[
  {
    "path": ".changeset/README.md",
    "content": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works\nwith multi-package repos, or single-package repos to help you version and publish your code. You can\nfind the full documentation for it [in our repository](https://github.com/changesets/changesets)\n\nWe have a quick list of common questions to get you started engaging with this project in\n[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)\n"
  },
  {
    "path": ".changeset/config.json",
    "content": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@2.3.0/schema.json\",\n  \"changelog\": \"@changesets/cli/changelog\",\n  \"commit\": false,\n  \"fixed\": [],\n  \"linked\": [],\n  \"access\": \"public\",\n  \"baseBranch\": \"main\",\n  \"updateInternalDependencies\": \"patch\",\n  \"ignore\": [\"@aws-smithy/*\"],\n  \"privatePackages\": {\n    \"tag\": false,\n    \"version\": false\n  }\n}\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  parser: \"@typescript-eslint/parser\", // Specifies the ESLint parser\n  parserOptions: {\n    ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features\n    sourceType: \"module\", // Allows for the use of imports\n  },\n  extends: [\n    // Uses the recommended rules from the @typescript-eslint/eslint-plugin\n    \"plugin:@typescript-eslint/recommended\",\n  ],\n  plugins: [\"@typescript-eslint\", \"n\"],\n  rules: {\n    /** Turn off strict enforcement */\n    \"@typescript-eslint/ban-types\": \"off\",\n    \"@typescript-eslint/ban-ts-comment\": \"off\",\n    \"@typescript-eslint/no-var-requires\": \"off\",\n    \"@typescript-eslint/no-empty-function\": \"off\",\n    \"@typescript-eslint/no-empty-interface\": \"off\",\n    \"@typescript-eslint/no-explicit-any\": \"off\",\n    \"@typescript-eslint/explicit-module-boundary-types\": \"off\",\n    \"prefer-rest-params\": \"off\",\n    \"@typescript-eslint/no-non-null-assertion\": \"off\",\n\n    // intentional usage\n    \"@typescript-eslint/no-empty-object-type\": \"off\",\n    \"@typescript-eslint/no-unsafe-function-type\": \"off\",\n\n    // temporary until upgrading ESLint\n    \"@typescript-eslint/no-unused-vars\": \"off\",\n    \"@typescript-eslint/no-require-imports\": \"off\",\n\n    /** Warnings */\n    \"@typescript-eslint/no-namespace\": \"warn\",\n\n    /** Errors */\n    \"@typescript-eslint/consistent-type-imports\": \"error\",\n    \"@typescript-eslint/no-import-type-side-effects\": \"error\",\n    \"n/prefer-node-protocol\": \"error\",\n  },\n  overrides: [\n    {\n      files: [\"packages/*/src/**/*.ts\"],\n      excludedFiles: [\"packages/*/src/**/*.spec.ts\"],\n      rules: {\n        \"no-restricted-imports\": [\n          \"error\",\n          {\n            patterns: [\n              {\n                group: [\"*src*\", \"*dist-*\"],\n              },\n              {\n                group: [\n                  \"@smithy/util-hex-encoding\",\n                  \"@smithy/util-base64\",\n                  \"@smithy/util-body-length-browser\",\n                  \"@smithy/util-body-length-node\",\n                  \"@smithy/util-utf8\",\n                  \"@smithy/util-buffer-from\",\n                  \"@smithy/is-array-buffer\",\n                  \"@smithy/middleware-serde\",\n                  \"@smithy/hash-node\",\n                  \"@smithy/hash-blob-browser\",\n                  \"@smithy/hash-stream-node\",\n                  \"@smithy/md5-js\",\n                  \"@smithy/chunked-blob-reader\",\n                  \"@smithy/chunked-blob-reader-native\",\n                  \"@smithy/util-stream\",\n                  \"@smithy/uuid\",\n                ],\n                message: \"This package has been consolidated into @smithy/core/serde.\",\n              },\n              {\n                group: [\n                  \"@smithy/smithy-client\",\n                  \"@smithy/middleware-stack\",\n                  \"@smithy/util-middleware\",\n                  \"@smithy/invalid-dependency\",\n                  \"@smithy/util-waiter\",\n                ],\n                message: \"This package has been consolidated into @smithy/core/client.\",\n              },\n              {\n                group: [\n                  \"@smithy/config-resolver\",\n                  \"@smithy/util-config-provider\",\n                  \"@smithy/node-config-provider\",\n                  \"@smithy/shared-ini-file-loader\",\n                  \"@smithy/property-provider\",\n                  \"@smithy/util-defaults-mode-browser\",\n                  \"@smithy/util-defaults-mode-node\",\n                ],\n                message: \"This package has been consolidated into @smithy/core/config.\",\n              },\n              {\n                group: [\n                  \"@smithy/protocol-http\",\n                  \"@smithy/middleware-content-length\",\n                  \"@smithy/util-uri-escape\",\n                  \"@smithy/querystring-builder\",\n                  \"@smithy/querystring-parser\",\n                  \"@smithy/url-parser\",\n                ],\n                message: \"This package has been consolidated into @smithy/core/protocols.\",\n              },\n              {\n                group: [\"@smithy/util-retry\", \"@smithy/middleware-retry\", \"@smithy/service-error-classification\"],\n                message: \"This package has been consolidated into @smithy/core/retry.\",\n              },\n              {\n                group: [\"@smithy/util-endpoints\", \"@smithy/middleware-endpoint\"],\n                message: \"This package has been consolidated into @smithy/core/endpoints.\",\n              },\n              {\n                group: [\n                  \"@smithy/hash-blob-browser\",\n                  \"@smithy/hash-stream-node\",\n                  \"@smithy/md5-js\",\n                  \"@smithy/chunked-blob-reader\",\n                  \"@smithy/chunked-blob-reader-native\",\n                ],\n                message: \"This package has been consolidated into @smithy/core/checksum.\",\n              },\n              {\n                group: [\n                  \"@smithy/eventstream-codec\",\n                  \"@smithy/eventstream-serde-universal\",\n                  \"@smithy/eventstream-serde-browser\",\n                  \"@smithy/eventstream-serde-node\",\n                  \"@smithy/eventstream-serde-config-resolver\",\n                ],\n                message: \"This package has been consolidated into @smithy/core/event-streams.\",\n              },\n            ],\n          },\n        ],\n      },\n    },\n  ],\n};\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @smithy-lang/aws-sdk-js-team\n\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "*Issue #, if available:*\n\n*Description of changes:*\n\nIf one or more of the packages in the `/packages` directory has been modified, be sure `yarn changeset add` has been run and its output has\nbeen committed and included in this pull request. See CONTRIBUTING.md.\n\n---\nBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: ci\n\non:\n  push:\n    branches: [main]\n  pull_request:\n    branches: [main]\n\npermissions:\n  contents: read\n\njobs:\n  build:\n    runs-on: ${{ matrix.os }}\n    name: Java ${{ matrix.java }} ${{ matrix.os }}\n    strategy:\n      matrix:\n        java: [17]\n        os: [macos-latest, ubuntu-latest, windows-latest]\n\n    steps:\n      - uses: actions/checkout@v5\n\n      - name: Set up JDK ${{ matrix.java }}\n        uses: actions/setup-java@v5\n        with:\n          java-version: ${{ matrix.java }}\n          distribution: \"corretto\"\n\n      - name: Setup Gradle\n        uses: gradle/actions/setup-gradle@v5\n        with:\n          cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}\n\n      - name: clean and build\n        run: ./gradlew clean build -Plog-tests\n\n      - name: publish\n        run: ./gradlew publish\n\n  protocol-tests:\n    runs-on: ${{ matrix.os }}\n    name: Protocol Tests\n    strategy:\n      matrix:\n        java: [17]\n        os: [ubuntu-latest]\n\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 22\n          cache: \"yarn\"\n\n      - name: Set up JDK ${{ matrix.java }}\n        uses: actions/setup-java@v5\n        with:\n          java-version: ${{ matrix.java }}\n          distribution: \"corretto\"\n\n      - name: Setup Gradle\n        uses: gradle/actions/setup-gradle@v5\n        with:\n          cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}\n\n      - name: clean and build\n        run: ./gradlew clean build -Plog-tests\n      - name: Install dependencies\n        run: |\n          yarn\n          yarn turbo telemetry disable\n      - name: Build packages\n        run: node ./scripts/retry -- yarn build\n      - name: Run protocol tests\n        run: node ./scripts/retry -- yarn test:protocols\n\n  lint-typescript:\n    runs-on: ubuntu-latest\n    name: TypeScript Lint\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 22\n          cache: \"yarn\"\n      - name: Install dependencies\n        run: yarn\n      - name: Run eslint\n        run: yarn lint --concurrency=3\n\n  test-typescript:\n    runs-on: smithy-typescript_ubuntu-latest_8-core\n    name: TypeScript Test ${{ matrix.node }}\n    needs: [\"ensure-typescript-packages-have-changesets\", \"lint-typescript\", \"ensure-typescript-formatted\"]\n    strategy:\n      fail-fast: false\n      matrix:\n        node: [18, 20, 22, 24, 26]\n\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: ${{ matrix.node }}\n          cache: \"yarn\"\n      - name: Set up JDK 17\n        uses: actions/setup-java@v5\n        with:\n          java-version: \"17\"\n          distribution: \"corretto\"\n      - name: Setup Gradle\n        uses: gradle/actions/setup-gradle@v5\n        with:\n          cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}\n      - name: Install dependencies\n        run: |\n          yarn\n          yarn turbo telemetry disable\n      - name: Build and validate API snapshot\n        run: node ./scripts/retry -- make api-snapshot\n      - name: Run unit tests\n        run: node ./scripts/retry -- yarn test\n      - name: Run integration tests\n        run: |\n          yarn config set enableImmutableInstalls false\n          node ./scripts/retry -- yarn test:integration\n\n  extract-docs:\n    runs-on: smithy-typescript_ubuntu-latest_8-core\n    name: Extract Docs\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 22\n          cache: \"yarn\"\n      - name: Install dependencies\n        run: |\n          yarn\n          yarn turbo telemetry disable\n      - name: Build packages\n        run: node ./scripts/retry -- yarn build\n      - name: Run API Extractor\n        run: yarn extract:docs\n\n  ensure-typescript-formatted:\n    runs-on: ubuntu-latest\n    name: Ensure TypeScript is formatted\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 22\n          cache: \"yarn\"\n      - name: Install dependencies\n        run: yarn\n      - name: Run the code formatter\n        run: yarn format\n      # This checks the output of git diff. If it's not empty (i.e there were\n      # changes) it'll return a non-zero error code.\n      - name: Ensure there are no changes from running the formatter\n        run: |\n          git diff\n          test -z \"$(git diff)\"\n\n  ensure-typescript-packages-have-changesets:\n    runs-on: ubuntu-latest\n    name: Ensure TypeScript packages have changesets\n    steps:\n      - uses: actions/checkout@v5\n        # Include full git history needed for `yarn changeset status`\n        with:\n          ref: ${{github.event.pull_request.head.sha}}\n          fetch-depth: 0\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 22\n          cache: \"yarn\"\n      - name: Install\n        run: yarn\n      - name: Ensure changesets exist for each changed package\n        run: yarn changeset status --since=origin/main\n"
  },
  {
    "path": ".github/workflows/git-sync.yml",
    "content": "name: git-sync-with-mirror\n\non:\n  push:\n    branches: [main]\n  workflow_dispatch:\n\npermissions:\n  contents: read\n\njobs:\n  git-sync:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: git-sync\n        env:\n          git_sync_source_repo: ${{ secrets.GIT_SYNC_SOURCE_REPO }}\n          git_sync_destination_repo: ${{ secrets.GIT_SYNC_DESTINATION_REPO }}\n        if: env.git_sync_source_repo && env.git_sync_destination_repo\n        uses: wei/git-sync@v3\n        with:\n          source_repo: ${{ secrets.GIT_SYNC_SOURCE_REPO }}\n          source_branch: \"main\"\n          destination_repo: ${{ secrets.GIT_SYNC_DESTINATION_REPO }}\n          destination_branch: \"main\"\n          source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}\n          destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}\n"
  },
  {
    "path": ".github/workflows/release-npm-packages.yml",
    "content": "name: release-npm-packages\n\non:\n  workflow_dispatch: # on button click\n\njobs:\n  release:\n    name: Release TypeScript packages to NPM\n    runs-on: ubuntu-latest\n    permissions:\n      id-token: write\n      contents: write\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 18\n          cache: \"yarn\"\n      - name: Install dependencies\n        run: yarn install\n      - name: Version\n        id: version\n        run: |\n          yarn changeset version\n          echo \"porcelain=$(git status --porcelain | wc -l)\" >> $GITHUB_OUTPUT\n      - name: Configure AWS Credentials\n        id: credentials\n        uses: aws-actions/configure-aws-credentials@v4\n        with:\n          aws-region: us-west-2\n          role-to-assume: ${{ secrets.JS_TEAM_ROLE_TO_ASSUME }}\n          role-session-name: SmithyTypeScriptGitHubRelease\n          audience: sts.amazonaws.com\n      - name: Configure deploy key for push\n        if: steps.version.outputs.porcelain != '0'\n        run: |\n          deploy_key=$(aws secretsmanager get-secret-value \\\n            --region us-west-2 \\\n            --secret-id ${{ secrets.DEPLOY_KEY_SECRET_ARN }} \\\n            --query SecretString --output text)\n          echo \"::add-mask::$deploy_key\"\n          mkdir -p ~/.ssh\n          echo \"$deploy_key\" > ~/.ssh/deploy_key\n          chmod 600 ~/.ssh/deploy_key\n          ssh-keyscan github.com >> ~/.ssh/known_hosts 2>/dev/null\n          git remote set-url origin git@github.com:smithy-lang/smithy-typescript.git\n          git config core.sshCommand \"ssh -i ~/.ssh/deploy_key -o IdentitiesOnly=yes\"\n      - name: Commit\n        id: commit\n        if: steps.version.outputs.porcelain != '0'\n        run: |\n          git config --global user.email \"github-aws-smithy-automation@amazon.com\"\n          git config --global user.name \"Smithy Automation\"\n          git add .\n          git commit -m 'Version NPM packages'\n          git push\n      - name: Fetch NPM token\n        id: token\n        if: steps.commit.outcome == 'success'\n        run: |\n          aws configure --profile token set role_arn ${{ secrets.JS_TEAM_TOKEN_ROLE }}\n          aws configure --profile token set credential_source Environment\n          npm_token=$(aws secretsmanager get-secret-value --region us-west-2 --secret-id=smithy-typescript-npm-token --query SecretString --output text --profile token)\n          echo \"::add-mask::$npm_token\"\n          echo \"NPM_TOKEN=$npm_token\" >> $GITHUB_ENV\n      - name: Stage Release\n        id: stage\n        if: steps.token.outcome == 'success'\n        run: |\n          yarn stage-release --concurrency=1\n      - name: Release\n        id: release\n        uses: changesets/action@v1\n        if: steps.stage.outcome == 'success'\n        with:\n          publish: yarn release\n        env:\n          NPM_TOKEN: ${{ env.NPM_TOKEN }}\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      - name: Failure Nofitication\n        if: ${{ failure() }}\n        run: aws cloudwatch put-metric-data --namespace SmithyTypeScriptPublish --metric-name NpmPackagePublishFailure --value 1\n"
  },
  {
    "path": ".github/workflows/release-npm-ssdk-libs.yml",
    "content": "name: release-npm-ssdk-libs\n\non:\n  workflow_dispatch: # on button click\n\njobs:\n  release:\n    name: Release to SSDK lib packages to NPM\n    runs-on: ubuntu-latest\n    permissions:\n      id-token: write\n      contents: write\n    steps:\n      - uses: actions/checkout@v5\n      - uses: actions/setup-node@v5\n        with:\n          node-version: 18\n          cache: \"yarn\"\n      - name: Install dependencies\n        run: yarn install\n      - name: Configure AWS Credentials\n        id: credentials\n        uses: aws-actions/configure-aws-credentials@v4\n        with:\n          aws-region: us-west-2\n          role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}\n          role-session-name: SmithyTypeScriptGitHubRelease\n          audience: sts.amazonaws.com\n      - name: Fetch NPM token\n        id: token\n        run: |\n          aws configure --profile token set role_arn ${{ secrets.TOKEN_ROLE }}\n          aws configure --profile token set credential_source Environment\n          npm_token=$(aws secretsmanager get-secret-value --region us-west-2 --secret-id=SMITHY_PUBLISH_npmToken --query SecretString --output text --profile token)\n          echo \"::add-mask::$npm_token\"\n          echo \"NPM_TOKEN=$npm_token\" >> $GITHUB_ENV\n      - name: Stage Release\n        id: stage\n        if: steps.token.outcome == 'success'\n        run: |\n          yarn stage-release --concurrency=1\n      - name: Release\n        id: release\n        uses: changesets/action@v1\n        if: steps.stage.outcome == 'success'\n        with:\n          publish: yarn release\n        env:\n          NPM_TOKEN: ${{ env.NPM_TOKEN }}\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      - name: Failure Nofitication\n        if: ${{ failure() }}\n        run: aws cloudwatch put-metric-data --namespace SmithyTypeScriptPublish --metric-name NpmPackagePublishFailure --value 1"
  },
  {
    "path": ".github/workflows/update-smithy-gradle-plugin.yml",
    "content": "name: Get latest smithy gradle plugin version\non:\n  workflow_dispatch: # on button click\n  # Uncomment once permissions to create PRs has been added.\n  schedule:\n    # Runs every wednesday at 11\n    - cron:  '0 11 * * WED'\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  get-version:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v5\n\n      - name: Fetch latest smithy-gradle-plugin version\n        id: fetch-latest\n        run: |\n          echo \"latestSmithyGradle=$( \\\n           curl -sL https://api.github.com/repos/smithy-lang/smithy-gradle-plugin/tags | \\\n           jq -r '.[0].name')\" >> $GITHUB_OUTPUT\n      - name: Get current version\n        id: get-current\n        run: |\n          cat gradle.properties >> $GITHUB_OUTPUT\n      - name: Check if the current version of smithy-gradle-plugin should be updated\n        id: update-check\n        run: |\n          echo update-required=$( \\\n          [ \"${{ steps.get-current.outputs.smithyGradleVersion }}\" = \"${{ steps.fetch-latest.outputs.latestSmithyGradle }}\" ] \\\n          && echo \"false\" || echo \"true\") >> $GITHUB_OUTPUT\n      - name: Set up new git branch for version bump\n        id: git-setup\n        if: steps.update-check.outputs.update-required == 'true'\n        run: |\n          git checkout -b \"automation/bump-smithy-gradle-version/${{ steps.fetch-latest.outputs.latestSmithyGradle }}\"\n          git config --global user.email \"github-aws-smithy-automation@amazon.com\"\n          git config --global user.name \"Smithy Automation\"\n      - name: Find and replace gradle version in properties files\n        id: replace-current-version-properties\n        if: steps.update-check.outputs.update-required == 'true'\n        run: |\n          find . -type f -name 'gradle.properties' \\\n          -exec sed -i \"s|smithyGradleVersion=${{ steps.get-current.outputs.smithyGradleVersion }}|smithyGradleVersion=${{ steps.fetch-latest.outputs.latestSmithyGradle }}|g\" {} \\;\n      - name: Create PR\n        if: steps.update-check.outputs.update-required == 'true'\n        run: |\n          git add .\n          git commit -m 'Update smithy-gradle-plugin Version'\n          git push --set-upstream origin \"automation/bump-smithy-gradle-version/${{ steps.fetch-latest.outputs.latestSmithyGradle }}\"\n          gh pr create \\\n            --title \"[Automation] smithy-gradle-plugin Version Bump - \\`${{ steps.fetch-latest.outputs.latestSmithyGradle }}\\`\" \\\n            --body \"Automated pull request to bump smithy gradle plugin version from ${{ steps.get-current.outputs.smithyGradleVersion }} to ${{ steps.fetch-latest.outputs.latestSmithyGradle }}\" \\\n            --base main\n          echo \"PR Created for version bump to ${{ steps.fetch-latest.outputs.latestSmithyGradle }}\"\n        env:\n          GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Eclipse\n.classpath\n.project\n.settings/\n\n# Intellij\n.idea/\n*.iml\n*.iws\n\n# Mac\n.DS_Store\n\n# Maven\ntarget/\n**/dependency-reduced-pom.xml\n\n# Gradle\n/.gradle\nbuild/\n*/out/\n*/*/out/\nwrapper/\n.attach_pid*\n\n# local scripting\nworkspace\n\n# Visual Studio Code\n.vscode/*\n\n# Integ test Yarn stuff\nsmithy-typescript-integ-tests/dist\nsmithy-typescript-integ-tests/node_modules\nsmithy-typescript-integ-tests/yarn.lock\n\n# Issue https://github.com/smithy-lang/smithy-typescript/issues/425\nsmithy-typescript-codegen/bin/\nsmithy-typescript-codegen-test/bin/\nsmithy-typescript-ssdk-codegen-test-utils/bin/\nsmithy-typescript-codegen-test/example-weather-customizations/bin/\n\ntestbed/bundlers/dist\ntestbed/bundlers/dist-*\n**/node_modules/\n**/*.tsbuildinfo\n**/*.d.ts\n**/yarn-error.log\ncoverage\n**/.turbo\ndist-*\n*.tsbuildinfo\n.pnp.*\n.yarn/*\n!.yarn/patches\n!.yarn/plugins\n!.yarn/releases\n!.yarn/sdks\n!.yarn/versions\n\n# NPM release staging\n.release\n\n# Gradle composite build properties\nlocal.properties\n\n# doc-gen\napi-extractor-packages"
  },
  {
    "path": ".prettierignore",
    "content": "./packages/**/dist/*\n./packages/**/dist-types/*\n./packages/**/dist-es/*\n./packages/**/dist-cjs/*\n**/dist/*\n**/dist-types/*\n**/dist-es/*\n**/dist-cjs/*\n"
  },
  {
    "path": ".yarn/releases/yarn-4.10.3.cjs",
    "content": "#!/usr/bin/env node\n/* eslint-disable */\n//prettier-ignore\n(()=>{var DGe=Object.create;var dU=Object.defineProperty;var PGe=Object.getOwnPropertyDescriptor;var bGe=Object.getOwnPropertyNames;var xGe=Object.getPrototypeOf,kGe=Object.prototype.hasOwnProperty;var Ie=(t=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(t,{get:(e,r)=>(typeof require<\"u\"?require:e)[r]}):t)(function(t){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+t+'\" is not supported')});var Ze=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Vt=(t,e)=>{for(var r in e)dU(t,r,{get:e[r],enumerable:!0})},QGe=(t,e,r,s)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let a of bGe(e))!kGe.call(t,a)&&a!==r&&dU(t,a,{get:()=>e[a],enumerable:!(s=PGe(e,a))||s.enumerable});return t};var ut=(t,e,r)=>(r=t!=null?DGe(xGe(t)):{},QGe(e||!t||!t.__esModule?dU(r,\"default\",{value:t,enumerable:!0}):r,t));var fi={};Vt(fi,{SAFE_TIME:()=>HX,S_IFDIR:()=>Jb,S_IFLNK:()=>Kb,S_IFMT:()=>Mf,S_IFREG:()=>N2});var Mf,Jb,N2,Kb,HX,jX=Ze(()=>{Mf=61440,Jb=16384,N2=32768,Kb=40960,HX=456789e3});var or={};Vt(or,{EBADF:()=>Mo,EBUSY:()=>RGe,EEXIST:()=>MGe,EINVAL:()=>FGe,EISDIR:()=>LGe,ENOENT:()=>NGe,ENOSYS:()=>TGe,ENOTDIR:()=>OGe,ENOTEMPTY:()=>_Ge,EOPNOTSUPP:()=>HGe,EROFS:()=>UGe,ERR_DIR_CLOSED:()=>mU});function Cc(t,e){return Object.assign(new Error(`${t}: ${e}`),{code:t})}function RGe(t){return Cc(\"EBUSY\",t)}function TGe(t,e){return Cc(\"ENOSYS\",`${t}, ${e}`)}function FGe(t){return Cc(\"EINVAL\",`invalid argument, ${t}`)}function Mo(t){return Cc(\"EBADF\",`bad file descriptor, ${t}`)}function NGe(t){return Cc(\"ENOENT\",`no such file or directory, ${t}`)}function OGe(t){return Cc(\"ENOTDIR\",`not a directory, ${t}`)}function LGe(t){return Cc(\"EISDIR\",`illegal operation on a directory, ${t}`)}function MGe(t){return Cc(\"EEXIST\",`file already exists, ${t}`)}function UGe(t){return Cc(\"EROFS\",`read-only filesystem, ${t}`)}function _Ge(t){return Cc(\"ENOTEMPTY\",`directory not empty, ${t}`)}function HGe(t){return Cc(\"EOPNOTSUPP\",`operation not supported, ${t}`)}function mU(){return Cc(\"ERR_DIR_CLOSED\",\"Directory handle was closed\")}var zb=Ze(()=>{});var $a={};Vt($a,{BigIntStatsEntry:()=>iE,DEFAULT_MODE:()=>IU,DirEntry:()=>yU,StatEntry:()=>nE,areStatsEqual:()=>CU,clearStats:()=>Zb,convertToBigIntStats:()=>GGe,makeDefaultStats:()=>GX,makeEmptyStats:()=>jGe});function GX(){return new nE}function jGe(){return Zb(GX())}function Zb(t){for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];typeof r==\"number\"?t[e]=0:typeof r==\"bigint\"?t[e]=BigInt(0):EU.types.isDate(r)&&(t[e]=new Date(0))}return t}function GGe(t){let e=new iE;for(let r in t)if(Object.hasOwn(t,r)){let s=t[r];typeof s==\"number\"?e[r]=BigInt(s):EU.types.isDate(s)&&(e[r]=new Date(s))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function CU(t,e){if(t.atimeMs!==e.atimeMs||t.birthtimeMs!==e.birthtimeMs||t.blksize!==e.blksize||t.blocks!==e.blocks||t.ctimeMs!==e.ctimeMs||t.dev!==e.dev||t.gid!==e.gid||t.ino!==e.ino||t.isBlockDevice()!==e.isBlockDevice()||t.isCharacterDevice()!==e.isCharacterDevice()||t.isDirectory()!==e.isDirectory()||t.isFIFO()!==e.isFIFO()||t.isFile()!==e.isFile()||t.isSocket()!==e.isSocket()||t.isSymbolicLink()!==e.isSymbolicLink()||t.mode!==e.mode||t.mtimeMs!==e.mtimeMs||t.nlink!==e.nlink||t.rdev!==e.rdev||t.size!==e.size||t.uid!==e.uid)return!1;let r=t,s=e;return!(r.atimeNs!==s.atimeNs||r.mtimeNs!==s.mtimeNs||r.ctimeNs!==s.ctimeNs||r.birthtimeNs!==s.birthtimeNs)}var EU,IU,yU,nE,iE,wU=Ze(()=>{EU=ut(Ie(\"util\")),IU=33188,yU=class{constructor(){this.name=\"\";this.path=\"\";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},nE=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=IU;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},iE=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(IU);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(61440))===BigInt(16384)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(61440))===BigInt(32768)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(61440))===BigInt(40960)}}});function JGe(t){let e,r;if(e=t.match(YGe))t=e[1];else if(r=t.match(VGe))t=`\\\\\\\\${r[1]?\".\\\\\":\"\"}${r[2]}`;else return t;return t.replace(/\\//g,\"\\\\\")}function KGe(t){t=t.replace(/\\\\/g,\"/\");let e,r;return(e=t.match(qGe))?t=`/${e[1]}`:(r=t.match(WGe))&&(t=`/unc/${r[1]?\".dot/\":\"\"}${r[2]}`),t}function Xb(t,e){return t===fe?WX(e):BU(e)}var O2,vt,Er,fe,J,qX,qGe,WGe,YGe,VGe,BU,WX,el=Ze(()=>{O2=ut(Ie(\"path\")),vt={root:\"/\",dot:\".\",parent:\"..\"},Er={home:\"~\",nodeModules:\"node_modules\",manifest:\"package.json\",lockfile:\"yarn.lock\",virtual:\"__virtual__\",pnpJs:\".pnp.js\",pnpCjs:\".pnp.cjs\",pnpData:\".pnp.data.json\",pnpEsmLoader:\".pnp.loader.mjs\",rc:\".yarnrc.yml\",env:\".env\"},fe=Object.create(O2.default),J=Object.create(O2.default.posix);fe.cwd=()=>process.cwd();J.cwd=process.platform===\"win32\"?()=>BU(process.cwd()):process.cwd;process.platform===\"win32\"&&(J.resolve=(...t)=>t.length>0&&J.isAbsolute(t[0])?O2.default.posix.resolve(...t):O2.default.posix.resolve(J.cwd(),...t));qX=function(t,e,r){return e=t.normalize(e),r=t.normalize(r),e===r?\".\":(e.endsWith(t.sep)||(e=e+t.sep),r.startsWith(e)?r.slice(e.length):null)};fe.contains=(t,e)=>qX(fe,t,e);J.contains=(t,e)=>qX(J,t,e);qGe=/^([a-zA-Z]:.*)$/,WGe=/^\\/\\/(\\.\\/)?(.*)$/,YGe=/^\\/([a-zA-Z]:.*)$/,VGe=/^\\/unc\\/(\\.dot\\/)?(.*)$/;BU=process.platform===\"win32\"?KGe:t=>t,WX=process.platform===\"win32\"?JGe:t=>t;fe.fromPortablePath=WX;fe.toPortablePath=BU});async function $b(t,e){let r=\"0123456789abcdef\";await t.mkdirPromise(e.indexPath,{recursive:!0});let s=[];for(let a of r)for(let n of r)s.push(t.mkdirPromise(t.pathUtils.join(e.indexPath,`${a}${n}`),{recursive:!0}));return await Promise.all(s),e.indexPath}async function YX(t,e,r,s,a){let n=t.pathUtils.normalize(e),c=r.pathUtils.normalize(s),f=[],p=[],{atime:h,mtime:E}=a.stableTime?{atime:dd,mtime:dd}:await r.lstatPromise(c);await t.mkdirpPromise(t.pathUtils.dirname(e),{utimes:[h,E]}),await vU(f,p,t,n,r,c,{...a,didParentExist:!0});for(let C of f)await C();await Promise.all(p.map(C=>C()))}async function vU(t,e,r,s,a,n,c){let f=c.didParentExist?await VX(r,s):null,p=await a.lstatPromise(n),{atime:h,mtime:E}=c.stableTime?{atime:dd,mtime:dd}:p,C;switch(!0){case p.isDirectory():C=await ZGe(t,e,r,s,f,a,n,p,c);break;case p.isFile():C=await eqe(t,e,r,s,f,a,n,p,c);break;case p.isSymbolicLink():C=await tqe(t,e,r,s,f,a,n,p,c);break;default:throw new Error(`Unsupported file type (${p.mode})`)}return(c.linkStrategy?.type!==\"HardlinkFromIndex\"||!p.isFile())&&((C||f?.mtime?.getTime()!==E.getTime()||f?.atime?.getTime()!==h.getTime())&&(e.push(()=>r.lutimesPromise(s,h,E)),C=!0),(f===null||(f.mode&511)!==(p.mode&511))&&(e.push(()=>r.chmodPromise(s,p.mode&511)),C=!0)),C}async function VX(t,e){try{return await t.lstatPromise(e)}catch{return null}}async function ZGe(t,e,r,s,a,n,c,f,p){if(a!==null&&!a.isDirectory())if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1;let h=!1;a===null&&(t.push(async()=>{try{await r.mkdirPromise(s,{mode:f.mode})}catch(S){if(S.code!==\"EEXIST\")throw S}}),h=!0);let E=await n.readdirPromise(c),C=p.didParentExist&&!a?{...p,didParentExist:!1}:p;if(p.stableSort)for(let S of E.sort())await vU(t,e,r,r.pathUtils.join(s,S),n,n.pathUtils.join(c,S),C)&&(h=!0);else(await Promise.all(E.map(async b=>{await vU(t,e,r,r.pathUtils.join(s,b),n,n.pathUtils.join(c,b),C)}))).some(b=>b)&&(h=!0);return h}async function XGe(t,e,r,s,a,n,c,f,p,h){let E=await n.checksumFilePromise(c,{algorithm:\"sha1\"}),C=420,S=f.mode&511,b=`${E}${S!==C?S.toString(8):\"\"}`,I=r.pathUtils.join(h.indexPath,E.slice(0,2),`${b}.dat`),T;(le=>(le[le.Lock=0]=\"Lock\",le[le.Rename=1]=\"Rename\"))(T||={});let N=1,U=await VX(r,I);if(a){let ie=U&&a.dev===U.dev&&a.ino===U.ino,ue=U?.mtimeMs!==zGe;if(ie&&ue&&h.autoRepair&&(N=0,U=null),!ie)if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1}let W=!U&&N===1?`${I}.${Math.floor(Math.random()*4294967296).toString(16).padStart(8,\"0\")}`:null,ee=!1;return t.push(async()=>{if(!U&&(N===0&&await r.lockPromise(I,async()=>{let ie=await n.readFilePromise(c);await r.writeFilePromise(I,ie)}),N===1&&W)){let ie=await n.readFilePromise(c);await r.writeFilePromise(W,ie);try{await r.linkPromise(W,I)}catch(ue){if(ue.code===\"EEXIST\")ee=!0,await r.unlinkPromise(W);else throw ue}}a||await r.linkPromise(I,s)}),e.push(async()=>{U||(await r.lutimesPromise(I,dd,dd),S!==C&&await r.chmodPromise(I,S)),W&&!ee&&await r.unlinkPromise(W)}),!1}async function $Ge(t,e,r,s,a,n,c,f,p){if(a!==null)if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1;return t.push(async()=>{let h=await n.readFilePromise(c);await r.writeFilePromise(s,h)}),!0}async function eqe(t,e,r,s,a,n,c,f,p){return p.linkStrategy?.type===\"HardlinkFromIndex\"?XGe(t,e,r,s,a,n,c,f,p,p.linkStrategy):$Ge(t,e,r,s,a,n,c,f,p)}async function tqe(t,e,r,s,a,n,c,f,p){if(a!==null)if(p.overwrite)t.push(async()=>r.removePromise(s)),a=null;else return!1;return t.push(async()=>{await r.symlinkPromise(Xb(r.pathUtils,await n.readlinkPromise(c)),s)}),!0}var dd,zGe,SU=Ze(()=>{el();dd=new Date(456789e3*1e3),zGe=dd.getTime()});function ex(t,e,r,s){let a=()=>{let n=r.shift();if(typeof n>\"u\")return null;let c=t.pathUtils.join(e,n);return Object.assign(t.statSync(c),{name:n,path:void 0})};return new L2(e,a,s)}var L2,JX=Ze(()=>{zb();L2=class{constructor(e,r,s={}){this.path=e;this.nextDirent=r;this.opts=s;this.closed=!1}throwIfClosed(){if(this.closed)throw mU()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.read())!==null;)yield e}finally{await this.close()}}read(e){let r=this.readSync();return typeof e<\"u\"?e(null,r):Promise.resolve(r)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(e){return this.closeSync(),typeof e<\"u\"?e(null):Promise.resolve()}closeSync(){this.throwIfClosed(),this.opts.onClose?.(),this.closed=!0}}});function KX(t,e){if(t!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${t}'`)}var zX,tx,ZX=Ze(()=>{zX=Ie(\"events\");wU();tx=class t extends zX.EventEmitter{constructor(r,s,{bigint:a=!1}={}){super();this.status=\"ready\";this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=r,this.path=s,this.bigint=a,this.lastStats=this.stat()}static create(r,s,a){let n=new t(r,s,a);return n.start(),n}start(){KX(this.status,\"ready\"),this.status=\"running\",this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit(\"change\",this.lastStats,this.lastStats)},3)}stop(){KX(this.status,\"running\"),this.status=\"stopped\",this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit(\"stop\")}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch{let r=this.bigint?new iE:new nE;return Zb(r)}}makeInterval(r){let s=setInterval(()=>{let a=this.stat(),n=this.lastStats;CU(a,n)||(this.lastStats=a,this.emit(\"change\",a,n))},r.interval);return r.persistent?s:s.unref()}registerChangeListener(r,s){this.addListener(\"change\",r),this.changeListeners.set(r,this.makeInterval(s))}unregisterChangeListener(r){this.removeListener(\"change\",r);let s=this.changeListeners.get(r);typeof s<\"u\"&&clearInterval(s),this.changeListeners.delete(r)}unregisterAllChangeListeners(){for(let r of this.changeListeners.keys())this.unregisterChangeListener(r)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let r of this.changeListeners.values())r.ref();return this}unref(){for(let r of this.changeListeners.values())r.unref();return this}}});function sE(t,e,r,s){let a,n,c,f;switch(typeof r){case\"function\":a=!1,n=!0,c=5007,f=r;break;default:({bigint:a=!1,persistent:n=!0,interval:c=5007}=r),f=s;break}let p=rx.get(t);typeof p>\"u\"&&rx.set(t,p=new Map);let h=p.get(e);return typeof h>\"u\"&&(h=tx.create(t,e,{bigint:a}),p.set(e,h)),h.registerChangeListener(f,{persistent:n,interval:c}),h}function md(t,e,r){let s=rx.get(t);if(typeof s>\"u\")return;let a=s.get(e);typeof a>\"u\"||(typeof r>\"u\"?a.unregisterAllChangeListeners():a.unregisterChangeListener(r),a.hasChangeListeners()||(a.stop(),s.delete(e)))}function yd(t){let e=rx.get(t);if(!(typeof e>\"u\"))for(let r of e.keys())md(t,r)}var rx,DU=Ze(()=>{ZX();rx=new WeakMap});function rqe(t){let e=t.match(/\\r?\\n/g);if(e===null)return $X.EOL;let r=e.filter(a=>a===`\\r\n`).length,s=e.length-r;return r>s?`\\r\n`:`\n`}function Ed(t,e){return e.replace(/\\r?\\n/g,rqe(t))}var XX,$X,mp,Uf,Id=Ze(()=>{XX=Ie(\"crypto\"),$X=Ie(\"os\");SU();el();mp=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let s=[e];for(;s.length>0;){let a=s.shift();if((await this.lstatPromise(a)).isDirectory()){let c=await this.readdirPromise(a);if(r)for(let f of c.sort())s.push(this.pathUtils.join(a,f));else throw new Error(\"Not supported\")}else yield a}}async checksumFilePromise(e,{algorithm:r=\"sha512\"}={}){let s=await this.openPromise(e,\"r\");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,XX.createHash)(r),f=0;for(;(f=await this.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest(\"hex\")}finally{await this.closePromise(s)}}async removePromise(e,{recursive:r=!0,maxRetries:s=5}={}){let a;try{a=await this.lstatPromise(e)}catch(n){if(n.code===\"ENOENT\")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(e);await Promise.all(n.map(c=>this.removePromise(this.pathUtils.resolve(e,c))))}for(let n=0;n<=s;n++)try{await this.rmdirPromise(e);break}catch(c){if(c.code!==\"EBUSY\"&&c.code!==\"ENOTEMPTY\")throw c;n<s&&await new Promise(f=>setTimeout(f,n*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let s;try{s=this.lstatSync(e)}catch(a){if(a.code===\"ENOENT\")return;throw a}if(s.isDirectory()){if(r)for(let a of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,a));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:s}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{await this.mkdirPromise(f)}catch(p){if(p.code===\"EEXIST\")continue;throw p}if(n??=f,r!=null&&await this.chmodPromise(f,r),s!=null)await this.utimesPromise(f,s[0],s[1]);else{let p=await this.statPromise(this.pathUtils.dirname(f));await this.utimesPromise(f,p.atime,p.mtime)}}}return n}mkdirpSync(e,{chmod:r,utimes:s}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{this.mkdirSync(f)}catch(p){if(p.code===\"EEXIST\")continue;throw p}if(n??=f,r!=null&&this.chmodSync(f,r),s!=null)this.utimesSync(f,s[0],s[1]);else{let p=this.statSync(this.pathUtils.dirname(f));this.utimesSync(f,p.atime,p.mtime)}}}return n}async copyPromise(e,r,{baseFs:s=this,overwrite:a=!0,stableSort:n=!1,stableTime:c=!1,linkStrategy:f=null}={}){return await YX(this,e,s,r,{overwrite:a,stableSort:n,stableTime:c,linkStrategy:f})}copySync(e,r,{baseFs:s=this,overwrite:a=!0}={}){let n=s.lstatSync(r),c=this.existsSync(e);if(n.isDirectory()){this.mkdirpSync(e);let p=s.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(e,h),s.pathUtils.join(r,h),{baseFs:s,overwrite:a})}else if(n.isFile()){if(!c||a){c&&this.removeSync(e);let p=s.readFileSync(r);this.writeFileSync(e,p)}}else if(n.isSymbolicLink()){if(!c||a){c&&this.removeSync(e);let p=s.readlinkSync(r);this.symlinkSync(Xb(this.pathUtils,p),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,\"0\")})`);let f=n.mode&511;this.chmodSync(e,f)}async changeFilePromise(e,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,s):this.changeFileTextPromise(e,r,s)}async changeFileBufferPromise(e,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(e)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(e,r,{mode:s})}async changeFileTextPromise(e,r,{automaticNewlines:s,mode:a}={}){let n=\"\";try{n=await this.readFilePromise(e,\"utf8\")}catch{}let c=s?Ed(n,r):r;n!==c&&await this.writeFilePromise(e,c,{mode:a})}changeFileSync(e,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,s):this.changeFileTextSync(e,r,s)}changeFileBufferSync(e,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(e)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(e,r,{mode:s})}changeFileTextSync(e,r,{automaticNewlines:s=!1,mode:a}={}){let n=\"\";try{n=this.readFileSync(e,\"utf8\")}catch{}let c=s?Ed(n,r):r;n!==c&&this.writeFileSync(e,c,{mode:a})}async movePromise(e,r){try{await this.renamePromise(e,r)}catch(s){if(s.code===\"EXDEV\")await this.copyPromise(r,e),await this.removePromise(e);else throw s}}moveSync(e,r){try{this.renameSync(e,r)}catch(s){if(s.code===\"EXDEV\")this.copySync(r,e),this.removeSync(e);else throw s}}async lockPromise(e,r){let s=`${e}.flock`,a=1e3/60,n=Date.now(),c=null,f=async()=>{let p;try{[p]=await this.readJsonPromise(s)}catch{return Date.now()-n<500}try{return process.kill(p,0),!0}catch{return!1}};for(;c===null;)try{c=await this.openPromise(s,\"wx\")}catch(p){if(p.code===\"EEXIST\"){if(!await f())try{await this.unlinkPromise(s);continue}catch{}if(Date.now()-n<60*1e3)await new Promise(h=>setTimeout(h,a));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${s})`)}else throw p}await this.writePromise(c,JSON.stringify([process.pid]));try{return await r()}finally{try{await this.closePromise(c),await this.unlinkPromise(s)}catch{}}}async readJsonPromise(e){let r=await this.readFilePromise(e,\"utf8\");try{return JSON.parse(r)}catch(s){throw s.message+=` (in ${e})`,s}}readJsonSync(e){let r=this.readFileSync(e,\"utf8\");try{return JSON.parse(r)}catch(s){throw s.message+=` (in ${e})`,s}}async writeJsonPromise(e,r,{compact:s=!1}={}){let a=s?0:2;return await this.writeFilePromise(e,`${JSON.stringify(r,null,a)}\n`)}writeJsonSync(e,r,{compact:s=!1}={}){let a=s?0:2;return this.writeFileSync(e,`${JSON.stringify(r,null,a)}\n`)}async preserveTimePromise(e,r){let s=await this.lstatPromise(e),a=await r();typeof a<\"u\"&&(e=a),await this.lutimesPromise(e,s.atime,s.mtime)}async preserveTimeSync(e,r){let s=this.lstatSync(e),a=r();typeof a<\"u\"&&(e=a),this.lutimesSync(e,s.atime,s.mtime)}},Uf=class extends mp{constructor(){super(J)}}});var _s,yp=Ze(()=>{Id();_s=class extends mp{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,s){return this.baseFs.openPromise(this.mapToBase(e),r,s)}openSync(e,r,s){return this.baseFs.openSync(this.mapToBase(e),r,s)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,s,a,n){return await this.baseFs.readPromise(e,r,s,a,n)}readSync(e,r,s,a,n){return this.baseFs.readSync(e,r,s,a,n)}async writePromise(e,r,s,a,n){return typeof r==\"string\"?await this.baseFs.writePromise(e,r,s):await this.baseFs.writePromise(e,r,s,a,n)}writeSync(e,r,s,a,n){return typeof r==\"string\"?this.baseFs.writeSync(e,r,s):this.baseFs.writeSync(e,r,s,a,n)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async fchmodPromise(e,r){return this.baseFs.fchmodPromise(e,r)}fchmodSync(e,r){return this.baseFs.fchmodSync(e,r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async fchownPromise(e,r,s){return this.baseFs.fchownPromise(e,r,s)}fchownSync(e,r,s){return this.baseFs.fchownSync(e,r,s)}async chownPromise(e,r,s){return this.baseFs.chownPromise(this.mapToBase(e),r,s)}chownSync(e,r,s){return this.baseFs.chownSync(this.mapToBase(e),r,s)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,s=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),s)}copyFileSync(e,r,s=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),s)}async appendFilePromise(e,r,s){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,s)}appendFileSync(e,r,s){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,s)}async writeFilePromise(e,r,s){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,s)}writeFileSync(e,r,s){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,s)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,s){return this.baseFs.utimesPromise(this.mapToBase(e),r,s)}utimesSync(e,r,s){return this.baseFs.utimesSync(this.mapToBase(e),r,s)}async lutimesPromise(e,r,s){return this.baseFs.lutimesPromise(this.mapToBase(e),r,s)}lutimesSync(e,r,s){return this.baseFs.lutimesSync(this.mapToBase(e),r,s)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async rmPromise(e,r){return this.baseFs.rmPromise(this.mapToBase(e),r)}rmSync(e,r){return this.baseFs.rmSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,s){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),a,s);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),c=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkPromise(c,a,s)}symlinkSync(e,r,s){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),a,s);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),c=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkSync(c,a,s)}async readFilePromise(e,r){return this.baseFs.readFilePromise(this.fsMapToBase(e),r)}readFileSync(e,r){return this.baseFs.readFileSync(this.fsMapToBase(e),r)}readdirPromise(e,r){return this.baseFs.readdirPromise(this.mapToBase(e),r)}readdirSync(e,r){return this.baseFs.readdirSync(this.mapToBase(e),r)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,r){return this.baseFs.truncatePromise(this.mapToBase(e),r)}truncateSync(e,r){return this.baseFs.truncateSync(this.mapToBase(e),r)}async ftruncatePromise(e,r){return this.baseFs.ftruncatePromise(e,r)}ftruncateSync(e,r){return this.baseFs.ftruncateSync(e,r)}watch(e,r,s){return this.baseFs.watch(this.mapToBase(e),r,s)}watchFile(e,r,s){return this.baseFs.watchFile(this.mapToBase(e),r,s)}unwatchFile(e,r){return this.baseFs.unwatchFile(this.mapToBase(e),r)}fsMapToBase(e){return typeof e==\"number\"?e:this.mapToBase(e)}}});var _f,e$=Ze(()=>{yp();_f=class extends _s{constructor(e,{baseFs:r,pathUtils:s}){super(s),this.target=e,this.baseFs=r}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}}});function t$(t){let e=t;return typeof t.path==\"string\"&&(e.path=fe.toPortablePath(t.path)),e}var r$,Yn,Cd=Ze(()=>{r$=ut(Ie(\"fs\"));Id();el();Yn=class extends Uf{constructor(e=r$.default){super(),this.realFs=e}getExtractHint(){return!1}getRealPath(){return vt.root}resolve(e){return J.resolve(e)}async openPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.open(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}openSync(e,r,s){return this.realFs.openSync(fe.fromPortablePath(e),r,s)}async opendirPromise(e,r){return await new Promise((s,a)=>{typeof r<\"u\"?this.realFs.opendir(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.opendir(fe.fromPortablePath(e),this.makeCallback(s,a))}).then(s=>{let a=s;return Object.defineProperty(a,\"path\",{value:e,configurable:!0,writable:!0}),a})}opendirSync(e,r){let a=typeof r<\"u\"?this.realFs.opendirSync(fe.fromPortablePath(e),r):this.realFs.opendirSync(fe.fromPortablePath(e));return Object.defineProperty(a,\"path\",{value:e,configurable:!0,writable:!0}),a}async readPromise(e,r,s=0,a=0,n=-1){return await new Promise((c,f)=>{this.realFs.read(e,r,s,a,n,(p,h)=>{p?f(p):c(h)})})}readSync(e,r,s,a,n){return this.realFs.readSync(e,r,s,a,n)}async writePromise(e,r,s,a,n){return await new Promise((c,f)=>typeof r==\"string\"?this.realFs.write(e,r,s,this.makeCallback(c,f)):this.realFs.write(e,r,s,a,n,this.makeCallback(c,f)))}writeSync(e,r,s,a,n){return typeof r==\"string\"?this.realFs.writeSync(e,r,s):this.realFs.writeSync(e,r,s,a,n)}async closePromise(e){await new Promise((r,s)=>{this.realFs.close(e,this.makeCallback(r,s))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let s=e!==null?fe.fromPortablePath(e):e;return this.realFs.createReadStream(s,r)}createWriteStream(e,r){let s=e!==null?fe.fromPortablePath(e):e;return this.realFs.createWriteStream(s,r)}async realpathPromise(e){return await new Promise((r,s)=>{this.realFs.realpath(fe.fromPortablePath(e),{},this.makeCallback(r,s))}).then(r=>fe.toPortablePath(r))}realpathSync(e){return fe.toPortablePath(this.realFs.realpathSync(fe.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(fe.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(fe.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((s,a)=>{this.realFs.access(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}existsSync(e){return this.realFs.existsSync(fe.fromPortablePath(e))}async statPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.stat(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.stat(fe.fromPortablePath(e),this.makeCallback(s,a))})}statSync(e,r){return r?this.realFs.statSync(fe.fromPortablePath(e),r):this.realFs.statSync(fe.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.fstat(e,r,this.makeCallback(s,a)):this.realFs.fstat(e,this.makeCallback(s,a))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.lstat(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.lstat(fe.fromPortablePath(e),this.makeCallback(s,a))})}lstatSync(e,r){return r?this.realFs.lstatSync(fe.fromPortablePath(e),r):this.realFs.lstatSync(fe.fromPortablePath(e))}async fchmodPromise(e,r){return await new Promise((s,a)=>{this.realFs.fchmod(e,r,this.makeCallback(s,a))})}fchmodSync(e,r){return this.realFs.fchmodSync(e,r)}async chmodPromise(e,r){return await new Promise((s,a)=>{this.realFs.chmod(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}chmodSync(e,r){return this.realFs.chmodSync(fe.fromPortablePath(e),r)}async fchownPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.fchown(e,r,s,this.makeCallback(a,n))})}fchownSync(e,r,s){return this.realFs.fchownSync(e,r,s)}async chownPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.chown(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}chownSync(e,r,s){return this.realFs.chownSync(fe.fromPortablePath(e),r,s)}async renamePromise(e,r){return await new Promise((s,a)=>{this.realFs.rename(fe.fromPortablePath(e),fe.fromPortablePath(r),this.makeCallback(s,a))})}renameSync(e,r){return this.realFs.renameSync(fe.fromPortablePath(e),fe.fromPortablePath(r))}async copyFilePromise(e,r,s=0){return await new Promise((a,n)=>{this.realFs.copyFile(fe.fromPortablePath(e),fe.fromPortablePath(r),s,this.makeCallback(a,n))})}copyFileSync(e,r,s=0){return this.realFs.copyFileSync(fe.fromPortablePath(e),fe.fromPortablePath(r),s)}async appendFilePromise(e,r,s){return await new Promise((a,n)=>{let c=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.appendFile(c,r,s,this.makeCallback(a,n)):this.realFs.appendFile(c,r,this.makeCallback(a,n))})}appendFileSync(e,r,s){let a=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.appendFileSync(a,r,s):this.realFs.appendFileSync(a,r)}async writeFilePromise(e,r,s){return await new Promise((a,n)=>{let c=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.writeFile(c,r,s,this.makeCallback(a,n)):this.realFs.writeFile(c,r,this.makeCallback(a,n))})}writeFileSync(e,r,s){let a=typeof e==\"string\"?fe.fromPortablePath(e):e;s?this.realFs.writeFileSync(a,r,s):this.realFs.writeFileSync(a,r)}async unlinkPromise(e){return await new Promise((r,s)=>{this.realFs.unlink(fe.fromPortablePath(e),this.makeCallback(r,s))})}unlinkSync(e){return this.realFs.unlinkSync(fe.fromPortablePath(e))}async utimesPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.utimes(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}utimesSync(e,r,s){this.realFs.utimesSync(fe.fromPortablePath(e),r,s)}async lutimesPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.lutimes(fe.fromPortablePath(e),r,s,this.makeCallback(a,n))})}lutimesSync(e,r,s){this.realFs.lutimesSync(fe.fromPortablePath(e),r,s)}async mkdirPromise(e,r){return await new Promise((s,a)=>{this.realFs.mkdir(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}mkdirSync(e,r){return this.realFs.mkdirSync(fe.fromPortablePath(e),r)}async rmdirPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.rmdir(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.rmdir(fe.fromPortablePath(e),this.makeCallback(s,a))})}rmdirSync(e,r){return this.realFs.rmdirSync(fe.fromPortablePath(e),r)}async rmPromise(e,r){return await new Promise((s,a)=>{r?this.realFs.rm(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.rm(fe.fromPortablePath(e),this.makeCallback(s,a))})}rmSync(e,r){return this.realFs.rmSync(fe.fromPortablePath(e),r)}async linkPromise(e,r){return await new Promise((s,a)=>{this.realFs.link(fe.fromPortablePath(e),fe.fromPortablePath(r),this.makeCallback(s,a))})}linkSync(e,r){return this.realFs.linkSync(fe.fromPortablePath(e),fe.fromPortablePath(r))}async symlinkPromise(e,r,s){return await new Promise((a,n)=>{this.realFs.symlink(fe.fromPortablePath(e.replace(/\\/+$/,\"\")),fe.fromPortablePath(r),s,this.makeCallback(a,n))})}symlinkSync(e,r,s){return this.realFs.symlinkSync(fe.fromPortablePath(e.replace(/\\/+$/,\"\")),fe.fromPortablePath(r),s)}async readFilePromise(e,r){return await new Promise((s,a)=>{let n=typeof e==\"string\"?fe.fromPortablePath(e):e;this.realFs.readFile(n,r,this.makeCallback(s,a))})}readFileSync(e,r){let s=typeof e==\"string\"?fe.fromPortablePath(e):e;return this.realFs.readFileSync(s,r)}async readdirPromise(e,r){return await new Promise((s,a)=>{r?r.recursive&&process.platform===\"win32\"?r.withFileTypes?this.realFs.readdir(fe.fromPortablePath(e),r,this.makeCallback(n=>s(n.map(t$)),a)):this.realFs.readdir(fe.fromPortablePath(e),r,this.makeCallback(n=>s(n.map(fe.toPortablePath)),a)):this.realFs.readdir(fe.fromPortablePath(e),r,this.makeCallback(s,a)):this.realFs.readdir(fe.fromPortablePath(e),this.makeCallback(s,a))})}readdirSync(e,r){return r?r.recursive&&process.platform===\"win32\"?r.withFileTypes?this.realFs.readdirSync(fe.fromPortablePath(e),r).map(t$):this.realFs.readdirSync(fe.fromPortablePath(e),r).map(fe.toPortablePath):this.realFs.readdirSync(fe.fromPortablePath(e),r):this.realFs.readdirSync(fe.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((r,s)=>{this.realFs.readlink(fe.fromPortablePath(e),this.makeCallback(r,s))}).then(r=>fe.toPortablePath(r))}readlinkSync(e){return fe.toPortablePath(this.realFs.readlinkSync(fe.fromPortablePath(e)))}async truncatePromise(e,r){return await new Promise((s,a)=>{this.realFs.truncate(fe.fromPortablePath(e),r,this.makeCallback(s,a))})}truncateSync(e,r){return this.realFs.truncateSync(fe.fromPortablePath(e),r)}async ftruncatePromise(e,r){return await new Promise((s,a)=>{this.realFs.ftruncate(e,r,this.makeCallback(s,a))})}ftruncateSync(e,r){return this.realFs.ftruncateSync(e,r)}watch(e,r,s){return this.realFs.watch(fe.fromPortablePath(e),r,s)}watchFile(e,r,s){return this.realFs.watchFile(fe.fromPortablePath(e),r,s)}unwatchFile(e,r){return this.realFs.unwatchFile(fe.fromPortablePath(e),r)}makeCallback(e,r){return(s,a)=>{s?r(s):e(a)}}}});var Sn,n$=Ze(()=>{Cd();yp();el();Sn=class extends _s{constructor(e,{baseFs:r=new Yn}={}){super(J),this.target=this.pathUtils.normalize(e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?J.normalize(e):this.baseFs.resolve(J.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}}});var i$,Hf,s$=Ze(()=>{Cd();yp();el();i$=vt.root,Hf=class extends _s{constructor(e,{baseFs:r=new Yn}={}){super(J),this.target=this.pathUtils.resolve(vt.root,e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(vt.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let r=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(i$,e));if(r.match(/^\\.\\.\\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(i$,this.pathUtils.relative(this.target,e))}}});var oE,o$=Ze(()=>{yp();oE=class extends _s{constructor(r,s){super(s);this.instance=null;this.factory=r}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(r){this.instance=r}mapFromBase(r){return r}mapToBase(r){return r}}});var wd,tl,e0,a$=Ze(()=>{wd=Ie(\"fs\");Id();Cd();DU();zb();el();tl=4278190080,e0=class extends Uf{constructor({baseFs:r=new Yn,filter:s=null,magicByte:a=42,maxOpenFiles:n=1/0,useCache:c=!0,maxAge:f=5e3,typeCheck:p=wd.constants.S_IFREG,getMountPoint:h,factoryPromise:E,factorySync:C}){if(Math.floor(a)!==a||!(a>1&&a<=127))throw new Error(\"The magic byte must be set to a round value between 1 and 127 included\");super();this.fdMap=new Map;this.nextFd=3;this.isMount=new Set;this.notMount=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.baseFs=r,this.mountInstances=c?new Map:null,this.factoryPromise=E,this.factorySync=C,this.filter=s,this.getMountPoint=h,this.magic=a<<24,this.maxAge=f,this.maxOpenFiles=n,this.typeCheck=p}getExtractHint(r){return this.baseFs.getExtractHint(r)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(yd(this),this.mountInstances)for(let[r,{childFs:s}]of this.mountInstances.entries())s.saveAndClose?.(),this.mountInstances.delete(r)}discardAndClose(){if(yd(this),this.mountInstances)for(let[r,{childFs:s}]of this.mountInstances.entries())s.discardAndClose?.(),this.mountInstances.delete(r)}resolve(r){return this.baseFs.resolve(r)}remapFd(r,s){let a=this.nextFd++|this.magic;return this.fdMap.set(a,[r,s]),a}async openPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.openPromise(r,s,a),async(n,{subPath:c})=>this.remapFd(n,await n.openPromise(c,s,a)))}openSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.openSync(r,s,a),(n,{subPath:c})=>this.remapFd(n,n.openSync(c,s,a)))}async opendirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.opendirPromise(r,s),async(a,{subPath:n})=>await a.opendirPromise(n,s),{requireSubpath:!1})}opendirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.opendirSync(r,s),(a,{subPath:n})=>a.opendirSync(n,s),{requireSubpath:!1})}async readPromise(r,s,a,n,c){if((r&tl)!==this.magic)return await this.baseFs.readPromise(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"read\");let[p,h]=f;return await p.readPromise(h,s,a,n,c)}readSync(r,s,a,n,c){if((r&tl)!==this.magic)return this.baseFs.readSync(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"readSync\");let[p,h]=f;return p.readSync(h,s,a,n,c)}async writePromise(r,s,a,n,c){if((r&tl)!==this.magic)return typeof s==\"string\"?await this.baseFs.writePromise(r,s,a):await this.baseFs.writePromise(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"write\");let[p,h]=f;return typeof s==\"string\"?await p.writePromise(h,s,a):await p.writePromise(h,s,a,n,c)}writeSync(r,s,a,n,c){if((r&tl)!==this.magic)return typeof s==\"string\"?this.baseFs.writeSync(r,s,a):this.baseFs.writeSync(r,s,a,n,c);let f=this.fdMap.get(r);if(typeof f>\"u\")throw Mo(\"writeSync\");let[p,h]=f;return typeof s==\"string\"?p.writeSync(h,s,a):p.writeSync(h,s,a,n,c)}async closePromise(r){if((r&tl)!==this.magic)return await this.baseFs.closePromise(r);let s=this.fdMap.get(r);if(typeof s>\"u\")throw Mo(\"close\");this.fdMap.delete(r);let[a,n]=s;return await a.closePromise(n)}closeSync(r){if((r&tl)!==this.magic)return this.baseFs.closeSync(r);let s=this.fdMap.get(r);if(typeof s>\"u\")throw Mo(\"closeSync\");this.fdMap.delete(r);let[a,n]=s;return a.closeSync(n)}createReadStream(r,s){return r===null?this.baseFs.createReadStream(r,s):this.makeCallSync(r,()=>this.baseFs.createReadStream(r,s),(a,{archivePath:n,subPath:c})=>{let f=a.createReadStream(c,s);return f.path=fe.fromPortablePath(this.pathUtils.join(n,c)),f})}createWriteStream(r,s){return r===null?this.baseFs.createWriteStream(r,s):this.makeCallSync(r,()=>this.baseFs.createWriteStream(r,s),(a,{subPath:n})=>a.createWriteStream(n,s))}async realpathPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.realpathPromise(r),async(s,{archivePath:a,subPath:n})=>{let c=this.realPaths.get(a);return typeof c>\"u\"&&(c=await this.baseFs.realpathPromise(a),this.realPaths.set(a,c)),this.pathUtils.join(c,this.pathUtils.relative(vt.root,await s.realpathPromise(n)))})}realpathSync(r){return this.makeCallSync(r,()=>this.baseFs.realpathSync(r),(s,{archivePath:a,subPath:n})=>{let c=this.realPaths.get(a);return typeof c>\"u\"&&(c=this.baseFs.realpathSync(a),this.realPaths.set(a,c)),this.pathUtils.join(c,this.pathUtils.relative(vt.root,s.realpathSync(n)))})}async existsPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.existsPromise(r),async(s,{subPath:a})=>await s.existsPromise(a))}existsSync(r){return this.makeCallSync(r,()=>this.baseFs.existsSync(r),(s,{subPath:a})=>s.existsSync(a))}async accessPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.accessPromise(r,s),async(a,{subPath:n})=>await a.accessPromise(n,s))}accessSync(r,s){return this.makeCallSync(r,()=>this.baseFs.accessSync(r,s),(a,{subPath:n})=>a.accessSync(n,s))}async statPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.statPromise(r,s),async(a,{subPath:n})=>await a.statPromise(n,s))}statSync(r,s){return this.makeCallSync(r,()=>this.baseFs.statSync(r,s),(a,{subPath:n})=>a.statSync(n,s))}async fstatPromise(r,s){if((r&tl)!==this.magic)return this.baseFs.fstatPromise(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fstat\");let[n,c]=a;return n.fstatPromise(c,s)}fstatSync(r,s){if((r&tl)!==this.magic)return this.baseFs.fstatSync(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fstatSync\");let[n,c]=a;return n.fstatSync(c,s)}async lstatPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.lstatPromise(r,s),async(a,{subPath:n})=>await a.lstatPromise(n,s))}lstatSync(r,s){return this.makeCallSync(r,()=>this.baseFs.lstatSync(r,s),(a,{subPath:n})=>a.lstatSync(n,s))}async fchmodPromise(r,s){if((r&tl)!==this.magic)return this.baseFs.fchmodPromise(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fchmod\");let[n,c]=a;return n.fchmodPromise(c,s)}fchmodSync(r,s){if((r&tl)!==this.magic)return this.baseFs.fchmodSync(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"fchmodSync\");let[n,c]=a;return n.fchmodSync(c,s)}async chmodPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.chmodPromise(r,s),async(a,{subPath:n})=>await a.chmodPromise(n,s))}chmodSync(r,s){return this.makeCallSync(r,()=>this.baseFs.chmodSync(r,s),(a,{subPath:n})=>a.chmodSync(n,s))}async fchownPromise(r,s,a){if((r&tl)!==this.magic)return this.baseFs.fchownPromise(r,s,a);let n=this.fdMap.get(r);if(typeof n>\"u\")throw Mo(\"fchown\");let[c,f]=n;return c.fchownPromise(f,s,a)}fchownSync(r,s,a){if((r&tl)!==this.magic)return this.baseFs.fchownSync(r,s,a);let n=this.fdMap.get(r);if(typeof n>\"u\")throw Mo(\"fchownSync\");let[c,f]=n;return c.fchownSync(f,s,a)}async chownPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.chownPromise(r,s,a),async(n,{subPath:c})=>await n.chownPromise(c,s,a))}chownSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.chownSync(r,s,a),(n,{subPath:c})=>n.chownSync(c,s,a))}async renamePromise(r,s){return await this.makeCallPromise(r,async()=>await this.makeCallPromise(s,async()=>await this.baseFs.renamePromise(r,s),async()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})}),async(a,{subPath:n})=>await this.makeCallPromise(s,async()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})},async(c,{subPath:f})=>{if(a!==c)throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"});return await a.renamePromise(n,f)}))}renameSync(r,s){return this.makeCallSync(r,()=>this.makeCallSync(s,()=>this.baseFs.renameSync(r,s),()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})}),(a,{subPath:n})=>this.makeCallSync(s,()=>{throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"})},(c,{subPath:f})=>{if(a!==c)throw Object.assign(new Error(\"EEXDEV: cross-device link not permitted\"),{code:\"EEXDEV\"});return a.renameSync(n,f)}))}async copyFilePromise(r,s,a=0){let n=async(c,f,p,h)=>{if(a&wd.constants.COPYFILE_FICLONE_FORCE)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${f}' -> ${h}'`),{code:\"EXDEV\"});if(a&wd.constants.COPYFILE_EXCL&&await this.existsPromise(f))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${f}' -> '${h}'`),{code:\"EEXIST\"});let E;try{E=await c.readFilePromise(f)}catch{throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${f}' -> '${h}'`),{code:\"EINVAL\"})}await p.writeFilePromise(h,E)};return await this.makeCallPromise(r,async()=>await this.makeCallPromise(s,async()=>await this.baseFs.copyFilePromise(r,s,a),async(c,{subPath:f})=>await n(this.baseFs,r,c,f)),async(c,{subPath:f})=>await this.makeCallPromise(s,async()=>await n(c,f,this.baseFs,s),async(p,{subPath:h})=>c!==p?await n(c,f,p,h):await c.copyFilePromise(f,h,a)))}copyFileSync(r,s,a=0){let n=(c,f,p,h)=>{if(a&wd.constants.COPYFILE_FICLONE_FORCE)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${f}' -> ${h}'`),{code:\"EXDEV\"});if(a&wd.constants.COPYFILE_EXCL&&this.existsSync(f))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${f}' -> '${h}'`),{code:\"EEXIST\"});let E;try{E=c.readFileSync(f)}catch{throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${f}' -> '${h}'`),{code:\"EINVAL\"})}p.writeFileSync(h,E)};return this.makeCallSync(r,()=>this.makeCallSync(s,()=>this.baseFs.copyFileSync(r,s,a),(c,{subPath:f})=>n(this.baseFs,r,c,f)),(c,{subPath:f})=>this.makeCallSync(s,()=>n(c,f,this.baseFs,s),(p,{subPath:h})=>c!==p?n(c,f,p,h):c.copyFileSync(f,h,a)))}async appendFilePromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.appendFilePromise(r,s,a),async(n,{subPath:c})=>await n.appendFilePromise(c,s,a))}appendFileSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.appendFileSync(r,s,a),(n,{subPath:c})=>n.appendFileSync(c,s,a))}async writeFilePromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.writeFilePromise(r,s,a),async(n,{subPath:c})=>await n.writeFilePromise(c,s,a))}writeFileSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.writeFileSync(r,s,a),(n,{subPath:c})=>n.writeFileSync(c,s,a))}async unlinkPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.unlinkPromise(r),async(s,{subPath:a})=>await s.unlinkPromise(a))}unlinkSync(r){return this.makeCallSync(r,()=>this.baseFs.unlinkSync(r),(s,{subPath:a})=>s.unlinkSync(a))}async utimesPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.utimesPromise(r,s,a),async(n,{subPath:c})=>await n.utimesPromise(c,s,a))}utimesSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.utimesSync(r,s,a),(n,{subPath:c})=>n.utimesSync(c,s,a))}async lutimesPromise(r,s,a){return await this.makeCallPromise(r,async()=>await this.baseFs.lutimesPromise(r,s,a),async(n,{subPath:c})=>await n.lutimesPromise(c,s,a))}lutimesSync(r,s,a){return this.makeCallSync(r,()=>this.baseFs.lutimesSync(r,s,a),(n,{subPath:c})=>n.lutimesSync(c,s,a))}async mkdirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.mkdirPromise(r,s),async(a,{subPath:n})=>await a.mkdirPromise(n,s))}mkdirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.mkdirSync(r,s),(a,{subPath:n})=>a.mkdirSync(n,s))}async rmdirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.rmdirPromise(r,s),async(a,{subPath:n})=>await a.rmdirPromise(n,s))}rmdirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.rmdirSync(r,s),(a,{subPath:n})=>a.rmdirSync(n,s))}async rmPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.rmPromise(r,s),async(a,{subPath:n})=>await a.rmPromise(n,s))}rmSync(r,s){return this.makeCallSync(r,()=>this.baseFs.rmSync(r,s),(a,{subPath:n})=>a.rmSync(n,s))}async linkPromise(r,s){return await this.makeCallPromise(s,async()=>await this.baseFs.linkPromise(r,s),async(a,{subPath:n})=>await a.linkPromise(r,n))}linkSync(r,s){return this.makeCallSync(s,()=>this.baseFs.linkSync(r,s),(a,{subPath:n})=>a.linkSync(r,n))}async symlinkPromise(r,s,a){return await this.makeCallPromise(s,async()=>await this.baseFs.symlinkPromise(r,s,a),async(n,{subPath:c})=>await n.symlinkPromise(r,c))}symlinkSync(r,s,a){return this.makeCallSync(s,()=>this.baseFs.symlinkSync(r,s,a),(n,{subPath:c})=>n.symlinkSync(r,c))}async readFilePromise(r,s){return this.makeCallPromise(r,async()=>await this.baseFs.readFilePromise(r,s),async(a,{subPath:n})=>await a.readFilePromise(n,s))}readFileSync(r,s){return this.makeCallSync(r,()=>this.baseFs.readFileSync(r,s),(a,{subPath:n})=>a.readFileSync(n,s))}async readdirPromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.readdirPromise(r,s),async(a,{subPath:n})=>await a.readdirPromise(n,s),{requireSubpath:!1})}readdirSync(r,s){return this.makeCallSync(r,()=>this.baseFs.readdirSync(r,s),(a,{subPath:n})=>a.readdirSync(n,s),{requireSubpath:!1})}async readlinkPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.readlinkPromise(r),async(s,{subPath:a})=>await s.readlinkPromise(a))}readlinkSync(r){return this.makeCallSync(r,()=>this.baseFs.readlinkSync(r),(s,{subPath:a})=>s.readlinkSync(a))}async truncatePromise(r,s){return await this.makeCallPromise(r,async()=>await this.baseFs.truncatePromise(r,s),async(a,{subPath:n})=>await a.truncatePromise(n,s))}truncateSync(r,s){return this.makeCallSync(r,()=>this.baseFs.truncateSync(r,s),(a,{subPath:n})=>a.truncateSync(n,s))}async ftruncatePromise(r,s){if((r&tl)!==this.magic)return this.baseFs.ftruncatePromise(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"ftruncate\");let[n,c]=a;return n.ftruncatePromise(c,s)}ftruncateSync(r,s){if((r&tl)!==this.magic)return this.baseFs.ftruncateSync(r,s);let a=this.fdMap.get(r);if(typeof a>\"u\")throw Mo(\"ftruncateSync\");let[n,c]=a;return n.ftruncateSync(c,s)}watch(r,s,a){return this.makeCallSync(r,()=>this.baseFs.watch(r,s,a),(n,{subPath:c})=>n.watch(c,s,a))}watchFile(r,s,a){return this.makeCallSync(r,()=>this.baseFs.watchFile(r,s,a),()=>sE(this,r,s,a))}unwatchFile(r,s){return this.makeCallSync(r,()=>this.baseFs.unwatchFile(r,s),()=>md(this,r,s))}async makeCallPromise(r,s,a,{requireSubpath:n=!0}={}){if(typeof r!=\"string\")return await s();let c=this.resolve(r),f=this.findMount(c);return f?n&&f.subPath===\"/\"?await s():await this.getMountPromise(f.archivePath,async p=>await a(p,f)):await s()}makeCallSync(r,s,a,{requireSubpath:n=!0}={}){if(typeof r!=\"string\")return s();let c=this.resolve(r),f=this.findMount(c);return!f||n&&f.subPath===\"/\"?s():this.getMountSync(f.archivePath,p=>a(p,f))}findMount(r){if(this.filter&&!this.filter.test(r))return null;let s=\"\";for(;;){let a=r.substring(s.length),n=this.getMountPoint(a,s);if(!n)return null;if(s=this.pathUtils.join(s,n),!this.isMount.has(s)){if(this.notMount.has(s))continue;try{if(this.typeCheck!==null&&(this.baseFs.statSync(s).mode&wd.constants.S_IFMT)!==this.typeCheck){this.notMount.add(s);continue}}catch{return null}this.isMount.add(s)}return{archivePath:s,subPath:this.pathUtils.join(vt.root,r.substring(s.length))}}}limitOpenFiles(r){if(this.mountInstances===null)return;let s=Date.now(),a=s+this.maxAge,n=r===null?0:this.mountInstances.size-r;for(let[c,{childFs:f,expiresAt:p,refCount:h}]of this.mountInstances.entries())if(!(h!==0||f.hasOpenFileHandles?.())){if(s>=p){f.saveAndClose?.(),this.mountInstances.delete(c),n-=1;continue}else if(r===null||n<=0){a=p;break}f.saveAndClose?.(),this.mountInstances.delete(c),n-=1}this.limitOpenFilesTimeout===null&&(r===null&&this.mountInstances.size>0||r!==null)&&isFinite(a)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},a-s).unref())}async getMountPromise(r,s){if(this.mountInstances){let a=this.mountInstances.get(r);if(!a){let n=await this.factoryPromise(this.baseFs,r);a=this.mountInstances.get(r),a||(a={childFs:n(),expiresAt:0,refCount:0})}this.mountInstances.delete(r),this.limitOpenFiles(this.maxOpenFiles-1),this.mountInstances.set(r,a),a.expiresAt=Date.now()+this.maxAge,a.refCount+=1;try{return await s(a.childFs)}finally{a.refCount-=1}}else{let a=(await this.factoryPromise(this.baseFs,r))();try{return await s(a)}finally{a.saveAndClose?.()}}}getMountSync(r,s){if(this.mountInstances){let a=this.mountInstances.get(r);return a||(a={childFs:this.factorySync(this.baseFs,r),expiresAt:0,refCount:0}),this.mountInstances.delete(r),this.limitOpenFiles(this.maxOpenFiles-1),this.mountInstances.set(r,a),a.expiresAt=Date.now()+this.maxAge,s(a.childFs)}else{let a=this.factorySync(this.baseFs,r);try{return s(a)}finally{a.saveAndClose?.()}}}}});var er,nx,l$=Ze(()=>{Id();el();er=()=>Object.assign(new Error(\"ENOSYS: unsupported filesystem access\"),{code:\"ENOSYS\"}),nx=class t extends mp{static{this.instance=new t}constructor(){super(J)}getExtractHint(){throw er()}getRealPath(){throw er()}resolve(){throw er()}async openPromise(){throw er()}openSync(){throw er()}async opendirPromise(){throw er()}opendirSync(){throw er()}async readPromise(){throw er()}readSync(){throw er()}async writePromise(){throw er()}writeSync(){throw er()}async closePromise(){throw er()}closeSync(){throw er()}createWriteStream(){throw er()}createReadStream(){throw er()}async realpathPromise(){throw er()}realpathSync(){throw er()}async readdirPromise(){throw er()}readdirSync(){throw er()}async existsPromise(e){throw er()}existsSync(e){throw er()}async accessPromise(){throw er()}accessSync(){throw er()}async statPromise(){throw er()}statSync(){throw er()}async fstatPromise(e){throw er()}fstatSync(e){throw er()}async lstatPromise(e){throw er()}lstatSync(e){throw er()}async fchmodPromise(){throw er()}fchmodSync(){throw er()}async chmodPromise(){throw er()}chmodSync(){throw er()}async fchownPromise(){throw er()}fchownSync(){throw er()}async chownPromise(){throw er()}chownSync(){throw er()}async mkdirPromise(){throw er()}mkdirSync(){throw er()}async rmdirPromise(){throw er()}rmdirSync(){throw er()}async rmPromise(){throw er()}rmSync(){throw er()}async linkPromise(){throw er()}linkSync(){throw er()}async symlinkPromise(){throw er()}symlinkSync(){throw er()}async renamePromise(){throw er()}renameSync(){throw er()}async copyFilePromise(){throw er()}copyFileSync(){throw er()}async appendFilePromise(){throw er()}appendFileSync(){throw er()}async writeFilePromise(){throw er()}writeFileSync(){throw er()}async unlinkPromise(){throw er()}unlinkSync(){throw er()}async utimesPromise(){throw er()}utimesSync(){throw er()}async lutimesPromise(){throw er()}lutimesSync(){throw er()}async readFilePromise(){throw er()}readFileSync(){throw er()}async readlinkPromise(){throw er()}readlinkSync(){throw er()}async truncatePromise(){throw er()}truncateSync(){throw er()}async ftruncatePromise(e,r){throw er()}ftruncateSync(e,r){throw er()}watch(){throw er()}watchFile(){throw er()}unwatchFile(){throw er()}}});var t0,c$=Ze(()=>{yp();el();t0=class extends _s{constructor(e){super(fe),this.baseFs=e}mapFromBase(e){return fe.fromPortablePath(e)}mapToBase(e){return fe.toPortablePath(e)}}});var nqe,PU,iqe,uo,u$=Ze(()=>{Cd();yp();el();nqe=/^[0-9]+$/,PU=/^(\\/(?:[^/]+\\/)*?(?:\\$\\$virtual|__virtual__))((?:\\/((?:[^/]+-)?[a-f0-9]+)(?:\\/([^/]+))?)?((?:\\/.*)?))$/,iqe=/^([^/]+-)?[a-f0-9]+$/,uo=class t extends _s{static makeVirtualPath(e,r,s){if(J.basename(e)!==\"__virtual__\")throw new Error('Assertion failed: Virtual folders must be named \"__virtual__\"');if(!J.basename(r).match(iqe))throw new Error(\"Assertion failed: Virtual components must be ended by an hexadecimal hash\");let n=J.relative(J.dirname(e),s).split(\"/\"),c=0;for(;c<n.length&&n[c]===\"..\";)c+=1;let f=n.slice(c);return J.join(e,r,String(c),...f)}static resolveVirtual(e){let r=e.match(PU);if(!r||!r[3]&&r[5])return e;let s=J.dirname(r[1]);if(!r[3]||!r[4])return s;if(!nqe.test(r[4]))return e;let n=Number(r[4]),c=\"../\".repeat(n),f=r[5]||\".\";return t.resolveVirtual(J.join(s,c,f))}constructor({baseFs:e=new Yn}={}){super(J),this.baseFs=e}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}realpathSync(e){let r=e.match(PU);if(!r)return this.baseFs.realpathSync(e);if(!r[5])return e;let s=this.baseFs.realpathSync(this.mapToBase(e));return t.makeVirtualPath(r[1],r[3],s)}async realpathPromise(e){let r=e.match(PU);if(!r)return await this.baseFs.realpathPromise(e);if(!r[5])return e;let s=await this.baseFs.realpathPromise(this.mapToBase(e));return t.makeVirtualPath(r[1],r[3],s)}mapToBase(e){if(e===\"\")return e;if(this.pathUtils.isAbsolute(e))return t.resolveVirtual(e);let r=t.resolveVirtual(this.baseFs.resolve(vt.dot)),s=t.resolveVirtual(this.baseFs.resolve(e));return J.relative(r,s)||vt.dot}mapFromBase(e){return e}}});function sqe(t,e){return typeof bU.default.isUtf8<\"u\"?bU.default.isUtf8(t):Buffer.byteLength(e)===t.byteLength}var bU,f$,A$,ix,p$=Ze(()=>{bU=ut(Ie(\"buffer\")),f$=Ie(\"url\"),A$=Ie(\"util\");yp();el();ix=class extends _s{constructor(e){super(fe),this.baseFs=e}mapFromBase(e){return e}mapToBase(e){if(typeof e==\"string\")return e;if(e instanceof URL)return(0,f$.fileURLToPath)(e);if(Buffer.isBuffer(e)){let r=e.toString();if(!sqe(e,r))throw new Error(\"Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942\");return r}throw new Error(`Unsupported path type: ${(0,A$.inspect)(e)}`)}}});var y$,Uo,Ep,r0,sx,ox,aE,Tu,Fu,h$,g$,d$,m$,M2,E$=Ze(()=>{y$=Ie(\"readline\"),Uo=Symbol(\"kBaseFs\"),Ep=Symbol(\"kFd\"),r0=Symbol(\"kClosePromise\"),sx=Symbol(\"kCloseResolve\"),ox=Symbol(\"kCloseReject\"),aE=Symbol(\"kRefs\"),Tu=Symbol(\"kRef\"),Fu=Symbol(\"kUnref\"),M2=class{constructor(e,r){this[m$]=1;this[d$]=void 0;this[g$]=void 0;this[h$]=void 0;this[Uo]=r,this[Ep]=e}get fd(){return this[Ep]}async appendFile(e,r){try{this[Tu](this.appendFile);let s=(typeof r==\"string\"?r:r?.encoding)??void 0;return await this[Uo].appendFilePromise(this.fd,e,s?{encoding:s}:void 0)}finally{this[Fu]()}}async chown(e,r){try{return this[Tu](this.chown),await this[Uo].fchownPromise(this.fd,e,r)}finally{this[Fu]()}}async chmod(e){try{return this[Tu](this.chmod),await this[Uo].fchmodPromise(this.fd,e)}finally{this[Fu]()}}createReadStream(e){return this[Uo].createReadStream(null,{...e,fd:this.fd})}createWriteStream(e){return this[Uo].createWriteStream(null,{...e,fd:this.fd})}datasync(){throw new Error(\"Method not implemented.\")}sync(){throw new Error(\"Method not implemented.\")}async read(e,r,s,a){try{this[Tu](this.read);let n;return Buffer.isBuffer(e)?n=e:(e??={},n=e.buffer??Buffer.alloc(16384),r=e.offset||0,s=e.length??n.byteLength,a=e.position??null),r??=0,s??=0,s===0?{bytesRead:s,buffer:n}:{bytesRead:await this[Uo].readPromise(this.fd,n,r,s,a),buffer:n}}finally{this[Fu]()}}async readFile(e){try{this[Tu](this.readFile);let r=(typeof e==\"string\"?e:e?.encoding)??void 0;return await this[Uo].readFilePromise(this.fd,r)}finally{this[Fu]()}}readLines(e){return(0,y$.createInterface)({input:this.createReadStream(e),crlfDelay:1/0})}async stat(e){try{return this[Tu](this.stat),await this[Uo].fstatPromise(this.fd,e)}finally{this[Fu]()}}async truncate(e){try{return this[Tu](this.truncate),await this[Uo].ftruncatePromise(this.fd,e)}finally{this[Fu]()}}utimes(e,r){throw new Error(\"Method not implemented.\")}async writeFile(e,r){try{this[Tu](this.writeFile);let s=(typeof r==\"string\"?r:r?.encoding)??void 0;await this[Uo].writeFilePromise(this.fd,e,s)}finally{this[Fu]()}}async write(...e){try{if(this[Tu](this.write),ArrayBuffer.isView(e[0])){let[r,s,a,n]=e;return{bytesWritten:await this[Uo].writePromise(this.fd,r,s??void 0,a??void 0,n??void 0),buffer:r}}else{let[r,s,a]=e;return{bytesWritten:await this[Uo].writePromise(this.fd,r,s,a),buffer:r}}}finally{this[Fu]()}}async writev(e,r){try{this[Tu](this.writev);let s=0;if(typeof r<\"u\")for(let a of e){let n=await this.write(a,void 0,void 0,r);s+=n.bytesWritten,r+=n.bytesWritten}else for(let a of e){let n=await this.write(a);s+=n.bytesWritten}return{buffers:e,bytesWritten:s}}finally{this[Fu]()}}readv(e,r){throw new Error(\"Method not implemented.\")}close(){if(this[Ep]===-1)return Promise.resolve();if(this[r0])return this[r0];if(this[aE]--,this[aE]===0){let e=this[Ep];this[Ep]=-1,this[r0]=this[Uo].closePromise(e).finally(()=>{this[r0]=void 0})}else this[r0]=new Promise((e,r)=>{this[sx]=e,this[ox]=r}).finally(()=>{this[r0]=void 0,this[ox]=void 0,this[sx]=void 0});return this[r0]}[(Uo,Ep,m$=aE,d$=r0,g$=sx,h$=ox,Tu)](e){if(this[Ep]===-1){let r=new Error(\"file closed\");throw r.code=\"EBADF\",r.syscall=e.name,r}this[aE]++}[Fu](){if(this[aE]--,this[aE]===0){let e=this[Ep];this[Ep]=-1,this[Uo].closePromise(e).then(this[sx],this[ox])}}}});function U2(t,e){e=new ix(e);let r=(s,a,n)=>{let c=s[a];s[a]=n,typeof c?.[lE.promisify.custom]<\"u\"&&(n[lE.promisify.custom]=c[lE.promisify.custom])};{r(t,\"exists\",(s,...a)=>{let c=typeof a[a.length-1]==\"function\"?a.pop():()=>{};process.nextTick(()=>{e.existsPromise(s).then(f=>{c(f)},()=>{c(!1)})})}),r(t,\"read\",(...s)=>{let[a,n,c,f,p,h]=s;if(s.length<=3){let E={};s.length<3?h=s[1]:(E=s[1],h=s[2]),{buffer:n=Buffer.alloc(16384),offset:c=0,length:f=n.byteLength,position:p}=E}if(c==null&&(c=0),f|=0,f===0){process.nextTick(()=>{h(null,0,n)});return}p==null&&(p=-1),process.nextTick(()=>{e.readPromise(a,n,c,f,p).then(E=>{h(null,E,n)},E=>{h(E,0,n)})})});for(let s of I$){let a=s.replace(/Promise$/,\"\");if(typeof t[a]>\"u\")continue;let n=e[s];if(typeof n>\"u\")continue;r(t,a,(...f)=>{let h=typeof f[f.length-1]==\"function\"?f.pop():()=>{};process.nextTick(()=>{n.apply(e,f).then(E=>{h(null,E)},E=>{h(E)})})})}t.realpath.native=t.realpath}{r(t,\"existsSync\",s=>{try{return e.existsSync(s)}catch{return!1}}),r(t,\"readSync\",(...s)=>{let[a,n,c,f,p]=s;return s.length<=3&&({offset:c=0,length:f=n.byteLength,position:p}=s[2]||{}),c==null&&(c=0),f|=0,f===0?0:(p==null&&(p=-1),e.readSync(a,n,c,f,p))});for(let s of oqe){let a=s;if(typeof t[a]>\"u\")continue;let n=e[s];typeof n>\"u\"||r(t,a,n.bind(e))}t.realpathSync.native=t.realpathSync}{let s=t.promises;for(let a of I$){let n=a.replace(/Promise$/,\"\");if(typeof s[n]>\"u\")continue;let c=e[a];typeof c>\"u\"||a!==\"open\"&&r(s,n,(f,...p)=>f instanceof M2?f[n].apply(f,p):c.call(e,f,...p))}r(s,\"open\",async(...a)=>{let n=await e.openPromise(...a);return new M2(n,e)})}t.read[lE.promisify.custom]=async(s,a,...n)=>({bytesRead:await e.readPromise(s,a,...n),buffer:a}),t.write[lE.promisify.custom]=async(s,a,...n)=>({bytesWritten:await e.writePromise(s,a,...n),buffer:a})}function ax(t,e){let r=Object.create(t);return U2(r,e),r}var lE,oqe,I$,C$=Ze(()=>{lE=Ie(\"util\");p$();E$();oqe=new Set([\"accessSync\",\"appendFileSync\",\"createReadStream\",\"createWriteStream\",\"chmodSync\",\"fchmodSync\",\"chownSync\",\"fchownSync\",\"closeSync\",\"copyFileSync\",\"linkSync\",\"lstatSync\",\"fstatSync\",\"lutimesSync\",\"mkdirSync\",\"openSync\",\"opendirSync\",\"readlinkSync\",\"readFileSync\",\"readdirSync\",\"readlinkSync\",\"realpathSync\",\"renameSync\",\"rmdirSync\",\"rmSync\",\"statSync\",\"symlinkSync\",\"truncateSync\",\"ftruncateSync\",\"unlinkSync\",\"unwatchFile\",\"utimesSync\",\"watch\",\"watchFile\",\"writeFileSync\",\"writeSync\"]),I$=new Set([\"accessPromise\",\"appendFilePromise\",\"fchmodPromise\",\"chmodPromise\",\"fchownPromise\",\"chownPromise\",\"closePromise\",\"copyFilePromise\",\"linkPromise\",\"fstatPromise\",\"lstatPromise\",\"lutimesPromise\",\"mkdirPromise\",\"openPromise\",\"opendirPromise\",\"readdirPromise\",\"realpathPromise\",\"readFilePromise\",\"readdirPromise\",\"readlinkPromise\",\"renamePromise\",\"rmdirPromise\",\"rmPromise\",\"statPromise\",\"symlinkPromise\",\"truncatePromise\",\"ftruncatePromise\",\"unlinkPromise\",\"utimesPromise\",\"writeFilePromise\",\"writeSync\"])});function w$(t){let e=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,\"0\");return`${t}${e}`}function B$(){if(xU)return xU;let t=fe.toPortablePath(v$.default.tmpdir()),e=ce.realpathSync(t);return process.once(\"exit\",()=>{ce.rmtempSync()}),xU={tmpdir:t,realTmpdir:e}}var v$,Nu,xU,ce,S$=Ze(()=>{v$=ut(Ie(\"os\"));Cd();el();Nu=new Set,xU=null;ce=Object.assign(new Yn,{detachTemp(t){Nu.delete(t)},mktempSync(t){let{tmpdir:e,realTmpdir:r}=B$();for(;;){let s=w$(\"xfs-\");try{this.mkdirSync(J.join(e,s))}catch(n){if(n.code===\"EEXIST\")continue;throw n}let a=J.join(r,s);if(Nu.add(a),typeof t>\"u\")return a;try{return t(a)}finally{if(Nu.has(a)){Nu.delete(a);try{this.removeSync(a)}catch{}}}}},async mktempPromise(t){let{tmpdir:e,realTmpdir:r}=B$();for(;;){let s=w$(\"xfs-\");try{await this.mkdirPromise(J.join(e,s))}catch(n){if(n.code===\"EEXIST\")continue;throw n}let a=J.join(r,s);if(Nu.add(a),typeof t>\"u\")return a;try{return await t(a)}finally{if(Nu.has(a)){Nu.delete(a);try{await this.removePromise(a)}catch{}}}}},async rmtempPromise(){await Promise.all(Array.from(Nu.values()).map(async t=>{try{await ce.removePromise(t,{maxRetries:0}),Nu.delete(t)}catch{}}))},rmtempSync(){for(let t of Nu)try{ce.removeSync(t),Nu.delete(t)}catch{}}})});var _2={};Vt(_2,{AliasFS:()=>_f,BasePortableFakeFS:()=>Uf,CustomDir:()=>L2,CwdFS:()=>Sn,FakeFS:()=>mp,Filename:()=>Er,JailFS:()=>Hf,LazyFS:()=>oE,MountFS:()=>e0,NoFS:()=>nx,NodeFS:()=>Yn,PortablePath:()=>vt,PosixFS:()=>t0,ProxiedFS:()=>_s,VirtualFS:()=>uo,constants:()=>fi,errors:()=>or,extendFs:()=>ax,normalizeLineEndings:()=>Ed,npath:()=>fe,opendir:()=>ex,patchFs:()=>U2,ppath:()=>J,setupCopyIndex:()=>$b,statUtils:()=>$a,unwatchAllFiles:()=>yd,unwatchFile:()=>md,watchFile:()=>sE,xfs:()=>ce});var Dt=Ze(()=>{jX();zb();wU();SU();JX();DU();Id();el();el();e$();Id();n$();s$();o$();a$();l$();Cd();c$();yp();u$();C$();S$()});var k$=_((mkt,x$)=>{x$.exports=b$;b$.sync=lqe;var D$=Ie(\"fs\");function aqe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(\";\"),r.indexOf(\"\")!==-1))return!0;for(var s=0;s<r.length;s++){var a=r[s].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a)return!0}return!1}function P$(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:aqe(e,r)}function b$(t,e,r){D$.stat(t,function(s,a){r(s,s?!1:P$(a,t,e))})}function lqe(t,e){return P$(D$.statSync(t),t,e)}});var N$=_((ykt,F$)=>{F$.exports=R$;R$.sync=cqe;var Q$=Ie(\"fs\");function R$(t,e,r){Q$.stat(t,function(s,a){r(s,s?!1:T$(a,e))})}function cqe(t,e){return T$(Q$.statSync(t),e)}function T$(t,e){return t.isFile()&&uqe(t,e)}function uqe(t,e){var r=t.mode,s=t.uid,a=t.gid,n=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),f=parseInt(\"100\",8),p=parseInt(\"010\",8),h=parseInt(\"001\",8),E=f|p,C=r&h||r&p&&a===c||r&f&&s===n||r&E&&n===0;return C}});var L$=_((Ikt,O$)=>{var Ekt=Ie(\"fs\"),lx;process.platform===\"win32\"||global.TESTING_WINDOWS?lx=k$():lx=N$();O$.exports=kU;kU.sync=fqe;function kU(t,e,r){if(typeof e==\"function\"&&(r=e,e={}),!r){if(typeof Promise!=\"function\")throw new TypeError(\"callback not provided\");return new Promise(function(s,a){kU(t,e||{},function(n,c){n?a(n):s(c)})})}lx(t,e||{},function(s,a){s&&(s.code===\"EACCES\"||e&&e.ignoreErrors)&&(s=null,a=!1),r(s,a)})}function fqe(t,e){try{return lx.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code===\"EACCES\")return!1;throw r}}});var q$=_((Ckt,G$)=>{var cE=process.platform===\"win32\"||process.env.OSTYPE===\"cygwin\"||process.env.OSTYPE===\"msys\",M$=Ie(\"path\"),Aqe=cE?\";\":\":\",U$=L$(),_$=t=>Object.assign(new Error(`not found: ${t}`),{code:\"ENOENT\"}),H$=(t,e)=>{let r=e.colon||Aqe,s=t.match(/\\//)||cE&&t.match(/\\\\/)?[\"\"]:[...cE?[process.cwd()]:[],...(e.path||process.env.PATH||\"\").split(r)],a=cE?e.pathExt||process.env.PATHEXT||\".EXE;.CMD;.BAT;.COM\":\"\",n=cE?a.split(r):[\"\"];return cE&&t.indexOf(\".\")!==-1&&n[0]!==\"\"&&n.unshift(\"\"),{pathEnv:s,pathExt:n,pathExtExe:a}},j$=(t,e,r)=>{typeof e==\"function\"&&(r=e,e={}),e||(e={});let{pathEnv:s,pathExt:a,pathExtExe:n}=H$(t,e),c=[],f=h=>new Promise((E,C)=>{if(h===s.length)return e.all&&c.length?E(c):C(_$(t));let S=s[h],b=/^\".*\"$/.test(S)?S.slice(1,-1):S,I=M$.join(b,t),T=!b&&/^\\.[\\\\\\/]/.test(t)?t.slice(0,2)+I:I;E(p(T,h,0))}),p=(h,E,C)=>new Promise((S,b)=>{if(C===a.length)return S(f(E+1));let I=a[C];U$(h+I,{pathExt:n},(T,N)=>{if(!T&&N)if(e.all)c.push(h+I);else return S(h+I);return S(p(h,E,C+1))})});return r?f(0).then(h=>r(null,h),r):f(0)},pqe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:s,pathExtExe:a}=H$(t,e),n=[];for(let c=0;c<r.length;c++){let f=r[c],p=/^\".*\"$/.test(f)?f.slice(1,-1):f,h=M$.join(p,t),E=!p&&/^\\.[\\\\\\/]/.test(t)?t.slice(0,2)+h:h;for(let C=0;C<s.length;C++){let S=E+s[C];try{if(U$.sync(S,{pathExt:a}))if(e.all)n.push(S);else return S}catch{}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw _$(t)};G$.exports=j$;j$.sync=pqe});var Y$=_((wkt,QU)=>{\"use strict\";var W$=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!==\"win32\"?\"PATH\":Object.keys(e).reverse().find(s=>s.toUpperCase()===\"PATH\")||\"Path\"};QU.exports=W$;QU.exports.default=W$});var z$=_((Bkt,K$)=>{\"use strict\";var V$=Ie(\"path\"),hqe=q$(),gqe=Y$();function J$(t,e){let r=t.options.env||process.env,s=process.cwd(),a=t.options.cwd!=null,n=a&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(t.options.cwd)}catch{}let c;try{c=hqe.sync(t.command,{path:r[gqe({env:r})],pathExt:e?V$.delimiter:void 0})}catch{}finally{n&&process.chdir(s)}return c&&(c=V$.resolve(a?t.options.cwd:\"\",c)),c}function dqe(t){return J$(t)||J$(t,!0)}K$.exports=dqe});var Z$=_((vkt,TU)=>{\"use strict\";var RU=/([()\\][%!^\"`<>&|;, *?])/g;function mqe(t){return t=t.replace(RU,\"^$1\"),t}function yqe(t,e){return t=`${t}`,t=t.replace(/(?=(\\\\+?)?)\\1\"/g,'$1$1\\\\\"'),t=t.replace(/(?=(\\\\+?)?)\\1$/,\"$1$1\"),t=`\"${t}\"`,t=t.replace(RU,\"^$1\"),e&&(t=t.replace(RU,\"^$1\")),t}TU.exports.command=mqe;TU.exports.argument=yqe});var $$=_((Skt,X$)=>{\"use strict\";X$.exports=/^#!(.*)/});var tee=_((Dkt,eee)=>{\"use strict\";var Eqe=$$();eee.exports=(t=\"\")=>{let e=t.match(Eqe);if(!e)return null;let[r,s]=e[0].replace(/#! ?/,\"\").split(\" \"),a=r.split(\"/\").pop();return a===\"env\"?s:s?`${a} ${s}`:a}});var nee=_((Pkt,ree)=>{\"use strict\";var FU=Ie(\"fs\"),Iqe=tee();function Cqe(t){let r=Buffer.alloc(150),s;try{s=FU.openSync(t,\"r\"),FU.readSync(s,r,0,150,0),FU.closeSync(s)}catch{}return Iqe(r.toString())}ree.exports=Cqe});var aee=_((bkt,oee)=>{\"use strict\";var wqe=Ie(\"path\"),iee=z$(),see=Z$(),Bqe=nee(),vqe=process.platform===\"win32\",Sqe=/\\.(?:com|exe)$/i,Dqe=/node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;function Pqe(t){t.file=iee(t);let e=t.file&&Bqe(t.file);return e?(t.args.unshift(t.file),t.command=e,iee(t)):t.file}function bqe(t){if(!vqe)return t;let e=Pqe(t),r=!Sqe.test(e);if(t.options.forceShell||r){let s=Dqe.test(e);t.command=wqe.normalize(t.command),t.command=see.command(t.command),t.args=t.args.map(n=>see.argument(n,s));let a=[t.command].concat(t.args).join(\" \");t.args=[\"/d\",\"/s\",\"/c\",`\"${a}\"`],t.command=process.env.comspec||\"cmd.exe\",t.options.windowsVerbatimArguments=!0}return t}function xqe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let s={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?s:bqe(s)}oee.exports=xqe});var uee=_((xkt,cee)=>{\"use strict\";var NU=process.platform===\"win32\";function OU(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:\"ENOENT\",errno:\"ENOENT\",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function kqe(t,e){if(!NU)return;let r=t.emit;t.emit=function(s,a){if(s===\"exit\"){let n=lee(a,e);if(n)return r.call(t,\"error\",n)}return r.apply(t,arguments)}}function lee(t,e){return NU&&t===1&&!e.file?OU(e.original,\"spawn\"):null}function Qqe(t,e){return NU&&t===1&&!e.file?OU(e.original,\"spawnSync\"):null}cee.exports={hookChildProcess:kqe,verifyENOENT:lee,verifyENOENTSync:Qqe,notFoundError:OU}});var UU=_((kkt,uE)=>{\"use strict\";var fee=Ie(\"child_process\"),LU=aee(),MU=uee();function Aee(t,e,r){let s=LU(t,e,r),a=fee.spawn(s.command,s.args,s.options);return MU.hookChildProcess(a,s),a}function Rqe(t,e,r){let s=LU(t,e,r),a=fee.spawnSync(s.command,s.args,s.options);return a.error=a.error||MU.verifyENOENTSync(a.status,s),a}uE.exports=Aee;uE.exports.spawn=Aee;uE.exports.sync=Rqe;uE.exports._parse=LU;uE.exports._enoent=MU});var hee=_((Qkt,pee)=>{\"use strict\";function Tqe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Bd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,Bd)}Tqe(Bd,Error);Bd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function Fqe(t,e){e=e!==void 0?e:{};var r={},s={Start:Wa},a=Wa,n=function(O){return O||[]},c=function(O,K,re){return[{command:O,type:K}].concat(re||[])},f=function(O,K){return[{command:O,type:K||\";\"}]},p=function(O){return O},h=\";\",E=ur(\";\",!1),C=\"&\",S=ur(\"&\",!1),b=function(O,K){return K?{chain:O,then:K}:{chain:O}},I=function(O,K){return{type:O,line:K}},T=\"&&\",N=ur(\"&&\",!1),U=\"||\",W=ur(\"||\",!1),ee=function(O,K){return K?{...O,then:K}:O},ie=function(O,K){return{type:O,chain:K}},ue=\"|&\",le=ur(\"|&\",!1),me=\"|\",pe=ur(\"|\",!1),Be=\"=\",Ce=ur(\"=\",!1),g=function(O,K){return{name:O,args:[K]}},we=function(O){return{name:O,args:[]}},ye=\"(\",Ae=ur(\"(\",!1),se=\")\",X=ur(\")\",!1),De=function(O,K){return{type:\"subshell\",subshell:O,args:K}},Te=\"{\",mt=ur(\"{\",!1),j=\"}\",rt=ur(\"}\",!1),Fe=function(O,K){return{type:\"group\",group:O,args:K}},Ne=function(O,K){return{type:\"command\",args:K,envs:O}},be=function(O){return{type:\"envs\",envs:O}},Ve=function(O){return O},ke=function(O){return O},it=/^[0-9]/,Ue=Ki([[\"0\",\"9\"]],!1,!1),x=function(O,K,re){return{type:\"redirection\",subtype:K,fd:O!==null?parseInt(O):null,args:[re]}},w=\">>\",P=ur(\">>\",!1),y=\">&\",F=ur(\">&\",!1),z=\">\",Z=ur(\">\",!1),$=\"<<<\",oe=ur(\"<<<\",!1),xe=\"<&\",Re=ur(\"<&\",!1),lt=\"<\",Ct=ur(\"<\",!1),qt=function(O){return{type:\"argument\",segments:[].concat(...O)}},ir=function(O){return O},bt=\"$'\",gn=ur(\"$'\",!1),br=\"'\",Ir=ur(\"'\",!1),Or=function(O){return[{type:\"text\",text:O}]},nn='\"\"',ai=ur('\"\"',!1),Io=function(){return{type:\"text\",text:\"\"}},ts='\"',$s=ur('\"',!1),Co=function(O){return O},Hi=function(O){return{type:\"arithmetic\",arithmetic:O,quoted:!0}},eo=function(O){return{type:\"shell\",shell:O,quoted:!0}},wo=function(O){return{type:\"variable\",...O,quoted:!0}},QA=function(O){return{type:\"text\",text:O}},Af=function(O){return{type:\"arithmetic\",arithmetic:O,quoted:!1}},dh=function(O){return{type:\"shell\",shell:O,quoted:!1}},mh=function(O){return{type:\"variable\",...O,quoted:!1}},to=function(O){return{type:\"glob\",pattern:O}},jn=/^[^']/,Rs=Ki([\"'\"],!0,!1),ro=function(O){return O.join(\"\")},ou=/^[^$\"]/,au=Ki([\"$\",'\"'],!0,!1),lu=`\\\\\n`,RA=ur(`\\\\\n`,!1),TA=function(){return\"\"},oa=\"\\\\\",aa=ur(\"\\\\\",!1),FA=/^[\\\\$\"`]/,gr=Ki([\"\\\\\",\"$\",'\"',\"`\"],!1,!1),Bo=function(O){return O},Me=\"\\\\a\",cu=ur(\"\\\\a\",!1),Cr=function(){return\"a\"},pf=\"\\\\b\",NA=ur(\"\\\\b\",!1),OA=function(){return\"\\b\"},uu=/^[Ee]/,fu=Ki([\"E\",\"e\"],!1,!1),oc=function(){return\"\\x1B\"},ve=\"\\\\f\",Nt=ur(\"\\\\f\",!1),ac=function(){return\"\\f\"},Oi=\"\\\\n\",no=ur(\"\\\\n\",!1),Tt=function(){return`\n`},xn=\"\\\\r\",la=ur(\"\\\\r\",!1),ji=function(){return\"\\r\"},Li=\"\\\\t\",Na=ur(\"\\\\t\",!1),dn=function(){return\"\t\"},Kn=\"\\\\v\",Au=ur(\"\\\\v\",!1),yh=function(){return\"\\v\"},Oa=/^[\\\\'\"?]/,La=Ki([\"\\\\\",\"'\",'\"',\"?\"],!1,!1),Ma=function(O){return String.fromCharCode(parseInt(O,16))},$e=\"\\\\x\",Ua=ur(\"\\\\x\",!1),hf=\"\\\\u\",lc=ur(\"\\\\u\",!1),wn=\"\\\\U\",ca=ur(\"\\\\U\",!1),LA=function(O){return String.fromCodePoint(parseInt(O,16))},MA=/^[0-7]/,ua=Ki([[\"0\",\"7\"]],!1,!1),Bl=/^[0-9a-fA-f]/,Mt=Ki([[\"0\",\"9\"],[\"a\",\"f\"],[\"A\",\"f\"]],!1,!1),kn=yf(),fa=\"{}\",Ha=ur(\"{}\",!1),rs=function(){return\"{}\"},cc=\"-\",pu=ur(\"-\",!1),uc=\"+\",ja=ur(\"+\",!1),Mi=\".\",Is=ur(\".\",!1),vl=function(O,K,re){return{type:\"number\",value:(O===\"-\"?-1:1)*parseFloat(K.join(\"\")+\".\"+re.join(\"\"))}},gf=function(O,K){return{type:\"number\",value:(O===\"-\"?-1:1)*parseInt(K.join(\"\"))}},fc=function(O){return{type:\"variable\",...O}},wi=function(O){return{type:\"variable\",name:O}},Qn=function(O){return O},Ac=\"*\",Ke=ur(\"*\",!1),st=\"/\",St=ur(\"/\",!1),lr=function(O,K,re){return{type:K===\"*\"?\"multiplication\":\"division\",right:re}},te=function(O,K){return K.reduce((re,de)=>({left:re,...de}),O)},Ee=function(O,K,re){return{type:K===\"+\"?\"addition\":\"subtraction\",right:re}},Oe=\"$((\",dt=ur(\"$((\",!1),Et=\"))\",Pt=ur(\"))\",!1),tr=function(O){return O},An=\"$(\",li=ur(\"$(\",!1),Gi=function(O){return O},Rn=\"${\",Ga=ur(\"${\",!1),my=\":-\",X1=ur(\":-\",!1),vo=function(O,K){return{name:O,defaultValue:K}},yy=\":-}\",Eh=ur(\":-}\",!1),$1=function(O){return{name:O,defaultValue:[]}},So=\":+\",Ih=ur(\":+\",!1),Ch=function(O,K){return{name:O,alternativeValue:K}},hu=\":+}\",wh=ur(\":+}\",!1),Fg=function(O){return{name:O,alternativeValue:[]}},Ng=function(O){return{name:O}},Og=\"$\",Ey=ur(\"$\",!1),df=function(O){return e.isGlobPattern(O)},Do=function(O){return O},Sl=/^[a-zA-Z0-9_]/,Bh=Ki([[\"a\",\"z\"],[\"A\",\"Z\"],[\"0\",\"9\"],\"_\"],!1,!1),Lg=function(){return By()},Dl=/^[$@*?#a-zA-Z0-9_\\-]/,Pl=Ki([\"$\",\"@\",\"*\",\"?\",\"#\",[\"a\",\"z\"],[\"A\",\"Z\"],[\"0\",\"9\"],\"_\",\"-\"],!1,!1),Iy=/^[()}<>$|&; \\t\"']/,UA=Ki([\"(\",\")\",\"}\",\"<\",\">\",\"$\",\"|\",\"&\",\";\",\" \",\"\t\",'\"',\"'\"],!1,!1),Cy=/^[<>&; \\t\"']/,wy=Ki([\"<\",\">\",\"&\",\";\",\" \",\"\t\",'\"',\"'\"],!1,!1),_A=/^[ \\t]/,HA=Ki([\" \",\"\t\"],!1,!1),Y=0,xt=0,jA=[{line:1,column:1}],Po=0,mf=[],yt=0,gu;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function By(){return t.substring(xt,Y)}function Mg(){return Ef(xt,Y)}function e2(O,K){throw K=K!==void 0?K:Ef(xt,Y),GA([Ug(O)],t.substring(xt,Y),K)}function vh(O,K){throw K=K!==void 0?K:Ef(xt,Y),di(O,K)}function ur(O,K){return{type:\"literal\",text:O,ignoreCase:K}}function Ki(O,K,re){return{type:\"class\",parts:O,inverted:K,ignoreCase:re}}function yf(){return{type:\"any\"}}function qa(){return{type:\"end\"}}function Ug(O){return{type:\"other\",description:O}}function du(O){var K=jA[O],re;if(K)return K;for(re=O-1;!jA[re];)re--;for(K=jA[re],K={line:K.line,column:K.column};re<O;)t.charCodeAt(re)===10?(K.line++,K.column=1):K.column++,re++;return jA[O]=K,K}function Ef(O,K){var re=du(O),de=du(K);return{start:{offset:O,line:re.line,column:re.column},end:{offset:K,line:de.line,column:de.column}}}function wt(O){Y<Po||(Y>Po&&(Po=Y,mf=[]),mf.push(O))}function di(O,K){return new Bd(O,null,null,K)}function GA(O,K,re){return new Bd(Bd.buildMessage(O,K),O,K,re)}function Wa(){var O,K,re;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();return K!==r?(re=Aa(),re===r&&(re=null),re!==r?(xt=O,K=n(re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function Aa(){var O,K,re,de,Je;if(O=Y,K=Sh(),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=_g(),de!==r?(Je=Ya(),Je===r&&(Je=null),Je!==r?(xt=O,K=c(K,de,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;if(O===r)if(O=Y,K=Sh(),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=_g(),de===r&&(de=null),de!==r?(xt=O,K=f(K,de),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;return O}function Ya(){var O,K,re,de,Je;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(re=Aa(),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=p(re),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;return O}function _g(){var O;return t.charCodeAt(Y)===59?(O=h,Y++):(O=r,yt===0&&wt(E)),O===r&&(t.charCodeAt(Y)===38?(O=C,Y++):(O=r,yt===0&&wt(S))),O}function Sh(){var O,K,re;return O=Y,K=qA(),K!==r?(re=Hg(),re===r&&(re=null),re!==r?(xt=O,K=b(K,re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function Hg(){var O,K,re,de,Je,At,dr;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(re=vy(),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=Sh(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();At!==r?(xt=O,K=I(re,Je),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;return O}function vy(){var O;return t.substr(Y,2)===T?(O=T,Y+=2):(O=r,yt===0&&wt(N)),O===r&&(t.substr(Y,2)===U?(O=U,Y+=2):(O=r,yt===0&&wt(W))),O}function qA(){var O,K,re;return O=Y,K=If(),K!==r?(re=jg(),re===r&&(re=null),re!==r?(xt=O,K=ee(K,re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function jg(){var O,K,re,de,Je,At,dr;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(re=mu(),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=qA(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();At!==r?(xt=O,K=ie(re,Je),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;return O}function mu(){var O;return t.substr(Y,2)===ue?(O=ue,Y+=2):(O=r,yt===0&&wt(le)),O===r&&(t.charCodeAt(Y)===124?(O=me,Y++):(O=r,yt===0&&wt(pe))),O}function yu(){var O,K,re,de,Je,At;if(O=Y,K=bh(),K!==r)if(t.charCodeAt(Y)===61?(re=Be,Y++):(re=r,yt===0&&wt(Ce)),re!==r)if(de=WA(),de!==r){for(Je=[],At=kt();At!==r;)Je.push(At),At=kt();Je!==r?(xt=O,K=g(K,de),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;else Y=O,O=r;if(O===r)if(O=Y,K=bh(),K!==r)if(t.charCodeAt(Y)===61?(re=Be,Y++):(re=r,yt===0&&wt(Ce)),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=we(K),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;return O}function If(){var O,K,re,de,Je,At,dr,vr,Un,mi,Cs;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(t.charCodeAt(Y)===40?(re=ye,Y++):(re=r,yt===0&&wt(Ae)),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=Aa(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();if(At!==r)if(t.charCodeAt(Y)===41?(dr=se,Y++):(dr=r,yt===0&&wt(X)),dr!==r){for(vr=[],Un=kt();Un!==r;)vr.push(Un),Un=kt();if(vr!==r){for(Un=[],mi=Gn();mi!==r;)Un.push(mi),mi=Gn();if(Un!==r){for(mi=[],Cs=kt();Cs!==r;)mi.push(Cs),Cs=kt();mi!==r?(xt=O,K=De(Je,Un),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;if(O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r)if(t.charCodeAt(Y)===123?(re=Te,Y++):(re=r,yt===0&&wt(mt)),re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r)if(Je=Aa(),Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();if(At!==r)if(t.charCodeAt(Y)===125?(dr=j,Y++):(dr=r,yt===0&&wt(rt)),dr!==r){for(vr=[],Un=kt();Un!==r;)vr.push(Un),Un=kt();if(vr!==r){for(Un=[],mi=Gn();mi!==r;)Un.push(mi),mi=Gn();if(Un!==r){for(mi=[],Cs=kt();Cs!==r;)mi.push(Cs),Cs=kt();mi!==r?(xt=O,K=Fe(Je,Un),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;else Y=O,O=r;if(O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r){for(re=[],de=yu();de!==r;)re.push(de),de=yu();if(re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();if(de!==r){if(Je=[],At=Eu(),At!==r)for(;At!==r;)Je.push(At),At=Eu();else Je=r;if(Je!==r){for(At=[],dr=kt();dr!==r;)At.push(dr),dr=kt();At!==r?(xt=O,K=Ne(re,Je),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r}else Y=O,O=r;if(O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r){if(re=[],de=yu(),de!==r)for(;de!==r;)re.push(de),de=yu();else re=r;if(re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=be(re),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r}}}return O}function Ts(){var O,K,re,de,Je;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r){if(re=[],de=bi(),de!==r)for(;de!==r;)re.push(de),de=bi();else re=r;if(re!==r){for(de=[],Je=kt();Je!==r;)de.push(Je),Je=kt();de!==r?(xt=O,K=Ve(re),O=K):(Y=O,O=r)}else Y=O,O=r}else Y=O,O=r;return O}function Eu(){var O,K,re;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();if(K!==r?(re=Gn(),re!==r?(xt=O,K=ke(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r){for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();K!==r?(re=bi(),re!==r?(xt=O,K=ke(re),O=K):(Y=O,O=r)):(Y=O,O=r)}return O}function Gn(){var O,K,re,de,Je;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();return K!==r?(it.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Ue)),re===r&&(re=null),re!==r?(de=ns(),de!==r?(Je=bi(),Je!==r?(xt=O,K=x(re,de,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function ns(){var O;return t.substr(Y,2)===w?(O=w,Y+=2):(O=r,yt===0&&wt(P)),O===r&&(t.substr(Y,2)===y?(O=y,Y+=2):(O=r,yt===0&&wt(F)),O===r&&(t.charCodeAt(Y)===62?(O=z,Y++):(O=r,yt===0&&wt(Z)),O===r&&(t.substr(Y,3)===$?(O=$,Y+=3):(O=r,yt===0&&wt(oe)),O===r&&(t.substr(Y,2)===xe?(O=xe,Y+=2):(O=r,yt===0&&wt(Re)),O===r&&(t.charCodeAt(Y)===60?(O=lt,Y++):(O=r,yt===0&&wt(Ct))))))),O}function bi(){var O,K,re;for(O=Y,K=[],re=kt();re!==r;)K.push(re),re=kt();return K!==r?(re=WA(),re!==r?(xt=O,K=ke(re),O=K):(Y=O,O=r)):(Y=O,O=r),O}function WA(){var O,K,re;if(O=Y,K=[],re=Cf(),re!==r)for(;re!==r;)K.push(re),re=Cf();else K=r;return K!==r&&(xt=O,K=qt(K)),O=K,O}function Cf(){var O,K;return O=Y,K=mn(),K!==r&&(xt=O,K=ir(K)),O=K,O===r&&(O=Y,K=Gg(),K!==r&&(xt=O,K=ir(K)),O=K,O===r&&(O=Y,K=qg(),K!==r&&(xt=O,K=ir(K)),O=K,O===r&&(O=Y,K=is(),K!==r&&(xt=O,K=ir(K)),O=K))),O}function mn(){var O,K,re,de;return O=Y,t.substr(Y,2)===bt?(K=bt,Y+=2):(K=r,yt===0&&wt(gn)),K!==r?(re=yn(),re!==r?(t.charCodeAt(Y)===39?(de=br,Y++):(de=r,yt===0&&wt(Ir)),de!==r?(xt=O,K=Or(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function Gg(){var O,K,re,de;return O=Y,t.charCodeAt(Y)===39?(K=br,Y++):(K=r,yt===0&&wt(Ir)),K!==r?(re=wf(),re!==r?(t.charCodeAt(Y)===39?(de=br,Y++):(de=r,yt===0&&wt(Ir)),de!==r?(xt=O,K=Or(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function qg(){var O,K,re,de;if(O=Y,t.substr(Y,2)===nn?(K=nn,Y+=2):(K=r,yt===0&&wt(ai)),K!==r&&(xt=O,K=Io()),O=K,O===r)if(O=Y,t.charCodeAt(Y)===34?(K=ts,Y++):(K=r,yt===0&&wt($s)),K!==r){for(re=[],de=bl();de!==r;)re.push(de),de=bl();re!==r?(t.charCodeAt(Y)===34?(de=ts,Y++):(de=r,yt===0&&wt($s)),de!==r?(xt=O,K=Co(re),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;return O}function is(){var O,K,re;if(O=Y,K=[],re=bo(),re!==r)for(;re!==r;)K.push(re),re=bo();else K=r;return K!==r&&(xt=O,K=Co(K)),O=K,O}function bl(){var O,K;return O=Y,K=Xr(),K!==r&&(xt=O,K=Hi(K)),O=K,O===r&&(O=Y,K=Ph(),K!==r&&(xt=O,K=eo(K)),O=K,O===r&&(O=Y,K=VA(),K!==r&&(xt=O,K=wo(K)),O=K,O===r&&(O=Y,K=Bf(),K!==r&&(xt=O,K=QA(K)),O=K))),O}function bo(){var O,K;return O=Y,K=Xr(),K!==r&&(xt=O,K=Af(K)),O=K,O===r&&(O=Y,K=Ph(),K!==r&&(xt=O,K=dh(K)),O=K,O===r&&(O=Y,K=VA(),K!==r&&(xt=O,K=mh(K)),O=K,O===r&&(O=Y,K=Sy(),K!==r&&(xt=O,K=to(K)),O=K,O===r&&(O=Y,K=Dh(),K!==r&&(xt=O,K=QA(K)),O=K)))),O}function wf(){var O,K,re;for(O=Y,K=[],jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Rs));re!==r;)K.push(re),jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Rs));return K!==r&&(xt=O,K=ro(K)),O=K,O}function Bf(){var O,K,re;if(O=Y,K=[],re=xl(),re===r&&(ou.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(au))),re!==r)for(;re!==r;)K.push(re),re=xl(),re===r&&(ou.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(au)));else K=r;return K!==r&&(xt=O,K=ro(K)),O=K,O}function xl(){var O,K,re;return O=Y,t.substr(Y,2)===lu?(K=lu,Y+=2):(K=r,yt===0&&wt(RA)),K!==r&&(xt=O,K=TA()),O=K,O===r&&(O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(FA.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(gr)),re!==r?(xt=O,K=Bo(re),O=K):(Y=O,O=r)):(Y=O,O=r)),O}function yn(){var O,K,re;for(O=Y,K=[],re=xo(),re===r&&(jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Rs)));re!==r;)K.push(re),re=xo(),re===r&&(jn.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Rs)));return K!==r&&(xt=O,K=ro(K)),O=K,O}function xo(){var O,K,re;return O=Y,t.substr(Y,2)===Me?(K=Me,Y+=2):(K=r,yt===0&&wt(cu)),K!==r&&(xt=O,K=Cr()),O=K,O===r&&(O=Y,t.substr(Y,2)===pf?(K=pf,Y+=2):(K=r,yt===0&&wt(NA)),K!==r&&(xt=O,K=OA()),O=K,O===r&&(O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(uu.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(fu)),re!==r?(xt=O,K=oc(),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===ve?(K=ve,Y+=2):(K=r,yt===0&&wt(Nt)),K!==r&&(xt=O,K=ac()),O=K,O===r&&(O=Y,t.substr(Y,2)===Oi?(K=Oi,Y+=2):(K=r,yt===0&&wt(no)),K!==r&&(xt=O,K=Tt()),O=K,O===r&&(O=Y,t.substr(Y,2)===xn?(K=xn,Y+=2):(K=r,yt===0&&wt(la)),K!==r&&(xt=O,K=ji()),O=K,O===r&&(O=Y,t.substr(Y,2)===Li?(K=Li,Y+=2):(K=r,yt===0&&wt(Na)),K!==r&&(xt=O,K=dn()),O=K,O===r&&(O=Y,t.substr(Y,2)===Kn?(K=Kn,Y+=2):(K=r,yt===0&&wt(Au)),K!==r&&(xt=O,K=yh()),O=K,O===r&&(O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(Oa.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(La)),re!==r?(xt=O,K=Bo(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Iu()))))))))),O}function Iu(){var O,K,re,de,Je,At,dr,vr,Un,mi,Cs,JA;return O=Y,t.charCodeAt(Y)===92?(K=oa,Y++):(K=r,yt===0&&wt(aa)),K!==r?(re=pa(),re!==r?(xt=O,K=Ma(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===$e?(K=$e,Y+=2):(K=r,yt===0&&wt(Ua)),K!==r?(re=Y,de=Y,Je=pa(),Je!==r?(At=Fs(),At!==r?(Je=[Je,At],de=Je):(Y=de,de=r)):(Y=de,de=r),de===r&&(de=pa()),de!==r?re=t.substring(re,Y):re=de,re!==r?(xt=O,K=Ma(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===hf?(K=hf,Y+=2):(K=r,yt===0&&wt(lc)),K!==r?(re=Y,de=Y,Je=Fs(),Je!==r?(At=Fs(),At!==r?(dr=Fs(),dr!==r?(vr=Fs(),vr!==r?(Je=[Je,At,dr,vr],de=Je):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r),de!==r?re=t.substring(re,Y):re=de,re!==r?(xt=O,K=Ma(re),O=K):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===wn?(K=wn,Y+=2):(K=r,yt===0&&wt(ca)),K!==r?(re=Y,de=Y,Je=Fs(),Je!==r?(At=Fs(),At!==r?(dr=Fs(),dr!==r?(vr=Fs(),vr!==r?(Un=Fs(),Un!==r?(mi=Fs(),mi!==r?(Cs=Fs(),Cs!==r?(JA=Fs(),JA!==r?(Je=[Je,At,dr,vr,Un,mi,Cs,JA],de=Je):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r)):(Y=de,de=r),de!==r?re=t.substring(re,Y):re=de,re!==r?(xt=O,K=LA(re),O=K):(Y=O,O=r)):(Y=O,O=r)))),O}function pa(){var O;return MA.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(ua)),O}function Fs(){var O;return Bl.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(Mt)),O}function Dh(){var O,K,re,de,Je;if(O=Y,K=[],re=Y,t.charCodeAt(Y)===92?(de=oa,Y++):(de=r,yt===0&&wt(aa)),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r),re===r&&(re=Y,t.substr(Y,2)===fa?(de=fa,Y+=2):(de=r,yt===0&&wt(Ha)),de!==r&&(xt=re,de=rs()),re=de,re===r&&(re=Y,de=Y,yt++,Je=Dy(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r))),re!==r)for(;re!==r;)K.push(re),re=Y,t.charCodeAt(Y)===92?(de=oa,Y++):(de=r,yt===0&&wt(aa)),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r),re===r&&(re=Y,t.substr(Y,2)===fa?(de=fa,Y+=2):(de=r,yt===0&&wt(Ha)),de!==r&&(xt=re,de=rs()),re=de,re===r&&(re=Y,de=Y,yt++,Je=Dy(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r)));else K=r;return K!==r&&(xt=O,K=ro(K)),O=K,O}function YA(){var O,K,re,de,Je,At;if(O=Y,t.charCodeAt(Y)===45?(K=cc,Y++):(K=r,yt===0&&wt(pu)),K===r&&(t.charCodeAt(Y)===43?(K=uc,Y++):(K=r,yt===0&&wt(ja))),K===r&&(K=null),K!==r){if(re=[],it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue)),de!==r)for(;de!==r;)re.push(de),it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue));else re=r;if(re!==r)if(t.charCodeAt(Y)===46?(de=Mi,Y++):(de=r,yt===0&&wt(Is)),de!==r){if(Je=[],it.test(t.charAt(Y))?(At=t.charAt(Y),Y++):(At=r,yt===0&&wt(Ue)),At!==r)for(;At!==r;)Je.push(At),it.test(t.charAt(Y))?(At=t.charAt(Y),Y++):(At=r,yt===0&&wt(Ue));else Je=r;Je!==r?(xt=O,K=vl(K,re,Je),O=K):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;if(O===r){if(O=Y,t.charCodeAt(Y)===45?(K=cc,Y++):(K=r,yt===0&&wt(pu)),K===r&&(t.charCodeAt(Y)===43?(K=uc,Y++):(K=r,yt===0&&wt(ja))),K===r&&(K=null),K!==r){if(re=[],it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue)),de!==r)for(;de!==r;)re.push(de),it.test(t.charAt(Y))?(de=t.charAt(Y),Y++):(de=r,yt===0&&wt(Ue));else re=r;re!==r?(xt=O,K=gf(K,re),O=K):(Y=O,O=r)}else Y=O,O=r;if(O===r&&(O=Y,K=VA(),K!==r&&(xt=O,K=fc(K)),O=K,O===r&&(O=Y,K=pc(),K!==r&&(xt=O,K=wi(K)),O=K,O===r)))if(O=Y,t.charCodeAt(Y)===40?(K=ye,Y++):(K=r,yt===0&&wt(Ae)),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();if(re!==r)if(de=io(),de!==r){for(Je=[],At=kt();At!==r;)Je.push(At),At=kt();Je!==r?(t.charCodeAt(Y)===41?(At=se,Y++):(At=r,yt===0&&wt(X)),At!==r?(xt=O,K=Qn(de),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r}return O}function vf(){var O,K,re,de,Je,At,dr,vr;if(O=Y,K=YA(),K!==r){for(re=[],de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===42?(At=Ac,Y++):(At=r,yt===0&&wt(Ke)),At===r&&(t.charCodeAt(Y)===47?(At=st,Y++):(At=r,yt===0&&wt(St))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=YA(),vr!==r?(xt=de,Je=lr(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r;for(;de!==r;){for(re.push(de),de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===42?(At=Ac,Y++):(At=r,yt===0&&wt(Ke)),At===r&&(t.charCodeAt(Y)===47?(At=st,Y++):(At=r,yt===0&&wt(St))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=YA(),vr!==r?(xt=de,Je=lr(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r}re!==r?(xt=O,K=te(K,re),O=K):(Y=O,O=r)}else Y=O,O=r;return O}function io(){var O,K,re,de,Je,At,dr,vr;if(O=Y,K=vf(),K!==r){for(re=[],de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===43?(At=uc,Y++):(At=r,yt===0&&wt(ja)),At===r&&(t.charCodeAt(Y)===45?(At=cc,Y++):(At=r,yt===0&&wt(pu))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=vf(),vr!==r?(xt=de,Je=Ee(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r;for(;de!==r;){for(re.push(de),de=Y,Je=[],At=kt();At!==r;)Je.push(At),At=kt();if(Je!==r)if(t.charCodeAt(Y)===43?(At=uc,Y++):(At=r,yt===0&&wt(ja)),At===r&&(t.charCodeAt(Y)===45?(At=cc,Y++):(At=r,yt===0&&wt(pu))),At!==r){for(dr=[],vr=kt();vr!==r;)dr.push(vr),vr=kt();dr!==r?(vr=vf(),vr!==r?(xt=de,Je=Ee(K,At,vr),de=Je):(Y=de,de=r)):(Y=de,de=r)}else Y=de,de=r;else Y=de,de=r}re!==r?(xt=O,K=te(K,re),O=K):(Y=O,O=r)}else Y=O,O=r;return O}function Xr(){var O,K,re,de,Je,At;if(O=Y,t.substr(Y,3)===Oe?(K=Oe,Y+=3):(K=r,yt===0&&wt(dt)),K!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();if(re!==r)if(de=io(),de!==r){for(Je=[],At=kt();At!==r;)Je.push(At),At=kt();Je!==r?(t.substr(Y,2)===Et?(At=Et,Y+=2):(At=r,yt===0&&wt(Pt)),At!==r?(xt=O,K=tr(de),O=K):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r}else Y=O,O=r;return O}function Ph(){var O,K,re,de;return O=Y,t.substr(Y,2)===An?(K=An,Y+=2):(K=r,yt===0&&wt(li)),K!==r?(re=Aa(),re!==r?(t.charCodeAt(Y)===41?(de=se,Y++):(de=r,yt===0&&wt(X)),de!==r?(xt=O,K=Gi(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O}function VA(){var O,K,re,de,Je,At;return O=Y,t.substr(Y,2)===Rn?(K=Rn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,2)===my?(de=my,Y+=2):(de=r,yt===0&&wt(X1)),de!==r?(Je=Ts(),Je!==r?(t.charCodeAt(Y)===125?(At=j,Y++):(At=r,yt===0&&wt(rt)),At!==r?(xt=O,K=vo(re,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Rn?(K=Rn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,3)===yy?(de=yy,Y+=3):(de=r,yt===0&&wt(Eh)),de!==r?(xt=O,K=$1(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Rn?(K=Rn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,2)===So?(de=So,Y+=2):(de=r,yt===0&&wt(Ih)),de!==r?(Je=Ts(),Je!==r?(t.charCodeAt(Y)===125?(At=j,Y++):(At=r,yt===0&&wt(rt)),At!==r?(xt=O,K=Ch(re,Je),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Rn?(K=Rn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.substr(Y,3)===hu?(de=hu,Y+=3):(de=r,yt===0&&wt(wh)),de!==r?(xt=O,K=Fg(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.substr(Y,2)===Rn?(K=Rn,Y+=2):(K=r,yt===0&&wt(Ga)),K!==r?(re=pc(),re!==r?(t.charCodeAt(Y)===125?(de=j,Y++):(de=r,yt===0&&wt(rt)),de!==r?(xt=O,K=Ng(re),O=K):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r),O===r&&(O=Y,t.charCodeAt(Y)===36?(K=Og,Y++):(K=r,yt===0&&wt(Ey)),K!==r?(re=pc(),re!==r?(xt=O,K=Ng(re),O=K):(Y=O,O=r)):(Y=O,O=r)))))),O}function Sy(){var O,K,re;return O=Y,K=Wg(),K!==r?(xt=Y,re=df(K),re?re=void 0:re=r,re!==r?(xt=O,K=Do(K),O=K):(Y=O,O=r)):(Y=O,O=r),O}function Wg(){var O,K,re,de,Je;if(O=Y,K=[],re=Y,de=Y,yt++,Je=xh(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r),re!==r)for(;re!==r;)K.push(re),re=Y,de=Y,yt++,Je=xh(),yt--,Je===r?de=void 0:(Y=de,de=r),de!==r?(t.length>Y?(Je=t.charAt(Y),Y++):(Je=r,yt===0&&wt(kn)),Je!==r?(xt=re,de=Bo(Je),re=de):(Y=re,re=r)):(Y=re,re=r);else K=r;return K!==r&&(xt=O,K=ro(K)),O=K,O}function bh(){var O,K,re;if(O=Y,K=[],Sl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Bh)),re!==r)for(;re!==r;)K.push(re),Sl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Bh));else K=r;return K!==r&&(xt=O,K=Lg()),O=K,O}function pc(){var O,K,re;if(O=Y,K=[],Dl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Pl)),re!==r)for(;re!==r;)K.push(re),Dl.test(t.charAt(Y))?(re=t.charAt(Y),Y++):(re=r,yt===0&&wt(Pl));else K=r;return K!==r&&(xt=O,K=Lg()),O=K,O}function Dy(){var O;return Iy.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(UA)),O}function xh(){var O;return Cy.test(t.charAt(Y))?(O=t.charAt(Y),Y++):(O=r,yt===0&&wt(wy)),O}function kt(){var O,K;if(O=[],_A.test(t.charAt(Y))?(K=t.charAt(Y),Y++):(K=r,yt===0&&wt(HA)),K!==r)for(;K!==r;)O.push(K),_A.test(t.charAt(Y))?(K=t.charAt(Y),Y++):(K=r,yt===0&&wt(HA));else O=r;return O}if(gu=a(),gu!==r&&Y===t.length)return gu;throw gu!==r&&Y<t.length&&wt(qa()),GA(mf,Po<t.length?t.charAt(Po):null,Po<t.length?Ef(Po,Po+1):Ef(Po,Po))}pee.exports={SyntaxError:Bd,parse:Fqe}});function ux(t,e={isGlobPattern:()=>!1}){try{return(0,gee.parse)(t,e)}catch(r){throw r.location&&(r.message=r.message.replace(/(\\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function fE(t,{endSemicolon:e=!1}={}){return t.map(({command:r,type:s},a)=>`${fx(r)}${s===\";\"?a!==t.length-1||e?\";\":\"\":\" &\"}`).join(\" \")}function fx(t){return`${AE(t.chain)}${t.then?` ${_U(t.then)}`:\"\"}`}function _U(t){return`${t.type} ${fx(t.line)}`}function AE(t){return`${jU(t)}${t.then?` ${HU(t.then)}`:\"\"}`}function HU(t){return`${t.type} ${AE(t.chain)}`}function jU(t){switch(t.type){case\"command\":return`${t.envs.length>0?`${t.envs.map(e=>cx(e)).join(\" \")} `:\"\"}${t.args.map(e=>GU(e)).join(\" \")}`;case\"subshell\":return`(${fE(t.subshell)})${t.args.length>0?` ${t.args.map(e=>H2(e)).join(\" \")}`:\"\"}`;case\"group\":return`{ ${fE(t.group,{endSemicolon:!0})} }${t.args.length>0?` ${t.args.map(e=>H2(e)).join(\" \")}`:\"\"}`;case\"envs\":return t.envs.map(e=>cx(e)).join(\" \");default:throw new Error(`Unsupported command type:  \"${t.type}\"`)}}function cx(t){return`${t.name}=${t.args[0]?vd(t.args[0]):\"\"}`}function GU(t){switch(t.type){case\"redirection\":return H2(t);case\"argument\":return vd(t);default:throw new Error(`Unsupported argument type: \"${t.type}\"`)}}function H2(t){return`${t.subtype} ${t.args.map(e=>vd(e)).join(\" \")}`}function vd(t){return t.segments.map(e=>qU(e)).join(\"\")}function qU(t){let e=(s,a)=>a?`\"${s}\"`:s,r=s=>s===\"\"?\"''\":s.match(/[()}<>$|&;\"'\\n\\t ]/)?s.match(/['\\t\\p{C}]/u)?s.match(/'/)?`\"${s.replace(/[\"$\\t\\p{C}]/u,Oqe)}\"`:`$'${s.replace(/[\\t\\p{C}]/u,mee)}'`:`'${s}'`:s;switch(t.type){case\"text\":return r(t.text);case\"glob\":return t.pattern;case\"shell\":return e(`$(${fE(t.shell)})`,t.quoted);case\"variable\":return e(typeof t.defaultValue>\"u\"?typeof t.alternativeValue>\"u\"?`\\${${t.name}}`:t.alternativeValue.length===0?`\\${${t.name}:+}`:`\\${${t.name}:+${t.alternativeValue.map(s=>vd(s)).join(\" \")}}`:t.defaultValue.length===0?`\\${${t.name}:-}`:`\\${${t.name}:-${t.defaultValue.map(s=>vd(s)).join(\" \")}}`,t.quoted);case\"arithmetic\":return`$(( ${Ax(t.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: \"${t.type}\"`)}}function Ax(t){let e=a=>{switch(a){case\"addition\":return\"+\";case\"subtraction\":return\"-\";case\"multiplication\":return\"*\";case\"division\":return\"/\";default:throw new Error(`Can't extract operator from arithmetic expression of type \"${a}\"`)}},r=(a,n)=>n?`( ${a} )`:a,s=a=>r(Ax(a),![\"number\",\"variable\"].includes(a.type));switch(t.type){case\"number\":return String(t.value);case\"variable\":return t.name;default:return`${s(t.left)} ${e(t.type)} ${s(t.right)}`}}var gee,dee,Nqe,mee,Oqe,yee=Ze(()=>{gee=ut(hee());dee=new Map([[\"\\f\",\"\\\\f\"],[`\n`,\"\\\\n\"],[\"\\r\",\"\\\\r\"],[\"\t\",\"\\\\t\"],[\"\\v\",\"\\\\v\"],[\"\\0\",\"\\\\0\"]]),Nqe=new Map([[\"\\\\\",\"\\\\\\\\\"],[\"$\",\"\\\\$\"],['\"','\\\\\"'],...Array.from(dee,([t,e])=>[t,`\"$'${e}'\"`])]),mee=t=>dee.get(t)??`\\\\x${t.charCodeAt(0).toString(16).padStart(2,\"0\")}`,Oqe=t=>Nqe.get(t)??`\"$'${mee(t)}'\"`});var Iee=_((Wkt,Eee)=>{\"use strict\";function Lqe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Sd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,Sd)}Lqe(Sd,Error);Sd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function Mqe(t,e){e=e!==void 0?e:{};var r={},s={resolution:Ne},a=Ne,n=\"/\",c=ye(\"/\",!1),f=function(Ue,x){return{from:Ue,descriptor:x}},p=function(Ue){return{descriptor:Ue}},h=\"@\",E=ye(\"@\",!1),C=function(Ue,x){return{fullName:Ue,description:x}},S=function(Ue){return{fullName:Ue}},b=function(){return Be()},I=/^[^\\/@]/,T=Ae([\"/\",\"@\"],!0,!1),N=/^[^\\/]/,U=Ae([\"/\"],!0,!1),W=0,ee=0,ie=[{line:1,column:1}],ue=0,le=[],me=0,pe;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function Be(){return t.substring(ee,W)}function Ce(){return mt(ee,W)}function g(Ue,x){throw x=x!==void 0?x:mt(ee,W),Fe([De(Ue)],t.substring(ee,W),x)}function we(Ue,x){throw x=x!==void 0?x:mt(ee,W),rt(Ue,x)}function ye(Ue,x){return{type:\"literal\",text:Ue,ignoreCase:x}}function Ae(Ue,x,w){return{type:\"class\",parts:Ue,inverted:x,ignoreCase:w}}function se(){return{type:\"any\"}}function X(){return{type:\"end\"}}function De(Ue){return{type:\"other\",description:Ue}}function Te(Ue){var x=ie[Ue],w;if(x)return x;for(w=Ue-1;!ie[w];)w--;for(x=ie[w],x={line:x.line,column:x.column};w<Ue;)t.charCodeAt(w)===10?(x.line++,x.column=1):x.column++,w++;return ie[Ue]=x,x}function mt(Ue,x){var w=Te(Ue),P=Te(x);return{start:{offset:Ue,line:w.line,column:w.column},end:{offset:x,line:P.line,column:P.column}}}function j(Ue){W<ue||(W>ue&&(ue=W,le=[]),le.push(Ue))}function rt(Ue,x){return new Sd(Ue,null,null,x)}function Fe(Ue,x,w){return new Sd(Sd.buildMessage(Ue,x),Ue,x,w)}function Ne(){var Ue,x,w,P;return Ue=W,x=be(),x!==r?(t.charCodeAt(W)===47?(w=n,W++):(w=r,me===0&&j(c)),w!==r?(P=be(),P!==r?(ee=Ue,x=f(x,P),Ue=x):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r),Ue===r&&(Ue=W,x=be(),x!==r&&(ee=Ue,x=p(x)),Ue=x),Ue}function be(){var Ue,x,w,P;return Ue=W,x=Ve(),x!==r?(t.charCodeAt(W)===64?(w=h,W++):(w=r,me===0&&j(E)),w!==r?(P=it(),P!==r?(ee=Ue,x=C(x,P),Ue=x):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r),Ue===r&&(Ue=W,x=Ve(),x!==r&&(ee=Ue,x=S(x)),Ue=x),Ue}function Ve(){var Ue,x,w,P,y;return Ue=W,t.charCodeAt(W)===64?(x=h,W++):(x=r,me===0&&j(E)),x!==r?(w=ke(),w!==r?(t.charCodeAt(W)===47?(P=n,W++):(P=r,me===0&&j(c)),P!==r?(y=ke(),y!==r?(ee=Ue,x=b(),Ue=x):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r)):(W=Ue,Ue=r),Ue===r&&(Ue=W,x=ke(),x!==r&&(ee=Ue,x=b()),Ue=x),Ue}function ke(){var Ue,x,w;if(Ue=W,x=[],I.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(T)),w!==r)for(;w!==r;)x.push(w),I.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(T));else x=r;return x!==r&&(ee=Ue,x=b()),Ue=x,Ue}function it(){var Ue,x,w;if(Ue=W,x=[],N.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(U)),w!==r)for(;w!==r;)x.push(w),N.test(t.charAt(W))?(w=t.charAt(W),W++):(w=r,me===0&&j(U));else x=r;return x!==r&&(ee=Ue,x=b()),Ue=x,Ue}if(pe=a(),pe!==r&&W===t.length)return pe;throw pe!==r&&W<t.length&&j(X()),Fe(le,ue<t.length?t.charAt(ue):null,ue<t.length?mt(ue,ue+1):mt(ue,ue))}Eee.exports={SyntaxError:Sd,parse:Mqe}});function px(t){let e=t.match(/^\\*{1,2}\\/(.*)/);if(e)throw new Error(`The override for '${t}' includes a glob pattern. Glob patterns have been removed since their behaviours don't match what you'd expect. Set the override to '${e[1]}' instead.`);try{return(0,Cee.parse)(t)}catch(r){throw r.location&&(r.message=r.message.replace(/(\\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function hx(t){let e=\"\";return t.from&&(e+=t.from.fullName,t.from.description&&(e+=`@${t.from.description}`),e+=\"/\"),e+=t.descriptor.fullName,t.descriptor.description&&(e+=`@${t.descriptor.description}`),e}var Cee,wee=Ze(()=>{Cee=ut(Iee())});var Pd=_((Vkt,Dd)=>{\"use strict\";function Bee(t){return typeof t>\"u\"||t===null}function Uqe(t){return typeof t==\"object\"&&t!==null}function _qe(t){return Array.isArray(t)?t:Bee(t)?[]:[t]}function Hqe(t,e){var r,s,a,n;if(e)for(n=Object.keys(e),r=0,s=n.length;r<s;r+=1)a=n[r],t[a]=e[a];return t}function jqe(t,e){var r=\"\",s;for(s=0;s<e;s+=1)r+=t;return r}function Gqe(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}Dd.exports.isNothing=Bee;Dd.exports.isObject=Uqe;Dd.exports.toArray=_qe;Dd.exports.repeat=jqe;Dd.exports.isNegativeZero=Gqe;Dd.exports.extend=Hqe});var pE=_((Jkt,vee)=>{\"use strict\";function j2(t,e){Error.call(this),this.name=\"YAMLException\",this.reason=t,this.mark=e,this.message=(this.reason||\"(unknown reason)\")+(this.mark?\" \"+this.mark.toString():\"\"),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||\"\"}j2.prototype=Object.create(Error.prototype);j2.prototype.constructor=j2;j2.prototype.toString=function(e){var r=this.name+\": \";return r+=this.reason||\"(unknown reason)\",!e&&this.mark&&(r+=\" \"+this.mark.toString()),r};vee.exports=j2});var Pee=_((Kkt,Dee)=>{\"use strict\";var See=Pd();function WU(t,e,r,s,a){this.name=t,this.buffer=e,this.position=r,this.line=s,this.column=a}WU.prototype.getSnippet=function(e,r){var s,a,n,c,f;if(!this.buffer)return null;for(e=e||4,r=r||75,s=\"\",a=this.position;a>0&&`\\0\\r\n\\x85\\u2028\\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){s=\" ... \",a+=5;break}for(n=\"\",c=this.position;c<this.buffer.length&&`\\0\\r\n\\x85\\u2028\\u2029`.indexOf(this.buffer.charAt(c))===-1;)if(c+=1,c-this.position>r/2-1){n=\" ... \",c-=5;break}return f=this.buffer.slice(a,c),See.repeat(\" \",e)+s+f+n+`\n`+See.repeat(\" \",e+this.position-a+s.length)+\"^\"};WU.prototype.toString=function(e){var r,s=\"\";return this.name&&(s+='in \"'+this.name+'\" '),s+=\"at line \"+(this.line+1)+\", column \"+(this.column+1),e||(r=this.getSnippet(),r&&(s+=`:\n`+r)),s};Dee.exports=WU});var Ss=_((zkt,xee)=>{\"use strict\";var bee=pE(),qqe=[\"kind\",\"resolve\",\"construct\",\"instanceOf\",\"predicate\",\"represent\",\"defaultStyle\",\"styleAliases\"],Wqe=[\"scalar\",\"sequence\",\"mapping\"];function Yqe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(s){e[String(s)]=r})}),e}function Vqe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(qqe.indexOf(r)===-1)throw new bee('Unknown option \"'+r+'\" is met in definition of \"'+t+'\" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=Yqe(e.styleAliases||null),Wqe.indexOf(this.kind)===-1)throw new bee('Unknown kind \"'+this.kind+'\" is specified for \"'+t+'\" YAML type.')}xee.exports=Vqe});var bd=_((Zkt,Qee)=>{\"use strict\";var kee=Pd(),gx=pE(),Jqe=Ss();function YU(t,e,r){var s=[];return t.include.forEach(function(a){r=YU(a,e,r)}),t[e].forEach(function(a){r.forEach(function(n,c){n.tag===a.tag&&n.kind===a.kind&&s.push(c)}),r.push(a)}),r.filter(function(a,n){return s.indexOf(n)===-1})}function Kqe(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function s(a){t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(s);return t}function hE(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!==\"scalar\")throw new gx(\"There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.\")}),this.compiledImplicit=YU(this,\"implicit\",[]),this.compiledExplicit=YU(this,\"explicit\",[]),this.compiledTypeMap=Kqe(this.compiledImplicit,this.compiledExplicit)}hE.DEFAULT=null;hE.create=function(){var e,r;switch(arguments.length){case 1:e=hE.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new gx(\"Wrong number of arguments for Schema.create function\")}if(e=kee.toArray(e),r=kee.toArray(r),!e.every(function(s){return s instanceof hE}))throw new gx(\"Specified list of super schemas (or a single Schema object) contains a non-Schema object.\");if(!r.every(function(s){return s instanceof Jqe}))throw new gx(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\");return new hE({include:e,explicit:r})};Qee.exports=hE});var Tee=_((Xkt,Ree)=>{\"use strict\";var zqe=Ss();Ree.exports=new zqe(\"tag:yaml.org,2002:str\",{kind:\"scalar\",construct:function(t){return t!==null?t:\"\"}})});var Nee=_(($kt,Fee)=>{\"use strict\";var Zqe=Ss();Fee.exports=new Zqe(\"tag:yaml.org,2002:seq\",{kind:\"sequence\",construct:function(t){return t!==null?t:[]}})});var Lee=_((eQt,Oee)=>{\"use strict\";var Xqe=Ss();Oee.exports=new Xqe(\"tag:yaml.org,2002:map\",{kind:\"mapping\",construct:function(t){return t!==null?t:{}}})});var dx=_((tQt,Mee)=>{\"use strict\";var $qe=bd();Mee.exports=new $qe({explicit:[Tee(),Nee(),Lee()]})});var _ee=_((rQt,Uee)=>{\"use strict\";var e5e=Ss();function t5e(t){if(t===null)return!0;var e=t.length;return e===1&&t===\"~\"||e===4&&(t===\"null\"||t===\"Null\"||t===\"NULL\")}function r5e(){return null}function n5e(t){return t===null}Uee.exports=new e5e(\"tag:yaml.org,2002:null\",{kind:\"scalar\",resolve:t5e,construct:r5e,predicate:n5e,represent:{canonical:function(){return\"~\"},lowercase:function(){return\"null\"},uppercase:function(){return\"NULL\"},camelcase:function(){return\"Null\"}},defaultStyle:\"lowercase\"})});var jee=_((nQt,Hee)=>{\"use strict\";var i5e=Ss();function s5e(t){if(t===null)return!1;var e=t.length;return e===4&&(t===\"true\"||t===\"True\"||t===\"TRUE\")||e===5&&(t===\"false\"||t===\"False\"||t===\"FALSE\")}function o5e(t){return t===\"true\"||t===\"True\"||t===\"TRUE\"}function a5e(t){return Object.prototype.toString.call(t)===\"[object Boolean]\"}Hee.exports=new i5e(\"tag:yaml.org,2002:bool\",{kind:\"scalar\",resolve:s5e,construct:o5e,predicate:a5e,represent:{lowercase:function(t){return t?\"true\":\"false\"},uppercase:function(t){return t?\"TRUE\":\"FALSE\"},camelcase:function(t){return t?\"True\":\"False\"}},defaultStyle:\"lowercase\"})});var qee=_((iQt,Gee)=>{\"use strict\";var l5e=Pd(),c5e=Ss();function u5e(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function f5e(t){return 48<=t&&t<=55}function A5e(t){return 48<=t&&t<=57}function p5e(t){if(t===null)return!1;var e=t.length,r=0,s=!1,a;if(!e)return!1;if(a=t[r],(a===\"-\"||a===\"+\")&&(a=t[++r]),a===\"0\"){if(r+1===e)return!0;if(a=t[++r],a===\"b\"){for(r++;r<e;r++)if(a=t[r],a!==\"_\"){if(a!==\"0\"&&a!==\"1\")return!1;s=!0}return s&&a!==\"_\"}if(a===\"x\"){for(r++;r<e;r++)if(a=t[r],a!==\"_\"){if(!u5e(t.charCodeAt(r)))return!1;s=!0}return s&&a!==\"_\"}for(;r<e;r++)if(a=t[r],a!==\"_\"){if(!f5e(t.charCodeAt(r)))return!1;s=!0}return s&&a!==\"_\"}if(a===\"_\")return!1;for(;r<e;r++)if(a=t[r],a!==\"_\"){if(a===\":\")break;if(!A5e(t.charCodeAt(r)))return!1;s=!0}return!s||a===\"_\"?!1:a!==\":\"?!0:/^(:[0-5]?[0-9])+$/.test(t.slice(r))}function h5e(t){var e=t,r=1,s,a,n=[];return e.indexOf(\"_\")!==-1&&(e=e.replace(/_/g,\"\")),s=e[0],(s===\"-\"||s===\"+\")&&(s===\"-\"&&(r=-1),e=e.slice(1),s=e[0]),e===\"0\"?0:s===\"0\"?e[1]===\"b\"?r*parseInt(e.slice(2),2):e[1]===\"x\"?r*parseInt(e,16):r*parseInt(e,8):e.indexOf(\":\")!==-1?(e.split(\":\").forEach(function(c){n.unshift(parseInt(c,10))}),e=0,a=1,n.forEach(function(c){e+=c*a,a*=60}),r*e):r*parseInt(e,10)}function g5e(t){return Object.prototype.toString.call(t)===\"[object Number]\"&&t%1===0&&!l5e.isNegativeZero(t)}Gee.exports=new c5e(\"tag:yaml.org,2002:int\",{kind:\"scalar\",resolve:p5e,construct:h5e,predicate:g5e,represent:{binary:function(t){return t>=0?\"0b\"+t.toString(2):\"-0b\"+t.toString(2).slice(1)},octal:function(t){return t>=0?\"0\"+t.toString(8):\"-0\"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?\"0x\"+t.toString(16).toUpperCase():\"-0x\"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:\"decimal\",styleAliases:{binary:[2,\"bin\"],octal:[8,\"oct\"],decimal:[10,\"dec\"],hexadecimal:[16,\"hex\"]}})});var Vee=_((sQt,Yee)=>{\"use strict\";var Wee=Pd(),d5e=Ss(),m5e=new RegExp(\"^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\\\.[0-9_]*|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$\");function y5e(t){return!(t===null||!m5e.test(t)||t[t.length-1]===\"_\")}function E5e(t){var e,r,s,a;return e=t.replace(/_/g,\"\").toLowerCase(),r=e[0]===\"-\"?-1:1,a=[],\"+-\".indexOf(e[0])>=0&&(e=e.slice(1)),e===\".inf\"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===\".nan\"?NaN:e.indexOf(\":\")>=0?(e.split(\":\").forEach(function(n){a.unshift(parseFloat(n,10))}),e=0,s=1,a.forEach(function(n){e+=n*s,s*=60}),r*e):r*parseFloat(e,10)}var I5e=/^[-+]?[0-9]+e/;function C5e(t,e){var r;if(isNaN(t))switch(e){case\"lowercase\":return\".nan\";case\"uppercase\":return\".NAN\";case\"camelcase\":return\".NaN\"}else if(Number.POSITIVE_INFINITY===t)switch(e){case\"lowercase\":return\".inf\";case\"uppercase\":return\".INF\";case\"camelcase\":return\".Inf\"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case\"lowercase\":return\"-.inf\";case\"uppercase\":return\"-.INF\";case\"camelcase\":return\"-.Inf\"}else if(Wee.isNegativeZero(t))return\"-0.0\";return r=t.toString(10),I5e.test(r)?r.replace(\"e\",\".e\"):r}function w5e(t){return Object.prototype.toString.call(t)===\"[object Number]\"&&(t%1!==0||Wee.isNegativeZero(t))}Yee.exports=new d5e(\"tag:yaml.org,2002:float\",{kind:\"scalar\",resolve:y5e,construct:E5e,predicate:w5e,represent:C5e,defaultStyle:\"lowercase\"})});var VU=_((oQt,Jee)=>{\"use strict\";var B5e=bd();Jee.exports=new B5e({include:[dx()],implicit:[_ee(),jee(),qee(),Vee()]})});var JU=_((aQt,Kee)=>{\"use strict\";var v5e=bd();Kee.exports=new v5e({include:[VU()]})});var $ee=_((lQt,Xee)=>{\"use strict\";var S5e=Ss(),zee=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$\"),Zee=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\\\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\\\.([0-9]*))?(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$\");function D5e(t){return t===null?!1:zee.exec(t)!==null||Zee.exec(t)!==null}function P5e(t){var e,r,s,a,n,c,f,p=0,h=null,E,C,S;if(e=zee.exec(t),e===null&&(e=Zee.exec(t)),e===null)throw new Error(\"Date resolve error\");if(r=+e[1],s=+e[2]-1,a=+e[3],!e[4])return new Date(Date.UTC(r,s,a));if(n=+e[4],c=+e[5],f=+e[6],e[7]){for(p=e[7].slice(0,3);p.length<3;)p+=\"0\";p=+p}return e[9]&&(E=+e[10],C=+(e[11]||0),h=(E*60+C)*6e4,e[9]===\"-\"&&(h=-h)),S=new Date(Date.UTC(r,s,a,n,c,f,p)),h&&S.setTime(S.getTime()-h),S}function b5e(t){return t.toISOString()}Xee.exports=new S5e(\"tag:yaml.org,2002:timestamp\",{kind:\"scalar\",resolve:D5e,construct:P5e,instanceOf:Date,represent:b5e})});var tte=_((cQt,ete)=>{\"use strict\";var x5e=Ss();function k5e(t){return t===\"<<\"||t===null}ete.exports=new x5e(\"tag:yaml.org,2002:merge\",{kind:\"scalar\",resolve:k5e})});var ite=_((uQt,nte)=>{\"use strict\";var xd;try{rte=Ie,xd=rte(\"buffer\").Buffer}catch{}var rte,Q5e=Ss(),KU=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\\r`;function R5e(t){if(t===null)return!1;var e,r,s=0,a=t.length,n=KU;for(r=0;r<a;r++)if(e=n.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;s+=6}return s%8===0}function T5e(t){var e,r,s=t.replace(/[\\r\\n=]/g,\"\"),a=s.length,n=KU,c=0,f=[];for(e=0;e<a;e++)e%4===0&&e&&(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)),c=c<<6|n.indexOf(s.charAt(e));return r=a%4*6,r===0?(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)):r===18?(f.push(c>>10&255),f.push(c>>2&255)):r===12&&f.push(c>>4&255),xd?xd.from?xd.from(f):new xd(f):f}function F5e(t){var e=\"\",r=0,s,a,n=t.length,c=KU;for(s=0;s<n;s++)s%3===0&&s&&(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]),r=(r<<8)+t[s];return a=n%3,a===0?(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]):a===2?(e+=c[r>>10&63],e+=c[r>>4&63],e+=c[r<<2&63],e+=c[64]):a===1&&(e+=c[r>>2&63],e+=c[r<<4&63],e+=c[64],e+=c[64]),e}function N5e(t){return xd&&xd.isBuffer(t)}nte.exports=new Q5e(\"tag:yaml.org,2002:binary\",{kind:\"scalar\",resolve:R5e,construct:T5e,predicate:N5e,represent:F5e})});var ote=_((AQt,ste)=>{\"use strict\";var O5e=Ss(),L5e=Object.prototype.hasOwnProperty,M5e=Object.prototype.toString;function U5e(t){if(t===null)return!0;var e=[],r,s,a,n,c,f=t;for(r=0,s=f.length;r<s;r+=1){if(a=f[r],c=!1,M5e.call(a)!==\"[object Object]\")return!1;for(n in a)if(L5e.call(a,n))if(!c)c=!0;else return!1;if(!c)return!1;if(e.indexOf(n)===-1)e.push(n);else return!1}return!0}function _5e(t){return t!==null?t:[]}ste.exports=new O5e(\"tag:yaml.org,2002:omap\",{kind:\"sequence\",resolve:U5e,construct:_5e})});var lte=_((pQt,ate)=>{\"use strict\";var H5e=Ss(),j5e=Object.prototype.toString;function G5e(t){if(t===null)return!0;var e,r,s,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1){if(s=c[e],j5e.call(s)!==\"[object Object]\"||(a=Object.keys(s),a.length!==1))return!1;n[e]=[a[0],s[a[0]]]}return!0}function q5e(t){if(t===null)return[];var e,r,s,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1)s=c[e],a=Object.keys(s),n[e]=[a[0],s[a[0]]];return n}ate.exports=new H5e(\"tag:yaml.org,2002:pairs\",{kind:\"sequence\",resolve:G5e,construct:q5e})});var ute=_((hQt,cte)=>{\"use strict\";var W5e=Ss(),Y5e=Object.prototype.hasOwnProperty;function V5e(t){if(t===null)return!0;var e,r=t;for(e in r)if(Y5e.call(r,e)&&r[e]!==null)return!1;return!0}function J5e(t){return t!==null?t:{}}cte.exports=new W5e(\"tag:yaml.org,2002:set\",{kind:\"mapping\",resolve:V5e,construct:J5e})});var gE=_((gQt,fte)=>{\"use strict\";var K5e=bd();fte.exports=new K5e({include:[JU()],implicit:[$ee(),tte()],explicit:[ite(),ote(),lte(),ute()]})});var pte=_((dQt,Ate)=>{\"use strict\";var z5e=Ss();function Z5e(){return!0}function X5e(){}function $5e(){return\"\"}function e9e(t){return typeof t>\"u\"}Ate.exports=new z5e(\"tag:yaml.org,2002:js/undefined\",{kind:\"scalar\",resolve:Z5e,construct:X5e,predicate:e9e,represent:$5e})});var gte=_((mQt,hte)=>{\"use strict\";var t9e=Ss();function r9e(t){if(t===null||t.length===0)return!1;var e=t,r=/\\/([gim]*)$/.exec(t),s=\"\";return!(e[0]===\"/\"&&(r&&(s=r[1]),s.length>3||e[e.length-s.length-1]!==\"/\"))}function n9e(t){var e=t,r=/\\/([gim]*)$/.exec(t),s=\"\";return e[0]===\"/\"&&(r&&(s=r[1]),e=e.slice(1,e.length-s.length-1)),new RegExp(e,s)}function i9e(t){var e=\"/\"+t.source+\"/\";return t.global&&(e+=\"g\"),t.multiline&&(e+=\"m\"),t.ignoreCase&&(e+=\"i\"),e}function s9e(t){return Object.prototype.toString.call(t)===\"[object RegExp]\"}hte.exports=new t9e(\"tag:yaml.org,2002:js/regexp\",{kind:\"scalar\",resolve:r9e,construct:n9e,predicate:s9e,represent:i9e})});var yte=_((yQt,mte)=>{\"use strict\";var mx;try{dte=Ie,mx=dte(\"esprima\")}catch{typeof window<\"u\"&&(mx=window.esprima)}var dte,o9e=Ss();function a9e(t){if(t===null)return!1;try{var e=\"(\"+t+\")\",r=mx.parse(e,{range:!0});return!(r.type!==\"Program\"||r.body.length!==1||r.body[0].type!==\"ExpressionStatement\"||r.body[0].expression.type!==\"ArrowFunctionExpression\"&&r.body[0].expression.type!==\"FunctionExpression\")}catch{return!1}}function l9e(t){var e=\"(\"+t+\")\",r=mx.parse(e,{range:!0}),s=[],a;if(r.type!==\"Program\"||r.body.length!==1||r.body[0].type!==\"ExpressionStatement\"||r.body[0].expression.type!==\"ArrowFunctionExpression\"&&r.body[0].expression.type!==\"FunctionExpression\")throw new Error(\"Failed to resolve function\");return r.body[0].expression.params.forEach(function(n){s.push(n.name)}),a=r.body[0].expression.body.range,r.body[0].expression.body.type===\"BlockStatement\"?new Function(s,e.slice(a[0]+1,a[1]-1)):new Function(s,\"return \"+e.slice(a[0],a[1]))}function c9e(t){return t.toString()}function u9e(t){return Object.prototype.toString.call(t)===\"[object Function]\"}mte.exports=new o9e(\"tag:yaml.org,2002:js/function\",{kind:\"scalar\",resolve:a9e,construct:l9e,predicate:u9e,represent:c9e})});var G2=_((IQt,Ite)=>{\"use strict\";var Ete=bd();Ite.exports=Ete.DEFAULT=new Ete({include:[gE()],explicit:[pte(),gte(),yte()]})});var Ute=_((CQt,q2)=>{\"use strict\";var Ip=Pd(),Pte=pE(),f9e=Pee(),bte=gE(),A9e=G2(),i0=Object.prototype.hasOwnProperty,yx=1,xte=2,kte=3,Ex=4,zU=1,p9e=2,Cte=3,h9e=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,g9e=/[\\x85\\u2028\\u2029]/,d9e=/[,\\[\\]\\{\\}]/,Qte=/^(?:!|!!|![a-z\\-]+!)$/i,Rte=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;function wte(t){return Object.prototype.toString.call(t)}function jf(t){return t===10||t===13}function Qd(t){return t===9||t===32}function rl(t){return t===9||t===32||t===10||t===13}function dE(t){return t===44||t===91||t===93||t===123||t===125}function m9e(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function y9e(t){return t===120?2:t===117?4:t===85?8:0}function E9e(t){return 48<=t&&t<=57?t-48:-1}function Bte(t){return t===48?\"\\0\":t===97?\"\\x07\":t===98?\"\\b\":t===116||t===9?\"\t\":t===110?`\n`:t===118?\"\\v\":t===102?\"\\f\":t===114?\"\\r\":t===101?\"\\x1B\":t===32?\" \":t===34?'\"':t===47?\"/\":t===92?\"\\\\\":t===78?\"\\x85\":t===95?\"\\xA0\":t===76?\"\\u2028\":t===80?\"\\u2029\":\"\"}function I9e(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var Tte=new Array(256),Fte=new Array(256);for(kd=0;kd<256;kd++)Tte[kd]=Bte(kd)?1:0,Fte[kd]=Bte(kd);var kd;function C9e(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||A9e,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function Nte(t,e){return new Pte(e,new f9e(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function Tr(t,e){throw Nte(t,e)}function Ix(t,e){t.onWarning&&t.onWarning.call(null,Nte(t,e))}var vte={YAML:function(e,r,s){var a,n,c;e.version!==null&&Tr(e,\"duplication of %YAML directive\"),s.length!==1&&Tr(e,\"YAML directive accepts exactly one argument\"),a=/^([0-9]+)\\.([0-9]+)$/.exec(s[0]),a===null&&Tr(e,\"ill-formed argument of the YAML directive\"),n=parseInt(a[1],10),c=parseInt(a[2],10),n!==1&&Tr(e,\"unacceptable YAML version of the document\"),e.version=s[0],e.checkLineBreaks=c<2,c!==1&&c!==2&&Ix(e,\"unsupported YAML version of the document\")},TAG:function(e,r,s){var a,n;s.length!==2&&Tr(e,\"TAG directive accepts exactly two arguments\"),a=s[0],n=s[1],Qte.test(a)||Tr(e,\"ill-formed tag handle (first argument) of the TAG directive\"),i0.call(e.tagMap,a)&&Tr(e,'there is a previously declared suffix for \"'+a+'\" tag handle'),Rte.test(n)||Tr(e,\"ill-formed tag prefix (second argument) of the TAG directive\"),e.tagMap[a]=n}};function n0(t,e,r,s){var a,n,c,f;if(e<r){if(f=t.input.slice(e,r),s)for(a=0,n=f.length;a<n;a+=1)c=f.charCodeAt(a),c===9||32<=c&&c<=1114111||Tr(t,\"expected valid JSON character\");else h9e.test(f)&&Tr(t,\"the stream contains non-printable characters\");t.result+=f}}function Ste(t,e,r,s){var a,n,c,f;for(Ip.isObject(r)||Tr(t,\"cannot merge mappings; the provided source object is unacceptable\"),a=Object.keys(r),c=0,f=a.length;c<f;c+=1)n=a[c],i0.call(e,n)||(e[n]=r[n],s[n]=!0)}function mE(t,e,r,s,a,n,c,f){var p,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),p=0,h=a.length;p<h;p+=1)Array.isArray(a[p])&&Tr(t,\"nested arrays are not supported inside keys\"),typeof a==\"object\"&&wte(a[p])===\"[object Object]\"&&(a[p]=\"[object Object]\");if(typeof a==\"object\"&&wte(a)===\"[object Object]\"&&(a=\"[object Object]\"),a=String(a),e===null&&(e={}),s===\"tag:yaml.org,2002:merge\")if(Array.isArray(n))for(p=0,h=n.length;p<h;p+=1)Ste(t,e,n[p],r);else Ste(t,e,n,r);else!t.json&&!i0.call(r,a)&&i0.call(e,a)&&(t.line=c||t.line,t.position=f||t.position,Tr(t,\"duplicated mapping key\")),e[a]=n,delete r[a];return e}function ZU(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Tr(t,\"a line break is expected\"),t.line+=1,t.lineStart=t.position}function os(t,e,r){for(var s=0,a=t.input.charCodeAt(t.position);a!==0;){for(;Qd(a);)a=t.input.charCodeAt(++t.position);if(e&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(jf(a))for(ZU(t),a=t.input.charCodeAt(t.position),s++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return r!==-1&&s!==0&&t.lineIndent<r&&Ix(t,\"deficient indentation\"),s}function Cx(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||rl(r)))}function XU(t,e){e===1?t.result+=\" \":e>1&&(t.result+=Ip.repeat(`\n`,e-1))}function w9e(t,e,r){var s,a,n,c,f,p,h,E,C=t.kind,S=t.result,b;if(b=t.input.charCodeAt(t.position),rl(b)||dE(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(a=t.input.charCodeAt(t.position+1),rl(a)||r&&dE(a)))return!1;for(t.kind=\"scalar\",t.result=\"\",n=c=t.position,f=!1;b!==0;){if(b===58){if(a=t.input.charCodeAt(t.position+1),rl(a)||r&&dE(a))break}else if(b===35){if(s=t.input.charCodeAt(t.position-1),rl(s))break}else{if(t.position===t.lineStart&&Cx(t)||r&&dE(b))break;if(jf(b))if(p=t.line,h=t.lineStart,E=t.lineIndent,os(t,!1,-1),t.lineIndent>=e){f=!0,b=t.input.charCodeAt(t.position);continue}else{t.position=c,t.line=p,t.lineStart=h,t.lineIndent=E;break}}f&&(n0(t,n,c,!1),XU(t,t.line-p),n=c=t.position,f=!1),Qd(b)||(c=t.position+1),b=t.input.charCodeAt(++t.position)}return n0(t,n,c,!1),t.result?!0:(t.kind=C,t.result=S,!1)}function B9e(t,e){var r,s,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind=\"scalar\",t.result=\"\",t.position++,s=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(n0(t,s,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)s=t.position,t.position++,a=t.position;else return!0;else jf(r)?(n0(t,s,a,!0),XU(t,os(t,!1,e)),s=a=t.position):t.position===t.lineStart&&Cx(t)?Tr(t,\"unexpected end of the document within a single quoted scalar\"):(t.position++,a=t.position);Tr(t,\"unexpected end of the stream within a single quoted scalar\")}function v9e(t,e){var r,s,a,n,c,f;if(f=t.input.charCodeAt(t.position),f!==34)return!1;for(t.kind=\"scalar\",t.result=\"\",t.position++,r=s=t.position;(f=t.input.charCodeAt(t.position))!==0;){if(f===34)return n0(t,r,t.position,!0),t.position++,!0;if(f===92){if(n0(t,r,t.position,!0),f=t.input.charCodeAt(++t.position),jf(f))os(t,!1,e);else if(f<256&&Tte[f])t.result+=Fte[f],t.position++;else if((c=y9e(f))>0){for(a=c,n=0;a>0;a--)f=t.input.charCodeAt(++t.position),(c=m9e(f))>=0?n=(n<<4)+c:Tr(t,\"expected hexadecimal character\");t.result+=I9e(n),t.position++}else Tr(t,\"unknown escape sequence\");r=s=t.position}else jf(f)?(n0(t,r,s,!0),XU(t,os(t,!1,e)),r=s=t.position):t.position===t.lineStart&&Cx(t)?Tr(t,\"unexpected end of the document within a double quoted scalar\"):(t.position++,s=t.position)}Tr(t,\"unexpected end of the stream within a double quoted scalar\")}function S9e(t,e){var r=!0,s,a=t.tag,n,c=t.anchor,f,p,h,E,C,S={},b,I,T,N;if(N=t.input.charCodeAt(t.position),N===91)p=93,C=!1,n=[];else if(N===123)p=125,C=!0,n={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),N=t.input.charCodeAt(++t.position);N!==0;){if(os(t,!0,e),N=t.input.charCodeAt(t.position),N===p)return t.position++,t.tag=a,t.anchor=c,t.kind=C?\"mapping\":\"sequence\",t.result=n,!0;r||Tr(t,\"missed comma between flow collection entries\"),I=b=T=null,h=E=!1,N===63&&(f=t.input.charCodeAt(t.position+1),rl(f)&&(h=E=!0,t.position++,os(t,!0,e))),s=t.line,yE(t,e,yx,!1,!0),I=t.tag,b=t.result,os(t,!0,e),N=t.input.charCodeAt(t.position),(E||t.line===s)&&N===58&&(h=!0,N=t.input.charCodeAt(++t.position),os(t,!0,e),yE(t,e,yx,!1,!0),T=t.result),C?mE(t,n,S,I,b,T):h?n.push(mE(t,null,S,I,b,T)):n.push(b),os(t,!0,e),N=t.input.charCodeAt(t.position),N===44?(r=!0,N=t.input.charCodeAt(++t.position)):r=!1}Tr(t,\"unexpected end of the stream within a flow collection\")}function D9e(t,e){var r,s,a=zU,n=!1,c=!1,f=e,p=0,h=!1,E,C;if(C=t.input.charCodeAt(t.position),C===124)s=!1;else if(C===62)s=!0;else return!1;for(t.kind=\"scalar\",t.result=\"\";C!==0;)if(C=t.input.charCodeAt(++t.position),C===43||C===45)zU===a?a=C===43?Cte:p9e:Tr(t,\"repeat of a chomping mode identifier\");else if((E=E9e(C))>=0)E===0?Tr(t,\"bad explicit indentation width of a block scalar; it cannot be less than one\"):c?Tr(t,\"repeat of an indentation width identifier\"):(f=e+E-1,c=!0);else break;if(Qd(C)){do C=t.input.charCodeAt(++t.position);while(Qd(C));if(C===35)do C=t.input.charCodeAt(++t.position);while(!jf(C)&&C!==0)}for(;C!==0;){for(ZU(t),t.lineIndent=0,C=t.input.charCodeAt(t.position);(!c||t.lineIndent<f)&&C===32;)t.lineIndent++,C=t.input.charCodeAt(++t.position);if(!c&&t.lineIndent>f&&(f=t.lineIndent),jf(C)){p++;continue}if(t.lineIndent<f){a===Cte?t.result+=Ip.repeat(`\n`,n?1+p:p):a===zU&&n&&(t.result+=`\n`);break}for(s?Qd(C)?(h=!0,t.result+=Ip.repeat(`\n`,n?1+p:p)):h?(h=!1,t.result+=Ip.repeat(`\n`,p+1)):p===0?n&&(t.result+=\" \"):t.result+=Ip.repeat(`\n`,p):t.result+=Ip.repeat(`\n`,n?1+p:p),n=!0,c=!0,p=0,r=t.position;!jf(C)&&C!==0;)C=t.input.charCodeAt(++t.position);n0(t,r,t.position,!1)}return!0}function Dte(t,e){var r,s=t.tag,a=t.anchor,n=[],c,f=!1,p;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),p=t.input.charCodeAt(t.position);p!==0&&!(p!==45||(c=t.input.charCodeAt(t.position+1),!rl(c)));){if(f=!0,t.position++,os(t,!0,-1)&&t.lineIndent<=e){n.push(null),p=t.input.charCodeAt(t.position);continue}if(r=t.line,yE(t,e,kte,!1,!0),n.push(t.result),os(t,!0,-1),p=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&p!==0)Tr(t,\"bad indentation of a sequence entry\");else if(t.lineIndent<e)break}return f?(t.tag=s,t.anchor=a,t.kind=\"sequence\",t.result=n,!0):!1}function P9e(t,e,r){var s,a,n,c,f=t.tag,p=t.anchor,h={},E={},C=null,S=null,b=null,I=!1,T=!1,N;for(t.anchor!==null&&(t.anchorMap[t.anchor]=h),N=t.input.charCodeAt(t.position);N!==0;){if(s=t.input.charCodeAt(t.position+1),n=t.line,c=t.position,(N===63||N===58)&&rl(s))N===63?(I&&(mE(t,h,E,C,S,null),C=S=b=null),T=!0,I=!0,a=!0):I?(I=!1,a=!0):Tr(t,\"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line\"),t.position+=1,N=s;else if(yE(t,r,xte,!1,!0))if(t.line===n){for(N=t.input.charCodeAt(t.position);Qd(N);)N=t.input.charCodeAt(++t.position);if(N===58)N=t.input.charCodeAt(++t.position),rl(N)||Tr(t,\"a whitespace character is expected after the key-value separator within a block mapping\"),I&&(mE(t,h,E,C,S,null),C=S=b=null),T=!0,I=!1,a=!1,C=t.tag,S=t.result;else if(T)Tr(t,\"can not read an implicit mapping pair; a colon is missed\");else return t.tag=f,t.anchor=p,!0}else if(T)Tr(t,\"can not read a block mapping entry; a multiline key may not be an implicit key\");else return t.tag=f,t.anchor=p,!0;else break;if((t.line===n||t.lineIndent>e)&&(yE(t,e,Ex,!0,a)&&(I?S=t.result:b=t.result),I||(mE(t,h,E,C,S,b,n,c),C=S=b=null),os(t,!0,-1),N=t.input.charCodeAt(t.position)),t.lineIndent>e&&N!==0)Tr(t,\"bad indentation of a mapping entry\");else if(t.lineIndent<e)break}return I&&mE(t,h,E,C,S,null),T&&(t.tag=f,t.anchor=p,t.kind=\"mapping\",t.result=h),T}function b9e(t){var e,r=!1,s=!1,a,n,c;if(c=t.input.charCodeAt(t.position),c!==33)return!1;if(t.tag!==null&&Tr(t,\"duplication of a tag property\"),c=t.input.charCodeAt(++t.position),c===60?(r=!0,c=t.input.charCodeAt(++t.position)):c===33?(s=!0,a=\"!!\",c=t.input.charCodeAt(++t.position)):a=\"!\",e=t.position,r){do c=t.input.charCodeAt(++t.position);while(c!==0&&c!==62);t.position<t.length?(n=t.input.slice(e,t.position),c=t.input.charCodeAt(++t.position)):Tr(t,\"unexpected end of the stream within a verbatim tag\")}else{for(;c!==0&&!rl(c);)c===33&&(s?Tr(t,\"tag suffix cannot contain exclamation marks\"):(a=t.input.slice(e-1,t.position+1),Qte.test(a)||Tr(t,\"named tag handle cannot contain such characters\"),s=!0,e=t.position+1)),c=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),d9e.test(n)&&Tr(t,\"tag suffix cannot contain flow indicator characters\")}return n&&!Rte.test(n)&&Tr(t,\"tag name cannot contain such characters: \"+n),r?t.tag=n:i0.call(t.tagMap,a)?t.tag=t.tagMap[a]+n:a===\"!\"?t.tag=\"!\"+n:a===\"!!\"?t.tag=\"tag:yaml.org,2002:\"+n:Tr(t,'undeclared tag handle \"'+a+'\"'),!0}function x9e(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&Tr(t,\"duplication of an anchor property\"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!rl(r)&&!dE(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Tr(t,\"name of an anchor node must contain at least one character\"),t.anchor=t.input.slice(e,t.position),!0}function k9e(t){var e,r,s;if(s=t.input.charCodeAt(t.position),s!==42)return!1;for(s=t.input.charCodeAt(++t.position),e=t.position;s!==0&&!rl(s)&&!dE(s);)s=t.input.charCodeAt(++t.position);return t.position===e&&Tr(t,\"name of an alias node must contain at least one character\"),r=t.input.slice(e,t.position),i0.call(t.anchorMap,r)||Tr(t,'unidentified alias \"'+r+'\"'),t.result=t.anchorMap[r],os(t,!0,-1),!0}function yE(t,e,r,s,a){var n,c,f,p=1,h=!1,E=!1,C,S,b,I,T;if(t.listener!==null&&t.listener(\"open\",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,n=c=f=Ex===r||kte===r,s&&os(t,!0,-1)&&(h=!0,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)),p===1)for(;b9e(t)||x9e(t);)os(t,!0,-1)?(h=!0,f=n,t.lineIndent>e?p=1:t.lineIndent===e?p=0:t.lineIndent<e&&(p=-1)):f=!1;if(f&&(f=h||a),(p===1||Ex===r)&&(yx===r||xte===r?I=e:I=e+1,T=t.position-t.lineStart,p===1?f&&(Dte(t,T)||P9e(t,T,I))||S9e(t,I)?E=!0:(c&&D9e(t,I)||B9e(t,I)||v9e(t,I)?E=!0:k9e(t)?(E=!0,(t.tag!==null||t.anchor!==null)&&Tr(t,\"alias node should not have any properties\")):w9e(t,I,yx===r)&&(E=!0,t.tag===null&&(t.tag=\"?\")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):p===0&&(E=f&&Dte(t,T))),t.tag!==null&&t.tag!==\"!\")if(t.tag===\"?\"){for(t.result!==null&&t.kind!==\"scalar\"&&Tr(t,'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"'+t.kind+'\"'),C=0,S=t.implicitTypes.length;C<S;C+=1)if(b=t.implicitTypes[C],b.resolve(t.result)){t.result=b.construct(t.result),t.tag=b.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else i0.call(t.typeMap[t.kind||\"fallback\"],t.tag)?(b=t.typeMap[t.kind||\"fallback\"][t.tag],t.result!==null&&b.kind!==t.kind&&Tr(t,\"unacceptable node kind for !<\"+t.tag+'> tag; it should be \"'+b.kind+'\", not \"'+t.kind+'\"'),b.resolve(t.result)?(t.result=b.construct(t.result),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Tr(t,\"cannot resolve a node with !<\"+t.tag+\"> explicit tag\")):Tr(t,\"unknown tag !<\"+t.tag+\">\");return t.listener!==null&&t.listener(\"close\",t),t.tag!==null||t.anchor!==null||E}function Q9e(t){var e=t.position,r,s,a,n=!1,c;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};(c=t.input.charCodeAt(t.position))!==0&&(os(t,!0,-1),c=t.input.charCodeAt(t.position),!(t.lineIndent>0||c!==37));){for(n=!0,c=t.input.charCodeAt(++t.position),r=t.position;c!==0&&!rl(c);)c=t.input.charCodeAt(++t.position);for(s=t.input.slice(r,t.position),a=[],s.length<1&&Tr(t,\"directive name must not be less than one character in length\");c!==0;){for(;Qd(c);)c=t.input.charCodeAt(++t.position);if(c===35){do c=t.input.charCodeAt(++t.position);while(c!==0&&!jf(c));break}if(jf(c))break;for(r=t.position;c!==0&&!rl(c);)c=t.input.charCodeAt(++t.position);a.push(t.input.slice(r,t.position))}c!==0&&ZU(t),i0.call(vte,s)?vte[s](t,s,a):Ix(t,'unknown document directive \"'+s+'\"')}if(os(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,os(t,!0,-1)):n&&Tr(t,\"directives end mark is expected\"),yE(t,t.lineIndent-1,Ex,!1,!0),os(t,!0,-1),t.checkLineBreaks&&g9e.test(t.input.slice(e,t.position))&&Ix(t,\"non-ASCII line breaks are interpreted as content\"),t.documents.push(t.result),t.position===t.lineStart&&Cx(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,os(t,!0,-1));return}if(t.position<t.length-1)Tr(t,\"end of the stream or a document separator is expected\");else return}function Ote(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`\n`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new C9e(t,e),s=t.indexOf(\"\\0\");for(s!==-1&&(r.position=s,Tr(r,\"null byte is not allowed in input\")),r.input+=\"\\0\";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Q9e(r);return r.documents}function Lte(t,e,r){e!==null&&typeof e==\"object\"&&typeof r>\"u\"&&(r=e,e=null);var s=Ote(t,r);if(typeof e!=\"function\")return s;for(var a=0,n=s.length;a<n;a+=1)e(s[a])}function Mte(t,e){var r=Ote(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new Pte(\"expected a single document in the stream, but found more\")}}function R9e(t,e,r){return typeof e==\"object\"&&e!==null&&typeof r>\"u\"&&(r=e,e=null),Lte(t,e,Ip.extend({schema:bte},r))}function T9e(t,e){return Mte(t,Ip.extend({schema:bte},e))}q2.exports.loadAll=Lte;q2.exports.load=Mte;q2.exports.safeLoadAll=R9e;q2.exports.safeLoad=T9e});var lre=_((wQt,r_)=>{\"use strict\";var Y2=Pd(),V2=pE(),F9e=G2(),N9e=gE(),Vte=Object.prototype.toString,Jte=Object.prototype.hasOwnProperty,O9e=9,W2=10,L9e=13,M9e=32,U9e=33,_9e=34,Kte=35,H9e=37,j9e=38,G9e=39,q9e=42,zte=44,W9e=45,Zte=58,Y9e=61,V9e=62,J9e=63,K9e=64,Xte=91,$te=93,z9e=96,ere=123,Z9e=124,tre=125,_o={};_o[0]=\"\\\\0\";_o[7]=\"\\\\a\";_o[8]=\"\\\\b\";_o[9]=\"\\\\t\";_o[10]=\"\\\\n\";_o[11]=\"\\\\v\";_o[12]=\"\\\\f\";_o[13]=\"\\\\r\";_o[27]=\"\\\\e\";_o[34]='\\\\\"';_o[92]=\"\\\\\\\\\";_o[133]=\"\\\\N\";_o[160]=\"\\\\_\";_o[8232]=\"\\\\L\";_o[8233]=\"\\\\P\";var X9e=[\"y\",\"Y\",\"yes\",\"Yes\",\"YES\",\"on\",\"On\",\"ON\",\"n\",\"N\",\"no\",\"No\",\"NO\",\"off\",\"Off\",\"OFF\"];function $9e(t,e){var r,s,a,n,c,f,p;if(e===null)return{};for(r={},s=Object.keys(e),a=0,n=s.length;a<n;a+=1)c=s[a],f=String(e[c]),c.slice(0,2)===\"!!\"&&(c=\"tag:yaml.org,2002:\"+c.slice(2)),p=t.compiledTypeMap.fallback[c],p&&Jte.call(p.styleAliases,f)&&(f=p.styleAliases[f]),r[c]=f;return r}function _te(t){var e,r,s;if(e=t.toString(16).toUpperCase(),t<=255)r=\"x\",s=2;else if(t<=65535)r=\"u\",s=4;else if(t<=4294967295)r=\"U\",s=8;else throw new V2(\"code point within a string may not be greater than 0xFFFFFFFF\");return\"\\\\\"+r+Y2.repeat(\"0\",s-e.length)+e}function eWe(t){this.schema=t.schema||F9e,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Y2.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=$9e(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=\"\",this.duplicates=[],this.usedDuplicates=null}function Hte(t,e){for(var r=Y2.repeat(\" \",e),s=0,a=-1,n=\"\",c,f=t.length;s<f;)a=t.indexOf(`\n`,s),a===-1?(c=t.slice(s),s=f):(c=t.slice(s,a+1),s=a+1),c.length&&c!==`\n`&&(n+=r),n+=c;return n}function $U(t,e){return`\n`+Y2.repeat(\" \",t.indent*e)}function tWe(t,e){var r,s,a;for(r=0,s=t.implicitTypes.length;r<s;r+=1)if(a=t.implicitTypes[r],a.resolve(e))return!0;return!1}function t_(t){return t===M9e||t===O9e}function EE(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function rWe(t){return EE(t)&&!t_(t)&&t!==65279&&t!==L9e&&t!==W2}function jte(t,e){return EE(t)&&t!==65279&&t!==zte&&t!==Xte&&t!==$te&&t!==ere&&t!==tre&&t!==Zte&&(t!==Kte||e&&rWe(e))}function nWe(t){return EE(t)&&t!==65279&&!t_(t)&&t!==W9e&&t!==J9e&&t!==Zte&&t!==zte&&t!==Xte&&t!==$te&&t!==ere&&t!==tre&&t!==Kte&&t!==j9e&&t!==q9e&&t!==U9e&&t!==Z9e&&t!==Y9e&&t!==V9e&&t!==G9e&&t!==_9e&&t!==H9e&&t!==K9e&&t!==z9e}function rre(t){var e=/^\\n* /;return e.test(t)}var nre=1,ire=2,sre=3,ore=4,wx=5;function iWe(t,e,r,s,a){var n,c,f,p=!1,h=!1,E=s!==-1,C=-1,S=nWe(t.charCodeAt(0))&&!t_(t.charCodeAt(t.length-1));if(e)for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),!EE(c))return wx;f=n>0?t.charCodeAt(n-1):null,S=S&&jte(c,f)}else{for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),c===W2)p=!0,E&&(h=h||n-C-1>s&&t[C+1]!==\" \",C=n);else if(!EE(c))return wx;f=n>0?t.charCodeAt(n-1):null,S=S&&jte(c,f)}h=h||E&&n-C-1>s&&t[C+1]!==\" \"}return!p&&!h?S&&!a(t)?nre:ire:r>9&&rre(t)?wx:h?ore:sre}function sWe(t,e,r,s){t.dump=function(){if(e.length===0)return\"''\";if(!t.noCompatMode&&X9e.indexOf(e)!==-1)return\"'\"+e+\"'\";var a=t.indent*Math.max(1,r),n=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),c=s||t.flowLevel>-1&&r>=t.flowLevel;function f(p){return tWe(t,p)}switch(iWe(e,c,t.indent,n,f)){case nre:return e;case ire:return\"'\"+e.replace(/'/g,\"''\")+\"'\";case sre:return\"|\"+Gte(e,t.indent)+qte(Hte(e,a));case ore:return\">\"+Gte(e,t.indent)+qte(Hte(oWe(e,n),a));case wx:return'\"'+aWe(e,n)+'\"';default:throw new V2(\"impossible error: invalid scalar style\")}}()}function Gte(t,e){var r=rre(t)?String(e):\"\",s=t[t.length-1]===`\n`,a=s&&(t[t.length-2]===`\n`||t===`\n`),n=a?\"+\":s?\"\":\"-\";return r+n+`\n`}function qte(t){return t[t.length-1]===`\n`?t.slice(0,-1):t}function oWe(t,e){for(var r=/(\\n+)([^\\n]*)/g,s=function(){var h=t.indexOf(`\n`);return h=h!==-1?h:t.length,r.lastIndex=h,Wte(t.slice(0,h),e)}(),a=t[0]===`\n`||t[0]===\" \",n,c;c=r.exec(t);){var f=c[1],p=c[2];n=p[0]===\" \",s+=f+(!a&&!n&&p!==\"\"?`\n`:\"\")+Wte(p,e),a=n}return s}function Wte(t,e){if(t===\"\"||t[0]===\" \")return t;for(var r=/ [^ ]/g,s,a=0,n,c=0,f=0,p=\"\";s=r.exec(t);)f=s.index,f-a>e&&(n=c>a?c:f,p+=`\n`+t.slice(a,n),a=n+1),c=f;return p+=`\n`,t.length-a>e&&c>a?p+=t.slice(a,c)+`\n`+t.slice(c+1):p+=t.slice(a),p.slice(1)}function aWe(t){for(var e=\"\",r,s,a,n=0;n<t.length;n++){if(r=t.charCodeAt(n),r>=55296&&r<=56319&&(s=t.charCodeAt(n+1),s>=56320&&s<=57343)){e+=_te((r-55296)*1024+s-56320+65536),n++;continue}a=_o[r],e+=!a&&EE(r)?t[n]:a||_te(r)}return e}function lWe(t,e,r){var s=\"\",a=t.tag,n,c;for(n=0,c=r.length;n<c;n+=1)Rd(t,e,r[n],!1,!1)&&(n!==0&&(s+=\",\"+(t.condenseFlow?\"\":\" \")),s+=t.dump);t.tag=a,t.dump=\"[\"+s+\"]\"}function cWe(t,e,r,s){var a=\"\",n=t.tag,c,f;for(c=0,f=r.length;c<f;c+=1)Rd(t,e+1,r[c],!0,!0)&&((!s||c!==0)&&(a+=$U(t,e)),t.dump&&W2===t.dump.charCodeAt(0)?a+=\"-\":a+=\"- \",a+=t.dump);t.tag=n,t.dump=a||\"[]\"}function uWe(t,e,r){var s=\"\",a=t.tag,n=Object.keys(r),c,f,p,h,E;for(c=0,f=n.length;c<f;c+=1)E=\"\",c!==0&&(E+=\", \"),t.condenseFlow&&(E+='\"'),p=n[c],h=r[p],Rd(t,e,p,!1,!1)&&(t.dump.length>1024&&(E+=\"? \"),E+=t.dump+(t.condenseFlow?'\"':\"\")+\":\"+(t.condenseFlow?\"\":\" \"),Rd(t,e,h,!1,!1)&&(E+=t.dump,s+=E));t.tag=a,t.dump=\"{\"+s+\"}\"}function fWe(t,e,r,s){var a=\"\",n=t.tag,c=Object.keys(r),f,p,h,E,C,S;if(t.sortKeys===!0)c.sort();else if(typeof t.sortKeys==\"function\")c.sort(t.sortKeys);else if(t.sortKeys)throw new V2(\"sortKeys must be a boolean or a function\");for(f=0,p=c.length;f<p;f+=1)S=\"\",(!s||f!==0)&&(S+=$U(t,e)),h=c[f],E=r[h],Rd(t,e+1,h,!0,!0,!0)&&(C=t.tag!==null&&t.tag!==\"?\"||t.dump&&t.dump.length>1024,C&&(t.dump&&W2===t.dump.charCodeAt(0)?S+=\"?\":S+=\"? \"),S+=t.dump,C&&(S+=$U(t,e)),Rd(t,e+1,E,!0,C)&&(t.dump&&W2===t.dump.charCodeAt(0)?S+=\":\":S+=\": \",S+=t.dump,a+=S));t.tag=n,t.dump=a||\"{}\"}function Yte(t,e,r){var s,a,n,c,f,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,c=a.length;n<c;n+=1)if(f=a[n],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof e==\"object\"&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=r?f.tag:\"?\",f.represent){if(p=t.styleMap[f.tag]||f.defaultStyle,Vte.call(f.represent)===\"[object Function]\")s=f.represent(e,p);else if(Jte.call(f.represent,p))s=f.represent[p](e,p);else throw new V2(\"!<\"+f.tag+'> tag resolver accepts not \"'+p+'\" style');t.dump=s}return!0}return!1}function Rd(t,e,r,s,a,n){t.tag=null,t.dump=r,Yte(t,r,!1)||Yte(t,r,!0);var c=Vte.call(t.dump);s&&(s=t.flowLevel<0||t.flowLevel>e);var f=c===\"[object Object]\"||c===\"[object Array]\",p,h;if(f&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!==\"?\"||h||t.indent!==2&&e>0)&&(a=!1),h&&t.usedDuplicates[p])t.dump=\"*ref_\"+p;else{if(f&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),c===\"[object Object]\")s&&Object.keys(t.dump).length!==0?(fWe(t,e,t.dump,a),h&&(t.dump=\"&ref_\"+p+t.dump)):(uWe(t,e,t.dump),h&&(t.dump=\"&ref_\"+p+\" \"+t.dump));else if(c===\"[object Array]\"){var E=t.noArrayIndent&&e>0?e-1:e;s&&t.dump.length!==0?(cWe(t,E,t.dump,a),h&&(t.dump=\"&ref_\"+p+t.dump)):(lWe(t,E,t.dump),h&&(t.dump=\"&ref_\"+p+\" \"+t.dump))}else if(c===\"[object String]\")t.tag!==\"?\"&&sWe(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new V2(\"unacceptable kind of an object to dump \"+c)}t.tag!==null&&t.tag!==\"?\"&&(t.dump=\"!<\"+t.tag+\"> \"+t.dump)}return!0}function AWe(t,e){var r=[],s=[],a,n;for(e_(t,r,s),a=0,n=s.length;a<n;a+=1)e.duplicates.push(r[s[a]]);e.usedDuplicates=new Array(n)}function e_(t,e,r){var s,a,n;if(t!==null&&typeof t==\"object\")if(a=e.indexOf(t),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(e.push(t),Array.isArray(t))for(a=0,n=t.length;a<n;a+=1)e_(t[a],e,r);else for(s=Object.keys(t),a=0,n=s.length;a<n;a+=1)e_(t[s[a]],e,r)}function are(t,e){e=e||{};var r=new eWe(e);return r.noRefs||AWe(t,r),Rd(r,0,t,!0,!0)?r.dump+`\n`:\"\"}function pWe(t,e){return are(t,Y2.extend({schema:N9e},e))}r_.exports.dump=are;r_.exports.safeDump=pWe});var ure=_((BQt,qi)=>{\"use strict\";var Bx=Ute(),cre=lre();function vx(t){return function(){throw new Error(\"Function \"+t+\" is deprecated and cannot be used.\")}}qi.exports.Type=Ss();qi.exports.Schema=bd();qi.exports.FAILSAFE_SCHEMA=dx();qi.exports.JSON_SCHEMA=VU();qi.exports.CORE_SCHEMA=JU();qi.exports.DEFAULT_SAFE_SCHEMA=gE();qi.exports.DEFAULT_FULL_SCHEMA=G2();qi.exports.load=Bx.load;qi.exports.loadAll=Bx.loadAll;qi.exports.safeLoad=Bx.safeLoad;qi.exports.safeLoadAll=Bx.safeLoadAll;qi.exports.dump=cre.dump;qi.exports.safeDump=cre.safeDump;qi.exports.YAMLException=pE();qi.exports.MINIMAL_SCHEMA=dx();qi.exports.SAFE_SCHEMA=gE();qi.exports.DEFAULT_SCHEMA=G2();qi.exports.scan=vx(\"scan\");qi.exports.parse=vx(\"parse\");qi.exports.compose=vx(\"compose\");qi.exports.addConstructor=vx(\"addConstructor\")});var Are=_((vQt,fre)=>{\"use strict\";var hWe=ure();fre.exports=hWe});var hre=_((SQt,pre)=>{\"use strict\";function gWe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Td(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,Td)}gWe(Td,Error);Td.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function dWe(t,e){e=e!==void 0?e:{};var r={},s={Start:lc},a=lc,n=function(te){return[].concat(...te)},c=\"-\",f=dn(\"-\",!1),p=function(te){return te},h=function(te){return Object.assign({},...te)},E=\"#\",C=dn(\"#\",!1),S=Au(),b=function(){return{}},I=\":\",T=dn(\":\",!1),N=function(te,Ee){return{[te]:Ee}},U=\",\",W=dn(\",\",!1),ee=function(te,Ee){return Ee},ie=function(te,Ee,Oe){return Object.assign({},...[te].concat(Ee).map(dt=>({[dt]:Oe})))},ue=function(te){return te},le=function(te){return te},me=Oa(\"correct indentation\"),pe=\" \",Be=dn(\" \",!1),Ce=function(te){return te.length===lr*St},g=function(te){return te.length===(lr+1)*St},we=function(){return lr++,!0},ye=function(){return lr--,!0},Ae=function(){return la()},se=Oa(\"pseudostring\"),X=/^[^\\r\\n\\t ?:,\\][{}#&*!|>'\"%@`\\-]/,De=Kn([\"\\r\",`\n`,\"\t\",\" \",\"?\",\":\",\",\",\"]\",\"[\",\"{\",\"}\",\"#\",\"&\",\"*\",\"!\",\"|\",\">\",\"'\",'\"',\"%\",\"@\",\"`\",\"-\"],!0,!1),Te=/^[^\\r\\n\\t ,\\][{}:#\"']/,mt=Kn([\"\\r\",`\n`,\"\t\",\" \",\",\",\"]\",\"[\",\"{\",\"}\",\":\",\"#\",'\"',\"'\"],!0,!1),j=function(){return la().replace(/^ *| *$/g,\"\")},rt=\"--\",Fe=dn(\"--\",!1),Ne=/^[a-zA-Z\\/0-9]/,be=Kn([[\"a\",\"z\"],[\"A\",\"Z\"],\"/\",[\"0\",\"9\"]],!1,!1),Ve=/^[^\\r\\n\\t :,]/,ke=Kn([\"\\r\",`\n`,\"\t\",\" \",\":\",\",\"],!0,!1),it=\"null\",Ue=dn(\"null\",!1),x=function(){return null},w=\"true\",P=dn(\"true\",!1),y=function(){return!0},F=\"false\",z=dn(\"false\",!1),Z=function(){return!1},$=Oa(\"string\"),oe='\"',xe=dn('\"',!1),Re=function(){return\"\"},lt=function(te){return te},Ct=function(te){return te.join(\"\")},qt=/^[^\"\\\\\\0-\\x1F\\x7F]/,ir=Kn(['\"',\"\\\\\",[\"\\0\",\"\u001f\"],\"\\x7F\"],!0,!1),bt='\\\\\"',gn=dn('\\\\\"',!1),br=function(){return'\"'},Ir=\"\\\\\\\\\",Or=dn(\"\\\\\\\\\",!1),nn=function(){return\"\\\\\"},ai=\"\\\\/\",Io=dn(\"\\\\/\",!1),ts=function(){return\"/\"},$s=\"\\\\b\",Co=dn(\"\\\\b\",!1),Hi=function(){return\"\\b\"},eo=\"\\\\f\",wo=dn(\"\\\\f\",!1),QA=function(){return\"\\f\"},Af=\"\\\\n\",dh=dn(\"\\\\n\",!1),mh=function(){return`\n`},to=\"\\\\r\",jn=dn(\"\\\\r\",!1),Rs=function(){return\"\\r\"},ro=\"\\\\t\",ou=dn(\"\\\\t\",!1),au=function(){return\"\t\"},lu=\"\\\\u\",RA=dn(\"\\\\u\",!1),TA=function(te,Ee,Oe,dt){return String.fromCharCode(parseInt(`0x${te}${Ee}${Oe}${dt}`))},oa=/^[0-9a-fA-F]/,aa=Kn([[\"0\",\"9\"],[\"a\",\"f\"],[\"A\",\"F\"]],!1,!1),FA=Oa(\"blank space\"),gr=/^[ \\t]/,Bo=Kn([\" \",\"\t\"],!1,!1),Me=Oa(\"white space\"),cu=/^[ \\t\\n\\r]/,Cr=Kn([\" \",\"\t\",`\n`,\"\\r\"],!1,!1),pf=`\\r\n`,NA=dn(`\\r\n`,!1),OA=`\n`,uu=dn(`\n`,!1),fu=\"\\r\",oc=dn(\"\\r\",!1),ve=0,Nt=0,ac=[{line:1,column:1}],Oi=0,no=[],Tt=0,xn;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function la(){return t.substring(Nt,ve)}function ji(){return Ma(Nt,ve)}function Li(te,Ee){throw Ee=Ee!==void 0?Ee:Ma(Nt,ve),hf([Oa(te)],t.substring(Nt,ve),Ee)}function Na(te,Ee){throw Ee=Ee!==void 0?Ee:Ma(Nt,ve),Ua(te,Ee)}function dn(te,Ee){return{type:\"literal\",text:te,ignoreCase:Ee}}function Kn(te,Ee,Oe){return{type:\"class\",parts:te,inverted:Ee,ignoreCase:Oe}}function Au(){return{type:\"any\"}}function yh(){return{type:\"end\"}}function Oa(te){return{type:\"other\",description:te}}function La(te){var Ee=ac[te],Oe;if(Ee)return Ee;for(Oe=te-1;!ac[Oe];)Oe--;for(Ee=ac[Oe],Ee={line:Ee.line,column:Ee.column};Oe<te;)t.charCodeAt(Oe)===10?(Ee.line++,Ee.column=1):Ee.column++,Oe++;return ac[te]=Ee,Ee}function Ma(te,Ee){var Oe=La(te),dt=La(Ee);return{start:{offset:te,line:Oe.line,column:Oe.column},end:{offset:Ee,line:dt.line,column:dt.column}}}function $e(te){ve<Oi||(ve>Oi&&(Oi=ve,no=[]),no.push(te))}function Ua(te,Ee){return new Td(te,null,null,Ee)}function hf(te,Ee,Oe){return new Td(Td.buildMessage(te,Ee),te,Ee,Oe)}function lc(){var te;return te=LA(),te}function wn(){var te,Ee,Oe;for(te=ve,Ee=[],Oe=ca();Oe!==r;)Ee.push(Oe),Oe=ca();return Ee!==r&&(Nt=te,Ee=n(Ee)),te=Ee,te}function ca(){var te,Ee,Oe,dt,Et;return te=ve,Ee=Bl(),Ee!==r?(t.charCodeAt(ve)===45?(Oe=c,ve++):(Oe=r,Tt===0&&$e(f)),Oe!==r?(dt=Qn(),dt!==r?(Et=ua(),Et!==r?(Nt=te,Ee=p(Et),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te}function LA(){var te,Ee,Oe;for(te=ve,Ee=[],Oe=MA();Oe!==r;)Ee.push(Oe),Oe=MA();return Ee!==r&&(Nt=te,Ee=h(Ee)),te=Ee,te}function MA(){var te,Ee,Oe,dt,Et,Pt,tr,An,li;if(te=ve,Ee=Qn(),Ee===r&&(Ee=null),Ee!==r){if(Oe=ve,t.charCodeAt(ve)===35?(dt=E,ve++):(dt=r,Tt===0&&$e(C)),dt!==r){if(Et=[],Pt=ve,tr=ve,Tt++,An=st(),Tt--,An===r?tr=void 0:(ve=tr,tr=r),tr!==r?(t.length>ve?(An=t.charAt(ve),ve++):(An=r,Tt===0&&$e(S)),An!==r?(tr=[tr,An],Pt=tr):(ve=Pt,Pt=r)):(ve=Pt,Pt=r),Pt!==r)for(;Pt!==r;)Et.push(Pt),Pt=ve,tr=ve,Tt++,An=st(),Tt--,An===r?tr=void 0:(ve=tr,tr=r),tr!==r?(t.length>ve?(An=t.charAt(ve),ve++):(An=r,Tt===0&&$e(S)),An!==r?(tr=[tr,An],Pt=tr):(ve=Pt,Pt=r)):(ve=Pt,Pt=r);else Et=r;Et!==r?(dt=[dt,Et],Oe=dt):(ve=Oe,Oe=r)}else ve=Oe,Oe=r;if(Oe===r&&(Oe=null),Oe!==r){if(dt=[],Et=Ke(),Et!==r)for(;Et!==r;)dt.push(Et),Et=Ke();else dt=r;dt!==r?(Nt=te,Ee=b(),te=Ee):(ve=te,te=r)}else ve=te,te=r}else ve=te,te=r;if(te===r&&(te=ve,Ee=Bl(),Ee!==r?(Oe=Ha(),Oe!==r?(dt=Qn(),dt===r&&(dt=null),dt!==r?(t.charCodeAt(ve)===58?(Et=I,ve++):(Et=r,Tt===0&&$e(T)),Et!==r?(Pt=Qn(),Pt===r&&(Pt=null),Pt!==r?(tr=ua(),tr!==r?(Nt=te,Ee=N(Oe,tr),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r&&(te=ve,Ee=Bl(),Ee!==r?(Oe=rs(),Oe!==r?(dt=Qn(),dt===r&&(dt=null),dt!==r?(t.charCodeAt(ve)===58?(Et=I,ve++):(Et=r,Tt===0&&$e(T)),Et!==r?(Pt=Qn(),Pt===r&&(Pt=null),Pt!==r?(tr=ua(),tr!==r?(Nt=te,Ee=N(Oe,tr),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r))){if(te=ve,Ee=Bl(),Ee!==r)if(Oe=rs(),Oe!==r)if(dt=Qn(),dt!==r)if(Et=pu(),Et!==r){if(Pt=[],tr=Ke(),tr!==r)for(;tr!==r;)Pt.push(tr),tr=Ke();else Pt=r;Pt!==r?(Nt=te,Ee=N(Oe,Et),te=Ee):(ve=te,te=r)}else ve=te,te=r;else ve=te,te=r;else ve=te,te=r;else ve=te,te=r;if(te===r)if(te=ve,Ee=Bl(),Ee!==r)if(Oe=rs(),Oe!==r){if(dt=[],Et=ve,Pt=Qn(),Pt===r&&(Pt=null),Pt!==r?(t.charCodeAt(ve)===44?(tr=U,ve++):(tr=r,Tt===0&&$e(W)),tr!==r?(An=Qn(),An===r&&(An=null),An!==r?(li=rs(),li!==r?(Nt=Et,Pt=ee(Oe,li),Et=Pt):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r),Et!==r)for(;Et!==r;)dt.push(Et),Et=ve,Pt=Qn(),Pt===r&&(Pt=null),Pt!==r?(t.charCodeAt(ve)===44?(tr=U,ve++):(tr=r,Tt===0&&$e(W)),tr!==r?(An=Qn(),An===r&&(An=null),An!==r?(li=rs(),li!==r?(Nt=Et,Pt=ee(Oe,li),Et=Pt):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r)):(ve=Et,Et=r);else dt=r;dt!==r?(Et=Qn(),Et===r&&(Et=null),Et!==r?(t.charCodeAt(ve)===58?(Pt=I,ve++):(Pt=r,Tt===0&&$e(T)),Pt!==r?(tr=Qn(),tr===r&&(tr=null),tr!==r?(An=ua(),An!==r?(Nt=te,Ee=ie(Oe,dt,An),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)}else ve=te,te=r;else ve=te,te=r}return te}function ua(){var te,Ee,Oe,dt,Et,Pt,tr;if(te=ve,Ee=ve,Tt++,Oe=ve,dt=st(),dt!==r?(Et=Mt(),Et!==r?(t.charCodeAt(ve)===45?(Pt=c,ve++):(Pt=r,Tt===0&&$e(f)),Pt!==r?(tr=Qn(),tr!==r?(dt=[dt,Et,Pt,tr],Oe=dt):(ve=Oe,Oe=r)):(ve=Oe,Oe=r)):(ve=Oe,Oe=r)):(ve=Oe,Oe=r),Tt--,Oe!==r?(ve=Ee,Ee=void 0):Ee=r,Ee!==r?(Oe=Ke(),Oe!==r?(dt=kn(),dt!==r?(Et=wn(),Et!==r?(Pt=fa(),Pt!==r?(Nt=te,Ee=ue(Et),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r&&(te=ve,Ee=st(),Ee!==r?(Oe=kn(),Oe!==r?(dt=LA(),dt!==r?(Et=fa(),Et!==r?(Nt=te,Ee=ue(dt),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r),te===r))if(te=ve,Ee=cc(),Ee!==r){if(Oe=[],dt=Ke(),dt!==r)for(;dt!==r;)Oe.push(dt),dt=Ke();else Oe=r;Oe!==r?(Nt=te,Ee=le(Ee),te=Ee):(ve=te,te=r)}else ve=te,te=r;return te}function Bl(){var te,Ee,Oe;for(Tt++,te=ve,Ee=[],t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Tt===0&&$e(Be));Oe!==r;)Ee.push(Oe),t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Tt===0&&$e(Be));return Ee!==r?(Nt=ve,Oe=Ce(Ee),Oe?Oe=void 0:Oe=r,Oe!==r?(Ee=[Ee,Oe],te=Ee):(ve=te,te=r)):(ve=te,te=r),Tt--,te===r&&(Ee=r,Tt===0&&$e(me)),te}function Mt(){var te,Ee,Oe;for(te=ve,Ee=[],t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Tt===0&&$e(Be));Oe!==r;)Ee.push(Oe),t.charCodeAt(ve)===32?(Oe=pe,ve++):(Oe=r,Tt===0&&$e(Be));return Ee!==r?(Nt=ve,Oe=g(Ee),Oe?Oe=void 0:Oe=r,Oe!==r?(Ee=[Ee,Oe],te=Ee):(ve=te,te=r)):(ve=te,te=r),te}function kn(){var te;return Nt=ve,te=we(),te?te=void 0:te=r,te}function fa(){var te;return Nt=ve,te=ye(),te?te=void 0:te=r,te}function Ha(){var te;return te=vl(),te===r&&(te=uc()),te}function rs(){var te,Ee,Oe;if(te=vl(),te===r){if(te=ve,Ee=[],Oe=ja(),Oe!==r)for(;Oe!==r;)Ee.push(Oe),Oe=ja();else Ee=r;Ee!==r&&(Nt=te,Ee=Ae()),te=Ee}return te}function cc(){var te;return te=Mi(),te===r&&(te=Is(),te===r&&(te=vl(),te===r&&(te=uc()))),te}function pu(){var te;return te=Mi(),te===r&&(te=vl(),te===r&&(te=ja())),te}function uc(){var te,Ee,Oe,dt,Et,Pt;if(Tt++,te=ve,X.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Tt===0&&$e(De)),Ee!==r){for(Oe=[],dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(Te.test(t.charAt(ve))?(Pt=t.charAt(ve),ve++):(Pt=r,Tt===0&&$e(mt)),Pt!==r?(Et=[Et,Pt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);dt!==r;)Oe.push(dt),dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(Te.test(t.charAt(ve))?(Pt=t.charAt(ve),ve++):(Pt=r,Tt===0&&$e(mt)),Pt!==r?(Et=[Et,Pt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);Oe!==r?(Nt=te,Ee=j(),te=Ee):(ve=te,te=r)}else ve=te,te=r;return Tt--,te===r&&(Ee=r,Tt===0&&$e(se)),te}function ja(){var te,Ee,Oe,dt,Et;if(te=ve,t.substr(ve,2)===rt?(Ee=rt,ve+=2):(Ee=r,Tt===0&&$e(Fe)),Ee===r&&(Ee=null),Ee!==r)if(Ne.test(t.charAt(ve))?(Oe=t.charAt(ve),ve++):(Oe=r,Tt===0&&$e(be)),Oe!==r){for(dt=[],Ve.test(t.charAt(ve))?(Et=t.charAt(ve),ve++):(Et=r,Tt===0&&$e(ke));Et!==r;)dt.push(Et),Ve.test(t.charAt(ve))?(Et=t.charAt(ve),ve++):(Et=r,Tt===0&&$e(ke));dt!==r?(Nt=te,Ee=j(),te=Ee):(ve=te,te=r)}else ve=te,te=r;else ve=te,te=r;return te}function Mi(){var te,Ee;return te=ve,t.substr(ve,4)===it?(Ee=it,ve+=4):(Ee=r,Tt===0&&$e(Ue)),Ee!==r&&(Nt=te,Ee=x()),te=Ee,te}function Is(){var te,Ee;return te=ve,t.substr(ve,4)===w?(Ee=w,ve+=4):(Ee=r,Tt===0&&$e(P)),Ee!==r&&(Nt=te,Ee=y()),te=Ee,te===r&&(te=ve,t.substr(ve,5)===F?(Ee=F,ve+=5):(Ee=r,Tt===0&&$e(z)),Ee!==r&&(Nt=te,Ee=Z()),te=Ee),te}function vl(){var te,Ee,Oe,dt;return Tt++,te=ve,t.charCodeAt(ve)===34?(Ee=oe,ve++):(Ee=r,Tt===0&&$e(xe)),Ee!==r?(t.charCodeAt(ve)===34?(Oe=oe,ve++):(Oe=r,Tt===0&&$e(xe)),Oe!==r?(Nt=te,Ee=Re(),te=Ee):(ve=te,te=r)):(ve=te,te=r),te===r&&(te=ve,t.charCodeAt(ve)===34?(Ee=oe,ve++):(Ee=r,Tt===0&&$e(xe)),Ee!==r?(Oe=gf(),Oe!==r?(t.charCodeAt(ve)===34?(dt=oe,ve++):(dt=r,Tt===0&&$e(xe)),dt!==r?(Nt=te,Ee=lt(Oe),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)),Tt--,te===r&&(Ee=r,Tt===0&&$e($)),te}function gf(){var te,Ee,Oe;if(te=ve,Ee=[],Oe=fc(),Oe!==r)for(;Oe!==r;)Ee.push(Oe),Oe=fc();else Ee=r;return Ee!==r&&(Nt=te,Ee=Ct(Ee)),te=Ee,te}function fc(){var te,Ee,Oe,dt,Et,Pt;return qt.test(t.charAt(ve))?(te=t.charAt(ve),ve++):(te=r,Tt===0&&$e(ir)),te===r&&(te=ve,t.substr(ve,2)===bt?(Ee=bt,ve+=2):(Ee=r,Tt===0&&$e(gn)),Ee!==r&&(Nt=te,Ee=br()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===Ir?(Ee=Ir,ve+=2):(Ee=r,Tt===0&&$e(Or)),Ee!==r&&(Nt=te,Ee=nn()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===ai?(Ee=ai,ve+=2):(Ee=r,Tt===0&&$e(Io)),Ee!==r&&(Nt=te,Ee=ts()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===$s?(Ee=$s,ve+=2):(Ee=r,Tt===0&&$e(Co)),Ee!==r&&(Nt=te,Ee=Hi()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===eo?(Ee=eo,ve+=2):(Ee=r,Tt===0&&$e(wo)),Ee!==r&&(Nt=te,Ee=QA()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===Af?(Ee=Af,ve+=2):(Ee=r,Tt===0&&$e(dh)),Ee!==r&&(Nt=te,Ee=mh()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===to?(Ee=to,ve+=2):(Ee=r,Tt===0&&$e(jn)),Ee!==r&&(Nt=te,Ee=Rs()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===ro?(Ee=ro,ve+=2):(Ee=r,Tt===0&&$e(ou)),Ee!==r&&(Nt=te,Ee=au()),te=Ee,te===r&&(te=ve,t.substr(ve,2)===lu?(Ee=lu,ve+=2):(Ee=r,Tt===0&&$e(RA)),Ee!==r?(Oe=wi(),Oe!==r?(dt=wi(),dt!==r?(Et=wi(),Et!==r?(Pt=wi(),Pt!==r?(Nt=te,Ee=TA(Oe,dt,Et,Pt),te=Ee):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)):(ve=te,te=r)))))))))),te}function wi(){var te;return oa.test(t.charAt(ve))?(te=t.charAt(ve),ve++):(te=r,Tt===0&&$e(aa)),te}function Qn(){var te,Ee;if(Tt++,te=[],gr.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Tt===0&&$e(Bo)),Ee!==r)for(;Ee!==r;)te.push(Ee),gr.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Tt===0&&$e(Bo));else te=r;return Tt--,te===r&&(Ee=r,Tt===0&&$e(FA)),te}function Ac(){var te,Ee;if(Tt++,te=[],cu.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Tt===0&&$e(Cr)),Ee!==r)for(;Ee!==r;)te.push(Ee),cu.test(t.charAt(ve))?(Ee=t.charAt(ve),ve++):(Ee=r,Tt===0&&$e(Cr));else te=r;return Tt--,te===r&&(Ee=r,Tt===0&&$e(Me)),te}function Ke(){var te,Ee,Oe,dt,Et,Pt;if(te=ve,Ee=st(),Ee!==r){for(Oe=[],dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(Pt=st(),Pt!==r?(Et=[Et,Pt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);dt!==r;)Oe.push(dt),dt=ve,Et=Qn(),Et===r&&(Et=null),Et!==r?(Pt=st(),Pt!==r?(Et=[Et,Pt],dt=Et):(ve=dt,dt=r)):(ve=dt,dt=r);Oe!==r?(Ee=[Ee,Oe],te=Ee):(ve=te,te=r)}else ve=te,te=r;return te}function st(){var te;return t.substr(ve,2)===pf?(te=pf,ve+=2):(te=r,Tt===0&&$e(NA)),te===r&&(t.charCodeAt(ve)===10?(te=OA,ve++):(te=r,Tt===0&&$e(uu)),te===r&&(t.charCodeAt(ve)===13?(te=fu,ve++):(te=r,Tt===0&&$e(oc)))),te}let St=2,lr=0;if(xn=a(),xn!==r&&ve===t.length)return xn;throw xn!==r&&ve<t.length&&$e(yh()),hf(no,Oi<t.length?t.charAt(Oi):null,Oi<t.length?Ma(Oi,Oi+1):Ma(Oi,Oi))}pre.exports={SyntaxError:Td,parse:dWe}});function dre(t){return t.match(mWe)?t:JSON.stringify(t)}function yre(t){return typeof t>\"u\"?!0:typeof t==\"object\"&&t!==null&&!Array.isArray(t)?Object.keys(t).every(e=>yre(t[e])):!1}function n_(t,e,r){if(t===null)return`null\n`;if(typeof t==\"number\"||typeof t==\"boolean\")return`${t.toString()}\n`;if(typeof t==\"string\")return`${dre(t)}\n`;if(Array.isArray(t)){if(t.length===0)return`[]\n`;let s=\"  \".repeat(e);return`\n${t.map(n=>`${s}- ${n_(n,e+1,!1)}`).join(\"\")}`}if(typeof t==\"object\"&&t){let[s,a]=t instanceof Sx?[t.data,!1]:[t,!0],n=\"  \".repeat(e),c=Object.keys(s);a&&c.sort((p,h)=>{let E=gre.indexOf(p),C=gre.indexOf(h);return E===-1&&C===-1?p<h?-1:p>h?1:0:E!==-1&&C===-1?-1:E===-1&&C!==-1?1:E-C});let f=c.filter(p=>!yre(s[p])).map((p,h)=>{let E=s[p],C=dre(p),S=n_(E,e+1,!0),b=h>0||r?n:\"\",I=C.length>1024?`? ${C}\n${b}:`:`${C}:`,T=S.startsWith(`\n`)?S:` ${S}`;return`${b}${I}${T}`}).join(e===0?`\n`:\"\")||`\n`;return r?`\n${f}`:`${f}`}throw new Error(`Unsupported value type (${t})`)}function nl(t){try{let e=n_(t,0,!1);return e!==`\n`?e:\"\"}catch(e){throw e.location&&(e.message=e.message.replace(/(\\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}function yWe(t){return t.endsWith(`\n`)||(t+=`\n`),(0,mre.parse)(t)}function IWe(t){if(EWe.test(t))return yWe(t);let e=(0,Dx.safeLoad)(t,{schema:Dx.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!=\"object\")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error(\"Expected an indexed object, got an array instead. Does your file follow Yaml's rules?\");return e}function as(t){return IWe(t)}var Dx,mre,mWe,gre,Sx,EWe,Ere=Ze(()=>{Dx=ut(Are()),mre=ut(hre()),mWe=/^(?![-?:,\\][{}#&*!|>'\"%@` \\t\\r\\n]).([ \\t]*(?![,\\][{}:# \\t\\r\\n]).)*$/,gre=[\"__metadata\",\"version\",\"resolution\",\"dependencies\",\"peerDependencies\",\"dependenciesMeta\",\"peerDependenciesMeta\",\"binaries\"],Sx=class{constructor(e){this.data=e}};nl.PreserveOrdering=Sx;EWe=/^(#.*(\\r?\\n))*?#\\s+yarn\\s+lockfile\\s+v1\\r?\\n/i});var J2={};Vt(J2,{parseResolution:()=>px,parseShell:()=>ux,parseSyml:()=>as,stringifyArgument:()=>GU,stringifyArgumentSegment:()=>qU,stringifyArithmeticExpression:()=>Ax,stringifyCommand:()=>jU,stringifyCommandChain:()=>AE,stringifyCommandChainThen:()=>HU,stringifyCommandLine:()=>fx,stringifyCommandLineThen:()=>_U,stringifyEnvSegment:()=>cx,stringifyRedirectArgument:()=>H2,stringifyResolution:()=>hx,stringifyShell:()=>fE,stringifyShellLine:()=>fE,stringifySyml:()=>nl,stringifyValueArgument:()=>vd});var wc=Ze(()=>{yee();wee();Ere()});var Cre=_((kQt,i_)=>{\"use strict\";var CWe=t=>{let e=!1,r=!1,s=!1;for(let a=0;a<t.length;a++){let n=t[a];e&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(t=t.slice(0,a)+\"-\"+t.slice(a),e=!1,s=r,r=!0,a++):r&&s&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(t=t.slice(0,a-1)+\"-\"+t.slice(a-1),s=r,r=!1,e=!0):(e=n.toLowerCase()===n&&n.toUpperCase()!==n,s=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return t},Ire=(t,e)=>{if(!(typeof t==\"string\"||Array.isArray(t)))throw new TypeError(\"Expected the input to be `string | string[]`\");e=Object.assign({pascalCase:!1},e);let r=a=>e.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join(\"-\"):t=t.trim(),t.length===0?\"\":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=CWe(t)),t=t.replace(/^[_.\\- ]+/,\"\").toLowerCase().replace(/[_.\\- ]+(\\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\\d+(\\w|$)/g,a=>a.toUpperCase()),r(t))};i_.exports=Ire;i_.exports.default=Ire});var wre=_((QQt,wWe)=>{wWe.exports=[{name:\"Agola CI\",constant:\"AGOLA\",env:\"AGOLA_GIT_REF\",pr:\"AGOLA_PULL_REQUEST_ID\"},{name:\"Appcircle\",constant:\"APPCIRCLE\",env:\"AC_APPCIRCLE\"},{name:\"AppVeyor\",constant:\"APPVEYOR\",env:\"APPVEYOR\",pr:\"APPVEYOR_PULL_REQUEST_NUMBER\"},{name:\"AWS CodeBuild\",constant:\"CODEBUILD\",env:\"CODEBUILD_BUILD_ARN\"},{name:\"Azure Pipelines\",constant:\"AZURE_PIPELINES\",env:\"TF_BUILD\",pr:{BUILD_REASON:\"PullRequest\"}},{name:\"Bamboo\",constant:\"BAMBOO\",env:\"bamboo_planKey\"},{name:\"Bitbucket Pipelines\",constant:\"BITBUCKET\",env:\"BITBUCKET_COMMIT\",pr:\"BITBUCKET_PR_ID\"},{name:\"Bitrise\",constant:\"BITRISE\",env:\"BITRISE_IO\",pr:\"BITRISE_PULL_REQUEST\"},{name:\"Buddy\",constant:\"BUDDY\",env:\"BUDDY_WORKSPACE_ID\",pr:\"BUDDY_EXECUTION_PULL_REQUEST_ID\"},{name:\"Buildkite\",constant:\"BUILDKITE\",env:\"BUILDKITE\",pr:{env:\"BUILDKITE_PULL_REQUEST\",ne:\"false\"}},{name:\"CircleCI\",constant:\"CIRCLE\",env:\"CIRCLECI\",pr:\"CIRCLE_PULL_REQUEST\"},{name:\"Cirrus CI\",constant:\"CIRRUS\",env:\"CIRRUS_CI\",pr:\"CIRRUS_PR\"},{name:\"Codefresh\",constant:\"CODEFRESH\",env:\"CF_BUILD_ID\",pr:{any:[\"CF_PULL_REQUEST_NUMBER\",\"CF_PULL_REQUEST_ID\"]}},{name:\"Codemagic\",constant:\"CODEMAGIC\",env:\"CM_BUILD_ID\",pr:\"CM_PULL_REQUEST\"},{name:\"Codeship\",constant:\"CODESHIP\",env:{CI_NAME:\"codeship\"}},{name:\"Drone\",constant:\"DRONE\",env:\"DRONE\",pr:{DRONE_BUILD_EVENT:\"pull_request\"}},{name:\"dsari\",constant:\"DSARI\",env:\"DSARI\"},{name:\"Earthly\",constant:\"EARTHLY\",env:\"EARTHLY_CI\"},{name:\"Expo Application Services\",constant:\"EAS\",env:\"EAS_BUILD\"},{name:\"Gerrit\",constant:\"GERRIT\",env:\"GERRIT_PROJECT\"},{name:\"Gitea Actions\",constant:\"GITEA_ACTIONS\",env:\"GITEA_ACTIONS\"},{name:\"GitHub Actions\",constant:\"GITHUB_ACTIONS\",env:\"GITHUB_ACTIONS\",pr:{GITHUB_EVENT_NAME:\"pull_request\"}},{name:\"GitLab CI\",constant:\"GITLAB\",env:\"GITLAB_CI\",pr:\"CI_MERGE_REQUEST_ID\"},{name:\"GoCD\",constant:\"GOCD\",env:\"GO_PIPELINE_LABEL\"},{name:\"Google Cloud Build\",constant:\"GOOGLE_CLOUD_BUILD\",env:\"BUILDER_OUTPUT\"},{name:\"Harness CI\",constant:\"HARNESS\",env:\"HARNESS_BUILD_ID\"},{name:\"Heroku\",constant:\"HEROKU\",env:{env:\"NODE\",includes:\"/app/.heroku/node/bin/node\"}},{name:\"Hudson\",constant:\"HUDSON\",env:\"HUDSON_URL\"},{name:\"Jenkins\",constant:\"JENKINS\",env:[\"JENKINS_URL\",\"BUILD_ID\"],pr:{any:[\"ghprbPullId\",\"CHANGE_ID\"]}},{name:\"LayerCI\",constant:\"LAYERCI\",env:\"LAYERCI\",pr:\"LAYERCI_PULL_REQUEST\"},{name:\"Magnum CI\",constant:\"MAGNUM\",env:\"MAGNUM\"},{name:\"Netlify CI\",constant:\"NETLIFY\",env:\"NETLIFY\",pr:{env:\"PULL_REQUEST\",ne:\"false\"}},{name:\"Nevercode\",constant:\"NEVERCODE\",env:\"NEVERCODE\",pr:{env:\"NEVERCODE_PULL_REQUEST\",ne:\"false\"}},{name:\"Prow\",constant:\"PROW\",env:\"PROW_JOB_ID\"},{name:\"ReleaseHub\",constant:\"RELEASEHUB\",env:\"RELEASE_BUILD_ID\"},{name:\"Render\",constant:\"RENDER\",env:\"RENDER\",pr:{IS_PULL_REQUEST:\"true\"}},{name:\"Sail CI\",constant:\"SAIL\",env:\"SAILCI\",pr:\"SAIL_PULL_REQUEST_NUMBER\"},{name:\"Screwdriver\",constant:\"SCREWDRIVER\",env:\"SCREWDRIVER\",pr:{env:\"SD_PULL_REQUEST\",ne:\"false\"}},{name:\"Semaphore\",constant:\"SEMAPHORE\",env:\"SEMAPHORE\",pr:\"PULL_REQUEST_NUMBER\"},{name:\"Sourcehut\",constant:\"SOURCEHUT\",env:{CI_NAME:\"sourcehut\"}},{name:\"Strider CD\",constant:\"STRIDER\",env:\"STRIDER\"},{name:\"TaskCluster\",constant:\"TASKCLUSTER\",env:[\"TASK_ID\",\"RUN_ID\"]},{name:\"TeamCity\",constant:\"TEAMCITY\",env:\"TEAMCITY_VERSION\"},{name:\"Travis CI\",constant:\"TRAVIS\",env:\"TRAVIS\",pr:{env:\"TRAVIS_PULL_REQUEST\",ne:\"false\"}},{name:\"Vela\",constant:\"VELA\",env:\"VELA\",pr:{VELA_PULL_REQUEST:\"1\"}},{name:\"Vercel\",constant:\"VERCEL\",env:{any:[\"NOW_BUILDER\",\"VERCEL\"]},pr:\"VERCEL_GIT_PULL_REQUEST_ID\"},{name:\"Visual Studio App Center\",constant:\"APPCENTER\",env:\"APPCENTER_BUILD_ID\"},{name:\"Woodpecker\",constant:\"WOODPECKER\",env:{CI:\"woodpecker\"},pr:{CI_BUILD_EVENT:\"pull_request\"}},{name:\"Xcode Cloud\",constant:\"XCODE_CLOUD\",env:\"CI_XCODE_PROJECT\",pr:\"CI_PULL_REQUEST_NUMBER\"},{name:\"Xcode Server\",constant:\"XCODE_SERVER\",env:\"XCS\"}]});var Fd=_(Ml=>{\"use strict\";var vre=wre(),Ds=process.env;Object.defineProperty(Ml,\"_vendors\",{value:vre.map(function(t){return t.constant})});Ml.name=null;Ml.isPR=null;vre.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(s){return Bre(s)});if(Ml[t.constant]=r,!!r)switch(Ml.name=t.name,typeof t.pr){case\"string\":Ml.isPR=!!Ds[t.pr];break;case\"object\":\"env\"in t.pr?Ml.isPR=t.pr.env in Ds&&Ds[t.pr.env]!==t.pr.ne:\"any\"in t.pr?Ml.isPR=t.pr.any.some(function(s){return!!Ds[s]}):Ml.isPR=Bre(t.pr);break;default:Ml.isPR=null}});Ml.isCI=!!(Ds.CI!==\"false\"&&(Ds.BUILD_ID||Ds.BUILD_NUMBER||Ds.CI||Ds.CI_APP_ID||Ds.CI_BUILD_ID||Ds.CI_BUILD_NUMBER||Ds.CI_NAME||Ds.CONTINUOUS_INTEGRATION||Ds.RUN_ID||Ml.name));function Bre(t){return typeof t==\"string\"?!!Ds[t]:\"env\"in t?Ds[t.env]&&Ds[t.env].includes(t.includes):\"any\"in t?t.any.some(function(e){return!!Ds[e]}):Object.keys(t).every(function(e){return Ds[e]===t[e]})}});var ei,En,Nd,s_,Px,Sre,o_,a_,bx=Ze(()=>{(function(t){t.StartOfInput=\"\\0\",t.EndOfInput=\"\u0001\",t.EndOfPartialInput=\"\u0002\"})(ei||(ei={}));(function(t){t[t.InitialNode=0]=\"InitialNode\",t[t.SuccessNode=1]=\"SuccessNode\",t[t.ErrorNode=2]=\"ErrorNode\",t[t.CustomNode=3]=\"CustomNode\"})(En||(En={}));Nd=-1,s_=/^(-h|--help)(?:=([0-9]+))?$/,Px=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,Sre=/^-[a-zA-Z]{2,}$/,o_=/^([^=]+)=([\\s\\S]*)$/,a_=process.env.DEBUG_CLI===\"1\"});var nt,IE,xx,l_,kx=Ze(()=>{bx();nt=class extends Error{constructor(e){super(e),this.clipanion={type:\"usage\"},this.name=\"UsageError\"}},IE=class extends Error{constructor(e,r){if(super(),this.input=e,this.candidates=r,this.clipanion={type:\"none\"},this.name=\"UnknownSyntaxError\",this.candidates.length===0)this.message=\"Command not found, but we're not sure what's the alternative.\";else if(this.candidates.every(s=>s.reason!==null&&s.reason===r[0].reason)){let[{reason:s}]=this.candidates;this.message=`${s}\n\n${this.candidates.map(({usage:a})=>`$ ${a}`).join(`\n`)}`}else if(this.candidates.length===1){let[{usage:s}]=this.candidates;this.message=`Command not found; did you mean:\n\n$ ${s}\n${l_(e)}`}else this.message=`Command not found; did you mean one of:\n\n${this.candidates.map(({usage:s},a)=>`${`${a}.`.padStart(4)} ${s}`).join(`\n`)}\n\n${l_(e)}`}},xx=class extends Error{constructor(e,r){super(),this.input=e,this.usages=r,this.clipanion={type:\"none\"},this.name=\"AmbiguousSyntaxError\",this.message=`Cannot find which to pick amongst the following alternatives:\n\n${this.usages.map((s,a)=>`${`${a}.`.padStart(4)} ${s}`).join(`\n`)}\n\n${l_(e)}`}},l_=t=>`While running ${t.filter(e=>e!==ei.EndOfInput&&e!==ei.EndOfPartialInput).map(e=>{let r=JSON.stringify(e);return e.match(/\\s/)||e.length===0||r!==`\"${e}\"`?r:e}).join(\" \")}`});function BWe(t){let e=t.split(`\n`),r=e.filter(a=>a.match(/\\S/)),s=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return e.map(a=>a.slice(s).trimRight()).join(`\n`)}function Ho(t,{format:e,paragraphs:r}){return t=t.replace(/\\r\\n?/g,`\n`),t=BWe(t),t=t.replace(/^\\n+|\\n+$/g,\"\"),t=t.replace(/^(\\s*)-([^\\n]*?)\\n+/gm,`$1-$2\n\n`),t=t.replace(/\\n(\\n)?\\n*/g,(s,a)=>a||\" \"),r&&(t=t.split(/\\n/).map(s=>{let a=s.match(/^\\s*[*-][\\t ]+(.*)/);if(!a)return s.match(/(.{1,80})(?: |$)/g).join(`\n`);let n=s.length-s.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,\"g\")).map((c,f)=>\" \".repeat(n)+(f===0?\"- \":\"  \")+c).join(`\n`)}).join(`\n\n`)),t=t.replace(/(`+)((?:.|[\\n])*?)\\1/g,(s,a,n)=>e.code(a+n+a)),t=t.replace(/(\\*\\*)((?:.|[\\n])*?)\\1/g,(s,a,n)=>e.bold(a+n+a)),t?`${t}\n`:\"\"}var c_,Dre,Pre,u_=Ze(()=>{c_=Array(80).fill(\"\\u2501\");for(let t=0;t<=24;++t)c_[c_.length-t]=`\\x1B[38;5;${232+t}m\\u2501`;Dre={header:t=>`\\x1B[1m\\u2501\\u2501\\u2501 ${t}${t.length<75?` ${c_.slice(t.length+5).join(\"\")}`:\":\"}\\x1B[0m`,bold:t=>`\\x1B[1m${t}\\x1B[22m`,error:t=>`\\x1B[31m\\x1B[1m${t}\\x1B[22m\\x1B[39m`,code:t=>`\\x1B[36m${t}\\x1B[39m`},Pre={header:t=>t,bold:t=>t,error:t=>t,code:t=>t}});function ya(t){return{...t,[K2]:!0}}function Gf(t,e){return typeof t>\"u\"?[t,e]:typeof t==\"object\"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function Qx(t,{mergeName:e=!1}={}){let r=t.match(/^([^:]+): (.*)$/m);if(!r)return\"validation failed\";let[,s,a]=r;return e&&(a=a[0].toLowerCase()+a.slice(1)),a=s!==\".\"||!e?`${s.replace(/^\\.(\\[|$)/,\"$1\")}: ${a}`:`: ${a}`,a}function z2(t,e){return e.length===1?new nt(`${t}${Qx(e[0],{mergeName:!0})}`):new nt(`${t}:\n${e.map(r=>`\n- ${Qx(r)}`).join(\"\")}`)}function Od(t,e,r){if(typeof r>\"u\")return e;let s=[],a=[],n=f=>{let p=e;return e=f,n.bind(null,p)};if(!r(e,{errors:s,coercions:a,coercion:n}))throw z2(`Invalid value for ${t}`,s);for(let[,f]of a)f();return e}var K2,Cp=Ze(()=>{kx();K2=Symbol(\"clipanion/isOption\")});var Ea={};Vt(Ea,{KeyRelationship:()=>qf,TypeAssertionError:()=>o0,applyCascade:()=>$2,as:()=>jWe,assert:()=>UWe,assertWithErrors:()=>_We,cascade:()=>Nx,fn:()=>GWe,hasAtLeastOneKey:()=>m_,hasExactLength:()=>Rre,hasForbiddenKeys:()=>lYe,hasKeyRelationship:()=>tB,hasMaxLength:()=>WWe,hasMinLength:()=>qWe,hasMutuallyExclusiveKeys:()=>cYe,hasRequiredKeys:()=>aYe,hasUniqueItems:()=>YWe,isArray:()=>Rx,isAtLeast:()=>g_,isAtMost:()=>KWe,isBase64:()=>nYe,isBoolean:()=>QWe,isDate:()=>TWe,isDict:()=>OWe,isEnum:()=>fo,isHexColor:()=>rYe,isISO8601:()=>tYe,isInExclusiveRange:()=>ZWe,isInInclusiveRange:()=>zWe,isInstanceOf:()=>MWe,isInteger:()=>d_,isJSON:()=>iYe,isLiteral:()=>xre,isLowerCase:()=>XWe,isMap:()=>NWe,isNegative:()=>VWe,isNullable:()=>oYe,isNumber:()=>p_,isObject:()=>kre,isOneOf:()=>h_,isOptional:()=>sYe,isPartial:()=>LWe,isPayload:()=>RWe,isPositive:()=>JWe,isRecord:()=>Fx,isSet:()=>FWe,isString:()=>wE,isTuple:()=>Tx,isUUID4:()=>eYe,isUnknown:()=>A_,isUpperCase:()=>$We,makeTrait:()=>Qre,makeValidator:()=>Wr,matchesRegExp:()=>X2,softAssert:()=>HWe});function ti(t){return t===null?\"null\":t===void 0?\"undefined\":t===\"\"?\"an empty string\":typeof t==\"symbol\"?`<${t.toString()}>`:Array.isArray(t)?\"an array\":JSON.stringify(t)}function CE(t,e){if(t.length===0)return\"nothing\";if(t.length===1)return ti(t[0]);let r=t.slice(0,-1),s=t[t.length-1],a=t.length>2?`, ${e} `:` ${e} `;return`${r.map(n=>ti(n)).join(\", \")}${a}${ti(s)}`}function s0(t,e){var r,s,a;return typeof e==\"number\"?`${(r=t?.p)!==null&&r!==void 0?r:\".\"}[${e}]`:vWe.test(e)?`${(s=t?.p)!==null&&s!==void 0?s:\"\"}.${e}`:`${(a=t?.p)!==null&&a!==void 0?a:\".\"}[${JSON.stringify(e)}]`}function f_(t,e,r){return t===1?e:r}function mr({errors:t,p:e}={},r){return t?.push(`${e??\".\"}: ${r}`),!1}function xWe(t,e){return r=>{t[e]=r}}function Wf(t,e){return r=>{let s=t[e];return t[e]=r,Wf(t,e).bind(null,s)}}function Z2(t,e,r){let s=()=>(t(r()),a),a=()=>(t(e),s);return s}function A_(){return Wr({test:(t,e)=>!0})}function xre(t){return Wr({test:(e,r)=>e!==t?mr(r,`Expected ${ti(t)} (got ${ti(e)})`):!0})}function wE(){return Wr({test:(t,e)=>typeof t!=\"string\"?mr(e,`Expected a string (got ${ti(t)})`):!0})}function fo(t){let e=Array.isArray(t)?t:Object.values(t),r=e.every(a=>typeof a==\"string\"||typeof a==\"number\"),s=new Set(e);return s.size===1?xre([...s][0]):Wr({test:(a,n)=>s.has(a)?!0:r?mr(n,`Expected one of ${CE(e,\"or\")} (got ${ti(a)})`):mr(n,`Expected a valid enumeration value (got ${ti(a)})`)})}function QWe(){return Wr({test:(t,e)=>{var r;if(typeof t!=\"boolean\"){if(typeof e?.coercions<\"u\"){if(typeof e?.coercion>\"u\")return mr(e,\"Unbound coercion result\");let s=kWe.get(t);if(typeof s<\"u\")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:\".\",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a boolean (got ${ti(t)})`)}return!0}})}function p_(){return Wr({test:(t,e)=>{var r;if(typeof t!=\"number\"){if(typeof e?.coercions<\"u\"){if(typeof e?.coercion>\"u\")return mr(e,\"Unbound coercion result\");let s;if(typeof t==\"string\"){let a;try{a=JSON.parse(t)}catch{}if(typeof a==\"number\")if(JSON.stringify(a)===t)s=a;else return mr(e,`Received a number that can't be safely represented by the runtime (${t})`)}if(typeof s<\"u\")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:\".\",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a number (got ${ti(t)})`)}return!0}})}function RWe(t){return Wr({test:(e,r)=>{var s;if(typeof r?.coercions>\"u\")return mr(r,\"The isPayload predicate can only be used with coercion enabled\");if(typeof r.coercion>\"u\")return mr(r,\"Unbound coercion result\");if(typeof e!=\"string\")return mr(r,`Expected a string (got ${ti(e)})`);let a;try{a=JSON.parse(e)}catch{return mr(r,`Expected a JSON string (got ${ti(e)})`)}let n={value:a};return t(a,Object.assign(Object.assign({},r),{coercion:Wf(n,\"value\")}))?(r.coercions.push([(s=r.p)!==null&&s!==void 0?s:\".\",r.coercion.bind(null,n.value)]),!0):!1}})}function TWe(){return Wr({test:(t,e)=>{var r;if(!(t instanceof Date)){if(typeof e?.coercions<\"u\"){if(typeof e?.coercion>\"u\")return mr(e,\"Unbound coercion result\");let s;if(typeof t==\"string\"&&bre.test(t))s=new Date(t);else{let a;if(typeof t==\"string\"){let n;try{n=JSON.parse(t)}catch{}typeof n==\"number\"&&(a=n)}else typeof t==\"number\"&&(a=t);if(typeof a<\"u\")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))s=new Date(a*1e3);else return mr(e,`Received a timestamp that can't be safely represented by the runtime (${t})`)}if(typeof s<\"u\")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:\".\",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a date (got ${ti(t)})`)}return!0}})}function Rx(t,{delimiter:e}={}){return Wr({test:(r,s)=>{var a;let n=r;if(typeof r==\"string\"&&typeof e<\"u\"&&typeof s?.coercions<\"u\"){if(typeof s?.coercion>\"u\")return mr(s,\"Unbound coercion result\");r=r.split(e)}if(!Array.isArray(r))return mr(s,`Expected an array (got ${ti(r)})`);let c=!0;for(let f=0,p=r.length;f<p&&(c=t(r[f],Object.assign(Object.assign({},s),{p:s0(s,f),coercion:Wf(r,f)}))&&c,!(!c&&s?.errors==null));++f);return r!==n&&s.coercions.push([(a=s.p)!==null&&a!==void 0?a:\".\",s.coercion.bind(null,r)]),c}})}function FWe(t,{delimiter:e}={}){let r=Rx(t,{delimiter:e});return Wr({test:(s,a)=>{var n,c;if(Object.getPrototypeOf(s).toString()===\"[object Set]\")if(typeof a?.coercions<\"u\"){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");let f=[...s],p=[...s];if(!r(p,Object.assign(Object.assign({},a),{coercion:void 0})))return!1;let h=()=>p.some((E,C)=>E!==f[C])?new Set(p):s;return a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",Z2(a.coercion,s,h)]),!0}else{let f=!0;for(let p of s)if(f=t(p,Object.assign({},a))&&f,!f&&a?.errors==null)break;return f}if(typeof a?.coercions<\"u\"){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");let f={value:s};return r(s,Object.assign(Object.assign({},a),{coercion:Wf(f,\"value\")}))?(a.coercions.push([(c=a.p)!==null&&c!==void 0?c:\".\",Z2(a.coercion,s,()=>new Set(f.value))]),!0):!1}return mr(a,`Expected a set (got ${ti(s)})`)}})}function NWe(t,e){let r=Rx(Tx([t,e])),s=Fx(e,{keys:t});return Wr({test:(a,n)=>{var c,f,p;if(Object.getPrototypeOf(a).toString()===\"[object Map]\")if(typeof n?.coercions<\"u\"){if(typeof n?.coercion>\"u\")return mr(n,\"Unbound coercion result\");let h=[...a],E=[...a];if(!r(E,Object.assign(Object.assign({},n),{coercion:void 0})))return!1;let C=()=>E.some((S,b)=>S[0]!==h[b][0]||S[1]!==h[b][1])?new Map(E):a;return n.coercions.push([(c=n.p)!==null&&c!==void 0?c:\".\",Z2(n.coercion,a,C)]),!0}else{let h=!0;for(let[E,C]of a)if(h=t(E,Object.assign({},n))&&h,!h&&n?.errors==null||(h=e(C,Object.assign(Object.assign({},n),{p:s0(n,E)}))&&h,!h&&n?.errors==null))break;return h}if(typeof n?.coercions<\"u\"){if(typeof n?.coercion>\"u\")return mr(n,\"Unbound coercion result\");let h={value:a};return Array.isArray(a)?r(a,Object.assign(Object.assign({},n),{coercion:void 0}))?(n.coercions.push([(f=n.p)!==null&&f!==void 0?f:\".\",Z2(n.coercion,a,()=>new Map(h.value))]),!0):!1:s(a,Object.assign(Object.assign({},n),{coercion:Wf(h,\"value\")}))?(n.coercions.push([(p=n.p)!==null&&p!==void 0?p:\".\",Z2(n.coercion,a,()=>new Map(Object.entries(h.value)))]),!0):!1}return mr(n,`Expected a map (got ${ti(a)})`)}})}function Tx(t,{delimiter:e}={}){let r=Rre(t.length);return Wr({test:(s,a)=>{var n;if(typeof s==\"string\"&&typeof e<\"u\"&&typeof a?.coercions<\"u\"){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");s=s.split(e),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",a.coercion.bind(null,s)])}if(!Array.isArray(s))return mr(a,`Expected a tuple (got ${ti(s)})`);let c=r(s,Object.assign({},a));for(let f=0,p=s.length;f<p&&f<t.length&&(c=t[f](s[f],Object.assign(Object.assign({},a),{p:s0(a,f),coercion:Wf(s,f)}))&&c,!(!c&&a?.errors==null));++f);return c}})}function Fx(t,{keys:e=null}={}){let r=Rx(Tx([e??wE(),t]));return Wr({test:(s,a)=>{var n;if(Array.isArray(s)&&typeof a?.coercions<\"u\")return typeof a?.coercion>\"u\"?mr(a,\"Unbound coercion result\"):r(s,Object.assign(Object.assign({},a),{coercion:void 0}))?(s=Object.fromEntries(s),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",a.coercion.bind(null,s)]),!0):!1;if(typeof s!=\"object\"||s===null)return mr(a,`Expected an object (got ${ti(s)})`);let c=Object.keys(s),f=!0;for(let p=0,h=c.length;p<h&&(f||a?.errors!=null);++p){let E=c[p],C=s[E];if(E===\"__proto__\"||E===\"constructor\"){f=mr(Object.assign(Object.assign({},a),{p:s0(a,E)}),\"Unsafe property name\");continue}if(e!==null&&!e(E,a)){f=!1;continue}if(!t(C,Object.assign(Object.assign({},a),{p:s0(a,E),coercion:Wf(s,E)}))){f=!1;continue}}return f}})}function OWe(t,e={}){return Fx(t,e)}function kre(t,{extra:e=null}={}){let r=Object.keys(t),s=Wr({test:(a,n)=>{if(typeof a!=\"object\"||a===null)return mr(n,`Expected an object (got ${ti(a)})`);let c=new Set([...r,...Object.keys(a)]),f={},p=!0;for(let h of c){if(h===\"constructor\"||h===\"__proto__\")p=mr(Object.assign(Object.assign({},n),{p:s0(n,h)}),\"Unsafe property name\");else{let E=Object.prototype.hasOwnProperty.call(t,h)?t[h]:void 0,C=Object.prototype.hasOwnProperty.call(a,h)?a[h]:void 0;typeof E<\"u\"?p=E(C,Object.assign(Object.assign({},n),{p:s0(n,h),coercion:Wf(a,h)}))&&p:e===null?p=mr(Object.assign(Object.assign({},n),{p:s0(n,h)}),`Extraneous property (got ${ti(C)})`):Object.defineProperty(f,h,{enumerable:!0,get:()=>C,set:xWe(a,h)})}if(!p&&n?.errors==null)break}return e!==null&&(p||n?.errors!=null)&&(p=e(f,n)&&p),p}});return Object.assign(s,{properties:t})}function LWe(t){return kre(t,{extra:Fx(A_())})}function Qre(t){return()=>t}function Wr({test:t}){return Qre(t)()}function UWe(t,e){if(!e(t))throw new o0}function _We(t,e){let r=[];if(!e(t,{errors:r}))throw new o0({errors:r})}function HWe(t,e){}function jWe(t,e,{coerce:r=!1,errors:s,throw:a}={}){let n=s?[]:void 0;if(!r){if(e(t,{errors:n}))return a?t:{value:t,errors:void 0};if(a)throw new o0({errors:n});return{value:void 0,errors:n??!0}}let c={value:t},f=Wf(c,\"value\"),p=[];if(!e(t,{errors:n,coercion:f,coercions:p})){if(a)throw new o0({errors:n});return{value:void 0,errors:n??!0}}for(let[,h]of p)h();return a?c.value:{value:c.value,errors:void 0}}function GWe(t,e){let r=Tx(t);return(...s)=>{if(!r(s))throw new o0;return e(...s)}}function qWe(t){return Wr({test:(e,r)=>e.length>=t?!0:mr(r,`Expected to have a length of at least ${t} elements (got ${e.length})`)})}function WWe(t){return Wr({test:(e,r)=>e.length<=t?!0:mr(r,`Expected to have a length of at most ${t} elements (got ${e.length})`)})}function Rre(t){return Wr({test:(e,r)=>e.length!==t?mr(r,`Expected to have a length of exactly ${t} elements (got ${e.length})`):!0})}function YWe({map:t}={}){return Wr({test:(e,r)=>{let s=new Set,a=new Set;for(let n=0,c=e.length;n<c;++n){let f=e[n],p=typeof t<\"u\"?t(f):f;if(s.has(p)){if(a.has(p))continue;mr(r,`Expected to contain unique elements; got a duplicate with ${ti(e)}`),a.add(p)}else s.add(p)}return a.size===0}})}function VWe(){return Wr({test:(t,e)=>t<=0?!0:mr(e,`Expected to be negative (got ${t})`)})}function JWe(){return Wr({test:(t,e)=>t>=0?!0:mr(e,`Expected to be positive (got ${t})`)})}function g_(t){return Wr({test:(e,r)=>e>=t?!0:mr(r,`Expected to be at least ${t} (got ${e})`)})}function KWe(t){return Wr({test:(e,r)=>e<=t?!0:mr(r,`Expected to be at most ${t} (got ${e})`)})}function zWe(t,e){return Wr({test:(r,s)=>r>=t&&r<=e?!0:mr(s,`Expected to be in the [${t}; ${e}] range (got ${r})`)})}function ZWe(t,e){return Wr({test:(r,s)=>r>=t&&r<e?!0:mr(s,`Expected to be in the [${t}; ${e}[ range (got ${r})`)})}function d_({unsafe:t=!1}={}){return Wr({test:(e,r)=>e!==Math.round(e)?mr(r,`Expected to be an integer (got ${e})`):!t&&!Number.isSafeInteger(e)?mr(r,`Expected to be a safe integer (got ${e})`):!0})}function X2(t){return Wr({test:(e,r)=>t.test(e)?!0:mr(r,`Expected to match the pattern ${t.toString()} (got ${ti(e)})`)})}function XWe(){return Wr({test:(t,e)=>t!==t.toLowerCase()?mr(e,`Expected to be all-lowercase (got ${t})`):!0})}function $We(){return Wr({test:(t,e)=>t!==t.toUpperCase()?mr(e,`Expected to be all-uppercase (got ${t})`):!0})}function eYe(){return Wr({test:(t,e)=>bWe.test(t)?!0:mr(e,`Expected to be a valid UUID v4 (got ${ti(t)})`)})}function tYe(){return Wr({test:(t,e)=>bre.test(t)?!0:mr(e,`Expected to be a valid ISO 8601 date string (got ${ti(t)})`)})}function rYe({alpha:t=!1}){return Wr({test:(e,r)=>(t?SWe.test(e):DWe.test(e))?!0:mr(r,`Expected to be a valid hexadecimal color string (got ${ti(e)})`)})}function nYe(){return Wr({test:(t,e)=>PWe.test(t)?!0:mr(e,`Expected to be a valid base 64 string (got ${ti(t)})`)})}function iYe(t=A_()){return Wr({test:(e,r)=>{let s;try{s=JSON.parse(e)}catch{return mr(r,`Expected to be a valid JSON string (got ${ti(e)})`)}return t(s,r)}})}function Nx(t,...e){let r=Array.isArray(e[0])?e[0]:e;return Wr({test:(s,a)=>{var n,c;let f={value:s},p=typeof a?.coercions<\"u\"?Wf(f,\"value\"):void 0,h=typeof a?.coercions<\"u\"?[]:void 0;if(!t(s,Object.assign(Object.assign({},a),{coercion:p,coercions:h})))return!1;let E=[];if(typeof h<\"u\")for(let[,C]of h)E.push(C());try{if(typeof a?.coercions<\"u\"){if(f.value!==s){if(typeof a?.coercion>\"u\")return mr(a,\"Unbound coercion result\");a.coercions.push([(n=a.p)!==null&&n!==void 0?n:\".\",a.coercion.bind(null,f.value)])}(c=a?.coercions)===null||c===void 0||c.push(...h)}return r.every(C=>C(f.value,a))}finally{for(let C of E)C()}}})}function $2(t,...e){let r=Array.isArray(e[0])?e[0]:e;return Nx(t,r)}function sYe(t){return Wr({test:(e,r)=>typeof e>\"u\"?!0:t(e,r)})}function oYe(t){return Wr({test:(e,r)=>e===null?!0:t(e,r)})}function aYe(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>{let f=new Set(Object.keys(n)),p=[];for(let h of s)a(f,h,n)||p.push(h);return p.length>0?mr(c,`Missing required ${f_(p.length,\"property\",\"properties\")} ${CE(p,\"and\")}`):!0}})}function m_(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>Object.keys(n).some(h=>a(s,h,n))?!0:mr(c,`Missing at least one property from ${CE(Array.from(s),\"or\")}`)})}function lYe(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>{let f=new Set(Object.keys(n)),p=[];for(let h of s)a(f,h,n)&&p.push(h);return p.length>0?mr(c,`Forbidden ${f_(p.length,\"property\",\"properties\")} ${CE(p,\"and\")}`):!0}})}function cYe(t,e){var r;let s=new Set(t),a=eB[(r=e?.missingIf)!==null&&r!==void 0?r:\"missing\"];return Wr({test:(n,c)=>{let f=new Set(Object.keys(n)),p=[];for(let h of s)a(f,h,n)&&p.push(h);return p.length>1?mr(c,`Mutually exclusive properties ${CE(p,\"and\")}`):!0}})}function tB(t,e,r,s){var a,n;let c=new Set((a=s?.ignore)!==null&&a!==void 0?a:[]),f=eB[(n=s?.missingIf)!==null&&n!==void 0?n:\"missing\"],p=new Set(r),h=uYe[e],E=e===qf.Forbids?\"or\":\"and\";return Wr({test:(C,S)=>{let b=new Set(Object.keys(C));if(!f(b,t,C)||c.has(C[t]))return!0;let I=[];for(let T of p)(f(b,T,C)&&!c.has(C[T]))!==h.expect&&I.push(T);return I.length>=1?mr(S,`Property \"${t}\" ${h.message} ${f_(I.length,\"property\",\"properties\")} ${CE(I,E)}`):!0}})}var vWe,SWe,DWe,PWe,bWe,bre,kWe,MWe,h_,o0,eB,qf,uYe,Ul=Ze(()=>{vWe=/^[a-zA-Z_][a-zA-Z0-9_]*$/;SWe=/^#[0-9a-f]{6}$/i,DWe=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,PWe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,bWe=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,bre=/^(?:[1-9]\\d{3}(-?)(?:(?:0[1-9]|1[0-2])\\1(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])\\1(?:29|30)|(?:0[13578]|1[02])(?:\\1)31|00[1-9]|0[1-9]\\d|[12]\\d{2}|3(?:[0-5]\\d|6[0-5]))|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\\2)29|-?366))T(?:[01]\\d|2[0-3])(:?)[0-5]\\d(?:\\3[0-5]\\d)?(?:Z|[+-][01]\\d(?:\\3[0-5]\\d)?)$/;kWe=new Map([[\"true\",!0],[\"True\",!0],[\"1\",!0],[1,!0],[\"false\",!1],[\"False\",!1],[\"0\",!1],[0,!1]]);MWe=t=>Wr({test:(e,r)=>e instanceof t?!0:mr(r,`Expected an instance of ${t.name} (got ${ti(e)})`)}),h_=(t,{exclusive:e=!1}={})=>Wr({test:(r,s)=>{var a,n,c;let f=[],p=typeof s?.errors<\"u\"?[]:void 0;for(let h=0,E=t.length;h<E;++h){let C=typeof s?.errors<\"u\"?[]:void 0,S=typeof s?.coercions<\"u\"?[]:void 0;if(t[h](r,Object.assign(Object.assign({},s),{errors:C,coercions:S,p:`${(a=s?.p)!==null&&a!==void 0?a:\".\"}#${h+1}`}))){if(f.push([`#${h+1}`,S]),!e)break}else p?.push(C[0])}if(f.length===1){let[,h]=f[0];return typeof h<\"u\"&&((n=s?.coercions)===null||n===void 0||n.push(...h)),!0}return f.length>1?mr(s,`Expected to match exactly a single predicate (matched ${f.join(\", \")})`):(c=s?.errors)===null||c===void 0||c.push(...p),!1}});o0=class extends Error{constructor({errors:e}={}){let r=\"Type mismatch\";if(e&&e.length>0){r+=`\n`;for(let s of e)r+=`\n- ${s}`}super(r)}};eB={missing:(t,e)=>t.has(e),undefined:(t,e,r)=>t.has(e)&&typeof r[e]<\"u\",nil:(t,e,r)=>t.has(e)&&r[e]!=null,falsy:(t,e,r)=>t.has(e)&&!!r[e]};(function(t){t.Forbids=\"Forbids\",t.Requires=\"Requires\"})(qf||(qf={}));uYe={[qf.Forbids]:{expect:!1,message:\"forbids using\"},[qf.Requires]:{expect:!0,message:\"requires using\"}}});var ot,a0=Ze(()=>{Cp();ot=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:c}=await Promise.resolve().then(()=>(Ul(),Ea)),f=c(a(n()),r),p=[],h=[];if(!f(this,{errors:p,coercions:h}))throw z2(\"Invalid option schema\",p);for(let[,C]of h)C()}else if(r!=null)throw new Error(\"Invalid command schema\");let s=await this.execute();return typeof s<\"u\"?s:0}};ot.isOption=K2;ot.Default=[]});function il(t){a_&&console.log(t)}function Fre(){let t={nodes:[]};for(let e=0;e<En.CustomNode;++e)t.nodes.push(_l());return t}function fYe(t){let e=Fre(),r=[],s=e.nodes.length;for(let a of t){r.push(s);for(let n=0;n<a.nodes.length;++n)Ore(n)||e.nodes.push(EYe(a.nodes[n],s));s+=a.nodes.length-En.CustomNode+1}for(let a of r)BE(e,En.InitialNode,a);return e}function Ou(t,e){return t.nodes.push(e),t.nodes.length-1}function AYe(t){let e=new Set,r=s=>{if(e.has(s))return;e.add(s);let a=t.nodes[s];for(let c of Object.values(a.statics))for(let{to:f}of c)r(f);for(let[,{to:c}]of a.dynamics)r(c);for(let{to:c}of a.shortcuts)r(c);let n=new Set(a.shortcuts.map(({to:c})=>c));for(;a.shortcuts.length>0;){let{to:c}=a.shortcuts.shift(),f=t.nodes[c];for(let[p,h]of Object.entries(f.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let C of h)E.some(({to:S})=>C.to===S)||E.push(C)}for(let[p,h]of f.dynamics)a.dynamics.some(([E,{to:C}])=>p===E&&h.to===C)||a.dynamics.push([p,h]);for(let p of f.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(En.InitialNode)}function pYe(t,{prefix:e=\"\"}={}){if(a_){il(`${e}Nodes are:`);for(let r=0;r<t.nodes.length;++r)il(`${e}  ${r}: ${JSON.stringify(t.nodes[r])}`)}}function hYe(t,e,r=!1){il(`Running a vm on ${JSON.stringify(e)}`);let s=[{node:En.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,partial:!1,tokens:[]}}];pYe(t,{prefix:\"  \"});let a=[ei.StartOfInput,...e];for(let n=0;n<a.length;++n){let c=a[n],f=c===ei.EndOfInput||c===ei.EndOfPartialInput,p=n-1;il(`  Processing ${JSON.stringify(c)}`);let h=[];for(let{node:E,state:C}of s){il(`    Current node is ${E}`);let S=t.nodes[E];if(E===En.ErrorNode){h.push({node:E,state:C});continue}console.assert(S.shortcuts.length===0,\"Shortcuts should have been eliminated by now\");let b=Object.prototype.hasOwnProperty.call(S.statics,c);if(!r||n<a.length-1||b)if(b){let I=S.statics[c];for(let{to:T,reducer:N}of I)h.push({node:T,state:typeof N<\"u\"?Ox(E_,N,C,c,p):C}),il(`      Static transition to ${T} found`)}else il(\"      No static transition found\");else{let I=!1;for(let T of Object.keys(S.statics))if(T.startsWith(c)){if(c===T)for(let{to:N,reducer:U}of S.statics[T])h.push({node:N,state:typeof U<\"u\"?Ox(E_,U,C,c,p):C}),il(`      Static transition to ${N} found`);else for(let{to:N}of S.statics[T])h.push({node:N,state:{...C,remainder:T.slice(c.length)}}),il(`      Static transition to ${N} found (partial match)`);I=!0}I||il(\"      No partial static transition found\")}if(!f)for(let[I,{to:T,reducer:N}]of S.dynamics)Ox(IYe,I,C,c,p)&&(h.push({node:T,state:typeof N<\"u\"?Ox(E_,N,C,c,p):C}),il(`      Dynamic transition to ${T} found (via ${I})`))}if(h.length===0&&f&&e.length===1)return[{node:En.InitialNode,state:Tre}];if(h.length===0)throw new IE(e,s.filter(({node:E})=>E!==En.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===En.ErrorNode))throw new IE(e,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));s=dYe(h)}if(s.length>0){il(\"  Results:\");for(let n of s)il(`    - ${n.node} -> ${JSON.stringify(n.state)}`)}else il(\"  No results\");return s}function gYe(t,e,{endToken:r=ei.EndOfInput}={}){let s=hYe(t,[...e,r]);return mYe(e,s.map(({state:a})=>a))}function dYe(t){let e=0;for(let{state:r}of t)r.path.length>e&&(e=r.path.length);return t.filter(({state:r})=>r.path.length===e)}function mYe(t,e){let r=e.filter(S=>S.selectedIndex!==null),s=r.filter(S=>!S.partial);if(s.length>0&&(r=s),r.length===0)throw new Error;let a=r.filter(S=>S.selectedIndex===Nd||S.requiredOptions.every(b=>b.some(I=>S.options.find(T=>T.name===I))));if(a.length===0)throw new IE(t,r.map(S=>({usage:S.candidateUsage,reason:null})));let n=0;for(let S of a)S.path.length>n&&(n=S.path.length);let c=a.filter(S=>S.path.length===n),f=S=>S.positionals.filter(({extra:b})=>!b).length+S.options.length,p=c.map(S=>({state:S,positionalCount:f(S)})),h=0;for(let{positionalCount:S}of p)S>h&&(h=S);let E=p.filter(({positionalCount:S})=>S===h).map(({state:S})=>S),C=yYe(E);if(C.length>1)throw new xx(t,C.map(S=>S.candidateUsage));return C[0]}function yYe(t){let e=[],r=[];for(let s of t)s.selectedIndex===Nd?r.push(s):e.push(s);return r.length>0&&e.push({...Tre,path:Nre(...r.map(s=>s.path)),options:r.reduce((s,a)=>s.concat(a.options),[])}),e}function Nre(t,e,...r){return e===void 0?Array.from(t):Nre(t.filter((s,a)=>s===e[a]),...r)}function _l(){return{dynamics:[],shortcuts:[],statics:{}}}function Ore(t){return t===En.SuccessNode||t===En.ErrorNode}function y_(t,e=0){return{to:Ore(t.to)?t.to:t.to>=En.CustomNode?t.to+e-En.CustomNode+1:t.to+e,reducer:t.reducer}}function EYe(t,e=0){let r=_l();for(let[s,a]of t.dynamics)r.dynamics.push([s,y_(a,e)]);for(let s of t.shortcuts)r.shortcuts.push(y_(s,e));for(let[s,a]of Object.entries(t.statics))r.statics[s]=a.map(n=>y_(n,e));return r}function Hs(t,e,r,s,a){t.nodes[e].dynamics.push([r,{to:s,reducer:a}])}function BE(t,e,r,s){t.nodes[e].shortcuts.push({to:r,reducer:s})}function Ia(t,e,r,s,a){(Object.prototype.hasOwnProperty.call(t.nodes[e].statics,r)?t.nodes[e].statics[r]:t.nodes[e].statics[r]=[]).push({to:s,reducer:a})}function Ox(t,e,r,s,a){if(Array.isArray(e)){let[n,...c]=e;return t[n](r,s,a,...c)}else return t[e](r,s,a)}var Tre,IYe,E_,Hl,I_,Lx,Mx=Ze(()=>{bx();kx();Tre={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:Nd,partial:!1,tokens:[]};IYe={always:()=>!0,isOptionLike:(t,e)=>!t.ignoreOptions&&e!==\"-\"&&e.startsWith(\"-\"),isNotOptionLike:(t,e)=>t.ignoreOptions||e===\"-\"||!e.startsWith(\"-\"),isOption:(t,e,r,s)=>!t.ignoreOptions&&e===s,isBatchOption:(t,e,r,s)=>!t.ignoreOptions&&Sre.test(e)&&[...e.slice(1)].every(a=>s.has(`-${a}`)),isBoundOption:(t,e,r,s,a)=>{let n=e.match(o_);return!t.ignoreOptions&&!!n&&Px.test(n[1])&&s.has(n[1])&&a.filter(c=>c.nameSet.includes(n[1])).every(c=>c.allowBinding)},isNegatedOption:(t,e,r,s)=>!t.ignoreOptions&&e===`--no-${s.slice(2)}`,isHelp:(t,e)=>!t.ignoreOptions&&s_.test(e),isUnsupportedOption:(t,e,r,s)=>!t.ignoreOptions&&e.startsWith(\"-\")&&Px.test(e)&&!s.has(e),isInvalidOption:(t,e)=>!t.ignoreOptions&&e.startsWith(\"-\")&&!Px.test(e)},E_={setCandidateState:(t,e,r,s)=>({...t,...s}),setSelectedIndex:(t,e,r,s)=>({...t,selectedIndex:s}),setPartialIndex:(t,e,r,s)=>({...t,selectedIndex:s,partial:!0}),pushBatch:(t,e,r,s)=>{let a=t.options.slice(),n=t.tokens.slice();for(let c=1;c<e.length;++c){let f=s.get(`-${e[c]}`),p=c===1?[0,2]:[c,c+1];a.push({name:f,value:!0}),n.push({segmentIndex:r,type:\"option\",option:f,slice:p})}return{...t,options:a,tokens:n}},pushBound:(t,e,r)=>{let[,s,a]=e.match(o_),n=t.options.concat({name:s,value:a}),c=t.tokens.concat([{segmentIndex:r,type:\"option\",slice:[0,s.length],option:s},{segmentIndex:r,type:\"assign\",slice:[s.length,s.length+1]},{segmentIndex:r,type:\"value\",slice:[s.length+1,s.length+a.length+1]}]);return{...t,options:n,tokens:c}},pushPath:(t,e,r)=>{let s=t.path.concat(e),a=t.tokens.concat({segmentIndex:r,type:\"path\"});return{...t,path:s,tokens:a}},pushPositional:(t,e,r)=>{let s=t.positionals.concat({value:e,extra:!1}),a=t.tokens.concat({segmentIndex:r,type:\"positional\"});return{...t,positionals:s,tokens:a}},pushExtra:(t,e,r)=>{let s=t.positionals.concat({value:e,extra:!0}),a=t.tokens.concat({segmentIndex:r,type:\"positional\"});return{...t,positionals:s,tokens:a}},pushExtraNoLimits:(t,e,r)=>{let s=t.positionals.concat({value:e,extra:Hl}),a=t.tokens.concat({segmentIndex:r,type:\"positional\"});return{...t,positionals:s,tokens:a}},pushTrue:(t,e,r,s)=>{let a=t.options.concat({name:s,value:!0}),n=t.tokens.concat({segmentIndex:r,type:\"option\",option:s});return{...t,options:a,tokens:n}},pushFalse:(t,e,r,s)=>{let a=t.options.concat({name:s,value:!1}),n=t.tokens.concat({segmentIndex:r,type:\"option\",option:s});return{...t,options:a,tokens:n}},pushUndefined:(t,e,r,s)=>{let a=t.options.concat({name:e,value:void 0}),n=t.tokens.concat({segmentIndex:r,type:\"option\",option:e});return{...t,options:a,tokens:n}},pushStringValue:(t,e,r)=>{var s;let a=t.options[t.options.length-1],n=t.options.slice(),c=t.tokens.concat({segmentIndex:r,type:\"value\"});return a.value=((s=a.value)!==null&&s!==void 0?s:[]).concat([e]),{...t,options:n,tokens:c}},setStringValue:(t,e,r)=>{let s=t.options[t.options.length-1],a=t.options.slice(),n=t.tokens.concat({segmentIndex:r,type:\"value\"});return s.value=e,{...t,options:a,tokens:n}},inhibateOptions:t=>({...t,ignoreOptions:!0}),useHelp:(t,e,r,s)=>{let[,,a]=e.match(s_);return typeof a<\"u\"?{...t,options:[{name:\"-c\",value:String(s)},{name:\"-i\",value:a}]}:{...t,options:[{name:\"-c\",value:String(s)}]}},setError:(t,e,r,s)=>e===ei.EndOfInput||e===ei.EndOfPartialInput?{...t,errorMessage:`${s}.`}:{...t,errorMessage:`${s} (\"${e}\").`},setOptionArityError:(t,e)=>{let r=t.options[t.options.length-1];return{...t,errorMessage:`Not enough arguments to option ${r.name}.`}}},Hl=Symbol(),I_=class{constructor(e,r){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=e,this.cliOpts=r}addPath(e){this.paths.push(e)}setArity({leading:e=this.arity.leading,trailing:r=this.arity.trailing,extra:s=this.arity.extra,proxy:a=this.arity.proxy}){Object.assign(this.arity,{leading:e,trailing:r,extra:s,proxy:a})}addPositional({name:e=\"arg\",required:r=!0}={}){if(!r&&this.arity.extra===Hl)throw new Error(\"Optional parameters cannot be declared when using .rest() or .proxy()\");if(!r&&this.arity.trailing.length>0)throw new Error(\"Optional parameters cannot be declared after the required trailing positional arguments\");!r&&this.arity.extra!==Hl?this.arity.extra.push(e):this.arity.extra!==Hl&&this.arity.extra.length===0?this.arity.leading.push(e):this.arity.trailing.push(e)}addRest({name:e=\"arg\",required:r=0}={}){if(this.arity.extra===Hl)throw new Error(\"Infinite lists cannot be declared multiple times in the same command\");if(this.arity.trailing.length>0)throw new Error(\"Infinite lists cannot be declared after the required trailing positional arguments\");for(let s=0;s<r;++s)this.addPositional({name:e});this.arity.extra=Hl}addProxy({required:e=0}={}){this.addRest({required:e}),this.arity.proxy=!0}addOption({names:e,description:r,arity:s=0,hidden:a=!1,required:n=!1,allowBinding:c=!0}){if(!c&&s>1)throw new Error(\"The arity cannot be higher than 1 when the option only supports the --arg=value syntax\");if(!Number.isInteger(s))throw new Error(`The arity must be an integer, got ${s}`);if(s<0)throw new Error(`The arity must be positive, got ${s}`);let f=e.reduce((p,h)=>h.length>p.length?h:p,\"\");for(let p of e)this.allOptionNames.set(p,f);this.options.push({preferredName:f,nameSet:e,description:r,arity:s,hidden:a,required:n,allowBinding:c})}setContext(e){this.context=e}usage({detailed:e=!0,inlineOptions:r=!0}={}){let s=[this.cliOpts.binaryName],a=[];if(this.paths.length>0&&s.push(...this.paths[0]),e){for(let{preferredName:c,nameSet:f,arity:p,hidden:h,description:E,required:C}of this.options){if(h)continue;let S=[];for(let I=0;I<p;++I)S.push(` #${I}`);let b=`${f.join(\",\")}${S.join(\"\")}`;!r&&E?a.push({preferredName:c,nameSet:f,definition:b,description:E,required:C}):s.push(C?`<${b}>`:`[${b}]`)}s.push(...this.arity.leading.map(c=>`<${c}>`)),this.arity.extra===Hl?s.push(\"...\"):s.push(...this.arity.extra.map(c=>`[${c}]`)),s.push(...this.arity.trailing.map(c=>`<${c}>`))}return{usage:s.join(\" \"),options:a}}compile(){if(typeof this.context>\"u\")throw new Error(\"Assertion failed: No context attached\");let e=Fre(),r=En.InitialNode,s=this.usage().usage,a=this.options.filter(f=>f.required).map(f=>f.nameSet);r=Ou(e,_l()),Ia(e,En.InitialNode,ei.StartOfInput,r,[\"setCandidateState\",{candidateUsage:s,requiredOptions:a}]);let n=this.arity.proxy?\"always\":\"isNotOptionLike\",c=this.paths.length>0?this.paths:[[]];for(let f of c){let p=r;if(f.length>0){let S=Ou(e,_l());BE(e,p,S),this.registerOptions(e,S),p=S}for(let S=0;S<f.length;++S){let b=Ou(e,_l());Ia(e,p,f[S],b,\"pushPath\"),p=b}if(this.arity.leading.length>0||!this.arity.proxy){let S=Ou(e,_l());Hs(e,p,\"isHelp\",S,[\"useHelp\",this.cliIndex]),Hs(e,S,\"always\",S,\"pushExtra\"),Ia(e,S,ei.EndOfInput,En.SuccessNode,[\"setSelectedIndex\",Nd]),this.registerOptions(e,p)}this.arity.leading.length>0&&(Ia(e,p,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,p,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex]));let h=p;for(let S=0;S<this.arity.leading.length;++S){let b=Ou(e,_l());(!this.arity.proxy||S+1!==this.arity.leading.length)&&this.registerOptions(e,b),(this.arity.trailing.length>0||S+1!==this.arity.leading.length)&&(Ia(e,b,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,b,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex])),Hs(e,h,\"isNotOptionLike\",b,\"pushPositional\"),h=b}let E=h;if(this.arity.extra===Hl||this.arity.extra.length>0){let S=Ou(e,_l());if(BE(e,h,S),this.arity.extra===Hl){let b=Ou(e,_l());this.arity.proxy||this.registerOptions(e,b),Hs(e,h,n,b,\"pushExtraNoLimits\"),Hs(e,b,n,b,\"pushExtraNoLimits\"),BE(e,b,S)}else for(let b=0;b<this.arity.extra.length;++b){let I=Ou(e,_l());(!this.arity.proxy||b>0)&&this.registerOptions(e,I),Hs(e,E,n,I,\"pushExtra\"),BE(e,I,S),E=I}E=S}this.arity.trailing.length>0&&(Ia(e,E,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,E,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex]));let C=E;for(let S=0;S<this.arity.trailing.length;++S){let b=Ou(e,_l());this.arity.proxy||this.registerOptions(e,b),S+1<this.arity.trailing.length&&(Ia(e,b,ei.EndOfInput,En.ErrorNode,[\"setError\",\"Not enough positional arguments\"]),Ia(e,b,ei.EndOfPartialInput,En.SuccessNode,[\"setPartialIndex\",this.cliIndex])),Hs(e,C,\"isNotOptionLike\",b,\"pushPositional\"),C=b}Hs(e,C,n,En.ErrorNode,[\"setError\",\"Extraneous positional argument\"]),Ia(e,C,ei.EndOfInput,En.SuccessNode,[\"setSelectedIndex\",this.cliIndex]),Ia(e,C,ei.EndOfPartialInput,En.SuccessNode,[\"setSelectedIndex\",this.cliIndex])}return{machine:e,context:this.context}}registerOptions(e,r){Hs(e,r,[\"isOption\",\"--\"],r,\"inhibateOptions\"),Hs(e,r,[\"isBatchOption\",this.allOptionNames],r,[\"pushBatch\",this.allOptionNames]),Hs(e,r,[\"isBoundOption\",this.allOptionNames,this.options],r,\"pushBound\"),Hs(e,r,[\"isUnsupportedOption\",this.allOptionNames],En.ErrorNode,[\"setError\",\"Unsupported option name\"]),Hs(e,r,[\"isInvalidOption\"],En.ErrorNode,[\"setError\",\"Invalid option name\"]);for(let s of this.options)if(s.arity===0)for(let a of s.nameSet)Hs(e,r,[\"isOption\",a],r,[\"pushTrue\",s.preferredName]),a.startsWith(\"--\")&&!a.startsWith(\"--no-\")&&Hs(e,r,[\"isNegatedOption\",a],r,[\"pushFalse\",s.preferredName]);else{let a=Ou(e,_l());for(let n of s.nameSet)Hs(e,r,[\"isOption\",n],a,[\"pushUndefined\",s.preferredName]);for(let n=0;n<s.arity;++n){let c=Ou(e,_l());Ia(e,a,ei.EndOfInput,En.ErrorNode,\"setOptionArityError\"),Ia(e,a,ei.EndOfPartialInput,En.ErrorNode,\"setOptionArityError\"),Hs(e,a,\"isOptionLike\",En.ErrorNode,\"setOptionArityError\");let f=s.arity===1?\"setStringValue\":\"pushStringValue\";Hs(e,a,\"isNotOptionLike\",c,f),a=c}BE(e,a,r)}}},Lx=class t{constructor({binaryName:e=\"...\"}={}){this.builders=[],this.opts={binaryName:e}}static build(e,r={}){return new t(r).commands(e).compile()}getBuilderByIndex(e){if(!(e>=0&&e<this.builders.length))throw new Error(`Assertion failed: Out-of-bound command index (${e})`);return this.builders[e]}commands(e){for(let r of e)r(this.command());return this}command(){let e=new I_(this.builders.length,this.opts);return this.builders.push(e),e}compile(){let e=[],r=[];for(let a of this.builders){let{machine:n,context:c}=a.compile();e.push(n),r.push(c)}let s=fYe(e);return AYe(s),{machine:s,contexts:r,process:(a,{partial:n}={})=>{let c=n?ei.EndOfPartialInput:ei.EndOfInput;return gYe(s,a,{endToken:c})}}}}});function Mre(){return Ux.default&&\"getColorDepth\"in Ux.default.WriteStream.prototype?Ux.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR===\"0\"?1:process.env.FORCE_COLOR===\"1\"||typeof process.stdout<\"u\"&&process.stdout.isTTY?8:1}function Ure(t){let e=Lre;if(typeof e>\"u\"){if(t.stdout===process.stdout&&t.stderr===process.stderr)return null;let{AsyncLocalStorage:r}=Ie(\"async_hooks\");e=Lre=new r;let s=process.stdout._write;process.stdout._write=function(n,c,f){let p=e.getStore();return typeof p>\"u\"?s.call(this,n,c,f):p.stdout.write(n,c,f)};let a=process.stderr._write;process.stderr._write=function(n,c,f){let p=e.getStore();return typeof p>\"u\"?a.call(this,n,c,f):p.stderr.write(n,c,f)}}return r=>e.run(t,r)}var Ux,Lre,_re=Ze(()=>{Ux=ut(Ie(\"tty\"),1)});var _x,Hre=Ze(()=>{a0();_x=class t extends ot{constructor(e){super(),this.contexts=e,this.commands=[]}static from(e,r){let s=new t(r);s.path=e.path;for(let a of e.options)switch(a.name){case\"-c\":s.commands.push(Number(a.value));break;case\"-i\":s.index=Number(a.value);break}return s}async execute(){let e=this.commands;if(typeof this.index<\"u\"&&this.index>=0&&this.index<e.length&&(e=[e[this.index]]),e.length===0)this.context.stdout.write(this.cli.usage());else if(e.length===1)this.context.stdout.write(this.cli.usage(this.contexts[e[0]].commandClass,{detailed:!0}));else if(e.length>1){this.context.stdout.write(`Multiple commands match your selection:\n`),this.context.stdout.write(`\n`);let r=0;for(let s of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[s].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`\n`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.\n`)}}}});async function qre(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=Yre(t);return Ca.from(r,e).runExit(s,a)}async function Wre(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=Yre(t);return Ca.from(r,e).run(s,a)}function Yre(t){let e,r,s,a;switch(typeof process<\"u\"&&typeof process.argv<\"u\"&&(s=process.argv.slice(2)),t.length){case 1:r=t[0];break;case 2:t[0]&&t[0].prototype instanceof ot||Array.isArray(t[0])?(r=t[0],Array.isArray(t[1])?s=t[1]:a=t[1]):(e=t[0],r=t[1]);break;case 3:Array.isArray(t[2])?(e=t[0],r=t[1],s=t[2]):t[0]&&t[0].prototype instanceof ot||Array.isArray(t[0])?(r=t[0],s=t[1],a=t[2]):(e=t[0],r=t[1],a=t[2]);break;default:e=t[0],r=t[1],s=t[2],a=t[3];break}if(typeof s>\"u\")throw new Error(\"The argv parameter must be provided when running Clipanion outside of a Node context\");return{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}}function Gre(t){return t()}var jre,Ca,Vre=Ze(()=>{bx();Mx();u_();_re();a0();Hre();jre=Symbol(\"clipanion/errorCommand\");Ca=class t{constructor({binaryLabel:e,binaryName:r=\"...\",binaryVersion:s,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new Lx({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=s,this.enableCapture=a,this.enableColors=n}static from(e,r={}){let s=new t(r),a=Array.isArray(e)?e:[e];for(let n of a)s.register(n);return s}register(e){var r;let s=new Map,a=new e;for(let p in a){let h=a[p];typeof h==\"object\"&&h!==null&&h[ot.isOption]&&s.set(p,h)}let n=this.builder.command(),c=n.cliIndex,f=(r=e.paths)!==null&&r!==void 0?r:a.paths;if(typeof f<\"u\")for(let p of f)n.addPath(p);this.registrations.set(e,{specs:s,builder:n,index:c});for(let[p,{definition:h}]of s.entries())h(n,p);n.setContext({commandClass:e})}process(e,r){let{input:s,context:a,partial:n}=typeof e==\"object\"&&Array.isArray(e)?{input:e,context:r}:e,{contexts:c,process:f}=this.builder.compile(),p=f(s,{partial:n}),h={...t.defaultContext,...a};switch(p.selectedIndex){case Nd:{let E=_x.from(p,c);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=c[p.selectedIndex],C=this.registrations.get(E);if(typeof C>\"u\")throw new Error(\"Assertion failed: Expected the command class to have been registered.\");let S=new E;S.context=h,S.tokens=p.tokens,S.path=p.path;try{for(let[b,{transformer:I}]of C.specs.entries())S[b]=I(C.builder,b,p,h);return S}catch(b){throw b[jre]=S,b}}break}}async run(e,r){var s,a;let n,c={...t.defaultContext,...r},f=(s=this.enableColors)!==null&&s!==void 0?s:c.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e,c)}catch(E){return c.stdout.write(this.error(E,{colored:f})),1}if(n.help)return c.stdout.write(this.usage(n,{colored:f,detailed:!0})),0;n.context=c,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,C)=>this.error(E,C),format:E=>this.format(E),process:(E,C)=>this.process(E,{...c,...C}),run:(E,C)=>this.run(E,{...c,...C}),usage:(E,C)=>this.usage(E,C)};let p=this.enableCapture&&(a=Ure(c))!==null&&a!==void 0?a:Gre,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return c.stdout.write(this.error(E,{colored:f,command:n})),1}return h}async runExit(e,r){process.exitCode=await this.run(e,r)}definition(e,{colored:r=!1}={}){if(!e.usage)return null;let{usage:s}=this.getUsageByRegistration(e,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(e,{detailed:!0,inlineOptions:!1}),c=typeof e.usage.category<\"u\"?Ho(e.usage.category,{format:this.format(r),paragraphs:!1}):void 0,f=typeof e.usage.description<\"u\"?Ho(e.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof e.usage.details<\"u\"?Ho(e.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof e.usage.examples<\"u\"?e.usage.examples.map(([E,C])=>[Ho(E,{format:this.format(r),paragraphs:!1}),C.replace(/\\$0/g,this.binaryName)]):void 0;return{path:s,usage:a,category:c,description:f,details:p,examples:h,options:n}}definitions({colored:e=!1}={}){let r=[];for(let s of this.registrations.keys()){let a=this.definition(s,{colored:e});a&&r.push(a)}return r}usage(e=null,{colored:r,detailed:s=!1,prefix:a=\"$ \"}={}){var n;if(e===null){for(let p of this.registrations.keys()){let h=p.paths,E=typeof p.usage<\"u\";if(!h||h.length===0||h.length===1&&h[0].length===0||((n=h?.some(b=>b.length===0))!==null&&n!==void 0?n:!1))if(e){e=null;break}else e=p;else if(E){e=null;continue}}e&&(s=!0)}let c=e!==null&&e instanceof ot?e.constructor:e,f=\"\";if(c)if(s){let{description:p=\"\",details:h=\"\",examples:E=[]}=c.usage||{};p!==\"\"&&(f+=Ho(p,{format:this.format(r),paragraphs:!1}).replace(/^./,b=>b.toUpperCase()),f+=`\n`),(h!==\"\"||E.length>0)&&(f+=`${this.format(r).header(\"Usage\")}\n`,f+=`\n`);let{usage:C,options:S}=this.getUsageByRegistration(c,{inlineOptions:!1});if(f+=`${this.format(r).bold(a)}${C}\n`,S.length>0){f+=`\n`,f+=`${this.format(r).header(\"Options\")}\n`;let b=S.reduce((I,T)=>Math.max(I,T.definition.length),0);f+=`\n`;for(let{definition:I,description:T}of S)f+=`  ${this.format(r).bold(I.padEnd(b))}    ${Ho(T,{format:this.format(r),paragraphs:!1})}`}if(h!==\"\"&&(f+=`\n`,f+=`${this.format(r).header(\"Details\")}\n`,f+=`\n`,f+=Ho(h,{format:this.format(r),paragraphs:!0})),E.length>0){f+=`\n`,f+=`${this.format(r).header(\"Examples\")}\n`;for(let[b,I]of E)f+=`\n`,f+=Ho(b,{format:this.format(r),paragraphs:!1}),f+=`${I.replace(/^/m,`  ${this.format(r).bold(a)}`).replace(/\\$0/g,this.binaryName)}\n`}}else{let{usage:p}=this.getUsageByRegistration(c);f+=`${this.format(r).bold(a)}${p}\n`}else{let p=new Map;for(let[S,{index:b}]of this.registrations.entries()){if(typeof S.usage>\"u\")continue;let I=typeof S.usage.category<\"u\"?Ho(S.usage.category,{format:this.format(r),paragraphs:!1}):null,T=p.get(I);typeof T>\"u\"&&p.set(I,T=[]);let{usage:N}=this.getUsageByIndex(b);T.push({commandClass:S,usage:N})}let h=Array.from(p.keys()).sort((S,b)=>S===null?-1:b===null?1:S.localeCompare(b,\"en\",{usage:\"sort\",caseFirst:\"upper\"})),E=typeof this.binaryLabel<\"u\",C=typeof this.binaryVersion<\"u\";E||C?(E&&C?f+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}\n\n`:E?f+=`${this.format(r).header(`${this.binaryLabel}`)}\n`:f+=`${this.format(r).header(`${this.binaryVersion}`)}\n`,f+=`  ${this.format(r).bold(a)}${this.binaryName} <command>\n`):f+=`${this.format(r).bold(a)}${this.binaryName} <command>\n`;for(let S of h){let b=p.get(S).slice().sort((T,N)=>T.usage.localeCompare(N.usage,\"en\",{usage:\"sort\",caseFirst:\"upper\"})),I=S!==null?S.trim():\"General commands\";f+=`\n`,f+=`${this.format(r).header(`${I}`)}\n`;for(let{commandClass:T,usage:N}of b){let U=T.usage.description||\"undocumented\";f+=`\n`,f+=`  ${this.format(r).bold(N)}\n`,f+=`    ${Ho(U,{format:this.format(r),paragraphs:!1})}`}}f+=`\n`,f+=Ho(\"You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.\",{format:this.format(r),paragraphs:!0})}return f}error(e,r){var s,{colored:a,command:n=(s=e[jre])!==null&&s!==void 0?s:null}=r===void 0?{}:r;(!e||typeof e!=\"object\"||!(\"stack\"in e))&&(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let c=\"\",f=e.name.replace(/([a-z])([A-Z])/g,\"$1 $2\");f===\"Error\"&&(f=\"Internal Error\"),c+=`${this.format(a).error(f)}: ${e.message}\n`;let p=e.clipanion;return typeof p<\"u\"?p.type===\"usage\"&&(c+=`\n`,c+=this.usage(n)):e.stack&&(c+=`${e.stack.replace(/^.*\\n/,\"\")}\n`),c}format(e){var r;return((r=e??this.enableColors)!==null&&r!==void 0?r:t.defaultContext.colorDepth>1)?Dre:Pre}getUsageByRegistration(e,r){let s=this.registrations.get(e);if(typeof s>\"u\")throw new Error(\"Assertion failed: Unregistered command\");return this.getUsageByIndex(s.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};Ca.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:Mre()}});var rB,Jre=Ze(()=>{a0();rB=class extends ot{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}\n`)}};rB.paths=[[\"--clipanion=definitions\"]]});var nB,Kre=Ze(()=>{a0();nB=class extends ot{async execute(){this.context.stdout.write(this.cli.usage())}};nB.paths=[[\"-h\"],[\"--help\"]]});function Hx(t={}){return ya({definition(e,r){var s;e.addProxy({name:(s=t.name)!==null&&s!==void 0?s:r,required:t.required})},transformer(e,r,s){return s.positionals.map(({value:a})=>a)}})}var C_=Ze(()=>{Cp()});var iB,zre=Ze(()=>{a0();C_();iB=class extends ot{constructor(){super(...arguments),this.args=Hx()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}\n`)}};iB.paths=[[\"--clipanion=tokens\"]]});var sB,Zre=Ze(()=>{a0();sB=class extends ot{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:\"<unknown>\"}\n`)}};sB.paths=[[\"-v\"],[\"--version\"]]});var w_={};Vt(w_,{DefinitionsCommand:()=>rB,HelpCommand:()=>nB,TokensCommand:()=>iB,VersionCommand:()=>sB});var Xre=Ze(()=>{Jre();Kre();zre();Zre()});function $re(t,e,r){let[s,a]=Gf(e,r??{}),{arity:n=1}=a,c=t.split(\",\"),f=new Set(c);return ya({definition(p){p.addOption({names:c,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let C,S=typeof s<\"u\"?[...s]:void 0;for(let{name:b,value:I}of E.options)f.has(b)&&(C=b,S=S??[],S.push(I));return typeof S<\"u\"?Od(C??h,S,a.validator):S}})}var ene=Ze(()=>{Cp()});function tne(t,e,r){let[s,a]=Gf(e,r??{}),n=t.split(\",\"),c=new Set(n);return ya({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E=S);return E}})}var rne=Ze(()=>{Cp()});function nne(t,e,r){let[s,a]=Gf(e,r??{}),n=t.split(\",\"),c=new Set(n);return ya({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E??(E=0),S?E+=1:E=0);return E}})}var ine=Ze(()=>{Cp()});function sne(t={}){return ya({definition(e,r){var s;e.addRest({name:(s=t.name)!==null&&s!==void 0?s:r,required:t.required})},transformer(e,r,s){let a=c=>{let f=s.positionals[c];return f.extra===Hl||f.extra===!1&&c<e.arity.leading.length},n=0;for(;n<s.positionals.length&&a(n);)n+=1;return s.positionals.splice(0,n).map(({value:c})=>c)}})}var one=Ze(()=>{Mx();Cp()});function CYe(t,e,r){let[s,a]=Gf(e,r??{}),{arity:n=1}=a,c=t.split(\",\"),f=new Set(c);return ya({definition(p){p.addOption({names:c,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,C){let S,b=s;typeof a.env<\"u\"&&C.env[a.env]&&(S=a.env,b=C.env[a.env]);for(let{name:I,value:T}of E.options)f.has(I)&&(S=I,b=T);return typeof b==\"string\"?Od(S??h,b,a.validator):b}})}function wYe(t={}){let{required:e=!0}=t;return ya({definition(r,s){var a;r.addPositional({name:(a=t.name)!==null&&a!==void 0?a:s,required:t.required})},transformer(r,s,a){var n;for(let c=0;c<a.positionals.length;++c){if(a.positionals[c].extra===Hl||e&&a.positionals[c].extra===!0||!e&&a.positionals[c].extra===!1)continue;let[f]=a.positionals.splice(c,1);return Od((n=t.name)!==null&&n!==void 0?n:s,f.value,t.validator)}}})}function ane(t,...e){return typeof t==\"string\"?CYe(t,...e):wYe(t)}var lne=Ze(()=>{Mx();Cp()});var ge={};Vt(ge,{Array:()=>$re,Boolean:()=>tne,Counter:()=>nne,Proxy:()=>Hx,Rest:()=>sne,String:()=>ane,applyValidator:()=>Od,cleanValidationError:()=>Qx,formatError:()=>z2,isOptionSymbol:()=>K2,makeCommandOption:()=>ya,rerouteArguments:()=>Gf});var cne=Ze(()=>{Cp();C_();ene();rne();ine();one();lne()});var oB={};Vt(oB,{Builtins:()=>w_,Cli:()=>Ca,Command:()=>ot,Option:()=>ge,UsageError:()=>nt,formatMarkdownish:()=>Ho,run:()=>Wre,runExit:()=>qre});var Yt=Ze(()=>{kx();u_();a0();Vre();Xre();cne()});var une=_((MRt,BYe)=>{BYe.exports={name:\"dotenv\",version:\"16.3.1\",description:\"Loads environment variables from .env file\",main:\"lib/main.js\",types:\"lib/main.d.ts\",exports:{\".\":{types:\"./lib/main.d.ts\",require:\"./lib/main.js\",default:\"./lib/main.js\"},\"./config\":\"./config.js\",\"./config.js\":\"./config.js\",\"./lib/env-options\":\"./lib/env-options.js\",\"./lib/env-options.js\":\"./lib/env-options.js\",\"./lib/cli-options\":\"./lib/cli-options.js\",\"./lib/cli-options.js\":\"./lib/cli-options.js\",\"./package.json\":\"./package.json\"},scripts:{\"dts-check\":\"tsc --project tests/types/tsconfig.json\",lint:\"standard\",\"lint-readme\":\"standard-markdown\",pretest:\"npm run lint && npm run dts-check\",test:\"tap tests/*.js --100 -Rspec\",prerelease:\"npm test\",release:\"standard-version\"},repository:{type:\"git\",url:\"git://github.com/motdotla/dotenv.git\"},funding:\"https://github.com/motdotla/dotenv?sponsor=1\",keywords:[\"dotenv\",\"env\",\".env\",\"environment\",\"variables\",\"config\",\"settings\"],readmeFilename:\"README.md\",license:\"BSD-2-Clause\",devDependencies:{\"@definitelytyped/dtslint\":\"^0.0.133\",\"@types/node\":\"^18.11.3\",decache:\"^4.6.1\",sinon:\"^14.0.1\",standard:\"^17.0.0\",\"standard-markdown\":\"^7.1.0\",\"standard-version\":\"^9.5.0\",tap:\"^16.3.0\",tar:\"^6.1.11\",typescript:\"^4.8.4\"},engines:{node:\">=12\"},browser:{fs:!1}}});var hne=_((URt,wp)=>{var fne=Ie(\"fs\"),v_=Ie(\"path\"),vYe=Ie(\"os\"),SYe=Ie(\"crypto\"),DYe=une(),S_=DYe.version,PYe=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg;function bYe(t){let e={},r=t.toString();r=r.replace(/\\r\\n?/mg,`\n`);let s;for(;(s=PYe.exec(r))!=null;){let a=s[1],n=s[2]||\"\";n=n.trim();let c=n[0];n=n.replace(/^(['\"`])([\\s\\S]*)\\1$/mg,\"$2\"),c==='\"'&&(n=n.replace(/\\\\n/g,`\n`),n=n.replace(/\\\\r/g,\"\\r\")),e[a]=n}return e}function xYe(t){let e=pne(t),r=js.configDotenv({path:e});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);let s=Ane(t).split(\",\"),a=s.length,n;for(let c=0;c<a;c++)try{let f=s[c].trim(),p=RYe(r,f);n=js.decrypt(p.ciphertext,p.key);break}catch(f){if(c+1>=a)throw f}return js.parse(n)}function kYe(t){console.log(`[dotenv@${S_}][INFO] ${t}`)}function QYe(t){console.log(`[dotenv@${S_}][WARN] ${t}`)}function B_(t){console.log(`[dotenv@${S_}][DEBUG] ${t}`)}function Ane(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:\"\"}function RYe(t,e){let r;try{r=new URL(e)}catch(f){throw f.code===\"ERR_INVALID_URL\"?new Error(\"INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development\"):f}let s=r.password;if(!s)throw new Error(\"INVALID_DOTENV_KEY: Missing key part\");let a=r.searchParams.get(\"environment\");if(!a)throw new Error(\"INVALID_DOTENV_KEY: Missing environment part\");let n=`DOTENV_VAULT_${a.toUpperCase()}`,c=t.parsed[n];if(!c)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:c,key:s}}function pne(t){let e=v_.resolve(process.cwd(),\".env\");return t&&t.path&&t.path.length>0&&(e=t.path),e.endsWith(\".vault\")?e:`${e}.vault`}function TYe(t){return t[0]===\"~\"?v_.join(vYe.homedir(),t.slice(1)):t}function FYe(t){kYe(\"Loading env from encrypted .env.vault\");let e=js._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),js.populate(r,e,t),{parsed:e}}function NYe(t){let e=v_.resolve(process.cwd(),\".env\"),r=\"utf8\",s=!!(t&&t.debug);t&&(t.path!=null&&(e=TYe(t.path)),t.encoding!=null&&(r=t.encoding));try{let a=js.parse(fne.readFileSync(e,{encoding:r})),n=process.env;return t&&t.processEnv!=null&&(n=t.processEnv),js.populate(n,a,t),{parsed:a}}catch(a){return s&&B_(`Failed to load ${e} ${a.message}`),{error:a}}}function OYe(t){let e=pne(t);return Ane(t).length===0?js.configDotenv(t):fne.existsSync(e)?js._configVault(t):(QYe(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),js.configDotenv(t))}function LYe(t,e){let r=Buffer.from(e.slice(-64),\"hex\"),s=Buffer.from(t,\"base64\"),a=s.slice(0,12),n=s.slice(-16);s=s.slice(12,-16);try{let c=SYe.createDecipheriv(\"aes-256-gcm\",r,a);return c.setAuthTag(n),`${c.update(s)}${c.final()}`}catch(c){let f=c instanceof RangeError,p=c.message===\"Invalid key length\",h=c.message===\"Unsupported state or unable to authenticate data\";if(f||p){let E=\"INVALID_DOTENV_KEY: It must be 64 characters long (or more)\";throw new Error(E)}else if(h){let E=\"DECRYPTION_FAILED: Please check your DOTENV_KEY\";throw new Error(E)}else throw console.error(\"Error: \",c.code),console.error(\"Error: \",c.message),c}}function MYe(t,e,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof e!=\"object\")throw new Error(\"OBJECT_REQUIRED: Please check the processEnv argument being passed to populate\");for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(a===!0&&(t[n]=e[n]),s&&B_(a===!0?`\"${n}\" is already defined and WAS overwritten`:`\"${n}\" is already defined and was NOT overwritten`)):t[n]=e[n]}var js={configDotenv:NYe,_configVault:FYe,_parseVault:xYe,config:OYe,decrypt:LYe,parse:bYe,populate:MYe};wp.exports.configDotenv=js.configDotenv;wp.exports._configVault=js._configVault;wp.exports._parseVault=js._parseVault;wp.exports.config=js.config;wp.exports.decrypt=js.decrypt;wp.exports.parse=js.parse;wp.exports.populate=js.populate;wp.exports=js});var dne=_((_Rt,gne)=>{\"use strict\";gne.exports=(t,...e)=>new Promise(r=>{r(t(...e))})});var Ld=_((HRt,D_)=>{\"use strict\";var UYe=dne(),mne=t=>{if(t<1)throw new TypeError(\"Expected `concurrency` to be a number from 1 and up\");let e=[],r=0,s=()=>{r--,e.length>0&&e.shift()()},a=(f,p,...h)=>{r++;let E=UYe(f,...h);p(E),E.then(s,s)},n=(f,p,...h)=>{r<t?a(f,p,...h):e.push(a.bind(null,f,p,...h))},c=(f,...p)=>new Promise(h=>n(f,h,...p));return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length}}),c};D_.exports=mne;D_.exports.default=mne});function Yf(t){return`YN${t.toString(10).padStart(4,\"0\")}`}function jx(t){let e=Number(t.slice(2));if(typeof Br[e]>\"u\")throw new Error(`Unknown message name: \"${t}\"`);return e}var Br,Gx=Ze(()=>{Br=(Me=>(Me[Me.UNNAMED=0]=\"UNNAMED\",Me[Me.EXCEPTION=1]=\"EXCEPTION\",Me[Me.MISSING_PEER_DEPENDENCY=2]=\"MISSING_PEER_DEPENDENCY\",Me[Me.CYCLIC_DEPENDENCIES=3]=\"CYCLIC_DEPENDENCIES\",Me[Me.DISABLED_BUILD_SCRIPTS=4]=\"DISABLED_BUILD_SCRIPTS\",Me[Me.BUILD_DISABLED=5]=\"BUILD_DISABLED\",Me[Me.SOFT_LINK_BUILD=6]=\"SOFT_LINK_BUILD\",Me[Me.MUST_BUILD=7]=\"MUST_BUILD\",Me[Me.MUST_REBUILD=8]=\"MUST_REBUILD\",Me[Me.BUILD_FAILED=9]=\"BUILD_FAILED\",Me[Me.RESOLVER_NOT_FOUND=10]=\"RESOLVER_NOT_FOUND\",Me[Me.FETCHER_NOT_FOUND=11]=\"FETCHER_NOT_FOUND\",Me[Me.LINKER_NOT_FOUND=12]=\"LINKER_NOT_FOUND\",Me[Me.FETCH_NOT_CACHED=13]=\"FETCH_NOT_CACHED\",Me[Me.YARN_IMPORT_FAILED=14]=\"YARN_IMPORT_FAILED\",Me[Me.REMOTE_INVALID=15]=\"REMOTE_INVALID\",Me[Me.REMOTE_NOT_FOUND=16]=\"REMOTE_NOT_FOUND\",Me[Me.RESOLUTION_PACK=17]=\"RESOLUTION_PACK\",Me[Me.CACHE_CHECKSUM_MISMATCH=18]=\"CACHE_CHECKSUM_MISMATCH\",Me[Me.UNUSED_CACHE_ENTRY=19]=\"UNUSED_CACHE_ENTRY\",Me[Me.MISSING_LOCKFILE_ENTRY=20]=\"MISSING_LOCKFILE_ENTRY\",Me[Me.WORKSPACE_NOT_FOUND=21]=\"WORKSPACE_NOT_FOUND\",Me[Me.TOO_MANY_MATCHING_WORKSPACES=22]=\"TOO_MANY_MATCHING_WORKSPACES\",Me[Me.CONSTRAINTS_MISSING_DEPENDENCY=23]=\"CONSTRAINTS_MISSING_DEPENDENCY\",Me[Me.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]=\"CONSTRAINTS_INCOMPATIBLE_DEPENDENCY\",Me[Me.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]=\"CONSTRAINTS_EXTRANEOUS_DEPENDENCY\",Me[Me.CONSTRAINTS_INVALID_DEPENDENCY=26]=\"CONSTRAINTS_INVALID_DEPENDENCY\",Me[Me.CANT_SUGGEST_RESOLUTIONS=27]=\"CANT_SUGGEST_RESOLUTIONS\",Me[Me.FROZEN_LOCKFILE_EXCEPTION=28]=\"FROZEN_LOCKFILE_EXCEPTION\",Me[Me.CROSS_DRIVE_VIRTUAL_LOCAL=29]=\"CROSS_DRIVE_VIRTUAL_LOCAL\",Me[Me.FETCH_FAILED=30]=\"FETCH_FAILED\",Me[Me.DANGEROUS_NODE_MODULES=31]=\"DANGEROUS_NODE_MODULES\",Me[Me.NODE_GYP_INJECTED=32]=\"NODE_GYP_INJECTED\",Me[Me.AUTHENTICATION_NOT_FOUND=33]=\"AUTHENTICATION_NOT_FOUND\",Me[Me.INVALID_CONFIGURATION_KEY=34]=\"INVALID_CONFIGURATION_KEY\",Me[Me.NETWORK_ERROR=35]=\"NETWORK_ERROR\",Me[Me.LIFECYCLE_SCRIPT=36]=\"LIFECYCLE_SCRIPT\",Me[Me.CONSTRAINTS_MISSING_FIELD=37]=\"CONSTRAINTS_MISSING_FIELD\",Me[Me.CONSTRAINTS_INCOMPATIBLE_FIELD=38]=\"CONSTRAINTS_INCOMPATIBLE_FIELD\",Me[Me.CONSTRAINTS_EXTRANEOUS_FIELD=39]=\"CONSTRAINTS_EXTRANEOUS_FIELD\",Me[Me.CONSTRAINTS_INVALID_FIELD=40]=\"CONSTRAINTS_INVALID_FIELD\",Me[Me.AUTHENTICATION_INVALID=41]=\"AUTHENTICATION_INVALID\",Me[Me.PROLOG_UNKNOWN_ERROR=42]=\"PROLOG_UNKNOWN_ERROR\",Me[Me.PROLOG_SYNTAX_ERROR=43]=\"PROLOG_SYNTAX_ERROR\",Me[Me.PROLOG_EXISTENCE_ERROR=44]=\"PROLOG_EXISTENCE_ERROR\",Me[Me.STACK_OVERFLOW_RESOLUTION=45]=\"STACK_OVERFLOW_RESOLUTION\",Me[Me.AUTOMERGE_FAILED_TO_PARSE=46]=\"AUTOMERGE_FAILED_TO_PARSE\",Me[Me.AUTOMERGE_IMMUTABLE=47]=\"AUTOMERGE_IMMUTABLE\",Me[Me.AUTOMERGE_SUCCESS=48]=\"AUTOMERGE_SUCCESS\",Me[Me.AUTOMERGE_REQUIRED=49]=\"AUTOMERGE_REQUIRED\",Me[Me.DEPRECATED_CLI_SETTINGS=50]=\"DEPRECATED_CLI_SETTINGS\",Me[Me.PLUGIN_NAME_NOT_FOUND=51]=\"PLUGIN_NAME_NOT_FOUND\",Me[Me.INVALID_PLUGIN_REFERENCE=52]=\"INVALID_PLUGIN_REFERENCE\",Me[Me.CONSTRAINTS_AMBIGUITY=53]=\"CONSTRAINTS_AMBIGUITY\",Me[Me.CACHE_OUTSIDE_PROJECT=54]=\"CACHE_OUTSIDE_PROJECT\",Me[Me.IMMUTABLE_INSTALL=55]=\"IMMUTABLE_INSTALL\",Me[Me.IMMUTABLE_CACHE=56]=\"IMMUTABLE_CACHE\",Me[Me.INVALID_MANIFEST=57]=\"INVALID_MANIFEST\",Me[Me.PACKAGE_PREPARATION_FAILED=58]=\"PACKAGE_PREPARATION_FAILED\",Me[Me.INVALID_RANGE_PEER_DEPENDENCY=59]=\"INVALID_RANGE_PEER_DEPENDENCY\",Me[Me.INCOMPATIBLE_PEER_DEPENDENCY=60]=\"INCOMPATIBLE_PEER_DEPENDENCY\",Me[Me.DEPRECATED_PACKAGE=61]=\"DEPRECATED_PACKAGE\",Me[Me.INCOMPATIBLE_OS=62]=\"INCOMPATIBLE_OS\",Me[Me.INCOMPATIBLE_CPU=63]=\"INCOMPATIBLE_CPU\",Me[Me.FROZEN_ARTIFACT_EXCEPTION=64]=\"FROZEN_ARTIFACT_EXCEPTION\",Me[Me.TELEMETRY_NOTICE=65]=\"TELEMETRY_NOTICE\",Me[Me.PATCH_HUNK_FAILED=66]=\"PATCH_HUNK_FAILED\",Me[Me.INVALID_CONFIGURATION_VALUE=67]=\"INVALID_CONFIGURATION_VALUE\",Me[Me.UNUSED_PACKAGE_EXTENSION=68]=\"UNUSED_PACKAGE_EXTENSION\",Me[Me.REDUNDANT_PACKAGE_EXTENSION=69]=\"REDUNDANT_PACKAGE_EXTENSION\",Me[Me.AUTO_NM_SUCCESS=70]=\"AUTO_NM_SUCCESS\",Me[Me.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK=71]=\"NM_CANT_INSTALL_EXTERNAL_SOFT_LINK\",Me[Me.NM_PRESERVE_SYMLINKS_REQUIRED=72]=\"NM_PRESERVE_SYMLINKS_REQUIRED\",Me[Me.UPDATE_LOCKFILE_ONLY_SKIP_LINK=73]=\"UPDATE_LOCKFILE_ONLY_SKIP_LINK\",Me[Me.NM_HARDLINKS_MODE_DOWNGRADED=74]=\"NM_HARDLINKS_MODE_DOWNGRADED\",Me[Me.PROLOG_INSTANTIATION_ERROR=75]=\"PROLOG_INSTANTIATION_ERROR\",Me[Me.INCOMPATIBLE_ARCHITECTURE=76]=\"INCOMPATIBLE_ARCHITECTURE\",Me[Me.GHOST_ARCHITECTURE=77]=\"GHOST_ARCHITECTURE\",Me[Me.RESOLUTION_MISMATCH=78]=\"RESOLUTION_MISMATCH\",Me[Me.PROLOG_LIMIT_EXCEEDED=79]=\"PROLOG_LIMIT_EXCEEDED\",Me[Me.NETWORK_DISABLED=80]=\"NETWORK_DISABLED\",Me[Me.NETWORK_UNSAFE_HTTP=81]=\"NETWORK_UNSAFE_HTTP\",Me[Me.RESOLUTION_FAILED=82]=\"RESOLUTION_FAILED\",Me[Me.AUTOMERGE_GIT_ERROR=83]=\"AUTOMERGE_GIT_ERROR\",Me[Me.CONSTRAINTS_CHECK_FAILED=84]=\"CONSTRAINTS_CHECK_FAILED\",Me[Me.UPDATED_RESOLUTION_RECORD=85]=\"UPDATED_RESOLUTION_RECORD\",Me[Me.EXPLAIN_PEER_DEPENDENCIES_CTA=86]=\"EXPLAIN_PEER_DEPENDENCIES_CTA\",Me[Me.MIGRATION_SUCCESS=87]=\"MIGRATION_SUCCESS\",Me[Me.VERSION_NOTICE=88]=\"VERSION_NOTICE\",Me[Me.TIPS_NOTICE=89]=\"TIPS_NOTICE\",Me[Me.OFFLINE_MODE_ENABLED=90]=\"OFFLINE_MODE_ENABLED\",Me[Me.INVALID_PROVENANCE_ENVIRONMENT=91]=\"INVALID_PROVENANCE_ENVIRONMENT\",Me))(Br||{})});var aB=_((GRt,yne)=>{var _Ye=\"2.0.0\",HYe=Number.MAX_SAFE_INTEGER||9007199254740991,jYe=16,GYe=250,qYe=[\"major\",\"premajor\",\"minor\",\"preminor\",\"patch\",\"prepatch\",\"prerelease\"];yne.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:jYe,MAX_SAFE_BUILD_LENGTH:GYe,MAX_SAFE_INTEGER:HYe,RELEASE_TYPES:qYe,SEMVER_SPEC_VERSION:_Ye,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var lB=_((qRt,Ene)=>{var WYe=typeof process==\"object\"&&process.env&&process.env.NODE_DEBUG&&/\\bsemver\\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error(\"SEMVER\",...t):()=>{};Ene.exports=WYe});var vE=_((Bp,Ine)=>{var{MAX_SAFE_COMPONENT_LENGTH:P_,MAX_SAFE_BUILD_LENGTH:YYe,MAX_LENGTH:VYe}=aB(),JYe=lB();Bp=Ine.exports={};var KYe=Bp.re=[],zYe=Bp.safeRe=[],rr=Bp.src=[],nr=Bp.t={},ZYe=0,b_=\"[a-zA-Z0-9-]\",XYe=[[\"\\\\s\",1],[\"\\\\d\",VYe],[b_,YYe]],$Ye=t=>{for(let[e,r]of XYe)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Jr=(t,e,r)=>{let s=$Ye(e),a=ZYe++;JYe(t,a,e),nr[t]=a,rr[a]=e,KYe[a]=new RegExp(e,r?\"g\":void 0),zYe[a]=new RegExp(s,r?\"g\":void 0)};Jr(\"NUMERICIDENTIFIER\",\"0|[1-9]\\\\d*\");Jr(\"NUMERICIDENTIFIERLOOSE\",\"\\\\d+\");Jr(\"NONNUMERICIDENTIFIER\",`\\\\d*[a-zA-Z-]${b_}*`);Jr(\"MAINVERSION\",`(${rr[nr.NUMERICIDENTIFIER]})\\\\.(${rr[nr.NUMERICIDENTIFIER]})\\\\.(${rr[nr.NUMERICIDENTIFIER]})`);Jr(\"MAINVERSIONLOOSE\",`(${rr[nr.NUMERICIDENTIFIERLOOSE]})\\\\.(${rr[nr.NUMERICIDENTIFIERLOOSE]})\\\\.(${rr[nr.NUMERICIDENTIFIERLOOSE]})`);Jr(\"PRERELEASEIDENTIFIER\",`(?:${rr[nr.NUMERICIDENTIFIER]}|${rr[nr.NONNUMERICIDENTIFIER]})`);Jr(\"PRERELEASEIDENTIFIERLOOSE\",`(?:${rr[nr.NUMERICIDENTIFIERLOOSE]}|${rr[nr.NONNUMERICIDENTIFIER]})`);Jr(\"PRERELEASE\",`(?:-(${rr[nr.PRERELEASEIDENTIFIER]}(?:\\\\.${rr[nr.PRERELEASEIDENTIFIER]})*))`);Jr(\"PRERELEASELOOSE\",`(?:-?(${rr[nr.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${rr[nr.PRERELEASEIDENTIFIERLOOSE]})*))`);Jr(\"BUILDIDENTIFIER\",`${b_}+`);Jr(\"BUILD\",`(?:\\\\+(${rr[nr.BUILDIDENTIFIER]}(?:\\\\.${rr[nr.BUILDIDENTIFIER]})*))`);Jr(\"FULLPLAIN\",`v?${rr[nr.MAINVERSION]}${rr[nr.PRERELEASE]}?${rr[nr.BUILD]}?`);Jr(\"FULL\",`^${rr[nr.FULLPLAIN]}$`);Jr(\"LOOSEPLAIN\",`[v=\\\\s]*${rr[nr.MAINVERSIONLOOSE]}${rr[nr.PRERELEASELOOSE]}?${rr[nr.BUILD]}?`);Jr(\"LOOSE\",`^${rr[nr.LOOSEPLAIN]}$`);Jr(\"GTLT\",\"((?:<|>)?=?)\");Jr(\"XRANGEIDENTIFIERLOOSE\",`${rr[nr.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`);Jr(\"XRANGEIDENTIFIER\",`${rr[nr.NUMERICIDENTIFIER]}|x|X|\\\\*`);Jr(\"XRANGEPLAIN\",`[v=\\\\s]*(${rr[nr.XRANGEIDENTIFIER]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIER]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIER]})(?:${rr[nr.PRERELEASE]})?${rr[nr.BUILD]}?)?)?`);Jr(\"XRANGEPLAINLOOSE\",`[v=\\\\s]*(${rr[nr.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${rr[nr.XRANGEIDENTIFIERLOOSE]})(?:${rr[nr.PRERELEASELOOSE]})?${rr[nr.BUILD]}?)?)?`);Jr(\"XRANGE\",`^${rr[nr.GTLT]}\\\\s*${rr[nr.XRANGEPLAIN]}$`);Jr(\"XRANGELOOSE\",`^${rr[nr.GTLT]}\\\\s*${rr[nr.XRANGEPLAINLOOSE]}$`);Jr(\"COERCEPLAIN\",`(^|[^\\\\d])(\\\\d{1,${P_}})(?:\\\\.(\\\\d{1,${P_}}))?(?:\\\\.(\\\\d{1,${P_}}))?`);Jr(\"COERCE\",`${rr[nr.COERCEPLAIN]}(?:$|[^\\\\d])`);Jr(\"COERCEFULL\",rr[nr.COERCEPLAIN]+`(?:${rr[nr.PRERELEASE]})?(?:${rr[nr.BUILD]})?(?:$|[^\\\\d])`);Jr(\"COERCERTL\",rr[nr.COERCE],!0);Jr(\"COERCERTLFULL\",rr[nr.COERCEFULL],!0);Jr(\"LONETILDE\",\"(?:~>?)\");Jr(\"TILDETRIM\",`(\\\\s*)${rr[nr.LONETILDE]}\\\\s+`,!0);Bp.tildeTrimReplace=\"$1~\";Jr(\"TILDE\",`^${rr[nr.LONETILDE]}${rr[nr.XRANGEPLAIN]}$`);Jr(\"TILDELOOSE\",`^${rr[nr.LONETILDE]}${rr[nr.XRANGEPLAINLOOSE]}$`);Jr(\"LONECARET\",\"(?:\\\\^)\");Jr(\"CARETTRIM\",`(\\\\s*)${rr[nr.LONECARET]}\\\\s+`,!0);Bp.caretTrimReplace=\"$1^\";Jr(\"CARET\",`^${rr[nr.LONECARET]}${rr[nr.XRANGEPLAIN]}$`);Jr(\"CARETLOOSE\",`^${rr[nr.LONECARET]}${rr[nr.XRANGEPLAINLOOSE]}$`);Jr(\"COMPARATORLOOSE\",`^${rr[nr.GTLT]}\\\\s*(${rr[nr.LOOSEPLAIN]})$|^$`);Jr(\"COMPARATOR\",`^${rr[nr.GTLT]}\\\\s*(${rr[nr.FULLPLAIN]})$|^$`);Jr(\"COMPARATORTRIM\",`(\\\\s*)${rr[nr.GTLT]}\\\\s*(${rr[nr.LOOSEPLAIN]}|${rr[nr.XRANGEPLAIN]})`,!0);Bp.comparatorTrimReplace=\"$1$2$3\";Jr(\"HYPHENRANGE\",`^\\\\s*(${rr[nr.XRANGEPLAIN]})\\\\s+-\\\\s+(${rr[nr.XRANGEPLAIN]})\\\\s*$`);Jr(\"HYPHENRANGELOOSE\",`^\\\\s*(${rr[nr.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${rr[nr.XRANGEPLAINLOOSE]})\\\\s*$`);Jr(\"STAR\",\"(<|>)?=?\\\\s*\\\\*\");Jr(\"GTE0\",\"^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$\");Jr(\"GTE0PRE\",\"^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$\")});var qx=_((WRt,Cne)=>{var eVe=Object.freeze({loose:!0}),tVe=Object.freeze({}),rVe=t=>t?typeof t!=\"object\"?eVe:t:tVe;Cne.exports=rVe});var x_=_((YRt,vne)=>{var wne=/^[0-9]+$/,Bne=(t,e)=>{let r=wne.test(t),s=wne.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:t<e?-1:1},nVe=(t,e)=>Bne(e,t);vne.exports={compareIdentifiers:Bne,rcompareIdentifiers:nVe}});var jo=_((VRt,bne)=>{var Wx=lB(),{MAX_LENGTH:Sne,MAX_SAFE_INTEGER:Yx}=aB(),{safeRe:Dne,t:Pne}=vE(),iVe=qx(),{compareIdentifiers:SE}=x_(),k_=class t{constructor(e,r){if(r=iVe(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!=\"string\")throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof e}\".`);if(e.length>Sne)throw new TypeError(`version is longer than ${Sne} characters`);Wx(\"SemVer\",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?Dne[Pne.LOOSE]:Dne[Pne.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Yx||this.major<0)throw new TypeError(\"Invalid major version\");if(this.minor>Yx||this.minor<0)throw new TypeError(\"Invalid minor version\");if(this.patch>Yx||this.patch<0)throw new TypeError(\"Invalid patch version\");s[4]?this.prerelease=s[4].split(\".\").map(a=>{if(/^[0-9]+$/.test(a)){let n=+a;if(n>=0&&n<Yx)return n}return a}):this.prerelease=[],this.build=s[5]?s[5].split(\".\"):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(\".\")}`),this.version}toString(){return this.version}compare(e){if(Wx(\"SemVer.compare\",this.version,this.options,e),!(e instanceof t)){if(typeof e==\"string\"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),SE(this.major,e.major)||SE(this.minor,e.minor)||SE(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],a=e.prerelease[r];if(Wx(\"prerelease compare\",r,s,a),s===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(s===void 0)return-1;if(s===a)continue;return SE(s,a)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let s=this.build[r],a=e.build[r];if(Wx(\"prerelease compare\",r,s,a),s===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(s===void 0)return-1;if(s===a)continue;return SE(s,a)}while(++r)}inc(e,r,s){switch(e){case\"premajor\":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(\"pre\",r,s);break;case\"preminor\":this.prerelease.length=0,this.patch=0,this.minor++,this.inc(\"pre\",r,s);break;case\"prepatch\":this.prerelease.length=0,this.inc(\"patch\",r,s),this.inc(\"pre\",r,s);break;case\"prerelease\":this.prerelease.length===0&&this.inc(\"patch\",r,s),this.inc(\"pre\",r,s);break;case\"major\":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case\"minor\":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case\"patch\":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case\"pre\":{let a=Number(s)?1:0;if(!r&&s===!1)throw new Error(\"invalid increment argument: identifier is empty\");if(this.prerelease.length===0)this.prerelease=[a];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]==\"number\"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(\".\")&&s===!1)throw new Error(\"invalid increment argument: identifier already exists\");this.prerelease.push(a)}}if(r){let n=[r,a];s===!1&&(n=[r]),SE(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(\".\")}`),this}};bne.exports=k_});var Md=_((JRt,kne)=>{var xne=jo(),sVe=(t,e,r=!1)=>{if(t instanceof xne)return t;try{return new xne(t,e)}catch(s){if(!r)return null;throw s}};kne.exports=sVe});var Rne=_((KRt,Qne)=>{var oVe=Md(),aVe=(t,e)=>{let r=oVe(t,e);return r?r.version:null};Qne.exports=aVe});var Fne=_((zRt,Tne)=>{var lVe=Md(),cVe=(t,e)=>{let r=lVe(t.trim().replace(/^[=v]+/,\"\"),e);return r?r.version:null};Tne.exports=cVe});var Lne=_((ZRt,One)=>{var Nne=jo(),uVe=(t,e,r,s,a)=>{typeof r==\"string\"&&(a=s,s=r,r=void 0);try{return new Nne(t instanceof Nne?t.version:t,r).inc(e,s,a).version}catch{return null}};One.exports=uVe});var _ne=_((XRt,Une)=>{var Mne=Md(),fVe=(t,e)=>{let r=Mne(t,null,!0),s=Mne(e,null,!0),a=r.compare(s);if(a===0)return null;let n=a>0,c=n?r:s,f=n?s:r,p=!!c.prerelease.length;if(!!f.prerelease.length&&!p)return!f.patch&&!f.minor?\"major\":c.patch?\"patch\":c.minor?\"minor\":\"major\";let E=p?\"pre\":\"\";return r.major!==s.major?E+\"major\":r.minor!==s.minor?E+\"minor\":r.patch!==s.patch?E+\"patch\":\"prerelease\"};Une.exports=fVe});var jne=_(($Rt,Hne)=>{var AVe=jo(),pVe=(t,e)=>new AVe(t,e).major;Hne.exports=pVe});var qne=_((eTt,Gne)=>{var hVe=jo(),gVe=(t,e)=>new hVe(t,e).minor;Gne.exports=gVe});var Yne=_((tTt,Wne)=>{var dVe=jo(),mVe=(t,e)=>new dVe(t,e).patch;Wne.exports=mVe});var Jne=_((rTt,Vne)=>{var yVe=Md(),EVe=(t,e)=>{let r=yVe(t,e);return r&&r.prerelease.length?r.prerelease:null};Vne.exports=EVe});var Bc=_((nTt,zne)=>{var Kne=jo(),IVe=(t,e,r)=>new Kne(t,r).compare(new Kne(e,r));zne.exports=IVe});var Xne=_((iTt,Zne)=>{var CVe=Bc(),wVe=(t,e,r)=>CVe(e,t,r);Zne.exports=wVe});var eie=_((sTt,$ne)=>{var BVe=Bc(),vVe=(t,e)=>BVe(t,e,!0);$ne.exports=vVe});var Vx=_((oTt,rie)=>{var tie=jo(),SVe=(t,e,r)=>{let s=new tie(t,r),a=new tie(e,r);return s.compare(a)||s.compareBuild(a)};rie.exports=SVe});var iie=_((aTt,nie)=>{var DVe=Vx(),PVe=(t,e)=>t.sort((r,s)=>DVe(r,s,e));nie.exports=PVe});var oie=_((lTt,sie)=>{var bVe=Vx(),xVe=(t,e)=>t.sort((r,s)=>bVe(s,r,e));sie.exports=xVe});var cB=_((cTt,aie)=>{var kVe=Bc(),QVe=(t,e,r)=>kVe(t,e,r)>0;aie.exports=QVe});var Jx=_((uTt,lie)=>{var RVe=Bc(),TVe=(t,e,r)=>RVe(t,e,r)<0;lie.exports=TVe});var Q_=_((fTt,cie)=>{var FVe=Bc(),NVe=(t,e,r)=>FVe(t,e,r)===0;cie.exports=NVe});var R_=_((ATt,uie)=>{var OVe=Bc(),LVe=(t,e,r)=>OVe(t,e,r)!==0;uie.exports=LVe});var Kx=_((pTt,fie)=>{var MVe=Bc(),UVe=(t,e,r)=>MVe(t,e,r)>=0;fie.exports=UVe});var zx=_((hTt,Aie)=>{var _Ve=Bc(),HVe=(t,e,r)=>_Ve(t,e,r)<=0;Aie.exports=HVe});var T_=_((gTt,pie)=>{var jVe=Q_(),GVe=R_(),qVe=cB(),WVe=Kx(),YVe=Jx(),VVe=zx(),JVe=(t,e,r,s)=>{switch(e){case\"===\":return typeof t==\"object\"&&(t=t.version),typeof r==\"object\"&&(r=r.version),t===r;case\"!==\":return typeof t==\"object\"&&(t=t.version),typeof r==\"object\"&&(r=r.version),t!==r;case\"\":case\"=\":case\"==\":return jVe(t,r,s);case\"!=\":return GVe(t,r,s);case\">\":return qVe(t,r,s);case\">=\":return WVe(t,r,s);case\"<\":return YVe(t,r,s);case\"<=\":return VVe(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};pie.exports=JVe});var gie=_((dTt,hie)=>{var KVe=jo(),zVe=Md(),{safeRe:Zx,t:Xx}=vE(),ZVe=(t,e)=>{if(t instanceof KVe)return t;if(typeof t==\"number\"&&(t=String(t)),typeof t!=\"string\")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Zx[Xx.COERCEFULL]:Zx[Xx.COERCE]);else{let p=e.includePrerelease?Zx[Xx.COERCERTLFULL]:Zx[Xx.COERCERTL],h;for(;(h=p.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||h.index+h[0].length!==r.index+r[0].length)&&(r=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(r===null)return null;let s=r[2],a=r[3]||\"0\",n=r[4]||\"0\",c=e.includePrerelease&&r[5]?`-${r[5]}`:\"\",f=e.includePrerelease&&r[6]?`+${r[6]}`:\"\";return zVe(`${s}.${a}.${n}${c}${f}`,e)};hie.exports=ZVe});var mie=_((mTt,die)=>{\"use strict\";die.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var $x=_((yTt,yie)=>{\"use strict\";yie.exports=Fn;Fn.Node=Ud;Fn.create=Fn;function Fn(t){var e=this;if(e instanceof Fn||(e=new Fn),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach==\"function\")t.forEach(function(a){e.push(a)});else if(arguments.length>0)for(var r=0,s=arguments.length;r<s;r++)e.push(arguments[r]);return e}Fn.prototype.removeNode=function(t){if(t.list!==this)throw new Error(\"removing node which does not belong to this list\");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Fn.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Fn.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Fn.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)$Ve(this,arguments[t]);return this.length};Fn.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)e7e(this,arguments[t]);return this.length};Fn.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Fn.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Fn.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,s=0;r!==null;s++)t.call(e,r.value,s,this),r=r.next};Fn.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,s=this.length-1;r!==null;s--)t.call(e,r.value,s,this),r=r.prev};Fn.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};Fn.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};Fn.prototype.map=function(t,e){e=e||this;for(var r=new Fn,s=this.head;s!==null;)r.push(t.call(e,s.value,this)),s=s.next;return r};Fn.prototype.mapReverse=function(t,e){e=e||this;for(var r=new Fn,s=this.tail;s!==null;)r.push(t.call(e,s.value,this)),s=s.prev;return r};Fn.prototype.reduce=function(t,e){var r,s=this.head;if(arguments.length>1)r=e;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError(\"Reduce of empty list with no initial value\");for(var a=0;s!==null;a++)r=t(r,s.value,a),s=s.next;return r};Fn.prototype.reduceReverse=function(t,e){var r,s=this.tail;if(arguments.length>1)r=e;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError(\"Reduce of empty list with no initial value\");for(var a=this.length-1;s!==null;a--)r=t(r,s.value,a),s=s.prev;return r};Fn.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Fn.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Fn.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Fn;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var s=0,a=this.head;a!==null&&s<t;s++)a=a.next;for(;a!==null&&s<e;s++,a=a.next)r.push(a.value);return r};Fn.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Fn;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var s=this.length,a=this.tail;a!==null&&s>e;s--)a=a.prev;for(;a!==null&&s>t;s--,a=a.prev)r.push(a.value);return r};Fn.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var s=0,a=this.head;a!==null&&s<t;s++)a=a.next;for(var n=[],s=0;a&&s<e;s++)n.push(a.value),a=this.removeNode(a);a===null&&(a=this.tail),a!==this.head&&a!==this.tail&&(a=a.prev);for(var s=0;s<r.length;s++)a=XVe(this,a,r[s]);return n};Fn.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var s=r.prev;r.prev=r.next,r.next=s}return this.head=e,this.tail=t,this};function XVe(t,e,r){var s=e===t.head?new Ud(r,null,e,t):new Ud(r,e,e.next,t);return s.next===null&&(t.tail=s),s.prev===null&&(t.head=s),t.length++,s}function $Ve(t,e){t.tail=new Ud(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function e7e(t,e){t.head=new Ud(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function Ud(t,e,r,s){if(!(this instanceof Ud))return new Ud(t,e,r,s);this.list=s,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{mie()(Fn)}catch{}});var Bie=_((ETt,wie)=>{\"use strict\";var t7e=$x(),_d=Symbol(\"max\"),Sp=Symbol(\"length\"),DE=Symbol(\"lengthCalculator\"),fB=Symbol(\"allowStale\"),Hd=Symbol(\"maxAge\"),vp=Symbol(\"dispose\"),Eie=Symbol(\"noDisposeOnSet\"),Gs=Symbol(\"lruList\"),Lu=Symbol(\"cache\"),Cie=Symbol(\"updateAgeOnGet\"),F_=()=>1,O_=class{constructor(e){if(typeof e==\"number\"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!=\"number\"||e.max<0))throw new TypeError(\"max must be a non-negative number\");let r=this[_d]=e.max||1/0,s=e.length||F_;if(this[DE]=typeof s!=\"function\"?F_:s,this[fB]=e.stale||!1,e.maxAge&&typeof e.maxAge!=\"number\")throw new TypeError(\"maxAge must be a number\");this[Hd]=e.maxAge||0,this[vp]=e.dispose,this[Eie]=e.noDisposeOnSet||!1,this[Cie]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!=\"number\"||e<0)throw new TypeError(\"max must be a non-negative number\");this[_d]=e||1/0,uB(this)}get max(){return this[_d]}set allowStale(e){this[fB]=!!e}get allowStale(){return this[fB]}set maxAge(e){if(typeof e!=\"number\")throw new TypeError(\"maxAge must be a non-negative number\");this[Hd]=e,uB(this)}get maxAge(){return this[Hd]}set lengthCalculator(e){typeof e!=\"function\"&&(e=F_),e!==this[DE]&&(this[DE]=e,this[Sp]=0,this[Gs].forEach(r=>{r.length=this[DE](r.value,r.key),this[Sp]+=r.length})),uB(this)}get lengthCalculator(){return this[DE]}get length(){return this[Sp]}get itemCount(){return this[Gs].length}rforEach(e,r){r=r||this;for(let s=this[Gs].tail;s!==null;){let a=s.prev;Iie(this,e,s,r),s=a}}forEach(e,r){r=r||this;for(let s=this[Gs].head;s!==null;){let a=s.next;Iie(this,e,s,r),s=a}}keys(){return this[Gs].toArray().map(e=>e.key)}values(){return this[Gs].toArray().map(e=>e.value)}reset(){this[vp]&&this[Gs]&&this[Gs].length&&this[Gs].forEach(e=>this[vp](e.key,e.value)),this[Lu]=new Map,this[Gs]=new t7e,this[Sp]=0}dump(){return this[Gs].map(e=>ek(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Gs]}set(e,r,s){if(s=s||this[Hd],s&&typeof s!=\"number\")throw new TypeError(\"maxAge must be a number\");let a=s?Date.now():0,n=this[DE](r,e);if(this[Lu].has(e)){if(n>this[_d])return PE(this,this[Lu].get(e)),!1;let p=this[Lu].get(e).value;return this[vp]&&(this[Eie]||this[vp](e,p.value)),p.now=a,p.maxAge=s,p.value=r,this[Sp]+=n-p.length,p.length=n,this.get(e),uB(this),!0}let c=new L_(e,r,n,a,s);return c.length>this[_d]?(this[vp]&&this[vp](e,r),!1):(this[Sp]+=c.length,this[Gs].unshift(c),this[Lu].set(e,this[Gs].head),uB(this),!0)}has(e){if(!this[Lu].has(e))return!1;let r=this[Lu].get(e).value;return!ek(this,r)}get(e){return N_(this,e,!0)}peek(e){return N_(this,e,!1)}pop(){let e=this[Gs].tail;return e?(PE(this,e),e.value):null}del(e){PE(this,this[Lu].get(e))}load(e){this.reset();let r=Date.now();for(let s=e.length-1;s>=0;s--){let a=e[s],n=a.e||0;if(n===0)this.set(a.k,a.v);else{let c=n-r;c>0&&this.set(a.k,a.v,c)}}}prune(){this[Lu].forEach((e,r)=>N_(this,r,!1))}},N_=(t,e,r)=>{let s=t[Lu].get(e);if(s){let a=s.value;if(ek(t,a)){if(PE(t,s),!t[fB])return}else r&&(t[Cie]&&(s.value.now=Date.now()),t[Gs].unshiftNode(s));return a.value}},ek=(t,e)=>{if(!e||!e.maxAge&&!t[Hd])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[Hd]&&r>t[Hd]},uB=t=>{if(t[Sp]>t[_d])for(let e=t[Gs].tail;t[Sp]>t[_d]&&e!==null;){let r=e.prev;PE(t,e),e=r}},PE=(t,e)=>{if(e){let r=e.value;t[vp]&&t[vp](r.key,r.value),t[Sp]-=r.length,t[Lu].delete(r.key),t[Gs].removeNode(e)}},L_=class{constructor(e,r,s,a,n){this.key=e,this.value=r,this.length=s,this.now=a,this.maxAge=n||0}},Iie=(t,e,r,s)=>{let a=r.value;ek(t,a)&&(PE(t,r),t[fB]||(a=void 0)),a&&e.call(s,a.value,a.key,t)};wie.exports=O_});var vc=_((ITt,Pie)=>{var M_=class t{constructor(e,r){if(r=n7e(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof U_)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\\s+/).join(\" \"),this.set=this.raw.split(\"||\").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(a=>!Sie(a[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let a of this.set)if(a.length===1&&u7e(a[0])){this.set=[a];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(\" \").trim()).join(\"||\").trim(),this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&l7e)|(this.options.loose&&c7e))+\":\"+e,a=vie.get(s);if(a)return a;let n=this.options.loose,c=n?sl[wa.HYPHENRANGELOOSE]:sl[wa.HYPHENRANGE];e=e.replace(c,I7e(this.options.includePrerelease)),vi(\"hyphen replace\",e),e=e.replace(sl[wa.COMPARATORTRIM],s7e),vi(\"comparator trim\",e),e=e.replace(sl[wa.TILDETRIM],o7e),vi(\"tilde trim\",e),e=e.replace(sl[wa.CARETTRIM],a7e),vi(\"caret trim\",e);let f=e.split(\" \").map(C=>f7e(C,this.options)).join(\" \").split(/\\s+/).map(C=>E7e(C,this.options));n&&(f=f.filter(C=>(vi(\"loose invalid filter\",C,this.options),!!C.match(sl[wa.COMPARATORLOOSE])))),vi(\"range list\",f);let p=new Map,h=f.map(C=>new U_(C,this.options));for(let C of h){if(Sie(C))return[C];p.set(C.value,C)}p.size>1&&p.has(\"\")&&p.delete(\"\");let E=[...p.values()];return vie.set(s,E),E}intersects(e,r){if(!(e instanceof t))throw new TypeError(\"a Range is required\");return this.set.some(s=>Die(s,r)&&e.set.some(a=>Die(a,r)&&s.every(n=>a.every(c=>n.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e==\"string\")try{e=new i7e(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(C7e(this.set[r],e,this.options))return!0;return!1}};Pie.exports=M_;var r7e=Bie(),vie=new r7e({max:1e3}),n7e=qx(),U_=AB(),vi=lB(),i7e=jo(),{safeRe:sl,t:wa,comparatorTrimReplace:s7e,tildeTrimReplace:o7e,caretTrimReplace:a7e}=vE(),{FLAG_INCLUDE_PRERELEASE:l7e,FLAG_LOOSE:c7e}=aB(),Sie=t=>t.value===\"<0.0.0-0\",u7e=t=>t.value===\"\",Die=(t,e)=>{let r=!0,s=t.slice(),a=s.pop();for(;r&&s.length;)r=s.every(n=>a.intersects(n,e)),a=s.pop();return r},f7e=(t,e)=>(vi(\"comp\",t,e),t=h7e(t,e),vi(\"caret\",t),t=A7e(t,e),vi(\"tildes\",t),t=d7e(t,e),vi(\"xrange\",t),t=y7e(t,e),vi(\"stars\",t),t),Ba=t=>!t||t.toLowerCase()===\"x\"||t===\"*\",A7e=(t,e)=>t.trim().split(/\\s+/).map(r=>p7e(r,e)).join(\" \"),p7e=(t,e)=>{let r=e.loose?sl[wa.TILDELOOSE]:sl[wa.TILDE];return t.replace(r,(s,a,n,c,f)=>{vi(\"tilde\",t,s,a,n,c,f);let p;return Ba(a)?p=\"\":Ba(n)?p=`>=${a}.0.0 <${+a+1}.0.0-0`:Ba(c)?p=`>=${a}.${n}.0 <${a}.${+n+1}.0-0`:f?(vi(\"replaceTilde pr\",f),p=`>=${a}.${n}.${c}-${f} <${a}.${+n+1}.0-0`):p=`>=${a}.${n}.${c} <${a}.${+n+1}.0-0`,vi(\"tilde return\",p),p})},h7e=(t,e)=>t.trim().split(/\\s+/).map(r=>g7e(r,e)).join(\" \"),g7e=(t,e)=>{vi(\"caret\",t,e);let r=e.loose?sl[wa.CARETLOOSE]:sl[wa.CARET],s=e.includePrerelease?\"-0\":\"\";return t.replace(r,(a,n,c,f,p)=>{vi(\"caret\",t,a,n,c,f,p);let h;return Ba(n)?h=\"\":Ba(c)?h=`>=${n}.0.0${s} <${+n+1}.0.0-0`:Ba(f)?n===\"0\"?h=`>=${n}.${c}.0${s} <${n}.${+c+1}.0-0`:h=`>=${n}.${c}.0${s} <${+n+1}.0.0-0`:p?(vi(\"replaceCaret pr\",p),n===\"0\"?c===\"0\"?h=`>=${n}.${c}.${f}-${p} <${n}.${c}.${+f+1}-0`:h=`>=${n}.${c}.${f}-${p} <${n}.${+c+1}.0-0`:h=`>=${n}.${c}.${f}-${p} <${+n+1}.0.0-0`):(vi(\"no pr\"),n===\"0\"?c===\"0\"?h=`>=${n}.${c}.${f}${s} <${n}.${c}.${+f+1}-0`:h=`>=${n}.${c}.${f}${s} <${n}.${+c+1}.0-0`:h=`>=${n}.${c}.${f} <${+n+1}.0.0-0`),vi(\"caret return\",h),h})},d7e=(t,e)=>(vi(\"replaceXRanges\",t,e),t.split(/\\s+/).map(r=>m7e(r,e)).join(\" \")),m7e=(t,e)=>{t=t.trim();let r=e.loose?sl[wa.XRANGELOOSE]:sl[wa.XRANGE];return t.replace(r,(s,a,n,c,f,p)=>{vi(\"xRange\",t,s,a,n,c,f,p);let h=Ba(n),E=h||Ba(c),C=E||Ba(f),S=C;return a===\"=\"&&S&&(a=\"\"),p=e.includePrerelease?\"-0\":\"\",h?a===\">\"||a===\"<\"?s=\"<0.0.0-0\":s=\"*\":a&&S?(E&&(c=0),f=0,a===\">\"?(a=\">=\",E?(n=+n+1,c=0,f=0):(c=+c+1,f=0)):a===\"<=\"&&(a=\"<\",E?n=+n+1:c=+c+1),a===\"<\"&&(p=\"-0\"),s=`${a+n}.${c}.${f}${p}`):E?s=`>=${n}.0.0${p} <${+n+1}.0.0-0`:C&&(s=`>=${n}.${c}.0${p} <${n}.${+c+1}.0-0`),vi(\"xRange return\",s),s})},y7e=(t,e)=>(vi(\"replaceStars\",t,e),t.trim().replace(sl[wa.STAR],\"\")),E7e=(t,e)=>(vi(\"replaceGTE0\",t,e),t.trim().replace(sl[e.includePrerelease?wa.GTE0PRE:wa.GTE0],\"\")),I7e=t=>(e,r,s,a,n,c,f,p,h,E,C,S,b)=>(Ba(s)?r=\"\":Ba(a)?r=`>=${s}.0.0${t?\"-0\":\"\"}`:Ba(n)?r=`>=${s}.${a}.0${t?\"-0\":\"\"}`:c?r=`>=${r}`:r=`>=${r}${t?\"-0\":\"\"}`,Ba(h)?p=\"\":Ba(E)?p=`<${+h+1}.0.0-0`:Ba(C)?p=`<${h}.${+E+1}.0-0`:S?p=`<=${h}.${E}.${C}-${S}`:t?p=`<${h}.${E}.${+C+1}-0`:p=`<=${p}`,`${r} ${p}`.trim()),C7e=(t,e,r)=>{for(let s=0;s<t.length;s++)if(!t[s].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let s=0;s<t.length;s++)if(vi(t[s].semver),t[s].semver!==U_.ANY&&t[s].semver.prerelease.length>0){let a=t[s].semver;if(a.major===e.major&&a.minor===e.minor&&a.patch===e.patch)return!0}return!1}return!0}});var AB=_((CTt,Tie)=>{var pB=Symbol(\"SemVer ANY\"),j_=class t{static get ANY(){return pB}constructor(e,r){if(r=bie(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\\s+/).join(\" \"),H_(\"comparator\",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===pB?this.value=\"\":this.value=this.operator+this.semver.version,H_(\"comp\",this)}parse(e){let r=this.options.loose?xie[kie.COMPARATORLOOSE]:xie[kie.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:\"\",this.operator===\"=\"&&(this.operator=\"\"),s[2]?this.semver=new Qie(s[2],this.options.loose):this.semver=pB}toString(){return this.value}test(e){if(H_(\"Comparator.test\",e,this.options.loose),this.semver===pB||e===pB)return!0;if(typeof e==\"string\")try{e=new Qie(e,this.options)}catch{return!1}return __(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError(\"a Comparator is required\");return this.operator===\"\"?this.value===\"\"?!0:new Rie(e.value,r).test(this.value):e.operator===\"\"?e.value===\"\"?!0:new Rie(this.value,r).test(e.semver):(r=bie(r),r.includePrerelease&&(this.value===\"<0.0.0-0\"||e.value===\"<0.0.0-0\")||!r.includePrerelease&&(this.value.startsWith(\"<0.0.0\")||e.value.startsWith(\"<0.0.0\"))?!1:!!(this.operator.startsWith(\">\")&&e.operator.startsWith(\">\")||this.operator.startsWith(\"<\")&&e.operator.startsWith(\"<\")||this.semver.version===e.semver.version&&this.operator.includes(\"=\")&&e.operator.includes(\"=\")||__(this.semver,\"<\",e.semver,r)&&this.operator.startsWith(\">\")&&e.operator.startsWith(\"<\")||__(this.semver,\">\",e.semver,r)&&this.operator.startsWith(\"<\")&&e.operator.startsWith(\">\")))}};Tie.exports=j_;var bie=qx(),{safeRe:xie,t:kie}=vE(),__=T_(),H_=lB(),Qie=jo(),Rie=vc()});var hB=_((wTt,Fie)=>{var w7e=vc(),B7e=(t,e,r)=>{try{e=new w7e(e,r)}catch{return!1}return e.test(t)};Fie.exports=B7e});var Oie=_((BTt,Nie)=>{var v7e=vc(),S7e=(t,e)=>new v7e(t,e).set.map(r=>r.map(s=>s.value).join(\" \").trim().split(\" \"));Nie.exports=S7e});var Mie=_((vTt,Lie)=>{var D7e=jo(),P7e=vc(),b7e=(t,e,r)=>{let s=null,a=null,n=null;try{n=new P7e(e,r)}catch{return null}return t.forEach(c=>{n.test(c)&&(!s||a.compare(c)===-1)&&(s=c,a=new D7e(s,r))}),s};Lie.exports=b7e});var _ie=_((STt,Uie)=>{var x7e=jo(),k7e=vc(),Q7e=(t,e,r)=>{let s=null,a=null,n=null;try{n=new k7e(e,r)}catch{return null}return t.forEach(c=>{n.test(c)&&(!s||a.compare(c)===1)&&(s=c,a=new x7e(s,r))}),s};Uie.exports=Q7e});var Gie=_((DTt,jie)=>{var G_=jo(),R7e=vc(),Hie=cB(),T7e=(t,e)=>{t=new R7e(t,e);let r=new G_(\"0.0.0\");if(t.test(r)||(r=new G_(\"0.0.0-0\"),t.test(r)))return r;r=null;for(let s=0;s<t.set.length;++s){let a=t.set[s],n=null;a.forEach(c=>{let f=new G_(c.semver.version);switch(c.operator){case\">\":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case\"\":case\">=\":(!n||Hie(f,n))&&(n=f);break;case\"<\":case\"<=\":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),n&&(!r||Hie(r,n))&&(r=n)}return r&&t.test(r)?r:null};jie.exports=T7e});var Wie=_((PTt,qie)=>{var F7e=vc(),N7e=(t,e)=>{try{return new F7e(t,e).range||\"*\"}catch{return null}};qie.exports=N7e});var tk=_((bTt,Kie)=>{var O7e=jo(),Jie=AB(),{ANY:L7e}=Jie,M7e=vc(),U7e=hB(),Yie=cB(),Vie=Jx(),_7e=zx(),H7e=Kx(),j7e=(t,e,r,s)=>{t=new O7e(t,s),e=new M7e(e,s);let a,n,c,f,p;switch(r){case\">\":a=Yie,n=_7e,c=Vie,f=\">\",p=\">=\";break;case\"<\":a=Vie,n=H7e,c=Yie,f=\"<\",p=\"<=\";break;default:throw new TypeError('Must provide a hilo val of \"<\" or \">\"')}if(U7e(t,e,s))return!1;for(let h=0;h<e.set.length;++h){let E=e.set[h],C=null,S=null;if(E.forEach(b=>{b.semver===L7e&&(b=new Jie(\">=0.0.0\")),C=C||b,S=S||b,a(b.semver,C.semver,s)?C=b:c(b.semver,S.semver,s)&&(S=b)}),C.operator===f||C.operator===p||(!S.operator||S.operator===f)&&n(t,S.semver))return!1;if(S.operator===p&&c(t,S.semver))return!1}return!0};Kie.exports=j7e});var Zie=_((xTt,zie)=>{var G7e=tk(),q7e=(t,e,r)=>G7e(t,e,\">\",r);zie.exports=q7e});var $ie=_((kTt,Xie)=>{var W7e=tk(),Y7e=(t,e,r)=>W7e(t,e,\"<\",r);Xie.exports=Y7e});var rse=_((QTt,tse)=>{var ese=vc(),V7e=(t,e,r)=>(t=new ese(t,r),e=new ese(e,r),t.intersects(e,r));tse.exports=V7e});var ise=_((RTt,nse)=>{var J7e=hB(),K7e=Bc();nse.exports=(t,e,r)=>{let s=[],a=null,n=null,c=t.sort((E,C)=>K7e(E,C,r));for(let E of c)J7e(E,e,r)?(n=E,a||(a=E)):(n&&s.push([a,n]),n=null,a=null);a&&s.push([a,null]);let f=[];for(let[E,C]of s)E===C?f.push(E):!C&&E===c[0]?f.push(\"*\"):C?E===c[0]?f.push(`<=${C}`):f.push(`${E} - ${C}`):f.push(`>=${E}`);let p=f.join(\" || \"),h=typeof e.raw==\"string\"?e.raw:String(e);return p.length<h.length?p:e}});var use=_((TTt,cse)=>{var sse=vc(),W_=AB(),{ANY:q_}=W_,gB=hB(),Y_=Bc(),z7e=(t,e,r={})=>{if(t===e)return!0;t=new sse(t,r),e=new sse(e,r);let s=!1;e:for(let a of t.set){for(let n of e.set){let c=X7e(a,n,r);if(s=s||c!==null,c)continue e}if(s)return!1}return!0},Z7e=[new W_(\">=0.0.0-0\")],ose=[new W_(\">=0.0.0\")],X7e=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===q_){if(e.length===1&&e[0].semver===q_)return!0;r.includePrerelease?t=Z7e:t=ose}if(e.length===1&&e[0].semver===q_){if(r.includePrerelease)return!0;e=ose}let s=new Set,a,n;for(let b of t)b.operator===\">\"||b.operator===\">=\"?a=ase(a,b,r):b.operator===\"<\"||b.operator===\"<=\"?n=lse(n,b,r):s.add(b.semver);if(s.size>1)return null;let c;if(a&&n){if(c=Y_(a.semver,n.semver,r),c>0)return null;if(c===0&&(a.operator!==\">=\"||n.operator!==\"<=\"))return null}for(let b of s){if(a&&!gB(b,String(a),r)||n&&!gB(b,String(n),r))return null;for(let I of e)if(!gB(b,String(I),r))return!1;return!0}let f,p,h,E,C=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,S=a&&!r.includePrerelease&&a.semver.prerelease.length?a.semver:!1;C&&C.prerelease.length===1&&n.operator===\"<\"&&C.prerelease[0]===0&&(C=!1);for(let b of e){if(E=E||b.operator===\">\"||b.operator===\">=\",h=h||b.operator===\"<\"||b.operator===\"<=\",a){if(S&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===S.major&&b.semver.minor===S.minor&&b.semver.patch===S.patch&&(S=!1),b.operator===\">\"||b.operator===\">=\"){if(f=ase(a,b,r),f===b&&f!==a)return!1}else if(a.operator===\">=\"&&!gB(a.semver,String(b),r))return!1}if(n){if(C&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===C.major&&b.semver.minor===C.minor&&b.semver.patch===C.patch&&(C=!1),b.operator===\"<\"||b.operator===\"<=\"){if(p=lse(n,b,r),p===b&&p!==n)return!1}else if(n.operator===\"<=\"&&!gB(n.semver,String(b),r))return!1}if(!b.operator&&(n||a)&&c!==0)return!1}return!(a&&h&&!n&&c!==0||n&&E&&!a&&c!==0||S||C)},ase=(t,e,r)=>{if(!t)return e;let s=Y_(t.semver,e.semver,r);return s>0?t:s<0||e.operator===\">\"&&t.operator===\">=\"?e:t},lse=(t,e,r)=>{if(!t)return e;let s=Y_(t.semver,e.semver,r);return s<0?t:s>0||e.operator===\"<\"&&t.operator===\"<=\"?e:t};cse.exports=z7e});var Ai=_((FTt,pse)=>{var V_=vE(),fse=aB(),$7e=jo(),Ase=x_(),eJe=Md(),tJe=Rne(),rJe=Fne(),nJe=Lne(),iJe=_ne(),sJe=jne(),oJe=qne(),aJe=Yne(),lJe=Jne(),cJe=Bc(),uJe=Xne(),fJe=eie(),AJe=Vx(),pJe=iie(),hJe=oie(),gJe=cB(),dJe=Jx(),mJe=Q_(),yJe=R_(),EJe=Kx(),IJe=zx(),CJe=T_(),wJe=gie(),BJe=AB(),vJe=vc(),SJe=hB(),DJe=Oie(),PJe=Mie(),bJe=_ie(),xJe=Gie(),kJe=Wie(),QJe=tk(),RJe=Zie(),TJe=$ie(),FJe=rse(),NJe=ise(),OJe=use();pse.exports={parse:eJe,valid:tJe,clean:rJe,inc:nJe,diff:iJe,major:sJe,minor:oJe,patch:aJe,prerelease:lJe,compare:cJe,rcompare:uJe,compareLoose:fJe,compareBuild:AJe,sort:pJe,rsort:hJe,gt:gJe,lt:dJe,eq:mJe,neq:yJe,gte:EJe,lte:IJe,cmp:CJe,coerce:wJe,Comparator:BJe,Range:vJe,satisfies:SJe,toComparators:DJe,maxSatisfying:PJe,minSatisfying:bJe,minVersion:xJe,validRange:kJe,outside:QJe,gtr:RJe,ltr:TJe,intersects:FJe,simplifyRange:NJe,subset:OJe,SemVer:$7e,re:V_.re,src:V_.src,tokens:V_.t,SEMVER_SPEC_VERSION:fse.SEMVER_SPEC_VERSION,RELEASE_TYPES:fse.RELEASE_TYPES,compareIdentifiers:Ase.compareIdentifiers,rcompareIdentifiers:Ase.rcompareIdentifiers}});var gse=_((NTt,hse)=>{\"use strict\";function LJe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function jd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name=\"SyntaxError\",typeof Error.captureStackTrace==\"function\"&&Error.captureStackTrace(this,jd)}LJe(jd,Error);jd.buildMessage=function(t,e){var r={literal:function(h){return'\"'+a(h.text)+'\"'},class:function(h){var E=\"\",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+\"-\"+n(h.parts[C][1]):n(h.parts[C]);return\"[\"+(h.inverted?\"^\":\"\")+E+\"]\"},any:function(h){return\"any character\"},end:function(h){return\"end of input\"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"').replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function n(h){return h.replace(/\\\\/g,\"\\\\\\\\\").replace(/\\]/g,\"\\\\]\").replace(/\\^/g,\"\\\\^\").replace(/-/g,\"\\\\-\").replace(/\\0/g,\"\\\\0\").replace(/\\t/g,\"\\\\t\").replace(/\\n/g,\"\\\\n\").replace(/\\r/g,\"\\\\r\").replace(/[\\x00-\\x0F]/g,function(E){return\"\\\\x0\"+s(E)}).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g,function(E){return\"\\\\x\"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+\" or \"+E[1];default:return E.slice(0,-1).join(\", \")+\", or \"+E[E.length-1]}}function p(h){return h?'\"'+a(h)+'\"':\"end of input\"}return\"Expected \"+f(t)+\" but \"+p(e)+\" found.\"};function MJe(t,e){e=e!==void 0?e:{};var r={},s={Expression:y},a=y,n=\"|\",c=Fe(\"|\",!1),f=\"&\",p=Fe(\"&\",!1),h=\"^\",E=Fe(\"^\",!1),C=function($,oe){return!!oe.reduce((xe,Re)=>{switch(Re[1]){case\"|\":return xe|Re[3];case\"&\":return xe&Re[3];case\"^\":return xe^Re[3]}},$)},S=\"!\",b=Fe(\"!\",!1),I=function($){return!$},T=\"(\",N=Fe(\"(\",!1),U=\")\",W=Fe(\")\",!1),ee=function($){return $},ie=/^[^ \\t\\n\\r()!|&\\^]/,ue=Ne([\" \",\"\t\",`\n`,\"\\r\",\"(\",\")\",\"!\",\"|\",\"&\",\"^\"],!0,!1),le=function($){return e.queryPattern.test($)},me=function($){return e.checkFn($)},pe=ke(\"whitespace\"),Be=/^[ \\t\\n\\r]/,Ce=Ne([\" \",\"\t\",`\n`,\"\\r\"],!1,!1),g=0,we=0,ye=[{line:1,column:1}],Ae=0,se=[],X=0,De;if(\"startRule\"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule \"`+e.startRule+'\".');a=s[e.startRule]}function Te(){return t.substring(we,g)}function mt(){return Ue(we,g)}function j($,oe){throw oe=oe!==void 0?oe:Ue(we,g),P([ke($)],t.substring(we,g),oe)}function rt($,oe){throw oe=oe!==void 0?oe:Ue(we,g),w($,oe)}function Fe($,oe){return{type:\"literal\",text:$,ignoreCase:oe}}function Ne($,oe,xe){return{type:\"class\",parts:$,inverted:oe,ignoreCase:xe}}function be(){return{type:\"any\"}}function Ve(){return{type:\"end\"}}function ke($){return{type:\"other\",description:$}}function it($){var oe=ye[$],xe;if(oe)return oe;for(xe=$-1;!ye[xe];)xe--;for(oe=ye[xe],oe={line:oe.line,column:oe.column};xe<$;)t.charCodeAt(xe)===10?(oe.line++,oe.column=1):oe.column++,xe++;return ye[$]=oe,oe}function Ue($,oe){var xe=it($),Re=it(oe);return{start:{offset:$,line:xe.line,column:xe.column},end:{offset:oe,line:Re.line,column:Re.column}}}function x($){g<Ae||(g>Ae&&(Ae=g,se=[]),se.push($))}function w($,oe){return new jd($,null,null,oe)}function P($,oe,xe){return new jd(jd.buildMessage($,oe),$,oe,xe)}function y(){var $,oe,xe,Re,lt,Ct,qt,ir;if($=g,oe=F(),oe!==r){for(xe=[],Re=g,lt=Z(),lt!==r?(t.charCodeAt(g)===124?(Ct=n,g++):(Ct=r,X===0&&x(c)),Ct===r&&(t.charCodeAt(g)===38?(Ct=f,g++):(Ct=r,X===0&&x(p)),Ct===r&&(t.charCodeAt(g)===94?(Ct=h,g++):(Ct=r,X===0&&x(E)))),Ct!==r?(qt=Z(),qt!==r?(ir=F(),ir!==r?(lt=[lt,Ct,qt,ir],Re=lt):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r);Re!==r;)xe.push(Re),Re=g,lt=Z(),lt!==r?(t.charCodeAt(g)===124?(Ct=n,g++):(Ct=r,X===0&&x(c)),Ct===r&&(t.charCodeAt(g)===38?(Ct=f,g++):(Ct=r,X===0&&x(p)),Ct===r&&(t.charCodeAt(g)===94?(Ct=h,g++):(Ct=r,X===0&&x(E)))),Ct!==r?(qt=Z(),qt!==r?(ir=F(),ir!==r?(lt=[lt,Ct,qt,ir],Re=lt):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r)):(g=Re,Re=r);xe!==r?(we=$,oe=C(oe,xe),$=oe):(g=$,$=r)}else g=$,$=r;return $}function F(){var $,oe,xe,Re,lt,Ct;return $=g,t.charCodeAt(g)===33?(oe=S,g++):(oe=r,X===0&&x(b)),oe!==r?(xe=F(),xe!==r?(we=$,oe=I(xe),$=oe):(g=$,$=r)):(g=$,$=r),$===r&&($=g,t.charCodeAt(g)===40?(oe=T,g++):(oe=r,X===0&&x(N)),oe!==r?(xe=Z(),xe!==r?(Re=y(),Re!==r?(lt=Z(),lt!==r?(t.charCodeAt(g)===41?(Ct=U,g++):(Ct=r,X===0&&x(W)),Ct!==r?(we=$,oe=ee(Re),$=oe):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r),$===r&&($=z())),$}function z(){var $,oe,xe,Re,lt;if($=g,oe=Z(),oe!==r){if(xe=g,Re=[],ie.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,X===0&&x(ue)),lt!==r)for(;lt!==r;)Re.push(lt),ie.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,X===0&&x(ue));else Re=r;Re!==r?xe=t.substring(xe,g):xe=Re,xe!==r?(we=g,Re=le(xe),Re?Re=void 0:Re=r,Re!==r?(we=$,oe=me(xe),$=oe):(g=$,$=r)):(g=$,$=r)}else g=$,$=r;return $}function Z(){var $,oe;for(X++,$=[],Be.test(t.charAt(g))?(oe=t.charAt(g),g++):(oe=r,X===0&&x(Ce));oe!==r;)$.push(oe),Be.test(t.charAt(g))?(oe=t.charAt(g),g++):(oe=r,X===0&&x(Ce));return X--,$===r&&(oe=r,X===0&&x(pe)),$}if(De=a(),De!==r&&g===t.length)return De;throw De!==r&&g<t.length&&x(Ve()),P(se,Ae<t.length?t.charAt(Ae):null,Ae<t.length?Ue(Ae,Ae+1):Ue(Ae,Ae))}hse.exports={SyntaxError:jd,parse:MJe}});var dse=_(rk=>{var{parse:UJe}=gse();rk.makeParser=(t=/[a-z]+/)=>(e,r)=>UJe(e,{queryPattern:t,checkFn:r});rk.parse=rk.makeParser()});var yse=_((LTt,mse)=>{\"use strict\";mse.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var J_=_((MTt,Ise)=>{var dB=yse(),Ese={};for(let t of Object.keys(dB))Ese[dB[t]]=t;var hr={rgb:{channels:3,labels:\"rgb\"},hsl:{channels:3,labels:\"hsl\"},hsv:{channels:3,labels:\"hsv\"},hwb:{channels:3,labels:\"hwb\"},cmyk:{channels:4,labels:\"cmyk\"},xyz:{channels:3,labels:\"xyz\"},lab:{channels:3,labels:\"lab\"},lch:{channels:3,labels:\"lch\"},hex:{channels:1,labels:[\"hex\"]},keyword:{channels:1,labels:[\"keyword\"]},ansi16:{channels:1,labels:[\"ansi16\"]},ansi256:{channels:1,labels:[\"ansi256\"]},hcg:{channels:3,labels:[\"h\",\"c\",\"g\"]},apple:{channels:3,labels:[\"r16\",\"g16\",\"b16\"]},gray:{channels:1,labels:[\"gray\"]}};Ise.exports=hr;for(let t of Object.keys(hr)){if(!(\"channels\"in hr[t]))throw new Error(\"missing channels property: \"+t);if(!(\"labels\"in hr[t]))throw new Error(\"missing channel labels property: \"+t);if(hr[t].labels.length!==hr[t].channels)throw new Error(\"channel and label counts mismatch: \"+t);let{channels:e,labels:r}=hr[t];delete hr[t].channels,delete hr[t].labels,Object.defineProperty(hr[t],\"channels\",{value:e}),Object.defineProperty(hr[t],\"labels\",{value:r})}hr.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255,a=Math.min(e,r,s),n=Math.max(e,r,s),c=n-a,f,p;n===a?f=0:e===n?f=(r-s)/c:r===n?f=2+(s-e)/c:s===n&&(f=4+(e-r)/c),f=Math.min(f*60,360),f<0&&(f+=360);let h=(a+n)/2;return n===a?p=0:h<=.5?p=c/(n+a):p=c/(2-n-a),[f,p*100,h*100]};hr.rgb.hsv=function(t){let e,r,s,a,n,c=t[0]/255,f=t[1]/255,p=t[2]/255,h=Math.max(c,f,p),E=h-Math.min(c,f,p),C=function(S){return(h-S)/6/E+1/2};return E===0?(a=0,n=0):(n=E/h,e=C(c),r=C(f),s=C(p),c===h?a=s-r:f===h?a=1/3+e-s:p===h&&(a=2/3+r-e),a<0?a+=1:a>1&&(a-=1)),[a*360,n*100,h*100]};hr.rgb.hwb=function(t){let e=t[0],r=t[1],s=t[2],a=hr.rgb.hsl(t)[0],n=1/255*Math.min(e,Math.min(r,s));return s=1-1/255*Math.max(e,Math.max(r,s)),[a,n*100,s*100]};hr.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255,a=Math.min(1-e,1-r,1-s),n=(1-e-a)/(1-a)||0,c=(1-r-a)/(1-a)||0,f=(1-s-a)/(1-a)||0;return[n*100,c*100,f*100,a*100]};function _Je(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}hr.rgb.keyword=function(t){let e=Ese[t];if(e)return e;let r=1/0,s;for(let a of Object.keys(dB)){let n=dB[a],c=_Je(t,n);c<r&&(r=c,s=a)}return s};hr.keyword.rgb=function(t){return dB[t]};hr.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;let a=e*.4124+r*.3576+s*.1805,n=e*.2126+r*.7152+s*.0722,c=e*.0193+r*.1192+s*.9505;return[a*100,n*100,c*100]};hr.rgb.lab=function(t){let e=hr.rgb.xyz(t),r=e[0],s=e[1],a=e[2];r/=95.047,s/=100,a/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let n=116*s-16,c=500*(r-s),f=200*(s-a);return[n,c,f]};hr.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,s=t[2]/100,a,n,c;if(r===0)return c=s*255,[c,c,c];s<.5?a=s*(1+r):a=s+r-s*r;let f=2*s-a,p=[0,0,0];for(let h=0;h<3;h++)n=e+1/3*-(h-1),n<0&&n++,n>1&&n--,6*n<1?c=f+(a-f)*6*n:2*n<1?c=a:3*n<2?c=f+(a-f)*(2/3-n)*6:c=f,p[h]=c*255;return p};hr.hsl.hsv=function(t){let e=t[0],r=t[1]/100,s=t[2]/100,a=r,n=Math.max(s,.01);s*=2,r*=s<=1?s:2-s,a*=n<=1?n:2-n;let c=(s+r)/2,f=s===0?2*a/(n+a):2*r/(s+r);return[e,f*100,c*100]};hr.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,s=t[2]/100,a=Math.floor(e)%6,n=e-Math.floor(e),c=255*s*(1-r),f=255*s*(1-r*n),p=255*s*(1-r*(1-n));switch(s*=255,a){case 0:return[s,p,c];case 1:return[f,s,c];case 2:return[c,s,p];case 3:return[c,f,s];case 4:return[p,c,s];case 5:return[s,c,f]}};hr.hsv.hsl=function(t){let e=t[0],r=t[1]/100,s=t[2]/100,a=Math.max(s,.01),n,c;c=(2-r)*s;let f=(2-r)*a;return n=r*a,n/=f<=1?f:2-f,n=n||0,c/=2,[e,n*100,c*100]};hr.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,s=t[2]/100,a=r+s,n;a>1&&(r/=a,s/=a);let c=Math.floor(6*e),f=1-s;n=6*e-c,c&1&&(n=1-n);let p=r+n*(f-r),h,E,C;switch(c){default:case 6:case 0:h=f,E=p,C=r;break;case 1:h=p,E=f,C=r;break;case 2:h=r,E=f,C=p;break;case 3:h=r,E=p,C=f;break;case 4:h=p,E=r,C=f;break;case 5:h=f,E=r,C=p;break}return[h*255,E*255,C*255]};hr.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,s=t[2]/100,a=t[3]/100,n=1-Math.min(1,e*(1-a)+a),c=1-Math.min(1,r*(1-a)+a),f=1-Math.min(1,s*(1-a)+a);return[n*255,c*255,f*255]};hr.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,s=t[2]/100,a,n,c;return a=e*3.2406+r*-1.5372+s*-.4986,n=e*-.9689+r*1.8758+s*.0415,c=e*.0557+r*-.204+s*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),c=Math.min(Math.max(0,c),1),[a*255,n*255,c*255]};hr.xyz.lab=function(t){let e=t[0],r=t[1],s=t[2];e/=95.047,r/=100,s/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let a=116*r-16,n=500*(e-r),c=200*(r-s);return[a,n,c]};hr.lab.xyz=function(t){let e=t[0],r=t[1],s=t[2],a,n,c;n=(e+16)/116,a=r/500+n,c=n-s/200;let f=n**3,p=a**3,h=c**3;return n=f>.008856?f:(n-16/116)/7.787,a=p>.008856?p:(a-16/116)/7.787,c=h>.008856?h:(c-16/116)/7.787,a*=95.047,n*=100,c*=108.883,[a,n,c]};hr.lab.lch=function(t){let e=t[0],r=t[1],s=t[2],a;a=Math.atan2(s,r)*360/2/Math.PI,a<0&&(a+=360);let c=Math.sqrt(r*r+s*s);return[e,c,a]};hr.lch.lab=function(t){let e=t[0],r=t[1],a=t[2]/360*2*Math.PI,n=r*Math.cos(a),c=r*Math.sin(a);return[e,n,c]};hr.rgb.ansi16=function(t,e=null){let[r,s,a]=t,n=e===null?hr.rgb.hsv(t)[2]:e;if(n=Math.round(n/50),n===0)return 30;let c=30+(Math.round(a/255)<<2|Math.round(s/255)<<1|Math.round(r/255));return n===2&&(c+=60),c};hr.hsv.ansi16=function(t){return hr.rgb.ansi16(hr.hsv.rgb(t),t[2])};hr.rgb.ansi256=function(t){let e=t[0],r=t[1],s=t[2];return e===r&&r===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)};hr.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,s=(e&1)*r*255,a=(e>>1&1)*r*255,n=(e>>2&1)*r*255;return[s,a,n]};hr.ansi256.rgb=function(t){if(t>=232){let n=(t-232)*10+8;return[n,n,n]}t-=16;let e,r=Math.floor(t/36)/5*255,s=Math.floor((e=t%36)/6)/5*255,a=e%6/5*255;return[r,s,a]};hr.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return\"000000\".substring(r.length)+r};hr.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split(\"\").map(f=>f+f).join(\"\"));let s=parseInt(r,16),a=s>>16&255,n=s>>8&255,c=s&255;return[a,n,c]};hr.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,s=t[2]/255,a=Math.max(Math.max(e,r),s),n=Math.min(Math.min(e,r),s),c=a-n,f,p;return c<1?f=n/(1-c):f=0,c<=0?p=0:a===e?p=(r-s)/c%6:a===r?p=2+(s-e)/c:p=4+(e-r)/c,p/=6,p%=1,[p*360,c*100,f*100]};hr.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,s=r<.5?2*e*r:2*e*(1-r),a=0;return s<1&&(a=(r-.5*s)/(1-s)),[t[0],s*100,a*100]};hr.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,s=e*r,a=0;return s<1&&(a=(r-s)/(1-s)),[t[0],s*100,a*100]};hr.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,s=t[2]/100;if(r===0)return[s*255,s*255,s*255];let a=[0,0,0],n=e%1*6,c=n%1,f=1-c,p=0;switch(Math.floor(n)){case 0:a[0]=1,a[1]=c,a[2]=0;break;case 1:a[0]=f,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=c;break;case 3:a[0]=0,a[1]=f,a[2]=1;break;case 4:a[0]=c,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=f}return p=(1-r)*s,[(r*a[0]+p)*255,(r*a[1]+p)*255,(r*a[2]+p)*255]};hr.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,s=e+r*(1-e),a=0;return s>0&&(a=e/s),[t[0],a*100,s*100]};hr.hcg.hsl=function(t){let e=t[1]/100,s=t[2]/100*(1-e)+.5*e,a=0;return s>0&&s<.5?a=e/(2*s):s>=.5&&s<1&&(a=e/(2*(1-s))),[t[0],a*100,s*100]};hr.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,s=e+r*(1-e);return[t[0],(s-e)*100,(1-s)*100]};hr.hwb.hcg=function(t){let e=t[1]/100,s=1-t[2]/100,a=s-e,n=0;return a<1&&(n=(s-a)/(1-a)),[t[0],a*100,n*100]};hr.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};hr.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};hr.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};hr.gray.hsl=function(t){return[0,0,t[0]]};hr.gray.hsv=hr.gray.hsl;hr.gray.hwb=function(t){return[0,100,t[0]]};hr.gray.cmyk=function(t){return[0,0,0,t[0]]};hr.gray.lab=function(t){return[t[0],0,0]};hr.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,s=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return\"000000\".substring(s.length)+s};hr.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var wse=_((UTt,Cse)=>{var nk=J_();function HJe(){let t={},e=Object.keys(nk);for(let r=e.length,s=0;s<r;s++)t[e[s]]={distance:-1,parent:null};return t}function jJe(t){let e=HJe(),r=[t];for(e[t].distance=0;r.length;){let s=r.pop(),a=Object.keys(nk[s]);for(let n=a.length,c=0;c<n;c++){let f=a[c],p=e[f];p.distance===-1&&(p.distance=e[s].distance+1,p.parent=s,r.unshift(f))}}return e}function GJe(t,e){return function(r){return e(t(r))}}function qJe(t,e){let r=[e[t].parent,t],s=nk[e[t].parent][t],a=e[t].parent;for(;e[a].parent;)r.unshift(e[a].parent),s=GJe(nk[e[a].parent][a],s),a=e[a].parent;return s.conversion=r,s}Cse.exports=function(t){let e=jJe(t),r={},s=Object.keys(e);for(let a=s.length,n=0;n<a;n++){let c=s[n];e[c].parent!==null&&(r[c]=qJe(c,e))}return r}});var vse=_((_Tt,Bse)=>{var K_=J_(),WJe=wse(),bE={},YJe=Object.keys(K_);function VJe(t){let e=function(...r){let s=r[0];return s==null?s:(s.length>1&&(r=s),t(r))};return\"conversion\"in t&&(e.conversion=t.conversion),e}function JJe(t){let e=function(...r){let s=r[0];if(s==null)return s;s.length>1&&(r=s);let a=t(r);if(typeof a==\"object\")for(let n=a.length,c=0;c<n;c++)a[c]=Math.round(a[c]);return a};return\"conversion\"in t&&(e.conversion=t.conversion),e}YJe.forEach(t=>{bE[t]={},Object.defineProperty(bE[t],\"channels\",{value:K_[t].channels}),Object.defineProperty(bE[t],\"labels\",{value:K_[t].labels});let e=WJe(t);Object.keys(e).forEach(s=>{let a=e[s];bE[t][s]=JJe(a),bE[t][s].raw=VJe(a)})});Bse.exports=bE});var sk=_((HTt,xse)=>{\"use strict\";var Sse=(t,e)=>(...r)=>`\\x1B[${t(...r)+e}m`,Dse=(t,e)=>(...r)=>{let s=t(...r);return`\\x1B[${38+e};5;${s}m`},Pse=(t,e)=>(...r)=>{let s=t(...r);return`\\x1B[${38+e};2;${s[0]};${s[1]};${s[2]}m`},ik=t=>t,bse=(t,e,r)=>[t,e,r],xE=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let s=r();return Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0}),s},enumerable:!0,configurable:!0})},z_,kE=(t,e,r,s)=>{z_===void 0&&(z_=vse());let a=s?10:0,n={};for(let[c,f]of Object.entries(z_)){let p=c===\"ansi16\"?\"ansi\":c;c===e?n[p]=t(r,a):typeof f==\"object\"&&(n[p]=t(f[e],a))}return n};function KJe(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,s]of Object.entries(e)){for(let[a,n]of Object.entries(s))e[a]={open:`\\x1B[${n[0]}m`,close:`\\x1B[${n[1]}m`},s[a]=e[a],t.set(n[0],n[1]);Object.defineProperty(e,r,{value:s,enumerable:!1})}return Object.defineProperty(e,\"codes\",{value:t,enumerable:!1}),e.color.close=\"\\x1B[39m\",e.bgColor.close=\"\\x1B[49m\",xE(e.color,\"ansi\",()=>kE(Sse,\"ansi16\",ik,!1)),xE(e.color,\"ansi256\",()=>kE(Dse,\"ansi256\",ik,!1)),xE(e.color,\"ansi16m\",()=>kE(Pse,\"rgb\",bse,!1)),xE(e.bgColor,\"ansi\",()=>kE(Sse,\"ansi16\",ik,!0)),xE(e.bgColor,\"ansi256\",()=>kE(Dse,\"ansi256\",ik,!0)),xE(e.bgColor,\"ansi16m\",()=>kE(Pse,\"rgb\",bse,!0)),e}Object.defineProperty(xse,\"exports\",{enumerable:!0,get:KJe})});var Qse=_((jTt,kse)=>{\"use strict\";kse.exports=(t,e=process.argv)=>{let r=t.startsWith(\"-\")?\"\":t.length===1?\"-\":\"--\",s=e.indexOf(r+t),a=e.indexOf(\"--\");return s!==-1&&(a===-1||s<a)}});var Fse=_((GTt,Tse)=>{\"use strict\";var zJe=Ie(\"os\"),Rse=Ie(\"tty\"),Sc=Qse(),{env:Ps}=process,l0;Sc(\"no-color\")||Sc(\"no-colors\")||Sc(\"color=false\")||Sc(\"color=never\")?l0=0:(Sc(\"color\")||Sc(\"colors\")||Sc(\"color=true\")||Sc(\"color=always\"))&&(l0=1);\"FORCE_COLOR\"in Ps&&(Ps.FORCE_COLOR===\"true\"?l0=1:Ps.FORCE_COLOR===\"false\"?l0=0:l0=Ps.FORCE_COLOR.length===0?1:Math.min(parseInt(Ps.FORCE_COLOR,10),3));function Z_(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function X_(t,e){if(l0===0)return 0;if(Sc(\"color=16m\")||Sc(\"color=full\")||Sc(\"color=truecolor\"))return 3;if(Sc(\"color=256\"))return 2;if(t&&!e&&l0===void 0)return 0;let r=l0||0;if(Ps.TERM===\"dumb\")return r;if(process.platform===\"win32\"){let s=zJe.release().split(\".\");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if(\"CI\"in Ps)return[\"TRAVIS\",\"CIRCLECI\",\"APPVEYOR\",\"GITLAB_CI\"].some(s=>s in Ps)||Ps.CI_NAME===\"codeship\"?1:r;if(\"TEAMCITY_VERSION\"in Ps)return/^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(Ps.TEAMCITY_VERSION)?1:0;if(\"GITHUB_ACTIONS\"in Ps)return 1;if(Ps.COLORTERM===\"truecolor\")return 3;if(\"TERM_PROGRAM\"in Ps){let s=parseInt((Ps.TERM_PROGRAM_VERSION||\"\").split(\".\")[0],10);switch(Ps.TERM_PROGRAM){case\"iTerm.app\":return s>=3?3:2;case\"Apple_Terminal\":return 2}}return/-256(color)?$/i.test(Ps.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ps.TERM)||\"COLORTERM\"in Ps?1:r}function ZJe(t){let e=X_(t,t&&t.isTTY);return Z_(e)}Tse.exports={supportsColor:ZJe,stdout:Z_(X_(!0,Rse.isatty(1))),stderr:Z_(X_(!0,Rse.isatty(2)))}});var Ose=_((qTt,Nse)=>{\"use strict\";var XJe=(t,e,r)=>{let s=t.indexOf(e);if(s===-1)return t;let a=e.length,n=0,c=\"\";do c+=t.substr(n,s-n)+e+r,n=s+a,s=t.indexOf(e,n);while(s!==-1);return c+=t.substr(n),c},$Je=(t,e,r,s)=>{let a=0,n=\"\";do{let c=t[s-1]===\"\\r\";n+=t.substr(a,(c?s-1:s)-a)+e+(c?`\\r\n`:`\n`)+r,a=s+1,s=t.indexOf(`\n`,a)}while(s!==-1);return n+=t.substr(a),n};Nse.exports={stringReplaceAll:XJe,stringEncaseCRLFWithFirstIndex:$Je}});var Hse=_((WTt,_se)=>{\"use strict\";var eKe=/(?:\\\\(u(?:[a-f\\d]{4}|\\{[a-f\\d]{1,6}\\})|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi,Lse=/(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g,tKe=/^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/,rKe=/\\\\(u(?:[a-f\\d]{4}|{[a-f\\d]{1,6}})|x[a-f\\d]{2}|.)|([^\\\\])/gi,nKe=new Map([[\"n\",`\n`],[\"r\",\"\\r\"],[\"t\",\"\t\"],[\"b\",\"\\b\"],[\"f\",\"\\f\"],[\"v\",\"\\v\"],[\"0\",\"\\0\"],[\"\\\\\",\"\\\\\"],[\"e\",\"\\x1B\"],[\"a\",\"\\x07\"]]);function Use(t){let e=t[0]===\"u\",r=t[1]===\"{\";return e&&!r&&t.length===5||t[0]===\"x\"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):nKe.get(t)||t}function iKe(t,e){let r=[],s=e.trim().split(/\\s*,\\s*/g),a;for(let n of s){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(tKe))r.push(a[2].replace(rKe,(f,p,h)=>p?Use(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function sKe(t){Lse.lastIndex=0;let e=[],r;for(;(r=Lse.exec(t))!==null;){let s=r[1];if(r[2]){let a=iKe(s,r[2]);e.push([s].concat(a))}else e.push([s])}return e}function Mse(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let s=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in s))throw new Error(`Unknown Chalk style: ${a}`);s=n.length>0?s[a](...n):s[a]}return s}_se.exports=(t,e)=>{let r=[],s=[],a=[];if(e.replace(eKe,(n,c,f,p,h,E)=>{if(c)a.push(Use(c));else if(p){let C=a.join(\"\");a=[],s.push(r.length===0?C:Mse(t,r)(C)),r.push({inverse:f,styles:sKe(p)})}else if(h){if(r.length===0)throw new Error(\"Found extraneous } in Chalk template literal\");s.push(Mse(t,r)(a.join(\"\"))),a=[],r.pop()}else a.push(E)}),s.push(a.join(\"\")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?\"\":\"s\"} (\\`}\\`)`;throw new Error(n)}return s.join(\"\")}});var RE=_((YTt,Vse)=>{\"use strict\";var mB=sk(),{stdout:e4,stderr:t4}=Fse(),{stringReplaceAll:oKe,stringEncaseCRLFWithFirstIndex:aKe}=Ose(),{isArray:ok}=Array,Gse=[\"ansi\",\"ansi\",\"ansi256\",\"ansi16m\"],QE=Object.create(null),lKe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error(\"The `level` option should be an integer from 0 to 3\");let r=e4?e4.level:0;t.level=e.level===void 0?r:e.level},r4=class{constructor(e){return qse(e)}},qse=t=>{let e={};return lKe(e,t),e.template=(...r)=>Yse(e.template,...r),Object.setPrototypeOf(e,ak.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error(\"`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.\")},e.template.Instance=r4,e.template};function ak(t){return qse(t)}for(let[t,e]of Object.entries(mB))QE[t]={get(){let r=lk(this,n4(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};QE.visible={get(){let t=lk(this,this._styler,!0);return Object.defineProperty(this,\"visible\",{value:t}),t}};var Wse=[\"rgb\",\"hex\",\"keyword\",\"hsl\",\"hsv\",\"hwb\",\"ansi\",\"ansi256\"];for(let t of Wse)QE[t]={get(){let{level:e}=this;return function(...r){let s=n4(mB.color[Gse[e]][t](...r),mB.color.close,this._styler);return lk(this,s,this._isEmpty)}}};for(let t of Wse){let e=\"bg\"+t[0].toUpperCase()+t.slice(1);QE[e]={get(){let{level:r}=this;return function(...s){let a=n4(mB.bgColor[Gse[r]][t](...s),mB.bgColor.close,this._styler);return lk(this,a,this._isEmpty)}}}}var cKe=Object.defineProperties(()=>{},{...QE,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),n4=(t,e,r)=>{let s,a;return r===void 0?(s=t,a=e):(s=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:s,closeAll:a,parent:r}},lk=(t,e,r)=>{let s=(...a)=>ok(a[0])&&ok(a[0].raw)?jse(s,Yse(s,...a)):jse(s,a.length===1?\"\"+a[0]:a.join(\" \"));return Object.setPrototypeOf(s,cKe),s._generator=t,s._styler=e,s._isEmpty=r,s},jse=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?\"\":e;let r=t._styler;if(r===void 0)return e;let{openAll:s,closeAll:a}=r;if(e.indexOf(\"\\x1B\")!==-1)for(;r!==void 0;)e=oKe(e,r.close,r.open),r=r.parent;let n=e.indexOf(`\n`);return n!==-1&&(e=aKe(e,a,s,n)),s+e+a},$_,Yse=(t,...e)=>{let[r]=e;if(!ok(r)||!ok(r.raw))return e.join(\" \");let s=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(s[n-1]).replace(/[{}\\\\]/g,\"\\\\$&\"),String(r.raw[n]));return $_===void 0&&($_=Hse()),$_(t,a.join(\"\"))};Object.defineProperties(ak.prototype,QE);var ck=ak();ck.supportsColor=e4;ck.stderr=ak({level:t4?t4.level:0});ck.stderr.supportsColor=t4;Vse.exports=ck});var uk=_(Dc=>{\"use strict\";Dc.isInteger=t=>typeof t==\"number\"?Number.isInteger(t):typeof t==\"string\"&&t.trim()!==\"\"?Number.isInteger(Number(t)):!1;Dc.find=(t,e)=>t.nodes.find(r=>r.type===e);Dc.exceedsLimit=(t,e,r=1,s)=>s===!1||!Dc.isInteger(t)||!Dc.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=s;Dc.escapeNode=(t,e=0,r)=>{let s=t.nodes[e];s&&(r&&s.type===r||s.type===\"open\"||s.type===\"close\")&&s.escaped!==!0&&(s.value=\"\\\\\"+s.value,s.escaped=!0)};Dc.encloseBrace=t=>t.type!==\"brace\"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Dc.isInvalidBrace=t=>t.type!==\"brace\"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Dc.isOpenOrClose=t=>t.type===\"open\"||t.type===\"close\"?!0:t.open===!0||t.close===!0;Dc.reduce=t=>t.reduce((e,r)=>(r.type===\"text\"&&e.push(r.value),r.type===\"range\"&&(r.type=\"text\"),e),[]);Dc.flatten=(...t)=>{let e=[],r=s=>{for(let a=0;a<s.length;a++){let n=s[a];Array.isArray(n)?r(n,e):n!==void 0&&e.push(n)}return e};return r(t),e}});var fk=_((JTt,Kse)=>{\"use strict\";var Jse=uk();Kse.exports=(t,e={})=>{let r=(s,a={})=>{let n=e.escapeInvalid&&Jse.isInvalidBrace(a),c=s.invalid===!0&&e.escapeInvalid===!0,f=\"\";if(s.value)return(n||c)&&Jse.isOpenOrClose(s)?\"\\\\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let p of s.nodes)f+=r(p);return f};return r(t)}});var Zse=_((KTt,zse)=>{\"use strict\";zse.exports=function(t){return typeof t==\"number\"?t-t===0:typeof t==\"string\"&&t.trim()!==\"\"?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var ooe=_((zTt,soe)=>{\"use strict\";var Xse=Zse(),Gd=(t,e,r)=>{if(Xse(t)===!1)throw new TypeError(\"toRegexRange: expected the first argument to be a number\");if(e===void 0||t===e)return String(t);if(Xse(e)===!1)throw new TypeError(\"toRegexRange: expected the second argument to be a number.\");let s={relaxZeros:!0,...r};typeof s.strictZeros==\"boolean\"&&(s.relaxZeros=s.strictZeros===!1);let a=String(s.relaxZeros),n=String(s.shorthand),c=String(s.capture),f=String(s.wrap),p=t+\":\"+e+\"=\"+a+n+c+f;if(Gd.cache.hasOwnProperty(p))return Gd.cache[p].result;let h=Math.min(t,e),E=Math.max(t,e);if(Math.abs(h-E)===1){let T=t+\"|\"+e;return s.capture?`(${T})`:s.wrap===!1?T:`(?:${T})`}let C=ioe(t)||ioe(e),S={min:t,max:e,a:h,b:E},b=[],I=[];if(C&&(S.isPadded=C,S.maxLen=String(S.max).length),h<0){let T=E<0?Math.abs(E):1;I=$se(T,Math.abs(h),S,s),h=S.a=0}return E>=0&&(b=$se(h,E,S,s)),S.negatives=I,S.positives=b,S.result=uKe(I,b,s),s.capture===!0?S.result=`(${S.result})`:s.wrap!==!1&&b.length+I.length>1&&(S.result=`(?:${S.result})`),Gd.cache[p]=S,S.result};function uKe(t,e,r){let s=i4(t,e,\"-\",!1,r)||[],a=i4(e,t,\"\",!1,r)||[],n=i4(t,e,\"-?\",!0,r)||[];return s.concat(n).concat(a).join(\"|\")}function fKe(t,e){let r=1,s=1,a=toe(t,r),n=new Set([e]);for(;t<=a&&a<=e;)n.add(a),r+=1,a=toe(t,r);for(a=roe(e+1,s)-1;t<a&&a<=e;)n.add(a),s+=1,a=roe(e+1,s)-1;return n=[...n],n.sort(hKe),n}function AKe(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let s=pKe(t,e),a=s.length,n=\"\",c=0;for(let f=0;f<a;f++){let[p,h]=s[f];p===h?n+=p:p!==\"0\"||h!==\"9\"?n+=gKe(p,h,r):c++}return c&&(n+=r.shorthand===!0?\"\\\\d\":\"[0-9]\"),{pattern:n,count:[c],digits:a}}function $se(t,e,r,s){let a=fKe(t,e),n=[],c=t,f;for(let p=0;p<a.length;p++){let h=a[p],E=AKe(String(c),String(h),s),C=\"\";if(!r.isPadded&&f&&f.pattern===E.pattern){f.count.length>1&&f.count.pop(),f.count.push(E.count[0]),f.string=f.pattern+noe(f.count),c=h+1;continue}r.isPadded&&(C=dKe(h,r,s)),E.string=C+E.pattern+noe(E.count),n.push(E),c=h+1,f=E}return n}function i4(t,e,r,s,a){let n=[];for(let c of t){let{string:f}=c;!s&&!eoe(e,\"string\",f)&&n.push(r+f),s&&eoe(e,\"string\",f)&&n.push(r+f)}return n}function pKe(t,e){let r=[];for(let s=0;s<t.length;s++)r.push([t[s],e[s]]);return r}function hKe(t,e){return t>e?1:e>t?-1:0}function eoe(t,e,r){return t.some(s=>s[e]===r)}function toe(t,e){return Number(String(t).slice(0,-e)+\"9\".repeat(e))}function roe(t,e){return t-t%Math.pow(10,e)}function noe(t){let[e=0,r=\"\"]=t;return r||e>1?`{${e+(r?\",\"+r:\"\")}}`:\"\"}function gKe(t,e,r){return`[${t}${e-t===1?\"\":\"-\"}${e}]`}function ioe(t){return/^-?(0+)\\d/.test(t)}function dKe(t,e,r){if(!e.isPadded)return t;let s=Math.abs(e.maxLen-String(t).length),a=r.relaxZeros!==!1;switch(s){case 0:return\"\";case 1:return a?\"0?\":\"0\";case 2:return a?\"0{0,2}\":\"00\";default:return a?`0{0,${s}}`:`0{${s}}`}}Gd.cache={};Gd.clearCache=()=>Gd.cache={};soe.exports=Gd});var a4=_((ZTt,hoe)=>{\"use strict\";var mKe=Ie(\"util\"),coe=ooe(),aoe=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t),yKe=t=>e=>t===!0?Number(e):String(e),s4=t=>typeof t==\"number\"||typeof t==\"string\"&&t!==\"\",yB=t=>Number.isInteger(+t),o4=t=>{let e=`${t}`,r=-1;if(e[0]===\"-\"&&(e=e.slice(1)),e===\"0\")return!1;for(;e[++r]===\"0\";);return r>0},EKe=(t,e,r)=>typeof t==\"string\"||typeof e==\"string\"?!0:r.stringify===!0,IKe=(t,e,r)=>{if(e>0){let s=t[0]===\"-\"?\"-\":\"\";s&&(t=t.slice(1)),t=s+t.padStart(s?e-1:e,\"0\")}return r===!1?String(t):t},loe=(t,e)=>{let r=t[0]===\"-\"?\"-\":\"\";for(r&&(t=t.slice(1),e--);t.length<e;)t=\"0\"+t;return r?\"-\"+t:t},CKe=(t,e)=>{t.negatives.sort((c,f)=>c<f?-1:c>f?1:0),t.positives.sort((c,f)=>c<f?-1:c>f?1:0);let r=e.capture?\"\":\"?:\",s=\"\",a=\"\",n;return t.positives.length&&(s=t.positives.join(\"|\")),t.negatives.length&&(a=`-(${r}${t.negatives.join(\"|\")})`),s&&a?n=`${s}|${a}`:n=s||a,e.wrap?`(${r}${n})`:n},uoe=(t,e,r,s)=>{if(r)return coe(t,e,{wrap:!1,...s});let a=String.fromCharCode(t);if(t===e)return a;let n=String.fromCharCode(e);return`[${a}-${n}]`},foe=(t,e,r)=>{if(Array.isArray(t)){let s=r.wrap===!0,a=r.capture?\"\":\"?:\";return s?`(${a}${t.join(\"|\")})`:t.join(\"|\")}return coe(t,e,r)},Aoe=(...t)=>new RangeError(\"Invalid range arguments: \"+mKe.inspect(...t)),poe=(t,e,r)=>{if(r.strictRanges===!0)throw Aoe([t,e]);return[]},wKe=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step \"${t}\" to be a number`);return[]},BKe=(t,e,r=1,s={})=>{let a=Number(t),n=Number(e);if(!Number.isInteger(a)||!Number.isInteger(n)){if(s.strictRanges===!0)throw Aoe([t,e]);return[]}a===0&&(a=0),n===0&&(n=0);let c=a>n,f=String(t),p=String(e),h=String(r);r=Math.max(Math.abs(r),1);let E=o4(f)||o4(p)||o4(h),C=E?Math.max(f.length,p.length,h.length):0,S=E===!1&&EKe(t,e,s)===!1,b=s.transform||yKe(S);if(s.toRegex&&r===1)return uoe(loe(t,C),loe(e,C),!0,s);let I={negatives:[],positives:[]},T=W=>I[W<0?\"negatives\":\"positives\"].push(Math.abs(W)),N=[],U=0;for(;c?a>=n:a<=n;)s.toRegex===!0&&r>1?T(a):N.push(IKe(b(a,U),C,S)),a=c?a-r:a+r,U++;return s.toRegex===!0?r>1?CKe(I,s):foe(N,null,{wrap:!1,...s}):N},vKe=(t,e,r=1,s={})=>{if(!yB(t)&&t.length>1||!yB(e)&&e.length>1)return poe(t,e,s);let a=s.transform||(S=>String.fromCharCode(S)),n=`${t}`.charCodeAt(0),c=`${e}`.charCodeAt(0),f=n>c,p=Math.min(n,c),h=Math.max(n,c);if(s.toRegex&&r===1)return uoe(p,h,!1,s);let E=[],C=0;for(;f?n>=c:n<=c;)E.push(a(n,C)),n=f?n-r:n+r,C++;return s.toRegex===!0?foe(E,null,{wrap:!1,options:s}):E},Ak=(t,e,r,s={})=>{if(e==null&&s4(t))return[t];if(!s4(t)||!s4(e))return poe(t,e,s);if(typeof r==\"function\")return Ak(t,e,1,{transform:r});if(aoe(r))return Ak(t,e,0,r);let a={...s};return a.capture===!0&&(a.wrap=!0),r=r||a.step||1,yB(r)?yB(t)&&yB(e)?BKe(t,e,r,a):vKe(t,e,Math.max(Math.abs(r),1),a):r!=null&&!aoe(r)?wKe(r,a):Ak(t,e,1,r)};hoe.exports=Ak});var moe=_((XTt,doe)=>{\"use strict\";var SKe=a4(),goe=uk(),DKe=(t,e={})=>{let r=(s,a={})=>{let n=goe.isInvalidBrace(a),c=s.invalid===!0&&e.escapeInvalid===!0,f=n===!0||c===!0,p=e.escapeInvalid===!0?\"\\\\\":\"\",h=\"\";if(s.isOpen===!0||s.isClose===!0)return p+s.value;if(s.type===\"open\")return f?p+s.value:\"(\";if(s.type===\"close\")return f?p+s.value:\")\";if(s.type===\"comma\")return s.prev.type===\"comma\"?\"\":f?s.value:\"|\";if(s.value)return s.value;if(s.nodes&&s.ranges>0){let E=goe.reduce(s.nodes),C=SKe(...E,{...e,wrap:!1,toRegex:!0});if(C.length!==0)return E.length>1&&C.length>1?`(${C})`:C}if(s.nodes)for(let E of s.nodes)h+=r(E,s);return h};return r(t)};doe.exports=DKe});var Ioe=_(($Tt,Eoe)=>{\"use strict\";var PKe=a4(),yoe=fk(),TE=uk(),qd=(t=\"\",e=\"\",r=!1)=>{let s=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?TE.flatten(e).map(a=>`{${a}}`):e;for(let a of t)if(Array.isArray(a))for(let n of a)s.push(qd(n,e,r));else for(let n of e)r===!0&&typeof n==\"string\"&&(n=`{${n}}`),s.push(Array.isArray(n)?qd(a,n,r):a+n);return TE.flatten(s)},bKe=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,s=(a,n={})=>{a.queue=[];let c=n,f=n.queue;for(;c.type!==\"brace\"&&c.type!==\"root\"&&c.parent;)c=c.parent,f=c.queue;if(a.invalid||a.dollar){f.push(qd(f.pop(),yoe(a,e)));return}if(a.type===\"brace\"&&a.invalid!==!0&&a.nodes.length===2){f.push(qd(f.pop(),[\"{}\"]));return}if(a.nodes&&a.ranges>0){let C=TE.reduce(a.nodes);if(TE.exceedsLimit(...C,e.step,r))throw new RangeError(\"expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.\");let S=PKe(...C,e);S.length===0&&(S=yoe(a,e)),f.push(qd(f.pop(),S)),a.nodes=[];return}let p=TE.encloseBrace(a),h=a.queue,E=a;for(;E.type!==\"brace\"&&E.type!==\"root\"&&E.parent;)E=E.parent,h=E.queue;for(let C=0;C<a.nodes.length;C++){let S=a.nodes[C];if(S.type===\"comma\"&&a.type===\"brace\"){C===1&&h.push(\"\"),h.push(\"\");continue}if(S.type===\"close\"){f.push(qd(f.pop(),h,p));continue}if(S.value&&S.type!==\"open\"){h.push(qd(h.pop(),S.value));continue}S.nodes&&s(S,a)}return h};return TE.flatten(s(t))};Eoe.exports=bKe});var woe=_((eFt,Coe)=>{\"use strict\";Coe.exports={MAX_LENGTH:1024*64,CHAR_0:\"0\",CHAR_9:\"9\",CHAR_UPPERCASE_A:\"A\",CHAR_LOWERCASE_A:\"a\",CHAR_UPPERCASE_Z:\"Z\",CHAR_LOWERCASE_Z:\"z\",CHAR_LEFT_PARENTHESES:\"(\",CHAR_RIGHT_PARENTHESES:\")\",CHAR_ASTERISK:\"*\",CHAR_AMPERSAND:\"&\",CHAR_AT:\"@\",CHAR_BACKSLASH:\"\\\\\",CHAR_BACKTICK:\"`\",CHAR_CARRIAGE_RETURN:\"\\r\",CHAR_CIRCUMFLEX_ACCENT:\"^\",CHAR_COLON:\":\",CHAR_COMMA:\",\",CHAR_DOLLAR:\"$\",CHAR_DOT:\".\",CHAR_DOUBLE_QUOTE:'\"',CHAR_EQUAL:\"=\",CHAR_EXCLAMATION_MARK:\"!\",CHAR_FORM_FEED:\"\\f\",CHAR_FORWARD_SLASH:\"/\",CHAR_HASH:\"#\",CHAR_HYPHEN_MINUS:\"-\",CHAR_LEFT_ANGLE_BRACKET:\"<\",CHAR_LEFT_CURLY_BRACE:\"{\",CHAR_LEFT_SQUARE_BRACKET:\"[\",CHAR_LINE_FEED:`\n`,CHAR_NO_BREAK_SPACE:\"\\xA0\",CHAR_PERCENT:\"%\",CHAR_PLUS:\"+\",CHAR_QUESTION_MARK:\"?\",CHAR_RIGHT_ANGLE_BRACKET:\">\",CHAR_RIGHT_CURLY_BRACE:\"}\",CHAR_RIGHT_SQUARE_BRACKET:\"]\",CHAR_SEMICOLON:\";\",CHAR_SINGLE_QUOTE:\"'\",CHAR_SPACE:\" \",CHAR_TAB:\"\t\",CHAR_UNDERSCORE:\"_\",CHAR_VERTICAL_LINE:\"|\",CHAR_ZERO_WIDTH_NOBREAK_SPACE:\"\\uFEFF\"}});var Poe=_((tFt,Doe)=>{\"use strict\";var xKe=fk(),{MAX_LENGTH:Boe,CHAR_BACKSLASH:l4,CHAR_BACKTICK:kKe,CHAR_COMMA:QKe,CHAR_DOT:RKe,CHAR_LEFT_PARENTHESES:TKe,CHAR_RIGHT_PARENTHESES:FKe,CHAR_LEFT_CURLY_BRACE:NKe,CHAR_RIGHT_CURLY_BRACE:OKe,CHAR_LEFT_SQUARE_BRACKET:voe,CHAR_RIGHT_SQUARE_BRACKET:Soe,CHAR_DOUBLE_QUOTE:LKe,CHAR_SINGLE_QUOTE:MKe,CHAR_NO_BREAK_SPACE:UKe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_Ke}=woe(),HKe=(t,e={})=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");let r=e||{},s=typeof r.maxLength==\"number\"?Math.min(Boe,r.maxLength):Boe;if(t.length>s)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${s})`);let a={type:\"root\",input:t,nodes:[]},n=[a],c=a,f=a,p=0,h=t.length,E=0,C=0,S,b={},I=()=>t[E++],T=N=>{if(N.type===\"text\"&&f.type===\"dot\"&&(f.type=\"text\"),f&&f.type===\"text\"&&N.type===\"text\"){f.value+=N.value;return}return c.nodes.push(N),N.parent=c,N.prev=f,f=N,N};for(T({type:\"bos\"});E<h;)if(c=n[n.length-1],S=I(),!(S===_Ke||S===UKe)){if(S===l4){T({type:\"text\",value:(e.keepEscaping?S:\"\")+I()});continue}if(S===Soe){T({type:\"text\",value:\"\\\\\"+S});continue}if(S===voe){p++;let N=!0,U;for(;E<h&&(U=I());){if(S+=U,U===voe){p++;continue}if(U===l4){S+=I();continue}if(U===Soe&&(p--,p===0))break}T({type:\"text\",value:S});continue}if(S===TKe){c=T({type:\"paren\",nodes:[]}),n.push(c),T({type:\"text\",value:S});continue}if(S===FKe){if(c.type!==\"paren\"){T({type:\"text\",value:S});continue}c=n.pop(),T({type:\"text\",value:S}),c=n[n.length-1];continue}if(S===LKe||S===MKe||S===kKe){let N=S,U;for(e.keepQuotes!==!0&&(S=\"\");E<h&&(U=I());){if(U===l4){S+=U+I();continue}if(U===N){e.keepQuotes===!0&&(S+=U);break}S+=U}T({type:\"text\",value:S});continue}if(S===NKe){C++;let U={type:\"brace\",open:!0,close:!1,dollar:f.value&&f.value.slice(-1)===\"$\"||c.dollar===!0,depth:C,commas:0,ranges:0,nodes:[]};c=T(U),n.push(c),T({type:\"open\",value:S});continue}if(S===OKe){if(c.type!==\"brace\"){T({type:\"text\",value:S});continue}let N=\"close\";c=n.pop(),c.close=!0,T({type:N,value:S}),C--,c=n[n.length-1];continue}if(S===QKe&&C>0){if(c.ranges>0){c.ranges=0;let N=c.nodes.shift();c.nodes=[N,{type:\"text\",value:xKe(c)}]}T({type:\"comma\",value:S}),c.commas++;continue}if(S===RKe&&C>0&&c.commas===0){let N=c.nodes;if(C===0||N.length===0){T({type:\"text\",value:S});continue}if(f.type===\"dot\"){if(c.range=[],f.value+=S,f.type=\"range\",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,f.type=\"text\";continue}c.ranges++,c.args=[];continue}if(f.type===\"range\"){N.pop();let U=N[N.length-1];U.value+=f.value+S,f=U,c.ranges--;continue}T({type:\"dot\",value:S});continue}T({type:\"text\",value:S})}do if(c=n.pop(),c.type!==\"root\"){c.nodes.forEach(W=>{W.nodes||(W.type===\"open\"&&(W.isOpen=!0),W.type===\"close\"&&(W.isClose=!0),W.nodes||(W.type=\"text\"),W.invalid=!0)});let N=n[n.length-1],U=N.nodes.indexOf(c);N.nodes.splice(U,1,...c.nodes)}while(n.length>0);return T({type:\"eos\"}),a};Doe.exports=HKe});var koe=_((rFt,xoe)=>{\"use strict\";var boe=fk(),jKe=moe(),GKe=Ioe(),qKe=Poe(),jl=(t,e={})=>{let r=[];if(Array.isArray(t))for(let s of t){let a=jl.create(s,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(jl.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};jl.parse=(t,e={})=>qKe(t,e);jl.stringify=(t,e={})=>boe(typeof t==\"string\"?jl.parse(t,e):t,e);jl.compile=(t,e={})=>(typeof t==\"string\"&&(t=jl.parse(t,e)),jKe(t,e));jl.expand=(t,e={})=>{typeof t==\"string\"&&(t=jl.parse(t,e));let r=GKe(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};jl.create=(t,e={})=>t===\"\"||t.length<3?[t]:e.expand!==!0?jl.compile(t,e):jl.expand(t,e);xoe.exports=jl});var EB=_((nFt,Noe)=>{\"use strict\";var WKe=Ie(\"path\"),Vf=\"\\\\\\\\/\",Qoe=`[^${Vf}]`,Dp=\"\\\\.\",YKe=\"\\\\+\",VKe=\"\\\\?\",pk=\"\\\\/\",JKe=\"(?=.)\",Roe=\"[^/]\",c4=`(?:${pk}|$)`,Toe=`(?:^|${pk})`,u4=`${Dp}{1,2}${c4}`,KKe=`(?!${Dp})`,zKe=`(?!${Toe}${u4})`,ZKe=`(?!${Dp}{0,1}${c4})`,XKe=`(?!${u4})`,$Ke=`[^.${pk}]`,eze=`${Roe}*?`,Foe={DOT_LITERAL:Dp,PLUS_LITERAL:YKe,QMARK_LITERAL:VKe,SLASH_LITERAL:pk,ONE_CHAR:JKe,QMARK:Roe,END_ANCHOR:c4,DOTS_SLASH:u4,NO_DOT:KKe,NO_DOTS:zKe,NO_DOT_SLASH:ZKe,NO_DOTS_SLASH:XKe,QMARK_NO_DOT:$Ke,STAR:eze,START_ANCHOR:Toe},tze={...Foe,SLASH_LITERAL:`[${Vf}]`,QMARK:Qoe,STAR:`${Qoe}*?`,DOTS_SLASH:`${Dp}{1,2}(?:[${Vf}]|$)`,NO_DOT:`(?!${Dp})`,NO_DOTS:`(?!(?:^|[${Vf}])${Dp}{1,2}(?:[${Vf}]|$))`,NO_DOT_SLASH:`(?!${Dp}{0,1}(?:[${Vf}]|$))`,NO_DOTS_SLASH:`(?!${Dp}{1,2}(?:[${Vf}]|$))`,QMARK_NO_DOT:`[^.${Vf}]`,START_ANCHOR:`(?:^|[${Vf}])`,END_ANCHOR:`(?:[${Vf}]|$)`},rze={alnum:\"a-zA-Z0-9\",alpha:\"a-zA-Z\",ascii:\"\\\\x00-\\\\x7F\",blank:\" \\\\t\",cntrl:\"\\\\x00-\\\\x1F\\\\x7F\",digit:\"0-9\",graph:\"\\\\x21-\\\\x7E\",lower:\"a-z\",print:\"\\\\x20-\\\\x7E \",punct:\"\\\\-!\\\"#$%&'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~\",space:\" \\\\t\\\\r\\\\n\\\\v\\\\f\",upper:\"A-Z\",word:\"A-Za-z0-9_\",xdigit:\"A-Fa-f0-9\"};Noe.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:rze,REGEX_BACKSLASH:/\\\\(?![*+?^${}(|)[\\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\\].,$*+?^{}()|\\\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\\\?)((\\W)(\\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,REPLACEMENTS:{\"***\":\"*\",\"**/**\":\"**\",\"**/**/**\":\"**\"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:WKe.sep,extglobChars(t){return{\"!\":{type:\"negate\",open:\"(?:(?!(?:\",close:`))${t.STAR})`},\"?\":{type:\"qmark\",open:\"(?:\",close:\")?\"},\"+\":{type:\"plus\",open:\"(?:\",close:\")+\"},\"*\":{type:\"star\",open:\"(?:\",close:\")*\"},\"@\":{type:\"at\",open:\"(?:\",close:\")\"}}},globChars(t){return t===!0?tze:Foe}}});var IB=_(ol=>{\"use strict\";var nze=Ie(\"path\"),ize=process.platform===\"win32\",{REGEX_BACKSLASH:sze,REGEX_REMOVE_BACKSLASH:oze,REGEX_SPECIAL_CHARS:aze,REGEX_SPECIAL_CHARS_GLOBAL:lze}=EB();ol.isObject=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t);ol.hasRegexChars=t=>aze.test(t);ol.isRegexChar=t=>t.length===1&&ol.hasRegexChars(t);ol.escapeRegex=t=>t.replace(lze,\"\\\\$1\");ol.toPosixSlashes=t=>t.replace(sze,\"/\");ol.removeBackslashes=t=>t.replace(oze,e=>e===\"\\\\\"?\"\":e);ol.supportsLookbehinds=()=>{let t=process.version.slice(1).split(\".\").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};ol.isWindows=t=>t&&typeof t.windows==\"boolean\"?t.windows:ize===!0||nze.sep===\"\\\\\";ol.escapeLast=(t,e,r)=>{let s=t.lastIndexOf(e,r);return s===-1?t:t[s-1]===\"\\\\\"?ol.escapeLast(t,e,s-1):`${t.slice(0,s)}\\\\${t.slice(s)}`};ol.removePrefix=(t,e={})=>{let r=t;return r.startsWith(\"./\")&&(r=r.slice(2),e.prefix=\"./\"),r};ol.wrapOutput=(t,e={},r={})=>{let s=r.contains?\"\":\"^\",a=r.contains?\"\":\"$\",n=`${s}(?:${t})${a}`;return e.negated===!0&&(n=`(?:^(?!${n}).*$)`),n}});var Goe=_((sFt,joe)=>{\"use strict\";var Ooe=IB(),{CHAR_ASTERISK:f4,CHAR_AT:cze,CHAR_BACKWARD_SLASH:CB,CHAR_COMMA:uze,CHAR_DOT:A4,CHAR_EXCLAMATION_MARK:p4,CHAR_FORWARD_SLASH:Hoe,CHAR_LEFT_CURLY_BRACE:h4,CHAR_LEFT_PARENTHESES:g4,CHAR_LEFT_SQUARE_BRACKET:fze,CHAR_PLUS:Aze,CHAR_QUESTION_MARK:Loe,CHAR_RIGHT_CURLY_BRACE:pze,CHAR_RIGHT_PARENTHESES:Moe,CHAR_RIGHT_SQUARE_BRACKET:hze}=EB(),Uoe=t=>t===Hoe||t===CB,_oe=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},gze=(t,e)=>{let r=e||{},s=t.length-1,a=r.parts===!0||r.scanToEnd===!0,n=[],c=[],f=[],p=t,h=-1,E=0,C=0,S=!1,b=!1,I=!1,T=!1,N=!1,U=!1,W=!1,ee=!1,ie=!1,ue=!1,le=0,me,pe,Be={value:\"\",depth:0,isGlob:!1},Ce=()=>h>=s,g=()=>p.charCodeAt(h+1),we=()=>(me=pe,p.charCodeAt(++h));for(;h<s;){pe=we();let De;if(pe===CB){W=Be.backslashes=!0,pe=we(),pe===h4&&(U=!0);continue}if(U===!0||pe===h4){for(le++;Ce()!==!0&&(pe=we());){if(pe===CB){W=Be.backslashes=!0,we();continue}if(pe===h4){le++;continue}if(U!==!0&&pe===A4&&(pe=we())===A4){if(S=Be.isBrace=!0,I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(U!==!0&&pe===uze){if(S=Be.isBrace=!0,I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(pe===pze&&(le--,le===0)){U=!1,S=Be.isBrace=!0,ue=!0;break}}if(a===!0)continue;break}if(pe===Hoe){if(n.push(h),c.push(Be),Be={value:\"\",depth:0,isGlob:!1},ue===!0)continue;if(me===A4&&h===E+1){E+=2;continue}C=h+1;continue}if(r.noext!==!0&&(pe===Aze||pe===cze||pe===f4||pe===Loe||pe===p4)===!0&&g()===g4){if(I=Be.isGlob=!0,T=Be.isExtglob=!0,ue=!0,pe===p4&&h===E&&(ie=!0),a===!0){for(;Ce()!==!0&&(pe=we());){if(pe===CB){W=Be.backslashes=!0,pe=we();continue}if(pe===Moe){I=Be.isGlob=!0,ue=!0;break}}continue}break}if(pe===f4){if(me===f4&&(N=Be.isGlobstar=!0),I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(pe===Loe){if(I=Be.isGlob=!0,ue=!0,a===!0)continue;break}if(pe===fze){for(;Ce()!==!0&&(De=we());){if(De===CB){W=Be.backslashes=!0,we();continue}if(De===hze){b=Be.isBracket=!0,I=Be.isGlob=!0,ue=!0;break}}if(a===!0)continue;break}if(r.nonegate!==!0&&pe===p4&&h===E){ee=Be.negated=!0,E++;continue}if(r.noparen!==!0&&pe===g4){if(I=Be.isGlob=!0,a===!0){for(;Ce()!==!0&&(pe=we());){if(pe===g4){W=Be.backslashes=!0,pe=we();continue}if(pe===Moe){ue=!0;break}}continue}break}if(I===!0){if(ue=!0,a===!0)continue;break}}r.noext===!0&&(T=!1,I=!1);let ye=p,Ae=\"\",se=\"\";E>0&&(Ae=p.slice(0,E),p=p.slice(E),C-=E),ye&&I===!0&&C>0?(ye=p.slice(0,C),se=p.slice(C)):I===!0?(ye=\"\",se=p):ye=p,ye&&ye!==\"\"&&ye!==\"/\"&&ye!==p&&Uoe(ye.charCodeAt(ye.length-1))&&(ye=ye.slice(0,-1)),r.unescape===!0&&(se&&(se=Ooe.removeBackslashes(se)),ye&&W===!0&&(ye=Ooe.removeBackslashes(ye)));let X={prefix:Ae,input:t,start:E,base:ye,glob:se,isBrace:S,isBracket:b,isGlob:I,isExtglob:T,isGlobstar:N,negated:ee,negatedExtglob:ie};if(r.tokens===!0&&(X.maxDepth=0,Uoe(pe)||c.push(Be),X.tokens=c),r.parts===!0||r.tokens===!0){let De;for(let Te=0;Te<n.length;Te++){let mt=De?De+1:E,j=n[Te],rt=t.slice(mt,j);r.tokens&&(Te===0&&E!==0?(c[Te].isPrefix=!0,c[Te].value=Ae):c[Te].value=rt,_oe(c[Te]),X.maxDepth+=c[Te].depth),(Te!==0||rt!==\"\")&&f.push(rt),De=j}if(De&&De+1<t.length){let Te=t.slice(De+1);f.push(Te),r.tokens&&(c[c.length-1].value=Te,_oe(c[c.length-1]),X.maxDepth+=c[c.length-1].depth)}X.slashes=n,X.parts=f}return X};joe.exports=gze});var Yoe=_((oFt,Woe)=>{\"use strict\";var hk=EB(),Gl=IB(),{MAX_LENGTH:gk,POSIX_REGEX_SOURCE:dze,REGEX_NON_SPECIAL_CHARS:mze,REGEX_SPECIAL_CHARS_BACKREF:yze,REPLACEMENTS:qoe}=hk,Eze=(t,e)=>{if(typeof e.expandRange==\"function\")return e.expandRange(...t,e);t.sort();let r=`[${t.join(\"-\")}]`;try{new RegExp(r)}catch{return t.map(a=>Gl.escapeRegex(a)).join(\"..\")}return r},FE=(t,e)=>`Missing ${t}: \"${e}\" - use \"\\\\\\\\${e}\" to match literal characters`,d4=(t,e)=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");t=qoe[t]||t;let r={...e},s=typeof r.maxLength==\"number\"?Math.min(gk,r.maxLength):gk,a=t.length;if(a>s)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);let n={type:\"bos\",value:\"\",output:r.prepend||\"\"},c=[n],f=r.capture?\"\":\"?:\",p=Gl.isWindows(e),h=hk.globChars(p),E=hk.extglobChars(h),{DOT_LITERAL:C,PLUS_LITERAL:S,SLASH_LITERAL:b,ONE_CHAR:I,DOTS_SLASH:T,NO_DOT:N,NO_DOT_SLASH:U,NO_DOTS_SLASH:W,QMARK:ee,QMARK_NO_DOT:ie,STAR:ue,START_ANCHOR:le}=h,me=x=>`(${f}(?:(?!${le}${x.dot?T:C}).)*?)`,pe=r.dot?\"\":N,Be=r.dot?ee:ie,Ce=r.bash===!0?me(r):ue;r.capture&&(Ce=`(${Ce})`),typeof r.noext==\"boolean\"&&(r.noextglob=r.noext);let g={input:t,index:-1,start:0,dot:r.dot===!0,consumed:\"\",output:\"\",prefix:\"\",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=Gl.removePrefix(t,g),a=t.length;let we=[],ye=[],Ae=[],se=n,X,De=()=>g.index===a-1,Te=g.peek=(x=1)=>t[g.index+x],mt=g.advance=()=>t[++g.index]||\"\",j=()=>t.slice(g.index+1),rt=(x=\"\",w=0)=>{g.consumed+=x,g.index+=w},Fe=x=>{g.output+=x.output!=null?x.output:x.value,rt(x.value)},Ne=()=>{let x=1;for(;Te()===\"!\"&&(Te(2)!==\"(\"||Te(3)===\"?\");)mt(),g.start++,x++;return x%2===0?!1:(g.negated=!0,g.start++,!0)},be=x=>{g[x]++,Ae.push(x)},Ve=x=>{g[x]--,Ae.pop()},ke=x=>{if(se.type===\"globstar\"){let w=g.braces>0&&(x.type===\"comma\"||x.type===\"brace\"),P=x.extglob===!0||we.length&&(x.type===\"pipe\"||x.type===\"paren\");x.type!==\"slash\"&&x.type!==\"paren\"&&!w&&!P&&(g.output=g.output.slice(0,-se.output.length),se.type=\"star\",se.value=\"*\",se.output=Ce,g.output+=se.output)}if(we.length&&x.type!==\"paren\"&&(we[we.length-1].inner+=x.value),(x.value||x.output)&&Fe(x),se&&se.type===\"text\"&&x.type===\"text\"){se.value+=x.value,se.output=(se.output||\"\")+x.value;return}x.prev=se,c.push(x),se=x},it=(x,w)=>{let P={...E[w],conditions:1,inner:\"\"};P.prev=se,P.parens=g.parens,P.output=g.output;let y=(r.capture?\"(\":\"\")+P.open;be(\"parens\"),ke({type:x,value:w,output:g.output?\"\":I}),ke({type:\"paren\",extglob:!0,value:mt(),output:y}),we.push(P)},Ue=x=>{let w=x.close+(r.capture?\")\":\"\"),P;if(x.type===\"negate\"){let y=Ce;if(x.inner&&x.inner.length>1&&x.inner.includes(\"/\")&&(y=me(r)),(y!==Ce||De()||/^\\)+$/.test(j()))&&(w=x.close=`)$))${y}`),x.inner.includes(\"*\")&&(P=j())&&/^\\.[^\\\\/.]+$/.test(P)){let F=d4(P,{...e,fastpaths:!1}).output;w=x.close=`)${F})${y})`}x.prev.type===\"bos\"&&(g.negatedExtglob=!0)}ke({type:\"paren\",extglob:!0,value:X,output:w}),Ve(\"parens\")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\\]{}\"])/.test(t)){let x=!1,w=t.replace(yze,(P,y,F,z,Z,$)=>z===\"\\\\\"?(x=!0,P):z===\"?\"?y?y+z+(Z?ee.repeat(Z.length):\"\"):$===0?Be+(Z?ee.repeat(Z.length):\"\"):ee.repeat(F.length):z===\".\"?C.repeat(F.length):z===\"*\"?y?y+z+(Z?Ce:\"\"):Ce:y?P:`\\\\${P}`);return x===!0&&(r.unescape===!0?w=w.replace(/\\\\/g,\"\"):w=w.replace(/\\\\+/g,P=>P.length%2===0?\"\\\\\\\\\":P?\"\\\\\":\"\")),w===t&&r.contains===!0?(g.output=t,g):(g.output=Gl.wrapOutput(w,g,e),g)}for(;!De();){if(X=mt(),X===\"\\0\")continue;if(X===\"\\\\\"){let P=Te();if(P===\"/\"&&r.bash!==!0||P===\".\"||P===\";\")continue;if(!P){X+=\"\\\\\",ke({type:\"text\",value:X});continue}let y=/^\\\\+/.exec(j()),F=0;if(y&&y[0].length>2&&(F=y[0].length,g.index+=F,F%2!==0&&(X+=\"\\\\\")),r.unescape===!0?X=mt():X+=mt(),g.brackets===0){ke({type:\"text\",value:X});continue}}if(g.brackets>0&&(X!==\"]\"||se.value===\"[\"||se.value===\"[^\")){if(r.posix!==!1&&X===\":\"){let P=se.value.slice(1);if(P.includes(\"[\")&&(se.posix=!0,P.includes(\":\"))){let y=se.value.lastIndexOf(\"[\"),F=se.value.slice(0,y),z=se.value.slice(y+2),Z=dze[z];if(Z){se.value=F+Z,g.backtrack=!0,mt(),!n.output&&c.indexOf(se)===1&&(n.output=I);continue}}}(X===\"[\"&&Te()!==\":\"||X===\"-\"&&Te()===\"]\")&&(X=`\\\\${X}`),X===\"]\"&&(se.value===\"[\"||se.value===\"[^\")&&(X=`\\\\${X}`),r.posix===!0&&X===\"!\"&&se.value===\"[\"&&(X=\"^\"),se.value+=X,Fe({value:X});continue}if(g.quotes===1&&X!=='\"'){X=Gl.escapeRegex(X),se.value+=X,Fe({value:X});continue}if(X==='\"'){g.quotes=g.quotes===1?0:1,r.keepQuotes===!0&&ke({type:\"text\",value:X});continue}if(X===\"(\"){be(\"parens\"),ke({type:\"paren\",value:X});continue}if(X===\")\"){if(g.parens===0&&r.strictBrackets===!0)throw new SyntaxError(FE(\"opening\",\"(\"));let P=we[we.length-1];if(P&&g.parens===P.parens+1){Ue(we.pop());continue}ke({type:\"paren\",value:X,output:g.parens?\")\":\"\\\\)\"}),Ve(\"parens\");continue}if(X===\"[\"){if(r.nobracket===!0||!j().includes(\"]\")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\"]\"));X=`\\\\${X}`}else be(\"brackets\");ke({type:\"bracket\",value:X});continue}if(X===\"]\"){if(r.nobracket===!0||se&&se.type===\"bracket\"&&se.value.length===1){ke({type:\"text\",value:X,output:`\\\\${X}`});continue}if(g.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"opening\",\"[\"));ke({type:\"text\",value:X,output:`\\\\${X}`});continue}Ve(\"brackets\");let P=se.value.slice(1);if(se.posix!==!0&&P[0]===\"^\"&&!P.includes(\"/\")&&(X=`/${X}`),se.value+=X,Fe({value:X}),r.literalBrackets===!1||Gl.hasRegexChars(P))continue;let y=Gl.escapeRegex(se.value);if(g.output=g.output.slice(0,-se.value.length),r.literalBrackets===!0){g.output+=y,se.value=y;continue}se.value=`(${f}${y}|${se.value})`,g.output+=se.value;continue}if(X===\"{\"&&r.nobrace!==!0){be(\"braces\");let P={type:\"brace\",value:X,output:\"(\",outputIndex:g.output.length,tokensIndex:g.tokens.length};ye.push(P),ke(P);continue}if(X===\"}\"){let P=ye[ye.length-1];if(r.nobrace===!0||!P){ke({type:\"text\",value:X,output:X});continue}let y=\")\";if(P.dots===!0){let F=c.slice(),z=[];for(let Z=F.length-1;Z>=0&&(c.pop(),F[Z].type!==\"brace\");Z--)F[Z].type!==\"dots\"&&z.unshift(F[Z].value);y=Eze(z,r),g.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){let F=g.output.slice(0,P.outputIndex),z=g.tokens.slice(P.tokensIndex);P.value=P.output=\"\\\\{\",X=y=\"\\\\}\",g.output=F;for(let Z of z)g.output+=Z.output||Z.value}ke({type:\"brace\",value:X,output:y}),Ve(\"braces\"),ye.pop();continue}if(X===\"|\"){we.length>0&&we[we.length-1].conditions++,ke({type:\"text\",value:X});continue}if(X===\",\"){let P=X,y=ye[ye.length-1];y&&Ae[Ae.length-1]===\"braces\"&&(y.comma=!0,P=\"|\"),ke({type:\"comma\",value:X,output:P});continue}if(X===\"/\"){if(se.type===\"dot\"&&g.index===g.start+1){g.start=g.index+1,g.consumed=\"\",g.output=\"\",c.pop(),se=n;continue}ke({type:\"slash\",value:X,output:b});continue}if(X===\".\"){if(g.braces>0&&se.type===\"dot\"){se.value===\".\"&&(se.output=C);let P=ye[ye.length-1];se.type=\"dots\",se.output+=X,se.value+=X,P.dots=!0;continue}if(g.braces+g.parens===0&&se.type!==\"bos\"&&se.type!==\"slash\"){ke({type:\"text\",value:X,output:C});continue}ke({type:\"dot\",value:X,output:C});continue}if(X===\"?\"){if(!(se&&se.value===\"(\")&&r.noextglob!==!0&&Te()===\"(\"&&Te(2)!==\"?\"){it(\"qmark\",X);continue}if(se&&se.type===\"paren\"){let y=Te(),F=X;if(y===\"<\"&&!Gl.supportsLookbehinds())throw new Error(\"Node.js v10 or higher is required for regex lookbehinds\");(se.value===\"(\"&&!/[!=<:]/.test(y)||y===\"<\"&&!/<([!=]|\\w+>)/.test(j()))&&(F=`\\\\${X}`),ke({type:\"text\",value:X,output:F});continue}if(r.dot!==!0&&(se.type===\"slash\"||se.type===\"bos\")){ke({type:\"qmark\",value:X,output:ie});continue}ke({type:\"qmark\",value:X,output:ee});continue}if(X===\"!\"){if(r.noextglob!==!0&&Te()===\"(\"&&(Te(2)!==\"?\"||!/[!=<:]/.test(Te(3)))){it(\"negate\",X);continue}if(r.nonegate!==!0&&g.index===0){Ne();continue}}if(X===\"+\"){if(r.noextglob!==!0&&Te()===\"(\"&&Te(2)!==\"?\"){it(\"plus\",X);continue}if(se&&se.value===\"(\"||r.regex===!1){ke({type:\"plus\",value:X,output:S});continue}if(se&&(se.type===\"bracket\"||se.type===\"paren\"||se.type===\"brace\")||g.parens>0){ke({type:\"plus\",value:X});continue}ke({type:\"plus\",value:S});continue}if(X===\"@\"){if(r.noextglob!==!0&&Te()===\"(\"&&Te(2)!==\"?\"){ke({type:\"at\",extglob:!0,value:X,output:\"\"});continue}ke({type:\"text\",value:X});continue}if(X!==\"*\"){(X===\"$\"||X===\"^\")&&(X=`\\\\${X}`);let P=mze.exec(j());P&&(X+=P[0],g.index+=P[0].length),ke({type:\"text\",value:X});continue}if(se&&(se.type===\"globstar\"||se.star===!0)){se.type=\"star\",se.star=!0,se.value+=X,se.output=Ce,g.backtrack=!0,g.globstar=!0,rt(X);continue}let x=j();if(r.noextglob!==!0&&/^\\([^?]/.test(x)){it(\"star\",X);continue}if(se.type===\"star\"){if(r.noglobstar===!0){rt(X);continue}let P=se.prev,y=P.prev,F=P.type===\"slash\"||P.type===\"bos\",z=y&&(y.type===\"star\"||y.type===\"globstar\");if(r.bash===!0&&(!F||x[0]&&x[0]!==\"/\")){ke({type:\"star\",value:X,output:\"\"});continue}let Z=g.braces>0&&(P.type===\"comma\"||P.type===\"brace\"),$=we.length&&(P.type===\"pipe\"||P.type===\"paren\");if(!F&&P.type!==\"paren\"&&!Z&&!$){ke({type:\"star\",value:X,output:\"\"});continue}for(;x.slice(0,3)===\"/**\";){let oe=t[g.index+4];if(oe&&oe!==\"/\")break;x=x.slice(3),rt(\"/**\",3)}if(P.type===\"bos\"&&De()){se.type=\"globstar\",se.value+=X,se.output=me(r),g.output=se.output,g.globstar=!0,rt(X);continue}if(P.type===\"slash\"&&P.prev.type!==\"bos\"&&!z&&De()){g.output=g.output.slice(0,-(P.output+se.output).length),P.output=`(?:${P.output}`,se.type=\"globstar\",se.output=me(r)+(r.strictSlashes?\")\":\"|$)\"),se.value+=X,g.globstar=!0,g.output+=P.output+se.output,rt(X);continue}if(P.type===\"slash\"&&P.prev.type!==\"bos\"&&x[0]===\"/\"){let oe=x[1]!==void 0?\"|$\":\"\";g.output=g.output.slice(0,-(P.output+se.output).length),P.output=`(?:${P.output}`,se.type=\"globstar\",se.output=`${me(r)}${b}|${b}${oe})`,se.value+=X,g.output+=P.output+se.output,g.globstar=!0,rt(X+mt()),ke({type:\"slash\",value:\"/\",output:\"\"});continue}if(P.type===\"bos\"&&x[0]===\"/\"){se.type=\"globstar\",se.value+=X,se.output=`(?:^|${b}|${me(r)}${b})`,g.output=se.output,g.globstar=!0,rt(X+mt()),ke({type:\"slash\",value:\"/\",output:\"\"});continue}g.output=g.output.slice(0,-se.output.length),se.type=\"globstar\",se.output=me(r),se.value+=X,g.output+=se.output,g.globstar=!0,rt(X);continue}let w={type:\"star\",value:X,output:Ce};if(r.bash===!0){w.output=\".*?\",(se.type===\"bos\"||se.type===\"slash\")&&(w.output=pe+w.output),ke(w);continue}if(se&&(se.type===\"bracket\"||se.type===\"paren\")&&r.regex===!0){w.output=X,ke(w);continue}(g.index===g.start||se.type===\"slash\"||se.type===\"dot\")&&(se.type===\"dot\"?(g.output+=U,se.output+=U):r.dot===!0?(g.output+=W,se.output+=W):(g.output+=pe,se.output+=pe),Te()!==\"*\"&&(g.output+=I,se.output+=I)),ke(w)}for(;g.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\"]\"));g.output=Gl.escapeLast(g.output,\"[\"),Ve(\"brackets\")}for(;g.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\")\"));g.output=Gl.escapeLast(g.output,\"(\"),Ve(\"parens\")}for(;g.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(FE(\"closing\",\"}\"));g.output=Gl.escapeLast(g.output,\"{\"),Ve(\"braces\")}if(r.strictSlashes!==!0&&(se.type===\"star\"||se.type===\"bracket\")&&ke({type:\"maybe_slash\",value:\"\",output:`${b}?`}),g.backtrack===!0){g.output=\"\";for(let x of g.tokens)g.output+=x.output!=null?x.output:x.value,x.suffix&&(g.output+=x.suffix)}return g};d4.fastpaths=(t,e)=>{let r={...e},s=typeof r.maxLength==\"number\"?Math.min(gk,r.maxLength):gk,a=t.length;if(a>s)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${s}`);t=qoe[t]||t;let n=Gl.isWindows(e),{DOT_LITERAL:c,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:E,NO_DOTS:C,NO_DOTS_SLASH:S,STAR:b,START_ANCHOR:I}=hk.globChars(n),T=r.dot?C:E,N=r.dot?S:E,U=r.capture?\"\":\"?:\",W={negated:!1,prefix:\"\"},ee=r.bash===!0?\".*?\":b;r.capture&&(ee=`(${ee})`);let ie=pe=>pe.noglobstar===!0?ee:`(${U}(?:(?!${I}${pe.dot?h:c}).)*?)`,ue=pe=>{switch(pe){case\"*\":return`${T}${p}${ee}`;case\".*\":return`${c}${p}${ee}`;case\"*.*\":return`${T}${ee}${c}${p}${ee}`;case\"*/*\":return`${T}${ee}${f}${p}${N}${ee}`;case\"**\":return T+ie(r);case\"**/*\":return`(?:${T}${ie(r)}${f})?${N}${p}${ee}`;case\"**/*.*\":return`(?:${T}${ie(r)}${f})?${N}${ee}${c}${p}${ee}`;case\"**/.*\":return`(?:${T}${ie(r)}${f})?${c}${p}${ee}`;default:{let Be=/^(.*?)\\.(\\w+)$/.exec(pe);if(!Be)return;let Ce=ue(Be[1]);return Ce?Ce+c+Be[2]:void 0}}},le=Gl.removePrefix(t,W),me=ue(le);return me&&r.strictSlashes!==!0&&(me+=`${f}?`),me};Woe.exports=d4});var Joe=_((aFt,Voe)=>{\"use strict\";var Ize=Ie(\"path\"),Cze=Goe(),m4=Yoe(),y4=IB(),wze=EB(),Bze=t=>t&&typeof t==\"object\"&&!Array.isArray(t),Zi=(t,e,r=!1)=>{if(Array.isArray(t)){let E=t.map(S=>Zi(S,e,r));return S=>{for(let b of E){let I=b(S);if(I)return I}return!1}}let s=Bze(t)&&t.tokens&&t.input;if(t===\"\"||typeof t!=\"string\"&&!s)throw new TypeError(\"Expected pattern to be a non-empty string\");let a=e||{},n=y4.isWindows(e),c=s?Zi.compileRe(t,e):Zi.makeRe(t,e,!1,!0),f=c.state;delete c.state;let p=()=>!1;if(a.ignore){let E={...e,ignore:null,onMatch:null,onResult:null};p=Zi(a.ignore,E,r)}let h=(E,C=!1)=>{let{isMatch:S,match:b,output:I}=Zi.test(E,c,e,{glob:t,posix:n}),T={glob:t,state:f,regex:c,posix:n,input:E,output:I,match:b,isMatch:S};return typeof a.onResult==\"function\"&&a.onResult(T),S===!1?(T.isMatch=!1,C?T:!1):p(E)?(typeof a.onIgnore==\"function\"&&a.onIgnore(T),T.isMatch=!1,C?T:!1):(typeof a.onMatch==\"function\"&&a.onMatch(T),C?T:!0)};return r&&(h.state=f),h};Zi.test=(t,e,r,{glob:s,posix:a}={})=>{if(typeof t!=\"string\")throw new TypeError(\"Expected input to be a string\");if(t===\"\")return{isMatch:!1,output:\"\"};let n=r||{},c=n.format||(a?y4.toPosixSlashes:null),f=t===s,p=f&&c?c(t):t;return f===!1&&(p=c?c(t):t,f=p===s),(f===!1||n.capture===!0)&&(n.matchBase===!0||n.basename===!0?f=Zi.matchBase(t,e,r,a):f=e.exec(p)),{isMatch:!!f,match:f,output:p}};Zi.matchBase=(t,e,r,s=y4.isWindows(r))=>(e instanceof RegExp?e:Zi.makeRe(e,r)).test(Ize.basename(t));Zi.isMatch=(t,e,r)=>Zi(e,r)(t);Zi.parse=(t,e)=>Array.isArray(t)?t.map(r=>Zi.parse(r,e)):m4(t,{...e,fastpaths:!1});Zi.scan=(t,e)=>Cze(t,e);Zi.compileRe=(t,e,r=!1,s=!1)=>{if(r===!0)return t.output;let a=e||{},n=a.contains?\"\":\"^\",c=a.contains?\"\":\"$\",f=`${n}(?:${t.output})${c}`;t&&t.negated===!0&&(f=`^(?!${f}).*$`);let p=Zi.toRegex(f,e);return s===!0&&(p.state=t),p};Zi.makeRe=(t,e={},r=!1,s=!1)=>{if(!t||typeof t!=\"string\")throw new TypeError(\"Expected a non-empty string\");let a={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]===\".\"||t[0]===\"*\")&&(a.output=m4.fastpaths(t,e)),a.output||(a=m4(t,e)),Zi.compileRe(a,e,r,s)};Zi.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?\"i\":\"\"))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Zi.constants=wze;Voe.exports=Zi});var zoe=_((lFt,Koe)=>{\"use strict\";Koe.exports=Joe()});var Go=_((cFt,eae)=>{\"use strict\";var Xoe=Ie(\"util\"),$oe=koe(),Jf=zoe(),E4=IB(),Zoe=t=>t===\"\"||t===\"./\",xi=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let s=new Set,a=new Set,n=new Set,c=0,f=E=>{n.add(E.output),r&&r.onResult&&r.onResult(E)};for(let E=0;E<e.length;E++){let C=Jf(String(e[E]),{...r,onResult:f},!0),S=C.state.negated||C.state.negatedExtglob;S&&c++;for(let b of t){let I=C(b,!0);(S?!I.isMatch:I.isMatch)&&(S?s.add(I.output):(s.delete(I.output),a.add(I.output)))}}let h=(c===e.length?[...n]:[...a]).filter(E=>!s.has(E));if(r&&h.length===0){if(r.failglob===!0)throw new Error(`No matches found for \"${e.join(\", \")}\"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(E=>E.replace(/\\\\/g,\"\")):e}return h};xi.match=xi;xi.matcher=(t,e)=>Jf(t,e);xi.isMatch=(t,e,r)=>Jf(e,r)(t);xi.any=xi.isMatch;xi.not=(t,e,r={})=>{e=[].concat(e).map(String);let s=new Set,a=[],n=f=>{r.onResult&&r.onResult(f),a.push(f.output)},c=new Set(xi(t,e,{...r,onResult:n}));for(let f of a)c.has(f)||s.add(f);return[...s]};xi.contains=(t,e,r)=>{if(typeof t!=\"string\")throw new TypeError(`Expected a string: \"${Xoe.inspect(t)}\"`);if(Array.isArray(e))return e.some(s=>xi.contains(t,s,r));if(typeof e==\"string\"){if(Zoe(t)||Zoe(e))return!1;if(t.includes(e)||t.startsWith(\"./\")&&t.slice(2).includes(e))return!0}return xi.isMatch(t,e,{...r,contains:!0})};xi.matchKeys=(t,e,r)=>{if(!E4.isObject(t))throw new TypeError(\"Expected the first argument to be an object\");let s=xi(Object.keys(t),e,r),a={};for(let n of s)a[n]=t[n];return a};xi.some=(t,e,r)=>{let s=[].concat(t);for(let a of[].concat(e)){let n=Jf(String(a),r);if(s.some(c=>n(c)))return!0}return!1};xi.every=(t,e,r)=>{let s=[].concat(t);for(let a of[].concat(e)){let n=Jf(String(a),r);if(!s.every(c=>n(c)))return!1}return!0};xi.all=(t,e,r)=>{if(typeof t!=\"string\")throw new TypeError(`Expected a string: \"${Xoe.inspect(t)}\"`);return[].concat(e).every(s=>Jf(s,r)(t))};xi.capture=(t,e,r)=>{let s=E4.isWindows(r),n=Jf.makeRe(String(t),{...r,capture:!0}).exec(s?E4.toPosixSlashes(e):e);if(n)return n.slice(1).map(c=>c===void 0?\"\":c)};xi.makeRe=(...t)=>Jf.makeRe(...t);xi.scan=(...t)=>Jf.scan(...t);xi.parse=(t,e)=>{let r=[];for(let s of[].concat(t||[]))for(let a of $oe(String(s),e))r.push(Jf.parse(a,e));return r};xi.braces=(t,e)=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");return e&&e.nobrace===!0||!/\\{.*\\}/.test(t)?[t]:$oe(t,e)};xi.braceExpand=(t,e)=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");return xi.braces(t,{...e,expand:!0})};eae.exports=xi});var rae=_((uFt,tae)=>{\"use strict\";tae.exports=({onlyFirst:t=!1}={})=>{let e=[\"[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\",\"(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))\"].join(\"|\");return new RegExp(e,t?void 0:\"g\")}});var dk=_((fFt,nae)=>{\"use strict\";var vze=rae();nae.exports=t=>typeof t==\"string\"?t.replace(vze(),\"\"):t});function iae(t){return Number.isSafeInteger(t)&&t>=0}var sae=Ze(()=>{});function oae(t){return t!=null&&typeof t!=\"function\"&&iae(t.length)}var aae=Ze(()=>{sae()});function Pc(t){return t===\"__proto__\"}var wB=Ze(()=>{});function NE(t){switch(typeof t){case\"number\":case\"symbol\":return!1;case\"string\":return t.includes(\".\")||t.includes(\"[\")||t.includes(\"]\")}}var mk=Ze(()=>{});function OE(t){return typeof t==\"string\"||typeof t==\"symbol\"?t:Object.is(t?.valueOf?.(),-0)?\"-0\":String(t)}var yk=Ze(()=>{});function Mu(t){let e=[],r=t.length;if(r===0)return e;let s=0,a=\"\",n=\"\",c=!1;for(t.charCodeAt(0)===46&&(e.push(\"\"),s++);s<r;){let f=t[s];n?f===\"\\\\\"&&s+1<r?(s++,a+=t[s]):f===n?n=\"\":a+=f:c?f==='\"'||f===\"'\"?n=f:f===\"]\"?(c=!1,e.push(a),a=\"\"):a+=f:f===\"[\"?(c=!0,a&&(e.push(a),a=\"\")):f===\".\"?a&&(e.push(a),a=\"\"):a+=f,s++}return a&&e.push(a),e}var LE=Ze(()=>{});function va(t,e,r){if(t==null)return r;switch(typeof e){case\"string\":{if(Pc(e))return r;let s=t[e];return s===void 0?NE(e)?va(t,Mu(e),r):r:s}case\"number\":case\"symbol\":{typeof e==\"number\"&&(e=OE(e));let s=t[e];return s===void 0?r:s}default:{if(Array.isArray(e))return Sze(t,e,r);if(Object.is(e?.valueOf(),-0)?e=\"-0\":e=String(e),Pc(e))return r;let s=t[e];return s===void 0?r:s}}}function Sze(t,e,r){if(e.length===0)return r;let s=t;for(let a=0;a<e.length;a++){if(s==null||Pc(e[a]))return r;s=s[e[a]]}return s===void 0?r:s}var Ek=Ze(()=>{wB();mk();yk();LE()});function I4(t){return t!==null&&(typeof t==\"object\"||typeof t==\"function\")}var lae=Ze(()=>{});function ME(t){return t==null||typeof t!=\"object\"&&typeof t!=\"function\"}var Ik=Ze(()=>{});function Ck(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}var C4=Ze(()=>{});function Wd(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}var wk=Ze(()=>{});function Yd(t){return t==null?t===void 0?\"[object Undefined]\":\"[object Null]\":Object.prototype.toString.call(t)}var Bk=Ze(()=>{});var vk,UE,_E,HE,Vd,Sk,Dk,Pk,bk,xk,cae,kk,jE,uae,Qk,Rk,Tk,Fk,Nk,fae,Ok,Lk,Mk,Aae,Uk,_k,Hk=Ze(()=>{vk=\"[object RegExp]\",UE=\"[object String]\",_E=\"[object Number]\",HE=\"[object Boolean]\",Vd=\"[object Arguments]\",Sk=\"[object Symbol]\",Dk=\"[object Date]\",Pk=\"[object Map]\",bk=\"[object Set]\",xk=\"[object Array]\",cae=\"[object Function]\",kk=\"[object ArrayBuffer]\",jE=\"[object Object]\",uae=\"[object Error]\",Qk=\"[object DataView]\",Rk=\"[object Uint8Array]\",Tk=\"[object Uint8ClampedArray]\",Fk=\"[object Uint16Array]\",Nk=\"[object Uint32Array]\",fae=\"[object BigUint64Array]\",Ok=\"[object Int8Array]\",Lk=\"[object Int16Array]\",Mk=\"[object Int32Array]\",Aae=\"[object BigInt64Array]\",Uk=\"[object Float32Array]\",_k=\"[object Float64Array]\"});function GE(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var jk=Ze(()=>{});function pae(t,e){return u0(t,void 0,t,new Map,e)}function u0(t,e,r,s=new Map,a=void 0){let n=a?.(t,e,r,s);if(n!=null)return n;if(ME(t))return t;if(s.has(t))return s.get(t);if(Array.isArray(t)){let c=new Array(t.length);s.set(t,c);for(let f=0;f<t.length;f++)c[f]=u0(t[f],f,r,s,a);return Object.hasOwn(t,\"index\")&&(c.index=t.index),Object.hasOwn(t,\"input\")&&(c.input=t.input),c}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let c=new RegExp(t.source,t.flags);return c.lastIndex=t.lastIndex,c}if(t instanceof Map){let c=new Map;s.set(t,c);for(let[f,p]of t)c.set(f,u0(p,f,r,s,a));return c}if(t instanceof Set){let c=new Set;s.set(t,c);for(let f of t)c.add(u0(f,void 0,r,s,a));return c}if(typeof Buffer<\"u\"&&Buffer.isBuffer(t))return t.subarray();if(GE(t)){let c=new(Object.getPrototypeOf(t)).constructor(t.length);s.set(t,c);for(let f=0;f<t.length;f++)c[f]=u0(t[f],f,r,s,a);return c}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<\"u\"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let c=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return s.set(t,c),c0(c,t,r,s,a),c}if(typeof File<\"u\"&&t instanceof File){let c=new File([t],t.name,{type:t.type});return s.set(t,c),c0(c,t,r,s,a),c}if(t instanceof Blob){let c=new Blob([t],{type:t.type});return s.set(t,c),c0(c,t,r,s,a),c}if(t instanceof Error){let c=new t.constructor;return s.set(t,c),c.message=t.message,c.name=t.name,c.stack=t.stack,c.cause=t.cause,c0(c,t,r,s,a),c}if(typeof t==\"object\"&&Dze(t)){let c=Object.create(Object.getPrototypeOf(t));return s.set(t,c),c0(c,t,r,s,a),c}return t}function c0(t,e,r=t,s,a){let n=[...Object.keys(e),...Wd(e)];for(let c=0;c<n.length;c++){let f=n[c],p=Object.getOwnPropertyDescriptor(t,f);(p==null||p.writable)&&(t[f]=u0(e[f],f,r,s,a))}}function Dze(t){switch(Yd(t)){case Vd:case xk:case kk:case Qk:case HE:case Dk:case Uk:case _k:case Ok:case Lk:case Mk:case Pk:case _E:case jE:case vk:case bk:case UE:case Sk:case Rk:case Tk:case Fk:case Nk:return!0;default:return!1}}var w4=Ze(()=>{wk();Bk();Hk();Ik();jk()});function hae(t){return u0(t,void 0,t,new Map,void 0)}var gae=Ze(()=>{w4()});function dae(t,e){return pae(t,(r,s,a,n)=>{let c=e?.(r,s,a,n);if(c!=null)return c;if(typeof t==\"object\")switch(Object.prototype.toString.call(t)){case _E:case UE:case HE:{let f=new t.constructor(t?.valueOf());return c0(f,t),f}case Vd:{let f={};return c0(f,t),f.length=t.length,f[Symbol.iterator]=t[Symbol.iterator],f}default:return}})}var mae=Ze(()=>{w4();Hk()});function f0(t){return dae(t)}var B4=Ze(()=>{mae()});function Gk(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case\"number\":return Number.isInteger(t)&&t>=0&&t<e;case\"symbol\":return!1;case\"string\":return Pze.test(t)}}var Pze,v4=Ze(()=>{Pze=/^(?:0|[1-9]\\d*)$/});function BB(t){return t!==null&&typeof t==\"object\"&&Yd(t)===\"[object Arguments]\"}var S4=Ze(()=>{Bk()});function vB(t,e){let r;if(Array.isArray(e)?r=e:typeof e==\"string\"&&NE(e)&&t?.[e]==null?r=Mu(e):r=[e],r.length===0)return!1;let s=t;for(let a=0;a<r.length;a++){let n=r[a];if((s==null||!Object.hasOwn(s,n))&&!((Array.isArray(s)||BB(s))&&Gk(n)&&n<s.length))return!1;s=s[n]}return!0}var D4=Ze(()=>{mk();v4();S4();LE()});function P4(t){return typeof t==\"object\"&&t!==null}var yae=Ze(()=>{});function Eae(t){return typeof t==\"symbol\"||t instanceof Symbol}var Iae=Ze(()=>{});function Cae(t,e){return Array.isArray(t)?!1:typeof t==\"number\"||typeof t==\"boolean\"||t==null||Eae(t)?!0:typeof t==\"string\"&&(xze.test(t)||!bze.test(t))||e!=null&&Object.hasOwn(e,t)}var bze,xze,wae=Ze(()=>{Iae();bze=/\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,xze=/^\\w*$/});function A0(t,e){if(t==null)return!0;switch(typeof e){case\"symbol\":case\"number\":case\"object\":{if(Array.isArray(e))return Bae(t,e);if(typeof e==\"number\"?e=OE(e):typeof e==\"object\"&&(Object.is(e?.valueOf(),-0)?e=\"-0\":e=String(e)),Pc(e))return!1;if(t?.[e]===void 0)return!0;try{return delete t[e],!0}catch{return!1}}case\"string\":{if(t?.[e]===void 0&&NE(e))return Bae(t,Mu(e));if(Pc(e))return!1;try{return delete t[e],!0}catch{return!1}}}}function Bae(t,e){let r=va(t,e.slice(0,-1),t),s=e[e.length-1];if(r?.[s]===void 0)return!0;if(Pc(s))return!1;try{return delete r[s],!0}catch{return!1}}var b4=Ze(()=>{Ek();wB();mk();yk();LE()});function vae(t){return t==null}var Sae=Ze(()=>{});var Dae,Pae=Ze(()=>{C4();Dae=(t,e,r)=>{let s=t[e];(!(Object.hasOwn(t,e)&&Ck(s,r))||r===void 0&&!(e in t))&&(t[e]=r)}});function bae(t,e,r,s){if(t==null&&!I4(t))return t;let a=Cae(e,t)?[e]:Array.isArray(e)?e:typeof e==\"string\"?Mu(e):[e],n=t;for(let c=0;c<a.length&&n!=null;c++){let f=OE(a[c]);if(Pc(f))continue;let p;if(c===a.length-1)p=r(n[f]);else{let h=n[f],E=s?.(h,f,t);p=E!==void 0?E:I4(h)?h:Gk(a[c+1])?[]:{}}Dae(n,f,p),n=n[f]}return t}var xae=Ze(()=>{wB();Pae();v4();wae();yk();lae();LE()});function Jd(t,e,r){return bae(t,e,()=>r,()=>{})}var x4=Ze(()=>{xae()});function kae(t,e=0,r={}){typeof r!=\"object\"&&(r={});let s=null,a=null,n=null,c=0,f=null,p,{leading:h=!1,trailing:E=!0,maxWait:C}=r,S=\"maxWait\"in r,b=S?Math.max(Number(C)||0,e):0,I=ue=>(s!==null&&(p=t.apply(a,s)),s=a=null,c=ue,p),T=ue=>(c=ue,f=setTimeout(ee,e),h&&s!==null?I(ue):p),N=ue=>(f=null,E&&s!==null?I(ue):p),U=ue=>{if(n===null)return!0;let le=ue-n,me=le>=e||le<0,pe=S&&ue-c>=b;return me||pe},W=ue=>{let le=n===null?0:ue-n,me=e-le,pe=b-(ue-c);return S?Math.min(me,pe):me},ee=()=>{let ue=Date.now();if(U(ue))return N(ue);f=setTimeout(ee,W(ue))},ie=function(...ue){let le=Date.now(),me=U(le);if(s=ue,a=this,n=le,me){if(f===null)return T(le);if(S)return clearTimeout(f),f=setTimeout(ee,e),I(le)}return f===null&&(f=setTimeout(ee,e)),p};return ie.cancel=()=>{f!==null&&clearTimeout(f),c=0,n=s=a=f=null},ie.flush=()=>f===null?p:N(Date.now()),ie}var Qae=Ze(()=>{});function k4(t,e=0,r={}){let{leading:s=!0,trailing:a=!0}=r;return kae(t,e,{leading:s,maxWait:e,trailing:a})}var Rae=Ze(()=>{Qae()});function Q4(t){if(t==null)return\"\";if(typeof t==\"string\")return t;if(Array.isArray(t))return t.map(Q4).join(\",\");let e=String(t);return e===\"0\"&&Object.is(Number(t),-0)?\"-0\":e}var Tae=Ze(()=>{});function R4(t){if(!t||typeof t!=\"object\")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)===\"[object Object]\":!1}var Fae=Ze(()=>{});function Nae(t,e,r){return SB(t,e,void 0,void 0,void 0,void 0,r)}function SB(t,e,r,s,a,n,c){let f=c(t,e,r,s,a,n);if(f!==void 0)return f;if(typeof t==typeof e)switch(typeof t){case\"bigint\":case\"string\":case\"boolean\":case\"symbol\":case\"undefined\":return t===e;case\"number\":return t===e||Object.is(t,e);case\"function\":return t===e;case\"object\":return DB(t,e,n,c)}return DB(t,e,n,c)}function DB(t,e,r,s){if(Object.is(t,e))return!0;let a=Yd(t),n=Yd(e);if(a===Vd&&(a=jE),n===Vd&&(n=jE),a!==n)return!1;switch(a){case UE:return t.toString()===e.toString();case _E:{let p=t.valueOf(),h=e.valueOf();return Ck(p,h)}case HE:case Dk:case Sk:return Object.is(t.valueOf(),e.valueOf());case vk:return t.source===e.source&&t.flags===e.flags;case cae:return t===e}r=r??new Map;let c=r.get(t),f=r.get(e);if(c!=null&&f!=null)return c===e;r.set(t,e),r.set(e,t);try{switch(a){case Pk:{if(t.size!==e.size)return!1;for(let[p,h]of t.entries())if(!e.has(p)||!SB(h,e.get(p),p,t,e,r,s))return!1;return!0}case bk:{if(t.size!==e.size)return!1;let p=Array.from(t.values()),h=Array.from(e.values());for(let E=0;E<p.length;E++){let C=p[E],S=h.findIndex(b=>SB(C,b,void 0,t,e,r,s));if(S===-1)return!1;h.splice(S,1)}return!0}case xk:case Rk:case Tk:case Fk:case Nk:case fae:case Ok:case Lk:case Mk:case Aae:case Uk:case _k:{if(typeof Buffer<\"u\"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let p=0;p<t.length;p++)if(!SB(t[p],e[p],p,t,e,r,s))return!1;return!0}case kk:return t.byteLength!==e.byteLength?!1:DB(new Uint8Array(t),new Uint8Array(e),r,s);case Qk:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:DB(new Uint8Array(t),new Uint8Array(e),r,s);case uae:return t.name===e.name&&t.message===e.message;case jE:{if(!(DB(t.constructor,e.constructor,r,s)||R4(t)&&R4(e)))return!1;let h=[...Object.keys(t),...Wd(t)],E=[...Object.keys(e),...Wd(e)];if(h.length!==E.length)return!1;for(let C=0;C<h.length;C++){let S=h[C],b=t[S];if(!Object.hasOwn(e,S))return!1;let I=e[S];if(!SB(b,I,S,t,e,r,s))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}var Oae=Ze(()=>{Fae();wk();Bk();Hk();C4()});function Lae(){}var Mae=Ze(()=>{});function T4(t,e){return Nae(t,e,Lae)}var Uae=Ze(()=>{Oae();Mae()});function _ae(t){return GE(t)}var Hae=Ze(()=>{jk()});function jae(t){if(typeof t!=\"object\"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!==\"[object Object]\"){let r=t[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${r}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}var Gae=Ze(()=>{});function qae(t){if(ME(t))return t;if(Array.isArray(t)||GE(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<\"u\"&&t instanceof SharedArrayBuffer)return t.slice(0);let e=Object.getPrototypeOf(t),r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){let s=new r(t);return s.lastIndex=t.lastIndex,s}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let s=new r(t.message);return s.stack=t.stack,s.name=t.name,s.cause=t.cause,s}if(typeof File<\"u\"&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t==\"object\"){let s=Object.create(e);return Object.assign(s,t)}return t}var Wae=Ze(()=>{Ik();jk()});function F4(t,...e){let r=e.slice(0,-1),s=e[e.length-1],a=t;for(let n=0;n<r.length;n++){let c=r[n];a=qk(a,c,s,new Map)}return a}function qk(t,e,r,s){if(ME(t)&&(t=Object(t)),e==null||typeof e!=\"object\")return t;if(s.has(e))return qae(s.get(e));if(s.set(e,t),Array.isArray(e)){e=e.slice();for(let n=0;n<e.length;n++)e[n]=e[n]??void 0}let a=[...Object.keys(e),...Wd(e)];for(let n=0;n<a.length;n++){let c=a[n];if(Pc(c))continue;let f=e[c],p=t[c];if(BB(f)&&(f={...f}),BB(p)&&(p={...p}),typeof Buffer<\"u\"&&Buffer.isBuffer(f)&&(f=f0(f)),Array.isArray(f))if(typeof p==\"object\"&&p!=null){let E=[],C=Reflect.ownKeys(p);for(let S=0;S<C.length;S++){let b=C[S];E[b]=p[b]}p=E}else p=[];let h=r(p,f,c,t,e,s);h!=null?t[c]=h:Array.isArray(f)||P4(p)&&P4(f)?t[c]=qk(p,f,r,s):p==null&&jae(f)?t[c]=qk({},f,r,s):p==null&&_ae(f)?t[c]=f0(f):(p===void 0||f!==void 0)&&(t[c]=f)}return t}var Yae=Ze(()=>{B4();wB();Wae();Ik();wk();S4();yae();Gae();Hae()});function N4(t,...e){if(t==null)return{};let r=hae(t);for(let s=0;s<e.length;s++){let a=e[s];switch(typeof a){case\"object\":{Array.isArray(a)||(a=Array.from(a));for(let n=0;n<a.length;n++){let c=a[n];A0(r,c)}break}case\"string\":case\"symbol\":case\"number\":{A0(r,a);break}}}return r}var Vae=Ze(()=>{b4();gae()});function Kd(t,...e){if(vae(t))return{};let r={};for(let s=0;s<e.length;s++){let a=e[s];switch(typeof a){case\"object\":{Array.isArray(a)||(oae(a)?a=Array.from(a):a=[a]);break}case\"string\":case\"symbol\":case\"number\":{a=[a];break}}for(let n of a){let c=va(t,n);c===void 0&&!vB(t,n)||(typeof n==\"string\"&&Object.hasOwn(t,n)?r[n]=c:Jd(r,n,c))}}return r}var Jae=Ze(()=>{Ek();D4();x4();aae();Sae()});function Kae(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}var zae=Ze(()=>{});function PB(t){return Kae(Q4(t))}var Zae=Ze(()=>{zae();Tae()});var ql=Ze(()=>{Rae();Uae();B4();Ek();D4();Yae();Vae();Jae();x4();b4();Zae();LE()});var je={};Vt(je,{AsyncActions:()=>M4,BufferStream:()=>L4,CachingStrategy:()=>ale,DefaultStream:()=>U4,allSettledSafe:()=>Uu,assertNever:()=>H4,bufferStream:()=>WE,buildIgnorePattern:()=>Oze,convertMapsToIndexableObjects:()=>Yk,dynamicRequire:()=>bp,escapeRegExp:()=>Qze,getArrayWithDefault:()=>xB,getFactoryWithDefault:()=>Yl,getMapWithDefault:()=>j4,getSetWithDefault:()=>Pp,groupBy:()=>Uze,isIndexableObject:()=>O4,isPathLike:()=>Lze,isTaggedYarnVersion:()=>kze,makeDeferred:()=>ile,mapAndFilter:()=>Wl,mapAndFind:()=>p0,mergeIntoTarget:()=>cle,overrideType:()=>Rze,parseBoolean:()=>kB,parseInt:()=>YE,parseOptionalBoolean:()=>lle,plural:()=>Wk,prettifyAsyncErrors:()=>qE,prettifySyncErrors:()=>G4,releaseAfterUseAsync:()=>Fze,replaceEnvVariables:()=>Vk,sortMap:()=>qs,toMerged:()=>Mze,tryParseOptionalBoolean:()=>q4,validateEnum:()=>Tze});function kze(t){return!!(tle.default.valid(t)&&t.match(/^[^-]+(-rc\\.[0-9]+)?$/))}function Wk(t,{one:e,more:r,zero:s=r}){return t===0?s:t===1?e:r}function Qze(t){return t.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Rze(t){}function H4(t){throw new Error(`Assertion failed: Unexpected object '${t}'`)}function Tze(t,e){let r=Object.values(t);if(!r.includes(e))throw new nt(`Invalid value for enumeration: ${JSON.stringify(e)} (expected one of ${r.map(s=>JSON.stringify(s)).join(\", \")})`);return e}function Wl(t,e){let r=[];for(let s of t){let a=e(s);a!==rle&&r.push(a)}return r}function p0(t,e){for(let r of t){let s=e(r);if(s!==nle)return s}}function O4(t){return typeof t==\"object\"&&t!==null}async function Uu(t){let e=await Promise.allSettled(t),r=[];for(let s of e){if(s.status===\"rejected\")throw s.reason;r.push(s.value)}return r}function Yk(t){if(t instanceof Map&&(t=Object.fromEntries(t)),O4(t))for(let e of Object.keys(t)){let r=t[e];O4(r)&&(t[e]=Yk(r))}return t}function Yl(t,e,r){let s=t.get(e);return typeof s>\"u\"&&t.set(e,s=r()),s}function xB(t,e){let r=t.get(e);return typeof r>\"u\"&&t.set(e,r=[]),r}function Pp(t,e){let r=t.get(e);return typeof r>\"u\"&&t.set(e,r=new Set),r}function j4(t,e){let r=t.get(e);return typeof r>\"u\"&&t.set(e,r=new Map),r}async function Fze(t,e){if(e==null)return await t();try{return await t()}finally{await e()}}async function qE(t,e){try{return await t()}catch(r){throw r.message=e(r.message),r}}function G4(t,e){try{return t()}catch(r){throw r.message=e(r.message),r}}async function WE(t){return await new Promise((e,r)=>{let s=[];t.on(\"error\",a=>{r(a)}),t.on(\"data\",a=>{s.push(a)}),t.on(\"end\",()=>{e(Buffer.concat(s))})})}function ile(){let t,e;return{promise:new Promise((s,a)=>{t=s,e=a}),resolve:t,reject:e}}function sle(t){return bB(fe.fromPortablePath(t))}function ole(path){let physicalPath=fe.fromPortablePath(path),currentCacheEntry=bB.cache[physicalPath];delete bB.cache[physicalPath];let result;try{result=sle(physicalPath);let freshCacheEntry=bB.cache[physicalPath],dynamicModule=eval(\"module\"),freshCacheIndex=dynamicModule.children.indexOf(freshCacheEntry);freshCacheIndex!==-1&&dynamicModule.children.splice(freshCacheIndex,1)}finally{bB.cache[physicalPath]=currentCacheEntry}return result}function Nze(t){let e=Xae.get(t),r=ce.statSync(t);if(e?.mtime===r.mtimeMs)return e.instance;let s=ole(t);return Xae.set(t,{mtime:r.mtimeMs,instance:s}),s}function bp(t,{cachingStrategy:e=2}={}){switch(e){case 0:return ole(t);case 1:return Nze(t);case 2:return sle(t);default:throw new Error(\"Unsupported caching strategy\")}}function qs(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let s=[];for(let n of e)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function Oze(t){return t.length===0?null:t.map(e=>`(${$ae.default.makeRe(e,{windows:!1,dot:!0}).source})`).join(\"|\")}function Vk(t,{env:e}){let r=/\\${(?<variableName>[\\d\\w_]+)(?<colon>:)?(?:-(?<fallback>[^}]*))?}/g;return t.replace(r,(...s)=>{let{variableName:a,colon:n,fallback:c}=s[s.length-1],f=Object.hasOwn(e,a),p=e[a];if(p||f&&!n)return p;if(c!=null)return c;throw new nt(`Environment variable not found (${a})`)})}function kB(t){switch(t){case\"true\":case\"1\":case 1:case!0:return!0;case\"false\":case\"0\":case 0:case!1:return!1;default:throw new Error(`Couldn't parse \"${t}\" as a boolean`)}}function lle(t){return typeof t>\"u\"?t:kB(t)}function q4(t){try{return lle(t)}catch{return null}}function Lze(t){return!!(fe.isAbsolute(t)||t.match(/^(\\.{1,2}|~)\\//))}function cle(t,...e){let r=c=>({value:c}),s=r(t),a=e.map(c=>r(c)),{value:n}=F4(s,...a,(c,f)=>{if(Array.isArray(c)&&Array.isArray(f)){for(let p of f)c.find(h=>T4(h,p))||c.push(p);return c}});return n}function Mze(...t){return cle({},...t)}function Uze(t,e){let r=Object.create(null);for(let s of t){let a=s[e];r[a]??=[],r[a].push(s)}return r}function YE(t){return typeof t==\"string\"?Number.parseInt(t,10):t}var $ae,ele,tle,_4,rle,nle,L4,M4,U4,bB,Xae,ale,bc=Ze(()=>{Dt();Yt();ql();$ae=ut(Go()),ele=ut(Ld()),tle=ut(Ai()),_4=Ie(\"stream\");rle=Symbol();Wl.skip=rle;nle=Symbol();p0.skip=nle;L4=class extends _4.Transform{constructor(){super(...arguments);this.chunks=[]}_transform(r,s,a){if(s!==\"buffer\"||!Buffer.isBuffer(r))throw new Error(\"Assertion failed: BufferStream only accept buffers\");this.chunks.push(r),a(null,null)}_flush(r){r(null,Buffer.concat(this.chunks))}};M4=class{constructor(e){this.deferred=new Map;this.promises=new Map;this.limit=(0,ele.default)(e)}set(e,r){let s=this.deferred.get(e);typeof s>\"u\"&&this.deferred.set(e,s=ile());let a=this.limit(()=>r());return this.promises.set(e,a),a.then(()=>{this.promises.get(e)===a&&s.resolve()},n=>{this.promises.get(e)===a&&s.reject(n)}),s.promise}reduce(e,r){let s=this.promises.get(e)??Promise.resolve();this.set(e,()=>r(s))}async wait(){await Promise.all(this.promises.values())}},U4=class extends _4.Transform{constructor(r=Buffer.alloc(0)){super();this.active=!0;this.ifEmpty=r}_transform(r,s,a){if(s!==\"buffer\"||!Buffer.isBuffer(r))throw new Error(\"Assertion failed: DefaultStream only accept buffers\");this.active=!1,a(null,r)}_flush(r){this.active&&this.ifEmpty.length>0?r(null,this.ifEmpty):r(null)}},bB=eval(\"require\");Xae=new Map;ale=(s=>(s[s.NoCache=0]=\"NoCache\",s[s.FsTime=1]=\"FsTime\",s[s.Node=2]=\"Node\",s))(ale||{})});var VE,W4,Y4,ule=Ze(()=>{VE=(r=>(r.HARD=\"HARD\",r.SOFT=\"SOFT\",r))(VE||{}),W4=(s=>(s.Dependency=\"Dependency\",s.PeerDependency=\"PeerDependency\",s.PeerDependencyMeta=\"PeerDependencyMeta\",s))(W4||{}),Y4=(s=>(s.Inactive=\"inactive\",s.Redundant=\"redundant\",s.Active=\"active\",s))(Y4||{})});var he={};Vt(he,{LogLevel:()=>$k,Style:()=>zk,Type:()=>ht,addLogFilterSupport:()=>TB,applyColor:()=>ri,applyHyperlink:()=>KE,applyStyle:()=>zd,json:()=>Zd,jsonOrPretty:()=>jze,mark:()=>Z4,pretty:()=>Ht,prettyField:()=>Kf,prettyList:()=>z4,prettyTruncatedLocatorList:()=>Xk,stripAnsi:()=>JE.default,supportsColor:()=>Zk,supportsHyperlinks:()=>K4,tuple:()=>_u});function fle(t){let e=[\"KiB\",\"MiB\",\"GiB\",\"TiB\"],r=e.length;for(;r>1&&t<1024**r;)r-=1;let s=1024**r;return`${Math.floor(t*100/s)/100} ${e[r-1]}`}function Jk(t,e){if(Array.isArray(e))return e.length===0?ri(t,\"[]\",ht.CODE):ri(t,\"[ \",ht.CODE)+e.map(r=>Jk(t,r)).join(\", \")+ri(t,\" ]\",ht.CODE);if(typeof e==\"string\")return ri(t,JSON.stringify(e),ht.STRING);if(typeof e==\"number\")return ri(t,JSON.stringify(e),ht.NUMBER);if(typeof e==\"boolean\")return ri(t,JSON.stringify(e),ht.BOOLEAN);if(e===null)return ri(t,\"null\",ht.NULL);if(typeof e==\"object\"&&Object.getPrototypeOf(e)===Object.prototype){let r=Object.entries(e);return r.length===0?ri(t,\"{}\",ht.CODE):ri(t,\"{ \",ht.CODE)+r.map(([s,a])=>`${Jk(t,s)}: ${Jk(t,a)}`).join(\", \")+ri(t,\" }\",ht.CODE)}if(typeof e>\"u\")return ri(t,\"undefined\",ht.NULL);throw new Error(\"Assertion failed: The value doesn't seem to be a valid JSON object\")}function _u(t,e){return[e,t]}function zd(t,e,r){return t.get(\"enableColors\")&&r&2&&(e=RB.default.bold(e)),e}function ri(t,e,r){if(!t.get(\"enableColors\"))return e;let s=_ze.get(r);if(s===null)return e;let a=typeof s>\"u\"?r:J4.level>=3?s[0]:s[1],n=typeof a==\"number\"?V4.ansi256(a):a.startsWith(\"#\")?V4.hex(a):V4[a];if(typeof n!=\"function\")throw new Error(`Invalid format type ${a}`);return n(e)}function KE(t,e,r){return t.get(\"enableHyperlinks\")?Hze?`\\x1B]8;;${r}\\x1B\\\\${e}\\x1B]8;;\\x1B\\\\`:`\\x1B]8;;${r}\\x07${e}\\x1B]8;;\\x07`:e}function Ht(t,e,r){if(e===null)return ri(t,\"null\",ht.NULL);if(Object.hasOwn(Kk,r))return Kk[r].pretty(t,e);if(typeof e!=\"string\")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof e}`);return ri(t,e,r)}function z4(t,e,r,{separator:s=\", \"}={}){return[...e].map(a=>Ht(t,a,r)).join(s)}function Zd(t,e){if(t===null)return null;if(Object.hasOwn(Kk,e))return Kk[e].json(t);if(typeof t!=\"string\")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof t}`);return t}function jze(t,e,[r,s]){return t?Zd(r,s):Ht(e,r,s)}function Z4(t){return{Check:ri(t,\"\\u2713\",\"green\"),Cross:ri(t,\"\\u2718\",\"red\"),Question:ri(t,\"?\",\"cyan\")}}function Kf(t,{label:e,value:[r,s]}){return`${Ht(t,e,ht.CODE)}: ${Ht(t,r,s)}`}function Xk(t,e,r){let s=[],a=[...e],n=r;for(;a.length>0;){let h=a[0],E=`${Yr(t,h)}, `,C=X4(h).length+2;if(s.length>0&&n<C)break;s.push([E,C]),n-=C,a.shift()}if(a.length===0)return s.map(([h])=>h).join(\"\").slice(0,-2);let c=\"X\".repeat(a.length.toString().length),f=`and ${c} more.`,p=a.length;for(;s.length>1&&n<f.length;)n+=s[s.length-1][1],p+=1,s.pop();return[s.map(([h])=>h).join(\"\"),f.replace(c,Ht(t,p,ht.NUMBER))].join(\"\")}function TB(t,{configuration:e}){let r=e.get(\"logFilters\"),s=new Map,a=new Map,n=[];for(let C of r){let S=C.get(\"level\");if(typeof S>\"u\")continue;let b=C.get(\"code\");typeof b<\"u\"&&s.set(b,S);let I=C.get(\"text\");typeof I<\"u\"&&a.set(I,S);let T=C.get(\"pattern\");typeof T<\"u\"&&n.push([Ale.default.matcher(T,{contains:!0}),S])}n.reverse();let c=(C,S,b)=>{if(C===null||C===0)return b;let I=a.size>0||n.length>0?(0,JE.default)(S):S;if(a.size>0){let T=a.get(I);if(typeof T<\"u\")return T??b}if(n.length>0){for(let[T,N]of n)if(T(I))return N??b}if(s.size>0){let T=s.get(Yf(C));if(typeof T<\"u\")return T??b}return b},f=t.reportInfo,p=t.reportWarning,h=t.reportError,E=function(C,S,b,I){switch(c(S,b,I)){case\"info\":f.call(C,S,b);break;case\"warning\":p.call(C,S??0,b);break;case\"error\":h.call(C,S??0,b);break}};t.reportInfo=function(...C){return E(this,...C,\"info\")},t.reportWarning=function(...C){return E(this,...C,\"warning\")},t.reportError=function(...C){return E(this,...C,\"error\")}}var RB,QB,Ale,JE,ht,zk,J4,Zk,K4,V4,_ze,qo,Kk,Hze,$k,xc=Ze(()=>{Dt();RB=ut(RE()),QB=ut(Fd());Yt();Ale=ut(Go()),JE=ut(dk());Gx();Wo();ht={NO_HINT:\"NO_HINT\",ID:\"ID\",NULL:\"NULL\",SCOPE:\"SCOPE\",NAME:\"NAME\",RANGE:\"RANGE\",REFERENCE:\"REFERENCE\",NUMBER:\"NUMBER\",STRING:\"STRING\",BOOLEAN:\"BOOLEAN\",PATH:\"PATH\",URL:\"URL\",ADDED:\"ADDED\",REMOVED:\"REMOVED\",CODE:\"CODE\",INSPECT:\"INSPECT\",DURATION:\"DURATION\",SIZE:\"SIZE\",SIZE_DIFF:\"SIZE_DIFF\",IDENT:\"IDENT\",DESCRIPTOR:\"DESCRIPTOR\",LOCATOR:\"LOCATOR\",RESOLUTION:\"RESOLUTION\",DEPENDENT:\"DEPENDENT\",PACKAGE_EXTENSION:\"PACKAGE_EXTENSION\",SETTING:\"SETTING\",MARKDOWN:\"MARKDOWN\",MARKDOWN_INLINE:\"MARKDOWN_INLINE\"},zk=(e=>(e[e.BOLD=2]=\"BOLD\",e))(zk||{}),J4=QB.default.GITHUB_ACTIONS?{level:2}:RB.default.supportsColor?{level:RB.default.supportsColor.level}:{level:0},Zk=J4.level!==0,K4=Zk&&!QB.default.GITHUB_ACTIONS&&!QB.default.CIRCLE&&!QB.default.GITLAB,V4=new RB.default.Instance(J4),_ze=new Map([[ht.NO_HINT,null],[ht.NULL,[\"#a853b5\",129]],[ht.SCOPE,[\"#d75f00\",166]],[ht.NAME,[\"#d7875f\",173]],[ht.RANGE,[\"#00afaf\",37]],[ht.REFERENCE,[\"#87afff\",111]],[ht.NUMBER,[\"#ffd700\",220]],[ht.STRING,[\"#b4bd68\",32]],[ht.BOOLEAN,[\"#faa023\",209]],[ht.PATH,[\"#d75fd7\",170]],[ht.URL,[\"#d75fd7\",170]],[ht.ADDED,[\"#5faf00\",70]],[ht.REMOVED,[\"#ff3131\",160]],[ht.CODE,[\"#87afff\",111]],[ht.SIZE,[\"#ffd700\",220]]]),qo=t=>t;Kk={[ht.ID]:qo({pretty:(t,e)=>typeof e==\"number\"?ri(t,`${e}`,ht.NUMBER):ri(t,e,ht.CODE),json:t=>t}),[ht.INSPECT]:qo({pretty:(t,e)=>Jk(t,e),json:t=>t}),[ht.NUMBER]:qo({pretty:(t,e)=>ri(t,`${e}`,ht.NUMBER),json:t=>t}),[ht.IDENT]:qo({pretty:(t,e)=>Xi(t,e),json:t=>un(t)}),[ht.LOCATOR]:qo({pretty:(t,e)=>Yr(t,e),json:t=>ll(t)}),[ht.DESCRIPTOR]:qo({pretty:(t,e)=>ni(t,e),json:t=>al(t)}),[ht.RESOLUTION]:qo({pretty:(t,{descriptor:e,locator:r})=>FB(t,e,r),json:({descriptor:t,locator:e})=>({descriptor:al(t),locator:e!==null?ll(e):null})}),[ht.DEPENDENT]:qo({pretty:(t,{locator:e,descriptor:r})=>$4(t,e,r),json:({locator:t,descriptor:e})=>({locator:ll(t),descriptor:al(e)})}),[ht.PACKAGE_EXTENSION]:qo({pretty:(t,e)=>{switch(e.type){case\"Dependency\":return`${Xi(t,e.parentDescriptor)} \\u27A4 ${ri(t,\"dependencies\",ht.CODE)} \\u27A4 ${Xi(t,e.descriptor)}`;case\"PeerDependency\":return`${Xi(t,e.parentDescriptor)} \\u27A4 ${ri(t,\"peerDependencies\",ht.CODE)} \\u27A4 ${Xi(t,e.descriptor)}`;case\"PeerDependencyMeta\":return`${Xi(t,e.parentDescriptor)} \\u27A4 ${ri(t,\"peerDependenciesMeta\",ht.CODE)} \\u27A4 ${Xi(t,Sa(e.selector))} \\u27A4 ${ri(t,e.key,ht.CODE)}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${e.type}`)}},json:t=>{switch(t.type){case\"Dependency\":return`${un(t.parentDescriptor)} > ${un(t.descriptor)}`;case\"PeerDependency\":return`${un(t.parentDescriptor)} >> ${un(t.descriptor)}`;case\"PeerDependencyMeta\":return`${un(t.parentDescriptor)} >> ${t.selector} / ${t.key}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${t.type}`)}}}),[ht.SETTING]:qo({pretty:(t,e)=>(t.get(e),KE(t,ri(t,e,ht.CODE),`https://yarnpkg.com/configuration/yarnrc#${e}`)),json:t=>t}),[ht.DURATION]:qo({pretty:(t,e)=>{if(e>1e3*60){let r=Math.floor(e/1e3/60),s=Math.ceil((e-r*60*1e3)/1e3);return s===0?`${r}m`:`${r}m ${s}s`}else{let r=Math.floor(e/1e3),s=e-r*1e3;return s===0?`${r}s`:`${r}s ${s}ms`}},json:t=>t}),[ht.SIZE]:qo({pretty:(t,e)=>ri(t,fle(e),ht.NUMBER),json:t=>t}),[ht.SIZE_DIFF]:qo({pretty:(t,e)=>{let r=e>=0?\"+\":\"-\",s=r===\"+\"?ht.REMOVED:ht.ADDED;return ri(t,`${r} ${fle(Math.max(Math.abs(e),1))}`,s)},json:t=>t}),[ht.PATH]:qo({pretty:(t,e)=>ri(t,fe.fromPortablePath(e),ht.PATH),json:t=>fe.fromPortablePath(t)}),[ht.MARKDOWN]:qo({pretty:(t,{text:e,format:r,paragraphs:s})=>Ho(e,{format:r,paragraphs:s}),json:({text:t})=>t}),[ht.MARKDOWN_INLINE]:qo({pretty:(t,e)=>(e=e.replace(/(`+)((?:.|[\\n])*?)\\1/g,(r,s,a)=>Ht(t,s+a+s,ht.CODE)),e=e.replace(/(\\*\\*)((?:.|[\\n])*?)\\1/g,(r,s,a)=>zd(t,a,2)),e),json:t=>t})};Hze=!!process.env.KONSOLE_VERSION;$k=(a=>(a.Error=\"error\",a.Warning=\"warning\",a.Info=\"info\",a.Discard=\"discard\",a))($k||{})});var ple=_(zE=>{\"use strict\";Object.defineProperty(zE,\"__esModule\",{value:!0});zE.splitWhen=zE.flatten=void 0;function Gze(t){return t.reduce((e,r)=>[].concat(e,r),[])}zE.flatten=Gze;function qze(t,e){let r=[[]],s=0;for(let a of t)e(a)?(s++,r[s]=[]):r[s].push(a);return r}zE.splitWhen=qze});var hle=_(eQ=>{\"use strict\";Object.defineProperty(eQ,\"__esModule\",{value:!0});eQ.isEnoentCodeError=void 0;function Wze(t){return t.code===\"ENOENT\"}eQ.isEnoentCodeError=Wze});var gle=_(tQ=>{\"use strict\";Object.defineProperty(tQ,\"__esModule\",{value:!0});tQ.createDirentFromStats=void 0;var e3=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Yze(t,e){return new e3(t,e)}tQ.createDirentFromStats=Yze});var Ele=_(ls=>{\"use strict\";Object.defineProperty(ls,\"__esModule\",{value:!0});ls.convertPosixPathToPattern=ls.convertWindowsPathToPattern=ls.convertPathToPattern=ls.escapePosixPath=ls.escapeWindowsPath=ls.escape=ls.removeLeadingDotSegment=ls.makeAbsolute=ls.unixify=void 0;var Vze=Ie(\"os\"),Jze=Ie(\"path\"),dle=Vze.platform()===\"win32\",Kze=2,zze=/(\\\\?)([()*?[\\]{|}]|^!|[!+@](?=\\()|\\\\(?![!()*+?@[\\]{|}]))/g,Zze=/(\\\\?)([()[\\]{}]|^!|[!+@](?=\\())/g,Xze=/^\\\\\\\\([.?])/,$ze=/\\\\(?![!()+@[\\]{}])/g;function eZe(t){return t.replace(/\\\\/g,\"/\")}ls.unixify=eZe;function tZe(t,e){return Jze.resolve(t,e)}ls.makeAbsolute=tZe;function rZe(t){if(t.charAt(0)===\".\"){let e=t.charAt(1);if(e===\"/\"||e===\"\\\\\")return t.slice(Kze)}return t}ls.removeLeadingDotSegment=rZe;ls.escape=dle?t3:r3;function t3(t){return t.replace(Zze,\"\\\\$2\")}ls.escapeWindowsPath=t3;function r3(t){return t.replace(zze,\"\\\\$2\")}ls.escapePosixPath=r3;ls.convertPathToPattern=dle?mle:yle;function mle(t){return t3(t).replace(Xze,\"//$1\").replace($ze,\"/\")}ls.convertWindowsPathToPattern=mle;function yle(t){return r3(t)}ls.convertPosixPathToPattern=yle});var Cle=_((UOt,Ile)=>{Ile.exports=function(e){if(typeof e!=\"string\"||e===\"\")return!1;for(var r;r=/(\\\\).|([@?!+*]\\(.*\\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var vle=_((_Ot,Ble)=>{var nZe=Cle(),wle={\"{\":\"}\",\"(\":\")\",\"[\":\"]\"},iZe=function(t){if(t[0]===\"!\")return!0;for(var e=0,r=-2,s=-2,a=-2,n=-2,c=-2;e<t.length;){if(t[e]===\"*\"||t[e+1]===\"?\"&&/[\\].+)]/.test(t[e])||s!==-1&&t[e]===\"[\"&&t[e+1]!==\"]\"&&(s<e&&(s=t.indexOf(\"]\",e)),s>e&&(c===-1||c>s||(c=t.indexOf(\"\\\\\",e),c===-1||c>s)))||a!==-1&&t[e]===\"{\"&&t[e+1]!==\"}\"&&(a=t.indexOf(\"}\",e),a>e&&(c=t.indexOf(\"\\\\\",e),c===-1||c>a))||n!==-1&&t[e]===\"(\"&&t[e+1]===\"?\"&&/[:!=]/.test(t[e+2])&&t[e+3]!==\")\"&&(n=t.indexOf(\")\",e),n>e&&(c=t.indexOf(\"\\\\\",e),c===-1||c>n))||r!==-1&&t[e]===\"(\"&&t[e+1]!==\"|\"&&(r<e&&(r=t.indexOf(\"|\",e)),r!==-1&&t[r+1]!==\")\"&&(n=t.indexOf(\")\",r),n>r&&(c=t.indexOf(\"\\\\\",r),c===-1||c>n))))return!0;if(t[e]===\"\\\\\"){var f=t[e+1];e+=2;var p=wle[f];if(p){var h=t.indexOf(p,e);h!==-1&&(e=h+1)}if(t[e]===\"!\")return!0}else e++}return!1},sZe=function(t){if(t[0]===\"!\")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\\]]/.test(t[e]))return!0;if(t[e]===\"\\\\\"){var r=t[e+1];e+=2;var s=wle[r];if(s){var a=t.indexOf(s,e);a!==-1&&(e=a+1)}if(t[e]===\"!\")return!0}else e++}return!1};Ble.exports=function(e,r){if(typeof e!=\"string\"||e===\"\")return!1;if(nZe(e))return!0;var s=iZe;return r&&r.strict===!1&&(s=sZe),s(e)}});var Dle=_((HOt,Sle)=>{\"use strict\";var oZe=vle(),aZe=Ie(\"path\").posix.dirname,lZe=Ie(\"os\").platform()===\"win32\",n3=\"/\",cZe=/\\\\/g,uZe=/[\\{\\[].*[\\}\\]]$/,fZe=/(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/,AZe=/\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;Sle.exports=function(e,r){var s=Object.assign({flipBackslashes:!0},r);s.flipBackslashes&&lZe&&e.indexOf(n3)<0&&(e=e.replace(cZe,n3)),uZe.test(e)&&(e+=n3),e+=\"a\";do e=aZe(e);while(oZe(e)||fZe.test(e));return e.replace(AZe,\"$1\")}});var Fle=_(jr=>{\"use strict\";Object.defineProperty(jr,\"__esModule\",{value:!0});jr.removeDuplicateSlashes=jr.matchAny=jr.convertPatternsToRe=jr.makeRe=jr.getPatternParts=jr.expandBraceExpansion=jr.expandPatternsWithBraceExpansion=jr.isAffectDepthOfReadingPattern=jr.endsWithSlashGlobStar=jr.hasGlobStar=jr.getBaseDirectory=jr.isPatternRelatedToParentDirectory=jr.getPatternsOutsideCurrentDirectory=jr.getPatternsInsideCurrentDirectory=jr.getPositivePatterns=jr.getNegativePatterns=jr.isPositivePattern=jr.isNegativePattern=jr.convertToNegativePattern=jr.convertToPositivePattern=jr.isDynamicPattern=jr.isStaticPattern=void 0;var pZe=Ie(\"path\"),hZe=Dle(),i3=Go(),Ple=\"**\",gZe=\"\\\\\",dZe=/[*?]|^!/,mZe=/\\[[^[]*]/,yZe=/(?:^|[^!*+?@])\\([^(]*\\|[^|]*\\)/,EZe=/[!*+?@]\\([^(]*\\)/,IZe=/,|\\.\\./,CZe=/(?!^)\\/{2,}/g;function ble(t,e={}){return!xle(t,e)}jr.isStaticPattern=ble;function xle(t,e={}){return t===\"\"?!1:!!(e.caseSensitiveMatch===!1||t.includes(gZe)||dZe.test(t)||mZe.test(t)||yZe.test(t)||e.extglob!==!1&&EZe.test(t)||e.braceExpansion!==!1&&wZe(t))}jr.isDynamicPattern=xle;function wZe(t){let e=t.indexOf(\"{\");if(e===-1)return!1;let r=t.indexOf(\"}\",e+1);if(r===-1)return!1;let s=t.slice(e,r);return IZe.test(s)}function BZe(t){return rQ(t)?t.slice(1):t}jr.convertToPositivePattern=BZe;function vZe(t){return\"!\"+t}jr.convertToNegativePattern=vZe;function rQ(t){return t.startsWith(\"!\")&&t[1]!==\"(\"}jr.isNegativePattern=rQ;function kle(t){return!rQ(t)}jr.isPositivePattern=kle;function SZe(t){return t.filter(rQ)}jr.getNegativePatterns=SZe;function DZe(t){return t.filter(kle)}jr.getPositivePatterns=DZe;function PZe(t){return t.filter(e=>!s3(e))}jr.getPatternsInsideCurrentDirectory=PZe;function bZe(t){return t.filter(s3)}jr.getPatternsOutsideCurrentDirectory=bZe;function s3(t){return t.startsWith(\"..\")||t.startsWith(\"./..\")}jr.isPatternRelatedToParentDirectory=s3;function xZe(t){return hZe(t,{flipBackslashes:!1})}jr.getBaseDirectory=xZe;function kZe(t){return t.includes(Ple)}jr.hasGlobStar=kZe;function Qle(t){return t.endsWith(\"/\"+Ple)}jr.endsWithSlashGlobStar=Qle;function QZe(t){let e=pZe.basename(t);return Qle(t)||ble(e)}jr.isAffectDepthOfReadingPattern=QZe;function RZe(t){return t.reduce((e,r)=>e.concat(Rle(r)),[])}jr.expandPatternsWithBraceExpansion=RZe;function Rle(t){let e=i3.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,s)=>r.length-s.length),e.filter(r=>r!==\"\")}jr.expandBraceExpansion=Rle;function TZe(t,e){let{parts:r}=i3.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith(\"/\")&&(r[0]=r[0].slice(1),r.unshift(\"\")),r}jr.getPatternParts=TZe;function Tle(t,e){return i3.makeRe(t,e)}jr.makeRe=Tle;function FZe(t,e){return t.map(r=>Tle(r,e))}jr.convertPatternsToRe=FZe;function NZe(t,e){return e.some(r=>r.test(t))}jr.matchAny=NZe;function OZe(t){return t.replace(CZe,\"/\")}jr.removeDuplicateSlashes=OZe});var Mle=_((GOt,Lle)=>{\"use strict\";var LZe=Ie(\"stream\"),Nle=LZe.PassThrough,MZe=Array.prototype.slice;Lle.exports=UZe;function UZe(){let t=[],e=MZe.call(arguments),r=!1,s=e[e.length-1];s&&!Array.isArray(s)&&s.pipe==null?e.pop():s={};let a=s.end!==!1,n=s.pipeError===!0;s.objectMode==null&&(s.objectMode=!0),s.highWaterMark==null&&(s.highWaterMark=64*1024);let c=Nle(s);function f(){for(let E=0,C=arguments.length;E<C;E++)t.push(Ole(arguments[E],s));return p(),this}function p(){if(r)return;r=!0;let E=t.shift();if(!E){process.nextTick(h);return}Array.isArray(E)||(E=[E]);let C=E.length+1;function S(){--C>0||(r=!1,p())}function b(I){function T(){I.removeListener(\"merge2UnpipeEnd\",T),I.removeListener(\"end\",T),n&&I.removeListener(\"error\",N),S()}function N(U){c.emit(\"error\",U)}if(I._readableState.endEmitted)return S();I.on(\"merge2UnpipeEnd\",T),I.on(\"end\",T),n&&I.on(\"error\",N),I.pipe(c,{end:!1}),I.resume()}for(let I=0;I<E.length;I++)b(E[I]);S()}function h(){r=!1,c.emit(\"queueDrain\"),a&&c.end()}return c.setMaxListeners(0),c.add=f,c.on(\"unpipe\",function(E){E.emit(\"merge2UnpipeEnd\")}),e.length&&f.apply(null,e),c}function Ole(t,e){if(Array.isArray(t))for(let r=0,s=t.length;r<s;r++)t[r]=Ole(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(Nle(e))),!t._readableState||!t.pause||!t.pipe)throw new Error(\"Only readable stream can be merged.\");t.pause()}return t}});var _le=_(nQ=>{\"use strict\";Object.defineProperty(nQ,\"__esModule\",{value:!0});nQ.merge=void 0;var _Ze=Mle();function HZe(t){let e=_Ze(t);return t.forEach(r=>{r.once(\"error\",s=>e.emit(\"error\",s))}),e.once(\"close\",()=>Ule(t)),e.once(\"end\",()=>Ule(t)),e}nQ.merge=HZe;function Ule(t){t.forEach(e=>e.emit(\"close\"))}});var Hle=_(ZE=>{\"use strict\";Object.defineProperty(ZE,\"__esModule\",{value:!0});ZE.isEmpty=ZE.isString=void 0;function jZe(t){return typeof t==\"string\"}ZE.isString=jZe;function GZe(t){return t===\"\"}ZE.isEmpty=GZe});var xp=_(Yo=>{\"use strict\";Object.defineProperty(Yo,\"__esModule\",{value:!0});Yo.string=Yo.stream=Yo.pattern=Yo.path=Yo.fs=Yo.errno=Yo.array=void 0;var qZe=ple();Yo.array=qZe;var WZe=hle();Yo.errno=WZe;var YZe=gle();Yo.fs=YZe;var VZe=Ele();Yo.path=VZe;var JZe=Fle();Yo.pattern=JZe;var KZe=_le();Yo.stream=KZe;var zZe=Hle();Yo.string=zZe});var Wle=_(Vo=>{\"use strict\";Object.defineProperty(Vo,\"__esModule\",{value:!0});Vo.convertPatternGroupToTask=Vo.convertPatternGroupsToTasks=Vo.groupPatternsByBaseDirectory=Vo.getNegativePatternsAsPositive=Vo.getPositivePatterns=Vo.convertPatternsToTasks=Vo.generate=void 0;var Hu=xp();function ZZe(t,e){let r=jle(t,e),s=jle(e.ignore,e),a=Gle(r),n=qle(r,s),c=a.filter(E=>Hu.pattern.isStaticPattern(E,e)),f=a.filter(E=>Hu.pattern.isDynamicPattern(E,e)),p=o3(c,n,!1),h=o3(f,n,!0);return p.concat(h)}Vo.generate=ZZe;function jle(t,e){let r=t;return e.braceExpansion&&(r=Hu.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(s=>s.includes(\"/\")?s:`**/${s}`)),r.map(s=>Hu.pattern.removeDuplicateSlashes(s))}function o3(t,e,r){let s=[],a=Hu.pattern.getPatternsOutsideCurrentDirectory(t),n=Hu.pattern.getPatternsInsideCurrentDirectory(t),c=a3(a),f=a3(n);return s.push(...l3(c,e,r)),\".\"in f?s.push(c3(\".\",n,e,r)):s.push(...l3(f,e,r)),s}Vo.convertPatternsToTasks=o3;function Gle(t){return Hu.pattern.getPositivePatterns(t)}Vo.getPositivePatterns=Gle;function qle(t,e){return Hu.pattern.getNegativePatterns(t).concat(e).map(Hu.pattern.convertToPositivePattern)}Vo.getNegativePatternsAsPositive=qle;function a3(t){let e={};return t.reduce((r,s)=>{let a=Hu.pattern.getBaseDirectory(s);return a in r?r[a].push(s):r[a]=[s],r},e)}Vo.groupPatternsByBaseDirectory=a3;function l3(t,e,r){return Object.keys(t).map(s=>c3(s,t[s],e,r))}Vo.convertPatternGroupsToTasks=l3;function c3(t,e,r,s){return{dynamic:s,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Hu.pattern.convertToNegativePattern))}}Vo.convertPatternGroupToTask=c3});var Vle=_(iQ=>{\"use strict\";Object.defineProperty(iQ,\"__esModule\",{value:!0});iQ.read=void 0;function XZe(t,e,r){e.fs.lstat(t,(s,a)=>{if(s!==null){Yle(r,s);return}if(!a.isSymbolicLink()||!e.followSymbolicLink){u3(r,a);return}e.fs.stat(t,(n,c)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){Yle(r,n);return}u3(r,a);return}e.markSymbolicLink&&(c.isSymbolicLink=()=>!0),u3(r,c)})})}iQ.read=XZe;function Yle(t,e){t(e)}function u3(t,e){t(null,e)}});var Jle=_(sQ=>{\"use strict\";Object.defineProperty(sQ,\"__esModule\",{value:!0});sQ.read=void 0;function $Ze(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let s=e.fs.statSync(t);return e.markSymbolicLink&&(s.isSymbolicLink=()=>!0),s}catch(s){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw s}}sQ.read=$Ze});var Kle=_(h0=>{\"use strict\";Object.defineProperty(h0,\"__esModule\",{value:!0});h0.createFileSystemAdapter=h0.FILE_SYSTEM_ADAPTER=void 0;var oQ=Ie(\"fs\");h0.FILE_SYSTEM_ADAPTER={lstat:oQ.lstat,stat:oQ.stat,lstatSync:oQ.lstatSync,statSync:oQ.statSync};function eXe(t){return t===void 0?h0.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},h0.FILE_SYSTEM_ADAPTER),t)}h0.createFileSystemAdapter=eXe});var zle=_(A3=>{\"use strict\";Object.defineProperty(A3,\"__esModule\",{value:!0});var tXe=Kle(),f3=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=tXe.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};A3.default=f3});var Xd=_(g0=>{\"use strict\";Object.defineProperty(g0,\"__esModule\",{value:!0});g0.statSync=g0.stat=g0.Settings=void 0;var Zle=Vle(),rXe=Jle(),p3=zle();g0.Settings=p3.default;function nXe(t,e,r){if(typeof e==\"function\"){Zle.read(t,h3(),e);return}Zle.read(t,h3(e),r)}g0.stat=nXe;function iXe(t,e){let r=h3(e);return rXe.read(t,r)}g0.statSync=iXe;function h3(t={}){return t instanceof p3.default?t:new p3.default(t)}});var ece=_(($Ot,$le)=>{var Xle;$le.exports=typeof queueMicrotask==\"function\"?queueMicrotask.bind(typeof window<\"u\"?window:global):t=>(Xle||(Xle=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var rce=_((eLt,tce)=>{tce.exports=oXe;var sXe=ece();function oXe(t,e){let r,s,a,n=!0;Array.isArray(t)?(r=[],s=t.length):(a=Object.keys(t),r={},s=a.length);function c(p){function h(){e&&e(p,r),e=null}n?sXe(h):h()}function f(p,h,E){r[p]=E,(--s===0||h)&&c(h)}s?a?a.forEach(function(p){t[p](function(h,E){f(p,h,E)})}):t.forEach(function(p,h){p(function(E,C){f(h,E,C)})}):c(null),n=!1}});var g3=_(lQ=>{\"use strict\";Object.defineProperty(lQ,\"__esModule\",{value:!0});lQ.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var aQ=process.versions.node.split(\".\");if(aQ[0]===void 0||aQ[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var nce=Number.parseInt(aQ[0],10),aXe=Number.parseInt(aQ[1],10),ice=10,lXe=10,cXe=nce>ice,uXe=nce===ice&&aXe>=lXe;lQ.IS_SUPPORT_READDIR_WITH_FILE_TYPES=cXe||uXe});var sce=_(cQ=>{\"use strict\";Object.defineProperty(cQ,\"__esModule\",{value:!0});cQ.createDirentFromStats=void 0;var d3=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function fXe(t,e){return new d3(t,e)}cQ.createDirentFromStats=fXe});var m3=_(uQ=>{\"use strict\";Object.defineProperty(uQ,\"__esModule\",{value:!0});uQ.fs=void 0;var AXe=sce();uQ.fs=AXe});var y3=_(fQ=>{\"use strict\";Object.defineProperty(fQ,\"__esModule\",{value:!0});fQ.joinPathSegments=void 0;function pXe(t,e,r){return t.endsWith(r)?t+e:t+r+e}fQ.joinPathSegments=pXe});var fce=_(d0=>{\"use strict\";Object.defineProperty(d0,\"__esModule\",{value:!0});d0.readdir=d0.readdirWithFileTypes=d0.read=void 0;var hXe=Xd(),oce=rce(),gXe=g3(),ace=m3(),lce=y3();function dXe(t,e,r){if(!e.stats&&gXe.IS_SUPPORT_READDIR_WITH_FILE_TYPES){cce(t,e,r);return}uce(t,e,r)}d0.read=dXe;function cce(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(s,a)=>{if(s!==null){AQ(r,s);return}let n=a.map(f=>({dirent:f,name:f.name,path:lce.joinPathSegments(t,f.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){E3(r,n);return}let c=n.map(f=>mXe(f,e));oce(c,(f,p)=>{if(f!==null){AQ(r,f);return}E3(r,p)})})}d0.readdirWithFileTypes=cce;function mXe(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(s,a)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){r(s);return}r(null,t);return}t.dirent=ace.fs.createDirentFromStats(t.name,a),r(null,t)})}}function uce(t,e,r){e.fs.readdir(t,(s,a)=>{if(s!==null){AQ(r,s);return}let n=a.map(c=>{let f=lce.joinPathSegments(t,c,e.pathSegmentSeparator);return p=>{hXe.stat(f,e.fsStatSettings,(h,E)=>{if(h!==null){p(h);return}let C={name:c,path:f,dirent:ace.fs.createDirentFromStats(c,E)};e.stats&&(C.stats=E),p(null,C)})}});oce(n,(c,f)=>{if(c!==null){AQ(r,c);return}E3(r,f)})})}d0.readdir=uce;function AQ(t,e){t(e)}function E3(t,e){t(null,e)}});var dce=_(m0=>{\"use strict\";Object.defineProperty(m0,\"__esModule\",{value:!0});m0.readdir=m0.readdirWithFileTypes=m0.read=void 0;var yXe=Xd(),EXe=g3(),Ace=m3(),pce=y3();function IXe(t,e){return!e.stats&&EXe.IS_SUPPORT_READDIR_WITH_FILE_TYPES?hce(t,e):gce(t,e)}m0.read=IXe;function hce(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(s=>{let a={dirent:s,name:s.name,path:pce.joinPathSegments(t,s.name,e.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let n=e.fs.statSync(a.path);a.dirent=Ace.fs.createDirentFromStats(a.name,n)}catch(n){if(e.throwErrorOnBrokenSymbolicLink)throw n}return a})}m0.readdirWithFileTypes=hce;function gce(t,e){return e.fs.readdirSync(t).map(s=>{let a=pce.joinPathSegments(t,s,e.pathSegmentSeparator),n=yXe.statSync(a,e.fsStatSettings),c={name:s,path:a,dirent:Ace.fs.createDirentFromStats(s,n)};return e.stats&&(c.stats=n),c})}m0.readdir=gce});var mce=_(y0=>{\"use strict\";Object.defineProperty(y0,\"__esModule\",{value:!0});y0.createFileSystemAdapter=y0.FILE_SYSTEM_ADAPTER=void 0;var XE=Ie(\"fs\");y0.FILE_SYSTEM_ADAPTER={lstat:XE.lstat,stat:XE.stat,lstatSync:XE.lstatSync,statSync:XE.statSync,readdir:XE.readdir,readdirSync:XE.readdirSync};function CXe(t){return t===void 0?y0.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},y0.FILE_SYSTEM_ADAPTER),t)}y0.createFileSystemAdapter=CXe});var yce=_(C3=>{\"use strict\";Object.defineProperty(C3,\"__esModule\",{value:!0});var wXe=Ie(\"path\"),BXe=Xd(),vXe=mce(),I3=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=vXe.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,wXe.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new BXe.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};C3.default=I3});var pQ=_(E0=>{\"use strict\";Object.defineProperty(E0,\"__esModule\",{value:!0});E0.Settings=E0.scandirSync=E0.scandir=void 0;var Ece=fce(),SXe=dce(),w3=yce();E0.Settings=w3.default;function DXe(t,e,r){if(typeof e==\"function\"){Ece.read(t,B3(),e);return}Ece.read(t,B3(e),r)}E0.scandir=DXe;function PXe(t,e){let r=B3(e);return SXe.read(t,r)}E0.scandirSync=PXe;function B3(t={}){return t instanceof w3.default?t:new w3.default(t)}});var Cce=_((uLt,Ice)=>{\"use strict\";function bXe(t){var e=new t,r=e;function s(){var n=e;return n.next?e=n.next:(e=new t,r=e),n.next=null,n}function a(n){r.next=n,r=n}return{get:s,release:a}}Ice.exports=bXe});var Bce=_((fLt,v3)=>{\"use strict\";var xXe=Cce();function wce(t,e,r){if(typeof t==\"function\"&&(r=e,e=t,t=null),!(r>=1))throw new Error(\"fastqueue concurrency must be equal to or greater than 1\");var s=xXe(kXe),a=null,n=null,c=0,f=null,p={push:T,drain:kc,saturated:kc,pause:E,paused:!1,get concurrency(){return r},set concurrency(ue){if(!(ue>=1))throw new Error(\"fastqueue concurrency must be equal to or greater than 1\");if(r=ue,!p.paused)for(;a&&c<r;)c++,U()},running:h,resume:b,idle:I,length:C,getQueue:S,unshift:N,empty:kc,kill:W,killAndDrain:ee,error:ie};return p;function h(){return c}function E(){p.paused=!0}function C(){for(var ue=a,le=0;ue;)ue=ue.next,le++;return le}function S(){for(var ue=a,le=[];ue;)le.push(ue.value),ue=ue.next;return le}function b(){if(p.paused){if(p.paused=!1,a===null){c++,U();return}for(;a&&c<r;)c++,U()}}function I(){return c===0&&p.length()===0}function T(ue,le){var me=s.get();me.context=t,me.release=U,me.value=ue,me.callback=le||kc,me.errorHandler=f,c>=r||p.paused?n?(n.next=me,n=me):(a=me,n=me,p.saturated()):(c++,e.call(t,me.value,me.worked))}function N(ue,le){var me=s.get();me.context=t,me.release=U,me.value=ue,me.callback=le||kc,me.errorHandler=f,c>=r||p.paused?a?(me.next=a,a=me):(a=me,n=me,p.saturated()):(c++,e.call(t,me.value,me.worked))}function U(ue){ue&&s.release(ue);var le=a;le&&c<=r?p.paused?c--:(n===a&&(n=null),a=le.next,le.next=null,e.call(t,le.value,le.worked),n===null&&p.empty()):--c===0&&p.drain()}function W(){a=null,n=null,p.drain=kc}function ee(){a=null,n=null,p.drain(),p.drain=kc}function ie(ue){f=ue}}function kc(){}function kXe(){this.value=null,this.callback=kc,this.next=null,this.release=kc,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,s){var a=t.callback,n=t.errorHandler,c=t.value;t.value=null,t.callback=kc,t.errorHandler&&n(r,c),a.call(t.context,r,s),t.release(t)}}function QXe(t,e,r){typeof t==\"function\"&&(r=e,e=t,t=null);function s(E,C){e.call(this,E).then(function(S){C(null,S)},C)}var a=wce(t,s,r),n=a.push,c=a.unshift;return a.push=f,a.unshift=p,a.drained=h,a;function f(E){var C=new Promise(function(S,b){n(E,function(I,T){if(I){b(I);return}S(T)})});return C.catch(kc),C}function p(E){var C=new Promise(function(S,b){c(E,function(I,T){if(I){b(I);return}S(T)})});return C.catch(kc),C}function h(){if(a.idle())return new Promise(function(S){S()});var E=a.drain,C=new Promise(function(S){a.drain=function(){E(),S()}});return C}}v3.exports=wce;v3.exports.promise=QXe});var hQ=_(zf=>{\"use strict\";Object.defineProperty(zf,\"__esModule\",{value:!0});zf.joinPathSegments=zf.replacePathSegmentSeparator=zf.isAppliedFilter=zf.isFatalError=void 0;function RXe(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}zf.isFatalError=RXe;function TXe(t,e){return t===null||t(e)}zf.isAppliedFilter=TXe;function FXe(t,e){return t.split(/[/\\\\]/).join(e)}zf.replacePathSegmentSeparator=FXe;function NXe(t,e,r){return t===\"\"?e:t.endsWith(r)?t+e:t+r+e}zf.joinPathSegments=NXe});var P3=_(D3=>{\"use strict\";Object.defineProperty(D3,\"__esModule\",{value:!0});var OXe=hQ(),S3=class{constructor(e,r){this._root=e,this._settings=r,this._root=OXe.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};D3.default=S3});var k3=_(x3=>{\"use strict\";Object.defineProperty(x3,\"__esModule\",{value:!0});var LXe=Ie(\"events\"),MXe=pQ(),UXe=Bce(),gQ=hQ(),_Xe=P3(),b3=class extends _Xe.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=MXe.scandir,this._emitter=new LXe.EventEmitter,this._queue=UXe(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(\"end\")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error(\"The reader is already destroyed\");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(\"entry\",e)}onError(e){this._emitter.once(\"error\",e)}onEnd(e){this._emitter.once(\"end\",e)}_pushToQueue(e,r){let s={directory:e,base:r};this._queue.push(s,a=>{a!==null&&this._handleError(a)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(s,a)=>{if(s!==null){r(s,void 0);return}for(let n of a)this._handleEntry(n,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!gQ.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(\"error\",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let s=e.path;r!==void 0&&(e.path=gQ.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),gQ.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&gQ.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(s,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(\"entry\",e)}};x3.default=b3});var vce=_(R3=>{\"use strict\";Object.defineProperty(R3,\"__esModule\",{value:!0});var HXe=k3(),Q3=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new HXe.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{jXe(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{GXe(e,this._storage)}),this._reader.read()}};R3.default=Q3;function jXe(t,e){t(e)}function GXe(t,e){t(null,e)}});var Sce=_(F3=>{\"use strict\";Object.defineProperty(F3,\"__esModule\",{value:!0});var qXe=Ie(\"stream\"),WXe=k3(),T3=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new WXe.default(this._root,this._settings),this._stream=new qXe.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(\"error\",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};F3.default=T3});var Dce=_(O3=>{\"use strict\";Object.defineProperty(O3,\"__esModule\",{value:!0});var YXe=pQ(),dQ=hQ(),VXe=P3(),N3=class extends VXe.default{constructor(){super(...arguments),this._scandir=YXe.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let s=this._scandir(e,this._settings.fsScandirSettings);for(let a of s)this._handleEntry(a,r)}catch(s){this._handleError(s)}}_handleError(e){if(dQ.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let s=e.path;r!==void 0&&(e.path=dQ.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),dQ.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&dQ.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(s,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};O3.default=N3});var Pce=_(M3=>{\"use strict\";Object.defineProperty(M3,\"__esModule\",{value:!0});var JXe=Dce(),L3=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new JXe.default(this._root,this._settings)}read(){return this._reader.read()}};M3.default=L3});var bce=_(_3=>{\"use strict\";Object.defineProperty(_3,\"__esModule\",{value:!0});var KXe=Ie(\"path\"),zXe=pQ(),U3=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,KXe.sep),this.fsScandirSettings=new zXe.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};_3.default=U3});var yQ=_(Zf=>{\"use strict\";Object.defineProperty(Zf,\"__esModule\",{value:!0});Zf.Settings=Zf.walkStream=Zf.walkSync=Zf.walk=void 0;var xce=vce(),ZXe=Sce(),XXe=Pce(),H3=bce();Zf.Settings=H3.default;function $Xe(t,e,r){if(typeof e==\"function\"){new xce.default(t,mQ()).read(e);return}new xce.default(t,mQ(e)).read(r)}Zf.walk=$Xe;function e$e(t,e){let r=mQ(e);return new XXe.default(t,r).read()}Zf.walkSync=e$e;function t$e(t,e){let r=mQ(e);return new ZXe.default(t,r).read()}Zf.walkStream=t$e;function mQ(t={}){return t instanceof H3.default?t:new H3.default(t)}});var EQ=_(G3=>{\"use strict\";Object.defineProperty(G3,\"__esModule\",{value:!0});var r$e=Ie(\"path\"),n$e=Xd(),kce=xp(),j3=class{constructor(e){this._settings=e,this._fsStatSettings=new n$e.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return r$e.resolve(this._settings.cwd,e)}_makeEntry(e,r){let s={name:r,path:r,dirent:kce.fs.createDirentFromStats(r,e)};return this._settings.stats&&(s.stats=e),s}_isFatalError(e){return!kce.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};G3.default=j3});var Y3=_(W3=>{\"use strict\";Object.defineProperty(W3,\"__esModule\",{value:!0});var i$e=Ie(\"stream\"),s$e=Xd(),o$e=yQ(),a$e=EQ(),q3=class extends a$e.default{constructor(){super(...arguments),this._walkStream=o$e.walkStream,this._stat=s$e.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let s=e.map(this._getFullEntryPath,this),a=new i$e.PassThrough({objectMode:!0});a._write=(n,c,f)=>this._getEntry(s[n],e[n],r).then(p=>{p!==null&&r.entryFilter(p)&&a.push(p),n===s.length-1&&a.end(),f()}).catch(f);for(let n=0;n<s.length;n++)a.write(n);return a}_getEntry(e,r,s){return this._getStat(e).then(a=>this._makeEntry(a,r)).catch(a=>{if(s.errorFilter(a))return null;throw a})}_getStat(e){return new Promise((r,s)=>{this._stat(e,this._fsStatSettings,(a,n)=>a===null?r(n):s(a))})}};W3.default=q3});var Qce=_(J3=>{\"use strict\";Object.defineProperty(J3,\"__esModule\",{value:!0});var l$e=yQ(),c$e=EQ(),u$e=Y3(),V3=class extends c$e.default{constructor(){super(...arguments),this._walkAsync=l$e.walk,this._readerStream=new u$e.default(this._settings)}dynamic(e,r){return new Promise((s,a)=>{this._walkAsync(e,r,(n,c)=>{n===null?s(c):a(n)})})}async static(e,r){let s=[],a=this._readerStream.static(e,r);return new Promise((n,c)=>{a.once(\"error\",c),a.on(\"data\",f=>s.push(f)),a.once(\"end\",()=>n(s))})}};J3.default=V3});var Rce=_(z3=>{\"use strict\";Object.defineProperty(z3,\"__esModule\",{value:!0});var NB=xp(),K3=class{constructor(e,r,s){this._patterns=e,this._settings=r,this._micromatchOptions=s,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),s=this._splitSegmentsIntoSections(r);this._storage.push({complete:s.length<=1,pattern:e,segments:r,sections:s})}}_getPatternSegments(e){return NB.pattern.getPatternParts(e,this._micromatchOptions).map(s=>NB.pattern.isDynamicPattern(s,this._settings)?{dynamic:!0,pattern:s,patternRe:NB.pattern.makeRe(s,this._micromatchOptions)}:{dynamic:!1,pattern:s})}_splitSegmentsIntoSections(e){return NB.array.splitWhen(e,r=>r.dynamic&&NB.pattern.hasGlobStar(r.pattern))}};z3.default=K3});var Tce=_(X3=>{\"use strict\";Object.defineProperty(X3,\"__esModule\",{value:!0});var f$e=Rce(),Z3=class extends f$e.default{match(e){let r=e.split(\"/\"),s=r.length,a=this._storage.filter(n=>!n.complete||n.segments.length>s);for(let n of a){let c=n.sections[0];if(!n.complete&&s>c.length||r.every((p,h)=>{let E=n.segments[h];return!!(E.dynamic&&E.patternRe.test(p)||!E.dynamic&&E.pattern===p)}))return!0}return!1}};X3.default=Z3});var Fce=_(e8=>{\"use strict\";Object.defineProperty(e8,\"__esModule\",{value:!0});var IQ=xp(),A$e=Tce(),$3=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,s){let a=this._getMatcher(r),n=this._getNegativePatternsRe(s);return c=>this._filter(e,c,a,n)}_getMatcher(e){return new A$e.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(IQ.pattern.isAffectDepthOfReadingPattern);return IQ.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,s,a){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let n=IQ.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(n,s)?!1:this._isSkippedByNegativePatterns(n,a)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let s=r.split(\"/\").length;if(e===\"\")return s;let a=e.split(\"/\").length;return s-a}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!IQ.pattern.matchAny(e,r)}};e8.default=$3});var Nce=_(r8=>{\"use strict\";Object.defineProperty(r8,\"__esModule\",{value:!0});var $d=xp(),t8=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let s=$d.pattern.convertPatternsToRe(e,this._micromatchOptions),a=$d.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}));return n=>this._filter(n,s,a)}_filter(e,r,s){let a=$d.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(a)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(a,s))return!1;let n=e.dirent.isDirectory(),c=this._isMatchToPatterns(a,r,n)&&!this._isMatchToPatterns(a,s,n);return this._settings.unique&&c&&this._createIndexRecord(a),c}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,r){if(!this._settings.absolute)return!1;let s=$d.path.makeAbsolute(this._settings.cwd,e);return $d.pattern.matchAny(s,r)}_isMatchToPatterns(e,r,s){let a=$d.pattern.matchAny(e,r);return!a&&s?$d.pattern.matchAny(e+\"/\",r):a}};r8.default=t8});var Oce=_(i8=>{\"use strict\";Object.defineProperty(i8,\"__esModule\",{value:!0});var p$e=xp(),n8=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return p$e.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};i8.default=n8});var Mce=_(o8=>{\"use strict\";Object.defineProperty(o8,\"__esModule\",{value:!0});var Lce=xp(),s8=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Lce.path.makeAbsolute(this._settings.cwd,r),r=Lce.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+=\"/\"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};o8.default=s8});var CQ=_(l8=>{\"use strict\";Object.defineProperty(l8,\"__esModule\",{value:!0});var h$e=Ie(\"path\"),g$e=Fce(),d$e=Nce(),m$e=Oce(),y$e=Mce(),a8=class{constructor(e){this._settings=e,this.errorFilter=new m$e.default(this._settings),this.entryFilter=new d$e.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new g$e.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new y$e.default(this._settings)}_getRootDirectory(e){return h$e.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base===\".\"?\"\":e.base;return{basePath:r,pathSegmentSeparator:\"/\",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};l8.default=a8});var Uce=_(u8=>{\"use strict\";Object.defineProperty(u8,\"__esModule\",{value:!0});var E$e=Qce(),I$e=CQ(),c8=class extends I$e.default{constructor(){super(...arguments),this._reader=new E$e.default(this._settings)}async read(e){let r=this._getRootDirectory(e),s=this._getReaderOptions(e);return(await this.api(r,e,s)).map(n=>s.transform(n))}api(e,r,s){return r.dynamic?this._reader.dynamic(e,s):this._reader.static(r.patterns,s)}};u8.default=c8});var _ce=_(A8=>{\"use strict\";Object.defineProperty(A8,\"__esModule\",{value:!0});var C$e=Ie(\"stream\"),w$e=Y3(),B$e=CQ(),f8=class extends B$e.default{constructor(){super(...arguments),this._reader=new w$e.default(this._settings)}read(e){let r=this._getRootDirectory(e),s=this._getReaderOptions(e),a=this.api(r,e,s),n=new C$e.Readable({objectMode:!0,read:()=>{}});return a.once(\"error\",c=>n.emit(\"error\",c)).on(\"data\",c=>n.emit(\"data\",s.transform(c))).once(\"end\",()=>n.emit(\"end\")),n.once(\"close\",()=>a.destroy()),n}api(e,r,s){return r.dynamic?this._reader.dynamic(e,s):this._reader.static(r.patterns,s)}};A8.default=f8});var Hce=_(h8=>{\"use strict\";Object.defineProperty(h8,\"__esModule\",{value:!0});var v$e=Xd(),S$e=yQ(),D$e=EQ(),p8=class extends D$e.default{constructor(){super(...arguments),this._walkSync=S$e.walkSync,this._statSync=v$e.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let s=[];for(let a of e){let n=this._getFullEntryPath(a),c=this._getEntry(n,a,r);c===null||!r.entryFilter(c)||s.push(c)}return s}_getEntry(e,r,s){try{let a=this._getStat(e);return this._makeEntry(a,r)}catch(a){if(s.errorFilter(a))return null;throw a}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};h8.default=p8});var jce=_(d8=>{\"use strict\";Object.defineProperty(d8,\"__esModule\",{value:!0});var P$e=Hce(),b$e=CQ(),g8=class extends b$e.default{constructor(){super(...arguments),this._reader=new P$e.default(this._settings)}read(e){let r=this._getRootDirectory(e),s=this._getReaderOptions(e);return this.api(r,e,s).map(s.transform)}api(e,r,s){return r.dynamic?this._reader.dynamic(e,s):this._reader.static(r.patterns,s)}};d8.default=g8});var Gce=_(eI=>{\"use strict\";Object.defineProperty(eI,\"__esModule\",{value:!0});eI.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var $E=Ie(\"fs\"),x$e=Ie(\"os\"),k$e=Math.max(x$e.cpus().length,1);eI.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:$E.lstat,lstatSync:$E.lstatSync,stat:$E.stat,statSync:$E.statSync,readdir:$E.readdir,readdirSync:$E.readdirSync};var m8=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,k$e),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},eI.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};eI.default=m8});var wQ=_((OLt,Wce)=>{\"use strict\";var qce=Wle(),Q$e=Uce(),R$e=_ce(),T$e=jce(),y8=Gce(),Qc=xp();async function E8(t,e){ju(t);let r=I8(t,Q$e.default,e),s=await Promise.all(r);return Qc.array.flatten(s)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(h,E){ju(h);let C=I8(h,T$e.default,E);return Qc.array.flatten(C)}t.sync=e;function r(h,E){ju(h);let C=I8(h,R$e.default,E);return Qc.stream.merge(C)}t.stream=r;function s(h,E){ju(h);let C=[].concat(h),S=new y8.default(E);return qce.generate(C,S)}t.generateTasks=s;function a(h,E){ju(h);let C=new y8.default(E);return Qc.pattern.isDynamicPattern(h,C)}t.isDynamicPattern=a;function n(h){return ju(h),Qc.path.escape(h)}t.escapePath=n;function c(h){return ju(h),Qc.path.convertPathToPattern(h)}t.convertPathToPattern=c;let f;(function(h){function E(S){return ju(S),Qc.path.escapePosixPath(S)}h.escapePath=E;function C(S){return ju(S),Qc.path.convertPosixPathToPattern(S)}h.convertPathToPattern=C})(f=t.posix||(t.posix={}));let p;(function(h){function E(S){return ju(S),Qc.path.escapeWindowsPath(S)}h.escapePath=E;function C(S){return ju(S),Qc.path.convertWindowsPathToPattern(S)}h.convertPathToPattern=C})(p=t.win32||(t.win32={}))})(E8||(E8={}));function I8(t,e,r){let s=[].concat(t),a=new y8.default(r),n=qce.generate(s,a),c=new e(a);return n.map(c.read,c)}function ju(t){if(![].concat(t).every(s=>Qc.string.isString(s)&&!Qc.string.isEmpty(s)))throw new TypeError(\"Patterns must be a string (non empty) or an array of strings\")}Wce.exports=E8});var Nn={};Vt(Nn,{checksumFile:()=>vQ,checksumPattern:()=>SQ,makeHash:()=>cs});function cs(...t){let e=(0,BQ.createHash)(\"sha512\"),r=\"\";for(let s of t)typeof s==\"string\"?r+=s:s&&(r&&(e.update(r),r=\"\"),e.update(s));return r&&e.update(r),e.digest(\"hex\")}async function vQ(t,{baseFs:e,algorithm:r}={baseFs:ce,algorithm:\"sha512\"}){let s=await e.openPromise(t,\"r\");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,BQ.createHash)(r),f=0;for(;(f=await e.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest(\"hex\")}finally{await e.closePromise(s)}}async function SQ(t,{cwd:e}){let s=(await(0,C8.default)(t,{cwd:fe.fromPortablePath(e),onlyDirectories:!0})).map(f=>`${f}/**/*`),a=await(0,C8.default)([t,...s],{cwd:fe.fromPortablePath(e),onlyFiles:!1});a.sort();let n=await Promise.all(a.map(async f=>{let p=[Buffer.from(f)],h=J.join(e,fe.toPortablePath(f)),E=await ce.lstatPromise(h);return E.isSymbolicLink()?p.push(Buffer.from(await ce.readlinkPromise(h))):E.isFile()&&p.push(await ce.readFilePromise(h)),p.join(\"\\0\")})),c=(0,BQ.createHash)(\"sha512\");for(let f of n)c.update(f);return c.digest(\"hex\")}var BQ,C8,I0=Ze(()=>{Dt();BQ=Ie(\"crypto\"),C8=ut(wQ())});var G={};Vt(G,{allPeerRequests:()=>qB,areDescriptorsEqual:()=>zce,areIdentsEqual:()=>UB,areLocatorsEqual:()=>_B,areVirtualPackagesEquivalent:()=>j$e,bindDescriptor:()=>_$e,bindLocator:()=>H$e,convertDescriptorToLocator:()=>DQ,convertLocatorToDescriptor:()=>B8,convertPackageToLocator:()=>L$e,convertToIdent:()=>O$e,convertToManifestRange:()=>X$e,copyPackage:()=>LB,devirtualizeDescriptor:()=>MB,devirtualizeLocator:()=>rI,ensureDevirtualizedDescriptor:()=>M$e,ensureDevirtualizedLocator:()=>U$e,getIdentVendorPath:()=>P8,isPackageCompatible:()=>QQ,isVirtualDescriptor:()=>kp,isVirtualLocator:()=>Gu,makeDescriptor:()=>On,makeIdent:()=>Da,makeLocator:()=>Ws,makeRange:()=>xQ,parseDescriptor:()=>C0,parseFileStyleRange:()=>z$e,parseIdent:()=>Sa,parseLocator:()=>Qp,parseRange:()=>em,prettyDependent:()=>$4,prettyDescriptor:()=>ni,prettyIdent:()=>Xi,prettyLocator:()=>Yr,prettyLocatorNoColors:()=>X4,prettyRange:()=>iI,prettyReference:()=>jB,prettyResolution:()=>FB,prettyWorkspace:()=>GB,renamePackage:()=>v8,slugifyIdent:()=>w8,slugifyLocator:()=>nI,sortDescriptors:()=>sI,stringifyDescriptor:()=>al,stringifyIdent:()=>un,stringifyLocator:()=>ll,tryParseDescriptor:()=>HB,tryParseIdent:()=>Zce,tryParseLocator:()=>bQ,tryParseRange:()=>K$e,unwrapIdentFromScope:()=>eet,virtualizeDescriptor:()=>S8,virtualizePackage:()=>D8,wrapIdentIntoScope:()=>$$e});function Da(t,e){if(t?.startsWith(\"@\"))throw new Error(\"Invalid scope: don't prefix it with '@'\");return{identHash:cs(t,e),scope:t,name:e}}function On(t,e){return{identHash:t.identHash,scope:t.scope,name:t.name,descriptorHash:cs(t.identHash,e),range:e}}function Ws(t,e){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:cs(t.identHash,e),reference:e}}function O$e(t){return{identHash:t.identHash,scope:t.scope,name:t.name}}function DQ(t){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:t.descriptorHash,reference:t.range}}function B8(t){return{identHash:t.identHash,scope:t.scope,name:t.name,descriptorHash:t.locatorHash,range:t.reference}}function L$e(t){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:t.locatorHash,reference:t.reference}}function v8(t,e){return{identHash:e.identHash,scope:e.scope,name:e.name,locatorHash:e.locatorHash,reference:e.reference,version:t.version,languageName:t.languageName,linkType:t.linkType,conditions:t.conditions,dependencies:new Map(t.dependencies),peerDependencies:new Map(t.peerDependencies),dependenciesMeta:new Map(t.dependenciesMeta),peerDependenciesMeta:new Map(t.peerDependenciesMeta),bin:new Map(t.bin)}}function LB(t){return v8(t,t)}function S8(t,e){if(e.includes(\"#\"))throw new Error(\"Invalid entropy\");return On(t,`virtual:${e}#${t.range}`)}function D8(t,e){if(e.includes(\"#\"))throw new Error(\"Invalid entropy\");return v8(t,Ws(t,`virtual:${e}#${t.reference}`))}function kp(t){return t.range.startsWith(OB)}function Gu(t){return t.reference.startsWith(OB)}function MB(t){if(!kp(t))throw new Error(\"Not a virtual descriptor\");return On(t,t.range.replace(PQ,\"\"))}function rI(t){if(!Gu(t))throw new Error(\"Not a virtual descriptor\");return Ws(t,t.reference.replace(PQ,\"\"))}function M$e(t){return kp(t)?On(t,t.range.replace(PQ,\"\")):t}function U$e(t){return Gu(t)?Ws(t,t.reference.replace(PQ,\"\")):t}function _$e(t,e){return t.range.includes(\"::\")?t:On(t,`${t.range}::${tI.default.stringify(e)}`)}function H$e(t,e){return t.reference.includes(\"::\")?t:Ws(t,`${t.reference}::${tI.default.stringify(e)}`)}function UB(t,e){return t.identHash===e.identHash}function zce(t,e){return t.descriptorHash===e.descriptorHash}function _B(t,e){return t.locatorHash===e.locatorHash}function j$e(t,e){if(!Gu(t))throw new Error(\"Invalid package type\");if(!Gu(e))throw new Error(\"Invalid package type\");if(!UB(t,e)||t.dependencies.size!==e.dependencies.size)return!1;for(let r of t.dependencies.values()){let s=e.dependencies.get(r.identHash);if(!s||!zce(r,s))return!1}return!0}function Sa(t){let e=Zce(t);if(!e)throw new Error(`Invalid ident (${t})`);return e}function Zce(t){let e=t.match(G$e);if(!e)return null;let[,r,s]=e;return Da(typeof r<\"u\"?r:null,s)}function C0(t,e=!1){let r=HB(t,e);if(!r)throw new Error(`Invalid descriptor (${t})`);return r}function HB(t,e=!1){let r=e?t.match(q$e):t.match(W$e);if(!r)return null;let[,s,a,n]=r;if(n===\"unknown\")throw new Error(`Invalid range (${t})`);let c=typeof s<\"u\"?s:null,f=typeof n<\"u\"?n:\"unknown\";return On(Da(c,a),f)}function Qp(t,e=!1){let r=bQ(t,e);if(!r)throw new Error(`Invalid locator (${t})`);return r}function bQ(t,e=!1){let r=e?t.match(Y$e):t.match(V$e);if(!r)return null;let[,s,a,n]=r;if(n===\"unknown\")throw new Error(`Invalid reference (${t})`);let c=typeof s<\"u\"?s:null,f=typeof n<\"u\"?n:\"unknown\";return Ws(Da(c,a),f)}function em(t,e){let r=t.match(J$e);if(r===null)throw new Error(`Invalid range (${t})`);let s=typeof r[1]<\"u\"?r[1]:null;if(typeof e?.requireProtocol==\"string\"&&s!==e.requireProtocol)throw new Error(`Invalid protocol (${s})`);if(e?.requireProtocol&&s===null)throw new Error(`Missing protocol (${s})`);let a=typeof r[3]<\"u\"?decodeURIComponent(r[2]):null;if(e?.requireSource&&a===null)throw new Error(`Missing source (${t})`);let n=typeof r[3]<\"u\"?decodeURIComponent(r[3]):decodeURIComponent(r[2]),c=e?.parseSelector?tI.default.parse(n):n,f=typeof r[4]<\"u\"?tI.default.parse(r[4]):null;return{protocol:s,source:a,selector:c,params:f}}function K$e(t,e){try{return em(t,e)}catch{return null}}function z$e(t,{protocol:e}){let{selector:r,params:s}=em(t,{requireProtocol:e,requireBindings:!0});if(typeof s.locator!=\"string\")throw new Error(`Assertion failed: Invalid bindings for ${t}`);return{parentLocator:Qp(s.locator,!0),path:r}}function Yce(t){return t=t.replaceAll(\"%\",\"%25\"),t=t.replaceAll(\":\",\"%3A\"),t=t.replaceAll(\"#\",\"%23\"),t}function Z$e(t){return t===null?!1:Object.entries(t).length>0}function xQ({protocol:t,source:e,selector:r,params:s}){let a=\"\";return t!==null&&(a+=`${t}`),e!==null&&(a+=`${Yce(e)}#`),a+=Yce(r),Z$e(s)&&(a+=`::${tI.default.stringify(s)}`),a}function X$e(t){let{params:e,protocol:r,source:s,selector:a}=em(t);for(let n in e)n.startsWith(\"__\")&&delete e[n];return xQ({protocol:r,source:s,params:e,selector:a})}function un(t){return t.scope?`@${t.scope}/${t.name}`:`${t.name}`}function $$e(t,e){return t.scope?Da(e,`${t.scope}__${t.name}`):Da(e,t.name)}function eet(t,e){if(t.scope!==e)return t;let r=t.name.indexOf(\"__\");if(r===-1)return Da(null,t.name);let s=t.name.slice(0,r),a=t.name.slice(r+2);return Da(s,a)}function al(t){return t.scope?`@${t.scope}/${t.name}@${t.range}`:`${t.name}@${t.range}`}function ll(t){return t.scope?`@${t.scope}/${t.name}@${t.reference}`:`${t.name}@${t.reference}`}function w8(t){return t.scope!==null?`@${t.scope}-${t.name}`:t.name}function nI(t){let{protocol:e,selector:r}=em(t.reference),s=e!==null?e.replace(tet,\"\"):\"exotic\",a=Vce.default.valid(r),n=a!==null?`${s}-${a}`:`${s}`,c=10;return t.scope?`${w8(t)}-${n}-${t.locatorHash.slice(0,c)}`:`${w8(t)}-${n}-${t.locatorHash.slice(0,c)}`}function Xi(t,e){return e.scope?`${Ht(t,`@${e.scope}/`,ht.SCOPE)}${Ht(t,e.name,ht.NAME)}`:`${Ht(t,e.name,ht.NAME)}`}function kQ(t){if(t.startsWith(OB)){let e=kQ(t.substring(t.indexOf(\"#\")+1)),r=t.substring(OB.length,OB.length+F$e);return`${e} [${r}]`}else return t.replace(ret,\"?[...]\")}function iI(t,e){return`${Ht(t,kQ(e),ht.RANGE)}`}function ni(t,e){return`${Xi(t,e)}${Ht(t,\"@\",ht.RANGE)}${iI(t,e.range)}`}function jB(t,e){return`${Ht(t,kQ(e),ht.REFERENCE)}`}function Yr(t,e){return`${Xi(t,e)}${Ht(t,\"@\",ht.REFERENCE)}${jB(t,e.reference)}`}function X4(t){return`${un(t)}@${kQ(t.reference)}`}function sI(t){return qs(t,[e=>un(e),e=>e.range])}function GB(t,e){return Xi(t,e.anchoredLocator)}function FB(t,e,r){let s=kp(e)?MB(e):e;return r===null?`${ni(t,s)} \\u2192 ${Z4(t).Cross}`:s.identHash===r.identHash?`${ni(t,s)} \\u2192 ${jB(t,r.reference)}`:`${ni(t,s)} \\u2192 ${Yr(t,r)}`}function $4(t,e,r){return r===null?`${Yr(t,e)}`:`${Yr(t,e)} (via ${iI(t,r.range)})`}function P8(t){return`node_modules/${un(t)}`}function QQ(t,e){return t.conditions?N$e(t.conditions,r=>{let[,s,a]=r.match(Kce),n=e[s];return n?n.includes(a):!0}):!0}function qB(t){let e=new Set;if(\"children\"in t)e.add(t);else for(let r of t.requests.values())e.add(r);for(let r of e)for(let s of r.children.values())e.add(s);return e}var tI,Vce,Jce,OB,F$e,Kce,N$e,PQ,G$e,q$e,W$e,Y$e,V$e,J$e,tet,ret,Wo=Ze(()=>{tI=ut(Ie(\"querystring\")),Vce=ut(Ai()),Jce=ut(dse());xc();I0();bc();Wo();OB=\"virtual:\",F$e=5,Kce=/(os|cpu|libc)=([a-z0-9_-]+)/,N$e=(0,Jce.makeParser)(Kce);PQ=/^[^#]*#/;G$e=/^(?:@([^/]+?)\\/)?([^@/]+)$/;q$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))$/,W$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))?$/;Y$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))$/,V$e=/^(?:@([^/]+?)\\/)?([^@/]+?)(?:@(.+))?$/;J$e=/^([^#:]*:)?((?:(?!::)[^#])*)(?:#((?:(?!::).)*))?(?:::(.*))?$/;tet=/:$/;ret=/\\?.*/});var Xce,$ce=Ze(()=>{Wo();Xce={hooks:{reduceDependency:(t,e,r,s,{resolver:a,resolveOptions:n})=>{for(let{pattern:c,reference:f}of e.topLevelWorkspace.manifest.resolutions){if(c.from&&(c.from.fullName!==un(r)||e.configuration.normalizeLocator(Ws(Sa(c.from.fullName),c.from.description??r.reference)).locatorHash!==r.locatorHash)||c.descriptor.fullName!==un(t)||e.configuration.normalizeDependency(On(Qp(c.descriptor.fullName),c.descriptor.description??t.range)).descriptorHash!==t.descriptorHash)continue;return a.bindDescriptor(e.configuration.normalizeDependency(On(t,f)),e.topLevelWorkspace.anchoredLocator,n)}return t},validateProject:async(t,e)=>{for(let r of t.workspaces){let s=GB(t.configuration,r);await t.configuration.triggerHook(a=>a.validateWorkspace,r,{reportWarning:(a,n)=>e.reportWarning(a,`${s}: ${n}`),reportError:(a,n)=>e.reportError(a,`${s}: ${n}`)})}},validateWorkspace:async(t,e)=>{let{manifest:r}=t;r.resolutions.length&&t.cwd!==t.project.cwd&&r.errors.push(new Error(\"Resolutions field will be ignored\"));for(let s of r.errors)e.reportWarning(57,s.message)}}}});var Ei,tm=Ze(()=>{Ei=class t{static{this.protocol=\"workspace:\"}supportsDescriptor(e,r){return!!(e.range.startsWith(t.protocol)||r.project.tryWorkspaceByDescriptor(e)!==null)}supportsLocator(e,r){return!!e.reference.startsWith(t.protocol)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){return[s.project.getWorkspaceByDescriptor(e).anchoredLocator]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let s=r.project.getWorkspaceByCwd(e.reference.slice(t.protocol.length));return{...e,version:s.manifest.version||\"0.0.0\",languageName:\"unknown\",linkType:\"SOFT\",conditions:null,dependencies:r.project.configuration.normalizeDependencyMap(new Map([...s.manifest.dependencies,...s.manifest.devDependencies])),peerDependencies:new Map([...s.manifest.peerDependencies]),dependenciesMeta:s.manifest.dependenciesMeta,peerDependenciesMeta:s.manifest.peerDependenciesMeta,bin:s.manifest.bin}}}});var Fr={};Vt(Fr,{SemVer:()=>iue.SemVer,clean:()=>iet,getComparator:()=>rue,mergeComparators:()=>b8,satisfiesWithPrereleases:()=>Xf,simplifyRanges:()=>x8,stringifyComparator:()=>nue,validRange:()=>cl});function Xf(t,e,r=!1){if(!t)return!1;let s=`${e}${r}`,a=eue.get(s);if(typeof a>\"u\")try{a=new Rp.default.Range(e,{includePrerelease:!0,loose:r})}catch{return!1}finally{eue.set(s,a||null)}else if(a===null)return!1;let n;try{n=new Rp.default.SemVer(t,a)}catch{return!1}return a.test(n)?!0:(n.prerelease&&(n.prerelease=[]),a.set.some(c=>{for(let f of c)f.semver.prerelease&&(f.semver.prerelease=[]);return c.every(f=>f.test(n))}))}function cl(t){if(t.indexOf(\":\")!==-1)return null;let e=tue.get(t);if(typeof e<\"u\")return e;try{e=new Rp.default.Range(t)}catch{e=null}return tue.set(t,e),e}function iet(t){let e=net.exec(t);return e?e[1]:null}function rue(t){if(t.semver===Rp.default.Comparator.ANY)return{gt:null,lt:null};switch(t.operator){case\"\":return{gt:[\">=\",t.semver],lt:[\"<=\",t.semver]};case\">\":case\">=\":return{gt:[t.operator,t.semver],lt:null};case\"<\":case\"<=\":return{gt:null,lt:[t.operator,t.semver]};default:throw new Error(`Assertion failed: Unexpected comparator operator (${t.operator})`)}}function b8(t){if(t.length===0)return null;let e=null,r=null;for(let s of t){if(s.gt){let a=e!==null?Rp.default.compare(s.gt[1],e[1]):null;(a===null||a>0||a===0&&s.gt[0]===\">\")&&(e=s.gt)}if(s.lt){let a=r!==null?Rp.default.compare(s.lt[1],r[1]):null;(a===null||a<0||a===0&&s.lt[0]===\"<\")&&(r=s.lt)}}if(e&&r){let s=Rp.default.compare(e[1],r[1]);if(s===0&&(e[0]===\">\"||r[0]===\"<\")||s>0)return null}return{gt:e,lt:r}}function nue(t){if(t.gt&&t.lt){if(t.gt[0]===\">=\"&&t.lt[0]===\"<=\"&&t.gt[1].version===t.lt[1].version)return t.gt[1].version;if(t.gt[0]===\">=\"&&t.lt[0]===\"<\"){if(t.lt[1].version===`${t.gt[1].major+1}.0.0-0`)return`^${t.gt[1].version}`;if(t.lt[1].version===`${t.gt[1].major}.${t.gt[1].minor+1}.0-0`)return`~${t.gt[1].version}`}}let e=[];return t.gt&&e.push(t.gt[0]+t.gt[1].version),t.lt&&e.push(t.lt[0]+t.lt[1].version),e.length?e.join(\" \"):\"*\"}function x8(t){let e=t.map(set).map(s=>cl(s).set.map(a=>a.map(n=>rue(n)))),r=e.shift().map(s=>b8(s)).filter(s=>s!==null);for(let s of e){let a=[];for(let n of r)for(let c of s){let f=b8([n,...c]);f!==null&&a.push(f)}r=a}return r.length===0?null:r.map(s=>nue(s)).join(\" || \")}function set(t){let e=t.split(\"||\");if(e.length>1){let r=new Set;for(let s of e)e.some(a=>a!==s&&Rp.default.subset(s,a))||r.add(s);if(r.size<e.length)return[...r].join(\" || \")}return t}var Rp,iue,eue,tue,net,Tp=Ze(()=>{Rp=ut(Ai()),iue=ut(Ai()),eue=new Map;tue=new Map;net=/^(?:[\\sv=]*?)((0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\s*)$/});function sue(t){let e=t.match(/^[ \\t]+/m);return e?e[0]:\"  \"}function oue(t){return t.charCodeAt(0)===65279?t.slice(1):t}function Pa(t){return t.replace(/\\\\/g,\"/\")}function RQ(t,{yamlCompatibilityMode:e}){return e?q4(t):typeof t>\"u\"||typeof t==\"boolean\"?t:null}function aue(t,e){let r=e.search(/[^!]/);if(r===-1)return\"invalid\";let s=r%2===0?\"\":\"!\",a=e.slice(r);return`${s}${t}=${a}`}function k8(t,e){return e.length===1?aue(t,e[0]):`(${e.map(r=>aue(t,r)).join(\" | \")})`}var lue,Ut,oI=Ze(()=>{Dt();wc();lue=ut(Ai());tm();bc();Tp();Wo();Ut=class t{constructor(){this.indent=\"  \";this.name=null;this.version=null;this.os=null;this.cpu=null;this.libc=null;this.type=null;this.packageManager=null;this.private=!1;this.license=null;this.main=null;this.module=null;this.browser=null;this.languageName=null;this.bin=new Map;this.scripts=new Map;this.dependencies=new Map;this.devDependencies=new Map;this.peerDependencies=new Map;this.workspaceDefinitions=[];this.dependenciesMeta=new Map;this.peerDependenciesMeta=new Map;this.resolutions=[];this.files=null;this.publishConfig=null;this.installConfig=null;this.preferUnplugged=null;this.raw={};this.errors=[]}static{this.fileName=\"package.json\"}static{this.allDependencies=[\"dependencies\",\"devDependencies\",\"peerDependencies\"]}static{this.hardDependencies=[\"dependencies\",\"devDependencies\"]}static async tryFind(e,{baseFs:r=new Yn}={}){let s=J.join(e,\"package.json\");try{return await t.fromFile(s,{baseFs:r})}catch(a){if(a.code===\"ENOENT\")return null;throw a}}static async find(e,{baseFs:r}={}){let s=await t.tryFind(e,{baseFs:r});if(s===null)throw new Error(\"Manifest not found\");return s}static async fromFile(e,{baseFs:r=new Yn}={}){let s=new t;return await s.loadFile(e,{baseFs:r}),s}static fromText(e){let r=new t;return r.loadFromText(e),r}loadFromText(e){let r;try{r=JSON.parse(oue(e)||\"{}\")}catch(s){throw s.message+=` (when parsing ${e})`,s}this.load(r),this.indent=sue(e)}async loadFile(e,{baseFs:r=new Yn}){let s=await r.readFilePromise(e,\"utf8\"),a;try{a=JSON.parse(oue(s)||\"{}\")}catch(n){throw n.message+=` (when parsing ${e})`,n}this.load(a),this.indent=sue(s)}load(e,{yamlCompatibilityMode:r=!1}={}){if(typeof e!=\"object\"||e===null)throw new Error(`Utterly invalid manifest data (${e})`);this.raw=e;let s=[];if(this.name=null,typeof e.name==\"string\")try{this.name=Sa(e.name)}catch{s.push(new Error(\"Parsing failed for the 'name' field\"))}if(typeof e.version==\"string\"?this.version=e.version:this.version=null,Array.isArray(e.os)){let n=[];this.os=n;for(let c of e.os)typeof c!=\"string\"?s.push(new Error(\"Parsing failed for the 'os' field\")):n.push(c)}else this.os=null;if(Array.isArray(e.cpu)){let n=[];this.cpu=n;for(let c of e.cpu)typeof c!=\"string\"?s.push(new Error(\"Parsing failed for the 'cpu' field\")):n.push(c)}else this.cpu=null;if(Array.isArray(e.libc)){let n=[];this.libc=n;for(let c of e.libc)typeof c!=\"string\"?s.push(new Error(\"Parsing failed for the 'libc' field\")):n.push(c)}else this.libc=null;if(typeof e.type==\"string\"?this.type=e.type:this.type=null,typeof e.packageManager==\"string\"?this.packageManager=e.packageManager:this.packageManager=null,typeof e.private==\"boolean\"?this.private=e.private:this.private=!1,typeof e.license==\"string\"?this.license=e.license:this.license=null,typeof e.languageName==\"string\"?this.languageName=e.languageName:this.languageName=null,typeof e.main==\"string\"?this.main=Pa(e.main):this.main=null,typeof e.module==\"string\"?this.module=Pa(e.module):this.module=null,e.browser!=null)if(typeof e.browser==\"string\")this.browser=Pa(e.browser);else{this.browser=new Map;for(let[n,c]of Object.entries(e.browser))this.browser.set(Pa(n),typeof c==\"string\"?Pa(c):c)}else this.browser=null;if(this.bin=new Map,typeof e.bin==\"string\")e.bin.trim()===\"\"?s.push(new Error(\"Invalid bin field\")):this.name!==null?this.bin.set(this.name.name,Pa(e.bin)):s.push(new Error(\"String bin field, but no attached package name\"));else if(typeof e.bin==\"object\"&&e.bin!==null)for(let[n,c]of Object.entries(e.bin)){if(typeof c!=\"string\"||c.trim()===\"\"){s.push(new Error(`Invalid bin definition for '${n}'`));continue}let f=Sa(n);this.bin.set(f.name,Pa(c))}if(this.scripts=new Map,typeof e.scripts==\"object\"&&e.scripts!==null)for(let[n,c]of Object.entries(e.scripts)){if(typeof c!=\"string\"){s.push(new Error(`Invalid script definition for '${n}'`));continue}this.scripts.set(n,c)}if(this.dependencies=new Map,typeof e.dependencies==\"object\"&&e.dependencies!==null)for(let[n,c]of Object.entries(e.dependencies)){if(typeof c!=\"string\"){s.push(new Error(`Invalid dependency range for '${n}'`));continue}let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=On(f,c);this.dependencies.set(p.identHash,p)}if(this.devDependencies=new Map,typeof e.devDependencies==\"object\"&&e.devDependencies!==null)for(let[n,c]of Object.entries(e.devDependencies)){if(typeof c!=\"string\"){s.push(new Error(`Invalid dependency range for '${n}'`));continue}let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=On(f,c);this.devDependencies.set(p.identHash,p)}if(this.peerDependencies=new Map,typeof e.peerDependencies==\"object\"&&e.peerDependencies!==null)for(let[n,c]of Object.entries(e.peerDependencies)){let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}(typeof c!=\"string\"||!c.startsWith(Ei.protocol)&&!cl(c))&&(s.push(new Error(`Invalid dependency range for '${n}'`)),c=\"*\");let p=On(f,c);this.peerDependencies.set(p.identHash,p)}typeof e.workspaces==\"object\"&&e.workspaces!==null&&e.workspaces.nohoist&&s.push(new Error(\"'nohoist' is deprecated, please use 'installConfig.hoistingLimits' instead\"));let a=Array.isArray(e.workspaces)?e.workspaces:typeof e.workspaces==\"object\"&&e.workspaces!==null&&Array.isArray(e.workspaces.packages)?e.workspaces.packages:[];this.workspaceDefinitions=[];for(let n of a){if(typeof n!=\"string\"){s.push(new Error(`Invalid workspace definition for '${n}'`));continue}this.workspaceDefinitions.push({pattern:n})}if(this.dependenciesMeta=new Map,typeof e.dependenciesMeta==\"object\"&&e.dependenciesMeta!==null)for(let[n,c]of Object.entries(e.dependenciesMeta)){if(typeof c!=\"object\"||c===null){s.push(new Error(`Invalid meta field for '${n}`));continue}let f=C0(n),p=this.ensureDependencyMeta(f),h=RQ(c.built,{yamlCompatibilityMode:r});if(h===null){s.push(new Error(`Invalid built meta field for '${n}'`));continue}let E=RQ(c.optional,{yamlCompatibilityMode:r});if(E===null){s.push(new Error(`Invalid optional meta field for '${n}'`));continue}let C=RQ(c.unplugged,{yamlCompatibilityMode:r});if(C===null){s.push(new Error(`Invalid unplugged meta field for '${n}'`));continue}Object.assign(p,{built:h,optional:E,unplugged:C})}if(this.peerDependenciesMeta=new Map,typeof e.peerDependenciesMeta==\"object\"&&e.peerDependenciesMeta!==null)for(let[n,c]of Object.entries(e.peerDependenciesMeta)){if(typeof c!=\"object\"||c===null){s.push(new Error(`Invalid meta field for '${n}'`));continue}let f=C0(n),p=this.ensurePeerDependencyMeta(f),h=RQ(c.optional,{yamlCompatibilityMode:r});if(h===null){s.push(new Error(`Invalid optional meta field for '${n}'`));continue}Object.assign(p,{optional:h})}if(this.resolutions=[],typeof e.resolutions==\"object\"&&e.resolutions!==null)for(let[n,c]of Object.entries(e.resolutions)){if(typeof c!=\"string\"){s.push(new Error(`Invalid resolution entry for '${n}'`));continue}try{this.resolutions.push({pattern:px(n),reference:c})}catch(f){s.push(f);continue}}if(Array.isArray(e.files)){this.files=new Set;for(let n of e.files){if(typeof n!=\"string\"){s.push(new Error(`Invalid files entry for '${n}'`));continue}this.files.add(n)}}else this.files=null;if(typeof e.publishConfig==\"object\"&&e.publishConfig!==null){if(this.publishConfig={},typeof e.publishConfig.access==\"string\"&&(this.publishConfig.access=e.publishConfig.access),typeof e.publishConfig.main==\"string\"&&(this.publishConfig.main=Pa(e.publishConfig.main)),typeof e.publishConfig.module==\"string\"&&(this.publishConfig.module=Pa(e.publishConfig.module)),e.publishConfig.browser!=null)if(typeof e.publishConfig.browser==\"string\")this.publishConfig.browser=Pa(e.publishConfig.browser);else{this.publishConfig.browser=new Map;for(let[n,c]of Object.entries(e.publishConfig.browser))this.publishConfig.browser.set(Pa(n),typeof c==\"string\"?Pa(c):c)}if(typeof e.publishConfig.registry==\"string\"&&(this.publishConfig.registry=e.publishConfig.registry),typeof e.publishConfig.provenance==\"boolean\"&&(this.publishConfig.provenance=e.publishConfig.provenance),typeof e.publishConfig.bin==\"string\")this.name!==null?this.publishConfig.bin=new Map([[this.name.name,Pa(e.publishConfig.bin)]]):s.push(new Error(\"String bin field, but no attached package name\"));else if(typeof e.publishConfig.bin==\"object\"&&e.publishConfig.bin!==null){this.publishConfig.bin=new Map;for(let[n,c]of Object.entries(e.publishConfig.bin)){if(typeof c!=\"string\"){s.push(new Error(`Invalid bin definition for '${n}'`));continue}this.publishConfig.bin.set(n,Pa(c))}}if(Array.isArray(e.publishConfig.executableFiles)){this.publishConfig.executableFiles=new Set;for(let n of e.publishConfig.executableFiles){if(typeof n!=\"string\"){s.push(new Error(\"Invalid executable file definition\"));continue}this.publishConfig.executableFiles.add(Pa(n))}}}else this.publishConfig=null;if(typeof e.installConfig==\"object\"&&e.installConfig!==null){this.installConfig={};for(let n of Object.keys(e.installConfig))n===\"hoistingLimits\"?typeof e.installConfig.hoistingLimits==\"string\"?this.installConfig.hoistingLimits=e.installConfig.hoistingLimits:s.push(new Error(\"Invalid hoisting limits definition\")):n==\"selfReferences\"?typeof e.installConfig.selfReferences==\"boolean\"?this.installConfig.selfReferences=e.installConfig.selfReferences:s.push(new Error(\"Invalid selfReferences definition, must be a boolean value\")):s.push(new Error(`Unrecognized installConfig key: ${n}`))}else this.installConfig=null;if(typeof e.optionalDependencies==\"object\"&&e.optionalDependencies!==null)for(let[n,c]of Object.entries(e.optionalDependencies)){if(typeof c!=\"string\"){s.push(new Error(`Invalid dependency range for '${n}'`));continue}let f;try{f=Sa(n)}catch{s.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=On(f,c);this.dependencies.set(p.identHash,p);let h=On(f,\"unknown\"),E=this.ensureDependencyMeta(h);Object.assign(E,{optional:!0})}typeof e.preferUnplugged==\"boolean\"?this.preferUnplugged=e.preferUnplugged:this.preferUnplugged=null,this.errors=s}getForScope(e){switch(e){case\"dependencies\":return this.dependencies;case\"devDependencies\":return this.devDependencies;case\"peerDependencies\":return this.peerDependencies;default:throw new Error(`Unsupported value (\"${e}\")`)}}hasConsumerDependency(e){return!!(this.dependencies.has(e.identHash)||this.peerDependencies.has(e.identHash))}hasHardDependency(e){return!!(this.dependencies.has(e.identHash)||this.devDependencies.has(e.identHash))}hasSoftDependency(e){return!!this.peerDependencies.has(e.identHash)}hasDependency(e){return!!(this.hasHardDependency(e)||this.hasSoftDependency(e))}getConditions(){let e=[];return this.os&&this.os.length>0&&e.push(k8(\"os\",this.os)),this.cpu&&this.cpu.length>0&&e.push(k8(\"cpu\",this.cpu)),this.libc&&this.libc.length>0&&e.push(k8(\"libc\",this.libc)),e.length>0?e.join(\" & \"):null}ensureDependencyMeta(e){if(e.range!==\"unknown\"&&!lue.default.valid(e.range))throw new Error(`Invalid meta field range for '${al(e)}'`);let r=un(e),s=e.range!==\"unknown\"?e.range:null,a=this.dependenciesMeta.get(r);a||this.dependenciesMeta.set(r,a=new Map);let n=a.get(s);return n||a.set(s,n={}),n}ensurePeerDependencyMeta(e){if(e.range!==\"unknown\")throw new Error(`Invalid meta field range for '${al(e)}'`);let r=un(e),s=this.peerDependenciesMeta.get(r);return s||this.peerDependenciesMeta.set(r,s={}),s}setRawField(e,r,{after:s=[]}={}){let a=new Set(s.filter(n=>Object.hasOwn(this.raw,n)));if(a.size===0||Object.hasOwn(this.raw,e))this.raw[e]=r;else{let n=this.raw,c=this.raw={},f=!1;for(let p of Object.keys(n))c[p]=n[p],f||(a.delete(p),a.size===0&&(c[e]=r,f=!0))}}exportTo(e,{compatibilityMode:r=!0}={}){if(Object.assign(e,this.raw),this.name!==null?e.name=un(this.name):delete e.name,this.version!==null?e.version=this.version:delete e.version,this.os!==null?e.os=this.os:delete e.os,this.cpu!==null?e.cpu=this.cpu:delete e.cpu,this.type!==null?e.type=this.type:delete e.type,this.packageManager!==null?e.packageManager=this.packageManager:delete e.packageManager,this.private?e.private=!0:delete e.private,this.license!==null?e.license=this.license:delete e.license,this.languageName!==null?e.languageName=this.languageName:delete e.languageName,this.main!==null?e.main=this.main:delete e.main,this.module!==null?e.module=this.module:delete e.module,this.browser!==null){let n=this.browser;typeof n==\"string\"?e.browser=n:n instanceof Map&&(e.browser=Object.assign({},...Array.from(n.keys()).sort().map(c=>({[c]:n.get(c)}))))}else delete e.browser;this.bin.size===1&&this.name!==null&&this.bin.has(this.name.name)?e.bin=this.bin.get(this.name.name):this.bin.size>0?e.bin=Object.assign({},...Array.from(this.bin.keys()).sort().map(n=>({[n]:this.bin.get(n)}))):delete e.bin,this.workspaceDefinitions.length>0?this.raw.workspaces&&!Array.isArray(this.raw.workspaces)?e.workspaces={...this.raw.workspaces,packages:this.workspaceDefinitions.map(({pattern:n})=>n)}:e.workspaces=this.workspaceDefinitions.map(({pattern:n})=>n):this.raw.workspaces&&!Array.isArray(this.raw.workspaces)&&Object.keys(this.raw.workspaces).length>0?e.workspaces=this.raw.workspaces:delete e.workspaces;let s=[],a=[];for(let n of this.dependencies.values()){let c=this.dependenciesMeta.get(un(n)),f=!1;if(r&&c){let p=c.get(null);p&&p.optional&&(f=!0)}f?a.push(n):s.push(n)}s.length>0?e.dependencies=Object.assign({},...sI(s).map(n=>({[un(n)]:n.range}))):delete e.dependencies,a.length>0?e.optionalDependencies=Object.assign({},...sI(a).map(n=>({[un(n)]:n.range}))):delete e.optionalDependencies,this.devDependencies.size>0?e.devDependencies=Object.assign({},...sI(this.devDependencies.values()).map(n=>({[un(n)]:n.range}))):delete e.devDependencies,this.peerDependencies.size>0?e.peerDependencies=Object.assign({},...sI(this.peerDependencies.values()).map(n=>({[un(n)]:n.range}))):delete e.peerDependencies,e.dependenciesMeta={};for(let[n,c]of qs(this.dependenciesMeta.entries(),([f,p])=>f))for(let[f,p]of qs(c.entries(),([h,E])=>h!==null?`0${h}`:\"1\")){let h=f!==null?al(On(Sa(n),f)):n,E={...p};r&&f===null&&delete E.optional,Object.keys(E).length!==0&&(e.dependenciesMeta[h]=E)}if(Object.keys(e.dependenciesMeta).length===0&&delete e.dependenciesMeta,this.peerDependenciesMeta.size>0?e.peerDependenciesMeta=Object.assign({},...qs(this.peerDependenciesMeta.entries(),([n,c])=>n).map(([n,c])=>({[n]:c}))):delete e.peerDependenciesMeta,this.resolutions.length>0?e.resolutions=Object.assign({},...this.resolutions.map(({pattern:n,reference:c})=>({[hx(n)]:c}))):delete e.resolutions,this.files!==null?e.files=Array.from(this.files):delete e.files,this.preferUnplugged!==null?e.preferUnplugged=this.preferUnplugged:delete e.preferUnplugged,this.scripts!==null&&this.scripts.size>0){e.scripts??={};for(let n of Object.keys(e.scripts))this.scripts.has(n)||delete e.scripts[n];for(let[n,c]of this.scripts.entries())e.scripts[n]=c}else delete e.scripts;return e}}});function aet(t){return typeof t.reportCode<\"u\"}var cue,uue,oet,jt,Ao,Rc=Ze(()=>{ql();cue=Ie(\"stream\"),uue=Ie(\"string_decoder\"),oet=15,jt=class extends Error{constructor(r,s,a){super(s);this.reportExtra=a;this.reportCode=r}};Ao=class{constructor(){this.cacheHits=new Set;this.cacheMisses=new Set;this.reportedInfos=new Set;this.reportedWarnings=new Set;this.reportedErrors=new Set}getRecommendedLength(){return 180}reportCacheHit(e){this.cacheHits.add(e.locatorHash)}reportCacheMiss(e,r){this.cacheMisses.add(e.locatorHash)}static progressViaCounter(e){let r=0,s,a=new Promise(p=>{s=p}),n=p=>{let h=s;a=new Promise(E=>{s=E}),r=p,h()},c=(p=0)=>{n(r+1)},f=async function*(){for(;r<e;)await a,yield{progress:r/e}}();return{[Symbol.asyncIterator](){return f},hasProgress:!0,hasTitle:!1,set:n,tick:c}}static progressViaTitle(){let e,r,s=new Promise(c=>{r=c}),a=k4(c=>{let f=r;s=new Promise(p=>{r=p}),e=c,f()},1e3/oet),n=async function*(){for(;;)await s,yield{title:e}}();return{[Symbol.asyncIterator](){return n},hasProgress:!1,hasTitle:!0,setTitle:a}}async startProgressPromise(e,r){let s=this.reportProgress(e);try{return await r(e)}finally{s.stop()}}startProgressSync(e,r){let s=this.reportProgress(e);try{return r(e)}finally{s.stop()}}reportInfoOnce(e,r,s){let a=s&&s.key?s.key:r;this.reportedInfos.has(a)||(this.reportedInfos.add(a),this.reportInfo(e,r),s?.reportExtra?.(this))}reportWarningOnce(e,r,s){let a=s&&s.key?s.key:r;this.reportedWarnings.has(a)||(this.reportedWarnings.add(a),this.reportWarning(e,r),s?.reportExtra?.(this))}reportErrorOnce(e,r,s){let a=s&&s.key?s.key:r;this.reportedErrors.has(a)||(this.reportedErrors.add(a),this.reportError(e,r),s?.reportExtra?.(this))}reportExceptionOnce(e){aet(e)?this.reportErrorOnce(e.reportCode,e.message,{key:e,reportExtra:e.reportExtra}):this.reportErrorOnce(1,e.stack||e.message,{key:e})}createStreamReporter(e=null){let r=new cue.PassThrough,s=new uue.StringDecoder,a=\"\";return r.on(\"data\",n=>{let c=s.write(n),f;do if(f=c.indexOf(`\n`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a=\"\",e!==null?this.reportInfo(null,`${e} ${p}`):this.reportInfo(null,p)}while(f!==-1);a+=c}),r.on(\"end\",()=>{let n=s.end();n!==\"\"&&(e!==null?this.reportInfo(null,`${e} ${n}`):this.reportInfo(null,n))}),r}}});var aI,Q8=Ze(()=>{Rc();Wo();aI=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let s=this.fetchers.find(a=>a.supports(e,r));return s||null}getFetcher(e,r){let s=this.fetchers.find(a=>a.supports(e,r));if(!s)throw new jt(11,`${Yr(r.project.configuration,e)} isn't supported by any available fetcher`);return s}}});var rm,R8=Ze(()=>{Wo();rm=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,s){return this.getResolverByDescriptor(e,s).bindDescriptor(e,r,s)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,s){return await this.getResolverByDescriptor(e,s).getCandidates(e,r,s)}async getSatisfying(e,r,s,a){return this.getResolverByDescriptor(e,a).getSatisfying(e,r,s,a)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let s=this.resolvers.find(a=>a.supportsDescriptor(e,r));return s||null}getResolverByDescriptor(e,r){let s=this.resolvers.find(a=>a.supportsDescriptor(e,r));if(!s)throw new Error(`${ni(r.project.configuration,e)} isn't supported by any available resolver`);return s}tryResolverByLocator(e,r){let s=this.resolvers.find(a=>a.supportsLocator(e,r));return s||null}getResolverByLocator(e,r){let s=this.resolvers.find(a=>a.supportsLocator(e,r));if(!s)throw new Error(`${Yr(r.project.configuration,e)} isn't supported by any available resolver`);return s}}});var lI,T8=Ze(()=>{Dt();Wo();lI=class{supports(e){return!!e.reference.startsWith(\"virtual:\")}getLocalPath(e,r){let s=e.reference.indexOf(\"#\");if(s===-1)throw new Error(\"Invalid virtual package reference\");let a=e.reference.slice(s+1),n=Ws(e,a);return r.fetcher.getLocalPath(n,r)}async fetch(e,r){let s=e.reference.indexOf(\"#\");if(s===-1)throw new Error(\"Invalid virtual package reference\");let a=e.reference.slice(s+1),n=Ws(e,a),c=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(e,c,r)}getLocatorFilename(e){return nI(e)}async ensureVirtualLink(e,r,s){let a=r.packageFs.getRealPath(),n=s.project.configuration.get(\"virtualFolder\"),c=this.getLocatorFilename(e),f=uo.makeVirtualPath(n,c,a),p=new _f(f,{baseFs:r.packageFs,pathUtils:J});return{...r,packageFs:p}}}});var TQ,fue=Ze(()=>{TQ=class t{static{this.protocol=\"virtual:\"}static isVirtualDescriptor(e){return!!e.range.startsWith(t.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(t.protocol)}supportsDescriptor(e,r){return t.isVirtualDescriptor(e)}supportsLocator(e,r){return t.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){throw new Error('Assertion failed: calling \"bindDescriptor\" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling \"getResolutionDependencies\" on a virtual descriptor is unsupported')}async getCandidates(e,r,s){throw new Error('Assertion failed: calling \"getCandidates\" on a virtual descriptor is unsupported')}async getSatisfying(e,r,s,a){throw new Error('Assertion failed: calling \"getSatisfying\" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling \"resolve\" on a virtual locator is unsupported')}}});var cI,F8=Ze(()=>{Dt();tm();cI=class{supports(e){return!!e.reference.startsWith(Ei.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let s=this.getWorkspace(e,r).cwd;return{packageFs:new Sn(s),prefixPath:vt.dot,localPath:s}}getWorkspace(e,r){return r.project.getWorkspaceByCwd(e.reference.slice(Ei.protocol.length))}}});function WB(t){return typeof t==\"object\"&&t!==null&&!Array.isArray(t)}function Aue(t){return typeof t>\"u\"?3:WB(t)?0:Array.isArray(t)?1:2}function L8(t,e){return Object.hasOwn(t,e)}function uet(t){return WB(t)&&L8(t,\"onConflict\")&&typeof t.onConflict==\"string\"}function fet(t){if(typeof t>\"u\")return{onConflict:\"default\",value:t};if(!uet(t))return{onConflict:\"default\",value:t};if(L8(t,\"value\"))return t;let{onConflict:e,...r}=t;return{onConflict:e,value:r}}function pue(t,e){let r=WB(t)&&L8(t,e)?t[e]:void 0;return fet(r)}function uI(t,e){return[t,e,hue]}function M8(t){return Array.isArray(t)?t[2]===hue:!1}function N8(t,e){if(WB(t)){let r={};for(let s of Object.keys(t))r[s]=N8(t[s],e);return uI(e,r)}return Array.isArray(t)?uI(e,t.map(r=>N8(r,e))):uI(e,t)}function O8(t,e,r,s,a){let n,c=[],f=a,p=0;for(let E=a-1;E>=s;--E){let[C,S]=t[E],{onConflict:b,value:I}=pue(S,r),T=Aue(I);if(T!==3){if(n??=T,T!==n||b===\"hardReset\"){p=f;break}if(T===2)return uI(C,I);if(c.unshift([C,I]),b===\"reset\"){p=E;break}b===\"extend\"&&E===s&&(s=0),f=E}}if(typeof n>\"u\")return null;let h=c.map(([E])=>E).join(\", \");switch(n){case 1:return uI(h,new Array().concat(...c.map(([E,C])=>C.map(S=>N8(S,E)))));case 0:{let E=Object.assign({},...c.map(([,T])=>T)),C=Object.keys(E),S={},b=t.map(([T,N])=>[T,pue(N,r).value]),I=cet(b,([T,N])=>{let U=Aue(N);return U!==0&&U!==3});if(I!==-1){let T=b.slice(I+1);for(let N of C)S[N]=O8(T,e,N,0,T.length)}else for(let T of C)S[T]=O8(b,e,T,p,b.length);return uI(h,S)}default:throw new Error(\"Assertion failed: Non-extendable value type\")}}function gue(t){return O8(t.map(([e,r])=>[e,{\".\":r}]),[],\".\",0,t.length)}function YB(t){return M8(t)?t[1]:t}function FQ(t){let e=M8(t)?t[1]:t;if(Array.isArray(e))return e.map(r=>FQ(r));if(WB(e)){let r={};for(let[s,a]of Object.entries(e))r[s]=FQ(a);return r}return e}function U8(t){return M8(t)?t[0]:null}var cet,hue,due=Ze(()=>{cet=(t,e,r)=>{let s=[...t];return s.reverse(),s.findIndex(e,r)};hue=Symbol()});var NQ={};Vt(NQ,{getDefaultGlobalFolder:()=>H8,getHomeFolder:()=>fI,isFolderInside:()=>j8});function H8(){if(process.platform===\"win32\"){let t=fe.toPortablePath(process.env.LOCALAPPDATA||fe.join((0,_8.homedir)(),\"AppData\",\"Local\"));return J.resolve(t,\"Yarn/Berry\")}if(process.env.XDG_DATA_HOME){let t=fe.toPortablePath(process.env.XDG_DATA_HOME);return J.resolve(t,\"yarn/berry\")}return J.resolve(fI(),\".yarn/berry\")}function fI(){return fe.toPortablePath((0,_8.homedir)()||\"/usr/local/share\")}function j8(t,e){let r=J.relative(e,t);return r&&!r.startsWith(\"..\")&&!J.isAbsolute(r)}var _8,OQ=Ze(()=>{Dt();_8=Ie(\"os\")});var Eue=_((uMt,yue)=>{\"use strict\";var G8=Ie(\"https\"),q8=Ie(\"http\"),{URL:mue}=Ie(\"url\"),W8=class extends q8.Agent{constructor(e){let{proxy:r,proxyRequestOptions:s,...a}=e;super(a),this.proxy=typeof r==\"string\"?new mue(r):r,this.proxyRequestOptions=s||{}}createConnection(e,r){let s={...this.proxyRequestOptions,method:\"CONNECT\",host:this.proxy.hostname,port:this.proxy.port,path:`${e.host}:${e.port}`,setHost:!1,headers:{...this.proxyRequestOptions.headers,connection:this.keepAlive?\"keep-alive\":\"close\",host:`${e.host}:${e.port}`},agent:!1,timeout:e.timeout||0};if(this.proxy.username||this.proxy.password){let n=Buffer.from(`${decodeURIComponent(this.proxy.username||\"\")}:${decodeURIComponent(this.proxy.password||\"\")}`).toString(\"base64\");s.headers[\"proxy-authorization\"]=`Basic ${n}`}this.proxy.protocol===\"https:\"&&(s.servername=this.proxy.hostname);let a=(this.proxy.protocol===\"http:\"?q8:G8).request(s);a.once(\"connect\",(n,c,f)=>{a.removeAllListeners(),c.removeAllListeners(),n.statusCode===200?r(null,c):(c.destroy(),r(new Error(`Bad response: ${n.statusCode}`),null))}),a.once(\"timeout\",()=>{a.destroy(new Error(\"Proxy timeout\"))}),a.once(\"error\",n=>{a.removeAllListeners(),r(n,null)}),a.end()}},Y8=class extends G8.Agent{constructor(e){let{proxy:r,proxyRequestOptions:s,...a}=e;super(a),this.proxy=typeof r==\"string\"?new mue(r):r,this.proxyRequestOptions=s||{}}createConnection(e,r){let s={...this.proxyRequestOptions,method:\"CONNECT\",host:this.proxy.hostname,port:this.proxy.port,path:`${e.host}:${e.port}`,setHost:!1,headers:{...this.proxyRequestOptions.headers,connection:this.keepAlive?\"keep-alive\":\"close\",host:`${e.host}:${e.port}`},agent:!1,timeout:e.timeout||0};if(this.proxy.username||this.proxy.password){let n=Buffer.from(`${decodeURIComponent(this.proxy.username||\"\")}:${decodeURIComponent(this.proxy.password||\"\")}`).toString(\"base64\");s.headers[\"proxy-authorization\"]=`Basic ${n}`}this.proxy.protocol===\"https:\"&&(s.servername=this.proxy.hostname);let a=(this.proxy.protocol===\"http:\"?q8:G8).request(s);a.once(\"connect\",(n,c,f)=>{if(a.removeAllListeners(),c.removeAllListeners(),n.statusCode===200){let p=super.createConnection({...e,socket:c});r(null,p)}else c.destroy(),r(new Error(`Bad response: ${n.statusCode}`),null)}),a.once(\"timeout\",()=>{a.destroy(new Error(\"Proxy timeout\"))}),a.once(\"error\",n=>{a.removeAllListeners(),r(n,null)}),a.end()}};yue.exports={HttpProxyAgent:W8,HttpsProxyAgent:Y8}});var V8,Iue,Cue,wue=Ze(()=>{V8=ut(Eue(),1),Iue=V8.default.HttpProxyAgent,Cue=V8.default.HttpsProxyAgent});var Np=_((Fp,LQ)=>{\"use strict\";Object.defineProperty(Fp,\"__esModule\",{value:!0});var Bue=[\"Int8Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Int16Array\",\"Uint16Array\",\"Int32Array\",\"Uint32Array\",\"Float32Array\",\"Float64Array\",\"BigInt64Array\",\"BigUint64Array\"];function pet(t){return Bue.includes(t)}var het=[\"Function\",\"Generator\",\"AsyncGenerator\",\"GeneratorFunction\",\"AsyncGeneratorFunction\",\"AsyncFunction\",\"Observable\",\"Array\",\"Buffer\",\"Blob\",\"Object\",\"RegExp\",\"Date\",\"Error\",\"Map\",\"Set\",\"WeakMap\",\"WeakSet\",\"ArrayBuffer\",\"SharedArrayBuffer\",\"DataView\",\"Promise\",\"URL\",\"FormData\",\"URLSearchParams\",\"HTMLElement\",...Bue];function get(t){return het.includes(t)}var det=[\"null\",\"undefined\",\"string\",\"number\",\"bigint\",\"boolean\",\"symbol\"];function met(t){return det.includes(t)}function AI(t){return e=>typeof e===t}var{toString:vue}=Object.prototype,VB=t=>{let e=vue.call(t).slice(8,-1);if(/HTML\\w+Element/.test(e)&&Pe.domElement(t))return\"HTMLElement\";if(get(e))return e},pi=t=>e=>VB(e)===t;function Pe(t){if(t===null)return\"null\";switch(typeof t){case\"undefined\":return\"undefined\";case\"string\":return\"string\";case\"number\":return\"number\";case\"boolean\":return\"boolean\";case\"function\":return\"Function\";case\"bigint\":return\"bigint\";case\"symbol\":return\"symbol\";default:}if(Pe.observable(t))return\"Observable\";if(Pe.array(t))return\"Array\";if(Pe.buffer(t))return\"Buffer\";let e=VB(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError(\"Please don't use object wrappers for primitive types\");return\"Object\"}Pe.undefined=AI(\"undefined\");Pe.string=AI(\"string\");var yet=AI(\"number\");Pe.number=t=>yet(t)&&!Pe.nan(t);Pe.bigint=AI(\"bigint\");Pe.function_=AI(\"function\");Pe.null_=t=>t===null;Pe.class_=t=>Pe.function_(t)&&t.toString().startsWith(\"class \");Pe.boolean=t=>t===!0||t===!1;Pe.symbol=AI(\"symbol\");Pe.numericString=t=>Pe.string(t)&&!Pe.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));Pe.array=(t,e)=>Array.isArray(t)?Pe.function_(e)?t.every(e):!0:!1;Pe.buffer=t=>{var e,r,s,a;return(a=(s=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||s===void 0?void 0:s.call(r,t))!==null&&a!==void 0?a:!1};Pe.blob=t=>pi(\"Blob\")(t);Pe.nullOrUndefined=t=>Pe.null_(t)||Pe.undefined(t);Pe.object=t=>!Pe.null_(t)&&(typeof t==\"object\"||Pe.function_(t));Pe.iterable=t=>{var e;return Pe.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};Pe.asyncIterable=t=>{var e;return Pe.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};Pe.generator=t=>{var e,r;return Pe.iterable(t)&&Pe.function_((e=t)===null||e===void 0?void 0:e.next)&&Pe.function_((r=t)===null||r===void 0?void 0:r.throw)};Pe.asyncGenerator=t=>Pe.asyncIterable(t)&&Pe.function_(t.next)&&Pe.function_(t.throw);Pe.nativePromise=t=>pi(\"Promise\")(t);var Eet=t=>{var e,r;return Pe.function_((e=t)===null||e===void 0?void 0:e.then)&&Pe.function_((r=t)===null||r===void 0?void 0:r.catch)};Pe.promise=t=>Pe.nativePromise(t)||Eet(t);Pe.generatorFunction=pi(\"GeneratorFunction\");Pe.asyncGeneratorFunction=t=>VB(t)===\"AsyncGeneratorFunction\";Pe.asyncFunction=t=>VB(t)===\"AsyncFunction\";Pe.boundFunction=t=>Pe.function_(t)&&!t.hasOwnProperty(\"prototype\");Pe.regExp=pi(\"RegExp\");Pe.date=pi(\"Date\");Pe.error=pi(\"Error\");Pe.map=t=>pi(\"Map\")(t);Pe.set=t=>pi(\"Set\")(t);Pe.weakMap=t=>pi(\"WeakMap\")(t);Pe.weakSet=t=>pi(\"WeakSet\")(t);Pe.int8Array=pi(\"Int8Array\");Pe.uint8Array=pi(\"Uint8Array\");Pe.uint8ClampedArray=pi(\"Uint8ClampedArray\");Pe.int16Array=pi(\"Int16Array\");Pe.uint16Array=pi(\"Uint16Array\");Pe.int32Array=pi(\"Int32Array\");Pe.uint32Array=pi(\"Uint32Array\");Pe.float32Array=pi(\"Float32Array\");Pe.float64Array=pi(\"Float64Array\");Pe.bigInt64Array=pi(\"BigInt64Array\");Pe.bigUint64Array=pi(\"BigUint64Array\");Pe.arrayBuffer=pi(\"ArrayBuffer\");Pe.sharedArrayBuffer=pi(\"SharedArrayBuffer\");Pe.dataView=pi(\"DataView\");Pe.enumCase=(t,e)=>Object.values(e).includes(t);Pe.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;Pe.urlInstance=t=>pi(\"URL\")(t);Pe.urlString=t=>{if(!Pe.string(t))return!1;try{return new URL(t),!0}catch{return!1}};Pe.truthy=t=>!!t;Pe.falsy=t=>!t;Pe.nan=t=>Number.isNaN(t);Pe.primitive=t=>Pe.null_(t)||met(typeof t);Pe.integer=t=>Number.isInteger(t);Pe.safeInteger=t=>Number.isSafeInteger(t);Pe.plainObject=t=>{if(vue.call(t)!==\"[object Object]\")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};Pe.typedArray=t=>pet(VB(t));var Iet=t=>Pe.safeInteger(t)&&t>=0;Pe.arrayLike=t=>!Pe.nullOrUndefined(t)&&!Pe.function_(t)&&Iet(t.length);Pe.inRange=(t,e)=>{if(Pe.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(Pe.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Cet=1,wet=[\"innerHTML\",\"ownerDocument\",\"style\",\"attributes\",\"nodeValue\"];Pe.domElement=t=>Pe.object(t)&&t.nodeType===Cet&&Pe.string(t.nodeName)&&!Pe.plainObject(t)&&wet.every(e=>e in t);Pe.observable=t=>{var e,r,s,a;return t?t===((r=(e=t)[Symbol.observable])===null||r===void 0?void 0:r.call(e))||t===((a=(s=t)[\"@@observable\"])===null||a===void 0?void 0:a.call(s)):!1};Pe.nodeStream=t=>Pe.object(t)&&Pe.function_(t.pipe)&&!Pe.observable(t);Pe.infinite=t=>t===1/0||t===-1/0;var Sue=t=>e=>Pe.integer(e)&&Math.abs(e%2)===t;Pe.evenInteger=Sue(0);Pe.oddInteger=Sue(1);Pe.emptyArray=t=>Pe.array(t)&&t.length===0;Pe.nonEmptyArray=t=>Pe.array(t)&&t.length>0;Pe.emptyString=t=>Pe.string(t)&&t.length===0;var Bet=t=>Pe.string(t)&&!/\\S/.test(t);Pe.emptyStringOrWhitespace=t=>Pe.emptyString(t)||Bet(t);Pe.nonEmptyString=t=>Pe.string(t)&&t.length>0;Pe.nonEmptyStringAndNotWhitespace=t=>Pe.string(t)&&!Pe.emptyStringOrWhitespace(t);Pe.emptyObject=t=>Pe.object(t)&&!Pe.map(t)&&!Pe.set(t)&&Object.keys(t).length===0;Pe.nonEmptyObject=t=>Pe.object(t)&&!Pe.map(t)&&!Pe.set(t)&&Object.keys(t).length>0;Pe.emptySet=t=>Pe.set(t)&&t.size===0;Pe.nonEmptySet=t=>Pe.set(t)&&t.size>0;Pe.emptyMap=t=>Pe.map(t)&&t.size===0;Pe.nonEmptyMap=t=>Pe.map(t)&&t.size>0;Pe.propertyKey=t=>Pe.any([Pe.string,Pe.number,Pe.symbol],t);Pe.formData=t=>pi(\"FormData\")(t);Pe.urlSearchParams=t=>pi(\"URLSearchParams\")(t);var Due=(t,e,r)=>{if(!Pe.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError(\"Invalid number of values\");return t.call(r,e)};Pe.any=(t,...e)=>(Pe.array(t)?t:[t]).some(s=>Due(Array.prototype.some,s,e));Pe.all=(t,...e)=>Due(Array.prototype.every,t,e);var _t=(t,e,r,s={})=>{if(!t){let{multipleValues:a}=s,n=a?`received values of types ${[...new Set(r.map(c=>`\\`${Pe(c)}\\``))].join(\", \")}`:`received value of type \\`${Pe(r)}\\``;throw new TypeError(`Expected value which is \\`${e}\\`, ${n}.`)}};Fp.assert={undefined:t=>_t(Pe.undefined(t),\"undefined\",t),string:t=>_t(Pe.string(t),\"string\",t),number:t=>_t(Pe.number(t),\"number\",t),bigint:t=>_t(Pe.bigint(t),\"bigint\",t),function_:t=>_t(Pe.function_(t),\"Function\",t),null_:t=>_t(Pe.null_(t),\"null\",t),class_:t=>_t(Pe.class_(t),\"Class\",t),boolean:t=>_t(Pe.boolean(t),\"boolean\",t),symbol:t=>_t(Pe.symbol(t),\"symbol\",t),numericString:t=>_t(Pe.numericString(t),\"string with a number\",t),array:(t,e)=>{_t(Pe.array(t),\"Array\",t),e&&t.forEach(e)},buffer:t=>_t(Pe.buffer(t),\"Buffer\",t),blob:t=>_t(Pe.blob(t),\"Blob\",t),nullOrUndefined:t=>_t(Pe.nullOrUndefined(t),\"null or undefined\",t),object:t=>_t(Pe.object(t),\"Object\",t),iterable:t=>_t(Pe.iterable(t),\"Iterable\",t),asyncIterable:t=>_t(Pe.asyncIterable(t),\"AsyncIterable\",t),generator:t=>_t(Pe.generator(t),\"Generator\",t),asyncGenerator:t=>_t(Pe.asyncGenerator(t),\"AsyncGenerator\",t),nativePromise:t=>_t(Pe.nativePromise(t),\"native Promise\",t),promise:t=>_t(Pe.promise(t),\"Promise\",t),generatorFunction:t=>_t(Pe.generatorFunction(t),\"GeneratorFunction\",t),asyncGeneratorFunction:t=>_t(Pe.asyncGeneratorFunction(t),\"AsyncGeneratorFunction\",t),asyncFunction:t=>_t(Pe.asyncFunction(t),\"AsyncFunction\",t),boundFunction:t=>_t(Pe.boundFunction(t),\"Function\",t),regExp:t=>_t(Pe.regExp(t),\"RegExp\",t),date:t=>_t(Pe.date(t),\"Date\",t),error:t=>_t(Pe.error(t),\"Error\",t),map:t=>_t(Pe.map(t),\"Map\",t),set:t=>_t(Pe.set(t),\"Set\",t),weakMap:t=>_t(Pe.weakMap(t),\"WeakMap\",t),weakSet:t=>_t(Pe.weakSet(t),\"WeakSet\",t),int8Array:t=>_t(Pe.int8Array(t),\"Int8Array\",t),uint8Array:t=>_t(Pe.uint8Array(t),\"Uint8Array\",t),uint8ClampedArray:t=>_t(Pe.uint8ClampedArray(t),\"Uint8ClampedArray\",t),int16Array:t=>_t(Pe.int16Array(t),\"Int16Array\",t),uint16Array:t=>_t(Pe.uint16Array(t),\"Uint16Array\",t),int32Array:t=>_t(Pe.int32Array(t),\"Int32Array\",t),uint32Array:t=>_t(Pe.uint32Array(t),\"Uint32Array\",t),float32Array:t=>_t(Pe.float32Array(t),\"Float32Array\",t),float64Array:t=>_t(Pe.float64Array(t),\"Float64Array\",t),bigInt64Array:t=>_t(Pe.bigInt64Array(t),\"BigInt64Array\",t),bigUint64Array:t=>_t(Pe.bigUint64Array(t),\"BigUint64Array\",t),arrayBuffer:t=>_t(Pe.arrayBuffer(t),\"ArrayBuffer\",t),sharedArrayBuffer:t=>_t(Pe.sharedArrayBuffer(t),\"SharedArrayBuffer\",t),dataView:t=>_t(Pe.dataView(t),\"DataView\",t),enumCase:(t,e)=>_t(Pe.enumCase(t,e),\"EnumCase\",t),urlInstance:t=>_t(Pe.urlInstance(t),\"URL\",t),urlString:t=>_t(Pe.urlString(t),\"string with a URL\",t),truthy:t=>_t(Pe.truthy(t),\"truthy\",t),falsy:t=>_t(Pe.falsy(t),\"falsy\",t),nan:t=>_t(Pe.nan(t),\"NaN\",t),primitive:t=>_t(Pe.primitive(t),\"primitive\",t),integer:t=>_t(Pe.integer(t),\"integer\",t),safeInteger:t=>_t(Pe.safeInteger(t),\"integer\",t),plainObject:t=>_t(Pe.plainObject(t),\"plain object\",t),typedArray:t=>_t(Pe.typedArray(t),\"TypedArray\",t),arrayLike:t=>_t(Pe.arrayLike(t),\"array-like\",t),domElement:t=>_t(Pe.domElement(t),\"HTMLElement\",t),observable:t=>_t(Pe.observable(t),\"Observable\",t),nodeStream:t=>_t(Pe.nodeStream(t),\"Node.js Stream\",t),infinite:t=>_t(Pe.infinite(t),\"infinite number\",t),emptyArray:t=>_t(Pe.emptyArray(t),\"empty array\",t),nonEmptyArray:t=>_t(Pe.nonEmptyArray(t),\"non-empty array\",t),emptyString:t=>_t(Pe.emptyString(t),\"empty string\",t),emptyStringOrWhitespace:t=>_t(Pe.emptyStringOrWhitespace(t),\"empty string or whitespace\",t),nonEmptyString:t=>_t(Pe.nonEmptyString(t),\"non-empty string\",t),nonEmptyStringAndNotWhitespace:t=>_t(Pe.nonEmptyStringAndNotWhitespace(t),\"non-empty string and not whitespace\",t),emptyObject:t=>_t(Pe.emptyObject(t),\"empty object\",t),nonEmptyObject:t=>_t(Pe.nonEmptyObject(t),\"non-empty object\",t),emptySet:t=>_t(Pe.emptySet(t),\"empty set\",t),nonEmptySet:t=>_t(Pe.nonEmptySet(t),\"non-empty set\",t),emptyMap:t=>_t(Pe.emptyMap(t),\"empty map\",t),nonEmptyMap:t=>_t(Pe.nonEmptyMap(t),\"non-empty map\",t),propertyKey:t=>_t(Pe.propertyKey(t),\"PropertyKey\",t),formData:t=>_t(Pe.formData(t),\"FormData\",t),urlSearchParams:t=>_t(Pe.urlSearchParams(t),\"URLSearchParams\",t),evenInteger:t=>_t(Pe.evenInteger(t),\"even integer\",t),oddInteger:t=>_t(Pe.oddInteger(t),\"odd integer\",t),directInstanceOf:(t,e)=>_t(Pe.directInstanceOf(t,e),\"T\",t),inRange:(t,e)=>_t(Pe.inRange(t,e),\"in range\",t),any:(t,...e)=>_t(Pe.any(t,...e),\"predicate returns truthy for any value\",e,{multipleValues:!0}),all:(t,...e)=>_t(Pe.all(t,...e),\"predicate returns truthy for all values\",e,{multipleValues:!0})};Object.defineProperties(Pe,{class:{value:Pe.class_},function:{value:Pe.function_},null:{value:Pe.null_}});Object.defineProperties(Fp.assert,{class:{value:Fp.assert.class_},function:{value:Fp.assert.function_},null:{value:Fp.assert.null_}});Fp.default=Pe;LQ.exports=Pe;LQ.exports.default=Pe;LQ.exports.assert=Fp.assert});var Pue=_((AMt,J8)=>{\"use strict\";var MQ=class extends Error{constructor(e){super(e||\"Promise was canceled\"),this.name=\"CancelError\"}get isCanceled(){return!0}},UQ=class t{static fn(e){return(...r)=>new t((s,a,n)=>{r.push(n),e(...r).then(s,a)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,s)=>{this._reject=s;let a=f=>{this._isPending=!1,r(f)},n=f=>{this._isPending=!1,s(f)},c=f=>{if(!this._isPending)throw new Error(\"The `onCancel` handler was attached after the promise settled.\");this._cancelHandlers.push(f)};return Object.defineProperties(c,{shouldReject:{get:()=>this._rejectOnCancel,set:f=>{this._rejectOnCancel=f}}}),e(a,n,c)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r)}this._isCanceled=!0,this._rejectOnCancel&&this._reject(new MQ(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(UQ.prototype,Promise.prototype);J8.exports=UQ;J8.exports.CancelError=MQ});var bue=_((z8,Z8)=>{\"use strict\";Object.defineProperty(z8,\"__esModule\",{value:!0});function vet(t){return t.encrypted}var K8=(t,e)=>{let r;typeof e==\"function\"?r={connect:e}:r=e;let s=typeof r.connect==\"function\",a=typeof r.secureConnect==\"function\",n=typeof r.close==\"function\",c=()=>{s&&r.connect(),vet(t)&&a&&(t.authorized?r.secureConnect():t.authorizationError||t.once(\"secureConnect\",r.secureConnect)),n&&t.once(\"close\",r.close)};t.writable&&!t.connecting?c():t.connecting?t.once(\"connect\",c):t.destroyed&&n&&r.close(t._hadError)};z8.default=K8;Z8.exports=K8;Z8.exports.default=K8});var xue=_(($8,eH)=>{\"use strict\";Object.defineProperty($8,\"__esModule\",{value:!0});var Det=bue(),Pet=Number(process.versions.node.split(\".\")[0]),X8=t=>{let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=c=>{let f=c.emit.bind(c);c.emit=(p,...h)=>(p===\"error\"&&(e.error=Date.now(),e.phases.total=e.error-e.start,c.emit=f),f(p,...h))};r(t),t.prependOnceListener(\"abort\",()=>{e.abort=Date.now(),(!e.response||Pet>=13)&&(e.phases.total=Date.now()-e.start)});let s=c=>{e.socket=Date.now(),e.phases.wait=e.socket-e.start;let f=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};c.prependOnceListener(\"lookup\",f),Det.default(c,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(c.removeListener(\"lookup\",f),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?s(t.socket):t.prependOnceListener(\"socket\",s);let a=()=>{var c;e.upload=Date.now(),e.phases.request=e.upload-(c=e.secureConnect,c??e.connect)};return(typeof t.writableFinished==\"boolean\"?t.writableFinished:t.finished&&t.outputSize===0&&(!t.socket||t.socket.writableLength===0))?a():t.prependOnceListener(\"finish\",a),t.prependOnceListener(\"response\",c=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,c.timings=e,r(c),c.prependOnceListener(\"end\",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start})}),e};$8.default=X8;eH.exports=X8;eH.exports.default=X8});var Oue=_((pMt,nH)=>{\"use strict\";var{V4MAPPED:bet,ADDRCONFIG:xet,ALL:Nue,promises:{Resolver:kue},lookup:ket}=Ie(\"dns\"),{promisify:tH}=Ie(\"util\"),Qet=Ie(\"os\"),pI=Symbol(\"cacheableLookupCreateConnection\"),rH=Symbol(\"cacheableLookupInstance\"),Que=Symbol(\"expires\"),Ret=typeof Nue==\"number\",Rue=t=>{if(!(t&&typeof t.createConnection==\"function\"))throw new Error(\"Expected an Agent instance as the first argument\")},Tet=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},Tue=()=>{let t=!1,e=!1;for(let r of Object.values(Qet.networkInterfaces()))for(let s of r)if(!s.internal&&(s.family===\"IPv6\"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Fet=t=>Symbol.iterator in t,Fue={ttl:!0},Net={all:!0},_Q=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:s=3600,errorTtl:a=.15,resolver:n=new kue,lookup:c=ket}={}){if(this.maxTtl=r,this.errorTtl=a,this._cache=e,this._resolver=n,this._dnsLookup=tH(c),this._resolver instanceof kue?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=tH(this._resolver.resolve4.bind(this._resolver)),this._resolve6=tH(this._resolver.resolve6.bind(this._resolver))),this._iface=Tue(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,s<1)this._fallback=!1;else{this._fallback=!0;let f=setInterval(()=>{this._hostnamesToFallback.clear()},s*1e3);f.unref&&f.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,s){if(typeof r==\"function\"?(s=r,r={}):typeof r==\"number\"&&(r={family:r}),!s)throw new Error(\"Callback must be a function.\");this.lookupAsync(e,r).then(a=>{r.all?s(null,a):s(null,a.address,a.family,a.expires,a.ttl)},s)}async lookupAsync(e,r={}){typeof r==\"number\"&&(r={family:r});let s=await this.query(e);if(r.family===6){let a=s.filter(n=>n.family===6);r.hints&bet&&(Ret&&r.hints&Nue||a.length===0)?Tet(s):s=a}else r.family===4&&(s=s.filter(a=>a.family===4));if(r.hints&xet){let{_iface:a}=this;s=s.filter(n=>n.family===6?a.has6:a.has4)}if(s.length===0){let a=new Error(`cacheableLookup ENOTFOUND ${e}`);throw a.code=\"ENOTFOUND\",a.hostname=e,a}return r.all?s:s[0]}async query(e){let r=await this._cache.get(e);if(!r){let s=this._pending[e];if(s)r=await s;else{let a=this.queryAndCache(e);this._pending[e]=a,r=await a}}return r=r.map(s=>({...s})),r}async _resolve(e){let r=async h=>{try{return await h}catch(E){if(E.code===\"ENODATA\"||E.code===\"ENOTFOUND\")return[];throw E}},[s,a]=await Promise.all([this._resolve4(e,Fue),this._resolve6(e,Fue)].map(h=>r(h))),n=0,c=0,f=0,p=Date.now();for(let h of s)h.family=4,h.expires=p+h.ttl*1e3,n=Math.max(n,h.ttl);for(let h of a)h.family=6,h.expires=p+h.ttl*1e3,c=Math.max(c,h.ttl);return s.length>0?a.length>0?f=Math.min(n,c):f=n:f=c,{entries:[...s,...a],cacheTtl:f}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,s){if(this.maxTtl>0&&s>0){s=Math.min(s,this.maxTtl)*1e3,r[Que]=Date.now()+s;try{await this._cache.set(e,r,s)}catch(a){this.lookupAsync=async()=>{let n=new Error(\"Cache Error. Please recreate the CacheableLookup instance.\");throw n.cause=a,n}}Fet(this._cache)&&this._tick(s)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Net);try{let r=await this._resolve(e);r.entries.length===0&&this._fallback&&(r=await this._lookup(e),r.entries.length!==0&&this._hostnamesToFallback.add(e));let s=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,s),delete this._pending[e],r.entries}catch(r){throw delete this._pending[e],r}}_tick(e){let r=this._nextRemovalTime;(!r||e<r)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=e,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let s=1/0,a=Date.now();for(let[n,c]of this._cache){let f=c[Que];a>=f?this._cache.delete(n):f<s&&(s=f)}s!==1/0&&this._tick(s-a)},e),this._removalTimeout.unref&&this._removalTimeout.unref())}install(e){if(Rue(e),pI in e)throw new Error(\"CacheableLookup has been already installed\");e[pI]=e.createConnection,e[rH]=this,e.createConnection=(r,s)=>(\"lookup\"in r||(r.lookup=this.lookup),e[pI](r,s))}uninstall(e){if(Rue(e),e[pI]){if(e[rH]!==this)throw new Error(\"The agent is not owned by this CacheableLookup instance\");e.createConnection=e[pI],delete e[pI],delete e[rH]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Tue(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};nH.exports=_Q;nH.exports.default=_Q});var Uue=_((hMt,iH)=>{\"use strict\";var Oet=typeof URL>\"u\"?Ie(\"url\").URL:URL,Let=\"text/plain\",Met=\"us-ascii\",Lue=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Uet=(t,{stripHash:e})=>{let r=t.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!r)throw new Error(`Invalid URL: ${t}`);let s=r[1].split(\";\"),a=r[2],n=e?\"\":r[3],c=!1;s[s.length-1]===\"base64\"&&(s.pop(),c=!0);let f=(s.shift()||\"\").toLowerCase(),h=[...s.map(E=>{let[C,S=\"\"]=E.split(\"=\").map(b=>b.trim());return C===\"charset\"&&(S=S.toLowerCase(),S===Met)?\"\":`${C}${S?`=${S}`:\"\"}`}).filter(Boolean)];return c&&h.push(\"base64\"),(h.length!==0||f&&f!==Let)&&h.unshift(f),`data:${h.join(\";\")},${c?a.trim():a}${n?`#${n}`:\"\"}`},Mue=(t,e)=>{if(e={defaultProtocol:\"http:\",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},Reflect.has(e,\"normalizeHttps\"))throw new Error(\"options.normalizeHttps is renamed to options.forceHttp\");if(Reflect.has(e,\"normalizeHttp\"))throw new Error(\"options.normalizeHttp is renamed to options.forceHttps\");if(Reflect.has(e,\"stripFragment\"))throw new Error(\"options.stripFragment is renamed to options.stripHash\");if(t=t.trim(),/^data:/i.test(t))return Uet(t,e);let r=t.startsWith(\"//\");!r&&/^\\.*\\//.test(t)||(t=t.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//,e.defaultProtocol));let a=new Oet(t);if(e.forceHttp&&e.forceHttps)throw new Error(\"The `forceHttp` and `forceHttps` options cannot be used together\");if(e.forceHttp&&a.protocol===\"https:\"&&(a.protocol=\"http:\"),e.forceHttps&&a.protocol===\"http:\"&&(a.protocol=\"https:\"),e.stripAuthentication&&(a.username=\"\",a.password=\"\"),e.stripHash&&(a.hash=\"\"),a.pathname&&(a.pathname=a.pathname.replace(/((?!:).|^)\\/{2,}/g,(n,c)=>/^(?!\\/)/g.test(c)?`${c}/`:\"/\")),a.pathname&&(a.pathname=decodeURI(a.pathname)),e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let n=a.pathname.split(\"/\"),c=n[n.length-1];Lue(c,e.removeDirectoryIndex)&&(n=n.slice(0,n.length-1),a.pathname=n.slice(1).join(\"/\")+\"/\")}if(a.hostname&&(a.hostname=a.hostname.replace(/\\.$/,\"\"),e.stripWWW&&/^www\\.([a-z\\-\\d]{2,63})\\.([a-z.]{2,5})$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\\./,\"\"))),Array.isArray(e.removeQueryParameters))for(let n of[...a.searchParams.keys()])Lue(n,e.removeQueryParameters)&&a.searchParams.delete(n);return e.sortQueryParameters&&a.searchParams.sort(),e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\\/$/,\"\")),t=a.toString(),(e.removeTrailingSlash||a.pathname===\"/\")&&a.hash===\"\"&&(t=t.replace(/\\/$/,\"\")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\\/\\//,\"//\")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\\/\\//,\"\")),t};iH.exports=Mue;iH.exports.default=Mue});var jue=_((gMt,Hue)=>{Hue.exports=_ue;function _ue(t,e){if(t&&e)return _ue(t)(e);if(typeof t!=\"function\")throw new TypeError(\"need wrapper function\");return Object.keys(t).forEach(function(s){r[s]=t[s]}),r;function r(){for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];var n=t.apply(this,s),c=s[s.length-1];return typeof n==\"function\"&&n!==c&&Object.keys(c).forEach(function(f){n[f]=c[f]}),n}}});var oH=_((dMt,sH)=>{var Gue=jue();sH.exports=Gue(HQ);sH.exports.strict=Gue(que);HQ.proto=HQ(function(){Object.defineProperty(Function.prototype,\"once\",{value:function(){return HQ(this)},configurable:!0}),Object.defineProperty(Function.prototype,\"onceStrict\",{value:function(){return que(this)},configurable:!0})});function HQ(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function que(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||\"Function wrapped with `once`\";return e.onceError=r+\" shouldn't be called more than once\",e.called=!1,e}});var aH=_((mMt,Yue)=>{var _et=oH(),Het=function(){},jet=function(t){return t.setHeader&&typeof t.abort==\"function\"},Get=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},Wue=function(t,e,r){if(typeof e==\"function\")return Wue(t,null,e);e||(e={}),r=_et(r||Het);var s=t._writableState,a=t._readableState,n=e.readable||e.readable!==!1&&t.readable,c=e.writable||e.writable!==!1&&t.writable,f=function(){t.writable||p()},p=function(){c=!1,n||r.call(t)},h=function(){n=!1,c||r.call(t)},E=function(I){r.call(t,I?new Error(\"exited with error code: \"+I):null)},C=function(I){r.call(t,I)},S=function(){if(n&&!(a&&a.ended))return r.call(t,new Error(\"premature close\"));if(c&&!(s&&s.ended))return r.call(t,new Error(\"premature close\"))},b=function(){t.req.on(\"finish\",p)};return jet(t)?(t.on(\"complete\",p),t.on(\"abort\",S),t.req?b():t.on(\"request\",b)):c&&!s&&(t.on(\"end\",f),t.on(\"close\",f)),Get(t)&&t.on(\"exit\",E),t.on(\"end\",h),t.on(\"finish\",p),e.error!==!1&&t.on(\"error\",C),t.on(\"close\",S),function(){t.removeListener(\"complete\",p),t.removeListener(\"abort\",S),t.removeListener(\"request\",b),t.req&&t.req.removeListener(\"finish\",p),t.removeListener(\"end\",f),t.removeListener(\"close\",f),t.removeListener(\"finish\",p),t.removeListener(\"exit\",E),t.removeListener(\"end\",h),t.removeListener(\"error\",C),t.removeListener(\"close\",S)}};Yue.exports=Wue});var Kue=_((yMt,Jue)=>{var qet=oH(),Wet=aH(),lH=Ie(\"fs\"),JB=function(){},Yet=/^v?\\.0/.test(process.version),jQ=function(t){return typeof t==\"function\"},Vet=function(t){return!Yet||!lH?!1:(t instanceof(lH.ReadStream||JB)||t instanceof(lH.WriteStream||JB))&&jQ(t.close)},Jet=function(t){return t.setHeader&&jQ(t.abort)},Ket=function(t,e,r,s){s=qet(s);var a=!1;t.on(\"close\",function(){a=!0}),Wet(t,{readable:e,writable:r},function(c){if(c)return s(c);a=!0,s()});var n=!1;return function(c){if(!a&&!n){if(n=!0,Vet(t))return t.close(JB);if(Jet(t))return t.abort();if(jQ(t.destroy))return t.destroy();s(c||new Error(\"stream was destroyed\"))}}},Vue=function(t){t()},zet=function(t,e){return t.pipe(e)},Zet=function(){var t=Array.prototype.slice.call(arguments),e=jQ(t[t.length-1]||JB)&&t.pop()||JB;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error(\"pump requires two streams per minimum\");var r,s=t.map(function(a,n){var c=n<t.length-1,f=n>0;return Ket(a,c,f,function(p){r||(r=p),p&&s.forEach(Vue),!c&&(s.forEach(Vue),e(r))})});return t.reduce(zet)};Jue.exports=Zet});var Zue=_((EMt,zue)=>{\"use strict\";var{PassThrough:Xet}=Ie(\"stream\");zue.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,s=r===\"buffer\",a=!1;e?a=!(r||s):r=r||\"utf8\",s&&(r=null);let n=new Xet({objectMode:a});r&&n.setEncoding(r);let c=0,f=[];return n.on(\"data\",p=>{f.push(p),a?c=f.length:c+=p.length}),n.getBufferedValue=()=>e?f:s?Buffer.concat(f,c):f.join(\"\"),n.getBufferedLength=()=>c,n}});var Xue=_((IMt,hI)=>{\"use strict\";var $et=Kue(),ett=Zue(),GQ=class extends Error{constructor(){super(\"maxBuffer exceeded\"),this.name=\"MaxBufferError\"}};async function qQ(t,e){if(!t)return Promise.reject(new Error(\"Expected a stream\"));e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,s;return await new Promise((a,n)=>{let c=f=>{f&&(f.bufferedData=s.getBufferedValue()),n(f)};s=$et(t,ett(e),f=>{if(f){c(f);return}a()}),s.on(\"data\",()=>{s.getBufferedLength()>r&&c(new GQ)})}),s.getBufferedValue()}hI.exports=qQ;hI.exports.default=qQ;hI.exports.buffer=(t,e)=>qQ(t,{...e,encoding:\"buffer\"});hI.exports.array=(t,e)=>qQ(t,{...e,array:!0});hI.exports.MaxBufferError=GQ});var efe=_((wMt,$ue)=>{\"use strict\";var ttt=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),rtt=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),ntt=new Set([500,502,503,504]),itt={date:!0,connection:!0,\"keep-alive\":!0,\"proxy-authenticate\":!0,\"proxy-authorization\":!0,te:!0,trailer:!0,\"transfer-encoding\":!0,upgrade:!0},stt={\"content-length\":!0,\"content-encoding\":!0,\"transfer-encoding\":!0,\"content-range\":!0};function nm(t){let e=parseInt(t,10);return isFinite(e)?e:0}function ott(t){return t?ntt.has(t.status):!0}function cH(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let s of r){let[a,n]=s.split(/=/,2);e[a.trim()]=n===void 0?!0:n.trim().replace(/^\"|\"$/g,\"\")}return e}function att(t){let e=[];for(let r in t){let s=t[r];e.push(s===!0?r:r+\"=\"+s)}if(e.length)return e.join(\", \")}$ue.exports=class{constructor(e,r,{shared:s,cacheHeuristic:a,immutableMinTimeToLive:n,ignoreCargoCult:c,_fromObject:f}={}){if(f){this._fromObject(f);return}if(!r||!r.headers)throw Error(\"Response headers missing\");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=s!==!1,this._cacheHeuristic=a!==void 0?a:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status=\"status\"in r?r.status:200,this._resHeaders=r.headers,this._rescc=cH(r.headers[\"cache-control\"]),this._method=\"method\"in e?e.method:\"GET\",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=cH(e.headers[\"cache-control\"]),c&&\"pre-check\"in this._rescc&&\"post-check\"in this._rescc&&(delete this._rescc[\"pre-check\"],delete this._rescc[\"post-check\"],delete this._rescc[\"no-cache\"],delete this._rescc[\"no-store\"],delete this._rescc[\"must-revalidate\"],this._resHeaders=Object.assign({},this._resHeaders,{\"cache-control\":att(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers[\"cache-control\"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc[\"no-cache\"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc[\"no-store\"]&&(this._method===\"GET\"||this._method===\"HEAD\"||this._method===\"POST\"&&this._hasExplicitExpiration())&&rtt.has(this._status)&&!this._rescc[\"no-store\"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc[\"max-age\"]||this._isShared&&this._rescc[\"s-maxage\"]||this._rescc.public||ttt.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc[\"s-maxage\"]||this._rescc[\"max-age\"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error(\"Request headers missing\")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=cH(e.headers[\"cache-control\"]);return r[\"no-cache\"]||/no-cache/.test(e.headers.pragma)||r[\"max-age\"]&&this.age()>r[\"max-age\"]||r[\"min-fresh\"]&&this.timeToLive()<1e3*r[\"min-fresh\"]||this.stale()&&!(r[\"max-stale\"]&&!this._rescc[\"must-revalidate\"]&&(r[\"max-stale\"]===!0||r[\"max-stale\"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method===\"HEAD\")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc[\"must-revalidate\"]||this._rescc.public||this._rescc[\"s-maxage\"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary===\"*\")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\\s*,\\s*/);for(let s of r)if(e.headers[s]!==this._reqHeaders[s])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let s in e)itt[s]||(r[s]=e[s]);if(e.connection){let s=e.connection.trim().split(/\\s*,\\s*/);for(let a of s)delete r[a]}if(r.warning){let s=r.warning.split(/,/).filter(a=>!/^\\s*1[0-9][0-9]/.test(a));s.length?r.warning=s.join(\",\").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:\"\")+'113 - \"rfc7234 5.5.4\"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return nm(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc[\"no-cache\"]||this._isShared&&this._resHeaders[\"set-cookie\"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary===\"*\")return 0;if(this._isShared){if(this._rescc[\"proxy-revalidate\"])return 0;if(this._rescc[\"s-maxage\"])return nm(this._rescc[\"s-maxage\"])}if(this._rescc[\"max-age\"])return nm(this._rescc[\"max-age\"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let s=Date.parse(this._resHeaders.expires);return Number.isNaN(s)||s<r?0:Math.max(e,(s-r)/1e3)}if(this._resHeaders[\"last-modified\"]){let s=Date.parse(this._resHeaders[\"last-modified\"]);if(isFinite(s)&&r>s)return Math.max(e,(r-s)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+nm(this._rescc[\"stale-if-error\"]),s=e+nm(this._rescc[\"stale-while-revalidate\"]);return Math.max(0,e,r,s)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+nm(this._rescc[\"stale-if-error\"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+nm(this._rescc[\"stale-while-revalidate\"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error(\"Reinitialized\");if(!e||e.v!==1)throw Error(\"Invalid serialization\");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r[\"if-range\"],!this._requestMatches(e,!0)||!this.storable())return delete r[\"if-none-match\"],delete r[\"if-modified-since\"],r;if(this._resHeaders.etag&&(r[\"if-none-match\"]=r[\"if-none-match\"]?`${r[\"if-none-match\"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r[\"accept-ranges\"]||r[\"if-match\"]||r[\"if-unmodified-since\"]||this._method&&this._method!=\"GET\"){if(delete r[\"if-modified-since\"],r[\"if-none-match\"]){let a=r[\"if-none-match\"].split(/,/).filter(n=>!/^\\s*W\\//.test(n));a.length?r[\"if-none-match\"]=a.join(\",\").trim():delete r[\"if-none-match\"]}}else this._resHeaders[\"last-modified\"]&&!r[\"if-modified-since\"]&&(r[\"if-modified-since\"]=this._resHeaders[\"last-modified\"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&ott(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error(\"Response headers missing\");let s=!1;if(r.status!==void 0&&r.status!=304?s=!1:r.headers.etag&&!/^\\s*W\\//.test(r.headers.etag)?s=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\\s*W\\//,\"\")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?s=this._resHeaders.etag.replace(/^\\s*W\\//,\"\")===r.headers.etag.replace(/^\\s*W\\//,\"\"):this._resHeaders[\"last-modified\"]?s=this._resHeaders[\"last-modified\"]===r.headers[\"last-modified\"]:!this._resHeaders.etag&&!this._resHeaders[\"last-modified\"]&&!r.headers.etag&&!r.headers[\"last-modified\"]&&(s=!0),!s)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let a={};for(let c in this._resHeaders)a[c]=c in r.headers&&!stt[c]?r.headers[c]:this._resHeaders[c];let n=Object.assign({},r,{status:this._status,method:this._method,headers:a});return{policy:new this.constructor(e,n,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var WQ=_((BMt,tfe)=>{\"use strict\";tfe.exports=t=>{let e={};for(let[r,s]of Object.entries(t))e[r.toLowerCase()]=s;return e}});var nfe=_((vMt,rfe)=>{\"use strict\";var ltt=Ie(\"stream\").Readable,ctt=WQ(),uH=class extends ltt{constructor(e,r,s,a){if(typeof e!=\"number\")throw new TypeError(\"Argument `statusCode` should be a number\");if(typeof r!=\"object\")throw new TypeError(\"Argument `headers` should be an object\");if(!(s instanceof Buffer))throw new TypeError(\"Argument `body` should be a buffer\");if(typeof a!=\"string\")throw new TypeError(\"Argument `url` should be a string\");super(),this.statusCode=e,this.headers=ctt(r),this.body=s,this.url=a}_read(){this.push(this.body),this.push(null)}};rfe.exports=uH});var sfe=_((SMt,ife)=>{\"use strict\";var utt=[\"destroy\",\"setTimeout\",\"socket\",\"headers\",\"trailers\",\"rawHeaders\",\"statusCode\",\"httpVersion\",\"httpVersionMinor\",\"httpVersionMajor\",\"rawTrailers\",\"statusMessage\"];ife.exports=(t,e)=>{let r=new Set(Object.keys(t).concat(utt));for(let s of r)s in e||(e[s]=typeof t[s]==\"function\"?t[s].bind(t):t[s])}});var afe=_((DMt,ofe)=>{\"use strict\";var ftt=Ie(\"stream\").PassThrough,Att=sfe(),ptt=t=>{if(!(t&&t.pipe))throw new TypeError(\"Parameter `response` must be a response stream.\");let e=new ftt;return Att(t,e),t.pipe(e)};ofe.exports=ptt});var lfe=_(fH=>{fH.stringify=function t(e){if(typeof e>\"u\")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(\":base64:\"+e.toString(\"base64\"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e==\"object\"){var r=\"\",s=Array.isArray(e);r=s?\"[\":\"{\";var a=!0;for(var n in e){var c=typeof e[n]==\"function\"||!s&&typeof e[n]>\"u\";Object.hasOwnProperty.call(e,n)&&!c&&(a||(r+=\",\"),a=!1,s?e[n]==null?r+=\"null\":r+=t(e[n]):e[n]!==void 0&&(r+=t(n)+\":\"+t(e[n])))}return r+=s?\"]\":\"}\",r}else return typeof e==\"string\"?JSON.stringify(/^:/.test(e)?\":\"+e:e):typeof e>\"u\"?\"null\":JSON.stringify(e)};fH.parse=function(t){return JSON.parse(t,function(e,r){return typeof r==\"string\"?/^:base64:/.test(r)?Buffer.from(r.substring(8),\"base64\"):/^:/.test(r)?r.substring(1):r:r})}});var Afe=_((bMt,ffe)=>{\"use strict\";var htt=Ie(\"events\"),cfe=lfe(),gtt=t=>{let e={redis:\"@keyv/redis\",rediss:\"@keyv/redis\",mongodb:\"@keyv/mongo\",mongo:\"@keyv/mongo\",sqlite:\"@keyv/sqlite\",postgresql:\"@keyv/postgres\",postgres:\"@keyv/postgres\",mysql:\"@keyv/mysql\",etcd:\"@keyv/etcd\",offline:\"@keyv/offline\",tiered:\"@keyv/tiered\"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(Ie(e[r]))(t)}return new Map},ufe=[\"sqlite\",\"postgres\",\"mysql\",\"mongo\",\"redis\",\"tiered\"],AH=class extends htt{constructor(e,{emitErrors:r=!0,...s}={}){if(super(),this.opts={namespace:\"keyv\",serialize:cfe.stringify,deserialize:cfe.parse,...typeof e==\"string\"?{uri:e}:e,...s},!this.opts.store){let n={...this.opts};this.opts.store=gtt(n)}if(this.opts.compression){let n=this.opts.compression;this.opts.serialize=n.serialize.bind(n),this.opts.deserialize=n.deserialize.bind(n)}typeof this.opts.store.on==\"function\"&&r&&this.opts.store.on(\"error\",n=>this.emit(\"error\",n)),this.opts.store.namespace=this.opts.namespace;let a=n=>async function*(){for await(let[c,f]of typeof n==\"function\"?n(this.opts.store.namespace):n){let p=await this.opts.deserialize(f);if(!(this.opts.store.namespace&&!c.includes(this.opts.store.namespace))){if(typeof p.expires==\"number\"&&Date.now()>p.expires){this.delete(c);continue}yield[this._getKeyUnprefix(c),p.value]}}};typeof this.opts.store[Symbol.iterator]==\"function\"&&this.opts.store instanceof Map?this.iterator=a(this.opts.store):typeof this.opts.store.iterator==\"function\"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=a(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return ufe.includes(this.opts.store.opts.dialect)||ufe.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(\":\").splice(1).join(\":\")}get(e,r){let{store:s}=this.opts,a=Array.isArray(e),n=a?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(a&&s.getMany===void 0){let c=[];for(let f of n)c.push(Promise.resolve().then(()=>s.get(f)).then(p=>typeof p==\"string\"?this.opts.deserialize(p):this.opts.compression?this.opts.deserialize(p):p).then(p=>{if(p!=null)return typeof p.expires==\"number\"&&Date.now()>p.expires?this.delete(f).then(()=>{}):r&&r.raw?p:p.value}));return Promise.allSettled(c).then(f=>{let p=[];for(let h of f)p.push(h.value);return p})}return Promise.resolve().then(()=>a?s.getMany(n):s.get(n)).then(c=>typeof c==\"string\"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return a?c.map((f,p)=>{if(typeof f==\"string\"&&(f=this.opts.deserialize(f)),f!=null){if(typeof f.expires==\"number\"&&Date.now()>f.expires){this.delete(e[p]).then(()=>{});return}return r&&r.raw?f:f.value}}):typeof c.expires==\"number\"&&Date.now()>c.expires?this.delete(e).then(()=>{}):r&&r.raw?c:c.value})}set(e,r,s){let a=this._getKeyPrefix(e);typeof s>\"u\"&&(s=this.opts.ttl),s===0&&(s=void 0);let{store:n}=this.opts;return Promise.resolve().then(()=>{let c=typeof s==\"number\"?Date.now()+s:null;return typeof r==\"symbol\"&&this.emit(\"error\",\"symbol cannot be serialized\"),r={value:r,expires:c},this.opts.serialize(r)}).then(c=>n.set(a,c,s)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let a=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let n=[];for(let c of a)n.push(r.delete(c));return Promise.allSettled(n).then(c=>c.every(f=>f.value===!0))}return Promise.resolve().then(()=>r.deleteMany(a))}let s=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(s))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:s}=this.opts;return Promise.resolve().then(async()=>typeof s.has==\"function\"?s.has(r):await s.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect==\"function\")return e.disconnect()}};ffe.exports=AH});var gfe=_((kMt,hfe)=>{\"use strict\";var dtt=Ie(\"events\"),YQ=Ie(\"url\"),mtt=Uue(),ytt=Xue(),pH=efe(),pfe=nfe(),Ett=WQ(),Itt=afe(),Ctt=Afe(),KB=class t{constructor(e,r){if(typeof e!=\"function\")throw new TypeError(\"Parameter `request` must be a function\");return this.cache=new Ctt({uri:typeof r==\"string\"&&r,store:typeof r!=\"string\"&&r,namespace:\"cacheable-request\"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(r,s)=>{let a;if(typeof r==\"string\")a=hH(YQ.parse(r)),r={};else if(r instanceof YQ.URL)a=hH(YQ.parse(r.toString())),r={};else{let[C,...S]=(r.path||\"\").split(\"?\"),b=S.length>0?`?${S.join(\"?\")}`:\"\";a=hH({...r,pathname:C,search:b})}r={headers:{},method:\"GET\",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...wtt(a)},r.headers=Ett(r.headers);let n=new dtt,c=mtt(YQ.format(a),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),f=`${r.method}:${c}`,p=!1,h=!1,E=C=>{h=!0;let S=!1,b,I=new Promise(N=>{b=()=>{S||(S=!0,N())}}),T=N=>{if(p&&!C.forceRefresh){N.status=N.statusCode;let W=pH.fromObject(p.cachePolicy).revalidatedPolicy(C,N);if(!W.modified){let ee=W.policy.responseHeaders();N=new pfe(p.statusCode,ee,p.body,p.url),N.cachePolicy=W.policy,N.fromCache=!0}}N.fromCache||(N.cachePolicy=new pH(C,N,C),N.fromCache=!1);let U;C.cache&&N.cachePolicy.storable()?(U=Itt(N),(async()=>{try{let W=ytt.buffer(N);if(await Promise.race([I,new Promise(le=>N.once(\"end\",le))]),S)return;let ee=await W,ie={cachePolicy:N.cachePolicy.toObject(),url:N.url,statusCode:N.fromCache?p.statusCode:N.statusCode,body:ee},ue=C.strictTtl?N.cachePolicy.timeToLive():void 0;C.maxTtl&&(ue=ue?Math.min(ue,C.maxTtl):C.maxTtl),await this.cache.set(f,ie,ue)}catch(W){n.emit(\"error\",new t.CacheError(W))}})()):C.cache&&p&&(async()=>{try{await this.cache.delete(f)}catch(W){n.emit(\"error\",new t.CacheError(W))}})(),n.emit(\"response\",U||N),typeof s==\"function\"&&s(U||N)};try{let N=e(C,T);N.once(\"error\",b),N.once(\"abort\",b),n.emit(\"request\",N)}catch(N){n.emit(\"error\",new t.RequestError(N))}};return(async()=>{let C=async b=>{await Promise.resolve();let I=b.cache?await this.cache.get(f):void 0;if(typeof I>\"u\")return E(b);let T=pH.fromObject(I.cachePolicy);if(T.satisfiesWithoutRevalidation(b)&&!b.forceRefresh){let N=T.responseHeaders(),U=new pfe(I.statusCode,N,I.body,I.url);U.cachePolicy=T,U.fromCache=!0,n.emit(\"response\",U),typeof s==\"function\"&&s(U)}else p=I,b.headers=T.revalidationHeaders(b),E(b)},S=b=>n.emit(\"error\",new t.CacheError(b));this.cache.once(\"error\",S),n.on(\"response\",()=>this.cache.removeListener(\"error\",S));try{await C(r)}catch(b){r.automaticFailover&&!h&&E(r),n.emit(\"error\",new t.CacheError(b))}})(),n}}};function wtt(t){let e={...t};return e.path=`${t.pathname||\"/\"}${t.search||\"\"}`,delete e.pathname,delete e.search,e}function hH(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||\"localhost\",port:t.port,pathname:t.pathname,search:t.search}}KB.RequestError=class extends Error{constructor(t){super(t.message),this.name=\"RequestError\",Object.assign(this,t)}};KB.CacheError=class extends Error{constructor(t){super(t.message),this.name=\"CacheError\",Object.assign(this,t)}};hfe.exports=KB});var mfe=_((TMt,dfe)=>{\"use strict\";var Btt=[\"aborted\",\"complete\",\"headers\",\"httpVersion\",\"httpVersionMinor\",\"httpVersionMajor\",\"method\",\"rawHeaders\",\"rawTrailers\",\"setTimeout\",\"socket\",\"statusCode\",\"statusMessage\",\"trailers\",\"url\"];dfe.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error(\"The second stream must have the `autoDestroy` option set to `false`\");let r=new Set(Object.keys(t).concat(Btt)),s={};for(let a of r)a in e||(s[a]={get(){let n=t[a];return typeof n==\"function\"?n.bind(t):n},set(n){t[a]=n},enumerable:!0,configurable:!1});return Object.defineProperties(e,s),t.once(\"aborted\",()=>{e.destroy(),e.emit(\"aborted\")}),t.once(\"close\",()=>{t.complete&&e.readable?e.once(\"end\",()=>{e.emit(\"close\")}):e.emit(\"close\")}),e}});var Efe=_((FMt,yfe)=>{\"use strict\";var{Transform:vtt,PassThrough:Stt}=Ie(\"stream\"),gH=Ie(\"zlib\"),Dtt=mfe();yfe.exports=t=>{let e=(t.headers[\"content-encoding\"]||\"\").toLowerCase();if(![\"gzip\",\"deflate\",\"br\"].includes(e))return t;let r=e===\"br\";if(r&&typeof gH.createBrotliDecompress!=\"function\")return t.destroy(new Error(\"Brotli is not supported on Node.js < 12\")),t;let s=!0,a=new vtt({transform(f,p,h){s=!1,h(null,f)},flush(f){f()}}),n=new Stt({autoDestroy:!1,destroy(f,p){t.destroy(),p(f)}}),c=r?gH.createBrotliDecompress():gH.createUnzip();return c.once(\"error\",f=>{if(s&&!t.readable){n.end();return}n.destroy(f)}),Dtt(t,n),t.pipe(a).pipe(c).pipe(n),n}});var mH=_((NMt,Ife)=>{\"use strict\";var dH=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError(\"`maxSize` must be a number greater than 0\");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction==\"function\")for(let[s,a]of this.oldCache.entries())this.onEviction(s,a);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};Ife.exports=dH});var EH=_((OMt,vfe)=>{\"use strict\";var Ptt=Ie(\"events\"),btt=Ie(\"tls\"),xtt=Ie(\"http2\"),ktt=mH(),ba=Symbol(\"currentStreamsCount\"),Cfe=Symbol(\"request\"),Tc=Symbol(\"cachedOriginSet\"),gI=Symbol(\"gracefullyClosing\"),Qtt=[\"maxDeflateDynamicTableSize\",\"maxSessionMemory\",\"maxHeaderListPairs\",\"maxOutstandingPings\",\"maxReservedRemoteStreams\",\"maxSendHeaderBlockLength\",\"paddingStrategy\",\"localAddress\",\"path\",\"rejectUnauthorized\",\"minDHSize\",\"ca\",\"cert\",\"clientCertEngine\",\"ciphers\",\"key\",\"pfx\",\"servername\",\"minVersion\",\"maxVersion\",\"secureProtocol\",\"crl\",\"honorCipherOrder\",\"ecdhCurve\",\"dhparam\",\"secureOptions\",\"sessionIdContext\"],Rtt=(t,e,r)=>{let s=0,a=t.length;for(;s<a;){let n=s+a>>>1;r(t[n],e)?s=n+1:a=n}return s},Ttt=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,yH=(t,e)=>{for(let r of t)r[Tc].length<e[Tc].length&&r[Tc].every(s=>e[Tc].includes(s))&&r[ba]+e[ba]<=e.remoteSettings.maxConcurrentStreams&&Bfe(r)},Ftt=(t,e)=>{for(let r of t)e[Tc].length<r[Tc].length&&e[Tc].every(s=>r[Tc].includes(s))&&e[ba]+r[ba]<=r.remoteSettings.maxConcurrentStreams&&Bfe(e)},wfe=({agent:t,isFree:e})=>{let r={};for(let s in t.sessions){let n=t.sessions[s].filter(c=>{let f=c[im.kCurrentStreamsCount]<c.remoteSettings.maxConcurrentStreams;return e?f:!f});n.length!==0&&(r[s]=n)}return r},Bfe=t=>{t[gI]=!0,t[ba]===0&&t.close()},im=class t extends Ptt{constructor({timeout:e=6e4,maxSessions:r=1/0,maxFreeSessions:s=10,maxCachedTlsSessions:a=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxFreeSessions=s,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new ktt({maxSize:a})}static normalizeOrigin(e,r){return typeof e==\"string\"&&(e=new URL(e)),r&&e.hostname!==r&&(e.hostname=r),e.origin}normalizeOptions(e){let r=\"\";if(e)for(let s of Qtt)e[s]&&(r+=`:${e[s]}`);return r}_tryToCreateNewSession(e,r){if(!(e in this.queue)||!(r in this.queue[e]))return;let s=this.queue[e][r];this._sessionsCount<this.maxSessions&&!s.completed&&(s.completed=!0,s())}getSession(e,r,s){return new Promise((a,n)=>{Array.isArray(s)?(s=[...s],a()):s=[{resolve:a,reject:n}];let c=this.normalizeOptions(r),f=t.normalizeOrigin(e,r&&r.servername);if(f===void 0){for(let{reject:E}of s)E(new TypeError(\"The `origin` argument needs to be a string or an URL object\"));return}if(c in this.sessions){let E=this.sessions[c],C=-1,S=-1,b;for(let I of E){let T=I.remoteSettings.maxConcurrentStreams;if(T<C)break;if(I[Tc].includes(f)){let N=I[ba];if(N>=T||I[gI]||I.destroyed)continue;b||(C=T),N>S&&(b=I,S=N)}}if(b){if(s.length!==1){for(let{reject:I}of s){let T=new Error(`Expected the length of listeners to be 1, got ${s.length}.\nPlease report this to https://github.com/szmarczak/http2-wrapper/`);I(T)}return}s[0].resolve(b);return}}if(c in this.queue){if(f in this.queue[c]){this.queue[c][f].listeners.push(...s),this._tryToCreateNewSession(c,f);return}}else this.queue[c]={};let p=()=>{c in this.queue&&this.queue[c][f]===h&&(delete this.queue[c][f],Object.keys(this.queue[c]).length===0&&delete this.queue[c])},h=()=>{let E=`${f}:${c}`,C=!1;try{let S=xtt.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});S[ba]=0,S[gI]=!1;let b=()=>S[ba]<S.remoteSettings.maxConcurrentStreams,I=!0;S.socket.once(\"session\",N=>{this.tlsSessionCache.set(E,N)}),S.once(\"error\",N=>{for(let{reject:U}of s)U(N);this.tlsSessionCache.delete(E)}),S.setTimeout(this.timeout,()=>{S.destroy()}),S.once(\"close\",()=>{if(C){I&&this._freeSessionsCount--,this._sessionsCount--;let N=this.sessions[c];N.splice(N.indexOf(S),1),N.length===0&&delete this.sessions[c]}else{let N=new Error(\"Session closed without receiving a SETTINGS frame\");N.code=\"HTTP2WRAPPER_NOSETTINGS\";for(let{reject:U}of s)U(N);p()}this._tryToCreateNewSession(c,f)});let T=()=>{if(!(!(c in this.queue)||!b())){for(let N of S[Tc])if(N in this.queue[c]){let{listeners:U}=this.queue[c][N];for(;U.length!==0&&b();)U.shift().resolve(S);let W=this.queue[c];if(W[N].listeners.length===0&&(delete W[N],Object.keys(W).length===0)){delete this.queue[c];break}if(!b())break}}};S.on(\"origin\",()=>{S[Tc]=S.originSet,b()&&(T(),yH(this.sessions[c],S))}),S.once(\"remoteSettings\",()=>{if(S.ref(),S.unref(),this._sessionsCount++,h.destroyed){let N=new Error(\"Agent has been destroyed\");for(let U of s)U.reject(N);S.destroy();return}S[Tc]=S.originSet;{let N=this.sessions;if(c in N){let U=N[c];U.splice(Rtt(U,S,Ttt),0,S)}else N[c]=[S]}this._freeSessionsCount+=1,C=!0,this.emit(\"session\",S),T(),p(),S[ba]===0&&this._freeSessionsCount>this.maxFreeSessions&&S.close(),s.length!==0&&(this.getSession(f,r,s),s.length=0),S.on(\"remoteSettings\",()=>{T(),yH(this.sessions[c],S)})}),S[Cfe]=S.request,S.request=(N,U)=>{if(S[gI])throw new Error(\"The session is gracefully closing. No new streams are allowed.\");let W=S[Cfe](N,U);return S.ref(),++S[ba],S[ba]===S.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,W.once(\"close\",()=>{if(I=b(),--S[ba],!S.destroyed&&!S.closed&&(Ftt(this.sessions[c],S),b()&&!S.closed)){I||(this._freeSessionsCount++,I=!0);let ee=S[ba]===0;ee&&S.unref(),ee&&(this._freeSessionsCount>this.maxFreeSessions||S[gI])?S.close():(yH(this.sessions[c],S),T())}}),W}}catch(S){for(let b of s)b.reject(S);p()}};h.listeners=s,h.completed=!1,h.destroyed=!1,this.queue[c][f]=h,this._tryToCreateNewSession(c,f)})}request(e,r,s,a){return new Promise((n,c)=>{this.getSession(e,r,[{reject:c,resolve:f=>{try{n(f.request(s,a))}catch(p){c(p)}}}])})}createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=[\"h2\"];let s=e.port||443,a=e.hostname||e.host;return typeof r.servername>\"u\"&&(r.servername=a),btt.connect(s,a,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[ba]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let s of r)s.destroy(e);for(let r of Object.values(this.queue))for(let s of Object.values(r))s.destroyed=!0;this.queue={}}get freeSessions(){return wfe({agent:this,isFree:!0})}get busySessions(){return wfe({agent:this,isFree:!1})}};im.kCurrentStreamsCount=ba;im.kGracefullyClosing=gI;vfe.exports={Agent:im,globalAgent:new im}});var CH=_((LMt,Sfe)=>{\"use strict\";var{Readable:Ntt}=Ie(\"stream\"),IH=class extends Ntt{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage=\"\",this.httpVersion=\"2.0\",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners(\"data\"),this.resume())}_read(){this.req&&this.req._request.resume()}};Sfe.exports=IH});var wH=_((MMt,Dfe)=>{\"use strict\";Dfe.exports=t=>{let e={protocol:t.protocol,hostname:typeof t.hostname==\"string\"&&t.hostname.startsWith(\"[\")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||\"\"}${t.search||\"\"}`};return typeof t.port==\"string\"&&t.port.length!==0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||\"\"}:${t.password||\"\"}`),e}});var bfe=_((UMt,Pfe)=>{\"use strict\";Pfe.exports=(t,e,r)=>{for(let s of r)t.on(s,(...a)=>e.emit(s,...a))}});var kfe=_((_Mt,xfe)=>{\"use strict\";xfe.exports=t=>{switch(t){case\":method\":case\":scheme\":case\":authority\":case\":path\":return!0;default:return!1}}});var Rfe=_((jMt,Qfe)=>{\"use strict\";var dI=(t,e,r)=>{Qfe.exports[e]=class extends t{constructor(...a){super(typeof r==\"string\"?r:r(a)),this.name=`${super.name} [${e}]`,this.code=e}}};dI(TypeError,\"ERR_INVALID_ARG_TYPE\",t=>{let e=t[0].includes(\".\")?\"property\":\"argument\",r=t[1],s=Array.isArray(r);return s&&(r=`${r.slice(0,-1).join(\", \")} or ${r.slice(-1)}`),`The \"${t[0]}\" ${e} must be ${s?\"one of\":\"of\"} type ${r}. Received ${typeof t[2]}`});dI(TypeError,\"ERR_INVALID_PROTOCOL\",t=>`Protocol \"${t[0]}\" not supported. Expected \"${t[1]}\"`);dI(Error,\"ERR_HTTP_HEADERS_SENT\",t=>`Cannot ${t[0]} headers after they are sent to the client`);dI(TypeError,\"ERR_INVALID_HTTP_TOKEN\",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);dI(TypeError,\"ERR_HTTP_INVALID_HEADER_VALUE\",t=>`Invalid value \"${t[0]} for header \"${t[1]}\"`);dI(TypeError,\"ERR_INVALID_CHAR\",t=>`Invalid character in ${t[0]} [${t[1]}]`)});var PH=_((GMt,Ufe)=>{\"use strict\";var Ott=Ie(\"http2\"),{Writable:Ltt}=Ie(\"stream\"),{Agent:Tfe,globalAgent:Mtt}=EH(),Utt=CH(),_tt=wH(),Htt=bfe(),jtt=kfe(),{ERR_INVALID_ARG_TYPE:BH,ERR_INVALID_PROTOCOL:Gtt,ERR_HTTP_HEADERS_SENT:Ffe,ERR_INVALID_HTTP_TOKEN:qtt,ERR_HTTP_INVALID_HEADER_VALUE:Wtt,ERR_INVALID_CHAR:Ytt}=Rfe(),{HTTP2_HEADER_STATUS:Nfe,HTTP2_HEADER_METHOD:Ofe,HTTP2_HEADER_PATH:Lfe,HTTP2_METHOD_CONNECT:Vtt}=Ott.constants,Jo=Symbol(\"headers\"),vH=Symbol(\"origin\"),SH=Symbol(\"session\"),Mfe=Symbol(\"options\"),VQ=Symbol(\"flushedHeaders\"),zB=Symbol(\"jobs\"),Jtt=/^[\\^`\\-\\w!#$%&*+.|~]+$/,Ktt=/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/,DH=class extends Ltt{constructor(e,r,s){super({autoDestroy:!1});let a=typeof e==\"string\"||e instanceof URL;if(a&&(e=_tt(e instanceof URL?e:new URL(e))),typeof r==\"function\"||r===void 0?(s=r,r=a?e:{...e}):r={...e,...r},r.h2session)this[SH]=r.h2session;else if(r.agent===!1)this.agent=new Tfe({maxFreeSessions:0});else if(typeof r.agent>\"u\"||r.agent===null)typeof r.createConnection==\"function\"?(this.agent=new Tfe({maxFreeSessions:0}),this.agent.createConnection=r.createConnection):this.agent=Mtt;else if(typeof r.agent.request==\"function\")this.agent=r.agent;else throw new BH(\"options.agent\",[\"Agent-like Object\",\"undefined\",\"false\"],r.agent);if(r.protocol&&r.protocol!==\"https:\")throw new Gtt(r.protocol,\"https:\");let n=r.port||r.defaultPort||this.agent&&this.agent.defaultPort||443,c=r.hostname||r.host||\"localhost\";delete r.hostname,delete r.host,delete r.port;let{timeout:f}=r;if(r.timeout=void 0,this[Jo]=Object.create(null),this[zB]=[],this.socket=null,this.connection=null,this.method=r.method||\"GET\",this.path=r.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,r.headers)for(let[p,h]of Object.entries(r.headers))this.setHeader(p,h);r.auth&&!(\"authorization\"in this[Jo])&&(this[Jo].authorization=\"Basic \"+Buffer.from(r.auth).toString(\"base64\")),r.session=r.tlsSession,r.path=r.socketPath,this[Mfe]=r,n===443?(this[vH]=`https://${c}`,\":authority\"in this[Jo]||(this[Jo][\":authority\"]=c)):(this[vH]=`https://${c}:${n}`,\":authority\"in this[Jo]||(this[Jo][\":authority\"]=`${c}:${n}`)),f&&this.setTimeout(f),s&&this.once(\"response\",s),this[VQ]=!1}get method(){return this[Jo][Ofe]}set method(e){e&&(this[Jo][Ofe]=e.toUpperCase())}get path(){return this[Jo][Lfe]}set path(e){e&&(this[Jo][Lfe]=e)}get _mustNotHaveABody(){return this.method===\"GET\"||this.method===\"HEAD\"||this.method===\"DELETE\"}_write(e,r,s){if(this._mustNotHaveABody){s(new Error(\"The GET, HEAD and DELETE methods must NOT have a body\"));return}this.flushHeaders();let a=()=>this._request.write(e,r,s);this._request?a():this[zB].push(a)}_final(e){if(this.destroyed)return;this.flushHeaders();let r=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?r():this[zB].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit(\"abort\")),this.aborted=!0,this.destroy())}_destroy(e,r){this.res&&this.res._dump(),this._request&&this._request.destroy(),r(e)}async flushHeaders(){if(this[VQ]||this.destroyed)return;this[VQ]=!0;let e=this.method===Vtt,r=s=>{if(this._request=s,this.destroyed){s.destroy();return}e||Htt(s,this,[\"timeout\",\"continue\",\"close\",\"error\"]);let a=c=>(...f)=>{!this.writable&&!this.destroyed?c(...f):this.once(\"finish\",()=>{c(...f)})};s.once(\"response\",a((c,f,p)=>{let h=new Utt(this.socket,s.readableHighWaterMark);this.res=h,h.req=this,h.statusCode=c[Nfe],h.headers=c,h.rawHeaders=p,h.once(\"end\",()=>{this.aborted?(h.aborted=!0,h.emit(\"aborted\")):(h.complete=!0,h.socket=null,h.connection=null)}),e?(h.upgrade=!0,this.emit(\"connect\",h,s,Buffer.alloc(0))?this.emit(\"close\"):s.destroy()):(s.on(\"data\",E=>{!h._dumped&&!h.push(E)&&s.pause()}),s.once(\"end\",()=>{h.push(null)}),this.emit(\"response\",h)||h._dump())})),s.once(\"headers\",a(c=>this.emit(\"information\",{statusCode:c[Nfe]}))),s.once(\"trailers\",a((c,f,p)=>{let{res:h}=this;h.trailers=c,h.rawTrailers=p}));let{socket:n}=s.session;this.socket=n,this.connection=n;for(let c of this[zB])c();this.emit(\"socket\",this.socket)};if(this[SH])try{r(this[SH].request(this[Jo]))}catch(s){this.emit(\"error\",s)}else{this.reusedSocket=!0;try{r(await this.agent.request(this[vH],this[Mfe],this[Jo]))}catch(s){this.emit(\"error\",s)}}}getHeader(e){if(typeof e!=\"string\")throw new BH(\"name\",\"string\",e);return this[Jo][e.toLowerCase()]}get headersSent(){return this[VQ]}removeHeader(e){if(typeof e!=\"string\")throw new BH(\"name\",\"string\",e);if(this.headersSent)throw new Ffe(\"remove\");delete this[Jo][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new Ffe(\"set\");if(typeof e!=\"string\"||!Jtt.test(e)&&!jtt(e))throw new qtt(\"Header name\",e);if(typeof r>\"u\")throw new Wtt(r,e);if(Ktt.test(r))throw new Ytt(\"header content\",e);this[Jo][e.toLowerCase()]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let s=()=>this._request.setTimeout(e,r);return this._request?s():this[zB].push(s),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Ufe.exports=DH});var Hfe=_((qMt,_fe)=>{\"use strict\";var ztt=Ie(\"tls\");_fe.exports=(t={},e=ztt.connect)=>new Promise((r,s)=>{let a=!1,n,c=async()=>{await p,n.off(\"timeout\",f),n.off(\"error\",s),t.resolveSocket?(r({alpnProtocol:n.alpnProtocol,socket:n,timeout:a}),a&&(await Promise.resolve(),n.emit(\"timeout\"))):(n.destroy(),r({alpnProtocol:n.alpnProtocol,timeout:a}))},f=async()=>{a=!0,c()},p=(async()=>{try{n=await e(t,c),n.on(\"error\",s),n.once(\"timeout\",f)}catch(h){s(h)}})()})});var Gfe=_((WMt,jfe)=>{\"use strict\";var Ztt=Ie(\"net\");jfe.exports=t=>{let e=t.host,r=t.headers&&t.headers.host;return r&&(r.startsWith(\"[\")?r.indexOf(\"]\")===-1?e=r:e=r.slice(1,-1):e=r.split(\":\",1)[0]),Ztt.isIP(e)?\"\":e}});var Yfe=_((YMt,xH)=>{\"use strict\";var qfe=Ie(\"http\"),bH=Ie(\"https\"),Xtt=Hfe(),$tt=mH(),ert=PH(),trt=Gfe(),rrt=wH(),JQ=new $tt({maxSize:100}),ZB=new Map,Wfe=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let s=()=>{t.emit(\"free\",e,r)};e.on(\"free\",s);let a=()=>{t.removeSocket(e,r)};e.on(\"close\",a);let n=()=>{t.removeSocket(e,r),e.off(\"close\",a),e.off(\"free\",s),e.off(\"agentRemove\",n)};e.on(\"agentRemove\",n),t.emit(\"free\",e,r)},nrt=async t=>{let e=`${t.host}:${t.port}:${t.ALPNProtocols.sort()}`;if(!JQ.has(e)){if(ZB.has(e))return(await ZB.get(e)).alpnProtocol;let{path:r,agent:s}=t;t.path=t.socketPath;let a=Xtt(t);ZB.set(e,a);try{let{socket:n,alpnProtocol:c}=await a;if(JQ.set(e,c),t.path=r,c===\"h2\")n.destroy();else{let{globalAgent:f}=bH,p=bH.Agent.prototype.createConnection;s?s.createConnection===p?Wfe(s,n,t):n.destroy():f.createConnection===p?Wfe(f,n,t):n.destroy()}return ZB.delete(e),c}catch(n){throw ZB.delete(e),n}}return JQ.get(e)};xH.exports=async(t,e,r)=>{if((typeof t==\"string\"||t instanceof URL)&&(t=rrt(new URL(t))),typeof e==\"function\"&&(r=e,e=void 0),e={ALPNProtocols:[\"h2\",\"http/1.1\"],...t,...e,resolveSocket:!0},!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error(\"The `ALPNProtocols` option must be an Array with at least one entry\");e.protocol=e.protocol||\"https:\";let s=e.protocol===\"https:\";e.host=e.hostname||e.host||\"localhost\",e.session=e.tlsSession,e.servername=e.servername||trt(e),e.port=e.port||(s?443:80),e._defaultAgent=s?bH.globalAgent:qfe.globalAgent;let a=e.agent;if(a){if(a.addRequest)throw new Error(\"The `options.agent` object can contain only `http`, `https` or `http2` properties\");e.agent=a[s?\"https\":\"http\"]}return s&&await nrt(e)===\"h2\"?(a&&(e.agent=a.http2),new ert(e,r)):qfe.request(e,r)};xH.exports.protocolCache=JQ});var Jfe=_((VMt,Vfe)=>{\"use strict\";var irt=Ie(\"http2\"),srt=EH(),kH=PH(),ort=CH(),art=Yfe(),lrt=(t,e,r)=>new kH(t,e,r),crt=(t,e,r)=>{let s=new kH(t,e,r);return s.end(),s};Vfe.exports={...irt,ClientRequest:kH,IncomingMessage:ort,...srt,request:lrt,get:crt,auto:art}});var RH=_(QH=>{\"use strict\";Object.defineProperty(QH,\"__esModule\",{value:!0});var Kfe=Np();QH.default=t=>Kfe.default.nodeStream(t)&&Kfe.default.function_(t.getBoundary)});var $fe=_(TH=>{\"use strict\";Object.defineProperty(TH,\"__esModule\",{value:!0});var Zfe=Ie(\"fs\"),Xfe=Ie(\"util\"),zfe=Np(),urt=RH(),frt=Xfe.promisify(Zfe.stat);TH.default=async(t,e)=>{if(e&&\"content-length\"in e)return Number(e[\"content-length\"]);if(!t)return 0;if(zfe.default.string(t))return Buffer.byteLength(t);if(zfe.default.buffer(t))return t.length;if(urt.default(t))return Xfe.promisify(t.getLength.bind(t))();if(t instanceof Zfe.ReadStream){let{size:r}=await frt(t.path);return r===0?void 0:r}}});var NH=_(FH=>{\"use strict\";Object.defineProperty(FH,\"__esModule\",{value:!0});function Art(t,e,r){let s={};for(let a of r)s[a]=(...n)=>{e.emit(a,...n)},t.on(a,s[a]);return()=>{for(let a of r)t.off(a,s[a])}}FH.default=Art});var eAe=_(OH=>{\"use strict\";Object.defineProperty(OH,\"__esModule\",{value:!0});OH.default=()=>{let t=[];return{once(e,r,s){e.once(r,s),t.push({origin:e,event:r,fn:s})},unhandleAll(){for(let e of t){let{origin:r,event:s,fn:a}=e;r.removeListener(s,a)}t.length=0}}}});var rAe=_(XB=>{\"use strict\";Object.defineProperty(XB,\"__esModule\",{value:!0});XB.TimeoutError=void 0;var prt=Ie(\"net\"),hrt=eAe(),tAe=Symbol(\"reentry\"),grt=()=>{},KQ=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),this.event=r,this.name=\"TimeoutError\",this.code=\"ETIMEDOUT\"}};XB.TimeoutError=KQ;XB.default=(t,e,r)=>{if(tAe in t)return grt;t[tAe]=!0;let s=[],{once:a,unhandleAll:n}=hrt.default(),c=(C,S,b)=>{var I;let T=setTimeout(S,C,C,b);(I=T.unref)===null||I===void 0||I.call(T);let N=()=>{clearTimeout(T)};return s.push(N),N},{host:f,hostname:p}=r,h=(C,S)=>{t.destroy(new KQ(C,S))},E=()=>{for(let C of s)C();n()};if(t.once(\"error\",C=>{if(E(),t.listenerCount(\"error\")===0)throw C}),t.once(\"close\",E),a(t,\"response\",C=>{a(C,\"end\",E)}),typeof e.request<\"u\"&&c(e.request,h,\"request\"),typeof e.socket<\"u\"){let C=()=>{h(e.socket,\"socket\")};t.setTimeout(e.socket,C),s.push(()=>{t.removeListener(\"timeout\",C)})}return a(t,\"socket\",C=>{var S;let{socketPath:b}=t;if(C.connecting){let I=!!(b??prt.isIP((S=p??f)!==null&&S!==void 0?S:\"\")!==0);if(typeof e.lookup<\"u\"&&!I&&typeof C.address().address>\"u\"){let T=c(e.lookup,h,\"lookup\");a(C,\"lookup\",T)}if(typeof e.connect<\"u\"){let T=()=>c(e.connect,h,\"connect\");I?a(C,\"connect\",T()):a(C,\"lookup\",N=>{N===null&&a(C,\"connect\",T())})}typeof e.secureConnect<\"u\"&&r.protocol===\"https:\"&&a(C,\"connect\",()=>{let T=c(e.secureConnect,h,\"secureConnect\");a(C,\"secureConnect\",T)})}if(typeof e.send<\"u\"){let I=()=>c(e.send,h,\"send\");C.connecting?a(C,\"connect\",()=>{a(t,\"upload-complete\",I())}):a(t,\"upload-complete\",I())}}),typeof e.response<\"u\"&&a(t,\"upload-complete\",()=>{let C=c(e.response,h,\"response\");a(t,\"response\",C)}),E}});var iAe=_(LH=>{\"use strict\";Object.defineProperty(LH,\"__esModule\",{value:!0});var nAe=Np();LH.default=t=>{t=t;let e={protocol:t.protocol,hostname:nAe.default.string(t.hostname)&&t.hostname.startsWith(\"[\")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||\"\"}${t.search||\"\"}`};return nAe.default.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||\"\"}:${t.password||\"\"}`),e}});var sAe=_(MH=>{\"use strict\";Object.defineProperty(MH,\"__esModule\",{value:!0});var drt=Ie(\"url\"),mrt=[\"protocol\",\"host\",\"hostname\",\"port\",\"pathname\",\"search\"];MH.default=(t,e)=>{var r,s;if(e.path){if(e.pathname)throw new TypeError(\"Parameters `path` and `pathname` are mutually exclusive.\");if(e.search)throw new TypeError(\"Parameters `path` and `search` are mutually exclusive.\");if(e.searchParams)throw new TypeError(\"Parameters `path` and `searchParams` are mutually exclusive.\")}if(e.search&&e.searchParams)throw new TypeError(\"Parameters `search` and `searchParams` are mutually exclusive.\");if(!t){if(!e.protocol)throw new TypeError(\"No URL protocol specified\");t=`${e.protocol}//${(s=(r=e.hostname)!==null&&r!==void 0?r:e.host)!==null&&s!==void 0?s:\"\"}`}let a=new drt.URL(t);if(e.path){let n=e.path.indexOf(\"?\");n===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,n),e.search=e.path.slice(n+1)),delete e.path}for(let n of mrt)e[n]&&(a[n]=e[n].toString());return a}});var oAe=_(_H=>{\"use strict\";Object.defineProperty(_H,\"__esModule\",{value:!0});var UH=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e==\"object\"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e==\"object\"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e==\"object\"?this.weakMap.has(e):this.map.has(e)}};_H.default=UH});var jH=_(HH=>{\"use strict\";Object.defineProperty(HH,\"__esModule\",{value:!0});var yrt=async t=>{let e=[],r=0;for await(let s of t)e.push(s),r+=Buffer.byteLength(s);return Buffer.isBuffer(e[0])?Buffer.concat(e,r):Buffer.from(e.join(\"\"))};HH.default=yrt});var lAe=_(sm=>{\"use strict\";Object.defineProperty(sm,\"__esModule\",{value:!0});sm.dnsLookupIpVersionToFamily=sm.isDnsLookupIpVersion=void 0;var aAe={auto:0,ipv4:4,ipv6:6};sm.isDnsLookupIpVersion=t=>t in aAe;sm.dnsLookupIpVersionToFamily=t=>{if(sm.isDnsLookupIpVersion(t))return aAe[t];throw new Error(\"Invalid DNS lookup IP version\")}});var GH=_(zQ=>{\"use strict\";Object.defineProperty(zQ,\"__esModule\",{value:!0});zQ.isResponseOk=void 0;zQ.isResponseOk=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304}});var uAe=_(qH=>{\"use strict\";Object.defineProperty(qH,\"__esModule\",{value:!0});var cAe=new Set;qH.default=t=>{cAe.has(t)||(cAe.add(t),process.emitWarning(`Got: ${t}`,{type:\"DeprecationWarning\"}))}});var fAe=_(WH=>{\"use strict\";Object.defineProperty(WH,\"__esModule\",{value:!0});var Si=Np(),Ert=(t,e)=>{if(Si.default.null_(t.encoding))throw new TypeError(\"To get a Buffer, set `options.responseType` to `buffer` instead\");Si.assert.any([Si.default.string,Si.default.undefined],t.encoding),Si.assert.any([Si.default.boolean,Si.default.undefined],t.resolveBodyOnly),Si.assert.any([Si.default.boolean,Si.default.undefined],t.methodRewriting),Si.assert.any([Si.default.boolean,Si.default.undefined],t.isStream),Si.assert.any([Si.default.string,Si.default.undefined],t.responseType),t.responseType===void 0&&(t.responseType=\"text\");let{retry:r}=t;if(e?t.retry={...e.retry}:t.retry={calculateDelay:s=>s.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},Si.default.object(r)?(t.retry={...t.retry,...r},t.retry.methods=[...new Set(t.retry.methods.map(s=>s.toUpperCase()))],t.retry.statusCodes=[...new Set(t.retry.statusCodes)],t.retry.errorCodes=[...new Set(t.retry.errorCodes)]):Si.default.number(r)&&(t.retry.limit=r),Si.default.undefined(t.retry.maxRetryAfter)&&(t.retry.maxRetryAfter=Math.min(...[t.timeout.request,t.timeout.connect].filter(Si.default.number))),Si.default.object(t.pagination)){e&&(t.pagination={...e.pagination,...t.pagination});let{pagination:s}=t;if(!Si.default.function_(s.transform))throw new Error(\"`options.pagination.transform` must be implemented\");if(!Si.default.function_(s.shouldContinue))throw new Error(\"`options.pagination.shouldContinue` must be implemented\");if(!Si.default.function_(s.filter))throw new TypeError(\"`options.pagination.filter` must be implemented\");if(!Si.default.function_(s.paginate))throw new Error(\"`options.pagination.paginate` must be implemented\")}return t.responseType===\"json\"&&t.headers.accept===void 0&&(t.headers.accept=\"application/json\"),t};WH.default=Ert});var AAe=_($B=>{\"use strict\";Object.defineProperty($B,\"__esModule\",{value:!0});$B.retryAfterStatusCodes=void 0;$B.retryAfterStatusCodes=new Set([413,429,503]);var Irt=({attemptCount:t,retryOptions:e,error:r,retryAfter:s})=>{if(t>e.limit)return 0;let a=e.methods.includes(r.options.method),n=e.errorCodes.includes(r.code),c=r.response&&e.statusCodes.includes(r.response.statusCode);if(!a||!n&&!c)return 0;if(r.response){if(s)return e.maxRetryAfter===void 0||s>e.maxRetryAfter?0:s;if(r.response.statusCode===413)return 0}let f=Math.random()*100;return 2**(t-1)*1e3+f};$B.default=Irt});var rv=_(Ln=>{\"use strict\";Object.defineProperty(Ln,\"__esModule\",{value:!0});Ln.UnsupportedProtocolError=Ln.ReadError=Ln.TimeoutError=Ln.UploadError=Ln.CacheError=Ln.HTTPError=Ln.MaxRedirectsError=Ln.RequestError=Ln.setNonEnumerableProperties=Ln.knownHookEvents=Ln.withoutBody=Ln.kIsNormalizedAlready=void 0;var pAe=Ie(\"util\"),hAe=Ie(\"stream\"),Crt=Ie(\"fs\"),w0=Ie(\"url\"),gAe=Ie(\"http\"),YH=Ie(\"http\"),wrt=Ie(\"https\"),Brt=xue(),vrt=Oue(),dAe=gfe(),Srt=Efe(),Drt=Jfe(),Prt=WQ(),at=Np(),brt=$fe(),mAe=RH(),xrt=NH(),yAe=rAe(),krt=iAe(),EAe=sAe(),Qrt=oAe(),Rrt=jH(),IAe=lAe(),Trt=GH(),B0=uAe(),Frt=fAe(),Nrt=AAe(),VH,po=Symbol(\"request\"),$Q=Symbol(\"response\"),mI=Symbol(\"responseSize\"),yI=Symbol(\"downloadedSize\"),EI=Symbol(\"bodySize\"),II=Symbol(\"uploadedSize\"),ZQ=Symbol(\"serverResponsesPiped\"),CAe=Symbol(\"unproxyEvents\"),wAe=Symbol(\"isFromCache\"),JH=Symbol(\"cancelTimeouts\"),BAe=Symbol(\"startedReading\"),CI=Symbol(\"stopReading\"),XQ=Symbol(\"triggerRead\"),v0=Symbol(\"body\"),ev=Symbol(\"jobs\"),vAe=Symbol(\"originalResponse\"),SAe=Symbol(\"retryTimeout\");Ln.kIsNormalizedAlready=Symbol(\"isNormalizedAlready\");var Ort=at.default.string(process.versions.brotli);Ln.withoutBody=new Set([\"GET\",\"HEAD\"]);Ln.knownHookEvents=[\"init\",\"beforeRequest\",\"beforeRedirect\",\"beforeError\",\"beforeRetry\",\"afterResponse\"];function Lrt(t){for(let e in t){let r=t[e];if(!at.default.string(r)&&!at.default.number(r)&&!at.default.boolean(r)&&!at.default.null_(r)&&!at.default.undefined(r))throw new TypeError(`The \\`searchParams\\` value '${String(r)}' must be a string, number, boolean or null`)}}function Mrt(t){return at.default.object(t)&&!(\"statusCode\"in t)}var KH=new Qrt.default,Urt=async t=>new Promise((e,r)=>{let s=a=>{r(a)};t.pending||e(),t.once(\"error\",s),t.once(\"ready\",()=>{t.off(\"error\",s),e()})}),_rt=new Set([300,301,302,303,304,307,308]),Hrt=[\"context\",\"body\",\"json\",\"form\"];Ln.setNonEnumerableProperties=(t,e)=>{let r={};for(let s of t)if(s)for(let a of Hrt)a in s&&(r[a]={writable:!0,configurable:!0,enumerable:!1,value:s[a]});Object.defineProperties(e,r)};var us=class extends Error{constructor(e,r,s){var a;if(super(e),Error.captureStackTrace(this,this.constructor),this.name=\"RequestError\",this.code=r.code,s instanceof oR?(Object.defineProperty(this,\"request\",{enumerable:!1,value:s}),Object.defineProperty(this,\"response\",{enumerable:!1,value:s[$Q]}),Object.defineProperty(this,\"options\",{enumerable:!1,value:s.options})):Object.defineProperty(this,\"options\",{enumerable:!1,value:s}),this.timings=(a=this.request)===null||a===void 0?void 0:a.timings,at.default.string(r.stack)&&at.default.string(this.stack)){let n=this.stack.indexOf(this.message)+this.message.length,c=this.stack.slice(n).split(`\n`).reverse(),f=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`\n`).reverse();for(;f.length!==0&&f[0]===c[0];)c.shift();this.stack=`${this.stack.slice(0,n)}${c.reverse().join(`\n`)}${f.reverse().join(`\n`)}`}}};Ln.RequestError=us;var eR=class extends us{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name=\"MaxRedirectsError\"}};Ln.MaxRedirectsError=eR;var tR=class extends us{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name=\"HTTPError\"}};Ln.HTTPError=tR;var rR=class extends us{constructor(e,r){super(e.message,e,r),this.name=\"CacheError\"}};Ln.CacheError=rR;var nR=class extends us{constructor(e,r){super(e.message,e,r),this.name=\"UploadError\"}};Ln.UploadError=nR;var iR=class extends us{constructor(e,r,s){super(e.message,e,s),this.name=\"TimeoutError\",this.event=e.event,this.timings=r}};Ln.TimeoutError=iR;var tv=class extends us{constructor(e,r){super(e.message,e,r),this.name=\"ReadError\"}};Ln.ReadError=tv;var sR=class extends us{constructor(e){super(`Unsupported protocol \"${e.url.protocol}\"`,{},e),this.name=\"UnsupportedProtocolError\"}};Ln.UnsupportedProtocolError=sR;var jrt=[\"socket\",\"connect\",\"continue\",\"information\",\"upgrade\",\"timeout\"],oR=class extends hAe.Duplex{constructor(e,r={},s){super({autoDestroy:!1,highWaterMark:0}),this[yI]=0,this[II]=0,this.requestInitialized=!1,this[ZQ]=new Set,this.redirects=[],this[CI]=!1,this[XQ]=!1,this[ev]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on(\"pipe\",h=>{h.prependListener(\"data\",a),h.on(\"data\",n),h.prependListener(\"end\",a),h.on(\"end\",n)}),this.on(\"unpipe\",h=>{h.off(\"data\",a),h.off(\"data\",n),h.off(\"end\",a),h.off(\"end\",n)}),this.on(\"pipe\",h=>{h instanceof YH.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:c,body:f,form:p}=r;if((c||f||p)&&this._lockWrite(),Ln.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,s)}catch(h){at.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof Crt.ReadStream&&await Urt(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError(\"Missing `url` property\");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[po])===null||h===void 0||h.destroy();return}for(let C of this[ev])C();this[ev].length=0,this.requestInitialized=!0}catch(E){if(E instanceof us){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(e,r,s){var a,n,c,f,p;let h=r;if(at.default.object(e)&&!at.default.urlInstance(e))r={...s,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError(\"The `url` option is mutually exclusive with the `input` argument\");r={...s,...r},e!==void 0&&(r.url=e),at.default.urlInstance(r.url)&&(r.url=new w0.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),at.assert.any([at.default.string,at.default.undefined],r.method),at.assert.any([at.default.object,at.default.undefined],r.headers),at.assert.any([at.default.string,at.default.urlInstance,at.default.undefined],r.prefixUrl),at.assert.any([at.default.object,at.default.undefined],r.cookieJar),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.searchParams),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.cache),at.assert.any([at.default.object,at.default.number,at.default.undefined],r.timeout),at.assert.any([at.default.object,at.default.undefined],r.context),at.assert.any([at.default.object,at.default.undefined],r.hooks),at.assert.any([at.default.boolean,at.default.undefined],r.decompress),at.assert.any([at.default.boolean,at.default.undefined],r.ignoreInvalidCookies),at.assert.any([at.default.boolean,at.default.undefined],r.followRedirect),at.assert.any([at.default.number,at.default.undefined],r.maxRedirects),at.assert.any([at.default.boolean,at.default.undefined],r.throwHttpErrors),at.assert.any([at.default.boolean,at.default.undefined],r.http2),at.assert.any([at.default.boolean,at.default.undefined],r.allowGetBody),at.assert.any([at.default.string,at.default.undefined],r.localAddress),at.assert.any([IAe.isDnsLookupIpVersion,at.default.undefined],r.dnsLookupIpVersion),at.assert.any([at.default.object,at.default.undefined],r.https),at.assert.any([at.default.boolean,at.default.undefined],r.rejectUnauthorized),r.https&&(at.assert.any([at.default.boolean,at.default.undefined],r.https.rejectUnauthorized),at.assert.any([at.default.function_,at.default.undefined],r.https.checkServerIdentity),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.certificateAuthority),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.key),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.certificate),at.assert.any([at.default.string,at.default.undefined],r.https.passphrase),at.assert.any([at.default.string,at.default.buffer,at.default.array,at.default.undefined],r.https.pfx)),at.assert.any([at.default.object,at.default.undefined],r.cacheOptions),at.default.string(r.method)?r.method=r.method.toUpperCase():r.method=\"GET\",r.headers===s?.headers?r.headers={...r.headers}:r.headers=Prt({...s?.headers,...r.headers}),\"slashes\"in r)throw new TypeError(\"The legacy `url.Url` has been deprecated. Use `URL` instead.\");if(\"auth\"in r)throw new TypeError(\"Parameter `auth` is deprecated. Use `username` / `password` instead.\");if(\"searchParams\"in r&&r.searchParams&&r.searchParams!==s?.searchParams){let b;if(at.default.string(r.searchParams)||r.searchParams instanceof w0.URLSearchParams)b=new w0.URLSearchParams(r.searchParams);else{Lrt(r.searchParams),b=new w0.URLSearchParams;for(let I in r.searchParams){let T=r.searchParams[I];T===null?b.append(I,\"\"):T!==void 0&&b.append(I,T)}}(a=s?.searchParams)===null||a===void 0||a.forEach((I,T)=>{b.has(T)||b.append(T,I)}),r.searchParams=b}if(r.username=(n=r.username)!==null&&n!==void 0?n:\"\",r.password=(c=r.password)!==null&&c!==void 0?c:\"\",at.default.undefined(r.prefixUrl)?r.prefixUrl=(f=s?.prefixUrl)!==null&&f!==void 0?f:\"\":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==\"\"&&!r.prefixUrl.endsWith(\"/\")&&(r.prefixUrl+=\"/\")),at.default.string(r.url)){if(r.url.startsWith(\"/\"))throw new Error(\"`input` must not start with a slash when using `prefixUrl`\");r.url=EAe.default(r.prefixUrl+r.url,r)}else(at.default.undefined(r.url)&&r.prefixUrl!==\"\"||r.protocol)&&(r.url=EAe.default(r.prefixUrl,r));if(r.url){\"port\"in r&&delete r.port;let{prefixUrl:b}=r;Object.defineProperty(r,\"prefixUrl\",{set:T=>{let N=r.url;if(!N.href.startsWith(T))throw new Error(`Cannot change \\`prefixUrl\\` from ${b} to ${T}: ${N.href}`);r.url=new w0.URL(T+N.href.slice(b.length)),b=T},get:()=>b});let{protocol:I}=r.url;if(I===\"unix:\"&&(I=\"http:\",r.url=new w0.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),I!==\"http:\"&&I!==\"https:\")throw new sR(r);r.username===\"\"?r.username=r.url.username:r.url.username=r.username,r.password===\"\"?r.password=r.url.password:r.url.password=r.password}let{cookieJar:E}=r;if(E){let{setCookie:b,getCookieString:I}=E;at.assert.function_(b),at.assert.function_(I),b.length===4&&I.length===0&&(b=pAe.promisify(b.bind(r.cookieJar)),I=pAe.promisify(I.bind(r.cookieJar)),r.cookieJar={setCookie:b,getCookieString:I})}let{cache:C}=r;if(C&&(KH.has(C)||KH.set(C,new dAe((b,I)=>{let T=b[po](b,I);return at.default.promise(T)&&(T.once=(N,U)=>{if(N===\"error\")T.catch(U);else if(N===\"abort\")(async()=>{try{(await T).once(\"abort\",U)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${N}`);return T}),T},C))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)VH||(VH=new vrt.default),r.dnsCache=VH;else if(!at.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \\`dnsCache\\` must be a CacheableLookup instance or a boolean, got ${at.default(r.dnsCache)}`);at.default.number(r.timeout)?r.timeout={request:r.timeout}:s&&r.timeout!==s.timeout?r.timeout={...s.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let S=r.hooks===s?.hooks;r.hooks={...r.hooks};for(let b of Ln.knownHookEvents)if(b in r.hooks)if(at.default.array(r.hooks[b]))r.hooks[b]=[...r.hooks[b]];else throw new TypeError(`Parameter \\`${b}\\` must be an Array, got ${at.default(r.hooks[b])}`);else r.hooks[b]=[];if(s&&!S)for(let b of Ln.knownHookEvents)s.hooks[b].length>0&&(r.hooks[b]=[...s.hooks[b],...r.hooks[b]]);if(\"family\"in r&&B0.default('\"options.family\" was never documented, please use \"options.dnsLookupIpVersion\"'),s?.https&&(r.https={...s.https,...r.https}),\"rejectUnauthorized\"in r&&B0.default('\"options.rejectUnauthorized\" is now deprecated, please use \"options.https.rejectUnauthorized\"'),\"checkServerIdentity\"in r&&B0.default('\"options.checkServerIdentity\" was never documented, please use \"options.https.checkServerIdentity\"'),\"ca\"in r&&B0.default('\"options.ca\" was never documented, please use \"options.https.certificateAuthority\"'),\"key\"in r&&B0.default('\"options.key\" was never documented, please use \"options.https.key\"'),\"cert\"in r&&B0.default('\"options.cert\" was never documented, please use \"options.https.certificate\"'),\"passphrase\"in r&&B0.default('\"options.passphrase\" was never documented, please use \"options.https.passphrase\"'),\"pfx\"in r&&B0.default('\"options.pfx\" was never documented, please use \"options.https.pfx\"'),\"followRedirects\"in r)throw new TypeError(\"The `followRedirects` option does not exist. Use `followRedirect` instead.\");if(r.agent){for(let b in r.agent)if(b!==\"http\"&&b!==\"https\"&&b!==\"http2\")throw new TypeError(`Expected the \\`options.agent\\` properties to be \\`http\\`, \\`https\\` or \\`http2\\`, got \\`${b}\\``)}return r.maxRedirects=(p=r.maxRedirects)!==null&&p!==void 0?p:0,Ln.setNonEnumerableProperties([s,h],r),Frt.default(r,s)}_lockWrite(){let e=()=>{throw new TypeError(\"The payload has been already provided\")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,s=!at.default.undefined(e.form),a=!at.default.undefined(e.json),n=!at.default.undefined(e.body),c=s||a||n,f=Ln.withoutBody.has(e.method)&&!(e.method===\"GET\"&&e.allowGetBody);if(this._cannotHaveBody=f,c){if(f)throw new TypeError(`The \\`${e.method}\\` method cannot be used with a body`);if([n,s,a].filter(p=>p).length>1)throw new TypeError(\"The `body`, `json` and `form` options are mutually exclusive\");if(n&&!(e.body instanceof hAe.Readable)&&!at.default.string(e.body)&&!at.default.buffer(e.body)&&!mAe.default(e.body))throw new TypeError(\"The `body` option must be a stream.Readable, string or Buffer\");if(s&&!at.default.object(e.form))throw new TypeError(\"The `form` option must be an Object\");{let p=!at.default.string(r[\"content-type\"]);n?(mAe.default(e.body)&&p&&(r[\"content-type\"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[v0]=e.body):s?(p&&(r[\"content-type\"]=\"application/x-www-form-urlencoded\"),this[v0]=new w0.URLSearchParams(e.form).toString()):(p&&(r[\"content-type\"]=\"application/json\"),this[v0]=e.stringifyJson(e.json));let h=await brt.default(this[v0],e.headers);at.default.undefined(r[\"content-length\"])&&at.default.undefined(r[\"transfer-encoding\"])&&!f&&!at.default.undefined(h)&&(r[\"content-length\"]=String(h))}}else f?this._lockWrite():this._unlockWrite();this[EI]=Number(r[\"content-length\"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:s}=r;this[vAe]=e,r.decompress&&(e=Srt(e));let a=e.statusCode,n=e;n.statusMessage=n.statusMessage?n.statusMessage:gAe.STATUS_CODES[a],n.url=r.url.toString(),n.requestUrl=this.requestUrl,n.redirectUrls=this.redirects,n.request=this,n.isFromCache=e.fromCache||!1,n.ip=this.ip,n.retryCount=this.retryCount,this[wAe]=n.isFromCache,this[mI]=Number(e.headers[\"content-length\"])||void 0,this[$Q]=e,e.once(\"end\",()=>{this[mI]=this[yI],this.emit(\"downloadProgress\",this.downloadProgress)}),e.once(\"error\",f=>{e.destroy(),this._beforeError(new tv(f,this))}),e.once(\"aborted\",()=>{this._beforeError(new tv({name:\"Error\",message:\"The server aborted pending request\",code:\"ECONNRESET\"},this))}),this.emit(\"downloadProgress\",this.downloadProgress);let c=e.headers[\"set-cookie\"];if(at.default.object(r.cookieJar)&&c){let f=c.map(async p=>r.cookieJar.setCookie(p,s.toString()));r.ignoreInvalidCookies&&(f=f.map(async p=>p.catch(()=>{})));try{await Promise.all(f)}catch(p){this._beforeError(p);return}}if(r.followRedirect&&e.headers.location&&_rt.has(a)){if(e.resume(),this[po]&&(this[JH](),delete this[po],this[CAe]()),(a===303&&r.method!==\"GET\"&&r.method!==\"HEAD\"||!r.methodRewriting)&&(r.method=\"GET\",\"body\"in r&&delete r.body,\"json\"in r&&delete r.json,\"form\"in r&&delete r.form,this[v0]=void 0,delete r.headers[\"content-length\"]),this.redirects.length>=r.maxRedirects){this._beforeError(new eR(this));return}try{let p=Buffer.from(e.headers.location,\"binary\").toString(),h=new w0.URL(p,s),E=h.toString();decodeURI(E),h.hostname!==s.hostname||h.port!==s.port?(\"host\"in r.headers&&delete r.headers.host,\"cookie\"in r.headers&&delete r.headers.cookie,\"authorization\"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username=\"\",r.password=\"\")):(h.username=r.username,h.password=r.password),this.redirects.push(E),r.url=h;for(let C of r.hooks.beforeRedirect)await C(r,n);this.emit(\"redirect\",n,r),await this._makeRequest()}catch(p){this._beforeError(p);return}return}if(r.isStream&&r.throwHttpErrors&&!Trt.isResponseOk(n)){this._beforeError(new tR(n));return}e.on(\"readable\",()=>{this[XQ]&&this._read()}),this.on(\"resume\",()=>{e.resume()}),this.on(\"pause\",()=>{e.pause()}),e.once(\"end\",()=>{this.push(null)}),this.emit(\"response\",e);for(let f of this[ZQ])if(!f.headersSent){for(let p in e.headers){let h=r.decompress?p!==\"content-encoding\":!0,E=e.headers[p];h&&f.setHeader(p,E)}f.statusCode=a}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:s,url:a}=r;Brt.default(e),this[JH]=yAe.default(e,s,a);let n=r.cache?\"cacheableResponse\":\"response\";e.once(n,p=>{this._onResponse(p)}),e.once(\"error\",p=>{var h;e.destroy(),(h=e.res)===null||h===void 0||h.removeAllListeners(\"end\"),p=p instanceof yAe.TimeoutError?new iR(p,this.timings,this):new us(p.message,p,this),this._beforeError(p)}),this[CAe]=xrt.default(e,this,jrt),this[po]=e,this.emit(\"uploadProgress\",this.uploadProgress);let c=this[v0],f=this.redirects.length===0?this:e;at.default.nodeStream(c)?(c.pipe(f),c.once(\"error\",p=>{this._beforeError(new nR(p,this))})):(this._unlockWrite(),at.default.undefined(c)?(this._cannotHaveBody||this._noPipe)&&(f.end(),this._lockWrite()):(this._writeRequest(c,void 0,()=>{}),f.end(),this._lockWrite())),this.emit(\"request\",e)}async _createCacheableRequest(e,r){return new Promise((s,a)=>{Object.assign(r,krt.default(e)),delete r.url;let n,c=KH.get(r.cache)(r,async f=>{f._readableState.autoDestroy=!1,n&&(await n).emit(\"cacheableResponse\",f),s(f)});r.url=e,c.once(\"error\",a),c.once(\"request\",async f=>{n=f,s(n)})})}async _makeRequest(){var e,r,s,a,n;let{options:c}=this,{headers:f}=c;for(let U in f)if(at.default.undefined(f[U]))delete f[U];else if(at.default.null_(f[U]))throw new TypeError(`Use \\`undefined\\` instead of \\`null\\` to delete the \\`${U}\\` header`);if(c.decompress&&at.default.undefined(f[\"accept-encoding\"])&&(f[\"accept-encoding\"]=Ort?\"gzip, deflate, br\":\"gzip, deflate\"),c.cookieJar){let U=await c.cookieJar.getCookieString(c.url.toString());at.default.nonEmptyString(U)&&(c.headers.cookie=U)}for(let U of c.hooks.beforeRequest){let W=await U(c);if(!at.default.undefined(W)){c.request=()=>W;break}}c.body&&this[v0]!==c.body&&(this[v0]=c.body);let{agent:p,request:h,timeout:E,url:C}=c;if(c.dnsCache&&!(\"lookup\"in c)&&(c.lookup=c.dnsCache.lookup),C.hostname===\"unix\"){let U=/(?<socketPath>.+?):(?<path>.+)/.exec(`${C.pathname}${C.search}`);if(U?.groups){let{socketPath:W,path:ee}=U.groups;Object.assign(c,{socketPath:W,path:ee,host:\"\"})}}let S=C.protocol===\"https:\",b;c.http2?b=Drt.auto:b=S?wrt.request:gAe.request;let I=(e=c.request)!==null&&e!==void 0?e:b,T=c.cache?this._createCacheableRequest:I;p&&!c.http2&&(c.agent=p[S?\"https\":\"http\"]),c[po]=I,delete c.request,delete c.timeout;let N=c;if(N.shared=(r=c.cacheOptions)===null||r===void 0?void 0:r.shared,N.cacheHeuristic=(s=c.cacheOptions)===null||s===void 0?void 0:s.cacheHeuristic,N.immutableMinTimeToLive=(a=c.cacheOptions)===null||a===void 0?void 0:a.immutableMinTimeToLive,N.ignoreCargoCult=(n=c.cacheOptions)===null||n===void 0?void 0:n.ignoreCargoCult,c.dnsLookupIpVersion!==void 0)try{N.family=IAe.dnsLookupIpVersionToFamily(c.dnsLookupIpVersion)}catch{throw new Error(\"Invalid `dnsLookupIpVersion` option value\")}c.https&&(\"rejectUnauthorized\"in c.https&&(N.rejectUnauthorized=c.https.rejectUnauthorized),c.https.checkServerIdentity&&(N.checkServerIdentity=c.https.checkServerIdentity),c.https.certificateAuthority&&(N.ca=c.https.certificateAuthority),c.https.certificate&&(N.cert=c.https.certificate),c.https.key&&(N.key=c.https.key),c.https.passphrase&&(N.passphrase=c.https.passphrase),c.https.pfx&&(N.pfx=c.https.pfx));try{let U=await T(C,N);at.default.undefined(U)&&(U=b(C,N)),c.request=h,c.timeout=E,c.agent=p,c.https&&(\"rejectUnauthorized\"in c.https&&delete N.rejectUnauthorized,c.https.checkServerIdentity&&delete N.checkServerIdentity,c.https.certificateAuthority&&delete N.ca,c.https.certificate&&delete N.cert,c.https.key&&delete N.key,c.https.passphrase&&delete N.passphrase,c.https.pfx&&delete N.pfx),Mrt(U)?this._onRequest(U):this.writable?(this.once(\"finish\",()=>{this._onResponse(U)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(U)}catch(U){throw U instanceof dAe.CacheError?new rR(U,this):new us(U.message,U,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new us(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[CI])return;let{options:r}=this,s=this.retryCount+1;this[CI]=!0,e instanceof us||(e=new us(e.message,e,this));let a=e,{response:n}=a;(async()=>{if(n&&!n.body){n.setEncoding(this._readableState.encoding);try{n.rawBody=await Rrt.default(n),n.body=n.rawBody.toString()}catch{}}if(this.listenerCount(\"retry\")!==0){let c;try{let f;n&&\"retry-after\"in n.headers&&(f=Number(n.headers[\"retry-after\"]),Number.isNaN(f)?(f=Date.parse(n.headers[\"retry-after\"])-Date.now(),f<=0&&(f=1)):f*=1e3),c=await r.retry.calculateDelay({attemptCount:s,retryOptions:r.retry,error:a,retryAfter:f,computedValue:Nrt.default({attemptCount:s,retryOptions:r.retry,error:a,retryAfter:f,computedValue:0})})}catch(f){this._error(new us(f.message,f,this));return}if(c){let f=async()=>{try{for(let p of this.options.hooks.beforeRetry)await p(this.options,a,s)}catch(p){this._error(new us(p.message,e,this));return}this.destroyed||(this.destroy(),this.emit(\"retry\",s,e))};this[SAe]=setTimeout(f,c);return}}this._error(a)})()}_read(){this[XQ]=!0;let e=this[$Q];if(e&&!this[CI]){e.readableLength&&(this[XQ]=!1);let r;for(;(r=e.read())!==null;){this[yI]+=r.length,this[BAe]=!0;let s=this.downloadProgress;s.percent<1&&this.emit(\"downloadProgress\",s),this.push(r)}}}_write(e,r,s){let a=()=>{this._writeRequest(e,r,s)};this.requestInitialized?a():this[ev].push(a)}_writeRequest(e,r,s){this[po].destroyed||(this._progressCallbacks.push(()=>{this[II]+=Buffer.byteLength(e,r);let a=this.uploadProgress;a.percent<1&&this.emit(\"uploadProgress\",a)}),this[po].write(e,r,a=>{!a&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),s(a)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(po in this)){e();return}if(this[po].destroyed){e();return}this[po].end(s=>{s||(this[EI]=this[II],this.emit(\"uploadProgress\",this.uploadProgress),this[po].emit(\"upload-complete\")),e(s)})};this.requestInitialized?r():this[ev].push(r)}_destroy(e,r){var s;this[CI]=!0,clearTimeout(this[SAe]),po in this&&(this[JH](),!((s=this[$Q])===null||s===void 0)&&s.complete||this[po].destroy()),e!==null&&!at.default.undefined(e)&&!(e instanceof us)&&(e=new us(e.message,e,this)),r(e)}get _isAboutToError(){return this[CI]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,s;return((r=(e=this[po])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((s=this[vAe])===null||s===void 0)&&s.complete)}get socket(){var e,r;return(r=(e=this[po])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[mI]?e=this[yI]/this[mI]:this[mI]===this[yI]?e=1:e=0,{percent:e,transferred:this[yI],total:this[mI]}}get uploadProgress(){let e;return this[EI]?e=this[II]/this[EI]:this[EI]===this[II]?e=1:e=0,{percent:e,transferred:this[II],total:this[EI]}}get timings(){var e;return(e=this[po])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[wAe]}pipe(e,r){if(this[BAe])throw new Error(\"Failed to pipe. The response has been emitted already.\");return e instanceof YH.ServerResponse&&this[ZQ].add(e),super.pipe(e,r)}unpipe(e){return e instanceof YH.ServerResponse&&this[ZQ].delete(e),super.unpipe(e),this}};Ln.default=oR});var nv=_(qu=>{\"use strict\";var Grt=qu&&qu.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),qrt=qu&&qu.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&Grt(e,t,r)};Object.defineProperty(qu,\"__esModule\",{value:!0});qu.CancelError=qu.ParseError=void 0;var DAe=rv(),zH=class extends DAe.RequestError{constructor(e,r){let{options:s}=r.request;super(`${e.message} in \"${s.url.toString()}\"`,e,r.request),this.name=\"ParseError\"}};qu.ParseError=zH;var ZH=class extends DAe.RequestError{constructor(e){super(\"Promise was canceled\",{},e),this.name=\"CancelError\"}get isCanceled(){return!0}};qu.CancelError=ZH;qrt(rv(),qu)});var bAe=_(XH=>{\"use strict\";Object.defineProperty(XH,\"__esModule\",{value:!0});var PAe=nv(),Wrt=(t,e,r,s)=>{let{rawBody:a}=t;try{if(e===\"text\")return a.toString(s);if(e===\"json\")return a.length===0?\"\":r(a.toString());if(e===\"buffer\")return a;throw new PAe.ParseError({message:`Unknown body type '${e}'`,name:\"Error\"},t)}catch(n){throw new PAe.ParseError(n,t)}};XH.default=Wrt});var $H=_(S0=>{\"use strict\";var Yrt=S0&&S0.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Vrt=S0&&S0.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yrt(e,t,r)};Object.defineProperty(S0,\"__esModule\",{value:!0});var Jrt=Ie(\"events\"),Krt=Np(),zrt=Pue(),aR=nv(),xAe=bAe(),kAe=rv(),Zrt=NH(),Xrt=jH(),QAe=GH(),$rt=[\"request\",\"response\",\"redirect\",\"uploadProgress\",\"downloadProgress\"];function RAe(t){let e,r,s=new Jrt.EventEmitter,a=new zrt((c,f,p)=>{let h=E=>{let C=new kAe.default(void 0,t);C.retryCount=E,C._noPipe=!0,p(()=>C.destroy()),p.shouldReject=!1,p(()=>f(new aR.CancelError(C))),e=C,C.once(\"response\",async I=>{var T;if(I.retryCount=E,I.request.aborted)return;let N;try{N=await Xrt.default(C),I.rawBody=N}catch{return}if(C._isAboutToError)return;let U=((T=I.headers[\"content-encoding\"])!==null&&T!==void 0?T:\"\").toLowerCase(),W=[\"gzip\",\"deflate\",\"br\"].includes(U),{options:ee}=C;if(W&&!ee.decompress)I.body=N;else try{I.body=xAe.default(I,ee.responseType,ee.parseJson,ee.encoding)}catch(ie){if(I.body=N.toString(),QAe.isResponseOk(I)){C._beforeError(ie);return}}try{for(let[ie,ue]of ee.hooks.afterResponse.entries())I=await ue(I,async le=>{let me=kAe.default.normalizeArguments(void 0,{...le,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},ee);me.hooks.afterResponse=me.hooks.afterResponse.slice(0,ie);for(let Be of me.hooks.beforeRetry)await Be(me);let pe=RAe(me);return p(()=>{pe.catch(()=>{}),pe.cancel()}),pe})}catch(ie){C._beforeError(new aR.RequestError(ie.message,ie,C));return}if(!QAe.isResponseOk(I)){C._beforeError(new aR.HTTPError(I));return}r=I,c(C.options.resolveBodyOnly?I.body:I)});let S=I=>{if(a.isCanceled)return;let{options:T}=C;if(I instanceof aR.HTTPError&&!T.throwHttpErrors){let{response:N}=I;c(C.options.resolveBodyOnly?N.body:N);return}f(I)};C.once(\"error\",S);let b=C.options.body;C.once(\"retry\",(I,T)=>{var N,U;if(b===((N=T.request)===null||N===void 0?void 0:N.options.body)&&Krt.default.nodeStream((U=T.request)===null||U===void 0?void 0:U.options.body)){S(T);return}h(I)}),Zrt.default(C,s,$rt)};h(0)});a.on=(c,f)=>(s.on(c,f),a);let n=c=>{let f=(async()=>{await a;let{options:p}=r.request;return xAe.default(r,c,p.parseJson,p.encoding)})();return Object.defineProperties(f,Object.getOwnPropertyDescriptors(a)),f};return a.json=()=>{let{headers:c}=e.options;return!e.writableFinished&&c.accept===void 0&&(c.accept=\"application/json\"),n(\"json\")},a.buffer=()=>n(\"buffer\"),a.text=()=>n(\"text\"),a}S0.default=RAe;Vrt(nv(),S0)});var TAe=_(ej=>{\"use strict\";Object.defineProperty(ej,\"__esModule\",{value:!0});var ent=nv();function tnt(t,...e){let r=(async()=>{if(t instanceof ent.RequestError)try{for(let a of e)if(a)for(let n of a)t=await n(t)}catch(a){t=a}throw t})(),s=()=>r;return r.json=s,r.text=s,r.buffer=s,r.on=s,r}ej.default=tnt});var OAe=_(tj=>{\"use strict\";Object.defineProperty(tj,\"__esModule\",{value:!0});var FAe=Np();function NAe(t){for(let e of Object.values(t))(FAe.default.plainObject(e)||FAe.default.array(e))&&NAe(e);return Object.freeze(t)}tj.default=NAe});var MAe=_(LAe=>{\"use strict\";Object.defineProperty(LAe,\"__esModule\",{value:!0})});var rj=_(Nc=>{\"use strict\";var rnt=Nc&&Nc.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),nnt=Nc&&Nc.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&rnt(e,t,r)};Object.defineProperty(Nc,\"__esModule\",{value:!0});Nc.defaultHandler=void 0;var UAe=Np(),Fc=$H(),int=TAe(),cR=rv(),snt=OAe(),ont={RequestError:Fc.RequestError,CacheError:Fc.CacheError,ReadError:Fc.ReadError,HTTPError:Fc.HTTPError,MaxRedirectsError:Fc.MaxRedirectsError,TimeoutError:Fc.TimeoutError,ParseError:Fc.ParseError,CancelError:Fc.CancelError,UnsupportedProtocolError:Fc.UnsupportedProtocolError,UploadError:Fc.UploadError},ant=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:lR}=cR.default,_Ae=(...t)=>{let e;for(let r of t)e=lR(void 0,r,e);return e},lnt=t=>t.isStream?new cR.default(void 0,t):Fc.default(t),cnt=t=>\"defaults\"in t&&\"options\"in t.defaults,unt=[\"get\",\"post\",\"put\",\"patch\",\"head\",\"delete\"];Nc.defaultHandler=(t,e)=>e(t);var HAe=(t,e)=>{if(t)for(let r of t)r(e)},jAe=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(s=>(a,n)=>{let c,f=s(a,p=>(c=n(p),c));if(f!==c&&!a.isStream&&c){let p=f,{then:h,catch:E,finally:C}=p;Object.setPrototypeOf(p,Object.getPrototypeOf(c)),Object.defineProperties(p,Object.getOwnPropertyDescriptors(c)),p.then=h,p.catch=E,p.finally=C}return f});let e=(s,a={},n)=>{var c,f;let p=0,h=E=>t.handlers[p++](E,p===t.handlers.length?lnt:h);if(UAe.default.plainObject(s)){let E={...s,...a};cR.setNonEnumerableProperties([s,a],E),a=E,s=void 0}try{let E;try{HAe(t.options.hooks.init,a),HAe((c=a.hooks)===null||c===void 0?void 0:c.init,a)}catch(S){E=S}let C=lR(s,a,n??t.options);if(C[cR.kIsNormalizedAlready]=!0,E)throw new Fc.RequestError(E.message,E,C);return h(C)}catch(E){if(a.isStream)throw E;return int.default(E,t.options.hooks.beforeError,(f=a.hooks)===null||f===void 0?void 0:f.beforeError)}};e.extend=(...s)=>{let a=[t.options],n=[...t._rawHandlers],c;for(let f of s)cnt(f)?(a.push(f.defaults.options),n.push(...f.defaults._rawHandlers),c=f.defaults.mutableDefaults):(a.push(f),\"handlers\"in f&&n.push(...f.handlers),c=f.mutableDefaults);return n=n.filter(f=>f!==Nc.defaultHandler),n.length===0&&n.push(Nc.defaultHandler),jAe({options:_Ae(...a),handlers:n,mutableDefaults:!!c})};let r=async function*(s,a){let n=lR(s,a,t.options);n.resolveBodyOnly=!1;let c=n.pagination;if(!UAe.default.object(c))throw new TypeError(\"`options.pagination` must be implemented\");let f=[],{countLimit:p}=c,h=0;for(;h<c.requestLimit;){h!==0&&await ant(c.backoff);let E=await e(void 0,void 0,n),C=await c.transform(E),S=[];for(let I of C)if(c.filter(I,f,S)&&(!c.shouldContinue(I,f,S)||(yield I,c.stackAllItems&&f.push(I),S.push(I),--p<=0)))return;let b=c.paginate(E,f,S);if(b===!1)return;b===E.request.options?n=E.request.options:b!==void 0&&(n=lR(void 0,b,n)),h++}};e.paginate=r,e.paginate.all=async(s,a)=>{let n=[];for await(let c of r(s,a))n.push(c);return n},e.paginate.each=r,e.stream=(s,a)=>e(s,{...a,isStream:!0});for(let s of unt)e[s]=(a,n)=>e(a,{...n,method:s}),e.stream[s]=(a,n)=>e(a,{...n,method:s,isStream:!0});return Object.assign(e,ont),Object.defineProperty(e,\"defaults\",{value:t.mutableDefaults?t:snt.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=_Ae,e};Nc.default=jAe;nnt(MAe(),Nc)});var WAe=_((Op,uR)=>{\"use strict\";var fnt=Op&&Op.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),GAe=Op&&Op.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&fnt(e,t,r)};Object.defineProperty(Op,\"__esModule\",{value:!0});var Ant=Ie(\"url\"),qAe=rj(),pnt={options:{method:\"GET\",retry:{limit:2,methods:[\"GET\",\"PUT\",\"HEAD\",\"DELETE\",\"OPTIONS\",\"TRACE\"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:[\"ETIMEDOUT\",\"ECONNRESET\",\"EADDRINUSE\",\"ECONNREFUSED\",\"EPIPE\",\"ENOTFOUND\",\"ENETUNREACH\",\"EAI_AGAIN\"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{\"user-agent\":\"got (https://github.com/sindresorhus/got)\"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:\"text\",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:\"\",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType===\"json\"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,\"link\"))return!1;let e=t.headers.link.split(\",\"),r;for(let s of e){let a=s.split(\";\");if(a[1].includes(\"next\")){r=a[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new Ant.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[qAe.defaultHandler],mutableDefaults:!1},nj=qAe.default(pnt);Op.default=nj;uR.exports=nj;uR.exports.default=nj;uR.exports.__esModule=!0;GAe(rj(),Op);GAe($H(),Op)});var ln={};Vt(ln,{Method:()=>ZAe,del:()=>ynt,get:()=>oj,getNetworkSettings:()=>zAe,post:()=>aj,put:()=>mnt,request:()=>iv});async function ij(t){return Yl(VAe,t,()=>ce.readFilePromise(t).then(e=>(VAe.set(t,e),e)))}function dnt({statusCode:t,statusMessage:e},r){let s=Ht(r,t,ht.NUMBER),a=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return KE(r,`${s}${e?` (${e})`:\"\"}`,a)}async function fR(t,{configuration:e,customErrorMessage:r}){try{return await t}catch(s){if(s.name!==\"HTTPError\")throw s;let a=r?.(s,e)??s.response.body?.error;a==null&&(s.message.startsWith(\"Response code\")?a=\"The remote server failed to provide the requested resource\":a=s.message),s.code===\"ETIMEDOUT\"&&s.event===\"socket\"&&(a+=`(can be increased via ${Ht(e,\"httpTimeout\",ht.SETTING)})`);let n=new jt(35,a,c=>{s.response&&c.reportError(35,`  ${Kf(e,{label:\"Response Code\",value:_u(ht.NO_HINT,dnt(s.response,e))})}`),s.request&&(c.reportError(35,`  ${Kf(e,{label:\"Request Method\",value:_u(ht.NO_HINT,s.request.options.method)})}`),c.reportError(35,`  ${Kf(e,{label:\"Request URL\",value:_u(ht.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&c.reportError(35,`  ${Kf(e,{label:\"Request Redirects\",value:_u(ht.NO_HINT,z4(e,s.request.redirects,ht.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&c.reportError(35,`  ${Kf(e,{label:\"Request Retry Count\",value:_u(ht.NO_HINT,`${Ht(e,s.request.retryCount,ht.NUMBER)} (can be increased via ${Ht(e,\"httpRetry\",ht.SETTING)})`)})}`)});throw n.originalError=s,n}}function zAe(t,e){let r=[...e.configuration.get(\"networkSettings\")].sort(([c],[f])=>f.length-c.length),s={enableNetwork:void 0,httpsCaFilePath:void 0,httpProxy:void 0,httpsProxy:void 0,httpsKeyFilePath:void 0,httpsCertFilePath:void 0},a=Object.keys(s),n=typeof t==\"string\"?new URL(t):t;for(let[c,f]of r)if(sj.default.isMatch(n.hostname,c))for(let p of a){let h=f.get(p);h!==null&&typeof s[p]>\"u\"&&(s[p]=h)}for(let c of a)typeof s[c]>\"u\"&&(s[c]=e.configuration.get(c));return s}async function iv(t,e,{configuration:r,headers:s,jsonRequest:a,jsonResponse:n,method:c=\"GET\",wrapNetworkRequest:f}){let p={target:t,body:e,configuration:r,headers:s,jsonRequest:a,jsonResponse:n,method:c},h=async()=>await Ent(t,e,p),E=typeof f<\"u\"?await f(h,p):h;return await(await r.reduceHook(S=>S.wrapNetworkRequest,E,p))()}async function oj(t,{configuration:e,jsonResponse:r,customErrorMessage:s,wrapNetworkRequest:a,...n}){let c=()=>fR(iv(t,null,{configuration:e,wrapNetworkRequest:a,...n}),{configuration:e,customErrorMessage:s}).then(p=>p.body),f=await(typeof a<\"u\"?c():Yl(YAe,t,()=>c().then(p=>(YAe.set(t,p),p))));return r?JSON.parse(f.toString()):f}async function mnt(t,e,{customErrorMessage:r,...s}){return(await fR(iv(t,e,{...s,method:\"PUT\"}),{customErrorMessage:r,configuration:s.configuration})).body}async function aj(t,e,{customErrorMessage:r,...s}){return(await fR(iv(t,e,{...s,method:\"POST\"}),{customErrorMessage:r,configuration:s.configuration})).body}async function ynt(t,{customErrorMessage:e,...r}){return(await fR(iv(t,null,{...r,method:\"DELETE\"}),{customErrorMessage:e,configuration:r.configuration})).body}async function Ent(t,e,{configuration:r,headers:s,jsonRequest:a,jsonResponse:n,method:c=\"GET\"}){let f=typeof t==\"string\"?new URL(t):t,p=zAe(f,{configuration:r});if(p.enableNetwork===!1)throw new jt(80,`Request to '${f.href}' has been blocked because of your configuration settings`);if(f.protocol===\"http:\"&&!sj.default.isMatch(f.hostname,r.get(\"unsafeHttpWhitelist\")))throw new jt(81,`Unsafe http requests must be explicitly whitelisted in your configuration (${f.hostname})`);let h={headers:s,method:c};h.responseType=n?\"json\":\"buffer\",e!==null&&(Buffer.isBuffer(e)||!a&&typeof e==\"string\"?h.body=e:h.json=e);let E=r.get(\"httpTimeout\"),C=r.get(\"httpRetry\"),S=r.get(\"enableStrictSsl\"),b=p.httpsCaFilePath,I=p.httpsCertFilePath,T=p.httpsKeyFilePath,{default:N}=await Promise.resolve().then(()=>ut(WAe())),U=b?await ij(b):void 0,W=I?await ij(I):void 0,ee=T?await ij(T):void 0,ie={rejectUnauthorized:S,ca:U,cert:W,key:ee},ue={http:p.httpProxy?new Iue({proxy:p.httpProxy,proxyRequestOptions:ie}):hnt,https:p.httpsProxy?new Cue({proxy:p.httpsProxy,proxyRequestOptions:ie}):gnt},le=N.extend({timeout:{socket:E},retry:C,agent:ue,https:{rejectUnauthorized:S,certificateAuthority:U,certificate:W,key:ee},...h});return r.getLimit(\"networkConcurrency\")(()=>le(f))}var JAe,KAe,sj,YAe,VAe,hnt,gnt,ZAe,AR=Ze(()=>{Dt();wue();JAe=Ie(\"https\"),KAe=Ie(\"http\"),sj=ut(Go());Rc();xc();bc();YAe=new Map,VAe=new Map,hnt=new KAe.Agent({keepAlive:!0}),gnt=new JAe.Agent({keepAlive:!0});ZAe=(a=>(a.GET=\"GET\",a.PUT=\"PUT\",a.POST=\"POST\",a.DELETE=\"DELETE\",a))(ZAe||{})});var fs={};Vt(fs,{availableParallelism:()=>cj,getArchitecture:()=>sv,getArchitectureName:()=>vnt,getArchitectureSet:()=>lj,getCaller:()=>bnt,major:()=>Int,openUrl:()=>Cnt});function Bnt(){if(process.platform!==\"linux\")return null;let t;try{t=ce.readFileSync(wnt)}catch{}if(typeof t<\"u\"){if(t&&(t.includes(\"GLIBC\")||t.includes(\"GNU libc\")||t.includes(\"GNU C Library\")))return\"glibc\";if(t&&t.includes(\"musl\"))return\"musl\"}let r=(process.report?.getReport()??{}).sharedObjects??[],s=/\\/(?:(ld-linux-|[^/]+-linux-gnu\\/)|(libc.musl-|ld-musl-))/;return p0(r,a=>{let n=a.match(s);if(!n)return p0.skip;if(n[1])return\"glibc\";if(n[2])return\"musl\";throw new Error(\"Assertion failed: Expected the libc variant to have been detected\")})??null}function sv(){return $Ae=$Ae??{os:(process.env.YARN_IS_TEST_ENV?process.env.YARN_OS_OVERRIDE:void 0)??process.platform,cpu:(process.env.YARN_IS_TEST_ENV?process.env.YARN_CPU_OVERRIDE:void 0)??process.arch,libc:(process.env.YARN_IS_TEST_ENV?process.env.YARN_LIBC_OVERRIDE:void 0)??Bnt()}}function vnt(t=sv()){return t.libc?`${t.os}-${t.cpu}-${t.libc}`:`${t.os}-${t.cpu}`}function lj(){let t=sv();return epe=epe??{os:[t.os],cpu:[t.cpu],libc:t.libc?[t.libc]:[]}}function Pnt(t){let e=Snt.exec(t);if(!e)return null;let r=e[2]&&e[2].indexOf(\"native\")===0,s=e[2]&&e[2].indexOf(\"eval\")===0,a=Dnt.exec(e[2]);return s&&a!=null&&(e[2]=a[1],e[3]=a[2],e[4]=a[3]),{file:r?null:e[2],methodName:e[1]||\"<unknown>\",arguments:r?[e[2]]:[],line:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}function bnt(){let e=new Error().stack.split(`\n`)[3];return Pnt(e)}function cj(){return typeof pR.default.availableParallelism<\"u\"?pR.default.availableParallelism():Math.max(1,pR.default.cpus().length)}var pR,Int,XAe,Cnt,wnt,$Ae,epe,Snt,Dnt,hR=Ze(()=>{Dt();pR=ut(Ie(\"os\"));gR();bc();Int=Number(process.versions.node.split(\".\")[0]),XAe=new Map([[\"darwin\",\"open\"],[\"linux\",\"xdg-open\"],[\"win32\",\"explorer.exe\"]]).get(process.platform),Cnt=typeof XAe<\"u\"?async t=>{try{return await uj(XAe,[t],{cwd:J.cwd()}),!0}catch{return!1}}:void 0,wnt=\"/usr/bin/ldd\";Snt=/^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i,Dnt=/\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/});function gj(t,e,r,s,a){let n=YB(r);if(s.isArray||s.type===\"ANY\"&&Array.isArray(n))return Array.isArray(n)?n.map((c,f)=>fj(t,`${e}[${f}]`,c,s,a)):String(n).split(/,/).map(c=>fj(t,e,c,s,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings \"${e}\" cannot be an array`);return fj(t,e,r,s,a)}function fj(t,e,r,s,a){let n=YB(r);switch(s.type){case\"ANY\":return FQ(n);case\"SHAPE\":return Rnt(t,e,r,s,a);case\"MAP\":return Tnt(t,e,r,s,a)}if(n===null&&!s.isNullable&&s.default!==null)throw new Error(`Non-nullable configuration settings \"${e}\" cannot be set to null`);if(s.values?.includes(n))return n;let f=(()=>{if(s.type===\"BOOLEAN\"&&typeof n!=\"string\")return kB(n);if(typeof n!=\"string\")throw new Error(`Expected configuration setting \"${e}\" to be a string, got ${typeof n}`);let p=Vk(n,{env:t.env});switch(s.type){case\"ABSOLUTE_PATH\":{let h=a,E=U8(r);return E&&E[0]!==\"<\"&&(h=J.dirname(E)),J.resolve(h,fe.toPortablePath(p))}case\"LOCATOR_LOOSE\":return Qp(p,!1);case\"NUMBER\":return parseInt(p);case\"LOCATOR\":return Qp(p);case\"BOOLEAN\":return kB(p);default:return p}})();if(s.values&&!s.values.includes(f))throw new Error(`Invalid value, expected one of ${s.values.join(\", \")}`);return f}function Rnt(t,e,r,s,a){let n=YB(r);if(typeof n!=\"object\"||Array.isArray(n))throw new nt(`Object configuration settings \"${e}\" must be an object`);let c=dj(t,s,{ignoreArrays:!0});if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=`${e}.${f}`;if(!s.properties[f])throw new nt(`Unrecognized configuration settings found: ${e}.${f} - run \"yarn config\" to see the list of settings supported in Yarn`);c.set(f,gj(t,h,p,s.properties[f],a))}return c}function Tnt(t,e,r,s,a){let n=YB(r),c=new Map;if(typeof n!=\"object\"||Array.isArray(n))throw new nt(`Map configuration settings \"${e}\" must be an object`);if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=s.normalizeKeys?s.normalizeKeys(f):f,E=`${e}['${h}']`,C=s.valueDefinition;c.set(h,gj(t,E,p,C,a))}return c}function dj(t,e,{ignoreArrays:r=!1}={}){switch(e.type){case\"SHAPE\":{if(e.isArray&&!r)return[];let s=new Map;for(let[a,n]of Object.entries(e.properties))s.set(a,dj(t,n));return s}case\"MAP\":return e.isArray&&!r?[]:new Map;case\"ABSOLUTE_PATH\":return e.default===null?null:t.projectCwd===null?Array.isArray(e.default)?e.default.map(s=>J.normalize(s)):J.isAbsolute(e.default)?J.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(s=>J.resolve(t.projectCwd,s)):J.resolve(t.projectCwd,e.default);default:return e.default}}function mR(t,e,r){if(e.type===\"SECRET\"&&typeof t==\"string\"&&r.hideSecrets)return Qnt;if(e.type===\"ABSOLUTE_PATH\"&&typeof t==\"string\"&&r.getNativePaths)return fe.fromPortablePath(t);if(e.isArray&&Array.isArray(t)){let s=[];for(let a of t)s.push(mR(a,e,r));return s}if(e.type===\"MAP\"&&t instanceof Map){if(t.size===0)return;let s=new Map;for(let[a,n]of t.entries()){let c=mR(n,e.valueDefinition,r);typeof c<\"u\"&&s.set(a,c)}return s}if(e.type===\"SHAPE\"&&t instanceof Map){if(t.size===0)return;let s=new Map;for(let[a,n]of t.entries()){let c=e.properties[a],f=mR(n,c,r);typeof f<\"u\"&&s.set(a,f)}return s}return t}function Fnt(){let t={};for(let[e,r]of Object.entries(process.env))e=e.toLowerCase(),e.startsWith(yR)&&(e=(0,rpe.default)(e.slice(yR.length)),t[e]=r);return t}function pj(){let t=`${yR}rc_filename`;for(let[e,r]of Object.entries(process.env))if(e.toLowerCase()===t&&typeof r==\"string\")return r;return hj}async function tpe(t){try{return await ce.readFilePromise(t)}catch{return Buffer.of()}}async function Nnt(t,e){return Buffer.compare(...await Promise.all([tpe(t),tpe(e)]))===0}async function Ont(t,e){let[r,s]=await Promise.all([ce.statPromise(t),ce.statPromise(e)]);return r.dev===s.dev&&r.ino===s.ino}async function Mnt({configuration:t,selfPath:e}){let r=t.get(\"yarnPath\");return t.get(\"ignorePath\")||r===null||r===e||await Lnt(r,e)?null:r}var rpe,Lp,npe,ipe,spe,Aj,xnt,ov,knt,Mp,yR,hj,Qnt,wI,ope,ER,dR,Lnt,ze,av=Ze(()=>{Dt();wc();rpe=ut(Cre()),Lp=ut(Fd());Yt();npe=ut(hne()),ipe=Ie(\"module\"),spe=ut(Ld()),Aj=Ie(\"stream\");$ce();oI();Q8();R8();T8();fue();F8();tm();due();OQ();xc();I0();AR();bc();hR();Tp();Wo();xnt=function(){if(!Lp.GITHUB_ACTIONS||!process.env.GITHUB_EVENT_PATH)return!1;let t=fe.toPortablePath(process.env.GITHUB_EVENT_PATH),e;try{e=ce.readJsonSync(t)}catch{return!1}return!(!(\"repository\"in e)||!e.repository||(e.repository.private??!0))}(),ov=new Set([\"@yarnpkg/plugin-constraints\",\"@yarnpkg/plugin-exec\",\"@yarnpkg/plugin-interactive-tools\",\"@yarnpkg/plugin-stage\",\"@yarnpkg/plugin-typescript\",\"@yarnpkg/plugin-version\",\"@yarnpkg/plugin-workspace-tools\"]),knt=new Set([\"isTestEnv\",\"injectNpmUser\",\"injectNpmPassword\",\"injectNpm2FaToken\",\"zipDataEpilogue\",\"cacheCheckpointOverride\",\"cacheVersionOverride\",\"lockfileVersionOverride\",\"osOverride\",\"cpuOverride\",\"libcOverride\",\"binFolder\",\"version\",\"flags\",\"profile\",\"gpg\",\"ignoreNode\",\"wrapOutput\",\"home\",\"confDir\",\"registry\",\"ignoreCwd\"]),Mp=/^(?!v)[a-z0-9._-]+$/i,yR=\"yarn_\",hj=\".yarnrc.yml\",Qnt=\"********\",wI=(E=>(E.ANY=\"ANY\",E.BOOLEAN=\"BOOLEAN\",E.ABSOLUTE_PATH=\"ABSOLUTE_PATH\",E.LOCATOR=\"LOCATOR\",E.LOCATOR_LOOSE=\"LOCATOR_LOOSE\",E.NUMBER=\"NUMBER\",E.STRING=\"STRING\",E.SECRET=\"SECRET\",E.SHAPE=\"SHAPE\",E.MAP=\"MAP\",E))(wI||{}),ope=ht,ER=(r=>(r.JUNCTIONS=\"junctions\",r.SYMLINKS=\"symlinks\",r))(ER||{}),dR={lastUpdateCheck:{description:\"Last timestamp we checked whether new Yarn versions were available\",type:\"STRING\",default:null},yarnPath:{description:\"Path to the local executable that must be used over the global one\",type:\"ABSOLUTE_PATH\",default:null},ignorePath:{description:\"If true, the local executable will be ignored when using the global one\",type:\"BOOLEAN\",default:!1},globalFolder:{description:\"Folder where all system-global files are stored\",type:\"ABSOLUTE_PATH\",default:H8()},cacheFolder:{description:\"Folder where the cache files must be written\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/cache\"},compressionLevel:{description:\"Zip files compression level, from 0 to 9 or mixed (a variant of 9, which stores some files uncompressed, when compression doesn't yield good results)\",type:\"NUMBER\",values:[\"mixed\",0,1,2,3,4,5,6,7,8,9],default:0},virtualFolder:{description:\"Folder where the virtual packages (cf doc) will be mapped on the disk (must be named __virtual__)\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/__virtual__\"},installStatePath:{description:\"Path of the file where the install state will be persisted\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/install-state.gz\"},immutablePatterns:{description:\"Array of glob patterns; files matching them won't be allowed to change during immutable installs\",type:\"STRING\",default:[],isArray:!0},rcFilename:{description:\"Name of the files where the configuration can be found\",type:\"STRING\",default:pj()},enableGlobalCache:{description:\"If true, the system-wide cache folder will be used regardless of `cache-folder`\",type:\"BOOLEAN\",default:!0},cacheMigrationMode:{description:\"Defines the conditions under which Yarn upgrades should cause the cache archives to be regenerated.\",type:\"STRING\",values:[\"always\",\"match-spec\",\"required-only\"],default:\"always\"},enableColors:{description:\"If true, the CLI is allowed to use colors in its output\",type:\"BOOLEAN\",default:Zk,defaultText:\"<dynamic>\"},enableHyperlinks:{description:\"If true, the CLI is allowed to use hyperlinks in its output\",type:\"BOOLEAN\",default:K4,defaultText:\"<dynamic>\"},enableInlineBuilds:{description:\"If true, the CLI will print the build output on the command line\",type:\"BOOLEAN\",default:Lp.isCI,defaultText:\"<dynamic>\"},enableMessageNames:{description:\"If true, the CLI will prefix most messages with codes suitable for search engines\",type:\"BOOLEAN\",default:!0},enableProgressBars:{description:\"If true, the CLI is allowed to show a progress bar for long-running events\",type:\"BOOLEAN\",default:!Lp.isCI,defaultText:\"<dynamic>\"},enableTimers:{description:\"If true, the CLI is allowed to print the time spent executing commands\",type:\"BOOLEAN\",default:!0},enableTips:{description:\"If true, installs will print a helpful message every day of the week\",type:\"BOOLEAN\",default:!Lp.isCI,defaultText:\"<dynamic>\"},preferInteractive:{description:\"If true, the CLI will automatically use the interactive mode when called from a TTY\",type:\"BOOLEAN\",default:!1},preferTruncatedLines:{description:\"If true, the CLI will truncate lines that would go beyond the size of the terminal\",type:\"BOOLEAN\",default:!1},progressBarStyle:{description:\"Which style of progress bar should be used (only when progress bars are enabled)\",type:\"STRING\",default:void 0,defaultText:\"<dynamic>\"},defaultLanguageName:{description:\"Default language mode that should be used when a package doesn't offer any insight\",type:\"STRING\",default:\"node\"},defaultProtocol:{description:\"Default resolution protocol used when resolving pure semver and tag ranges\",type:\"STRING\",default:\"npm:\"},enableTransparentWorkspaces:{description:\"If false, Yarn won't automatically resolve workspace dependencies unless they use the `workspace:` protocol\",type:\"BOOLEAN\",default:!0},supportedArchitectures:{description:\"Architectures that Yarn will fetch and inject into the resolver\",type:\"SHAPE\",properties:{os:{description:\"Array of supported process.platform strings, or null to target them all\",type:\"STRING\",isArray:!0,isNullable:!0,default:[\"current\"]},cpu:{description:\"Array of supported process.arch strings, or null to target them all\",type:\"STRING\",isArray:!0,isNullable:!0,default:[\"current\"]},libc:{description:\"Array of supported libc libraries, or null to target them all\",type:\"STRING\",isArray:!0,isNullable:!0,default:[\"current\"]}}},enableMirror:{description:\"If true, the downloaded packages will be retrieved and stored in both the local and global folders\",type:\"BOOLEAN\",default:!0},enableNetwork:{description:\"If false, Yarn will refuse to use the network if required to\",type:\"BOOLEAN\",default:!0},enableOfflineMode:{description:\"If true, Yarn will attempt to retrieve files and metadata from the global cache rather than the network\",type:\"BOOLEAN\",default:!1},httpProxy:{description:\"URL of the http proxy that must be used for outgoing http requests\",type:\"STRING\",default:null},httpsProxy:{description:\"URL of the http proxy that must be used for outgoing https requests\",type:\"STRING\",default:null},unsafeHttpWhitelist:{description:\"List of the hostnames for which http queries are allowed (glob patterns are supported)\",type:\"STRING\",default:[],isArray:!0},httpTimeout:{description:\"Timeout of each http request in milliseconds\",type:\"NUMBER\",default:6e4},httpRetry:{description:\"Retry times on http failure\",type:\"NUMBER\",default:3},networkConcurrency:{description:\"Maximal number of concurrent requests\",type:\"NUMBER\",default:50},taskPoolConcurrency:{description:\"Maximal amount of concurrent heavy task processing\",type:\"NUMBER\",default:cj()},taskPoolMode:{description:\"Execution strategy for heavy tasks\",type:\"STRING\",values:[\"async\",\"workers\"],default:\"workers\"},networkSettings:{description:\"Network settings per hostname (glob patterns are supported)\",type:\"MAP\",valueDefinition:{description:\"\",type:\"SHAPE\",properties:{httpsCaFilePath:{description:\"Path to file containing one or multiple Certificate Authority signing certificates\",type:\"ABSOLUTE_PATH\",default:null},enableNetwork:{description:\"If false, the package manager will refuse to use the network if required to\",type:\"BOOLEAN\",default:null},httpProxy:{description:\"URL of the http proxy that must be used for outgoing http requests\",type:\"STRING\",default:null},httpsProxy:{description:\"URL of the http proxy that must be used for outgoing https requests\",type:\"STRING\",default:null},httpsKeyFilePath:{description:\"Path to file containing private key in PEM format\",type:\"ABSOLUTE_PATH\",default:null},httpsCertFilePath:{description:\"Path to file containing certificate chain in PEM format\",type:\"ABSOLUTE_PATH\",default:null}}}},httpsCaFilePath:{description:\"A path to a file containing one or multiple Certificate Authority signing certificates\",type:\"ABSOLUTE_PATH\",default:null},httpsKeyFilePath:{description:\"Path to file containing private key in PEM format\",type:\"ABSOLUTE_PATH\",default:null},httpsCertFilePath:{description:\"Path to file containing certificate chain in PEM format\",type:\"ABSOLUTE_PATH\",default:null},enableStrictSsl:{description:\"If false, SSL certificate errors will be ignored\",type:\"BOOLEAN\",default:!0},logFilters:{description:\"Overrides for log levels\",type:\"SHAPE\",isArray:!0,concatenateValues:!0,properties:{code:{description:\"Code of the messages covered by this override\",type:\"STRING\",default:void 0},text:{description:\"Code of the texts covered by this override\",type:\"STRING\",default:void 0},pattern:{description:\"Code of the patterns covered by this override\",type:\"STRING\",default:void 0},level:{description:\"Log level override, set to null to remove override\",type:\"STRING\",values:Object.values($k),isNullable:!0,default:void 0}}},enableTelemetry:{description:\"If true, telemetry will be periodically sent, following the rules in https://yarnpkg.com/advanced/telemetry\",type:\"BOOLEAN\",default:!0},telemetryInterval:{description:\"Minimal amount of time between two telemetry uploads, in days\",type:\"NUMBER\",default:7},telemetryUserId:{description:\"If you desire to tell us which project you are, you can set this field. Completely optional and opt-in.\",type:\"STRING\",default:null},enableHardenedMode:{description:\"If true, automatically enable --check-resolutions --refresh-lockfile on installs\",type:\"BOOLEAN\",default:Lp.isPR&&xnt,defaultText:\"<true on public PRs>\"},enableScripts:{description:\"If true, packages are allowed to have install scripts by default\",type:\"BOOLEAN\",default:!0},enableStrictSettings:{description:\"If true, unknown settings will cause Yarn to abort\",type:\"BOOLEAN\",default:!0},enableImmutableCache:{description:\"If true, the cache is reputed immutable and actions that would modify it will throw\",type:\"BOOLEAN\",default:!1},enableCacheClean:{description:\"If false, disallows the `cache clean` command\",type:\"BOOLEAN\",default:!0},checksumBehavior:{description:\"Enumeration defining what to do when a checksum doesn't match expectations\",type:\"STRING\",default:\"throw\"},injectEnvironmentFiles:{description:\"List of all the environment files that Yarn should inject inside the process when it starts\",type:\"ABSOLUTE_PATH\",default:[\".env.yarn?\"],isArray:!0},packageExtensions:{description:\"Map of package corrections to apply on the dependency tree\",type:\"MAP\",valueDefinition:{description:\"The extension that will be applied to any package whose version matches the specified range\",type:\"SHAPE\",properties:{dependencies:{description:\"The set of dependencies that must be made available to the current package in order for it to work properly\",type:\"MAP\",valueDefinition:{description:\"A range\",type:\"STRING\"}},peerDependencies:{description:\"Inherited dependencies - the consumer of the package will be tasked to provide them\",type:\"MAP\",valueDefinition:{description:\"A semver range\",type:\"STRING\"}},peerDependenciesMeta:{description:\"Extra information related to the dependencies listed in the peerDependencies field\",type:\"MAP\",valueDefinition:{description:\"The peerDependency meta\",type:\"SHAPE\",properties:{optional:{description:\"If true, the selected peer dependency will be marked as optional by the package manager and the consumer omitting it won't be reported as an error\",type:\"BOOLEAN\",default:!1}}}}}}}};Lnt=process.platform===\"win32\"?Nnt:Ont;ze=class t{constructor(e){this.isCI=Lp.isCI;this.projectCwd=null;this.plugins=new Map;this.settings=new Map;this.values=new Map;this.sources=new Map;this.invalid=new Map;this.env={};this.limits=new Map;this.packageExtensions=null;this.startingCwd=e}static{this.deleteProperty=Symbol()}static{this.telemetry=null}static create(e,r,s){let a=new t(e);typeof r<\"u\"&&!(r instanceof Map)&&(a.projectCwd=r),a.importSettings(dR);let n=typeof s<\"u\"?s:r instanceof Map?r:new Map;for(let[c,f]of n)a.activatePlugin(c,f);return a}static async find(e,r,{strict:s=!0,usePathCheck:a=null,useRc:n=!0}={}){let c=Fnt();delete c.rcFilename;let f=new t(e),p=await t.findRcFiles(e),h=await t.findFolderRcFile(fI());h&&(p.find(me=>me.path===h.path)||p.unshift(h));let E=gue(p.map(le=>[le.path,le.data])),C=vt.dot,S=new Set(Object.keys(dR)),b=({yarnPath:le,ignorePath:me,injectEnvironmentFiles:pe})=>({yarnPath:le,ignorePath:me,injectEnvironmentFiles:pe}),I=({yarnPath:le,ignorePath:me,injectEnvironmentFiles:pe,...Be})=>{let Ce={};for(let[g,we]of Object.entries(Be))S.has(g)&&(Ce[g]=we);return Ce},T=({yarnPath:le,ignorePath:me,...pe})=>{let Be={};for(let[Ce,g]of Object.entries(pe))S.has(Ce)||(Be[Ce]=g);return Be};if(f.importSettings(b(dR)),f.useWithSource(\"<environment>\",b(c),e,{strict:!1}),E){let[le,me]=E;f.useWithSource(le,b(me),C,{strict:!1})}if(a){if(await Mnt({configuration:f,selfPath:a})!==null)return f;f.useWithSource(\"<override>\",{ignorePath:!0},e,{strict:!1,overwrite:!0})}let N=await t.findProjectCwd(e);f.startingCwd=e,f.projectCwd=N;let U=Object.assign(Object.create(null),process.env);f.env=U;let W=await Promise.all(f.get(\"injectEnvironmentFiles\").map(async le=>{let me=le.endsWith(\"?\")?await ce.readFilePromise(le.slice(0,-1),\"utf8\").catch(()=>\"\"):await ce.readFilePromise(le,\"utf8\");return(0,npe.parse)(me)}));for(let le of W)for(let[me,pe]of Object.entries(le))f.env[me]=Vk(pe,{env:U});if(f.importSettings(I(dR)),f.useWithSource(\"<environment>\",I(c),e,{strict:s}),E){let[le,me]=E;f.useWithSource(le,I(me),C,{strict:s})}let ee=le=>\"default\"in le?le.default:le,ie=new Map([[\"@@core\",Xce]]);if(r!==null)for(let le of r.plugins.keys())ie.set(le,ee(r.modules.get(le)));for(let[le,me]of ie)f.activatePlugin(le,me);let ue=new Map([]);if(r!==null){let le=new Map;for(let[Be,Ce]of r.modules)le.set(Be,()=>Ce);let me=new Set,pe=async(Be,Ce)=>{let{factory:g,name:we}=bp(Be);if(!g||me.has(we))return;let ye=new Map(le),Ae=X=>{if((0,ipe.isBuiltin)(X))return bp(X);if(ye.has(X))return ye.get(X)();throw new nt(`This plugin cannot access the package referenced via ${X} which is neither a builtin, nor an exposed entry`)},se=await qE(async()=>ee(await g(Ae)),X=>`${X} (when initializing ${we}, defined in ${Ce})`);le.set(we,()=>se),me.add(we),ue.set(we,se)};if(c.plugins)for(let Be of c.plugins.split(\";\")){let Ce=J.resolve(e,fe.toPortablePath(Be));await pe(Ce,\"<environment>\")}for(let{path:Be,cwd:Ce,data:g}of p)if(n&&Array.isArray(g.plugins))for(let we of g.plugins){let ye=typeof we!=\"string\"?we.path:we,Ae=we?.spec??\"\",se=we?.checksum??\"\";if(ov.has(Ae))continue;let X=J.resolve(Ce,fe.toPortablePath(ye));if(!await ce.existsPromise(X)){if(!Ae){let mt=Ht(f,J.basename(X,\".cjs\"),ht.NAME),j=Ht(f,\".gitignore\",ht.NAME),rt=Ht(f,f.values.get(\"rcFilename\"),ht.NAME),Fe=Ht(f,\"https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored\",ht.URL);throw new nt(`Missing source for the ${mt} plugin - please try to remove the plugin from ${rt} then reinstall it manually. This error usually occurs because ${j} is incorrect, check ${Fe} to make sure your plugin folder isn't gitignored.`)}if(!Ae.match(/^https?:/)){let mt=Ht(f,J.basename(X,\".cjs\"),ht.NAME),j=Ht(f,f.values.get(\"rcFilename\"),ht.NAME);throw new nt(`Failed to recognize the source for the ${mt} plugin - please try to delete the plugin from ${j} then reinstall it manually.`)}let De=await oj(Ae,{configuration:f}),Te=cs(De);if(se&&se!==Te){let mt=Ht(f,J.basename(X,\".cjs\"),ht.NAME),j=Ht(f,f.values.get(\"rcFilename\"),ht.NAME),rt=Ht(f,`yarn plugin import ${Ae}`,ht.CODE);throw new nt(`Failed to fetch the ${mt} plugin from its remote location: its checksum seems to have changed. If this is expected, please remove the plugin from ${j} then run ${rt} to reimport it.`)}await ce.mkdirPromise(J.dirname(X),{recursive:!0}),await ce.writeFilePromise(X,De)}await pe(X,Be)}}for(let[le,me]of ue)f.activatePlugin(le,me);if(f.useWithSource(\"<environment>\",T(c),e,{strict:s}),E){let[le,me]=E;f.useWithSource(le,T(me),C,{strict:s})}return f.get(\"enableGlobalCache\")&&(f.values.set(\"cacheFolder\",`${f.get(\"globalFolder\")}/cache`),f.sources.set(\"cacheFolder\",\"<internal>\")),f}static async findRcFiles(e){let r=pj(),s=[],a=e,n=null;for(;a!==n;){n=a;let c=J.join(n,r);if(ce.existsSync(c)){let f,p;try{p=await ce.readFilePromise(c,\"utf8\"),f=as(p)}catch{let h=\"\";throw p?.match(/^\\s+(?!-)[^:]+\\s+\\S+/m)&&(h=\" (in particular, make sure you list the colons after each key name)\"),new nt(`Parse error when loading ${c}; please check it's proper Yaml${h}`)}s.unshift({path:c,cwd:n,data:f})}a=J.dirname(n)}return s}static async findFolderRcFile(e){let r=J.join(e,Er.rc),s;try{s=await ce.readFilePromise(r,\"utf8\")}catch(n){if(n.code===\"ENOENT\")return null;throw n}let a=as(s);return{path:r,cwd:e,data:a}}static async findProjectCwd(e){let r=null,s=e,a=null;for(;s!==a;){if(a=s,ce.existsSync(J.join(a,Er.lockfile)))return a;ce.existsSync(J.join(a,Er.manifest))&&(r=a),s=J.dirname(a)}return r}static async updateConfiguration(e,r,s={}){let a=pj(),n=J.join(e,a),c=ce.existsSync(n)?as(await ce.readFilePromise(n,\"utf8\")):{},f=!1,p;if(typeof r==\"function\"){try{p=r(c)}catch{p=r({})}if(p===c)return!1}else{p=c;for(let h of Object.keys(r)){let E=c[h],C=r[h],S;if(typeof C==\"function\")try{S=C(E)}catch{S=C(void 0)}else S=C;E!==S&&(S===t.deleteProperty?delete p[h]:p[h]=S,f=!0)}if(!f)return!1}return await ce.changeFilePromise(n,nl(p),{automaticNewlines:!0}),!0}static async addPlugin(e,r){r.length!==0&&await t.updateConfiguration(e,s=>{let a=s.plugins??[];if(a.length===0)return{...s,plugins:r};let n=[],c=[...r];for(let f of a){let p=typeof f!=\"string\"?f.path:f,h=c.find(E=>E.path===p);h?(n.push(h),c=c.filter(E=>E!==h)):n.push(f)}return n.push(...c),{...s,plugins:n}})}static async updateHomeConfiguration(e){let r=fI();return await t.updateConfiguration(r,e)}activatePlugin(e,r){this.plugins.set(e,r),typeof r.configuration<\"u\"&&this.importSettings(r.configuration)}importSettings(e){for(let[r,s]of Object.entries(e))if(s!=null){if(this.settings.has(r))throw new Error(`Cannot redefine settings \"${r}\"`);this.settings.set(r,s),this.values.set(r,dj(this,s))}}useWithSource(e,r,s,a){try{this.use(e,r,s,a)}catch(n){throw n.message+=` (in ${Ht(this,e,ht.PATH)})`,n}}use(e,r,s,{strict:a=!0,overwrite:n=!1}={}){a=a&&this.get(\"enableStrictSettings\");for(let c of[\"enableStrictSettings\",...Object.keys(r)]){let f=r[c],p=U8(f);if(p&&(e=p),typeof f>\"u\"||c===\"plugins\"||e===\"<environment>\"&&knt.has(c))continue;if(c===\"rcFilename\")throw new nt(`The rcFilename settings can only be set via ${`${yR}RC_FILENAME`.toUpperCase()}, not via a rc file`);let h=this.settings.get(c);if(!h){let C=fI(),S=e[0]!==\"<\"?J.dirname(e):null;if(a&&!(S!==null?C===S:!1))throw new nt(`Unrecognized or legacy configuration settings found: ${c} - run \"yarn config\" to see the list of settings supported in Yarn`);this.invalid.set(c,e);continue}if(this.sources.has(c)&&!(n||h.type===\"MAP\"||h.isArray&&h.concatenateValues))continue;let E;try{E=gj(this,c,f,h,s)}catch(C){throw C.message+=` in ${Ht(this,e,ht.PATH)}`,C}if(c===\"enableStrictSettings\"&&e!==\"<environment>\"){a=E;continue}if(h.type===\"MAP\"){let C=this.values.get(c);this.values.set(c,new Map(n?[...C,...E]:[...E,...C])),this.sources.set(c,`${this.sources.get(c)}, ${e}`)}else if(h.isArray&&h.concatenateValues){let C=this.values.get(c);this.values.set(c,n?[...C,...E]:[...E,...C]),this.sources.set(c,`${this.sources.get(c)}, ${e}`)}else this.values.set(c,E),this.sources.set(c,e)}}get(e){if(!this.values.has(e))throw new Error(`Invalid configuration key \"${e}\"`);return this.values.get(e)}getSpecial(e,{hideSecrets:r=!1,getNativePaths:s=!1}){let a=this.get(e),n=this.settings.get(e);if(typeof n>\"u\")throw new nt(`Couldn't find a configuration settings named \"${e}\"`);return mR(a,n,{hideSecrets:r,getNativePaths:s})}getSubprocessStreams(e,{header:r,prefix:s,report:a}){let n,c,f=ce.createWriteStream(e);if(this.get(\"enableInlineBuilds\")){let p=a.createStreamReporter(`${s} ${Ht(this,\"STDOUT\",\"green\")}`),h=a.createStreamReporter(`${s} ${Ht(this,\"STDERR\",\"red\")}`);n=new Aj.PassThrough,n.pipe(p),n.pipe(f),c=new Aj.PassThrough,c.pipe(h),c.pipe(f)}else n=f,c=f,typeof r<\"u\"&&n.write(`${r}\n`);return{stdout:n,stderr:c}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let s of r.resolvers||[])e.push(new s);return new rm([new TQ,new Ei,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let s of r.fetchers||[])e.push(new s);return new aI([new lI,new cI,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let s of r.linkers||[])e.push(new s);return e}getSupportedArchitectures(){let e=sv(),r=this.get(\"supportedArchitectures\"),s=r.get(\"os\");s!==null&&(s=s.map(c=>c===\"current\"?e.os:c));let a=r.get(\"cpu\");a!==null&&(a=a.map(c=>c===\"current\"?e.cpu:c));let n=r.get(\"libc\");return n!==null&&(n=Wl(n,c=>c===\"current\"?e.libc??Wl.skip:c)),{os:s,cpu:a,libc:n}}isInteractive({interactive:e,stdout:r}){return r.isTTY?e??this.get(\"preferInteractive\"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let e=this.packageExtensions,r=(s,a,{userProvided:n=!1}={})=>{if(!cl(s.range))throw new Error(\"Only semver ranges are allowed as keys for the packageExtensions setting\");let c=new Ut;c.load(a,{yamlCompatibilityMode:!0});let f=xB(e,s.identHash),p=[];f.push([s.range,p]);let h={status:\"inactive\",userProvided:n,parentDescriptor:s};for(let E of c.dependencies.values())p.push({...h,type:\"Dependency\",descriptor:E});for(let E of c.peerDependencies.values())p.push({...h,type:\"PeerDependency\",descriptor:E});for(let[E,C]of c.peerDependenciesMeta)for(let[S,b]of Object.entries(C))p.push({...h,type:\"PeerDependencyMeta\",selector:E,key:S,value:b})};await this.triggerHook(s=>s.registerPackageExtensions,this,r);for(let[s,a]of this.get(\"packageExtensions\"))r(C0(s,!0),Yk(a),{userProvided:!0});return e}normalizeLocator(e){return cl(e.reference)?Ws(e,`${this.get(\"defaultProtocol\")}${e.reference}`):Mp.test(e.reference)?Ws(e,`${this.get(\"defaultProtocol\")}${e.reference}`):e}normalizeDependency(e){return cl(e.range)?On(e,`${this.get(\"defaultProtocol\")}${e.range}`):Mp.test(e.range)?On(e,`${this.get(\"defaultProtocol\")}${e.range}`):e}normalizeDependencyMap(e){return new Map([...e].map(([r,s])=>[r,this.normalizeDependency(s)]))}normalizePackage(e,{packageExtensions:r}){let s=LB(e),a=r.get(e.identHash);if(typeof a<\"u\"){let c=e.version;if(c!==null){for(let[f,p]of a)if(Xf(c,f))for(let h of p)switch(h.status===\"inactive\"&&(h.status=\"redundant\"),h.type){case\"Dependency\":typeof s.dependencies.get(h.descriptor.identHash)>\"u\"&&(h.status=\"active\",s.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case\"PeerDependency\":typeof s.peerDependencies.get(h.descriptor.identHash)>\"u\"&&(h.status=\"active\",s.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case\"PeerDependencyMeta\":{let E=s.peerDependenciesMeta.get(h.selector);(typeof E>\"u\"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status=\"active\",Yl(s.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:H4(h)}}}let n=c=>c.scope?`${c.scope}__${c.name}`:`${c.name}`;for(let c of s.peerDependenciesMeta.keys()){let f=Sa(c);s.peerDependencies.has(f.identHash)||s.peerDependencies.set(f.identHash,On(f,\"*\"))}for(let c of s.peerDependencies.values()){if(c.scope===\"types\")continue;let f=n(c),p=Da(\"types\",f),h=un(p);s.peerDependencies.has(p.identHash)||s.peerDependenciesMeta.has(h)||s.dependencies.has(p.identHash)||(s.peerDependencies.set(p.identHash,On(p,\"*\")),s.peerDependenciesMeta.set(h,{optional:!0}))}return s.dependencies=new Map(qs(s.dependencies,([,c])=>al(c))),s.peerDependencies=new Map(qs(s.peerDependencies,([,c])=>al(c))),s}getLimit(e){return Yl(this.limits,e,()=>(0,spe.default)(this.get(e)))}async triggerHook(e,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=e(a);n&&await n(...r)}}async triggerMultipleHooks(e,r){for(let s of r)await this.triggerHook(e,...s)}async reduceHook(e,r,...s){let a=r;for(let n of this.plugins.values()){let c=n.hooks;if(!c)continue;let f=e(c);f&&(a=await f(a,...s))}return a}async firstHook(e,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=e(a);if(!n)continue;let c=await n(...r);if(typeof c<\"u\")return c}return null}}});var qr={};Vt(qr,{EndStrategy:()=>Ij,ExecError:()=>IR,PipeError:()=>lv,execvp:()=>uj,pipevp:()=>Wu});function om(t){return t!==null&&typeof t.fd==\"number\"}function mj(){}function yj(){for(let t of am)t.kill()}async function Wu(t,e,{cwd:r,env:s=process.env,strict:a=!1,stdin:n=null,stdout:c,stderr:f,end:p=2}){let h=[\"pipe\",\"pipe\",\"pipe\"];n===null?h[0]=\"ignore\":om(n)&&(h[0]=n),om(c)&&(h[1]=c),om(f)&&(h[2]=f);let E=(0,Ej.default)(t,e,{cwd:fe.fromPortablePath(r),env:{...s,PWD:fe.fromPortablePath(r)},stdio:h});am.add(E),am.size===1&&(process.on(\"SIGINT\",mj),process.on(\"SIGTERM\",yj)),!om(n)&&n!==null&&n.pipe(E.stdin),om(c)||E.stdout.pipe(c,{end:!1}),om(f)||E.stderr.pipe(f,{end:!1});let C=()=>{for(let S of new Set([c,f]))om(S)||S.end()};return new Promise((S,b)=>{E.on(\"error\",I=>{am.delete(E),am.size===0&&(process.off(\"SIGINT\",mj),process.off(\"SIGTERM\",yj)),(p===2||p===1)&&C(),b(I)}),E.on(\"close\",(I,T)=>{am.delete(E),am.size===0&&(process.off(\"SIGINT\",mj),process.off(\"SIGTERM\",yj)),(p===2||p===1&&I!==0)&&C(),I===0||!a?S({code:Cj(I,T)}):b(new lv({fileName:t,code:I,signal:T}))})})}async function uj(t,e,{cwd:r,env:s=process.env,encoding:a=\"utf8\",strict:n=!1}){let c=[\"ignore\",\"pipe\",\"pipe\"],f=[],p=[],h=fe.fromPortablePath(r);typeof s.PWD<\"u\"&&(s={...s,PWD:h});let E=(0,Ej.default)(t,e,{cwd:h,env:s,stdio:c});return E.stdout.on(\"data\",C=>{f.push(C)}),E.stderr.on(\"data\",C=>{p.push(C)}),await new Promise((C,S)=>{E.on(\"error\",b=>{let I=ze.create(r),T=Ht(I,t,ht.PATH);S(new jt(1,`Process ${T} failed to spawn`,N=>{N.reportError(1,`  ${Kf(I,{label:\"Thrown Error\",value:_u(ht.NO_HINT,b.message)})}`)}))}),E.on(\"close\",(b,I)=>{let T=a===\"buffer\"?Buffer.concat(f):Buffer.concat(f).toString(a),N=a===\"buffer\"?Buffer.concat(p):Buffer.concat(p).toString(a);b===0||!n?C({code:Cj(b,I),stdout:T,stderr:N}):S(new IR({fileName:t,code:b,signal:I,stdout:T,stderr:N}))})})}function Cj(t,e){let r=Unt.get(e);return typeof r<\"u\"?128+r:t??1}function _nt(t,e,{configuration:r,report:s}){s.reportError(1,`  ${Kf(r,t!==null?{label:\"Exit Code\",value:_u(ht.NUMBER,t)}:{label:\"Exit Signal\",value:_u(ht.CODE,e)})}`)}var Ej,Ij,lv,IR,am,Unt,gR=Ze(()=>{Dt();Ej=ut(UU());av();Rc();xc();Ij=(s=>(s[s.Never=0]=\"Never\",s[s.ErrorCode=1]=\"ErrorCode\",s[s.Always=2]=\"Always\",s))(Ij||{}),lv=class extends jt{constructor({fileName:e,code:r,signal:s}){let a=ze.create(J.cwd()),n=Ht(a,e,ht.PATH);super(1,`Child ${n} reported an error`,c=>{_nt(r,s,{configuration:a,report:c})}),this.code=Cj(r,s)}},IR=class extends lv{constructor({fileName:e,code:r,signal:s,stdout:a,stderr:n}){super({fileName:e,code:r,signal:s}),this.stdout=a,this.stderr=n}};am=new Set;Unt=new Map([[\"SIGINT\",2],[\"SIGQUIT\",3],[\"SIGKILL\",9],[\"SIGTERM\",15]])});function lpe(t){ape=t}function cv(){return typeof wj>\"u\"&&(wj=ape()),wj}var wj,ape,Bj=Ze(()=>{ape=()=>{throw new Error(\"Assertion failed: No libzip instance is available, and no factory was configured\")}});var cpe=_((CR,Sj)=>{var Hnt=Object.assign({},Ie(\"fs\")),vj=function(){var t=typeof document<\"u\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<\"u\"&&(t=t||__filename),function(e){e=e||{};var r=typeof e<\"u\"?e:{},s,a;r.ready=new Promise(function(Ke,st){s=Ke,a=st});var n={},c;for(c in r)r.hasOwnProperty(c)&&(n[c]=r[c]);var f=[],p=\"./this.program\",h=function(Ke,st){throw st},E=!1,C=!0,S=\"\";function b(Ke){return r.locateFile?r.locateFile(Ke,S):S+Ke}var I,T,N,U;C&&(E?S=Ie(\"path\").dirname(S)+\"/\":S=__dirname+\"/\",I=function(st,St){var lr=Me(st);return lr?St?lr:lr.toString():(N||(N=Hnt),U||(U=Ie(\"path\")),st=U.normalize(st),N.readFileSync(st,St?null:\"utf8\"))},T=function(st){var St=I(st,!0);return St.buffer||(St=new Uint8Array(St)),we(St.buffer),St},process.argv.length>1&&(p=process.argv[1].replace(/\\\\/g,\"/\")),f=process.argv.slice(2),h=function(Ke){process.exit(Ke)},r.inspect=function(){return\"[Emscripten Module object]\"});var W=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(c in n)n.hasOwnProperty(c)&&(r[c]=n[c]);n=null,r.arguments&&(f=r.arguments),r.thisProgram&&(p=r.thisProgram),r.quit&&(h=r.quit);var ie=0,ue=function(Ke){ie=Ke},le;r.wasmBinary&&(le=r.wasmBinary);var me=r.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&ts(\"no native wasm support detected\");function pe(Ke,st,St){switch(st=st||\"i8\",st.charAt(st.length-1)===\"*\"&&(st=\"i32\"),st){case\"i1\":return Ve[Ke>>0];case\"i8\":return Ve[Ke>>0];case\"i16\":return mh((Ke>>1)*2);case\"i32\":return to((Ke>>2)*4);case\"i64\":return to((Ke>>2)*4);case\"float\":return Af((Ke>>2)*4);case\"double\":return dh((Ke>>3)*8);default:ts(\"invalid type for getValue: \"+st)}return null}var Be,Ce=!1,g;function we(Ke,st){Ke||ts(\"Assertion failed: \"+st)}function ye(Ke){var st=r[\"_\"+Ke];return we(st,\"Cannot call unknown function \"+Ke+\", make sure it is exported\"),st}function Ae(Ke,st,St,lr,te){var Ee={string:function(Gi){var Rn=0;if(Gi!=null&&Gi!==0){var Ga=(Gi.length<<2)+1;Rn=wi(Ga),mt(Gi,Rn,Ga)}return Rn},array:function(Gi){var Rn=wi(Gi.length);return Fe(Gi,Rn),Rn}};function Oe(Gi){return st===\"string\"?De(Gi):st===\"boolean\"?!!Gi:Gi}var dt=ye(Ke),Et=[],Pt=0;if(lr)for(var tr=0;tr<lr.length;tr++){var An=Ee[St[tr]];An?(Pt===0&&(Pt=gf()),Et[tr]=An(lr[tr])):Et[tr]=lr[tr]}var li=dt.apply(null,Et);return li=Oe(li),Pt!==0&&fc(Pt),li}function se(Ke,st,St,lr){St=St||[];var te=St.every(function(Oe){return Oe===\"number\"}),Ee=st!==\"string\";return Ee&&te&&!lr?ye(Ke):function(){return Ae(Ke,st,St,arguments,lr)}}var X=new TextDecoder(\"utf8\");function De(Ke,st){if(!Ke)return\"\";for(var St=Ke+st,lr=Ke;!(lr>=St)&&ke[lr];)++lr;return X.decode(ke.subarray(Ke,lr))}function Te(Ke,st,St,lr){if(!(lr>0))return 0;for(var te=St,Ee=St+lr-1,Oe=0;Oe<Ke.length;++Oe){var dt=Ke.charCodeAt(Oe);if(dt>=55296&&dt<=57343){var Et=Ke.charCodeAt(++Oe);dt=65536+((dt&1023)<<10)|Et&1023}if(dt<=127){if(St>=Ee)break;st[St++]=dt}else if(dt<=2047){if(St+1>=Ee)break;st[St++]=192|dt>>6,st[St++]=128|dt&63}else if(dt<=65535){if(St+2>=Ee)break;st[St++]=224|dt>>12,st[St++]=128|dt>>6&63,st[St++]=128|dt&63}else{if(St+3>=Ee)break;st[St++]=240|dt>>18,st[St++]=128|dt>>12&63,st[St++]=128|dt>>6&63,st[St++]=128|dt&63}}return st[St]=0,St-te}function mt(Ke,st,St){return Te(Ke,ke,st,St)}function j(Ke){for(var st=0,St=0;St<Ke.length;++St){var lr=Ke.charCodeAt(St);lr>=55296&&lr<=57343&&(lr=65536+((lr&1023)<<10)|Ke.charCodeAt(++St)&1023),lr<=127?++st:lr<=2047?st+=2:lr<=65535?st+=3:st+=4}return st}function rt(Ke){var st=j(Ke)+1,St=La(st);return St&&Te(Ke,Ve,St,st),St}function Fe(Ke,st){Ve.set(Ke,st)}function Ne(Ke,st){return Ke%st>0&&(Ke+=st-Ke%st),Ke}var be,Ve,ke,it,Ue,x,w,P,y,F;function z(Ke){be=Ke,r.HEAP_DATA_VIEW=F=new DataView(Ke),r.HEAP8=Ve=new Int8Array(Ke),r.HEAP16=it=new Int16Array(Ke),r.HEAP32=x=new Int32Array(Ke),r.HEAPU8=ke=new Uint8Array(Ke),r.HEAPU16=Ue=new Uint16Array(Ke),r.HEAPU32=w=new Uint32Array(Ke),r.HEAPF32=P=new Float32Array(Ke),r.HEAPF64=y=new Float64Array(Ke)}var Z=r.INITIAL_MEMORY||16777216,$,oe=[],xe=[],Re=[],lt=!1;function Ct(){if(r.preRun)for(typeof r.preRun==\"function\"&&(r.preRun=[r.preRun]);r.preRun.length;)bt(r.preRun.shift());Rs(oe)}function qt(){lt=!0,Rs(xe)}function ir(){if(r.postRun)for(typeof r.postRun==\"function\"&&(r.postRun=[r.postRun]);r.postRun.length;)br(r.postRun.shift());Rs(Re)}function bt(Ke){oe.unshift(Ke)}function gn(Ke){xe.unshift(Ke)}function br(Ke){Re.unshift(Ke)}var Ir=0,Or=null,nn=null;function ai(Ke){Ir++,r.monitorRunDependencies&&r.monitorRunDependencies(Ir)}function Io(Ke){if(Ir--,r.monitorRunDependencies&&r.monitorRunDependencies(Ir),Ir==0&&(Or!==null&&(clearInterval(Or),Or=null),nn)){var st=nn;nn=null,st()}}r.preloadedImages={},r.preloadedAudios={};function ts(Ke){r.onAbort&&r.onAbort(Ke),Ke+=\"\",ee(Ke),Ce=!0,g=1,Ke=\"abort(\"+Ke+\"). Build with -s ASSERTIONS=1 for more info.\";var st=new WebAssembly.RuntimeError(Ke);throw a(st),st}var $s=\"data:application/octet-stream;base64,\";function Co(Ke){return Ke.startsWith($s)}var Hi=\"data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AF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FBEAgAacQCSIFRQ0BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAWoiAi0AACACLQABIAAoAnwRAAA2AlQMAQsgAUUNACAAIAFBAWsgACgChAERAgAaCyAAKAKELiAAKAI8IgJBAUZrIgRFDQAgACABIAQgACgCgAERBQAgACAAKAKELiAEazYChC4gACgCPCECCyACQYUCSw0AIAAoAgAoAgRFDQAgACgCMCEBDAELCwJAIAAoAkQiAiAAKAJAIgNNDQAgAAJ/IAAoAjwgACgCaGoiASADSwRAIAAoAkggAWpBACACIAFrIgNBggIgA0GCAkkbIgMQGSABIANqDAELIAFBggJqIgEgA00NASAAKAJIIANqQQAgAiADayICIAEgA2siAyACIANJGyIDEBkgACgCQCADags2AkALC50CAQF/AkAgAAJ/IAAoAqAuIgFBwABGBEAgACgCBCAAKAIQaiAAKQOYLjcAACAAQgA3A5guIAAgACgCEEEIajYCEEEADAELIAFBIE4EQCAAKAIEIAAoAhBqIAApA5guPgAAIAAgAEGcLmo1AgA3A5guIAAgACgCEEEEajYCECAAIAAoAqAuQSBrIgE2AqAuCyABQRBOBEAgACgCBCAAKAIQaiAAKQOYLj0AACAAIAAoAhBBAmo2AhAgACAAKQOYLkIQiDcDmC4gACAAKAKgLkEQayIBNgKgLgsgAUEISA0BIAAgACgCECIBQQFqNgIQIAEgACgCBGogACkDmC48AAAgACAAKQOYLkIIiDcDmC4gACgCoC5BCGsLNgKgLgsLEAAgACgCCBAGIABBADYCCAvwAQECf0F/IQECQCAALQAoDQAgACgCJEEDRgRAIABBDGoEQCAAQQA2AhAgAEEXNgIMC0F/DwsCQCAAKAIgBEAgACkDGELAAINCAFINASAAQQxqBEAgAEEANgIQIABBHTYCDAtBfw8LAkAgACgCACICRQ0AIAIQMkF/Sg0AIAAoAgAhASAAQQxqIgAEQCAAIAEoAgw2AgAgACABKAIQNgIEC0F/DwsgAEEAQgBBABAOQn9VDQAgACgCACIARQ0BIAAQGhpBfw8LQQAhASAAQQA7ATQgAEEMagRAIABCADcCDAsgACAAKAIgQQFqNgIgCyABCzsAIAAtACgEf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A3E7AQxBACEFIANFBEBB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyAFEBwMAgsgA0GjEkGoEiACQYACcSIHG0EEECwgB0UEQCADIAkEf0EtBSABLwEIC0H//wNxEA0LIAMgCQR/QS0FIAE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X8BfgJAAn9BACAARQ0AGiAArUIChiICpyIBIABBBHJBgIAESQ0AGkF/IAEgAkIgiKcbCyIBEAkiAEUNACAAQQRrLQAAQQNxRQ0AIABBACABEBkLIAALQwEDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAXFFDQAgASgCEEF+Rw0AIAEgAkF+cSICNgIAIAINACABECAgAEEANgIECyAAQQA6AAwL1wICBH8BfgJAAkAgACgCQCABp0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wgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJBIGohAiAfQgF9Ih9CAFINAAsLICBC4ABUDQADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggAiABKQA4NwA4IAIgASkAMDcAMCACIAEpACg3ACggAiABKQAgNwAgIAIgASkAWDcAWCACIAEpAFA3AFAgAiABKQBINwBIIAIgASkAQDcAQCACIAEpAGA3AGAgAiABKQBoNwBoIAIgASkAcDcAcCACIAEpAHg3AHggAUGAAWohASACQYABaiECIBpCgAF9IhpCH1YNAAsLIBpCEFoEQCACIAEpAAA3AAAgAiABKQAINwAIIBpCEH0hGiACQRBqIQIgAUEQaiEBCyAaQghaBEAgAiABKQAANwAAIBpCCH0hGiACQQhqIQIgAUEIaiEBCyAaQgRaBEAgAiABKAAANgAAIBpCBH0hGiACQQRqIQIgAUEEaiEBCyAaQgJaBEAgAiABLwAAOwAAIBpCAn0hGiACQQJqIQIgAUECaiEBCyAcIBt9IRwgGlBFBEAgAiABLQAAOgAAIAJBAWohAiABQQFqIQELIBxCAFINAAsLIAUgBmshAUEAIARrIQUCQCAEQQdLBEAgBCEDDAELIAEgBE0EQCAEIQMMAQsgAiAEayEFA0ACQCACIAUpAAA3AAAgBEEBdCEDIAEgBGshASACIARqIQIgBEEDSw0AIAMhBCABIANLDQELC0EAIANrIQULIAIgBWohBAJAIAUgDyACa6wiGiABrSIbIBogG1QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAQLIBAgAWsiCUEBaiIGIAUgBSAGSxshAyABIARrIQIgAUEHcUUNAi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HdkGAAmogB0GAAkkbQYDLAGotAAAiBUECdCIIaiIKLwECaiEGIAozAQAgA62GIAuEIQsgBCAFQQRJBH8gBgUgByAIQYDSAGooAgBrrSAGrYYgC4QhCyAIQcDUAGooAgAgBmoLIgVqIgNBP00EQCALIASthiAMhCELDAELIARBwABGBEAgACgCBCAAKAIQaiAMNwAAIAAgACgCEEEIajYCECAFIQMMAQsgACgCBCAAKAIQaiALIASthiAMhDcAACAAIAAoAhBBCGo2AhAgA0FAaiEDIAtBwAAgBGutiCELCyAAIAs3A5guIAAgAzYCoC4gCSAAKALwLUkNAAsLIAFBgAhqMwEAIQwCQCADIAFBgghqLwEAIgJqIgFBP00EQCAMIAOthiALhCEMDAELIANBwABGBEAgACgCBCAAKAIQaiALNwAAIAAgACgCEEEIajYCECACIQEMAQsgACgCBCAAKAIQaiAMIAOthiALhDcAACAAIAAoAhBBCGo2AhAgAUFAaiEBIAxBwAAgA2utiCEMCyAAIAw3A5guIAAgATYCoC4L8AQBA38gAEHkAWohAgNAIAIgAUECdCIDakEAOwEAIAIgA0EEcmpBADsBACABQQJqIgFBngJHDQALIABBADsBzBUgAEEAOwHYEyAAQZQWakEAOwEAIABBkBZqQQA7AQAgAEGMFmpBADsBACAAQYgWakEAOwEAIABBhBZqQQA7AQAgAEGAFmpBADsBACAAQfwVakEAOwEAIABB+BVqQQA7AQAgAEH0FWpBADsBACAAQfAVakEAOwEAIABB7BVqQQA7AQAgAEHoFWpBADsBACAAQeQVakEAOwEAIABB4BVqQQA7AQAgAEHcFWpBADsBACAAQdgVakEAOwEAIABB1BVqQQA7AQAgAEHQFWpBADsBACAAQcwUakEAOwEAIABByBRqQQA7AQAgAEHEFGpBADsBACAAQcAUakEAOwEAIABBvBRqQQA7AQAgAEG4FGpBADsBACAAQbQUakEAOwEAIABBsBRqQQA7AQAgAEGsFGpBADsBACAAQagUakEAOwEAIABBpBRqQQA7AQAgAEGgFGpBADsBACAAQZwUakEAOwEAIABBmBRqQQA7AQAgAEGUF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CMAsgA0HnADYCIAsCQCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSCABagVBAAsgAygCaCABa0EAEA8gAyADKAJoNgJYIAMoAgAQCiADKAIAKAIQRQ0BC0EBIQQLIAQLDAILAn8CQANAAkACQAJAAkACQCADKAI8Ig1BggJLDQAgAxAvAkAgAygCPCINQYICSw0AIAoNAEEADAgLIA1FDQQgDUECSw0AIAMoAmghCAwBCyADKAJoIghFBEBBACEIDAELIAMoAkggCGoiAUEBayIELQAAIgYgAS0AAEcNACAGIAQtAAJHDQAgBEEDaiEEQQAhCQJAA0AgBiAELQAARw0BIAQtAAEgBkcEQCAJQQFyIQkMAgsgBC0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uacacmlV89OIQxVHWLH85opu2G6anDHPe4rXW6t4PvpeNN5LzsY36i/Q0X7/IjjfLf0cVz0P9fbcGRNiDOv6w+bBTje2M6eWVyVBAofXqKNVCIwrRfpliqTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAK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3J0ZWQgYnkgcHJvdG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w==\";Co(Hi)||(Hi=b(Hi));function eo(Ke){try{if(Ke==Hi&&le)return new Uint8Array(le);var st=Me(Ke);if(st)return st;if(T)return T(Ke);throw\"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)\"}catch(St){ts(St)}}function wo(Ke,st){var St,lr,te;try{te=eo(Ke),lr=new WebAssembly.Module(te),St=new WebAssembly.Instance(lr,st)}catch(Oe){var Ee=Oe.toString();throw ee(\"failed to compile wasm module: \"+Ee),(Ee.includes(\"imported Memory\")||Ee.includes(\"memory import\"))&&ee(\"Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time).\"),Oe}return[St,lr]}function QA(){var Ke={a:cu};function st(te,Ee){var Oe=te.exports;r.asm=Oe,Be=r.asm.g,z(Be.buffer),$=r.asm.W,gn(r.asm.h),Io(\"wasm-instantiate\")}if(ai(\"wasm-instantiate\"),r.instantiateWasm)try{var St=r.instantiateWasm(Ke,st);return St}catch(te){return ee(\"Module.instantiateWasm callback failed with error: \"+te),!1}var lr=wo(Hi,Ke);return st(lr[0]),r.asm}function Af(Ke){return F.getFloat32(Ke,!0)}function dh(Ke){return F.getFloat64(Ke,!0)}function mh(Ke){return F.getInt16(Ke,!0)}function to(Ke){return F.getInt32(Ke,!0)}function jn(Ke,st){F.setInt32(Ke,st,!0)}function Rs(Ke){for(;Ke.length>0;){var st=Ke.shift();if(typeof st==\"function\"){st(r);continue}var St=st.func;typeof St==\"number\"?st.arg===void 0?$.get(St)():$.get(St)(st.arg):St(st.arg===void 0?null:st.arg)}}function ro(Ke,st){var St=new Date(to((Ke>>2)*4)*1e3);jn((st>>2)*4,St.getUTCSeconds()),jn((st+4>>2)*4,St.getUTCMinutes()),jn((st+8>>2)*4,St.getUTCHours()),jn((st+12>>2)*4,St.getUTCDate()),jn((st+16>>2)*4,St.getUTCMonth()),jn((st+20>>2)*4,St.getUTCFullYear()-1900),jn((st+24>>2)*4,St.getUTCDay()),jn((st+36>>2)*4,0),jn((st+32>>2)*4,0);var lr=Date.UTC(St.getUTCFullYear(),0,1,0,0,0,0),te=(St.getTime()-lr)/(1e3*60*60*24)|0;return jn((st+28>>2)*4,te),ro.GMTString||(ro.GMTString=rt(\"GMT\")),jn((st+40>>2)*4,ro.GMTString),st}function ou(Ke,st){return ro(Ke,st)}function au(Ke,st,St){ke.copyWithin(Ke,st,st+St)}function lu(Ke){try{return Be.grow(Ke-be.byteLength+65535>>>16),z(Be.buffer),1}catch{}}function RA(Ke){var st=ke.length;Ke=Ke>>>0;var St=2147483648;if(Ke>St)return!1;for(var lr=1;lr<=4;lr*=2){var te=st*(1+.2/lr);te=Math.min(te,Ke+100663296);var Ee=Math.min(St,Ne(Math.max(Ke,te),65536)),Oe=lu(Ee);if(Oe)return!0}return!1}function TA(Ke){ue(Ke)}function oa(Ke){var st=Date.now()/1e3|0;return Ke&&jn((Ke>>2)*4,st),st}function aa(){if(aa.called)return;aa.called=!0;var Ke=new Date().getFullYear(),st=new Date(Ke,0,1),St=new Date(Ke,6,1),lr=st.getTimezoneOffset(),te=St.getTimezoneOffset(),Ee=Math.max(lr,te);jn((vl()>>2)*4,Ee*60),jn((Is()>>2)*4,+(lr!=te));function Oe(An){var li=An.toTimeString().match(/\\(([A-Za-z ]+)\\)$/);return li?li[1]:\"GMT\"}var dt=Oe(st),Et=Oe(St),Pt=rt(dt),tr=rt(Et);te<lr?(jn((Mi()>>2)*4,Pt),jn((Mi()+4>>2)*4,tr)):(jn((Mi()>>2)*4,tr),jn((Mi()+4>>2)*4,Pt))}function FA(Ke){aa();var st=Date.UTC(to((Ke+20>>2)*4)+1900,to((Ke+16>>2)*4),to((Ke+12>>2)*4),to((Ke+8>>2)*4),to((Ke+4>>2)*4),to((Ke>>2)*4),0),St=new Date(st);jn((Ke+24>>2)*4,St.getUTCDay());var lr=Date.UTC(St.getUTCFullYear(),0,1,0,0,0,0),te=(St.getTime()-lr)/(1e3*60*60*24)|0;return jn((Ke+28>>2)*4,te),St.getTime()/1e3|0}var gr=typeof atob==\"function\"?atob:function(Ke){var st=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",St=\"\",lr,te,Ee,Oe,dt,Et,Pt,tr=0;Ke=Ke.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");do Oe=st.indexOf(Ke.charAt(tr++)),dt=st.indexOf(Ke.charAt(tr++)),Et=st.indexOf(Ke.charAt(tr++)),Pt=st.indexOf(Ke.charAt(tr++)),lr=Oe<<2|dt>>4,te=(dt&15)<<4|Et>>2,Ee=(Et&3)<<6|Pt,St=St+String.fromCharCode(lr),Et!==64&&(St=St+String.fromCharCode(te)),Pt!==64&&(St=St+String.fromCharCode(Ee));while(tr<Ke.length);return St};function Bo(Ke){if(typeof C==\"boolean\"&&C){var st;try{st=Buffer.from(Ke,\"base64\")}catch{st=new Buffer(Ke,\"base64\")}return new Uint8Array(st.buffer,st.byteOffset,st.byteLength)}try{for(var St=gr(Ke),lr=new Uint8Array(St.length),te=0;te<St.length;++te)lr[te]=St.charCodeAt(te);return lr}catch{throw new Error(\"Converting base64 string to bytes failed.\")}}function Me(Ke){if(Co(Ke))return Bo(Ke.slice($s.length))}var cu={e:ou,c:au,d:RA,a:TA,b:oa,f:FA},Cr=QA(),pf=r.___wasm_call_ctors=Cr.h,NA=r._zip_ext_count_symlinks=Cr.i,OA=r._zip_file_get_external_attributes=Cr.j,uu=r._zipstruct_statS=Cr.k,fu=r._zipstruct_stat_size=Cr.l,oc=r._zipstruct_stat_mtime=Cr.m,ve=r._zipstruct_stat_crc=Cr.n,Nt=r._zipstruct_errorS=Cr.o,ac=r._zipstruct_error_code_zip=Cr.p,Oi=r._zipstruct_stat_comp_size=Cr.q,no=r._zipstruct_stat_comp_method=Cr.r,Tt=r._zip_close=Cr.s,xn=r._zip_delete=Cr.t,la=r._zip_dir_add=Cr.u,ji=r._zip_discard=Cr.v,Li=r._zip_error_init_with_code=Cr.w,Na=r._zip_get_error=Cr.x,dn=r._zip_file_get_error=Cr.y,Kn=r._zip_error_strerror=Cr.z,Au=r._zip_fclose=Cr.A,yh=r._zip_file_add=Cr.B,Oa=r._free=Cr.C,La=r._malloc=Cr.D,Ma=r._zip_source_error=Cr.E,$e=r._zip_source_seek=Cr.F,Ua=r._zip_file_set_external_attributes=Cr.G,hf=r._zip_file_set_mtime=Cr.H,lc=r._zip_fopen_index=Cr.I,wn=r._zip_fread=Cr.J,ca=r._zip_get_name=Cr.K,LA=r._zip_get_num_entries=Cr.L,MA=r._zip_source_read=Cr.M,ua=r._zip_name_locate=Cr.N,Bl=r._zip_open_from_source=Cr.O,Mt=r._zip_set_file_compression=Cr.P,kn=r._zip_source_buffer=Cr.Q,fa=r._zip_source_buffer_create=Cr.R,Ha=r._zip_source_close=Cr.S,rs=r._zip_source_free=Cr.T,cc=r._zip_source_keep=Cr.U,pu=r._zip_source_open=Cr.V,uc=r._zip_source_tell=Cr.X,ja=r._zip_stat_index=Cr.Y,Mi=r.__get_tzname=Cr.Z,Is=r.__get_daylight=Cr._,vl=r.__get_timezone=Cr.$,gf=r.stackSave=Cr.aa,fc=r.stackRestore=Cr.ba,wi=r.stackAlloc=Cr.ca;r.cwrap=se,r.getValue=pe;var Qn;nn=function Ke(){Qn||Ac(),Qn||(nn=Ke)};function Ac(Ke){if(Ke=Ke||f,Ir>0||(Ct(),Ir>0))return;function st(){Qn||(Qn=!0,r.calledRun=!0,!Ce&&(qt(),s(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),ir()))}r.setStatus?(r.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){r.setStatus(\"\")},1),st()},1)):st()}if(r.run=Ac,r.preInit)for(typeof r.preInit==\"function\"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Ac(),e}}();typeof CR==\"object\"&&typeof Sj==\"object\"?Sj.exports=vj:typeof define==\"function\"&&define.amd?define([],function(){return vj}):typeof CR==\"object\"&&(CR.createModule=vj)});var Up,upe,fpe,Ape=Ze(()=>{Up=[\"number\",\"number\"],upe=(X=>(X[X.ZIP_ER_OK=0]=\"ZIP_ER_OK\",X[X.ZIP_ER_MULTIDISK=1]=\"ZIP_ER_MULTIDISK\",X[X.ZIP_ER_RENAME=2]=\"ZIP_ER_RENAME\",X[X.ZIP_ER_CLOSE=3]=\"ZIP_ER_CLOSE\",X[X.ZIP_ER_SEEK=4]=\"ZIP_ER_SEEK\",X[X.ZIP_ER_READ=5]=\"ZIP_ER_READ\",X[X.ZIP_ER_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{}),fpe=t=>({get HEAPU8(){return t.HEAPU8},errors:upe,SEEK_SET:0,SEEK_CUR:1,SEEK_END:2,ZIP_CHECKCONS:4,ZIP_EXCL:2,ZIP_RDONLY:16,ZIP_FL_OVERWRITE:8192,ZIP_FL_COMPRESSED:4,ZIP_OPSYS_DOS:0,ZIP_OPSYS_AMIGA:1,ZIP_OPSYS_OPENVMS:2,ZIP_OPSYS_UNIX:3,ZIP_OPSYS_VM_CMS:4,ZIP_OPSYS_ATARI_ST:5,ZIP_OPSYS_OS_2:6,ZIP_OPSYS_MACINTOSH:7,ZIP_OPSYS_Z_SYSTEM:8,ZIP_OPSYS_CPM:9,ZIP_OPSYS_WINDOWS_NTFS:10,ZIP_OPSYS_MVS:11,ZIP_OPSYS_VSE:12,ZIP_OPSYS_ACORN_RISC:13,ZIP_OPSYS_VFAT:14,ZIP_OPSYS_ALTERNATE_MVS:15,ZIP_OPSYS_BEOS:16,ZIP_OPSYS_TANDEM:17,ZIP_OPSYS_OS_400:18,ZIP_OPSYS_OS_X:19,ZIP_CM_DEFAULT:-1,ZIP_CM_STORE:0,ZIP_CM_DEFLATE:8,uint08S:t._malloc(1),uint32S:t._malloc(4),malloc:t._malloc,free:t._free,getValue:t.getValue,openFromSource:t.cwrap(\"zip_open_from_source\",\"number\",[\"number\",\"number\",\"number\"]),close:t.cwrap(\"zip_close\",\"number\",[\"number\"]),discard:t.cwrap(\"zip_discard\",null,[\"number\"]),getError:t.cwrap(\"zip_get_error\",\"number\",[\"number\"]),getName:t.cwrap(\"zip_get_name\",\"string\",[\"number\",\"number\",\"number\"]),getNumEntries:t.cwrap(\"zip_get_num_entries\",\"number\",[\"number\",\"number\"]),delete:t.cwrap(\"zip_delete\",\"number\",[\"number\",\"number\"]),statIndex:t.cwrap(\"zip_stat_index\",\"number\",[\"number\",...Up,\"number\",\"number\"]),fopenIndex:t.cwrap(\"zip_fopen_index\",\"number\",[\"number\",...Up,\"number\"]),fread:t.cwrap(\"zip_fread\",\"number\",[\"number\",\"number\",\"number\",\"number\"]),fclose:t.cwrap(\"zip_fclose\",\"number\",[\"number\"]),dir:{add:t.cwrap(\"zip_dir_add\",\"number\",[\"number\",\"string\"])},file:{add:t.cwrap(\"zip_file_add\",\"number\",[\"number\",\"string\",\"number\",\"number\"]),getError:t.cwrap(\"zip_file_get_error\",\"number\",[\"number\"]),getExternalAttributes:t.cwrap(\"zip_file_get_external_attributes\",\"number\",[\"number\",...Up,\"number\",\"number\",\"number\"]),setExternalAttributes:t.cwrap(\"zip_file_set_external_attributes\",\"number\",[\"number\",...Up,\"number\",\"number\",\"number\"]),setMtime:t.cwrap(\"zip_file_set_mtime\",\"number\",[\"number\",...Up,\"number\",\"number\"]),setCompression:t.cwrap(\"zip_set_file_compression\",\"number\",[\"number\",...Up,\"number\",\"number\"])},ext:{countSymlinks:t.cwrap(\"zip_ext_count_symlinks\",\"number\",[\"number\"])},error:{initWithCode:t.cwrap(\"zip_error_init_with_code\",null,[\"number\",\"number\"]),strerror:t.cwrap(\"zip_error_strerror\",\"string\",[\"number\"])},name:{locate:t.cwrap(\"zip_name_locate\",\"number\",[\"number\",\"string\",\"number\"])},source:{fromUnattachedBuffer:t.cwrap(\"zip_source_buffer_create\",\"number\",[\"number\",...Up,\"number\",\"number\"]),fromBuffer:t.cwrap(\"zip_source_buffer\",\"number\",[\"number\",\"number\",...Up,\"number\"]),free:t.cwrap(\"zip_source_free\",null,[\"number\"]),keep:t.cwrap(\"zip_source_keep\",null,[\"number\"]),open:t.cwrap(\"zip_source_open\",\"number\",[\"number\"]),close:t.cwrap(\"zip_source_close\",\"number\",[\"number\"]),seek:t.cwrap(\"zip_source_seek\",\"number\",[\"number\",...Up,\"number\"]),tell:t.cwrap(\"zip_source_tell\",\"number\",[\"number\"]),read:t.cwrap(\"zip_source_read\",\"number\",[\"number\",\"number\",\"number\"]),error:t.cwrap(\"zip_source_error\",\"number\",[\"number\"])},struct:{statS:t.cwrap(\"zipstruct_statS\",\"number\",[]),statSize:t.cwrap(\"zipstruct_stat_size\",\"number\",[\"number\"]),statCompSize:t.cwrap(\"zipstruct_stat_comp_size\",\"number\",[\"number\"]),statCompMethod:t.cwrap(\"zipstruct_stat_comp_method\",\"number\",[\"number\"]),statMtime:t.cwrap(\"zipstruct_stat_mtime\",\"number\",[\"number\"]),statCrc:t.cwrap(\"zipstruct_stat_crc\",\"number\",[\"number\"]),errorS:t.cwrap(\"zipstruct_errorS\",\"number\",[]),errorCodeZip:t.cwrap(\"zipstruct_error_code_zip\",\"number\",[\"number\"])}})});function Dj(t,e){let r=t.indexOf(e);if(r<=0)return null;let s=r;for(;r>=0&&(s=r+e.length,t[s]!==J.sep);){if(t[r-1]===J.sep)return null;r=t.indexOf(e,s)}return t.length>s&&t[s]!==J.sep?null:t.slice(0,s)}var $f,ppe=Ze(()=>{Dt();Dt();eA();$f=class t extends e0{static async openPromise(e,r){let s=new t(r);try{return await e(s)}finally{s.saveAndClose()}}constructor(e={}){let r=e.fileExtensions,s=e.readOnlyArchives,a=typeof r>\"u\"?f=>Dj(f,\".zip\"):f=>{for(let p of r){let h=Dj(f,p);if(h)return h}return null},n=(f,p)=>new As(p,{baseFs:f,readOnly:s,stats:f.statSync(p),customZipImplementation:e.customZipImplementation}),c=async(f,p)=>{let h={baseFs:f,readOnly:s,stats:await f.statPromise(p),customZipImplementation:e.customZipImplementation};return()=>new As(p,h)};super({...e,factorySync:n,factoryPromise:c,getMountPoint:a})}}});var Pj,BI,bj=Ze(()=>{Bj();Pj=class extends Error{constructor(e,r){super(e),this.name=\"Libzip Error\",this.code=r}},BI=class{constructor(e){this.filesShouldBeCached=!0;let r=\"buffer\"in e?e.buffer:e.baseFs.readFileSync(e.path);this.libzip=cv();let s=this.libzip.malloc(4);try{let c=0;e.readOnly&&(c|=this.libzip.ZIP_RDONLY);let f=this.allocateUnattachedSource(r);try{this.zip=this.libzip.openFromSource(f,c,s),this.lzSource=f}catch(p){throw this.libzip.source.free(f),p}if(this.zip===0){let p=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(p,this.libzip.getValue(s,\"i32\")),this.makeLibzipError(p)}}finally{this.libzip.free(s)}let a=this.libzip.getNumEntries(this.zip,0),n=new Array(a);for(let c=0;c<a;++c)n[c]=this.libzip.getName(this.zip,c,0);if(this.listings=n,this.symlinkCount=this.libzip.ext.countSymlinks(this.zip),this.symlinkCount===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}getSymlinkCount(){return this.symlinkCount}getListings(){return this.listings}stat(e){let r=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.libzip.struct.statSize(r)>>>0,n=this.libzip.struct.statMtime(r)>>>0,c=this.libzip.struct.statCrc(r)>>>0;return{size:a,mtime:n,crc:c}}makeLibzipError(e){let r=this.libzip.struct.errorCodeZip(e),s=this.libzip.error.strerror(e),a=new Pj(s,this.libzip.errors[r]);if(r===this.libzip.errors.ZIP_ER_CHANGED)throw new Error(`Assertion failed: Unexpected libzip error: ${a.message}`);return a}setFileSource(e,r,s){let a=this.allocateSource(s);try{let n=this.libzip.file.add(this.zip,e,a,this.libzip.ZIP_FL_OVERWRITE);if(n===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(r!==null&&this.libzip.file.setCompression(this.zip,n,0,r[0],r[1])===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return n}catch(n){throw this.libzip.source.free(a),n}}setMtime(e,r){if(this.libzip.file.setMtime(this.zip,e,0,r,0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}getExternalAttributes(e){if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let s=this.libzip.getValue(this.libzip.uint08S,\"i8\")>>>0,a=this.libzip.getValue(this.libzip.uint32S,\"i32\")>>>0;return[s,a]}setExternalAttributes(e,r,s){if(this.libzip.file.setExternalAttributes(this.zip,e,0,0,r,s)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}locate(e){return this.libzip.name.locate(this.zip,e,0)}getFileSource(e){let r=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.libzip.struct.statCompSize(r),n=this.libzip.struct.statCompMethod(r),c=this.libzip.malloc(a);try{let f=this.libzip.fopenIndex(this.zip,e,0,this.libzip.ZIP_FL_COMPRESSED);if(f===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let p=this.libzip.fread(f,c,a,0);if(p===-1)throw this.makeLibzipError(this.libzip.file.getError(f));if(p<a)throw new Error(\"Incomplete read\");if(p>a)throw new Error(\"Overread\");let h=this.libzip.HEAPU8.subarray(c,c+a);return{data:Buffer.from(h),compressionMethod:n}}finally{this.libzip.fclose(f)}}finally{this.libzip.free(c)}}deleteEntry(e){if(this.libzip.delete(this.zip,e)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}addDirectory(e){let r=this.libzip.dir.add(this.zip,e);if(r===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return r}getBufferAndClose(){try{if(this.libzip.source.keep(this.lzSource),this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.libzip.source.open(this.lzSource)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(this.libzip.source.seek(this.lzSource,0,0,this.libzip.SEEK_END)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));let e=this.libzip.source.tell(this.lzSource);if(e===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(this.libzip.source.seek(this.lzSource,0,0,this.libzip.SEEK_SET)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));let r=this.libzip.malloc(e);if(!r)throw new Error(\"Couldn't allocate enough memory\");try{let s=this.libzip.source.read(this.lzSource,r,e);if(s===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(s<e)throw new Error(\"Incomplete read\");if(s>e)throw new Error(\"Overread\");let a=Buffer.from(this.libzip.HEAPU8.subarray(r,r+e));return process.env.YARN_IS_TEST_ENV&&process.env.YARN_ZIP_DATA_EPILOGUE&&(a=Buffer.concat([a,Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)])),a}finally{this.libzip.free(r)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource)}}allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));let r=this.libzip.malloc(e.byteLength);if(!r)throw new Error(\"Couldn't allocate enough memory\");return new Uint8Array(this.libzip.HEAPU8.buffer,r,e.byteLength).set(e),{buffer:r,byteLength:e.byteLength}}allocateUnattachedSource(e){let r=this.libzip.struct.errorS(),{buffer:s,byteLength:a}=this.allocateBuffer(e),n=this.libzip.source.fromUnattachedBuffer(s,a,0,1,r);if(n===0)throw this.libzip.free(r),this.makeLibzipError(r);return n}allocateSource(e){let{buffer:r,byteLength:s}=this.allocateBuffer(e),a=this.libzip.source.fromBuffer(this.zip,r,s,0,1);if(a===0)throw this.libzip.free(r),this.makeLibzipError(this.libzip.getError(this.zip));return a}discard(){this.libzip.discard(this.zip)}}});function jnt(t){if(typeof t==\"string\"&&String(+t)===t)return+t;if(typeof t==\"number\"&&Number.isFinite(t))return t<0?Date.now()/1e3:t;if(hpe.types.isDate(t))return t.getTime()/1e3;throw new Error(\"Invalid time\")}function wR(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var xa,xj,hpe,kj,lm,Qj,Rj,gpe,As,BR=Ze(()=>{Dt();Dt();Dt();Dt();Dt();Dt();xa=Ie(\"fs\"),xj=Ie(\"stream\"),hpe=Ie(\"util\"),kj=ut(Ie(\"zlib\"));bj();lm=3,Qj=0,Rj=8,gpe=\"mixed\";As=class extends Uf{constructor(r,s={}){super();this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;s.readOnly&&(this.readOnly=!0);let a=s;this.level=typeof a.level<\"u\"?a.level:gpe;let n=s.customZipImplementation??BI;if(typeof r==\"string\"){let{baseFs:f=new Yn}=a;this.baseFs=f,this.path=r}else this.path=null,this.baseFs=null;if(s.stats)this.stats=s.stats;else if(typeof r==\"string\")try{this.stats=this.baseFs.statSync(r)}catch(f){if(f.code===\"ENOENT\"&&a.create)this.stats=$a.makeDefaultStats();else throw f}else this.stats=$a.makeDefaultStats();typeof r==\"string\"?s.create?this.zipImpl=new n({buffer:wR(),readOnly:this.readOnly}):this.zipImpl=new n({path:r,baseFs:this.baseFs,readOnly:this.readOnly,size:this.stats.size}):this.zipImpl=new n({buffer:r??wR(),readOnly:this.readOnly}),this.listings.set(vt.root,new Set);let c=this.zipImpl.getListings();for(let f=0;f<c.length;f++){let p=c[f];if(J.isAbsolute(p))continue;let h=J.resolve(vt.root,p);this.registerEntry(h,f),p.endsWith(\"/\")&&this.registerListing(h)}this.symlinkCount=this.zipImpl.getSymlinkCount(),this.ready=!0}getExtractHint(r){for(let s of this.entries.keys()){let a=this.pathUtils.extname(s);if(r.relevantExtensions.has(a))return!0}return!1}getAllFiles(){return Array.from(this.entries.keys())}getRealPath(){if(!this.path)throw new Error(\"ZipFS don't have real paths when loaded from a buffer\");return this.path}prepareClose(){if(!this.ready)throw or.EBUSY(\"archive closed, close\");yd(this)}getBufferAndClose(){if(this.prepareClose(),this.entries.size===0)return this.discardAndClose(),wR();try{return this.zipImpl.getBufferAndClose()}finally{this.ready=!1}}discardAndClose(){this.prepareClose(),this.zipImpl.discard(),this.ready=!1}saveAndClose(){if(!this.path||!this.baseFs)throw new Error(\"ZipFS cannot be saved and must be discarded when loaded from a buffer\");if(this.readOnly){this.discardAndClose();return}let r=this.baseFs.existsSync(this.path)||this.stats.mode===$a.DEFAULT_MODE?void 0:this.stats.mode;this.baseFs.writeFileSync(this.path,this.getBufferAndClose(),{mode:r}),this.ready=!1}resolve(r){return J.resolve(vt.root,r)}async openPromise(r,s,a){return this.openSync(r,s,a)}openSync(r,s,a){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:r}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(r,s){return this.opendirSync(r,s)}opendirSync(r,s={}){let a=this.resolveFilename(`opendir '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`opendir '${r}'`);let n=this.listings.get(a);if(!n)throw or.ENOTDIR(`opendir '${r}'`);let c=[...n],f=this.openSync(a,\"r\");return ex(this,a,c,{onClose:()=>{this.closeSync(f)}})}async readPromise(r,s,a,n,c){return this.readSync(r,s,a,n,c)}readSync(r,s,a=0,n=s.byteLength,c=-1){let f=this.fds.get(r);if(typeof f>\"u\")throw or.EBADF(\"read\");let p=c===-1||c===null?f.cursor:c,h=this.readFileSync(f.p);h.copy(s,a,p,p+n);let E=Math.max(0,Math.min(h.length-p,n));return(c===-1||c===null)&&(f.cursor+=E),E}async writePromise(r,s,a,n,c){return typeof s==\"string\"?this.writeSync(r,s,c):this.writeSync(r,s,a,n,c)}writeSync(r,s,a,n,c){throw typeof this.fds.get(r)>\"u\"?or.EBADF(\"read\"):new Error(\"Unimplemented\")}async closePromise(r){return this.closeSync(r)}closeSync(r){if(typeof this.fds.get(r)>\"u\")throw or.EBADF(\"read\");this.fds.delete(r)}createReadStream(r,{encoding:s}={}){if(r===null)throw new Error(\"Unimplemented\");let a=this.openSync(r,\"r\"),n=Object.assign(new xj.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(f,p)=>{clearImmediate(c),this.closeSync(a),p(f)}}),{close(){n.destroy()},bytesRead:0,path:r,pending:!1}),c=setImmediate(async()=>{try{let f=await this.readFilePromise(r,s);n.bytesRead=f.length,n.end(f)}catch(f){n.destroy(f)}});return n}createWriteStream(r,{encoding:s}={}){if(this.readOnly)throw or.EROFS(`open '${r}'`);if(r===null)throw new Error(\"Unimplemented\");let a=[],n=this.openSync(r,\"w\"),c=Object.assign(new xj.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(f,p)=>{try{f?p(f):(this.writeFileSync(r,Buffer.concat(a),s),p(null))}catch(h){p(h)}finally{this.closeSync(n)}}}),{close(){c.destroy()},bytesWritten:0,path:r,pending:!1});return c.on(\"data\",f=>{let p=Buffer.from(f);c.bytesWritten+=p.length,a.push(p)}),c}async realpathPromise(r){return this.realpathSync(r)}realpathSync(r){let s=this.resolveFilename(`lstat '${r}'`,r);if(!this.entries.has(s)&&!this.listings.has(s))throw or.ENOENT(`lstat '${r}'`);return s}async existsPromise(r){return this.existsSync(r)}existsSync(r){if(!this.ready)throw or.EBUSY(`archive closed, existsSync '${r}'`);if(this.symlinkCount===0){let a=J.resolve(vt.root,r);return this.entries.has(a)||this.listings.has(a)}let s;try{s=this.resolveFilename(`stat '${r}'`,r,void 0,!1)}catch{return!1}return s===void 0?!1:this.entries.has(s)||this.listings.has(s)}async accessPromise(r,s){return this.accessSync(r,s)}accessSync(r,s=xa.constants.F_OK){let a=this.resolveFilename(`access '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`access '${r}'`);if(this.readOnly&&s&xa.constants.W_OK)throw or.EROFS(`access '${r}'`)}async statPromise(r,s={bigint:!1}){return s.bigint?this.statSync(r,{bigint:!0}):this.statSync(r)}statSync(r,s={bigint:!1,throwIfNoEntry:!0}){let a=this.resolveFilename(`stat '${r}'`,r,void 0,s.throwIfNoEntry);if(a!==void 0){if(!this.entries.has(a)&&!this.listings.has(a)){if(s.throwIfNoEntry===!1)return;throw or.ENOENT(`stat '${r}'`)}if(r[r.length-1]===\"/\"&&!this.listings.has(a))throw or.ENOTDIR(`stat '${r}'`);return this.statImpl(`stat '${r}'`,a,s)}}async fstatPromise(r,s){return this.fstatSync(r,s)}fstatSync(r,s){let a=this.fds.get(r);if(typeof a>\"u\")throw or.EBADF(\"fstatSync\");let{p:n}=a,c=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(c)&&!this.listings.has(c))throw or.ENOENT(`stat '${n}'`);if(n[n.length-1]===\"/\"&&!this.listings.has(c))throw or.ENOTDIR(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,c,s)}async lstatPromise(r,s={bigint:!1}){return s.bigint?this.lstatSync(r,{bigint:!0}):this.lstatSync(r)}lstatSync(r,s={bigint:!1,throwIfNoEntry:!0}){let a=this.resolveFilename(`lstat '${r}'`,r,!1,s.throwIfNoEntry);if(a!==void 0){if(!this.entries.has(a)&&!this.listings.has(a)){if(s.throwIfNoEntry===!1)return;throw or.ENOENT(`lstat '${r}'`)}if(r[r.length-1]===\"/\"&&!this.listings.has(a))throw or.ENOTDIR(`lstat '${r}'`);return this.statImpl(`lstat '${r}'`,a,s)}}statImpl(r,s,a={}){let n=this.entries.get(s);if(typeof n<\"u\"){let c=this.zipImpl.stat(n),f=c.crc,p=c.size,h=c.mtime*1e3,E=this.stats.uid,C=this.stats.gid,S=512,b=Math.ceil(c.size/S),I=h,T=h,N=h,U=new Date(I),W=new Date(T),ee=new Date(N),ie=new Date(h),ue=this.listings.has(s)?xa.constants.S_IFDIR:this.isSymbolicLink(n)?xa.constants.S_IFLNK:xa.constants.S_IFREG,le=ue===xa.constants.S_IFDIR?493:420,me=ue|this.getUnixMode(n,le)&511,pe=Object.assign(new $a.StatEntry,{uid:E,gid:C,size:p,blksize:S,blocks:b,atime:U,birthtime:W,ctime:ee,mtime:ie,atimeMs:I,birthtimeMs:T,ctimeMs:N,mtimeMs:h,mode:me,crc:f});return a.bigint===!0?$a.convertToBigIntStats(pe):pe}if(this.listings.has(s)){let c=this.stats.uid,f=this.stats.gid,p=0,h=512,E=0,C=this.stats.mtimeMs,S=this.stats.mtimeMs,b=this.stats.mtimeMs,I=this.stats.mtimeMs,T=new Date(C),N=new Date(S),U=new Date(b),W=new Date(I),ee=xa.constants.S_IFDIR|493,ue=Object.assign(new $a.StatEntry,{uid:c,gid:f,size:p,blksize:h,blocks:E,atime:T,birthtime:N,ctime:U,mtime:W,atimeMs:C,birthtimeMs:S,ctimeMs:b,mtimeMs:I,mode:ee,crc:0});return a.bigint===!0?$a.convertToBigIntStats(ue):ue}throw new Error(\"Unreachable\")}getUnixMode(r,s){let[a,n]=this.zipImpl.getExternalAttributes(r);return a!==lm?s:n>>>16}registerListing(r){let s=this.listings.get(r);if(s)return s;this.registerListing(J.dirname(r)).add(J.basename(r));let n=new Set;return this.listings.set(r,n),n}registerEntry(r,s){this.registerListing(J.dirname(r)).add(J.basename(r)),this.entries.set(r,s)}unregisterListing(r){this.listings.delete(r),this.listings.get(J.dirname(r))?.delete(J.basename(r))}unregisterEntry(r){this.unregisterListing(r);let s=this.entries.get(r);this.entries.delete(r),!(typeof s>\"u\")&&(this.fileSources.delete(s),this.isSymbolicLink(s)&&this.symlinkCount--)}deleteEntry(r,s){this.unregisterEntry(r),this.zipImpl.deleteEntry(s)}resolveFilename(r,s,a=!0,n=!0){if(!this.ready)throw or.EBUSY(`archive closed, ${r}`);let c=J.resolve(vt.root,s);if(c===\"/\")return vt.root;let f=this.entries.get(c);if(a&&f!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(f)){let p=this.getFileSource(f).toString();return this.resolveFilename(r,J.resolve(J.dirname(c),p),!0,n)}else return c;for(;;){let p=this.resolveFilename(r,J.dirname(c),!0,n);if(p===void 0)return p;let h=this.listings.has(p),E=this.entries.has(p);if(!h&&!E){if(n===!1)return;throw or.ENOENT(r)}if(!h)throw or.ENOTDIR(r);if(c=J.resolve(p,J.basename(c)),!a||this.symlinkCount===0)break;let C=this.zipImpl.locate(c.slice(1));if(C===-1)break;if(this.isSymbolicLink(C)){let S=this.getFileSource(C).toString();c=J.resolve(J.dirname(c),S)}else break}return c}setFileSource(r,s){let a=Buffer.isBuffer(s)?s:Buffer.from(s),n=J.relative(vt.root,r),c=null;this.level!==\"mixed\"&&(c=[this.level===0?Qj:Rj,this.level]);let f=this.zipImpl.setFileSource(n,c,a);return this.fileSources.set(f,a),f}isSymbolicLink(r){if(this.symlinkCount===0)return!1;let[s,a]=this.zipImpl.getExternalAttributes(r);return s!==lm?!1:(a>>>16&xa.constants.S_IFMT)===xa.constants.S_IFLNK}getFileSource(r,s={asyncDecompress:!1}){let a=this.fileSources.get(r);if(typeof a<\"u\")return a;let{data:n,compressionMethod:c}=this.zipImpl.getFileSource(r);if(c===Qj)return this.zipImpl.filesShouldBeCached&&this.fileSources.set(r,n),n;if(c===Rj){if(s.asyncDecompress)return new Promise((f,p)=>{kj.default.inflateRaw(n,(h,E)=>{h?p(h):(this.zipImpl.filesShouldBeCached&&this.fileSources.set(r,E),f(E))})});{let f=kj.default.inflateRawSync(n);return this.zipImpl.filesShouldBeCached&&this.fileSources.set(r,f),f}}else throw new Error(`Unsupported compression method: ${c}`)}async fchmodPromise(r,s){return this.chmodPromise(this.fdToPath(r,\"fchmod\"),s)}fchmodSync(r,s){return this.chmodSync(this.fdToPath(r,\"fchmodSync\"),s)}async chmodPromise(r,s){return this.chmodSync(r,s)}chmodSync(r,s){if(this.readOnly)throw or.EROFS(`chmod '${r}'`);s&=493;let a=this.resolveFilename(`chmod '${r}'`,r,!1),n=this.entries.get(a);if(typeof n>\"u\")throw new Error(`Assertion failed: The entry should have been registered (${a})`);let f=this.getUnixMode(n,xa.constants.S_IFREG|0)&-512|s;this.zipImpl.setExternalAttributes(n,lm,f<<16)}async fchownPromise(r,s,a){return this.chownPromise(this.fdToPath(r,\"fchown\"),s,a)}fchownSync(r,s,a){return this.chownSync(this.fdToPath(r,\"fchownSync\"),s,a)}async chownPromise(r,s,a){return this.chownSync(r,s,a)}chownSync(r,s,a){throw new Error(\"Unimplemented\")}async renamePromise(r,s){return this.renameSync(r,s)}renameSync(r,s){throw new Error(\"Unimplemented\")}async copyFilePromise(r,s,a){let{indexSource:n,indexDest:c,resolvedDestP:f}=this.prepareCopyFile(r,s,a),p=await this.getFileSource(n,{asyncDecompress:!0}),h=this.setFileSource(f,p);h!==c&&this.registerEntry(f,h)}copyFileSync(r,s,a=0){let{indexSource:n,indexDest:c,resolvedDestP:f}=this.prepareCopyFile(r,s,a),p=this.getFileSource(n),h=this.setFileSource(f,p);h!==c&&this.registerEntry(f,h)}prepareCopyFile(r,s,a=0){if(this.readOnly)throw or.EROFS(`copyfile '${r} -> '${s}'`);if(a&xa.constants.COPYFILE_FICLONE_FORCE)throw or.ENOSYS(\"unsupported clone operation\",`copyfile '${r}' -> ${s}'`);let n=this.resolveFilename(`copyfile '${r} -> ${s}'`,r),c=this.entries.get(n);if(typeof c>\"u\")throw or.EINVAL(`copyfile '${r}' -> '${s}'`);let f=this.resolveFilename(`copyfile '${r}' -> ${s}'`,s),p=this.entries.get(f);if(a&(xa.constants.COPYFILE_EXCL|xa.constants.COPYFILE_FICLONE_FORCE)&&typeof p<\"u\")throw or.EEXIST(`copyfile '${r}' -> '${s}'`);return{indexSource:c,resolvedDestP:f,indexDest:p}}async appendFilePromise(r,s,a){if(this.readOnly)throw or.EROFS(`open '${r}'`);return typeof a>\"u\"?a={flag:\"a\"}:typeof a==\"string\"?a={flag:\"a\",encoding:a}:typeof a.flag>\"u\"&&(a={flag:\"a\",...a}),this.writeFilePromise(r,s,a)}appendFileSync(r,s,a={}){if(this.readOnly)throw or.EROFS(`open '${r}'`);return typeof a>\"u\"?a={flag:\"a\"}:typeof a==\"string\"?a={flag:\"a\",encoding:a}:typeof a.flag>\"u\"&&(a={flag:\"a\",...a}),this.writeFileSync(r,s,a)}fdToPath(r,s){let a=this.fds.get(r)?.p;if(typeof a>\"u\")throw or.EBADF(s);return a}async writeFilePromise(r,s,a){let{encoding:n,mode:c,index:f,resolvedP:p}=this.prepareWriteFile(r,a);f!==void 0&&typeof a==\"object\"&&a.flag&&a.flag.includes(\"a\")&&(s=Buffer.concat([await this.getFileSource(f,{asyncDecompress:!0}),Buffer.from(s)])),n!==null&&(s=s.toString(n));let h=this.setFileSource(p,s);h!==f&&this.registerEntry(p,h),c!==null&&await this.chmodPromise(p,c)}writeFileSync(r,s,a){let{encoding:n,mode:c,index:f,resolvedP:p}=this.prepareWriteFile(r,a);f!==void 0&&typeof a==\"object\"&&a.flag&&a.flag.includes(\"a\")&&(s=Buffer.concat([this.getFileSource(f),Buffer.from(s)])),n!==null&&(s=s.toString(n));let h=this.setFileSource(p,s);h!==f&&this.registerEntry(p,h),c!==null&&this.chmodSync(p,c)}prepareWriteFile(r,s){if(typeof r==\"number\"&&(r=this.fdToPath(r,\"read\")),this.readOnly)throw or.EROFS(`open '${r}'`);let a=this.resolveFilename(`open '${r}'`,r);if(this.listings.has(a))throw or.EISDIR(`open '${r}'`);let n=null,c=null;typeof s==\"string\"?n=s:typeof s==\"object\"&&({encoding:n=null,mode:c=null}=s);let f=this.entries.get(a);return{encoding:n,mode:c,resolvedP:a,index:f}}async unlinkPromise(r){return this.unlinkSync(r)}unlinkSync(r){if(this.readOnly)throw or.EROFS(`unlink '${r}'`);let s=this.resolveFilename(`unlink '${r}'`,r);if(this.listings.has(s))throw or.EISDIR(`unlink '${r}'`);let a=this.entries.get(s);if(typeof a>\"u\")throw or.EINVAL(`unlink '${r}'`);this.deleteEntry(s,a)}async utimesPromise(r,s,a){return this.utimesSync(r,s,a)}utimesSync(r,s,a){if(this.readOnly)throw or.EROFS(`utimes '${r}'`);let n=this.resolveFilename(`utimes '${r}'`,r);this.utimesImpl(n,a)}async lutimesPromise(r,s,a){return this.lutimesSync(r,s,a)}lutimesSync(r,s,a){if(this.readOnly)throw or.EROFS(`lutimes '${r}'`);let n=this.resolveFilename(`utimes '${r}'`,r,!1);this.utimesImpl(n,a)}utimesImpl(r,s){this.listings.has(r)&&(this.entries.has(r)||this.hydrateDirectory(r));let a=this.entries.get(r);if(a===void 0)throw new Error(\"Unreachable\");this.zipImpl.setMtime(a,jnt(s))}async mkdirPromise(r,s){return this.mkdirSync(r,s)}mkdirSync(r,{mode:s=493,recursive:a=!1}={}){if(a)return this.mkdirpSync(r,{chmod:s});if(this.readOnly)throw or.EROFS(`mkdir '${r}'`);let n=this.resolveFilename(`mkdir '${r}'`,r);if(this.entries.has(n)||this.listings.has(n))throw or.EEXIST(`mkdir '${r}'`);this.hydrateDirectory(n),this.chmodSync(n,s)}async rmdirPromise(r,s){return this.rmdirSync(r,s)}rmdirSync(r,{recursive:s=!1}={}){if(this.readOnly)throw or.EROFS(`rmdir '${r}'`);if(s){this.removeSync(r);return}let a=this.resolveFilename(`rmdir '${r}'`,r),n=this.listings.get(a);if(!n)throw or.ENOTDIR(`rmdir '${r}'`);if(n.size>0)throw or.ENOTEMPTY(`rmdir '${r}'`);let c=this.entries.get(a);if(typeof c>\"u\")throw or.EINVAL(`rmdir '${r}'`);this.deleteEntry(r,c)}async rmPromise(r,s){return this.rmSync(r,s)}rmSync(r,{recursive:s=!1}={}){if(this.readOnly)throw or.EROFS(`rm '${r}'`);if(s){this.removeSync(r);return}let a=this.resolveFilename(`rm '${r}'`,r),n=this.listings.get(a);if(!n)throw or.ENOTDIR(`rm '${r}'`);if(n.size>0)throw or.ENOTEMPTY(`rm '${r}'`);let c=this.entries.get(a);if(typeof c>\"u\")throw or.EINVAL(`rm '${r}'`);this.deleteEntry(r,c)}hydrateDirectory(r){let s=this.zipImpl.addDirectory(J.relative(vt.root,r));return this.registerListing(r),this.registerEntry(r,s),s}async linkPromise(r,s){return this.linkSync(r,s)}linkSync(r,s){throw or.EOPNOTSUPP(`link '${r}' -> '${s}'`)}async symlinkPromise(r,s){return this.symlinkSync(r,s)}symlinkSync(r,s){if(this.readOnly)throw or.EROFS(`symlink '${r}' -> '${s}'`);let a=this.resolveFilename(`symlink '${r}' -> '${s}'`,s);if(this.listings.has(a))throw or.EISDIR(`symlink '${r}' -> '${s}'`);if(this.entries.has(a))throw or.EEXIST(`symlink '${r}' -> '${s}'`);let n=this.setFileSource(a,r);this.registerEntry(a,n),this.zipImpl.setExternalAttributes(n,lm,(xa.constants.S_IFLNK|511)<<16),this.symlinkCount+=1}async readFilePromise(r,s){typeof s==\"object\"&&(s=s?s.encoding:void 0);let a=await this.readFileBuffer(r,{asyncDecompress:!0});return s?a.toString(s):a}readFileSync(r,s){typeof s==\"object\"&&(s=s?s.encoding:void 0);let a=this.readFileBuffer(r);return s?a.toString(s):a}readFileBuffer(r,s={asyncDecompress:!1}){typeof r==\"number\"&&(r=this.fdToPath(r,\"read\"));let a=this.resolveFilename(`open '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`open '${r}'`);if(r[r.length-1]===\"/\"&&!this.listings.has(a))throw or.ENOTDIR(`open '${r}'`);if(this.listings.has(a))throw or.EISDIR(\"read\");let n=this.entries.get(a);if(n===void 0)throw new Error(\"Unreachable\");return this.getFileSource(n,s)}async readdirPromise(r,s){return this.readdirSync(r,s)}readdirSync(r,s){let a=this.resolveFilename(`scandir '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw or.ENOENT(`scandir '${r}'`);let n=this.listings.get(a);if(!n)throw or.ENOTDIR(`scandir '${r}'`);if(s?.recursive)if(s?.withFileTypes){let c=Array.from(n,f=>Object.assign(this.statImpl(\"lstat\",J.join(r,f)),{name:f,path:vt.dot,parentPath:vt.dot}));for(let f of c){if(!f.isDirectory())continue;let p=J.join(f.path,f.name),h=this.listings.get(J.join(a,p));for(let E of h)c.push(Object.assign(this.statImpl(\"lstat\",J.join(r,p,E)),{name:E,path:p,parentPath:p}))}return c}else{let c=[...n];for(let f of c){let p=this.listings.get(J.join(a,f));if(!(typeof p>\"u\"))for(let h of p)c.push(J.join(f,h))}return c}else return s?.withFileTypes?Array.from(n,c=>Object.assign(this.statImpl(\"lstat\",J.join(r,c)),{name:c,path:void 0,parentPath:void 0})):[...n]}async readlinkPromise(r){let s=this.prepareReadlink(r);return(await this.getFileSource(s,{asyncDecompress:!0})).toString()}readlinkSync(r){let s=this.prepareReadlink(r);return this.getFileSource(s).toString()}prepareReadlink(r){let s=this.resolveFilename(`readlink '${r}'`,r,!1);if(!this.entries.has(s)&&!this.listings.has(s))throw or.ENOENT(`readlink '${r}'`);if(r[r.length-1]===\"/\"&&!this.listings.has(s))throw or.ENOTDIR(`open '${r}'`);if(this.listings.has(s))throw or.EINVAL(`readlink '${r}'`);let a=this.entries.get(s);if(a===void 0)throw new Error(\"Unreachable\");if(!this.isSymbolicLink(a))throw or.EINVAL(`readlink '${r}'`);return a}async truncatePromise(r,s=0){let a=this.resolveFilename(`open '${r}'`,r),n=this.entries.get(a);if(typeof n>\"u\")throw or.EINVAL(`open '${r}'`);let c=await this.getFileSource(n,{asyncDecompress:!0}),f=Buffer.alloc(s,0);return c.copy(f),await this.writeFilePromise(r,f)}truncateSync(r,s=0){let a=this.resolveFilename(`open '${r}'`,r),n=this.entries.get(a);if(typeof n>\"u\")throw or.EINVAL(`open '${r}'`);let c=this.getFileSource(n),f=Buffer.alloc(s,0);return c.copy(f),this.writeFileSync(r,f)}async ftruncatePromise(r,s){return this.truncatePromise(this.fdToPath(r,\"ftruncate\"),s)}ftruncateSync(r,s){return this.truncateSync(this.fdToPath(r,\"ftruncateSync\"),s)}watch(r,s,a){let n;switch(typeof s){case\"function\":case\"string\":case\"undefined\":n=!0;break;default:({persistent:n=!0}=s);break}if(!n)return{on:()=>{},close:()=>{}};let c=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(c)}}}watchFile(r,s,a){let n=J.resolve(vt.root,r);return sE(this,n,s,a)}unwatchFile(r,s){let a=J.resolve(vt.root,r);return md(this,a,s)}}});function mpe(t,e,r=Buffer.alloc(0),s){let a=new As(r),n=C=>C===e||C.startsWith(`${e}/`)?C.slice(0,e.length):null,c=async(C,S)=>()=>a,f=(C,S)=>a,p={...t},h=new Yn(p),E=new e0({baseFs:h,getMountPoint:n,factoryPromise:c,factorySync:f,magicByte:21,maxAge:1/0,typeCheck:s?.typeCheck});return U2(dpe.default,new t0(E)),a}var dpe,ype=Ze(()=>{Dt();dpe=ut(Ie(\"fs\"));BR()});var Epe=Ze(()=>{ppe();BR();ype()});var Tj,uv,vR,Ipe=Ze(()=>{Dt();BR();Tj={CENTRAL_DIRECTORY:33639248,END_OF_CENTRAL_DIRECTORY:101010256},uv=22,vR=class t{constructor(e){this.filesShouldBeCached=!1;if(\"buffer\"in e)throw new Error(\"Buffer based zip archives are not supported\");if(!e.readOnly)throw new Error(\"Writable zip archives are not supported\");this.baseFs=e.baseFs,this.fd=this.baseFs.openSync(e.path,\"r\");try{this.entries=t.readZipSync(this.fd,this.baseFs,e.size)}catch(r){throw this.baseFs.closeSync(this.fd),this.fd=\"closed\",r}}static readZipSync(e,r,s){if(s<uv)throw new Error(\"Invalid ZIP file: EOCD not found\");let a=-1,n=Buffer.alloc(uv);if(r.readSync(e,n,0,uv,s-uv),n.readUInt32LE(0)===Tj.END_OF_CENTRAL_DIRECTORY)a=0;else{let T=Math.min(65557,s);n=Buffer.alloc(T),r.readSync(e,n,0,T,Math.max(0,s-T));for(let N=n.length-4;N>=0;N--)if(n.readUInt32LE(N)===Tj.END_OF_CENTRAL_DIRECTORY){a=N;break}if(a===-1)throw new Error(\"Not a zip archive\")}let c=n.readUInt16LE(a+10),f=n.readUInt32LE(a+12),p=n.readUInt32LE(a+16),h=n.readUInt16LE(a+20);if(a+h+uv>n.length)throw new Error(\"Zip archive inconsistent\");if(c==65535||f==4294967295||p==4294967295)throw new Error(\"Zip 64 is not supported\");if(f>s)throw new Error(\"Zip archive inconsistent\");if(c>f/46)throw new Error(\"Zip archive inconsistent\");let E=Buffer.alloc(f);if(r.readSync(e,E,0,E.length,p)!==E.length)throw new Error(\"Zip archive inconsistent\");let C=[],S=0,b=0,I=0;for(;b<c;){if(S+46>E.length)throw new Error(\"Zip archive inconsistent\");if(E.readUInt32LE(S)!==Tj.CENTRAL_DIRECTORY)throw new Error(\"Zip archive inconsistent\");let N=E.readUInt16LE(S+4)>>>8;if(E.readUInt16LE(S+8)&1)throw new Error(\"Encrypted zip files are not supported\");let W=E.readUInt16LE(S+10),ee=E.readUInt32LE(S+16),ie=E.readUInt16LE(S+28),ue=E.readUInt16LE(S+30),le=E.readUInt16LE(S+32),me=E.readUInt32LE(S+42),pe=E.toString(\"utf8\",S+46,S+46+ie).replaceAll(\"\\0\",\" \");if(pe.includes(\"\\0\"))throw new Error(\"Invalid ZIP file\");let Be=E.readUInt32LE(S+20),Ce=E.readUInt32LE(S+38);C.push({name:pe,os:N,mtime:fi.SAFE_TIME,crc:ee,compressionMethod:W,isSymbolicLink:N===lm&&(Ce>>>16&fi.S_IFMT)===fi.S_IFLNK,size:E.readUInt32LE(S+24),compressedSize:Be,externalAttributes:Ce,localHeaderOffset:me}),I+=Be,b+=1,S+=46+ie+ue+le}if(I>s)throw new Error(\"Zip archive inconsistent\");if(S!==E.length)throw new Error(\"Zip archive inconsistent\");return C}getExternalAttributes(e){let r=this.entries[e];return[r.os,r.externalAttributes]}getListings(){return this.entries.map(e=>e.name)}getSymlinkCount(){let e=0;for(let r of this.entries)r.isSymbolicLink&&(e+=1);return e}stat(e){let r=this.entries[e];return{crc:r.crc,mtime:r.mtime,size:r.size}}locate(e){for(let r=0;r<this.entries.length;r++)if(this.entries[r].name===e)return r;return-1}getFileSource(e){if(this.fd===\"closed\")throw new Error(\"ZIP file is closed\");let r=this.entries[e],s=Buffer.alloc(30);this.baseFs.readSync(this.fd,s,0,s.length,r.localHeaderOffset);let a=s.readUInt16LE(26),n=s.readUInt16LE(28),c=Buffer.alloc(r.compressedSize);if(this.baseFs.readSync(this.fd,c,0,r.compressedSize,r.localHeaderOffset+30+a+n)!==r.compressedSize)throw new Error(\"Invalid ZIP file\");return{data:c,compressionMethod:r.compressionMethod}}discard(){this.fd!==\"closed\"&&(this.baseFs.closeSync(this.fd),this.fd=\"closed\")}addDirectory(e){throw new Error(\"Not implemented\")}deleteEntry(e){throw new Error(\"Not implemented\")}setMtime(e,r){throw new Error(\"Not implemented\")}getBufferAndClose(){throw new Error(\"Not implemented\")}setFileSource(e,r,s){throw new Error(\"Not implemented\")}setExternalAttributes(e,r,s){throw new Error(\"Not implemented\")}}});var fv={};Vt(fv,{DEFAULT_COMPRESSION_LEVEL:()=>gpe,DEFLATE:()=>Rj,JsZipImpl:()=>vR,LibZipImpl:()=>BI,STORE:()=>Qj,ZIP_UNIX:()=>lm,ZipFS:()=>As,ZipOpenFS:()=>$f,getArchivePart:()=>Dj,getLibzipPromise:()=>qnt,getLibzipSync:()=>Gnt,makeEmptyArchive:()=>wR,mountMemoryDrive:()=>mpe});function Gnt(){return cv()}async function qnt(){return cv()}var Cpe,eA=Ze(()=>{Bj();Cpe=ut(cpe());Ape();Epe();Ipe();bj();lpe(()=>{let t=(0,Cpe.default)();return fpe(t)})});var Av,wpe=Ze(()=>{Dt();Yt();pv();Av=class extends ot{constructor(){super(...arguments);this.cwd=ge.String(\"--cwd\",process.cwd(),{description:\"The directory to run the command in\"});this.commandName=ge.String();this.args=ge.Proxy()}static{this.usage={description:\"run a command using yarn's portable shell\",details:`\n      This command will run a command using Yarn's portable shell.\n\n      Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell.\n\n      Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell.\n\n      Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used.\n\n      For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md.\n    `,examples:[[\"Run a simple command\",\"$0 echo Hello\"],[\"Run a command with a glob pattern\",\"$0 echo '*.js'\"],[\"Run a command with a redirection\",\"$0 echo Hello World '>' hello.txt\"],[\"Run a command with an escaped glob pattern (The double escape is needed in Unix shells)\",`$0 echo '\"*.js\"'`],[\"Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)\",'$0 \"GREETING=Hello echo $GREETING World\"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(\" \")}`:this.commandName;return await vI(r,[],{cwd:fe.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var Vl,Bpe=Ze(()=>{Vl=class extends Error{constructor(e){super(e),this.name=\"ShellError\"}}});var PR={};Vt(PR,{fastGlobOptions:()=>Dpe,isBraceExpansion:()=>Fj,isGlobPattern:()=>Wnt,match:()=>Ynt,micromatchOptions:()=>DR});function Wnt(t){if(!SR.default.scan(t,DR).isGlob)return!1;try{SR.default.parse(t,DR)}catch{return!1}return!0}function Ynt(t,{cwd:e,baseFs:r}){return(0,vpe.default)(t,{...Dpe,cwd:fe.fromPortablePath(e),fs:ax(Spe.default,new t0(r))})}function Fj(t){return SR.default.scan(t,DR).isBrace}var vpe,Spe,SR,DR,Dpe,Ppe=Ze(()=>{Dt();vpe=ut(wQ()),Spe=ut(Ie(\"fs\")),SR=ut(Go()),DR={strictBrackets:!0},Dpe={onlyDirectories:!1,onlyFiles:!1}});function Nj(){}function Oj(){for(let t of cm)t.kill()}function Qpe(t,e,r,s){return a=>{let n=a[0]instanceof tA.Transform?\"pipe\":a[0],c=a[1]instanceof tA.Transform?\"pipe\":a[1],f=a[2]instanceof tA.Transform?\"pipe\":a[2],p=(0,xpe.default)(t,e,{...s,stdio:[n,c,f]});return cm.add(p),cm.size===1&&(process.on(\"SIGINT\",Nj),process.on(\"SIGTERM\",Oj)),a[0]instanceof tA.Transform&&a[0].pipe(p.stdin),a[1]instanceof tA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof tA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on(\"error\",E=>{switch(cm.delete(p),cm.size===0&&(process.off(\"SIGINT\",Nj),process.off(\"SIGTERM\",Oj)),E.code){case\"ENOENT\":a[2].write(`command not found: ${t}\n`),h(127);break;case\"EACCES\":a[2].write(`permission denied: ${t}\n`),h(128);break;default:a[2].write(`uncaught error: ${E.message}\n`),h(1);break}}),p.on(\"close\",E=>{cm.delete(p),cm.size===0&&(process.off(\"SIGINT\",Nj),process.off(\"SIGTERM\",Oj)),h(E!==null?E:129)})})}}}function Rpe(t){return e=>{let r=e[0]===\"pipe\"?new tA.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}function bR(t,e){return Mj.start(t,e)}function bpe(t,e=null){let r=new tA.PassThrough,s=new kpe.StringDecoder,a=\"\";return r.on(\"data\",n=>{let c=s.write(n),f;do if(f=c.indexOf(`\n`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a=\"\",t(e!==null?`${e} ${p}`:p)}while(f!==-1);a+=c}),r.on(\"end\",()=>{let n=s.end();n!==\"\"&&t(e!==null?`${e} ${n}`:n)}),r}function Tpe(t,{prefix:e}){return{stdout:bpe(r=>t.stdout.write(`${r}\n`),t.stdout.isTTY?e:null),stderr:bpe(r=>t.stderr.write(`${r}\n`),t.stderr.isTTY?e:null)}}var xpe,tA,kpe,cm,Oc,Lj,Mj,Uj=Ze(()=>{xpe=ut(UU()),tA=Ie(\"stream\"),kpe=Ie(\"string_decoder\"),cm=new Set;Oc=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},Lj=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error(\"Assertion failed: No stream attached\");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error(\"Assertion failed: No stream attached\");return this.stream}},Mj=class t{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:s,stderr:a}){let n=new t(null,e);return n.stdin=r,n.stdout=s,n.stderr=a,n}pipeTo(e,r=1){let s=new t(this,e),a=new Lj;return s.pipe=a,s.stdout=this.stdout,s.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),s}async exec(){let e=[\"ignore\",\"ignore\",\"ignore\"];if(this.pipe)e[0]=\"pipe\";else{if(this.stdin===null)throw new Error(\"Assertion failed: No input stream registered\");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error(\"Assertion failed: No output stream registered\");r=this.stdout,e[1]=r.get();let s;if(this.stderr===null)throw new Error(\"Assertion failed: No error stream registered\");s=this.stderr,e[2]=s.get();let a=this.implementation(e);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),s.close(),n))}async run(){let e=[];for(let s=this;s;s=s.ancestor)e.push(s.exec());return(await Promise.all(e))[0]}}});var mv={};Vt(mv,{EntryCommand:()=>Av,ShellError:()=>Vl,execute:()=>vI,globUtils:()=>PR});function Fpe(t,e,r){let s=new Jl.PassThrough({autoDestroy:!0});switch(t){case 0:(e&1)===1&&r.stdin.pipe(s,{end:!1}),(e&2)===2&&r.stdin instanceof Jl.Writable&&s.pipe(r.stdin,{end:!1});break;case 1:(e&1)===1&&r.stdout.pipe(s,{end:!1}),(e&2)===2&&s.pipe(r.stdout,{end:!1});break;case 2:(e&1)===1&&r.stderr.pipe(s,{end:!1}),(e&2)===2&&s.pipe(r.stderr,{end:!1});break;default:throw new Vl(`Bad file descriptor: \"${t}\"`)}return s}function kR(t,e={}){let r={...t,...e};return r.environment={...t.environment,...e.environment},r.variables={...t.variables,...e.variables},r}async function Jnt(t,e,r){let s=[],a=new Jl.PassThrough;return a.on(\"data\",n=>s.push(n)),await QR(t,e,kR(r,{stdout:a})),Buffer.concat(s).toString().replace(/[\\r\\n]+$/,\"\")}async function Npe(t,e,r){let s=t.map(async n=>{let c=await um(n.args,e,r);return{name:n.name,value:c.join(\" \")}});return(await Promise.all(s)).reduce((n,c)=>(n[c.name]=c.value,n),{})}function xR(t){return t.match(/[^ \\r\\n\\t]+/g)||[]}async function Hpe(t,e,r,s,a=s){switch(t.name){case\"$\":s(String(process.pid));break;case\"#\":s(String(e.args.length));break;case\"@\":if(t.quoted)for(let n of e.args)a(n);else for(let n of e.args){let c=xR(n);for(let f=0;f<c.length-1;++f)a(c[f]);s(c[c.length-1])}break;case\"*\":{let n=e.args.join(\" \");if(t.quoted)s(n);else for(let c of xR(n))a(c)}break;case\"PPID\":s(String(process.ppid));break;case\"RANDOM\":s(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(t.name,10),c,f=Number.isFinite(n);if(f?n>=0&&n<e.args.length&&(c=e.args[n]):Object.hasOwn(r.variables,t.name)?c=r.variables[t.name]:Object.hasOwn(r.environment,t.name)&&(c=r.environment[t.name]),typeof c<\"u\"&&t.alternativeValue?c=(await um(t.alternativeValue,e,r)).join(\" \"):typeof c>\"u\"&&(t.defaultValue?c=(await um(t.defaultValue,e,r)).join(\" \"):t.alternativeValue&&(c=\"\")),typeof c>\"u\")throw f?new Vl(`Unbound argument #${n}`):new Vl(`Unbound variable \"${t.name}\"`);if(t.quoted)s(c);else{let p=xR(c);for(let E=0;E<p.length-1;++E)a(p[E]);let h=p[p.length-1];typeof h<\"u\"&&s(h)}}break}}async function hv(t,e,r){if(t.type===\"number\"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: \"${t.value}\", only integers are allowed`)}else if(t.type===\"variable\"){let s=[];await Hpe({...t,quoted:!0},e,r,n=>s.push(n));let a=Number(s.join(\" \"));return Number.isNaN(a)?hv({type:\"variable\",name:s.join(\" \")},e,r):hv({type:\"number\",value:a},e,r)}else return Knt[t.type](await hv(t.left,e,r),await hv(t.right,e,r))}async function um(t,e,r){let s=new Map,a=[],n=[],c=E=>{n.push(E)},f=()=>{n.length>0&&a.push(n.join(\"\")),n=[]},p=E=>{c(E),f()},h=(E,C,S)=>{let b=JSON.stringify({type:E,fd:C}),I=s.get(b);typeof I>\"u\"&&s.set(b,I=[]),I.push(S)};for(let E of t){let C=!1;switch(E.type){case\"redirection\":{let S=await um(E.args,e,r);for(let b of S)h(E.subtype,E.fd,b)}break;case\"argument\":for(let S of E.segments)switch(S.type){case\"text\":c(S.text);break;case\"glob\":c(S.pattern),C=!0;break;case\"shell\":{let b=await Jnt(S.shell,e,r);if(S.quoted)c(b);else{let I=xR(b);for(let T=0;T<I.length-1;++T)p(I[T]);c(I[I.length-1])}}break;case\"variable\":await Hpe(S,e,r,c,p);break;case\"arithmetic\":c(String(await hv(S.arithmetic,e,r)));break}break}if(f(),C){let S=a.pop();if(typeof S>\"u\")throw new Error(\"Assertion failed: Expected a glob pattern to have been set\");let b=await e.glob.match(S,{cwd:r.cwd,baseFs:e.baseFs});if(b.length===0){let I=Fj(S)?\". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22\":\"\";throw new Vl(`No matches found: \"${S}\"${I}`)}for(let I of b.sort())p(I)}}if(s.size>0){let E=[];for(let[C,S]of s.entries())E.splice(E.length,0,C,String(S.length),...S);a.splice(0,0,\"__ysh_set_redirects\",...E,\"--\")}return a}function gv(t,e,r){e.builtins.has(t[0])||(t=[\"command\",...t]);let s=fe.fromPortablePath(r.cwd),a=r.environment;typeof a.PWD<\"u\"&&(a={...a,PWD:s});let[n,...c]=t;if(n===\"command\")return Qpe(c[0],c.slice(1),e,{cwd:s,env:a});let f=e.builtins.get(n);if(typeof f>\"u\")throw new Error(`Assertion failed: A builtin should exist for \"${n}\"`);return Rpe(async({stdin:p,stdout:h,stderr:E})=>{let{stdin:C,stdout:S,stderr:b}=r;r.stdin=p,r.stdout=h,r.stderr=E;try{return await f(c,e,r)}finally{r.stdin=C,r.stdout=S,r.stderr=b}})}function znt(t,e,r){return s=>{let a=new Jl.PassThrough,n=QR(t,e,kR(r,{stdin:a}));return{stdin:a,promise:n}}}function Znt(t,e,r){return s=>{let a=new Jl.PassThrough,n=QR(t,e,r);return{stdin:a,promise:n}}}function Ope(t,e,r,s){if(e.length===0)return t;{let a;do a=String(Math.random());while(Object.hasOwn(s.procedures,a));return s.procedures={...s.procedures},s.procedures[a]=t,gv([...e,\"__ysh_run_procedure\",a],r,s)}}async function Lpe(t,e,r){let s=t,a=null,n=null;for(;s;){let c=s.then?{...r}:r,f;switch(s.type){case\"command\":{let p=await um(s.args,e,r),h=await Npe(s.envs,e,r);f=s.envs.length?gv(p,e,kR(c,{environment:h})):gv(p,e,c)}break;case\"subshell\":{let p=await um(s.args,e,r),h=znt(s.subshell,e,c);f=Ope(h,p,e,c)}break;case\"group\":{let p=await um(s.args,e,r),h=Znt(s.group,e,c);f=Ope(h,p,e,c)}break;case\"envs\":{let p=await Npe(s.envs,e,r);c.environment={...c.environment,...p},f=gv([\"true\"],e,c)}break}if(typeof f>\"u\")throw new Error(\"Assertion failed: An action should have been generated\");if(a===null)n=bR(f,{stdin:new Oc(c.stdin),stdout:new Oc(c.stdout),stderr:new Oc(c.stderr)});else{if(n===null)throw new Error(\"Assertion failed: The execution pipeline should have been setup\");switch(a){case\"|\":n=n.pipeTo(f,1);break;case\"|&\":n=n.pipeTo(f,3);break}}s.then?(a=s.then.type,s=s.then.chain):s=null}if(n===null)throw new Error(\"Assertion failed: The execution pipeline should have been setup\");return await n.run()}async function Xnt(t,e,r,{background:s=!1}={}){function a(n){let c=[\"#2E86AB\",\"#A23B72\",\"#F18F01\",\"#C73E1D\",\"#CCE2A3\"],f=c[n%c.length];return Mpe.default.hex(f)}if(s){let n=r.nextBackgroundJobIndex++,c=a(n),f=`[${n}]`,p=c(f),{stdout:h,stderr:E}=Tpe(r,{prefix:p});return r.backgroundJobs.push(Lpe(t,e,kR(r,{stdout:h,stderr:E})).catch(C=>E.write(`${C.message}\n`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${c(AE(t))}' has ended\n`)})),0}return await Lpe(t,e,r)}async function $nt(t,e,r,{background:s=!1}={}){let a,n=f=>{a=f,r.variables[\"?\"]=String(f)},c=async f=>{try{return await Xnt(f.chain,e,r,{background:s&&typeof f.then>\"u\"})}catch(p){if(!(p instanceof Vl))throw p;return r.stderr.write(`${p.message}\n`),1}};for(n(await c(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case\"&&\":a===0&&n(await c(t.then.line));break;case\"||\":a!==0&&n(await c(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: \"${t.then.type}\"`)}t=t.then.line}return a}async function QR(t,e,r){let s=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of t){if(a=await $nt(n,e,r,{background:c===\"&\"}),r.exitCode!==null)return r.exitCode;r.variables[\"?\"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,a}function jpe(t){switch(t.type){case\"variable\":return t.name===\"@\"||t.name===\"#\"||t.name===\"*\"||Number.isFinite(parseInt(t.name,10))||\"defaultValue\"in t&&!!t.defaultValue&&t.defaultValue.some(e=>dv(e))||\"alternativeValue\"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>dv(e));case\"arithmetic\":return _j(t.arithmetic);case\"shell\":return Hj(t.shell);default:return!1}}function dv(t){switch(t.type){case\"redirection\":return t.args.some(e=>dv(e));case\"argument\":return t.segments.some(e=>jpe(e));default:throw new Error(`Assertion failed: Unsupported argument type: \"${t.type}\"`)}}function _j(t){switch(t.type){case\"variable\":return jpe(t);case\"number\":return!1;default:return _j(t.left)||_j(t.right)}}function Hj(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let s;switch(r.type){case\"subshell\":s=Hj(r.subshell);break;case\"command\":s=r.envs.some(a=>a.args.some(n=>dv(n)))||r.args.some(a=>dv(a));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function vI(t,e=[],{baseFs:r=new Yn,builtins:s={},cwd:a=fe.toPortablePath(process.cwd()),env:n=process.env,stdin:c=process.stdin,stdout:f=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=PR}={}){let C={};for(let[I,T]of Object.entries(n))typeof T<\"u\"&&(C[I]=T);let S=new Map(Vnt);for(let[I,T]of Object.entries(s))S.set(I,T);c===null&&(c=new Jl.PassThrough,c.end());let b=ux(t,E);if(!Hj(b)&&b.length>0&&e.length>0){let{command:I}=b[b.length-1];for(;I.then;)I=I.then.line;let T=I.chain;for(;T.then;)T=T.then.chain;T.type===\"command\"&&(T.args=T.args.concat(e.map(N=>({type:\"argument\",segments:[{type:\"text\",text:N}]}))))}return await QR(b,{args:e,baseFs:r,builtins:S,initialStdin:c,initialStdout:f,initialStderr:p,glob:E},{cwd:a,environment:C,exitCode:null,procedures:{},stdin:c,stdout:f,stderr:p,variables:Object.assign({},h,{\"?\":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var Mpe,Upe,Jl,_pe,Vnt,Knt,pv=Ze(()=>{Dt();wc();Mpe=ut(RE()),Upe=Ie(\"os\"),Jl=Ie(\"stream\"),_pe=Ie(\"timers/promises\");wpe();Bpe();Ppe();Uj();Uj();Vnt=new Map([[\"cd\",async([t=(0,Upe.homedir)(),...e],r,s)=>{let a=J.resolve(s.cwd,fe.toPortablePath(t));if(!(await r.baseFs.statPromise(a).catch(c=>{throw c.code===\"ENOENT\"?new Vl(`cd: no such file or directory: ${t}`):c})).isDirectory())throw new Vl(`cd: not a directory: ${t}`);return s.cwd=a,0}],[\"pwd\",async(t,e,r)=>(r.stdout.write(`${fe.fromPortablePath(r.cwd)}\n`),0)],[\":\",async(t,e,r)=>0],[\"true\",async(t,e,r)=>0],[\"false\",async(t,e,r)=>1],[\"exit\",async([t,...e],r,s)=>s.exitCode=parseInt(t??s.variables[\"?\"],10)],[\"echo\",async(t,e,r)=>(r.stdout.write(`${t.join(\" \")}\n`),0)],[\"sleep\",async([t],e,r)=>{if(typeof t>\"u\")throw new Vl(\"sleep: missing operand\");let s=Number(t);if(Number.isNaN(s))throw new Vl(`sleep: invalid time interval '${t}'`);return await(0,_pe.setTimeout)(1e3*s,0)}],[\"unset\",async(t,e,r)=>{for(let s of t)delete r.environment[s],delete r.variables[s];return 0}],[\"__ysh_run_procedure\",async(t,e,r)=>{let s=r.procedures[t[0]];return await bR(s,{stdin:new Oc(r.stdin),stdout:new Oc(r.stdout),stderr:new Oc(r.stderr)}).run()}],[\"__ysh_set_redirects\",async(t,e,r)=>{let s=r.stdin,a=r.stdout,n=r.stderr,c=[],f=[],p=[],h=0;for(;t[h]!==\"--\";){let C=t[h++],{type:S,fd:b}=JSON.parse(C),I=W=>{switch(b){case null:case 0:c.push(W);break;default:throw new Error(`Unsupported file descriptor: \"${b}\"`)}},T=W=>{switch(b){case null:case 1:f.push(W);break;case 2:p.push(W);break;default:throw new Error(`Unsupported file descriptor: \"${b}\"`)}},N=Number(t[h++]),U=h+N;for(let W=h;W<U;++h,++W)switch(S){case\"<\":I(()=>e.baseFs.createReadStream(J.resolve(r.cwd,fe.toPortablePath(t[W]))));break;case\"<<<\":I(()=>{let ee=new Jl.PassThrough;return process.nextTick(()=>{ee.write(`${t[W]}\n`),ee.end()}),ee});break;case\"<&\":I(()=>Fpe(Number(t[W]),1,r));break;case\">\":case\">>\":{let ee=J.resolve(r.cwd,fe.toPortablePath(t[W]));T(ee===\"/dev/null\"?new Jl.Writable({autoDestroy:!0,emitClose:!0,write(ie,ue,le){setImmediate(le)}}):e.baseFs.createWriteStream(ee,S===\">>\"?{flags:\"a\"}:void 0))}break;case\">&\":T(Fpe(Number(t[W]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: \"${S}\"`)}}if(c.length>0){let C=new Jl.PassThrough;s=C;let S=b=>{if(b===c.length)C.end();else{let I=c[b]();I.pipe(C,{end:!1}),I.on(\"end\",()=>{S(b+1)})}};S(0)}if(f.length>0){let C=new Jl.PassThrough;a=C;for(let S of f)C.pipe(S)}if(p.length>0){let C=new Jl.PassThrough;n=C;for(let S of p)C.pipe(S)}let E=await bR(gv(t.slice(h+1),e,r),{stdin:new Oc(s),stdout:new Oc(a),stderr:new Oc(n)}).run();return await Promise.all(f.map(C=>new Promise((S,b)=>{C.on(\"error\",I=>{b(I)}),C.on(\"close\",()=>{S()}),C.end()}))),await Promise.all(p.map(C=>new Promise((S,b)=>{C.on(\"error\",I=>{b(I)}),C.on(\"close\",()=>{S()}),C.end()}))),E}]]);Knt={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)}});var Gpe=_((d4t,RR)=>{function eit(){var t=0,e=1,r=2,s=3,a=4,n=5,c=6,f=7,p=8,h=9,E=10,C=11,S=12,b=13,I=14,T=15,N=16,U=17,W=0,ee=1,ie=2,ue=3,le=4;function me(g,we){return 55296<=g.charCodeAt(we)&&g.charCodeAt(we)<=56319&&56320<=g.charCodeAt(we+1)&&g.charCodeAt(we+1)<=57343}function pe(g,we){we===void 0&&(we=0);var ye=g.charCodeAt(we);if(55296<=ye&&ye<=56319&&we<g.length-1){var Ae=ye,se=g.charCodeAt(we+1);return 56320<=se&&se<=57343?(Ae-55296)*1024+(se-56320)+65536:Ae}if(56320<=ye&&ye<=57343&&we>=1){var Ae=g.charCodeAt(we-1),se=ye;return 55296<=Ae&&Ae<=56319?(Ae-55296)*1024+(se-56320)+65536:se}return ye}function Be(g,we,ye){var Ae=[g].concat(we).concat([ye]),se=Ae[Ae.length-2],X=ye,De=Ae.lastIndexOf(I);if(De>1&&Ae.slice(1,De).every(function(j){return j==s})&&[s,b,U].indexOf(g)==-1)return ie;var Te=Ae.lastIndexOf(a);if(Te>0&&Ae.slice(1,Te).every(function(j){return j==a})&&[S,a].indexOf(se)==-1)return Ae.filter(function(j){return j==a}).length%2==1?ue:le;if(se==t&&X==e)return W;if(se==r||se==t||se==e)return X==I&&we.every(function(j){return j==s})?ie:ee;if(X==r||X==t||X==e)return ee;if(se==c&&(X==c||X==f||X==h||X==E))return W;if((se==h||se==f)&&(X==f||X==p))return W;if((se==E||se==p)&&X==p)return W;if(X==s||X==T)return W;if(X==n)return W;if(se==S)return W;var mt=Ae.indexOf(s)!=-1?Ae.lastIndexOf(s)-1:Ae.length-2;return[b,U].indexOf(Ae[mt])!=-1&&Ae.slice(mt+1,-1).every(function(j){return j==s})&&X==I||se==T&&[N,U].indexOf(X)!=-1?W:we.indexOf(a)!=-1?ie:se==a&&X==a?W:ee}this.nextBreak=function(g,we){if(we===void 0&&(we=0),we<0)return 0;if(we>=g.length-1)return g.length;for(var ye=Ce(pe(g,we)),Ae=[],se=we+1;se<g.length;se++)if(!me(g,se-1)){var X=Ce(pe(g,se));if(Be(ye,Ae,X))return se;Ae.push(X)}return g.length},this.splitGraphemes=function(g){for(var we=[],ye=0,Ae;(Ae=this.nextBreak(g,ye))<g.length;)we.push(g.slice(ye,Ae)),ye=Ae;return ye<g.length&&we.push(g.slice(ye)),we},this.iterateGraphemes=function(g){var we=0,ye={next:function(){var Ae,se;return(se=this.nextBreak(g,we))<g.length?(Ae=g.slice(we,se),we=se,{value:Ae,done:!1}):we<g.length?(Ae=g.slice(we),we=g.length,{value:Ae,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<\"u\"&&Symbol.iterator&&(ye[Symbol.iterator]=function(){return ye}),ye},this.countGraphemes=function(g){for(var we=0,ye=0,Ae;(Ae=this.nextBreak(g,ye))<g.length;)ye=Ae,we++;return ye<g.length&&we++,we};function Ce(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?S:g==13?t:g==10?e:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?r:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?s:127462<=g&&g<=127487?a:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?n:4352<=g&&g<=4447||43360<=g&&g<=43388?c:4448<=g&&g<=4519||55216<=g&&g<=55238?f:4520<=g&&g<=4607||55243<=g&&g<=55291?p:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?h:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?E:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?b:127995<=g&&g<=127999?I:g==8205?T:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?N:128102<=g&&g<=128105?U:C}return this}typeof RR<\"u\"&&RR.exports&&(RR.exports=eit)});var Wpe=_((m4t,qpe)=>{var tit=/^(.*?)(\\x1b\\[[^m]+m|\\x1b\\]8;;.*?(\\x1b\\\\|\\u0007))/,TR;function rit(){if(TR)return TR;if(typeof Intl.Segmenter<\"u\"){let t=new Intl.Segmenter(\"en\",{granularity:\"grapheme\"});return TR=e=>Array.from(t.segment(e),({segment:r})=>r)}else{let t=Gpe(),e=new t;return TR=r=>e.splitGraphemes(r)}}qpe.exports=(t,e=0,r=t.length)=>{if(e<0||r<0)throw new RangeError(\"Negative indices aren't supported by this implementation\");let s=r-e,a=\"\",n=0,c=0;for(;t.length>0;){let f=t.match(tit)||[t,t,void 0],p=rit()(f[1]),h=Math.min(e-n,p.length);p=p.slice(h);let E=Math.min(s-c,p.length);a+=p.slice(0,E).join(\"\"),n+=h,c+=E,typeof f[2]<\"u\"&&(a+=f[2]),t=t.slice(f[0].length)}return a}});var fn,yv=Ze(()=>{fn=process.env.YARN_IS_TEST_ENV?\"0.0.0\":\"4.10.3\"});function Zpe(t,{configuration:e,json:r}){if(!e.get(\"enableMessageNames\"))return\"\";let a=Yf(t===null?0:t);return!r&&t===null?Ht(e,a,\"grey\"):a}function jj(t,{configuration:e,json:r}){let s=Zpe(t,{configuration:e,json:r});if(!s||t===null||t===0)return s;let a=Br[t],n=`https://yarnpkg.com/advanced/error-codes#${s}---${a}`.toLowerCase();return KE(e,s,n)}async function SI({configuration:t,stdout:e,forceError:r},s){let a=await Ot.start({configuration:t,stdout:e,includeFooter:!1},async n=>{let c=!1,f=!1;for(let p of s)typeof p.option<\"u\"&&(p.error||r?(f=!0,n.reportError(50,p.message)):(c=!0,n.reportWarning(50,p.message)),p.callback?.());c&&!f&&n.reportSeparator()});return a.hasErrors()?a.exitCode():null}var Kpe,FR,nit,Ype,Vpe,D0,zpe,Jpe,iit,sit,NR,oit,Ot,Ev=Ze(()=>{Kpe=ut(Wpe()),FR=ut(Fd());Gx();Rc();yv();xc();nit=\"\\xB7\",Ype=[\"\\u280B\",\"\\u2819\",\"\\u2839\",\"\\u2838\",\"\\u283C\",\"\\u2834\",\"\\u2826\",\"\\u2827\",\"\\u2807\",\"\\u280F\"],Vpe=80,D0=FR.default.GITHUB_ACTIONS?{start:t=>`::group::${t}\n`,end:t=>`::endgroup::\n`}:FR.default.TRAVIS?{start:t=>`travis_fold:start:${t}\n`,end:t=>`travis_fold:end:${t}\n`}:FR.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\\W+/g,\"_\")}[collapsed=true]\\r\\x1B[0K${t}\n`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\\W+/g,\"_\")}\\r\\x1B[0K`}:null,zpe=D0!==null,Jpe=new Date,iit=[\"iTerm.app\",\"Apple_Terminal\",\"WarpTerminal\",\"vscode\"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,sit=t=>t,NR=sit({patrick:{date:[17,3],chars:[\"\\u{1F340}\",\"\\u{1F331}\"],size:40},simba:{date:[19,7],chars:[\"\\u{1F981}\",\"\\u{1F334}\"],size:40},jack:{date:[31,10],chars:[\"\\u{1F383}\",\"\\u{1F987}\"],size:40},hogsfather:{date:[31,12],chars:[\"\\u{1F389}\",\"\\u{1F384}\"],size:40},default:{chars:[\"=\",\"-\"],size:80}}),oit=iit&&Object.keys(NR).find(t=>{let e=NR[t];return!(e.date&&(e.date[0]!==Jpe.getDate()||e.date[1]!==Jpe.getMonth()+1))})||\"default\";Ot=class extends Ao{constructor({configuration:r,stdout:s,json:a=!1,forceSectionAlignment:n=!1,includeNames:c=!0,includePrefix:f=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:C=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(TB(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=c,this.includePrefix=f,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=C,this.json=a,this.stdout=s,r.get(\"enableProgressBars\")&&!a&&s.isTTY&&s.columns>22){let S=r.get(\"progressBarStyle\")||oit;if(!Object.hasOwn(NR,S))throw new Error(\"Assertion failed: Invalid progress bar style\");this.progressStyle=NR[S];let b=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*b/80)}}static async start(r,s){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!=\"string\"){let h=c;c=h.message,f=f??h.name}let p=typeof f<\"u\"?`${f}: ${c}`:c;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,zd(r.configuration,`Yarn ${fn}`,2));try{await s(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let s=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,s-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}async startSectionPromise({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}startTimerImpl(r,s,a){return{cb:typeof s==\"function\"?s:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\\u250C ${r}`),this.indent+=1,D0!==null&&!this.json&&this.includeInfos&&this.stdout.write(D0.start(r))},reportFooter:f=>{if(this.indent-=1,D0!==null&&!this.json&&this.includeInfos){this.stdout.write(D0.end(r));for(let p of this.timerFooter)p()}this.configuration.get(\"enableTimers\")&&f>200?this.reportInfo(null,`\\u2514 Completed in ${Ht(this.configuration,f,ht.DURATION)}`):this.reportInfo(null,\"\\u2514 Completed\"),this.level-=1},skipIfEmpty:(typeof s==\"function\"?{}:s).skipIfEmpty}}startTimerSync(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionSync(c,n)}async startTimerPromise(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionPromise(c,n)}reportSeparator(){this.indent===0?this.writeLine(\"\"):this.reportInfo(null,\"\")}reportInfo(r,s){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:\"\",c=`${this.formatPrefix(n,\"blueBright\")}${s}`;this.json?this.reportJson({type:\"info\",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(c)}reportWarning(r,s){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:\"\";this.json?this.reportJson({type:\"warning\",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,\"yellowBright\")}${s}`)}reportError(r,s){this.errorCount+=1,this.timerFooter.push(()=>this.reportErrorImpl(r,s)),this.reportErrorImpl(r,s)}reportErrorImpl(r,s){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:\"\";this.json?this.reportJson({type:\"error\",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,\"redBright\")}${s}`,{truncate:!1})}reportFold(r,s){if(!D0)return;let a=`${D0.start(r)}${s}${D0.end(r)}`;this.timerFooter.push(()=>this.stdout.write(a))}reportProgress(r){if(this.progressStyle===null)return{...Promise.resolve(),stop:()=>{}};if(r.hasProgress&&r.hasTitle)throw new Error(\"Unimplemented: Progress bars can't have both progress and titles.\");let s=!1,a=Promise.resolve().then(async()=>{let c={progress:r.hasProgress?0:void 0,title:r.hasTitle?\"\":void 0};this.progress.set(r,{definition:c,lastScaledSize:r.hasProgress?-1:void 0,lastTitle:void 0}),this.refreshProgress({delta:-1});for await(let{progress:f,title:p}of r)s||c.progress===f&&c.title===p||(c.progress=f,c.title=p,this.refreshProgress());n()}),n=()=>{s||(s=!0,this.progress.delete(r),this.refreshProgress({delta:1}))};return{...a,stop:n}}reportJson(r){this.json&&this.writeLine(`${JSON.stringify(r)}`)}async finalize(){if(!this.includeFooter)return;let r=\"\";this.errorCount>0?r=\"Failed with errors\":this.warningCount>0?r=\"Done with warnings\":r=\"Done\";let s=Ht(this.configuration,Date.now()-this.startTime,ht.DURATION),a=this.configuration.get(\"enableTimers\")?`${r} in ${s}`:r;this.errorCount>0?this.reportError(0,a):this.warningCount>0?this.reportWarning(0,a):this.reportInfo(0,a)}writeLine(r,{truncate:s}={}){this.clearProgress({clear:!0}),this.stdout.write(`${this.truncate(r,{truncate:s})}\n`),this.writeProgress()}writeLines(r,{truncate:s}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:s})}\n`);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let s of r)s.committed=!0,s.action()}clearProgress({delta:r=0,clear:s=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\\x1B[${this.progress.size+r}A`),(r>0||s)&&this.stdout.write(\"\\x1B[0J\"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>Vpe&&(this.progressFrame=(this.progressFrame+1)%Ype.length,this.progressTime=r);let s=Ype[this.progressFrame];for(let a of this.progress.values()){let n=\"\";if(typeof a.lastScaledSize<\"u\"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let c=this.formatName(null),f=c?`${c}: `:\"\",p=a.definition.title?` ${a.definition.title}`:\"\";this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"blueBright\")} ${f}${s}${n}${p}\n`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},Vpe)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<\"u\"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,p=c.lastScaledSize;c.lastScaledSize=f;let h=c.lastTitle;if(c.lastTitle=c.definition.title,f!==p||(n=h!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>\"u\"&&(s=this.configuration.get(\"preferTruncatedLines\")),s&&(r=(0,Kpe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?Zpe(r,{configuration:this.configuration,json:this.json}):\"\"}formatPrefix(r,s){return this.includePrefix?`${Ht(this.configuration,\"\\u27A4\",s)} ${r}${this.formatIndent()}`:\"\"}formatNameWithHyperlink(r){return this.includeNames?jj(r,{configuration:this.configuration,json:this.json}):\"\"}formatIndent(){return this.level>0||!this.forceSectionAlignment?\"\\u2502 \".repeat(this.indent):`${nit} `}}});var In={};Vt(In,{PackageManager:()=>$pe,detectPackageManager:()=>ehe,executePackageAccessibleBinary:()=>she,executePackageScript:()=>OR,executePackageShellcode:()=>Gj,executeWorkspaceAccessibleBinary:()=>pit,executeWorkspaceLifecycleScript:()=>nhe,executeWorkspaceScript:()=>rhe,getPackageAccessibleBinaries:()=>LR,getWorkspaceAccessibleBinaries:()=>ihe,hasPackageScript:()=>uit,hasWorkspaceScript:()=>qj,isNodeScript:()=>Wj,makeScriptEnv:()=>Iv,maybeExecuteWorkspaceLifecycleScript:()=>Ait,prepareExternalProject:()=>cit});async function P0(t,e,r,s=[]){if(process.platform===\"win32\"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @\"${r}\" ${s.map(n=>`\"${n.replace('\"','\"\"')}\"`).join(\" \")} %*`;await ce.writeFilePromise(J.format({dir:t,name:e,ext:\".cmd\"}),a)}await ce.writeFilePromise(J.join(t,e),`#!/bin/sh\nexec \"${r}\" ${s.map(a=>`'${a.replace(/'/g,`'\"'\"'`)}'`).join(\" \")} \"$@\"\n`,{mode:493})}async function ehe(t){let e=await Ut.tryFind(t);if(e?.packageManager){let s=bQ(e.packageManager);if(s?.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=s.reference.split(\".\");switch(s.name){case\"yarn\":return{packageManagerField:!0,packageManager:Number(n)===1?\"Yarn Classic\":\"Yarn\",reason:a};case\"npm\":return{packageManagerField:!0,packageManager:\"npm\",reason:a};case\"pnpm\":return{packageManagerField:!0,packageManager:\"pnpm\",reason:a}}}}let r;try{r=await ce.readFilePromise(J.join(t,Er.lockfile),\"utf8\")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:\"Yarn\",reason:'\"__metadata\" key found in yarn.lock'}:{packageManager:\"Yarn Classic\",reason:'\"__metadata\" key not found in yarn.lock, must be a Yarn classic lockfile'}:ce.existsSync(J.join(t,\"package-lock.json\"))?{packageManager:\"npm\",reason:`found npm's \"package-lock.json\" lockfile`}:ce.existsSync(J.join(t,\"pnpm-lock.yaml\"))?{packageManager:\"pnpm\",reason:`found pnpm's \"pnpm-lock.yaml\" lockfile`}:null}async function Iv({project:t,locator:e,binFolder:r,ignoreCorepack:s,lifecycleScript:a,baseEnv:n=t?.configuration.env??process.env}){let c={};for(let[E,C]of Object.entries(n))typeof C<\"u\"&&(c[E.toLowerCase()!==\"path\"?E:\"PATH\"]=C);let f=fe.fromPortablePath(r);c.BERRY_BIN_FOLDER=fe.fromPortablePath(f);let p=process.env.COREPACK_ROOT&&!s?fe.join(process.env.COREPACK_ROOT,\"dist/yarn.js\"):process.argv[1];if(await Promise.all([P0(r,\"node\",process.execPath),...fn!==null?[P0(r,\"run\",process.execPath,[p,\"run\"]),P0(r,\"yarn\",process.execPath,[p]),P0(r,\"yarnpkg\",process.execPath,[p]),P0(r,\"node-gyp\",process.execPath,[p,\"run\",\"--top-level\",\"node-gyp\"])]:[]]),t&&(c.INIT_CWD=fe.fromPortablePath(t.configuration.startingCwd),c.PROJECT_CWD=fe.fromPortablePath(t.cwd)),c.PATH=c.PATH?`${f}${fe.delimiter}${c.PATH}`:`${f}`,c.npm_execpath=`${f}${fe.sep}yarn`,c.npm_node_execpath=`${f}${fe.sep}node`,e){if(!t)throw new Error(\"Assertion failed: Missing project\");let E=t.tryWorkspaceByLocator(e),C=E?E.manifest.version??\"\":t.storedPackages.get(e.locatorHash).version??\"\";c.npm_package_name=un(e),c.npm_package_version=C;let S;if(E)S=E.cwd;else{let b=t.storedPackages.get(e.locatorHash);if(!b)throw new Error(`Package for ${Yr(t.configuration,e)} not found in the project`);let I=t.configuration.getLinkers(),T={project:t,report:new Ot({stdout:new b0.PassThrough,configuration:t.configuration})},N=I.find(U=>U.supportsPackage(b,T));if(!N)throw new Error(`The package ${Yr(t.configuration,b)} isn't supported by any of the available linkers`);S=await N.findPackageLocation(b,T)}c.npm_package_json=fe.fromPortablePath(J.join(S,Er.manifest))}let h=fn!==null?`yarn/${fn}`:`yarn/${bp(\"@yarnpkg/core\").version}-core`;return c.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(c.npm_lifecycle_event=a),t&&await t.configuration.triggerHook(E=>E.setupScriptEnvironment,t,c,async(E,C,S)=>await P0(r,E,C,S)),c}async function cit(t,e,{configuration:r,report:s,workspace:a=null,locator:n=null}){await lit(async()=>{await ce.mktempPromise(async c=>{let f=J.join(c,\"pack.log\"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(f,{prefix:fe.fromPortablePath(t),report:s}),C=n&&Gu(n)?rI(n):n,S=C?ll(C):\"an external project\";h.write(`Packing ${S} from sources\n`);let b=await ehe(t),I;b!==null?(h.write(`Using ${b.packageManager} for bootstrap. Reason: ${b.reason}\n\n`),I=b.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn\n\n`),I=\"Yarn\");let T=I===\"Yarn\"&&!b?.packageManagerField;await ce.mktempPromise(async N=>{let U=await Iv({binFolder:N,ignoreCorepack:T,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:\"0\"}}),ee=new Map([[\"Yarn Classic\",async()=>{let ue=a!==null?[\"workspace\",a]:[],le=J.join(t,Er.manifest),me=await ce.readFilePromise(le),pe=await Wu(process.execPath,[process.argv[1],\"set\",\"version\",\"classic\",\"--only-if-needed\",\"--yarn-path\"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(pe.code!==0)return pe.code;await ce.writeFilePromise(le,me),await ce.appendFilePromise(J.join(t,\".npmignore\"),`/.yarn\n`),h.write(`\n`),delete U.NODE_ENV;let Be=await Wu(\"yarn\",[\"install\"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(Be.code!==0)return Be.code;h.write(`\n`);let Ce=await Wu(\"yarn\",[...ue,\"pack\",\"--filename\",fe.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ce.code!==0?Ce.code:0}],[\"Yarn\",async()=>{let ue=a!==null?[\"workspace\",a]:[];U.YARN_ENABLE_INLINE_BUILDS=\"1\";let le=J.join(t,Er.lockfile);await ce.existsPromise(le)||await ce.writeFilePromise(le,\"\");let me=await Wu(\"yarn\",[...ue,\"pack\",\"--install-if-needed\",\"--filename\",fe.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return me.code!==0?me.code:0}],[\"npm\",async()=>{if(a!==null){let we=new b0.PassThrough,ye=WE(we);we.pipe(h,{end:!1});let Ae=await Wu(\"npm\",[\"--version\"],{cwd:t,env:U,stdin:p,stdout:we,stderr:E,end:0});if(we.end(),Ae.code!==0)return h.end(),E.end(),Ae.code;let se=(await ye).toString().trim();if(!Xf(se,\">=7.x\")){let X=Da(null,\"npm\"),De=On(X,se),Te=On(X,\">=7.x\");throw new Error(`Workspaces aren't supported by ${ni(r,De)}; please upgrade to ${ni(r,Te)} (npm has been detected as the primary package manager for ${Ht(r,t,ht.PATH)})`)}}let ue=a!==null?[\"--workspace\",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let le=await Wu(\"npm\",[\"install\",\"--legacy-peer-deps\"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(le.code!==0)return le.code;let me=new b0.PassThrough,pe=WE(me);me.pipe(h);let Be=await Wu(\"npm\",[\"pack\",\"--silent\",...ue],{cwd:t,env:U,stdin:p,stdout:me,stderr:E});if(Be.code!==0)return Be.code;let Ce=(await pe).toString().trim().replace(/^.*\\n/s,\"\"),g=J.resolve(t,fe.toPortablePath(Ce));return await ce.renamePromise(g,e),0}]]).get(I);if(typeof ee>\"u\")throw new Error(\"Assertion failed: Unsupported workflow\");let ie=await ee();if(!(ie===0||typeof ie>\"u\"))throw ce.detachTemp(c),new jt(58,`Packing the package failed (exit code ${ie}, logs can be found here: ${Ht(r,f,ht.PATH)})`)})})})}async function uit(t,e,{project:r}){let s=r.tryWorkspaceByLocator(t);if(s!==null)return qj(s,e);let a=r.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${Yr(r.configuration,t)} not found in the project`);return await $f.openPromise(async n=>{let c=r.configuration,f=r.configuration.getLinkers(),p={project:r,report:new Ot({stdout:new b0.PassThrough,configuration:c})},h=f.find(b=>b.supportsPackage(a,p));if(!h)throw new Error(`The package ${Yr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),C=new Sn(E,{baseFs:n});return(await Ut.find(vt.dot,{baseFs:C})).scripts.has(e)})}async function OR(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ce.mktempPromise(async p=>{let{manifest:h,env:E,cwd:C}=await the(t,{project:a,binFolder:p,cwd:s,lifecycleScript:e}),S=h.scripts.get(e);if(typeof S>\"u\")return 1;let b=async()=>await vI(S,r,{cwd:C,env:E,stdin:n,stdout:c,stderr:f});return await(await a.configuration.reduceHook(T=>T.wrapScriptExecution,b,a,t,e,{script:S,args:r,cwd:C,env:E,stdin:n,stdout:c,stderr:f}))()})}async function Gj(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ce.mktempPromise(async p=>{let{env:h,cwd:E}=await the(t,{project:a,binFolder:p,cwd:s});return await vI(e,r,{cwd:E,env:h,stdin:n,stdout:c,stderr:f})})}async function fit(t,{binFolder:e,cwd:r,lifecycleScript:s}){let a=await Iv({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:s});return await Yj(e,await ihe(t)),typeof r>\"u\"&&(r=J.dirname(await ce.realpathPromise(J.join(t.cwd,\"package.json\")))),{manifest:t.manifest,binFolder:e,env:a,cwd:r}}async function the(t,{project:e,binFolder:r,cwd:s,lifecycleScript:a}){let n=e.tryWorkspaceByLocator(t);if(n!==null)return fit(n,{binFolder:r,cwd:s,lifecycleScript:a});let c=e.storedPackages.get(t.locatorHash);if(!c)throw new Error(`Package for ${Yr(e.configuration,t)} not found in the project`);return await $f.openPromise(async f=>{let p=e.configuration,h=e.configuration.getLinkers(),E={project:e,report:new Ot({stdout:new b0.PassThrough,configuration:p})},C=h.find(N=>N.supportsPackage(c,E));if(!C)throw new Error(`The package ${Yr(e.configuration,c)} isn't supported by any of the available linkers`);let S=await Iv({project:e,locator:t,binFolder:r,lifecycleScript:a});await Yj(r,await LR(t,{project:e}));let b=await C.findPackageLocation(c,E),I=new Sn(b,{baseFs:f}),T=await Ut.find(vt.dot,{baseFs:I});return typeof s>\"u\"&&(s=b),{manifest:T,binFolder:r,env:S,cwd:s}})}async function rhe(t,e,r,{cwd:s,stdin:a,stdout:n,stderr:c}){return await OR(t.anchoredLocator,e,r,{cwd:s,project:t.project,stdin:a,stdout:n,stderr:c})}function qj(t,e){return t.manifest.scripts.has(e)}async function nhe(t,e,{cwd:r,report:s}){let{configuration:a}=t.project,n=null;await ce.mktempPromise(async c=>{let f=J.join(c,`${e}.log`),p=`# This file contains the result of Yarn calling the \"${e}\" lifecycle script inside a workspace (\"${fe.fromPortablePath(t.cwd)}\")\n`,{stdout:h,stderr:E}=a.getSubprocessStreams(f,{report:s,prefix:Yr(a,t.anchoredLocator),header:p});s.reportInfo(36,`Calling the \"${e}\" lifecycle script`);let C=await rhe(t,e,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),C!==0)throw ce.detachTemp(c),new jt(36,`${PB(e)} script failed (exit code ${Ht(a,C,ht.NUMBER)}, logs can be found here: ${Ht(a,f,ht.PATH)}); run ${Ht(a,`yarn ${e}`,ht.CODE)} to investigate`)})}async function Ait(t,e,r){qj(t,e)&&await nhe(t,e,r)}function Wj(t){let e=J.extname(t);if(e.match(/\\.[cm]?[jt]sx?$/))return!0;if(e===\".exe\"||e===\".bin\")return!1;let r=Buffer.alloc(4),s;try{s=ce.openSync(t,\"r\")}catch{return!0}try{ce.readSync(s,r,0,r.length,0)}finally{ce.closeSync(s)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function LR(t,{project:e}){let r=e.configuration,s=new Map,a=e.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${Yr(r,t)} not found in the project`);let n=new b0.Writable,c=r.getLinkers(),f={project:e,report:new Ot({configuration:r,stdout:n})},p=new Set([t.locatorHash]);for(let E of a.dependencies.values()){let C=e.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(`Assertion failed: The resolution (${ni(r,E)}) should have been registered`);p.add(C)}let h=await Promise.all(Array.from(p,async E=>{let C=e.storedPackages.get(E);if(!C)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(C.bin.size===0)return Wl.skip;let S=c.find(I=>I.supportsPackage(C,f));if(!S)return Wl.skip;let b=null;try{b=await S.findPackageLocation(C,f)}catch(I){if(I.code===\"LOCATOR_NOT_INSTALLED\")return Wl.skip;throw I}return{dependency:C,packageLocation:b}}));for(let E of h){if(E===Wl.skip)continue;let{dependency:C,packageLocation:S}=E;for(let[b,I]of C.bin){let T=J.resolve(S,I);s.set(b,[C,fe.fromPortablePath(T),Wj(T)])}}return s}async function ihe(t){return await LR(t.anchoredLocator,{project:t.project})}async function Yj(t,e){await Promise.all(Array.from(e,([r,[,s,a]])=>a?P0(t,r,process.execPath,[s]):P0(t,r,s,[])))}async function she(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await LR(t,{project:a});let E=h.get(e);if(!E)throw new Error(`Binary not found (${e}) for ${Yr(a.configuration,t)}`);return await ce.mktempPromise(async C=>{let[,S]=E,b=await Iv({project:a,locator:t,binFolder:C});await Yj(b.BERRY_BIN_FOLDER,h);let I=Wj(fe.toPortablePath(S))?Wu(process.execPath,[...p,S,...r],{cwd:s,env:b,stdin:n,stdout:c,stderr:f}):Wu(S,r,{cwd:s,env:b,stdin:n,stdout:c,stderr:f}),T;try{T=await I}finally{await ce.removePromise(b.BERRY_BIN_FOLDER)}return T.code})}async function pit(t,e,r,{cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await she(t.anchoredLocator,e,r,{project:t.project,cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var Xpe,b0,$pe,ait,lit,Vj=Ze(()=>{Dt();Dt();eA();pv();ql();Xpe=ut(Ld()),b0=Ie(\"stream\");oI();Rc();Ev();yv();gR();xc();bc();Tp();Wo();$pe=(a=>(a.Yarn1=\"Yarn Classic\",a.Yarn2=\"Yarn\",a.Npm=\"npm\",a.Pnpm=\"pnpm\",a))($pe||{});ait=2,lit=(0,Xpe.default)(ait)});var DI=_((U4t,ahe)=>{\"use strict\";var ohe=new Map([[\"C\",\"cwd\"],[\"f\",\"file\"],[\"z\",\"gzip\"],[\"P\",\"preservePaths\"],[\"U\",\"unlink\"],[\"strip-components\",\"strip\"],[\"stripComponents\",\"strip\"],[\"keep-newer\",\"newer\"],[\"keepNewer\",\"newer\"],[\"keep-newer-files\",\"newer\"],[\"keepNewerFiles\",\"newer\"],[\"k\",\"keep\"],[\"keep-existing\",\"keep\"],[\"keepExisting\",\"keep\"],[\"m\",\"noMtime\"],[\"no-mtime\",\"noMtime\"],[\"p\",\"preserveOwner\"],[\"L\",\"follow\"],[\"h\",\"follow\"]]);ahe.exports=t=>t?Object.keys(t).map(e=>[ohe.has(e)?ohe.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var bI=_((_4t,dhe)=>{\"use strict\";var lhe=typeof process==\"object\"&&process?process:{stdout:null,stderr:null},hit=Ie(\"events\"),che=Ie(\"stream\"),uhe=Ie(\"string_decoder\").StringDecoder,_p=Symbol(\"EOF\"),Hp=Symbol(\"maybeEmitEnd\"),x0=Symbol(\"emittedEnd\"),MR=Symbol(\"emittingEnd\"),Cv=Symbol(\"emittedError\"),UR=Symbol(\"closed\"),fhe=Symbol(\"read\"),_R=Symbol(\"flush\"),Ahe=Symbol(\"flushChunk\"),ul=Symbol(\"encoding\"),jp=Symbol(\"decoder\"),HR=Symbol(\"flowing\"),wv=Symbol(\"paused\"),PI=Symbol(\"resume\"),Ys=Symbol(\"bufferLength\"),Jj=Symbol(\"bufferPush\"),Kj=Symbol(\"bufferShift\"),Ko=Symbol(\"objectMode\"),zo=Symbol(\"destroyed\"),zj=Symbol(\"emitData\"),phe=Symbol(\"emitEnd\"),Zj=Symbol(\"emitEnd2\"),Gp=Symbol(\"async\"),Bv=t=>Promise.resolve().then(t),hhe=global._MP_NO_ITERATOR_SYMBOLS_!==\"1\",git=hhe&&Symbol.asyncIterator||Symbol(\"asyncIterator not implemented\"),dit=hhe&&Symbol.iterator||Symbol(\"iterator not implemented\"),mit=t=>t===\"end\"||t===\"finish\"||t===\"prefinish\",yit=t=>t instanceof ArrayBuffer||typeof t==\"object\"&&t.constructor&&t.constructor.name===\"ArrayBuffer\"&&t.byteLength>=0,Eit=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),jR=class{constructor(e,r,s){this.src=e,this.dest=r,this.opts=s,this.ondrain=()=>e[PI](),r.on(\"drain\",this.ondrain)}unpipe(){this.dest.removeListener(\"drain\",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Xj=class extends jR{unpipe(){this.src.removeListener(\"error\",this.proxyErrors),super.unpipe()}constructor(e,r,s){super(e,r,s),this.proxyErrors=a=>r.emit(\"error\",a),e.on(\"error\",this.proxyErrors)}};dhe.exports=class ghe extends che{constructor(e){super(),this[HR]=!1,this[wv]=!1,this.pipes=[],this.buffer=[],this[Ko]=e&&e.objectMode||!1,this[Ko]?this[ul]=null:this[ul]=e&&e.encoding||null,this[ul]===\"buffer\"&&(this[ul]=null),this[Gp]=e&&!!e.async||!1,this[jp]=this[ul]?new uhe(this[ul]):null,this[_p]=!1,this[x0]=!1,this[MR]=!1,this[UR]=!1,this[Cv]=null,this.writable=!0,this.readable=!0,this[Ys]=0,this[zo]=!1}get bufferLength(){return this[Ys]}get encoding(){return this[ul]}set encoding(e){if(this[Ko])throw new Error(\"cannot set encoding in objectMode\");if(this[ul]&&e!==this[ul]&&(this[jp]&&this[jp].lastNeed||this[Ys]))throw new Error(\"cannot change encoding\");this[ul]!==e&&(this[jp]=e?new uhe(e):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[jp].write(r)))),this[ul]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Ko]}set objectMode(e){this[Ko]=this[Ko]||!!e}get async(){return this[Gp]}set async(e){this[Gp]=this[Gp]||!!e}write(e,r,s){if(this[_p])throw new Error(\"write after end\");if(this[zo])return this.emit(\"error\",Object.assign(new Error(\"Cannot call write after a stream was destroyed\"),{code:\"ERR_STREAM_DESTROYED\"})),!0;typeof r==\"function\"&&(s=r,r=\"utf8\"),r||(r=\"utf8\");let a=this[Gp]?Bv:n=>n();return!this[Ko]&&!Buffer.isBuffer(e)&&(Eit(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):yit(e)?e=Buffer.from(e):typeof e!=\"string\"&&(this.objectMode=!0)),this[Ko]?(this.flowing&&this[Ys]!==0&&this[_R](!0),this.flowing?this.emit(\"data\",e):this[Jj](e),this[Ys]!==0&&this.emit(\"readable\"),s&&a(s),this.flowing):e.length?(typeof e==\"string\"&&!(r===this[ul]&&!this[jp].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[ul]&&(e=this[jp].write(e)),this.flowing&&this[Ys]!==0&&this[_R](!0),this.flowing?this.emit(\"data\",e):this[Jj](e),this[Ys]!==0&&this.emit(\"readable\"),s&&a(s),this.flowing):(this[Ys]!==0&&this.emit(\"readable\"),s&&a(s),this.flowing)}read(e){if(this[zo])return null;if(this[Ys]===0||e===0||e>this[Ys])return this[Hp](),null;this[Ko]&&(e=null),this.buffer.length>1&&!this[Ko]&&(this.encoding?this.buffer=[this.buffer.join(\"\")]:this.buffer=[Buffer.concat(this.buffer,this[Ys])]);let r=this[fhe](e||null,this.buffer[0]);return this[Hp](),r}[fhe](e,r){return e===r.length||e===null?this[Kj]():(this.buffer[0]=r.slice(e),r=r.slice(0,e),this[Ys]-=e),this.emit(\"data\",r),!this.buffer.length&&!this[_p]&&this.emit(\"drain\"),r}end(e,r,s){return typeof e==\"function\"&&(s=e,e=null),typeof r==\"function\"&&(s=r,r=\"utf8\"),e&&this.write(e,r),s&&this.once(\"end\",s),this[_p]=!0,this.writable=!1,(this.flowing||!this[wv])&&this[Hp](),this}[PI](){this[zo]||(this[wv]=!1,this[HR]=!0,this.emit(\"resume\"),this.buffer.length?this[_R]():this[_p]?this[Hp]():this.emit(\"drain\"))}resume(){return this[PI]()}pause(){this[HR]=!1,this[wv]=!0}get destroyed(){return this[zo]}get flowing(){return this[HR]}get paused(){return this[wv]}[Jj](e){this[Ko]?this[Ys]+=1:this[Ys]+=e.length,this.buffer.push(e)}[Kj](){return this.buffer.length&&(this[Ko]?this[Ys]-=1:this[Ys]-=this.buffer[0].length),this.buffer.shift()}[_R](e){do;while(this[Ahe](this[Kj]()));!e&&!this.buffer.length&&!this[_p]&&this.emit(\"drain\")}[Ahe](e){return e?(this.emit(\"data\",e),this.flowing):!1}pipe(e,r){if(this[zo])return;let s=this[x0];return r=r||{},e===lhe.stdout||e===lhe.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,s?r.end&&e.end():(this.pipes.push(r.proxyErrors?new Xj(this,e,r):new jR(this,e,r)),this[Gp]?Bv(()=>this[PI]()):this[PI]()),e}unpipe(e){let r=this.pipes.find(s=>s.dest===e);r&&(this.pipes.splice(this.pipes.indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let s=super.on(e,r);return e===\"data\"&&!this.pipes.length&&!this.flowing?this[PI]():e===\"readable\"&&this[Ys]!==0?super.emit(\"readable\"):mit(e)&&this[x0]?(super.emit(e),this.removeAllListeners(e)):e===\"error\"&&this[Cv]&&(this[Gp]?Bv(()=>r.call(this,this[Cv])):r.call(this,this[Cv])),s}get emittedEnd(){return this[x0]}[Hp](){!this[MR]&&!this[x0]&&!this[zo]&&this.buffer.length===0&&this[_p]&&(this[MR]=!0,this.emit(\"end\"),this.emit(\"prefinish\"),this.emit(\"finish\"),this[UR]&&this.emit(\"close\"),this[MR]=!1)}emit(e,r,...s){if(e!==\"error\"&&e!==\"close\"&&e!==zo&&this[zo])return;if(e===\"data\")return r?this[Gp]?Bv(()=>this[zj](r)):this[zj](r):!1;if(e===\"end\")return this[phe]();if(e===\"close\"){if(this[UR]=!0,!this[x0]&&!this[zo])return;let n=super.emit(\"close\");return this.removeAllListeners(\"close\"),n}else if(e===\"error\"){this[Cv]=r;let n=super.emit(\"error\",r);return this[Hp](),n}else if(e===\"resume\"){let n=super.emit(\"resume\");return this[Hp](),n}else if(e===\"finish\"||e===\"prefinish\"){let n=super.emit(e);return this.removeAllListeners(e),n}let a=super.emit(e,r,...s);return this[Hp](),a}[zj](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let r=super.emit(\"data\",e);return this[Hp](),r}[phe](){this[x0]||(this[x0]=!0,this.readable=!1,this[Gp]?Bv(()=>this[Zj]()):this[Zj]())}[Zj](){if(this[jp]){let r=this[jp].end();if(r){for(let s of this.pipes)s.dest.write(r);super.emit(\"data\",r)}}for(let r of this.pipes)r.end();let e=super.emit(\"end\");return this.removeAllListeners(\"end\"),e}collect(){let e=[];this[Ko]||(e.dataLength=0);let r=this.promise();return this.on(\"data\",s=>{e.push(s),this[Ko]||(e.dataLength+=s.length)}),r.then(()=>e)}concat(){return this[Ko]?Promise.reject(new Error(\"cannot concat in objectMode\")):this.collect().then(e=>this[Ko]?Promise.reject(new Error(\"cannot concat in objectMode\")):this[ul]?e.join(\"\"):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(zo,()=>r(new Error(\"stream destroyed\"))),this.on(\"error\",s=>r(s)),this.on(\"end\",()=>e())})}[git](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[_p])return Promise.resolve({done:!0});let s=null,a=null,n=h=>{this.removeListener(\"data\",c),this.removeListener(\"end\",f),a(h)},c=h=>{this.removeListener(\"error\",n),this.removeListener(\"end\",f),this.pause(),s({value:h,done:!!this[_p]})},f=()=>{this.removeListener(\"error\",n),this.removeListener(\"data\",c),s({done:!0})},p=()=>n(new Error(\"stream destroyed\"));return new Promise((h,E)=>{a=E,s=h,this.once(zo,p),this.once(\"error\",n),this.once(\"end\",f),this.once(\"data\",c)})}}}[dit](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[zo]?(e?this.emit(\"error\",e):this.emit(zo),this):(this[zo]=!0,this.buffer.length=0,this[Ys]=0,typeof this.close==\"function\"&&!this[UR]&&this.close(),e?this.emit(\"error\",e):this.emit(zo),this)}static isStream(e){return!!e&&(e instanceof ghe||e instanceof che||e instanceof hit&&(typeof e.pipe==\"function\"||typeof e.write==\"function\"&&typeof e.end==\"function\"))}}});var yhe=_((H4t,mhe)=>{var Iit=Ie(\"zlib\").constants||{ZLIB_VERNUM:4736};mhe.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Iit))});var h6=_(Kl=>{\"use strict\";var n6=Ie(\"assert\"),k0=Ie(\"buffer\").Buffer,Che=Ie(\"zlib\"),fm=Kl.constants=yhe(),Cit=bI(),Ehe=k0.concat,Am=Symbol(\"_superWrite\"),kI=class extends Error{constructor(e){super(\"zlib: \"+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code=\"ZLIB_ERROR\"),this.message=\"zlib: \"+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return\"ZlibError\"}},wit=Symbol(\"opts\"),vv=Symbol(\"flushFlag\"),Ihe=Symbol(\"finishFlushFlag\"),p6=Symbol(\"fullFlushFlag\"),Ii=Symbol(\"handle\"),GR=Symbol(\"onError\"),xI=Symbol(\"sawError\"),$j=Symbol(\"level\"),e6=Symbol(\"strategy\"),t6=Symbol(\"ended\"),j4t=Symbol(\"_defaultFullFlush\"),qR=class extends Cit{constructor(e,r){if(!e||typeof e!=\"object\")throw new TypeError(\"invalid options for ZlibBase constructor\");super(e),this[xI]=!1,this[t6]=!1,this[wit]=e,this[vv]=e.flush,this[Ihe]=e.finishFlush;try{this[Ii]=new Che[r](e)}catch(s){throw new kI(s)}this[GR]=s=>{this[xI]||(this[xI]=!0,this.close(),this.emit(\"error\",s))},this[Ii].on(\"error\",s=>this[GR](new kI(s))),this.once(\"end\",()=>this.close)}close(){this[Ii]&&(this[Ii].close(),this[Ii]=null,this.emit(\"close\"))}reset(){if(!this[xI])return n6(this[Ii],\"zlib binding closed\"),this[Ii].reset()}flush(e){this.ended||(typeof e!=\"number\"&&(e=this[p6]),this.write(Object.assign(k0.alloc(0),{[vv]:e})))}end(e,r,s){return e&&this.write(e,r),this.flush(this[Ihe]),this[t6]=!0,super.end(null,null,s)}get ended(){return this[t6]}write(e,r,s){if(typeof r==\"function\"&&(s=r,r=\"utf8\"),typeof e==\"string\"&&(e=k0.from(e,r)),this[xI])return;n6(this[Ii],\"zlib binding closed\");let a=this[Ii]._handle,n=a.close;a.close=()=>{};let c=this[Ii].close;this[Ii].close=()=>{},k0.concat=h=>h;let f;try{let h=typeof e[vv]==\"number\"?e[vv]:this[vv];f=this[Ii]._processChunk(e,h),k0.concat=Ehe}catch(h){k0.concat=Ehe,this[GR](new kI(h))}finally{this[Ii]&&(this[Ii]._handle=a,a.close=n,this[Ii].close=c,this[Ii].removeAllListeners(\"error\"))}this[Ii]&&this[Ii].on(\"error\",h=>this[GR](new kI(h)));let p;if(f)if(Array.isArray(f)&&f.length>0){p=this[Am](k0.from(f[0]));for(let h=1;h<f.length;h++)p=this[Am](f[h])}else p=this[Am](k0.from(f));return s&&s(),p}[Am](e){return super.write(e)}},qp=class extends qR{constructor(e,r){e=e||{},e.flush=e.flush||fm.Z_NO_FLUSH,e.finishFlush=e.finishFlush||fm.Z_FINISH,super(e,r),this[p6]=fm.Z_FULL_FLUSH,this[$j]=e.level,this[e6]=e.strategy}params(e,r){if(!this[xI]){if(!this[Ii])throw new Error(\"cannot switch params when binding is closed\");if(!this[Ii].params)throw new Error(\"not supported in this implementation\");if(this[$j]!==e||this[e6]!==r){this.flush(fm.Z_SYNC_FLUSH),n6(this[Ii],\"zlib binding closed\");let s=this[Ii].flush;this[Ii].flush=(a,n)=>{this.flush(a),n()};try{this[Ii].params(e,r)}finally{this[Ii].flush=s}this[Ii]&&(this[$j]=e,this[e6]=r)}}}},i6=class extends qp{constructor(e){super(e,\"Deflate\")}},s6=class extends qp{constructor(e){super(e,\"Inflate\")}},r6=Symbol(\"_portable\"),o6=class extends qp{constructor(e){super(e,\"Gzip\"),this[r6]=e&&!!e.portable}[Am](e){return this[r6]?(this[r6]=!1,e[9]=255,super[Am](e)):super[Am](e)}},a6=class extends qp{constructor(e){super(e,\"Gunzip\")}},l6=class extends qp{constructor(e){super(e,\"DeflateRaw\")}},c6=class extends qp{constructor(e){super(e,\"InflateRaw\")}},u6=class extends qp{constructor(e){super(e,\"Unzip\")}},WR=class extends qR{constructor(e,r){e=e||{},e.flush=e.flush||fm.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||fm.BROTLI_OPERATION_FINISH,super(e,r),this[p6]=fm.BROTLI_OPERATION_FLUSH}},f6=class extends WR{constructor(e){super(e,\"BrotliCompress\")}},A6=class extends WR{constructor(e){super(e,\"BrotliDecompress\")}};Kl.Deflate=i6;Kl.Inflate=s6;Kl.Gzip=o6;Kl.Gunzip=a6;Kl.DeflateRaw=l6;Kl.InflateRaw=c6;Kl.Unzip=u6;typeof Che.BrotliCompress==\"function\"?(Kl.BrotliCompress=f6,Kl.BrotliDecompress=A6):Kl.BrotliCompress=Kl.BrotliDecompress=class{constructor(){throw new Error(\"Brotli is not supported in this version of Node.js\")}}});var QI=_((W4t,whe)=>{var Bit=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;whe.exports=Bit!==\"win32\"?t=>t:t=>t&&t.replace(/\\\\/g,\"/\")});var YR=_((V4t,Bhe)=>{\"use strict\";var vit=bI(),g6=QI(),d6=Symbol(\"slurp\");Bhe.exports=class extends vit{constructor(e,r,s){switch(super(),this.pause(),this.extended=r,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case\"File\":case\"OldFile\":case\"Link\":case\"SymbolicLink\":case\"CharacterDevice\":case\"BlockDevice\":case\"Directory\":case\"FIFO\":case\"ContiguousFile\":case\"GNUDumpDir\":break;case\"NextFileHasLongLinkpath\":case\"NextFileHasLongPath\":case\"OldGnuLongPath\":case\"GlobalExtendedHeader\":case\"ExtendedHeader\":case\"OldExtendedHeader\":this.meta=!0;break;default:this.ignore=!0}this.path=g6(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=g6(e.linkpath),this.uname=e.uname,this.gname=e.gname,r&&this[d6](r),s&&this[d6](s,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error(\"writing more to entry than is appropriate\");let s=this.remain,a=this.blockRemain;return this.remain=Math.max(0,s-r),this.blockRemain=Math.max(0,a-r),this.ignore?!0:s>=r?super.write(e):super.write(e.slice(0,s))}[d6](e,r){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(r&&s===\"path\")&&(this[s]=s===\"path\"||s===\"linkpath\"?g6(e[s]):e[s])}}});var m6=_(VR=>{\"use strict\";VR.name=new Map([[\"0\",\"File\"],[\"\",\"OldFile\"],[\"1\",\"Link\"],[\"2\",\"SymbolicLink\"],[\"3\",\"CharacterDevice\"],[\"4\",\"BlockDevice\"],[\"5\",\"Directory\"],[\"6\",\"FIFO\"],[\"7\",\"ContiguousFile\"],[\"g\",\"GlobalExtendedHeader\"],[\"x\",\"ExtendedHeader\"],[\"A\",\"SolarisACL\"],[\"D\",\"GNUDumpDir\"],[\"I\",\"Inode\"],[\"K\",\"NextFileHasLongLinkpath\"],[\"L\",\"NextFileHasLongPath\"],[\"M\",\"ContinuationFile\"],[\"N\",\"OldGnuLongPath\"],[\"S\",\"SparseFile\"],[\"V\",\"TapeVolumeHeader\"],[\"X\",\"OldExtendedHeader\"]]);VR.code=new Map(Array.from(VR.name).map(t=>[t[1],t[0]]))});var Phe=_((K4t,Dhe)=>{\"use strict\";var Sit=(t,e)=>{if(Number.isSafeInteger(t))t<0?Pit(t,e):Dit(t,e);else throw Error(\"cannot encode number outside of javascript safe integer range\");return e},Dit=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},Pit=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var s=e.length;s>1;s--){var a=t&255;t=Math.floor(t/256),r?e[s-1]=vhe(a):a===0?e[s-1]=0:(r=!0,e[s-1]=She(a))}},bit=t=>{let e=t[0],r=e===128?kit(t.slice(1,t.length)):e===255?xit(t):null;if(r===null)throw Error(\"invalid base256 encoding\");if(!Number.isSafeInteger(r))throw Error(\"parsed number outside of javascript safe integer range\");return r},xit=t=>{for(var e=t.length,r=0,s=!1,a=e-1;a>-1;a--){var n=t[a],c;s?c=vhe(n):n===0?c=n:(s=!0,c=She(n)),c!==0&&(r-=c*Math.pow(256,e-a-1))}return r},kit=t=>{for(var e=t.length,r=0,s=e-1;s>-1;s--){var a=t[s];a!==0&&(r+=a*Math.pow(256,e-s-1))}return r},vhe=t=>(255^t)&255,She=t=>(255^t)+1&255;Dhe.exports={encode:Sit,parse:bit}});var TI=_((z4t,xhe)=>{\"use strict\";var y6=m6(),RI=Ie(\"path\").posix,bhe=Phe(),E6=Symbol(\"slurp\"),zl=Symbol(\"type\"),w6=class{constructor(e,r,s,a){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[zl]=\"0\",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,r||0,s,a):e&&this.set(e)}decode(e,r,s,a){if(r||(r=0),!e||!(e.length>=r+512))throw new Error(\"need 512 bytes for header\");if(this.path=pm(e,r,100),this.mode=Q0(e,r+100,8),this.uid=Q0(e,r+108,8),this.gid=Q0(e,r+116,8),this.size=Q0(e,r+124,12),this.mtime=I6(e,r+136,12),this.cksum=Q0(e,r+148,12),this[E6](s),this[E6](a,!0),this[zl]=pm(e,r+156,1),this[zl]===\"\"&&(this[zl]=\"0\"),this[zl]===\"0\"&&this.path.substr(-1)===\"/\"&&(this[zl]=\"5\"),this[zl]===\"5\"&&(this.size=0),this.linkpath=pm(e,r+157,100),e.slice(r+257,r+265).toString()===\"ustar\\x0000\")if(this.uname=pm(e,r+265,32),this.gname=pm(e,r+297,32),this.devmaj=Q0(e,r+329,8),this.devmin=Q0(e,r+337,8),e[r+475]!==0){let c=pm(e,r+345,155);this.path=c+\"/\"+this.path}else{let c=pm(e,r+345,130);c&&(this.path=c+\"/\"+this.path),this.atime=I6(e,r+476,12),this.ctime=I6(e,r+488,12)}let n=8*32;for(let c=r;c<r+148;c++)n+=e[c];for(let c=r+156;c<r+512;c++)n+=e[c];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[E6](e,r){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(r&&s===\"path\")&&(this[s]=e[s])}encode(e,r){if(e||(e=this.block=Buffer.alloc(512),r=0),r||(r=0),!(e.length>=r+512))throw new Error(\"need 512 bytes for header\");let s=this.ctime||this.atime?130:155,a=Qit(this.path||\"\",s),n=a[0],c=a[1];this.needPax=a[2],this.needPax=hm(e,r,100,n)||this.needPax,this.needPax=R0(e,r+100,8,this.mode)||this.needPax,this.needPax=R0(e,r+108,8,this.uid)||this.needPax,this.needPax=R0(e,r+116,8,this.gid)||this.needPax,this.needPax=R0(e,r+124,12,this.size)||this.needPax,this.needPax=C6(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this[zl].charCodeAt(0),this.needPax=hm(e,r+157,100,this.linkpath)||this.needPax,e.write(\"ustar\\x0000\",r+257,8),this.needPax=hm(e,r+265,32,this.uname)||this.needPax,this.needPax=hm(e,r+297,32,this.gname)||this.needPax,this.needPax=R0(e,r+329,8,this.devmaj)||this.needPax,this.needPax=R0(e,r+337,8,this.devmin)||this.needPax,this.needPax=hm(e,r+345,s,c)||this.needPax,e[r+475]!==0?this.needPax=hm(e,r+345,155,c)||this.needPax:(this.needPax=hm(e,r+345,130,c)||this.needPax,this.needPax=C6(e,r+476,12,this.atime)||this.needPax,this.needPax=C6(e,r+488,12,this.ctime)||this.needPax);let f=8*32;for(let p=r;p<r+148;p++)f+=e[p];for(let p=r+156;p<r+512;p++)f+=e[p];return this.cksum=f,R0(e,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let r in e)e[r]!==null&&e[r]!==void 0&&(this[r]=e[r])}get type(){return y6.name.get(this[zl])||this[zl]}get typeKey(){return this[zl]}set type(e){y6.code.has(e)?this[zl]=y6.code.get(e):this[zl]=e}},Qit=(t,e)=>{let s=t,a=\"\",n,c=RI.parse(t).root||\".\";if(Buffer.byteLength(s)<100)n=[s,a,!1];else{a=RI.dirname(s),s=RI.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(a)<=e?n=[s,a,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(a)<=e?n=[s.substr(0,99),a,!0]:(s=RI.join(RI.basename(a),s),a=RI.dirname(a));while(a!==c&&!n);n||(n=[t.substr(0,99),\"\",!0])}return n},pm=(t,e,r)=>t.slice(e,e+r).toString(\"utf8\").replace(/\\0.*/,\"\"),I6=(t,e,r)=>Rit(Q0(t,e,r)),Rit=t=>t===null?null:new Date(t*1e3),Q0=(t,e,r)=>t[e]&128?bhe.parse(t.slice(e,e+r)):Fit(t,e,r),Tit=t=>isNaN(t)?null:t,Fit=(t,e,r)=>Tit(parseInt(t.slice(e,e+r).toString(\"utf8\").replace(/\\0.*$/,\"\").trim(),8)),Nit={12:8589934591,8:2097151},R0=(t,e,r,s)=>s===null?!1:s>Nit[r]||s<0?(bhe.encode(s,t.slice(e,e+r)),!0):(Oit(t,e,r,s),!1),Oit=(t,e,r,s)=>t.write(Lit(s,r),e,r,\"ascii\"),Lit=(t,e)=>Mit(Math.floor(t).toString(8),e),Mit=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join(\"0\")+t+\" \")+\"\\0\",C6=(t,e,r,s)=>s===null?!1:R0(t,e,r,s.getTime()/1e3),Uit=new Array(156).join(\"\\0\"),hm=(t,e,r,s)=>s===null?!1:(t.write(s+Uit,e,r,\"utf8\"),s.length!==Buffer.byteLength(s)||s.length>r);xhe.exports=w6});var JR=_((Z4t,khe)=>{\"use strict\";var _it=TI(),Hit=Ie(\"path\"),Sv=class{constructor(e,r){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=r||!1}encode(){let e=this.encodeBody();if(e===\"\")return null;let r=Buffer.byteLength(e),s=512*Math.ceil(1+r/512),a=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)a[n]=0;new _it({path:(\"PaxHeader/\"+Hit.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?\"GlobalExtendedHeader\":\"ExtendedHeader\",linkpath:\"\",uname:this.uname||\"\",gname:this.gname||\"\",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(a),a.write(e,512,r,\"utf8\");for(let n=r+512;n<a.length;n++)a[n]=0;return a}encodeBody(){return this.encodeField(\"path\")+this.encodeField(\"ctime\")+this.encodeField(\"atime\")+this.encodeField(\"dev\")+this.encodeField(\"ino\")+this.encodeField(\"nlink\")+this.encodeField(\"charset\")+this.encodeField(\"comment\")+this.encodeField(\"gid\")+this.encodeField(\"gname\")+this.encodeField(\"linkpath\")+this.encodeField(\"mtime\")+this.encodeField(\"size\")+this.encodeField(\"uid\")+this.encodeField(\"uname\")}encodeField(e){if(this[e]===null||this[e]===void 0)return\"\";let r=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=\" \"+(e===\"dev\"||e===\"ino\"||e===\"nlink\"?\"SCHILY.\":\"\")+e+\"=\"+r+`\n`,a=Buffer.byteLength(s),n=Math.floor(Math.log(a)/Math.log(10))+1;return a+n>=Math.pow(10,n)&&(n+=1),n+a+s}};Sv.parse=(t,e,r)=>new Sv(jit(Git(t),e),r);var jit=(t,e)=>e?Object.keys(t).reduce((r,s)=>(r[s]=t[s],r),e):t,Git=t=>t.replace(/\\n$/,\"\").split(`\n`).reduce(qit,Object.create(null)),qit=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+\" \").length);let s=e.split(\"=\"),a=s.shift().replace(/^SCHILY\\.(dev|ino|nlink)/,\"$1\");if(!a)return t;let n=s.join(\"=\");return t[a]=/^([A-Z]+\\.)?([mac]|birth|creation)time$/.test(a)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t};khe.exports=Sv});var FI=_((X4t,Qhe)=>{Qhe.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)===\"/\";)r=e,e--;return r===-1?t:t.slice(0,r)}});var KR=_(($4t,Rhe)=>{\"use strict\";Rhe.exports=t=>class extends t{warn(e,r,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=r instanceof Error&&r.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(r instanceof Error&&(s=Object.assign(r,s),r=r.message),this.emit(\"warn\",s.tarCode,r,s)):r instanceof Error?this.emit(\"error\",Object.assign(r,s)):this.emit(\"error\",Object.assign(new Error(`${e}: ${r}`),s))}}});var v6=_((t3t,The)=>{\"use strict\";var zR=[\"|\",\"<\",\">\",\"?\",\":\"],B6=zR.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),Wit=new Map(zR.map((t,e)=>[t,B6[e]])),Yit=new Map(B6.map((t,e)=>[t,zR[e]]));The.exports={encode:t=>zR.reduce((e,r)=>e.split(r).join(Wit.get(r)),t),decode:t=>B6.reduce((e,r)=>e.split(r).join(Yit.get(r)),t)}});var S6=_((r3t,Nhe)=>{var{isAbsolute:Vit,parse:Fhe}=Ie(\"path\").win32;Nhe.exports=t=>{let e=\"\",r=Fhe(t);for(;Vit(t)||r.root;){let s=t.charAt(0)===\"/\"&&t.slice(0,4)!==\"//?/\"?\"/\":r.root;t=t.substr(s.length),e+=s,r=Fhe(t)}return[e,t]}});var Lhe=_((n3t,Ohe)=>{\"use strict\";Ohe.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var N6=_((o3t,Zhe)=>{\"use strict\";var qhe=bI(),Whe=JR(),Yhe=TI(),nA=Ie(\"fs\"),Mhe=Ie(\"path\"),rA=QI(),Jit=FI(),Vhe=(t,e)=>e?(t=rA(t).replace(/^\\.(\\/|$)/,\"\"),Jit(e)+\"/\"+t):rA(t),Kit=16*1024*1024,Uhe=Symbol(\"process\"),_he=Symbol(\"file\"),Hhe=Symbol(\"directory\"),P6=Symbol(\"symlink\"),jhe=Symbol(\"hardlink\"),Dv=Symbol(\"header\"),ZR=Symbol(\"read\"),b6=Symbol(\"lstat\"),XR=Symbol(\"onlstat\"),x6=Symbol(\"onread\"),k6=Symbol(\"onreadlink\"),Q6=Symbol(\"openfile\"),R6=Symbol(\"onopenfile\"),T0=Symbol(\"close\"),$R=Symbol(\"mode\"),T6=Symbol(\"awaitDrain\"),D6=Symbol(\"ondrain\"),iA=Symbol(\"prefix\"),Ghe=Symbol(\"hadError\"),Jhe=KR(),zit=v6(),Khe=S6(),zhe=Lhe(),eT=Jhe(class extends qhe{constructor(e,r){if(r=r||{},super(r),typeof e!=\"string\")throw new TypeError(\"path is required\");this.path=rA(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||\"\",this.maxReadSize=r.maxReadSize||Kit,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=rA(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?rA(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn==\"function\"&&this.on(\"warn\",r.onwarn);let s=!1;if(!this.preservePaths){let[a,n]=Khe(this.path);a&&(this.path=n,s=a)}this.win32=!!r.win32||process.platform===\"win32\",this.win32&&(this.path=zit.decode(this.path.replace(/\\\\/g,\"/\")),e=e.replace(/\\\\/g,\"/\")),this.absolute=rA(r.absolute||Mhe.resolve(this.cwd,e)),this.path===\"\"&&(this.path=\"./\"),s&&this.warn(\"TAR_ENTRY_INFO\",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[XR](this.statCache.get(this.absolute)):this[b6]()}emit(e,...r){return e===\"error\"&&(this[Ghe]=!0),super.emit(e,...r)}[b6](){nA.lstat(this.absolute,(e,r)=>{if(e)return this.emit(\"error\",e);this[XR](r)})}[XR](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Xit(e),this.emit(\"stat\",e),this[Uhe]()}[Uhe](){switch(this.type){case\"File\":return this[_he]();case\"Directory\":return this[Hhe]();case\"SymbolicLink\":return this[P6]();default:return this.end()}}[$R](e){return zhe(e,this.type===\"Directory\",this.portable)}[iA](e){return Vhe(e,this.prefix)}[Dv](){this.type===\"Directory\"&&this.portable&&(this.noMtime=!0),this.header=new Yhe({path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,mode:this[$R](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:\"\",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Whe({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Hhe](){this.path.substr(-1)!==\"/\"&&(this.path+=\"/\"),this.stat.size=0,this[Dv](),this.end()}[P6](){nA.readlink(this.absolute,(e,r)=>{if(e)return this.emit(\"error\",e);this[k6](r)})}[k6](e){this.linkpath=rA(e),this[Dv](),this.end()}[jhe](e){this.type=\"Link\",this.linkpath=rA(Mhe.relative(this.cwd,e)),this.stat.size=0,this[Dv](),this.end()}[_he](){if(this.stat.nlink>1){let e=this.stat.dev+\":\"+this.stat.ino;if(this.linkCache.has(e)){let r=this.linkCache.get(e);if(r.indexOf(this.cwd)===0)return this[jhe](r)}this.linkCache.set(e,this.absolute)}if(this[Dv](),this.stat.size===0)return this.end();this[Q6]()}[Q6](){nA.open(this.absolute,\"r\",(e,r)=>{if(e)return this.emit(\"error\",e);this[R6](r)})}[R6](e){if(this.fd=e,this[Ghe])return this[T0]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ZR]()}[ZR](){let{fd:e,buf:r,offset:s,length:a,pos:n}=this;nA.read(e,r,s,a,n,(c,f)=>{if(c)return this[T0](()=>this.emit(\"error\",c));this[x6](f)})}[T0](e){nA.close(this.fd,e)}[x6](e){if(e<=0&&this.remain>0){let a=new Error(\"encountered unexpected EOF\");return a.path=this.absolute,a.syscall=\"read\",a.code=\"EOF\",this[T0](()=>this.emit(\"error\",a))}if(e>this.remain){let a=new Error(\"did not encounter expected EOF\");return a.path=this.absolute,a.syscall=\"read\",a.code=\"EOF\",this[T0](()=>this.emit(\"error\",a))}if(e===this.remain)for(let a=e;a<this.length&&e<this.blockRemain;a++)this.buf[a+this.offset]=0,e++,this.remain++;let r=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(r)?this[D6]():this[T6](()=>this[D6]())}[T6](e){this.once(\"drain\",e)}write(e){if(this.blockRemain<e.length){let r=new Error(\"writing more data than expected\");return r.path=this.absolute,this.emit(\"error\",r)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[D6](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[T0](e=>e?this.emit(\"error\",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[ZR]()}}),F6=class extends eT{[b6](){this[XR](nA.lstatSync(this.absolute))}[P6](){this[k6](nA.readlinkSync(this.absolute))}[Q6](){this[R6](nA.openSync(this.absolute,\"r\"))}[ZR](){let e=!0;try{let{fd:r,buf:s,offset:a,length:n,pos:c}=this,f=nA.readSync(r,s,a,n,c);this[x6](f),e=!1}finally{if(e)try{this[T0](()=>{})}catch{}}}[T6](e){e()}[T0](e){nA.closeSync(this.fd),e()}},Zit=Jhe(class extends qhe{constructor(e,r){r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=e,this.type=e.type,this.type===\"Directory\"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix||null,this.path=rA(e.path),this.mode=this[$R](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:r.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=rA(e.linkpath),typeof r.onwarn==\"function\"&&this.on(\"warn\",r.onwarn);let s=!1;if(!this.preservePaths){let[a,n]=Khe(this.path);a&&(this.path=n,s=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Yhe({path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn(\"TAR_ENTRY_INFO\",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Whe({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[iA](this.path),linkpath:this.type===\"Link\"?this[iA](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[iA](e){return Vhe(e,this.prefix)}[$R](e){return zhe(e,this.type===\"Directory\",this.portable)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error(\"writing more to entry than is appropriate\");return this.blockRemain-=r,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});eT.Sync=F6;eT.Tar=Zit;var Xit=t=>t.isFile()?\"File\":t.isDirectory()?\"Directory\":t.isSymbolicLink()?\"SymbolicLink\":\"Unsupported\";Zhe.exports=eT});var cT=_((l3t,i0e)=>{\"use strict\";var aT=class{constructor(e,r){this.path=e||\"./\",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},$it=bI(),est=h6(),tst=YR(),q6=N6(),rst=q6.Sync,nst=q6.Tar,ist=$x(),Xhe=Buffer.alloc(1024),nT=Symbol(\"onStat\"),tT=Symbol(\"ended\"),sA=Symbol(\"queue\"),NI=Symbol(\"current\"),gm=Symbol(\"process\"),rT=Symbol(\"processing\"),$he=Symbol(\"processJob\"),oA=Symbol(\"jobs\"),O6=Symbol(\"jobDone\"),iT=Symbol(\"addFSEntry\"),e0e=Symbol(\"addTarEntry\"),_6=Symbol(\"stat\"),H6=Symbol(\"readdir\"),sT=Symbol(\"onreaddir\"),oT=Symbol(\"pipe\"),t0e=Symbol(\"entry\"),L6=Symbol(\"entryOpt\"),j6=Symbol(\"writeEntryClass\"),n0e=Symbol(\"write\"),M6=Symbol(\"ondrain\"),lT=Ie(\"fs\"),r0e=Ie(\"path\"),sst=KR(),U6=QI(),W6=sst(class extends $it{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||\"\",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=U6(e.prefix||\"\"),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[j6]=q6,typeof e.onwarn==\"function\"&&this.on(\"warn\",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!=\"object\"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new est.Gzip(e.gzip),this.zip.on(\"data\",r=>super.write(r)),this.zip.on(\"end\",r=>super.end()),this.zip.on(\"drain\",r=>this[M6]()),this.on(\"resume\",r=>this.zip.resume())):this.on(\"drain\",this[M6]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter==\"function\"?e.filter:r=>!0,this[sA]=new ist,this[oA]=0,this.jobs=+e.jobs||4,this[rT]=!1,this[tT]=!1}[n0e](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[tT]=!0,this[gm](),this}write(e){if(this[tT])throw new Error(\"write after end\");return e instanceof tst?this[e0e](e):this[iT](e),this.flowing}[e0e](e){let r=U6(r0e.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new aT(e.path,r,!1);s.entry=new nst(e,this[L6](s)),s.entry.on(\"end\",a=>this[O6](s)),this[oA]+=1,this[sA].push(s)}this[gm]()}[iT](e){let r=U6(r0e.resolve(this.cwd,e));this[sA].push(new aT(e,r)),this[gm]()}[_6](e){e.pending=!0,this[oA]+=1;let r=this.follow?\"stat\":\"lstat\";lT[r](e.absolute,(s,a)=>{e.pending=!1,this[oA]-=1,s?this.emit(\"error\",s):this[nT](e,a)})}[nT](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[gm]()}[H6](e){e.pending=!0,this[oA]+=1,lT.readdir(e.absolute,(r,s)=>{if(e.pending=!1,this[oA]-=1,r)return this.emit(\"error\",r);this[sT](e,s)})}[sT](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[gm]()}[gm](){if(!this[rT]){this[rT]=!0;for(let e=this[sA].head;e!==null&&this[oA]<this.jobs;e=e.next)if(this[$he](e.value),e.value.ignore){let r=e.next;this[sA].removeNode(e),e.next=r}this[rT]=!1,this[tT]&&!this[sA].length&&this[oA]===0&&(this.zip?this.zip.end(Xhe):(super.write(Xhe),super.end()))}}get[NI](){return this[sA]&&this[sA].head&&this[sA].head.value}[O6](e){this[sA].shift(),this[oA]-=1,this[gm]()}[$he](e){if(!e.pending){if(e.entry){e===this[NI]&&!e.piped&&this[oT](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[nT](e,this.statCache.get(e.absolute)):this[_6](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[sT](e,this.readdirCache.get(e.absolute)):this[H6](e),!e.readdir))){if(e.entry=this[t0e](e),!e.entry){e.ignore=!0;return}e===this[NI]&&!e.piped&&this[oT](e)}}}[L6](e){return{onwarn:(r,s,a)=>this.warn(r,s,a),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[t0e](e){this[oA]+=1;try{return new this[j6](e.path,this[L6](e)).on(\"end\",()=>this[O6](e)).on(\"error\",r=>this.emit(\"error\",r))}catch(r){this.emit(\"error\",r)}}[M6](){this[NI]&&this[NI].entry&&this[NI].entry.resume()}[oT](e){e.piped=!0,e.readdir&&e.readdir.forEach(a=>{let n=e.path,c=n===\"./\"?\"\":n.replace(/\\/*$/,\"/\");this[iT](c+a)});let r=e.entry,s=this.zip;s?r.on(\"data\",a=>{s.write(a)||r.pause()}):r.on(\"data\",a=>{super.write(a)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),G6=class extends W6{constructor(e){super(e),this[j6]=rst}pause(){}resume(){}[_6](e){let r=this.follow?\"statSync\":\"lstatSync\";this[nT](e,lT[r](e.absolute))}[H6](e,r){this[sT](e,lT.readdirSync(e.absolute))}[oT](e){let r=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(a=>{let n=e.path,c=n===\"./\"?\"\":n.replace(/\\/*$/,\"/\");this[iT](c+a)}),s?r.on(\"data\",a=>{s.write(a)}):r.on(\"data\",a=>{super[n0e](a)})}};W6.Sync=G6;i0e.exports=W6});var GI=_(bv=>{\"use strict\";var ost=bI(),ast=Ie(\"events\").EventEmitter,fl=Ie(\"fs\"),J6=fl.writev;if(!J6){let t=process.binding(\"fs\"),e=t.FSReqWrap||t.FSReqCallback;J6=(r,s,a,n)=>{let c=(p,h)=>n(p,h,s),f=new e;f.oncomplete=c,t.writeBuffers(r,s,a,f)}}var HI=Symbol(\"_autoClose\"),Yu=Symbol(\"_close\"),Pv=Symbol(\"_ended\"),ii=Symbol(\"_fd\"),s0e=Symbol(\"_finished\"),N0=Symbol(\"_flags\"),Y6=Symbol(\"_flush\"),K6=Symbol(\"_handleChunk\"),z6=Symbol(\"_makeBuf\"),hT=Symbol(\"_mode\"),uT=Symbol(\"_needDrain\"),UI=Symbol(\"_onerror\"),jI=Symbol(\"_onopen\"),V6=Symbol(\"_onread\"),LI=Symbol(\"_onwrite\"),O0=Symbol(\"_open\"),Wp=Symbol(\"_path\"),dm=Symbol(\"_pos\"),aA=Symbol(\"_queue\"),MI=Symbol(\"_read\"),o0e=Symbol(\"_readSize\"),F0=Symbol(\"_reading\"),fT=Symbol(\"_remain\"),a0e=Symbol(\"_size\"),AT=Symbol(\"_write\"),OI=Symbol(\"_writing\"),pT=Symbol(\"_defaultFlag\"),_I=Symbol(\"_errored\"),gT=class extends ost{constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!=\"string\")throw new TypeError(\"path must be a string\");this[_I]=!1,this[ii]=typeof r.fd==\"number\"?r.fd:null,this[Wp]=e,this[o0e]=r.readSize||16*1024*1024,this[F0]=!1,this[a0e]=typeof r.size==\"number\"?r.size:1/0,this[fT]=this[a0e],this[HI]=typeof r.autoClose==\"boolean\"?r.autoClose:!0,typeof this[ii]==\"number\"?this[MI]():this[O0]()}get fd(){return this[ii]}get path(){return this[Wp]}write(){throw new TypeError(\"this is a readable stream\")}end(){throw new TypeError(\"this is a readable stream\")}[O0](){fl.open(this[Wp],\"r\",(e,r)=>this[jI](e,r))}[jI](e,r){e?this[UI](e):(this[ii]=r,this.emit(\"open\",r),this[MI]())}[z6](){return Buffer.allocUnsafe(Math.min(this[o0e],this[fT]))}[MI](){if(!this[F0]){this[F0]=!0;let e=this[z6]();if(e.length===0)return process.nextTick(()=>this[V6](null,0,e));fl.read(this[ii],e,0,e.length,null,(r,s,a)=>this[V6](r,s,a))}}[V6](e,r,s){this[F0]=!1,e?this[UI](e):this[K6](r,s)&&this[MI]()}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.close(e,r=>r?this.emit(\"error\",r):this.emit(\"close\"))}}[UI](e){this[F0]=!0,this[Yu](),this.emit(\"error\",e)}[K6](e,r){let s=!1;return this[fT]-=e,e>0&&(s=super.write(e<r.length?r.slice(0,e):r)),(e===0||this[fT]<=0)&&(s=!1,this[Yu](),super.end()),s}emit(e,r){switch(e){case\"prefinish\":case\"finish\":break;case\"drain\":typeof this[ii]==\"number\"&&this[MI]();break;case\"error\":return this[_I]?void 0:(this[_I]=!0,super.emit(e,r));default:return super.emit(e,r)}}},Z6=class extends gT{[O0](){let e=!0;try{this[jI](null,fl.openSync(this[Wp],\"r\")),e=!1}finally{e&&this[Yu]()}}[MI](){let e=!0;try{if(!this[F0]){this[F0]=!0;do{let r=this[z6](),s=r.length===0?0:fl.readSync(this[ii],r,0,r.length,null);if(!this[K6](s,r))break}while(!0);this[F0]=!1}e=!1}finally{e&&this[Yu]()}}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.closeSync(e),this.emit(\"close\")}}},dT=class extends ast{constructor(e,r){r=r||{},super(r),this.readable=!1,this.writable=!0,this[_I]=!1,this[OI]=!1,this[Pv]=!1,this[uT]=!1,this[aA]=[],this[Wp]=e,this[ii]=typeof r.fd==\"number\"?r.fd:null,this[hT]=r.mode===void 0?438:r.mode,this[dm]=typeof r.start==\"number\"?r.start:null,this[HI]=typeof r.autoClose==\"boolean\"?r.autoClose:!0;let s=this[dm]!==null?\"r+\":\"w\";this[pT]=r.flags===void 0,this[N0]=this[pT]?s:r.flags,this[ii]===null&&this[O0]()}emit(e,r){if(e===\"error\"){if(this[_I])return;this[_I]=!0}return super.emit(e,r)}get fd(){return this[ii]}get path(){return this[Wp]}[UI](e){this[Yu](),this[OI]=!0,this.emit(\"error\",e)}[O0](){fl.open(this[Wp],this[N0],this[hT],(e,r)=>this[jI](e,r))}[jI](e,r){this[pT]&&this[N0]===\"r+\"&&e&&e.code===\"ENOENT\"?(this[N0]=\"w\",this[O0]()):e?this[UI](e):(this[ii]=r,this.emit(\"open\",r),this[Y6]())}end(e,r){return e&&this.write(e,r),this[Pv]=!0,!this[OI]&&!this[aA].length&&typeof this[ii]==\"number\"&&this[LI](null,0),this}write(e,r){return typeof e==\"string\"&&(e=Buffer.from(e,r)),this[Pv]?(this.emit(\"error\",new Error(\"write() after end()\")),!1):this[ii]===null||this[OI]||this[aA].length?(this[aA].push(e),this[uT]=!0,!1):(this[OI]=!0,this[AT](e),!0)}[AT](e){fl.write(this[ii],e,0,e.length,this[dm],(r,s)=>this[LI](r,s))}[LI](e,r){e?this[UI](e):(this[dm]!==null&&(this[dm]+=r),this[aA].length?this[Y6]():(this[OI]=!1,this[Pv]&&!this[s0e]?(this[s0e]=!0,this[Yu](),this.emit(\"finish\")):this[uT]&&(this[uT]=!1,this.emit(\"drain\"))))}[Y6](){if(this[aA].length===0)this[Pv]&&this[LI](null,0);else if(this[aA].length===1)this[AT](this[aA].pop());else{let e=this[aA];this[aA]=[],J6(this[ii],e,this[dm],(r,s)=>this[LI](r,s))}}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.close(e,r=>r?this.emit(\"error\",r):this.emit(\"close\"))}}},X6=class extends dT{[O0](){let e;if(this[pT]&&this[N0]===\"r+\")try{e=fl.openSync(this[Wp],this[N0],this[hT])}catch(r){if(r.code===\"ENOENT\")return this[N0]=\"w\",this[O0]();throw r}else e=fl.openSync(this[Wp],this[N0],this[hT]);this[jI](null,e)}[Yu](){if(this[HI]&&typeof this[ii]==\"number\"){let e=this[ii];this[ii]=null,fl.closeSync(e),this.emit(\"close\")}}[AT](e){let r=!0;try{this[LI](null,fl.writeSync(this[ii],e,0,e.length,this[dm])),r=!1}finally{if(r)try{this[Yu]()}catch{}}}};bv.ReadStream=gT;bv.ReadStreamSync=Z6;bv.WriteStream=dT;bv.WriteStreamSync=X6});var BT=_((f3t,h0e)=>{\"use strict\";var lst=KR(),cst=TI(),ust=Ie(\"events\"),fst=$x(),Ast=1024*1024,pst=YR(),l0e=JR(),hst=h6(),$6=Buffer.from([31,139]),Lc=Symbol(\"state\"),mm=Symbol(\"writeEntry\"),Yp=Symbol(\"readEntry\"),eG=Symbol(\"nextEntry\"),c0e=Symbol(\"processEntry\"),Mc=Symbol(\"extendedHeader\"),xv=Symbol(\"globalExtendedHeader\"),L0=Symbol(\"meta\"),u0e=Symbol(\"emitMeta\"),Di=Symbol(\"buffer\"),Vp=Symbol(\"queue\"),ym=Symbol(\"ended\"),f0e=Symbol(\"emittedEnd\"),Em=Symbol(\"emit\"),Al=Symbol(\"unzip\"),mT=Symbol(\"consumeChunk\"),yT=Symbol(\"consumeChunkSub\"),tG=Symbol(\"consumeBody\"),A0e=Symbol(\"consumeMeta\"),p0e=Symbol(\"consumeHeader\"),ET=Symbol(\"consuming\"),rG=Symbol(\"bufferConcat\"),nG=Symbol(\"maybeEnd\"),kv=Symbol(\"writing\"),M0=Symbol(\"aborted\"),IT=Symbol(\"onDone\"),Im=Symbol(\"sawValidEntry\"),CT=Symbol(\"sawNullBlock\"),wT=Symbol(\"sawEOF\"),gst=t=>!0;h0e.exports=lst(class extends ust{constructor(e){e=e||{},super(e),this.file=e.file||\"\",this[Im]=null,this.on(IT,r=>{(this[Lc]===\"begin\"||this[Im]===!1)&&this.warn(\"TAR_BAD_ARCHIVE\",\"Unrecognized archive format\")}),e.ondone?this.on(IT,e.ondone):this.on(IT,r=>{this.emit(\"prefinish\"),this.emit(\"finish\"),this.emit(\"end\"),this.emit(\"close\")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Ast,this.filter=typeof e.filter==\"function\"?e.filter:gst,this.writable=!0,this.readable=!1,this[Vp]=new fst,this[Di]=null,this[Yp]=null,this[mm]=null,this[Lc]=\"begin\",this[L0]=\"\",this[Mc]=null,this[xv]=null,this[ym]=!1,this[Al]=null,this[M0]=!1,this[CT]=!1,this[wT]=!1,typeof e.onwarn==\"function\"&&this.on(\"warn\",e.onwarn),typeof e.onentry==\"function\"&&this.on(\"entry\",e.onentry)}[p0e](e,r){this[Im]===null&&(this[Im]=!1);let s;try{s=new cst(e,r,this[Mc],this[xv])}catch(a){return this.warn(\"TAR_ENTRY_INVALID\",a)}if(s.nullBlock)this[CT]?(this[wT]=!0,this[Lc]===\"begin\"&&(this[Lc]=\"header\"),this[Em](\"eof\")):(this[CT]=!0,this[Em](\"nullBlock\"));else if(this[CT]=!1,!s.cksumValid)this.warn(\"TAR_ENTRY_INVALID\",\"checksum failure\",{header:s});else if(!s.path)this.warn(\"TAR_ENTRY_INVALID\",\"path is required\",{header:s});else{let a=s.type;if(/^(Symbolic)?Link$/.test(a)&&!s.linkpath)this.warn(\"TAR_ENTRY_INVALID\",\"linkpath required\",{header:s});else if(!/^(Symbolic)?Link$/.test(a)&&s.linkpath)this.warn(\"TAR_ENTRY_INVALID\",\"linkpath forbidden\",{header:s});else{let n=this[mm]=new pst(s,this[Mc],this[xv]);if(!this[Im])if(n.remain){let c=()=>{n.invalid||(this[Im]=!0)};n.on(\"end\",c)}else this[Im]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Em](\"ignoredEntry\",n),this[Lc]=\"ignore\",n.resume()):n.size>0&&(this[L0]=\"\",n.on(\"data\",c=>this[L0]+=c),this[Lc]=\"meta\"):(this[Mc]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Em](\"ignoredEntry\",n),this[Lc]=n.remain?\"ignore\":\"header\",n.resume()):(n.remain?this[Lc]=\"body\":(this[Lc]=\"header\",n.end()),this[Yp]?this[Vp].push(n):(this[Vp].push(n),this[eG]())))}}}[c0e](e){let r=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Yp]=e,this.emit(\"entry\",e),e.emittedEnd||(e.on(\"end\",s=>this[eG]()),r=!1)):(this[Yp]=null,r=!1),r}[eG](){do;while(this[c0e](this[Vp].shift()));if(!this[Vp].length){let e=this[Yp];!e||e.flowing||e.size===e.remain?this[kv]||this.emit(\"drain\"):e.once(\"drain\",s=>this.emit(\"drain\"))}}[tG](e,r){let s=this[mm],a=s.blockRemain,n=a>=e.length&&r===0?e:e.slice(r,r+a);return s.write(n),s.blockRemain||(this[Lc]=\"header\",this[mm]=null,s.end()),n.length}[A0e](e,r){let s=this[mm],a=this[tG](e,r);return this[mm]||this[u0e](s),a}[Em](e,r,s){!this[Vp].length&&!this[Yp]?this.emit(e,r,s):this[Vp].push([e,r,s])}[u0e](e){switch(this[Em](\"meta\",this[L0]),e.type){case\"ExtendedHeader\":case\"OldExtendedHeader\":this[Mc]=l0e.parse(this[L0],this[Mc],!1);break;case\"GlobalExtendedHeader\":this[xv]=l0e.parse(this[L0],this[xv],!0);break;case\"NextFileHasLongPath\":case\"OldGnuLongPath\":this[Mc]=this[Mc]||Object.create(null),this[Mc].path=this[L0].replace(/\\0.*/,\"\");break;case\"NextFileHasLongLinkpath\":this[Mc]=this[Mc]||Object.create(null),this[Mc].linkpath=this[L0].replace(/\\0.*/,\"\");break;default:throw new Error(\"unknown meta: \"+e.type)}}abort(e){this[M0]=!0,this.emit(\"abort\",e),this.warn(\"TAR_ABORT\",e,{recoverable:!1})}write(e){if(this[M0])return;if(this[Al]===null&&e){if(this[Di]&&(e=Buffer.concat([this[Di],e]),this[Di]=null),e.length<$6.length)return this[Di]=e,!0;for(let s=0;this[Al]===null&&s<$6.length;s++)e[s]!==$6[s]&&(this[Al]=!1);if(this[Al]===null){let s=this[ym];this[ym]=!1,this[Al]=new hst.Unzip,this[Al].on(\"data\",n=>this[mT](n)),this[Al].on(\"error\",n=>this.abort(n)),this[Al].on(\"end\",n=>{this[ym]=!0,this[mT]()}),this[kv]=!0;let a=this[Al][s?\"end\":\"write\"](e);return this[kv]=!1,a}}this[kv]=!0,this[Al]?this[Al].write(e):this[mT](e),this[kv]=!1;let r=this[Vp].length?!1:this[Yp]?this[Yp].flowing:!0;return!r&&!this[Vp].length&&this[Yp].once(\"drain\",s=>this.emit(\"drain\")),r}[rG](e){e&&!this[M0]&&(this[Di]=this[Di]?Buffer.concat([this[Di],e]):e)}[nG](){if(this[ym]&&!this[f0e]&&!this[M0]&&!this[ET]){this[f0e]=!0;let e=this[mm];if(e&&e.blockRemain){let r=this[Di]?this[Di].length:0;this.warn(\"TAR_BAD_ARCHIVE\",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[Di]&&e.write(this[Di]),e.end()}this[Em](IT)}}[mT](e){if(this[ET])this[rG](e);else if(!e&&!this[Di])this[nG]();else{if(this[ET]=!0,this[Di]){this[rG](e);let r=this[Di];this[Di]=null,this[yT](r)}else this[yT](e);for(;this[Di]&&this[Di].length>=512&&!this[M0]&&!this[wT];){let r=this[Di];this[Di]=null,this[yT](r)}this[ET]=!1}(!this[Di]||this[ym])&&this[nG]()}[yT](e){let r=0,s=e.length;for(;r+512<=s&&!this[M0]&&!this[wT];)switch(this[Lc]){case\"begin\":case\"header\":this[p0e](e,r),r+=512;break;case\"ignore\":case\"body\":r+=this[tG](e,r);break;case\"meta\":r+=this[A0e](e,r);break;default:throw new Error(\"invalid state: \"+this[Lc])}r<s&&(this[Di]?this[Di]=Buffer.concat([e.slice(r),this[Di]]):this[Di]=e.slice(r))}end(e){this[M0]||(this[Al]?this[Al].end(e):(this[ym]=!0,this.write(e)))}})});var vT=_((A3t,y0e)=>{\"use strict\";var dst=DI(),d0e=BT(),qI=Ie(\"fs\"),mst=GI(),g0e=Ie(\"path\"),iG=FI();y0e.exports=(t,e,r)=>{typeof t==\"function\"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e==\"function\"&&(r=e,e=null),e?e=Array.from(e):e=[];let s=dst(t);if(s.sync&&typeof r==\"function\")throw new TypeError(\"callback not supported for sync tar functions\");if(!s.file&&typeof r==\"function\")throw new TypeError(\"callback only supported with file option\");return e.length&&Est(s,e),s.noResume||yst(s),s.file&&s.sync?Ist(s):s.file?Cst(s,r):m0e(s)};var yst=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},Est=(t,e)=>{let r=new Map(e.map(n=>[iG(n),!0])),s=t.filter,a=(n,c)=>{let f=c||g0e.parse(n).root||\".\",p=n===f?!1:r.has(n)?r.get(n):a(g0e.dirname(n),f);return r.set(n,p),p};t.filter=s?(n,c)=>s(n,c)&&a(iG(n)):n=>a(iG(n))},Ist=t=>{let e=m0e(t),r=t.file,s=!0,a;try{let n=qI.statSync(r),c=t.maxReadSize||16*1024*1024;if(n.size<c)e.end(qI.readFileSync(r));else{let f=0,p=Buffer.allocUnsafe(c);for(a=qI.openSync(r,\"r\");f<n.size;){let h=qI.readSync(a,p,0,c,f);f+=h,e.write(p.slice(0,h))}e.end()}s=!1}finally{if(s&&a)try{qI.closeSync(a)}catch{}}},Cst=(t,e)=>{let r=new d0e(t),s=t.maxReadSize||16*1024*1024,a=t.file,n=new Promise((c,f)=>{r.on(\"error\",f),r.on(\"end\",c),qI.stat(a,(p,h)=>{if(p)f(p);else{let E=new mst.ReadStream(a,{readSize:s,size:h.size});E.on(\"error\",f),E.pipe(r)}})});return e?n.then(e,e):n},m0e=t=>new d0e(t)});var v0e=_((p3t,B0e)=>{\"use strict\";var wst=DI(),ST=cT(),E0e=GI(),I0e=vT(),C0e=Ie(\"path\");B0e.exports=(t,e,r)=>{if(typeof e==\"function\"&&(r=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError(\"no files or directories specified\");e=Array.from(e);let s=wst(t);if(s.sync&&typeof r==\"function\")throw new TypeError(\"callback not supported for sync tar functions\");if(!s.file&&typeof r==\"function\")throw new TypeError(\"callback only supported with file option\");return s.file&&s.sync?Bst(s,e):s.file?vst(s,e,r):s.sync?Sst(s,e):Dst(s,e)};var Bst=(t,e)=>{let r=new ST.Sync(t),s=new E0e.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(s),w0e(r,e)},vst=(t,e,r)=>{let s=new ST(t),a=new E0e.WriteStream(t.file,{mode:t.mode||438});s.pipe(a);let n=new Promise((c,f)=>{a.on(\"error\",f),a.on(\"close\",c),s.on(\"error\",f)});return sG(s,e),r?n.then(r,r):n},w0e=(t,e)=>{e.forEach(r=>{r.charAt(0)===\"@\"?I0e({file:C0e.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:s=>t.add(s)}):t.add(r)}),t.end()},sG=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)===\"@\")return I0e({file:C0e.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:s=>t.add(s)}).then(s=>sG(t,e));t.add(r)}t.end()},Sst=(t,e)=>{let r=new ST.Sync(t);return w0e(r,e),r},Dst=(t,e)=>{let r=new ST(t);return sG(r,e),r}});var oG=_((h3t,Q0e)=>{\"use strict\";var Pst=DI(),S0e=cT(),Zl=Ie(\"fs\"),D0e=GI(),P0e=vT(),b0e=Ie(\"path\"),x0e=TI();Q0e.exports=(t,e,r)=>{let s=Pst(t);if(!s.file)throw new TypeError(\"file is required\");if(s.gzip)throw new TypeError(\"cannot append to compressed archives\");if(!e||!Array.isArray(e)||!e.length)throw new TypeError(\"no files or directories specified\");return e=Array.from(e),s.sync?bst(s,e):kst(s,e,r)};var bst=(t,e)=>{let r=new S0e.Sync(t),s=!0,a,n;try{try{a=Zl.openSync(t.file,\"r+\")}catch(p){if(p.code===\"ENOENT\")a=Zl.openSync(t.file,\"w+\");else throw p}let c=Zl.fstatSync(a),f=Buffer.alloc(512);e:for(n=0;n<c.size;n+=512){for(let E=0,C=0;E<512;E+=C){if(C=Zl.readSync(a,f,E,f.length-E,n+E),n===0&&f[0]===31&&f[1]===139)throw new Error(\"cannot append to compressed archives\");if(!C)break e}let p=new x0e(f);if(!p.cksumValid)break;let h=512*Math.ceil(p.size/512);if(n+h+512>c.size)break;n+=h,t.mtimeCache&&t.mtimeCache.set(p.path,p.mtime)}s=!1,xst(t,r,n,a,e)}finally{if(s)try{Zl.closeSync(a)}catch{}}},xst=(t,e,r,s,a)=>{let n=new D0e.WriteStreamSync(t.file,{fd:s,start:r});e.pipe(n),Qst(e,a)},kst=(t,e,r)=>{e=Array.from(e);let s=new S0e(t),a=(c,f,p)=>{let h=(I,T)=>{I?Zl.close(c,N=>p(I)):p(null,T)},E=0;if(f===0)return h(null,0);let C=0,S=Buffer.alloc(512),b=(I,T)=>{if(I)return h(I);if(C+=T,C<512&&T)return Zl.read(c,S,C,S.length-C,E+C,b);if(E===0&&S[0]===31&&S[1]===139)return h(new Error(\"cannot append to compressed archives\"));if(C<512)return h(null,E);let N=new x0e(S);if(!N.cksumValid)return h(null,E);let U=512*Math.ceil(N.size/512);if(E+U+512>f||(E+=U+512,E>=f))return h(null,E);t.mtimeCache&&t.mtimeCache.set(N.path,N.mtime),C=0,Zl.read(c,S,0,512,E,b)};Zl.read(c,S,0,512,E,b)},n=new Promise((c,f)=>{s.on(\"error\",f);let p=\"r+\",h=(E,C)=>{if(E&&E.code===\"ENOENT\"&&p===\"r+\")return p=\"w+\",Zl.open(t.file,p,h);if(E)return f(E);Zl.fstat(C,(S,b)=>{if(S)return Zl.close(C,()=>f(S));a(C,b.size,(I,T)=>{if(I)return f(I);let N=new D0e.WriteStream(t.file,{fd:C,start:T});s.pipe(N),N.on(\"error\",f),N.on(\"close\",c),k0e(s,e)})})};Zl.open(t.file,p,h)});return r?n.then(r,r):n},Qst=(t,e)=>{e.forEach(r=>{r.charAt(0)===\"@\"?P0e({file:b0e.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:s=>t.add(s)}):t.add(r)}),t.end()},k0e=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)===\"@\")return P0e({file:b0e.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:s=>t.add(s)}).then(s=>k0e(t,e));t.add(r)}t.end()}});var T0e=_((g3t,R0e)=>{\"use strict\";var Rst=DI(),Tst=oG();R0e.exports=(t,e,r)=>{let s=Rst(t);if(!s.file)throw new TypeError(\"file is required\");if(s.gzip)throw new TypeError(\"cannot append to compressed archives\");if(!e||!Array.isArray(e)||!e.length)throw new TypeError(\"no files or directories specified\");return e=Array.from(e),Fst(s),Tst(s,e,r)};var Fst=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,s)=>e(r,s)&&!(t.mtimeCache.get(r)>s.mtime):(r,s)=>!(t.mtimeCache.get(r)>s.mtime)}});var O0e=_((d3t,N0e)=>{var{promisify:F0e}=Ie(\"util\"),U0=Ie(\"fs\"),Nst=t=>{if(!t)t={mode:511,fs:U0};else if(typeof t==\"object\")t={mode:511,fs:U0,...t};else if(typeof t==\"number\")t={mode:t,fs:U0};else if(typeof t==\"string\")t={mode:parseInt(t,8),fs:U0};else throw new TypeError(\"invalid options argument\");return t.mkdir=t.mkdir||t.fs.mkdir||U0.mkdir,t.mkdirAsync=F0e(t.mkdir),t.stat=t.stat||t.fs.stat||U0.stat,t.statAsync=F0e(t.stat),t.statSync=t.statSync||t.fs.statSync||U0.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||U0.mkdirSync,t};N0e.exports=Nst});var M0e=_((m3t,L0e)=>{var Ost=process.platform,{resolve:Lst,parse:Mst}=Ie(\"path\"),Ust=t=>{if(/\\0/.test(t))throw Object.assign(new TypeError(\"path must be a string without null bytes\"),{path:t,code:\"ERR_INVALID_ARG_VALUE\"});if(t=Lst(t),Ost===\"win32\"){let e=/[*|\"<>?:]/,{root:r}=Mst(t);if(e.test(t.substr(r.length)))throw Object.assign(new Error(\"Illegal characters in path.\"),{path:t,code:\"EINVAL\"})}return t};L0e.exports=Ust});var G0e=_((y3t,j0e)=>{var{dirname:U0e}=Ie(\"path\"),_0e=(t,e,r=void 0)=>r===e?Promise.resolve():t.statAsync(e).then(s=>s.isDirectory()?r:void 0,s=>s.code===\"ENOENT\"?_0e(t,U0e(e),e):void 0),H0e=(t,e,r=void 0)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(s){return s.code===\"ENOENT\"?H0e(t,U0e(e),e):void 0}};j0e.exports={findMade:_0e,findMadeSync:H0e}});var cG=_((E3t,W0e)=>{var{dirname:q0e}=Ie(\"path\"),aG=(t,e,r)=>{e.recursive=!1;let s=q0e(t);return s===t?e.mkdirAsync(t,e).catch(a=>{if(a.code!==\"EISDIR\")throw a}):e.mkdirAsync(t,e).then(()=>r||t,a=>{if(a.code===\"ENOENT\")return aG(s,e).then(n=>aG(t,e,n));if(a.code!==\"EEXIST\"&&a.code!==\"EROFS\")throw a;return e.statAsync(t).then(n=>{if(n.isDirectory())return r;throw a},()=>{throw a})})},lG=(t,e,r)=>{let s=q0e(t);if(e.recursive=!1,s===t)try{return e.mkdirSync(t,e)}catch(a){if(a.code!==\"EISDIR\")throw a;return}try{return e.mkdirSync(t,e),r||t}catch(a){if(a.code===\"ENOENT\")return lG(t,e,lG(s,e,r));if(a.code!==\"EEXIST\"&&a.code!==\"EROFS\")throw a;try{if(!e.statSync(t).isDirectory())throw a}catch{throw a}}};W0e.exports={mkdirpManual:aG,mkdirpManualSync:lG}});var J0e=_((I3t,V0e)=>{var{dirname:Y0e}=Ie(\"path\"),{findMade:_st,findMadeSync:Hst}=G0e(),{mkdirpManual:jst,mkdirpManualSync:Gst}=cG(),qst=(t,e)=>(e.recursive=!0,Y0e(t)===t?e.mkdirAsync(t,e):_st(e,t).then(s=>e.mkdirAsync(t,e).then(()=>s).catch(a=>{if(a.code===\"ENOENT\")return jst(t,e);throw a}))),Wst=(t,e)=>{if(e.recursive=!0,Y0e(t)===t)return e.mkdirSync(t,e);let s=Hst(e,t);try{return e.mkdirSync(t,e),s}catch(a){if(a.code===\"ENOENT\")return Gst(t,e);throw a}};V0e.exports={mkdirpNative:qst,mkdirpNativeSync:Wst}});var X0e=_((C3t,Z0e)=>{var K0e=Ie(\"fs\"),Yst=process.version,uG=Yst.replace(/^v/,\"\").split(\".\"),z0e=+uG[0]>10||+uG[0]==10&&+uG[1]>=12,Vst=z0e?t=>t.mkdir===K0e.mkdir:()=>!1,Jst=z0e?t=>t.mkdirSync===K0e.mkdirSync:()=>!1;Z0e.exports={useNative:Vst,useNativeSync:Jst}});var ige=_((w3t,nge)=>{var WI=O0e(),YI=M0e(),{mkdirpNative:$0e,mkdirpNativeSync:ege}=J0e(),{mkdirpManual:tge,mkdirpManualSync:rge}=cG(),{useNative:Kst,useNativeSync:zst}=X0e(),VI=(t,e)=>(t=YI(t),e=WI(e),Kst(e)?$0e(t,e):tge(t,e)),Zst=(t,e)=>(t=YI(t),e=WI(e),zst(e)?ege(t,e):rge(t,e));VI.sync=Zst;VI.native=(t,e)=>$0e(YI(t),WI(e));VI.manual=(t,e)=>tge(YI(t),WI(e));VI.nativeSync=(t,e)=>ege(YI(t),WI(e));VI.manualSync=(t,e)=>rge(YI(t),WI(e));nge.exports=VI});var fge=_((B3t,uge)=>{\"use strict\";var Uc=Ie(\"fs\"),Cm=Ie(\"path\"),Xst=Uc.lchown?\"lchown\":\"chown\",$st=Uc.lchownSync?\"lchownSync\":\"chownSync\",oge=Uc.lchown&&!process.version.match(/v1[1-9]+\\./)&&!process.version.match(/v10\\.[6-9]/),sge=(t,e,r)=>{try{return Uc[$st](t,e,r)}catch(s){if(s.code!==\"ENOENT\")throw s}},eot=(t,e,r)=>{try{return Uc.chownSync(t,e,r)}catch(s){if(s.code!==\"ENOENT\")throw s}},tot=oge?(t,e,r,s)=>a=>{!a||a.code!==\"EISDIR\"?s(a):Uc.chown(t,e,r,s)}:(t,e,r,s)=>s,fG=oge?(t,e,r)=>{try{return sge(t,e,r)}catch(s){if(s.code!==\"EISDIR\")throw s;eot(t,e,r)}}:(t,e,r)=>sge(t,e,r),rot=process.version,age=(t,e,r)=>Uc.readdir(t,e,r),not=(t,e)=>Uc.readdirSync(t,e);/^v4\\./.test(rot)&&(age=(t,e,r)=>Uc.readdir(t,r));var DT=(t,e,r,s)=>{Uc[Xst](t,e,r,tot(t,e,r,a=>{s(a&&a.code!==\"ENOENT\"?a:null)}))},lge=(t,e,r,s,a)=>{if(typeof e==\"string\")return Uc.lstat(Cm.resolve(t,e),(n,c)=>{if(n)return a(n.code!==\"ENOENT\"?n:null);c.name=e,lge(t,c,r,s,a)});if(e.isDirectory())AG(Cm.resolve(t,e.name),r,s,n=>{if(n)return a(n);let c=Cm.resolve(t,e.name);DT(c,r,s,a)});else{let n=Cm.resolve(t,e.name);DT(n,r,s,a)}},AG=(t,e,r,s)=>{age(t,{withFileTypes:!0},(a,n)=>{if(a){if(a.code===\"ENOENT\")return s();if(a.code!==\"ENOTDIR\"&&a.code!==\"ENOTSUP\")return s(a)}if(a||!n.length)return DT(t,e,r,s);let c=n.length,f=null,p=h=>{if(!f){if(h)return s(f=h);if(--c===0)return DT(t,e,r,s)}};n.forEach(h=>lge(t,h,e,r,p))})},iot=(t,e,r,s)=>{if(typeof e==\"string\")try{let a=Uc.lstatSync(Cm.resolve(t,e));a.name=e,e=a}catch(a){if(a.code===\"ENOENT\")return;throw a}e.isDirectory()&&cge(Cm.resolve(t,e.name),r,s),fG(Cm.resolve(t,e.name),r,s)},cge=(t,e,r)=>{let s;try{s=not(t,{withFileTypes:!0})}catch(a){if(a.code===\"ENOENT\")return;if(a.code===\"ENOTDIR\"||a.code===\"ENOTSUP\")return fG(t,e,r);throw a}return s&&s.length&&s.forEach(a=>iot(t,a,e,r)),fG(t,e,r)};uge.exports=AG;AG.sync=cge});var gge=_((v3t,pG)=>{\"use strict\";var Age=ige(),_c=Ie(\"fs\"),PT=Ie(\"path\"),pge=fge(),Vu=QI(),bT=class extends Error{constructor(e,r){super(\"Cannot extract through symbolic link\"),this.path=r,this.symlink=e}get name(){return\"SylinkError\"}},xT=class extends Error{constructor(e,r){super(r+\": Cannot cd into '\"+e+\"'\"),this.path=e,this.code=r}get name(){return\"CwdError\"}},kT=(t,e)=>t.get(Vu(e)),Qv=(t,e,r)=>t.set(Vu(e),r),sot=(t,e)=>{_c.stat(t,(r,s)=>{(r||!s.isDirectory())&&(r=new xT(t,r&&r.code||\"ENOTDIR\")),e(r)})};pG.exports=(t,e,r)=>{t=Vu(t);let s=e.umask,a=e.mode|448,n=(a&s)!==0,c=e.uid,f=e.gid,p=typeof c==\"number\"&&typeof f==\"number\"&&(c!==e.processUid||f!==e.processGid),h=e.preserve,E=e.unlink,C=e.cache,S=Vu(e.cwd),b=(N,U)=>{N?r(N):(Qv(C,t,!0),U&&p?pge(U,c,f,W=>b(W)):n?_c.chmod(t,a,r):r())};if(C&&kT(C,t)===!0)return b();if(t===S)return sot(t,b);if(h)return Age(t,{mode:a}).then(N=>b(null,N),b);let T=Vu(PT.relative(S,t)).split(\"/\");QT(S,T,a,C,E,S,null,b)};var QT=(t,e,r,s,a,n,c,f)=>{if(!e.length)return f(null,c);let p=e.shift(),h=Vu(PT.resolve(t+\"/\"+p));if(kT(s,h))return QT(h,e,r,s,a,n,c,f);_c.mkdir(h,r,hge(h,e,r,s,a,n,c,f))},hge=(t,e,r,s,a,n,c,f)=>p=>{p?_c.lstat(t,(h,E)=>{if(h)h.path=h.path&&Vu(h.path),f(h);else if(E.isDirectory())QT(t,e,r,s,a,n,c,f);else if(a)_c.unlink(t,C=>{if(C)return f(C);_c.mkdir(t,r,hge(t,e,r,s,a,n,c,f))});else{if(E.isSymbolicLink())return f(new bT(t,t+\"/\"+e.join(\"/\")));f(p)}}):(c=c||t,QT(t,e,r,s,a,n,c,f))},oot=t=>{let e=!1,r=\"ENOTDIR\";try{e=_c.statSync(t).isDirectory()}catch(s){r=s.code}finally{if(!e)throw new xT(t,r)}};pG.exports.sync=(t,e)=>{t=Vu(t);let r=e.umask,s=e.mode|448,a=(s&r)!==0,n=e.uid,c=e.gid,f=typeof n==\"number\"&&typeof c==\"number\"&&(n!==e.processUid||c!==e.processGid),p=e.preserve,h=e.unlink,E=e.cache,C=Vu(e.cwd),S=N=>{Qv(E,t,!0),N&&f&&pge.sync(N,n,c),a&&_c.chmodSync(t,s)};if(E&&kT(E,t)===!0)return S();if(t===C)return oot(C),S();if(p)return S(Age.sync(t,s));let I=Vu(PT.relative(C,t)).split(\"/\"),T=null;for(let N=I.shift(),U=C;N&&(U+=\"/\"+N);N=I.shift())if(U=Vu(PT.resolve(U)),!kT(E,U))try{_c.mkdirSync(U,s),T=T||U,Qv(E,U,!0)}catch{let ee=_c.lstatSync(U);if(ee.isDirectory()){Qv(E,U,!0);continue}else if(h){_c.unlinkSync(U),_c.mkdirSync(U,s),T=T||U,Qv(E,U,!0);continue}else if(ee.isSymbolicLink())return new bT(U,U+\"/\"+I.join(\"/\"))}return S(T)}});var gG=_((S3t,dge)=>{var hG=Object.create(null),{hasOwnProperty:aot}=Object.prototype;dge.exports=t=>(aot.call(hG,t)||(hG[t]=t.normalize(\"NFKD\")),hG[t])});var Ige=_((D3t,Ege)=>{var mge=Ie(\"assert\"),lot=gG(),cot=FI(),{join:yge}=Ie(\"path\"),uot=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,fot=uot===\"win32\";Ege.exports=()=>{let t=new Map,e=new Map,r=h=>h.split(\"/\").slice(0,-1).reduce((C,S)=>(C.length&&(S=yge(C[C.length-1],S)),C.push(S||\"/\"),C),[]),s=new Set,a=h=>{let E=e.get(h);if(!E)throw new Error(\"function does not have any path reservations\");return{paths:E.paths.map(C=>t.get(C)),dirs:[...E.dirs].map(C=>t.get(C))}},n=h=>{let{paths:E,dirs:C}=a(h);return E.every(S=>S[0]===h)&&C.every(S=>S[0]instanceof Set&&S[0].has(h))},c=h=>s.has(h)||!n(h)?!1:(s.add(h),h(()=>f(h)),!0),f=h=>{if(!s.has(h))return!1;let{paths:E,dirs:C}=e.get(h),S=new Set;return E.forEach(b=>{let I=t.get(b);mge.equal(I[0],h),I.length===1?t.delete(b):(I.shift(),typeof I[0]==\"function\"?S.add(I[0]):I[0].forEach(T=>S.add(T)))}),C.forEach(b=>{let I=t.get(b);mge(I[0]instanceof Set),I[0].size===1&&I.length===1?t.delete(b):I[0].size===1?(I.shift(),S.add(I[0])):I[0].delete(h)}),s.delete(h),S.forEach(b=>c(b)),!0};return{check:n,reserve:(h,E)=>{h=fot?[\"win32 parallelization disabled\"]:h.map(S=>lot(cot(yge(S))).toLowerCase());let C=new Set(h.map(S=>r(S)).reduce((S,b)=>S.concat(b)));return e.set(E,{dirs:C,paths:h}),h.forEach(S=>{let b=t.get(S);b?b.push(E):t.set(S,[E])}),C.forEach(S=>{let b=t.get(S);b?b[b.length-1]instanceof Set?b[b.length-1].add(E):b.push(new Set([E])):t.set(S,[new Set([E])])}),c(E)}}}});var Bge=_((P3t,wge)=>{var Aot=process.platform,pot=Aot===\"win32\",hot=global.__FAKE_TESTING_FS__||Ie(\"fs\"),{O_CREAT:got,O_TRUNC:dot,O_WRONLY:mot,UV_FS_O_FILEMAP:Cge=0}=hot.constants,yot=pot&&!!Cge,Eot=512*1024,Iot=Cge|dot|got|mot;wge.exports=yot?t=>t<Eot?Iot:\"w\":()=>\"w\"});var vG=_((b3t,Lge)=>{\"use strict\";var Cot=Ie(\"assert\"),wot=BT(),Mn=Ie(\"fs\"),Bot=GI(),Jp=Ie(\"path\"),Fge=gge(),vge=v6(),vot=Ige(),Sot=S6(),Xl=QI(),Dot=FI(),Pot=gG(),Sge=Symbol(\"onEntry\"),yG=Symbol(\"checkFs\"),Dge=Symbol(\"checkFs2\"),FT=Symbol(\"pruneCache\"),EG=Symbol(\"isReusable\"),Hc=Symbol(\"makeFs\"),IG=Symbol(\"file\"),CG=Symbol(\"directory\"),NT=Symbol(\"link\"),Pge=Symbol(\"symlink\"),bge=Symbol(\"hardlink\"),xge=Symbol(\"unsupported\"),kge=Symbol(\"checkPath\"),_0=Symbol(\"mkdir\"),Zo=Symbol(\"onError\"),RT=Symbol(\"pending\"),Qge=Symbol(\"pend\"),JI=Symbol(\"unpend\"),dG=Symbol(\"ended\"),mG=Symbol(\"maybeClose\"),wG=Symbol(\"skip\"),Rv=Symbol(\"doChown\"),Tv=Symbol(\"uid\"),Fv=Symbol(\"gid\"),Nv=Symbol(\"checkedCwd\"),Nge=Ie(\"crypto\"),Oge=Bge(),bot=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Ov=bot===\"win32\",xot=(t,e)=>{if(!Ov)return Mn.unlink(t,e);let r=t+\".DELETE.\"+Nge.randomBytes(16).toString(\"hex\");Mn.rename(t,r,s=>{if(s)return e(s);Mn.unlink(r,e)})},kot=t=>{if(!Ov)return Mn.unlinkSync(t);let e=t+\".DELETE.\"+Nge.randomBytes(16).toString(\"hex\");Mn.renameSync(t,e),Mn.unlinkSync(e)},Rge=(t,e,r)=>t===t>>>0?t:e===e>>>0?e:r,Tge=t=>Pot(Dot(Xl(t))).toLowerCase(),Qot=(t,e)=>{e=Tge(e);for(let r of t.keys()){let s=Tge(r);(s===e||s.indexOf(e+\"/\")===0)&&t.delete(r)}},Rot=t=>{for(let e of t.keys())t.delete(e)},Lv=class extends wot{constructor(e){if(e||(e={}),e.ondone=r=>{this[dG]=!0,this[mG]()},super(e),this[Nv]=!1,this.reservations=vot(),this.transform=typeof e.transform==\"function\"?e.transform:null,this.writable=!0,this.readable=!1,this[RT]=0,this[dG]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid==\"number\"||typeof e.gid==\"number\"){if(typeof e.uid!=\"number\"||typeof e.gid!=\"number\")throw new TypeError(\"cannot set owner without number uid and gid\");if(e.preserveOwner)throw new TypeError(\"cannot preserve owner in archive and also set owner explicitly\");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!=\"number\"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Ov,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=Xl(Jp.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask==\"number\"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on(\"entry\",r=>this[Sge](r))}warn(e,r,s={}){return(e===\"TAR_BAD_ARCHIVE\"||e===\"TAR_ABORT\")&&(s.recoverable=!1),super.warn(e,r,s)}[mG](){this[dG]&&this[RT]===0&&(this.emit(\"prefinish\"),this.emit(\"finish\"),this.emit(\"end\"),this.emit(\"close\"))}[kge](e){if(this.strip){let r=Xl(e.path).split(\"/\");if(r.length<this.strip)return!1;if(e.path=r.slice(this.strip).join(\"/\"),e.type===\"Link\"){let s=Xl(e.linkpath).split(\"/\");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join(\"/\");else return!1}}if(!this.preservePaths){let r=Xl(e.path),s=r.split(\"/\");if(s.includes(\"..\")||Ov&&/^[a-z]:\\.\\.$/i.test(s[0]))return this.warn(\"TAR_ENTRY_ERROR\",\"path contains '..'\",{entry:e,path:r}),!1;let[a,n]=Sot(r);a&&(e.path=n,this.warn(\"TAR_ENTRY_INFO\",`stripping ${a} from absolute path`,{entry:e,path:r}))}if(Jp.isAbsolute(e.path)?e.absolute=Xl(Jp.resolve(e.path)):e.absolute=Xl(Jp.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+\"/\")!==0&&e.absolute!==this.cwd)return this.warn(\"TAR_ENTRY_ERROR\",\"path escaped extraction target\",{entry:e,path:Xl(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!==\"Directory\"&&e.type!==\"GNUDumpDir\")return!1;if(this.win32){let{root:r}=Jp.win32.parse(e.absolute);e.absolute=r+vge.encode(e.absolute.substr(r.length));let{root:s}=Jp.win32.parse(e.path);e.path=s+vge.encode(e.path.substr(s.length))}return!0}[Sge](e){if(!this[kge](e))return e.resume();switch(Cot.equal(typeof e.absolute,\"string\"),e.type){case\"Directory\":case\"GNUDumpDir\":e.mode&&(e.mode=e.mode|448);case\"File\":case\"OldFile\":case\"ContiguousFile\":case\"Link\":case\"SymbolicLink\":return this[yG](e);case\"CharacterDevice\":case\"BlockDevice\":case\"FIFO\":default:return this[xge](e)}}[Zo](e,r){e.name===\"CwdError\"?this.emit(\"error\",e):(this.warn(\"TAR_ENTRY_ERROR\",e,{entry:r}),this[JI](),r.resume())}[_0](e,r,s){Fge(Xl(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r,noChmod:this.noChmod},s)}[Rv](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==\"number\"&&e.uid!==this.processUid||typeof e.gid==\"number\"&&e.gid!==this.processGid)||typeof this.uid==\"number\"&&this.uid!==this.processUid||typeof this.gid==\"number\"&&this.gid!==this.processGid}[Tv](e){return Rge(this.uid,e.uid,this.processUid)}[Fv](e){return Rge(this.gid,e.gid,this.processGid)}[IG](e,r){let s=e.mode&4095||this.fmode,a=new Bot.WriteStream(e.absolute,{flags:Oge(e.size),mode:s,autoClose:!1});a.on(\"error\",p=>{a.fd&&Mn.close(a.fd,()=>{}),a.write=()=>!0,this[Zo](p,e),r()});let n=1,c=p=>{if(p){a.fd&&Mn.close(a.fd,()=>{}),this[Zo](p,e),r();return}--n===0&&Mn.close(a.fd,h=>{h?this[Zo](h,e):this[JI](),r()})};a.on(\"finish\",p=>{let h=e.absolute,E=a.fd;if(e.mtime&&!this.noMtime){n++;let C=e.atime||new Date,S=e.mtime;Mn.futimes(E,C,S,b=>b?Mn.utimes(h,C,S,I=>c(I&&b)):c())}if(this[Rv](e)){n++;let C=this[Tv](e),S=this[Fv](e);Mn.fchown(E,C,S,b=>b?Mn.chown(h,C,S,I=>c(I&&b)):c())}c()});let f=this.transform&&this.transform(e)||e;f!==e&&(f.on(\"error\",p=>{this[Zo](p,e),r()}),e.pipe(f)),f.pipe(a)}[CG](e,r){let s=e.mode&4095||this.dmode;this[_0](e.absolute,s,a=>{if(a){this[Zo](a,e),r();return}let n=1,c=f=>{--n===0&&(r(),this[JI](),e.resume())};e.mtime&&!this.noMtime&&(n++,Mn.utimes(e.absolute,e.atime||new Date,e.mtime,c)),this[Rv](e)&&(n++,Mn.chown(e.absolute,this[Tv](e),this[Fv](e),c)),c()})}[xge](e){e.unsupported=!0,this.warn(\"TAR_ENTRY_UNSUPPORTED\",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Pge](e,r){this[NT](e,e.linkpath,\"symlink\",r)}[bge](e,r){let s=Xl(Jp.resolve(this.cwd,e.linkpath));this[NT](e,s,\"link\",r)}[Qge](){this[RT]++}[JI](){this[RT]--,this[mG]()}[wG](e){this[JI](),e.resume()}[EG](e,r){return e.type===\"File\"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!Ov}[yG](e){this[Qge]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,s=>this[Dge](e,s))}[FT](e){e.type===\"SymbolicLink\"?Rot(this.dirCache):e.type!==\"Directory\"&&Qot(this.dirCache,e.absolute)}[Dge](e,r){this[FT](e);let s=f=>{this[FT](e),r(f)},a=()=>{this[_0](this.cwd,this.dmode,f=>{if(f){this[Zo](f,e),s();return}this[Nv]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let f=Xl(Jp.dirname(e.absolute));if(f!==this.cwd)return this[_0](f,this.dmode,p=>{if(p){this[Zo](p,e),s();return}c()})}c()},c=()=>{Mn.lstat(e.absolute,(f,p)=>{if(p&&(this.keep||this.newer&&p.mtime>e.mtime)){this[wG](e),s();return}if(f||this[EG](e,p))return this[Hc](null,e,s);if(p.isDirectory()){if(e.type===\"Directory\"){let h=!this.noChmod&&e.mode&&(p.mode&4095)!==e.mode,E=C=>this[Hc](C,e,s);return h?Mn.chmod(e.absolute,e.mode,E):E()}if(e.absolute!==this.cwd)return Mn.rmdir(e.absolute,h=>this[Hc](h,e,s))}if(e.absolute===this.cwd)return this[Hc](null,e,s);xot(e.absolute,h=>this[Hc](h,e,s))})};this[Nv]?n():a()}[Hc](e,r,s){if(e){this[Zo](e,r),s();return}switch(r.type){case\"File\":case\"OldFile\":case\"ContiguousFile\":return this[IG](r,s);case\"Link\":return this[bge](r,s);case\"SymbolicLink\":return this[Pge](r,s);case\"Directory\":case\"GNUDumpDir\":return this[CG](r,s)}}[NT](e,r,s,a){Mn[s](r,e.absolute,n=>{n?this[Zo](n,e):(this[JI](),e.resume()),a()})}},TT=t=>{try{return[null,t()]}catch(e){return[e,null]}},BG=class extends Lv{[Hc](e,r){return super[Hc](e,r,()=>{})}[yG](e){if(this[FT](e),!this[Nv]){let n=this[_0](this.cwd,this.dmode);if(n)return this[Zo](n,e);this[Nv]=!0}if(e.absolute!==this.cwd){let n=Xl(Jp.dirname(e.absolute));if(n!==this.cwd){let c=this[_0](n,this.dmode);if(c)return this[Zo](c,e)}}let[r,s]=TT(()=>Mn.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[wG](e);if(r||this[EG](e,s))return this[Hc](null,e);if(s.isDirectory()){if(e.type===\"Directory\"){let c=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[f]=c?TT(()=>{Mn.chmodSync(e.absolute,e.mode)}):[];return this[Hc](f,e)}let[n]=TT(()=>Mn.rmdirSync(e.absolute));this[Hc](n,e)}let[a]=e.absolute===this.cwd?[]:TT(()=>kot(e.absolute));this[Hc](a,e)}[IG](e,r){let s=e.mode&4095||this.fmode,a=f=>{let p;try{Mn.closeSync(n)}catch(h){p=h}(f||p)&&this[Zo](f||p,e),r()},n;try{n=Mn.openSync(e.absolute,Oge(e.size),s)}catch(f){return a(f)}let c=this.transform&&this.transform(e)||e;c!==e&&(c.on(\"error\",f=>this[Zo](f,e)),e.pipe(c)),c.on(\"data\",f=>{try{Mn.writeSync(n,f,0,f.length)}catch(p){a(p)}}),c.on(\"end\",f=>{let p=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,E=e.mtime;try{Mn.futimesSync(n,h,E)}catch(C){try{Mn.utimesSync(e.absolute,h,E)}catch{p=C}}}if(this[Rv](e)){let h=this[Tv](e),E=this[Fv](e);try{Mn.fchownSync(n,h,E)}catch(C){try{Mn.chownSync(e.absolute,h,E)}catch{p=p||C}}}a(p)})}[CG](e,r){let s=e.mode&4095||this.dmode,a=this[_0](e.absolute,s);if(a){this[Zo](a,e),r();return}if(e.mtime&&!this.noMtime)try{Mn.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[Rv](e))try{Mn.chownSync(e.absolute,this[Tv](e),this[Fv](e))}catch{}r(),e.resume()}[_0](e,r){try{return Fge.sync(Xl(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(s){return s}}[NT](e,r,s,a){try{Mn[s+\"Sync\"](r,e.absolute),a(),e.resume()}catch(n){return this[Zo](n,e)}}};Lv.Sync=BG;Lge.exports=Lv});var jge=_((x3t,Hge)=>{\"use strict\";var Tot=DI(),OT=vG(),Uge=Ie(\"fs\"),_ge=GI(),Mge=Ie(\"path\"),SG=FI();Hge.exports=(t,e,r)=>{typeof t==\"function\"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e==\"function\"&&(r=e,e=null),e?e=Array.from(e):e=[];let s=Tot(t);if(s.sync&&typeof r==\"function\")throw new TypeError(\"callback not supported for sync tar functions\");if(!s.file&&typeof r==\"function\")throw new TypeError(\"callback only supported with file option\");return e.length&&Fot(s,e),s.file&&s.sync?Not(s):s.file?Oot(s,r):s.sync?Lot(s):Mot(s)};var Fot=(t,e)=>{let r=new Map(e.map(n=>[SG(n),!0])),s=t.filter,a=(n,c)=>{let f=c||Mge.parse(n).root||\".\",p=n===f?!1:r.has(n)?r.get(n):a(Mge.dirname(n),f);return r.set(n,p),p};t.filter=s?(n,c)=>s(n,c)&&a(SG(n)):n=>a(SG(n))},Not=t=>{let e=new OT.Sync(t),r=t.file,s=Uge.statSync(r),a=t.maxReadSize||16*1024*1024;new _ge.ReadStreamSync(r,{readSize:a,size:s.size}).pipe(e)},Oot=(t,e)=>{let r=new OT(t),s=t.maxReadSize||16*1024*1024,a=t.file,n=new Promise((c,f)=>{r.on(\"error\",f),r.on(\"close\",c),Uge.stat(a,(p,h)=>{if(p)f(p);else{let E=new _ge.ReadStream(a,{readSize:s,size:h.size});E.on(\"error\",f),E.pipe(r)}})});return e?n.then(e,e):n},Lot=t=>new OT.Sync(t),Mot=t=>new OT(t)});var Gge=_(bs=>{\"use strict\";bs.c=bs.create=v0e();bs.r=bs.replace=oG();bs.t=bs.list=vT();bs.u=bs.update=T0e();bs.x=bs.extract=jge();bs.Pack=cT();bs.Unpack=vG();bs.Parse=BT();bs.ReadEntry=YR();bs.WriteEntry=N6();bs.Header=TI();bs.Pax=JR();bs.types=m6()});var DG,qge,H0,Mv,Uv,Wge=Ze(()=>{DG=ut(Ld()),qge=Ie(\"worker_threads\"),H0=Symbol(\"kTaskInfo\"),Mv=class{constructor(e,r){this.fn=e;this.limit=(0,DG.default)(r.poolSize)}run(e){return this.limit(()=>this.fn(e))}},Uv=class{constructor(e,r){this.source=e;this.workers=[];this.limit=(0,DG.default)(r.poolSize),this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let s=this.workers.pop();s?s.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new qge.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,\"--unhandled-rejections=strict\"]});return e.on(\"message\",r=>{if(!e[H0])throw new Error(\"Assertion failed: Worker sent a result without having a task assigned\");e[H0].resolve(r),e[H0]=null,e.unref(),this.workers.push(e)}),e.on(\"error\",r=>{e[H0]?.reject(r),e[H0]=null}),e.on(\"exit\",r=>{r!==0&&e[H0]?.reject(new Error(`Worker exited with code ${r}`)),e[H0]=null}),e}run(e){return this.limit(()=>{let r=this.workers.pop()??this.createWorker();return r.ref(),new Promise((s,a)=>{r[H0]={resolve:s,reject:a},r.postMessage(e)})})}}});var Vge=_((T3t,Yge)=>{var PG;Yge.exports.getContent=()=>(typeof PG>\"u\"&&(PG=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"W2xFdgBPZrjSneDvVbLecg9fIhuy4cX6GuF9CJQpmu4RdNt2tSIi3YZAPJzO1Ju/O0dV1bTkYsgCLThVdbatry9HdhTU1geV2ROjsMltUFBZJKzSZoSLXaDMA7MJtfXUZJlq3aQXKbUKncLmJdo5ByJUTvhIXveNwEBNvBd2oxvnpn4bPkVdGHlvHIlNFxsdCpFJELoRwnbMYlM4po2Z06KXwCi1p2pjs9id3NE2aovZB2yHbSj773jMlfchfy8YwvdDUZ/vn38/MrcgKXdhPVyCRIJINOTc+nvG10A05G5fDWBJlRYRLcZ2SJ9KXzV9P+t4bZ/4ta/XzPq/ny+h1gFHGaDHLBUStJHA1I6ePGRc71wTQyYfc9XD5lW9lkNwtRR9fQNnHnpZTidToeBJ1Jm1RF0pyQsV2LW+fcW218zX0zX/IxA45ZhdTxJH79h9EQSUiPkborYYSHZWctm7f//rd+ZPtVfMU6BpdkJgCVQmfvqm+fVbEgYxqmR7xsfeTPDsKih7u8clJ/eEIKB1UIl7ilvT1LKqXzCI9eUZcoOKhSFnla7zhX1BzrDkzGO57PXtznEtQ5DI6RoVcQbKVsRC1v/6verXL2YYcm90hZP2vehoS2TLcW3ZHklOOlVVgmElU0lA2ZUfMcB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Vn0Y+5BFggcC5MZ4D5FEs0V4sEK8EA/wPcpDFlWMyvg8WKeNgWb7EbHbqR1d92dlSn0E8nRsdOo+z3J7tbSAC3f9e3SzDJB5xVXbt+Zq3ayiGJzf4KV4Mfkf\",\"base64\")).toString()),PG)});var ps={};Vt(ps,{convertToZip:()=>jot,convertToZipWorker:()=>kG,extractArchiveTo:()=>Xge,getDefaultTaskPool:()=>zge,getTaskPoolForConfiguration:()=>Zge,makeArchiveFromDirectory:()=>Hot});function Uot(t,e){switch(t){case\"async\":return new Mv(kG,{poolSize:e});case\"workers\":return new Uv((0,xG.getContent)(),{poolSize:e});default:throw new Error(`Assertion failed: Unknown value ${t} for taskPoolMode`)}}function zge(){return typeof bG>\"u\"&&(bG=Uot(\"workers\",fs.availableParallelism())),bG}function Zge(t){return typeof t>\"u\"?zge():Yl(_ot,t,()=>{let e=t.get(\"taskPoolMode\"),r=t.get(\"taskPoolConcurrency\");switch(e){case\"async\":return new Mv(kG,{poolSize:r});case\"workers\":return new Uv((0,xG.getContent)(),{poolSize:r});default:throw new Error(`Assertion failed: Unknown value ${e} for taskPoolMode`)}})}async function kG(t){let{tmpFile:e,tgz:r,compressionLevel:s,extractBufferOpts:a}=t,n=new As(e,{create:!0,level:s,stats:$a.makeDefaultStats()}),c=Buffer.from(r.buffer,r.byteOffset,r.byteLength);return await Xge(c,n,a),n.saveAndClose(),e}async function Hot(t,{baseFs:e=new Yn,prefixPath:r=vt.root,compressionLevel:s,inMemory:a=!1}={}){let n;if(a)n=new As(null,{level:s});else{let f=await ce.mktempPromise(),p=J.join(f,\"archive.zip\");n=new As(p,{create:!0,level:s})}let c=J.resolve(vt.root,r);return await n.copyPromise(c,t,{baseFs:e,stableTime:!0,stableSort:!0}),n}async function jot(t,e={}){let r=await ce.mktempPromise(),s=J.join(r,\"archive.zip\"),a=e.compressionLevel??e.configuration?.get(\"compressionLevel\")??\"mixed\",n={prefixPath:e.prefixPath,stripComponents:e.stripComponents};return await(e.taskPool??Zge(e.configuration)).run({tmpFile:s,tgz:t,compressionLevel:a,extractBufferOpts:n}),new As(s,{level:e.compressionLevel})}async function*Got(t){let e=new Kge.default.Parse,r=new Jge.PassThrough({objectMode:!0,autoDestroy:!0,emitClose:!0});e.on(\"entry\",s=>{r.write(s)}),e.on(\"error\",s=>{r.destroy(s)}),e.on(\"close\",()=>{r.destroyed||r.end()}),e.end(t);for await(let s of r){let a=s;yield a,a.resume()}}async function Xge(t,e,{stripComponents:r=0,prefixPath:s=vt.dot}={}){function a(n){if(n.path[0]===\"/\")return!0;let c=n.path.split(/\\//g);return!!(c.some(f=>f===\"..\")||c.length<=r)}for await(let n of Got(t)){if(a(n))continue;let c=J.normalize(fe.toPortablePath(n.path)).replace(/\\/$/,\"\").split(/\\//g);if(c.length<=r)continue;let f=c.slice(r).join(\"/\"),p=J.join(s,f),h=420;switch((n.type===\"Directory\"||(n.mode??0)&73)&&(h|=73),n.type){case\"Directory\":e.mkdirpSync(J.dirname(p),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),e.mkdirSync(p,{mode:h}),e.utimesSync(p,fi.SAFE_TIME,fi.SAFE_TIME);break;case\"OldFile\":case\"File\":e.mkdirpSync(J.dirname(p),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),e.writeFileSync(p,await WE(n),{mode:h}),e.utimesSync(p,fi.SAFE_TIME,fi.SAFE_TIME);break;case\"SymbolicLink\":e.mkdirpSync(J.dirname(p),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),e.symlinkSync(n.linkpath,p),e.lutimesSync(p,fi.SAFE_TIME,fi.SAFE_TIME);break}}return e}var Jge,Kge,xG,bG,_ot,$ge=Ze(()=>{Ge();Dt();eA();Jge=Ie(\"stream\"),Kge=ut(Gge());Wge();bc();xG=ut(Vge());_ot=new WeakMap});var tde=_((QG,ede)=>{(function(t,e){typeof QG==\"object\"?ede.exports=e():typeof define==\"function\"&&define.amd?define(e):t.treeify=e()})(QG,function(){function t(a,n){var c=n?\"\\u2514\":\"\\u251C\";return a?c+=\"\\u2500 \":c+=\"\\u2500\\u2500\\u2510\",c}function e(a,n){var c=[];for(var f in a)a.hasOwnProperty(f)&&(n&&typeof a[f]==\"function\"||c.push(f));return c}function r(a,n,c,f,p,h,E){var C=\"\",S=0,b,I,T=f.slice(0);if(T.push([n,c])&&f.length>0&&(f.forEach(function(U,W){W>0&&(C+=(U[1]?\" \":\"\\u2502\")+\"  \"),!I&&U[0]===n&&(I=!0)}),C+=t(a,c)+a,p&&(typeof n!=\"object\"||n instanceof Date)&&(C+=\": \"+n),I&&(C+=\" (circular ref.)\"),E(C)),!I&&typeof n==\"object\"){var N=e(n,h);N.forEach(function(U){b=++S===N.length,r(U,n[U],b,T,p,h,E)})}}var s={};return s.asLines=function(a,n,c,f){var p=typeof c!=\"function\"?c:!1;r(\".\",a,!1,[],n,p,f||c)},s.asTree=function(a,n,c){var f=\"\";return r(\".\",a,!1,[],n,c,function(p){f+=p+`\n`}),f},s})});var xs={};Vt(xs,{emitList:()=>qot,emitTree:()=>sde,treeNodeToJson:()=>ide,treeNodeToTreeify:()=>nde});function nde(t,{configuration:e}){let r={},s=0,a=(n,c)=>{let f=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of f){if(!h)continue;let{label:E,value:C,children:S}=h,b=[];typeof E<\"u\"&&b.push(zd(e,E,2)),typeof C<\"u\"&&b.push(Ht(e,C[0],C[1])),b.length===0&&b.push(zd(e,`${p}`,2));let I=b.join(\": \").trim(),T=`\\0${s++}\\0`,N=c[`${T}${I}`]={};typeof S<\"u\"&&a(S,N)}};if(typeof t.children>\"u\")throw new Error(\"The root node must only contain children\");return a(t.children,r),r}function ide(t){let e=r=>{if(typeof r.children>\"u\"){if(typeof r.value>\"u\")throw new Error(\"Assertion failed: Expected a value to be set if the children are missing\");return Zd(r.value[0],r.value[1])}let s=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,c]of s)c&&(a[Wot(n)]=e(c));return typeof r.value>\"u\"?a:{value:Zd(r.value[0],r.value[1]),children:a}};return e(t)}function qot(t,{configuration:e,stdout:r,json:s}){let a=t.map(n=>({value:n}));sde({children:a},{configuration:e,stdout:r,json:s})}function sde(t,{configuration:e,stdout:r,json:s,separators:a=0}){if(s){let c=Array.isArray(t.children)?t.children.values():Object.values(t.children??{});for(let f of c)f&&r.write(`${JSON.stringify(ide(f))}\n`);return}let n=(0,rde.asTree)(nde(t,{configuration:e}),!1,!1);if(n=n.replace(/\\0[0-9]+\\0/g,\"\"),a>=1&&(n=n.replace(/^([├└]─)/gm,`\\u2502\n$1`).replace(/^│\\n/,\"\")),a>=2)for(let c=0;c<2;++c)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\\n]+\\n)(([│ ]).{2}[├└].{2}[^\\n]*\\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3  \\u2502 \n$2`).replace(/^│\\n/,\"\");if(a>=3)throw new Error(\"Only the first two levels are accepted by treeUtils.emitTree\");r.write(n)}function Wot(t){return typeof t==\"string\"?t.replace(/^\\0[0-9]+\\0/,\"\"):t}var rde,ode=Ze(()=>{rde=ut(tde());xc()});var LT,ade=Ze(()=>{LT=class{constructor(e){this.releaseFunction=e;this.map=new Map}addOrCreate(e,r){let s=this.map.get(e);if(typeof s<\"u\"){if(s.refCount<=0)throw new Error(`Race condition in RefCountedMap. While adding a new key the refCount is: ${s.refCount} for ${JSON.stringify(e)}`);return s.refCount++,{value:s.value,release:()=>this.release(e)}}else{let a=r();return this.map.set(e,{refCount:1,value:a}),{value:a,release:()=>this.release(e)}}}release(e){let r=this.map.get(e);if(!r)throw new Error(`Unbalanced calls to release. No known instances of: ${JSON.stringify(e)}`);let s=r.refCount;if(s<=0)throw new Error(`Unbalanced calls to release. Too many release vs alloc refcount would become: ${s-1} of ${JSON.stringify(e)}`);s==1?(this.map.delete(e),this.releaseFunction(r.value)):r.refCount--}}});function _v(t){let e=t.match(Yot);if(!e?.groups)throw new Error(\"Assertion failed: Expected the checksum to match the requested pattern\");let r=e.groups.cacheVersion?parseInt(e.groups.cacheVersion):null;return{cacheKey:e.groups.cacheKey??null,cacheVersion:r,cacheSpec:e.groups.cacheSpec??null,hash:e.groups.hash}}var lde,RG,TG,MT,Kr,Yot,FG=Ze(()=>{Ge();Dt();Dt();eA();lde=Ie(\"crypto\"),RG=ut(Ie(\"fs\"));ade();Rc();I0();bc();Wo();TG=YE(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),MT=YE(process.env.YARN_CACHE_VERSION_OVERRIDE??10),Kr=class t{constructor(e,{configuration:r,immutable:s=r.get(\"enableImmutableCache\"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.refCountedZipFsCache=new LT(e=>{e.discardAndClose()});this.cacheId=`-${(0,lde.randomBytes)(8).toString(\"hex\")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=s,this.check=a;let{cacheSpec:n,cacheKey:c}=t.getCacheKey(r);this.cacheSpec=n,this.cacheKey=c}static async find(e,{immutable:r,check:s}={}){let a=new t(e.get(\"cacheFolder\"),{configuration:e,immutable:r,check:s});return await a.setup(),a}static getCacheKey(e){let r=e.get(\"compressionLevel\"),s=r!==\"mixed\"?`c${r}`:\"\";return{cacheKey:[MT,s].join(\"\"),cacheSpec:s}}get mirrorCwd(){if(!this.configuration.get(\"enableMirror\"))return null;let e=`${this.configuration.get(\"globalFolder\")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${nI(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let a=_v(r).hash.slice(0,10);return`${nI(e)}-${a}.zip`}isChecksumCompatible(e){if(e===null)return!1;let{cacheVersion:r,cacheSpec:s}=_v(e);if(r===null||r<TG)return!1;let a=this.configuration.get(\"cacheMigrationMode\");return!(r<MT&&a===\"always\"||s!==this.cacheSpec&&a!==\"required-only\")}getLocatorPath(e,r){return this.mirrorCwd===null?J.resolve(this.cwd,this.getVersionFilename(e)):r===null?J.resolve(this.cwd,this.getVersionFilename(e)):J.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?J.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get(\"enableGlobalCache\"))if(this.immutable){if(!await ce.existsPromise(this.cwd))throw new jt(56,\"Cache path does not exist.\")}else{await ce.mkdirPromise(this.cwd,{recursive:!0});let e=J.resolve(this.cwd,\".gitignore\");await ce.changeFilePromise(e,`/.gitignore\n*.flock\n*.tmp\n`)}(this.mirrorCwd||!this.immutable)&&await ce.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:s,onMiss:a,loader:n,...c}){let f=this.getLocatorMirrorPath(e),p=new Yn,h=()=>{let pe=new As,Be=J.join(vt.root,P8(e));return pe.mkdirSync(Be,{recursive:!0}),pe.writeJsonSync(J.join(Be,Er.manifest),{name:un(e),mocked:!0}),pe},E=async(pe,{isColdHit:Be,controlPath:Ce=null})=>{if(Ce===null&&c.unstablePackages?.has(e.locatorHash))return{isValid:!0,hash:null};let g=r&&!Be?_v(r).cacheKey:this.cacheKey,we=!c.skipIntegrityCheck||!r?`${g}/${await vQ(pe)}`:r;if(Ce!==null){let Ae=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await vQ(Ce)}`:r;if(we!==Ae)throw new jt(18,\"The remote archive doesn't match the local checksum - has the local cache been corrupted?\")}let ye=null;switch(r!==null&&we!==r&&(this.check?ye=\"throw\":_v(r).cacheKey!==_v(we).cacheKey?ye=\"update\":ye=this.configuration.get(\"checksumBehavior\")),ye){case null:case\"update\":return{isValid:!0,hash:we};case\"ignore\":return{isValid:!0,hash:r};case\"reset\":return{isValid:!1,hash:r};default:case\"throw\":throw new jt(18,\"The remote archive doesn't match the expected checksum\")}},C=async pe=>{if(!n)throw new Error(`Cache check required but no loader configured for ${Yr(this.configuration,e)}`);let Be=await n(),Ce=Be.getRealPath();Be.saveAndClose(),await ce.chmodPromise(Ce,420);let g=await E(pe,{controlPath:Ce,isColdHit:!1});if(!g.isValid)throw new Error(\"Assertion failed: Expected a valid checksum\");return g.hash},S=async()=>{if(f===null||!await ce.existsPromise(f)){let pe=await n(),Be=pe.getRealPath();return pe.saveAndClose(),{source:\"loader\",path:Be}}return{source:\"mirror\",path:f}},b=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${Yr(this.configuration,e)}`);if(this.immutable)throw new jt(56,`Cache entry required but missing for ${Yr(this.configuration,e)}`);let{path:pe,source:Be}=await S(),{hash:Ce}=await E(pe,{isColdHit:!0}),g=this.getLocatorPath(e,Ce),we=[];Be!==\"mirror\"&&f!==null&&we.push(async()=>{let Ae=`${f}${this.cacheId}`;await ce.copyFilePromise(pe,Ae,RG.default.constants.COPYFILE_FICLONE),await ce.chmodPromise(Ae,420),await ce.renamePromise(Ae,f)}),(!c.mirrorWriteOnly||f===null)&&we.push(async()=>{let Ae=`${g}${this.cacheId}`;await ce.copyFilePromise(pe,Ae,RG.default.constants.COPYFILE_FICLONE),await ce.chmodPromise(Ae,420),await ce.renamePromise(Ae,g)});let ye=c.mirrorWriteOnly?f??g:g;return await Promise.all(we.map(Ae=>Ae())),[!1,ye,Ce]},I=async()=>{let Be=(async()=>{let Ce=c.unstablePackages?.has(e.locatorHash),g=Ce||!r||this.isChecksumCompatible(r)?this.getLocatorPath(e,r):null,we=g!==null?this.markedFiles.has(g)||await p.existsPromise(g):!1,ye=!!c.mockedPackages?.has(e.locatorHash)&&(!this.check||!we),Ae=ye||we,se=Ae?s:a;if(se&&se(),Ae){let X=null,De=g;if(!ye)if(this.check)X=await C(De);else{let Te=await E(De,{isColdHit:!1});if(Te.isValid)X=Te.hash;else return b()}return[ye,De,X]}else{if(this.immutable&&Ce)throw new jt(56,`Cache entry required but missing for ${Yr(this.configuration,e)}; consider defining ${he.pretty(this.configuration,\"supportedArchitectures\",he.Type.CODE)} to cache packages for multiple systems`);return b()}})();this.mutexes.set(e.locatorHash,Be);try{return await Be}finally{this.mutexes.delete(e.locatorHash)}};for(let pe;pe=this.mutexes.get(e.locatorHash);)await pe;let[T,N,U]=await I();T||this.markedFiles.add(N);let W=()=>this.refCountedZipFsCache.addOrCreate(N,()=>T?h():new As(N,{baseFs:p,readOnly:!0})),ee,ie=new oE(()=>G4(()=>(ee=W(),ee.value),pe=>`Failed to open the cache entry for ${Yr(this.configuration,e)}: ${pe}`),J),ue=new _f(N,{baseFs:ie,pathUtils:J}),le=()=>{ee?.release()},me=c.unstablePackages?.has(e.locatorHash)?null:U;return[ue,le,me]}},Yot=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\\/)?(?<hash>.*)$/});var UT,cde=Ze(()=>{UT=(r=>(r[r.SCRIPT=0]=\"SCRIPT\",r[r.SHELLCODE=1]=\"SHELLCODE\",r))(UT||{})});var Vot,KI,NG=Ze(()=>{Dt();wc();Tp();Wo();Vot=[[/^(git(?:\\+(?:https|ssh))?:\\/\\/.*(?:\\.git)?)#(.*)$/,(t,e,r,s)=>`${r}#commit=${s}`],[/^https:\\/\\/((?:[^/]+?)@)?codeload\\.github\\.com\\/([^/]+\\/[^/]+)\\/tar\\.gz\\/([0-9a-f]+)$/,(t,e,r=\"\",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https:\\/\\/((?:[^/]+?)@)?github\\.com\\/([^/]+\\/[^/]+?)(?:\\.git)?#([0-9a-f]+)$/,(t,e,r=\"\",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https?:\\/\\/[^/]+\\/(?:[^/]+\\/)*(?:@.+(?:\\/|(?:%2f)))?([^/]+)\\/(?:-|download)\\/\\1-[^/]+\\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\\/\\/npm\\.pkg\\.github\\.com\\/download\\/(?:@[^/]+)\\/(?:[^/]+)\\/(?:[^/]+)\\/(?:[0-9a-f]+)(?:#|$)/,t=>`npm:${t}`],[/^https:\\/\\/npm\\.fontawesome\\.com\\/(?:@[^/]+)\\/([^/]+)\\/-\\/([^/]+)\\/\\1-\\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\\/\\/[^/]+\\/.*\\/(@[^/]+)\\/([^/]+)\\/-\\/\\1\\/\\2-(?:[.\\d\\w-]+)\\.tgz(?:#|$)/,(t,e)=>xQ({protocol:\"npm:\",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],KI=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:r}){let s=J.join(e.cwd,Er.lockfile);if(!ce.existsSync(s))return;let a=await ce.readFilePromise(s,\"utf8\"),n=as(a);if(Object.hasOwn(n,\"__metadata\"))return;let c=this.resolutions=new Map;for(let f of Object.keys(n)){let p=HB(f);if(!p){r.reportWarning(14,`Failed to parse the string \"${f}\" into a proper descriptor`);continue}let h=cl(p.range)?On(p,`npm:${p.range}`):p,{version:E,resolved:C}=n[f];if(!C)continue;let S;for(let[I,T]of Vot){let N=C.match(I);if(N){S=T(E,...N);break}}if(!S){r.reportWarning(14,`${ni(e.configuration,h)}: Only some patterns can be imported from legacy lockfiles (not \"${C}\")`);continue}let b=h;try{let I=em(h.range),T=HB(I.selector,!0);T&&(b=T)}catch{}c.set(h.descriptorHash,Ws(b,S))}}supportsDescriptor(e,r){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error(\"Assertion failed: This resolver doesn't support resolving locators to packages\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!this.resolutions)throw new Error(\"Assertion failed: The resolution store should have been setup\");let a=this.resolutions.get(e.descriptorHash);if(!a)throw new Error(\"Assertion failed: The resolution should have been registered\");let n=B8(a),c=s.project.configuration.normalizeDependency(n);return await this.resolver.getCandidates(c,r,s)}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){throw new Error(\"Assertion failed: This resolver doesn't support resolving locators to packages\")}}});var lA,ude=Ze(()=>{Rc();Ev();xc();lA=class extends Ao{constructor({configuration:r,stdout:s,suggestInstall:a=!0}){super();this.errorCount=0;TB(this,{configuration:r}),this.configuration=r,this.stdout=s,this.suggestInstall=a}static async start(r,s){let a=new this(r);try{await s(a)}catch(n){a.reportExceptionOnce(n)}finally{await a.finalize()}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(r){}reportCacheMiss(r){}startSectionSync(r,s){return s()}async startSectionPromise(r,s){return await s()}startTimerSync(r,s,a){return(typeof s==\"function\"?s:a)()}async startTimerPromise(r,s,a){return await(typeof s==\"function\"?s:a)()}reportSeparator(){}reportInfo(r,s){}reportWarning(r,s){}reportError(r,s){this.errorCount+=1,this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"redBright\")} ${this.formatNameWithHyperlink(r)}: ${s}\n`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,s){}async finalize(){this.errorCount>0&&(this.stdout.write(`\n`),this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"redBright\")} Errors happened when preparing the environment required to run this command.\n`),this.suggestInstall&&this.stdout.write(`${Ht(this.configuration,\"\\u27A4\",\"redBright\")} This might be caused by packages being missing from the lockfile, in which case running \"yarn install\" might help.\n`))}formatNameWithHyperlink(r){return jj(r,{configuration:this.configuration,json:!1})}}});var zI,OG=Ze(()=>{Wo();zI=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(DQ(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(e,r){throw new Error(\"The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,s){let a=s.project.storedResolutions.get(e.descriptorHash);if(a){let c=s.project.originalPackages.get(a);if(c)return[c]}let n=s.project.originalPackages.get(DQ(e).locatorHash);if(n)return[n];throw new Error(\"Resolution expected from the lockfile data\")}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let s=r.project.originalPackages.get(e.locatorHash);if(!s)throw new Error(\"The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache\");return s}}});function Kp(){}function Jot(t,e,r,s,a){for(var n=0,c=e.length,f=0,p=0;n<c;n++){var h=e[n];if(h.removed){if(h.value=t.join(s.slice(p,p+h.count)),p+=h.count,n&&e[n-1].added){var C=e[n-1];e[n-1]=e[n],e[n]=C}}else{if(!h.added&&a){var E=r.slice(f,f+h.count);E=E.map(function(b,I){var T=s[p+I];return T.length>b.length?T:b}),h.value=t.join(E)}else h.value=t.join(r.slice(f,f+h.count));f+=h.count,h.added||(p+=h.count)}}var S=e[c-1];return c>1&&typeof S.value==\"string\"&&(S.added||S.removed)&&t.equals(\"\",S.value)&&(e[c-2].value+=S.value,e.pop()),e}function Kot(t){return{newPos:t.newPos,components:t.components.slice(0)}}function zot(t,e){if(typeof t==\"function\")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function pde(t,e,r){return r=zot(r,{ignoreWhitespace:!0}),HG.diff(t,e,r)}function Zot(t,e,r){return jG.diff(t,e,r)}function _T(t){\"@babel/helpers - typeof\";return typeof Symbol==\"function\"&&typeof Symbol.iterator==\"symbol\"?_T=function(e){return typeof e}:_T=function(e){return e&&typeof Symbol==\"function\"&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},_T(t)}function LG(t){return eat(t)||tat(t)||rat(t)||nat()}function eat(t){if(Array.isArray(t))return MG(t)}function tat(t){if(typeof Symbol<\"u\"&&Symbol.iterator in Object(t))return Array.from(t)}function rat(t,e){if(t){if(typeof t==\"string\")return MG(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r===\"Object\"&&t.constructor&&(r=t.constructor.name),r===\"Map\"||r===\"Set\")return Array.from(t);if(r===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MG(t,e)}}function MG(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,s=new Array(e);r<e;r++)s[r]=t[r];return s}function nat(){throw new TypeError(`Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UG(t,e,r,s,a){e=e||[],r=r||[],s&&(t=s(a,t));var n;for(n=0;n<e.length;n+=1)if(e[n]===t)return r[n];var c;if(iat.call(t)===\"[object Array]\"){for(e.push(t),c=new Array(t.length),r.push(c),n=0;n<t.length;n+=1)c[n]=UG(t[n],e,r,s,a);return e.pop(),r.pop(),c}if(t&&t.toJSON&&(t=t.toJSON()),_T(t)===\"object\"&&t!==null){e.push(t),c={},r.push(c);var f=[],p;for(p in t)t.hasOwnProperty(p)&&f.push(p);for(f.sort(),n=0;n<f.length;n+=1)p=f[n],c[p]=UG(t[p],e,r,s,p);e.pop(),r.pop()}else c=t;return c}function hde(t,e,r,s,a,n,c){c||(c={}),typeof c.context>\"u\"&&(c.context=4);var f=Zot(r,s,c);if(!f)return;f.push({value:\"\",lines:[]});function p(U){return U.map(function(W){return\" \"+W})}for(var h=[],E=0,C=0,S=[],b=1,I=1,T=function(W){var ee=f[W],ie=ee.lines||ee.value.replace(/\\n$/,\"\").split(`\n`);if(ee.lines=ie,ee.added||ee.removed){var ue;if(!E){var le=f[W-1];E=b,C=I,le&&(S=c.context>0?p(le.lines.slice(-c.context)):[],E-=S.length,C-=S.length)}(ue=S).push.apply(ue,LG(ie.map(function(Ae){return(ee.added?\"+\":\"-\")+Ae}))),ee.added?I+=ie.length:b+=ie.length}else{if(E)if(ie.length<=c.context*2&&W<f.length-2){var me;(me=S).push.apply(me,LG(p(ie)))}else{var pe,Be=Math.min(ie.length,c.context);(pe=S).push.apply(pe,LG(p(ie.slice(0,Be))));var Ce={oldStart:E,oldLines:b-E+Be,newStart:C,newLines:I-C+Be,lines:S};if(W>=f.length-2&&ie.length<=c.context){var g=/\\n$/.test(r),we=/\\n$/.test(s),ye=ie.length==0&&S.length>Ce.oldLines;!g&&ye&&r.length>0&&S.splice(Ce.oldLines,0,\"\\\\ No newline at end of file\"),(!g&&!ye||!we)&&S.push(\"\\\\ No newline at end of file\")}h.push(Ce),E=0,C=0,S=[]}b+=ie.length,I+=ie.length}},N=0;N<f.length;N++)T(N);return{oldFileName:t,newFileName:e,oldHeader:a,newHeader:n,hunks:h}}var c8t,fde,Ade,HG,jG,Xot,$ot,iat,Hv,_G,GG=Ze(()=>{Kp.prototype={diff:function(e,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.callback;typeof s==\"function\"&&(a=s,s={}),this.options=s;var n=this;function c(T){return a?(setTimeout(function(){a(void 0,T)},0),!0):T}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var f=r.length,p=e.length,h=1,E=f+p;s.maxEditLength&&(E=Math.min(E,s.maxEditLength));var C=[{newPos:-1,components:[]}],S=this.extractCommon(C[0],r,e,0);if(C[0].newPos+1>=f&&S+1>=p)return c([{value:this.join(r),count:r.length}]);function b(){for(var T=-1*h;T<=h;T+=2){var N=void 0,U=C[T-1],W=C[T+1],ee=(W?W.newPos:0)-T;U&&(C[T-1]=void 0);var ie=U&&U.newPos+1<f,ue=W&&0<=ee&&ee<p;if(!ie&&!ue){C[T]=void 0;continue}if(!ie||ue&&U.newPos<W.newPos?(N=Kot(W),n.pushComponent(N.components,void 0,!0)):(N=U,N.newPos++,n.pushComponent(N.components,!0,void 0)),ee=n.extractCommon(N,r,e,T),N.newPos+1>=f&&ee+1>=p)return c(Jot(n,N.components,r,e,n.useLongestToken));C[T]=N}h++}if(a)(function T(){setTimeout(function(){if(h>E)return a();b()||T()},0)})();else for(;h<=E;){var I=b();if(I)return I}},pushComponent:function(e,r,s){var a=e[e.length-1];a&&a.added===r&&a.removed===s?e[e.length-1]={count:a.count+1,added:r,removed:s}:e.push({count:1,added:r,removed:s})},extractCommon:function(e,r,s,a){for(var n=r.length,c=s.length,f=e.newPos,p=f-a,h=0;f+1<n&&p+1<c&&this.equals(r[f+1],s[p+1]);)f++,p++,h++;return h&&e.components.push({count:h}),e.newPos=f,p},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],s=0;s<e.length;s++)e[s]&&r.push(e[s]);return r},castInput:function(e){return e},tokenize:function(e){return e.split(\"\")},join:function(e){return e.join(\"\")}};c8t=new Kp;fde=/^[A-Za-z\\xC0-\\u02C6\\u02C8-\\u02D7\\u02DE-\\u02FF\\u1E00-\\u1EFF]+$/,Ade=/\\S/,HG=new Kp;HG.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!Ade.test(t)&&!Ade.test(e)};HG.tokenize=function(t){for(var e=t.split(/([^\\S\\r\\n]+|[()[\\]{}'\"\\r\\n]|\\b)/),r=0;r<e.length-1;r++)!e[r+1]&&e[r+2]&&fde.test(e[r])&&fde.test(e[r+2])&&(e[r]+=e[r+2],e.splice(r+1,2),r--);return e};jG=new Kp;jG.tokenize=function(t){var e=[],r=t.split(/(\\n|\\r\\n)/);r[r.length-1]||r.pop();for(var s=0;s<r.length;s++){var a=r[s];s%2&&!this.options.newlineIsToken?e[e.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),e.push(a))}return e};Xot=new Kp;Xot.tokenize=function(t){return t.split(/(\\S.+?[.!?])(?=\\s+|$)/)};$ot=new Kp;$ot.tokenize=function(t){return t.split(/([{}:;,]|\\s+)/)};iat=Object.prototype.toString,Hv=new Kp;Hv.useLongestToken=!0;Hv.tokenize=jG.tokenize;Hv.castInput=function(t){var e=this.options,r=e.undefinedReplacement,s=e.stringifyReplacer,a=s===void 0?function(n,c){return typeof c>\"u\"?r:c}:s;return typeof t==\"string\"?t:JSON.stringify(UG(t,null,null,a),a,\"  \")};Hv.equals=function(t,e){return Kp.prototype.equals.call(Hv,t.replace(/,([\\r\\n])/g,\"$1\"),e.replace(/,([\\r\\n])/g,\"$1\"))};_G=new Kp;_G.tokenize=function(t){return t.slice()};_G.join=_G.removeEmpty=function(t){return t}});var HT,gde=Ze(()=>{Rc();HT=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return this.resolver.supportsDescriptor(e,r)}supportsLocator(e,r){return this.resolver.supportsLocator(e,r)}shouldPersistResolution(e,r){return this.resolver.shouldPersistResolution(e,r)}bindDescriptor(e,r,s){return this.resolver.bindDescriptor(e,r,s)}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,s){throw new jt(20,`This package doesn't seem to be present in your lockfile; run \"yarn install\" to update the lockfile`)}async getSatisfying(e,r,s,a){throw new jt(20,`This package doesn't seem to be present in your lockfile; run \"yarn install\" to update the lockfile`)}async resolve(e,r){throw new jt(20,`This package doesn't seem to be present in your lockfile; run \"yarn install\" to update the lockfile`)}}});var ki,qG=Ze(()=>{Rc();ki=class extends Ao{reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,r){return r()}async startSectionPromise(e,r){return await r()}startTimerSync(e,r,s){return(typeof r==\"function\"?r:s)()}async startTimerPromise(e,r,s){return await(typeof r==\"function\"?r:s)()}reportSeparator(){}reportInfo(e,r){}reportWarning(e,r){}reportError(e,r){}reportProgress(e){return{...Promise.resolve().then(async()=>{for await(let{}of e);}),stop:()=>{}}}reportJson(e){}reportFold(e,r){}async finalize(){}}});var dde,ZI,WG=Ze(()=>{Dt();dde=ut(wQ());oI();tm();xc();I0();Tp();Wo();ZI=class{constructor(e,{project:r}){this.workspacesCwds=new Set;this.project=r,this.cwd=e}async setup(){this.manifest=await Ut.tryFind(this.cwd)??new Ut,this.relativeCwd=J.relative(this.project.cwd,this.cwd)||vt.dot;let e=this.manifest.name?this.manifest.name:Da(null,`${this.computeCandidateName()}-${cs(this.relativeCwd).substring(0,6)}`);this.anchoredDescriptor=On(e,`${Ei.protocol}${this.relativeCwd}`),this.anchoredLocator=Ws(e,`${Ei.protocol}${this.relativeCwd}`);let r=this.manifest.workspaceDefinitions.map(({pattern:a})=>a);if(r.length===0)return;let s=await(0,dde.default)(r,{cwd:fe.fromPortablePath(this.cwd),onlyDirectories:!0,ignore:[\"**/node_modules\",\"**/.git\",\"**/.yarn\"]});s.sort(),await s.reduce(async(a,n)=>{let c=J.resolve(this.cwd,fe.toPortablePath(n)),f=await ce.existsPromise(J.join(c,\"package.json\"));await a,f&&this.workspacesCwds.add(c)},Promise.resolve())}get anchoredPackage(){let e=this.project.storedPackages.get(this.anchoredLocator.locatorHash);if(!e)throw new Error(`Assertion failed: Expected workspace ${GB(this.project.configuration,this)} (${Ht(this.project.configuration,J.join(this.cwd,Er.manifest),ht.PATH)}) to have been resolved. Run \"yarn install\" to update the lockfile`);return e}accepts(e){let r=e.indexOf(\":\"),s=r!==-1?e.slice(0,r+1):null,a=r!==-1?e.slice(r+1):e;if(s===Ei.protocol&&J.normalize(a)===this.relativeCwd||s===Ei.protocol&&(a===\"*\"||a===\"^\"||a===\"~\"))return!0;let n=cl(a);return n?s===Ei.protocol?n.test(this.manifest.version??\"0.0.0\"):this.project.configuration.get(\"enableTransparentWorkspaces\")&&this.manifest.version!==null?n.test(this.manifest.version):!1:!1}computeCandidateName(){return this.cwd===this.project.cwd?\"root-workspace\":`${J.basename(this.cwd)}`||\"unnamed-workspace\"}getRecursiveWorkspaceDependencies({dependencies:e=Ut.hardDependencies}={}){let r=new Set,s=a=>{for(let n of e)for(let c of a.manifest[n].values()){let f=this.project.tryWorkspaceByDescriptor(c);f===null||r.has(f)||(r.add(f),s(f))}};return s(this),r}getRecursiveWorkspaceDependents({dependencies:e=Ut.hardDependencies}={}){let r=new Set,s=a=>{for(let n of this.project.workspaces)e.some(f=>[...n.manifest[f].values()].some(p=>{let h=this.project.tryWorkspaceByDescriptor(p);return h!==null&&_B(h.anchoredLocator,a.anchoredLocator)}))&&!r.has(n)&&(r.add(n),s(n))};return s(this),r}getRecursiveWorkspaceChildren(){let e=new Set([this]);for(let r of e)for(let s of r.workspacesCwds){let a=this.project.workspacesByCwd.get(s);a&&e.add(a)}return e.delete(this),Array.from(e)}async persistManifest(){let e={};this.manifest.exportTo(e);let r=J.join(this.cwd,Ut.fileName),s=`${JSON.stringify(e,null,this.manifest.indent)}\n`;await ce.changeFilePromise(r,s,{automaticNewlines:!0}),this.manifest.raw=e}}});function uat({project:t,allDescriptors:e,allResolutions:r,allPackages:s,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:c=new Map,peerWarnings:f=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,C=[],S=new Map,b=new Map,I=new Map,T=new Map,N=new Map,U=new Map(t.workspaces.map(le=>{let me=le.anchoredLocator.locatorHash,pe=s.get(me);if(typeof pe>\"u\")throw new Error(\"Assertion failed: The workspace should have an associated package\");return[me,LB(pe)]})),W=()=>{let le=ce.mktempSync(),me=J.join(le,\"stacktrace.log\"),pe=String(C.length+1).length,Be=C.map((Ce,g)=>`${`${g+1}.`.padStart(pe,\" \")} ${ll(Ce)}\n`).join(\"\");throw ce.writeFileSync(me,Be),ce.detachTemp(le),new jt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${fe.fromPortablePath(me)}`)},ee=le=>{let me=r.get(le.descriptorHash);if(typeof me>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");let pe=s.get(me);if(!pe)throw new Error(\"Assertion failed: The package could not be found\");return pe},ie=(le,me,pe,{top:Be,optional:Ce})=>{C.length>1e3&&W(),C.push(me);let g=ue(le,me,pe,{top:Be,optional:Ce});return C.pop(),g},ue=(le,me,pe,{top:Be,optional:Ce})=>{if(Ce||n.delete(me.locatorHash),a.has(me.locatorHash))return;a.add(me.locatorHash);let g=s.get(me.locatorHash);if(!g)throw new Error(`Assertion failed: The package (${Yr(t.configuration,me)}) should have been registered`);let we=new Set,ye=new Map,Ae=[],se=[],X=[],De=[];for(let Te of Array.from(g.dependencies.values())){if(g.peerDependencies.has(Te.identHash)&&g.locatorHash!==Be)continue;if(kp(Te))throw new Error(\"Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch\");h.delete(Te.descriptorHash);let mt=Ce;if(!mt){let ke=g.dependenciesMeta.get(un(Te));if(typeof ke<\"u\"){let it=ke.get(null);typeof it<\"u\"&&it.optional&&(mt=!0)}}let j=r.get(Te.descriptorHash);if(!j)throw new Error(`Assertion failed: The resolution (${ni(t.configuration,Te)}) should have been registered`);let rt=U.get(j)||s.get(j);if(!rt)throw new Error(`Assertion failed: The package (${j}, resolved from ${ni(t.configuration,Te)}) should have been registered`);if(rt.peerDependencies.size===0){ie(Te,rt,new Map,{top:Be,optional:mt});continue}let Fe,Ne,be=new Set,Ve=new Map;Ae.push(()=>{Fe=S8(Te,me.locatorHash),Ne=D8(rt,me.locatorHash),g.dependencies.set(Te.identHash,Fe),r.set(Fe.descriptorHash,Ne.locatorHash),e.set(Fe.descriptorHash,Fe),s.set(Ne.locatorHash,Ne),Pp(T,Ne.locatorHash).add(Fe.descriptorHash),we.add(Ne.locatorHash)}),se.push(()=>{N.set(Ne.locatorHash,Ve);for(let ke of Ne.peerDependencies.values()){let Ue=Yl(ye,ke.identHash,()=>{let x=pe.get(ke.identHash)??null,w=g.dependencies.get(ke.identHash);return!w&&UB(me,ke)&&(le.identHash===me.identHash?w=le:(w=On(me,le.range),e.set(w.descriptorHash,w),r.set(w.descriptorHash,me.locatorHash),h.delete(w.descriptorHash),x=null)),w||(w=On(ke,\"missing:\")),{subject:me,ident:ke,provided:w,root:!x,requests:new Map,hash:`p${cs(me.locatorHash,ke.identHash).slice(0,6)}`}}).provided;if(Ue.range===\"missing:\"&&Ne.dependencies.has(ke.identHash)){Ne.peerDependencies.delete(ke.identHash);continue}if(Ve.set(ke.identHash,{requester:Ne,descriptor:ke,meta:Ne.peerDependenciesMeta.get(un(ke)),children:new Map}),Ne.dependencies.set(ke.identHash,Ue),kp(Ue)){let x=r.get(Ue.descriptorHash);Pp(I,x).add(Ne.locatorHash)}S.set(Ue.identHash,Ue),Ue.range===\"missing:\"&&be.add(Ue.identHash)}Ne.dependencies=new Map(qs(Ne.dependencies,([ke,it])=>un(it)))}),X.push(()=>{if(!s.has(Ne.locatorHash))return;let ke=E.get(rt.locatorHash);typeof ke==\"number\"&&ke>=2&&W();let it=E.get(rt.locatorHash),Ue=typeof it<\"u\"?it+1:1;E.set(rt.locatorHash,Ue),ie(Fe,Ne,Ve,{top:Be,optional:mt}),E.set(rt.locatorHash,Ue-1)}),De.push(()=>{let ke=r.get(Fe.descriptorHash);if(typeof ke>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let it=N.get(ke);if(typeof it>\"u\")throw new Error(\"Assertion failed: Expected the peer requests to be registered\");for(let Ue of ye.values()){let x=it.get(Ue.ident.identHash);x&&(Ue.requests.set(Fe.descriptorHash,x),p.set(Ue.hash,Ue),Ue.root||pe.get(Ue.ident.identHash)?.children.set(Fe.descriptorHash,x))}if(s.has(Ne.locatorHash))for(let Ue of be)Ne.dependencies.delete(Ue)})}for(let Te of[...Ae,...se])Te();for(let Te of we){we.delete(Te);let mt=s.get(Te),j=cs(rI(mt).locatorHash,...Array.from(mt.dependencies.values(),be=>{let Ve=be.range!==\"missing:\"?r.get(be.descriptorHash):\"missing:\";if(typeof Ve>\"u\")throw new Error(`Assertion failed: Expected the resolution for ${ni(t.configuration,be)} to have been registered`);return Ve===Be?`${Ve} (top)`:Ve})),rt=b.get(j);if(typeof rt>\"u\"){b.set(j,mt);continue}let Fe=Pp(T,rt.locatorHash);for(let be of T.get(mt.locatorHash)??[])r.set(be,rt.locatorHash),Fe.add(be);s.delete(mt.locatorHash),a.delete(mt.locatorHash),we.delete(mt.locatorHash);let Ne=I.get(mt.locatorHash);if(Ne!==void 0){let be=Pp(I,rt.locatorHash);for(let Ve of Ne)be.add(Ve),we.add(Ve)}}for(let Te of[...X,...De])Te()};for(let le of t.workspaces){let me=le.anchoredLocator;h.delete(le.anchoredDescriptor.descriptorHash),ie(le.anchoredDescriptor,me,new Map,{top:me.locatorHash,optional:!1})}for(let le of p.values()){if(!le.root)continue;let me=s.get(le.subject.locatorHash);if(typeof me>\"u\")continue;for(let Be of le.requests.values()){let Ce=`p${cs(le.subject.locatorHash,un(le.ident),Be.requester.locatorHash).slice(0,6)}`;c.set(Ce,{subject:le.subject.locatorHash,requested:le.ident,rootRequester:Be.requester.locatorHash,allRequesters:Array.from(qB(Be),g=>g.requester.locatorHash)})}let pe=[...qB(le)];if(le.provided.range!==\"missing:\"){let Be=ee(le.provided),Ce=Be.version??\"0.0.0\",g=ye=>{if(ye.startsWith(Ei.protocol)){if(!t.tryWorkspaceByLocator(Be))return null;ye=ye.slice(Ei.protocol.length),(ye===\"^\"||ye===\"~\")&&(ye=\"*\")}return ye},we=!0;for(let ye of pe){let Ae=g(ye.descriptor.range);if(Ae===null){we=!1;continue}if(!Xf(Ce,Ae)){we=!1;let se=`p${cs(le.subject.locatorHash,un(le.ident),ye.requester.locatorHash).slice(0,6)}`;f.push({type:1,subject:me,requested:le.ident,requester:ye.requester,version:Ce,hash:se,requirementCount:pe.length})}}if(!we){let ye=pe.map(Ae=>g(Ae.descriptor.range));f.push({type:3,node:le,range:ye.includes(null)?null:x8(ye),hash:le.hash})}}else{let Be=!0;for(let Ce of pe)if(!Ce.meta?.optional){Be=!1;let g=`p${cs(le.subject.locatorHash,un(le.ident),Ce.requester.locatorHash).slice(0,6)}`;f.push({type:0,subject:me,requested:le.ident,requester:Ce.requester,hash:g})}Be||f.push({type:2,node:le,hash:le.hash})}}}function*fat(t){let e=new Map;if(\"children\"in t)e.set(t,t);else for(let r of t.requests.values())e.set(r,r);for(let[r,s]of e){yield{request:r,root:s};for(let a of r.children.values())e.has(a)||e.set(a,s)}}function Aat(t,e){let r=[],s=[],a=!1;for(let n of t.peerWarnings)if(!(n.type===1||n.type===0)){if(!t.tryWorkspaceByLocator(n.node.subject)){a=!0;continue}if(n.type===3){let c=t.storedResolutions.get(n.node.provided.descriptorHash);if(typeof c>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let f=t.storedPackages.get(c);if(typeof f>\"u\")throw new Error(\"Assertion failed: Expected the package to be registered\");let p=p0(fat(n.node),({request:C,root:S})=>Xf(f.version??\"0.0.0\",C.descriptor.range)?p0.skip:C===S?Xi(t.configuration,C.requester):`${Xi(t.configuration,C.requester)} (via ${Xi(t.configuration,S.requester)})`),h=[...qB(n.node)].length>1?\"and other dependencies request\":\"requests\",E=n.range?iI(t.configuration,n.range):Ht(t.configuration,\"but they have non-overlapping ranges!\",\"redBright\");r.push(`${Xi(t.configuration,n.node.ident)} is listed by your project with version ${jB(t.configuration,f.version??\"0.0.0\")} (${Ht(t.configuration,n.hash,ht.CODE)}), which doesn't satisfy what ${p} ${h} (${E}).`)}if(n.type===2){let c=n.node.requests.size>1?\" and other dependencies\":\"\";s.push(`${Yr(t.configuration,n.node.subject)} doesn't provide ${Xi(t.configuration,n.node.ident)} (${Ht(t.configuration,n.hash,ht.CODE)}), requested by ${Xi(t.configuration,n.node.requests.values().next().value.requester)}${c}.`)}}e.startSectionSync({reportFooter:()=>{e.reportWarning(86,`Some peer dependencies are incorrectly met by your project; run ${Ht(t.configuration,\"yarn explain peer-requirements <hash>\",ht.CODE)} for details, where ${Ht(t.configuration,\"<hash>\",ht.CODE)} is the six-letter p-prefixed code.`)},skipIfEmpty:!0},()=>{for(let n of qs(r,c=>JE.default(c)))e.reportWarning(60,n);for(let n of qs(s,c=>JE.default(c)))e.reportWarning(2,n)}),a&&e.reportWarning(86,`Some peer dependencies are incorrectly met by dependencies; run ${Ht(t.configuration,\"yarn explain peer-requirements\",ht.CODE)} for details.`)}var jT,GT,Ede,JG,VG,KG,qT,sat,oat,mde,aat,lat,cat,$l,YG,WT,yde,Rt,Ide=Ze(()=>{Dt();Dt();wc();Yt();jT=Ie(\"crypto\");GG();ql();GT=ut(Ld()),Ede=ut(Ai()),JG=Ie(\"util\"),VG=ut(Ie(\"v8\")),KG=ut(Ie(\"zlib\"));FG();av();NG();OG();oI();R8();Rc();gde();Ev();qG();tm();WG();OQ();xc();I0();bc();hR();Vj();Tp();Wo();qT=YE(process.env.YARN_LOCKFILE_VERSION_OVERRIDE??8),sat=3,oat=/ *, */g,mde=/\\/$/,aat=32,lat=(0,JG.promisify)(KG.default.gzip),cat=(0,JG.promisify)(KG.default.gunzip),$l=(r=>(r.UpdateLockfile=\"update-lockfile\",r.SkipBuild=\"skip-build\",r))($l||{}),YG={restoreLinkersCustomData:[\"linkersCustomData\"],restoreResolutions:[\"accessibleLocators\",\"conditionalLocators\",\"disabledLocators\",\"optionalBuilds\",\"storedDescriptors\",\"storedResolutions\",\"storedPackages\",\"lockFileChecksum\"],restoreBuildState:[\"skippedBuilds\",\"storedBuildState\"]},WT=(a=>(a[a.NotProvided=0]=\"NotProvided\",a[a.NotCompatible=1]=\"NotCompatible\",a[a.NodeNotProvided=2]=\"NodeNotProvided\",a[a.NodeNotCompatible=3]=\"NodeNotCompatible\",a))(WT||{}),yde=t=>cs(`${sat}`,t),Rt=class t{constructor(e,{configuration:r}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.skippedBuilds=new Set;this.lockfileLastVersion=null;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.peerWarnings=[];this.peerRequirementNodes=new Map;this.linkersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=r,this.cwd=e}static async find(e,r){if(!e.projectCwd)throw new nt(`No project found in ${r}`);let s=e.projectCwd,a=r,n=null;for(;n!==e.projectCwd;){if(n=a,ce.existsSync(J.join(n,Er.manifest))){s=n;break}a=J.dirname(n)}let c=new t(e.projectCwd,{configuration:e});ze.telemetry?.reportProject(c.cwd),await c.setupResolutions(),await c.setupWorkspaces(),ze.telemetry?.reportWorkspaceCount(c.workspaces.length),ze.telemetry?.reportDependencyCount(c.workspaces.reduce((I,T)=>I+T.manifest.dependencies.size+T.manifest.devDependencies.size,0));let f=c.tryWorkspaceByCwd(s);if(f)return{project:c,workspace:f,locator:f.anchoredLocator};let p=await c.findLocatorForLocation(`${s}/`,{strict:!0});if(p)return{project:c,locator:p,workspace:null};let h=Ht(e,c.cwd,ht.PATH),E=Ht(e,J.relative(c.cwd,s),ht.PATH),C=`- If ${h} isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,S=`- If ${h} is intended to be a project, it might be that you forgot to list ${E} in its workspace configuration.`,b=`- Finally, if ${h} is fine and you intend ${E} to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.`;throw new nt(`The nearest package directory (${Ht(e,s,ht.PATH)}) doesn't seem to be part of the project declared in ${Ht(e,c.cwd,ht.PATH)}.\n\n${[C,S,b].join(`\n`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=J.join(this.cwd,Er.lockfile),r=this.configuration.get(\"defaultLanguageName\");if(ce.existsSync(e)){let s=await ce.readFilePromise(e,\"utf8\");this.lockFileChecksum=yde(s);let a=as(s);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<qT;for(let f of Object.keys(a)){if(f===\"__metadata\")continue;let p=a[f];if(typeof p.resolution>\"u\")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${f})`);let h=Qp(p.resolution,!0),E=new Ut;E.load(p,{yamlCompatibilityMode:!0});let C=E.version,S=E.languageName||r,b=p.linkType.toUpperCase(),I=p.conditions??null,T=E.dependencies,N=E.peerDependencies,U=E.dependenciesMeta,W=E.peerDependenciesMeta,ee=E.bin;if(p.checksum!=null){let ue=typeof c<\"u\"&&!p.checksum.includes(\"/\")?`${c}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,ue)}let ie={...h,version:C,languageName:S,linkType:b,conditions:I,dependencies:T,peerDependencies:N,dependenciesMeta:U,peerDependenciesMeta:W,bin:ee};this.originalPackages.set(ie.locatorHash,ie);for(let ue of f.split(oat)){let le=C0(ue);n<=6&&(le=this.configuration.normalizeDependency(le),le=On(le,le.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,\"$1npm%3A\"))),this.storedDescriptors.set(le.descriptorHash,le),this.storedResolutions.set(le.descriptorHash,h.locatorHash)}}}else s.includes(\"yarn lockfile v1\")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=new Set,r=(0,GT.default)(4),s=async(a,n)=>{if(e.has(n))return a;e.add(n);let c=new ZI(n,{project:this});await r(()=>c.setup());let f=a.then(()=>{this.addWorkspace(c)});return Array.from(c.workspacesCwds).reduce(s,f)};await s(Promise.resolve(),this.cwd)}addWorkspace(e){let r=this.workspacesByIdent.get(e.anchoredLocator.identHash);if(typeof r<\"u\")throw new Error(`Duplicate workspace name ${Xi(this.configuration,e.anchoredLocator)}: ${fe.fromPortablePath(e.cwd)} conflicts with ${fe.fromPortablePath(r.cwd)}`);this.workspaces.push(e),this.workspacesByCwd.set(e.cwd,e),this.workspacesByIdent.set(e.anchoredLocator.identHash,e)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){J.isAbsolute(e)||(e=J.resolve(this.cwd,e)),e=J.normalize(e).replace(/\\/+$/,\"\");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let s of this.workspaces)J.relative(s.cwd,e).startsWith(\"../\")||r&&r.cwd.length>=s.cwd.length||(r=s);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r>\"u\"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${Xi(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){if(e.range.startsWith(Ei.protocol)){let s=e.range.slice(Ei.protocol.length);if(s!==\"^\"&&s!==\"~\"&&s!==\"*\"&&!cl(s))return this.tryWorkspaceByCwd(s)}let r=this.tryWorkspaceByIdent(e);return r===null||(kp(e)&&(e=MB(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${ni(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Gu(e)&&(e=rI(e)),r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${Yr(this.configuration,e)})`);return r}deleteDescriptor(e){this.storedResolutions.delete(e),this.storedDescriptors.delete(e)}deleteLocator(e){this.originalPackages.delete(e),this.storedPackages.delete(e),this.accessibleLocators.delete(e)}forgetResolution(e){if(\"descriptorHash\"in e){let r=this.storedResolutions.get(e.descriptorHash);this.deleteDescriptor(e.descriptorHash);let s=new Set(this.storedResolutions.values());typeof r<\"u\"&&!s.has(r)&&this.deleteLocator(r)}if(\"locatorHash\"in e){this.deleteLocator(e.locatorHash);for(let[r,s]of this.storedResolutions)s===e.locatorHash&&this.deleteDescriptor(r)}}forgetTransientResolutions(){let e=this.configuration.makeResolver(),r=new Map;for(let[s,a]of this.storedResolutions.entries()){let n=r.get(a);n||r.set(a,n=new Set),n.add(s)}for(let s of this.originalPackages.values()){let a;try{a=e.shouldPersistResolution(s,{project:this,resolver:e})}catch{a=!1}if(!a){this.deleteLocator(s.locatorHash);let n=r.get(s.locatorHash);if(n){r.delete(s.locatorHash);for(let c of n)this.deleteDescriptor(c)}}}}forgetVirtualResolutions(){for(let e of this.storedPackages.values())for(let[r,s]of e.dependencies)kp(s)&&e.dependencies.set(r,MB(s))}getDependencyMeta(e,r){let s={},n=this.topLevelWorkspace.manifest.dependenciesMeta.get(un(e));if(!n)return s;let c=n.get(null);if(c&&Object.assign(s,c),r===null||!Ede.default.valid(r))return s;for(let[f,p]of n)f!==null&&f===r&&Object.assign(s,p);return s}async findLocatorForLocation(e,{strict:r=!1}={}){let s=new ki,a=this.configuration.getLinkers(),n={project:this,report:s};for(let c of a){let f=await c.findPackageLocator(e,n);if(f){if(r&&(await c.findPackageLocation(f,n)).replace(mde,\"\")!==e.replace(mde,\"\"))continue;return f}}return null}async loadUserConfig(){let e=J.join(this.cwd,\".pnp.cjs\");await ce.existsPromise(e)&&bp(e).setup();let r=J.join(this.cwd,\"yarn.config.cjs\");return await ce.existsPromise(r)?bp(r):null}async preparePackage(e,{resolver:r,resolveOptions:s}){let a=await this.configuration.getPackageExtensions(),n=this.configuration.normalizePackage(e,{packageExtensions:a});for(let[c,f]of n.dependencies){let p=await this.configuration.reduceHook(E=>E.reduceDependency,f,this,n,f,{resolver:r,resolveOptions:s});if(!UB(f,p))throw new Error(\"Assertion failed: The descriptor ident cannot be changed through aliases\");let h=r.bindDescriptor(p,n,s);n.dependencies.set(c,h)}return n}async resolveEverything(e){if(!this.workspacesByCwd||!this.workspacesByIdent)throw new Error(\"Workspaces must have been setup before calling this function\");this.forgetVirtualResolutions();let r=new Map(this.originalPackages),s=[];e.lockfileOnly||this.forgetTransientResolutions();let a=e.resolver||this.configuration.makeResolver(),n=new KI(a);await n.setup(this,{report:e.report});let c=e.lockfileOnly?[new HT(a)]:[n,a],f=new rm([new zI(a),...c]),p=new rm([...c]),h=this.configuration.makeFetcher(),E=e.lockfileOnly?{project:this,report:e.report,resolver:f}:{project:this,report:e.report,resolver:f,fetchOptions:{project:this,cache:e.cache,checksums:this.storedChecksums,report:e.report,fetcher:h,cacheOptions:{mirrorWriteOnly:!0}}},C=new Map,S=new Map,b=new Map,I=new Map,T=new Map,N=new Map,U=this.topLevelWorkspace.anchoredLocator,W=new Set,ee=[],ie=lj(),ue=this.configuration.getSupportedArchitectures();await e.report.startProgressPromise(Ao.progressViaTitle(),async se=>{let X=async rt=>{let Fe=await qE(async()=>await f.resolve(rt,E),ke=>`${Yr(this.configuration,rt)}: ${ke}`);if(!_B(rt,Fe))throw new Error(`Assertion failed: The locator cannot be changed by the resolver (went from ${Yr(this.configuration,rt)} to ${Yr(this.configuration,Fe)})`);I.set(Fe.locatorHash,Fe),!r.delete(Fe.locatorHash)&&!this.tryWorkspaceByLocator(Fe)&&s.push(Fe);let be=await this.preparePackage(Fe,{resolver:f,resolveOptions:E}),Ve=Uu([...be.dependencies.values()].map(ke=>j(ke)));return ee.push(Ve),Ve.catch(()=>{}),S.set(be.locatorHash,be),be},De=async rt=>{let Fe=T.get(rt.locatorHash);if(typeof Fe<\"u\")return Fe;let Ne=Promise.resolve().then(()=>X(rt));return T.set(rt.locatorHash,Ne),Ne},Te=async(rt,Fe)=>{let Ne=await j(Fe);return C.set(rt.descriptorHash,rt),b.set(rt.descriptorHash,Ne.locatorHash),Ne},mt=async rt=>{se.setTitle(ni(this.configuration,rt));let Fe=this.resolutionAliases.get(rt.descriptorHash);if(typeof Fe<\"u\")return Te(rt,this.storedDescriptors.get(Fe));let Ne=f.getResolutionDependencies(rt,E),be=Object.fromEntries(await Uu(Object.entries(Ne).map(async([it,Ue])=>{let x=f.bindDescriptor(Ue,U,E),w=await j(x);return W.add(w.locatorHash),[it,w]}))),ke=(await qE(async()=>await f.getCandidates(rt,be,E),it=>`${ni(this.configuration,rt)}: ${it}`))[0];if(typeof ke>\"u\")throw new jt(82,`${ni(this.configuration,rt)}: No candidates found`);if(e.checkResolutions){let{locators:it}=await p.getSatisfying(rt,be,[ke],{...E,resolver:p});if(!it.find(Ue=>Ue.locatorHash===ke.locatorHash))throw new jt(78,`Invalid resolution ${FB(this.configuration,rt,ke)}`)}return C.set(rt.descriptorHash,rt),b.set(rt.descriptorHash,ke.locatorHash),De(ke)},j=rt=>{let Fe=N.get(rt.descriptorHash);if(typeof Fe<\"u\")return Fe;C.set(rt.descriptorHash,rt);let Ne=Promise.resolve().then(()=>mt(rt));return N.set(rt.descriptorHash,Ne),Ne};for(let rt of this.workspaces){let Fe=rt.anchoredDescriptor;ee.push(j(Fe))}for(;ee.length>0;){let rt=[...ee];ee.length=0,await Uu(rt)}});let le=Wl(r.values(),se=>this.tryWorkspaceByLocator(se)?Wl.skip:se);if(s.length>0||le.length>0){let se=new Set(this.workspaces.flatMap(rt=>{let Fe=S.get(rt.anchoredLocator.locatorHash);if(!Fe)throw new Error(\"Assertion failed: The workspace should have been resolved\");return Array.from(Fe.dependencies.values(),Ne=>{let be=b.get(Ne.descriptorHash);if(!be)throw new Error(\"Assertion failed: The resolution should have been registered\");return be})})),X=rt=>se.has(rt.locatorHash)?\"0\":\"1\",De=rt=>ll(rt),Te=qs(s,[X,De]),mt=qs(le,[X,De]),j=e.report.getRecommendedLength();Te.length>0&&e.report.reportInfo(85,`${Ht(this.configuration,\"+\",ht.ADDED)} ${Xk(this.configuration,Te,j)}`),mt.length>0&&e.report.reportInfo(85,`${Ht(this.configuration,\"-\",ht.REMOVED)} ${Xk(this.configuration,mt,j)}`)}let me=new Set(this.resolutionAliases.values()),pe=new Set(S.keys()),Be=new Set,Ce=new Map,g=[],we=new Map;uat({project:this,accessibleLocators:Be,volatileDescriptors:me,optionalBuilds:pe,peerRequirements:Ce,peerWarnings:g,peerRequirementNodes:we,allDescriptors:C,allResolutions:b,allPackages:S});for(let se of W)pe.delete(se);for(let se of me)C.delete(se),b.delete(se);let ye=new Set,Ae=new Set;for(let se of S.values())se.conditions!=null&&pe.has(se.locatorHash)&&(QQ(se,ue)||(QQ(se,ie)&&e.report.reportWarningOnce(77,`${Yr(this.configuration,se)}: Your current architecture (${process.platform}-${process.arch}) is supported by this package, but is missing from the ${Ht(this.configuration,\"supportedArchitectures\",ht.SETTING)} setting`),Ae.add(se.locatorHash)),ye.add(se.locatorHash));this.storedResolutions=b,this.storedDescriptors=C,this.storedPackages=S,this.accessibleLocators=Be,this.conditionalLocators=ye,this.disabledLocators=Ae,this.originalPackages=I,this.optionalBuilds=pe,this.peerRequirements=Ce,this.peerWarnings=g,this.peerRequirementNodes=we}async fetchEverything({cache:e,report:r,fetcher:s,mode:a,persistProject:n=!0}){let c={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators},f=s||this.configuration.makeFetcher(),p={checksums:this.storedChecksums,project:this,cache:e,fetcher:f,report:r,cacheOptions:c},h=Array.from(new Set(qs(this.storedResolutions.values(),[I=>{let T=this.storedPackages.get(I);if(!T)throw new Error(\"Assertion failed: The locator should have been registered\");return ll(T)}])));a===\"update-lockfile\"&&(h=h.filter(I=>!this.storedChecksums.has(I)));let E=!1,C=Ao.progressViaCounter(h.length);await r.reportProgress(C);let S=(0,GT.default)(aat);if(await Uu(h.map(I=>S(async()=>{let T=this.storedPackages.get(I);if(!T)throw new Error(\"Assertion failed: The locator should have been registered\");if(Gu(T))return;let N;try{N=await f.fetch(T,p)}catch(U){U.message=`${Yr(this.configuration,T)}: ${U.message}`,r.reportExceptionOnce(U),E=U;return}N.checksum!=null?this.storedChecksums.set(T.locatorHash,N.checksum):this.storedChecksums.delete(T.locatorHash),N.releaseFs&&N.releaseFs()}).finally(()=>{C.tick()}))),E)throw E;let b=n&&a!==\"update-lockfile\"?await this.cacheCleanup({cache:e,report:r}):null;if(r.cacheMisses.size>0||b){let T=(await Promise.all([...r.cacheMisses].map(async le=>{let me=this.storedPackages.get(le),pe=this.storedChecksums.get(le)??null,Be=e.getLocatorPath(me,pe);return(await ce.statPromise(Be)).size}))).reduce((le,me)=>le+me,0)-(b?.size??0),N=r.cacheMisses.size,U=b?.count??0,W=`${Wk(N,{zero:\"No new packages\",one:\"A package was\",more:`${Ht(this.configuration,N,ht.NUMBER)} packages were`})} added to the project`,ee=`${Wk(U,{zero:\"none were\",one:\"one was\",more:`${Ht(this.configuration,U,ht.NUMBER)} were`})} removed`,ie=T!==0?` (${Ht(this.configuration,T,ht.SIZE_DIFF)})`:\"\",ue=U>0?N>0?`${W}, and ${ee}${ie}.`:`${W}, but ${ee}${ie}.`:`${W}${ie}.`;r.reportInfo(13,ue)}}async linkEverything({cache:e,report:r,fetcher:s,mode:a}){let n={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators,skipIntegrityCheck:!0},c=s||this.configuration.makeFetcher(),f={checksums:this.storedChecksums,project:this,cache:e,fetcher:c,report:r,cacheOptions:n},p=this.configuration.getLinkers(),h={project:this,report:r},E=new Map(p.map(ye=>{let Ae=ye.makeInstaller(h),se=ye.getCustomDataKey(),X=this.linkersCustomData.get(se);return typeof X<\"u\"&&Ae.attachCustomData(X),[ye,Ae]})),C=new Map,S=new Map,b=new Map,I=new Map(await Uu([...this.accessibleLocators].map(async ye=>{let Ae=this.storedPackages.get(ye);if(!Ae)throw new Error(\"Assertion failed: The locator should have been registered\");return[ye,await c.fetch(Ae,f)]}))),T=[],N=new Set,U=[];for(let ye of this.accessibleLocators){let Ae=this.storedPackages.get(ye);if(typeof Ae>\"u\")throw new Error(\"Assertion failed: The locator should have been registered\");let se=I.get(Ae.locatorHash);if(typeof se>\"u\")throw new Error(\"Assertion failed: The fetch result should have been registered\");let X=[],De=mt=>{X.push(mt)},Te=this.tryWorkspaceByLocator(Ae);if(Te!==null){let mt=[],{scripts:j}=Te.manifest;for(let Fe of[\"preinstall\",\"install\",\"postinstall\"])j.has(Fe)&&mt.push({type:0,script:Fe});try{for(let[Fe,Ne]of E)if(Fe.supportsPackage(Ae,h)&&(await Ne.installPackage(Ae,se,{holdFetchResult:De})).buildRequest!==null)throw new Error(\"Assertion failed: Linkers can't return build directives for workspaces; this responsibility befalls to the Yarn core\")}finally{X.length===0?se.releaseFs?.():T.push(Uu(X).catch(()=>{}).then(()=>{se.releaseFs?.()}))}let rt=J.join(se.packageFs.getRealPath(),se.prefixPath);S.set(Ae.locatorHash,rt),!Gu(Ae)&&mt.length>0&&b.set(Ae.locatorHash,{buildDirectives:mt,buildLocations:[rt]})}else{let mt=p.find(Fe=>Fe.supportsPackage(Ae,h));if(!mt)throw new jt(12,`${Yr(this.configuration,Ae)} isn't supported by any available linker`);let j=E.get(mt);if(!j)throw new Error(\"Assertion failed: The installer should have been registered\");let rt;try{rt=await j.installPackage(Ae,se,{holdFetchResult:De})}finally{X.length===0?se.releaseFs?.():T.push(Uu(X).then(()=>{}).then(()=>{se.releaseFs?.()}))}C.set(Ae.locatorHash,mt),S.set(Ae.locatorHash,rt.packageLocation),rt.buildRequest&&rt.packageLocation&&(rt.buildRequest.skipped?(N.add(Ae.locatorHash),this.skippedBuilds.has(Ae.locatorHash)||U.push([Ae,rt.buildRequest.explain])):b.set(Ae.locatorHash,{buildDirectives:rt.buildRequest.directives,buildLocations:[rt.packageLocation]}))}}let W=new Map;for(let ye of this.accessibleLocators){let Ae=this.storedPackages.get(ye);if(!Ae)throw new Error(\"Assertion failed: The locator should have been registered\");let se=this.tryWorkspaceByLocator(Ae)!==null,X=async(De,Te)=>{let mt=S.get(Ae.locatorHash);if(typeof mt>\"u\")throw new Error(`Assertion failed: The package (${Yr(this.configuration,Ae)}) should have been registered`);let j=[];for(let rt of Ae.dependencies.values()){let Fe=this.storedResolutions.get(rt.descriptorHash);if(typeof Fe>\"u\")throw new Error(`Assertion failed: The resolution (${ni(this.configuration,rt)}, from ${Yr(this.configuration,Ae)})should have been registered`);let Ne=this.storedPackages.get(Fe);if(typeof Ne>\"u\")throw new Error(`Assertion failed: The package (${Fe}, resolved from ${ni(this.configuration,rt)}) should have been registered`);let be=this.tryWorkspaceByLocator(Ne)===null?C.get(Fe):null;if(typeof be>\"u\")throw new Error(`Assertion failed: The package (${Fe}, resolved from ${ni(this.configuration,rt)}) should have been registered`);be===De||be===null?S.get(Ne.locatorHash)!==null&&j.push([rt,Ne]):!se&&mt!==null&&xB(W,Fe).push(mt)}mt!==null&&await Te.attachInternalDependencies(Ae,j)};if(se)for(let[De,Te]of E)De.supportsPackage(Ae,h)&&await X(De,Te);else{let De=C.get(Ae.locatorHash);if(!De)throw new Error(\"Assertion failed: The linker should have been found\");let Te=E.get(De);if(!Te)throw new Error(\"Assertion failed: The installer should have been registered\");await X(De,Te)}}for(let[ye,Ae]of W){let se=this.storedPackages.get(ye);if(!se)throw new Error(\"Assertion failed: The package should have been registered\");let X=C.get(se.locatorHash);if(!X)throw new Error(\"Assertion failed: The linker should have been found\");let De=E.get(X);if(!De)throw new Error(\"Assertion failed: The installer should have been registered\");await De.attachExternalDependents(se,Ae)}let ee=new Map;for(let[ye,Ae]of E){let se=await Ae.finalizeInstall();for(let X of se?.records??[])X.buildRequest.skipped?(N.add(X.locator.locatorHash),this.skippedBuilds.has(X.locator.locatorHash)||U.push([X.locator,X.buildRequest.explain])):b.set(X.locator.locatorHash,{buildDirectives:X.buildRequest.directives,buildLocations:X.buildLocations});typeof se?.customData<\"u\"&&ee.set(ye.getCustomDataKey(),se.customData)}if(this.linkersCustomData=ee,await Uu(T),a===\"skip-build\")return;for(let[,ye]of qs(U,([Ae])=>ll(Ae)))ye(r);let ie=new Set(b.keys()),ue=(0,jT.createHash)(\"sha512\");ue.update(process.versions.node),await this.configuration.triggerHook(ye=>ye.globalHashGeneration,this,ye=>{ue.update(\"\\0\"),ue.update(ye)});let le=ue.digest(\"hex\"),me=new Map,pe=ye=>{let Ae=me.get(ye.locatorHash);if(typeof Ae<\"u\")return Ae;let se=this.storedPackages.get(ye.locatorHash);if(typeof se>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");let X=(0,jT.createHash)(\"sha512\");X.update(ye.locatorHash),me.set(ye.locatorHash,\"<recursive>\");for(let De of se.dependencies.values()){let Te=this.storedResolutions.get(De.descriptorHash);if(typeof Te>\"u\")throw new Error(`Assertion failed: The resolution (${ni(this.configuration,De)}) should have been registered`);let mt=this.storedPackages.get(Te);if(typeof mt>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");X.update(pe(mt))}return Ae=X.digest(\"hex\"),me.set(ye.locatorHash,Ae),Ae},Be=(ye,Ae)=>{let se=(0,jT.createHash)(\"sha512\");se.update(le),se.update(pe(ye));for(let X of Ae)se.update(X);return se.digest(\"hex\")},Ce=new Map,g=!1,we=ye=>{let Ae=new Set([ye.locatorHash]);for(let se of Ae){let X=this.storedPackages.get(se);if(!X)throw new Error(\"Assertion failed: The package should have been registered\");for(let De of X.dependencies.values()){let Te=this.storedResolutions.get(De.descriptorHash);if(!Te)throw new Error(`Assertion failed: The resolution (${ni(this.configuration,De)}) should have been registered`);if(Te!==ye.locatorHash&&ie.has(Te))return!1;let mt=this.storedPackages.get(Te);if(!mt)throw new Error(\"Assertion failed: The package should have been registered\");let j=this.tryWorkspaceByLocator(mt);if(j){if(j.anchoredLocator.locatorHash!==ye.locatorHash&&ie.has(j.anchoredLocator.locatorHash))return!1;Ae.add(j.anchoredLocator.locatorHash)}Ae.add(Te)}}return!0};for(;ie.size>0;){let ye=ie.size,Ae=[];for(let se of ie){let X=this.storedPackages.get(se);if(!X)throw new Error(\"Assertion failed: The package should have been registered\");if(!we(X))continue;let De=b.get(X.locatorHash);if(!De)throw new Error(\"Assertion failed: The build directive should have been registered\");let Te=Be(X,De.buildLocations);if(this.storedBuildState.get(X.locatorHash)===Te){Ce.set(X.locatorHash,Te),ie.delete(se);continue}g||(await this.persistInstallStateFile(),g=!0),this.storedBuildState.has(X.locatorHash)?r.reportInfo(8,`${Yr(this.configuration,X)} must be rebuilt because its dependency tree changed`):r.reportInfo(7,`${Yr(this.configuration,X)} must be built because it never has been before or the last one failed`);let mt=De.buildLocations.map(async j=>{if(!J.isAbsolute(j))throw new Error(`Assertion failed: Expected the build location to be absolute (not ${j})`);for(let rt of De.buildDirectives){let Fe=`# This file contains the result of Yarn building a package (${ll(X)})\n`;switch(rt.type){case 0:Fe+=`# Script name: ${rt.script}\n`;break;case 1:Fe+=`# Script code: ${rt.script}\n`;break}let Ne=null;if(!await ce.mktempPromise(async Ve=>{let ke=J.join(Ve,\"build.log\"),{stdout:it,stderr:Ue}=this.configuration.getSubprocessStreams(ke,{header:Fe,prefix:Yr(this.configuration,X),report:r}),x;try{switch(rt.type){case 0:x=await OR(X,rt.script,[],{cwd:j,project:this,stdin:Ne,stdout:it,stderr:Ue});break;case 1:x=await Gj(X,rt.script,[],{cwd:j,project:this,stdin:Ne,stdout:it,stderr:Ue});break}}catch(y){Ue.write(y.stack),x=1}if(it.end(),Ue.end(),x===0)return!0;ce.detachTemp(Ve);let w=`${Yr(this.configuration,X)} couldn't be built successfully (exit code ${Ht(this.configuration,x,ht.NUMBER)}, logs can be found here: ${Ht(this.configuration,ke,ht.PATH)})`,P=this.optionalBuilds.has(X.locatorHash);return P?r.reportInfo(9,w):r.reportError(9,w),zpe&&r.reportFold(fe.fromPortablePath(ke),ce.readFileSync(ke,\"utf8\")),P}))return!1}return!0});Ae.push(...mt,Promise.allSettled(mt).then(j=>{ie.delete(se),j.every(rt=>rt.status===\"fulfilled\"&&rt.value===!0)&&Ce.set(X.locatorHash,Te)}))}if(await Uu(Ae),ye===ie.size){let se=Array.from(ie).map(X=>{let De=this.storedPackages.get(X);if(!De)throw new Error(\"Assertion failed: The package should have been registered\");return Yr(this.configuration,De)}).join(\", \");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${se})`);break}}this.storedBuildState=Ce,this.skippedBuilds=N}async installWithNewReport(e,r){return(await Ot.start({configuration:this.configuration,json:e.json,stdout:e.stdout,forceSectionAlignment:!0,includeLogs:!e.json&&!e.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(e){let r=this.configuration.get(\"nodeLinker\");ze.telemetry?.reportInstall(r);let s=!1;if(await e.report.startTimerPromise(\"Project validation\",{skipIfEmpty:!0},async()=>{this.configuration.get(\"enableOfflineMode\")&&e.report.reportWarning(90,\"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it\"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,C)=>{e.report.reportWarning(E,C)},reportError:(E,C)=>{e.report.reportError(E,C),s=!0}})}),s)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,C]of E)for(let S of C)S.status=\"inactive\";let n=J.join(this.cwd,Er.lockfile),c=null;if(e.immutable)try{c=await ce.readFilePromise(n,\"utf8\")}catch(E){throw E.code===\"ENOENT\"?new jt(28,\"The lockfile would have been created by this install, which is explicitly forbidden.\"):E}await e.report.startTimerPromise(\"Resolution step\",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise(\"Post-resolution validation\",{skipIfEmpty:!0},async()=>{Aat(this,e.report);for(let[,E]of a)for(let[,C]of E)for(let S of C)if(S.userProvided){let b=Ht(this.configuration,S,ht.PACKAGE_EXTENSION);switch(S.status){case\"inactive\":e.report.reportWarning(68,`${b}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case\"redundant\":e.report.reportWarning(69,`${b}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(c!==null){let E=Ed(c,this.generateLockfile());if(E!==c){let C=hde(n,n,c,E,void 0,void 0,{maxEditLength:100});if(C){e.report.reportSeparator();for(let S of C.hunks){e.report.reportInfo(null,`@@ -${S.oldStart},${S.oldLines} +${S.newStart},${S.newLines} @@`);for(let b of S.lines)b.startsWith(\"+\")?e.report.reportError(28,Ht(this.configuration,b,ht.ADDED)):b.startsWith(\"-\")?e.report.reportError(28,Ht(this.configuration,b,ht.REMOVED)):e.report.reportInfo(null,Ht(this.configuration,b,\"grey\"))}e.report.reportSeparator()}throw new jt(28,\"The lockfile would have been modified by this install, which is explicitly forbidden.\")}}});for(let E of a.values())for(let[,C]of E)for(let S of C)S.userProvided&&S.status===\"active\"&&ze.telemetry?.reportPackageExtension(Zd(S,ht.PACKAGE_EXTENSION));await e.report.startTimerPromise(\"Fetch step\",async()=>{await this.fetchEverything(e)});let f=e.immutable?[...new Set(this.configuration.get(\"immutablePatterns\"))].sort():[],p=await Promise.all(f.map(async E=>SQ(E,{cwd:this.cwd})));(typeof e.persistProject>\"u\"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise(\"Link step\",async()=>{if(e.mode===\"update-lockfile\"){e.report.reportWarning(73,`Skipped due to ${Ht(this.configuration,\"mode=update-lockfile\",ht.CODE)}`);return}await this.linkEverything(e);let E=await Promise.all(f.map(async C=>SQ(C,{cwd:this.cwd})));for(let C=0;C<f.length;++C)p[C]!==E[C]&&e.report.reportError(64,`The checksum for ${f[C]} has been modified by this install, which is explicitly forbidden.`)}),await this.persistInstallStateFile();let h=!1;await e.report.startTimerPromise(\"Post-install validation\",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(E=>E.validateProjectAfterInstall,this,{reportWarning:(E,C)=>{e.report.reportWarning(E,C)},reportError:(E,C)=>{e.report.reportError(E,C),h=!0}})}),!h&&await this.configuration.triggerHook(E=>E.afterAllInstalled,this,e)}generateLockfile(){let e=new Map;for(let[n,c]of this.storedResolutions.entries()){let f=e.get(c);f||e.set(c,f=new Set),f.add(n)}let r={},{cacheKey:s}=Kr.getCacheKey(this.configuration);r.__metadata={version:qT,cacheKey:s};for(let[n,c]of e.entries()){let f=this.originalPackages.get(n);if(!f)continue;let p=[];for(let C of c){let S=this.storedDescriptors.get(C);if(!S)throw new Error(\"Assertion failed: The descriptor should have been registered\");p.push(S)}let h=p.map(C=>al(C)).sort().join(\", \"),E=new Ut;E.version=f.linkType===\"HARD\"?f.version:\"0.0.0-use.local\",E.languageName=f.languageName,E.dependencies=new Map(f.dependencies),E.peerDependencies=new Map(f.peerDependencies),E.dependenciesMeta=new Map(f.dependenciesMeta),E.peerDependenciesMeta=new Map(f.peerDependenciesMeta),E.bin=new Map(f.bin),r[h]={...E.exportTo({},{compatibilityMode:!1}),linkType:f.linkType.toLowerCase(),resolution:ll(f),checksum:this.storedChecksums.get(f.locatorHash),conditions:f.conditions||void 0}}return`${[`# This file is generated by running \"yarn install\" inside your project.\n`,`# Manual changes might be lost - proceed with caution!\n`].join(\"\")}\n`+nl(r)}async persistLockfile(){let e=J.join(this.cwd,Er.lockfile),r=\"\";try{r=await ce.readFilePromise(e,\"utf8\")}catch{}let s=this.generateLockfile(),a=Ed(r,s);a!==r&&(await ce.writeFilePromise(e,a),this.lockFileChecksum=yde(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let c of Object.values(YG))e.push(...c);let r=Kd(this,e),s=VG.default.serialize(r),a=cs(s);if(this.installStateChecksum===a)return;let n=this.configuration.get(\"installStatePath\");await ce.mkdirPromise(J.dirname(n),{recursive:!0}),await ce.writeFilePromise(n,await lat(s)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:s=!0}={}){let a=this.configuration.get(\"installStatePath\"),n;try{let c=await cat(await ce.readFilePromise(a));n=VG.default.deserialize(c),this.installStateChecksum=cs(c)}catch{r&&await this.applyLightResolution();return}e&&typeof n.linkersCustomData<\"u\"&&(this.linkersCustomData=n.linkersCustomData),s&&Object.assign(this,Kd(n,YG.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,Kd(n,YG.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new ki}),await this.persistInstallStateFile()}async persist(){let e=(0,GT.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>e(()=>r.persistManifest()))])}async cacheCleanup({cache:e,report:r}){if(this.configuration.get(\"enableGlobalCache\"))return null;let s=new Set([\".gitignore\"]);if(!j8(e.cwd,this.cwd)||!await ce.existsPromise(e.cwd))return null;let a=[];for(let c of await ce.readdirPromise(e.cwd)){if(s.has(c))continue;let f=J.resolve(e.cwd,c);e.markedFiles.has(f)||(e.immutable?r.reportError(56,`${Ht(this.configuration,J.basename(f),\"magenta\")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(ce.lstatPromise(f).then(async p=>(await ce.removePromise(f),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((c,f)=>c+f,0)}}}});function pat(t){let s=Math.floor(t.timeNow/864e5),a=t.updateInterval*864e5,n=t.state.lastUpdate??t.timeNow+a+Math.floor(a*t.randomInitialInterval),c=n+a,f=t.state.lastTips??s*864e5,p=f+864e5+8*36e5-t.timeZone,h=c<=t.timeNow,E=p<=t.timeNow,C=null;return(h||E||!t.state.lastUpdate||!t.state.lastTips)&&(C={},C.lastUpdate=h?t.timeNow:n,C.lastTips=f,C.blocks=h?{}:t.state.blocks,C.displayedTips=t.state.displayedTips),{nextState:C,triggerUpdate:h,triggerTips:E,nextTips:E?s*864e5:f}}var XI,Cde=Ze(()=>{Dt();yv();I0();AR();bc();Tp();XI=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=e;let s=this.getRegistryPath();this.isNew=!ce.existsSync(s),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(e){let r=new Set(this.displayedTips),s=f=>f&&fn?Xf(fn,f):!1,a=e.map((f,p)=>p).filter(f=>e[f]&&s(e[f]?.selector));if(a.length===0)return null;let n=a.filter(f=>!r.has(f));if(n.length===0){let f=Math.floor(a.length*.2);this.displayedTips=f>0?this.displayedTips.slice(-f):[],n=a.filter(p=>!r.has(p))}let c=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(c),this.commitTips(),e[c]}reportVersion(e){this.reportValue(\"version\",e.replace(/-git\\..*/,\"-git\"))}reportCommandName(e){this.reportValue(\"commandName\",e||\"<none>\")}reportPluginName(e){this.reportValue(\"pluginName\",e)}reportProject(e){this.reportEnumerator(\"projectCount\",e)}reportInstall(e){this.reportHit(\"installCount\",e)}reportPackageExtension(e){this.reportValue(\"packageExtension\",e)}reportWorkspaceCount(e){this.reportValue(\"workspaceCount\",String(e))}reportDependencyCount(e){this.reportValue(\"dependencyCount\",String(e))}reportValue(e,r){Pp(this.values,e).add(r)}reportEnumerator(e,r){Pp(this.enumerators,e).add(cs(r))}reportHit(e,r=\"*\"){let s=j4(this.hits,e),a=Yl(s,r,()=>0);s.set(r,a+1)}getRegistryPath(){let e=this.configuration.get(\"globalFolder\");return J.join(e,\"telemetry.json\")}sendReport(e){let r=this.getRegistryPath(),s;try{s=ce.readJsonSync(r)}catch{s={}}let{nextState:a,triggerUpdate:n,triggerTips:c,nextTips:f}=pat({state:s,timeNow:Date.now(),timeZone:new Date().getTimezoneOffset()*60*1e3,randomInitialInterval:Math.random(),updateInterval:this.configuration.get(\"telemetryInterval\")});if(this.nextTips=f,this.displayedTips=s.displayedTips??[],a!==null)try{ce.mkdirSync(J.dirname(r),{recursive:!0}),ce.writeJsonSync(r,a)}catch{return!1}if(c&&this.configuration.get(\"enableTips\")&&(this.shouldShowTips=!0),n){let p=s.blocks??{};if(Object.keys(p).length===0){let h=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,E=C=>aj(h,C,{configuration:this.configuration}).catch(()=>{});for(let[C,S]of Object.entries(s.blocks??{})){if(Object.keys(S).length===0)continue;let b=S;b.userId=C,b.reportType=\"primary\";for(let N of Object.keys(b.enumerators??{}))b.enumerators[N]=b.enumerators[N].length;E(b);let I=new Map,T=20;for(let[N,U]of Object.entries(b.values))U.length>0&&I.set(N,U.slice(0,T));for(;I.size>0;){let N={};N.userId=C,N.reportType=\"secondary\",N.metrics={};for(let[U,W]of I)N.metrics[U]=W.shift(),W.length===0&&I.delete(U);E(N)}}}}return!0}applyChanges(){let e=this.getRegistryPath(),r;try{r=ce.readJsonSync(e)}catch{r={}}let s=this.configuration.get(\"telemetryUserId\")??\"*\",a=r.blocks=r.blocks??{},n=a[s]=a[s]??{};for(let c of this.hits.keys()){let f=n.hits=n.hits??{},p=f[c]=f[c]??{};for(let[h,E]of this.hits.get(c))p[h]=(p[h]??0)+E}for(let c of[\"values\",\"enumerators\"])for(let f of this[c].keys()){let p=n[c]=n[c]??{};p[f]=[...new Set([...p[f]??[],...this[c].get(f)??[]])]}this.shouldCommitTips&&(r.lastTips=this.nextTips,r.displayedTips=this.displayedTips),ce.mkdirSync(J.dirname(e),{recursive:!0}),ce.writeJsonSync(e,r)}startBuffer(){process.on(\"exit\",()=>{try{this.applyChanges()}catch{}})}}});var jv={};Vt(jv,{BuildDirectiveType:()=>UT,CACHE_CHECKPOINT:()=>TG,CACHE_VERSION:()=>MT,Cache:()=>Kr,Configuration:()=>ze,DEFAULT_RC_FILENAME:()=>hj,FormatType:()=>ope,InstallMode:()=>$l,LEGACY_PLUGINS:()=>ov,LOCKFILE_VERSION:()=>qT,LegacyMigrationResolver:()=>KI,LightReport:()=>lA,LinkType:()=>VE,LockfileResolver:()=>zI,Manifest:()=>Ut,MessageName:()=>Br,MultiFetcher:()=>aI,PackageExtensionStatus:()=>Y4,PackageExtensionType:()=>W4,PeerWarningType:()=>WT,Project:()=>Rt,Report:()=>Ao,ReportError:()=>jt,SettingsType:()=>wI,StreamReport:()=>Ot,TAG_REGEXP:()=>Mp,TelemetryManager:()=>XI,ThrowReport:()=>ki,VirtualFetcher:()=>lI,WindowsLinkType:()=>ER,Workspace:()=>ZI,WorkspaceFetcher:()=>cI,WorkspaceResolver:()=>Ei,YarnVersion:()=>fn,execUtils:()=>qr,folderUtils:()=>NQ,formatUtils:()=>he,hashUtils:()=>Nn,httpUtils:()=>ln,miscUtils:()=>je,nodeUtils:()=>fs,parseMessageName:()=>jx,reportOptionDeprecations:()=>SI,scriptUtils:()=>In,semverUtils:()=>Fr,stringifyMessageName:()=>Yf,structUtils:()=>G,tgzUtils:()=>ps,treeUtils:()=>xs});var Ge=Ze(()=>{gR();OQ();xc();I0();AR();bc();hR();Vj();Tp();Wo();$ge();ode();FG();av();av();cde();NG();ude();OG();oI();Gx();Q8();Ide();Rc();Ev();Cde();qG();T8();F8();tm();WG();yv();ule()});var Pde=_((OHt,qv)=>{\"use strict\";var gat=process.env.TERM_PROGRAM===\"Hyper\",dat=process.platform===\"win32\",vde=process.platform===\"linux\",zG={ballotDisabled:\"\\u2612\",ballotOff:\"\\u2610\",ballotOn:\"\\u2611\",bullet:\"\\u2022\",bulletWhite:\"\\u25E6\",fullBlock:\"\\u2588\",heart:\"\\u2764\",identicalTo:\"\\u2261\",line:\"\\u2500\",mark:\"\\u203B\",middot:\"\\xB7\",minus:\"\\uFF0D\",multiplication:\"\\xD7\",obelus:\"\\xF7\",pencilDownRight:\"\\u270E\",pencilRight:\"\\u270F\",pencilUpRight:\"\\u2710\",percent:\"%\",pilcrow2:\"\\u2761\",pilcrow:\"\\xB6\",plusMinus:\"\\xB1\",section:\"\\xA7\",starsOff:\"\\u2606\",starsOn:\"\\u2605\",upDownArrow:\"\\u2195\"},Sde=Object.assign({},zG,{check:\"\\u221A\",cross:\"\\xD7\",ellipsisLarge:\"...\",ellipsis:\"...\",info:\"i\",question:\"?\",questionSmall:\"?\",pointer:\">\",pointerSmall:\"\\xBB\",radioOff:\"( )\",radioOn:\"(*)\",warning:\"\\u203C\"}),Dde=Object.assign({},zG,{ballotCross:\"\\u2718\",check:\"\\u2714\",cross:\"\\u2716\",ellipsisLarge:\"\\u22EF\",ellipsis:\"\\u2026\",info:\"\\u2139\",question:\"?\",questionFull:\"\\uFF1F\",questionSmall:\"\\uFE56\",pointer:vde?\"\\u25B8\":\"\\u276F\",pointerSmall:vde?\"\\u2023\":\"\\u203A\",radioOff:\"\\u25EF\",radioOn:\"\\u25C9\",warning:\"\\u26A0\"});qv.exports=dat&&!gat?Sde:Dde;Reflect.defineProperty(qv.exports,\"common\",{enumerable:!1,value:zG});Reflect.defineProperty(qv.exports,\"windows\",{enumerable:!1,value:Sde});Reflect.defineProperty(qv.exports,\"other\",{enumerable:!1,value:Dde})});var Ju=_((LHt,ZG)=>{\"use strict\";var mat=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t),yat=/[\\u001b\\u009b][[\\]#;?()]*(?:(?:(?:[^\\W_]*;?[^\\W_]*)\\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,bde=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};\"FORCE_COLOR\"in process.env&&(t.enabled=process.env.FORCE_COLOR!==\"0\");let e=n=>{let c=n.open=`\\x1B[${n.codes[0]}m`,f=n.close=`\\x1B[${n.codes[1]}m`,p=n.regex=new RegExp(`\\\\u001b\\\\[${n.codes[1]}m`,\"g\");return n.wrap=(h,E)=>{h.includes(f)&&(h=h.replace(p,f+c));let C=c+h+f;return E?C.replace(/\\r*\\n/g,`${f}$&${c}`):C},n},r=(n,c,f)=>typeof n==\"function\"?n(c):n.wrap(c,f),s=(n,c)=>{if(n===\"\"||n==null)return\"\";if(t.enabled===!1)return n;if(t.visible===!1)return\"\";let f=\"\"+n,p=f.includes(`\n`),h=c.length;for(h>0&&c.includes(\"unstyle\")&&(c=[...new Set([\"unstyle\",...c])].reverse());h-- >0;)f=r(t.styles[c[h]],f,p);return f},a=(n,c,f)=>{t.styles[n]=e({name:n,codes:c}),(t.keys[f]||(t.keys[f]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(h){t.alias(n,h)},get(){let h=E=>s(E,h.stack);return Reflect.setPrototypeOf(h,t),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a(\"reset\",[0,0],\"modifier\"),a(\"bold\",[1,22],\"modifier\"),a(\"dim\",[2,22],\"modifier\"),a(\"italic\",[3,23],\"modifier\"),a(\"underline\",[4,24],\"modifier\"),a(\"inverse\",[7,27],\"modifier\"),a(\"hidden\",[8,28],\"modifier\"),a(\"strikethrough\",[9,29],\"modifier\"),a(\"black\",[30,39],\"color\"),a(\"red\",[31,39],\"color\"),a(\"green\",[32,39],\"color\"),a(\"yellow\",[33,39],\"color\"),a(\"blue\",[34,39],\"color\"),a(\"magenta\",[35,39],\"color\"),a(\"cyan\",[36,39],\"color\"),a(\"white\",[37,39],\"color\"),a(\"gray\",[90,39],\"color\"),a(\"grey\",[90,39],\"color\"),a(\"bgBlack\",[40,49],\"bg\"),a(\"bgRed\",[41,49],\"bg\"),a(\"bgGreen\",[42,49],\"bg\"),a(\"bgYellow\",[43,49],\"bg\"),a(\"bgBlue\",[44,49],\"bg\"),a(\"bgMagenta\",[45,49],\"bg\"),a(\"bgCyan\",[46,49],\"bg\"),a(\"bgWhite\",[47,49],\"bg\"),a(\"blackBright\",[90,39],\"bright\"),a(\"redBright\",[91,39],\"bright\"),a(\"greenBright\",[92,39],\"bright\"),a(\"yellowBright\",[93,39],\"bright\"),a(\"blueBright\",[94,39],\"bright\"),a(\"magentaBright\",[95,39],\"bright\"),a(\"cyanBright\",[96,39],\"bright\"),a(\"whiteBright\",[97,39],\"bright\"),a(\"bgBlackBright\",[100,49],\"bgBright\"),a(\"bgRedBright\",[101,49],\"bgBright\"),a(\"bgGreenBright\",[102,49],\"bgBright\"),a(\"bgYellowBright\",[103,49],\"bgBright\"),a(\"bgBlueBright\",[104,49],\"bgBright\"),a(\"bgMagentaBright\",[105,49],\"bgBright\"),a(\"bgCyanBright\",[106,49],\"bgBright\"),a(\"bgWhiteBright\",[107,49],\"bgBright\"),t.ansiRegex=yat,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n==\"string\"&&n!==\"\"&&t.ansiRegex.test(n)),t.alias=(n,c)=>{let f=typeof c==\"string\"?t[c]:c;if(typeof f!=\"function\")throw new TypeError(\"Expected alias to be the name of an existing color (string) or a function\");f.stack||(Reflect.defineProperty(f,\"name\",{value:n}),t.styles[n]=f,f.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(p){t.alias(n,p)},get(){let p=h=>s(h,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(f.stack):f.stack,p}})},t.theme=n=>{if(!mat(n))throw new TypeError(\"Expected theme to be an object\");for(let c of Object.keys(n))t.alias(c,n[c]);return t},t.alias(\"unstyle\",n=>typeof n==\"string\"&&n!==\"\"?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,\"\")):\"\"),t.alias(\"noop\",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Pde(),t.define=a,t};ZG.exports=bde();ZG.exports.create=bde});var Xo=_(pn=>{\"use strict\";var Eat=Object.prototype.toString,jc=Ju(),xde=!1,XG=[],kde={yellow:\"blue\",cyan:\"red\",green:\"magenta\",black:\"white\",blue:\"yellow\",red:\"cyan\",magenta:\"green\",white:\"black\"};pn.longest=(t,e)=>t.reduce((r,s)=>Math.max(r,e?s[e].length:s.length),0);pn.hasColor=t=>!!t&&jc.hasColor(t);var VT=pn.isObject=t=>t!==null&&typeof t==\"object\"&&!Array.isArray(t);pn.nativeType=t=>Eat.call(t).slice(8,-1).toLowerCase().replace(/\\s/g,\"\");pn.isAsyncFn=t=>pn.nativeType(t)===\"asyncfunction\";pn.isPrimitive=t=>t!=null&&typeof t!=\"object\"&&typeof t!=\"function\";pn.resolve=(t,e,...r)=>typeof e==\"function\"?e.call(t,...r):e;pn.scrollDown=(t=[])=>[...t.slice(1),t[0]];pn.scrollUp=(t=[])=>[t.pop(),...t];pn.reorder=(t=[])=>{let e=t.slice();return e.sort((r,s)=>r.index>s.index?1:r.index<s.index?-1:0),e};pn.swap=(t,e,r)=>{let s=t.length,a=r===s?0:r<0?s-1:r,n=t[e];t[e]=t[a],t[a]=n};pn.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize==\"function\"&&(r=t.getWindowSize()[0]),process.platform===\"win32\"?r-1:r};pn.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize==\"function\"&&(r=t.getWindowSize()[1]),r};pn.wordWrap=(t,e={})=>{if(!t)return t;typeof e==\"number\"&&(e={width:e});let{indent:r=\"\",newline:s=`\n`+r,width:a=80}=e,n=(s+r).match(/[^\\S\\n]/g)||[];a-=n.length;let c=`.{1,${a}}([\\\\s\\\\u200B]+|$)|[^\\\\s\\\\u200B]+?([\\\\s\\\\u200B]+|$)`,f=t.trim(),p=new RegExp(c,\"g\"),h=f.match(p)||[];return h=h.map(E=>E.replace(/\\n$/,\"\")),e.padEnd&&(h=h.map(E=>E.padEnd(a,\" \"))),e.padStart&&(h=h.map(E=>E.padStart(a,\" \"))),r+h.join(s)};pn.unmute=t=>{let e=t.stack.find(s=>jc.keys.color.includes(s));return e?jc[e]:t.stack.find(s=>s.slice(2)===\"bg\")?jc[e.slice(2)]:s=>s};pn.pascal=t=>t?t[0].toUpperCase()+t.slice(1):\"\";pn.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(s=>jc.keys.color.includes(s));if(e){let s=jc[\"bg\"+pn.pascal(e)];return s?s.black:t}let r=t.stack.find(s=>s.slice(0,2)===\"bg\");return r?jc[r.slice(2).toLowerCase()]||t:jc.none};pn.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(s=>jc.keys.color.includes(s)),r=t.stack.find(s=>s.slice(0,2)===\"bg\");if(e&&!r)return jc[kde[e]||e];if(r){let s=r.slice(2).toLowerCase(),a=kde[s];return a&&jc[\"bg\"+pn.pascal(a)]||t}return jc.none};pn.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),s=e>=12?\"pm\":\"am\";e=e%12;let a=e===0?12:e,n=r<10?\"0\"+r:r;return a+\":\"+n+\" \"+s};pn.set=(t={},e=\"\",r)=>e.split(\".\").reduce((s,a,n,c)=>{let f=c.length-1>n?s[a]||{}:r;return!pn.isObject(f)&&n<c.length-1&&(f={}),s[a]=f},t);pn.get=(t={},e=\"\",r)=>{let s=t[e]==null?e.split(\".\").reduce((a,n)=>a&&a[n],t):t[e];return s??r};pn.mixin=(t,e)=>{if(!VT(t))return e;if(!VT(e))return t;for(let r of Object.keys(e)){let s=Object.getOwnPropertyDescriptor(e,r);if(s.hasOwnProperty(\"value\"))if(t.hasOwnProperty(r)&&VT(s.value)){let a=Object.getOwnPropertyDescriptor(t,r);VT(a.value)?t[r]=pn.merge({},t[r],e[r]):Reflect.defineProperty(t,r,s)}else Reflect.defineProperty(t,r,s);else Reflect.defineProperty(t,r,s)}return t};pn.merge=(...t)=>{let e={};for(let r of t)pn.mixin(e,r);return e};pn.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let s of Object.keys(r)){let a=r[s];typeof a==\"function\"?pn.define(t,s,a.bind(e)):pn.define(t,s,a)}};pn.onExit=t=>{let e=(r,s)=>{xde||(xde=!0,XG.forEach(a=>a()),r===!0&&process.exit(128+s))};XG.length===0&&(process.once(\"SIGTERM\",e.bind(null,!0,15)),process.once(\"SIGINT\",e.bind(null,!0,2)),process.once(\"exit\",e)),XG.push(t)};pn.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};pn.defineExport=(t,e,r)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(a){s=a},get(){return s?s():r()}})}});var Qde=_(rC=>{\"use strict\";rC.ctrl={a:\"first\",b:\"backward\",c:\"cancel\",d:\"deleteForward\",e:\"last\",f:\"forward\",g:\"reset\",i:\"tab\",k:\"cutForward\",l:\"reset\",n:\"newItem\",m:\"cancel\",j:\"submit\",p:\"search\",r:\"remove\",s:\"save\",u:\"undo\",w:\"cutLeft\",x:\"toggleCursor\",v:\"paste\"};rC.shift={up:\"shiftUp\",down:\"shiftDown\",left:\"shiftLeft\",right:\"shiftRight\",tab:\"prev\"};rC.fn={up:\"pageUp\",down:\"pageDown\",left:\"pageLeft\",right:\"pageRight\",delete:\"deleteForward\"};rC.option={b:\"backward\",f:\"forward\",d:\"cutRight\",left:\"cutLeft\",up:\"altUp\",down:\"altDown\"};rC.keys={pageup:\"pageUp\",pagedown:\"pageDown\",home:\"home\",end:\"end\",cancel:\"cancel\",delete:\"deleteForward\",backspace:\"delete\",down:\"down\",enter:\"submit\",escape:\"cancel\",left:\"left\",space:\"space\",number:\"number\",return:\"submit\",right:\"right\",tab:\"next\",up:\"up\"}});var Fde=_((_Ht,Tde)=>{\"use strict\";var Rde=Ie(\"readline\"),Iat=Qde(),Cat=/^(?:\\x1b)([a-zA-Z0-9])$/,wat=/^(?:\\x1b+)(O|N|\\[|\\[\\[)(?:(\\d+)(?:;(\\d+))?([~^$])|(?:1;)?(\\d+)?([a-zA-Z]))/,Bat={OP:\"f1\",OQ:\"f2\",OR:\"f3\",OS:\"f4\",\"[11~\":\"f1\",\"[12~\":\"f2\",\"[13~\":\"f3\",\"[14~\":\"f4\",\"[[A\":\"f1\",\"[[B\":\"f2\",\"[[C\":\"f3\",\"[[D\":\"f4\",\"[[E\":\"f5\",\"[15~\":\"f5\",\"[17~\":\"f6\",\"[18~\":\"f7\",\"[19~\":\"f8\",\"[20~\":\"f9\",\"[21~\":\"f10\",\"[23~\":\"f11\",\"[24~\":\"f12\",\"[A\":\"up\",\"[B\":\"down\",\"[C\":\"right\",\"[D\":\"left\",\"[E\":\"clear\",\"[F\":\"end\",\"[H\":\"home\",OA:\"up\",OB:\"down\",OC:\"right\",OD:\"left\",OE:\"clear\",OF:\"end\",OH:\"home\",\"[1~\":\"home\",\"[2~\":\"insert\",\"[3~\":\"delete\",\"[4~\":\"end\",\"[5~\":\"pageup\",\"[6~\":\"pagedown\",\"[[5~\":\"pageup\",\"[[6~\":\"pagedown\",\"[7~\":\"home\",\"[8~\":\"end\",\"[a\":\"up\",\"[b\":\"down\",\"[c\":\"right\",\"[d\":\"left\",\"[e\":\"clear\",\"[2$\":\"insert\",\"[3$\":\"delete\",\"[5$\":\"pageup\",\"[6$\":\"pagedown\",\"[7$\":\"home\",\"[8$\":\"end\",Oa:\"up\",Ob:\"down\",Oc:\"right\",Od:\"left\",Oe:\"clear\",\"[2^\":\"insert\",\"[3^\":\"delete\",\"[5^\":\"pageup\",\"[6^\":\"pagedown\",\"[7^\":\"home\",\"[8^\":\"end\",\"[Z\":\"tab\"};function vat(t){return[\"[a\",\"[b\",\"[c\",\"[d\",\"[e\",\"[2$\",\"[3$\",\"[5$\",\"[6$\",\"[7$\",\"[8$\",\"[Z\"].includes(t)}function Sat(t){return[\"Oa\",\"Ob\",\"Oc\",\"Od\",\"Oe\",\"[2^\",\"[3^\",\"[5^\",\"[6^\",\"[7^\",\"[8^\"].includes(t)}var JT=(t=\"\",e={})=>{let r,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&t[1]===void 0?(t[0]-=128,t=\"\\x1B\"+String(t)):t=String(t):t!==void 0&&typeof t!=\"string\"?t=String(t):t||(t=s.sequence||\"\"),s.sequence=s.sequence||t||s.name,t===\"\\r\")s.raw=void 0,s.name=\"return\";else if(t===`\n`)s.name=\"enter\";else if(t===\"\t\")s.name=\"tab\";else if(t===\"\\b\"||t===\"\\x7F\"||t===\"\\x1B\\x7F\"||t===\"\\x1B\\b\")s.name=\"backspace\",s.meta=t.charAt(0)===\"\\x1B\";else if(t===\"\\x1B\"||t===\"\\x1B\\x1B\")s.name=\"escape\",s.meta=t.length===2;else if(t===\" \"||t===\"\\x1B \")s.name=\"space\",s.meta=t.length===2;else if(t<=\"\u001a\")s.name=String.fromCharCode(t.charCodeAt(0)+97-1),s.ctrl=!0;else if(t.length===1&&t>=\"0\"&&t<=\"9\")s.name=\"number\";else if(t.length===1&&t>=\"a\"&&t<=\"z\")s.name=t;else if(t.length===1&&t>=\"A\"&&t<=\"Z\")s.name=t.toLowerCase(),s.shift=!0;else if(r=Cat.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(r[1]);else if(r=wat.exec(t)){let a=[...t];a[0]===\"\\x1B\"&&a[1]===\"\\x1B\"&&(s.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(\"\"),c=(r[3]||r[5]||1)-1;s.ctrl=!!(c&4),s.meta=!!(c&10),s.shift=!!(c&1),s.code=n,s.name=Bat[n],s.shift=vat(n)||s.shift,s.ctrl=Sat(n)||s.ctrl}return s};JT.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error(\"Invalid stream passed\");let s=Rde.createInterface({terminal:!0,input:r});Rde.emitKeypressEvents(r,s);let a=(f,p)=>e(f,JT(f,p),s),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on(\"keypress\",a),s.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener(\"keypress\",a),s.pause(),s.close()}};JT.action=(t,e,r)=>{let s={...Iat,...r};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)};Tde.exports=JT});var Ode=_((HHt,Nde)=>{\"use strict\";Nde.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let s=e[r];typeof s==\"number\"&&(s={interval:s}),Dat(t,r,s)}};function Dat(t,e,r={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},a=r.interval||120;s.frames=r.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,t.render()},a);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,\"interval\",{value:n}),t.once(\"close\",()=>s.stop()),s.stop}});var Mde=_((jHt,Lde)=>{\"use strict\";var{define:Pat,width:bat}=Xo(),$G=class{constructor(e){let r=e.options;Pat(this,\"_prompt\",e),this.type=e.type,this.name=e.name,this.message=\"\",this.header=\"\",this.footer=\"\",this.error=\"\",this.hint=\"\",this.input=\"\",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt=\"\",this.buffer=\"\",this.width=bat(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r==\"function\"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading==\"boolean\"?this._loading:this.loadingChoices?\"choices\":!1}get status(){return this.cancelled?\"cancelled\":this.submitted?\"submitted\":\"pending\"}};Lde.exports=$G});var _de=_((GHt,Ude)=>{\"use strict\";var eq=Xo(),ho=Ju(),tq={default:ho.noop,noop:ho.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||eq.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||eq.complement(this.primary)},primary:ho.cyan,success:ho.green,danger:ho.magenta,strong:ho.bold,warning:ho.yellow,muted:ho.dim,disabled:ho.gray,dark:ho.dim.gray,underline:ho.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse}};tq.merge=(t={})=>{t.styles&&typeof t.styles.enabled==\"boolean\"&&(ho.enabled=t.styles.enabled),t.styles&&typeof t.styles.visible==\"boolean\"&&(ho.visible=t.styles.visible);let e=eq.merge({},tq,t.styles);delete e.merge;for(let r of Object.keys(ho))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>ho[r]});for(let r of Object.keys(ho.styles))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>ho[r]});return e};Ude.exports=tq});var jde=_((qHt,Hde)=>{\"use strict\";var rq=process.platform===\"win32\",zp=Ju(),xat=Xo(),nq={...zp.symbols,upDownDoubleArrow:\"\\u21D5\",upDownDoubleArrow2:\"\\u2B0D\",upDownArrow:\"\\u2195\",asterisk:\"*\",asterism:\"\\u2042\",bulletWhite:\"\\u25E6\",electricArrow:\"\\u2301\",ellipsisLarge:\"\\u22EF\",ellipsisSmall:\"\\u2026\",fullBlock:\"\\u2588\",identicalTo:\"\\u2261\",indicator:zp.symbols.check,leftAngle:\"\\u2039\",mark:\"\\u203B\",minus:\"\\u2212\",multiplication:\"\\xD7\",obelus:\"\\xF7\",percent:\"%\",pilcrow:\"\\xB6\",pilcrow2:\"\\u2761\",pencilUpRight:\"\\u2710\",pencilDownRight:\"\\u270E\",pencilRight:\"\\u270F\",plus:\"+\",plusMinus:\"\\xB1\",pointRight:\"\\u261E\",rightAngle:\"\\u203A\",section:\"\\xA7\",hexagon:{off:\"\\u2B21\",on:\"\\u2B22\",disabled:\"\\u2B22\"},ballot:{on:\"\\u2611\",off:\"\\u2610\",disabled:\"\\u2612\"},stars:{on:\"\\u2605\",off:\"\\u2606\",disabled:\"\\u2606\"},folder:{on:\"\\u25BC\",off:\"\\u25B6\",disabled:\"\\u25B6\"},prefix:{pending:zp.symbols.question,submitted:zp.symbols.check,cancelled:zp.symbols.cross},separator:{pending:zp.symbols.pointerSmall,submitted:zp.symbols.middot,cancelled:zp.symbols.middot},radio:{off:rq?\"( )\":\"\\u25EF\",on:rq?\"(*)\":\"\\u25C9\",disabled:rq?\"(|)\":\"\\u24BE\"},numbers:[\"\\u24EA\",\"\\u2460\",\"\\u2461\",\"\\u2462\",\"\\u2463\",\"\\u2464\",\"\\u2465\",\"\\u2466\",\"\\u2467\",\"\\u2468\",\"\\u2469\",\"\\u246A\",\"\\u246B\",\"\\u246C\",\"\\u246D\",\"\\u246E\",\"\\u246F\",\"\\u2470\",\"\\u2471\",\"\\u2472\",\"\\u2473\",\"\\u3251\",\"\\u3252\",\"\\u3253\",\"\\u3254\",\"\\u3255\",\"\\u3256\",\"\\u3257\",\"\\u3258\",\"\\u3259\",\"\\u325A\",\"\\u325B\",\"\\u325C\",\"\\u325D\",\"\\u325E\",\"\\u325F\",\"\\u32B1\",\"\\u32B2\",\"\\u32B3\",\"\\u32B4\",\"\\u32B5\",\"\\u32B6\",\"\\u32B7\",\"\\u32B8\",\"\\u32B9\",\"\\u32BA\",\"\\u32BB\",\"\\u32BC\",\"\\u32BD\",\"\\u32BE\",\"\\u32BF\"]};nq.merge=t=>{let e=xat.merge({},zp.symbols,nq,t.symbols);return delete e.merge,e};Hde.exports=nq});var qde=_((WHt,Gde)=>{\"use strict\";var kat=_de(),Qat=jde(),Rat=Xo();Gde.exports=t=>{t.options=Rat.merge({},t.options.theme,t.options),t.symbols=Qat.merge(t.options),t.styles=kat.merge(t.options)}});var Kde=_((Vde,Jde)=>{\"use strict\";var Wde=process.env.TERM_PROGRAM===\"Apple_Terminal\",Tat=Ju(),iq=Xo(),Ku=Jde.exports=Vde,Ui=\"\\x1B[\",Yde=\"\\x07\",sq=!1,j0=Ku.code={bell:Yde,beep:Yde,beginning:`${Ui}G`,down:`${Ui}J`,esc:Ui,getPosition:`${Ui}6n`,hide:`${Ui}?25l`,line:`${Ui}2K`,lineEnd:`${Ui}K`,lineStart:`${Ui}1K`,restorePosition:Ui+(Wde?\"8\":\"u\"),savePosition:Ui+(Wde?\"7\":\"s\"),screen:`${Ui}2J`,show:`${Ui}?25h`,up:`${Ui}1J`},wm=Ku.cursor={get hidden(){return sq},hide(){return sq=!0,j0.hide},show(){return sq=!1,j0.show},forward:(t=1)=>`${Ui}${t}C`,backward:(t=1)=>`${Ui}${t}D`,nextLine:(t=1)=>`${Ui}E`.repeat(t),prevLine:(t=1)=>`${Ui}F`.repeat(t),up:(t=1)=>t?`${Ui}${t}A`:\"\",down:(t=1)=>t?`${Ui}${t}B`:\"\",right:(t=1)=>t?`${Ui}${t}C`:\"\",left:(t=1)=>t?`${Ui}${t}D`:\"\",to(t,e){return e?`${Ui}${e+1};${t+1}H`:`${Ui}${t+1}G`},move(t=0,e=0){let r=\"\";return r+=t<0?wm.left(-t):t>0?wm.right(t):\"\",r+=e<0?wm.up(-e):e>0?wm.down(e):\"\",r},restore(t={}){let{after:e,cursor:r,initial:s,input:a,prompt:n,size:c,value:f}=t;if(s=iq.isPrimitive(s)?String(s):\"\",a=iq.isPrimitive(a)?String(a):\"\",f=iq.isPrimitive(f)?String(f):\"\",c){let p=Ku.cursor.up(c)+Ku.cursor.to(n.length),h=a.length-r;return h>0&&(p+=Ku.cursor.left(h)),p}if(f||e){let p=!a&&s?-s.length:-a.length+r;return e&&(p-=e.length),a===\"\"&&s&&!n.includes(s)&&(p+=s.length),Ku.cursor.move(p)}}},oq=Ku.erase={screen:j0.screen,up:j0.up,down:j0.down,line:j0.line,lineEnd:j0.lineEnd,lineStart:j0.lineStart,lines(t){let e=\"\";for(let r=0;r<t;r++)e+=Ku.erase.line+(r<t-1?Ku.cursor.up(1):\"\");return t&&(e+=Ku.code.beginning),e}};Ku.clear=(t=\"\",e=process.stdout.columns)=>{if(!e)return oq.line+wm.to(0);let r=n=>[...Tat.unstyle(n)].length,s=t.split(/\\r?\\n/),a=0;for(let n of s)a+=1+Math.floor(Math.max(r(n)-1,0)/e);return(oq.line+wm.prevLine()).repeat(a-1)+oq.line+wm.to(0)}});var nC=_((YHt,Zde)=>{\"use strict\";var Fat=Ie(\"events\"),zde=Ju(),aq=Fde(),Nat=Ode(),Oat=Mde(),Lat=qde(),pl=Xo(),Bm=Kde(),lq=class t extends Fat{constructor(e={}){super(),this.name=e.name,this.type=e.type,this.options=e,Lat(this),Nat(this),this.state=new Oat(this),this.initial=[e.initial,e.default].find(r=>r!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=Uat(this.options.margin),this.setMaxListeners(0),Mat(this)}async keypress(e,r={}){this.keypressed=!0;let s=aq.action(e,aq(e,r),this.options.actions);this.state.keypress=s,this.emit(\"keypress\",e,s),this.emit(\"state\",this.state.clone());let a=this.options[s.action]||this[s.action]||this.dispatch;if(typeof a==\"function\")return await a.call(this,e,s);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit(\"alert\"):this.stdout.write(Bm.code.beep)}cursorHide(){this.stdout.write(Bm.cursor.hide()),pl.onExit(()=>this.cursorShow())}cursorShow(){this.stdout.write(Bm.cursor.show())}write(e){e&&(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let r=this.state.buffer;this.state.buffer=\"\",!(!r&&!e||this.options.show===!1)&&this.stdout.write(Bm.cursor.down(e)+Bm.clear(r,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:r,rest:s}=this.sections(),{cursor:a,initial:n=\"\",input:c=\"\",value:f=\"\"}=this,p=this.state.size=s.length,h={after:r,cursor:a,initial:n,input:c,prompt:e,size:p,value:f},E=Bm.cursor.restore(h);E&&this.stdout.write(E)}sections(){let{buffer:e,input:r,prompt:s}=this.state;s=zde.unstyle(s);let a=zde.unstyle(e),n=a.indexOf(s),c=a.slice(0,n),p=a.slice(n).split(`\n`),h=p[0],E=p[p.length-1],S=(s+(r?\" \"+r:\"\")).length,b=S<h.length?h.slice(S+1):\"\";return{header:c,prompt:h,after:b,rest:p.slice(1),last:E}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`\n`+this.symbols.pointer+\" \";typeof e==\"string\"?r+=e.trim():r+=\"Invalid input\",this.state.error=`\n`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit(\"submit\",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel==\"function\"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit(\"cancel\",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Bm.cursor.down(e.rest.length)),this.write(`\n`.repeat(r))}catch{}this.emit(\"close\")}start(){!this.stop&&this.options.show!==!1&&(this.stop=aq.listen(this,this.keypress.bind(this)),this.once(\"close\",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip==\"function\"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:s}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>s.call(this,this.value),typeof r.initial==\"function\"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun==\"function\"&&await r.onRun.call(this,this),typeof r.onSubmit==\"function\"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error(\"expected prompt to have a custom render method\")}run(){return new Promise(async(e,r)=>{if(this.once(\"submit\",e),this.once(\"cancel\",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit(\"run\")})}async element(e,r,s){let{options:a,state:n,symbols:c,timers:f}=this,p=f&&f[e];n.timer=p;let h=a[e]||n[e]||c[e],E=r&&r[e]!=null?r[e]:await h;if(E===\"\")return E;let C=await this.resolve(E,n,r,s);return!C&&r&&r[e]?this.resolve(h,n,r,s):C}async prefix(){let e=await this.element(\"prefix\")||this.symbols,r=this.timers&&this.timers.prefix,s=this.state;return s.timer=r,pl.isObject(e)&&(e=e[s.status]||e.pending),pl.hasColor(e)?e:(this.styles[s.status]||this.styles.pending)(e)}async message(){let e=await this.element(\"message\");return pl.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element(\"separator\")||this.symbols,r=this.timers&&this.timers.separator,s=this.state;s.timer=r;let a=e[s.status]||e.pending||s.separator,n=await this.resolve(a,s);return pl.isObject(n)&&(n=n[s.status]||n.pending),pl.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let s=await this.element(\"pointer\",e,r);if(typeof s==\"string\"&&pl.hasColor(s))return s;if(s){let a=this.styles,n=this.index===r,c=n?a.primary:h=>h,f=await this.resolve(s[n?\"on\":\"off\"]||s,this.state),p=pl.hasColor(f)?f:c(f);return n?p:\" \".repeat(f.length)}}async indicator(e,r){let s=await this.element(\"indicator\",e,r);if(typeof s==\"string\"&&pl.hasColor(s))return s;if(s){let a=this.styles,n=e.enabled===!0,c=n?a.success:a.dark,f=s[n?\"on\":\"off\"]||s;return pl.hasColor(f)?f:c(f)}return\"\"}body(){return null}footer(){if(this.state.status===\"pending\")return this.element(\"footer\")}header(){if(this.state.status===\"pending\")return this.element(\"header\")}async hint(){if(this.state.status===\"pending\"&&!this.isValue(this.state.input)){let e=await this.element(\"hint\");return pl.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?\"\":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==\"\"}resolve(e,...r){return pl.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||pl.height(this.stdout,25)}get width(){return this.options.columns||pl.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,s=[r,e].find(this.isValue.bind(this));return this.isValue(s)?s:this.initial}static get prompt(){return e=>new this(e).run()}};function Mat(t){let e=a=>t[a]===void 0||typeof t[a]==\"function\",r=[\"actions\",\"choices\",\"initial\",\"margin\",\"roles\",\"styles\",\"symbols\",\"theme\",\"timers\",\"value\"],s=[\"body\",\"footer\",\"error\",\"header\",\"hint\",\"indicator\",\"message\",\"prefix\",\"separator\",\"skip\"];for(let a of Object.keys(t.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=t.options[a];typeof n==\"function\"&&e(a)?s.includes(a)||(t[a]=n.bind(t)):typeof t[a]!=\"function\"&&(t[a]=n)}}function Uat(t){typeof t==\"number\"&&(t=[t,t,t,t]);let e=[].concat(t||[]),r=a=>a%2===0?`\n`:\" \",s=[];for(let a=0;a<4;a++){let n=r(a);e[a]?s.push(n.repeat(e[a])):s.push(\"\")}return s}Zde.exports=lq});var eme=_((VHt,$de)=>{\"use strict\";var _at=Xo(),Xde={default(t,e){return e},checkbox(t,e){throw new Error(\"checkbox role is not implemented yet\")},editable(t,e){throw new Error(\"editable role is not implemented yet\")},expandable(t,e){throw new Error(\"expandable role is not implemented yet\")},heading(t,e){return e.disabled=\"\",e.indicator=[e.indicator,\" \"].find(r=>r!=null),e.message=e.message||\"\",e},input(t,e){throw new Error(\"input role is not implemented yet\")},option(t,e){return Xde.default(t,e)},radio(t,e){throw new Error(\"radio role is not implemented yet\")},separator(t,e){return e.disabled=\"\",e.indicator=[e.indicator,\" \"].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};$de.exports=(t,e={})=>{let r=_at.merge({},Xde,e.roles);return r[t]||r.default}});var Wv=_((JHt,nme)=>{\"use strict\";var Hat=Ju(),jat=nC(),Gat=eme(),KT=Xo(),{reorder:cq,scrollUp:qat,scrollDown:Wat,isObject:tme,swap:Yat}=KT,uq=class extends jat{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=\"\"}async initialize(){typeof this.options.initial==\"function\"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:s,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof a!=\"function\"&&this.selectable.length===0)throw new Error(\"At least one choice must be selectable\");tme(r)&&(r=Object.keys(r)),Array.isArray(r)?(s!=null&&(this.index=this.findIndex(s)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(r=s),typeof r==\"string\"&&(r=this.findIndex(r)),typeof r==\"number\"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let s=[],a=0,n=async(c,f)=>{typeof c==\"function\"&&(c=await c.call(this)),c instanceof Promise&&(c=await c);for(let p=0;p<c.length;p++){let h=c[p]=await this.toChoice(c[p],a++,f);s.push(h),h.choices&&await n(h.choices,h)}return s};return n(e,r).then(c=>(this.state.loadingChoices=!1,c))}async toChoice(e,r,s){if(typeof e==\"function\"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e==\"string\"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let a=e.value;if(e=Gat(e.role,this.options)(this,e),typeof e.disabled==\"string\"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint=\"(disabled)\"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||\"\",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input=\"\",e.index=r,e.cursor=0,KT.define(e,\"parent\",s),e.level=s?s.level+1:1,e.indent==null&&(e.indent=s?s.indent+\"  \":e.indent||\"\"),e.path=s?s.path+\".\"+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,Hat.unstyle(e.message).length));let c={...e};return e.reset=(f=c.input,p=c.value)=>{for(let h of Object.keys(c))e[h]=c[h];e.input=f,e.value=p},a==null&&typeof e.initial==\"function\"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit(\"choice\",e,r,this),typeof e.onChoice==\"function\"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,s){let a=await this.toChoice(e,r,s);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(e,r,s){let a={name:\"New choice name?\",editable:!0,newChoice:!0,...e},n=await this.addChoice(a,r,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input=\"\",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?\"  \".repeat(e.level-1):\"\":e.indent}dispatch(e,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(e,r){return typeof r!=\"boolean\"&&(r=e.enabled),r&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=r&&!this.isDisabled(e),e)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(e=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}toggle(e,r){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!=\"boolean\"&&(r=!e.enabled),e.enabled=r,e.choices&&e.choices.forEach(a=>this.toggle(a,r));let s=e.parent;for(;s;){let a=s.choices.filter(n=>this.isDisabled(n));s.enabled=a.every(n=>n.enabled===!0),s=s.parent}return rme(this,this.choices),this.emit(\"toggle\",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let r=s=>{let a=Number(s);if(a>this.choices.length-1)return this.alert();let n=this.focused,c=this.choices.find(f=>a===f.index);if(!c.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(c)===-1){let f=cq(this.choices),p=f.indexOf(c);if(n.index>p){let h=f.slice(p,p+this.limit),E=f.filter(C=>!h.includes(C));this.choices=h.concat(E)}else{let h=p-this.limit+1;this.choices=f.slice(h).concat(f.slice(0,h))}}return this.index=this.choices.indexOf(c),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(s=>{let a=this.choices.length,n=this.num,c=(f=!1,p)=>{clearTimeout(this.numberTimeout),f&&(p=r(n)),this.num=\"\",s(p)};if(n===\"0\"||n.length===1&&+(n+\"0\")>a)return c(!0);if(Number(n)>a)return c(!1,this.alert());this.numberTimeout=setTimeout(()=>c(!0),this.delay)})}home(){return this.choices=cq(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,r=cq(this.choices);return this.choices=r.slice(e).concat(r.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,r=this.visible.length,s=this.index;return this.options.scroll===!1&&s===0?this.alert():e>r&&s===0?this.scrollUp():(this.index=(s-1%e+e)%e,this.isDisabled()?this.up():this.render())}down(){let e=this.choices.length,r=this.visible.length,s=this.index;return this.options.scroll===!1&&s===r-1?this.alert():e>r&&s===r-1?this.scrollDown():(this.index=(s+1)%e,this.isDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=qat(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=Wat(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){Yat(this.choices,this.index,e)}isDisabled(e=this.focused){return e&&[\"disabled\",\"collapsed\",\"hidden\",\"completing\",\"readonly\"].some(s=>e[s]===!0)?!0:e&&e.role===\"heading\"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(r=>this.isEnabled(r));if(e.choices){let r=e.choices.filter(s=>!this.isDisabled(s));return e.enabled&&r.every(s=>this.isEnabled(s))}return e.enabled&&!this.isDisabled(e)}isChoice(e,r){return e.name===r||e.index===Number(r)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(r=>this.isChoice(e,r)):this.isChoice(e,this.initial)}map(e=[],r=\"value\"){return[].concat(e||[]).reduce((s,a)=>(s[a]=this.find(a,r),s),{})}filter(e,r){let a=typeof e==\"function\"?e:(f,p)=>[f.name,p].includes(e),c=(this.options.multiple?this.state._choices:this.choices).filter(a);return r?c.map(f=>f[r]):c}find(e,r){if(tme(e))return r?e[r]:e;let a=typeof e==\"function\"?e:(c,f)=>[c.name,f].includes(e),n=this.choices.find(a);if(n)return r?n[r]:n}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(c=>c.newChoice))return this.alert();let{reorder:r,sort:s}=this.options,a=this.multiple===!0,n=this.selected;return n===void 0?this.alert():(Array.isArray(n)&&r!==!1&&s!==!0&&(n=KT.reorder(n)),this.value=a?n.map(c=>c.name):n.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let r of e)this.state._choices.some(s=>s.name===r.name)||this.state._choices.push(r);if(!this._initial&&this.options.initial){this._initial=!0;let r=this.initial;if(typeof r==\"string\"||typeof r==\"number\"){let s=this.find(r);s&&(this.initial=s.index,this.focus(s,!0))}}}get choices(){return rme(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:r,choices:s}=this,a=e.limit||this._limit||r.limit||s.length;return Math.min(a,this.height)}set value(e){super.value=e}get value(){return typeof super.value!=\"string\"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function rme(t,e){if(e instanceof Promise)return e;if(typeof e==\"function\"){if(KT.isAsyncFn(e))return e;e=e.call(t,t)}for(let r of e){if(Array.isArray(r.choices)){let s=r.choices.filter(a=>!t.isDisabled(a));r.enabled=s.every(a=>a.enabled===!0)}t.isDisabled(r)===!0&&delete r.enabled}return e}nme.exports=uq});var G0=_((KHt,ime)=>{\"use strict\";var Vat=Wv(),fq=Xo(),Aq=class extends Vat{constructor(e){super(e),this.emptyError=this.options.emptyError||\"No items were selected\"}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,r){return!this.multiple||this.options.pointer?super.pointer(e,r):\"\"}indicator(e,r){return this.multiple?super.indicator(e,r):\"\"}choiceMessage(e,r){let s=this.resolve(e.message,this.state,e,r);return e.role===\"heading\"&&!fq.hasColor(s)&&(s=this.styles.strong(s)),this.resolve(s,this.state,e,r)}choiceSeparator(){return\":\"}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=await this.pointer(e,r),n=await this.indicator(e,r)+(e.pad||\"\"),c=await this.resolve(e.hint,this.state,e,r);c&&!fq.hasColor(c)&&(c=this.styles.muted(c));let f=this.indent(e),p=await this.choiceMessage(e,r),h=()=>[this.margin[3],f+a+n,p,this.margin[1],c].filter(Boolean).join(\" \");return e.role===\"heading\"?h():e.disabled?(fq.hasColor(p)||(p=this.styles.disabled(p)),h()):(s&&(p=this.styles.em(p)),h())}async renderChoices(){if(this.state.loading===\"choices\")return this.styles.warning(\"Loading choices\");if(this.state.submitted)return\"\";let e=this.visible.map(async(n,c)=>await this.renderChoice(n,c)),r=await Promise.all(e);r.length||r.push(this.styles.danger(\"No matching choices\"));let s=this.margin[0]+r.join(`\n`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,s].filter(Boolean).join(`\n`)}format(){return!this.state.submitted||this.state.cancelled?\"\":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(\", \"):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,s=\"\",a=await this.header(),n=await this.prefix(),c=await this.separator(),f=await this.message();this.options.promptLine!==!1&&(s=[n,f,c,\"\"].join(\" \"),this.state.prompt=s);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();p&&(s+=p),h&&!s.includes(h)&&(s+=\" \"+h),e&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(s+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,s,E,C].filter(Boolean).join(`\n`)),this.write(this.margin[2]),this.restore()}};ime.exports=Aq});var ome=_((zHt,sme)=>{\"use strict\";var Jat=G0(),Kat=(t,e)=>{let r=t.toLowerCase();return s=>{let n=s.toLowerCase().indexOf(r),c=e(s.slice(n,n+r.length));return n>=0?s.slice(0,n)+c+s.slice(n+r.length):s}},pq=class extends Jat{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:s}=this.state;return this.input=s.slice(0,r)+e+s.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest==\"function\")return this.options.suggest.call(this,e,r);let s=e.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(s))}pointer(){return\"\"}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(\", \");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!==\"pending\")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Kat(this.input,e),s=this.choices;this.choices=s.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=s}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};sme.exports=pq});var gq=_((ZHt,ame)=>{\"use strict\";var hq=Xo();ame.exports=(t,e={})=>{t.cursorHide();let{input:r=\"\",initial:s=\"\",pos:a,showCursor:n=!0,color:c}=e,f=c||t.styles.placeholder,p=hq.inverse(t.styles.primary),h=T=>p(t.styles.black(T)),E=r,C=\" \",S=h(C);if(t.blink&&t.blink.off===!0&&(h=T=>T,S=\"\"),n&&a===0&&s===\"\"&&r===\"\")return h(C);if(n&&a===0&&(r===s||r===\"\"))return h(s[0])+f(s.slice(1));s=hq.isPrimitive(s)?`${s}`:\"\",r=hq.isPrimitive(r)?`${r}`:\"\";let b=s&&s.startsWith(r)&&s!==r,I=b?h(s[r.length]):S;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),I=\"\"),n===!1&&(I=\"\"),b){let T=t.styles.unstyle(E+I);return E+I+f(s.slice(T.length))}return E+I}});var zT=_((XHt,lme)=>{\"use strict\";var zat=Ju(),Zat=G0(),Xat=gq(),dq=class extends Zat{constructor(e){super({...e,multiple:!0}),this.type=\"form\",this.initial=this.options.initial,this.align=[this.options.align,\"right\"].find(r=>r!=null),this.emptyError=\"\",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:s,input:a}=r;return r.value=r.input=a.slice(0,s)+e+a.slice(s),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:s}=e;return e.value=e.input=s.slice(0,r-1)+s.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:s}=e;if(s[r]===void 0)return this.alert();let a=`${s}`.slice(0,r)+`${s}`.slice(r+1);return e.value=e.input=a,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:s}=e;return r&&r.startsWith(s)&&s!==r?(e.value=e.input=r,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input=\"\",e.cursor=0,this.render()):this.alert()}separator(){return\"\"}format(e){return this.state.submitted?\"\":super.format(e)}pointer(){return\"\"}indicator(e){return e.input?\"\\u29BF\":\"\\u2299\"}async choiceSeparator(e,r){let s=await this.resolve(e.separator,this.state,e,r)||\":\";return s?\" \"+this.styles.disabled(s):\"\"}async renderChoice(e,r){await this.onChoice(e,r);let{state:s,styles:a}=this,{cursor:n,initial:c=\"\",name:f,hint:p,input:h=\"\"}=e,{muted:E,submitted:C,primary:S,danger:b}=a,I=p,T=this.index===r,N=e.validate||(()=>!0),U=await this.choiceSeparator(e,r),W=e.message;this.align===\"right\"&&(W=W.padStart(this.longest+1,\" \")),this.align===\"left\"&&(W=W.padEnd(this.longest+1,\" \"));let ee=this.values[f]=h||c,ie=h?\"success\":\"dark\";await N.call(e,ee,this.state)!==!0&&(ie=\"danger\");let ue=a[ie],le=ue(await this.indicator(e,r))+(e.pad||\"\"),me=this.indent(e),pe=()=>[me,le,W+U,h,I].filter(Boolean).join(\" \");if(s.submitted)return W=zat.unstyle(W),h=C(h),I=\"\",pe();if(e.format)h=await e.format.call(this,h,e,r);else{let Be=this.styles.muted;h=Xat(this,{input:h,initial:c,pos:n,showCursor:T,color:Be})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[f]=await e.result.call(this,ee,e,r)),T&&(W=S(W)),e.error?h+=(h?\" \":\"\")+b(e.error.trim()):e.hint&&(h+=(h?\" \":\"\")+E(e.hint.trim())),pe()}async submit(){return this.value=this.values,super.base.submit.call(this)}};lme.exports=dq});var mq=_(($Ht,ume)=>{\"use strict\";var $at=zT(),elt=()=>{throw new Error(\"expected prompt to have a custom authenticate method\")},cme=(t=elt)=>{class e extends $at{constructor(s){super(s)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(s){return cme(s)}}return e};ume.exports=cme()});var pme=_((ejt,Ame)=>{\"use strict\";var tlt=mq();function rlt(t,e){return t.username===this.options.username&&t.password===this.options.password}var fme=(t=rlt)=>{let e=[{name:\"username\",message:\"username\"},{name:\"password\",message:\"password\",format(s){return this.options.showPassword?s:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(s.length))}}];class r extends tlt.create(t){constructor(a){super({...a,choices:e})}static create(a){return fme(a)}}return r};Ame.exports=fme()});var ZT=_((tjt,hme)=>{\"use strict\";var nlt=nC(),{isPrimitive:ilt,hasColor:slt}=Xo(),yq=class extends nlt{constructor(e){super(e),this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:r,state:s}=this;return s.submitted?r.success(e):r.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return ilt(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status===\"pending\"){let e=await this.element(\"hint\");return slt(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=this.styles.muted(this.default),f=[s,n,c,a].filter(Boolean).join(\" \");this.state.prompt=f;let p=await this.header(),h=this.value=this.cast(e),E=await this.format(h),C=await this.error()||await this.hint(),S=await this.footer();C&&!f.includes(C)&&(E+=\" \"+C),f+=\" \"+E,this.clear(r),this.write([p,f,S].filter(Boolean).join(`\n`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};hme.exports=yq});var dme=_((rjt,gme)=>{\"use strict\";var olt=ZT(),Eq=class extends olt{constructor(e){super(e),this.default=this.options.default||(this.initial?\"(Y/n)\":\"(y/N)\")}};gme.exports=Eq});var yme=_((njt,mme)=>{\"use strict\";var alt=G0(),llt=zT(),iC=llt.prototype,Iq=class extends alt{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,\"left\"].find(r=>r!=null),this.emptyError=\"\",this.values={}}dispatch(e,r){let s=this.focused,a=s.parent||{};return!s.editable&&!a.editable&&(e===\"a\"||e===\"i\")?super[e]():iC.dispatch.call(this,e,r)}append(e,r){return iC.append.call(this,e,r)}delete(e,r){return iC.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?iC.next.call(this):super.next()}prev(){return this.focused.editable?iC.prev.call(this):super.prev()}async indicator(e,r){let s=e.indicator||\"\",a=e.editable?s:super.indicator(e,r);return await this.resolve(a,this.state,e,r)||\"\"}indent(e){return e.role===\"heading\"?\"\":e.editable?\" \":\"  \"}async renderChoice(e,r){return e.indent=\"\",e.editable?iC.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return\"\"}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!=\"function\"||r.role===\"heading\")continue;let s=r.parent?this.value[r.parent.name]:this.value;if(r.editable?s=r.value===r.name?r.initial||\"\":r.value:this.isDisabled(r)||(s=r.enabled===!0),e=await r.validate(s,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e==\"string\"?e:\"Invalid Input\"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role===\"heading\"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||\"\":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};mme.exports=Iq});var vm=_((ijt,Eme)=>{\"use strict\";var clt=nC(),ult=gq(),{isPrimitive:flt}=Xo(),Cq=class extends clt{constructor(e){super(e),this.initial=flt(this.initial)?String(this.initial):\"\",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let s=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name===\"return\"&&(!s||s.name!==\"return\")?this.append(`\n`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value=\"\",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:s}=this.state;this.input=`${s}`.slice(0,r)+e+`${s}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),s=this.input.slice(e),a=r.split(\" \");this.state.clipboard.push(a.pop()),this.input=a.join(\" \"),this.cursor=this.input.length,this.input+=s,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):\"\";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):ult(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),s=await this.separator(),a=await this.message(),n=[r,a,s].filter(Boolean).join(\" \");this.state.prompt=n;let c=await this.header(),f=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!f.includes(p)&&(f+=\" \"+p),n+=\" \"+f,this.clear(e),this.write([c,n,h].filter(Boolean).join(`\n`)),this.restore()}};Eme.exports=Cq});var Cme=_((sjt,Ime)=>{\"use strict\";var Alt=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),XT=t=>Alt(t).filter(Boolean);Ime.exports=(t,e={},r=\"\")=>{let{past:s=[],present:a=\"\"}=e,n,c;switch(t){case\"prev\":case\"undo\":return n=s.slice(0,s.length-1),c=s[s.length-1]||\"\",{past:XT([r,...n]),present:c};case\"next\":case\"redo\":return n=s.slice(1),c=s[0]||\"\",{past:XT([...n,r]),present:c};case\"save\":return{past:XT([...s,r]),present:\"\"};case\"remove\":return c=XT(s.filter(f=>f!==r)),a=\"\",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: \"${t}\"`)}}});var Bq=_((ojt,Bme)=>{\"use strict\";var plt=vm(),wme=Cme(),wq=class extends plt{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let s=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get(\"values\")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=wme(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion(\"prev\")}altDown(){return this.completion(\"next\")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=wme(\"save\",this.data,this.input),this.store.set(\"values\",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Bme.exports=wq});var Sme=_((ajt,vme)=>{\"use strict\";var hlt=vm(),vq=class extends hlt{format(){return\"\"}};vme.exports=vq});var Pme=_((ljt,Dme)=>{\"use strict\";var glt=vm(),Sq=class extends glt{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||\"\"}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(\", \")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};Dme.exports=Sq});var xme=_((cjt,bme)=>{\"use strict\";var dlt=G0(),Dq=class extends dlt{constructor(e){super({...e,multiple:!0})}};bme.exports=Dq});var bq=_((ujt,kme)=>{\"use strict\";var mlt=vm(),Pq=class extends mlt{constructor(e={}){super({style:\"number\",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:\"\",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e===\".\"&&this.input.includes(\".\")?this.alert(\"invalid number\"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,s=this.toNumber(this.input);return s>this.max+r?this.alert():(this.input=`${s+r}`,this.render())}down(e){let r=e||this.minor,s=this.toNumber(this.input);return s<this.min-r?this.alert():(this.input=`${s-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format==\"function\"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=\"\"){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\\.)|(\\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};kme.exports=Pq});var Rme=_((fjt,Qme)=>{Qme.exports=bq()});var Fme=_((Ajt,Tme)=>{\"use strict\";var ylt=vm(),xq=class extends ylt{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):\"\"}};Tme.exports=xq});var Lme=_((pjt,Ome)=>{\"use strict\";var Elt=Ju(),Ilt=Wv(),Nme=Xo(),kq=class extends Ilt{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||\"left\"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`\n   `;let r=e.startNumber||1;typeof this.scale==\"number\"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((s,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let s=0;s<this.scale.length;s++)r.scale.push({index:s})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,s){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return\"\"}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(\", \"):\"\"}pointer(){return\"\"}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?\"\":[\"\",...this.scale.map(s=>`   ${s.name} - ${s.message}`)].map(s=>this.styles.muted(s)).join(`\n`)}renderScaleHeading(e){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading==\"function\"&&(r=this.options.renderScaleHeading.call(this,e));let s=this.scaleLength-r.join(\"\").length,a=Math.round(s/(r.length-1)),c=r.map(p=>this.styles.strong(p)).join(\" \".repeat(a)),f=\" \".repeat(this.widths[0]);return this.margin[3]+f+this.margin[1]+c}scaleIndicator(e,r,s){if(typeof this.options.scaleIndicator==\"function\")return this.options.scaleIndicator.call(this,e,r,s);let a=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let s=e.scale.map(n=>this.scaleIndicator(e,n,r)),a=this.term===\"Hyper\"?\"\":\" \";return s.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=await this.pointer(e,r),n=await e.hint;n&&!Nme.hasColor(n)&&(n=this.styles.muted(n));let c=I=>this.margin[3]+I.replace(/\\s+$/,\"\").padEnd(this.widths[0],\" \"),f=this.newline,p=this.indent(e),h=await this.resolve(e.message,this.state,e,r),E=await this.renderScale(e,r),C=this.margin[1]+this.margin[3];this.scaleLength=Elt.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-C.length);let b=Nme.wordWrap(h,{width:this.widths[0],newline:f}).split(`\n`).map(I=>c(I)+this.margin[1]);return s&&(E=this.styles.info(E),b=b.map(I=>this.styles.info(I))),b[0]+=E,this.linebreak&&b.push(\"\"),[p+a,b.join(`\n`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return\"\";this.tableize();let e=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(e),s=await this.renderScaleHeading();return this.margin[0]+[s,...r.map(a=>a.join(\" \"))].join(`\n`)}async render(){let{submitted:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=\"\";this.options.promptLine!==!1&&(c=[s,n,a,\"\"].join(\" \"),this.state.prompt=c);let f=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),C=await this.renderChoices(),S=await this.footer(),b=this.emptyError;p&&(c+=p),E&&!c.includes(E)&&(c+=\" \"+E),e&&!p&&!C.trim()&&this.multiple&&b!=null&&(c+=this.styles.danger(b)),this.clear(r),this.write([f,c,h,C,S].filter(Boolean).join(`\n`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};Ome.exports=kq});var _me=_((hjt,Ume)=>{\"use strict\";var Mme=Ju(),Clt=(t=\"\")=>typeof t==\"string\"?t.replace(/^['\"]|['\"]$/g,\"\"):\"\",Rq=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=Clt(e.initial||this.field.initial||\"\"),this.message=e.message||this.name,this.cursor=0,this.input=\"\",this.lines=[]}},wlt=async(t={},e={},r=s=>s)=>{let s=new Set,a=t.fields||[],n=t.template,c=[],f=[],p=[],h=1;typeof n==\"function\"&&(n=await n());let E=-1,C=()=>n[++E],S=()=>n[E+1],b=I=>{I.line=h,c.push(I)};for(b({type:\"bos\",value:\"\"});E<n.length-1;){let I=C();if(/^[^\\S\\n ]$/.test(I)){b({type:\"text\",value:I});continue}if(I===`\n`){b({type:\"newline\",value:I}),h++;continue}if(I===\"\\\\\"){I+=C(),b({type:\"text\",value:I});continue}if((I===\"$\"||I===\"#\"||I===\"{\")&&S()===\"{\"){let N=C();I+=N;let U={type:\"template\",open:I,inner:\"\",close:\"\",value:I},W;for(;W=C();){if(W===\"}\"){S()===\"}\"&&(W+=C()),U.value+=W,U.close=W;break}W===\":\"?(U.initial=\"\",U.key=U.inner):U.initial!==void 0&&(U.initial+=W),U.value+=W,U.inner+=W}U.template=U.open+(U.initial||U.inner)+U.close,U.key=U.key||U.inner,e.hasOwnProperty(U.key)&&(U.initial=e[U.key]),U=r(U),b(U),p.push(U.key),s.add(U.key);let ee=f.find(ie=>ie.name===U.key);U.field=a.find(ie=>ie.name===U.key),ee||(ee=new Rq(U),f.push(ee)),ee.lines.push(U.line-1);continue}let T=c[c.length-1];T.type===\"text\"&&T.line===h?T.value+=I:b({type:\"text\",value:I})}return b({type:\"eos\",value:\"\"}),{input:n,tabstops:c,unique:s,keys:p,items:f}};Ume.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),s={...e.values,...e.initial},{tabstops:a,items:n,keys:c}=await wlt(e,s),f=Qq(\"result\",t,e),p=Qq(\"format\",t,e),h=Qq(\"validate\",t,e,!0),E=t.isValue.bind(t);return async(C={},S=!1)=>{let b=0;C.required=r,C.items=n,C.keys=c,C.output=\"\";let I=async(W,ee,ie,ue)=>{let le=await h(W,ee,ie,ue);return le===!1?\"Invalid field \"+ie.name:le};for(let W of a){let ee=W.value,ie=W.key;if(W.type!==\"template\"){ee&&(C.output+=ee);continue}if(W.type===\"template\"){let ue=n.find(Ce=>Ce.name===ie);e.required===!0&&C.required.add(ue.name);let le=[ue.input,C.values[ue.value],ue.value,ee].find(E),pe=(ue.field||{}).message||W.inner;if(S){let Ce=await I(C.values[ie],C,ue,b);if(Ce&&typeof Ce==\"string\"||Ce===!1){C.invalid.set(ie,Ce);continue}C.invalid.delete(ie);let g=await f(C.values[ie],C,ue,b);C.output+=Mme.unstyle(g);continue}ue.placeholder=!1;let Be=ee;ee=await p(ee,C,ue,b),le!==ee?(C.values[ie]=le,ee=t.styles.typing(le),C.missing.delete(pe)):(C.values[ie]=void 0,le=`<${pe}>`,ee=t.styles.primary(le),ue.placeholder=!0,C.required.has(ie)&&C.missing.add(pe)),C.missing.has(pe)&&C.validating&&(ee=t.styles.warning(le)),C.invalid.has(ie)&&C.validating&&(ee=t.styles.danger(le)),b===C.index&&(Be!==ee?ee=t.styles.underline(ee):ee=t.styles.heading(Mme.unstyle(ee))),b++}ee&&(C.output+=ee)}let T=C.output.split(`\n`).map(W=>\" \"+W),N=n.length,U=0;for(let W of n)C.invalid.has(W.name)&&W.lines.forEach(ee=>{T[ee][0]===\" \"&&(T[ee]=C.styles.danger(C.symbols.bullet)+T[ee].slice(1))}),t.isValue(C.values[W.name])&&U++;return C.completed=(U/N*100).toFixed(0),C.output=T.join(`\n`),C.output}};function Qq(t,e,r,s){return(a,n,c,f)=>typeof c.field[t]==\"function\"?c.field[t].call(e,a,n,c,f):[s,a].find(p=>e.isValue(p))}});var jme=_((gjt,Hme)=>{\"use strict\";var Blt=Ju(),vlt=_me(),Slt=nC(),Tq=class extends Slt{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await vlt(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let s=this.getItem(),a=s.input.slice(0,this.cursor),n=s.input.slice(this.cursor);this.input=s.input=`${a}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),s=e.input.slice(0,this.cursor-1);this.input=e.input=`${s}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:s,size:a}=this.state,n=[this.options.newline,`\n`].find(W=>W!=null),c=await this.prefix(),f=await this.separator(),p=await this.message(),h=[c,p,f].filter(Boolean).join(\" \");this.state.prompt=h;let E=await this.header(),C=await this.error()||\"\",S=await this.hint()||\"\",b=s?\"\":await this.interpolate(this.state),I=this.state.key=r[e]||\"\",T=await this.format(I),N=await this.footer();T&&(h+=\" \"+T),S&&!T&&this.state.completed===0&&(h+=\" \"+S),this.clear(a);let U=[E,h,b,N,C.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:s,index:a}=this.state,n=r.find(c=>c.name===s[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!=\"function\"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:s,values:a}=this.state;if(e.size){let f=\"\";for(let[p,h]of e)f+=`Invalid ${p}: ${h}\n`;return this.state.error=f,super.submit()}if(r.size)return this.state.error=\"Required: \"+[...r.keys()].join(\", \"),super.submit();let c=Blt.unstyle(s).split(`\n`).map(f=>f.slice(1)).join(`\n`);return this.value={values:a,result:c},super.submit()}};Hme.exports=Tq});var qme=_((djt,Gme)=>{\"use strict\";var Dlt=\"(Use <shift>+<up/down> to sort)\",Plt=G0(),Fq=class extends Plt{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,Dlt].find(this.isValue.bind(this))}indicator(){return\"\"}async renderChoice(e,r){let s=await super.renderChoice(e,r),a=this.symbols.identicalTo+\" \",n=this.index===r&&this.sorting?this.styles.muted(a):\"  \";return this.options.drag===!1&&(n=\"\"),this.options.numbered===!0?n+`${r+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Gme.exports=Fq});var Yme=_((mjt,Wme)=>{\"use strict\";var blt=Wv(),Nq=class extends blt{constructor(e={}){if(super(e),this.emptyError=e.emptyError||\"No items were selected\",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=[\"\",\"4 - Strongly Agree\",\"3 - Agree\",\"2 - Neutral\",\"1 - Disagree\",\"0 - Strongly Disagree\",\"\"];r=r.map(s=>this.styles.muted(s)),this.state.header=r.join(`\n   `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let s of r)s.scale=xlt(5,this.options),s.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],s=r.selected;return e.scale.forEach(a=>a.selected=!1),r.selected=!s,this.render()}indicator(){return\"\"}pointer(){return\"\"}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return\"   \"}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=this.term===\"Hyper\",n=a?9:8,c=a?\"\":\" \",f=this.symbols.line.repeat(n),p=\" \".repeat(n+(a?0:1)),h=ee=>(ee?this.styles.success(\"\\u25C9\"):\"\\u25EF\")+c,E=r+1+\".\",C=s?this.styles.heading:this.styles.noop,S=await this.resolve(e.message,this.state,e,r),b=this.indent(e),I=b+e.scale.map((ee,ie)=>h(ie===e.scaleIdx)).join(f),T=ee=>ee===e.scaleIdx?C(ee):ee,N=b+e.scale.map((ee,ie)=>T(ie)).join(p),U=()=>[E,S].filter(Boolean).join(\" \"),W=()=>[U(),I,N,\" \"].filter(Boolean).join(`\n`);return s&&(I=this.styles.cyan(I),N=this.styles.cyan(N)),W()}async renderChoices(){if(this.state.submitted)return\"\";let e=this.visible.map(async(s,a)=>await this.renderChoice(s,a)),r=await Promise.all(e);return r.length||r.push(this.styles.danger(\"No matching choices\")),r.join(`\n`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(\", \"):\"\"}async render(){let{submitted:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=[s,n,a].filter(Boolean).join(\" \");this.state.prompt=c;let f=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();(p||!h)&&(c+=\" \"+p),h&&!c.includes(h)&&(c+=\" \"+h),e&&!p&&!E&&this.multiple&&this.type!==\"form\"&&(c+=this.styles.danger(this.emptyError)),this.clear(r),this.write([c,f,E,C].filter(Boolean).join(`\n`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function xlt(t,e={}){if(Array.isArray(e.scale))return e.scale.map(s=>({...s}));let r=[];for(let s=1;s<t+1;s++)r.push({i:s,selected:!1});return r}Wme.exports=Nq});var Jme=_((yjt,Vme)=>{Vme.exports=Bq()});var zme=_((Ejt,Kme)=>{\"use strict\";var klt=ZT(),Oq=class extends klt{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||\"no\",this.enabled=this.options.enabled||\"yes\",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e=\"\",r){switch(e.toLowerCase()){case\" \":return this.toggle();case\"1\":case\"y\":case\"t\":return this.enable();case\"0\":case\"n\":case\"f\":return this.disable();default:return this.alert()}}format(){let e=s=>this.styles.primary.underline(s);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(\" / \"))}async render(){let{size:e}=this.state,r=await this.header(),s=await this.prefix(),a=await this.separator(),n=await this.message(),c=await this.format(),f=await this.error()||await this.hint(),p=await this.footer(),h=[s,n,a,c].join(\" \");this.state.prompt=h,f&&!h.includes(f)&&(h+=\" \"+f),this.clear(e),this.write([r,h,p].filter(Boolean).join(`\n`)),this.write(this.margin[2]),this.restore()}};Kme.exports=Oq});var Xme=_((Ijt,Zme)=>{\"use strict\";var Qlt=G0(),Lq=class extends Qlt{constructor(e){if(super(e),typeof this.options.correctChoice!=\"number\"||this.options.correctChoice<0)throw new Error(\"Please specify the index of the correct answer from the list of choices\")}async toChoices(e,r){let s=await super.toChoices(e,r);if(s.length<2)throw new Error(\"Please give at least two choices to the user\");if(this.options.correctChoice>s.length)throw new Error(\"Please specify the index of the correct answer from the list of choices\");return s}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Zme.exports=Lq});var eye=_(Mq=>{\"use strict\";var $me=Xo(),ks=(t,e)=>{$me.defineExport(Mq,t,e),$me.defineExport(Mq,t.toLowerCase(),e)};ks(\"AutoComplete\",()=>ome());ks(\"BasicAuth\",()=>pme());ks(\"Confirm\",()=>dme());ks(\"Editable\",()=>yme());ks(\"Form\",()=>zT());ks(\"Input\",()=>Bq());ks(\"Invisible\",()=>Sme());ks(\"List\",()=>Pme());ks(\"MultiSelect\",()=>xme());ks(\"Numeral\",()=>Rme());ks(\"Password\",()=>Fme());ks(\"Scale\",()=>Lme());ks(\"Select\",()=>G0());ks(\"Snippet\",()=>jme());ks(\"Sort\",()=>qme());ks(\"Survey\",()=>Yme());ks(\"Text\",()=>Jme());ks(\"Toggle\",()=>zme());ks(\"Quiz\",()=>Xme())});var rye=_((wjt,tye)=>{tye.exports={ArrayPrompt:Wv(),AuthPrompt:mq(),BooleanPrompt:ZT(),NumberPrompt:bq(),StringPrompt:vm()}});var Vv=_((Bjt,iye)=>{\"use strict\";var nye=Ie(\"assert\"),_q=Ie(\"events\"),q0=Xo(),zu=class extends _q{constructor(e,r){super(),this.options=q0.merge({},e),this.answers={...r}}register(e,r){if(q0.isObject(e)){for(let a of Object.keys(e))this.register(a,e[a]);return this}nye.equal(typeof r,\"function\",\"expected a function\");let s=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[s]=r:this.prompts[s]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r==\"function\"&&(r=await r.call(this)),await this.ask(q0.merge({},this.options,r))}catch(s){return Promise.reject(s)}return this.answers}async ask(e){typeof e==\"function\"&&(e=await e.call(this));let r=q0.merge({},this.options,e),{type:s,name:a}=e,{set:n,get:c}=q0;if(typeof s==\"function\"&&(s=await s.call(this,e,this.answers)),!s)return this.answers[a];nye(this.prompts[s],`Prompt \"${s}\" is not registered`);let f=new this.prompts[s](r),p=c(this.answers,a);f.state.answers=this.answers,f.enquirer=this,a&&f.on(\"submit\",E=>{this.emit(\"answer\",a,E,f),n(this.answers,a,E)});let h=f.emit.bind(f);return f.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit(\"prompt\",f,this),r.autofill&&p!=null?(f.value=f.input=p,r.autofill===\"show\"&&await f.submit()):p=f.value=await f.run(),p}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||nC()}static get prompts(){return eye()}static get types(){return rye()}static get prompt(){let e=(r,...s)=>{let a=new this(...s),n=a.emit.bind(a);return a.emit=(...c)=>(e.emit(...c),n(...c)),a.prompt(r)};return q0.mixinEmitter(e,new _q),e}};q0.mixinEmitter(zu,new _q);var Uq=zu.prompts;for(let t of Object.keys(Uq)){let e=t.toLowerCase(),r=s=>new Uq[t](s).run();zu.prompt[e]=r,zu[e]=r,zu[t]||Reflect.defineProperty(zu,t,{get:()=>Uq[t]})}var Yv=t=>{q0.defineExport(zu,t,()=>zu.types[t])};Yv(\"ArrayPrompt\");Yv(\"AuthPrompt\");Yv(\"BooleanPrompt\");Yv(\"NumberPrompt\");Yv(\"StringPrompt\");iye.exports=zu});var Aye=_((Y6t,_lt)=>{_lt.exports={name:\"@yarnpkg/cli\",version:\"4.10.3\",license:\"BSD-2-Clause\",main:\"./sources/index.ts\",exports:{\".\":\"./sources/index.ts\",\"./polyfills\":\"./sources/polyfills.ts\",\"./package.json\":\"./package.json\"},dependencies:{\"@yarnpkg/core\":\"workspace:^\",\"@yarnpkg/fslib\":\"workspace:^\",\"@yarnpkg/libzip\":\"workspace:^\",\"@yarnpkg/parsers\":\"workspace:^\",\"@yarnpkg/plugin-catalog\":\"workspace:^\",\"@yarnpkg/plugin-compat\":\"workspace:^\",\"@yarnpkg/plugin-constraints\":\"workspace:^\",\"@yarnpkg/plugin-dlx\":\"workspace:^\",\"@yarnpkg/plugin-essentials\":\"workspace:^\",\"@yarnpkg/plugin-exec\":\"workspace:^\",\"@yarnpkg/plugin-file\":\"workspace:^\",\"@yarnpkg/plugin-git\":\"workspace:^\",\"@yarnpkg/plugin-github\":\"workspace:^\",\"@yarnpkg/plugin-http\":\"workspace:^\",\"@yarnpkg/plugin-init\":\"workspace:^\",\"@yarnpkg/plugin-interactive-tools\":\"workspace:^\",\"@yarnpkg/plugin-jsr\":\"workspace:^\",\"@yarnpkg/plugin-link\":\"workspace:^\",\"@yarnpkg/plugin-nm\":\"workspace:^\",\"@yarnpkg/plugin-npm\":\"workspace:^\",\"@yarnpkg/plugin-npm-cli\":\"workspace:^\",\"@yarnpkg/plugin-pack\":\"workspace:^\",\"@yarnpkg/plugin-patch\":\"workspace:^\",\"@yarnpkg/plugin-pnp\":\"workspace:^\",\"@yarnpkg/plugin-pnpm\":\"workspace:^\",\"@yarnpkg/plugin-stage\":\"workspace:^\",\"@yarnpkg/plugin-typescript\":\"workspace:^\",\"@yarnpkg/plugin-version\":\"workspace:^\",\"@yarnpkg/plugin-workspace-tools\":\"workspace:^\",\"@yarnpkg/shell\":\"workspace:^\",\"ci-info\":\"^4.0.0\",clipanion:\"^4.0.0-rc.2\",semver:\"^7.1.2\",tslib:\"^2.4.0\",typanion:\"^3.14.0\"},devDependencies:{\"@types/semver\":\"^7.1.0\",\"@yarnpkg/builder\":\"workspace:^\",\"@yarnpkg/monorepo\":\"workspace:^\",\"@yarnpkg/pnpify\":\"workspace:^\"},peerDependencies:{\"@yarnpkg/core\":\"workspace:^\"},scripts:{postpack:\"rm -rf lib\",prepack:'run build:compile \"$(pwd)\"',\"build:cli+hook\":\"run build:pnp:hook && builder build bundle\",\"build:cli\":\"builder build bundle\",\"run:cli\":\"builder run\",\"update-local\":\"run build:cli --no-git-hash && rsync -a --delete bundles/ bin/\"},publishConfig:{main:\"./lib/index.js\",bin:null,exports:{\".\":\"./lib/index.js\",\"./package.json\":\"./package.json\"}},files:[\"/lib/**/*\",\"!/lib/pluginConfiguration.*\",\"!/lib/cli.*\"],\"@yarnpkg/builder\":{bundles:{standard:[\"@yarnpkg/plugin-essentials\",\"@yarnpkg/plugin-compat\",\"@yarnpkg/plugin-constraints\",\"@yarnpkg/plugin-dlx\",\"@yarnpkg/plugin-exec\",\"@yarnpkg/plugin-file\",\"@yarnpkg/plugin-git\",\"@yarnpkg/plugin-github\",\"@yarnpkg/plugin-http\",\"@yarnpkg/plugin-init\",\"@yarnpkg/plugin-interactive-tools\",\"@yarnpkg/plugin-jsr\",\"@yarnpkg/plugin-link\",\"@yarnpkg/plugin-nm\",\"@yarnpkg/plugin-npm\",\"@yarnpkg/plugin-npm-cli\",\"@yarnpkg/plugin-pack\",\"@yarnpkg/plugin-patch\",\"@yarnpkg/plugin-pnp\",\"@yarnpkg/plugin-pnpm\",\"@yarnpkg/plugin-stage\",\"@yarnpkg/plugin-typescript\",\"@yarnpkg/plugin-version\",\"@yarnpkg/plugin-workspace-tools\",\"@yarnpkg/plugin-catalog\"]}},repository:{type:\"git\",url:\"git+https://github.com/yarnpkg/berry.git\",directory:\"packages/yarnpkg-cli\"},engines:{node:\">=18.12.0\"}}});var t5=_((v9t,vye)=>{\"use strict\";vye.exports=function(e,r){r===!0&&(r=0);var s=\"\";if(typeof e==\"string\")try{s=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(s=e.protocol);var a=s.split(/\\:|\\+/).filter(Boolean);return typeof r==\"number\"?a[r]:a}});var Dye=_((S9t,Sye)=>{\"use strict\";var oct=t5();function act(t){var e={protocols:[],protocol:null,port:null,resource:\"\",host:\"\",user:\"\",password:\"\",pathname:\"\",hash:\"\",search:\"\",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=oct(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||\"\",e.password=r.password||\"\",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=[\"file\"],e.protocol=e.protocols[0],e.port=\"\",e.resource=\"\",e.user=\"\",e.pathname=\"\",e.hash=\"\",e.search=\"\",e.href=t,e.query={},e.parse_failed=!0}return e}Sye.exports=act});var xye=_((D9t,bye)=>{\"use strict\";var lct=Dye();function cct(t){return t&&typeof t==\"object\"&&\"default\"in t?t:{default:t}}var uct=cct(lct),fct=\"text/plain\",Act=\"us-ascii\",Pye=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),pct=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:s,data:a,hash:n}=r.groups,c=s.split(\";\");n=e?\"\":n;let f=!1;c[c.length-1]===\"base64\"&&(c.pop(),f=!0);let p=(c.shift()||\"\").toLowerCase(),E=[...c.map(C=>{let[S,b=\"\"]=C.split(\"=\").map(I=>I.trim());return S===\"charset\"&&(b=b.toLowerCase(),b===Act)?\"\":`${S}${b?`=${b}`:\"\"}`}).filter(Boolean)];return f&&E.push(\"base64\"),(E.length>0||p&&p!==fct)&&E.unshift(p),`data:${E.join(\";\")},${f?a.trim():a}${n?`#${n}`:\"\"}`};function hct(t,e){if(e={defaultProtocol:\"http:\",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return pct(t,e);if(/^view-source:/i.test(t))throw new Error(\"`view-source:` is not supported as it is a non-standard protocol\");let r=t.startsWith(\"//\");!r&&/^\\.*\\//.test(t)||(t=t.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//,e.defaultProtocol));let a=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error(\"The `forceHttp` and `forceHttps` options cannot be used together\");if(e.forceHttp&&a.protocol===\"https:\"&&(a.protocol=\"http:\"),e.forceHttps&&a.protocol===\"http:\"&&(a.protocol=\"https:\"),e.stripAuthentication&&(a.username=\"\",a.password=\"\"),e.stripHash?a.hash=\"\":e.stripTextFragment&&(a.hash=a.hash.replace(/#?:~:text.*?$/i,\"\")),a.pathname){let c=/\\b[a-z][a-z\\d+\\-.]{1,50}:\\/\\//g,f=0,p=\"\";for(;;){let E=c.exec(a.pathname);if(!E)break;let C=E[0],S=E.index,b=a.pathname.slice(f,S);p+=b.replace(/\\/{2,}/g,\"/\"),p+=C,f=S+C.length}let h=a.pathname.slice(f,a.pathname.length);p+=h.replace(/\\/{2,}/g,\"/\"),a.pathname=p}if(a.pathname)try{a.pathname=decodeURI(a.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=a.pathname.split(\"/\"),f=c[c.length-1];Pye(f,e.removeDirectoryIndex)&&(c=c.slice(0,-1),a.pathname=c.slice(1).join(\"/\")+\"/\")}if(a.hostname&&(a.hostname=a.hostname.replace(/\\.$/,\"\"),e.stripWWW&&/^www\\.(?!www\\.)[a-z\\-\\d]{1,63}\\.[a-z.\\-\\d]{2,63}$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\\./,\"\"))),Array.isArray(e.removeQueryParameters))for(let c of[...a.searchParams.keys()])Pye(c,e.removeQueryParameters)&&a.searchParams.delete(c);if(e.removeQueryParameters===!0&&(a.search=\"\"),e.sortQueryParameters){a.searchParams.sort();try{a.search=decodeURIComponent(a.search)}catch{}}e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\\/$/,\"\"));let n=t;return t=a.toString(),!e.removeSingleSlash&&a.pathname===\"/\"&&!n.endsWith(\"/\")&&a.hash===\"\"&&(t=t.replace(/\\/$/,\"\")),(e.removeTrailingSlash||a.pathname===\"/\")&&a.hash===\"\"&&e.removeSingleSlash&&(t=t.replace(/\\/$/,\"\")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\\/\\//,\"//\")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\\/\\//,\"\")),t}var r5=(t,e=!1)=>{let r=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\\/\\/)([\\w\\.\\-@]+)[\\/:]([\\~,\\.\\w,\\-,\\_,\\/]+?(?:\\.git|\\/)?)$/,s=n=>{let c=new Error(n);throw c.subject_url=t,c};(typeof t!=\"string\"||!t.trim())&&s(\"Invalid url.\"),t.length>r5.MAX_INPUT_LENGTH&&s(\"Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH.\"),e&&(typeof e!=\"object\"&&(e={stripHash:!1}),t=hct(t,e));let a=uct.default(t);if(a.parse_failed){let n=a.href.match(r);n?(a.protocols=[\"ssh\"],a.protocol=\"ssh\",a.resource=n[2],a.host=n[2],a.user=n[1],a.pathname=`/${n[3]}`,a.parse_failed=!1):s(\"URL parsing failed.\")}return a};r5.MAX_INPUT_LENGTH=2048;bye.exports=r5});var Rye=_((P9t,Qye)=>{\"use strict\";var gct=t5();function kye(t){if(Array.isArray(t))return t.indexOf(\"ssh\")!==-1||t.indexOf(\"rsync\")!==-1;if(typeof t!=\"string\")return!1;var e=gct(t);if(t=t.substring(t.indexOf(\"://\")+3),kye(e))return!0;var r=new RegExp(\".([a-zA-Z\\\\d]+):(\\\\d+)/\");return!t.match(r)&&t.indexOf(\"@\")<t.indexOf(\":\")}Qye.exports=kye});var Nye=_((b9t,Fye)=>{\"use strict\";var dct=xye(),Tye=Rye();function mct(t){var e=dct(t);return e.token=\"\",e.password===\"x-oauth-basic\"?e.token=e.user:e.user===\"x-token-auth\"&&(e.token=e.password),Tye(e.protocols)||e.protocols.length===0&&Tye(t)?e.protocol=\"ssh\":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol=\"file\",e.protocols=[\"file\"]),e.href=e.href.replace(/\\/$/,\"\"),e}Fye.exports=mct});var Lye=_((x9t,Oye)=>{\"use strict\";var yct=Nye();function n5(t){if(typeof t!=\"string\")throw new Error(\"The url must be a string.\");var e=/^([a-z\\d-]{1,39})\\/([-\\.\\w]{1,100})$/i;e.test(t)&&(t=\"https://github.com/\"+t);var r=yct(t),s=r.resource.split(\".\"),a=null;switch(r.toString=function(N){return n5.stringify(this,N)},r.source=s.length>2?s.slice(1-s.length).join(\".\"):r.source=r.resource,r.git_suffix=/\\.git$/.test(r.pathname),r.name=decodeURIComponent((r.pathname||r.href).replace(/(^\\/)|(\\/$)/g,\"\").replace(/\\.git$/,\"\")),r.owner=decodeURIComponent(r.user),r.source){case\"git.cloudforge.com\":r.owner=r.user,r.organization=s[0],r.source=\"cloudforge.com\";break;case\"visualstudio.com\":if(r.resource===\"vs-ssh.visualstudio.com\"){a=r.name.split(\"/\"),a.length===4&&(r.organization=a[1],r.owner=a[2],r.name=a[3],r.full_name=a[2]+\"/\"+a[3]);break}else{a=r.name.split(\"/\"),a.length===2?(r.owner=a[1],r.name=a[1],r.full_name=\"_git/\"+r.name):a.length===3?(r.name=a[2],a[0]===\"DefaultCollection\"?(r.owner=a[2],r.organization=a[0],r.full_name=r.organization+\"/_git/\"+r.name):(r.owner=a[0],r.full_name=r.owner+\"/_git/\"+r.name)):a.length===4&&(r.organization=a[0],r.owner=a[1],r.name=a[3],r.full_name=r.organization+\"/\"+r.owner+\"/_git/\"+r.name);break}case\"dev.azure.com\":case\"azure.com\":if(r.resource===\"ssh.dev.azure.com\"){a=r.name.split(\"/\"),a.length===4&&(r.organization=a[1],r.owner=a[2],r.name=a[3]);break}else{a=r.name.split(\"/\"),a.length===5?(r.organization=a[0],r.owner=a[1],r.name=a[4],r.full_name=\"_git/\"+r.name):a.length===3?(r.name=a[2],a[0]===\"DefaultCollection\"?(r.owner=a[2],r.organization=a[0],r.full_name=r.organization+\"/_git/\"+r.name):(r.owner=a[0],r.full_name=r.owner+\"/_git/\"+r.name)):a.length===4&&(r.organization=a[0],r.owner=a[1],r.name=a[3],r.full_name=r.organization+\"/\"+r.owner+\"/_git/\"+r.name),r.query&&r.query.path&&(r.filepath=r.query.path.replace(/^\\/+/g,\"\")),r.query&&r.query.version&&(r.ref=r.query.version.replace(/^GB/,\"\"));break}default:a=r.name.split(\"/\");var n=a.length-1;if(a.length>=2){var c=a.indexOf(\"-\",2),f=a.indexOf(\"blob\",2),p=a.indexOf(\"tree\",2),h=a.indexOf(\"commit\",2),E=a.indexOf(\"src\",2),C=a.indexOf(\"raw\",2),S=a.indexOf(\"edit\",2);n=c>0?c-1:f>0?f-1:p>0?p-1:h>0?h-1:E>0?E-1:C>0?C-1:S>0?S-1:n,r.owner=a.slice(0,n).join(\"/\"),r.name=a[n],h&&(r.commit=a[n+2])}r.ref=\"\",r.filepathtype=\"\",r.filepath=\"\";var b=a.length>n&&a[n+1]===\"-\"?n+1:n;a.length>b+2&&[\"raw\",\"src\",\"blob\",\"tree\",\"edit\"].indexOf(a[b+1])>=0&&(r.filepathtype=a[b+1],r.ref=a[b+2],a.length>b+3&&(r.filepath=a.slice(b+3).join(\"/\"))),r.organization=r.owner;break}r.full_name||(r.full_name=r.owner,r.name&&(r.full_name&&(r.full_name+=\"/\"),r.full_name+=r.name)),r.owner.startsWith(\"scm/\")&&(r.source=\"bitbucket-server\",r.owner=r.owner.replace(\"scm/\",\"\"),r.organization=r.owner,r.full_name=r.owner+\"/\"+r.name);var I=/(projects|users)\\/(.*?)\\/repos\\/(.*?)((\\/.*$)|$)/,T=I.exec(r.pathname);return T!=null&&(r.source=\"bitbucket-server\",T[1]===\"users\"?r.owner=\"~\"+T[2]:r.owner=T[2],r.organization=r.owner,r.name=T[3],a=T[4].split(\"/\"),a.length>1&&([\"raw\",\"browse\"].indexOf(a[1])>=0?(r.filepathtype=a[1],a.length>2&&(r.filepath=a.slice(2).join(\"/\"))):a[1]===\"commits\"&&a.length>2&&(r.commit=a[2])),r.full_name=r.owner+\"/\"+r.name,r.query.at?r.ref=r.query.at:r.ref=\"\"),r}n5.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join(\"+\"):t.protocol);var r=t.port?\":\"+t.port:\"\",s=t.user||\"git\",a=t.git_suffix?\".git\":\"\";switch(e){case\"ssh\":return r?\"ssh://\"+s+\"@\"+t.resource+r+\"/\"+t.full_name+a:s+\"@\"+t.resource+\":\"+t.full_name+a;case\"git+ssh\":case\"ssh+git\":case\"ftp\":case\"ftps\":return e+\"://\"+s+\"@\"+t.resource+r+\"/\"+t.full_name+a;case\"http\":case\"https\":var n=t.token?Ect(t):t.user&&(t.protocols.includes(\"http\")||t.protocols.includes(\"https\"))?t.user+\"@\":\"\";return e+\"://\"+n+t.resource+r+\"/\"+Ict(t)+a;default:return t.href}};function Ect(t){switch(t.source){case\"bitbucket.org\":return\"x-token-auth:\"+t.token+\"@\";default:return t.token+\"@\"}}function Ict(t){switch(t.source){case\"bitbucket-server\":return\"scm/\"+t.full_name;default:return\"\"+t.full_name}}Oye.exports=n5});function Fct(t,e){return e===1&&Tct.has(t[0])}function nS(t){let e=Array.isArray(t)?t:Mu(t);return e.map((s,a)=>Qct.test(s)?`[${s}]`:Rct.test(s)&&!Fct(e,a)?`.${s}`:`[${JSON.stringify(s)}]`).join(\"\").replace(/^\\./,\"\")}function Nct(t,e){let r=[];if(e.methodName!==null&&r.push(he.pretty(t,e.methodName,he.Type.CODE)),e.file!==null){let s=[];s.push(he.pretty(t,e.file,he.Type.PATH)),e.line!==null&&(s.push(he.pretty(t,e.line,he.Type.NUMBER)),e.column!==null&&s.push(he.pretty(t,e.column,he.Type.NUMBER))),r.push(`(${s.join(he.pretty(t,\":\",\"grey\"))})`)}return r.join(\" \")}function nF(t,{manifestUpdates:e,reportedErrors:r},{fix:s}={}){let a=new Map,n=new Map,c=[...r.keys()].map(f=>[f,new Map]);for(let[f,p]of[...c,...e]){let h=r.get(f)?.map(b=>({text:b,fixable:!1}))??[],E=!1,C=t.getWorkspaceByCwd(f),S=C.manifest.exportTo({});for(let[b,I]of p){if(I.size>1){let T=[...I].map(([N,U])=>{let W=he.pretty(t.configuration,N,he.Type.INSPECT),ee=U.size>0?Nct(t.configuration,U.values().next().value):null;return ee!==null?`\n${W} at ${ee}`:`\n${W}`}).join(\"\");h.push({text:`Conflict detected in constraint targeting ${he.pretty(t.configuration,b,he.Type.CODE)}; conflicting values are:${T}`,fixable:!1})}else{let[[T]]=I,N=va(S,b);if(JSON.stringify(N)===JSON.stringify(T))continue;if(!s){let U=typeof N>\"u\"?`Missing field ${he.pretty(t.configuration,b,he.Type.CODE)}; expected ${he.pretty(t.configuration,T,he.Type.INSPECT)}`:typeof T>\"u\"?`Extraneous field ${he.pretty(t.configuration,b,he.Type.CODE)} currently set to ${he.pretty(t.configuration,N,he.Type.INSPECT)}`:`Invalid field ${he.pretty(t.configuration,b,he.Type.CODE)}; expected ${he.pretty(t.configuration,T,he.Type.INSPECT)}, found ${he.pretty(t.configuration,N,he.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof T>\"u\"?A0(S,b):Jd(S,b,T),E=!0}E&&a.set(C,S)}h.length>0&&n.set(C,h)}return{changedWorkspaces:a,remainingErrors:n}}function Zye(t,{configuration:e}){let r={children:[]};for(let[s,a]of t){let n=[];for(let f of a){let p=f.text.split(/\\n/);f.fixable&&(p[0]=`${he.pretty(e,\"\\u2699\",\"gray\")} ${p[0]}`),n.push({value:he.tuple(he.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:he.tuple(he.Type.NO_HINT,h)}))})}let c={value:he.tuple(he.Type.LOCATOR,s.anchoredLocator),children:je.sortMap(n,f=>f.value[1])};r.children.push(c)}return r.children=je.sortMap(r.children,s=>s.value[1]),r}var WC,Qct,Rct,Tct,iS=Ze(()=>{Ge();ql();WC=class{constructor(e){this.indexedFields=e;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let e of this.indexedFields)this.indexes[e]=new Map}insert(e){this.items.push(e);for(let r of this.indexedFields){let s=Object.hasOwn(e,r)?e[r]:void 0;if(typeof s>\"u\")continue;je.getArrayWithDefault(this.indexes[r],s).push(e)}return e}find(e){if(typeof e>\"u\")return this.items;let r=Object.entries(e);if(r.length===0)return this.items;let s=[],a;for(let[c,f]of r){let p=c,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>\"u\"){s.push([p,f]);continue}let E=new Set(h.get(f)??[]);if(E.size===0)return[];if(typeof a>\"u\")a=E;else for(let C of a)E.has(C)||a.delete(C);if(a.size===0)break}let n=[...a??[]];return s.length>0&&(n=n.filter(c=>{for(let[f,p]of s)if(!(typeof p<\"u\"?Object.hasOwn(c,f)&&c[f]===p:Object.hasOwn(c,f)===!1))return!1;return!0})),n}},Qct=/^[0-9]+$/,Rct=/^[a-zA-Z0-9_]+$/,Tct=new Set([\"scripts\",...Ut.allDependencies])});var Xye=_((CYt,m5)=>{var Oct;(function(t){var e=function(){return{\"append/2\":[new t.type.Rule(new t.type.Term(\"append\",[new t.type.Var(\"X\"),new t.type.Var(\"L\")]),new t.type.Term(\"foldl\",[new t.type.Term(\"append\",[]),new t.type.Var(\"X\"),new t.type.Term(\"[]\",[]),new t.type.Var(\"L\")]))],\"append/3\":[new t.type.Rule(new t.type.Term(\"append\",[new t.type.Term(\"[]\",[]),new t.type.Var(\"X\"),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"append\",[new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"S\")])]),new t.type.Term(\"append\",[new t.type.Var(\"T\"),new t.type.Var(\"X\"),new t.type.Var(\"S\")]))],\"member/2\":[new t.type.Rule(new t.type.Term(\"member\",[new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"_\")])]),null),new t.type.Rule(new t.type.Term(\"member\",[new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"_\"),new t.type.Var(\"Xs\")])]),new t.type.Term(\"member\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]))],\"permutation/2\":[new t.type.Rule(new t.type.Term(\"permutation\",[new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"permutation\",[new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"permutation\",[new t.type.Var(\"T\"),new t.type.Var(\"P\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"P\")]),new t.type.Term(\"append\",[new t.type.Var(\"X\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"Y\")]),new t.type.Var(\"S\")])])]))],\"maplist/2\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"X\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"Xs\")])]))],\"maplist/3\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\")])]))],\"maplist/4\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\")])]))],\"maplist/5\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\")])]))],\"maplist/6\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")]),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Es\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\"),new t.type.Var(\"E\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\"),new t.type.Var(\"Es\")])]))],\"maplist/7\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")]),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Es\")]),new t.type.Term(\".\",[new t.type.Var(\"F\"),new t.type.Var(\"Fs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\"),new t.type.Var(\"E\"),new t.type.Var(\"F\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\"),new t.type.Var(\"Es\"),new t.type.Var(\"Fs\")])]))],\"maplist/8\":[new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"A\"),new t.type.Var(\"As\")]),new t.type.Term(\".\",[new t.type.Var(\"B\"),new t.type.Var(\"Bs\")]),new t.type.Term(\".\",[new t.type.Var(\"C\"),new t.type.Var(\"Cs\")]),new t.type.Term(\".\",[new t.type.Var(\"D\"),new t.type.Var(\"Ds\")]),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Es\")]),new t.type.Term(\".\",[new t.type.Var(\"F\"),new t.type.Var(\"Fs\")]),new t.type.Term(\".\",[new t.type.Var(\"G\"),new t.type.Var(\"Gs\")])]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P\"),new t.type.Var(\"A\"),new t.type.Var(\"B\"),new t.type.Var(\"C\"),new t.type.Var(\"D\"),new t.type.Var(\"E\"),new t.type.Var(\"F\"),new t.type.Var(\"G\")]),new t.type.Term(\"maplist\",[new t.type.Var(\"P\"),new t.type.Var(\"As\"),new t.type.Var(\"Bs\"),new t.type.Var(\"Cs\"),new t.type.Var(\"Ds\"),new t.type.Var(\"Es\"),new t.type.Var(\"Fs\"),new t.type.Var(\"Gs\")])]))],\"include/3\":[new t.type.Rule(new t.type.Term(\"include\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"include\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"L\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P\"),new t.type.Var(\"A\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"A\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"B\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"F\"),new t.type.Var(\"B\")]),new t.type.Term(\",\",[new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"F\")]),new t.type.Term(\",\",[new t.type.Term(\"=\",[new t.type.Var(\"L\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"S\")])]),new t.type.Term(\"!\",[])])]),new t.type.Term(\"=\",[new t.type.Var(\"L\"),new t.type.Var(\"S\")])]),new t.type.Term(\"include\",[new t.type.Var(\"P\"),new t.type.Var(\"T\"),new t.type.Var(\"S\")])])])])]))],\"exclude/3\":[new t.type.Rule(new t.type.Term(\"exclude\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Term(\"[]\",[])]),null),new t.type.Rule(new t.type.Term(\"exclude\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"exclude\",[new t.type.Var(\"P\"),new t.type.Var(\"T\"),new t.type.Var(\"E\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P\"),new t.type.Var(\"L\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"L\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"Q\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"R\"),new t.type.Var(\"Q\")]),new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"R\")]),new t.type.Term(\",\",[new t.type.Term(\"!\",[]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"E\")])])]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"E\")])])])])])])]))],\"foldl/4\":[new t.type.Rule(new t.type.Term(\"foldl\",[new t.type.Var(\"_\"),new t.type.Term(\"[]\",[]),new t.type.Var(\"I\"),new t.type.Var(\"I\")]),null),new t.type.Rule(new t.type.Term(\"foldl\",[new t.type.Var(\"P\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Var(\"T\")]),new t.type.Var(\"I\"),new t.type.Var(\"R\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P\"),new t.type.Var(\"L\")]),new t.type.Term(\",\",[new t.type.Term(\"append\",[new t.type.Var(\"L\"),new t.type.Term(\".\",[new t.type.Var(\"I\"),new t.type.Term(\".\",[new t.type.Var(\"H\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])])])]),new t.type.Var(\"L2\")]),new t.type.Term(\",\",[new t.type.Term(\"=..\",[new t.type.Var(\"P2\"),new t.type.Var(\"L2\")]),new t.type.Term(\",\",[new t.type.Term(\"call\",[new t.type.Var(\"P2\")]),new t.type.Term(\"foldl\",[new t.type.Var(\"P\"),new t.type.Var(\"T\"),new t.type.Var(\"X\"),new t.type.Var(\"R\")])])])])]))],\"select/3\":[new t.type.Rule(new t.type.Term(\"select\",[new t.type.Var(\"E\"),new t.type.Term(\".\",[new t.type.Var(\"E\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"Xs\")]),null),new t.type.Rule(new t.type.Term(\"select\",[new t.type.Var(\"E\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Ys\")])]),new t.type.Term(\"select\",[new t.type.Var(\"E\"),new t.type.Var(\"Xs\"),new t.type.Var(\"Ys\")]))],\"sum_list/2\":[new t.type.Rule(new t.type.Term(\"sum_list\",[new t.type.Term(\"[]\",[]),new t.type.Num(0,!1)]),null),new t.type.Rule(new t.type.Term(\"sum_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"sum_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\"is\",[new t.type.Var(\"S\"),new t.type.Term(\"+\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")])])]))],\"max_list/2\":[new t.type.Rule(new t.type.Term(\"max_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"max_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"max_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\">=\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")]),new t.type.Term(\",\",[new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"X\")]),new t.type.Term(\"!\",[])])]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"Y\")])])]))],\"min_list/2\":[new t.type.Rule(new t.type.Term(\"min_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"min_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"min_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\";\",[new t.type.Term(\",\",[new t.type.Term(\"=<\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")]),new t.type.Term(\",\",[new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"X\")]),new t.type.Term(\"!\",[])])]),new t.type.Term(\"=\",[new t.type.Var(\"S\"),new t.type.Var(\"Y\")])])]))],\"prod_list/2\":[new t.type.Rule(new t.type.Term(\"prod_list\",[new t.type.Term(\"[]\",[]),new t.type.Num(1,!1)]),null),new t.type.Rule(new t.type.Term(\"prod_list\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"S\")]),new t.type.Term(\",\",[new t.type.Term(\"prod_list\",[new t.type.Var(\"Xs\"),new t.type.Var(\"Y\")]),new t.type.Term(\"is\",[new t.type.Var(\"S\"),new t.type.Term(\"*\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\")])])]))],\"last/2\":[new t.type.Rule(new t.type.Term(\"last\",[new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Term(\"[]\",[])]),new t.type.Var(\"X\")]),null),new t.type.Rule(new t.type.Term(\"last\",[new t.type.Term(\".\",[new t.type.Var(\"_\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"X\")]),new t.type.Term(\"last\",[new t.type.Var(\"Xs\"),new t.type.Var(\"X\")]))],\"prefix/2\":[new t.type.Rule(new t.type.Term(\"prefix\",[new t.type.Var(\"Part\"),new t.type.Var(\"Whole\")]),new t.type.Term(\"append\",[new t.type.Var(\"Part\"),new t.type.Var(\"_\"),new t.type.Var(\"Whole\")]))],\"nth0/3\":[new t.type.Rule(new t.type.Term(\"nth0\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")])]),new t.type.Term(\",\",[new t.type.Term(\">=\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")]),new t.type.Term(\"!\",[])])])]))],\"nth1/3\":[new t.type.Rule(new t.type.Term(\"nth1\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")])]),new t.type.Term(\",\",[new t.type.Term(\">\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"_\")]),new t.type.Term(\"!\",[])])])]))],\"nth0/4\":[new t.type.Rule(new t.type.Term(\"nth0\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")])]),new t.type.Term(\",\",[new t.type.Term(\">=\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(0,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\"!\",[])])])]))],\"nth1/4\":[new t.type.Rule(new t.type.Term(\"nth1\",[new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\";\",[new t.type.Term(\"->\",[new t.type.Term(\"var\",[new t.type.Var(\"X\")]),new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")])]),new t.type.Term(\",\",[new t.type.Term(\">\",[new t.type.Var(\"X\"),new t.type.Num(0,!1)]),new t.type.Term(\",\",[new t.type.Term(\"nth\",[new t.type.Num(1,!1),new t.type.Var(\"X\"),new t.type.Var(\"Y\"),new t.type.Var(\"Z\"),new t.type.Var(\"W\")]),new t.type.Term(\"!\",[])])])]))],\"nth/5\":[new t.type.Rule(new t.type.Term(\"nth\",[new t.type.Var(\"N\"),new t.type.Var(\"N\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),null),new t.type.Rule(new t.type.Term(\"nth\",[new t.type.Var(\"N\"),new t.type.Var(\"O\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Xs\")]),new t.type.Var(\"Y\"),new t.type.Term(\".\",[new t.type.Var(\"X\"),new t.type.Var(\"Ys\")])]),new t.type.Term(\",\",[new t.type.Term(\"is\",[new t.type.Var(\"M\"),new t.type.Term(\"+\",[new t.type.Var(\"N\"),new t.type.Num(1,!1)])]),new t.type.Term(\"nth\",[new t.type.Var(\"M\"),new t.type.Var(\"O\"),new t.type.Var(\"Xs\"),new t.type.Var(\"Y\"),new t.type.Var(\"Ys\")])]))],\"length/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(!t.type.is_variable(f)&&!t.type.is_integer(f))s.throw_error(t.error.type(\"integer\",f,n.indicator));else if(t.type.is_integer(f)&&f.value<0)s.throw_error(t.error.domain(\"not_less_than_zero\",f,n.indicator));else{var p=new t.type.Term(\"length\",[c,new t.type.Num(0,!1),f]);t.type.is_integer(f)&&(p=new t.type.Term(\",\",[p,new t.type.Term(\"!\",[])])),s.prepend([new t.type.State(a.goal.replace(p),a.substitution,a)])}},\"length/3\":[new t.type.Rule(new t.type.Term(\"length\",[new t.type.Term(\"[]\",[]),new t.type.Var(\"N\"),new t.type.Var(\"N\")]),null),new t.type.Rule(new t.type.Term(\"length\",[new t.type.Term(\".\",[new t.type.Var(\"_\"),new t.type.Var(\"X\")]),new t.type.Var(\"A\"),new t.type.Var(\"N\")]),new t.type.Term(\",\",[new t.type.Term(\"succ\",[new t.type.Var(\"A\"),new t.type.Var(\"B\")]),new t.type.Term(\"length\",[new t.type.Var(\"X\"),new t.type.Var(\"B\"),new t.type.Var(\"N\")])]))],\"replicate/3\":function(s,a,n){var c=n.args[0],f=n.args[1],p=n.args[2];if(t.type.is_variable(f))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_integer(f))s.throw_error(t.error.type(\"integer\",f,n.indicator));else if(f.value<0)s.throw_error(t.error.domain(\"not_less_than_zero\",f,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))s.throw_error(t.error.type(\"list\",p,n.indicator));else{for(var h=new t.type.Term(\"[]\"),E=0;E<f.value;E++)h=new t.type.Term(\".\",[c,h]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[h,p])),a.substitution,a)])}},\"sort/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else{for(var p=[],h=c;h.indicator===\"./2\";)p.push(h.args[0]),h=h.args[1];if(t.type.is_variable(h))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(h))s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var E=p.sort(t.compare),C=E.length-1;C>0;C--)E[C].equals(E[C-1])&&E.splice(C,1);for(var S=new t.type.Term(\"[]\"),C=E.length-1;C>=0;C--)S=new t.type.Term(\".\",[E[C],S]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[S,f])),a.substitution,a)])}}},\"msort/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else{for(var p=[],h=c;h.indicator===\"./2\";)p.push(h.args[0]),h=h.args[1];if(t.type.is_variable(h))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(h))s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var E=p.sort(t.compare),C=new t.type.Term(\"[]\"),S=E.length-1;S>=0;S--)C=new t.type.Term(\".\",[E[S],C]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[C,f])),a.substitution,a)])}}},\"keysort/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else{for(var p=[],h,E=c;E.indicator===\"./2\";){if(h=E.args[0],t.type.is_variable(h)){s.throw_error(t.error.instantiation(n.indicator));return}else if(!t.type.is_term(h)||h.indicator!==\"-/2\"){s.throw_error(t.error.type(\"pair\",h,n.indicator));return}h.args[0].pair=h.args[1],p.push(h.args[0]),E=E.args[1]}if(t.type.is_variable(E))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(E))s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var C=p.sort(t.compare),S=new t.type.Term(\"[]\"),b=C.length-1;b>=0;b--)S=new t.type.Term(\".\",[new t.type.Term(\"-\",[C[b],C[b].pair]),S]),delete C[b].pair;s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[S,f])),a.substitution,a)])}}},\"take/3\":function(s,a,n){var c=n.args[0],f=n.args[1],p=n.args[2];if(t.type.is_variable(f)||t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else if(!t.type.is_integer(c))s.throw_error(t.error.type(\"integer\",c,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))s.throw_error(t.error.type(\"list\",p,n.indicator));else{for(var h=c.value,E=[],C=f;h>0&&C.indicator===\"./2\";)E.push(C.args[0]),C=C.args[1],h--;if(h===0){for(var S=new t.type.Term(\"[]\"),h=E.length-1;h>=0;h--)S=new t.type.Term(\".\",[E[h],S]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[S,p])),a.substitution,a)])}}},\"drop/3\":function(s,a,n){var c=n.args[0],f=n.args[1],p=n.args[2];if(t.type.is_variable(f)||t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else if(!t.type.is_integer(c))s.throw_error(t.error.type(\"integer\",c,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))s.throw_error(t.error.type(\"list\",p,n.indicator));else{for(var h=c.value,E=[],C=f;h>0&&C.indicator===\"./2\";)E.push(C.args[0]),C=C.args[1],h--;h===0&&s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[C,p])),a.substitution,a)])}},\"reverse/2\":function(s,a,n){var c=n.args[0],f=n.args[1],p=t.type.is_instantiated_list(c),h=t.type.is_instantiated_list(f);if(t.type.is_variable(c)&&t.type.is_variable(f))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(c)&&!t.type.is_fully_list(c))s.throw_error(t.error.type(\"list\",c,n.indicator));else if(!t.type.is_variable(f)&&!t.type.is_fully_list(f))s.throw_error(t.error.type(\"list\",f,n.indicator));else if(!p&&!h)s.throw_error(t.error.instantiation(n.indicator));else{for(var E=p?c:f,C=new t.type.Term(\"[]\",[]);E.indicator===\"./2\";)C=new t.type.Term(\".\",[E.args[0],C]),E=E.args[1];s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[C,p?f:c])),a.substitution,a)])}},\"list_to_set/2\":function(s,a,n){var c=n.args[0],f=n.args[1];if(t.type.is_variable(c))s.throw_error(t.error.instantiation(n.indicator));else{for(var p=c,h=[];p.indicator===\"./2\";)h.push(p.args[0]),p=p.args[1];if(t.type.is_variable(p))s.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_term(p)||p.indicator!==\"[]/0\")s.throw_error(t.error.type(\"list\",c,n.indicator));else{for(var E=[],C=new t.type.Term(\"[]\",[]),S,b=0;b<h.length;b++){S=!1;for(var I=0;I<E.length&&!S;I++)S=t.compare(h[b],E[I])===0;S||E.push(h[b])}for(b=E.length-1;b>=0;b--)C=new t.type.Term(\".\",[E[b],C]);s.prepend([new t.type.State(a.goal.replace(new t.type.Term(\"=\",[f,C])),a.substitution,a)])}}}}},r=[\"append/2\",\"append/3\",\"member/2\",\"permutation/2\",\"maplist/2\",\"maplist/3\",\"maplist/4\",\"maplist/5\",\"maplist/6\",\"maplist/7\",\"maplist/8\",\"include/3\",\"exclude/3\",\"foldl/4\",\"sum_list/2\",\"max_list/2\",\"min_list/2\",\"prod_list/2\",\"last/2\",\"prefix/2\",\"nth0/3\",\"nth1/3\",\"nth0/4\",\"nth1/4\",\"length/2\",\"replicate/3\",\"select/3\",\"sort/2\",\"msort/2\",\"keysort/2\",\"take/3\",\"drop/3\",\"reverse/2\",\"list_to_set/2\"];typeof m5<\"u\"?m5.exports=function(s){t=s,new t.type.Module(\"lists\",e(),r)}:new t.type.Module(\"lists\",e(),r)})(Oct)});var pEe=_($r=>{\"use strict\";var Pm=process.platform===\"win32\",y5=\"aes-256-cbc\",Lct=\"sha256\",tEe=\"The current environment doesn't support interactive reading from TTY.\",si=Ie(\"fs\"),$ye=process.binding(\"tty_wrap\").TTY,I5=Ie(\"child_process\"),V0=Ie(\"path\"),C5={prompt:\"> \",hideEchoBack:!1,mask:\"*\",limit:[],limitMessage:\"Input another, please.$<( [)limit(])>\",defaultInput:\"\",trueValue:[],falseValue:[],caseSensitive:!1,keepWhitespace:!1,encoding:\"utf8\",bufferSize:1024,print:void 0,history:!0,cd:!1,phContent:void 0,preCheck:void 0},Zp=\"none\",Xu,VC,eEe=!1,Y0,sF,E5,Mct=0,D5=\"\",Dm=[],oF,rEe=!1,w5=!1,sS=!1;function nEe(t){function e(r){return r.replace(/[^\\w\\u0080-\\uFFFF]/g,function(s){return\"#\"+s.charCodeAt(0)+\";\"})}return sF.concat(function(r){var s=[];return Object.keys(r).forEach(function(a){r[a]===\"boolean\"?t[a]&&s.push(\"--\"+a):r[a]===\"string\"&&t[a]&&s.push(\"--\"+a,e(t[a]))}),s}({display:\"string\",displayOnly:\"boolean\",keyIn:\"boolean\",hideEchoBack:\"boolean\",mask:\"string\",limit:\"string\",caseSensitive:\"boolean\"}))}function Uct(t,e){function r(U){var W,ee=\"\",ie;for(E5=E5||Ie(\"os\").tmpdir();;){W=V0.join(E5,U+ee);try{ie=si.openSync(W,\"wx\")}catch(ue){if(ue.code===\"EEXIST\"){ee++;continue}else throw ue}si.closeSync(ie);break}return W}var s,a,n,c={},f,p,h=r(\"readline-sync.stdout\"),E=r(\"readline-sync.stderr\"),C=r(\"readline-sync.exit\"),S=r(\"readline-sync.done\"),b=Ie(\"crypto\"),I,T,N;I=b.createHash(Lct),I.update(\"\"+process.pid+Mct+++Math.random()),N=I.digest(\"hex\"),T=b.createDecipher(y5,N),s=nEe(t),Pm?(a=process.env.ComSpec||\"cmd.exe\",process.env.Q='\"',n=[\"/V:ON\",\"/S\",\"/C\",\"(%Q%\"+a+\"%Q% /V:ON /S /C %Q%%Q%\"+Y0+\"%Q%\"+s.map(function(U){return\" %Q%\"+U+\"%Q%\"}).join(\"\")+\" & (echo !ERRORLEVEL!)>%Q%\"+C+\"%Q%%Q%) 2>%Q%\"+E+\"%Q% |%Q%\"+process.execPath+\"%Q% %Q%\"+__dirname+\"\\\\encrypt.js%Q% %Q%\"+y5+\"%Q% %Q%\"+N+\"%Q% >%Q%\"+h+\"%Q% & (echo 1)>%Q%\"+S+\"%Q%\"]):(a=\"/bin/sh\",n=[\"-c\",'(\"'+Y0+'\"'+s.map(function(U){return\" '\"+U.replace(/'/g,\"'\\\\''\")+\"'\"}).join(\"\")+'; echo $?>\"'+C+'\") 2>\"'+E+'\" |\"'+process.execPath+'\" \"'+__dirname+'/encrypt.js\" \"'+y5+'\" \"'+N+'\" >\"'+h+'\"; echo 1 >\"'+S+'\"']),sS&&sS(\"_execFileSync\",s);try{I5.spawn(a,n,e)}catch(U){c.error=new Error(U.message),c.error.method=\"_execFileSync - spawn\",c.error.program=a,c.error.args=n}for(;si.readFileSync(S,{encoding:t.encoding}).trim()!==\"1\";);return(f=si.readFileSync(C,{encoding:t.encoding}).trim())===\"0\"?c.input=T.update(si.readFileSync(h,{encoding:\"binary\"}),\"hex\",t.encoding)+T.final(t.encoding):(p=si.readFileSync(E,{encoding:t.encoding}).trim(),c.error=new Error(tEe+(p?`\n`+p:\"\")),c.error.method=\"_execFileSync\",c.error.program=a,c.error.args=n,c.error.extMessage=p,c.error.exitCode=+f),si.unlinkSync(h),si.unlinkSync(E),si.unlinkSync(C),si.unlinkSync(S),c}function _ct(t){var e,r={},s,a={env:process.env,encoding:t.encoding};if(Y0||(Pm?process.env.PSModulePath?(Y0=\"powershell.exe\",sF=[\"-ExecutionPolicy\",\"Bypass\",\"-File\",__dirname+\"\\\\read.ps1\"]):(Y0=\"cscript.exe\",sF=[\"//nologo\",__dirname+\"\\\\read.cs.js\"]):(Y0=\"/bin/sh\",sF=[__dirname+\"/read.sh\"])),Pm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),I5.execFileSync){e=nEe(t),sS&&sS(\"execFileSync\",e);try{r.input=I5.execFileSync(Y0,e,a)}catch(n){s=n.stderr?(n.stderr+\"\").trim():\"\",r.error=new Error(tEe+(s?`\n`+s:\"\")),r.error.method=\"execFileSync\",r.error.program=Y0,r.error.args=e,r.error.extMessage=s,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=Uct(t,a);return r.error||(r.input=r.input.replace(/^\\s*'|'\\s*$/g,\"\"),t.display=\"\"),r}function B5(t){var e=\"\",r=t.display,s=!t.display&&t.keyIn&&t.hideEchoBack&&!t.mask;function a(){var n=_ct(t);if(n.error)throw n.error;return n.input}return w5&&w5(t),function(){var n,c,f;function p(){return n||(n=process.binding(\"fs\"),c=process.binding(\"constants\")),n}if(typeof Zp==\"string\")if(Zp=null,Pm){if(f=function(h){var E=h.replace(/^\\D+/,\"\").split(\".\"),C=0;return(E[0]=+E[0])&&(C+=E[0]*1e4),(E[1]=+E[1])&&(C+=E[1]*100),(E[2]=+E[2])&&(C+=E[2]),C}(process.version),!(f>=20302&&f<40204||f>=5e4&&f<50100||f>=50600&&f<60200)&&process.stdin.isTTY)process.stdin.pause(),Zp=process.stdin.fd,VC=process.stdin._handle;else try{Zp=p().open(\"CONIN$\",c.O_RDWR,parseInt(\"0666\",8)),VC=new $ye(Zp,!0)}catch{}if(process.stdout.isTTY)Xu=process.stdout.fd;else{try{Xu=si.openSync(\"\\\\\\\\.\\\\CON\",\"w\")}catch{}if(typeof Xu!=\"number\")try{Xu=p().open(\"CONOUT$\",c.O_RDWR,parseInt(\"0666\",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{Zp=si.openSync(\"/dev/tty\",\"r\"),VC=process.stdin._handle}catch{}}else try{Zp=si.openSync(\"/dev/tty\",\"r\"),VC=new $ye(Zp,!1)}catch{}if(process.stdout.isTTY)Xu=process.stdout.fd;else try{Xu=si.openSync(\"/dev/tty\",\"w\")}catch{}}}(),function(){var n,c,f=!t.hideEchoBack&&!t.keyIn,p,h,E,C,S;oF=\"\";function b(I){return I===eEe?!0:VC.setRawMode(I)!==0?!1:(eEe=I,!0)}if(rEe||!VC||typeof Xu!=\"number\"&&(t.display||!f)){e=a();return}if(t.display&&(si.writeSync(Xu,t.display),t.display=\"\"),!t.displayOnly){if(!b(!f)){e=a();return}for(h=t.keyIn?1:t.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),t.keyIn&&t.limit&&(c=new RegExp(\"[^\"+t.limit+\"]\",\"g\"+(t.caseSensitive?\"\":\"i\")));;){E=0;try{E=si.readSync(Zp,p,0,h)}catch(I){if(I.code!==\"EOF\"){b(!1),e+=a();return}}if(E>0?(C=p.toString(t.encoding,0,E),oF+=C):(C=`\n`,oF+=\"\\0\"),C&&typeof(S=(C.match(/^(.*?)[\\r\\n]/)||[])[1])==\"string\"&&(C=S,n=!0),C&&(C=C.replace(/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/g,\"\")),C&&c&&(C=C.replace(c,\"\")),C&&(f||(t.hideEchoBack?t.mask&&si.writeSync(Xu,new Array(C.length+1).join(t.mask)):si.writeSync(Xu,C)),e+=C),!t.keyIn&&n||t.keyIn&&e.length>=h)break}!f&&!s&&si.writeSync(Xu,`\n`),b(!1)}}(),t.print&&!s&&t.print(r+(t.displayOnly?\"\":(t.hideEchoBack?new Array(e.length+1).join(t.mask):e)+`\n`),t.encoding),t.displayOnly?\"\":D5=t.keepWhitespace||t.keyIn?e:e.trim()}function Hct(t,e){var r=[];function s(a){a!=null&&(Array.isArray(a)?a.forEach(s):(!e||e(a))&&r.push(a))}return s(t),r}function P5(t){return t.replace(/[\\x00-\\x7f]/g,function(e){return\"\\\\x\"+(\"00\"+e.charCodeAt().toString(16)).substr(-2)})}function Vs(){var t=Array.prototype.slice.call(arguments),e,r;return t.length&&typeof t[0]==\"boolean\"&&(r=t.shift(),r&&(e=Object.keys(C5),t.unshift(C5))),t.reduce(function(s,a){return a==null||(a.hasOwnProperty(\"noEchoBack\")&&!a.hasOwnProperty(\"hideEchoBack\")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty(\"noTrim\")&&!a.hasOwnProperty(\"keepWhitespace\")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(e=Object.keys(a)),e.forEach(function(n){var c;if(a.hasOwnProperty(n))switch(c=a[n],n){case\"mask\":case\"limitMessage\":case\"defaultInput\":case\"encoding\":c=c!=null?c+\"\":\"\",c&&n!==\"limitMessage\"&&(c=c.replace(/[\\r\\n]/g,\"\")),s[n]=c;break;case\"bufferSize\":!isNaN(c=parseInt(c,10))&&typeof c==\"number\"&&(s[n]=c);break;case\"displayOnly\":case\"keyIn\":case\"hideEchoBack\":case\"caseSensitive\":case\"keepWhitespace\":case\"history\":case\"cd\":s[n]=!!c;break;case\"limit\":case\"trueValue\":case\"falseValue\":s[n]=Hct(c,function(f){var p=typeof f;return p===\"string\"||p===\"number\"||p===\"function\"||f instanceof RegExp}).map(function(f){return typeof f==\"string\"?f.replace(/[\\r\\n]/g,\"\"):f});break;case\"print\":case\"phContent\":case\"preCheck\":s[n]=typeof c==\"function\"?c:void 0;break;case\"prompt\":case\"display\":s[n]=c??\"\";break}})),s},{})}function v5(t,e,r){return e.some(function(s){var a=typeof s;return a===\"string\"?r?t===s:t.toLowerCase()===s.toLowerCase():a===\"number\"?parseFloat(t)===s:a===\"function\"?s(t):s instanceof RegExp?s.test(t):!1})}function b5(t,e){var r=V0.normalize(Pm?(process.env.HOMEDRIVE||\"\")+(process.env.HOMEPATH||\"\"):process.env.HOME||\"\").replace(/[\\/\\\\]+$/,\"\");return t=V0.normalize(t),e?t.replace(/^~(?=\\/|\\\\|$)/,r):t.replace(new RegExp(\"^\"+P5(r)+\"(?=\\\\/|\\\\\\\\|$)\",Pm?\"i\":\"\"),\"~\")}function JC(t,e){var r=\"(?:\\\\(([\\\\s\\\\S]*?)\\\\))?(\\\\w+|.-.)(?:\\\\(([\\\\s\\\\S]*?)\\\\))?\",s=new RegExp(\"(\\\\$)?(\\\\$<\"+r+\">)\",\"g\"),a=new RegExp(\"(\\\\$)?(\\\\$\\\\{\"+r+\"\\\\})\",\"g\");function n(c,f,p,h,E,C){var S;return f||typeof(S=e(E))!=\"string\"?p:S?(h||\"\")+S+(C||\"\"):\"\"}return t.replace(s,n).replace(a,n)}function iEe(t,e,r){var s,a=[],n=-1,c=0,f=\"\",p;function h(E,C){return C.length>3?(E.push(C[0]+\"...\"+C[C.length-1]),p=!0):C.length&&(E=E.concat(C)),E}return s=t.reduce(function(E,C){return E.concat((C+\"\").split(\"\"))},[]).reduce(function(E,C){var S,b;return e||(C=C.toLowerCase()),S=/^\\d$/.test(C)?1:/^[A-Z]$/.test(C)?2:/^[a-z]$/.test(C)?3:0,r&&S===0?f+=C:(b=C.charCodeAt(0),S&&S===n&&b===c+1?a.push(C):(E=h(E,a),a=[C],n=S),c=b),E},[]),s=h(s,a),f&&(s.push(f),p=!0),{values:s,suppressed:p}}function sEe(t,e){return t.join(t.length>2?\", \":e?\" / \":\"/\")}function oEe(t,e){var r,s,a={},n;if(e.phContent&&(r=e.phContent(t,e)),typeof r!=\"string\")switch(t){case\"hideEchoBack\":case\"mask\":case\"defaultInput\":case\"caseSensitive\":case\"keepWhitespace\":case\"encoding\":case\"bufferSize\":case\"history\":case\"cd\":r=e.hasOwnProperty(t)?typeof e[t]==\"boolean\"?e[t]?\"on\":\"off\":e[t]+\"\":\"\";break;case\"limit\":case\"trueValue\":case\"falseValue\":s=e[e.hasOwnProperty(t+\"Src\")?t+\"Src\":t],e.keyIn?(a=iEe(s,e.caseSensitive),s=a.values):s=s.filter(function(c){var f=typeof c;return f===\"string\"||f===\"number\"}),r=sEe(s,a.suppressed);break;case\"limitCount\":case\"limitCountNotZero\":r=e[e.hasOwnProperty(\"limitSrc\")?\"limitSrc\":\"limit\"].length,r=r||t!==\"limitCountNotZero\"?r+\"\":\"\";break;case\"lastInput\":r=D5;break;case\"cwd\":case\"CWD\":case\"cwdHome\":r=process.cwd(),t===\"CWD\"?r=V0.basename(r):t===\"cwdHome\"&&(r=b5(r));break;case\"date\":case\"time\":case\"localeDate\":case\"localeTime\":r=new Date()[\"to\"+t.replace(/^./,function(c){return c.toUpperCase()})+\"String\"]();break;default:typeof(n=(t.match(/^history_m(\\d+)$/)||[])[1])==\"string\"&&(r=Dm[Dm.length-n]||\"\")}return r}function aEe(t){var e=/^(.)-(.)$/.exec(t),r=\"\",s,a,n,c;if(!e)return null;for(s=e[1].charCodeAt(0),a=e[2].charCodeAt(0),c=s<a?1:-1,n=s;n!==a+c;n+=c)r+=String.fromCharCode(n);return r}function S5(t){var e=new RegExp(/(\\s*)(?:(\"|')(.*?)(?:\\2|$)|(\\S+))/g),r,s=\"\",a=[],n;for(t=t.trim();r=e.exec(t);)n=r[3]||r[4]||\"\",r[1]&&(a.push(s),s=\"\"),s+=n;return s&&a.push(s),a}function lEe(t,e){return e.trueValue.length&&v5(t,e.trueValue,e.caseSensitive)?!0:e.falseValue.length&&v5(t,e.falseValue,e.caseSensitive)?!1:t}function cEe(t){var e,r,s,a,n,c,f;function p(E){return oEe(E,t)}function h(E){t.display+=(/[^\\r\\n]$/.test(t.display)?`\n`:\"\")+E}for(t.limitSrc=t.limit,t.displaySrc=t.display,t.limit=\"\",t.display=JC(t.display+\"\",p);;){if(e=B5(t),r=!1,s=\"\",t.defaultInput&&!e&&(e=t.defaultInput),t.history&&((a=/^\\s*\\!(?:\\!|-1)(:p)?\\s*$/.exec(e))?(n=Dm[0]||\"\",a[1]?r=!0:e=n,h(n+`\n`),r||(t.displayOnly=!0,B5(t),t.displayOnly=!1)):e&&e!==Dm[Dm.length-1]&&(Dm=[e])),!r&&t.cd&&e)switch(c=S5(e),c[0].toLowerCase()){case\"cd\":if(c[1])try{process.chdir(b5(c[1],!0))}catch(E){h(E+\"\")}r=!0;break;case\"pwd\":h(process.cwd()),r=!0;break}if(!r&&t.preCheck&&(f=t.preCheck(e,t),e=f.res,f.forceNext&&(r=!0)),!r){if(!t.limitSrc.length||v5(e,t.limitSrc,t.caseSensitive))break;t.limitMessage&&(s=JC(t.limitMessage,p))}h((s?s+`\n`:\"\")+JC(t.displaySrc+\"\",p))}return lEe(e,t)}$r._DBG_set_useExt=function(t){rEe=t};$r._DBG_set_checkOptions=function(t){w5=t};$r._DBG_set_checkMethod=function(t){sS=t};$r._DBG_clearHistory=function(){D5=\"\",Dm=[]};$r.setDefaultOptions=function(t){return C5=Vs(!0,t),Vs(!0)};$r.question=function(t,e){return cEe(Vs(Vs(!0,e),{display:t}))};$r.prompt=function(t){var e=Vs(!0,t);return e.display=e.prompt,cEe(e)};$r.keyIn=function(t,e){var r=Vs(Vs(!0,e),{display:t,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(s){var a=typeof s;return a===\"string\"||a===\"number\"}).map(function(s){return JC(s+\"\",aEe)}),r.limit=P5(r.limitSrc.join(\"\")),[\"trueValue\",\"falseValue\"].forEach(function(s){r[s]=r[s].reduce(function(a,n){var c=typeof n;return c===\"string\"||c===\"number\"?a=a.concat((n+\"\").split(\"\")):a.push(n),a},[])}),r.display=JC(r.display+\"\",function(s){return oEe(s,r)}),lEe(B5(r),r)};$r.questionEMail=function(t,e){return t==null&&(t=\"Input e-mail address: \"),$r.question(t,Vs({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:\"Input valid e-mail address, please.\",trueValue:null,falseValue:null},e,{keepWhitespace:!1,cd:!1}))};$r.questionNewPassword=function(t,e){var r,s,a,n=Vs({hideEchoBack:!0,mask:\"*\",limitMessage:`It can include: $<charlist>\nAnd the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},e,{history:!1,cd:!1,phContent:function(b){return b===\"charlist\"?r.text:b===\"length\"?s+\"...\"+a:null}}),c,f,p,h,E,C,S;for(e=e||{},c=JC(e.charlist?e.charlist+\"\":\"$<!-~>\",aEe),(isNaN(s=parseInt(e.min,10))||typeof s!=\"number\")&&(s=12),(isNaN(a=parseInt(e.max,10))||typeof a!=\"number\")&&(a=24),h=new RegExp(\"^[\"+P5(c)+\"]{\"+s+\",\"+a+\"}$\"),r=iEe([c],n.caseSensitive,!0),r.text=sEe(r.values,r.suppressed),f=e.confirmMessage!=null?e.confirmMessage:\"Reinput a same one to confirm it: \",p=e.unmatchMessage!=null?e.unmatchMessage:\"It differs from first one. Hit only the Enter key if you want to retry from first one.\",t==null&&(t=\"Input new password: \"),E=n.limitMessage;!S;)n.limit=h,n.limitMessage=E,C=$r.question(t,n),n.limit=[C,\"\"],n.limitMessage=p,S=$r.question(f,n);return C};function uEe(t,e,r){var s;function a(n){return s=r(n),!isNaN(s)&&typeof s==\"number\"}return $r.question(t,Vs({limitMessage:\"Input valid number, please.\"},e,{limit:a,cd:!1})),s}$r.questionInt=function(t,e){return uEe(t,e,function(r){return parseInt(r,10)})};$r.questionFloat=function(t,e){return uEe(t,e,parseFloat)};$r.questionPath=function(t,e){var r,s=\"\",a=Vs({hideEchoBack:!1,limitMessage:`$<error(\n)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},e,{keepWhitespace:!1,limit:function(n){var c,f,p;n=b5(n,!0),s=\"\";function h(E){E.split(/\\/|\\\\/).reduce(function(C,S){var b=V0.resolve(C+=S+V0.sep);if(!si.existsSync(b))si.mkdirSync(b);else if(!si.statSync(b).isDirectory())throw new Error(\"Non directory already exists: \"+b);return C},\"\")}try{if(c=si.existsSync(n),r=c?si.realpathSync(n):V0.resolve(n),!e.hasOwnProperty(\"exists\")&&!c||typeof e.exists==\"boolean\"&&e.exists!==c)return s=(c?\"Already exists\":\"No such file or directory\")+\": \"+r,!1;if(!c&&e.create&&(e.isDirectory?h(r):(h(V0.dirname(r)),si.closeSync(si.openSync(r,\"w\"))),r=si.realpathSync(r)),c&&(e.min||e.max||e.isFile||e.isDirectory)){if(f=si.statSync(r),e.isFile&&!f.isFile())return s=\"Not file: \"+r,!1;if(e.isDirectory&&!f.isDirectory())return s=\"Not directory: \"+r,!1;if(e.min&&f.size<+e.min||e.max&&f.size>+e.max)return s=\"Size \"+f.size+\" is out of range: \"+r,!1}if(typeof e.validate==\"function\"&&(p=e.validate(r))!==!0)return typeof p==\"string\"&&(s=p),!1}catch(E){return s=E+\"\",!1}return!0},phContent:function(n){return n===\"error\"?s:n!==\"min\"&&n!==\"max\"?null:e.hasOwnProperty(n)?e[n]+\"\":\"\"}});return e=e||{},t==null&&(t='Input path (you can \"cd\" and \"pwd\"): '),$r.question(t,a),r};function fEe(t,e){var r={},s={};return typeof t==\"object\"?(Object.keys(t).forEach(function(a){typeof t[a]==\"function\"&&(s[e.caseSensitive?a:a.toLowerCase()]=t[a])}),r.preCheck=function(a){var n;return r.args=S5(a),n=r.args[0]||\"\",e.caseSensitive||(n=n.toLowerCase()),r.hRes=n!==\"_\"&&s.hasOwnProperty(n)?s[n].apply(a,r.args.slice(1)):s.hasOwnProperty(\"_\")?s._.apply(a,r.args):null,{res:a,forceNext:!1}},s.hasOwnProperty(\"_\")||(r.limit=function(){var a=r.args[0]||\"\";return e.caseSensitive||(a=a.toLowerCase()),s.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=S5(a),r.hRes=typeof t==\"function\"?t.apply(a,r.args):!0,{res:a,forceNext:!1}},r}$r.promptCL=function(t,e){var r=Vs({hideEchoBack:!1,limitMessage:\"Requested command is not available.\",caseSensitive:!1,history:!0},e),s=fEe(t,r);return r.limit=s.limit,r.preCheck=s.preCheck,$r.prompt(r),s.args};$r.promptLoop=function(t,e){for(var r=Vs({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},e);!t($r.prompt(r)););};$r.promptCLLoop=function(t,e){var r=Vs({hideEchoBack:!1,limitMessage:\"Requested command is not available.\",caseSensitive:!1,history:!0},e),s=fEe(t,r);for(r.limit=s.limit,r.preCheck=s.preCheck;$r.prompt(r),!s.hRes;);};$r.promptSimShell=function(t){return $r.prompt(Vs({hideEchoBack:!1,history:!0},t,{prompt:function(){return Pm?\"$<cwd>>\":(process.env.USER||\"\")+(process.env.HOSTNAME?\"@\"+process.env.HOSTNAME.replace(/\\..*$/,\"\"):\"\")+\":$<cwdHome>$ \"}()}))};function AEe(t,e,r){var s;return t==null&&(t=\"Are you sure? \"),(!e||e.guide!==!1)&&(t+=\"\")&&(t=t.replace(/\\s*:?\\s*$/,\"\")+\" [y/n]: \"),s=$r.keyIn(t,Vs(e,{hideEchoBack:!1,limit:r,trueValue:\"y\",falseValue:\"n\",caseSensitive:!1})),typeof s==\"boolean\"?s:\"\"}$r.keyInYN=function(t,e){return AEe(t,e)};$r.keyInYNStrict=function(t,e){return AEe(t,e,\"yn\")};$r.keyInPause=function(t,e){t==null&&(t=\"Continue...\"),(!e||e.guide!==!1)&&(t+=\"\")&&(t=t.replace(/\\s+$/,\"\")+\" (Hit any key)\"),$r.keyIn(t,Vs({limit:null},e,{hideEchoBack:!0,mask:\"\"}))};$r.keyInSelect=function(t,e,r){var s=Vs({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p===\"itemsCount\"?t.length+\"\":p===\"firstItem\"?(t[0]+\"\").trim():p===\"lastItem\"?(t[t.length-1]+\"\").trim():null}}),a=\"\",n={},c=49,f=`\n`;if(!Array.isArray(t)||!t.length||t.length>35)throw\"`items` must be Array (max length: 35).\";return t.forEach(function(p,h){var E=String.fromCharCode(c);a+=E,n[E]=h,f+=\"[\"+E+\"] \"+(p+\"\").trim()+`\n`,c=c===57?97:c+1}),(!r||r.cancel!==!1)&&(a+=\"0\",n[0]=-1,f+=\"[0] \"+(r&&r.cancel!=null&&typeof r.cancel!=\"boolean\"?(r.cancel+\"\").trim():\"CANCEL\")+`\n`),s.limit=a,f+=`\n`,e==null&&(e=\"Choose one from list: \"),(e+=\"\")&&((!r||r.guide!==!1)&&(e=e.replace(/\\s*:?\\s*$/,\"\")+\" [$<limit>]: \"),f+=e),n[$r.keyIn(f,s).toLowerCase()]};$r.getRawInput=function(){return oF};function oS(t,e){var r;return e.length&&(r={},r[t]=e[0]),$r.setDefaultOptions(r)[t]}$r.setPrint=function(){return oS(\"print\",arguments)};$r.setPrompt=function(){return oS(\"prompt\",arguments)};$r.setEncoding=function(){return oS(\"encoding\",arguments)};$r.setMask=function(){return oS(\"mask\",arguments)};$r.setBufferSize=function(){return oS(\"bufferSize\",arguments)}});var x5=_((BYt,ec)=>{(function(){var t={major:0,minor:2,patch:66,status:\"beta\"};tau_file_system={files:{},open:function(w,P,y){var F=tau_file_system.files[w];if(!F){if(y===\"read\")return null;F={path:w,text:\"\",type:P,get:function(z,Z){return Z===this.text.length||Z>this.text.length?\"end_of_file\":this.text.substring(Z,Z+z)},put:function(z,Z){return Z===\"end_of_file\"?(this.text+=z,!0):Z===\"past_end_of_file\"?null:(this.text=this.text.substring(0,Z)+z+this.text.substring(Z+z.length),!0)},get_byte:function(z){if(z===\"end_of_stream\")return-1;var Z=Math.floor(z/2);if(this.text.length<=Z)return-1;var $=n(this.text[Math.floor(z/2)],0);return z%2===0?$&255:$/256>>>0},put_byte:function(z,Z){var $=Z===\"end_of_stream\"?this.text.length:Math.floor(Z/2);if(this.text.length<$)return null;var oe=this.text.length===$?-1:n(this.text[Math.floor(Z/2)],0);return Z%2===0?(oe=oe/256>>>0,oe=(oe&255)<<8|z&255):(oe=oe&255,oe=(z&255)<<8|oe&255),this.text.length===$?this.text+=c(oe):this.text=this.text.substring(0,$)+c(oe)+this.text.substring($+1),!0},flush:function(){return!0},close:function(){var z=tau_file_system.files[this.path];return z?!0:null}},tau_file_system.files[w]=F}return y===\"write\"&&(F.text=\"\"),F}},tau_user_input={buffer:\"\",get:function(w,P){for(var y;tau_user_input.buffer.length<w;)y=window.prompt(),y&&(tau_user_input.buffer+=y);return y=tau_user_input.buffer.substr(0,w),tau_user_input.buffer=tau_user_input.buffer.substr(w),y}},tau_user_output={put:function(w,P){return console.log(w),!0},flush:function(){return!0}},nodejs_file_system={open:function(w,P,y){var F=Ie(\"fs\"),z=F.openSync(w,y[0]);return y===\"read\"&&!F.existsSync(w)?null:{get:function(Z,$){var oe=new Buffer(Z);return F.readSync(z,oe,0,Z,$),oe.toString()},put:function(Z,$){var oe=Buffer.from(Z);if($===\"end_of_file\")F.writeSync(z,oe);else{if($===\"past_end_of_file\")return null;F.writeSync(z,oe,0,oe.length,$)}return!0},get_byte:function(Z){return null},put_byte:function(Z,$){return null},flush:function(){return!0},close:function(){return F.closeSync(z),!0}}}},nodejs_user_input={buffer:\"\",get:function(w,P){for(var y,F=pEe();nodejs_user_input.buffer.length<w;)nodejs_user_input.buffer+=F.question();return y=nodejs_user_input.buffer.substr(0,w),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(w),y}},nodejs_user_output={put:function(w,P){return process.stdout.write(w),!0},flush:function(){return!0}};var e;Array.prototype.indexOf?e=function(w,P){return w.indexOf(P)}:e=function(w,P){for(var y=w.length,F=0;F<y;F++)if(P===w[F])return F;return-1};var r=function(w,P){if(w.length!==0){for(var y=w[0],F=w.length,z=1;z<F;z++)y=P(y,w[z]);return y}},s;Array.prototype.map?s=function(w,P){return w.map(P)}:s=function(w,P){for(var y=[],F=w.length,z=0;z<F;z++)y.push(P(w[z]));return y};var a;Array.prototype.filter?a=function(w,P){return w.filter(P)}:a=function(w,P){for(var y=[],F=w.length,z=0;z<F;z++)P(w[z])&&y.push(w[z]);return y};var n;String.prototype.codePointAt?n=function(w,P){return w.codePointAt(P)}:n=function(w,P){return w.charCodeAt(P)};var c;String.fromCodePoint?c=function(){return String.fromCodePoint.apply(null,arguments)}:c=function(){return String.fromCharCode.apply(null,arguments)};var f=0,p=1,h=/(\\\\a)|(\\\\b)|(\\\\f)|(\\\\n)|(\\\\r)|(\\\\t)|(\\\\v)|\\\\x([0-9a-fA-F]+)\\\\|\\\\([0-7]+)\\\\|(\\\\\\\\)|(\\\\')|('')|(\\\\\")|(\\\\`)|(\\\\.)|(.)/g,E={\"\\\\a\":7,\"\\\\b\":8,\"\\\\f\":12,\"\\\\n\":10,\"\\\\r\":13,\"\\\\t\":9,\"\\\\v\":11};function C(w){var P=[],y=!1;return w.replace(h,function(F,z,Z,$,oe,xe,Re,lt,Ct,qt,ir,bt,gn,br,Ir,Or,nn){switch(!0){case Ct!==void 0:return P.push(parseInt(Ct,16)),\"\";case qt!==void 0:return P.push(parseInt(qt,8)),\"\";case ir!==void 0:case bt!==void 0:case gn!==void 0:case br!==void 0:case Ir!==void 0:return P.push(n(F.substr(1),0)),\"\";case nn!==void 0:return P.push(n(nn,0)),\"\";case Or!==void 0:y=!0;default:return P.push(E[F]),\"\"}}),y?null:P}function S(w,P){var y=\"\";if(w.length<2)return w;try{w=w.replace(/\\\\([0-7]+)\\\\/g,function($,oe){return c(parseInt(oe,8))}),w=w.replace(/\\\\x([0-9a-fA-F]+)\\\\/g,function($,oe){return c(parseInt(oe,16))})}catch{return null}for(var F=0;F<w.length;F++){var z=w.charAt(F),Z=w.charAt(F+1);if(z===P&&Z===P)F++,y+=P;else if(z===\"\\\\\")if([\"a\",\"b\",\"f\",\"n\",\"r\",\"t\",\"v\",\"'\",'\"',\"\\\\\",\"a\",\"\\b\",\"\\f\",`\n`,\"\\r\",\"\t\",\"\\v\"].indexOf(Z)!==-1)switch(F+=1,Z){case\"a\":y+=\"a\";break;case\"b\":y+=\"\\b\";break;case\"f\":y+=\"\\f\";break;case\"n\":y+=`\n`;break;case\"r\":y+=\"\\r\";break;case\"t\":y+=\"\t\";break;case\"v\":y+=\"\\v\";break;case\"'\":y+=\"'\";break;case'\"':y+='\"';break;case\"\\\\\":y+=\"\\\\\";break}else return null;else y+=z}return y}function b(w){for(var P=\"\",y=0;y<w.length;y++)switch(w.charAt(y)){case\"'\":P+=\"\\\\'\";break;case\"\\\\\":P+=\"\\\\\\\\\";break;case\"\\b\":P+=\"\\\\b\";break;case\"\\f\":P+=\"\\\\f\";break;case`\n`:P+=\"\\\\n\";break;case\"\\r\":P+=\"\\\\r\";break;case\"\t\":P+=\"\\\\t\";break;case\"\\v\":P+=\"\\\\v\";break;default:P+=w.charAt(y);break}return P}function I(w){var P=w.substr(2);switch(w.substr(0,2).toLowerCase()){case\"0x\":return parseInt(P,16);case\"0b\":return parseInt(P,2);case\"0o\":return parseInt(P,8);case\"0'\":return C(P)[0];default:return parseFloat(w)}}var T={whitespace:/^\\s*(?:(?:%.*)|(?:\\/\\*(?:\\n|\\r|.)*?\\*\\/)|(?:\\s+))\\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\\!|,|;|[a-z][0-9a-zA-Z_]*|[#\\$\\&\\*\\+\\-\\.\\/\\:\\<\\=\\>\\?\\@\\^\\~\\\\]+|'(?:[^']*?(?:\\\\(?:x?\\d+)?\\\\)*(?:'')*(?:\\\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\\\[abfnrtv\\\\'\"`]|\\\\x?\\d+\\\\|[^\\\\])|\\d+(?:\\.\\d+(?:[eE][+-]?\\d+)?)?)/,string:/^(?:\"([^\"]|\"\"|\\\\\")*\"|`([^`]|``|\\\\`)*`)/,l_brace:/^(?:\\[)/,r_brace:/^(?:\\])/,l_bracket:/^(?:\\{)/,r_bracket:/^(?:\\})/,bar:/^(?:\\|)/,l_paren:/^(?:\\()/,r_paren:/^(?:\\))/};function N(w,P){return w.get_flag(\"char_conversion\").id===\"on\"?P.replace(/./g,function(y){return w.get_char_conversion(y)}):P}function U(w){this.thread=w,this.text=\"\",this.tokens=[]}U.prototype.set_last_tokens=function(w){return this.tokens=w},U.prototype.new_text=function(w){this.text=w,this.tokens=[]},U.prototype.get_tokens=function(w){var P,y=0,F=0,z=0,Z=[],$=!1;if(w){var oe=this.tokens[w-1];y=oe.len,P=N(this.thread,this.text.substr(oe.len)),F=oe.line,z=oe.start}else P=this.text;if(/^\\s*$/.test(P))return null;for(;P!==\"\";){var xe=[],Re=!1;if(/^\\n/.exec(P)!==null){F++,z=0,y++,P=P.replace(/\\n/,\"\"),$=!0;continue}for(var lt in T)if(T.hasOwnProperty(lt)){var Ct=T[lt].exec(P);Ct&&xe.push({value:Ct[0],name:lt,matches:Ct})}if(!xe.length)return this.set_last_tokens([{value:P,matches:[],name:\"lexical\",line:F,start:z}]);var oe=r(xe,function(br,Ir){return br.value.length>=Ir.value.length?br:Ir});switch(oe.start=z,oe.line=F,P=P.replace(oe.value,\"\"),z+=oe.value.length,y+=oe.value.length,oe.name){case\"atom\":oe.raw=oe.value,oe.value.charAt(0)===\"'\"&&(oe.value=S(oe.value.substr(1,oe.value.length-2),\"'\"),oe.value===null&&(oe.name=\"lexical\",oe.value=\"unknown escape sequence\"));break;case\"number\":oe.float=oe.value.substring(0,2)!==\"0x\"&&oe.value.match(/[.eE]/)!==null&&oe.value!==\"0'.\",oe.value=I(oe.value),oe.blank=Re;break;case\"string\":var qt=oe.value.charAt(0);oe.value=S(oe.value.substr(1,oe.value.length-2),qt),oe.value===null&&(oe.name=\"lexical\",oe.value=\"unknown escape sequence\");break;case\"whitespace\":var ir=Z[Z.length-1];ir&&(ir.space=!0),Re=!0;continue;case\"r_bracket\":Z.length>0&&Z[Z.length-1].name===\"l_bracket\"&&(oe=Z.pop(),oe.name=\"atom\",oe.value=\"{}\",oe.raw=\"{}\",oe.space=!1);break;case\"r_brace\":Z.length>0&&Z[Z.length-1].name===\"l_brace\"&&(oe=Z.pop(),oe.name=\"atom\",oe.value=\"[]\",oe.raw=\"[]\",oe.space=!1);break}oe.len=y,Z.push(oe),Re=!1}var bt=this.set_last_tokens(Z);return bt.length===0?null:bt};function W(w,P,y,F,z){if(!P[y])return{type:f,value:x.error.syntax(P[y-1],\"expression expected\",!0)};var Z;if(F===\"0\"){var $=P[y];switch($.name){case\"number\":return{type:p,len:y+1,value:new x.type.Num($.value,$.float)};case\"variable\":return{type:p,len:y+1,value:new x.type.Var($.value)};case\"string\":var oe;switch(w.get_flag(\"double_quotes\").id){case\"atom\":oe=new j($.value,[]);break;case\"codes\":oe=new j(\"[]\",[]);for(var xe=$.value.length-1;xe>=0;xe--)oe=new j(\".\",[new x.type.Num(n($.value,xe),!1),oe]);break;case\"chars\":oe=new j(\"[]\",[]);for(var xe=$.value.length-1;xe>=0;xe--)oe=new j(\".\",[new x.type.Term($.value.charAt(xe),[]),oe]);break}return{type:p,len:y+1,value:oe};case\"l_paren\":var bt=W(w,P,y+1,w.__get_max_priority(),!0);return bt.type!==p?bt:P[bt.len]&&P[bt.len].name===\"r_paren\"?(bt.len++,bt):{type:f,derived:!0,value:x.error.syntax(P[bt.len]?P[bt.len]:P[bt.len-1],\") or operator expected\",!P[bt.len])};case\"l_bracket\":var bt=W(w,P,y+1,w.__get_max_priority(),!0);return bt.type!==p?bt:P[bt.len]&&P[bt.len].name===\"r_bracket\"?(bt.len++,bt.value=new j(\"{}\",[bt.value]),bt):{type:f,derived:!0,value:x.error.syntax(P[bt.len]?P[bt.len]:P[bt.len-1],\"} or operator expected\",!P[bt.len])}}var Re=ee(w,P,y,z);return Re.type===p||Re.derived||(Re=ie(w,P,y),Re.type===p||Re.derived)?Re:{type:f,derived:!1,value:x.error.syntax(P[y],\"unexpected token\")}}var lt=w.__get_max_priority(),Ct=w.__get_next_priority(F),qt=y;if(P[y].name===\"atom\"&&P[y+1]&&(P[y].space||P[y+1].name!==\"l_paren\")){var $=P[y++],ir=w.__lookup_operator_classes(F,$.value);if(ir&&ir.indexOf(\"fy\")>-1){var bt=W(w,P,y,F,z);if(bt.type!==f)return $.value===\"-\"&&!$.space&&x.type.is_number(bt.value)?{value:new x.type.Num(-bt.value.value,bt.value.is_float),len:bt.len,type:p}:{value:new x.type.Term($.value,[bt.value]),len:bt.len,type:p};Z=bt}else if(ir&&ir.indexOf(\"fx\")>-1){var bt=W(w,P,y,Ct,z);if(bt.type!==f)return{value:new x.type.Term($.value,[bt.value]),len:bt.len,type:p};Z=bt}}y=qt;var bt=W(w,P,y,Ct,z);if(bt.type===p){y=bt.len;var $=P[y];if(P[y]&&(P[y].name===\"atom\"&&w.__lookup_operator_classes(F,$.value)||P[y].name===\"bar\"&&w.__lookup_operator_classes(F,\"|\"))){var gn=Ct,br=F,ir=w.__lookup_operator_classes(F,$.value);if(ir.indexOf(\"xf\")>-1)return{value:new x.type.Term($.value,[bt.value]),len:++bt.len,type:p};if(ir.indexOf(\"xfx\")>-1){var Ir=W(w,P,y+1,gn,z);return Ir.type===p?{value:new x.type.Term($.value,[bt.value,Ir.value]),len:Ir.len,type:p}:(Ir.derived=!0,Ir)}else if(ir.indexOf(\"xfy\")>-1){var Ir=W(w,P,y+1,br,z);return Ir.type===p?{value:new x.type.Term($.value,[bt.value,Ir.value]),len:Ir.len,type:p}:(Ir.derived=!0,Ir)}else if(bt.type!==f)for(;;){y=bt.len;var $=P[y];if($&&$.name===\"atom\"&&w.__lookup_operator_classes(F,$.value)){var ir=w.__lookup_operator_classes(F,$.value);if(ir.indexOf(\"yf\")>-1)bt={value:new x.type.Term($.value,[bt.value]),len:++y,type:p};else if(ir.indexOf(\"yfx\")>-1){var Ir=W(w,P,++y,gn,z);if(Ir.type===f)return Ir.derived=!0,Ir;y=Ir.len,bt={value:new x.type.Term($.value,[bt.value,Ir.value]),len:y,type:p}}else break}else break}}else Z={type:f,value:x.error.syntax(P[bt.len-1],\"operator expected\")};return bt}return bt}function ee(w,P,y,F){if(!P[y]||P[y].name===\"atom\"&&P[y].raw===\".\"&&!F&&(P[y].space||!P[y+1]||P[y+1].name!==\"l_paren\"))return{type:f,derived:!1,value:x.error.syntax(P[y-1],\"unfounded token\")};var z=P[y],Z=[];if(P[y].name===\"atom\"&&P[y].raw!==\",\"){if(y++,P[y-1].space)return{type:p,len:y,value:new x.type.Term(z.value,Z)};if(P[y]&&P[y].name===\"l_paren\"){if(P[y+1]&&P[y+1].name===\"r_paren\")return{type:f,derived:!0,value:x.error.syntax(P[y+1],\"argument expected\")};var $=W(w,P,++y,\"999\",!0);if($.type===f)return $.derived?$:{type:f,derived:!0,value:x.error.syntax(P[y]?P[y]:P[y-1],\"argument expected\",!P[y])};for(Z.push($.value),y=$.len;P[y]&&P[y].name===\"atom\"&&P[y].value===\",\";){if($=W(w,P,y+1,\"999\",!0),$.type===f)return $.derived?$:{type:f,derived:!0,value:x.error.syntax(P[y+1]?P[y+1]:P[y],\"argument expected\",!P[y+1])};Z.push($.value),y=$.len}if(P[y]&&P[y].name===\"r_paren\")y++;else return{type:f,derived:!0,value:x.error.syntax(P[y]?P[y]:P[y-1],\", or ) expected\",!P[y])}}return{type:p,len:y,value:new x.type.Term(z.value,Z)}}return{type:f,derived:!1,value:x.error.syntax(P[y],\"term expected\")}}function ie(w,P,y){if(!P[y])return{type:f,derived:!1,value:x.error.syntax(P[y-1],\"[ expected\")};if(P[y]&&P[y].name===\"l_brace\"){var F=W(w,P,++y,\"999\",!0),z=[F.value],Z=void 0;if(F.type===f)return P[y]&&P[y].name===\"r_brace\"?{type:p,len:y+1,value:new x.type.Term(\"[]\",[])}:{type:f,derived:!0,value:x.error.syntax(P[y],\"] expected\")};for(y=F.len;P[y]&&P[y].name===\"atom\"&&P[y].value===\",\";){if(F=W(w,P,y+1,\"999\",!0),F.type===f)return F.derived?F:{type:f,derived:!0,value:x.error.syntax(P[y+1]?P[y+1]:P[y],\"argument expected\",!P[y+1])};z.push(F.value),y=F.len}var $=!1;if(P[y]&&P[y].name===\"bar\"){if($=!0,F=W(w,P,y+1,\"999\",!0),F.type===f)return F.derived?F:{type:f,derived:!0,value:x.error.syntax(P[y+1]?P[y+1]:P[y],\"argument expected\",!P[y+1])};Z=F.value,y=F.len}return P[y]&&P[y].name===\"r_brace\"?{type:p,len:y+1,value:g(z,Z)}:{type:f,derived:!0,value:x.error.syntax(P[y]?P[y]:P[y-1],$?\"] expected\":\", or | or ] expected\",!P[y])}}return{type:f,derived:!1,value:x.error.syntax(P[y],\"list expected\")}}function ue(w,P,y){var F=P[y].line,z=W(w,P,y,w.__get_max_priority(),!1),Z=null,$;if(z.type!==f)if(y=z.len,P[y]&&P[y].name===\"atom\"&&P[y].raw===\".\")if(y++,x.type.is_term(z.value)){if(z.value.indicator===\":-/2\"?(Z=new x.type.Rule(z.value.args[0],Ce(z.value.args[1])),$={value:Z,len:y,type:p}):z.value.indicator===\"-->/2\"?(Z=pe(new x.type.Rule(z.value.args[0],z.value.args[1]),w),Z.body=Ce(Z.body),$={value:Z,len:y,type:x.type.is_rule(Z)?p:f}):(Z=new x.type.Rule(z.value,null),$={value:Z,len:y,type:p}),Z){var oe=Z.singleton_variables();oe.length>0&&w.throw_warning(x.warning.singleton(oe,Z.head.indicator,F))}return $}else return{type:f,value:x.error.syntax(P[y],\"callable expected\")};else return{type:f,value:x.error.syntax(P[y]?P[y]:P[y-1],\". or operator expected\")};return z}function le(w,P,y){y=y||{},y.from=y.from?y.from:\"$tau-js\",y.reconsult=y.reconsult!==void 0?y.reconsult:!0;var F=new U(w),z={},Z;F.new_text(P);var $=0,oe=F.get_tokens($);do{if(oe===null||!oe[$])break;var xe=ue(w,oe,$);if(xe.type===f)return new j(\"throw\",[xe.value]);if(xe.value.body===null&&xe.value.head.indicator===\"?-/1\"){var Re=new it(w.session);Re.add_goal(xe.value.head.args[0]),Re.answer(function(Ct){x.type.is_error(Ct)?w.throw_warning(Ct.args[0]):(Ct===!1||Ct===null)&&w.throw_warning(x.warning.failed_goal(xe.value.head.args[0],xe.len))}),$=xe.len;var lt=!0}else if(xe.value.body===null&&xe.value.head.indicator===\":-/1\"){var lt=w.run_directive(xe.value.head.args[0]);$=xe.len,xe.value.head.args[0].indicator===\"char_conversion/2\"&&(oe=F.get_tokens($),$=0)}else{Z=xe.value.head.indicator,y.reconsult!==!1&&z[Z]!==!0&&!w.is_multifile_predicate(Z)&&(w.session.rules[Z]=a(w.session.rules[Z]||[],function(qt){return qt.dynamic}),z[Z]=!0);var lt=w.add_rule(xe.value,y);$=xe.len}if(!lt)return lt}while(!0);return!0}function me(w,P){var y=new U(w);y.new_text(P);var F=0;do{var z=y.get_tokens(F);if(z===null)break;var Z=W(w,z,0,w.__get_max_priority(),!1);if(Z.type!==f){var $=Z.len,oe=$;if(z[$]&&z[$].name===\"atom\"&&z[$].raw===\".\")w.add_goal(Ce(Z.value));else{var xe=z[$];return new j(\"throw\",[x.error.syntax(xe||z[$-1],\". or operator expected\",!xe)])}F=Z.len+1}else return new j(\"throw\",[Z.value])}while(!0);return!0}function pe(w,P){w=w.rename(P);var y=P.next_free_variable(),F=Be(w.body,y,P);return F.error?F.value:(w.body=F.value,w.head.args=w.head.args.concat([y,F.variable]),w.head=new j(w.head.id,w.head.args),w)}function Be(w,P,y){var F;if(x.type.is_term(w)&&w.indicator===\"!/0\")return{value:w,variable:P,error:!1};if(x.type.is_term(w)&&w.indicator===\",/2\"){var z=Be(w.args[0],P,y);if(z.error)return z;var Z=Be(w.args[1],z.variable,y);return Z.error?Z:{value:new j(\",\",[z.value,Z.value]),variable:Z.variable,error:!1}}else{if(x.type.is_term(w)&&w.indicator===\"{}/1\")return{value:w.args[0],variable:P,error:!1};if(x.type.is_empty_list(w))return{value:new j(\"true\",[]),variable:P,error:!1};if(x.type.is_list(w)){F=y.next_free_variable();for(var $=w,oe;$.indicator===\"./2\";)oe=$,$=$.args[1];return x.type.is_variable($)?{value:x.error.instantiation(\"DCG\"),variable:P,error:!0}:x.type.is_empty_list($)?(oe.args[1]=F,{value:new j(\"=\",[P,w]),variable:F,error:!1}):{value:x.error.type(\"list\",w,\"DCG\"),variable:P,error:!0}}else return x.type.is_callable(w)?(F=y.next_free_variable(),w.args=w.args.concat([P,F]),w=new j(w.id,w.args),{value:w,variable:F,error:!1}):{value:x.error.type(\"callable\",w,\"DCG\"),variable:P,error:!0}}}function Ce(w){return x.type.is_variable(w)?new j(\"call\",[w]):x.type.is_term(w)&&[\",/2\",\";/2\",\"->/2\"].indexOf(w.indicator)!==-1?new j(w.id,[Ce(w.args[0]),Ce(w.args[1])]):w}function g(w,P){for(var y=P||new x.type.Term(\"[]\",[]),F=w.length-1;F>=0;F--)y=new x.type.Term(\".\",[w[F],y]);return y}function we(w,P){for(var y=w.length-1;y>=0;y--)w[y]===P&&w.splice(y,1)}function ye(w){for(var P={},y=[],F=0;F<w.length;F++)w[F]in P||(y.push(w[F]),P[w[F]]=!0);return y}function Ae(w,P,y,F){if(w.session.rules[y]!==null){for(var z=0;z<w.session.rules[y].length;z++)if(w.session.rules[y][z]===F){w.session.rules[y].splice(z,1),w.success(P);break}}}function se(w){return function(P,y,F){var z=F.args[0],Z=F.args.slice(1,w);if(x.type.is_variable(z))P.throw_error(x.error.instantiation(P.level));else if(!x.type.is_callable(z))P.throw_error(x.error.type(\"callable\",z,P.level));else{var $=new j(z.id,z.args.concat(Z));P.prepend([new be(y.goal.replace($),y.substitution,y)])}}}function X(w){for(var P=w.length-1;P>=0;P--)if(w.charAt(P)===\"/\")return new j(\"/\",[new j(w.substring(0,P)),new Te(parseInt(w.substring(P+1)),!1)])}function De(w){this.id=w}function Te(w,P){this.is_float=P!==void 0?P:parseInt(w)!==w,this.value=this.is_float?w:parseInt(w)}var mt=0;function j(w,P,y){this.ref=y||++mt,this.id=w,this.args=P||[],this.indicator=w+\"/\"+this.args.length}var rt=0;function Fe(w,P,y,F,z,Z){this.id=rt++,this.stream=w,this.mode=P,this.alias=y,this.type=F!==void 0?F:\"text\",this.reposition=z!==void 0?z:!0,this.eof_action=Z!==void 0?Z:\"eof_code\",this.position=this.mode===\"append\"?\"end_of_stream\":0,this.output=this.mode===\"write\"||this.mode===\"append\",this.input=this.mode===\"read\"}function Ne(w){w=w||{},this.links=w}function be(w,P,y){P=P||new Ne,y=y||null,this.goal=w,this.substitution=P,this.parent=y}function Ve(w,P,y){this.head=w,this.body=P,this.dynamic=y||!1}function ke(w){w=w===void 0||w<=0?1e3:w,this.rules={},this.src_predicates={},this.rename=0,this.modules=[],this.thread=new it(this),this.total_threads=1,this.renamed_variables={},this.public_predicates={},this.multifile_predicates={},this.limit=w,this.streams={user_input:new Fe(typeof ec<\"u\"&&ec.exports?nodejs_user_input:tau_user_input,\"read\",\"user_input\",\"text\",!1,\"reset\"),user_output:new Fe(typeof ec<\"u\"&&ec.exports?nodejs_user_output:tau_user_output,\"write\",\"user_output\",\"text\",!1,\"eof_code\")},this.file_system=typeof ec<\"u\"&&ec.exports?nodejs_file_system:tau_file_system,this.standard_input=this.streams.user_input,this.standard_output=this.streams.user_output,this.current_input=this.streams.user_input,this.current_output=this.streams.user_output,this.format_success=function(P){return P.substitution},this.format_error=function(P){return P.goal},this.flag={bounded:x.flag.bounded.value,max_integer:x.flag.max_integer.value,min_integer:x.flag.min_integer.value,integer_rounding_function:x.flag.integer_rounding_function.value,char_conversion:x.flag.char_conversion.value,debug:x.flag.debug.value,max_arity:x.flag.max_arity.value,unknown:x.flag.unknown.value,double_quotes:x.flag.double_quotes.value,occurs_check:x.flag.occurs_check.value,dialect:x.flag.dialect.value,version_data:x.flag.version_data.value,nodejs:x.flag.nodejs.value},this.__loaded_modules=[],this.__char_conversion={},this.__operators={1200:{\":-\":[\"fx\",\"xfx\"],\"-->\":[\"xfx\"],\"?-\":[\"fx\"]},1100:{\";\":[\"xfy\"]},1050:{\"->\":[\"xfy\"]},1e3:{\",\":[\"xfy\"]},900:{\"\\\\+\":[\"fy\"]},700:{\"=\":[\"xfx\"],\"\\\\=\":[\"xfx\"],\"==\":[\"xfx\"],\"\\\\==\":[\"xfx\"],\"@<\":[\"xfx\"],\"@=<\":[\"xfx\"],\"@>\":[\"xfx\"],\"@>=\":[\"xfx\"],\"=..\":[\"xfx\"],is:[\"xfx\"],\"=:=\":[\"xfx\"],\"=\\\\=\":[\"xfx\"],\"<\":[\"xfx\"],\"=<\":[\"xfx\"],\">\":[\"xfx\"],\">=\":[\"xfx\"]},600:{\":\":[\"xfy\"]},500:{\"+\":[\"yfx\"],\"-\":[\"yfx\"],\"/\\\\\":[\"yfx\"],\"\\\\/\":[\"yfx\"]},400:{\"*\":[\"yfx\"],\"/\":[\"yfx\"],\"//\":[\"yfx\"],rem:[\"yfx\"],mod:[\"yfx\"],\"<<\":[\"yfx\"],\">>\":[\"yfx\"]},200:{\"**\":[\"xfx\"],\"^\":[\"xfy\"],\"-\":[\"fy\"],\"+\":[\"fy\"],\"\\\\\":[\"fy\"]}}}function it(w){this.epoch=Date.now(),this.session=w,this.session.total_threads++,this.total_steps=0,this.cpu_time=0,this.cpu_time_last=0,this.points=[],this.debugger=!1,this.debugger_states=[],this.level=\"top_level/0\",this.__calls=[],this.current_limit=this.session.limit,this.warnings=[]}function Ue(w,P,y){this.id=w,this.rules=P,this.exports=y,x.module[w]=this}Ue.prototype.exports_predicate=function(w){return this.exports.indexOf(w)!==-1},De.prototype.unify=function(w,P){if(P&&e(w.variables(),this.id)!==-1&&!x.type.is_variable(w))return null;var y={};return y[this.id]=w,new Ne(y)},Te.prototype.unify=function(w,P){return x.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float?new Ne:null},j.prototype.unify=function(w,P){if(x.type.is_term(w)&&this.indicator===w.indicator){for(var y=new Ne,F=0;F<this.args.length;F++){var z=x.unify(this.args[F].apply(y),w.args[F].apply(y),P);if(z===null)return null;for(var Z in z.links)y.links[Z]=z.links[Z];y=y.apply(z)}return y}return null},Fe.prototype.unify=function(w,P){return x.type.is_stream(w)&&this.id===w.id?new Ne:null},De.prototype.toString=function(w){return this.id},Te.prototype.toString=function(w){return this.is_float&&e(this.value.toString(),\".\")===-1?this.value+\".0\":this.value.toString()},j.prototype.toString=function(w,P,y){if(w=w||{},w.quoted=w.quoted===void 0?!0:w.quoted,w.ignore_ops=w.ignore_ops===void 0?!1:w.ignore_ops,w.numbervars=w.numbervars===void 0?!1:w.numbervars,P=P===void 0?1200:P,y=y===void 0?\"\":y,w.numbervars&&this.indicator===\"$VAR/1\"&&x.type.is_integer(this.args[0])&&this.args[0].value>=0){var F=this.args[0].value,z=Math.floor(F/26),Z=F%26;return\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"[Z]+(z!==0?z:\"\")}switch(this.indicator){case\"[]/0\":case\"{}/0\":case\"!/0\":return this.id;case\"{}/1\":return\"{\"+this.args[0].toString(w)+\"}\";case\"./2\":for(var $=\"[\"+this.args[0].toString(w),oe=this.args[1];oe.indicator===\"./2\";)$+=\", \"+oe.args[0].toString(w),oe=oe.args[1];return oe.indicator!==\"[]/0\"&&($+=\"|\"+oe.toString(w)),$+=\"]\",$;case\",/2\":return\"(\"+this.args[0].toString(w)+\", \"+this.args[1].toString(w)+\")\";default:var xe=this.id,Re=w.session?w.session.lookup_operator(this.id,this.args.length):null;if(w.session===void 0||w.ignore_ops||Re===null)return w.quoted&&!/^(!|,|;|[a-z][0-9a-zA-Z_]*)$/.test(xe)&&xe!==\"{}\"&&xe!==\"[]\"&&(xe=\"'\"+b(xe)+\"'\"),xe+(this.args.length?\"(\"+s(this.args,function(ir){return ir.toString(w)}).join(\", \")+\")\":\"\");var lt=Re.priority>P.priority||Re.priority===P.priority&&(Re.class===\"xfy\"&&this.indicator!==P.indicator||Re.class===\"yfx\"&&this.indicator!==P.indicator||this.indicator===P.indicator&&Re.class===\"yfx\"&&y===\"right\"||this.indicator===P.indicator&&Re.class===\"xfy\"&&y===\"left\");Re.indicator=this.indicator;var Ct=lt?\"(\":\"\",qt=lt?\")\":\"\";return this.args.length===0?\"(\"+this.id+\")\":[\"fy\",\"fx\"].indexOf(Re.class)!==-1?Ct+xe+\" \"+this.args[0].toString(w,Re)+qt:[\"yf\",\"xf\"].indexOf(Re.class)!==-1?Ct+this.args[0].toString(w,Re)+\" \"+xe+qt:Ct+this.args[0].toString(w,Re,\"left\")+\" \"+this.id+\" \"+this.args[1].toString(w,Re,\"right\")+qt}},Fe.prototype.toString=function(w){return\"<stream>(\"+this.id+\")\"},Ne.prototype.toString=function(w){var P=\"{\";for(var y in this.links)this.links.hasOwnProperty(y)&&(P!==\"{\"&&(P+=\", \"),P+=y+\"/\"+this.links[y].toString(w));return P+=\"}\",P},be.prototype.toString=function(w){return this.goal===null?\"<\"+this.substitution.toString(w)+\">\":\"<\"+this.goal.toString(w)+\", \"+this.substitution.toString(w)+\">\"},Ve.prototype.toString=function(w){return this.body?this.head.toString(w)+\" :- \"+this.body.toString(w)+\".\":this.head.toString(w)+\".\"},ke.prototype.toString=function(w){for(var P=\"\",y=0;y<this.modules.length;y++)P+=\":- use_module(library(\"+this.modules[y]+`)).\n`;P+=`\n`;for(key in this.rules)for(y=0;y<this.rules[key].length;y++)P+=this.rules[key][y].toString(w),P+=`\n`;return P},De.prototype.clone=function(){return new De(this.id)},Te.prototype.clone=function(){return new Te(this.value,this.is_float)},j.prototype.clone=function(){return new j(this.id,s(this.args,function(w){return w.clone()}))},Fe.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Ne.prototype.clone=function(){var w={};for(var P in this.links)this.links.hasOwnProperty(P)&&(w[P]=this.links[P].clone());return new Ne(w)},be.prototype.clone=function(){return new be(this.goal.clone(),this.substitution.clone(),this.parent)},Ve.prototype.clone=function(){return new Ve(this.head.clone(),this.body!==null?this.body.clone():null)},De.prototype.equals=function(w){return x.type.is_variable(w)&&this.id===w.id},Te.prototype.equals=function(w){return x.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float},j.prototype.equals=function(w){if(!x.type.is_term(w)||this.indicator!==w.indicator)return!1;for(var P=0;P<this.args.length;P++)if(!this.args[P].equals(w.args[P]))return!1;return!0},Fe.prototype.equals=function(w){return x.type.is_stream(w)&&this.id===w.id},Ne.prototype.equals=function(w){var P;if(!x.type.is_substitution(w))return!1;for(P in this.links)if(this.links.hasOwnProperty(P)&&(!w.links[P]||!this.links[P].equals(w.links[P])))return!1;for(P in w.links)if(w.links.hasOwnProperty(P)&&!this.links[P])return!1;return!0},be.prototype.equals=function(w){return x.type.is_state(w)&&this.goal.equals(w.goal)&&this.substitution.equals(w.substitution)&&this.parent===w.parent},Ve.prototype.equals=function(w){return x.type.is_rule(w)&&this.head.equals(w.head)&&(this.body===null&&w.body===null||this.body!==null&&this.body.equals(w.body))},De.prototype.rename=function(w){return w.get_free_variable(this)},Te.prototype.rename=function(w){return this},j.prototype.rename=function(w){return new j(this.id,s(this.args,function(P){return P.rename(w)}))},Fe.prototype.rename=function(w){return this},Ve.prototype.rename=function(w){return new Ve(this.head.rename(w),this.body!==null?this.body.rename(w):null)},De.prototype.variables=function(){return[this.id]},Te.prototype.variables=function(){return[]},j.prototype.variables=function(){return[].concat.apply([],s(this.args,function(w){return w.variables()}))},Fe.prototype.variables=function(){return[]},Ve.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},De.prototype.apply=function(w){return w.lookup(this.id)?w.lookup(this.id):this},Te.prototype.apply=function(w){return this},j.prototype.apply=function(w){if(this.indicator===\"./2\"){for(var P=[],y=this;y.indicator===\"./2\";)P.push(y.args[0].apply(w)),y=y.args[1];for(var F=y.apply(w),z=P.length-1;z>=0;z--)F=new j(\".\",[P[z],F]);return F}return new j(this.id,s(this.args,function(Z){return Z.apply(w)}),this.ref)},Fe.prototype.apply=function(w){return this},Ve.prototype.apply=function(w){return new Ve(this.head.apply(w),this.body!==null?this.body.apply(w):null)},Ne.prototype.apply=function(w){var P,y={};for(P in this.links)this.links.hasOwnProperty(P)&&(y[P]=this.links[P].apply(w));return new Ne(y)},j.prototype.select=function(){for(var w=this;w.indicator===\",/2\";)w=w.args[0];return w},j.prototype.replace=function(w){return this.indicator===\",/2\"?this.args[0].indicator===\",/2\"?new j(\",\",[this.args[0].replace(w),this.args[1]]):w===null?this.args[1]:new j(\",\",[w,this.args[1]]):w},j.prototype.search=function(w){if(x.type.is_term(w)&&w.ref!==void 0&&this.ref===w.ref)return!0;for(var P=0;P<this.args.length;P++)if(x.type.is_term(this.args[P])&&this.args[P].search(w))return!0;return!1},ke.prototype.get_current_input=function(){return this.current_input},it.prototype.get_current_input=function(){return this.session.get_current_input()},ke.prototype.get_current_output=function(){return this.current_output},it.prototype.get_current_output=function(){return this.session.get_current_output()},ke.prototype.set_current_input=function(w){this.current_input=w},it.prototype.set_current_input=function(w){return this.session.set_current_input(w)},ke.prototype.set_current_output=function(w){this.current_input=w},it.prototype.set_current_output=function(w){return this.session.set_current_output(w)},ke.prototype.get_stream_by_alias=function(w){return this.streams[w]},it.prototype.get_stream_by_alias=function(w){return this.session.get_stream_by_alias(w)},ke.prototype.file_system_open=function(w,P,y){return this.file_system.open(w,P,y)},it.prototype.file_system_open=function(w,P,y){return this.session.file_system_open(w,P,y)},ke.prototype.get_char_conversion=function(w){return this.__char_conversion[w]||w},it.prototype.get_char_conversion=function(w){return this.session.get_char_conversion(w)},ke.prototype.parse=function(w){return this.thread.parse(w)},it.prototype.parse=function(w){var P=new U(this);P.new_text(w);var y=P.get_tokens();if(y===null)return!1;var F=W(this,y,0,this.__get_max_priority(),!1);return F.len!==y.length?!1:{value:F.value,expr:F,tokens:y}},ke.prototype.get_flag=function(w){return this.flag[w]},it.prototype.get_flag=function(w){return this.session.get_flag(w)},ke.prototype.add_rule=function(w,P){return P=P||{},P.from=P.from?P.from:\"$tau-js\",this.src_predicates[w.head.indicator]=P.from,this.rules[w.head.indicator]||(this.rules[w.head.indicator]=[]),this.rules[w.head.indicator].push(w),this.public_predicates.hasOwnProperty(w.head.indicator)||(this.public_predicates[w.head.indicator]=!1),!0},it.prototype.add_rule=function(w,P){return this.session.add_rule(w,P)},ke.prototype.run_directive=function(w){this.thread.run_directive(w)},it.prototype.run_directive=function(w){return x.type.is_directive(w)?(x.directive[w.indicator](this,w),!0):!1},ke.prototype.__get_max_priority=function(){return\"1200\"},it.prototype.__get_max_priority=function(){return this.session.__get_max_priority()},ke.prototype.__get_next_priority=function(w){var P=0;w=parseInt(w);for(var y in this.__operators)if(this.__operators.hasOwnProperty(y)){var F=parseInt(y);F>P&&F<w&&(P=F)}return P.toString()},it.prototype.__get_next_priority=function(w){return this.session.__get_next_priority(w)},ke.prototype.__lookup_operator_classes=function(w,P){return this.__operators.hasOwnProperty(w)&&this.__operators[w][P]instanceof Array&&this.__operators[w][P]||!1},it.prototype.__lookup_operator_classes=function(w,P){return this.session.__lookup_operator_classes(w,P)},ke.prototype.lookup_operator=function(w,P){for(var y in this.__operators)if(this.__operators[y][w]){for(var F=0;F<this.__operators[y][w].length;F++)if(P===0||this.__operators[y][w][F].length===P+1)return{priority:y,class:this.__operators[y][w][F]}}return null},it.prototype.lookup_operator=function(w,P){return this.session.lookup_operator(w,P)},ke.prototype.throw_warning=function(w){this.thread.throw_warning(w)},it.prototype.throw_warning=function(w){this.warnings.push(w)},ke.prototype.get_warnings=function(){return this.thread.get_warnings()},it.prototype.get_warnings=function(){return this.warnings},ke.prototype.add_goal=function(w,P){this.thread.add_goal(w,P)},it.prototype.add_goal=function(w,P,y){y=y||null,P===!0&&(this.points=[]);for(var F=w.variables(),z={},Z=0;Z<F.length;Z++)z[F[Z]]=new De(F[Z]);this.points.push(new be(w,new Ne(z),y))},ke.prototype.consult=function(w,P){return this.thread.consult(w,P)},it.prototype.consult=function(w,P){var y=\"\";if(typeof w==\"string\"){y=w;var F=y.length;if(y.substring(F-3,F)===\".pl\"&&document.getElementById(y)){var z=document.getElementById(y),Z=z.getAttribute(\"type\");Z!==null&&Z.replace(/ /g,\"\").toLowerCase()===\"text/prolog\"&&(y=z.text)}}else if(w.nodeName)switch(w.nodeName.toLowerCase()){case\"input\":case\"textarea\":y=w.value;break;default:y=w.innerHTML;break}else return!1;return this.warnings=[],le(this,y,P)},ke.prototype.query=function(w){return this.thread.query(w)},it.prototype.query=function(w){return this.points=[],this.debugger_points=[],me(this,w)},ke.prototype.head_point=function(){return this.thread.head_point()},it.prototype.head_point=function(){return this.points[this.points.length-1]},ke.prototype.get_free_variable=function(w){return this.thread.get_free_variable(w)},it.prototype.get_free_variable=function(w){var P=[];if(w.id===\"_\"||this.session.renamed_variables[w.id]===void 0){for(this.session.rename++,this.points.length>0&&(P=this.head_point().substitution.domain());e(P,x.format_variable(this.session.rename))!==-1;)this.session.rename++;if(w.id===\"_\")return new De(x.format_variable(this.session.rename));this.session.renamed_variables[w.id]=x.format_variable(this.session.rename)}return new De(this.session.renamed_variables[w.id])},ke.prototype.next_free_variable=function(){return this.thread.next_free_variable()},it.prototype.next_free_variable=function(){this.session.rename++;var w=[];for(this.points.length>0&&(w=this.head_point().substitution.domain());e(w,x.format_variable(this.session.rename))!==-1;)this.session.rename++;return new De(x.format_variable(this.session.rename))},ke.prototype.is_public_predicate=function(w){return!this.public_predicates.hasOwnProperty(w)||this.public_predicates[w]===!0},it.prototype.is_public_predicate=function(w){return this.session.is_public_predicate(w)},ke.prototype.is_multifile_predicate=function(w){return this.multifile_predicates.hasOwnProperty(w)&&this.multifile_predicates[w]===!0},it.prototype.is_multifile_predicate=function(w){return this.session.is_multifile_predicate(w)},ke.prototype.prepend=function(w){return this.thread.prepend(w)},it.prototype.prepend=function(w){for(var P=w.length-1;P>=0;P--)this.points.push(w[P])},ke.prototype.success=function(w,P){return this.thread.success(w,P)},it.prototype.success=function(w,y){var y=typeof y>\"u\"?w:y;this.prepend([new be(w.goal.replace(null),w.substitution,y)])},ke.prototype.throw_error=function(w){return this.thread.throw_error(w)},it.prototype.throw_error=function(w){this.prepend([new be(new j(\"throw\",[w]),new Ne,null,null)])},ke.prototype.step_rule=function(w,P){return this.thread.step_rule(w,P)},it.prototype.step_rule=function(w,P){var y=P.indicator;if(w===\"user\"&&(w=null),w===null&&this.session.rules.hasOwnProperty(y))return this.session.rules[y];for(var F=w===null?this.session.modules:e(this.session.modules,w)===-1?[]:[w],z=0;z<F.length;z++){var Z=x.module[F[z]];if(Z.rules.hasOwnProperty(y)&&(Z.rules.hasOwnProperty(this.level)||Z.exports_predicate(y)))return x.module[F[z]].rules[y]}return null},ke.prototype.step=function(){return this.thread.step()},it.prototype.step=function(){if(this.points.length!==0){var w=!1,P=this.points.pop();if(this.debugger&&this.debugger_states.push(P),x.type.is_term(P.goal)){var y=P.goal.select(),F=null,z=[];if(y!==null){this.total_steps++;for(var Z=P;Z.parent!==null&&Z.parent.goal.search(y);)Z=Z.parent;if(this.level=Z.parent===null?\"top_level/0\":Z.parent.goal.select().indicator,x.type.is_term(y)&&y.indicator===\":/2\"&&(F=y.args[0].id,y=y.args[1]),F===null&&x.type.is_builtin(y))this.__call_indicator=y.indicator,w=x.predicate[y.indicator](this,P,y);else{var $=this.step_rule(F,y);if($===null)this.session.rules.hasOwnProperty(y.indicator)||(this.get_flag(\"unknown\").id===\"error\"?this.throw_error(x.error.existence(\"procedure\",y.indicator,this.level)):this.get_flag(\"unknown\").id===\"warning\"&&this.throw_warning(\"unknown procedure \"+y.indicator+\" (from \"+this.level+\")\"));else if($ instanceof Function)w=$(this,P,y);else{for(var oe in $)if($.hasOwnProperty(oe)){var xe=$[oe];this.session.renamed_variables={},xe=xe.rename(this);var Re=this.get_flag(\"occurs_check\").indicator===\"true/0\",lt=new be,Ct=x.unify(y,xe.head,Re);Ct!==null&&(lt.goal=P.goal.replace(xe.body),lt.goal!==null&&(lt.goal=lt.goal.apply(Ct)),lt.substitution=P.substitution.apply(Ct),lt.parent=P,z.push(lt))}this.prepend(z)}}}}else x.type.is_variable(P.goal)?this.throw_error(x.error.instantiation(this.level)):this.throw_error(x.error.type(\"callable\",P.goal,this.level));return w}},ke.prototype.answer=function(w){return this.thread.answer(w)},it.prototype.answer=function(w){w=w||function(P){},this.__calls.push(w),!(this.__calls.length>1)&&this.again()},ke.prototype.answers=function(w,P,y){return this.thread.answers(w,P,y)},it.prototype.answers=function(w,P,y){var F=P||1e3,z=this;if(P<=0){y&&y();return}this.answer(function(Z){w(Z),Z!==!1?setTimeout(function(){z.answers(w,P-1,y)},1):y&&y()})},ke.prototype.again=function(w){return this.thread.again(w)},it.prototype.again=function(w){for(var P,y=Date.now();this.__calls.length>0;){for(this.warnings=[],w!==!1&&(this.current_limit=this.session.limit);this.current_limit>0&&this.points.length>0&&this.head_point().goal!==null&&!x.type.is_error(this.head_point().goal);)if(this.current_limit--,this.step()===!0)return;var F=Date.now();this.cpu_time_last=F-y,this.cpu_time+=this.cpu_time_last;var z=this.__calls.shift();this.current_limit<=0?z(null):this.points.length===0?z(!1):x.type.is_error(this.head_point().goal)?(P=this.session.format_error(this.points.pop()),this.points=[],z(P)):(this.debugger&&this.debugger_states.push(this.head_point()),P=this.session.format_success(this.points.pop()),z(P))}},ke.prototype.unfold=function(w){if(w.body===null)return!1;var P=w.head,y=w.body,F=y.select(),z=new it(this),Z=[];z.add_goal(F),z.step();for(var $=z.points.length-1;$>=0;$--){var oe=z.points[$],xe=P.apply(oe.substitution),Re=y.replace(oe.goal);Re!==null&&(Re=Re.apply(oe.substitution)),Z.push(new Ve(xe,Re))}var lt=this.rules[P.indicator],Ct=e(lt,w);return Z.length>0&&Ct!==-1?(lt.splice.apply(lt,[Ct,1].concat(Z)),!0):!1},it.prototype.unfold=function(w){return this.session.unfold(w)},De.prototype.interpret=function(w){return x.error.instantiation(w.level)},Te.prototype.interpret=function(w){return this},j.prototype.interpret=function(w){return x.type.is_unitary_list(this)?this.args[0].interpret(w):x.operate(w,this)},De.prototype.compare=function(w){return this.id<w.id?-1:this.id>w.id?1:0},Te.prototype.compare=function(w){if(this.value===w.value&&this.is_float===w.is_float)return 0;if(this.value<w.value||this.value===w.value&&this.is_float&&!w.is_float)return-1;if(this.value>w.value)return 1},j.prototype.compare=function(w){if(this.args.length<w.args.length||this.args.length===w.args.length&&this.id<w.id)return-1;if(this.args.length>w.args.length||this.args.length===w.args.length&&this.id>w.id)return 1;for(var P=0;P<this.args.length;P++){var y=x.compare(this.args[P],w.args[P]);if(y!==0)return y}return 0},Ne.prototype.lookup=function(w){return this.links[w]?this.links[w]:null},Ne.prototype.filter=function(w){var P={};for(var y in this.links)if(this.links.hasOwnProperty(y)){var F=this.links[y];w(y,F)&&(P[y]=F)}return new Ne(P)},Ne.prototype.exclude=function(w){var P={};for(var y in this.links)this.links.hasOwnProperty(y)&&e(w,y)===-1&&(P[y]=this.links[y]);return new Ne(P)},Ne.prototype.add=function(w,P){this.links[w]=P},Ne.prototype.domain=function(w){var P=w===!0?function(z){return z}:function(z){return new De(z)},y=[];for(var F in this.links)y.push(P(F));return y},De.prototype.compile=function(){return'new pl.type.Var(\"'+this.id.toString()+'\")'},Te.prototype.compile=function(){return\"new pl.type.Num(\"+this.value.toString()+\", \"+this.is_float.toString()+\")\"},j.prototype.compile=function(){return'new pl.type.Term(\"'+this.id.replace(/\"/g,'\\\\\"')+'\", ['+s(this.args,function(w){return w.compile()})+\"])\"},Ve.prototype.compile=function(){return\"new pl.type.Rule(\"+this.head.compile()+\", \"+(this.body===null?\"null\":this.body.compile())+\")\"},ke.prototype.compile=function(){var w,P=[],y;for(var F in this.rules)if(this.rules.hasOwnProperty(F)){var z=this.rules[F];y=[],w='\"'+F+'\": [';for(var Z=0;Z<z.length;Z++)y.push(z[Z].compile());w+=y.join(),w+=\"]\",P.push(w)}return\"{\"+P.join()+\"};\"},De.prototype.toJavaScript=function(){},Te.prototype.toJavaScript=function(){return this.value},j.prototype.toJavaScript=function(){if(this.args.length===0&&this.indicator!==\"[]/0\")return this.id;if(x.type.is_list(this)){for(var w=[],P=this,y;P.indicator===\"./2\";){if(y=P.args[0].toJavaScript(),y===void 0)return;w.push(y),P=P.args[1]}if(P.indicator===\"[]/0\")return w}},Ve.prototype.singleton_variables=function(){var w=this.head.variables(),P={},y=[];this.body!==null&&(w=w.concat(this.body.variables()));for(var F=0;F<w.length;F++)P[w[F]]===void 0&&(P[w[F]]=0),P[w[F]]++;for(var z in P)z!==\"_\"&&P[z]===1&&y.push(z);return y};var x={__env:typeof ec<\"u\"&&ec.exports?global:window,module:{},version:t,parser:{tokenizer:U,expression:W},utils:{str_indicator:X,codePointAt:n,fromCodePoint:c},statistics:{getCountTerms:function(){return mt}},fromJavaScript:{test:{boolean:function(w){return w===!0||w===!1},number:function(w){return typeof w==\"number\"},string:function(w){return typeof w==\"string\"},list:function(w){return w instanceof Array},variable:function(w){return w===void 0},any:function(w){return!0}},conversion:{boolean:function(w){return new j(w?\"true\":\"false\",[])},number:function(w){return new Te(w,w%1!==0)},string:function(w){return new j(w,[])},list:function(w){for(var P=[],y,F=0;F<w.length;F++){if(y=x.fromJavaScript.apply(w[F]),y===void 0)return;P.push(y)}return g(P)},variable:function(w){return new De(\"_\")},any:function(w){}},apply:function(w){for(var P in x.fromJavaScript.test)if(P!==\"any\"&&x.fromJavaScript.test[P](w))return x.fromJavaScript.conversion[P](w);return x.fromJavaScript.conversion.any(w)}},type:{Var:De,Num:Te,Term:j,Rule:Ve,State:be,Stream:Fe,Module:Ue,Thread:it,Session:ke,Substitution:Ne,order:[De,Te,j,Fe],compare:function(w,P){var y=e(x.type.order,w.constructor),F=e(x.type.order,P.constructor);if(y<F)return-1;if(y>F)return 1;if(w.constructor===Te){if(w.is_float&&P.is_float)return 0;if(w.is_float)return-1;if(P.is_float)return 1}return 0},is_substitution:function(w){return w instanceof Ne},is_state:function(w){return w instanceof be},is_rule:function(w){return w instanceof Ve},is_variable:function(w){return w instanceof De},is_stream:function(w){return w instanceof Fe},is_anonymous_var:function(w){return w instanceof De&&w.id===\"_\"},is_callable:function(w){return w instanceof j},is_number:function(w){return w instanceof Te},is_integer:function(w){return w instanceof Te&&!w.is_float},is_float:function(w){return w instanceof Te&&w.is_float},is_term:function(w){return w instanceof j},is_atom:function(w){return w instanceof j&&w.args.length===0},is_ground:function(w){if(w instanceof De)return!1;if(w instanceof j){for(var P=0;P<w.args.length;P++)if(!x.type.is_ground(w.args[P]))return!1}return!0},is_atomic:function(w){return w instanceof j&&w.args.length===0||w instanceof Te},is_compound:function(w){return w instanceof j&&w.args.length>0},is_list:function(w){return w instanceof j&&(w.indicator===\"[]/0\"||w.indicator===\"./2\")},is_empty_list:function(w){return w instanceof j&&w.indicator===\"[]/0\"},is_non_empty_list:function(w){return w instanceof j&&w.indicator===\"./2\"},is_fully_list:function(w){for(;w instanceof j&&w.indicator===\"./2\";)w=w.args[1];return w instanceof De||w instanceof j&&w.indicator===\"[]/0\"},is_instantiated_list:function(w){for(;w instanceof j&&w.indicator===\"./2\";)w=w.args[1];return w instanceof j&&w.indicator===\"[]/0\"},is_unitary_list:function(w){return w instanceof j&&w.indicator===\"./2\"&&w.args[1]instanceof j&&w.args[1].indicator===\"[]/0\"},is_character:function(w){return w instanceof j&&(w.id.length===1||w.id.length>0&&w.id.length<=2&&n(w.id,0)>=65536)},is_character_code:function(w){return w instanceof Te&&!w.is_float&&w.value>=0&&w.value<=1114111},is_byte:function(w){return w instanceof Te&&!w.is_float&&w.value>=0&&w.value<=255},is_operator:function(w){return w instanceof j&&x.arithmetic.evaluation[w.indicator]},is_directive:function(w){return w instanceof j&&x.directive[w.indicator]!==void 0},is_builtin:function(w){return w instanceof j&&x.predicate[w.indicator]!==void 0},is_error:function(w){return w instanceof j&&w.indicator===\"throw/1\"},is_predicate_indicator:function(w){return w instanceof j&&w.indicator===\"//2\"&&w.args[0]instanceof j&&w.args[0].args.length===0&&w.args[1]instanceof Te&&w.args[1].is_float===!1},is_flag:function(w){return w instanceof j&&w.args.length===0&&x.flag[w.id]!==void 0},is_value_flag:function(w,P){if(!x.type.is_flag(w))return!1;for(var y in x.flag[w.id].allowed)if(x.flag[w.id].allowed.hasOwnProperty(y)&&x.flag[w.id].allowed[y].equals(P))return!0;return!1},is_io_mode:function(w){return x.type.is_atom(w)&&[\"read\",\"write\",\"append\"].indexOf(w.id)!==-1},is_stream_option:function(w){return x.type.is_term(w)&&(w.indicator===\"alias/1\"&&x.type.is_atom(w.args[0])||w.indicator===\"reposition/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")||w.indicator===\"type/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"text\"||w.args[0].id===\"binary\")||w.indicator===\"eof_action/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"error\"||w.args[0].id===\"eof_code\"||w.args[0].id===\"reset\"))},is_stream_position:function(w){return x.type.is_integer(w)&&w.value>=0||x.type.is_atom(w)&&(w.id===\"end_of_stream\"||w.id===\"past_end_of_stream\")},is_stream_property:function(w){return x.type.is_term(w)&&(w.indicator===\"input/0\"||w.indicator===\"output/0\"||w.indicator===\"alias/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0]))||w.indicator===\"file_name/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0]))||w.indicator===\"position/1\"&&(x.type.is_variable(w.args[0])||x.type.is_stream_position(w.args[0]))||w.indicator===\"reposition/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\"))||w.indicator===\"type/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"text\"||w.args[0].id===\"binary\"))||w.indicator===\"mode/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"read\"||w.args[0].id===\"write\"||w.args[0].id===\"append\"))||w.indicator===\"eof_action/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"error\"||w.args[0].id===\"eof_code\"||w.args[0].id===\"reset\"))||w.indicator===\"end_of_stream/1\"&&(x.type.is_variable(w.args[0])||x.type.is_atom(w.args[0])&&(w.args[0].id===\"at\"||w.args[0].id===\"past\"||w.args[0].id===\"not\")))},is_streamable:function(w){return w.__proto__.stream!==void 0},is_read_option:function(w){return x.type.is_term(w)&&[\"variables/1\",\"variable_names/1\",\"singletons/1\"].indexOf(w.indicator)!==-1},is_write_option:function(w){return x.type.is_term(w)&&(w.indicator===\"quoted/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")||w.indicator===\"ignore_ops/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")||w.indicator===\"numbervars/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\"))},is_close_option:function(w){return x.type.is_term(w)&&w.indicator===\"force/1\"&&x.type.is_atom(w.args[0])&&(w.args[0].id===\"true\"||w.args[0].id===\"false\")},is_modifiable_flag:function(w){return x.type.is_flag(w)&&x.flag[w.id].changeable},is_module:function(w){return w instanceof j&&w.indicator===\"library/1\"&&w.args[0]instanceof j&&w.args[0].args.length===0&&x.module[w.args[0].id]!==void 0}},arithmetic:{evaluation:{\"e/0\":{type_args:null,type_result:!0,fn:function(w){return Math.E}},\"pi/0\":{type_args:null,type_result:!0,fn:function(w){return Math.PI}},\"tau/0\":{type_args:null,type_result:!0,fn:function(w){return 2*Math.PI}},\"epsilon/0\":{type_args:null,type_result:!0,fn:function(w){return Number.EPSILON}},\"+/1\":{type_args:null,type_result:null,fn:function(w,P){return w}},\"-/1\":{type_args:null,type_result:null,fn:function(w,P){return-w}},\"\\\\/1\":{type_args:!1,type_result:!1,fn:function(w,P){return~w}},\"abs/1\":{type_args:null,type_result:null,fn:function(w,P){return Math.abs(w)}},\"sign/1\":{type_args:null,type_result:null,fn:function(w,P){return Math.sign(w)}},\"float_integer_part/1\":{type_args:!0,type_result:!1,fn:function(w,P){return parseInt(w)}},\"float_fractional_part/1\":{type_args:!0,type_result:!0,fn:function(w,P){return w-parseInt(w)}},\"float/1\":{type_args:null,type_result:!0,fn:function(w,P){return parseFloat(w)}},\"floor/1\":{type_args:!0,type_result:!1,fn:function(w,P){return Math.floor(w)}},\"truncate/1\":{type_args:!0,type_result:!1,fn:function(w,P){return parseInt(w)}},\"round/1\":{type_args:!0,type_result:!1,fn:function(w,P){return Math.round(w)}},\"ceiling/1\":{type_args:!0,type_result:!1,fn:function(w,P){return Math.ceil(w)}},\"sin/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.sin(w)}},\"cos/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.cos(w)}},\"tan/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.tan(w)}},\"asin/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.asin(w)}},\"acos/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.acos(w)}},\"atan/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.atan(w)}},\"atan2/2\":{type_args:null,type_result:!0,fn:function(w,P,y){return Math.atan2(w,P)}},\"exp/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.exp(w)}},\"sqrt/1\":{type_args:null,type_result:!0,fn:function(w,P){return Math.sqrt(w)}},\"log/1\":{type_args:null,type_result:!0,fn:function(w,P){return w>0?Math.log(w):x.error.evaluation(\"undefined\",P.__call_indicator)}},\"+/2\":{type_args:null,type_result:null,fn:function(w,P,y){return w+P}},\"-/2\":{type_args:null,type_result:null,fn:function(w,P,y){return w-P}},\"*/2\":{type_args:null,type_result:null,fn:function(w,P,y){return w*P}},\"//2\":{type_args:null,type_result:!0,fn:function(w,P,y){return P?w/P:x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"///2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return P?parseInt(w/P):x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"**/2\":{type_args:null,type_result:!0,fn:function(w,P,y){return Math.pow(w,P)}},\"^/2\":{type_args:null,type_result:null,fn:function(w,P,y){return Math.pow(w,P)}},\"<</2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return w<<P}},\">>/2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return w>>P}},\"/\\\\/2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return w&P}},\"\\\\//2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return w|P}},\"xor/2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return w^P}},\"rem/2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return P?w%P:x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"mod/2\":{type_args:!1,type_result:!1,fn:function(w,P,y){return P?w-parseInt(w/P)*P:x.error.evaluation(\"zero_division\",y.__call_indicator)}},\"max/2\":{type_args:null,type_result:null,fn:function(w,P,y){return Math.max(w,P)}},\"min/2\":{type_args:null,type_result:null,fn:function(w,P,y){return Math.min(w,P)}}}},directive:{\"dynamic/1\":function(w,P){var y=P.args[0];if(x.type.is_variable(y))w.throw_error(x.error.instantiation(P.indicator));else if(!x.type.is_compound(y)||y.indicator!==\"//2\")w.throw_error(x.error.type(\"predicate_indicator\",y,P.indicator));else if(x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1]))w.throw_error(x.error.instantiation(P.indicator));else if(!x.type.is_atom(y.args[0]))w.throw_error(x.error.type(\"atom\",y.args[0],P.indicator));else if(!x.type.is_integer(y.args[1]))w.throw_error(x.error.type(\"integer\",y.args[1],P.indicator));else{var F=P.args[0].args[0].id+\"/\"+P.args[0].args[1].value;w.session.public_predicates[F]=!0,w.session.rules[F]||(w.session.rules[F]=[])}},\"multifile/1\":function(w,P){var y=P.args[0];x.type.is_variable(y)?w.throw_error(x.error.instantiation(P.indicator)):!x.type.is_compound(y)||y.indicator!==\"//2\"?w.throw_error(x.error.type(\"predicate_indicator\",y,P.indicator)):x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1])?w.throw_error(x.error.instantiation(P.indicator)):x.type.is_atom(y.args[0])?x.type.is_integer(y.args[1])?w.session.multifile_predicates[P.args[0].args[0].id+\"/\"+P.args[0].args[1].value]=!0:w.throw_error(x.error.type(\"integer\",y.args[1],P.indicator)):w.throw_error(x.error.type(\"atom\",y.args[0],P.indicator))},\"set_prolog_flag/2\":function(w,P){var y=P.args[0],F=P.args[1];x.type.is_variable(y)||x.type.is_variable(F)?w.throw_error(x.error.instantiation(P.indicator)):x.type.is_atom(y)?x.type.is_flag(y)?x.type.is_value_flag(y,F)?x.type.is_modifiable_flag(y)?w.session.flag[y.id]=F:w.throw_error(x.error.permission(\"modify\",\"flag\",y)):w.throw_error(x.error.domain(\"flag_value\",new j(\"+\",[y,F]),P.indicator)):w.throw_error(x.error.domain(\"prolog_flag\",y,P.indicator)):w.throw_error(x.error.type(\"atom\",y,P.indicator))},\"use_module/1\":function(w,P){var y=P.args[0];if(x.type.is_variable(y))w.throw_error(x.error.instantiation(P.indicator));else if(!x.type.is_term(y))w.throw_error(x.error.type(\"term\",y,P.indicator));else if(x.type.is_module(y)){var F=y.args[0].id;e(w.session.modules,F)===-1&&w.session.modules.push(F)}},\"char_conversion/2\":function(w,P){var y=P.args[0],F=P.args[1];x.type.is_variable(y)||x.type.is_variable(F)?w.throw_error(x.error.instantiation(P.indicator)):x.type.is_character(y)?x.type.is_character(F)?y.id===F.id?delete w.session.__char_conversion[y.id]:w.session.__char_conversion[y.id]=F.id:w.throw_error(x.error.type(\"character\",F,P.indicator)):w.throw_error(x.error.type(\"character\",y,P.indicator))},\"op/3\":function(w,P){var y=P.args[0],F=P.args[1],z=P.args[2];if(x.type.is_variable(y)||x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(P.indicator));else if(!x.type.is_integer(y))w.throw_error(x.error.type(\"integer\",y,P.indicator));else if(!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,P.indicator));else if(!x.type.is_atom(z))w.throw_error(x.error.type(\"atom\",z,P.indicator));else if(y.value<0||y.value>1200)w.throw_error(x.error.domain(\"operator_priority\",y,P.indicator));else if(z.id===\",\")w.throw_error(x.error.permission(\"modify\",\"operator\",z,P.indicator));else if(z.id===\"|\"&&(y.value<1001||F.id.length!==3))w.throw_error(x.error.permission(\"modify\",\"operator\",z,P.indicator));else if([\"fy\",\"fx\",\"yf\",\"xf\",\"xfx\",\"yfx\",\"xfy\"].indexOf(F.id)===-1)w.throw_error(x.error.domain(\"operator_specifier\",F,P.indicator));else{var Z={prefix:null,infix:null,postfix:null};for(var $ in w.session.__operators)if(w.session.__operators.hasOwnProperty($)){var oe=w.session.__operators[$][z.id];oe&&(e(oe,\"fx\")!==-1&&(Z.prefix={priority:$,type:\"fx\"}),e(oe,\"fy\")!==-1&&(Z.prefix={priority:$,type:\"fy\"}),e(oe,\"xf\")!==-1&&(Z.postfix={priority:$,type:\"xf\"}),e(oe,\"yf\")!==-1&&(Z.postfix={priority:$,type:\"yf\"}),e(oe,\"xfx\")!==-1&&(Z.infix={priority:$,type:\"xfx\"}),e(oe,\"xfy\")!==-1&&(Z.infix={priority:$,type:\"xfy\"}),e(oe,\"yfx\")!==-1&&(Z.infix={priority:$,type:\"yfx\"}))}var xe;switch(F.id){case\"fy\":case\"fx\":xe=\"prefix\";break;case\"yf\":case\"xf\":xe=\"postfix\";break;default:xe=\"infix\";break}if(((Z.prefix&&xe===\"prefix\"||Z.postfix&&xe===\"postfix\"||Z.infix&&xe===\"infix\")&&Z[xe].type!==F.id||Z.infix&&xe===\"postfix\"||Z.postfix&&xe===\"infix\")&&y.value!==0)w.throw_error(x.error.permission(\"create\",\"operator\",z,P.indicator));else return Z[xe]&&(we(w.session.__operators[Z[xe].priority][z.id],F.id),w.session.__operators[Z[xe].priority][z.id].length===0&&delete w.session.__operators[Z[xe].priority][z.id]),y.value>0&&(w.session.__operators[y.value]||(w.session.__operators[y.value.toString()]={}),w.session.__operators[y.value][z.id]||(w.session.__operators[y.value][z.id]=[]),w.session.__operators[y.value][z.id].push(F.id)),!0}}},predicate:{\"op/3\":function(w,P,y){x.directive[\"op/3\"](w,y)&&w.success(P)},\"current_op/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2],$=[];for(var oe in w.session.__operators)for(var xe in w.session.__operators[oe])for(var Re=0;Re<w.session.__operators[oe][xe].length;Re++)$.push(new be(P.goal.replace(new j(\",\",[new j(\"=\",[new Te(oe,!1),F]),new j(\",\",[new j(\"=\",[new j(w.session.__operators[oe][xe][Re],[]),z]),new j(\"=\",[new j(xe,[]),Z])])])),P.substitution,P));w.prepend($)},\";/2\":function(w,P,y){if(x.type.is_term(y.args[0])&&y.args[0].indicator===\"->/2\"){var F=w.points,z=w.session.format_success,Z=w.session.format_error;w.session.format_success=function(Re){return Re.substitution},w.session.format_error=function(Re){return Re.goal},w.points=[new be(y.args[0].args[0],P.substitution,P)];var $=function(Re){w.points=F,w.session.format_success=z,w.session.format_error=Z,Re===!1?w.prepend([new be(P.goal.replace(y.args[1]),P.substitution,P)]):x.type.is_error(Re)?w.throw_error(Re.args[0]):Re===null?(w.prepend([P]),w.__calls.shift()(null)):w.prepend([new be(P.goal.replace(y.args[0].args[1]).apply(Re),P.substitution.apply(Re),P)])};w.__calls.unshift($)}else{var oe=new be(P.goal.replace(y.args[0]),P.substitution,P),xe=new be(P.goal.replace(y.args[1]),P.substitution,P);w.prepend([oe,xe])}},\"!/0\":function(w,P,y){var F,z,Z=[];for(F=P,z=null;F.parent!==null&&F.parent.goal.search(y);)if(z=F,F=F.parent,F.goal!==null){var $=F.goal.select();if($&&$.id===\"call\"&&$.search(y)){F=z;break}}for(var oe=w.points.length-1;oe>=0;oe--){for(var xe=w.points[oe],Re=xe.parent;Re!==null&&Re!==F.parent;)Re=Re.parent;Re===null&&Re!==F.parent&&Z.push(xe)}w.points=Z.reverse(),w.success(P)},\"\\\\+/1\":function(w,P,y){var F=y.args[0];x.type.is_variable(F)?w.throw_error(x.error.instantiation(w.level)):x.type.is_callable(F)?w.prepend([new be(P.goal.replace(new j(\",\",[new j(\",\",[new j(\"call\",[F]),new j(\"!\",[])]),new j(\"fail\",[])])),P.substitution,P),new be(P.goal.replace(null),P.substitution,P)]):w.throw_error(x.error.type(\"callable\",F,w.level))},\"->/2\":function(w,P,y){var F=P.goal.replace(new j(\",\",[y.args[0],new j(\",\",[new j(\"!\"),y.args[1]])]));w.prepend([new be(F,P.substitution,P)])},\"fail/0\":function(w,P,y){},\"false/0\":function(w,P,y){},\"true/0\":function(w,P,y){w.success(P)},\"call/1\":se(1),\"call/2\":se(2),\"call/3\":se(3),\"call/4\":se(4),\"call/5\":se(5),\"call/6\":se(6),\"call/7\":se(7),\"call/8\":se(8),\"once/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"call\",[F]),new j(\"!\",[])])),P.substitution,P)])},\"forall/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\"\\\\+\",[new j(\",\",[new j(\"call\",[F]),new j(\"\\\\+\",[new j(\"call\",[z])])])])),P.substitution,P)])},\"repeat/0\":function(w,P,y){w.prepend([new be(P.goal.replace(null),P.substitution,P),P])},\"throw/1\":function(w,P,y){x.type.is_variable(y.args[0])?w.throw_error(x.error.instantiation(w.level)):w.throw_error(y.args[0])},\"catch/3\":function(w,P,y){var F=w.points;w.points=[],w.prepend([new be(y.args[0],P.substitution,P)]);var z=w.session.format_success,Z=w.session.format_error;w.session.format_success=function(oe){return oe.substitution},w.session.format_error=function(oe){return oe.goal};var $=function(oe){var xe=w.points;if(w.points=F,w.session.format_success=z,w.session.format_error=Z,x.type.is_error(oe)){for(var Re=[],lt=w.points.length-1;lt>=0;lt--){for(var ir=w.points[lt],Ct=ir.parent;Ct!==null&&Ct!==P.parent;)Ct=Ct.parent;Ct===null&&Ct!==P.parent&&Re.push(ir)}w.points=Re;var qt=w.get_flag(\"occurs_check\").indicator===\"true/0\",ir=new be,bt=x.unify(oe.args[0],y.args[1],qt);bt!==null?(ir.substitution=P.substitution.apply(bt),ir.goal=P.goal.replace(y.args[2]).apply(bt),ir.parent=P,w.prepend([ir])):w.throw_error(oe.args[0])}else if(oe!==!1){for(var gn=oe===null?[]:[new be(P.goal.apply(oe).replace(null),P.substitution.apply(oe),P)],br=[],lt=xe.length-1;lt>=0;lt--){br.push(xe[lt]);var Ir=xe[lt].goal!==null?xe[lt].goal.select():null;if(x.type.is_term(Ir)&&Ir.indicator===\"!/0\")break}var Or=s(br,function(nn){return nn.goal===null&&(nn.goal=new j(\"true\",[])),nn=new be(P.goal.replace(new j(\"catch\",[nn.goal,y.args[1],y.args[2]])),P.substitution.apply(nn.substitution),nn.parent),nn.exclude=y.args[0].variables(),nn}).reverse();w.prepend(Or),w.prepend(gn),oe===null&&(this.current_limit=0,w.__calls.shift()(null))}};w.__calls.unshift($)},\"=/2\":function(w,P,y){var F=w.get_flag(\"occurs_check\").indicator===\"true/0\",z=new be,Z=x.unify(y.args[0],y.args[1],F);Z!==null&&(z.goal=P.goal.apply(Z).replace(null),z.substitution=P.substitution.apply(Z),z.parent=P,w.prepend([z]))},\"unify_with_occurs_check/2\":function(w,P,y){var F=new be,z=x.unify(y.args[0],y.args[1],!0);z!==null&&(F.goal=P.goal.apply(z).replace(null),F.substitution=P.substitution.apply(z),F.parent=P,w.prepend([F]))},\"\\\\=/2\":function(w,P,y){var F=w.get_flag(\"occurs_check\").indicator===\"true/0\",z=x.unify(y.args[0],y.args[1],F);z===null&&w.success(P)},\"subsumes_term/2\":function(w,P,y){var F=w.get_flag(\"occurs_check\").indicator===\"true/0\",z=x.unify(y.args[1],y.args[0],F);z!==null&&y.args[1].apply(z).equals(y.args[1])&&w.success(P)},\"findall/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2];if(x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(z))w.throw_error(x.error.type(\"callable\",z,y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_list(Z))w.throw_error(x.error.type(\"list\",Z,y.indicator));else{var $=w.next_free_variable(),oe=new j(\",\",[z,new j(\"=\",[$,F])]),xe=w.points,Re=w.session.limit,lt=w.session.format_success;w.session.format_success=function(ir){return ir.substitution},w.add_goal(oe,!0,P);var Ct=[],qt=function(ir){if(ir!==!1&&ir!==null&&!x.type.is_error(ir))w.__calls.unshift(qt),Ct.push(ir.links[$.id]),w.session.limit=w.current_limit;else if(w.points=xe,w.session.limit=Re,w.session.format_success=lt,x.type.is_error(ir))w.throw_error(ir.args[0]);else if(w.current_limit>0){for(var bt=new j(\"[]\"),gn=Ct.length-1;gn>=0;gn--)bt=new j(\".\",[Ct[gn],bt]);w.prepend([new be(P.goal.replace(new j(\"=\",[Z,bt])),P.substitution,P)])}};w.__calls.unshift(qt)}},\"bagof/3\":function(w,P,y){var F,z=y.args[0],Z=y.args[1],$=y.args[2];if(x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(Z))w.throw_error(x.error.type(\"callable\",Z,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_list($))w.throw_error(x.error.type(\"list\",$,y.indicator));else{var oe=w.next_free_variable(),xe;Z.indicator===\"^/2\"?(xe=Z.args[0].variables(),Z=Z.args[1]):xe=[],xe=xe.concat(z.variables());for(var Re=Z.variables().filter(function(Or){return e(xe,Or)===-1}),lt=new j(\"[]\"),Ct=Re.length-1;Ct>=0;Ct--)lt=new j(\".\",[new De(Re[Ct]),lt]);var qt=new j(\",\",[Z,new j(\"=\",[oe,new j(\",\",[lt,z])])]),ir=w.points,bt=w.session.limit,gn=w.session.format_success;w.session.format_success=function(Or){return Or.substitution},w.add_goal(qt,!0,P);var br=[],Ir=function(Or){if(Or!==!1&&Or!==null&&!x.type.is_error(Or)){w.__calls.unshift(Ir);var nn=!1,ai=Or.links[oe.id].args[0],Io=Or.links[oe.id].args[1];for(var ts in br)if(br.hasOwnProperty(ts)){var $s=br[ts];if($s.variables.equals(ai)){$s.answers.push(Io),nn=!0;break}}nn||br.push({variables:ai,answers:[Io]}),w.session.limit=w.current_limit}else if(w.points=ir,w.session.limit=bt,w.session.format_success=gn,x.type.is_error(Or))w.throw_error(Or.args[0]);else if(w.current_limit>0){for(var Co=[],Hi=0;Hi<br.length;Hi++){Or=br[Hi].answers;for(var eo=new j(\"[]\"),wo=Or.length-1;wo>=0;wo--)eo=new j(\".\",[Or[wo],eo]);Co.push(new be(P.goal.replace(new j(\",\",[new j(\"=\",[lt,br[Hi].variables]),new j(\"=\",[$,eo])])),P.substitution,P))}w.prepend(Co)}};w.__calls.unshift(Ir)}},\"setof/3\":function(w,P,y){var F,z=y.args[0],Z=y.args[1],$=y.args[2];if(x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(Z))w.throw_error(x.error.type(\"callable\",Z,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_list($))w.throw_error(x.error.type(\"list\",$,y.indicator));else{var oe=w.next_free_variable(),xe;Z.indicator===\"^/2\"?(xe=Z.args[0].variables(),Z=Z.args[1]):xe=[],xe=xe.concat(z.variables());for(var Re=Z.variables().filter(function(Or){return e(xe,Or)===-1}),lt=new j(\"[]\"),Ct=Re.length-1;Ct>=0;Ct--)lt=new j(\".\",[new De(Re[Ct]),lt]);var qt=new j(\",\",[Z,new j(\"=\",[oe,new j(\",\",[lt,z])])]),ir=w.points,bt=w.session.limit,gn=w.session.format_success;w.session.format_success=function(Or){return Or.substitution},w.add_goal(qt,!0,P);var br=[],Ir=function(Or){if(Or!==!1&&Or!==null&&!x.type.is_error(Or)){w.__calls.unshift(Ir);var nn=!1,ai=Or.links[oe.id].args[0],Io=Or.links[oe.id].args[1];for(var ts in br)if(br.hasOwnProperty(ts)){var $s=br[ts];if($s.variables.equals(ai)){$s.answers.push(Io),nn=!0;break}}nn||br.push({variables:ai,answers:[Io]}),w.session.limit=w.current_limit}else if(w.points=ir,w.session.limit=bt,w.session.format_success=gn,x.type.is_error(Or))w.throw_error(Or.args[0]);else if(w.current_limit>0){for(var Co=[],Hi=0;Hi<br.length;Hi++){Or=br[Hi].answers.sort(x.compare);for(var eo=new j(\"[]\"),wo=Or.length-1;wo>=0;wo--)eo=new j(\".\",[Or[wo],eo]);Co.push(new be(P.goal.replace(new j(\",\",[new j(\"=\",[lt,br[Hi].variables]),new j(\"=\",[$,eo])])),P.substitution,P))}w.prepend(Co)}};w.__calls.unshift(Ir)}},\"functor/3\":function(w,P,y){var F,z=y.args[0],Z=y.args[1],$=y.args[2];if(x.type.is_variable(z)&&(x.type.is_variable(Z)||x.type.is_variable($)))w.throw_error(x.error.instantiation(\"functor/3\"));else if(!x.type.is_variable($)&&!x.type.is_integer($))w.throw_error(x.error.type(\"integer\",y.args[2],\"functor/3\"));else if(!x.type.is_variable(Z)&&!x.type.is_atomic(Z))w.throw_error(x.error.type(\"atomic\",y.args[1],\"functor/3\"));else if(x.type.is_integer(Z)&&x.type.is_integer($)&&$.value!==0)w.throw_error(x.error.type(\"atom\",y.args[1],\"functor/3\"));else if(x.type.is_variable(z)){if(y.args[2].value>=0){for(var oe=[],xe=0;xe<$.value;xe++)oe.push(w.next_free_variable());var Re=x.type.is_integer(Z)?Z:new j(Z.id,oe);w.prepend([new be(P.goal.replace(new j(\"=\",[z,Re])),P.substitution,P)])}}else{var lt=x.type.is_integer(z)?z:new j(z.id,[]),Ct=x.type.is_integer(z)?new Te(0,!1):new Te(z.args.length,!1),qt=new j(\",\",[new j(\"=\",[lt,Z]),new j(\"=\",[Ct,$])]);w.prepend([new be(P.goal.replace(qt),P.substitution,P)])}},\"arg/3\":function(w,P,y){if(x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1]))w.throw_error(x.error.instantiation(y.indicator));else if(y.args[0].value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",y.args[0],y.indicator));else if(!x.type.is_compound(y.args[1]))w.throw_error(x.error.type(\"compound\",y.args[1],y.indicator));else{var F=y.args[0].value;if(F>0&&F<=y.args[1].args.length){var z=new j(\"=\",[y.args[1].args[F-1],y.args[2]]);w.prepend([new be(P.goal.replace(z),P.substitution,P)])}}},\"=../2\":function(w,P,y){var F;if(x.type.is_variable(y.args[0])&&(x.type.is_variable(y.args[1])||x.type.is_non_empty_list(y.args[1])&&x.type.is_variable(y.args[1].args[0])))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_fully_list(y.args[1]))w.throw_error(x.error.type(\"list\",y.args[1],y.indicator));else if(x.type.is_variable(y.args[0])){if(!x.type.is_variable(y.args[1])){var Z=[];for(F=y.args[1].args[1];F.indicator===\"./2\";)Z.push(F.args[0]),F=F.args[1];x.type.is_variable(y.args[0])&&x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):Z.length===0&&x.type.is_compound(y.args[1].args[0])?w.throw_error(x.error.type(\"atomic\",y.args[1].args[0],y.indicator)):Z.length>0&&(x.type.is_compound(y.args[1].args[0])||x.type.is_number(y.args[1].args[0]))?w.throw_error(x.error.type(\"atom\",y.args[1].args[0],y.indicator)):Z.length===0?w.prepend([new be(P.goal.replace(new j(\"=\",[y.args[1].args[0],y.args[0]],P)),P.substitution,P)]):w.prepend([new be(P.goal.replace(new j(\"=\",[new j(y.args[1].args[0].id,Z),y.args[0]])),P.substitution,P)])}}else{if(x.type.is_atomic(y.args[0]))F=new j(\".\",[y.args[0],new j(\"[]\")]);else{F=new j(\"[]\");for(var z=y.args[0].args.length-1;z>=0;z--)F=new j(\".\",[y.args[0].args[z],F]);F=new j(\".\",[new j(y.args[0].id),F])}w.prepend([new be(P.goal.replace(new j(\"=\",[F,y.args[1]])),P.substitution,P)])}},\"copy_term/2\":function(w,P,y){var F=y.args[0].rename(w);w.prepend([new be(P.goal.replace(new j(\"=\",[F,y.args[1]])),P.substitution,P.parent)])},\"term_variables/2\":function(w,P,y){var F=y.args[0],z=y.args[1];if(!x.type.is_fully_list(z))w.throw_error(x.error.type(\"list\",z,y.indicator));else{var Z=g(s(ye(F.variables()),function($){return new De($)}));w.prepend([new be(P.goal.replace(new j(\"=\",[z,Z])),P.substitution,P)])}},\"clause/2\":function(w,P,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else if(!x.type.is_variable(y.args[1])&&!x.type.is_callable(y.args[1]))w.throw_error(x.error.type(\"callable\",y.args[1],y.indicator));else if(w.session.rules[y.args[0].indicator]!==void 0)if(w.is_public_predicate(y.args[0].indicator)){var F=[];for(var z in w.session.rules[y.args[0].indicator])if(w.session.rules[y.args[0].indicator].hasOwnProperty(z)){var Z=w.session.rules[y.args[0].indicator][z];w.session.renamed_variables={},Z=Z.rename(w),Z.body===null&&(Z.body=new j(\"true\"));var $=new j(\",\",[new j(\"=\",[Z.head,y.args[0]]),new j(\"=\",[Z.body,y.args[1]])]);F.push(new be(P.goal.replace($),P.substitution,P))}w.prepend(F)}else w.throw_error(x.error.permission(\"access\",\"private_procedure\",y.args[0].indicator,y.indicator))},\"current_predicate/1\":function(w,P,y){var F=y.args[0];if(!x.type.is_variable(F)&&(!x.type.is_compound(F)||F.indicator!==\"//2\"))w.throw_error(x.error.type(\"predicate_indicator\",F,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_variable(F.args[0])&&!x.type.is_atom(F.args[0]))w.throw_error(x.error.type(\"atom\",F.args[0],y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_variable(F.args[1])&&!x.type.is_integer(F.args[1]))w.throw_error(x.error.type(\"integer\",F.args[1],y.indicator));else{var z=[];for(var Z in w.session.rules)if(w.session.rules.hasOwnProperty(Z)){var $=Z.lastIndexOf(\"/\"),oe=Z.substr(0,$),xe=parseInt(Z.substr($+1,Z.length-($+1))),Re=new j(\"/\",[new j(oe),new Te(xe,!1)]),lt=new j(\"=\",[Re,F]);z.push(new be(P.goal.replace(lt),P.substitution,P))}w.prepend(z)}},\"asserta/1\":function(w,P,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else{var F,z;y.args[0].indicator===\":-/2\"?(F=y.args[0].args[0],z=Ce(y.args[0].args[1])):(F=y.args[0],z=null),x.type.is_callable(F)?z!==null&&!x.type.is_callable(z)?w.throw_error(x.error.type(\"callable\",z,y.indicator)):w.is_public_predicate(F.indicator)?(w.session.rules[F.indicator]===void 0&&(w.session.rules[F.indicator]=[]),w.session.public_predicates[F.indicator]=!0,w.session.rules[F.indicator]=[new Ve(F,z,!0)].concat(w.session.rules[F.indicator]),w.success(P)):w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F.indicator,y.indicator)):w.throw_error(x.error.type(\"callable\",F,y.indicator))}},\"assertz/1\":function(w,P,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else{var F,z;y.args[0].indicator===\":-/2\"?(F=y.args[0].args[0],z=Ce(y.args[0].args[1])):(F=y.args[0],z=null),x.type.is_callable(F)?z!==null&&!x.type.is_callable(z)?w.throw_error(x.error.type(\"callable\",z,y.indicator)):w.is_public_predicate(F.indicator)?(w.session.rules[F.indicator]===void 0&&(w.session.rules[F.indicator]=[]),w.session.public_predicates[F.indicator]=!0,w.session.rules[F.indicator].push(new Ve(F,z,!0)),w.success(P)):w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F.indicator,y.indicator)):w.throw_error(x.error.type(\"callable\",F,y.indicator))}},\"retract/1\":function(w,P,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))w.throw_error(x.error.type(\"callable\",y.args[0],y.indicator));else{var F,z;if(y.args[0].indicator===\":-/2\"?(F=y.args[0].args[0],z=y.args[0].args[1]):(F=y.args[0],z=new j(\"true\")),typeof P.retract>\"u\")if(w.is_public_predicate(F.indicator)){if(w.session.rules[F.indicator]!==void 0){for(var Z=[],$=0;$<w.session.rules[F.indicator].length;$++){w.session.renamed_variables={};var oe=w.session.rules[F.indicator][$],xe=oe.rename(w);xe.body===null&&(xe.body=new j(\"true\",[]));var Re=w.get_flag(\"occurs_check\").indicator===\"true/0\",lt=x.unify(new j(\",\",[F,z]),new j(\",\",[xe.head,xe.body]),Re);if(lt!==null){var Ct=new be(P.goal.replace(new j(\",\",[new j(\"retract\",[new j(\":-\",[F,z])]),new j(\",\",[new j(\"=\",[F,xe.head]),new j(\"=\",[z,xe.body])])])),P.substitution,P);Ct.retract=oe,Z.push(Ct)}}w.prepend(Z)}}else w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F.indicator,y.indicator));else Ae(w,P,F.indicator,P.retract)}},\"retractall/1\":function(w,P,y){var F=y.args[0];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_callable(F)?w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"retract\",[new x.type.Term(\":-\",[F,new De(\"_\")])]),new j(\"fail\",[])])),P.substitution,P),new be(P.goal.replace(null),P.substitution,P)]):w.throw_error(x.error.type(\"callable\",F,y.indicator))},\"abolish/1\":function(w,P,y){if(x.type.is_variable(y.args[0])||x.type.is_term(y.args[0])&&y.args[0].indicator===\"//2\"&&(x.type.is_variable(y.args[0].args[0])||x.type.is_variable(y.args[0].args[1])))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_term(y.args[0])||y.args[0].indicator!==\"//2\")w.throw_error(x.error.type(\"predicate_indicator\",y.args[0],y.indicator));else if(!x.type.is_atom(y.args[0].args[0]))w.throw_error(x.error.type(\"atom\",y.args[0].args[0],y.indicator));else if(!x.type.is_integer(y.args[0].args[1]))w.throw_error(x.error.type(\"integer\",y.args[0].args[1],y.indicator));else if(y.args[0].args[1].value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",y.args[0].args[1],y.indicator));else if(x.type.is_number(w.get_flag(\"max_arity\"))&&y.args[0].args[1].value>w.get_flag(\"max_arity\").value)w.throw_error(x.error.representation(\"max_arity\",y.indicator));else{var F=y.args[0].args[0].id+\"/\"+y.args[0].args[1].value;w.is_public_predicate(F)?(delete w.session.rules[F],w.success(P)):w.throw_error(x.error.permission(\"modify\",\"static_procedure\",F,y.indicator))}},\"atom_length/2\":function(w,P,y){if(x.type.is_variable(y.args[0]))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_atom(y.args[0]))w.throw_error(x.error.type(\"atom\",y.args[0],y.indicator));else if(!x.type.is_variable(y.args[1])&&!x.type.is_integer(y.args[1]))w.throw_error(x.error.type(\"integer\",y.args[1],y.indicator));else if(x.type.is_integer(y.args[1])&&y.args[1].value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",y.args[1],y.indicator));else{var F=new Te(y.args[0].id.length,!1);w.prepend([new be(P.goal.replace(new j(\"=\",[F,y.args[1]])),P.substitution,P)])}},\"atom_concat/3\":function(w,P,y){var F,z,Z=y.args[0],$=y.args[1],oe=y.args[2];if(x.type.is_variable(oe)&&(x.type.is_variable(Z)||x.type.is_variable($)))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_atom(Z))w.throw_error(x.error.type(\"atom\",Z,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_atom($))w.throw_error(x.error.type(\"atom\",$,y.indicator));else if(!x.type.is_variable(oe)&&!x.type.is_atom(oe))w.throw_error(x.error.type(\"atom\",oe,y.indicator));else{var xe=x.type.is_variable(Z),Re=x.type.is_variable($);if(!xe&&!Re)z=new j(\"=\",[oe,new j(Z.id+$.id)]),w.prepend([new be(P.goal.replace(z),P.substitution,P)]);else if(xe&&!Re)F=oe.id.substr(0,oe.id.length-$.id.length),F+$.id===oe.id&&(z=new j(\"=\",[Z,new j(F)]),w.prepend([new be(P.goal.replace(z),P.substitution,P)]));else if(Re&&!xe)F=oe.id.substr(Z.id.length),Z.id+F===oe.id&&(z=new j(\"=\",[$,new j(F)]),w.prepend([new be(P.goal.replace(z),P.substitution,P)]));else{for(var lt=[],Ct=0;Ct<=oe.id.length;Ct++){var qt=new j(oe.id.substr(0,Ct)),ir=new j(oe.id.substr(Ct));z=new j(\",\",[new j(\"=\",[qt,Z]),new j(\"=\",[ir,$])]),lt.push(new be(P.goal.replace(z),P.substitution,P))}w.prepend(lt)}}},\"sub_atom/5\":function(w,P,y){var F,z=y.args[0],Z=y.args[1],$=y.args[2],oe=y.args[3],xe=y.args[4];if(x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_integer(Z))w.throw_error(x.error.type(\"integer\",Z,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_integer($))w.throw_error(x.error.type(\"integer\",$,y.indicator));else if(!x.type.is_variable(oe)&&!x.type.is_integer(oe))w.throw_error(x.error.type(\"integer\",oe,y.indicator));else if(x.type.is_integer(Z)&&Z.value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",Z,y.indicator));else if(x.type.is_integer($)&&$.value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",$,y.indicator));else if(x.type.is_integer(oe)&&oe.value<0)w.throw_error(x.error.domain(\"not_less_than_zero\",oe,y.indicator));else{var Re=[],lt=[],Ct=[];if(x.type.is_variable(Z))for(F=0;F<=z.id.length;F++)Re.push(F);else Re.push(Z.value);if(x.type.is_variable($))for(F=0;F<=z.id.length;F++)lt.push(F);else lt.push($.value);if(x.type.is_variable(oe))for(F=0;F<=z.id.length;F++)Ct.push(F);else Ct.push(oe.value);var qt=[];for(var ir in Re)if(Re.hasOwnProperty(ir)){F=Re[ir];for(var bt in lt)if(lt.hasOwnProperty(bt)){var gn=lt[bt],br=z.id.length-F-gn;if(e(Ct,br)!==-1&&F+gn+br===z.id.length){var Ir=z.id.substr(F,gn);if(z.id===z.id.substr(0,F)+Ir+z.id.substr(F+gn,br)){var Or=new j(\"=\",[new j(Ir),xe]),nn=new j(\"=\",[Z,new Te(F)]),ai=new j(\"=\",[$,new Te(gn)]),Io=new j(\"=\",[oe,new Te(br)]),ts=new j(\",\",[new j(\",\",[new j(\",\",[nn,ai]),Io]),Or]);qt.push(new be(P.goal.replace(ts),P.substitution,P))}}}}w.prepend(qt)}},\"atom_chars/2\":function(w,P,y){var F=y.args[0],z=y.args[1];if(x.type.is_variable(F)&&x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(x.type.is_variable(F)){for(var oe=z,xe=x.type.is_variable(F),Re=\"\";oe.indicator===\"./2\";){if(x.type.is_character(oe.args[0]))Re+=oe.args[0].id;else if(x.type.is_variable(oe.args[0])&&xe){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.type(\"character\",oe.args[0],y.indicator));return}oe=oe.args[1]}x.type.is_variable(oe)&&xe?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)?w.throw_error(x.error.type(\"list\",z,y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[new j(Re),F])),P.substitution,P)])}else{for(var Z=new j(\"[]\"),$=F.id.length-1;$>=0;$--)Z=new j(\".\",[new j(F.id.charAt($)),Z]);w.prepend([new be(P.goal.replace(new j(\"=\",[z,Z])),P.substitution,P)])}},\"atom_codes/2\":function(w,P,y){var F=y.args[0],z=y.args[1];if(x.type.is_variable(F)&&x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(x.type.is_variable(F)){for(var oe=z,xe=x.type.is_variable(F),Re=\"\";oe.indicator===\"./2\";){if(x.type.is_character_code(oe.args[0]))Re+=c(oe.args[0].value);else if(x.type.is_variable(oe.args[0])&&xe){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.representation(\"character_code\",y.indicator));return}oe=oe.args[1]}x.type.is_variable(oe)&&xe?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)?w.throw_error(x.error.type(\"list\",z,y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[new j(Re),F])),P.substitution,P)])}else{for(var Z=new j(\"[]\"),$=F.id.length-1;$>=0;$--)Z=new j(\".\",[new Te(n(F.id,$),!1),Z]);w.prepend([new be(P.goal.replace(new j(\"=\",[z,Z])),P.substitution,P)])}},\"char_code/2\":function(w,P,y){var F=y.args[0],z=y.args[1];if(x.type.is_variable(F)&&x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_character(F))w.throw_error(x.error.type(\"character\",F,y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",z,y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_character_code(z))w.throw_error(x.error.representation(\"character_code\",y.indicator));else if(x.type.is_variable(z)){var Z=new Te(n(F.id,0),!1);w.prepend([new be(P.goal.replace(new j(\"=\",[Z,z])),P.substitution,P)])}else{var $=new j(c(z.value));w.prepend([new be(P.goal.replace(new j(\"=\",[$,F])),P.substitution,P)])}},\"number_chars/2\":function(w,P,y){var F,z=y.args[0],Z=y.args[1];if(x.type.is_variable(z)&&x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_number(z))w.throw_error(x.error.type(\"number\",z,y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_list(Z))w.throw_error(x.error.type(\"list\",Z,y.indicator));else{var $=x.type.is_variable(z);if(!x.type.is_variable(Z)){var oe=Z,xe=!0;for(F=\"\";oe.indicator===\"./2\";){if(x.type.is_character(oe.args[0]))F+=oe.args[0].id;else if(x.type.is_variable(oe.args[0]))xe=!1;else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.type(\"character\",oe.args[0],y.indicator));return}oe=oe.args[1]}if(xe=xe&&x.type.is_empty_list(oe),!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)){w.throw_error(x.error.type(\"list\",Z,y.indicator));return}if(!xe&&$){w.throw_error(x.error.instantiation(y.indicator));return}else if(xe)if(x.type.is_variable(oe)&&$){w.throw_error(x.error.instantiation(y.indicator));return}else{var Re=w.parse(F),lt=Re.value;!x.type.is_number(lt)||Re.tokens[Re.tokens.length-1].space?w.throw_error(x.error.syntax_by_predicate(\"parseable_number\",y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[z,lt])),P.substitution,P)]);return}}if(!$){F=z.toString();for(var Ct=new j(\"[]\"),qt=F.length-1;qt>=0;qt--)Ct=new j(\".\",[new j(F.charAt(qt)),Ct]);w.prepend([new be(P.goal.replace(new j(\"=\",[Z,Ct])),P.substitution,P)])}}},\"number_codes/2\":function(w,P,y){var F,z=y.args[0],Z=y.args[1];if(x.type.is_variable(z)&&x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_number(z))w.throw_error(x.error.type(\"number\",z,y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_list(Z))w.throw_error(x.error.type(\"list\",Z,y.indicator));else{var $=x.type.is_variable(z);if(!x.type.is_variable(Z)){var oe=Z,xe=!0;for(F=\"\";oe.indicator===\"./2\";){if(x.type.is_character_code(oe.args[0]))F+=c(oe.args[0].value);else if(x.type.is_variable(oe.args[0]))xe=!1;else if(!x.type.is_variable(oe.args[0])){w.throw_error(x.error.type(\"character_code\",oe.args[0],y.indicator));return}oe=oe.args[1]}if(xe=xe&&x.type.is_empty_list(oe),!x.type.is_empty_list(oe)&&!x.type.is_variable(oe)){w.throw_error(x.error.type(\"list\",Z,y.indicator));return}if(!xe&&$){w.throw_error(x.error.instantiation(y.indicator));return}else if(xe)if(x.type.is_variable(oe)&&$){w.throw_error(x.error.instantiation(y.indicator));return}else{var Re=w.parse(F),lt=Re.value;!x.type.is_number(lt)||Re.tokens[Re.tokens.length-1].space?w.throw_error(x.error.syntax_by_predicate(\"parseable_number\",y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[z,lt])),P.substitution,P)]);return}}if(!$){F=z.toString();for(var Ct=new j(\"[]\"),qt=F.length-1;qt>=0;qt--)Ct=new j(\".\",[new Te(n(F,qt),!1),Ct]);w.prepend([new be(P.goal.replace(new j(\"=\",[Z,Ct])),P.substitution,P)])}}},\"upcase_atom/2\":function(w,P,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(F)?!x.type.is_variable(z)&&!x.type.is_atom(z)?w.throw_error(x.error.type(\"atom\",z,y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[z,new j(F.id.toUpperCase(),[])])),P.substitution,P)]):w.throw_error(x.error.type(\"atom\",F,y.indicator))},\"downcase_atom/2\":function(w,P,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(F)?!x.type.is_variable(z)&&!x.type.is_atom(z)?w.throw_error(x.error.type(\"atom\",z,y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[z,new j(F.id.toLowerCase(),[])])),P.substitution,P)]):w.throw_error(x.error.type(\"atom\",F,y.indicator))},\"atomic_list_concat/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\"atomic_list_concat\",[F,new j(\"\",[]),z])),P.substitution,P)])},\"atomic_list_concat/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2];if(x.type.is_variable(z)||x.type.is_variable(F)&&x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_list(F))w.throw_error(x.error.type(\"list\",F,y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_atom(Z))w.throw_error(x.error.type(\"atom\",Z,y.indicator));else if(x.type.is_variable(Z)){for(var oe=\"\",xe=F;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(!x.type.is_atom(xe.args[0])&&!x.type.is_number(xe.args[0])){w.throw_error(x.error.type(\"atomic\",xe.args[0],y.indicator));return}oe!==\"\"&&(oe+=z.id),x.type.is_atom(xe.args[0])?oe+=xe.args[0].id:oe+=\"\"+xe.args[0].value,xe=xe.args[1]}oe=new j(oe,[]),x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_term(xe)||xe.indicator!==\"[]/0\"?w.throw_error(x.error.type(\"list\",F,y.indicator)):w.prepend([new be(P.goal.replace(new j(\"=\",[oe,Z])),P.substitution,P)])}else{var $=g(s(Z.id.split(z.id),function(Re){return new j(Re,[])}));w.prepend([new be(P.goal.replace(new j(\"=\",[$,F])),P.substitution,P)])}},\"@=</2\":function(w,P,y){x.compare(y.args[0],y.args[1])<=0&&w.success(P)},\"==/2\":function(w,P,y){x.compare(y.args[0],y.args[1])===0&&w.success(P)},\"\\\\==/2\":function(w,P,y){x.compare(y.args[0],y.args[1])!==0&&w.success(P)},\"@</2\":function(w,P,y){x.compare(y.args[0],y.args[1])<0&&w.success(P)},\"@>/2\":function(w,P,y){x.compare(y.args[0],y.args[1])>0&&w.success(P)},\"@>=/2\":function(w,P,y){x.compare(y.args[0],y.args[1])>=0&&w.success(P)},\"compare/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2];if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(x.type.is_atom(F)&&[\"<\",\">\",\"=\"].indexOf(F.id)===-1)w.throw_error(x.type.domain(\"order\",F,y.indicator));else{var $=x.compare(z,Z);$=$===0?\"=\":$===-1?\"<\":\">\",w.prepend([new be(P.goal.replace(new j(\"=\",[F,new j($,[])])),P.substitution,P)])}},\"is/2\":function(w,P,y){var F=y.args[1].interpret(w);x.type.is_number(F)?w.prepend([new be(P.goal.replace(new j(\"=\",[y.args[0],F],w.level)),P.substitution,P)]):w.throw_error(F)},\"between/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2];if(x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_integer(F))w.throw_error(x.error.type(\"integer\",F,y.indicator));else if(!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",z,y.indicator));else if(!x.type.is_variable(Z)&&!x.type.is_integer(Z))w.throw_error(x.error.type(\"integer\",Z,y.indicator));else if(x.type.is_variable(Z)){var $=[new be(P.goal.replace(new j(\"=\",[Z,F])),P.substitution,P)];F.value<z.value&&$.push(new be(P.goal.replace(new j(\"between\",[new Te(F.value+1,!1),z,Z])),P.substitution,P)),w.prepend($)}else F.value<=Z.value&&z.value>=Z.value&&w.success(P)},\"succ/2\":function(w,P,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)&&x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(F)&&!x.type.is_integer(F)?w.throw_error(x.error.type(\"integer\",F,y.indicator)):!x.type.is_variable(z)&&!x.type.is_integer(z)?w.throw_error(x.error.type(\"integer\",z,y.indicator)):!x.type.is_variable(F)&&F.value<0?w.throw_error(x.error.domain(\"not_less_than_zero\",F,y.indicator)):!x.type.is_variable(z)&&z.value<0?w.throw_error(x.error.domain(\"not_less_than_zero\",z,y.indicator)):(x.type.is_variable(z)||z.value>0)&&(x.type.is_variable(F)?w.prepend([new be(P.goal.replace(new j(\"=\",[F,new Te(z.value-1,!1)])),P.substitution,P)]):w.prepend([new be(P.goal.replace(new j(\"=\",[z,new Te(F.value+1,!1)])),P.substitution,P)]))},\"=:=/2\":function(w,P,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F===0&&w.success(P)},\"=\\\\=/2\":function(w,P,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F!==0&&w.success(P)},\"</2\":function(w,P,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F<0&&w.success(P)},\"=</2\":function(w,P,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F<=0&&w.success(P)},\">/2\":function(w,P,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F>0&&w.success(P)},\">=/2\":function(w,P,y){var F=x.arithmetic_compare(w,y.args[0],y.args[1]);x.type.is_term(F)?w.throw_error(F):F>=0&&w.success(P)},\"var/1\":function(w,P,y){x.type.is_variable(y.args[0])&&w.success(P)},\"atom/1\":function(w,P,y){x.type.is_atom(y.args[0])&&w.success(P)},\"atomic/1\":function(w,P,y){x.type.is_atomic(y.args[0])&&w.success(P)},\"compound/1\":function(w,P,y){x.type.is_compound(y.args[0])&&w.success(P)},\"integer/1\":function(w,P,y){x.type.is_integer(y.args[0])&&w.success(P)},\"float/1\":function(w,P,y){x.type.is_float(y.args[0])&&w.success(P)},\"number/1\":function(w,P,y){x.type.is_number(y.args[0])&&w.success(P)},\"nonvar/1\":function(w,P,y){x.type.is_variable(y.args[0])||w.success(P)},\"ground/1\":function(w,P,y){y.variables().length===0&&w.success(P)},\"acyclic_term/1\":function(w,P,y){for(var F=P.substitution.apply(P.substitution),z=y.args[0].variables(),Z=0;Z<z.length;Z++)if(P.substitution.links[z[Z]]!==void 0&&!P.substitution.links[z[Z]].equals(F.links[z[Z]]))return;w.success(P)},\"callable/1\":function(w,P,y){x.type.is_callable(y.args[0])&&w.success(P)},\"is_list/1\":function(w,P,y){for(var F=y.args[0];x.type.is_term(F)&&F.indicator===\"./2\";)F=F.args[1];x.type.is_term(F)&&F.indicator===\"[]/0\"&&w.success(P)},\"current_input/1\":function(w,P,y){var F=y.args[0];!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream\",F,y.indicator)):(x.type.is_atom(F)&&w.get_stream_by_alias(F.id)&&(F=w.get_stream_by_alias(F.id)),w.prepend([new be(P.goal.replace(new j(\"=\",[F,w.get_current_input()])),P.substitution,P)]))},\"current_output/1\":function(w,P,y){var F=y.args[0];!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):(x.type.is_atom(F)&&w.get_stream_by_alias(F.id)&&(F=w.get_stream_by_alias(F.id)),w.prepend([new be(P.goal.replace(new j(\"=\",[F,w.get_current_output()])),P.substitution,P)]))},\"set_input/1\":function(w,P,y){var F=y.args[0],z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):x.type.is_stream(z)?z.output===!0?w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator)):(w.set_current_input(z),w.success(P)):w.throw_error(x.error.existence(\"stream\",F,y.indicator))},\"set_output/1\":function(w,P,y){var F=y.args[0],z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):x.type.is_stream(z)?z.input===!0?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):(w.set_current_output(z),w.success(P)):w.throw_error(x.error.existence(\"stream\",F,y.indicator))},\"open/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2];w.prepend([new be(P.goal.replace(new j(\"open\",[F,z,Z,new j(\"[]\",[])])),P.substitution,P)])},\"open/4\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2],$=y.args[3];if(x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_atom(z))w.throw_error(x.error.type(\"atom\",z,y.indicator));else if(!x.type.is_list($))w.throw_error(x.error.type(\"list\",$,y.indicator));else if(!x.type.is_variable(Z))w.throw_error(x.error.type(\"variable\",Z,y.indicator));else if(!x.type.is_atom(F)&&!x.type.is_streamable(F))w.throw_error(x.error.domain(\"source_sink\",F,y.indicator));else if(!x.type.is_io_mode(z))w.throw_error(x.error.domain(\"io_mode\",z,y.indicator));else{for(var oe={},xe=$,Re;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(Re=xe.args[0],x.type.is_variable(Re)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_stream_option(Re)){w.throw_error(x.error.domain(\"stream_option\",Re,y.indicator));return}oe[Re.id]=Re.args[0].id,xe=xe.args[1]}if(xe.indicator!==\"[]/0\"){x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",$,y.indicator));return}else{var lt=oe.alias;if(lt&&w.get_stream_by_alias(lt)){w.throw_error(x.error.permission(\"open\",\"source_sink\",new j(\"alias\",[new j(lt,[])]),y.indicator));return}oe.type||(oe.type=\"text\");var Ct;if(x.type.is_atom(F)?Ct=w.file_system_open(F.id,oe.type,z.id):Ct=F.stream(oe.type,z.id),Ct===!1){w.throw_error(x.error.permission(\"open\",\"source_sink\",F,y.indicator));return}else if(Ct===null){w.throw_error(x.error.existence(\"source_sink\",F,y.indicator));return}var qt=new Fe(Ct,z.id,oe.alias,oe.type,oe.reposition===\"true\",oe.eof_action);lt?w.session.streams[lt]=qt:w.session.streams[qt.id]=qt,w.prepend([new be(P.goal.replace(new j(\"=\",[Z,qt])),P.substitution,P)])}}},\"close/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\"close\",[F,new j(\"[]\",[])])),P.substitution,P)])},\"close/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F)||x.type.is_variable(z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(z))w.throw_error(x.error.type(\"list\",z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else{for(var $={},oe=z,xe;x.type.is_term(oe)&&oe.indicator===\"./2\";){if(xe=oe.args[0],x.type.is_variable(xe)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_close_option(xe)){w.throw_error(x.error.domain(\"close_option\",xe,y.indicator));return}$[xe.id]=xe.args[0].id===\"true\",oe=oe.args[1]}if(oe.indicator!==\"[]/0\"){x.type.is_variable(oe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",z,y.indicator));return}else{if(Z===w.session.standard_input||Z===w.session.standard_output){w.success(P);return}else Z===w.session.current_input?w.session.current_input=w.session.standard_input:Z===w.session.current_output&&(w.session.current_output=w.session.current_output);Z.alias!==null?delete w.session.streams[Z.alias]:delete w.session.streams[Z.id],Z.output&&Z.stream.flush();var Re=Z.stream.close();Z.stream=null,($.force===!0||Re===!0)&&w.success(P)}}},\"flush_output/0\":function(w,P,y){w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"flush_output\",[new De(\"S\")])])),P.substitution,P)])},\"flush_output/1\":function(w,P,y){var F=y.args[0],z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(z)||z.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):F.input===!0?w.throw_error(x.error.permission(\"output\",\"stream\",output,y.indicator)):(z.stream.flush(),w.success(P))},\"stream_property/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_variable(F)&&(!x.type.is_stream(Z)||Z.stream===null))w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_stream_property(z))w.throw_error(x.error.domain(\"stream_property\",z,y.indicator));else{var $=[],oe=[];if(!x.type.is_variable(F))$.push(Z);else for(var xe in w.session.streams)$.push(w.session.streams[xe]);for(var Re=0;Re<$.length;Re++){var lt=[];$[Re].filename&&lt.push(new j(\"file_name\",[new j($[Re].file_name,[])])),lt.push(new j(\"mode\",[new j($[Re].mode,[])])),lt.push(new j($[Re].input?\"input\":\"output\",[])),$[Re].alias&&lt.push(new j(\"alias\",[new j($[Re].alias,[])])),lt.push(new j(\"position\",[typeof $[Re].position==\"number\"?new Te($[Re].position,!1):new j($[Re].position,[])])),lt.push(new j(\"end_of_stream\",[new j($[Re].position===\"end_of_stream\"?\"at\":$[Re].position===\"past_end_of_stream\"?\"past\":\"not\",[])])),lt.push(new j(\"eof_action\",[new j($[Re].eof_action,[])])),lt.push(new j(\"reposition\",[new j($[Re].reposition?\"true\":\"false\",[])])),lt.push(new j(\"type\",[new j($[Re].type,[])]));for(var Ct=0;Ct<lt.length;Ct++)oe.push(new be(P.goal.replace(new j(\",\",[new j(\"=\",[x.type.is_variable(F)?F:Z,$[Re]]),new j(\"=\",[z,lt[Ct]])])),P.substitution,P))}w.prepend(oe)}},\"at_end_of_stream/0\":function(w,P,y){w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\",\",[new j(\"stream_property\",[new De(\"S\"),new j(\"end_of_stream\",[new De(\"E\")])]),new j(\",\",[new j(\"!\",[]),new j(\";\",[new j(\"=\",[new De(\"E\"),new j(\"at\",[])]),new j(\"=\",[new De(\"E\"),new j(\"past\",[])])])])])])),P.substitution,P)])},\"at_end_of_stream/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"stream_property\",[F,new j(\"end_of_stream\",[new De(\"E\")])]),new j(\",\",[new j(\"!\",[]),new j(\";\",[new j(\"=\",[new De(\"E\"),new j(\"at\",[])]),new j(\"=\",[new De(\"E\"),new j(\"past\",[])])])])])),P.substitution,P)])},\"set_stream_position/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(Z)||Z.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):x.type.is_stream_position(z)?Z.reposition===!1?w.throw_error(x.error.permission(\"reposition\",\"stream\",F,y.indicator)):(x.type.is_integer(z)?Z.position=z.value:Z.position=z.id,w.success(P)):w.throw_error(x.error.domain(\"stream_position\",z,y.indicator))},\"get_char/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"get_char\",[new De(\"S\"),F])])),P.substitution,P)])},\"get_char/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_character(z))w.throw_error(x.error.type(\"in_character\",z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(Z.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(Z.position===\"past_end_of_stream\"&&Z.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(Z.position===\"end_of_stream\")$=\"end_of_file\",Z.position=\"past_end_of_stream\";else{if($=Z.stream.get(1,Z.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}Z.position++}w.prepend([new be(P.goal.replace(new j(\"=\",[new j($,[]),z])),P.substitution,P)])}},\"get_code/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"get_code\",[new De(\"S\"),F])])),P.substitution,P)])},\"get_code/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",char,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(Z.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(Z.position===\"past_end_of_stream\"&&Z.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(Z.position===\"end_of_stream\")$=-1,Z.position=\"past_end_of_stream\";else{if($=Z.stream.get(1,Z.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}$=n($,0),Z.position++}w.prepend([new be(P.goal.replace(new j(\"=\",[new Te($,!1),z])),P.substitution,P)])}},\"peek_char/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"peek_char\",[new De(\"S\"),F])])),P.substitution,P)])},\"peek_char/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_character(z))w.throw_error(x.error.type(\"in_character\",z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(Z.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(Z.position===\"past_end_of_stream\"&&Z.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(Z.position===\"end_of_stream\")$=\"end_of_file\",Z.position=\"past_end_of_stream\";else if($=Z.stream.get(1,Z.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}w.prepend([new be(P.goal.replace(new j(\"=\",[new j($,[]),z])),P.substitution,P)])}},\"peek_code/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"peek_code\",[new De(\"S\"),F])])),P.substitution,P)])},\"peek_code/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_integer(z))w.throw_error(x.error.type(\"integer\",char,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(Z.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if(Z.position===\"past_end_of_stream\"&&Z.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(Z.position===\"end_of_stream\")$=-1,Z.position=\"past_end_of_stream\";else{if($=Z.stream.get(1,Z.position),$===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}$=n($,0)}w.prepend([new be(P.goal.replace(new j(\"=\",[new Te($,!1),z])),P.substitution,P)])}},\"put_char/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_char\",[new De(\"S\"),F])])),P.substitution,P)])},\"put_char/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_character(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(Z)||Z.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):Z.input?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):Z.type===\"binary\"?w.throw_error(x.error.permission(\"output\",\"binary_stream\",F,y.indicator)):Z.stream.put(z.id,Z.position)&&(typeof Z.position==\"number\"&&Z.position++,w.success(P)):w.throw_error(x.error.type(\"character\",z,y.indicator))},\"put_code/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_code\",[new De(\"S\"),F])])),P.substitution,P)])},\"put_code/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_integer(z)?x.type.is_character_code(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(Z)||Z.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):Z.input?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):Z.type===\"binary\"?w.throw_error(x.error.permission(\"output\",\"binary_stream\",F,y.indicator)):Z.stream.put_char(c(z.value),Z.position)&&(typeof Z.position==\"number\"&&Z.position++,w.success(P)):w.throw_error(x.error.representation(\"character_code\",y.indicator)):w.throw_error(x.error.type(\"integer\",z,y.indicator))},\"nl/0\":function(w,P,y){w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_char\",[new De(\"S\"),new j(`\n`,[])])])),P.substitution,P)])},\"nl/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\"put_char\",[F,new j(`\n`,[])])),P.substitution,P)])},\"get_byte/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"get_byte\",[new De(\"S\"),F])])),P.substitution,P)])},\"get_byte/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_byte(z))w.throw_error(x.error.type(\"in_byte\",char,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(Z.type===\"text\")w.throw_error(x.error.permission(\"input\",\"text_stream\",F,y.indicator));else if(Z.position===\"past_end_of_stream\"&&Z.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(Z.position===\"end_of_stream\")$=\"end_of_file\",Z.position=\"past_end_of_stream\";else{if($=Z.stream.get_byte(Z.position),$===null){w.throw_error(x.error.representation(\"byte\",y.indicator));return}Z.position++}w.prepend([new be(P.goal.replace(new j(\"=\",[new Te($,!1),z])),P.substitution,P)])}},\"peek_byte/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"peek_byte\",[new De(\"S\"),F])])),P.substitution,P)])},\"peek_byte/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_byte(z))w.throw_error(x.error.type(\"in_byte\",char,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if(Z.type===\"text\")w.throw_error(x.error.permission(\"input\",\"text_stream\",F,y.indicator));else if(Z.position===\"past_end_of_stream\"&&Z.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{var $;if(Z.position===\"end_of_stream\")$=\"end_of_file\",Z.position=\"past_end_of_stream\";else if($=Z.stream.get_byte(Z.position),$===null){w.throw_error(x.error.representation(\"byte\",y.indicator));return}w.prepend([new be(P.goal.replace(new j(\"=\",[new Te($,!1),z])),P.substitution,P)])}},\"put_byte/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"put_byte\",[new De(\"S\"),F])])),P.substitution,P)])},\"put_byte/2\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_byte(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator)):!x.type.is_stream(Z)||Z.stream===null?w.throw_error(x.error.existence(\"stream\",F,y.indicator)):Z.input?w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator)):Z.type===\"text\"?w.throw_error(x.error.permission(\"output\",\"text_stream\",F,y.indicator)):Z.stream.put_byte(z.value,Z.position)&&(typeof Z.position==\"number\"&&Z.position++,w.success(P)):w.throw_error(x.error.type(\"byte\",z,y.indicator))},\"read/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"read_term\",[new De(\"S\"),F,new j(\"[]\",[])])])),P.substitution,P)])},\"read/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\"read_term\",[F,z,new j(\"[]\",[])])),P.substitution,P)])},\"read_term/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_input\",[new De(\"S\")]),new j(\"read_term\",[new De(\"S\"),F,z])])),P.substitution,P)])},\"read_term/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2],$=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F)||x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(Z))w.throw_error(x.error.type(\"list\",Z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream($)||$.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if($.output)w.throw_error(x.error.permission(\"input\",\"stream\",F,y.indicator));else if($.type===\"binary\")w.throw_error(x.error.permission(\"input\",\"binary_stream\",F,y.indicator));else if($.position===\"past_end_of_stream\"&&$.eof_action===\"error\")w.throw_error(x.error.permission(\"input\",\"past_end_of_stream\",F,y.indicator));else{for(var oe={},xe=Z,Re;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(Re=xe.args[0],x.type.is_variable(Re)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_read_option(Re)){w.throw_error(x.error.domain(\"read_option\",Re,y.indicator));return}oe[Re.id]=Re.args[0],xe=xe.args[1]}if(xe.indicator!==\"[]/0\"){x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",Z,y.indicator));return}else{for(var lt,Ct,qt,ir=\"\",bt=[],gn=null;gn===null||gn.name!==\"atom\"||gn.value!==\".\"||qt.type===f&&x.flatten_error(new j(\"throw\",[qt.value])).found===\"token_not_found\";){if(lt=$.stream.get(1,$.position),lt===null){w.throw_error(x.error.representation(\"character\",y.indicator));return}if(lt===\"end_of_file\"||lt===\"past_end_of_file\"){qt?w.throw_error(x.error.syntax(bt[qt.len-1],\". or expression expected\",!1)):w.throw_error(x.error.syntax(null,\"token not found\",!0));return}$.position++,ir+=lt,Ct=new U(w),Ct.new_text(ir),bt=Ct.get_tokens(),gn=bt!==null&&bt.length>0?bt[bt.length-1]:null,bt!==null&&(qt=W(w,bt,0,w.__get_max_priority(),!1))}if(qt.type===p&&qt.len===bt.length-1&&gn.value===\".\"){qt=qt.value.rename(w);var br=new j(\"=\",[z,qt]);if(oe.variables){var Ir=g(s(ye(qt.variables()),function(Or){return new De(Or)}));br=new j(\",\",[br,new j(\"=\",[oe.variables,Ir])])}if(oe.variable_names){var Ir=g(s(ye(qt.variables()),function(nn){var ai;for(ai in w.session.renamed_variables)if(w.session.renamed_variables.hasOwnProperty(ai)&&w.session.renamed_variables[ai]===nn)break;return new j(\"=\",[new j(ai,[]),new De(nn)])}));br=new j(\",\",[br,new j(\"=\",[oe.variable_names,Ir])])}if(oe.singletons){var Ir=g(s(new Ve(qt,null).singleton_variables(),function(nn){var ai;for(ai in w.session.renamed_variables)if(w.session.renamed_variables.hasOwnProperty(ai)&&w.session.renamed_variables[ai]===nn)break;return new j(\"=\",[new j(ai,[]),new De(nn)])}));br=new j(\",\",[br,new j(\"=\",[oe.singletons,Ir])])}w.prepend([new be(P.goal.replace(br),P.substitution,P)])}else qt.type===p?w.throw_error(x.error.syntax(bt[qt.len],\"unexpected token\",!1)):w.throw_error(qt.value)}}},\"write/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"write\",[new De(\"S\"),F])])),P.substitution,P)])},\"write/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\"write_term\",[F,z,new j(\".\",[new j(\"quoted\",[new j(\"false\",[])]),new j(\".\",[new j(\"ignore_ops\",[new j(\"false\")]),new j(\".\",[new j(\"numbervars\",[new j(\"true\")]),new j(\"[]\",[])])])])])),P.substitution,P)])},\"writeq/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"writeq\",[new De(\"S\"),F])])),P.substitution,P)])},\"writeq/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\"write_term\",[F,z,new j(\".\",[new j(\"quoted\",[new j(\"true\",[])]),new j(\".\",[new j(\"ignore_ops\",[new j(\"false\")]),new j(\".\",[new j(\"numbervars\",[new j(\"true\")]),new j(\"[]\",[])])])])])),P.substitution,P)])},\"write_canonical/1\":function(w,P,y){var F=y.args[0];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"write_canonical\",[new De(\"S\"),F])])),P.substitution,P)])},\"write_canonical/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\"write_term\",[F,z,new j(\".\",[new j(\"quoted\",[new j(\"true\",[])]),new j(\".\",[new j(\"ignore_ops\",[new j(\"true\")]),new j(\".\",[new j(\"numbervars\",[new j(\"false\")]),new j(\"[]\",[])])])])])),P.substitution,P)])},\"write_term/2\":function(w,P,y){var F=y.args[0],z=y.args[1];w.prepend([new be(P.goal.replace(new j(\",\",[new j(\"current_output\",[new De(\"S\")]),new j(\"write_term\",[new De(\"S\"),F,z])])),P.substitution,P)])},\"write_term/3\":function(w,P,y){var F=y.args[0],z=y.args[1],Z=y.args[2],$=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F)||x.type.is_variable(Z))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(Z))w.throw_error(x.error.type(\"list\",Z,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain(\"stream_or_alias\",F,y.indicator));else if(!x.type.is_stream($)||$.stream===null)w.throw_error(x.error.existence(\"stream\",F,y.indicator));else if($.input)w.throw_error(x.error.permission(\"output\",\"stream\",F,y.indicator));else if($.type===\"binary\")w.throw_error(x.error.permission(\"output\",\"binary_stream\",F,y.indicator));else if($.position===\"past_end_of_stream\"&&$.eof_action===\"error\")w.throw_error(x.error.permission(\"output\",\"past_end_of_stream\",F,y.indicator));else{for(var oe={},xe=Z,Re;x.type.is_term(xe)&&xe.indicator===\"./2\";){if(Re=xe.args[0],x.type.is_variable(Re)){w.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_write_option(Re)){w.throw_error(x.error.domain(\"write_option\",Re,y.indicator));return}oe[Re.id]=Re.args[0].id===\"true\",xe=xe.args[1]}if(xe.indicator!==\"[]/0\"){x.type.is_variable(xe)?w.throw_error(x.error.instantiation(y.indicator)):w.throw_error(x.error.type(\"list\",Z,y.indicator));return}else{oe.session=w.session;var lt=z.toString(oe);$.stream.put(lt,$.position),typeof $.position==\"number\"&&($.position+=lt.length),w.success(P)}}},\"halt/0\":function(w,P,y){w.points=[]},\"halt/1\":function(w,P,y){var F=y.args[0];x.type.is_variable(F)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_integer(F)?w.points=[]:w.throw_error(x.error.type(\"integer\",F,y.indicator))},\"current_prolog_flag/2\":function(w,P,y){var F=y.args[0],z=y.args[1];if(!x.type.is_variable(F)&&!x.type.is_atom(F))w.throw_error(x.error.type(\"atom\",F,y.indicator));else if(!x.type.is_variable(F)&&!x.type.is_flag(F))w.throw_error(x.error.domain(\"prolog_flag\",F,y.indicator));else{var Z=[];for(var $ in x.flag)if(x.flag.hasOwnProperty($)){var oe=new j(\",\",[new j(\"=\",[new j($),F]),new j(\"=\",[w.get_flag($),z])]);Z.push(new be(P.goal.replace(oe),P.substitution,P))}w.prepend(Z)}},\"set_prolog_flag/2\":function(w,P,y){var F=y.args[0],z=y.args[1];x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(F)?x.type.is_flag(F)?x.type.is_value_flag(F,z)?x.type.is_modifiable_flag(F)?(w.session.flag[F.id]=z,w.success(P)):w.throw_error(x.error.permission(\"modify\",\"flag\",F)):w.throw_error(x.error.domain(\"flag_value\",new j(\"+\",[F,z]),y.indicator)):w.throw_error(x.error.domain(\"prolog_flag\",F,y.indicator)):w.throw_error(x.error.type(\"atom\",F,y.indicator))}},flag:{bounded:{allowed:[new j(\"true\"),new j(\"false\")],value:new j(\"true\"),changeable:!1},max_integer:{allowed:[new Te(Number.MAX_SAFE_INTEGER)],value:new Te(Number.MAX_SAFE_INTEGER),changeable:!1},min_integer:{allowed:[new Te(Number.MIN_SAFE_INTEGER)],value:new Te(Number.MIN_SAFE_INTEGER),changeable:!1},integer_rounding_function:{allowed:[new j(\"down\"),new j(\"toward_zero\")],value:new j(\"toward_zero\"),changeable:!1},char_conversion:{allowed:[new j(\"on\"),new j(\"off\")],value:new j(\"on\"),changeable:!0},debug:{allowed:[new j(\"on\"),new j(\"off\")],value:new j(\"off\"),changeable:!0},max_arity:{allowed:[new j(\"unbounded\")],value:new j(\"unbounded\"),changeable:!1},unknown:{allowed:[new j(\"error\"),new j(\"fail\"),new j(\"warning\")],value:new j(\"error\"),changeable:!0},double_quotes:{allowed:[new j(\"chars\"),new j(\"codes\"),new j(\"atom\")],value:new j(\"codes\"),changeable:!0},occurs_check:{allowed:[new j(\"false\"),new j(\"true\")],value:new j(\"false\"),changeable:!0},dialect:{allowed:[new j(\"tau\")],value:new j(\"tau\"),changeable:!1},version_data:{allowed:[new j(\"tau\",[new Te(t.major,!1),new Te(t.minor,!1),new Te(t.patch,!1),new j(t.status)])],value:new j(\"tau\",[new Te(t.major,!1),new Te(t.minor,!1),new Te(t.patch,!1),new j(t.status)]),changeable:!1},nodejs:{allowed:[new j(\"yes\"),new j(\"no\")],value:new j(typeof ec<\"u\"&&ec.exports?\"yes\":\"no\"),changeable:!1}},unify:function(w,P,y){y=y===void 0?!1:y;for(var F=[{left:w,right:P}],z={};F.length!==0;){var Z=F.pop();if(w=Z.left,P=Z.right,x.type.is_term(w)&&x.type.is_term(P)){if(w.indicator!==P.indicator)return null;for(var $=0;$<w.args.length;$++)F.push({left:w.args[$],right:P.args[$]})}else if(x.type.is_number(w)&&x.type.is_number(P)){if(w.value!==P.value||w.is_float!==P.is_float)return null}else if(x.type.is_variable(w)){if(x.type.is_variable(P)&&w.id===P.id)continue;if(y===!0&&P.variables().indexOf(w.id)!==-1)return null;if(w.id!==\"_\"){var oe=new Ne;oe.add(w.id,P);for(var $=0;$<F.length;$++)F[$].left=F[$].left.apply(oe),F[$].right=F[$].right.apply(oe);for(var $ in z)z[$]=z[$].apply(oe);z[w.id]=P}}else if(x.type.is_variable(P))F.push({left:P,right:w});else if(w.unify!==void 0){if(!w.unify(P))return null}else return null}return new Ne(z)},compare:function(w,P){var y=x.type.compare(w,P);return y!==0?y:w.compare(P)},arithmetic_compare:function(w,P,y){var F=P.interpret(w);if(x.type.is_number(F)){var z=y.interpret(w);return x.type.is_number(z)?F.value<z.value?-1:F.value>z.value?1:0:z}else return F},operate:function(w,P){if(x.type.is_operator(P)){for(var y=x.type.is_operator(P),F=[],z,Z=!1,$=0;$<P.args.length;$++){if(z=P.args[$].interpret(w),x.type.is_number(z)){if(y.type_args!==null&&z.is_float!==y.type_args)return x.error.type(y.type_args?\"float\":\"integer\",z,w.__call_indicator);F.push(z.value)}else return z;Z=Z||z.is_float}return F.push(w),z=x.arithmetic.evaluation[P.indicator].fn.apply(this,F),Z=y.type_result===null?Z:y.type_result,x.type.is_term(z)?z:z===Number.POSITIVE_INFINITY||z===Number.NEGATIVE_INFINITY?x.error.evaluation(\"overflow\",w.__call_indicator):Z===!1&&w.get_flag(\"bounded\").id===\"true\"&&(z>w.get_flag(\"max_integer\").value||z<w.get_flag(\"min_integer\").value)?x.error.evaluation(\"int_overflow\",w.__call_indicator):new Te(z,Z)}else return x.error.type(\"evaluable\",P.indicator,w.__call_indicator)},error:{existence:function(w,P,y){return typeof P==\"string\"&&(P=X(P)),new j(\"error\",[new j(\"existence_error\",[new j(w),P]),X(y)])},type:function(w,P,y){return new j(\"error\",[new j(\"type_error\",[new j(w),P]),X(y)])},instantiation:function(w){return new j(\"error\",[new j(\"instantiation_error\"),X(w)])},domain:function(w,P,y){return new j(\"error\",[new j(\"domain_error\",[new j(w),P]),X(y)])},representation:function(w,P){return new j(\"error\",[new j(\"representation_error\",[new j(w)]),X(P)])},permission:function(w,P,y,F){return new j(\"error\",[new j(\"permission_error\",[new j(w),new j(P),y]),X(F)])},evaluation:function(w,P){return new j(\"error\",[new j(\"evaluation_error\",[new j(w)]),X(P)])},syntax:function(w,P,y){w=w||{value:\"\",line:0,column:0,matches:[\"\"],start:0};var F=y&&w.matches.length>0?w.start+w.matches[0].length:w.start,z=y?new j(\"token_not_found\"):new j(\"found\",[new j(w.value.toString())]),Z=new j(\".\",[new j(\"line\",[new Te(w.line+1)]),new j(\".\",[new j(\"column\",[new Te(F+1)]),new j(\".\",[z,new j(\"[]\",[])])])]);return new j(\"error\",[new j(\"syntax_error\",[new j(P)]),Z])},syntax_by_predicate:function(w,P){return new j(\"error\",[new j(\"syntax_error\",[new j(w)]),X(P)])}},warning:{singleton:function(w,P,y){for(var F=new j(\"[]\"),z=w.length-1;z>=0;z--)F=new j(\".\",[new De(w[z]),F]);return new j(\"warning\",[new j(\"singleton_variables\",[F,X(P)]),new j(\".\",[new j(\"line\",[new Te(y,!1)]),new j(\"[]\")])])},failed_goal:function(w,P){return new j(\"warning\",[new j(\"failed_goal\",[w]),new j(\".\",[new j(\"line\",[new Te(P,!1)]),new j(\"[]\")])])}},format_variable:function(w){return\"_\"+w},format_answer:function(w,P,F){P instanceof ke&&(P=P.thread);var F=F||{};if(F.session=P?P.session:void 0,x.type.is_error(w))return\"uncaught exception: \"+w.args[0].toString();if(w===!1)return\"false.\";if(w===null)return\"limit exceeded ;\";var z=0,Z=\"\";if(x.type.is_substitution(w)){var $=w.domain(!0);w=w.filter(function(Re,lt){return!x.type.is_variable(lt)||$.indexOf(lt.id)!==-1&&Re!==lt.id})}for(var oe in w.links)w.links.hasOwnProperty(oe)&&(z++,Z!==\"\"&&(Z+=\", \"),Z+=oe.toString(F)+\" = \"+w.links[oe].toString(F));var xe=typeof P>\"u\"||P.points.length>0?\" ;\":\".\";return z===0?\"true\"+xe:Z+xe},flatten_error:function(w){if(!x.type.is_error(w))return null;w=w.args[0];var P={};return P.type=w.args[0].id,P.thrown=P.type===\"syntax_error\"?null:w.args[1].id,P.expected=null,P.found=null,P.representation=null,P.existence=null,P.existence_type=null,P.line=null,P.column=null,P.permission_operation=null,P.permission_type=null,P.evaluation_type=null,P.type===\"type_error\"||P.type===\"domain_error\"?(P.expected=w.args[0].args[0].id,P.found=w.args[0].args[1].toString()):P.type===\"syntax_error\"?w.args[1].indicator===\"./2\"?(P.expected=w.args[0].args[0].id,P.found=w.args[1].args[1].args[1].args[0],P.found=P.found.id===\"token_not_found\"?P.found.id:P.found.args[0].id,P.line=w.args[1].args[0].args[0].value,P.column=w.args[1].args[1].args[0].args[0].value):P.thrown=w.args[1].id:P.type===\"permission_error\"?(P.found=w.args[0].args[2].toString(),P.permission_operation=w.args[0].args[0].id,P.permission_type=w.args[0].args[1].id):P.type===\"evaluation_error\"?P.evaluation_type=w.args[0].args[0].id:P.type===\"representation_error\"?P.representation=w.args[0].args[0].id:P.type===\"existence_error\"&&(P.existence=w.args[0].args[1].toString(),P.existence_type=w.args[0].args[0].id),P},create:function(w){return new x.type.Session(w)}};typeof ec<\"u\"?ec.exports=x:window.pl=x})()});function hEe(t,e,r){t.prepend(r.map(s=>new hl.default.type.State(e.goal.replace(s),e.substitution,e)))}function k5(t){let e=dEe.get(t.session);if(e==null)throw new Error(\"Assertion failed: A project should have been registered for the active session\");return e}function mEe(t,e){dEe.set(t,e),t.consult(`:- use_module(library(${qct.id})).`)}var hl,gEe,J0,jct,Gct,dEe,qct,yEe=Ze(()=>{Ge();ql();hl=ut(x5()),gEe=ut(Ie(\"vm\")),{is_atom:J0,is_variable:jct,is_instantiated_list:Gct}=hl.default.type;dEe=new WeakMap;qct=new hl.default.type.Module(\"constraints\",{\"project_workspaces_by_descriptor/3\":(t,e,r)=>{let[s,a,n]=r.args;if(!J0(s)||!J0(a)){t.throw_error(hl.default.error.instantiation(r.indicator));return}let c=G.parseIdent(s.id),f=G.makeDescriptor(c,a.id),h=k5(t).tryWorkspaceByDescriptor(f);jct(n)&&h!==null&&hEe(t,e,[new hl.default.type.Term(\"=\",[n,new hl.default.type.Term(String(h.relativeCwd))])]),J0(n)&&h!==null&&h.relativeCwd===n.id&&t.success(e)},\"workspace_field/3\":(t,e,r)=>{let[s,a,n]=r.args;if(!J0(s)||!J0(a)){t.throw_error(hl.default.error.instantiation(r.indicator));return}let f=k5(t).tryWorkspaceByCwd(s.id);if(f==null)return;let p=va(f.manifest.raw,a.id);typeof p>\"u\"||hEe(t,e,[new hl.default.type.Term(\"=\",[n,new hl.default.type.Term(typeof p==\"object\"?JSON.stringify(p):p)])])},\"workspace_field_test/3\":(t,e,r)=>{let[s,a,n]=r.args;t.prepend([new hl.default.type.State(e.goal.replace(new hl.default.type.Term(\"workspace_field_test\",[s,a,n,new hl.default.type.Term(\"[]\",[])])),e.substitution,e)])},\"workspace_field_test/4\":(t,e,r)=>{let[s,a,n,c]=r.args;if(!J0(s)||!J0(a)||!J0(n)||!Gct(c)){t.throw_error(hl.default.error.instantiation(r.indicator));return}let p=k5(t).tryWorkspaceByCwd(s.id);if(p==null)return;let h=va(p.manifest.raw,a.id);if(typeof h>\"u\")return;let E={$$:h};for(let[S,b]of c.toJavaScript().entries())E[`$${S}`]=b;gEe.default.runInNewContext(n.id,E)&&t.success(e)}},[\"project_workspaces_by_descriptor/3\",\"workspace_field/3\",\"workspace_field_test/3\",\"workspace_field_test/4\"])});var aS={};Vt(aS,{Constraints:()=>R5,DependencyType:()=>wEe});function go(t){if(t instanceof KC.default.type.Num)return t.value;if(t instanceof KC.default.type.Term)switch(t.indicator){case\"throw/1\":return go(t.args[0]);case\"error/1\":return go(t.args[0]);case\"error/2\":if(t.args[0]instanceof KC.default.type.Term&&t.args[0].indicator===\"syntax_error/1\")return Object.assign(go(t.args[0]),...go(t.args[1]));{let e=go(t.args[0]);return e.message+=` (in ${go(t.args[1])})`,e}case\"syntax_error/1\":return new jt(43,`Syntax error: ${go(t.args[0])}`);case\"existence_error/2\":return new jt(44,`Existence error: ${go(t.args[0])} ${go(t.args[1])} not found`);case\"instantiation_error/0\":return new jt(75,\"Instantiation error: an argument is variable when an instantiated argument was expected\");case\"line/1\":return{line:go(t.args[0])};case\"column/1\":return{column:go(t.args[0])};case\"found/1\":return{found:go(t.args[0])};case\"./2\":return[go(t.args[0])].concat(go(t.args[1]));case\"//2\":return`${go(t.args[0])}/${go(t.args[1])}`;default:return t.id}throw`couldn't pretty print because of unsupported node ${t}`}function IEe(t){let e;try{e=go(t)}catch(r){throw typeof r==\"string\"?new jt(42,`Unknown error: ${t} (note: ${r})`):r}return typeof e.line<\"u\"&&typeof e.column<\"u\"&&(e.message+=` at line ${e.line}, column ${e.column}`),e}function bm(t){return t.id===\"null\"?null:`${t.toJavaScript()}`}function Wct(t){if(t.id===\"null\")return null;{let e=t.toJavaScript();if(typeof e!=\"string\")return JSON.stringify(e);try{return JSON.stringify(JSON.parse(e))}catch{return JSON.stringify(e)}}}function K0(t){return typeof t==\"string\"?`'${t}'`:\"[]\"}var CEe,KC,wEe,EEe,Q5,R5,lS=Ze(()=>{Ge();Ge();Dt();CEe=ut(Xye()),KC=ut(x5());iS();yEe();(0,CEe.default)(KC.default);wEe=(s=>(s.Dependencies=\"dependencies\",s.DevDependencies=\"devDependencies\",s.PeerDependencies=\"peerDependencies\",s))(wEe||{}),EEe=[\"dependencies\",\"devDependencies\",\"peerDependencies\"];Q5=class{constructor(e,r){let s=1e3*e.workspaces.length;this.session=KC.default.create(s),mEe(this.session,e),this.session.consult(\":- use_module(library(lists)).\"),this.session.consult(r)}fetchNextAnswer(){return new Promise(e=>{this.session.answer(r=>{e(r)})})}async*makeQuery(e){let r=this.session.query(e);if(r!==!0)throw IEe(r);for(;;){let s=await this.fetchNextAnswer();if(s===null)throw new jt(79,\"Resolution limit exceeded\");if(!s)break;if(s.id===\"throw\")throw IEe(s);yield s}}};R5=class t{constructor(e){this.source=\"\";this.project=e;let r=e.configuration.get(\"constraintsPath\");ce.existsSync(r)&&(this.source=ce.readFileSync(r,\"utf8\"))}static async find(e){return new t(e)}getProjectDatabase(){let e=\"\";for(let r of EEe)e+=`dependency_type(${r}).\n`;for(let r of this.project.workspacesByCwd.values()){let s=r.relativeCwd;e+=`workspace(${K0(s)}).\n`,e+=`workspace_ident(${K0(s)}, ${K0(G.stringifyIdent(r.anchoredLocator))}).\n`,e+=`workspace_version(${K0(s)}, ${K0(r.manifest.version)}).\n`;for(let a of EEe)for(let n of r.manifest[a].values())e+=`workspace_has_dependency(${K0(s)}, ${K0(G.stringifyIdent(n))}, ${K0(n.range)}, ${a}).\n`}return e+=`workspace(_) :- false.\n`,e+=`workspace_ident(_, _) :- false.\n`,e+=`workspace_version(_, _) :- false.\n`,e+=`workspace_has_dependency(_, _, _, _) :- false.\n`,e}getDeclarations(){let e=\"\";return e+=`gen_enforced_dependency(_, _, _, _) :- false.\n`,e+=`gen_enforced_field(_, _, _) :- false.\n`,e}get fullSource(){return`${this.getProjectDatabase()}\n${this.source}\n${this.getDeclarations()}`}createSession(){return new Q5(this.project,this.fullSource)}async processClassic(){let e=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(e),enforcedFields:await this.genEnforcedFields(e)}}async process(){let{enforcedDependencies:e,enforcedFields:r}=await this.processClassic(),s=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:c,dependencyType:f}of e){let p=nS([f,G.stringifyIdent(n)]),h=je.getMapWithDefault(s,a.cwd);je.getMapWithDefault(h,p).set(c??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:c}of r){let f=nS(n),p=je.getMapWithDefault(s,a.cwd);je.getMapWithDefault(p,f).set(JSON.parse(c)??void 0,new Set)}return{manifestUpdates:s,reportedErrors:new Map}}async genEnforcedDependencies(e){let r=[];for await(let s of e.makeQuery(\"workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).\")){let a=J.resolve(this.project.cwd,bm(s.links.WorkspaceCwd)),n=bm(s.links.DependencyIdent),c=bm(s.links.DependencyRange),f=bm(s.links.DependencyType);if(a===null||n===null)throw new Error(\"Invalid rule\");let p=this.project.getWorkspaceByCwd(a),h=G.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:c,dependencyType:f})}return je.sortMap(r,[({dependencyRange:s})=>s!==null?\"0\":\"1\",({workspace:s})=>G.stringifyIdent(s.anchoredLocator),({dependencyIdent:s})=>G.stringifyIdent(s)])}async genEnforcedFields(e){let r=[];for await(let s of e.makeQuery(\"workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).\")){let a=J.resolve(this.project.cwd,bm(s.links.WorkspaceCwd)),n=bm(s.links.FieldPath),c=Wct(s.links.FieldValue);if(a===null||n===null)throw new Error(\"Invalid rule\");let f=this.project.getWorkspaceByCwd(a);r.push({workspace:f,fieldPath:n,fieldValue:c})}return je.sortMap(r,[({workspace:s})=>G.stringifyIdent(s.anchoredLocator),({fieldPath:s})=>s])}async*query(e){let r=this.createSession();for await(let s of r.makeQuery(e)){let a={};for(let[n,c]of Object.entries(s.links))n!==\"_\"&&(a[n]=bm(c));yield a}}}});var QEe=_(uF=>{\"use strict\";Object.defineProperty(uF,\"__esModule\",{value:!0});function BS(t){let e=[...t.caches],r=e.shift();return r===void 0?kEe():{get(s,a,n={miss:()=>Promise.resolve()}){return r.get(s,a,n).catch(()=>BS({caches:e}).get(s,a,n))},set(s,a){return r.set(s,a).catch(()=>BS({caches:e}).set(s,a))},delete(s){return r.delete(s).catch(()=>BS({caches:e}).delete(s))},clear(){return r.clear().catch(()=>BS({caches:e}).clear())}}}function kEe(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}uF.createFallbackableCache=BS;uF.createNullCache=kEe});var TEe=_((iJt,REe)=>{REe.exports=QEe()});var FEe=_(Y5=>{\"use strict\";Object.defineProperty(Y5,\"__esModule\",{value:!0});function uut(t={serializable:!0}){let e={};return{get(r,s,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in e)return Promise.resolve(t.serializable?JSON.parse(e[n]):e[n]);let c=s(),f=a&&a.miss||(()=>Promise.resolve());return c.then(p=>f(p)).then(()=>c)},set(r,s){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}Y5.createInMemoryCache=uut});var OEe=_((oJt,NEe)=>{NEe.exports=FEe()});var MEe=_($u=>{\"use strict\";Object.defineProperty($u,\"__esModule\",{value:!0});function fut(t,e,r){let s={\"x-algolia-api-key\":r,\"x-algolia-application-id\":e};return{headers(){return t===V5.WithinHeaders?s:{}},queryParameters(){return t===V5.WithinQueryParameters?s:{}}}}function Aut(t){let e=0,r=()=>(e++,new Promise(s=>{setTimeout(()=>{s(t(r))},Math.min(100*e,1e3))}));return t(r)}function LEe(t,e=(r,s)=>Promise.resolve()){return Object.assign(t,{wait(r){return LEe(t.then(s=>Promise.all([e(s,r),s])).then(s=>s[1]))}})}function put(t){let e=t.length-1;for(e;e>0;e--){let r=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[r],t[r]=s}return t}function hut(t,e){return e&&Object.keys(e).forEach(r=>{t[r]=e[r](t)}),t}function gut(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}var dut=\"4.22.1\",mut=t=>()=>t.transporter.requester.destroy(),V5={WithinQueryParameters:0,WithinHeaders:1};$u.AuthMode=V5;$u.addMethods=hut;$u.createAuth=fut;$u.createRetryablePromise=Aut;$u.createWaitablePromise=LEe;$u.destroy=mut;$u.encode=gut;$u.shuffle=put;$u.version=dut});var vS=_((lJt,UEe)=>{UEe.exports=MEe()});var _Ee=_(J5=>{\"use strict\";Object.defineProperty(J5,\"__esModule\",{value:!0});var yut={Delete:\"DELETE\",Get:\"GET\",Post:\"POST\",Put:\"PUT\"};J5.MethodEnum=yut});var SS=_((uJt,HEe)=>{HEe.exports=_Ee()});var rIe=_(Wi=>{\"use strict\";Object.defineProperty(Wi,\"__esModule\",{value:!0});var GEe=SS();function K5(t,e){let r=t||{},s=r.data||{};return Object.keys(r).forEach(a=>{[\"timeout\",\"headers\",\"queryParameters\",\"data\",\"cacheable\"].indexOf(a)===-1&&(s[a]=r[a])}),{data:Object.entries(s).length>0?s:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var DS={Read:1,Write:2,Any:3},sw={Up:1,Down:2,Timeouted:3},qEe=2*60*1e3;function Z5(t,e=sw.Up){return{...t,status:e,lastUpdate:Date.now()}}function WEe(t){return t.status===sw.Up||Date.now()-t.lastUpdate>qEe}function YEe(t){return t.status===sw.Timeouted&&Date.now()-t.lastUpdate<=qEe}function X5(t){return typeof t==\"string\"?{protocol:\"https\",url:t,accept:DS.Any}:{protocol:t.protocol||\"https\",url:t.url,accept:t.accept||DS.Any}}function Eut(t,e){return Promise.all(e.map(r=>t.get(r,()=>Promise.resolve(Z5(r))))).then(r=>{let s=r.filter(f=>WEe(f)),a=r.filter(f=>YEe(f)),n=[...s,...a],c=n.length>0?n.map(f=>X5(f)):e;return{getTimeout(f,p){return(a.length===0&&f===0?1:a.length+3+f)*p},statelessHosts:c}})}var Iut=({isTimedOut:t,status:e})=>!t&&~~e===0,Cut=t=>{let e=t.status;return t.isTimedOut||Iut(t)||~~(e/100)!==2&&~~(e/100)!==4},wut=({status:t})=>~~(t/100)===2,But=(t,e)=>Cut(t)?e.onRetry(t):wut(t)?e.onSuccess(t):e.onFail(t);function jEe(t,e,r,s){let a=[],n=ZEe(r,s),c=XEe(t,s),f=r.method,p=r.method!==GEe.MethodEnum.Get?{}:{...r.data,...s.data},h={\"x-algolia-agent\":t.userAgent.value,...t.queryParameters,...p,...s.queryParameters},E=0,C=(S,b)=>{let I=S.pop();if(I===void 0)throw tIe(z5(a));let T={data:n,headers:c,method:f,url:KEe(I,r.path,h),connectTimeout:b(E,t.timeouts.connect),responseTimeout:b(E,s.timeout)},N=W=>{let ee={request:T,response:W,host:I,triesLeft:S.length};return a.push(ee),ee},U={onSuccess:W=>VEe(W),onRetry(W){let ee=N(W);return W.isTimedOut&&E++,Promise.all([t.logger.info(\"Retryable failure\",$5(ee)),t.hostsCache.set(I,Z5(I,W.isTimedOut?sw.Timeouted:sw.Down))]).then(()=>C(S,b))},onFail(W){throw N(W),JEe(W,z5(a))}};return t.requester.send(T).then(W=>But(W,U))};return Eut(t.hostsCache,e).then(S=>C([...S.statelessHosts].reverse(),S.getTimeout))}function vut(t){let{hostsCache:e,logger:r,requester:s,requestsCache:a,responsesCache:n,timeouts:c,userAgent:f,hosts:p,queryParameters:h,headers:E}=t,C={hostsCache:e,logger:r,requester:s,requestsCache:a,responsesCache:n,timeouts:c,userAgent:f,headers:E,queryParameters:h,hosts:p.map(S=>X5(S)),read(S,b){let I=K5(b,C.timeouts.read),T=()=>jEe(C,C.hosts.filter(W=>(W.accept&DS.Read)!==0),S,I);if((I.cacheable!==void 0?I.cacheable:S.cacheable)!==!0)return T();let U={request:S,mappedRequestOptions:I,transporter:{queryParameters:C.queryParameters,headers:C.headers}};return C.responsesCache.get(U,()=>C.requestsCache.get(U,()=>C.requestsCache.set(U,T()).then(W=>Promise.all([C.requestsCache.delete(U),W]),W=>Promise.all([C.requestsCache.delete(U),Promise.reject(W)])).then(([W,ee])=>ee)),{miss:W=>C.responsesCache.set(U,W)})},write(S,b){return jEe(C,C.hosts.filter(I=>(I.accept&DS.Write)!==0),S,K5(b,C.timeouts.write))}};return C}function Sut(t){let e={value:`Algolia for JavaScript (${t})`,add(r){let s=`; ${r.segment}${r.version!==void 0?` (${r.version})`:\"\"}`;return e.value.indexOf(s)===-1&&(e.value=`${e.value}${s}`),e}};return e}function VEe(t){try{return JSON.parse(t.content)}catch(e){throw eIe(e.message,t)}}function JEe({content:t,status:e},r){let s=t;try{s=JSON.parse(t).message}catch{}return $Ee(s,e,r)}function Dut(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}function KEe(t,e,r){let s=zEe(r),a=`${t.protocol}://${t.url}/${e.charAt(0)===\"/\"?e.substr(1):e}`;return s.length&&(a+=`?${s}`),a}function zEe(t){let e=r=>Object.prototype.toString.call(r)===\"[object Object]\"||Object.prototype.toString.call(r)===\"[object Array]\";return Object.keys(t).map(r=>Dut(\"%s=%s\",r,e(t[r])?JSON.stringify(t[r]):t[r])).join(\"&\")}function ZEe(t,e){if(t.method===GEe.MethodEnum.Get||t.data===void 0&&e.data===void 0)return;let r=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(r)}function XEe(t,e){let r={...t.headers,...e.headers},s={};return Object.keys(r).forEach(a=>{let n=r[a];s[a.toLowerCase()]=n}),s}function z5(t){return t.map(e=>$5(e))}function $5(t){let e=t.request.headers[\"x-algolia-api-key\"]?{\"x-algolia-api-key\":\"*****\"}:{};return{...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function $Ee(t,e,r){return{name:\"ApiError\",message:t,status:e,transporterStackTrace:r}}function eIe(t,e){return{name:\"DeserializationError\",message:t,response:e}}function tIe(t){return{name:\"RetryError\",message:\"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.\",transporterStackTrace:t}}Wi.CallEnum=DS;Wi.HostStatusEnum=sw;Wi.createApiError=$Ee;Wi.createDeserializationError=eIe;Wi.createMappedRequestOptions=K5;Wi.createRetryError=tIe;Wi.createStatefulHost=Z5;Wi.createStatelessHost=X5;Wi.createTransporter=vut;Wi.createUserAgent=Sut;Wi.deserializeFailure=JEe;Wi.deserializeSuccess=VEe;Wi.isStatefulHostTimeouted=YEe;Wi.isStatefulHostUp=WEe;Wi.serializeData=ZEe;Wi.serializeHeaders=XEe;Wi.serializeQueryParameters=zEe;Wi.serializeUrl=KEe;Wi.stackFrameWithoutCredentials=$5;Wi.stackTraceWithoutCredentials=z5});var PS=_((AJt,nIe)=>{nIe.exports=rIe()});var iIe=_(Z0=>{\"use strict\";Object.defineProperty(Z0,\"__esModule\",{value:!0});var ow=vS(),Put=PS(),bS=SS(),but=t=>{let e=t.region||\"us\",r=ow.createAuth(ow.AuthMode.WithinHeaders,t.appId,t.apiKey),s=Put.createTransporter({hosts:[{url:`analytics.${e}.algolia.com`}],...t,headers:{...r.headers(),\"content-type\":\"application/json\",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}}),a=t.appId;return ow.addMethods({appId:a,transporter:s},t.methods)},xut=t=>(e,r)=>t.transporter.write({method:bS.MethodEnum.Post,path:\"2/abtests\",data:e},r),kut=t=>(e,r)=>t.transporter.write({method:bS.MethodEnum.Delete,path:ow.encode(\"2/abtests/%s\",e)},r),Qut=t=>(e,r)=>t.transporter.read({method:bS.MethodEnum.Get,path:ow.encode(\"2/abtests/%s\",e)},r),Rut=t=>e=>t.transporter.read({method:bS.MethodEnum.Get,path:\"2/abtests\"},e),Tut=t=>(e,r)=>t.transporter.write({method:bS.MethodEnum.Post,path:ow.encode(\"2/abtests/%s/stop\",e)},r);Z0.addABTest=xut;Z0.createAnalyticsClient=but;Z0.deleteABTest=kut;Z0.getABTest=Qut;Z0.getABTests=Rut;Z0.stopABTest=Tut});var oIe=_((hJt,sIe)=>{sIe.exports=iIe()});var lIe=_(xS=>{\"use strict\";Object.defineProperty(xS,\"__esModule\",{value:!0});var e9=vS(),Fut=PS(),aIe=SS(),Nut=t=>{let e=t.region||\"us\",r=e9.createAuth(e9.AuthMode.WithinHeaders,t.appId,t.apiKey),s=Fut.createTransporter({hosts:[{url:`personalization.${e}.algolia.com`}],...t,headers:{...r.headers(),\"content-type\":\"application/json\",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}});return e9.addMethods({appId:t.appId,transporter:s},t.methods)},Out=t=>e=>t.transporter.read({method:aIe.MethodEnum.Get,path:\"1/strategies/personalization\"},e),Lut=t=>(e,r)=>t.transporter.write({method:aIe.MethodEnum.Post,path:\"1/strategies/personalization\",data:e},r);xS.createPersonalizationClient=Nut;xS.getPersonalizationStrategy=Out;xS.setPersonalizationStrategy=Lut});var uIe=_((dJt,cIe)=>{cIe.exports=lIe()});var vIe=_(Ft=>{\"use strict\";Object.defineProperty(Ft,\"__esModule\",{value:!0});var Jt=vS(),gl=PS(),Pr=SS(),Mut=Ie(\"crypto\");function fF(t){let e=r=>t.request(r).then(s=>{if(t.batch!==void 0&&t.batch(s.hits),!t.shouldStop(s))return s.cursor?e({cursor:s.cursor}):e({page:(r.page||0)+1})});return e({})}var Uut=t=>{let e=t.appId,r=Jt.createAuth(t.authMode!==void 0?t.authMode:Jt.AuthMode.WithinHeaders,e,t.apiKey),s=gl.createTransporter({hosts:[{url:`${e}-dsn.algolia.net`,accept:gl.CallEnum.Read},{url:`${e}.algolia.net`,accept:gl.CallEnum.Write}].concat(Jt.shuffle([{url:`${e}-1.algolianet.com`},{url:`${e}-2.algolianet.com`},{url:`${e}-3.algolianet.com`}])),...t,headers:{...r.headers(),\"content-type\":\"application/x-www-form-urlencoded\",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}}),a={transporter:s,appId:e,addAlgoliaAgent(n,c){s.userAgent.add({segment:n,version:c})},clearCache(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>{})}};return Jt.addMethods(a,t.methods)};function fIe(){return{name:\"MissingObjectIDError\",message:\"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.\"}}function AIe(){return{name:\"ObjectNotFoundError\",message:\"Object not found.\"}}function pIe(){return{name:\"ValidUntilNotFoundError\",message:\"ValidUntil not found in given secured api key.\"}}var _ut=t=>(e,r)=>{let{queryParameters:s,...a}=r||{},n={acl:e,...s!==void 0?{queryParameters:s}:{}},c=(f,p)=>Jt.createRetryablePromise(h=>kS(t)(f.key,p).catch(E=>{if(E.status!==404)throw E;return h()}));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:\"1/keys\",data:n},a),c)},Hut=t=>(e,r,s)=>{let a=gl.createMappedRequestOptions(s);return a.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:Pr.MethodEnum.Post,path:\"1/clusters/mapping\",data:{cluster:r}},a)},jut=t=>(e,r,s)=>t.transporter.write({method:Pr.MethodEnum.Post,path:\"1/clusters/mapping/batch\",data:{users:e,cluster:r}},s),Gut=t=>(e,r)=>Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:{action:\"addEntry\",body:[]}}},r),(s,a)=>aw(t)(s.taskID,a)),AF=t=>(e,r,s)=>{let a=(n,c)=>QS(t)(e,{methods:{waitTask:hs}}).waitTask(n.taskID,c);return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/operation\",e),data:{operation:\"copy\",destination:r}},s),a)},qut=t=>(e,r,s)=>AF(t)(e,r,{...s,scope:[hF.Rules]}),Wut=t=>(e,r,s)=>AF(t)(e,r,{...s,scope:[hF.Settings]}),Yut=t=>(e,r,s)=>AF(t)(e,r,{...s,scope:[hF.Synonyms]}),Vut=t=>(e,r)=>e.method===Pr.MethodEnum.Get?t.transporter.read(e,r):t.transporter.write(e,r),Jut=t=>(e,r)=>{let s=(a,n)=>Jt.createRetryablePromise(c=>kS(t)(e,n).then(c).catch(f=>{if(f.status!==404)throw f}));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Delete,path:Jt.encode(\"1/keys/%s\",e)},r),s)},Kut=t=>(e,r,s)=>{let a=r.map(n=>({action:\"deleteEntry\",body:{objectID:n}}));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},s),(n,c)=>aw(t)(n.taskID,c))},zut=()=>(t,e)=>{let r=gl.serializeQueryParameters(e),s=Mut.createHmac(\"sha256\",t).update(r).digest(\"hex\");return Buffer.from(s+r).toString(\"base64\")},kS=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/keys/%s\",e)},r),hIe=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/task/%s\",e.toString())},r),Zut=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"/1/dictionaries/*/settings\"},e),Xut=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/logs\"},e),$ut=()=>t=>{let e=Buffer.from(t,\"base64\").toString(\"ascii\"),r=/validUntil=(\\d+)/,s=e.match(r);if(s===null)throw pIe();return parseInt(s[1],10)-Math.round(new Date().getTime()/1e3)},eft=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/clusters/mapping/top\"},e),tft=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/clusters/mapping/%s\",e)},r),rft=t=>e=>{let{retrieveMappings:r,...s}=e||{};return r===!0&&(s.getClusters=!0),t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/clusters/mapping/pending\"},s)},QS=t=>(e,r={})=>{let s={transporter:t.transporter,appId:t.appId,indexName:e};return Jt.addMethods(s,r.methods)},nft=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/keys\"},e),ift=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/clusters\"},e),sft=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/indexes\"},e),oft=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:\"1/clusters/mapping\"},e),aft=t=>(e,r,s)=>{let a=(n,c)=>QS(t)(e,{methods:{waitTask:hs}}).waitTask(n.taskID,c);return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/operation\",e),data:{operation:\"move\",destination:r}},s),a)},lft=t=>(e,r)=>{let s=(a,n)=>Promise.all(Object.keys(a.taskID).map(c=>QS(t)(c,{methods:{waitTask:hs}}).waitTask(a.taskID[c],n)));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:\"1/indexes/*/batch\",data:{requests:e}},r),s)},cft=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Post,path:\"1/indexes/*/objects\",data:{requests:e}},r),uft=t=>(e,r)=>{let s=e.map(a=>({...a,params:gl.serializeQueryParameters(a.params||{})}));return t.transporter.read({method:Pr.MethodEnum.Post,path:\"1/indexes/*/queries\",data:{requests:s},cacheable:!0},r)},fft=t=>(e,r)=>Promise.all(e.map(s=>{let{facetName:a,facetQuery:n,...c}=s.params;return QS(t)(s.indexName,{methods:{searchForFacetValues:CIe}}).searchForFacetValues(a,n,{...r,...c})})),Aft=t=>(e,r)=>{let s=gl.createMappedRequestOptions(r);return s.queryParameters[\"X-Algolia-User-ID\"]=e,t.transporter.write({method:Pr.MethodEnum.Delete,path:\"1/clusters/mapping\"},s)},pft=t=>(e,r,s)=>{let a=r.map(n=>({action:\"addEntry\",body:n}));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!0,requests:a}},s),(n,c)=>aw(t)(n.taskID,c))},hft=t=>(e,r)=>{let s=(a,n)=>Jt.createRetryablePromise(c=>kS(t)(e,n).catch(f=>{if(f.status!==404)throw f;return c()}));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/keys/%s/restore\",e)},r),s)},gft=t=>(e,r,s)=>{let a=r.map(n=>({action:\"addEntry\",body:n}));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/batch\",e),data:{clearExistingDictionaryEntries:!1,requests:a}},s),(n,c)=>aw(t)(n.taskID,c))},dft=t=>(e,r,s)=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"/1/dictionaries/%s/search\",e),data:{query:r},cacheable:!0},s),mft=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Post,path:\"1/clusters/mapping/search\",data:{query:e}},r),yft=t=>(e,r)=>Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Put,path:\"/1/dictionaries/*/settings\",data:e},r),(s,a)=>aw(t)(s.taskID,a)),Eft=t=>(e,r)=>{let s=Object.assign({},r),{queryParameters:a,...n}=r||{},c=a?{queryParameters:a}:{},f=[\"acl\",\"indexes\",\"referers\",\"restrictSources\",\"queryParameters\",\"description\",\"maxQueriesPerIPPerHour\",\"maxHitsPerQuery\"],p=E=>Object.keys(s).filter(C=>f.indexOf(C)!==-1).every(C=>{if(Array.isArray(E[C])&&Array.isArray(s[C])){let S=E[C];return S.length===s[C].length&&S.every((b,I)=>b===s[C][I])}else return E[C]===s[C]}),h=(E,C)=>Jt.createRetryablePromise(S=>kS(t)(e,C).then(b=>p(b)?Promise.resolve():S()));return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Put,path:Jt.encode(\"1/keys/%s\",e),data:c},n),h)},aw=t=>(e,r)=>Jt.createRetryablePromise(s=>hIe(t)(e,r).then(a=>a.status!==\"published\"?s():void 0)),gIe=t=>(e,r)=>{let s=(a,n)=>hs(t)(a.taskID,n);return Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/batch\",t.indexName),data:{requests:e}},r),s)},Ift=t=>e=>fF({shouldStop:r=>r.cursor===void 0,...e,request:r=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/browse\",t.indexName),data:r},e)}),Cft=t=>e=>{let r={hitsPerPage:1e3,...e};return fF({shouldStop:s=>s.hits.length<r.hitsPerPage,...r,request(s){return wIe(t)(\"\",{...r,...s}).then(a=>({...a,hits:a.hits.map(n=>(delete n._highlightResult,n))}))}})},wft=t=>e=>{let r={hitsPerPage:1e3,...e};return fF({shouldStop:s=>s.hits.length<r.hitsPerPage,...r,request(s){return BIe(t)(\"\",{...r,...s}).then(a=>({...a,hits:a.hits.map(n=>(delete n._highlightResult,n))}))}})},pF=t=>(e,r,s)=>{let{batchSize:a,...n}=s||{},c={taskIDs:[],objectIDs:[]},f=(p=0)=>{let h=[],E;for(E=p;E<e.length&&(h.push(e[E]),h.length!==(a||1e3));E++);return h.length===0?Promise.resolve(c):gIe(t)(h.map(C=>({action:r,body:C})),n).then(C=>(c.objectIDs=c.objectIDs.concat(C.objectIDs),c.taskIDs.push(C.taskID),E++,f(E)))};return Jt.createWaitablePromise(f(),(p,h)=>Promise.all(p.taskIDs.map(E=>hs(t)(E,h))))},Bft=t=>e=>Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/clear\",t.indexName)},e),(r,s)=>hs(t)(r.taskID,s)),vft=t=>e=>{let{forwardToReplicas:r,...s}=e||{},a=gl.createMappedRequestOptions(s);return r&&(a.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/rules/clear\",t.indexName)},a),(n,c)=>hs(t)(n.taskID,c))},Sft=t=>e=>{let{forwardToReplicas:r,...s}=e||{},a=gl.createMappedRequestOptions(s);return r&&(a.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/synonyms/clear\",t.indexName)},a),(n,c)=>hs(t)(n.taskID,c))},Dft=t=>(e,r)=>Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/deleteByQuery\",t.indexName),data:e},r),(s,a)=>hs(t)(s.taskID,a)),Pft=t=>e=>Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Delete,path:Jt.encode(\"1/indexes/%s\",t.indexName)},e),(r,s)=>hs(t)(r.taskID,s)),bft=t=>(e,r)=>Jt.createWaitablePromise(dIe(t)([e],r).then(s=>({taskID:s.taskIDs[0]})),(s,a)=>hs(t)(s.taskID,a)),dIe=t=>(e,r)=>{let s=e.map(a=>({objectID:a}));return pF(t)(s,km.DeleteObject,r)},xft=t=>(e,r)=>{let{forwardToReplicas:s,...a}=r||{},n=gl.createMappedRequestOptions(a);return s&&(n.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Delete,path:Jt.encode(\"1/indexes/%s/rules/%s\",t.indexName,e)},n),(c,f)=>hs(t)(c.taskID,f))},kft=t=>(e,r)=>{let{forwardToReplicas:s,...a}=r||{},n=gl.createMappedRequestOptions(a);return s&&(n.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Delete,path:Jt.encode(\"1/indexes/%s/synonyms/%s\",t.indexName,e)},n),(c,f)=>hs(t)(c.taskID,f))},Qft=t=>e=>mIe(t)(e).then(()=>!0).catch(r=>{if(r.status!==404)throw r;return!1}),Rft=t=>(e,r,s)=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/answers/%s/prediction\",t.indexName),data:{query:e,queryLanguages:r},cacheable:!0},s),Tft=t=>(e,r)=>{let{query:s,paginate:a,...n}=r||{},c=0,f=()=>IIe(t)(s||\"\",{...n,page:c}).then(p=>{for(let[h,E]of Object.entries(p.hits))if(e(E))return{object:E,position:parseInt(h,10),page:c};if(c++,a===!1||c>=p.nbPages)throw AIe();return f()});return f()},Fft=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/%s\",t.indexName,e)},r),Nft=()=>(t,e)=>{for(let[r,s]of Object.entries(t.hits))if(s.objectID===e)return parseInt(r,10);return-1},Oft=t=>(e,r)=>{let{attributesToRetrieve:s,...a}=r||{},n=e.map(c=>({indexName:t.indexName,objectID:c,...s?{attributesToRetrieve:s}:{}}));return t.transporter.read({method:Pr.MethodEnum.Post,path:\"1/indexes/*/objects\",data:{requests:n}},a)},Lft=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/rules/%s\",t.indexName,e)},r),mIe=t=>e=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/settings\",t.indexName),data:{getVersion:2}},e),Mft=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/synonyms/%s\",t.indexName,e)},r),yIe=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Get,path:Jt.encode(\"1/indexes/%s/task/%s\",t.indexName,e.toString())},r),Uft=t=>(e,r)=>Jt.createWaitablePromise(EIe(t)([e],r).then(s=>({objectID:s.objectIDs[0],taskID:s.taskIDs[0]})),(s,a)=>hs(t)(s.taskID,a)),EIe=t=>(e,r)=>{let{createIfNotExists:s,...a}=r||{},n=s?km.PartialUpdateObject:km.PartialUpdateObjectNoCreate;return pF(t)(e,n,a)},_ft=t=>(e,r)=>{let{safe:s,autoGenerateObjectIDIfNotExist:a,batchSize:n,...c}=r||{},f=(I,T,N,U)=>Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/operation\",I),data:{operation:N,destination:T}},U),(W,ee)=>hs(t)(W.taskID,ee)),p=Math.random().toString(36).substring(7),h=`${t.indexName}_tmp_${p}`,E=t9({appId:t.appId,transporter:t.transporter,indexName:h}),C=[],S=f(t.indexName,h,\"copy\",{...c,scope:[\"settings\",\"synonyms\",\"rules\"]});C.push(S);let b=(s?S.wait(c):S).then(()=>{let I=E(e,{...c,autoGenerateObjectIDIfNotExist:a,batchSize:n});return C.push(I),s?I.wait(c):I}).then(()=>{let I=f(h,t.indexName,\"move\",c);return C.push(I),s?I.wait(c):I}).then(()=>Promise.all(C)).then(([I,T,N])=>({objectIDs:T.objectIDs,taskIDs:[I.taskID,...T.taskIDs,N.taskID]}));return Jt.createWaitablePromise(b,(I,T)=>Promise.all(C.map(N=>N.wait(T))))},Hft=t=>(e,r)=>r9(t)(e,{...r,clearExistingRules:!0}),jft=t=>(e,r)=>n9(t)(e,{...r,clearExistingSynonyms:!0}),Gft=t=>(e,r)=>Jt.createWaitablePromise(t9(t)([e],r).then(s=>({objectID:s.objectIDs[0],taskID:s.taskIDs[0]})),(s,a)=>hs(t)(s.taskID,a)),t9=t=>(e,r)=>{let{autoGenerateObjectIDIfNotExist:s,...a}=r||{},n=s?km.AddObject:km.UpdateObject;if(n===km.UpdateObject){for(let c of e)if(c.objectID===void 0)return Jt.createWaitablePromise(Promise.reject(fIe()))}return pF(t)(e,n,a)},qft=t=>(e,r)=>r9(t)([e],r),r9=t=>(e,r)=>{let{forwardToReplicas:s,clearExistingRules:a,...n}=r||{},c=gl.createMappedRequestOptions(n);return s&&(c.queryParameters.forwardToReplicas=1),a&&(c.queryParameters.clearExistingRules=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/rules/batch\",t.indexName),data:e},c),(f,p)=>hs(t)(f.taskID,p))},Wft=t=>(e,r)=>n9(t)([e],r),n9=t=>(e,r)=>{let{forwardToReplicas:s,clearExistingSynonyms:a,replaceExistingSynonyms:n,...c}=r||{},f=gl.createMappedRequestOptions(c);return s&&(f.queryParameters.forwardToReplicas=1),(n||a)&&(f.queryParameters.replaceExistingSynonyms=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/synonyms/batch\",t.indexName),data:e},f),(p,h)=>hs(t)(p.taskID,h))},IIe=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/query\",t.indexName),data:{query:e},cacheable:!0},r),CIe=t=>(e,r,s)=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/facets/%s/query\",t.indexName,e),data:{facetQuery:r},cacheable:!0},s),wIe=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/rules/search\",t.indexName),data:{query:e}},r),BIe=t=>(e,r)=>t.transporter.read({method:Pr.MethodEnum.Post,path:Jt.encode(\"1/indexes/%s/synonyms/search\",t.indexName),data:{query:e}},r),Yft=t=>(e,r)=>{let{forwardToReplicas:s,...a}=r||{},n=gl.createMappedRequestOptions(a);return s&&(n.queryParameters.forwardToReplicas=1),Jt.createWaitablePromise(t.transporter.write({method:Pr.MethodEnum.Put,path:Jt.encode(\"1/indexes/%s/settings\",t.indexName),data:e},n),(c,f)=>hs(t)(c.taskID,f))},hs=t=>(e,r)=>Jt.createRetryablePromise(s=>yIe(t)(e,r).then(a=>a.status!==\"published\"?s():void 0)),Vft={AddObject:\"addObject\",Analytics:\"analytics\",Browser:\"browse\",DeleteIndex:\"deleteIndex\",DeleteObject:\"deleteObject\",EditSettings:\"editSettings\",Inference:\"inference\",ListIndexes:\"listIndexes\",Logs:\"logs\",Personalization:\"personalization\",Recommendation:\"recommendation\",Search:\"search\",SeeUnretrievableAttributes:\"seeUnretrievableAttributes\",Settings:\"settings\",Usage:\"usage\"},km={AddObject:\"addObject\",UpdateObject:\"updateObject\",PartialUpdateObject:\"partialUpdateObject\",PartialUpdateObjectNoCreate:\"partialUpdateObjectNoCreate\",DeleteObject:\"deleteObject\",DeleteIndex:\"delete\",ClearIndex:\"clear\"},hF={Settings:\"settings\",Synonyms:\"synonyms\",Rules:\"rules\"},Jft={None:\"none\",StopIfEnoughMatches:\"stopIfEnoughMatches\"},Kft={Synonym:\"synonym\",OneWaySynonym:\"oneWaySynonym\",AltCorrection1:\"altCorrection1\",AltCorrection2:\"altCorrection2\",Placeholder:\"placeholder\"};Ft.ApiKeyACLEnum=Vft;Ft.BatchActionEnum=km;Ft.ScopeEnum=hF;Ft.StrategyEnum=Jft;Ft.SynonymEnum=Kft;Ft.addApiKey=_ut;Ft.assignUserID=Hut;Ft.assignUserIDs=jut;Ft.batch=gIe;Ft.browseObjects=Ift;Ft.browseRules=Cft;Ft.browseSynonyms=wft;Ft.chunkedBatch=pF;Ft.clearDictionaryEntries=Gut;Ft.clearObjects=Bft;Ft.clearRules=vft;Ft.clearSynonyms=Sft;Ft.copyIndex=AF;Ft.copyRules=qut;Ft.copySettings=Wut;Ft.copySynonyms=Yut;Ft.createBrowsablePromise=fF;Ft.createMissingObjectIDError=fIe;Ft.createObjectNotFoundError=AIe;Ft.createSearchClient=Uut;Ft.createValidUntilNotFoundError=pIe;Ft.customRequest=Vut;Ft.deleteApiKey=Jut;Ft.deleteBy=Dft;Ft.deleteDictionaryEntries=Kut;Ft.deleteIndex=Pft;Ft.deleteObject=bft;Ft.deleteObjects=dIe;Ft.deleteRule=xft;Ft.deleteSynonym=kft;Ft.exists=Qft;Ft.findAnswers=Rft;Ft.findObject=Tft;Ft.generateSecuredApiKey=zut;Ft.getApiKey=kS;Ft.getAppTask=hIe;Ft.getDictionarySettings=Zut;Ft.getLogs=Xut;Ft.getObject=Fft;Ft.getObjectPosition=Nft;Ft.getObjects=Oft;Ft.getRule=Lft;Ft.getSecuredApiKeyRemainingValidity=$ut;Ft.getSettings=mIe;Ft.getSynonym=Mft;Ft.getTask=yIe;Ft.getTopUserIDs=eft;Ft.getUserID=tft;Ft.hasPendingMappings=rft;Ft.initIndex=QS;Ft.listApiKeys=nft;Ft.listClusters=ift;Ft.listIndices=sft;Ft.listUserIDs=oft;Ft.moveIndex=aft;Ft.multipleBatch=lft;Ft.multipleGetObjects=cft;Ft.multipleQueries=uft;Ft.multipleSearchForFacetValues=fft;Ft.partialUpdateObject=Uft;Ft.partialUpdateObjects=EIe;Ft.removeUserID=Aft;Ft.replaceAllObjects=_ft;Ft.replaceAllRules=Hft;Ft.replaceAllSynonyms=jft;Ft.replaceDictionaryEntries=pft;Ft.restoreApiKey=hft;Ft.saveDictionaryEntries=gft;Ft.saveObject=Gft;Ft.saveObjects=t9;Ft.saveRule=qft;Ft.saveRules=r9;Ft.saveSynonym=Wft;Ft.saveSynonyms=n9;Ft.search=IIe;Ft.searchDictionaryEntries=dft;Ft.searchForFacetValues=CIe;Ft.searchRules=wIe;Ft.searchSynonyms=BIe;Ft.searchUserIDs=mft;Ft.setDictionarySettings=yft;Ft.setSettings=Yft;Ft.updateApiKey=Eft;Ft.waitAppTask=aw;Ft.waitTask=hs});var DIe=_((yJt,SIe)=>{SIe.exports=vIe()});var PIe=_(gF=>{\"use strict\";Object.defineProperty(gF,\"__esModule\",{value:!0});function zft(){return{debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var Zft={Debug:1,Info:2,Error:3};gF.LogLevelEnum=Zft;gF.createNullLogger=zft});var xIe=_((IJt,bIe)=>{bIe.exports=PIe()});var TIe=_(i9=>{\"use strict\";Object.defineProperty(i9,\"__esModule\",{value:!0});var kIe=Ie(\"http\"),QIe=Ie(\"https\"),Xft=Ie(\"url\"),RIe={keepAlive:!0},$ft=new kIe.Agent(RIe),eAt=new QIe.Agent(RIe);function tAt({agent:t,httpAgent:e,httpsAgent:r,requesterOptions:s={}}={}){let a=e||t||$ft,n=r||t||eAt;return{send(c){return new Promise(f=>{let p=Xft.parse(c.url),h=p.query===null?p.pathname:`${p.pathname}?${p.query}`,E={...s,agent:p.protocol===\"https:\"?n:a,hostname:p.hostname,path:h,method:c.method,headers:{...s&&s.headers?s.headers:{},...c.headers},...p.port!==void 0?{port:p.port||\"\"}:{}},C=(p.protocol===\"https:\"?QIe:kIe).request(E,T=>{let N=[];T.on(\"data\",U=>{N=N.concat(U)}),T.on(\"end\",()=>{clearTimeout(b),clearTimeout(I),f({status:T.statusCode||0,content:Buffer.concat(N).toString(),isTimedOut:!1})})}),S=(T,N)=>setTimeout(()=>{C.abort(),f({status:0,content:N,isTimedOut:!0})},T*1e3),b=S(c.connectTimeout,\"Connection timeout\"),I;C.on(\"error\",T=>{clearTimeout(b),clearTimeout(I),f({status:0,content:T.message,isTimedOut:!1})}),C.once(\"response\",()=>{clearTimeout(b),I=S(c.responseTimeout,\"Socket timeout\")}),c.data!==void 0&&C.write(c.data),C.end()})},destroy(){return a.destroy(),n.destroy(),Promise.resolve()}}}i9.createNodeHttpRequester=tAt});var NIe=_((wJt,FIe)=>{FIe.exports=TIe()});var UIe=_((BJt,MIe)=>{\"use strict\";var OIe=TEe(),rAt=OEe(),lw=oIe(),o9=vS(),s9=uIe(),Gt=DIe(),nAt=xIe(),iAt=NIe(),sAt=PS();function LIe(t,e,r){let s={appId:t,apiKey:e,timeouts:{connect:2,read:5,write:30},requester:iAt.createNodeHttpRequester(),logger:nAt.createNullLogger(),responsesCache:OIe.createNullCache(),requestsCache:OIe.createNullCache(),hostsCache:rAt.createInMemoryCache(),userAgent:sAt.createUserAgent(o9.version).add({segment:\"Node.js\",version:process.versions.node})},a={...s,...r},n=()=>c=>s9.createPersonalizationClient({...s,...c,methods:{getPersonalizationStrategy:s9.getPersonalizationStrategy,setPersonalizationStrategy:s9.setPersonalizationStrategy}});return Gt.createSearchClient({...a,methods:{search:Gt.multipleQueries,searchForFacetValues:Gt.multipleSearchForFacetValues,multipleBatch:Gt.multipleBatch,multipleGetObjects:Gt.multipleGetObjects,multipleQueries:Gt.multipleQueries,copyIndex:Gt.copyIndex,copySettings:Gt.copySettings,copyRules:Gt.copyRules,copySynonyms:Gt.copySynonyms,moveIndex:Gt.moveIndex,listIndices:Gt.listIndices,getLogs:Gt.getLogs,listClusters:Gt.listClusters,multipleSearchForFacetValues:Gt.multipleSearchForFacetValues,getApiKey:Gt.getApiKey,addApiKey:Gt.addApiKey,listApiKeys:Gt.listApiKeys,updateApiKey:Gt.updateApiKey,deleteApiKey:Gt.deleteApiKey,restoreApiKey:Gt.restoreApiKey,assignUserID:Gt.assignUserID,assignUserIDs:Gt.assignUserIDs,getUserID:Gt.getUserID,searchUserIDs:Gt.searchUserIDs,listUserIDs:Gt.listUserIDs,getTopUserIDs:Gt.getTopUserIDs,removeUserID:Gt.removeUserID,hasPendingMappings:Gt.hasPendingMappings,generateSecuredApiKey:Gt.generateSecuredApiKey,getSecuredApiKeyRemainingValidity:Gt.getSecuredApiKeyRemainingValidity,destroy:o9.destroy,clearDictionaryEntries:Gt.clearDictionaryEntries,deleteDictionaryEntries:Gt.deleteDictionaryEntries,getDictionarySettings:Gt.getDictionarySettings,getAppTask:Gt.getAppTask,replaceDictionaryEntries:Gt.replaceDictionaryEntries,saveDictionaryEntries:Gt.saveDictionaryEntries,searchDictionaryEntries:Gt.searchDictionaryEntries,setDictionarySettings:Gt.setDictionarySettings,waitAppTask:Gt.waitAppTask,customRequest:Gt.customRequest,initIndex:c=>f=>Gt.initIndex(c)(f,{methods:{batch:Gt.batch,delete:Gt.deleteIndex,findAnswers:Gt.findAnswers,getObject:Gt.getObject,getObjects:Gt.getObjects,saveObject:Gt.saveObject,saveObjects:Gt.saveObjects,search:Gt.search,searchForFacetValues:Gt.searchForFacetValues,waitTask:Gt.waitTask,setSettings:Gt.setSettings,getSettings:Gt.getSettings,partialUpdateObject:Gt.partialUpdateObject,partialUpdateObjects:Gt.partialUpdateObjects,deleteObject:Gt.deleteObject,deleteObjects:Gt.deleteObjects,deleteBy:Gt.deleteBy,clearObjects:Gt.clearObjects,browseObjects:Gt.browseObjects,getObjectPosition:Gt.getObjectPosition,findObject:Gt.findObject,exists:Gt.exists,saveSynonym:Gt.saveSynonym,saveSynonyms:Gt.saveSynonyms,getSynonym:Gt.getSynonym,searchSynonyms:Gt.searchSynonyms,browseSynonyms:Gt.browseSynonyms,deleteSynonym:Gt.deleteSynonym,clearSynonyms:Gt.clearSynonyms,replaceAllObjects:Gt.replaceAllObjects,replaceAllSynonyms:Gt.replaceAllSynonyms,searchRules:Gt.searchRules,getRule:Gt.getRule,deleteRule:Gt.deleteRule,saveRule:Gt.saveRule,saveRules:Gt.saveRules,replaceAllRules:Gt.replaceAllRules,browseRules:Gt.browseRules,clearRules:Gt.clearRules}}),initAnalytics:()=>c=>lw.createAnalyticsClient({...s,...c,methods:{addABTest:lw.addABTest,getABTest:lw.getABTest,getABTests:lw.getABTests,stopABTest:lw.stopABTest,deleteABTest:lw.deleteABTest}}),initPersonalization:n,initRecommendation:()=>c=>(a.logger.info(\"The `initRecommendation` method is deprecated. Use `initPersonalization` instead.\"),n()(c))}})}LIe.version=o9.version;MIe.exports=LIe});var l9=_((vJt,a9)=>{var _Ie=UIe();a9.exports=_Ie;a9.exports.default=_Ie});var f9=_((DJt,GIe)=>{\"use strict\";var jIe=Object.getOwnPropertySymbols,aAt=Object.prototype.hasOwnProperty,lAt=Object.prototype.propertyIsEnumerable;function cAt(t){if(t==null)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}function uAt(){try{if(!Object.assign)return!1;var t=new String(\"abc\");if(t[5]=\"de\",Object.getOwnPropertyNames(t)[0]===\"5\")return!1;for(var e={},r=0;r<10;r++)e[\"_\"+String.fromCharCode(r)]=r;var s=Object.getOwnPropertyNames(e).map(function(n){return e[n]});if(s.join(\"\")!==\"0123456789\")return!1;var a={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(n){a[n]=n}),Object.keys(Object.assign({},a)).join(\"\")===\"abcdefghijklmnopqrst\"}catch{return!1}}GIe.exports=uAt()?Object.assign:function(t,e){for(var r,s=cAt(t),a,n=1;n<arguments.length;n++){r=Object(arguments[n]);for(var c in r)aAt.call(r,c)&&(s[c]=r[c]);if(jIe){a=jIe(r);for(var f=0;f<a.length;f++)lAt.call(r,a[f])&&(s[a[f]]=r[a[f]])}}return s}});var sCe=_(Dn=>{\"use strict\";var p9=f9(),cw=60103,YIe=60106;Dn.Fragment=60107;Dn.StrictMode=60108;Dn.Profiler=60114;var VIe=60109,JIe=60110,KIe=60112;Dn.Suspense=60113;var zIe=60115,ZIe=60116;typeof Symbol==\"function\"&&Symbol.for&&(Gc=Symbol.for,cw=Gc(\"react.element\"),YIe=Gc(\"react.portal\"),Dn.Fragment=Gc(\"react.fragment\"),Dn.StrictMode=Gc(\"react.strict_mode\"),Dn.Profiler=Gc(\"react.profiler\"),VIe=Gc(\"react.provider\"),JIe=Gc(\"react.context\"),KIe=Gc(\"react.forward_ref\"),Dn.Suspense=Gc(\"react.suspense\"),zIe=Gc(\"react.memo\"),ZIe=Gc(\"react.lazy\"));var Gc,qIe=typeof Symbol==\"function\"&&Symbol.iterator;function fAt(t){return t===null||typeof t!=\"object\"?null:(t=qIe&&t[qIe]||t[\"@@iterator\"],typeof t==\"function\"?t:null)}function RS(t){for(var e=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+t,r=1;r<arguments.length;r++)e+=\"&args[]=\"+encodeURIComponent(arguments[r]);return\"Minified React error #\"+t+\"; visit \"+e+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var XIe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$Ie={};function uw(t,e,r){this.props=t,this.context=e,this.refs=$Ie,this.updater=r||XIe}uw.prototype.isReactComponent={};uw.prototype.setState=function(t,e){if(typeof t!=\"object\"&&typeof t!=\"function\"&&t!=null)throw Error(RS(85));this.updater.enqueueSetState(this,t,e,\"setState\")};uw.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,\"forceUpdate\")};function eCe(){}eCe.prototype=uw.prototype;function h9(t,e,r){this.props=t,this.context=e,this.refs=$Ie,this.updater=r||XIe}var g9=h9.prototype=new eCe;g9.constructor=h9;p9(g9,uw.prototype);g9.isPureReactComponent=!0;var d9={current:null},tCe=Object.prototype.hasOwnProperty,rCe={key:!0,ref:!0,__self:!0,__source:!0};function nCe(t,e,r){var s,a={},n=null,c=null;if(e!=null)for(s in e.ref!==void 0&&(c=e.ref),e.key!==void 0&&(n=\"\"+e.key),e)tCe.call(e,s)&&!rCe.hasOwnProperty(s)&&(a[s]=e[s]);var f=arguments.length-2;if(f===1)a.children=r;else if(1<f){for(var p=Array(f),h=0;h<f;h++)p[h]=arguments[h+2];a.children=p}if(t&&t.defaultProps)for(s in f=t.defaultProps,f)a[s]===void 0&&(a[s]=f[s]);return{$$typeof:cw,type:t,key:n,ref:c,props:a,_owner:d9.current}}function AAt(t,e){return{$$typeof:cw,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function m9(t){return typeof t==\"object\"&&t!==null&&t.$$typeof===cw}function pAt(t){var e={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+t.replace(/[=:]/g,function(r){return e[r]})}var WIe=/\\/+/g;function A9(t,e){return typeof t==\"object\"&&t!==null&&t.key!=null?pAt(\"\"+t.key):e.toString(36)}function mF(t,e,r,s,a){var n=typeof t;(n===\"undefined\"||n===\"boolean\")&&(t=null);var c=!1;if(t===null)c=!0;else switch(n){case\"string\":case\"number\":c=!0;break;case\"object\":switch(t.$$typeof){case cw:case YIe:c=!0}}if(c)return c=t,a=a(c),t=s===\"\"?\".\"+A9(c,0):s,Array.isArray(a)?(r=\"\",t!=null&&(r=t.replace(WIe,\"$&/\")+\"/\"),mF(a,e,r,\"\",function(h){return h})):a!=null&&(m9(a)&&(a=AAt(a,r+(!a.key||c&&c.key===a.key?\"\":(\"\"+a.key).replace(WIe,\"$&/\")+\"/\")+t)),e.push(a)),1;if(c=0,s=s===\"\"?\".\":s+\":\",Array.isArray(t))for(var f=0;f<t.length;f++){n=t[f];var p=s+A9(n,f);c+=mF(n,e,r,p,a)}else if(p=fAt(t),typeof p==\"function\")for(t=p.call(t),f=0;!(n=t.next()).done;)n=n.value,p=s+A9(n,f++),c+=mF(n,e,r,p,a);else if(n===\"object\")throw e=\"\"+t,Error(RS(31,e===\"[object Object]\"?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":e));return c}function dF(t,e,r){if(t==null)return t;var s=[],a=0;return mF(t,s,\"\",\"\",function(n){return e.call(r,n,a++)}),s}function hAt(t){if(t._status===-1){var e=t._result;e=e(),t._status=0,t._result=e,e.then(function(r){t._status===0&&(r=r.default,t._status=1,t._result=r)},function(r){t._status===0&&(t._status=2,t._result=r)})}if(t._status===1)return t._result;throw t._result}var iCe={current:null};function Xp(){var t=iCe.current;if(t===null)throw Error(RS(321));return t}var gAt={ReactCurrentDispatcher:iCe,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:d9,IsSomeRendererActing:{current:!1},assign:p9};Dn.Children={map:dF,forEach:function(t,e,r){dF(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return dF(t,function(){e++}),e},toArray:function(t){return dF(t,function(e){return e})||[]},only:function(t){if(!m9(t))throw Error(RS(143));return t}};Dn.Component=uw;Dn.PureComponent=h9;Dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gAt;Dn.cloneElement=function(t,e,r){if(t==null)throw Error(RS(267,t));var s=p9({},t.props),a=t.key,n=t.ref,c=t._owner;if(e!=null){if(e.ref!==void 0&&(n=e.ref,c=d9.current),e.key!==void 0&&(a=\"\"+e.key),t.type&&t.type.defaultProps)var f=t.type.defaultProps;for(p in e)tCe.call(e,p)&&!rCe.hasOwnProperty(p)&&(s[p]=e[p]===void 0&&f!==void 0?f[p]:e[p])}var p=arguments.length-2;if(p===1)s.children=r;else if(1<p){f=Array(p);for(var h=0;h<p;h++)f[h]=arguments[h+2];s.children=f}return{$$typeof:cw,type:t.type,key:a,ref:n,props:s,_owner:c}};Dn.createContext=function(t,e){return e===void 0&&(e=null),t={$$typeof:JIe,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider={$$typeof:VIe,_context:t},t.Consumer=t};Dn.createElement=nCe;Dn.createFactory=function(t){var e=nCe.bind(null,t);return e.type=t,e};Dn.createRef=function(){return{current:null}};Dn.forwardRef=function(t){return{$$typeof:KIe,render:t}};Dn.isValidElement=m9;Dn.lazy=function(t){return{$$typeof:ZIe,_payload:{_status:-1,_result:t},_init:hAt}};Dn.memo=function(t,e){return{$$typeof:zIe,type:t,compare:e===void 0?null:e}};Dn.useCallback=function(t,e){return Xp().useCallback(t,e)};Dn.useContext=function(t,e){return Xp().useContext(t,e)};Dn.useDebugValue=function(){};Dn.useEffect=function(t,e){return Xp().useEffect(t,e)};Dn.useImperativeHandle=function(t,e,r){return Xp().useImperativeHandle(t,e,r)};Dn.useLayoutEffect=function(t,e){return Xp().useLayoutEffect(t,e)};Dn.useMemo=function(t,e){return Xp().useMemo(t,e)};Dn.useReducer=function(t,e,r){return Xp().useReducer(t,e,r)};Dn.useRef=function(t){return Xp().useRef(t)};Dn.useState=function(t){return Xp().useState(t)};Dn.version=\"17.0.2\"});var hn=_((bJt,oCe)=>{\"use strict\";oCe.exports=sCe()});var yF=_((xJt,aCe)=>{function dAt(t){var e=typeof t;return t!=null&&(e==\"object\"||e==\"function\")}aCe.exports=dAt});var cCe=_((kJt,lCe)=>{var mAt=typeof global==\"object\"&&global&&global.Object===Object&&global;lCe.exports=mAt});var y9=_((QJt,uCe)=>{var yAt=cCe(),EAt=typeof self==\"object\"&&self&&self.Object===Object&&self,IAt=yAt||EAt||Function(\"return this\")();uCe.exports=IAt});var ACe=_((RJt,fCe)=>{var CAt=y9(),wAt=function(){return CAt.Date.now()};fCe.exports=wAt});var hCe=_((TJt,pCe)=>{var BAt=/\\s/;function vAt(t){for(var e=t.length;e--&&BAt.test(t.charAt(e)););return e}pCe.exports=vAt});var dCe=_((FJt,gCe)=>{var SAt=hCe(),DAt=/^\\s+/;function PAt(t){return t&&t.slice(0,SAt(t)+1).replace(DAt,\"\")}gCe.exports=PAt});var E9=_((NJt,mCe)=>{var bAt=y9(),xAt=bAt.Symbol;mCe.exports=xAt});var CCe=_((OJt,ICe)=>{var yCe=E9(),ECe=Object.prototype,kAt=ECe.hasOwnProperty,QAt=ECe.toString,TS=yCe?yCe.toStringTag:void 0;function RAt(t){var e=kAt.call(t,TS),r=t[TS];try{t[TS]=void 0;var s=!0}catch{}var a=QAt.call(t);return s&&(e?t[TS]=r:delete t[TS]),a}ICe.exports=RAt});var BCe=_((LJt,wCe)=>{var TAt=Object.prototype,FAt=TAt.toString;function NAt(t){return FAt.call(t)}wCe.exports=NAt});var PCe=_((MJt,DCe)=>{var vCe=E9(),OAt=CCe(),LAt=BCe(),MAt=\"[object Null]\",UAt=\"[object Undefined]\",SCe=vCe?vCe.toStringTag:void 0;function _At(t){return t==null?t===void 0?UAt:MAt:SCe&&SCe in Object(t)?OAt(t):LAt(t)}DCe.exports=_At});var xCe=_((UJt,bCe)=>{function HAt(t){return t!=null&&typeof t==\"object\"}bCe.exports=HAt});var QCe=_((_Jt,kCe)=>{var jAt=PCe(),GAt=xCe(),qAt=\"[object Symbol]\";function WAt(t){return typeof t==\"symbol\"||GAt(t)&&jAt(t)==qAt}kCe.exports=WAt});var NCe=_((HJt,FCe)=>{var YAt=dCe(),RCe=yF(),VAt=QCe(),TCe=NaN,JAt=/^[-+]0x[0-9a-f]+$/i,KAt=/^0b[01]+$/i,zAt=/^0o[0-7]+$/i,ZAt=parseInt;function XAt(t){if(typeof t==\"number\")return t;if(VAt(t))return TCe;if(RCe(t)){var e=typeof t.valueOf==\"function\"?t.valueOf():t;t=RCe(e)?e+\"\":e}if(typeof t!=\"string\")return t===0?t:+t;t=YAt(t);var r=KAt.test(t);return r||zAt.test(t)?ZAt(t.slice(2),r?2:8):JAt.test(t)?TCe:+t}FCe.exports=XAt});var MCe=_((jJt,LCe)=>{var $At=yF(),I9=ACe(),OCe=NCe(),ept=\"Expected a function\",tpt=Math.max,rpt=Math.min;function npt(t,e,r){var s,a,n,c,f,p,h=0,E=!1,C=!1,S=!0;if(typeof t!=\"function\")throw new TypeError(ept);e=OCe(e)||0,$At(r)&&(E=!!r.leading,C=\"maxWait\"in r,n=C?tpt(OCe(r.maxWait)||0,e):n,S=\"trailing\"in r?!!r.trailing:S);function b(le){var me=s,pe=a;return s=a=void 0,h=le,c=t.apply(pe,me),c}function I(le){return h=le,f=setTimeout(U,e),E?b(le):c}function T(le){var me=le-p,pe=le-h,Be=e-me;return C?rpt(Be,n-pe):Be}function N(le){var me=le-p,pe=le-h;return p===void 0||me>=e||me<0||C&&pe>=n}function U(){var le=I9();if(N(le))return W(le);f=setTimeout(U,T(le))}function W(le){return f=void 0,S&&s?b(le):(s=a=void 0,c)}function ee(){f!==void 0&&clearTimeout(f),h=0,s=p=a=f=void 0}function ie(){return f===void 0?c:W(I9())}function ue(){var le=I9(),me=N(le);if(s=arguments,a=this,p=le,me){if(f===void 0)return I(p);if(C)return clearTimeout(f),f=setTimeout(U,e),b(p)}return f===void 0&&(f=setTimeout(U,e)),c}return ue.cancel=ee,ue.flush=ie,ue}LCe.exports=npt});var _Ce=_((GJt,UCe)=>{var ipt=MCe(),spt=yF(),opt=\"Expected a function\";function apt(t,e,r){var s=!0,a=!0;if(typeof t!=\"function\")throw new TypeError(opt);return spt(r)&&(s=\"leading\"in r?!!r.leading:s,a=\"trailing\"in r?!!r.trailing:a),ipt(t,e,{leading:s,maxWait:e,trailing:a})}UCe.exports=apt});var w9=_((qJt,C9)=>{\"use strict\";var Cn=C9.exports;C9.exports.default=Cn;var Zn=\"\\x1B[\",NS=\"\\x1B]\",fw=\"\\x07\",EF=\";\",HCe=process.env.TERM_PROGRAM===\"Apple_Terminal\";Cn.cursorTo=(t,e)=>{if(typeof t!=\"number\")throw new TypeError(\"The `x` argument is required\");return typeof e!=\"number\"?Zn+(t+1)+\"G\":Zn+(e+1)+\";\"+(t+1)+\"H\"};Cn.cursorMove=(t,e)=>{if(typeof t!=\"number\")throw new TypeError(\"The `x` argument is required\");let r=\"\";return t<0?r+=Zn+-t+\"D\":t>0&&(r+=Zn+t+\"C\"),e<0?r+=Zn+-e+\"A\":e>0&&(r+=Zn+e+\"B\"),r};Cn.cursorUp=(t=1)=>Zn+t+\"A\";Cn.cursorDown=(t=1)=>Zn+t+\"B\";Cn.cursorForward=(t=1)=>Zn+t+\"C\";Cn.cursorBackward=(t=1)=>Zn+t+\"D\";Cn.cursorLeft=Zn+\"G\";Cn.cursorSavePosition=HCe?\"\\x1B7\":Zn+\"s\";Cn.cursorRestorePosition=HCe?\"\\x1B8\":Zn+\"u\";Cn.cursorGetPosition=Zn+\"6n\";Cn.cursorNextLine=Zn+\"E\";Cn.cursorPrevLine=Zn+\"F\";Cn.cursorHide=Zn+\"?25l\";Cn.cursorShow=Zn+\"?25h\";Cn.eraseLines=t=>{let e=\"\";for(let r=0;r<t;r++)e+=Cn.eraseLine+(r<t-1?Cn.cursorUp():\"\");return t&&(e+=Cn.cursorLeft),e};Cn.eraseEndLine=Zn+\"K\";Cn.eraseStartLine=Zn+\"1K\";Cn.eraseLine=Zn+\"2K\";Cn.eraseDown=Zn+\"J\";Cn.eraseUp=Zn+\"1J\";Cn.eraseScreen=Zn+\"2J\";Cn.scrollUp=Zn+\"S\";Cn.scrollDown=Zn+\"T\";Cn.clearScreen=\"\\x1Bc\";Cn.clearTerminal=process.platform===\"win32\"?`${Cn.eraseScreen}${Zn}0f`:`${Cn.eraseScreen}${Zn}3J${Zn}H`;Cn.beep=fw;Cn.link=(t,e)=>[NS,\"8\",EF,EF,e,fw,t,NS,\"8\",EF,EF,fw].join(\"\");Cn.image=(t,e={})=>{let r=`${NS}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=\";preserveAspectRatio=0\"),r+\":\"+t.toString(\"base64\")+fw};Cn.iTerm={setCwd:(t=process.cwd())=>`${NS}50;CurrentDir=${t}${fw}`,annotation:(t,e={})=>{let r=`${NS}1337;`,s=typeof e.x<\"u\",a=typeof e.y<\"u\";if((s||a)&&!(s&&a&&typeof e.length<\"u\"))throw new Error(\"`x`, `y` and `length` must be defined when `x` or `y` is defined\");return t=t.replace(/\\|/g,\"\"),r+=e.isHidden?\"AddHiddenAnnotation=\":\"AddAnnotation=\",e.length>0?r+=(s?[t,e.length,e.x,e.y]:[e.length,t]).join(\"|\"):r+=t,r+fw}}});var GCe=_((WJt,B9)=>{\"use strict\";var jCe=(t,e)=>{for(let r of Reflect.ownKeys(e))Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t};B9.exports=jCe;B9.exports.default=jCe});var WCe=_((YJt,CF)=>{\"use strict\";var lpt=GCe(),IF=new WeakMap,qCe=(t,e={})=>{if(typeof t!=\"function\")throw new TypeError(\"Expected a function\");let r,s=0,a=t.displayName||t.name||\"<anonymous>\",n=function(...c){if(IF.set(n,++s),s===1)r=t.apply(this,c),t=null;else if(e.throw===!0)throw new Error(`Function \\`${a}\\` can only be called once`);return r};return lpt(n,t),IF.set(n,s),n};CF.exports=qCe;CF.exports.default=qCe;CF.exports.callCount=t=>{if(!IF.has(t))throw new Error(`The given function \\`${t.name}\\` is not wrapped by the \\`onetime\\` package`);return IF.get(t)}});var YCe=_((VJt,wF)=>{wF.exports=[\"SIGABRT\",\"SIGALRM\",\"SIGHUP\",\"SIGINT\",\"SIGTERM\"];process.platform!==\"win32\"&&wF.exports.push(\"SIGVTALRM\",\"SIGXCPU\",\"SIGXFSZ\",\"SIGUSR2\",\"SIGTRAP\",\"SIGSYS\",\"SIGQUIT\",\"SIGIOT\");process.platform===\"linux\"&&wF.exports.push(\"SIGIO\",\"SIGPOLL\",\"SIGPWR\",\"SIGSTKFLT\",\"SIGUNUSED\")});var D9=_((JJt,hw)=>{var Qi=global.process,Qm=function(t){return t&&typeof t==\"object\"&&typeof t.removeListener==\"function\"&&typeof t.emit==\"function\"&&typeof t.reallyExit==\"function\"&&typeof t.listeners==\"function\"&&typeof t.kill==\"function\"&&typeof t.pid==\"number\"&&typeof t.on==\"function\"};Qm(Qi)?(VCe=Ie(\"assert\"),Aw=YCe(),JCe=/^win/i.test(Qi.platform),OS=Ie(\"events\"),typeof OS!=\"function\"&&(OS=OS.EventEmitter),Qi.__signal_exit_emitter__?Js=Qi.__signal_exit_emitter__:(Js=Qi.__signal_exit_emitter__=new OS,Js.count=0,Js.emitted={}),Js.infinite||(Js.setMaxListeners(1/0),Js.infinite=!0),hw.exports=function(t,e){if(!Qm(global.process))return function(){};VCe.equal(typeof t,\"function\",\"a callback must be provided for exit handler\"),pw===!1&&v9();var r=\"exit\";e&&e.alwaysLast&&(r=\"afterexit\");var s=function(){Js.removeListener(r,t),Js.listeners(\"exit\").length===0&&Js.listeners(\"afterexit\").length===0&&BF()};return Js.on(r,t),s},BF=function(){!pw||!Qm(global.process)||(pw=!1,Aw.forEach(function(e){try{Qi.removeListener(e,vF[e])}catch{}}),Qi.emit=SF,Qi.reallyExit=S9,Js.count-=1)},hw.exports.unload=BF,Rm=function(e,r,s){Js.emitted[e]||(Js.emitted[e]=!0,Js.emit(e,r,s))},vF={},Aw.forEach(function(t){vF[t]=function(){if(Qm(global.process)){var r=Qi.listeners(t);r.length===Js.count&&(BF(),Rm(\"exit\",null,t),Rm(\"afterexit\",null,t),JCe&&t===\"SIGHUP\"&&(t=\"SIGINT\"),Qi.kill(Qi.pid,t))}}}),hw.exports.signals=function(){return Aw},pw=!1,v9=function(){pw||!Qm(global.process)||(pw=!0,Js.count+=1,Aw=Aw.filter(function(e){try{return Qi.on(e,vF[e]),!0}catch{return!1}}),Qi.emit=zCe,Qi.reallyExit=KCe)},hw.exports.load=v9,S9=Qi.reallyExit,KCe=function(e){Qm(global.process)&&(Qi.exitCode=e||0,Rm(\"exit\",Qi.exitCode,null),Rm(\"afterexit\",Qi.exitCode,null),S9.call(Qi,Qi.exitCode))},SF=Qi.emit,zCe=function(e,r){if(e===\"exit\"&&Qm(global.process)){r!==void 0&&(Qi.exitCode=r);var s=SF.apply(this,arguments);return Rm(\"exit\",Qi.exitCode,null),Rm(\"afterexit\",Qi.exitCode,null),s}else return SF.apply(this,arguments)}):hw.exports=function(){return function(){}};var VCe,Aw,JCe,OS,Js,BF,Rm,vF,pw,v9,S9,KCe,SF,zCe});var XCe=_((KJt,ZCe)=>{\"use strict\";var cpt=WCe(),upt=D9();ZCe.exports=cpt(()=>{upt(()=>{process.stderr.write(\"\\x1B[?25h\")},{alwaysLast:!0})})});var P9=_(gw=>{\"use strict\";var fpt=XCe(),DF=!1;gw.show=(t=process.stderr)=>{t.isTTY&&(DF=!1,t.write(\"\\x1B[?25h\"))};gw.hide=(t=process.stderr)=>{t.isTTY&&(fpt(),DF=!0,t.write(\"\\x1B[?25l\"))};gw.toggle=(t,e)=>{t!==void 0&&(DF=t),DF?gw.show(e):gw.hide(e)}});var rwe=_(LS=>{\"use strict\";var twe=LS&&LS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(LS,\"__esModule\",{value:!0});var $Ce=twe(w9()),ewe=twe(P9()),Apt=(t,{showCursor:e=!1}={})=>{let r=0,s=\"\",a=!1,n=c=>{!e&&!a&&(ewe.default.hide(),a=!0);let f=c+`\n`;f!==s&&(s=f,t.write($Ce.default.eraseLines(r)+f),r=f.split(`\n`).length)};return n.clear=()=>{t.write($Ce.default.eraseLines(r)),s=\"\",r=0},n.done=()=>{s=\"\",r=0,e||(ewe.default.show(),a=!1)},n};LS.default={create:Apt}});var nwe=_((XJt,ppt)=>{ppt.exports=[{name:\"AppVeyor\",constant:\"APPVEYOR\",env:\"APPVEYOR\",pr:\"APPVEYOR_PULL_REQUEST_NUMBER\"},{name:\"Azure Pipelines\",constant:\"AZURE_PIPELINES\",env:\"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\",pr:\"SYSTEM_PULLREQUEST_PULLREQUESTID\"},{name:\"Bamboo\",constant:\"BAMBOO\",env:\"bamboo_planKey\"},{name:\"Bitbucket Pipelines\",constant:\"BITBUCKET\",env:\"BITBUCKET_COMMIT\",pr:\"BITBUCKET_PR_ID\"},{name:\"Bitrise\",constant:\"BITRISE\",env:\"BITRISE_IO\",pr:\"BITRISE_PULL_REQUEST\"},{name:\"Buddy\",constant:\"BUDDY\",env:\"BUDDY_WORKSPACE_ID\",pr:\"BUDDY_EXECUTION_PULL_REQUEST_ID\"},{name:\"Buildkite\",constant:\"BUILDKITE\",env:\"BUILDKITE\",pr:{env:\"BUILDKITE_PULL_REQUEST\",ne:\"false\"}},{name:\"CircleCI\",constant:\"CIRCLE\",env:\"CIRCLECI\",pr:\"CIRCLE_PULL_REQUEST\"},{name:\"Cirrus CI\",constant:\"CIRRUS\",env:\"CIRRUS_CI\",pr:\"CIRRUS_PR\"},{name:\"AWS CodeBuild\",constant:\"CODEBUILD\",env:\"CODEBUILD_BUILD_ARN\"},{name:\"Codeship\",constant:\"CODESHIP\",env:{CI_NAME:\"codeship\"}},{name:\"Drone\",constant:\"DRONE\",env:\"DRONE\",pr:{DRONE_BUILD_EVENT:\"pull_request\"}},{name:\"dsari\",constant:\"DSARI\",env:\"DSARI\"},{name:\"GitLab CI\",constant:\"GITLAB\",env:\"GITLAB_CI\"},{name:\"GoCD\",constant:\"GOCD\",env:\"GO_PIPELINE_LABEL\"},{name:\"Hudson\",constant:\"HUDSON\",env:\"HUDSON_URL\"},{name:\"Jenkins\",constant:\"JENKINS\",env:[\"JENKINS_URL\",\"BUILD_ID\"],pr:{any:[\"ghprbPullId\",\"CHANGE_ID\"]}},{name:\"Magnum CI\",constant:\"MAGNUM\",env:\"MAGNUM\"},{name:\"Netlify CI\",constant:\"NETLIFY\",env:\"NETLIFY_BUILD_BASE\",pr:{env:\"PULL_REQUEST\",ne:\"false\"}},{name:\"Sail CI\",constant:\"SAIL\",env:\"SAILCI\",pr:\"SAIL_PULL_REQUEST_NUMBER\"},{name:\"Semaphore\",constant:\"SEMAPHORE\",env:\"SEMAPHORE\",pr:\"PULL_REQUEST_NUMBER\"},{name:\"Shippable\",constant:\"SHIPPABLE\",env:\"SHIPPABLE\",pr:{IS_PULL_REQUEST:\"true\"}},{name:\"Solano CI\",constant:\"SOLANO\",env:\"TDDIUM\",pr:\"TDDIUM_PR_ID\"},{name:\"Strider CD\",constant:\"STRIDER\",env:\"STRIDER\"},{name:\"TaskCluster\",constant:\"TASKCLUSTER\",env:[\"TASK_ID\",\"RUN_ID\"]},{name:\"TeamCity\",constant:\"TEAMCITY\",env:\"TEAMCITY_VERSION\"},{name:\"Travis CI\",constant:\"TRAVIS\",env:\"TRAVIS\",pr:{env:\"TRAVIS_PULL_REQUEST\",ne:\"false\"}}]});var owe=_(tc=>{\"use strict\";var swe=nwe(),uA=process.env;Object.defineProperty(tc,\"_vendors\",{value:swe.map(function(t){return t.constant})});tc.name=null;tc.isPR=null;swe.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(s){return iwe(s)});if(tc[t.constant]=r,r)switch(tc.name=t.name,typeof t.pr){case\"string\":tc.isPR=!!uA[t.pr];break;case\"object\":\"env\"in t.pr?tc.isPR=t.pr.env in uA&&uA[t.pr.env]!==t.pr.ne:\"any\"in t.pr?tc.isPR=t.pr.any.some(function(s){return!!uA[s]}):tc.isPR=iwe(t.pr);break;default:tc.isPR=null}});tc.isCI=!!(uA.CI||uA.CONTINUOUS_INTEGRATION||uA.BUILD_NUMBER||uA.RUN_ID||tc.name);function iwe(t){return typeof t==\"string\"?!!uA[t]:Object.keys(t).every(function(e){return uA[e]===t[e]})}});var lwe=_((eKt,awe)=>{\"use strict\";awe.exports=owe().isCI});var uwe=_((tKt,cwe)=>{\"use strict\";var hpt=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};cwe.exports=(t,{include:e,exclude:r}={})=>{let s=a=>{let n=c=>typeof c==\"string\"?a===c:c.test(a);return e?e.some(n):r?!r.some(n):!0};for(let[a,n]of hpt(t.constructor.prototype)){if(n===\"constructor\"||!s(n))continue;let c=Reflect.getOwnPropertyDescriptor(a,n);c&&typeof c.value==\"function\"&&(t[n]=t[n].bind(t))}return t}});var dwe=_(Vn=>{\"use strict\";var mw,_S,kF,F9;typeof performance==\"object\"&&typeof performance.now==\"function\"?(fwe=performance,Vn.unstable_now=function(){return fwe.now()}):(b9=Date,Awe=b9.now(),Vn.unstable_now=function(){return b9.now()-Awe});var fwe,b9,Awe;typeof window>\"u\"||typeof MessageChannel!=\"function\"?(dw=null,x9=null,k9=function(){if(dw!==null)try{var t=Vn.unstable_now();dw(!0,t),dw=null}catch(e){throw setTimeout(k9,0),e}},mw=function(t){dw!==null?setTimeout(mw,0,t):(dw=t,setTimeout(k9,0))},_S=function(t,e){x9=setTimeout(t,e)},kF=function(){clearTimeout(x9)},Vn.unstable_shouldYield=function(){return!1},F9=Vn.unstable_forceFrameRate=function(){}):(pwe=window.setTimeout,hwe=window.clearTimeout,typeof console<\"u\"&&(gwe=window.cancelAnimationFrame,typeof window.requestAnimationFrame!=\"function\"&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"),typeof gwe!=\"function\"&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\")),MS=!1,US=null,PF=-1,Q9=5,R9=0,Vn.unstable_shouldYield=function(){return Vn.unstable_now()>=R9},F9=function(){},Vn.unstable_forceFrameRate=function(t){0>t||125<t?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):Q9=0<t?Math.floor(1e3/t):5},T9=new MessageChannel,bF=T9.port2,T9.port1.onmessage=function(){if(US!==null){var t=Vn.unstable_now();R9=t+Q9;try{US(!0,t)?bF.postMessage(null):(MS=!1,US=null)}catch(e){throw bF.postMessage(null),e}}else MS=!1},mw=function(t){US=t,MS||(MS=!0,bF.postMessage(null))},_S=function(t,e){PF=pwe(function(){t(Vn.unstable_now())},e)},kF=function(){hwe(PF),PF=-1});var dw,x9,k9,pwe,hwe,gwe,MS,US,PF,Q9,R9,T9,bF;function N9(t,e){var r=t.length;t.push(e);e:for(;;){var s=r-1>>>1,a=t[s];if(a!==void 0&&0<xF(a,e))t[s]=e,t[r]=a,r=s;else break e}}function ef(t){return t=t[0],t===void 0?null:t}function QF(t){var e=t[0];if(e!==void 0){var r=t.pop();if(r!==e){t[0]=r;e:for(var s=0,a=t.length;s<a;){var n=2*(s+1)-1,c=t[n],f=n+1,p=t[f];if(c!==void 0&&0>xF(c,r))p!==void 0&&0>xF(p,c)?(t[s]=p,t[f]=r,s=f):(t[s]=c,t[n]=r,s=n);else if(p!==void 0&&0>xF(p,r))t[s]=p,t[f]=r,s=f;else break e}}return e}return null}function xF(t,e){var r=t.sortIndex-e.sortIndex;return r!==0?r:t.id-e.id}var fA=[],X0=[],gpt=1,qc=null,$o=3,RF=!1,Tm=!1,HS=!1;function O9(t){for(var e=ef(X0);e!==null;){if(e.callback===null)QF(X0);else if(e.startTime<=t)QF(X0),e.sortIndex=e.expirationTime,N9(fA,e);else break;e=ef(X0)}}function L9(t){if(HS=!1,O9(t),!Tm)if(ef(fA)!==null)Tm=!0,mw(M9);else{var e=ef(X0);e!==null&&_S(L9,e.startTime-t)}}function M9(t,e){Tm=!1,HS&&(HS=!1,kF()),RF=!0;var r=$o;try{for(O9(e),qc=ef(fA);qc!==null&&(!(qc.expirationTime>e)||t&&!Vn.unstable_shouldYield());){var s=qc.callback;if(typeof s==\"function\"){qc.callback=null,$o=qc.priorityLevel;var a=s(qc.expirationTime<=e);e=Vn.unstable_now(),typeof a==\"function\"?qc.callback=a:qc===ef(fA)&&QF(fA),O9(e)}else QF(fA);qc=ef(fA)}if(qc!==null)var n=!0;else{var c=ef(X0);c!==null&&_S(L9,c.startTime-e),n=!1}return n}finally{qc=null,$o=r,RF=!1}}var dpt=F9;Vn.unstable_IdlePriority=5;Vn.unstable_ImmediatePriority=1;Vn.unstable_LowPriority=4;Vn.unstable_NormalPriority=3;Vn.unstable_Profiling=null;Vn.unstable_UserBlockingPriority=2;Vn.unstable_cancelCallback=function(t){t.callback=null};Vn.unstable_continueExecution=function(){Tm||RF||(Tm=!0,mw(M9))};Vn.unstable_getCurrentPriorityLevel=function(){return $o};Vn.unstable_getFirstCallbackNode=function(){return ef(fA)};Vn.unstable_next=function(t){switch($o){case 1:case 2:case 3:var e=3;break;default:e=$o}var r=$o;$o=e;try{return t()}finally{$o=r}};Vn.unstable_pauseExecution=function(){};Vn.unstable_requestPaint=dpt;Vn.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=$o;$o=t;try{return e()}finally{$o=r}};Vn.unstable_scheduleCallback=function(t,e,r){var s=Vn.unstable_now();switch(typeof r==\"object\"&&r!==null?(r=r.delay,r=typeof r==\"number\"&&0<r?s+r:s):r=s,t){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return a=r+a,t={id:gpt++,callback:e,priorityLevel:t,startTime:r,expirationTime:a,sortIndex:-1},r>s?(t.sortIndex=r,N9(X0,t),ef(fA)===null&&t===ef(X0)&&(HS?kF():HS=!0,_S(L9,r-s))):(t.sortIndex=a,N9(fA,t),Tm||RF||(Tm=!0,mw(M9))),t};Vn.unstable_wrapCallback=function(t){var e=$o;return function(){var r=$o;$o=e;try{return t.apply(this,arguments)}finally{$o=r}}}});var U9=_((nKt,mwe)=>{\"use strict\";mwe.exports=dwe()});var ywe=_((iKt,jS)=>{jS.exports=function(e){var r={},s=f9(),a=hn(),n=U9();function c(v){for(var D=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+v,Q=1;Q<arguments.length;Q++)D+=\"&args[]=\"+encodeURIComponent(arguments[Q]);return\"Minified React error #\"+v+\"; visit \"+D+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var f=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,p=60103,h=60106,E=60107,C=60108,S=60114,b=60109,I=60110,T=60112,N=60113,U=60120,W=60115,ee=60116,ie=60121,ue=60129,le=60130,me=60131;if(typeof Symbol==\"function\"&&Symbol.for){var pe=Symbol.for;p=pe(\"react.element\"),h=pe(\"react.portal\"),E=pe(\"react.fragment\"),C=pe(\"react.strict_mode\"),S=pe(\"react.profiler\"),b=pe(\"react.provider\"),I=pe(\"react.context\"),T=pe(\"react.forward_ref\"),N=pe(\"react.suspense\"),U=pe(\"react.suspense_list\"),W=pe(\"react.memo\"),ee=pe(\"react.lazy\"),ie=pe(\"react.block\"),pe(\"react.scope\"),ue=pe(\"react.debug_trace_mode\"),le=pe(\"react.offscreen\"),me=pe(\"react.legacy_hidden\")}var Be=typeof Symbol==\"function\"&&Symbol.iterator;function Ce(v){return v===null||typeof v!=\"object\"?null:(v=Be&&v[Be]||v[\"@@iterator\"],typeof v==\"function\"?v:null)}function g(v){if(v==null)return null;if(typeof v==\"function\")return v.displayName||v.name||null;if(typeof v==\"string\")return v;switch(v){case E:return\"Fragment\";case h:return\"Portal\";case S:return\"Profiler\";case C:return\"StrictMode\";case N:return\"Suspense\";case U:return\"SuspenseList\"}if(typeof v==\"object\")switch(v.$$typeof){case I:return(v.displayName||\"Context\")+\".Consumer\";case b:return(v._context.displayName||\"Context\")+\".Provider\";case T:var D=v.render;return D=D.displayName||D.name||\"\",v.displayName||(D!==\"\"?\"ForwardRef(\"+D+\")\":\"ForwardRef\");case W:return g(v.type);case ie:return g(v._render);case ee:D=v._payload,v=v._init;try{return g(v(D))}catch{}}return null}function we(v){var D=v,Q=v;if(v.alternate)for(;D.return;)D=D.return;else{v=D;do D=v,D.flags&1026&&(Q=D.return),v=D.return;while(v)}return D.tag===3?Q:null}function ye(v){if(we(v)!==v)throw Error(c(188))}function Ae(v){var D=v.alternate;if(!D){if(D=we(v),D===null)throw Error(c(188));return D!==v?null:v}for(var Q=v,H=D;;){var V=Q.return;if(V===null)break;var ne=V.alternate;if(ne===null){if(H=V.return,H!==null){Q=H;continue}break}if(V.child===ne.child){for(ne=V.child;ne;){if(ne===Q)return ye(V),v;if(ne===H)return ye(V),D;ne=ne.sibling}throw Error(c(188))}if(Q.return!==H.return)Q=V,H=ne;else{for(var Se=!1,_e=V.child;_e;){if(_e===Q){Se=!0,Q=V,H=ne;break}if(_e===H){Se=!0,H=V,Q=ne;break}_e=_e.sibling}if(!Se){for(_e=ne.child;_e;){if(_e===Q){Se=!0,Q=ne,H=V;break}if(_e===H){Se=!0,H=ne,Q=V;break}_e=_e.sibling}if(!Se)throw Error(c(189))}}if(Q.alternate!==H)throw Error(c(190))}if(Q.tag!==3)throw Error(c(188));return Q.stateNode.current===Q?v:D}function se(v){if(v=Ae(v),!v)return null;for(var D=v;;){if(D.tag===5||D.tag===6)return D;if(D.child)D.child.return=D,D=D.child;else{if(D===v)break;for(;!D.sibling;){if(!D.return||D.return===v)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}}return null}function X(v){if(v=Ae(v),!v)return null;for(var D=v;;){if(D.tag===5||D.tag===6)return D;if(D.child&&D.tag!==4)D.child.return=D,D=D.child;else{if(D===v)break;for(;!D.sibling;){if(!D.return||D.return===v)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}}return null}function De(v,D){for(var Q=v.alternate;D!==null;){if(D===v||D===Q)return!0;D=D.return}return!1}var Te=e.getPublicInstance,mt=e.getRootHostContext,j=e.getChildHostContext,rt=e.prepareForCommit,Fe=e.resetAfterCommit,Ne=e.createInstance,be=e.appendInitialChild,Ve=e.finalizeInitialChildren,ke=e.prepareUpdate,it=e.shouldSetTextContent,Ue=e.createTextInstance,x=e.scheduleTimeout,w=e.cancelTimeout,P=e.noTimeout,y=e.isPrimaryRenderer,F=e.supportsMutation,z=e.supportsPersistence,Z=e.supportsHydration,$=e.getInstanceFromNode,oe=e.makeOpaqueHydratingObject,xe=e.makeClientId,Re=e.beforeActiveInstanceBlur,lt=e.afterActiveInstanceBlur,Ct=e.preparePortalMount,qt=e.supportsTestSelectors,ir=e.findFiberRoot,bt=e.getBoundingRect,gn=e.getTextContent,br=e.isHiddenSubtree,Ir=e.matchAccessibilityRole,Or=e.setFocusIfFocusable,nn=e.setupIntersectionObserver,ai=e.appendChild,Io=e.appendChildToContainer,ts=e.commitTextUpdate,$s=e.commitMount,Co=e.commitUpdate,Hi=e.insertBefore,eo=e.insertInContainerBefore,wo=e.removeChild,QA=e.removeChildFromContainer,Af=e.resetTextContent,dh=e.hideInstance,mh=e.hideTextInstance,to=e.unhideInstance,jn=e.unhideTextInstance,Rs=e.clearContainer,ro=e.cloneInstance,ou=e.createContainerChildSet,au=e.appendChildToContainerChildSet,lu=e.finalizeContainerChildren,RA=e.replaceContainerChildren,TA=e.cloneHiddenInstance,oa=e.cloneHiddenTextInstance,aa=e.canHydrateInstance,FA=e.canHydrateTextInstance,gr=e.isSuspenseInstancePending,Bo=e.isSuspenseInstanceFallback,Me=e.getNextHydratableSibling,cu=e.getFirstHydratableChild,Cr=e.hydrateInstance,pf=e.hydrateTextInstance,NA=e.getNextHydratableInstanceAfterSuspenseInstance,OA=e.commitHydratedContainer,uu=e.commitHydratedSuspenseInstance,fu;function oc(v){if(fu===void 0)try{throw Error()}catch(Q){var D=Q.stack.trim().match(/\\n( *(at )?)/);fu=D&&D[1]||\"\"}return`\n`+fu+v}var ve=!1;function Nt(v,D){if(!v||ve)return\"\";ve=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(D)if(D=function(){throw Error()},Object.defineProperty(D.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(D,[])}catch(pt){var H=pt}Reflect.construct(v,[],D)}else{try{D.call()}catch(pt){H=pt}v.call(D.prototype)}else{try{throw Error()}catch(pt){H=pt}v()}}catch(pt){if(pt&&H&&typeof pt.stack==\"string\"){for(var V=pt.stack.split(`\n`),ne=H.stack.split(`\n`),Se=V.length-1,_e=ne.length-1;1<=Se&&0<=_e&&V[Se]!==ne[_e];)_e--;for(;1<=Se&&0<=_e;Se--,_e--)if(V[Se]!==ne[_e]){if(Se!==1||_e!==1)do if(Se--,_e--,0>_e||V[Se]!==ne[_e])return`\n`+V[Se].replace(\" at new \",\" at \");while(1<=Se&&0<=_e);break}}}finally{ve=!1,Error.prepareStackTrace=Q}return(v=v?v.displayName||v.name:\"\")?oc(v):\"\"}var ac=[],Oi=-1;function no(v){return{current:v}}function Tt(v){0>Oi||(v.current=ac[Oi],ac[Oi]=null,Oi--)}function xn(v,D){Oi++,ac[Oi]=v.current,v.current=D}var la={},ji=no(la),Li=no(!1),Na=la;function dn(v,D){var Q=v.type.contextTypes;if(!Q)return la;var H=v.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===D)return H.__reactInternalMemoizedMaskedChildContext;var V={},ne;for(ne in Q)V[ne]=D[ne];return H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=D,v.__reactInternalMemoizedMaskedChildContext=V),V}function Kn(v){return v=v.childContextTypes,v!=null}function Au(){Tt(Li),Tt(ji)}function yh(v,D,Q){if(ji.current!==la)throw Error(c(168));xn(ji,D),xn(Li,Q)}function Oa(v,D,Q){var H=v.stateNode;if(v=D.childContextTypes,typeof H.getChildContext!=\"function\")return Q;H=H.getChildContext();for(var V in H)if(!(V in v))throw Error(c(108,g(D)||\"Unknown\",V));return s({},Q,H)}function La(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||la,Na=ji.current,xn(ji,v),xn(Li,Li.current),!0}function Ma(v,D,Q){var H=v.stateNode;if(!H)throw Error(c(169));Q?(v=Oa(v,D,Na),H.__reactInternalMemoizedMergedChildContext=v,Tt(Li),Tt(ji),xn(ji,v)):Tt(Li),xn(Li,Q)}var $e=null,Ua=null,hf=n.unstable_now;hf();var lc=0,wn=8;function ca(v){if(1&v)return wn=15,1;if(2&v)return wn=14,2;if(4&v)return wn=13,4;var D=24&v;return D!==0?(wn=12,D):v&32?(wn=11,32):(D=192&v,D!==0?(wn=10,D):v&256?(wn=9,256):(D=3584&v,D!==0?(wn=8,D):v&4096?(wn=7,4096):(D=4186112&v,D!==0?(wn=6,D):(D=62914560&v,D!==0?(wn=5,D):v&67108864?(wn=4,67108864):v&134217728?(wn=3,134217728):(D=805306368&v,D!==0?(wn=2,D):1073741824&v?(wn=1,1073741824):(wn=8,v))))))}function LA(v){switch(v){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function MA(v){switch(v){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(c(358,v))}}function ua(v,D){var Q=v.pendingLanes;if(Q===0)return wn=0;var H=0,V=0,ne=v.expiredLanes,Se=v.suspendedLanes,_e=v.pingedLanes;if(ne!==0)H=ne,V=wn=15;else if(ne=Q&134217727,ne!==0){var pt=ne&~Se;pt!==0?(H=ca(pt),V=wn):(_e&=ne,_e!==0&&(H=ca(_e),V=wn))}else ne=Q&~Se,ne!==0?(H=ca(ne),V=wn):_e!==0&&(H=ca(_e),V=wn);if(H===0)return 0;if(H=31-rs(H),H=Q&((0>H?0:1<<H)<<1)-1,D!==0&&D!==H&&!(D&Se)){if(ca(D),V<=wn)return D;wn=V}if(D=v.entangledLanes,D!==0)for(v=v.entanglements,D&=H;0<D;)Q=31-rs(D),V=1<<Q,H|=v[Q],D&=~V;return H}function Bl(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function Mt(v,D){switch(v){case 15:return 1;case 14:return 2;case 12:return v=kn(24&~D),v===0?Mt(10,D):v;case 10:return v=kn(192&~D),v===0?Mt(8,D):v;case 8:return v=kn(3584&~D),v===0&&(v=kn(4186112&~D),v===0&&(v=512)),v;case 2:return D=kn(805306368&~D),D===0&&(D=268435456),D}throw Error(c(358,v))}function kn(v){return v&-v}function fa(v){for(var D=[],Q=0;31>Q;Q++)D.push(v);return D}function Ha(v,D,Q){v.pendingLanes|=D;var H=D-1;v.suspendedLanes&=H,v.pingedLanes&=H,v=v.eventTimes,D=31-rs(D),v[D]=Q}var rs=Math.clz32?Math.clz32:uc,cc=Math.log,pu=Math.LN2;function uc(v){return v===0?32:31-(cc(v)/pu|0)|0}var ja=n.unstable_runWithPriority,Mi=n.unstable_scheduleCallback,Is=n.unstable_cancelCallback,vl=n.unstable_shouldYield,gf=n.unstable_requestPaint,fc=n.unstable_now,wi=n.unstable_getCurrentPriorityLevel,Qn=n.unstable_ImmediatePriority,Ac=n.unstable_UserBlockingPriority,Ke=n.unstable_NormalPriority,st=n.unstable_LowPriority,St=n.unstable_IdlePriority,lr={},te=gf!==void 0?gf:function(){},Ee=null,Oe=null,dt=!1,Et=fc(),Pt=1e4>Et?fc:function(){return fc()-Et};function tr(){switch(wi()){case Qn:return 99;case Ac:return 98;case Ke:return 97;case st:return 96;case St:return 95;default:throw Error(c(332))}}function An(v){switch(v){case 99:return Qn;case 98:return Ac;case 97:return Ke;case 96:return st;case 95:return St;default:throw Error(c(332))}}function li(v,D){return v=An(v),ja(v,D)}function Gi(v,D,Q){return v=An(v),Mi(v,D,Q)}function Rn(){if(Oe!==null){var v=Oe;Oe=null,Is(v)}Ga()}function Ga(){if(!dt&&Ee!==null){dt=!0;var v=0;try{var D=Ee;li(99,function(){for(;v<D.length;v++){var Q=D[v];do Q=Q(!0);while(Q!==null)}}),Ee=null}catch(Q){throw Ee!==null&&(Ee=Ee.slice(v+1)),Mi(Qn,Rn),Q}finally{dt=!1}}}var my=f.ReactCurrentBatchConfig;function X1(v,D){return v===D&&(v!==0||1/v===1/D)||v!==v&&D!==D}var vo=typeof Object.is==\"function\"?Object.is:X1,yy=Object.prototype.hasOwnProperty;function Eh(v,D){if(vo(v,D))return!0;if(typeof v!=\"object\"||v===null||typeof D!=\"object\"||D===null)return!1;var Q=Object.keys(v),H=Object.keys(D);if(Q.length!==H.length)return!1;for(H=0;H<Q.length;H++)if(!yy.call(D,Q[H])||!vo(v[Q[H]],D[Q[H]]))return!1;return!0}function $1(v){switch(v.tag){case 5:return oc(v.type);case 16:return oc(\"Lazy\");case 13:return oc(\"Suspense\");case 19:return oc(\"SuspenseList\");case 0:case 2:case 15:return v=Nt(v.type,!1),v;case 11:return v=Nt(v.type.render,!1),v;case 22:return v=Nt(v.type._render,!1),v;case 1:return v=Nt(v.type,!0),v;default:return\"\"}}function So(v,D){if(v&&v.defaultProps){D=s({},D),v=v.defaultProps;for(var Q in v)D[Q]===void 0&&(D[Q]=v[Q]);return D}return D}var Ih=no(null),Ch=null,hu=null,wh=null;function Fg(){wh=hu=Ch=null}function Ng(v,D){v=v.type._context,y?(xn(Ih,v._currentValue),v._currentValue=D):(xn(Ih,v._currentValue2),v._currentValue2=D)}function Og(v){var D=Ih.current;Tt(Ih),v=v.type._context,y?v._currentValue=D:v._currentValue2=D}function Ey(v,D){for(;v!==null;){var Q=v.alternate;if((v.childLanes&D)===D){if(Q===null||(Q.childLanes&D)===D)break;Q.childLanes|=D}else v.childLanes|=D,Q!==null&&(Q.childLanes|=D);v=v.return}}function df(v,D){Ch=v,wh=hu=null,v=v.dependencies,v!==null&&v.firstContext!==null&&(v.lanes&D&&(Je=!0),v.firstContext=null)}function Do(v,D){if(wh!==v&&D!==!1&&D!==0)if((typeof D!=\"number\"||D===1073741823)&&(wh=v,D=1073741823),D={context:v,observedBits:D,next:null},hu===null){if(Ch===null)throw Error(c(308));hu=D,Ch.dependencies={lanes:0,firstContext:D,responders:null}}else hu=hu.next=D;return y?v._currentValue:v._currentValue2}var Sl=!1;function Bh(v){v.updateQueue={baseState:v.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function Lg(v,D){v=v.updateQueue,D.updateQueue===v&&(D.updateQueue={baseState:v.baseState,firstBaseUpdate:v.firstBaseUpdate,lastBaseUpdate:v.lastBaseUpdate,shared:v.shared,effects:v.effects})}function Dl(v,D){return{eventTime:v,lane:D,tag:0,payload:null,callback:null,next:null}}function Pl(v,D){if(v=v.updateQueue,v!==null){v=v.shared;var Q=v.pending;Q===null?D.next=D:(D.next=Q.next,Q.next=D),v.pending=D}}function Iy(v,D){var Q=v.updateQueue,H=v.alternate;if(H!==null&&(H=H.updateQueue,Q===H)){var V=null,ne=null;if(Q=Q.firstBaseUpdate,Q!==null){do{var Se={eventTime:Q.eventTime,lane:Q.lane,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null};ne===null?V=ne=Se:ne=ne.next=Se,Q=Q.next}while(Q!==null);ne===null?V=ne=D:ne=ne.next=D}else V=ne=D;Q={baseState:H.baseState,firstBaseUpdate:V,lastBaseUpdate:ne,shared:H.shared,effects:H.effects},v.updateQueue=Q;return}v=Q.lastBaseUpdate,v===null?Q.firstBaseUpdate=D:v.next=D,Q.lastBaseUpdate=D}function UA(v,D,Q,H){var V=v.updateQueue;Sl=!1;var ne=V.firstBaseUpdate,Se=V.lastBaseUpdate,_e=V.shared.pending;if(_e!==null){V.shared.pending=null;var pt=_e,Wt=pt.next;pt.next=null,Se===null?ne=Wt:Se.next=Wt,Se=pt;var Sr=v.alternate;if(Sr!==null){Sr=Sr.updateQueue;var Lr=Sr.lastBaseUpdate;Lr!==Se&&(Lr===null?Sr.firstBaseUpdate=Wt:Lr.next=Wt,Sr.lastBaseUpdate=pt)}}if(ne!==null){Lr=V.baseState,Se=0,Sr=Wt=pt=null;do{_e=ne.lane;var Xt=ne.eventTime;if((H&_e)===_e){Sr!==null&&(Sr=Sr.next={eventTime:Xt,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var zn=v,yi=ne;switch(_e=D,Xt=Q,yi.tag){case 1:if(zn=yi.payload,typeof zn==\"function\"){Lr=zn.call(Xt,Lr,_e);break e}Lr=zn;break e;case 3:zn.flags=zn.flags&-4097|64;case 0:if(zn=yi.payload,_e=typeof zn==\"function\"?zn.call(Xt,Lr,_e):zn,_e==null)break e;Lr=s({},Lr,_e);break e;case 2:Sl=!0}}ne.callback!==null&&(v.flags|=32,_e=V.effects,_e===null?V.effects=[ne]:_e.push(ne))}else Xt={eventTime:Xt,lane:_e,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Sr===null?(Wt=Sr=Xt,pt=Lr):Sr=Sr.next=Xt,Se|=_e;if(ne=ne.next,ne===null){if(_e=V.shared.pending,_e===null)break;ne=_e.next,_e.next=null,V.lastBaseUpdate=_e,V.shared.pending=null}}while(!0);Sr===null&&(pt=Lr),V.baseState=pt,V.firstBaseUpdate=Wt,V.lastBaseUpdate=Sr,Xg|=Se,v.lanes=Se,v.memoizedState=Lr}}function Cy(v,D,Q){if(v=D.effects,D.effects=null,v!==null)for(D=0;D<v.length;D++){var H=v[D],V=H.callback;if(V!==null){if(H.callback=null,H=Q,typeof V!=\"function\")throw Error(c(191,V));V.call(H)}}}var wy=new a.Component().refs;function _A(v,D,Q,H){D=v.memoizedState,Q=Q(H,D),Q=Q==null?D:s({},D,Q),v.memoizedState=Q,v.lanes===0&&(v.updateQueue.baseState=Q)}var HA={isMounted:function(v){return(v=v._reactInternals)?we(v)===v:!1},enqueueSetState:function(v,D,Q){v=v._reactInternals;var H=ko(),V=Bs(v),ne=Dl(H,V);ne.payload=D,Q!=null&&(ne.callback=Q),Pl(v,ne),Rl(v,V,H)},enqueueReplaceState:function(v,D,Q){v=v._reactInternals;var H=ko(),V=Bs(v),ne=Dl(H,V);ne.tag=1,ne.payload=D,Q!=null&&(ne.callback=Q),Pl(v,ne),Rl(v,V,H)},enqueueForceUpdate:function(v,D){v=v._reactInternals;var Q=ko(),H=Bs(v),V=Dl(Q,H);V.tag=2,D!=null&&(V.callback=D),Pl(v,V),Rl(v,H,Q)}};function Y(v,D,Q,H,V,ne,Se){return v=v.stateNode,typeof v.shouldComponentUpdate==\"function\"?v.shouldComponentUpdate(H,ne,Se):D.prototype&&D.prototype.isPureReactComponent?!Eh(Q,H)||!Eh(V,ne):!0}function xt(v,D,Q){var H=!1,V=la,ne=D.contextType;return typeof ne==\"object\"&&ne!==null?ne=Do(ne):(V=Kn(D)?Na:ji.current,H=D.contextTypes,ne=(H=H!=null)?dn(v,V):la),D=new D(Q,ne),v.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,D.updater=HA,v.stateNode=D,D._reactInternals=v,H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=V,v.__reactInternalMemoizedMaskedChildContext=ne),D}function jA(v,D,Q,H){v=D.state,typeof D.componentWillReceiveProps==\"function\"&&D.componentWillReceiveProps(Q,H),typeof D.UNSAFE_componentWillReceiveProps==\"function\"&&D.UNSAFE_componentWillReceiveProps(Q,H),D.state!==v&&HA.enqueueReplaceState(D,D.state,null)}function Po(v,D,Q,H){var V=v.stateNode;V.props=Q,V.state=v.memoizedState,V.refs=wy,Bh(v);var ne=D.contextType;typeof ne==\"object\"&&ne!==null?V.context=Do(ne):(ne=Kn(D)?Na:ji.current,V.context=dn(v,ne)),UA(v,Q,V,H),V.state=v.memoizedState,ne=D.getDerivedStateFromProps,typeof ne==\"function\"&&(_A(v,D,ne,Q),V.state=v.memoizedState),typeof D.getDerivedStateFromProps==\"function\"||typeof V.getSnapshotBeforeUpdate==\"function\"||typeof V.UNSAFE_componentWillMount!=\"function\"&&typeof V.componentWillMount!=\"function\"||(D=V.state,typeof V.componentWillMount==\"function\"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount==\"function\"&&V.UNSAFE_componentWillMount(),D!==V.state&&HA.enqueueReplaceState(V,V.state,null),UA(v,Q,V,H),V.state=v.memoizedState),typeof V.componentDidMount==\"function\"&&(v.flags|=4)}var mf=Array.isArray;function yt(v,D,Q){if(v=Q.ref,v!==null&&typeof v!=\"function\"&&typeof v!=\"object\"){if(Q._owner){if(Q=Q._owner,Q){if(Q.tag!==1)throw Error(c(309));var H=Q.stateNode}if(!H)throw Error(c(147,v));var V=\"\"+v;return D!==null&&D.ref!==null&&typeof D.ref==\"function\"&&D.ref._stringRef===V?D.ref:(D=function(ne){var Se=H.refs;Se===wy&&(Se=H.refs={}),ne===null?delete Se[V]:Se[V]=ne},D._stringRef=V,D)}if(typeof v!=\"string\")throw Error(c(284));if(!Q._owner)throw Error(c(290,v))}return v}function gu(v,D){if(v.type!==\"textarea\")throw Error(c(31,Object.prototype.toString.call(D)===\"[object Object]\"?\"object with keys {\"+Object.keys(D).join(\", \")+\"}\":D))}function By(v){function D(et,qe){if(v){var gt=et.lastEffect;gt!==null?(gt.nextEffect=qe,et.lastEffect=qe):et.firstEffect=et.lastEffect=qe,qe.nextEffect=null,qe.flags=8}}function Q(et,qe){if(!v)return null;for(;qe!==null;)D(et,qe),qe=qe.sibling;return null}function H(et,qe){for(et=new Map;qe!==null;)qe.key!==null?et.set(qe.key,qe):et.set(qe.index,qe),qe=qe.sibling;return et}function V(et,qe){return et=Su(et,qe),et.index=0,et.sibling=null,et}function ne(et,qe,gt){return et.index=gt,v?(gt=et.alternate,gt!==null?(gt=gt.index,gt<qe?(et.flags=2,qe):gt):(et.flags=2,qe)):qe}function Se(et){return v&&et.alternate===null&&(et.flags=2),et}function _e(et,qe,gt,Zt){return qe===null||qe.tag!==6?(qe=P2(gt,et.mode,Zt),qe.return=et,qe):(qe=V(qe,gt),qe.return=et,qe)}function pt(et,qe,gt,Zt){return qe!==null&&qe.elementType===gt.type?(Zt=V(qe,gt.props),Zt.ref=yt(et,qe,gt),Zt.return=et,Zt):(Zt=sd(gt.type,gt.key,gt.props,null,et.mode,Zt),Zt.ref=yt(et,qe,gt),Zt.return=et,Zt)}function Wt(et,qe,gt,Zt){return qe===null||qe.tag!==4||qe.stateNode.containerInfo!==gt.containerInfo||qe.stateNode.implementation!==gt.implementation?(qe=Qo(gt,et.mode,Zt),qe.return=et,qe):(qe=V(qe,gt.children||[]),qe.return=et,qe)}function Sr(et,qe,gt,Zt,Dr){return qe===null||qe.tag!==7?(qe=kf(gt,et.mode,Zt,Dr),qe.return=et,qe):(qe=V(qe,gt),qe.return=et,qe)}function Lr(et,qe,gt){if(typeof qe==\"string\"||typeof qe==\"number\")return qe=P2(\"\"+qe,et.mode,gt),qe.return=et,qe;if(typeof qe==\"object\"&&qe!==null){switch(qe.$$typeof){case p:return gt=sd(qe.type,qe.key,qe.props,null,et.mode,gt),gt.ref=yt(et,null,qe),gt.return=et,gt;case h:return qe=Qo(qe,et.mode,gt),qe.return=et,qe}if(mf(qe)||Ce(qe))return qe=kf(qe,et.mode,gt,null),qe.return=et,qe;gu(et,qe)}return null}function Xt(et,qe,gt,Zt){var Dr=qe!==null?qe.key:null;if(typeof gt==\"string\"||typeof gt==\"number\")return Dr!==null?null:_e(et,qe,\"\"+gt,Zt);if(typeof gt==\"object\"&&gt!==null){switch(gt.$$typeof){case p:return gt.key===Dr?gt.type===E?Sr(et,qe,gt.props.children,Zt,Dr):pt(et,qe,gt,Zt):null;case h:return gt.key===Dr?Wt(et,qe,gt,Zt):null}if(mf(gt)||Ce(gt))return Dr!==null?null:Sr(et,qe,gt,Zt,null);gu(et,gt)}return null}function zn(et,qe,gt,Zt,Dr){if(typeof Zt==\"string\"||typeof Zt==\"number\")return et=et.get(gt)||null,_e(qe,et,\"\"+Zt,Dr);if(typeof Zt==\"object\"&&Zt!==null){switch(Zt.$$typeof){case p:return et=et.get(Zt.key===null?gt:Zt.key)||null,Zt.type===E?Sr(qe,et,Zt.props.children,Dr,Zt.key):pt(qe,et,Zt,Dr);case h:return et=et.get(Zt.key===null?gt:Zt.key)||null,Wt(qe,et,Zt,Dr)}if(mf(Zt)||Ce(Zt))return et=et.get(gt)||null,Sr(qe,et,Zt,Dr,null);gu(qe,Zt)}return null}function yi(et,qe,gt,Zt){for(var Dr=null,Xn=null,kr=qe,Tn=qe=0,_n=null;kr!==null&&Tn<gt.length;Tn++){kr.index>Tn?(_n=kr,kr=null):_n=kr.sibling;var zr=Xt(et,kr,gt[Tn],Zt);if(zr===null){kr===null&&(kr=_n);break}v&&kr&&zr.alternate===null&&D(et,kr),qe=ne(zr,qe,Tn),Xn===null?Dr=zr:Xn.sibling=zr,Xn=zr,kr=_n}if(Tn===gt.length)return Q(et,kr),Dr;if(kr===null){for(;Tn<gt.length;Tn++)kr=Lr(et,gt[Tn],Zt),kr!==null&&(qe=ne(kr,qe,Tn),Xn===null?Dr=kr:Xn.sibling=kr,Xn=kr);return Dr}for(kr=H(et,kr);Tn<gt.length;Tn++)_n=zn(kr,et,Tn,gt[Tn],Zt),_n!==null&&(v&&_n.alternate!==null&&kr.delete(_n.key===null?Tn:_n.key),qe=ne(_n,qe,Tn),Xn===null?Dr=_n:Xn.sibling=_n,Xn=_n);return v&&kr.forEach(function(ci){return D(et,ci)}),Dr}function za(et,qe,gt,Zt){var Dr=Ce(gt);if(typeof Dr!=\"function\")throw Error(c(150));if(gt=Dr.call(gt),gt==null)throw Error(c(151));for(var Xn=Dr=null,kr=qe,Tn=qe=0,_n=null,zr=gt.next();kr!==null&&!zr.done;Tn++,zr=gt.next()){kr.index>Tn?(_n=kr,kr=null):_n=kr.sibling;var ci=Xt(et,kr,zr.value,Zt);if(ci===null){kr===null&&(kr=_n);break}v&&kr&&ci.alternate===null&&D(et,kr),qe=ne(ci,qe,Tn),Xn===null?Dr=ci:Xn.sibling=ci,Xn=ci,kr=_n}if(zr.done)return Q(et,kr),Dr;if(kr===null){for(;!zr.done;Tn++,zr=gt.next())zr=Lr(et,zr.value,Zt),zr!==null&&(qe=ne(zr,qe,Tn),Xn===null?Dr=zr:Xn.sibling=zr,Xn=zr);return Dr}for(kr=H(et,kr);!zr.done;Tn++,zr=gt.next())zr=zn(kr,et,Tn,zr.value,Zt),zr!==null&&(v&&zr.alternate!==null&&kr.delete(zr.key===null?Tn:zr.key),qe=ne(zr,qe,Tn),Xn===null?Dr=zr:Xn.sibling=zr,Xn=zr);return v&&kr.forEach(function(Du){return D(et,Du)}),Dr}return function(et,qe,gt,Zt){var Dr=typeof gt==\"object\"&&gt!==null&&gt.type===E&&gt.key===null;Dr&&(gt=gt.props.children);var Xn=typeof gt==\"object\"&&gt!==null;if(Xn)switch(gt.$$typeof){case p:e:{for(Xn=gt.key,Dr=qe;Dr!==null;){if(Dr.key===Xn){switch(Dr.tag){case 7:if(gt.type===E){Q(et,Dr.sibling),qe=V(Dr,gt.props.children),qe.return=et,et=qe;break e}break;default:if(Dr.elementType===gt.type){Q(et,Dr.sibling),qe=V(Dr,gt.props),qe.ref=yt(et,Dr,gt),qe.return=et,et=qe;break e}}Q(et,Dr);break}else D(et,Dr);Dr=Dr.sibling}gt.type===E?(qe=kf(gt.props.children,et.mode,Zt,gt.key),qe.return=et,et=qe):(Zt=sd(gt.type,gt.key,gt.props,null,et.mode,Zt),Zt.ref=yt(et,qe,gt),Zt.return=et,et=Zt)}return Se(et);case h:e:{for(Dr=gt.key;qe!==null;){if(qe.key===Dr)if(qe.tag===4&&qe.stateNode.containerInfo===gt.containerInfo&&qe.stateNode.implementation===gt.implementation){Q(et,qe.sibling),qe=V(qe,gt.children||[]),qe.return=et,et=qe;break e}else{Q(et,qe);break}else D(et,qe);qe=qe.sibling}qe=Qo(gt,et.mode,Zt),qe.return=et,et=qe}return Se(et)}if(typeof gt==\"string\"||typeof gt==\"number\")return gt=\"\"+gt,qe!==null&&qe.tag===6?(Q(et,qe.sibling),qe=V(qe,gt),qe.return=et,et=qe):(Q(et,qe),qe=P2(gt,et.mode,Zt),qe.return=et,et=qe),Se(et);if(mf(gt))return yi(et,qe,gt,Zt);if(Ce(gt))return za(et,qe,gt,Zt);if(Xn&&gu(et,gt),typeof gt>\"u\"&&!Dr)switch(et.tag){case 1:case 22:case 0:case 11:case 15:throw Error(c(152,g(et.type)||\"Component\"))}return Q(et,qe)}}var Mg=By(!0),e2=By(!1),vh={},ur=no(vh),Ki=no(vh),yf=no(vh);function qa(v){if(v===vh)throw Error(c(174));return v}function Ug(v,D){xn(yf,D),xn(Ki,v),xn(ur,vh),v=mt(D),Tt(ur),xn(ur,v)}function du(){Tt(ur),Tt(Ki),Tt(yf)}function Ef(v){var D=qa(yf.current),Q=qa(ur.current);D=j(Q,v.type,D),Q!==D&&(xn(Ki,v),xn(ur,D))}function wt(v){Ki.current===v&&(Tt(ur),Tt(Ki))}var di=no(0);function GA(v){for(var D=v;D!==null;){if(D.tag===13){var Q=D.memoizedState;if(Q!==null&&(Q=Q.dehydrated,Q===null||gr(Q)||Bo(Q)))return D}else if(D.tag===19&&D.memoizedProps.revealOrder!==void 0){if(D.flags&64)return D}else if(D.child!==null){D.child.return=D,D=D.child;continue}if(D===v)break;for(;D.sibling===null;){if(D.return===null||D.return===v)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}return null}var Wa=null,Aa=null,Ya=!1;function _g(v,D){var Q=Ka(5,null,null,0);Q.elementType=\"DELETED\",Q.type=\"DELETED\",Q.stateNode=D,Q.return=v,Q.flags=8,v.lastEffect!==null?(v.lastEffect.nextEffect=Q,v.lastEffect=Q):v.firstEffect=v.lastEffect=Q}function Sh(v,D){switch(v.tag){case 5:return D=aa(D,v.type,v.pendingProps),D!==null?(v.stateNode=D,!0):!1;case 6:return D=FA(D,v.pendingProps),D!==null?(v.stateNode=D,!0):!1;case 13:return!1;default:return!1}}function Hg(v){if(Ya){var D=Aa;if(D){var Q=D;if(!Sh(v,D)){if(D=Me(Q),!D||!Sh(v,D)){v.flags=v.flags&-1025|2,Ya=!1,Wa=v;return}_g(Wa,Q)}Wa=v,Aa=cu(D)}else v.flags=v.flags&-1025|2,Ya=!1,Wa=v}}function vy(v){for(v=v.return;v!==null&&v.tag!==5&&v.tag!==3&&v.tag!==13;)v=v.return;Wa=v}function qA(v){if(!Z||v!==Wa)return!1;if(!Ya)return vy(v),Ya=!0,!1;var D=v.type;if(v.tag!==5||D!==\"head\"&&D!==\"body\"&&!it(D,v.memoizedProps))for(D=Aa;D;)_g(v,D),D=Me(D);if(vy(v),v.tag===13){if(!Z)throw Error(c(316));if(v=v.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(c(317));Aa=NA(v)}else Aa=Wa?Me(v.stateNode):null;return!0}function jg(){Z&&(Aa=Wa=null,Ya=!1)}var mu=[];function yu(){for(var v=0;v<mu.length;v++){var D=mu[v];y?D._workInProgressVersionPrimary=null:D._workInProgressVersionSecondary=null}mu.length=0}var If=f.ReactCurrentDispatcher,Ts=f.ReactCurrentBatchConfig,Eu=0,Gn=null,ns=null,bi=null,WA=!1,Cf=!1;function mn(){throw Error(c(321))}function Gg(v,D){if(D===null)return!1;for(var Q=0;Q<D.length&&Q<v.length;Q++)if(!vo(v[Q],D[Q]))return!1;return!0}function qg(v,D,Q,H,V,ne){if(Eu=ne,Gn=D,D.memoizedState=null,D.updateQueue=null,D.lanes=0,If.current=v===null||v.memoizedState===null?O:K,v=Q(H,V),Cf){ne=0;do{if(Cf=!1,!(25>ne))throw Error(c(301));ne+=1,bi=ns=null,D.updateQueue=null,If.current=re,v=Q(H,V)}while(Cf)}if(If.current=kt,D=ns!==null&&ns.next!==null,Eu=0,bi=ns=Gn=null,WA=!1,D)throw Error(c(300));return v}function is(){var v={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bi===null?Gn.memoizedState=bi=v:bi=bi.next=v,bi}function bl(){if(ns===null){var v=Gn.alternate;v=v!==null?v.memoizedState:null}else v=ns.next;var D=bi===null?Gn.memoizedState:bi.next;if(D!==null)bi=D,ns=v;else{if(v===null)throw Error(c(310));ns=v,v={memoizedState:ns.memoizedState,baseState:ns.baseState,baseQueue:ns.baseQueue,queue:ns.queue,next:null},bi===null?Gn.memoizedState=bi=v:bi=bi.next=v}return bi}function bo(v,D){return typeof D==\"function\"?D(v):D}function wf(v){var D=bl(),Q=D.queue;if(Q===null)throw Error(c(311));Q.lastRenderedReducer=v;var H=ns,V=H.baseQueue,ne=Q.pending;if(ne!==null){if(V!==null){var Se=V.next;V.next=ne.next,ne.next=Se}H.baseQueue=V=ne,Q.pending=null}if(V!==null){V=V.next,H=H.baseState;var _e=Se=ne=null,pt=V;do{var Wt=pt.lane;if((Eu&Wt)===Wt)_e!==null&&(_e=_e.next={lane:0,action:pt.action,eagerReducer:pt.eagerReducer,eagerState:pt.eagerState,next:null}),H=pt.eagerReducer===v?pt.eagerState:v(H,pt.action);else{var Sr={lane:Wt,action:pt.action,eagerReducer:pt.eagerReducer,eagerState:pt.eagerState,next:null};_e===null?(Se=_e=Sr,ne=H):_e=_e.next=Sr,Gn.lanes|=Wt,Xg|=Wt}pt=pt.next}while(pt!==null&&pt!==V);_e===null?ne=H:_e.next=Se,vo(H,D.memoizedState)||(Je=!0),D.memoizedState=H,D.baseState=ne,D.baseQueue=_e,Q.lastRenderedState=H}return[D.memoizedState,Q.dispatch]}function Bf(v){var D=bl(),Q=D.queue;if(Q===null)throw Error(c(311));Q.lastRenderedReducer=v;var H=Q.dispatch,V=Q.pending,ne=D.memoizedState;if(V!==null){Q.pending=null;var Se=V=V.next;do ne=v(ne,Se.action),Se=Se.next;while(Se!==V);vo(ne,D.memoizedState)||(Je=!0),D.memoizedState=ne,D.baseQueue===null&&(D.baseState=ne),Q.lastRenderedState=ne}return[ne,H]}function xl(v,D,Q){var H=D._getVersion;H=H(D._source);var V=y?D._workInProgressVersionPrimary:D._workInProgressVersionSecondary;if(V!==null?v=V===H:(v=v.mutableReadLanes,(v=(Eu&v)===v)&&(y?D._workInProgressVersionPrimary=H:D._workInProgressVersionSecondary=H,mu.push(D))),v)return Q(D._source);throw mu.push(D),Error(c(350))}function yn(v,D,Q,H){var V=so;if(V===null)throw Error(c(349));var ne=D._getVersion,Se=ne(D._source),_e=If.current,pt=_e.useState(function(){return xl(V,D,Q)}),Wt=pt[1],Sr=pt[0];pt=bi;var Lr=v.memoizedState,Xt=Lr.refs,zn=Xt.getSnapshot,yi=Lr.source;Lr=Lr.subscribe;var za=Gn;return v.memoizedState={refs:Xt,source:D,subscribe:H},_e.useEffect(function(){Xt.getSnapshot=Q,Xt.setSnapshot=Wt;var et=ne(D._source);if(!vo(Se,et)){et=Q(D._source),vo(Sr,et)||(Wt(et),et=Bs(za),V.mutableReadLanes|=et&V.pendingLanes),et=V.mutableReadLanes,V.entangledLanes|=et;for(var qe=V.entanglements,gt=et;0<gt;){var Zt=31-rs(gt),Dr=1<<Zt;qe[Zt]|=et,gt&=~Dr}}},[Q,D,H]),_e.useEffect(function(){return H(D._source,function(){var et=Xt.getSnapshot,qe=Xt.setSnapshot;try{qe(et(D._source));var gt=Bs(za);V.mutableReadLanes|=gt&V.pendingLanes}catch(Zt){qe(function(){throw Zt})}})},[D,H]),vo(zn,Q)&&vo(yi,D)&&vo(Lr,H)||(v={pending:null,dispatch:null,lastRenderedReducer:bo,lastRenderedState:Sr},v.dispatch=Wt=xh.bind(null,Gn,v),pt.queue=v,pt.baseQueue=null,Sr=xl(V,D,Q),pt.memoizedState=pt.baseState=Sr),Sr}function xo(v,D,Q){var H=bl();return yn(H,v,D,Q)}function Iu(v){var D=is();return typeof v==\"function\"&&(v=v()),D.memoizedState=D.baseState=v,v=D.queue={pending:null,dispatch:null,lastRenderedReducer:bo,lastRenderedState:v},v=v.dispatch=xh.bind(null,Gn,v),[D.memoizedState,v]}function pa(v,D,Q,H){return v={tag:v,create:D,destroy:Q,deps:H,next:null},D=Gn.updateQueue,D===null?(D={lastEffect:null},Gn.updateQueue=D,D.lastEffect=v.next=v):(Q=D.lastEffect,Q===null?D.lastEffect=v.next=v:(H=Q.next,Q.next=v,v.next=H,D.lastEffect=v)),v}function Fs(v){var D=is();return v={current:v},D.memoizedState=v}function Dh(){return bl().memoizedState}function YA(v,D,Q,H){var V=is();Gn.flags|=v,V.memoizedState=pa(1|D,Q,void 0,H===void 0?null:H)}function vf(v,D,Q,H){var V=bl();H=H===void 0?null:H;var ne=void 0;if(ns!==null){var Se=ns.memoizedState;if(ne=Se.destroy,H!==null&&Gg(H,Se.deps)){pa(D,Q,ne,H);return}}Gn.flags|=v,V.memoizedState=pa(1|D,Q,ne,H)}function io(v,D){return YA(516,4,v,D)}function Xr(v,D){return vf(516,4,v,D)}function Ph(v,D){return vf(4,2,v,D)}function VA(v,D){if(typeof D==\"function\")return v=v(),D(v),function(){D(null)};if(D!=null)return v=v(),D.current=v,function(){D.current=null}}function Sy(v,D,Q){return Q=Q!=null?Q.concat([v]):null,vf(4,2,VA.bind(null,D,v),Q)}function Wg(){}function bh(v,D){var Q=bl();D=D===void 0?null:D;var H=Q.memoizedState;return H!==null&&D!==null&&Gg(D,H[1])?H[0]:(Q.memoizedState=[v,D],v)}function pc(v,D){var Q=bl();D=D===void 0?null:D;var H=Q.memoizedState;return H!==null&&D!==null&&Gg(D,H[1])?H[0]:(v=v(),Q.memoizedState=[v,D],v)}function Dy(v,D){var Q=tr();li(98>Q?98:Q,function(){v(!0)}),li(97<Q?97:Q,function(){var H=Ts.transition;Ts.transition=1;try{v(!1),D()}finally{Ts.transition=H}})}function xh(v,D,Q){var H=ko(),V=Bs(v),ne={lane:V,action:Q,eagerReducer:null,eagerState:null,next:null},Se=D.pending;if(Se===null?ne.next=ne:(ne.next=Se.next,Se.next=ne),D.pending=ne,Se=v.alternate,v===Gn||Se!==null&&Se===Gn)Cf=WA=!0;else{if(v.lanes===0&&(Se===null||Se.lanes===0)&&(Se=D.lastRenderedReducer,Se!==null))try{var _e=D.lastRenderedState,pt=Se(_e,Q);if(ne.eagerReducer=Se,ne.eagerState=pt,vo(pt,_e))return}catch{}finally{}Rl(v,V,H)}}var kt={readContext:Do,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useMutableSource:mn,useOpaqueIdentifier:mn,unstable_isNewReconciler:!1},O={readContext:Do,useCallback:function(v,D){return is().memoizedState=[v,D===void 0?null:D],v},useContext:Do,useEffect:io,useImperativeHandle:function(v,D,Q){return Q=Q!=null?Q.concat([v]):null,YA(4,2,VA.bind(null,D,v),Q)},useLayoutEffect:function(v,D){return YA(4,2,v,D)},useMemo:function(v,D){var Q=is();return D=D===void 0?null:D,v=v(),Q.memoizedState=[v,D],v},useReducer:function(v,D,Q){var H=is();return D=Q!==void 0?Q(D):D,H.memoizedState=H.baseState=D,v=H.queue={pending:null,dispatch:null,lastRenderedReducer:v,lastRenderedState:D},v=v.dispatch=xh.bind(null,Gn,v),[H.memoizedState,v]},useRef:Fs,useState:Iu,useDebugValue:Wg,useDeferredValue:function(v){var D=Iu(v),Q=D[0],H=D[1];return io(function(){var V=Ts.transition;Ts.transition=1;try{H(v)}finally{Ts.transition=V}},[v]),Q},useTransition:function(){var v=Iu(!1),D=v[0];return v=Dy.bind(null,v[1]),Fs(v),[v,D]},useMutableSource:function(v,D,Q){var H=is();return H.memoizedState={refs:{getSnapshot:D,setSnapshot:null},source:v,subscribe:Q},yn(H,v,D,Q)},useOpaqueIdentifier:function(){if(Ya){var v=!1,D=oe(function(){throw v||(v=!0,Q(xe())),Error(c(355))}),Q=Iu(D)[1];return!(Gn.mode&2)&&(Gn.flags|=516,pa(5,function(){Q(xe())},void 0,null)),D}return D=xe(),Iu(D),D},unstable_isNewReconciler:!1},K={readContext:Do,useCallback:bh,useContext:Do,useEffect:Xr,useImperativeHandle:Sy,useLayoutEffect:Ph,useMemo:pc,useReducer:wf,useRef:Dh,useState:function(){return wf(bo)},useDebugValue:Wg,useDeferredValue:function(v){var D=wf(bo),Q=D[0],H=D[1];return Xr(function(){var V=Ts.transition;Ts.transition=1;try{H(v)}finally{Ts.transition=V}},[v]),Q},useTransition:function(){var v=wf(bo)[0];return[Dh().current,v]},useMutableSource:xo,useOpaqueIdentifier:function(){return wf(bo)[0]},unstable_isNewReconciler:!1},re={readContext:Do,useCallback:bh,useContext:Do,useEffect:Xr,useImperativeHandle:Sy,useLayoutEffect:Ph,useMemo:pc,useReducer:Bf,useRef:Dh,useState:function(){return Bf(bo)},useDebugValue:Wg,useDeferredValue:function(v){var D=Bf(bo),Q=D[0],H=D[1];return Xr(function(){var V=Ts.transition;Ts.transition=1;try{H(v)}finally{Ts.transition=V}},[v]),Q},useTransition:function(){var v=Bf(bo)[0];return[Dh().current,v]},useMutableSource:xo,useOpaqueIdentifier:function(){return Bf(bo)[0]},unstable_isNewReconciler:!1},de=f.ReactCurrentOwner,Je=!1;function At(v,D,Q,H){D.child=v===null?e2(D,null,Q,H):Mg(D,v.child,Q,H)}function dr(v,D,Q,H,V){Q=Q.render;var ne=D.ref;return df(D,V),H=qg(v,D,Q,H,ne,V),v!==null&&!Je?(D.updateQueue=v.updateQueue,D.flags&=-517,v.lanes&=~V,qn(v,D,V)):(D.flags|=1,At(v,D,H,V),D.child)}function vr(v,D,Q,H,V,ne){if(v===null){var Se=Q.type;return typeof Se==\"function\"&&!S2(Se)&&Se.defaultProps===void 0&&Q.compare===null&&Q.defaultProps===void 0?(D.tag=15,D.type=Se,Un(v,D,Se,H,V,ne)):(v=sd(Q.type,null,H,D,D.mode,ne),v.ref=D.ref,v.return=D,D.child=v)}return Se=v.child,!(V&ne)&&(V=Se.memoizedProps,Q=Q.compare,Q=Q!==null?Q:Eh,Q(V,H)&&v.ref===D.ref)?qn(v,D,ne):(D.flags|=1,v=Su(Se,H),v.ref=D.ref,v.return=D,D.child=v)}function Un(v,D,Q,H,V,ne){if(v!==null&&Eh(v.memoizedProps,H)&&v.ref===D.ref)if(Je=!1,(ne&V)!==0)v.flags&16384&&(Je=!0);else return D.lanes=v.lanes,qn(v,D,ne);return JA(v,D,Q,H,ne)}function mi(v,D,Q){var H=D.pendingProps,V=H.children,ne=v!==null?v.memoizedState:null;if(H.mode===\"hidden\"||H.mode===\"unstable-defer-without-hiding\")if(!(D.mode&4))D.memoizedState={baseLanes:0},qy(D,Q);else if(Q&1073741824)D.memoizedState={baseLanes:0},qy(D,ne!==null?ne.baseLanes:Q);else return v=ne!==null?ne.baseLanes|Q:Q,D.lanes=D.childLanes=1073741824,D.memoizedState={baseLanes:v},qy(D,v),null;else ne!==null?(H=ne.baseLanes|Q,D.memoizedState=null):H=Q,qy(D,H);return At(v,D,V,Q),D.child}function Cs(v,D){var Q=D.ref;(v===null&&Q!==null||v!==null&&v.ref!==Q)&&(D.flags|=128)}function JA(v,D,Q,H,V){var ne=Kn(Q)?Na:ji.current;return ne=dn(D,ne),df(D,V),Q=qg(v,D,Q,H,ne,V),v!==null&&!Je?(D.updateQueue=v.updateQueue,D.flags&=-517,v.lanes&=~V,qn(v,D,V)):(D.flags|=1,At(v,D,Q,V),D.child)}function ab(v,D,Q,H,V){if(Kn(Q)){var ne=!0;La(D)}else ne=!1;if(df(D,V),D.stateNode===null)v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),xt(D,Q,H),Po(D,Q,H,V),H=!0;else if(v===null){var Se=D.stateNode,_e=D.memoizedProps;Se.props=_e;var pt=Se.context,Wt=Q.contextType;typeof Wt==\"object\"&&Wt!==null?Wt=Do(Wt):(Wt=Kn(Q)?Na:ji.current,Wt=dn(D,Wt));var Sr=Q.getDerivedStateFromProps,Lr=typeof Sr==\"function\"||typeof Se.getSnapshotBeforeUpdate==\"function\";Lr||typeof Se.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof Se.componentWillReceiveProps!=\"function\"||(_e!==H||pt!==Wt)&&jA(D,Se,H,Wt),Sl=!1;var Xt=D.memoizedState;Se.state=Xt,UA(D,H,Se,V),pt=D.memoizedState,_e!==H||Xt!==pt||Li.current||Sl?(typeof Sr==\"function\"&&(_A(D,Q,Sr,H),pt=D.memoizedState),(_e=Sl||Y(D,Q,_e,H,Xt,pt,Wt))?(Lr||typeof Se.UNSAFE_componentWillMount!=\"function\"&&typeof Se.componentWillMount!=\"function\"||(typeof Se.componentWillMount==\"function\"&&Se.componentWillMount(),typeof Se.UNSAFE_componentWillMount==\"function\"&&Se.UNSAFE_componentWillMount()),typeof Se.componentDidMount==\"function\"&&(D.flags|=4)):(typeof Se.componentDidMount==\"function\"&&(D.flags|=4),D.memoizedProps=H,D.memoizedState=pt),Se.props=H,Se.state=pt,Se.context=Wt,H=_e):(typeof Se.componentDidMount==\"function\"&&(D.flags|=4),H=!1)}else{Se=D.stateNode,Lg(v,D),_e=D.memoizedProps,Wt=D.type===D.elementType?_e:So(D.type,_e),Se.props=Wt,Lr=D.pendingProps,Xt=Se.context,pt=Q.contextType,typeof pt==\"object\"&&pt!==null?pt=Do(pt):(pt=Kn(Q)?Na:ji.current,pt=dn(D,pt));var zn=Q.getDerivedStateFromProps;(Sr=typeof zn==\"function\"||typeof Se.getSnapshotBeforeUpdate==\"function\")||typeof Se.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof Se.componentWillReceiveProps!=\"function\"||(_e!==Lr||Xt!==pt)&&jA(D,Se,H,pt),Sl=!1,Xt=D.memoizedState,Se.state=Xt,UA(D,H,Se,V);var yi=D.memoizedState;_e!==Lr||Xt!==yi||Li.current||Sl?(typeof zn==\"function\"&&(_A(D,Q,zn,H),yi=D.memoizedState),(Wt=Sl||Y(D,Q,Wt,H,Xt,yi,pt))?(Sr||typeof Se.UNSAFE_componentWillUpdate!=\"function\"&&typeof Se.componentWillUpdate!=\"function\"||(typeof Se.componentWillUpdate==\"function\"&&Se.componentWillUpdate(H,yi,pt),typeof Se.UNSAFE_componentWillUpdate==\"function\"&&Se.UNSAFE_componentWillUpdate(H,yi,pt)),typeof Se.componentDidUpdate==\"function\"&&(D.flags|=4),typeof Se.getSnapshotBeforeUpdate==\"function\"&&(D.flags|=256)):(typeof Se.componentDidUpdate!=\"function\"||_e===v.memoizedProps&&Xt===v.memoizedState||(D.flags|=4),typeof Se.getSnapshotBeforeUpdate!=\"function\"||_e===v.memoizedProps&&Xt===v.memoizedState||(D.flags|=256),D.memoizedProps=H,D.memoizedState=yi),Se.props=H,Se.state=yi,Se.context=pt,H=Wt):(typeof Se.componentDidUpdate!=\"function\"||_e===v.memoizedProps&&Xt===v.memoizedState||(D.flags|=4),typeof Se.getSnapshotBeforeUpdate!=\"function\"||_e===v.memoizedProps&&Xt===v.memoizedState||(D.flags|=256),H=!1)}return t2(v,D,Q,H,ne,V)}function t2(v,D,Q,H,V,ne){Cs(v,D);var Se=(D.flags&64)!==0;if(!H&&!Se)return V&&Ma(D,Q,!1),qn(v,D,ne);H=D.stateNode,de.current=D;var _e=Se&&typeof Q.getDerivedStateFromError!=\"function\"?null:H.render();return D.flags|=1,v!==null&&Se?(D.child=Mg(D,v.child,null,ne),D.child=Mg(D,null,_e,ne)):At(v,D,_e,ne),D.memoizedState=H.state,V&&Ma(D,Q,!0),D.child}function Py(v){var D=v.stateNode;D.pendingContext?yh(v,D.pendingContext,D.pendingContext!==D.context):D.context&&yh(v,D.context,!1),Ug(v,D.containerInfo)}var kh={dehydrated:null,retryLane:0};function r2(v,D,Q){var H=D.pendingProps,V=di.current,ne=!1,Se;return(Se=(D.flags&64)!==0)||(Se=v!==null&&v.memoizedState===null?!1:(V&2)!==0),Se?(ne=!0,D.flags&=-65):v!==null&&v.memoizedState===null||H.fallback===void 0||H.unstable_avoidThisFallback===!0||(V|=1),xn(di,V&1),v===null?(H.fallback!==void 0&&Hg(D),v=H.children,V=H.fallback,ne?(v=Va(D,v,V,Q),D.child.memoizedState={baseLanes:Q},D.memoizedState=kh,v):typeof H.unstable_expectedLoadTime==\"number\"?(v=Va(D,v,V,Q),D.child.memoizedState={baseLanes:Q},D.memoizedState=kh,D.lanes=33554432,v):(Q=D2({mode:\"visible\",children:v},D.mode,Q,null),Q.return=D,D.child=Q)):v.memoizedState!==null?ne?(H=KA(v,D,H.children,H.fallback,Q),ne=D.child,V=v.child.memoizedState,ne.memoizedState=V===null?{baseLanes:Q}:{baseLanes:V.baseLanes|Q},ne.childLanes=v.childLanes&~Q,D.memoizedState=kh,H):(Q=n2(v,D,H.children,Q),D.memoizedState=null,Q):ne?(H=KA(v,D,H.children,H.fallback,Q),ne=D.child,V=v.child.memoizedState,ne.memoizedState=V===null?{baseLanes:Q}:{baseLanes:V.baseLanes|Q},ne.childLanes=v.childLanes&~Q,D.memoizedState=kh,H):(Q=n2(v,D,H.children,Q),D.memoizedState=null,Q)}function Va(v,D,Q,H){var V=v.mode,ne=v.child;return D={mode:\"hidden\",children:D},!(V&2)&&ne!==null?(ne.childLanes=0,ne.pendingProps=D):ne=D2(D,V,0,null),Q=kf(Q,V,H,null),ne.return=v,Q.return=v,ne.sibling=Q,v.child=ne,Q}function n2(v,D,Q,H){var V=v.child;return v=V.sibling,Q=Su(V,{mode:\"visible\",children:Q}),!(D.mode&2)&&(Q.lanes=H),Q.return=D,Q.sibling=null,v!==null&&(v.nextEffect=null,v.flags=8,D.firstEffect=D.lastEffect=v),D.child=Q}function KA(v,D,Q,H,V){var ne=D.mode,Se=v.child;v=Se.sibling;var _e={mode:\"hidden\",children:Q};return!(ne&2)&&D.child!==Se?(Q=D.child,Q.childLanes=0,Q.pendingProps=_e,Se=Q.lastEffect,Se!==null?(D.firstEffect=Q.firstEffect,D.lastEffect=Se,Se.nextEffect=null):D.firstEffect=D.lastEffect=null):Q=Su(Se,_e),v!==null?H=Su(v,H):(H=kf(H,ne,V,null),H.flags|=2),H.return=D,Q.return=D,Q.sibling=H,D.child=Q,H}function Qh(v,D){v.lanes|=D;var Q=v.alternate;Q!==null&&(Q.lanes|=D),Ey(v.return,D)}function by(v,D,Q,H,V,ne){var Se=v.memoizedState;Se===null?v.memoizedState={isBackwards:D,rendering:null,renderingStartTime:0,last:H,tail:Q,tailMode:V,lastEffect:ne}:(Se.isBackwards=D,Se.rendering=null,Se.renderingStartTime=0,Se.last=H,Se.tail=Q,Se.tailMode=V,Se.lastEffect=ne)}function lb(v,D,Q){var H=D.pendingProps,V=H.revealOrder,ne=H.tail;if(At(v,D,H.children,Q),H=di.current,H&2)H=H&1|2,D.flags|=64;else{if(v!==null&&v.flags&64)e:for(v=D.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&Qh(v,Q);else if(v.tag===19)Qh(v,Q);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===D)break e;for(;v.sibling===null;){if(v.return===null||v.return===D)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}H&=1}if(xn(di,H),!(D.mode&2))D.memoizedState=null;else switch(V){case\"forwards\":for(Q=D.child,V=null;Q!==null;)v=Q.alternate,v!==null&&GA(v)===null&&(V=Q),Q=Q.sibling;Q=V,Q===null?(V=D.child,D.child=null):(V=Q.sibling,Q.sibling=null),by(D,!1,V,Q,ne,D.lastEffect);break;case\"backwards\":for(Q=null,V=D.child,D.child=null;V!==null;){if(v=V.alternate,v!==null&&GA(v)===null){D.child=V;break}v=V.sibling,V.sibling=Q,Q=V,V=v}by(D,!0,Q,null,ne,D.lastEffect);break;case\"together\":by(D,!1,null,null,void 0,D.lastEffect);break;default:D.memoizedState=null}return D.child}function qn(v,D,Q){if(v!==null&&(D.dependencies=v.dependencies),Xg|=D.lanes,Q&D.childLanes){if(v!==null&&D.child!==v.child)throw Error(c(153));if(D.child!==null){for(v=D.child,Q=Su(v,v.pendingProps),D.child=Q,Q.return=D;v.sibling!==null;)v=v.sibling,Q=Q.sibling=Su(v,v.pendingProps),Q.return=D;Q.sibling=null}return D.child}return null}function ss(v){v.flags|=4}var kl,Ql,Cu,ha;if(F)kl=function(v,D){for(var Q=D.child;Q!==null;){if(Q.tag===5||Q.tag===6)be(v,Q.stateNode);else if(Q.tag!==4&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}},Ql=function(){},Cu=function(v,D,Q,H,V){if(v=v.memoizedProps,v!==H){var ne=D.stateNode,Se=qa(ur.current);Q=ke(ne,Q,v,H,V,Se),(D.updateQueue=Q)&&ss(D)}},ha=function(v,D,Q,H){Q!==H&&ss(D)};else if(z){kl=function(v,D,Q,H){for(var V=D.child;V!==null;){if(V.tag===5){var ne=V.stateNode;Q&&H&&(ne=TA(ne,V.type,V.memoizedProps,V)),be(v,ne)}else if(V.tag===6)ne=V.stateNode,Q&&H&&(ne=oa(ne,V.memoizedProps,V)),be(v,ne);else if(V.tag!==4){if(V.tag===13&&V.flags&4&&(ne=V.memoizedState!==null)){var Se=V.child;if(Se!==null&&(Se.child!==null&&(Se.child.return=Se,kl(v,Se,!0,ne)),ne=Se.sibling,ne!==null)){ne.return=V,V=ne;continue}}if(V.child!==null){V.child.return=V,V=V.child;continue}}if(V===D)break;for(;V.sibling===null;){if(V.return===null||V.return===D)return;V=V.return}V.sibling.return=V.return,V=V.sibling}};var zA=function(v,D,Q,H){for(var V=D.child;V!==null;){if(V.tag===5){var ne=V.stateNode;Q&&H&&(ne=TA(ne,V.type,V.memoizedProps,V)),au(v,ne)}else if(V.tag===6)ne=V.stateNode,Q&&H&&(ne=oa(ne,V.memoizedProps,V)),au(v,ne);else if(V.tag!==4){if(V.tag===13&&V.flags&4&&(ne=V.memoizedState!==null)){var Se=V.child;if(Se!==null&&(Se.child!==null&&(Se.child.return=Se,zA(v,Se,!0,ne)),ne=Se.sibling,ne!==null)){ne.return=V,V=ne;continue}}if(V.child!==null){V.child.return=V,V=V.child;continue}}if(V===D)break;for(;V.sibling===null;){if(V.return===null||V.return===D)return;V=V.return}V.sibling.return=V.return,V=V.sibling}};Ql=function(v){var D=v.stateNode;if(v.firstEffect!==null){var Q=D.containerInfo,H=ou(Q);zA(H,v,!1,!1),D.pendingChildren=H,ss(v),lu(Q,H)}},Cu=function(v,D,Q,H,V){var ne=v.stateNode,Se=v.memoizedProps;if((v=D.firstEffect===null)&&Se===H)D.stateNode=ne;else{var _e=D.stateNode,pt=qa(ur.current),Wt=null;Se!==H&&(Wt=ke(_e,Q,Se,H,V,pt)),v&&Wt===null?D.stateNode=ne:(ne=ro(ne,Wt,Q,Se,H,D,v,_e),Ve(ne,Q,H,V,pt)&&ss(D),D.stateNode=ne,v?ss(D):kl(ne,D,!1,!1))}},ha=function(v,D,Q,H){Q!==H?(v=qa(yf.current),Q=qa(ur.current),D.stateNode=Ue(H,v,Q,D),ss(D)):D.stateNode=v.stateNode}}else Ql=function(){},Cu=function(){},ha=function(){};function ZA(v,D){if(!Ya)switch(v.tailMode){case\"hidden\":D=v.tail;for(var Q=null;D!==null;)D.alternate!==null&&(Q=D),D=D.sibling;Q===null?v.tail=null:Q.sibling=null;break;case\"collapsed\":Q=v.tail;for(var H=null;Q!==null;)Q.alternate!==null&&(H=Q),Q=Q.sibling;H===null?D||v.tail===null?v.tail=null:v.tail.sibling=null:H.sibling=null}}function HL(v,D,Q){var H=D.pendingProps;switch(D.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Kn(D.type)&&Au(),null;case 3:return du(),Tt(Li),Tt(ji),yu(),H=D.stateNode,H.pendingContext&&(H.context=H.pendingContext,H.pendingContext=null),(v===null||v.child===null)&&(qA(D)?ss(D):H.hydrate||(D.flags|=256)),Ql(D),null;case 5:wt(D);var V=qa(yf.current);if(Q=D.type,v!==null&&D.stateNode!=null)Cu(v,D,Q,H,V),v.ref!==D.ref&&(D.flags|=128);else{if(!H){if(D.stateNode===null)throw Error(c(166));return null}if(v=qa(ur.current),qA(D)){if(!Z)throw Error(c(175));v=Cr(D.stateNode,D.type,D.memoizedProps,V,v,D),D.updateQueue=v,v!==null&&ss(D)}else{var ne=Ne(Q,H,V,v,D);kl(ne,D,!1,!1),D.stateNode=ne,Ve(ne,Q,H,V,v)&&ss(D)}D.ref!==null&&(D.flags|=128)}return null;case 6:if(v&&D.stateNode!=null)ha(v,D,v.memoizedProps,H);else{if(typeof H!=\"string\"&&D.stateNode===null)throw Error(c(166));if(v=qa(yf.current),V=qa(ur.current),qA(D)){if(!Z)throw Error(c(176));pf(D.stateNode,D.memoizedProps,D)&&ss(D)}else D.stateNode=Ue(H,v,V,D)}return null;case 13:return Tt(di),H=D.memoizedState,D.flags&64?(D.lanes=Q,D):(H=H!==null,V=!1,v===null?D.memoizedProps.fallback!==void 0&&qA(D):V=v.memoizedState!==null,H&&!V&&D.mode&2&&(v===null&&D.memoizedProps.unstable_avoidThisFallback!==!0||di.current&1?ws===0&&(ws=3):((ws===0||ws===3)&&(ws=4),so===null||!(Xg&134217727)&&!(Fh&134217727)||Nh(so,Ns))),z&&H&&(D.flags|=4),F&&(H||V)&&(D.flags|=4),null);case 4:return du(),Ql(D),v===null&&Ct(D.stateNode.containerInfo),null;case 10:return Og(D),null;case 17:return Kn(D.type)&&Au(),null;case 19:if(Tt(di),H=D.memoizedState,H===null)return null;if(V=(D.flags&64)!==0,ne=H.rendering,ne===null)if(V)ZA(H,!1);else{if(ws!==0||v!==null&&v.flags&64)for(v=D.child;v!==null;){if(ne=GA(v),ne!==null){for(D.flags|=64,ZA(H,!1),v=ne.updateQueue,v!==null&&(D.updateQueue=v,D.flags|=4),H.lastEffect===null&&(D.firstEffect=null),D.lastEffect=H.lastEffect,v=Q,H=D.child;H!==null;)V=H,Q=v,V.flags&=2,V.nextEffect=null,V.firstEffect=null,V.lastEffect=null,ne=V.alternate,ne===null?(V.childLanes=0,V.lanes=Q,V.child=null,V.memoizedProps=null,V.memoizedState=null,V.updateQueue=null,V.dependencies=null,V.stateNode=null):(V.childLanes=ne.childLanes,V.lanes=ne.lanes,V.child=ne.child,V.memoizedProps=ne.memoizedProps,V.memoizedState=ne.memoizedState,V.updateQueue=ne.updateQueue,V.type=ne.type,Q=ne.dependencies,V.dependencies=Q===null?null:{lanes:Q.lanes,firstContext:Q.firstContext}),H=H.sibling;return xn(di,di.current&1|2),D.child}v=v.sibling}H.tail!==null&&Pt()>m2&&(D.flags|=64,V=!0,ZA(H,!1),D.lanes=33554432)}else{if(!V)if(v=GA(ne),v!==null){if(D.flags|=64,V=!0,v=v.updateQueue,v!==null&&(D.updateQueue=v,D.flags|=4),ZA(H,!0),H.tail===null&&H.tailMode===\"hidden\"&&!ne.alternate&&!Ya)return D=D.lastEffect=H.lastEffect,D!==null&&(D.nextEffect=null),null}else 2*Pt()-H.renderingStartTime>m2&&Q!==1073741824&&(D.flags|=64,V=!0,ZA(H,!1),D.lanes=33554432);H.isBackwards?(ne.sibling=D.child,D.child=ne):(v=H.last,v!==null?v.sibling=ne:D.child=ne,H.last=ne)}return H.tail!==null?(v=H.tail,H.rendering=v,H.tail=v.sibling,H.lastEffect=D.lastEffect,H.renderingStartTime=Pt(),v.sibling=null,D=di.current,xn(di,V?D&1|2:D&1),v):null;case 23:case 24:return B2(),v!==null&&v.memoizedState!==null!=(D.memoizedState!==null)&&H.mode!==\"unstable-defer-without-hiding\"&&(D.flags|=4),null}throw Error(c(156,D.tag))}function jL(v){switch(v.tag){case 1:Kn(v.type)&&Au();var D=v.flags;return D&4096?(v.flags=D&-4097|64,v):null;case 3:if(du(),Tt(Li),Tt(ji),yu(),D=v.flags,D&64)throw Error(c(285));return v.flags=D&-4097|64,v;case 5:return wt(v),null;case 13:return Tt(di),D=v.flags,D&4096?(v.flags=D&-4097|64,v):null;case 19:return Tt(di),null;case 4:return du(),null;case 10:return Og(v),null;case 23:case 24:return B2(),null;default:return null}}function Yg(v,D){try{var Q=\"\",H=D;do Q+=$1(H),H=H.return;while(H);var V=Q}catch(ne){V=`\nError generating stack: `+ne.message+`\n`+ne.stack}return{value:v,source:D,stack:V}}function Vg(v,D){try{console.error(D.value)}catch(Q){setTimeout(function(){throw Q})}}var qL=typeof WeakMap==\"function\"?WeakMap:Map;function i2(v,D,Q){Q=Dl(-1,Q),Q.tag=3,Q.payload={element:null};var H=D.value;return Q.callback=function(){_y||(_y=!0,y2=H),Vg(v,D)},Q}function Jg(v,D,Q){Q=Dl(-1,Q),Q.tag=3;var H=v.type.getDerivedStateFromError;if(typeof H==\"function\"){var V=D.value;Q.payload=function(){return Vg(v,D),H(V)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch==\"function\"&&(Q.callback=function(){typeof H!=\"function\"&&(hc===null?hc=new Set([this]):hc.add(this),Vg(v,D));var Se=D.stack;this.componentDidCatch(D.value,{componentStack:Se!==null?Se:\"\"})}),Q}var WL=typeof WeakSet==\"function\"?WeakSet:Set;function s2(v){var D=v.ref;if(D!==null)if(typeof D==\"function\")try{D(null)}catch(Q){xf(v,Q)}else D.current=null}function xy(v,D){switch(D.tag){case 0:case 11:case 15:case 22:return;case 1:if(D.flags&256&&v!==null){var Q=v.memoizedProps,H=v.memoizedState;v=D.stateNode,D=v.getSnapshotBeforeUpdate(D.elementType===D.type?Q:So(D.type,Q),H),v.__reactInternalSnapshotBeforeUpdate=D}return;case 3:F&&D.flags&256&&Rs(D.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(c(163))}function Rh(v,D){if(D=D.updateQueue,D=D!==null?D.lastEffect:null,D!==null){var Q=D=D.next;do{if((Q.tag&v)===v){var H=Q.destroy;Q.destroy=void 0,H!==void 0&&H()}Q=Q.next}while(Q!==D)}}function ub(v,D,Q){switch(Q.tag){case 0:case 11:case 15:case 22:if(D=Q.updateQueue,D=D!==null?D.lastEffect:null,D!==null){v=D=D.next;do{if((v.tag&3)===3){var H=v.create;v.destroy=H()}v=v.next}while(v!==D)}if(D=Q.updateQueue,D=D!==null?D.lastEffect:null,D!==null){v=D=D.next;do{var V=v;H=V.next,V=V.tag,V&4&&V&1&&(vb(Q,v),eM(Q,v)),v=H}while(v!==D)}return;case 1:v=Q.stateNode,Q.flags&4&&(D===null?v.componentDidMount():(H=Q.elementType===Q.type?D.memoizedProps:So(Q.type,D.memoizedProps),v.componentDidUpdate(H,D.memoizedState,v.__reactInternalSnapshotBeforeUpdate))),D=Q.updateQueue,D!==null&&Cy(Q,D,v);return;case 3:if(D=Q.updateQueue,D!==null){if(v=null,Q.child!==null)switch(Q.child.tag){case 5:v=Te(Q.child.stateNode);break;case 1:v=Q.child.stateNode}Cy(Q,D,v)}return;case 5:v=Q.stateNode,D===null&&Q.flags&4&&$s(v,Q.type,Q.memoizedProps,Q);return;case 6:return;case 4:return;case 12:return;case 13:Z&&Q.memoizedState===null&&(Q=Q.alternate,Q!==null&&(Q=Q.memoizedState,Q!==null&&(Q=Q.dehydrated,Q!==null&&uu(Q))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(c(163))}function fb(v,D){if(F)for(var Q=v;;){if(Q.tag===5){var H=Q.stateNode;D?dh(H):to(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)H=Q.stateNode,D?mh(H):jn(H,Q.memoizedProps);else if((Q.tag!==23&&Q.tag!==24||Q.memoizedState===null||Q===v)&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===v)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===v)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}}function ky(v,D){if(Ua&&typeof Ua.onCommitFiberUnmount==\"function\")try{Ua.onCommitFiberUnmount($e,D)}catch{}switch(D.tag){case 0:case 11:case 14:case 15:case 22:if(v=D.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var Q=v=v.next;do{var H=Q,V=H.destroy;if(H=H.tag,V!==void 0)if(H&4)vb(D,Q);else{H=D;try{V()}catch(ne){xf(H,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(s2(D),v=D.stateNode,typeof v.componentWillUnmount==\"function\")try{v.props=D.memoizedProps,v.state=D.memoizedState,v.componentWillUnmount()}catch(ne){xf(D,ne)}break;case 5:s2(D);break;case 4:F?gb(v,D):z&&z&&(D=D.stateNode.containerInfo,v=ou(D),RA(D,v))}}function Ab(v,D){for(var Q=D;;)if(ky(v,Q),Q.child===null||F&&Q.tag===4){if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}else Q.child.return=Q,Q=Q.child}function Qy(v){v.alternate=null,v.child=null,v.dependencies=null,v.firstEffect=null,v.lastEffect=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.return=null,v.updateQueue=null}function pb(v){return v.tag===5||v.tag===3||v.tag===4}function hb(v){if(F){e:{for(var D=v.return;D!==null;){if(pb(D))break e;D=D.return}throw Error(c(160))}var Q=D;switch(D=Q.stateNode,Q.tag){case 5:var H=!1;break;case 3:D=D.containerInfo,H=!0;break;case 4:D=D.containerInfo,H=!0;break;default:throw Error(c(161))}Q.flags&16&&(Af(D),Q.flags&=-17);e:t:for(Q=v;;){for(;Q.sibling===null;){if(Q.return===null||pb(Q.return)){Q=null;break e}Q=Q.return}for(Q.sibling.return=Q.return,Q=Q.sibling;Q.tag!==5&&Q.tag!==6&&Q.tag!==18;){if(Q.flags&2||Q.child===null||Q.tag===4)continue t;Q.child.return=Q,Q=Q.child}if(!(Q.flags&2)){Q=Q.stateNode;break e}}H?o2(v,Q,D):a2(v,Q,D)}}function o2(v,D,Q){var H=v.tag,V=H===5||H===6;if(V)v=V?v.stateNode:v.stateNode.instance,D?eo(Q,v,D):Io(Q,v);else if(H!==4&&(v=v.child,v!==null))for(o2(v,D,Q),v=v.sibling;v!==null;)o2(v,D,Q),v=v.sibling}function a2(v,D,Q){var H=v.tag,V=H===5||H===6;if(V)v=V?v.stateNode:v.stateNode.instance,D?Hi(Q,v,D):ai(Q,v);else if(H!==4&&(v=v.child,v!==null))for(a2(v,D,Q),v=v.sibling;v!==null;)a2(v,D,Q),v=v.sibling}function gb(v,D){for(var Q=D,H=!1,V,ne;;){if(!H){H=Q.return;e:for(;;){if(H===null)throw Error(c(160));switch(V=H.stateNode,H.tag){case 5:ne=!1;break e;case 3:V=V.containerInfo,ne=!0;break e;case 4:V=V.containerInfo,ne=!0;break e}H=H.return}H=!0}if(Q.tag===5||Q.tag===6)Ab(v,Q),ne?QA(V,Q.stateNode):wo(V,Q.stateNode);else if(Q.tag===4){if(Q.child!==null){V=Q.stateNode.containerInfo,ne=!0,Q.child.return=Q,Q=Q.child;continue}}else if(ky(v,Q),Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return,Q.tag===4&&(H=!1)}Q.sibling.return=Q.return,Q=Q.sibling}}function l2(v,D){if(F){switch(D.tag){case 0:case 11:case 14:case 15:case 22:Rh(3,D);return;case 1:return;case 5:var Q=D.stateNode;if(Q!=null){var H=D.memoizedProps;v=v!==null?v.memoizedProps:H;var V=D.type,ne=D.updateQueue;D.updateQueue=null,ne!==null&&Co(Q,ne,V,v,H,D)}return;case 6:if(D.stateNode===null)throw Error(c(162));Q=D.memoizedProps,ts(D.stateNode,v!==null?v.memoizedProps:Q,Q);return;case 3:Z&&(D=D.stateNode,D.hydrate&&(D.hydrate=!1,OA(D.containerInfo)));return;case 12:return;case 13:db(D),Kg(D);return;case 19:Kg(D);return;case 17:return;case 23:case 24:fb(D,D.memoizedState!==null);return}throw Error(c(163))}switch(D.tag){case 0:case 11:case 14:case 15:case 22:Rh(3,D);return;case 12:return;case 13:db(D),Kg(D);return;case 19:Kg(D);return;case 3:Z&&(Q=D.stateNode,Q.hydrate&&(Q.hydrate=!1,OA(Q.containerInfo)));break;case 23:case 24:return}e:if(z){switch(D.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:D=D.stateNode,RA(D.containerInfo,D.pendingChildren);break e}throw Error(c(163))}}function db(v){v.memoizedState!==null&&(d2=Pt(),F&&fb(v.child,!0))}function Kg(v){var D=v.updateQueue;if(D!==null){v.updateQueue=null;var Q=v.stateNode;Q===null&&(Q=v.stateNode=new WL),D.forEach(function(H){var V=rM.bind(null,v,H);Q.has(H)||(Q.add(H),H.then(V,V))})}}function YL(v,D){return v!==null&&(v=v.memoizedState,v===null||v.dehydrated!==null)?(D=D.memoizedState,D!==null&&D.dehydrated===null):!1}var Ry=0,Ty=1,Fy=2,zg=3,Ny=4;if(typeof Symbol==\"function\"&&Symbol.for){var Zg=Symbol.for;Ry=Zg(\"selector.component\"),Ty=Zg(\"selector.has_pseudo_class\"),Fy=Zg(\"selector.role\"),zg=Zg(\"selector.test_id\"),Ny=Zg(\"selector.text\")}function Oy(v){var D=$(v);if(D!=null){if(typeof D.memoizedProps[\"data-testname\"]!=\"string\")throw Error(c(364));return D}if(v=ir(v),v===null)throw Error(c(362));return v.stateNode.current}function Sf(v,D){switch(D.$$typeof){case Ry:if(v.type===D.value)return!0;break;case Ty:e:{D=D.value,v=[v,0];for(var Q=0;Q<v.length;){var H=v[Q++],V=v[Q++],ne=D[V];if(H.tag!==5||!br(H)){for(;ne!=null&&Sf(H,ne);)V++,ne=D[V];if(V===D.length){D=!0;break e}else for(H=H.child;H!==null;)v.push(H,V),H=H.sibling}}D=!1}return D;case Fy:if(v.tag===5&&Ir(v.stateNode,D.value))return!0;break;case Ny:if((v.tag===5||v.tag===6)&&(v=gn(v),v!==null&&0<=v.indexOf(D.value)))return!0;break;case zg:if(v.tag===5&&(v=v.memoizedProps[\"data-testname\"],typeof v==\"string\"&&v.toLowerCase()===D.value.toLowerCase()))return!0;break;default:throw Error(c(365,D))}return!1}function Df(v){switch(v.$$typeof){case Ry:return\"<\"+(g(v.value)||\"Unknown\")+\">\";case Ty:return\":has(\"+(Df(v)||\"\")+\")\";case Fy:return'[role=\"'+v.value+'\"]';case Ny:return'\"'+v.value+'\"';case zg:return'[data-testname=\"'+v.value+'\"]';default:throw Error(c(365,v))}}function c2(v,D){var Q=[];v=[v,0];for(var H=0;H<v.length;){var V=v[H++],ne=v[H++],Se=D[ne];if(V.tag!==5||!br(V)){for(;Se!=null&&Sf(V,Se);)ne++,Se=D[ne];if(ne===D.length)Q.push(V);else for(V=V.child;V!==null;)v.push(V,ne),V=V.sibling}}return Q}function u2(v,D){if(!qt)throw Error(c(363));v=Oy(v),v=c2(v,D),D=[],v=Array.from(v);for(var Q=0;Q<v.length;){var H=v[Q++];if(H.tag===5)br(H)||D.push(H.stateNode);else for(H=H.child;H!==null;)v.push(H),H=H.sibling}return D}var Ly=null;function VL(v){if(Ly===null)try{var D=(\"require\"+Math.random()).slice(0,7);Ly=(jS&&jS[D]).call(jS,\"timers\").setImmediate}catch{Ly=function(H){var V=new MessageChannel;V.port1.onmessage=H,V.port2.postMessage(void 0)}}return Ly(v)}var JL=Math.ceil,My=f.ReactCurrentDispatcher,f2=f.ReactCurrentOwner,A2=f.IsSomeRendererActing,xr=0,so=null,zi=null,Ns=0,XA=0,p2=no(0),ws=0,Uy=null,Th=0,Xg=0,Fh=0,h2=0,g2=null,d2=0,m2=1/0;function Pf(){m2=Pt()+500}var sr=null,_y=!1,y2=null,hc=null,bf=!1,$g=null,ed=90,E2=[],I2=[],wu=null,td=0,C2=null,Hy=-1,Bu=0,jy=0,rd=null,nd=!1;function ko(){return xr&48?Pt():Hy!==-1?Hy:Hy=Pt()}function Bs(v){if(v=v.mode,!(v&2))return 1;if(!(v&4))return tr()===99?1:2;if(Bu===0&&(Bu=Th),my.transition!==0){jy!==0&&(jy=g2!==null?g2.pendingLanes:0),v=Bu;var D=4186112&~jy;return D&=-D,D===0&&(v=4186112&~v,D=v&-v,D===0&&(D=8192)),D}return v=tr(),xr&4&&v===98?v=Mt(12,Bu):(v=LA(v),v=Mt(v,Bu)),v}function Rl(v,D,Q){if(50<td)throw td=0,C2=null,Error(c(185));if(v=Gy(v,D),v===null)return null;Ha(v,D,Q),v===so&&(Fh|=D,ws===4&&Nh(v,Ns));var H=tr();D===1?xr&8&&!(xr&48)?w2(v):(ga(v,Q),xr===0&&(Pf(),Rn())):(!(xr&4)||H!==98&&H!==99||(wu===null?wu=new Set([v]):wu.add(v)),ga(v,Q)),g2=v}function Gy(v,D){v.lanes|=D;var Q=v.alternate;for(Q!==null&&(Q.lanes|=D),Q=v,v=v.return;v!==null;)v.childLanes|=D,Q=v.alternate,Q!==null&&(Q.childLanes|=D),Q=v,v=v.return;return Q.tag===3?Q.stateNode:null}function ga(v,D){for(var Q=v.callbackNode,H=v.suspendedLanes,V=v.pingedLanes,ne=v.expirationTimes,Se=v.pendingLanes;0<Se;){var _e=31-rs(Se),pt=1<<_e,Wt=ne[_e];if(Wt===-1){if(!(pt&H)||pt&V){Wt=D,ca(pt);var Sr=wn;ne[_e]=10<=Sr?Wt+250:6<=Sr?Wt+5e3:-1}}else Wt<=D&&(v.expiredLanes|=pt);Se&=~pt}if(H=ua(v,v===so?Ns:0),D=wn,H===0)Q!==null&&(Q!==lr&&Is(Q),v.callbackNode=null,v.callbackPriority=0);else{if(Q!==null){if(v.callbackPriority===D)return;Q!==lr&&Is(Q)}D===15?(Q=w2.bind(null,v),Ee===null?(Ee=[Q],Oe=Mi(Qn,Ga)):Ee.push(Q),Q=lr):D===14?Q=Gi(99,w2.bind(null,v)):(Q=MA(D),Q=Gi(Q,mb.bind(null,v))),v.callbackPriority=D,v.callbackNode=Q}}function mb(v){if(Hy=-1,jy=Bu=0,xr&48)throw Error(c(327));var D=v.callbackNode;if(vu()&&v.callbackNode!==D)return null;var Q=ua(v,v===so?Ns:0);if(Q===0)return null;var H=Q,V=xr;xr|=16;var ne=Cb();(so!==v||Ns!==H)&&(Pf(),Oh(v,H));do try{ZL();break}catch(_e){Ib(v,_e)}while(!0);if(Fg(),My.current=ne,xr=V,zi!==null?H=0:(so=null,Ns=0,H=ws),Th&Fh)Oh(v,0);else if(H!==0){if(H===2&&(xr|=64,v.hydrate&&(v.hydrate=!1,Rs(v.containerInfo)),Q=Bl(v),Q!==0&&(H=id(v,Q))),H===1)throw D=Uy,Oh(v,0),Nh(v,Q),ga(v,Pt()),D;switch(v.finishedWork=v.current.alternate,v.finishedLanes=Q,H){case 0:case 1:throw Error(c(345));case 2:$A(v);break;case 3:if(Nh(v,Q),(Q&62914560)===Q&&(H=d2+500-Pt(),10<H)){if(ua(v,0)!==0)break;if(V=v.suspendedLanes,(V&Q)!==Q){ko(),v.pingedLanes|=v.suspendedLanes&V;break}v.timeoutHandle=x($A.bind(null,v),H);break}$A(v);break;case 4:if(Nh(v,Q),(Q&4186112)===Q)break;for(H=v.eventTimes,V=-1;0<Q;){var Se=31-rs(Q);ne=1<<Se,Se=H[Se],Se>V&&(V=Se),Q&=~ne}if(Q=V,Q=Pt()-Q,Q=(120>Q?120:480>Q?480:1080>Q?1080:1920>Q?1920:3e3>Q?3e3:4320>Q?4320:1960*JL(Q/1960))-Q,10<Q){v.timeoutHandle=x($A.bind(null,v),Q);break}$A(v);break;case 5:$A(v);break;default:throw Error(c(329))}}return ga(v,Pt()),v.callbackNode===D?mb.bind(null,v):null}function Nh(v,D){for(D&=~h2,D&=~Fh,v.suspendedLanes|=D,v.pingedLanes&=~D,v=v.expirationTimes;0<D;){var Q=31-rs(D),H=1<<Q;v[Q]=-1,D&=~H}}function w2(v){if(xr&48)throw Error(c(327));if(vu(),v===so&&v.expiredLanes&Ns){var D=Ns,Q=id(v,D);Th&Fh&&(D=ua(v,D),Q=id(v,D))}else D=ua(v,0),Q=id(v,D);if(v.tag!==0&&Q===2&&(xr|=64,v.hydrate&&(v.hydrate=!1,Rs(v.containerInfo)),D=Bl(v),D!==0&&(Q=id(v,D))),Q===1)throw Q=Uy,Oh(v,0),Nh(v,D),ga(v,Pt()),Q;return v.finishedWork=v.current.alternate,v.finishedLanes=D,$A(v),ga(v,Pt()),null}function KL(){if(wu!==null){var v=wu;wu=null,v.forEach(function(D){D.expiredLanes|=24&D.pendingLanes,ga(D,Pt())})}Rn()}function yb(v,D){var Q=xr;xr|=1;try{return v(D)}finally{xr=Q,xr===0&&(Pf(),Rn())}}function Eb(v,D){var Q=xr;if(Q&48)return v(D);xr|=1;try{if(v)return li(99,v.bind(null,D))}finally{xr=Q,Rn()}}function qy(v,D){xn(p2,XA),XA|=D,Th|=D}function B2(){XA=p2.current,Tt(p2)}function Oh(v,D){v.finishedWork=null,v.finishedLanes=0;var Q=v.timeoutHandle;if(Q!==P&&(v.timeoutHandle=P,w(Q)),zi!==null)for(Q=zi.return;Q!==null;){var H=Q;switch(H.tag){case 1:H=H.type.childContextTypes,H!=null&&Au();break;case 3:du(),Tt(Li),Tt(ji),yu();break;case 5:wt(H);break;case 4:du();break;case 13:Tt(di);break;case 19:Tt(di);break;case 10:Og(H);break;case 23:case 24:B2()}Q=Q.return}so=v,zi=Su(v.current,null),Ns=XA=Th=D,ws=0,Uy=null,h2=Fh=Xg=0}function Ib(v,D){do{var Q=zi;try{if(Fg(),If.current=kt,WA){for(var H=Gn.memoizedState;H!==null;){var V=H.queue;V!==null&&(V.pending=null),H=H.next}WA=!1}if(Eu=0,bi=ns=Gn=null,Cf=!1,f2.current=null,Q===null||Q.return===null){ws=1,Uy=D,zi=null;break}e:{var ne=v,Se=Q.return,_e=Q,pt=D;if(D=Ns,_e.flags|=2048,_e.firstEffect=_e.lastEffect=null,pt!==null&&typeof pt==\"object\"&&typeof pt.then==\"function\"){var Wt=pt;if(!(_e.mode&2)){var Sr=_e.alternate;Sr?(_e.updateQueue=Sr.updateQueue,_e.memoizedState=Sr.memoizedState,_e.lanes=Sr.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Lr=(di.current&1)!==0,Xt=Se;do{var zn;if(zn=Xt.tag===13){var yi=Xt.memoizedState;if(yi!==null)zn=yi.dehydrated!==null;else{var za=Xt.memoizedProps;zn=za.fallback===void 0?!1:za.unstable_avoidThisFallback!==!0?!0:!Lr}}if(zn){var et=Xt.updateQueue;if(et===null){var qe=new Set;qe.add(Wt),Xt.updateQueue=qe}else et.add(Wt);if(!(Xt.mode&2)){if(Xt.flags|=64,_e.flags|=16384,_e.flags&=-2981,_e.tag===1)if(_e.alternate===null)_e.tag=17;else{var gt=Dl(-1,1);gt.tag=2,Pl(_e,gt)}_e.lanes|=1;break e}pt=void 0,_e=D;var Zt=ne.pingCache;if(Zt===null?(Zt=ne.pingCache=new qL,pt=new Set,Zt.set(Wt,pt)):(pt=Zt.get(Wt),pt===void 0&&(pt=new Set,Zt.set(Wt,pt))),!pt.has(_e)){pt.add(_e);var Dr=Db.bind(null,ne,Wt,_e);Wt.then(Dr,Dr)}Xt.flags|=4096,Xt.lanes=D;break e}Xt=Xt.return}while(Xt!==null);pt=Error((g(_e.type)||\"A React component\")+` suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}ws!==5&&(ws=2),pt=Yg(pt,_e),Xt=Se;do{switch(Xt.tag){case 3:ne=pt,Xt.flags|=4096,D&=-D,Xt.lanes|=D;var Xn=i2(Xt,ne,D);Iy(Xt,Xn);break e;case 1:ne=pt;var kr=Xt.type,Tn=Xt.stateNode;if(!(Xt.flags&64)&&(typeof kr.getDerivedStateFromError==\"function\"||Tn!==null&&typeof Tn.componentDidCatch==\"function\"&&(hc===null||!hc.has(Tn)))){Xt.flags|=4096,D&=-D,Xt.lanes|=D;var _n=Jg(Xt,ne,D);Iy(Xt,_n);break e}}Xt=Xt.return}while(Xt!==null)}Bb(Q)}catch(zr){D=zr,zi===Q&&Q!==null&&(zi=Q=Q.return);continue}break}while(!0)}function Cb(){var v=My.current;return My.current=kt,v===null?kt:v}function id(v,D){var Q=xr;xr|=16;var H=Cb();so===v&&Ns===D||Oh(v,D);do try{zL();break}catch(V){Ib(v,V)}while(!0);if(Fg(),xr=Q,My.current=H,zi!==null)throw Error(c(261));return so=null,Ns=0,ws}function zL(){for(;zi!==null;)wb(zi)}function ZL(){for(;zi!==null&&!vl();)wb(zi)}function wb(v){var D=Pb(v.alternate,v,XA);v.memoizedProps=v.pendingProps,D===null?Bb(v):zi=D,f2.current=null}function Bb(v){var D=v;do{var Q=D.alternate;if(v=D.return,D.flags&2048){if(Q=jL(D),Q!==null){Q.flags&=2047,zi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=HL(Q,D,XA),Q!==null){zi=Q;return}if(Q=D,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||XA&1073741824||!(Q.mode&4)){for(var H=0,V=Q.child;V!==null;)H|=V.lanes|V.childLanes,V=V.sibling;Q.childLanes=H}v!==null&&!(v.flags&2048)&&(v.firstEffect===null&&(v.firstEffect=D.firstEffect),D.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=D.firstEffect),v.lastEffect=D.lastEffect),1<D.flags&&(v.lastEffect!==null?v.lastEffect.nextEffect=D:v.firstEffect=D,v.lastEffect=D))}if(D=D.sibling,D!==null){zi=D;return}zi=D=v}while(D!==null);ws===0&&(ws=5)}function $A(v){var D=tr();return li(99,XL.bind(null,v,D)),null}function XL(v,D){do vu();while($g!==null);if(xr&48)throw Error(c(327));var Q=v.finishedWork;if(Q===null)return null;if(v.finishedWork=null,v.finishedLanes=0,Q===v.current)throw Error(c(177));v.callbackNode=null;var H=Q.lanes|Q.childLanes,V=H,ne=v.pendingLanes&~V;v.pendingLanes=V,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=V,v.mutableReadLanes&=V,v.entangledLanes&=V,V=v.entanglements;for(var Se=v.eventTimes,_e=v.expirationTimes;0<ne;){var pt=31-rs(ne),Wt=1<<pt;V[pt]=0,Se[pt]=-1,_e[pt]=-1,ne&=~Wt}if(wu!==null&&!(H&24)&&wu.has(v)&&wu.delete(v),v===so&&(zi=so=null,Ns=0),1<Q.flags?Q.lastEffect!==null?(Q.lastEffect.nextEffect=Q,H=Q.firstEffect):H=Q:H=Q.firstEffect,H!==null){V=xr,xr|=32,f2.current=null,rd=rt(v.containerInfo),nd=!1,sr=H;do try{$L()}catch(qe){if(sr===null)throw Error(c(330));xf(sr,qe),sr=sr.nextEffect}while(sr!==null);rd=null,sr=H;do try{for(Se=v;sr!==null;){var Sr=sr.flags;if(Sr&16&&F&&Af(sr.stateNode),Sr&128){var Lr=sr.alternate;if(Lr!==null){var Xt=Lr.ref;Xt!==null&&(typeof Xt==\"function\"?Xt(null):Xt.current=null)}}switch(Sr&1038){case 2:hb(sr),sr.flags&=-3;break;case 6:hb(sr),sr.flags&=-3,l2(sr.alternate,sr);break;case 1024:sr.flags&=-1025;break;case 1028:sr.flags&=-1025,l2(sr.alternate,sr);break;case 4:l2(sr.alternate,sr);break;case 8:_e=Se,ne=sr,F?gb(_e,ne):Ab(_e,ne);var zn=ne.alternate;Qy(ne),zn!==null&&Qy(zn)}sr=sr.nextEffect}}catch(qe){if(sr===null)throw Error(c(330));xf(sr,qe),sr=sr.nextEffect}while(sr!==null);nd&&lt(),Fe(v.containerInfo),v.current=Q,sr=H;do try{for(Sr=v;sr!==null;){var yi=sr.flags;if(yi&36&&ub(Sr,sr.alternate,sr),yi&128){Lr=void 0;var za=sr.ref;if(za!==null){var et=sr.stateNode;switch(sr.tag){case 5:Lr=Te(et);break;default:Lr=et}typeof za==\"function\"?za(Lr):za.current=Lr}}sr=sr.nextEffect}}catch(qe){if(sr===null)throw Error(c(330));xf(sr,qe),sr=sr.nextEffect}while(sr!==null);sr=null,te(),xr=V}else v.current=Q;if(bf)bf=!1,$g=v,ed=D;else for(sr=H;sr!==null;)D=sr.nextEffect,sr.nextEffect=null,sr.flags&8&&(yi=sr,yi.sibling=null,yi.stateNode=null),sr=D;if(H=v.pendingLanes,H===0&&(hc=null),H===1?v===C2?td++:(td=0,C2=v):td=0,Q=Q.stateNode,Ua&&typeof Ua.onCommitFiberRoot==\"function\")try{Ua.onCommitFiberRoot($e,Q,void 0,(Q.current.flags&64)===64)}catch{}if(ga(v,Pt()),_y)throw _y=!1,v=y2,y2=null,v;return xr&8||Rn(),null}function $L(){for(;sr!==null;){var v=sr.alternate;nd||rd===null||(sr.flags&8?De(sr,rd)&&(nd=!0,Re()):sr.tag===13&&YL(v,sr)&&De(sr,rd)&&(nd=!0,Re()));var D=sr.flags;D&256&&xy(v,sr),!(D&512)||bf||(bf=!0,Gi(97,function(){return vu(),null})),sr=sr.nextEffect}}function vu(){if(ed!==90){var v=97<ed?97:ed;return ed=90,li(v,tM)}return!1}function eM(v,D){E2.push(D,v),bf||(bf=!0,Gi(97,function(){return vu(),null}))}function vb(v,D){I2.push(D,v),bf||(bf=!0,Gi(97,function(){return vu(),null}))}function tM(){if($g===null)return!1;var v=$g;if($g=null,xr&48)throw Error(c(331));var D=xr;xr|=32;var Q=I2;I2=[];for(var H=0;H<Q.length;H+=2){var V=Q[H],ne=Q[H+1],Se=V.destroy;if(V.destroy=void 0,typeof Se==\"function\")try{Se()}catch(pt){if(ne===null)throw Error(c(330));xf(ne,pt)}}for(Q=E2,E2=[],H=0;H<Q.length;H+=2){V=Q[H],ne=Q[H+1];try{var _e=V.create;V.destroy=_e()}catch(pt){if(ne===null)throw Error(c(330));xf(ne,pt)}}for(_e=v.current.firstEffect;_e!==null;)v=_e.nextEffect,_e.nextEffect=null,_e.flags&8&&(_e.sibling=null,_e.stateNode=null),_e=v;return xr=D,Rn(),!0}function Sb(v,D,Q){D=Yg(Q,D),D=i2(v,D,1),Pl(v,D),D=ko(),v=Gy(v,1),v!==null&&(Ha(v,1,D),ga(v,D))}function xf(v,D){if(v.tag===3)Sb(v,v,D);else for(var Q=v.return;Q!==null;){if(Q.tag===3){Sb(Q,v,D);break}else if(Q.tag===1){var H=Q.stateNode;if(typeof Q.type.getDerivedStateFromError==\"function\"||typeof H.componentDidCatch==\"function\"&&(hc===null||!hc.has(H))){v=Yg(D,v);var V=Jg(Q,v,1);if(Pl(Q,V),V=ko(),Q=Gy(Q,1),Q!==null)Ha(Q,1,V),ga(Q,V);else if(typeof H.componentDidCatch==\"function\"&&(hc===null||!hc.has(H)))try{H.componentDidCatch(D,v)}catch{}break}}Q=Q.return}}function Db(v,D,Q){var H=v.pingCache;H!==null&&H.delete(D),D=ko(),v.pingedLanes|=v.suspendedLanes&Q,so===v&&(Ns&Q)===Q&&(ws===4||ws===3&&(Ns&62914560)===Ns&&500>Pt()-d2?Oh(v,0):h2|=Q),ga(v,D)}function rM(v,D){var Q=v.stateNode;Q!==null&&Q.delete(D),D=0,D===0&&(D=v.mode,D&2?D&4?(Bu===0&&(Bu=Th),D=kn(62914560&~Bu),D===0&&(D=4194304)):D=tr()===99?1:2:D=1),Q=ko(),v=Gy(v,D),v!==null&&(Ha(v,D,Q),ga(v,Q))}var Pb;Pb=function(v,D,Q){var H=D.lanes;if(v!==null)if(v.memoizedProps!==D.pendingProps||Li.current)Je=!0;else if(Q&H)Je=!!(v.flags&16384);else{switch(Je=!1,D.tag){case 3:Py(D),jg();break;case 5:Ef(D);break;case 1:Kn(D.type)&&La(D);break;case 4:Ug(D,D.stateNode.containerInfo);break;case 10:Ng(D,D.memoizedProps.value);break;case 13:if(D.memoizedState!==null)return Q&D.child.childLanes?r2(v,D,Q):(xn(di,di.current&1),D=qn(v,D,Q),D!==null?D.sibling:null);xn(di,di.current&1);break;case 19:if(H=(Q&D.childLanes)!==0,v.flags&64){if(H)return lb(v,D,Q);D.flags|=64}var V=D.memoizedState;if(V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),xn(di,di.current),H)break;return null;case 23:case 24:return D.lanes=0,mi(v,D,Q)}return qn(v,D,Q)}else Je=!1;switch(D.lanes=0,D.tag){case 2:if(H=D.type,v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),v=D.pendingProps,V=dn(D,ji.current),df(D,Q),V=qg(null,D,H,v,V,Q),D.flags|=1,typeof V==\"object\"&&V!==null&&typeof V.render==\"function\"&&V.$$typeof===void 0){if(D.tag=1,D.memoizedState=null,D.updateQueue=null,Kn(H)){var ne=!0;La(D)}else ne=!1;D.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,Bh(D);var Se=H.getDerivedStateFromProps;typeof Se==\"function\"&&_A(D,H,Se,v),V.updater=HA,D.stateNode=V,V._reactInternals=D,Po(D,H,v,Q),D=t2(null,D,H,!0,ne,Q)}else D.tag=0,At(null,D,V,Q),D=D.child;return D;case 16:V=D.elementType;e:{switch(v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),v=D.pendingProps,ne=V._init,V=ne(V._payload),D.type=V,ne=D.tag=iM(V),v=So(V,v),ne){case 0:D=JA(null,D,V,v,Q);break e;case 1:D=ab(null,D,V,v,Q);break e;case 11:D=dr(null,D,V,v,Q);break e;case 14:D=vr(null,D,V,So(V.type,v),H,Q);break e}throw Error(c(306,V,\"\"))}return D;case 0:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),JA(v,D,H,V,Q);case 1:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),ab(v,D,H,V,Q);case 3:if(Py(D),H=D.updateQueue,v===null||H===null)throw Error(c(282));if(H=D.pendingProps,V=D.memoizedState,V=V!==null?V.element:null,Lg(v,D),UA(D,H,null,Q),H=D.memoizedState.element,H===V)jg(),D=qn(v,D,Q);else{if(V=D.stateNode,(ne=V.hydrate)&&(Z?(Aa=cu(D.stateNode.containerInfo),Wa=D,ne=Ya=!0):ne=!1),ne){if(Z&&(v=V.mutableSourceEagerHydrationData,v!=null))for(V=0;V<v.length;V+=2)ne=v[V],Se=v[V+1],y?ne._workInProgressVersionPrimary=Se:ne._workInProgressVersionSecondary=Se,mu.push(ne);for(Q=e2(D,null,H,Q),D.child=Q;Q;)Q.flags=Q.flags&-3|1024,Q=Q.sibling}else At(v,D,H,Q),jg();D=D.child}return D;case 5:return Ef(D),v===null&&Hg(D),H=D.type,V=D.pendingProps,ne=v!==null?v.memoizedProps:null,Se=V.children,it(H,V)?Se=null:ne!==null&&it(H,ne)&&(D.flags|=16),Cs(v,D),At(v,D,Se,Q),D.child;case 6:return v===null&&Hg(D),null;case 13:return r2(v,D,Q);case 4:return Ug(D,D.stateNode.containerInfo),H=D.pendingProps,v===null?D.child=Mg(D,null,H,Q):At(v,D,H,Q),D.child;case 11:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),dr(v,D,H,V,Q);case 7:return At(v,D,D.pendingProps,Q),D.child;case 8:return At(v,D,D.pendingProps.children,Q),D.child;case 12:return At(v,D,D.pendingProps.children,Q),D.child;case 10:e:{if(H=D.type._context,V=D.pendingProps,Se=D.memoizedProps,ne=V.value,Ng(D,ne),Se!==null){var _e=Se.value;if(ne=vo(_e,ne)?0:(typeof H._calculateChangedBits==\"function\"?H._calculateChangedBits(_e,ne):1073741823)|0,ne===0){if(Se.children===V.children&&!Li.current){D=qn(v,D,Q);break e}}else for(_e=D.child,_e!==null&&(_e.return=D);_e!==null;){var pt=_e.dependencies;if(pt!==null){Se=_e.child;for(var Wt=pt.firstContext;Wt!==null;){if(Wt.context===H&&Wt.observedBits&ne){_e.tag===1&&(Wt=Dl(-1,Q&-Q),Wt.tag=2,Pl(_e,Wt)),_e.lanes|=Q,Wt=_e.alternate,Wt!==null&&(Wt.lanes|=Q),Ey(_e.return,Q),pt.lanes|=Q;break}Wt=Wt.next}}else Se=_e.tag===10&&_e.type===D.type?null:_e.child;if(Se!==null)Se.return=_e;else for(Se=_e;Se!==null;){if(Se===D){Se=null;break}if(_e=Se.sibling,_e!==null){_e.return=Se.return,Se=_e;break}Se=Se.return}_e=Se}}At(v,D,V.children,Q),D=D.child}return D;case 9:return V=D.type,ne=D.pendingProps,H=ne.children,df(D,Q),V=Do(V,ne.unstable_observedBits),H=H(V),D.flags|=1,At(v,D,H,Q),D.child;case 14:return V=D.type,ne=So(V,D.pendingProps),ne=So(V.type,ne),vr(v,D,V,ne,H,Q);case 15:return Un(v,D,D.type,D.pendingProps,H,Q);case 17:return H=D.type,V=D.pendingProps,V=D.elementType===H?V:So(H,V),v!==null&&(v.alternate=null,D.alternate=null,D.flags|=2),D.tag=1,Kn(H)?(v=!0,La(D)):v=!1,df(D,Q),xt(D,H,V),Po(D,H,V,Q),t2(null,D,H,!0,v,Q);case 19:return lb(v,D,Q);case 23:return mi(v,D,Q);case 24:return mi(v,D,Q)}throw Error(c(156,D.tag))};var Wy={current:!1},Os=n.unstable_flushAllWithoutAsserting,bb=typeof Os==\"function\";function v2(){if(Os!==void 0)return Os();for(var v=!1;vu();)v=!0;return v}function da(v){try{v2(),VL(function(){v2()?da(v):v()})}catch(D){v(D)}}var Ja=0,Yy=!1;function nM(v,D,Q,H){this.tag=v,this.key=Q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=D,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=H,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Ka(v,D,Q,H){return new nM(v,D,Q,H)}function S2(v){return v=v.prototype,!(!v||!v.isReactComponent)}function iM(v){if(typeof v==\"function\")return S2(v)?1:0;if(v!=null){if(v=v.$$typeof,v===T)return 11;if(v===W)return 14}return 2}function Su(v,D){var Q=v.alternate;return Q===null?(Q=Ka(v.tag,D,v.key,v.mode),Q.elementType=v.elementType,Q.type=v.type,Q.stateNode=v.stateNode,Q.alternate=v,v.alternate=Q):(Q.pendingProps=D,Q.type=v.type,Q.flags=0,Q.nextEffect=null,Q.firstEffect=null,Q.lastEffect=null),Q.childLanes=v.childLanes,Q.lanes=v.lanes,Q.child=v.child,Q.memoizedProps=v.memoizedProps,Q.memoizedState=v.memoizedState,Q.updateQueue=v.updateQueue,D=v.dependencies,Q.dependencies=D===null?null:{lanes:D.lanes,firstContext:D.firstContext},Q.sibling=v.sibling,Q.index=v.index,Q.ref=v.ref,Q}function sd(v,D,Q,H,V,ne){var Se=2;if(H=v,typeof v==\"function\")S2(v)&&(Se=1);else if(typeof v==\"string\")Se=5;else e:switch(v){case E:return kf(Q.children,V,ne,D);case ue:Se=8,V|=16;break;case C:Se=8,V|=1;break;case S:return v=Ka(12,Q,D,V|8),v.elementType=S,v.type=S,v.lanes=ne,v;case N:return v=Ka(13,Q,D,V),v.type=N,v.elementType=N,v.lanes=ne,v;case U:return v=Ka(19,Q,D,V),v.elementType=U,v.lanes=ne,v;case le:return D2(Q,V,ne,D);case me:return v=Ka(24,Q,D,V),v.elementType=me,v.lanes=ne,v;default:if(typeof v==\"object\"&&v!==null)switch(v.$$typeof){case b:Se=10;break e;case I:Se=9;break e;case T:Se=11;break e;case W:Se=14;break e;case ee:Se=16,H=null;break e;case ie:Se=22;break e}throw Error(c(130,v==null?v:typeof v,\"\"))}return D=Ka(Se,Q,D,V),D.elementType=v,D.type=H,D.lanes=ne,D}function kf(v,D,Q,H){return v=Ka(7,v,H,D),v.lanes=Q,v}function D2(v,D,Q,H){return v=Ka(23,v,H,D),v.elementType=le,v.lanes=Q,v}function P2(v,D,Q){return v=Ka(6,v,null,D),v.lanes=Q,v}function Qo(v,D,Q){return D=Ka(4,v.children!==null?v.children:[],v.key,D),D.lanes=Q,D.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},D}function sM(v,D,Q){this.tag=D,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=P,this.pendingContext=this.context=null,this.hydrate=Q,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=fa(0),this.expirationTimes=fa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fa(0),Z&&(this.mutableSourceEagerHydrationData=null)}function xb(v){var D=v._reactInternals;if(D===void 0)throw typeof v.render==\"function\"?Error(c(188)):Error(c(268,Object.keys(v)));return v=se(D),v===null?null:v.stateNode}function kb(v,D){if(v=v.memoizedState,v!==null&&v.dehydrated!==null){var Q=v.retryLane;v.retryLane=Q!==0&&Q<D?Q:D}}function Vy(v,D){kb(v,D),(v=v.alternate)&&kb(v,D)}function oM(v){return v=se(v),v===null?null:v.stateNode}function aM(){return null}return r.IsThisRendererActing=Wy,r.act=function(v){function D(){Ja--,A2.current=Q,Wy.current=H}Yy===!1&&(Yy=!0,console.error(\"act(...) is not supported in production builds of React, and might not behave as expected.\")),Ja++;var Q=A2.current,H=Wy.current;A2.current=!0,Wy.current=!0;try{var V=yb(v)}catch(ne){throw D(),ne}if(V!==null&&typeof V==\"object\"&&typeof V.then==\"function\")return{then:function(ne,Se){V.then(function(){1<Ja||bb===!0&&Q===!0?(D(),ne()):da(function(_e){D(),_e?Se(_e):ne()})},function(_e){D(),Se(_e)})}};try{Ja!==1||bb!==!1&&Q!==!1||v2(),D()}catch(ne){throw D(),ne}return{then:function(ne){ne()}}},r.attemptContinuousHydration=function(v){if(v.tag===13){var D=ko();Rl(v,67108864,D),Vy(v,67108864)}},r.attemptHydrationAtCurrentPriority=function(v){if(v.tag===13){var D=ko(),Q=Bs(v);Rl(v,Q,D),Vy(v,Q)}},r.attemptSynchronousHydration=function(v){switch(v.tag){case 3:var D=v.stateNode;if(D.hydrate){var Q=ca(D.pendingLanes);D.expiredLanes|=Q&D.pendingLanes,ga(D,Pt()),!(xr&48)&&(Pf(),Rn())}break;case 13:var H=ko();Eb(function(){return Rl(v,1,H)}),Vy(v,4)}},r.attemptUserBlockingHydration=function(v){if(v.tag===13){var D=ko();Rl(v,4,D),Vy(v,4)}},r.batchedEventUpdates=function(v,D){var Q=xr;xr|=2;try{return v(D)}finally{xr=Q,xr===0&&(Pf(),Rn())}},r.batchedUpdates=yb,r.createComponentSelector=function(v){return{$$typeof:Ry,value:v}},r.createContainer=function(v,D,Q){return v=new sM(v,D,Q),D=Ka(3,null,null,D===2?7:D===1?3:0),v.current=D,D.stateNode=v,Bh(D),v},r.createHasPsuedoClassSelector=function(v){return{$$typeof:Ty,value:v}},r.createPortal=function(v,D,Q){var H=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:H==null?null:\"\"+H,children:v,containerInfo:D,implementation:Q}},r.createRoleSelector=function(v){return{$$typeof:Fy,value:v}},r.createTestNameSelector=function(v){return{$$typeof:zg,value:v}},r.createTextSelector=function(v){return{$$typeof:Ny,value:v}},r.deferredUpdates=function(v){return li(97,v)},r.discreteUpdates=function(v,D,Q,H,V){var ne=xr;xr|=4;try{return li(98,v.bind(null,D,Q,H,V))}finally{xr=ne,xr===0&&(Pf(),Rn())}},r.findAllNodes=u2,r.findBoundingRects=function(v,D){if(!qt)throw Error(c(363));D=u2(v,D),v=[];for(var Q=0;Q<D.length;Q++)v.push(bt(D[Q]));for(D=v.length-1;0<D;D--){Q=v[D];for(var H=Q.x,V=H+Q.width,ne=Q.y,Se=ne+Q.height,_e=D-1;0<=_e;_e--)if(D!==_e){var pt=v[_e],Wt=pt.x,Sr=Wt+pt.width,Lr=pt.y,Xt=Lr+pt.height;if(H>=Wt&&ne>=Lr&&V<=Sr&&Se<=Xt){v.splice(D,1);break}else if(H!==Wt||Q.width!==pt.width||Xt<ne||Lr>Se){if(!(ne!==Lr||Q.height!==pt.height||Sr<H||Wt>V)){Wt>H&&(pt.width+=Wt-H,pt.x=H),Sr<V&&(pt.width=V-Wt),v.splice(D,1);break}}else{Lr>ne&&(pt.height+=Lr-ne,pt.y=ne),Xt<Se&&(pt.height=Se-Lr),v.splice(D,1);break}}}return v},r.findHostInstance=xb,r.findHostInstanceWithNoPortals=function(v){return v=X(v),v===null?null:v.tag===20?v.stateNode.instance:v.stateNode},r.findHostInstanceWithWarning=function(v){return xb(v)},r.flushControlled=function(v){var D=xr;xr|=1;try{li(99,v)}finally{xr=D,xr===0&&(Pf(),Rn())}},r.flushDiscreteUpdates=function(){!(xr&49)&&(KL(),vu())},r.flushPassiveEffects=vu,r.flushSync=Eb,r.focusWithin=function(v,D){if(!qt)throw Error(c(363));for(v=Oy(v),D=c2(v,D),D=Array.from(D),v=0;v<D.length;){var Q=D[v++];if(!br(Q)){if(Q.tag===5&&Or(Q.stateNode))return!0;for(Q=Q.child;Q!==null;)D.push(Q),Q=Q.sibling}}return!1},r.getCurrentUpdateLanePriority=function(){return lc},r.getFindAllNodesFailureDescription=function(v,D){if(!qt)throw Error(c(363));var Q=0,H=[];v=[Oy(v),0];for(var V=0;V<v.length;){var ne=v[V++],Se=v[V++],_e=D[Se];if((ne.tag!==5||!br(ne))&&(Sf(ne,_e)&&(H.push(Df(_e)),Se++,Se>Q&&(Q=Se)),Se<D.length))for(ne=ne.child;ne!==null;)v.push(ne,Se),ne=ne.sibling}if(Q<D.length){for(v=[];Q<D.length;Q++)v.push(Df(D[Q]));return`findAllNodes was able to match part of the selector:\n  `+(H.join(\" > \")+`\n\nNo matching component was found for:\n  `)+v.join(\" > \")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return Te(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:oM,findFiberByHostInstance:v.findFiberByHostInstance||aM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\")v=!1;else{var D=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!D.isDisabled&&D.supportsFiber)try{$e=D.inject(v),Ua=D}catch{}v=!0}return v},r.observeVisibleRects=function(v,D,Q,H){if(!qt)throw Error(c(363));v=u2(v,D);var V=nn(v,Q,H).disconnect;return{disconnect:function(){V()}}},r.registerMutableSourceForHydration=function(v,D){var Q=D._getVersion;Q=Q(D._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[D,Q]:v.mutableSourceEagerHydrationData.push(D,Q)},r.runWithPriority=function(v,D){var Q=lc;try{return lc=v,D()}finally{lc=Q}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(v,D){var Q=xr;xr&=-2,xr|=8;try{return v(D)}finally{xr=Q,xr===0&&(Pf(),Rn())}},r.updateContainer=function(v,D,Q,H){var V=D.current,ne=ko(),Se=Bs(V);e:if(Q){Q=Q._reactInternals;t:{if(we(Q)!==Q||Q.tag!==1)throw Error(c(170));var _e=Q;do{switch(_e.tag){case 3:_e=_e.stateNode.context;break t;case 1:if(Kn(_e.type)){_e=_e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}_e=_e.return}while(_e!==null);throw Error(c(171))}if(Q.tag===1){var pt=Q.type;if(Kn(pt)){Q=Oa(Q,pt,_e);break e}}Q=_e}else Q=la;return D.context===null?D.context=Q:D.pendingContext=Q,D=Dl(ne,Se),D.payload={element:v},H=H===void 0?null:H,H!==null&&(D.callback=H),Pl(V,D),Rl(V,Se,ne),Se},r}});var Iwe=_((sKt,Ewe)=>{\"use strict\";Ewe.exports=ywe()});var wwe=_((oKt,Cwe)=>{\"use strict\";var mpt={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};Cwe.exports=mpt});var Dwe=_((aKt,Swe)=>{\"use strict\";var ypt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},TF=function(){function t(e,r){for(var s=0;s<r.length;s++){var a=r[s];a.enumerable=a.enumerable||!1,a.configurable=!0,\"value\"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,s){return r&&t(e.prototype,r),s&&t(e,s),e}}();function _9(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H9(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}var tf=wwe(),Ept=function(){function t(e,r,s,a,n,c){H9(this,t),this.left=e,this.right=r,this.top=s,this.bottom=a,this.width=n,this.height=c}return TF(t,[{key:\"fromJS\",value:function(r){r(this.left,this.right,this.top,this.bottom,this.width,this.height)}},{key:\"toString\",value:function(){return\"<Layout#\"+this.left+\":\"+this.right+\";\"+this.top+\":\"+this.bottom+\";\"+this.width+\":\"+this.height+\">\"}}]),t}(),Bwe=function(){TF(t,null,[{key:\"fromJS\",value:function(r){var s=r.width,a=r.height;return new t(s,a)}}]);function t(e,r){H9(this,t),this.width=e,this.height=r}return TF(t,[{key:\"fromJS\",value:function(r){r(this.width,this.height)}},{key:\"toString\",value:function(){return\"<Size#\"+this.width+\"x\"+this.height+\">\"}}]),t}(),vwe=function(){function t(e,r){H9(this,t),this.unit=e,this.value=r}return TF(t,[{key:\"fromJS\",value:function(r){r(this.unit,this.value)}},{key:\"toString\",value:function(){switch(this.unit){case tf.UNIT_POINT:return String(this.value);case tf.UNIT_PERCENT:return this.value+\"%\";case tf.UNIT_AUTO:return\"auto\";default:return this.value+\"?\"}}},{key:\"valueOf\",value:function(){return this.value}}]),t}();Swe.exports=function(t,e){function r(c,f,p){var h=c[f];c[f]=function(){for(var E=arguments.length,C=Array(E),S=0;S<E;S++)C[S]=arguments[S];return p.call.apply(p,[this,h].concat(C))}}for(var s=[\"setPosition\",\"setMargin\",\"setFlexBasis\",\"setWidth\",\"setHeight\",\"setMinWidth\",\"setMinHeight\",\"setMaxWidth\",\"setMaxHeight\",\"setPadding\"],a=function(){var f,p=s[n],h=(f={},_9(f,tf.UNIT_POINT,e.Node.prototype[p]),_9(f,tf.UNIT_PERCENT,e.Node.prototype[p+\"Percent\"]),_9(f,tf.UNIT_AUTO,e.Node.prototype[p+\"Auto\"]),f);r(e.Node.prototype,p,function(E){for(var C=arguments.length,S=Array(C>1?C-1:0),b=1;b<C;b++)S[b-1]=arguments[b];var I=S.pop(),T=void 0,N=void 0;if(I===\"auto\")T=tf.UNIT_AUTO,N=void 0;else if(I instanceof vwe)T=I.unit,N=I.valueOf();else if(T=typeof I==\"string\"&&I.endsWith(\"%\")?tf.UNIT_PERCENT:tf.UNIT_POINT,N=parseFloat(I),!Number.isNaN(I)&&Number.isNaN(N))throw new Error(\"Invalid value \"+I+\" for \"+p);if(!h[T])throw new Error('Failed to execute \"'+p+`\": Unsupported unit '`+I+\"'\");if(N!==void 0){var U;return(U=h[T]).call.apply(U,[this].concat(S,[N]))}else{var W;return(W=h[T]).call.apply(W,[this].concat(S))}})},n=0;n<s.length;n++)a();return r(e.Config.prototype,\"free\",function(){e.Config.destroy(this)}),r(e.Node,\"create\",function(c,f){return f?e.Node.createWithConfig(f):e.Node.createDefault()}),r(e.Node.prototype,\"free\",function(){e.Node.destroy(this)}),r(e.Node.prototype,\"freeRecursive\",function(){for(var c=0,f=this.getChildCount();c<f;++c)this.getChild(0).freeRecursive();this.free()}),r(e.Node.prototype,\"setMeasureFunc\",function(c,f){return f?c.call(this,function(){return Bwe.fromJS(f.apply(void 0,arguments))}):this.unsetMeasureFunc()}),r(e.Node.prototype,\"calculateLayout\",function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:tf.DIRECTION_LTR;return c.call(this,f,p,h)}),ypt({Config:e.Config,Node:e.Node,Layout:t(\"Layout\",Ept),Size:t(\"Size\",Bwe),Value:t(\"Value\",vwe),getInstanceCount:function(){return e.getInstanceCount.apply(e,arguments)}},tf)}});var Pwe=_((exports,module)=>{(function(t,e){typeof define==\"function\"&&define.amd?define([],function(){return e}):typeof module==\"object\"&&module.exports?module.exports=e:(t.nbind=t.nbind||{}).init=e})(exports,function(Module,cb){typeof Module==\"function\"&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(t,e){return function(){t&&t.apply(this,arguments);try{Module.ccall(\"nbind_init\")}catch(r){e(r);return}e(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb);var Module;Module||(Module=(typeof Module<\"u\"?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if(Module.ENVIRONMENT===\"WEB\")ENVIRONMENT_IS_WEB=!0;else if(Module.ENVIRONMENT===\"WORKER\")ENVIRONMENT_IS_WORKER=!0;else if(Module.ENVIRONMENT===\"NODE\")ENVIRONMENT_IS_NODE=!0;else if(Module.ENVIRONMENT===\"SHELL\")ENVIRONMENT_IS_SHELL=!0;else throw new Error(\"The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.\");else ENVIRONMENT_IS_WEB=typeof window==\"object\",ENVIRONMENT_IS_WORKER=typeof importScripts==\"function\",ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof Ie==\"function\"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(e,r){nodeFS||(nodeFS={}(\"\")),nodePath||(nodePath={}(\"\")),e=nodePath.normalize(e);var s=nodeFS.readFileSync(e);return r?s:s.toString()},Module.readBinary=function(e){var r=Module.read(e,!0);return r.buffer||(r=new Uint8Array(r)),assert(r.buffer),r},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\\\/g,\"/\"):Module.thisProgram=\"unknown-program\"),Module.arguments=process.argv.slice(2),typeof module<\"u\"&&(module.exports=Module),Module.inspect=function(){return\"[Emscripten Module object]\"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr<\"u\"&&(Module.printErr=printErr),typeof read<\"u\"?Module.read=read:Module.read=function(){throw\"no read() available\"},Module.readBinary=function(e){if(typeof readbuffer==\"function\")return new Uint8Array(readbuffer(e));var r=read(e,\"binary\");return assert(typeof r==\"object\"),r},typeof scriptArgs<\"u\"?Module.arguments=scriptArgs:typeof arguments<\"u\"&&(Module.arguments=arguments),typeof quit==\"function\"&&(Module.quit=function(t,e){quit(t)});else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(e){var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.send(null),r.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}),Module.readAsync=function(e,r,s){var a=new XMLHttpRequest;a.open(\"GET\",e,!0),a.responseType=\"arraybuffer\",a.onload=function(){a.status==200||a.status==0&&a.response?r(a.response):s()},a.onerror=s,a.send(null)},typeof arguments<\"u\"&&(Module.arguments=arguments),typeof console<\"u\")Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump<\"u\"?function(t){dump(t)}:function(t){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle>\"u\"&&(Module.setWindowTitle=function(t){document.title=t})}else throw\"Unknown runtime environment. Where are we?\";function globalEval(t){eval.call(null,t)}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram=\"./this.program\"),Module.quit||(Module.quit=function(t,e){throw e}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(t){return tempRet0=t,t},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(t){STACKTOP=t},getNativeTypeSize:function(t){switch(t){case\"i1\":case\"i8\":return 1;case\"i16\":return 2;case\"i32\":return 4;case\"i64\":return 8;case\"float\":return 4;case\"double\":return 8;default:{if(t[t.length-1]===\"*\")return Runtime.QUANTUM_SIZE;if(t[0]===\"i\"){var e=parseInt(t.substr(1));return assert(e%8===0),e/8}else return 0}}},getNativeFieldSize:function(t){return Math.max(Runtime.getNativeTypeSize(t),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(t,e){return e===\"double\"||e===\"i64\"?t&7&&(assert((t&7)===4),t+=4):assert((t&3)===0),t},getAlignSize:function(t,e,r){return!r&&(t==\"i64\"||t==\"double\")?8:t?Math.min(e||(t?Runtime.getNativeFieldSize(t):0),Runtime.QUANTUM_SIZE):Math.min(e,8)},dynCall:function(t,e,r){return r&&r.length?Module[\"dynCall_\"+t].apply(null,[e].concat(r)):Module[\"dynCall_\"+t].call(null,e)},functionPointers:[],addFunction:function(t){for(var e=0;e<Runtime.functionPointers.length;e++)if(!Runtime.functionPointers[e])return Runtime.functionPointers[e]=t,2*(1+e);throw\"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.\"},removeFunction:function(t){Runtime.functionPointers[(t-2)/2]=null},warnOnce:function(t){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[t]||(Runtime.warnOnce.shown[t]=1,Module.printErr(t))},funcWrappers:{},getFuncWrapper:function(t,e){if(t){assert(e),Runtime.funcWrappers[e]||(Runtime.funcWrappers[e]={});var r=Runtime.funcWrappers[e];return r[t]||(e.length===1?r[t]=function(){return Runtime.dynCall(e,t)}:e.length===2?r[t]=function(a){return Runtime.dynCall(e,t,[a])}:r[t]=function(){return Runtime.dynCall(e,t,Array.prototype.slice.call(arguments))}),r[t]}},getCompilerSetting:function(t){throw\"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work\"},stackAlloc:function(t){var e=STACKTOP;return STACKTOP=STACKTOP+t|0,STACKTOP=STACKTOP+15&-16,e},staticAlloc:function(t){var e=STATICTOP;return STATICTOP=STATICTOP+t|0,STATICTOP=STATICTOP+15&-16,e},dynamicAlloc:function(t){var e=HEAP32[DYNAMICTOP_PTR>>2],r=(e+t+15|0)&-16;if(HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY){var s=enlargeMemory();if(!s)return HEAP32[DYNAMICTOP_PTR>>2]=e,0}return e},alignMemory:function(t,e){var r=t=Math.ceil(t/(e||16))*(e||16);return r},makeBigInt:function(t,e,r){var s=r?+(t>>>0)+ +(e>>>0)*4294967296:+(t>>>0)+ +(e|0)*4294967296;return s},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0;function assert(t,e){t||abort(\"Assertion failed: \"+e)}function getCFunc(ident){var func=Module[\"_\"+ident];if(!func)try{func=eval(\"_\"+ident)}catch(t){}return assert(func,\"Cannot call unknown function \"+ident+\" (perhaps LLVM optimizations or closure removed it?)\"),func}var cwrap,ccall;(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(t){var e=Runtime.stackAlloc(t.length);return writeArrayToMemory(t,e),e},stringToC:function(t){var e=0;if(t!=null&&t!==0){var r=(t.length<<2)+1;e=Runtime.stackAlloc(r),stringToUTF8(t,e,r)}return e}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,s,a,n){var c=getCFunc(e),f=[],p=0;if(a)for(var h=0;h<a.length;h++){var E=toC[s[h]];E?(p===0&&(p=Runtime.stackSave()),f[h]=E(a[h])):f[h]=a[h]}var C=c.apply(null,f);if(r===\"string\"&&(C=Pointer_stringify(C)),p!==0){if(n&&n.async){EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(p)});return}Runtime.stackRestore(p)}return C};var sourceRegex=/^function\\s*[a-zA-Z$_0-9]*\\s*\\(([^)]*)\\)\\s*{\\s*([^*]*?)[\\s;]*(?:return\\s*(.*?)[;\\s]*)?}$/;function parseJSFunc(t){var e=t.toString().match(sourceRegex).slice(1);return{arguments:e[0],body:e[1],returnValue:e[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource){JSsource={};for(var t in JSfuncs)JSfuncs.hasOwnProperty(t)&&(JSsource[t]=parseJSFunc(JSfuncs[t]))}}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(t){return t===\"number\"}),numericRet=returnType!==\"string\";if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(t,e){return\"$\"+e}),funcstr=\"(function(\"+argNames.join(\",\")+\") {\",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+=\"var stack = \"+JSsource.stackSave.body+\";\";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(type!==\"number\"){var convertCode=JSsource[type+\"ToC\"];funcstr+=\"var \"+convertCode.arguments+\" = \"+arg+\";\",funcstr+=convertCode.body+\";\",funcstr+=arg+\"=(\"+convertCode.returnValue+\");\"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+=\"var ret = \"+cfuncname+\"(\"+argNames.join(\",\")+\");\",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+=\"ret = \"+strgfy+\"(ret);\"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace(\"()\",\"(stack)\")+\";\"),funcstr+=\"return ret})\",eval(funcstr)}})(),Module.ccall=ccall,Module.cwrap=cwrap;function setValue(t,e,r,s){switch(r=r||\"i8\",r.charAt(r.length-1)===\"*\"&&(r=\"i32\"),r){case\"i1\":HEAP8[t>>0]=e;break;case\"i8\":HEAP8[t>>0]=e;break;case\"i16\":HEAP16[t>>1]=e;break;case\"i32\":HEAP32[t>>2]=e;break;case\"i64\":tempI64=[e>>>0,(tempDouble=e,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case\"float\":HEAPF32[t>>2]=e;break;case\"double\":HEAPF64[t>>3]=e;break;default:abort(\"invalid type for setValue: \"+r)}}Module.setValue=setValue;function getValue(t,e,r){switch(e=e||\"i8\",e.charAt(e.length-1)===\"*\"&&(e=\"i32\"),e){case\"i1\":return HEAP8[t>>0];case\"i8\":return HEAP8[t>>0];case\"i16\":return HEAP16[t>>1];case\"i32\":return HEAP32[t>>2];case\"i64\":return HEAP32[t>>2];case\"float\":return HEAPF32[t>>2];case\"double\":return HEAPF64[t>>3];default:abort(\"invalid type for setValue: \"+e)}return null}Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE;function allocate(t,e,r,s){var a,n;typeof t==\"number\"?(a=!0,n=t):(a=!1,n=t.length);var c=typeof e==\"string\"?e:null,f;if(r==ALLOC_NONE?f=s:f=[typeof _malloc==\"function\"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][r===void 0?ALLOC_STATIC:r](Math.max(n,c?1:e.length)),a){var s=f,p;for(assert((f&3)==0),p=f+(n&-4);s<p;s+=4)HEAP32[s>>2]=0;for(p=f+n;s<p;)HEAP8[s++>>0]=0;return f}if(c===\"i8\")return t.subarray||t.slice?HEAPU8.set(t,f):HEAPU8.set(new Uint8Array(t),f),f;for(var h=0,E,C,S;h<n;){var b=t[h];if(typeof b==\"function\"&&(b=Runtime.getFunctionIndex(b)),E=c||e[h],E===0){h++;continue}E==\"i64\"&&(E=\"i32\"),setValue(f+h,b,E),S!==E&&(C=Runtime.getNativeTypeSize(E),S=E),h+=C}return f}Module.allocate=allocate;function getMemory(t){return staticSealed?runtimeInitialized?_malloc(t):Runtime.dynamicAlloc(t):Runtime.staticAlloc(t)}Module.getMemory=getMemory;function Pointer_stringify(t,e){if(e===0||!t)return\"\";for(var r=0,s,a=0;s=HEAPU8[t+a>>0],r|=s,!(s==0&&!e||(a++,e&&a==e)););e||(e=a);var n=\"\";if(r<128){for(var c=1024,f;e>0;)f=String.fromCharCode.apply(String,HEAPU8.subarray(t,t+Math.min(e,c))),n=n?n+f:f,t+=c,e-=c;return n}return Module.UTF8ToString(t)}Module.Pointer_stringify=Pointer_stringify;function AsciiToString(t){for(var e=\"\";;){var r=HEAP8[t++>>0];if(!r)return e;e+=String.fromCharCode(r)}}Module.AsciiToString=AsciiToString;function stringToAscii(t,e){return writeAsciiToMemory(t,e,!1)}Module.stringToAscii=stringToAscii;var UTF8Decoder=typeof TextDecoder<\"u\"?new TextDecoder(\"utf8\"):void 0;function UTF8ArrayToString(t,e){for(var r=e;t[r];)++r;if(r-e>16&&t.subarray&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,r));for(var s,a,n,c,f,p,h=\"\";;){if(s=t[e++],!s)return h;if(!(s&128)){h+=String.fromCharCode(s);continue}if(a=t[e++]&63,(s&224)==192){h+=String.fromCharCode((s&31)<<6|a);continue}if(n=t[e++]&63,(s&240)==224?s=(s&15)<<12|a<<6|n:(c=t[e++]&63,(s&248)==240?s=(s&7)<<18|a<<12|n<<6|c:(f=t[e++]&63,(s&252)==248?s=(s&3)<<24|a<<18|n<<12|c<<6|f:(p=t[e++]&63,s=(s&1)<<30|a<<24|n<<18|c<<12|f<<6|p))),s<65536)h+=String.fromCharCode(s);else{var E=s-65536;h+=String.fromCharCode(55296|E>>10,56320|E&1023)}}}Module.UTF8ArrayToString=UTF8ArrayToString;function UTF8ToString(t){return UTF8ArrayToString(HEAPU8,t)}Module.UTF8ToString=UTF8ToString;function stringToUTF8Array(t,e,r,s){if(!(s>0))return 0;for(var a=r,n=r+s-1,c=0;c<t.length;++c){var f=t.charCodeAt(c);if(f>=55296&&f<=57343&&(f=65536+((f&1023)<<10)|t.charCodeAt(++c)&1023),f<=127){if(r>=n)break;e[r++]=f}else if(f<=2047){if(r+1>=n)break;e[r++]=192|f>>6,e[r++]=128|f&63}else if(f<=65535){if(r+2>=n)break;e[r++]=224|f>>12,e[r++]=128|f>>6&63,e[r++]=128|f&63}else if(f<=2097151){if(r+3>=n)break;e[r++]=240|f>>18,e[r++]=128|f>>12&63,e[r++]=128|f>>6&63,e[r++]=128|f&63}else if(f<=67108863){if(r+4>=n)break;e[r++]=248|f>>24,e[r++]=128|f>>18&63,e[r++]=128|f>>12&63,e[r++]=128|f>>6&63,e[r++]=128|f&63}else{if(r+5>=n)break;e[r++]=252|f>>30,e[r++]=128|f>>24&63,e[r++]=128|f>>18&63,e[r++]=128|f>>12&63,e[r++]=128|f>>6&63,e[r++]=128|f&63}}return e[r]=0,r-a}Module.stringToUTF8Array=stringToUTF8Array;function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}Module.stringToUTF8=stringToUTF8;function lengthBytesUTF8(t){for(var e=0,r=0;r<t.length;++r){var s=t.charCodeAt(r);s>=55296&&s<=57343&&(s=65536+((s&1023)<<10)|t.charCodeAt(++r)&1023),s<=127?++e:s<=2047?e+=2:s<=65535?e+=3:s<=2097151?e+=4:s<=67108863?e+=5:e+=6}return e}Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder<\"u\"?new TextDecoder(\"utf-16le\"):void 0;function demangle(t){var e=Module.___cxa_demangle||Module.__cxa_demangle;if(e){try{var r=t.substr(1),s=lengthBytesUTF8(r)+1,a=_malloc(s);stringToUTF8(r,a,s);var n=_malloc(4),c=e(a,0,0,n);if(getValue(n,\"i32\")===0&&c)return Pointer_stringify(c)}catch{}finally{a&&_free(a),n&&_free(n),c&&_free(c)}return t}return Runtime.warnOnce(\"warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling\"),t}function demangleAll(t){var e=/__Z[\\w\\d_]+/g;return t.replace(e,function(r){var s=demangle(r);return r===s?r:r+\" [\"+s+\"]\"})}function jsStackTrace(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return\"(no stack trace available)\"}return t.stack.toString()}function stackTrace(){var t=jsStackTrace();return Module.extraStackTrace&&(t+=`\n`+Module.extraStackTrace()),demangleAll(t)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort(\"Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value \"+TOTAL_MEMORY+\", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 \")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr(\"TOTAL_MEMORY should be larger than TOTAL_STACK, was \"+TOTAL_MEMORY+\"! (TOTAL_STACK=\"+TOTAL_STACK+\")\"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw\"Runtime error: expected the system to be little-endian!\";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(t){for(;t.length>0;){var e=t.shift();if(typeof e==\"function\"){e();continue}var r=e.func;typeof r==\"number\"?e.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(e.arg===void 0?null:e.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun==\"function\"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun==\"function\"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(t){__ATPRERUN__.unshift(t)}Module.addOnPreRun=addOnPreRun;function addOnInit(t){__ATINIT__.unshift(t)}Module.addOnInit=addOnInit;function addOnPreMain(t){__ATMAIN__.unshift(t)}Module.addOnPreMain=addOnPreMain;function addOnExit(t){__ATEXIT__.unshift(t)}Module.addOnExit=addOnExit;function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(t,e,r){var s=r>0?r:lengthBytesUTF8(t)+1,a=new Array(s),n=stringToUTF8Array(t,a,0,a.length);return e&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(t){for(var e=[],r=0;r<t.length;r++){var s=t[r];s>255&&(s&=255),e.push(String.fromCharCode(s))}return e.join(\"\")}Module.intArrayToString=intArrayToString;function writeStringToMemory(t,e,r){Runtime.warnOnce(\"writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!\");var s,a;r&&(a=e+lengthBytesUTF8(t),s=HEAP8[a]),stringToUTF8(t,e,1/0),r&&(HEAP8[a]=s)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(t,e){HEAP8.set(t,e)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(t,e,r){for(var s=0;s<t.length;++s)HEAP8[e++>>0]=t.charCodeAt(s);r||(HEAP8[e>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function t(e,r){var s=e>>>16,a=e&65535,n=r>>>16,c=r&65535;return a*c+(s*c+a*n<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(t){return froundBuffer[0]=t,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(t){t=t>>>0;for(var e=0;e<32;e++)if(t&1<<31-e)return e;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}Module.addRunDependency=addRunDependency;function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(t,e,r,s,a,n,c,f){return _nbind.callbackSignatureList[t].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(t,e,r,s,a,n,c,f){return ASM_CONSTS[t](e,r,s,a,n,c,f)}function _emscripten_asm_const_iiiii(t,e,r,s,a){return ASM_CONSTS[t](e,r,s,a)}function _emscripten_asm_const_iiidddddd(t,e,r,s,a,n,c,f,p){return ASM_CONSTS[t](e,r,s,a,n,c,f,p)}function _emscripten_asm_const_iiididi(t,e,r,s,a,n,c){return ASM_CONSTS[t](e,r,s,a,n,c)}function _emscripten_asm_const_iiii(t,e,r,s){return ASM_CONSTS[t](e,r,s)}function _emscripten_asm_const_iiiid(t,e,r,s,a){return ASM_CONSTS[t](e,r,s,a)}function _emscripten_asm_const_iiiiii(t,e,r,s,a,n){return ASM_CONSTS[t](e,r,s,a,n)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],\"i8\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;STATICTOP+=16;function _atexit(t,e){__ATEXIT__.unshift({func:t,arg:e})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr(\"missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj\"),abort(-1)}function __decorate(t,e,r,s){var a=arguments.length,n=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,c;if(typeof Reflect==\"object\"&&typeof Reflect.decorate==\"function\")n=Reflect.decorate(t,e,r,s);else for(var f=t.length-1;f>=0;f--)(c=t[f])&&(n=(a<3?c(n):a>3?c(e,r,n):c(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function _defineHidden(t){return function(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!1,value:t,writable:!0})}}var _nbind={};function __nbind_free_external(t){_nbind.externalList[t].dereference(t)}function __nbind_reference_external(t){_nbind.externalList[t].reference()}function _llvm_stackrestore(t){var e=_llvm_stacksave,r=e.LLVM_SAVEDSTACKS[t];e.LLVM_SAVEDSTACKS.splice(t,1),Runtime.stackRestore(r)}function __nbind_register_pool(t,e,r,s){_nbind.Pool.pageSize=t,_nbind.Pool.usedPtr=e/4,_nbind.Pool.rootPtr=r,_nbind.Pool.pagePtr=s/4,HEAP32[e/4]=16909060,HEAP8[e]==1&&(_nbind.bigEndian=!0),HEAP32[e/4]=0,_nbind.makeTypeKindTbl=(n={},n[1024]=_nbind.PrimitiveType,n[64]=_nbind.Int64Type,n[2048]=_nbind.BindClass,n[3072]=_nbind.BindClassPtr,n[4096]=_nbind.SharedClassPtr,n[5120]=_nbind.ArrayType,n[6144]=_nbind.ArrayType,n[7168]=_nbind.CStringType,n[9216]=_nbind.CallbackType,n[10240]=_nbind.BindType,n),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,\"cbFunction &\":_nbind.CallbackType,\"const cbFunction &\":_nbind.CallbackType,\"const std::string &\":_nbind.StringType,\"std::string\":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var a=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:\"\"});a.proto=Module,_nbind.BindClass.list.push(a);var n}function _emscripten_set_main_loop_timing(t,e){if(Browser.mainLoop.timingMode=t,Browser.mainLoop.timingValue=e,!Browser.mainLoop.func)return 1;if(t==0)Browser.mainLoop.scheduler=function(){var c=Math.max(0,Browser.mainLoop.tickStartTime+e-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,c)},Browser.mainLoop.method=\"timeout\";else if(t==1)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method=\"rAF\";else if(t==2){if(!window.setImmediate){let n=function(c){c.source===window&&c.data===s&&(c.stopPropagation(),r.shift()())};var a=n,r=[],s=\"setimmediate\";window.addEventListener(\"message\",n,!0),window.setImmediate=function(f){r.push(f),ENVIRONMENT_IS_WORKER?(Module.setImmediates===void 0&&(Module.setImmediates=[]),Module.setImmediates.push(f),window.postMessage({target:s})):window.postMessage(s,\"*\")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method=\"immediate\"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(t,e,r,s,a){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,\"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.\"),Browser.mainLoop.func=t,Browser.mainLoop.arg=s;var n;typeof s<\"u\"?n=function(){Module.dynCall_vi(t,s)}:n=function(){Module.dynCall_v(t)};var c=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var p=Date.now(),h=Browser.mainLoop.queue.shift();if(h.func(h.arg),Browser.mainLoop.remainingBlockers){var E=Browser.mainLoop.remainingBlockers,C=E%1==0?E-1:Math.floor(E);h.counted?Browser.mainLoop.remainingBlockers=C:(C=C+.5,Browser.mainLoop.remainingBlockers=(8*E+C)/9)}if(console.log('main loop blocker \"'+h.name+'\" took '+(Date.now()-p)+\" ms\"),Browser.mainLoop.updateStatus(),c<Browser.mainLoop.currentlyRunningMainloop)return;setTimeout(Browser.mainLoop.runner,0);return}if(!(c<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else Browser.mainLoop.timingMode==0&&(Browser.mainLoop.tickStartTime=_emscripten_get_now());Browser.mainLoop.method===\"timeout\"&&Module.ctx&&(Module.printErr(\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\"),Browser.mainLoop.method=\"\"),Browser.mainLoop.runIter(n),!(c<Browser.mainLoop.currentlyRunningMainloop)&&(typeof SDL==\"object\"&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},a||(e&&e>0?_emscripten_set_main_loop_timing(0,1e3/e):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw\"SimulateInfiniteLoop\"}var Browser={mainLoop:{scheduler:null,method:\"\",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var t=Browser.mainLoop.timingMode,e=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(t,e),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var t=Module.statusMessage||\"Please wait...\",e=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;e?e<r?Module.setStatus(t+\" (\"+(r-e)+\"/\"+r+\")\"):Module.setStatus(t):Module.setStatus(\"\")}},runIter:function(t){if(!ABORT){if(Module.preMainLoop){var e=Module.preMainLoop();if(e===!1)return}try{t()}catch(r){if(r instanceof ExitStatus)return;throw r&&typeof r==\"object\"&&r.stack&&Module.printErr(\"exception thrown: \"+[r,r.stack]),r}Module.postMainLoop&&Module.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),Browser.initted)return;Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch{Browser.hasBlobConstructor=!1,console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\")}Browser.BlobBuilder=typeof MozBlobBuilder<\"u\"?MozBlobBuilder:typeof WebKitBlobBuilder<\"u\"?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log(\"warning: no BlobBuilder\"),Browser.URLObject=typeof window<\"u\"?window.URL?window.URL:window.webkitURL:void 0,!Module.noImageDecoding&&typeof Browser.URLObject>\"u\"&&(console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\"),Module.noImageDecoding=!0);var t={};t.canHandle=function(n){return!Module.noImageDecoding&&/\\.(jpg|jpeg|png|bmp)$/i.test(n)},t.handle=function(n,c,f,p){var h=null;if(Browser.hasBlobConstructor)try{h=new Blob([n],{type:Browser.getMimetype(c)}),h.size!==n.length&&(h=new Blob([new Uint8Array(n).buffer],{type:Browser.getMimetype(c)}))}catch(b){Runtime.warnOnce(\"Blob constructor present but fails: \"+b+\"; falling back to blob builder\")}if(!h){var E=new Browser.BlobBuilder;E.append(new Uint8Array(n).buffer),h=E.getBlob()}var C=Browser.URLObject.createObjectURL(h),S=new Image;S.onload=function(){assert(S.complete,\"Image \"+c+\" could not be decoded\");var I=document.createElement(\"canvas\");I.width=S.width,I.height=S.height;var T=I.getContext(\"2d\");T.drawImage(S,0,0),Module.preloadedImages[c]=I,Browser.URLObject.revokeObjectURL(C),f&&f(n)},S.onerror=function(I){console.log(\"Image \"+C+\" could not be decoded\"),p&&p()},S.src=C},Module.preloadPlugins.push(t);var e={};e.canHandle=function(n){return!Module.noAudioDecoding&&n.substr(-4)in{\".ogg\":1,\".wav\":1,\".mp3\":1}},e.handle=function(n,c,f,p){var h=!1;function E(T){h||(h=!0,Module.preloadedAudios[c]=T,f&&f(n))}function C(){h||(h=!0,Module.preloadedAudios[c]=new Audio,p&&p())}if(Browser.hasBlobConstructor){try{var S=new Blob([n],{type:Browser.getMimetype(c)})}catch{return C()}var b=Browser.URLObject.createObjectURL(S),I=new Audio;I.addEventListener(\"canplaythrough\",function(){E(I)},!1),I.onerror=function(N){if(h)return;console.log(\"warning: browser could not fully decode audio \"+c+\", trying slower base64 approach\");function U(W){for(var ee=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",ie=\"=\",ue=\"\",le=0,me=0,pe=0;pe<W.length;pe++)for(le=le<<8|W[pe],me+=8;me>=6;){var Be=le>>me-6&63;me-=6,ue+=ee[Be]}return me==2?(ue+=ee[(le&3)<<4],ue+=ie+ie):me==4&&(ue+=ee[(le&15)<<2],ue+=ie),ue}I.src=\"data:audio/x-\"+c.substr(-3)+\";base64,\"+U(n),E(I)},I.src=b,Browser.safeSetTimeout(function(){E(I)},1e4)}else return C()},Module.preloadPlugins.push(e);function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var s=Module.canvas;s&&(s.requestPointerLock=s.requestPointerLock||s.mozRequestPointerLock||s.webkitRequestPointerLock||s.msRequestPointerLock||function(){},s.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},s.exitPointerLock=s.exitPointerLock.bind(document),document.addEventListener(\"pointerlockchange\",r,!1),document.addEventListener(\"mozpointerlockchange\",r,!1),document.addEventListener(\"webkitpointerlockchange\",r,!1),document.addEventListener(\"mspointerlockchange\",r,!1),Module.elementPointerLock&&s.addEventListener(\"click\",function(a){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),a.preventDefault())},!1))},createContext:function(t,e,r,s){if(e&&Module.ctx&&t==Module.canvas)return Module.ctx;var a,n;if(e){var c={antialias:!1,alpha:!1};if(s)for(var f in s)c[f]=s[f];n=GL.createContext(t,c),n&&(a=GL.getContext(n).GLctx)}else a=t.getContext(\"2d\");return a?(r&&(e||assert(typeof GLctx>\"u\",\"cannot set in module if GLctx is used, but we are a non-GL context that would replace it\"),Module.ctx=a,e&&GL.makeContextCurrent(n),Module.useWebGL=e,Browser.moduleContextCreatedCallbacks.forEach(function(p){p()}),Browser.init()),a):null},destroyContext:function(t,e,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(t,e,r){Browser.lockPointer=t,Browser.resizeCanvas=e,Browser.vrDevice=r,typeof Browser.lockPointer>\"u\"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>\"u\"&&(Browser.resizeCanvas=!1),typeof Browser.vrDevice>\"u\"&&(Browser.vrDevice=null);var s=Module.canvas;function a(){Browser.isFullscreen=!1;var c=s.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===c?(s.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},s.exitFullscreen=s.exitFullscreen.bind(document),Browser.lockPointer&&s.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(c.parentNode.insertBefore(s,c),c.parentNode.removeChild(c),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(s)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener(\"fullscreenchange\",a,!1),document.addEventListener(\"mozfullscreenchange\",a,!1),document.addEventListener(\"webkitfullscreenchange\",a,!1),document.addEventListener(\"MSFullscreenChange\",a,!1));var n=document.createElement(\"div\");s.parentNode.insertBefore(n,s),n.appendChild(s),n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||(n.webkitRequestFullscreen?function(){n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(n.webkitRequestFullScreen?function(){n.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?n.requestFullscreen({vrDisplay:r}):n.requestFullscreen()},requestFullScreen:function(t,e,r){return Module.printErr(\"Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.\"),Browser.requestFullScreen=function(s,a,n){return Browser.requestFullscreen(s,a,n)},Browser.requestFullscreen(t,e,r)},nextRAF:0,fakeRequestAnimationFrame:function(t){var e=Date.now();if(Browser.nextRAF===0)Browser.nextRAF=e+1e3/60;else for(;e+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-e,0);setTimeout(t,r)},requestAnimationFrame:function t(e){typeof window>\"u\"?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(t){return function(){if(!ABORT)return t.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var t=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],t.forEach(function(e){e()})}},safeRequestAnimationFrame:function(t){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?t():Browser.queuedAsyncCallbacks.push(t))})},safeSetTimeout:function(t,e){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?t():Browser.queuedAsyncCallbacks.push(t))},e)},safeSetInterval:function(t,e){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&t()},e)},getMimetype:function(t){return{jpg:\"image/jpeg\",jpeg:\"image/jpeg\",png:\"image/png\",bmp:\"image/bmp\",ogg:\"audio/ogg\",wav:\"audio/wav\",mp3:\"audio/mpeg\"}[t.substr(t.lastIndexOf(\".\")+1)]},getUserMedia:function(t){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(t)},getMovementX:function(t){return t.movementX||t.mozMovementX||t.webkitMovementX||0},getMovementY:function(t){return t.movementY||t.mozMovementY||t.webkitMovementY||0},getMouseWheelDelta:function(t){var e=0;switch(t.type){case\"DOMMouseScroll\":e=t.detail;break;case\"mousewheel\":e=t.wheelDelta;break;case\"wheel\":e=t.deltaY;break;default:throw\"unrecognized mouse wheel event: \"+t.type}return e},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(t){if(Browser.pointerLock)t.type!=\"mousemove\"&&\"mozMovementX\"in t?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(t),Browser.mouseMovementY=Browser.getMovementY(t)),typeof SDL<\"u\"?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var e=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,s=Module.canvas.height,a=typeof window.scrollX<\"u\"?window.scrollX:window.pageXOffset,n=typeof window.scrollY<\"u\"?window.scrollY:window.pageYOffset;if(t.type===\"touchstart\"||t.type===\"touchend\"||t.type===\"touchmove\"){var c=t.touch;if(c===void 0)return;var f=c.pageX-(a+e.left),p=c.pageY-(n+e.top);f=f*(r/e.width),p=p*(s/e.height);var h={x:f,y:p};if(t.type===\"touchstart\")Browser.lastTouches[c.identifier]=h,Browser.touches[c.identifier]=h;else if(t.type===\"touchend\"||t.type===\"touchmove\"){var E=Browser.touches[c.identifier];E||(E=h),Browser.lastTouches[c.identifier]=E,Browser.touches[c.identifier]=h}return}var C=t.pageX-(a+e.left),S=t.pageY-(n+e.top);C=C*(r/e.width),S=S*(s/e.height),Browser.mouseMovementX=C-Browser.mouseX,Browser.mouseMovementY=S-Browser.mouseY,Browser.mouseX=C,Browser.mouseY=S}},asyncLoad:function(t,e,r,s){var a=s?\"\":\"al \"+t;Module.readAsync(t,function(n){assert(n,'Loading data file \"'+t+'\" failed (no arrayBuffer).'),e(new Uint8Array(n)),a&&removeRunDependency(a)},function(n){if(r)r();else throw'Loading data file \"'+t+'\" failed.'}),a&&addRunDependency(a)},resizeListeners:[],updateResizeListeners:function(){var t=Module.canvas;Browser.resizeListeners.forEach(function(e){e(t.width,t.height)})},setCanvasSize:function(t,e,r){var s=Module.canvas;Browser.updateCanvasDimensions(s,t,e),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL<\"u\"){var t=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];t=t|8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=t}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL<\"u\"){var t=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];t=t&-8388609,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=t}Browser.updateResizeListeners()},updateCanvasDimensions:function(t,e,r){e&&r?(t.widthNative=e,t.heightNative=r):(e=t.widthNative,r=t.heightNative);var s=e,a=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(s/a<Module.forcedAspectRatio?s=Math.round(a*Module.forcedAspectRatio):a=Math.round(s/Module.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===t.parentNode&&typeof screen<\"u\"){var n=Math.min(screen.width/s,screen.height/a);s=Math.round(s*n),a=Math.round(a*n)}Browser.resizeCanvas?(t.width!=s&&(t.width=s),t.height!=a&&(t.height=a),typeof t.style<\"u\"&&(t.style.removeProperty(\"width\"),t.style.removeProperty(\"height\"))):(t.width!=e&&(t.width=e),t.height!=r&&(t.height=r),typeof t.style<\"u\"&&(s!=e||a!=r?(t.style.setProperty(\"width\",s+\"px\",\"important\"),t.style.setProperty(\"height\",a+\"px\",\"important\")):(t.style.removeProperty(\"width\"),t.style.removeProperty(\"height\"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var t=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,t}},SYSCALLS={varargs:0,get:function(t){SYSCALLS.varargs+=4;var e=HEAP32[SYSCALLS.varargs-4>>2];return e},getStr:function(){var t=Pointer_stringify(SYSCALLS.get());return t},get64:function(){var t=SYSCALLS.get(),e=SYSCALLS.get();return t>=0?assert(e===0):assert(e===-1),t},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall6(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(s){return(typeof FS>\"u\"||!(s instanceof FS.ErrnoError))&&abort(s),-s.errno}}function ___syscall54(t,e){SYSCALLS.varargs=e;try{return 0}catch(r){return(typeof FS>\"u\"||!(r instanceof FS.ErrnoError))&&abort(r),-r.errno}}function _typeModule(t){var e=[[0,1,\"X\"],[1,1,\"const X\"],[128,1,\"X *\"],[256,1,\"X &\"],[384,1,\"X &&\"],[512,1,\"std::shared_ptr<X>\"],[640,1,\"std::unique_ptr<X>\"],[5120,1,\"std::vector<X>\"],[6144,2,\"std::array<X, Y>\"],[9216,-1,\"std::function<X (Y)>\"]];function r(p,h,E,C,S,b){if(h==1){var I=C&896;(I==128||I==256||I==384)&&(p=\"X const\")}var T;return b?T=E.replace(\"X\",p).replace(\"Y\",S):T=p.replace(\"X\",E).replace(\"Y\",S),T.replace(/([*&]) (?=[*&])/g,\"$1\")}function s(p,h,E,C,S){throw new Error(p+\" type \"+E.replace(\"X\",h+\"?\")+(C?\" with flag \"+C:\"\")+\" in \"+S)}function a(p,h,E,C,S,b,I,T){b===void 0&&(b=\"X\"),T===void 0&&(T=1);var N=E(p);if(N)return N;var U=C(p),W=U.placeholderFlag,ee=e[W];I&&ee&&(b=r(I[2],I[0],b,ee[0],\"?\",!0));var ie;W==0&&(ie=\"Unbound\"),W>=10&&(ie=\"Corrupt\"),T>20&&(ie=\"Deeply nested\"),ie&&s(ie,p,b,W,S||\"?\");var ue=U.paramList[0],le=a(ue,h,E,C,S,b,ee,T+1),me,pe={flags:ee[0],id:p,name:\"\",paramList:[le]},Be=[],Ce=\"?\";switch(U.placeholderFlag){case 1:me=le.spec;break;case 2:if((le.flags&15360)==1024&&le.spec.ptrSize==1){pe.flags=7168;break}case 3:case 6:case 5:me=le.spec,le.flags&15360;break;case 8:Ce=\"\"+U.paramList[1],pe.paramList.push(U.paramList[1]);break;case 9:for(var g=0,we=U.paramList[1];g<we.length;g++){var ye=we[g],Ae=a(ye,h,E,C,S,b,ee,T+1);Be.push(Ae.name),pe.paramList.push(Ae)}Ce=Be.join(\", \");break;default:break}if(pe.name=r(ee[2],ee[0],le.name,le.flags,Ce),me){for(var se=0,X=Object.keys(me);se<X.length;se++){var De=X[se];pe[De]=pe[De]||me[De]}pe.flags|=me.flags}return n(h,pe)}function n(p,h){var E=h.flags,C=E&896,S=E&15360;return!h.name&&S==1024&&(h.ptrSize==1?h.name=(E&16?\"\":(E&8?\"un\":\"\")+\"signed \")+\"char\":h.name=(E&8?\"u\":\"\")+(E&32?\"float\":\"int\")+(h.ptrSize*8+\"_t\")),h.ptrSize==8&&!(E&32)&&(S=64),S==2048&&(C==512||C==640?S=4096:C&&(S=3072)),p(S,h)}var c=function(){function p(h){this.id=h.id,this.name=h.name,this.flags=h.flags,this.spec=h}return p.prototype.toString=function(){return this.name},p}(),f={Type:c,getComplexType:a,makeType:n,structureList:e};return t.output=f,t.output||f}function __nbind_register_type(t,e){var r=_nbind.readAsciiString(e),s={flags:10240,id:t,name:r};_nbind.makeType(_nbind.constructType,s)}function __nbind_register_callback_signature(t,e){var r=_nbind.readTypeIdList(t,e),s=_nbind.callbackSignatureList.length;return _nbind.callbackSignatureList[s]=_nbind.makeJSCaller(r),s}function __extends(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function s(){this.constructor=t}s.prototype=e.prototype,t.prototype=new s}function __nbind_register_class(t,e,r,s,a,n,c){var f=_nbind.readAsciiString(c),p=_nbind.readPolicyList(e),h=HEAPU32.subarray(t/4,t/4+2),E={flags:2048|(p.Value?2:0),id:h[0],name:f},C=_nbind.makeType(_nbind.constructType,E);C.ptrType=_nbind.getComplexType(h[1],_nbind.constructType,_nbind.getType,_nbind.queryType),C.destroy=_nbind.makeMethodCaller(C.ptrType,{boundID:E.id,flags:0,name:\"destroy\",num:0,ptr:n,title:C.name+\".free\",typeList:[\"void\",\"uint32_t\",\"uint32_t\"]}),a&&(C.superIdList=Array.prototype.slice.call(HEAPU32.subarray(r/4,r/4+a)),C.upcastList=Array.prototype.slice.call(HEAPU32.subarray(s/4,s/4+a))),Module[C.name]=C.makeBound(p),_nbind.BindClass.list.push(C)}function _removeAccessorPrefix(t){var e=/^[Gg]et_?([A-Z]?([A-Z]?))/;return t.replace(e,function(r,s,a){return a?s:s.toLowerCase()})}function __nbind_register_function(t,e,r,s,a,n,c,f,p,h){var E=_nbind.getType(t),C=_nbind.readPolicyList(e),S=_nbind.readTypeIdList(r,s),b;if(c==5)b=[{direct:a,name:\"__nbindConstructor\",ptr:0,title:E.name+\" constructor\",typeList:[\"uint32_t\"].concat(S.slice(1))},{direct:n,name:\"__nbindValueConstructor\",ptr:0,title:E.name+\" value constructor\",typeList:[\"void\",\"uint32_t\"].concat(S.slice(1))}];else{var I=_nbind.readAsciiString(f),T=(E.name&&E.name+\".\")+I;(c==3||c==4)&&(I=_removeAccessorPrefix(I)),b=[{boundID:t,direct:n,name:I,ptr:a,title:T,typeList:S}]}for(var N=0,U=b;N<U.length;N++){var W=U[N];W.signatureType=c,W.policyTbl=C,W.num=p,W.flags=h,E.addMethod(W)}}function _nbind_value(t,e){_nbind.typeNameTbl[t]||_nbind.throwError(\"Unknown value type \"+t),Module.NBind.bind_value(t,e),_defineHidden(_nbind.typeNameTbl[t].proto.prototype.__nbindValueConstructor)(e.prototype,\"__nbindValueConstructor\")}Module._nbind_value=_nbind_value;function __nbind_get_value_object(t,e){var r=_nbind.popValue(t);if(!r.fromJS)throw new Error(\"Object \"+r+\" has no fromJS function\");r.fromJS(function(){r.__nbindValueConstructor.apply(this,Array.prototype.concat.apply([e],arguments))})}function _emscripten_memcpy_big(t,e,r){return HEAPU8.set(HEAPU8.subarray(e,e+r),t),t}function __nbind_register_primitive(t,e,r){var s={flags:1024|r,id:t,ptrSize:e};_nbind.makeType(_nbind.constructType,s)}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],\"i8\",ALLOC_STATIC);function ___setErrNo(t){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=t),t}function _llvm_stacksave(){var t=_llvm_stacksave;return t.LLVM_SAVEDSTACKS||(t.LLVM_SAVEDSTACKS=[]),t.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),t.LLVM_SAVEDSTACKS.length-1}function ___syscall140(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD(),s=SYSCALLS.get(),a=SYSCALLS.get(),n=SYSCALLS.get(),c=SYSCALLS.get(),f=a;return FS.llseek(r,f,c),HEAP32[n>>2]=r.position,r.getdents&&f===0&&c===0&&(r.getdents=null),0}catch(p){return(typeof FS>\"u\"||!(p instanceof FS.ErrnoError))&&abort(p),-p.errno}}function ___syscall146(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.get(),s=SYSCALLS.get(),a=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(E,C){var S=___syscall146.buffers[E];assert(S),C===0||C===10?((E===1?Module.print:Module.printErr)(UTF8ArrayToString(S,0)),S.length=0):S.push(C)});for(var c=0;c<a;c++){for(var f=HEAP32[s+c*8>>2],p=HEAP32[s+(c*8+4)>>2],h=0;h<p;h++)___syscall146.printChar(r,HEAPU8[f+h]);n+=p}return n}catch(E){return(typeof FS>\"u\"||!(E instanceof FS.ErrnoError))&&abort(E),-E.errno}}function __nbind_finish(){for(var t=0,e=_nbind.BindClass.list;t<e.length;t++){var r=e[t];r.finish()}}var ___dso_handle=STATICTOP;STATICTOP+=16,function(_nbind){var typeIdTbl={};_nbind.typeNameTbl={};var Pool=function(){function t(){}return t.lalloc=function(e){e=e+7&-8;var r=HEAPU32[t.usedPtr];if(e>t.pageSize/2||e>t.pageSize-r){var s=_nbind.typeNameTbl.NBind.proto;return s.lalloc(e)}else return HEAPU32[t.usedPtr]=r+e,t.rootPtr+r},t.lreset=function(e,r){var s=HEAPU32[t.pagePtr];if(s){var a=_nbind.typeNameTbl.NBind.proto;a.lreset(e,r)}else HEAPU32[t.usedPtr]=e},t}();_nbind.Pool=Pool;function constructType(t,e){var r=t==10240?_nbind.makeTypeNameTbl[e.name]||_nbind.BindType:_nbind.makeTypeKindTbl[t],s=new r(e);return typeIdTbl[e.id]=s,_nbind.typeNameTbl[e.name]=s,s}_nbind.constructType=constructType;function getType(t){return typeIdTbl[t]}_nbind.getType=getType;function queryType(t){var e=HEAPU8[t],r=_nbind.structureList[e][1];t/=4,r<0&&(++t,r=HEAPU32[t]+1);var s=Array.prototype.slice.call(HEAPU32.subarray(t+1,t+1+r));return e==9&&(s=[s[0],s.slice(1)]),{paramList:s,placeholderFlag:e}}_nbind.queryType=queryType;function getTypes(t,e){return t.map(function(r){return typeof r==\"number\"?_nbind.getComplexType(r,constructType,getType,queryType,e):_nbind.typeNameTbl[r]})}_nbind.getTypes=getTypes;function readTypeIdList(t,e){return Array.prototype.slice.call(HEAPU32,t/4,t/4+e)}_nbind.readTypeIdList=readTypeIdList;function readAsciiString(t){for(var e=t;HEAPU8[e++];);return String.fromCharCode.apply(\"\",HEAPU8.subarray(t,e-1))}_nbind.readAsciiString=readAsciiString;function readPolicyList(t){var e={};if(t)for(;;){var r=HEAPU32[t/4];if(!r)break;e[readAsciiString(r)]=!0,t+=4}return e}_nbind.readPolicyList=readPolicyList;function getDynCall(t,e){var r={float32_t:\"d\",float64_t:\"d\",int64_t:\"d\",uint64_t:\"d\",void:\"v\"},s=t.map(function(n){return r[n.name]||\"i\"}).join(\"\"),a=Module[\"dynCall_\"+s];if(!a)throw new Error(\"dynCall_\"+s+\" not found for \"+e+\"(\"+t.map(function(n){return n.name}).join(\", \")+\")\");return a}_nbind.getDynCall=getDynCall;function addMethod(t,e,r,s){var a=t[e];t.hasOwnProperty(e)&&a?((a.arity||a.arity===0)&&(a=_nbind.makeOverloader(a,a.arity),t[e]=a),a.addMethod(r,s)):(r.arity=s,t[e]=r)}_nbind.addMethod=addMethod;function throwError(t){throw new Error(t)}_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.heap=HEAPU32,r.ptrSize=4,r}return e.prototype.needsWireRead=function(r){return!!this.wireRead||!!this.makeWireRead},e.prototype.needsWireWrite=function(r){return!!this.wireWrite||!!this.makeWireWrite},e}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this,a=r.flags&32?{32:HEAPF32,64:HEAPF64}:r.flags&8?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return s.heap=a[r.ptrSize*8],s.ptrSize=r.ptrSize,s}return e.prototype.needsWireWrite=function(r){return!!r&&!!r.Strict},e.prototype.makeWireWrite=function(r,s){return s&&s.Strict&&function(a){if(typeof a==\"number\")return a;throw new Error(\"Type mismatch\")}},e}(BindType);_nbind.PrimitiveType=PrimitiveType;function pushCString(t,e){if(t==null){if(e&&e.Nullable)return 0;throw new Error(\"Type mismatch\")}if(e&&e.Strict){if(typeof t!=\"string\")throw new Error(\"Type mismatch\")}else t=t.toString();var r=Module.lengthBytesUTF8(t)+1,s=_nbind.Pool.lalloc(r);return Module.stringToUTF8Array(t,HEAPU8,s,r),s}_nbind.pushCString=pushCString;function popCString(t){return t===0?null:Module.Pointer_stringify(t)}_nbind.popCString=popCString;var CStringType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popCString,r.wireWrite=pushCString,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,s){return function(a){return pushCString(a,s)}},e}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=function(s){return!!s},r}return e.prototype.needsWireWrite=function(r){return!!r&&!!r.Strict},e.prototype.makeWireRead=function(r){return\"!!(\"+r+\")\"},e.prototype.makeWireWrite=function(r,s){return s&&s.Strict&&function(a){if(typeof a==\"boolean\")return a;throw new Error(\"Type mismatch\")}||r},e}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function t(){}return t.prototype.persist=function(){this.__nbindState|=1},t}();_nbind.Wrapper=Wrapper;function makeBound(t,e){var r=function(s){__extends(a,s);function a(n,c,f,p){var h=s.call(this)||this;if(!(h instanceof a))return new(Function.prototype.bind.apply(a,Array.prototype.concat.apply([null],arguments)));var E=c,C=f,S=p;if(n!==_nbind.ptrMarker){var b=h.__nbindConstructor.apply(h,arguments);E=4608,S=HEAPU32[b/4],C=HEAPU32[b/4+1]}var I={configurable:!0,enumerable:!1,value:null,writable:!1},T={__nbindFlags:E,__nbindPtr:C};S&&(T.__nbindShared=S,_nbind.mark(h));for(var N=0,U=Object.keys(T);N<U.length;N++){var W=U[N];I.value=T[W],Object.defineProperty(h,W,I)}return _defineHidden(0)(h,\"__nbindState\"),h}return a.prototype.free=function(){e.destroy.call(this,this.__nbindShared,this.__nbindFlags),this.__nbindState|=2,disableMember(this,\"__nbindShared\"),disableMember(this,\"__nbindPtr\")},a}(Wrapper);return __decorate([_defineHidden()],r.prototype,\"__nbindConstructor\",void 0),__decorate([_defineHidden()],r.prototype,\"__nbindValueConstructor\",void 0),__decorate([_defineHidden(t)],r.prototype,\"__nbindPolicies\",void 0),r}_nbind.makeBound=makeBound;function disableMember(t,e){function r(){throw new Error(\"Accessing deleted object\")}Object.defineProperty(t,e,{configurable:!1,enumerable:!1,get:r,set:r})}_nbind.ptrMarker={};var BindClass=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;return s.wireRead=function(a){return _nbind.popValue(a,s.ptrType)},s.wireWrite=function(a){return pushPointer(a,s.ptrType,!0)},s.pendingSuperCount=0,s.ready=!1,s.methodTbl={},r.paramList?(s.classType=r.paramList[0].classType,s.proto=s.classType.proto):s.classType=s,s}return e.prototype.makeBound=function(r){var s=_nbind.makeBound(r,this);return this.proto=s,this.ptrType.proto=s,s},e.prototype.addMethod=function(r){var s=this.methodTbl[r.name]||[];s.push(r),this.methodTbl[r.name]=s},e.prototype.registerMethods=function(r,s){for(var a,n=0,c=Object.keys(r.methodTbl);n<c.length;n++)for(var f=c[n],p=r.methodTbl[f],h=0,E=p;h<E.length;h++){var C=E[h],S=void 0,b=void 0;if(S=this.proto.prototype,!(s&&C.signatureType!=1))switch(C.signatureType){case 1:S=this.proto;case 5:b=_nbind.makeCaller(C),_nbind.addMethod(S,C.name,b,C.typeList.length-1);break;case 4:a=_nbind.makeMethodCaller(r.ptrType,C);break;case 3:Object.defineProperty(S,C.name,{configurable:!0,enumerable:!1,get:_nbind.makeMethodCaller(r.ptrType,C),set:a});break;case 2:b=_nbind.makeMethodCaller(r.ptrType,C),_nbind.addMethod(S,C.name,b,C.typeList.length-1);break;default:break}}},e.prototype.registerSuperMethods=function(r,s,a){if(!a[r.name]){a[r.name]=!0;for(var n=0,c,f=0,p=r.superIdList||[];f<p.length;f++){var h=p[f],E=_nbind.getType(h);n++<s||s<0?c=-1:c=0,this.registerSuperMethods(E,c,a)}this.registerMethods(r,s<0)}},e.prototype.finish=function(){if(this.ready)return this;this.ready=!0,this.superList=(this.superIdList||[]).map(function(a){return _nbind.getType(a).finish()});var r=this.proto;if(this.superList.length){var s=function(){this.constructor=r};s.prototype=this.superList[0].proto.prototype,r.prototype=new s}return r!=Module&&(r.prototype.__nbindType=this),this.registerSuperMethods(this,1,{}),this},e.prototype.upcastStep=function(r,s){if(r==this)return s;for(var a=0;a<this.superList.length;++a){var n=this.superList[a].upcastStep(r,_nbind.callUpcast(this.upcastList[a],s));if(n)return n}return 0},e}(_nbind.BindType);BindClass.list=[],_nbind.BindClass=BindClass;function popPointer(t,e){return t?new e.proto(_nbind.ptrMarker,e.flags,t):null}_nbind.popPointer=popPointer;function pushPointer(t,e,r){if(!(t instanceof _nbind.Wrapper)){if(r)return _nbind.pushValue(t);throw new Error(\"Type mismatch\")}var s=t.__nbindPtr,a=t.__nbindType.classType,n=e.classType;if(t instanceof e.proto)for(;a!=n;)s=_nbind.callUpcast(a.upcastList[0],s),a=a.superList[0];else if(s=a.upcastStep(n,s),!s)throw new Error(\"Type mismatch\");return s}_nbind.pushPointer=pushPointer;function pushMutablePointer(t,e){var r=pushPointer(t,e);if(t.__nbindFlags&1)throw new Error(\"Passing a const value as a non-const argument\");return r}var BindClassPtr=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;s.classType=r.paramList[0].classType,s.proto=s.classType.proto;var a=r.flags&1,n=(s.flags&896)==256&&r.flags&2,c=a?pushPointer:pushMutablePointer,f=n?_nbind.popValue:popPointer;return s.makeWireWrite=function(p,h){return h.Nullable?function(E){return E?c(E,s):0}:function(E){return c(E,s)}},s.wireRead=function(p){return f(p,s)},s.wireWrite=function(p){return c(p,s)},s}return e}(_nbind.BindType);_nbind.BindClassPtr=BindClassPtr;function popShared(t,e){var r=HEAPU32[t/4],s=HEAPU32[t/4+1];return s?new e.proto(_nbind.ptrMarker,e.flags,s,r):null}_nbind.popShared=popShared;function pushShared(t,e){if(!(t instanceof e.proto))throw new Error(\"Type mismatch\");return t.__nbindShared}function pushMutableShared(t,e){if(!(t instanceof e.proto))throw new Error(\"Type mismatch\");if(t.__nbindFlags&1)throw new Error(\"Passing a const value as a non-const argument\");return t.__nbindShared}var SharedClassPtr=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;s.readResources=[_nbind.resources.pool],s.classType=r.paramList[0].classType,s.proto=s.classType.proto;var a=r.flags&1,n=a?pushShared:pushMutableShared;return s.wireRead=function(c){return popShared(c,s)},s.wireWrite=function(c){return n(c,s)},s}return e}(_nbind.BindType);_nbind.SharedClassPtr=SharedClassPtr,_nbind.externalList=[0];var firstFreeExternal=0,External=function(){function t(e){this.refCount=1,this.data=e}return t.prototype.register=function(){var e=firstFreeExternal;return e?firstFreeExternal=_nbind.externalList[e]:e=_nbind.externalList.length,_nbind.externalList[e]=this,e},t.prototype.reference=function(){++this.refCount},t.prototype.dereference=function(e){--this.refCount==0&&(this.free&&this.free(),_nbind.externalList[e]=firstFreeExternal,firstFreeExternal=e)},t}();_nbind.External=External;function popExternal(t){var e=_nbind.externalList[t];return e.dereference(t),e.data}function pushExternal(t){var e=new External(t);return e.reference(),e.register()}var ExternalType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popExternal,r.wireWrite=pushExternal,r}return e}(_nbind.BindType);_nbind.ExternalType=ExternalType,_nbind.callbackSignatureList=[];var CallbackType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireWrite=function(s){return typeof s!=\"function\"&&_nbind.throwError(\"Type mismatch\"),new _nbind.External(s).register()},r}return e}(_nbind.BindType);_nbind.CallbackType=CallbackType,_nbind.valueList=[0];var firstFreeValue=0;function pushValue(t){var e=firstFreeValue;return e?firstFreeValue=_nbind.valueList[e]:e=_nbind.valueList.length,_nbind.valueList[e]=t,e*2+1}_nbind.pushValue=pushValue;function popValue(t,e){if(t||_nbind.throwError(\"Value type JavaScript class is missing or not registered\"),t&1){t>>=1;var r=_nbind.valueList[t];return _nbind.valueList[t]=firstFreeValue,firstFreeValue=t,r}else{if(e)return _nbind.popShared(t,e);throw new Error(\"Invalid value slot \"+t)}}_nbind.popValue=popValue;var valueBase=18446744073709552e3;function push64(t){return typeof t==\"number\"?t:pushValue(t)*4096+valueBase}function pop64(t){return t<valueBase?t:popValue((t-valueBase)/4096)}var CreateValueType=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeWireWrite=function(r){return\"(_nbind.pushValue(new \"+r+\"))\"},e}(_nbind.BindType);_nbind.CreateValueType=CreateValueType;var Int64Type=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireWrite=push64,r.wireRead=pop64,r}return e}(_nbind.BindType);_nbind.Int64Type=Int64Type;function pushArray(t,e){if(!t)return 0;var r=t.length;if((e.size||e.size===0)&&r<e.size)throw new Error(\"Type mismatch\");var s=e.memberType.ptrSize,a=_nbind.Pool.lalloc(4+r*s);HEAPU32[a/4]=r;var n=e.memberType.heap,c=(a+4)/s,f=e.memberType.wireWrite,p=0;if(f)for(;p<r;)n[c++]=f(t[p++]);else for(;p<r;)n[c++]=t[p++];return a}_nbind.pushArray=pushArray;function popArray(t,e){if(t===0)return null;var r=HEAPU32[t/4],s=new Array(r),a=e.memberType.heap;t=(t+4)/e.memberType.ptrSize;var n=e.memberType.wireRead,c=0;if(n)for(;c<r;)s[c++]=n(a[t++]);else for(;c<r;)s[c++]=a[t++];return s}_nbind.popArray=popArray;var ArrayType=function(t){__extends(e,t);function e(r){var s=t.call(this,r)||this;return s.wireRead=function(a){return popArray(a,s)},s.wireWrite=function(a){return pushArray(a,s)},s.readResources=[_nbind.resources.pool],s.writeResources=[_nbind.resources.pool],s.memberType=r.paramList[0],r.paramList[1]&&(s.size=r.paramList[1]),s}return e}(_nbind.BindType);_nbind.ArrayType=ArrayType;function pushString(t,e){if(t==null)if(e&&e.Nullable)t=\"\";else throw new Error(\"Type mismatch\");if(e&&e.Strict){if(typeof t!=\"string\")throw new Error(\"Type mismatch\")}else t=t.toString();var r=Module.lengthBytesUTF8(t),s=_nbind.Pool.lalloc(4+r+1);return HEAPU32[s/4]=r,Module.stringToUTF8Array(t,HEAPU8,s+4,r+1),s}_nbind.pushString=pushString;function popString(t){if(t===0)return null;var e=HEAPU32[t/4];return Module.Pointer_stringify(t+4,e)}_nbind.popString=popString;var StringType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popString,r.wireWrite=pushString,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,s){return function(a){return pushString(a,s)}},e}(_nbind.BindType);_nbind.StringType=StringType;function makeArgList(t){return Array.apply(null,Array(t)).map(function(e,r){return\"a\"+(r+1)})}function anyNeedsWireWrite(t,e){return t.reduce(function(r,s){return r||s.needsWireWrite(e)},!1)}function anyNeedsWireRead(t,e){return t.reduce(function(r,s){return r||!!s.needsWireRead(e)},!1)}function makeWireRead(t,e,r,s){var a=t.length;return r.makeWireRead?r.makeWireRead(s,t,a):r.wireRead?(t[a]=r.wireRead,\"(convertParamList[\"+a+\"](\"+s+\"))\"):s}function makeWireWrite(t,e,r,s){var a,n=t.length;return r.makeWireWrite?a=r.makeWireWrite(s,e,t,n):a=r.wireWrite,a?typeof a==\"string\"?a:(t[n]=a,\"(convertParamList[\"+n+\"](\"+s+\"))\"):s}function buildCallerFunction(dynCall,ptrType,ptr,num,policyTbl,needsWireWrite,prefix,returnType,argTypeList,mask,err){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireRead(convertParamList,policyTbl,returnType,\"dynCall(\"+[prefix].concat(argList.map(function(t,e){return makeWireWrite(convertParamList,policyTbl,argTypeList[e],t)})).join(\",\")+\")\"),resourceSet=_nbind.listResources([returnType],argTypeList),sourceCode=\"function(\"+argList.join(\",\")+\"){\"+(mask?\"this.__nbindFlags&mask&&err();\":\"\")+resourceSet.makeOpen()+\"var r=\"+callExpression+\";\"+resourceSet.makeClose()+\"return r;}\";return eval(\"(\"+sourceCode+\")\")}function buildJSCallerFunction(returnType,argTypeList){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireWrite(convertParamList,null,returnType,\"_nbind.externalList[num].data(\"+argList.map(function(t,e){return makeWireRead(convertParamList,null,argTypeList[e],t)}).join(\",\")+\")\"),resourceSet=_nbind.listResources(argTypeList,[returnType]);resourceSet.remove(_nbind.resources.pool);var sourceCode=\"function(\"+[\"dummy\",\"num\"].concat(argList).join(\",\")+\"){\"+resourceSet.makeOpen()+\"var r=\"+callExpression+\";\"+resourceSet.makeClose()+\"return r;}\";return eval(\"(\"+sourceCode+\")\")}_nbind.buildJSCallerFunction=buildJSCallerFunction;function makeJSCaller(t){var e=t.length-1,r=_nbind.getTypes(t,\"callback\"),s=r[0],a=r.slice(1),n=anyNeedsWireRead(a,null),c=s.needsWireWrite(null);if(!c&&!n)switch(e){case 0:return function(f,p){return _nbind.externalList[p].data()};case 1:return function(f,p,h){return _nbind.externalList[p].data(h)};case 2:return function(f,p,h,E){return _nbind.externalList[p].data(h,E)};case 3:return function(f,p,h,E,C){return _nbind.externalList[p].data(h,E,C)};default:break}return buildJSCallerFunction(s,a)}_nbind.makeJSCaller=makeJSCaller;function makeMethodCaller(t,e){var r=e.typeList.length-1,s=e.typeList.slice(0);s.splice(1,0,\"uint32_t\",e.boundID);var a=_nbind.getTypes(s,e.title),n=a[0],c=a.slice(3),f=n.needsWireRead(e.policyTbl),p=anyNeedsWireWrite(c,e.policyTbl),h=e.ptr,E=e.num,C=_nbind.getDynCall(a,e.title),S=~e.flags&1;function b(){throw new Error(\"Calling a non-const method on a const object\")}if(!f&&!p)switch(r){case 0:return function(){return this.__nbindFlags&S?b():C(h,E,_nbind.pushPointer(this,t))};case 1:return function(I){return this.__nbindFlags&S?b():C(h,E,_nbind.pushPointer(this,t),I)};case 2:return function(I,T){return this.__nbindFlags&S?b():C(h,E,_nbind.pushPointer(this,t),I,T)};case 3:return function(I,T,N){return this.__nbindFlags&S?b():C(h,E,_nbind.pushPointer(this,t),I,T,N)};default:break}return buildCallerFunction(C,t,h,E,e.policyTbl,p,\"ptr,num,pushPointer(this,ptrType)\",n,c,S,b)}_nbind.makeMethodCaller=makeMethodCaller;function makeCaller(t){var e=t.typeList.length-1,r=_nbind.getTypes(t.typeList,t.title),s=r[0],a=r.slice(1),n=s.needsWireRead(t.policyTbl),c=anyNeedsWireWrite(a,t.policyTbl),f=t.direct,p=t.ptr;if(t.direct&&!n&&!c){var h=_nbind.getDynCall(r,t.title);switch(e){case 0:return function(){return h(f)};case 1:return function(b){return h(f,b)};case 2:return function(b,I){return h(f,b,I)};case 3:return function(b,I,T){return h(f,b,I,T)};default:break}p=0}var E;if(p){var C=t.typeList.slice(0);C.splice(1,0,\"uint32_t\"),r=_nbind.getTypes(C,t.title),E=\"ptr,num\"}else p=f,E=\"ptr\";var S=_nbind.getDynCall(r,t.title);return buildCallerFunction(S,null,p,t.num,t.policyTbl,c,E,s,a)}_nbind.makeCaller=makeCaller;function makeOverloader(t,e){var r=[];function s(){return r[arguments.length].apply(this,arguments)}return s.addMethod=function(a,n){r[n]=a},s.addMethod(t,e),s}_nbind.makeOverloader=makeOverloader;var Resource=function(){function t(e,r){var s=this;this.makeOpen=function(){return Object.keys(s.openTbl).join(\"\")},this.makeClose=function(){return Object.keys(s.closeTbl).join(\"\")},this.openTbl={},this.closeTbl={},e&&(this.openTbl[e]=!0),r&&(this.closeTbl[r]=!0)}return t.prototype.add=function(e){for(var r=0,s=Object.keys(e.openTbl);r<s.length;r++){var a=s[r];this.openTbl[a]=!0}for(var n=0,c=Object.keys(e.closeTbl);n<c.length;n++){var a=c[n];this.closeTbl[a]=!0}},t.prototype.remove=function(e){for(var r=0,s=Object.keys(e.openTbl);r<s.length;r++){var a=s[r];delete this.openTbl[a]}for(var n=0,c=Object.keys(e.closeTbl);n<c.length;n++){var a=c[n];delete this.closeTbl[a]}},t}();_nbind.Resource=Resource;function listResources(t,e){for(var r=new Resource,s=0,a=t;s<a.length;s++)for(var n=a[s],c=0,f=n.readResources||[];c<f.length;c++){var p=f[c];r.add(p)}for(var h=0,E=e;h<E.length;h++)for(var n=E[h],C=0,S=n.writeResources||[];C<S.length;C++){var p=S[C];r.add(p)}return r}_nbind.listResources=listResources,_nbind.resources={pool:new Resource(\"var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];\",\"_nbind.Pool.lreset(used,page);\")};var ExternalBuffer=function(t){__extends(e,t);function e(r,s){var a=t.call(this,r)||this;return a.ptr=s,a}return e.prototype.free=function(){_free(this.ptr)},e}(_nbind.External);function getBuffer(t){return t instanceof ArrayBuffer?new Uint8Array(t):t instanceof DataView?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function pushBuffer(t,e){if(t==null&&e&&e.Nullable&&(t=[]),typeof t!=\"object\")throw new Error(\"Type mismatch\");var r=t,s=r.byteLength||r.length;if(!s&&s!==0&&r.byteLength!==0)throw new Error(\"Type mismatch\");var a=_nbind.Pool.lalloc(8),n=_malloc(s),c=a/4;return HEAPU32[c++]=s,HEAPU32[c++]=n,HEAPU32[c++]=new ExternalBuffer(t,n).register(),HEAPU8.set(getBuffer(t),n),a}var BufferType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireWrite=pushBuffer,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,s){return function(a){return pushBuffer(a,s)}},e}(_nbind.BindType);_nbind.BufferType=BufferType;function commitBuffer(t,e,r){var s=_nbind.externalList[t].data,a=Buffer;if(typeof Buffer!=\"function\"&&(a=function(){}),!(s instanceof Array)){var n=HEAPU8.subarray(e,e+r);if(s instanceof a){var c=void 0;typeof Buffer.from==\"function\"&&Buffer.from.length>=3?c=Buffer.from(n):c=new Buffer(n),c.copy(s)}else getBuffer(s).set(n)}}_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var t=0,e=dirtyList;t<e.length;t++){var r=e[t];r.__nbindState&3||r.free()}dirtyList=[],gcTimer=0}_nbind.mark=function(t){};function toggleLightGC(t){t?_nbind.mark=function(e){dirtyList.push(e),gcTimer||(gcTimer=setTimeout(sweep,0))}:_nbind.mark=function(e){}}_nbind.toggleLightGC=toggleLightGC}(_nbind),Module.requestFullScreen=function t(e,r,s){Module.printErr(\"Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.\"),Module.requestFullScreen=Module.requestFullscreen,Browser.requestFullScreen(e,r,s)},Module.requestFullscreen=function t(e,r,s){Browser.requestFullscreen(e,r,s)},Module.requestAnimationFrame=function t(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function t(e,r,s){Browser.setCanvasSize(e,r,s)},Module.pauseMainLoop=function t(){Browser.mainLoop.pause()},Module.resumeMainLoop=function t(){Browser.mainLoop.resume()},Module.getUserMedia=function t(){Browser.getUserMedia()},Module.createContext=function t(e,r,s,a){return Browser.createContext(e,r,s,a)},ENVIRONMENT_IS_NODE?_emscripten_get_now=function(){var e=process.hrtime();return e[0]*1e3+e[1]/1e6}:typeof dateNow<\"u\"?_emscripten_get_now=dateNow:typeof self==\"object\"&&self.performance&&typeof self.performance.now==\"function\"?_emscripten_get_now=function(){return self.performance.now()}:typeof performance==\"object\"&&typeof performance.now==\"function\"?_emscripten_get_now=function(){return performance.now()}:_emscripten_get_now=Date.now,__ATEXIT__.push(function(){var t=Module._fflush;t&&t(0);var e=___syscall146.printChar;if(e){var r=___syscall146.buffers;r[1].length&&e(1,10),r[2].length&&e(2,10)}}),DYNAMICTOP_PTR=allocate(1,\"i32\",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0;function invoke_viiiii(t,e,r,s,a,n){try{Module.dynCall_viiiii(t,e,r,s,a,n)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_vif(t,e,r){try{Module.dynCall_vif(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_vid(t,e,r){try{Module.dynCall_vid(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_fiff(t,e,r,s){try{return Module.dynCall_fiff(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_vi(t,e){try{Module.dynCall_vi(t,e)}catch(r){if(typeof r!=\"number\"&&r!==\"longjmp\")throw r;Module.setThrew(1,0)}}function invoke_vii(t,e,r){try{Module.dynCall_vii(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_ii(t,e){try{return Module.dynCall_ii(t,e)}catch(r){if(typeof r!=\"number\"&&r!==\"longjmp\")throw r;Module.setThrew(1,0)}}function invoke_viddi(t,e,r,s,a){try{Module.dynCall_viddi(t,e,r,s,a)}catch(n){if(typeof n!=\"number\"&&n!==\"longjmp\")throw n;Module.setThrew(1,0)}}function invoke_vidd(t,e,r,s){try{Module.dynCall_vidd(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_iiii(t,e,r,s){try{return Module.dynCall_iiii(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_diii(t,e,r,s){try{return Module.dynCall_diii(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_di(t,e){try{return Module.dynCall_di(t,e)}catch(r){if(typeof r!=\"number\"&&r!==\"longjmp\")throw r;Module.setThrew(1,0)}}function invoke_iid(t,e,r){try{return Module.dynCall_iid(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_iii(t,e,r){try{return Module.dynCall_iii(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_viiddi(t,e,r,s,a,n){try{Module.dynCall_viiddi(t,e,r,s,a,n)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_viiiiii(t,e,r,s,a,n,c){try{Module.dynCall_viiiiii(t,e,r,s,a,n,c)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_dii(t,e,r){try{return Module.dynCall_dii(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_i(t){try{return Module.dynCall_i(t)}catch(e){if(typeof e!=\"number\"&&e!==\"longjmp\")throw e;Module.setThrew(1,0)}}function invoke_iiiiii(t,e,r,s,a,n){try{return Module.dynCall_iiiiii(t,e,r,s,a,n)}catch(c){if(typeof c!=\"number\"&&c!==\"longjmp\")throw c;Module.setThrew(1,0)}}function invoke_viiid(t,e,r,s,a){try{Module.dynCall_viiid(t,e,r,s,a)}catch(n){if(typeof n!=\"number\"&&n!==\"longjmp\")throw n;Module.setThrew(1,0)}}function invoke_viififi(t,e,r,s,a,n,c){try{Module.dynCall_viififi(t,e,r,s,a,n,c)}catch(f){if(typeof f!=\"number\"&&f!==\"longjmp\")throw f;Module.setThrew(1,0)}}function invoke_viii(t,e,r,s){try{Module.dynCall_viii(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_v(t){try{Module.dynCall_v(t)}catch(e){if(typeof e!=\"number\"&&e!==\"longjmp\")throw e;Module.setThrew(1,0)}}function invoke_viid(t,e,r,s){try{Module.dynCall_viid(t,e,r,s)}catch(a){if(typeof a!=\"number\"&&a!==\"longjmp\")throw a;Module.setThrew(1,0)}}function invoke_idd(t,e,r){try{return Module.dynCall_idd(t,e,r)}catch(s){if(typeof s!=\"number\"&&s!==\"longjmp\")throw s;Module.setThrew(1,0)}}function invoke_viiii(t,e,r,s,a){try{Module.dynCall_viiii(t,e,r,s,a)}catch(n){if(typeof n!=\"number\"&&n!==\"longjmp\")throw n;Module.setThrew(1,0)}}Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(t,e,r){var s=new t.Int8Array(r),a=new t.Int16Array(r),n=new t.Int32Array(r),c=new t.Uint8Array(r),f=new t.Uint16Array(r),p=new t.Uint32Array(r),h=new t.Float32Array(r),E=new t.Float64Array(r),C=e.DYNAMICTOP_PTR|0,S=e.tempDoublePtr|0,b=e.ABORT|0,I=e.STACKTOP|0,T=e.STACK_MAX|0,N=e.cttz_i8|0,U=e.___dso_handle|0,W=0,ee=0,ie=0,ue=0,le=t.NaN,me=t.Infinity,pe=0,Be=0,Ce=0,g=0,we=0,ye=0,Ae=t.Math.floor,se=t.Math.abs,X=t.Math.sqrt,De=t.Math.pow,Te=t.Math.cos,mt=t.Math.sin,j=t.Math.tan,rt=t.Math.acos,Fe=t.Math.asin,Ne=t.Math.atan,be=t.Math.atan2,Ve=t.Math.exp,ke=t.Math.log,it=t.Math.ceil,Ue=t.Math.imul,x=t.Math.min,w=t.Math.max,P=t.Math.clz32,y=t.Math.fround,F=e.abort,z=e.assert,Z=e.enlargeMemory,$=e.getTotalMemory,oe=e.abortOnCannotGrowMemory,xe=e.invoke_viiiii,Re=e.invoke_vif,lt=e.invoke_vid,Ct=e.invoke_fiff,qt=e.invoke_vi,ir=e.invoke_vii,bt=e.invoke_ii,gn=e.invoke_viddi,br=e.invoke_vidd,Ir=e.invoke_iiii,Or=e.invoke_diii,nn=e.invoke_di,ai=e.invoke_iid,Io=e.invoke_iii,ts=e.invoke_viiddi,$s=e.invoke_viiiiii,Co=e.invoke_dii,Hi=e.invoke_i,eo=e.invoke_iiiiii,wo=e.invoke_viiid,QA=e.invoke_viififi,Af=e.invoke_viii,dh=e.invoke_v,mh=e.invoke_viid,to=e.invoke_idd,jn=e.invoke_viiii,Rs=e._emscripten_asm_const_iiiii,ro=e._emscripten_asm_const_iiidddddd,ou=e._emscripten_asm_const_iiiid,au=e.__nbind_reference_external,lu=e._emscripten_asm_const_iiiiiiii,RA=e._removeAccessorPrefix,TA=e._typeModule,oa=e.__nbind_register_pool,aa=e.__decorate,FA=e._llvm_stackrestore,gr=e.___cxa_atexit,Bo=e.__extends,Me=e.__nbind_get_value_object,cu=e.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,Cr=e._emscripten_set_main_loop_timing,pf=e.__nbind_register_primitive,NA=e.__nbind_register_type,OA=e._emscripten_memcpy_big,uu=e.__nbind_register_function,fu=e.___setErrNo,oc=e.__nbind_register_class,ve=e.__nbind_finish,Nt=e._abort,ac=e._nbind_value,Oi=e._llvm_stacksave,no=e.___syscall54,Tt=e._defineHidden,xn=e._emscripten_set_main_loop,la=e._emscripten_get_now,ji=e.__nbind_register_callback_signature,Li=e._emscripten_asm_const_iiiiii,Na=e.__nbind_free_external,dn=e._emscripten_asm_const_iiii,Kn=e._emscripten_asm_const_iiididi,Au=e.___syscall6,yh=e._atexit,Oa=e.___syscall140,La=e.___syscall146,Ma=y(0);let $e=y(0);function Ua(o){o=o|0;var l=0;return l=I,I=I+o|0,I=I+15&-16,l|0}function hf(){return I|0}function lc(o){o=o|0,I=o}function wn(o,l){o=o|0,l=l|0,I=o,T=l}function ca(o,l){o=o|0,l=l|0,W||(W=o,ee=l)}function LA(o){o=o|0,ye=o}function MA(){return ye|0}function ua(){var o=0,l=0;Qr(8104,8,400)|0,Qr(8504,408,540)|0,o=9044,l=o+44|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));s[9088]=0,s[9089]=1,n[2273]=0,n[2274]=948,n[2275]=948,gr(17,8104,U|0)|0}function Bl(o){o=o|0,dt(o+948|0)}function Mt(o){return o=y(o),((fb(o)|0)&2147483647)>>>0>2139095040|0}function kn(o,l,u){o=o|0,l=l|0,u=u|0;e:do if(n[o+(l<<3)+4>>2]|0)o=o+(l<<3)|0;else{if((l|2|0)==3&&n[o+60>>2]|0){o=o+56|0;break}switch(l|0){case 0:case 2:case 4:case 5:{if(n[o+52>>2]|0){o=o+48|0;break e}break}default:}if(n[o+68>>2]|0){o=o+64|0;break}else{o=(l|1|0)==5?948:u;break}}while(!1);return o|0}function fa(o){o=o|0;var l=0;return l=_b(1e3)|0,Ha(o,(l|0)!=0,2456),n[2276]=(n[2276]|0)+1,Qr(l|0,8104,1e3)|0,s[o+2>>0]|0&&(n[l+4>>2]=2,n[l+12>>2]=4),n[l+976>>2]=o,l|0}function Ha(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;d=I,I=I+16|0,A=d,l||(n[A>>2]=u,Wg(o,5,3197,A)),I=d}function rs(){return fa(956)|0}function cc(o){o=o|0;var l=0;return l=Kt(1e3)|0,pu(l,o),Ha(n[o+976>>2]|0,1,2456),n[2276]=(n[2276]|0)+1,n[l+944>>2]=0,l|0}function pu(o,l){o=o|0,l=l|0;var u=0;Qr(o|0,l|0,948)|0,Dy(o+948|0,l+948|0),u=o+960|0,o=l+960|0,l=u+40|0;do n[u>>2]=n[o>>2],u=u+4|0,o=o+4|0;while((u|0)<(l|0))}function uc(o){o=o|0;var l=0,u=0,A=0,d=0;if(l=o+944|0,u=n[l>>2]|0,u|0&&(ja(u+948|0,o)|0,n[l>>2]=0),u=Mi(o)|0,u|0){l=0;do n[(Is(o,l)|0)+944>>2]=0,l=l+1|0;while((l|0)!=(u|0))}u=o+948|0,A=n[u>>2]|0,d=o+952|0,l=n[d>>2]|0,(l|0)!=(A|0)&&(n[d>>2]=l+(~((l+-4-A|0)>>>2)<<2)),vl(u),Hb(o),n[2276]=(n[2276]|0)+-1}function ja(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0;A=n[o>>2]|0,k=o+4|0,u=n[k>>2]|0,m=u;e:do if((A|0)==(u|0))d=A,B=4;else for(o=A;;){if((n[o>>2]|0)==(l|0)){d=o,B=4;break e}if(o=o+4|0,(o|0)==(u|0)){o=0;break}}while(!1);return(B|0)==4&&((d|0)!=(u|0)?(A=d+4|0,o=m-A|0,l=o>>2,l&&(Q2(d|0,A|0,o|0)|0,u=n[k>>2]|0),o=d+(l<<2)|0,(u|0)==(o|0)||(n[k>>2]=u+(~((u+-4-o|0)>>>2)<<2)),o=1):o=0),o|0}function Mi(o){return o=o|0,(n[o+952>>2]|0)-(n[o+948>>2]|0)>>2|0}function Is(o,l){o=o|0,l=l|0;var u=0;return u=n[o+948>>2]|0,(n[o+952>>2]|0)-u>>2>>>0>l>>>0?o=n[u+(l<<2)>>2]|0:o=0,o|0}function vl(o){o=o|0;var l=0,u=0,A=0,d=0;A=I,I=I+32|0,l=A,d=n[o>>2]|0,u=(n[o+4>>2]|0)-d|0,((n[o+8>>2]|0)-d|0)>>>0>u>>>0&&(d=u>>2,ky(l,d,d,o+8|0),Ab(o,l),Qy(l)),I=A}function gf(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0;M=Mi(o)|0;do if(M|0){if((n[(Is(o,0)|0)+944>>2]|0)==(o|0)){if(!(ja(o+948|0,l)|0))break;Qr(l+400|0,8504,540)|0,n[l+944>>2]=0,Oe(o);break}B=n[(n[o+976>>2]|0)+12>>2]|0,k=o+948|0,R=(B|0)==0,u=0,m=0;do A=n[(n[k>>2]|0)+(m<<2)>>2]|0,(A|0)==(l|0)?Oe(o):(d=cc(A)|0,n[(n[k>>2]|0)+(u<<2)>>2]=d,n[d+944>>2]=o,R||gU[B&15](A,d,o,u),u=u+1|0),m=m+1|0;while((m|0)!=(M|0));if(u>>>0<M>>>0){R=o+948|0,k=o+952|0,B=u,u=n[k>>2]|0;do m=(n[R>>2]|0)+(B<<2)|0,A=m+4|0,d=u-A|0,l=d>>2,l&&(Q2(m|0,A|0,d|0)|0,u=n[k>>2]|0),d=u,A=m+(l<<2)|0,(d|0)!=(A|0)&&(u=d+(~((d+-4-A|0)>>>2)<<2)|0,n[k>>2]=u),B=B+1|0;while((B|0)!=(M|0))}}while(!1)}function fc(o){o=o|0;var l=0,u=0,A=0,d=0;wi(o,(Mi(o)|0)==0,2491),wi(o,(n[o+944>>2]|0)==0,2545),l=o+948|0,u=n[l>>2]|0,A=o+952|0,d=n[A>>2]|0,(d|0)!=(u|0)&&(n[A>>2]=d+(~((d+-4-u|0)>>>2)<<2)),vl(l),l=o+976|0,u=n[l>>2]|0,Qr(o|0,8104,1e3)|0,s[u+2>>0]|0&&(n[o+4>>2]=2,n[o+12>>2]=4),n[l>>2]=u}function wi(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;d=I,I=I+16|0,A=d,l||(n[A>>2]=u,xo(o,5,3197,A)),I=d}function Qn(){return n[2276]|0}function Ac(){var o=0;return o=_b(20)|0,Ke((o|0)!=0,2592),n[2277]=(n[2277]|0)+1,n[o>>2]=n[239],n[o+4>>2]=n[240],n[o+8>>2]=n[241],n[o+12>>2]=n[242],n[o+16>>2]=n[243],o|0}function Ke(o,l){o=o|0,l=l|0;var u=0,A=0;A=I,I=I+16|0,u=A,o||(n[u>>2]=l,xo(0,5,3197,u)),I=A}function st(o){o=o|0,Hb(o),n[2277]=(n[2277]|0)+-1}function St(o,l){o=o|0,l=l|0;var u=0;l?(wi(o,(Mi(o)|0)==0,2629),u=1):(u=0,l=0),n[o+964>>2]=l,n[o+988>>2]=u}function lr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,m=A+8|0,d=A+4|0,B=A,n[d>>2]=l,wi(o,(n[l+944>>2]|0)==0,2709),wi(o,(n[o+964>>2]|0)==0,2763),te(o),l=o+948|0,n[B>>2]=(n[l>>2]|0)+(u<<2),n[m>>2]=n[B>>2],Ee(l,m,d)|0,n[(n[d>>2]|0)+944>>2]=o,Oe(o),I=A}function te(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;if(u=Mi(o)|0,u|0&&(n[(Is(o,0)|0)+944>>2]|0)!=(o|0)){A=n[(n[o+976>>2]|0)+12>>2]|0,d=o+948|0,m=(A|0)==0,l=0;do B=n[(n[d>>2]|0)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Xe,A=ae+12|0,Xe=n[m>>2]|0,n[m>>2]=n[A>>2],n[A>>2]=Xe,Qy(ae),A=n[L>>2]|0;break}m=A,B=((m-d>>2)+1|0)/-2|0,k=A+(B<<2)|0,d=R-m|0,m=d>>2,m&&(Q2(k|0,A|0,d|0)|0,A=n[M>>2]|0),Xe=k+(m<<2)|0,n[L>>2]=Xe,n[M>>2]=A+(B<<2),A=Xe}while(!1);n[A>>2]=n[u>>2],n[L>>2]=(n[L>>2]|0)+4,l=hb(o,Qe,l)|0,Qy(Qe)}while(!1);return I=tt,l|0}function Oe(o){o=o|0;var l=0;do{if(l=o+984|0,s[l>>0]|0)break;s[l>>0]=1,h[o+504>>2]=y(le),o=n[o+944>>2]|0}while(o|0)}function dt(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-4-A|0)>>>2)<<2)),It(u))}function Et(o){return o=o|0,n[o+944>>2]|0}function Pt(o){o=o|0,wi(o,(n[o+964>>2]|0)!=0,2832),Oe(o)}function tr(o){return o=o|0,(s[o+984>>0]|0)!=0|0}function An(o,l){o=o|0,l=l|0,s6e(o,l,400)|0&&(Qr(o|0,l|0,400)|0,Oe(o))}function li(o){o=o|0;var l=$e;return l=y(h[o+44>>2]),o=Mt(l)|0,y(o?y(0):l)}function Gi(o){o=o|0;var l=$e;return l=y(h[o+48>>2]),Mt(l)|0&&(l=s[(n[o+976>>2]|0)+2>>0]|0?y(1):y(0)),y(l)}function Rn(o,l){o=o|0,l=l|0,n[o+980>>2]=l}function Ga(o){return o=o|0,n[o+980>>2]|0}function my(o,l){o=o|0,l=l|0;var u=0;u=o+4|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function X1(o){return o=o|0,n[o+4>>2]|0}function vo(o,l){o=o|0,l=l|0;var u=0;u=o+8|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function yy(o){return o=o|0,n[o+8>>2]|0}function Eh(o,l){o=o|0,l=l|0;var u=0;u=o+12|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function $1(o){return o=o|0,n[o+12>>2]|0}function So(o,l){o=o|0,l=l|0;var u=0;u=o+16|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Ih(o){return o=o|0,n[o+16>>2]|0}function Ch(o,l){o=o|0,l=l|0;var u=0;u=o+20|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function hu(o){return o=o|0,n[o+20>>2]|0}function wh(o,l){o=o|0,l=l|0;var u=0;u=o+24|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Fg(o){return o=o|0,n[o+24>>2]|0}function Ng(o,l){o=o|0,l=l|0;var u=0;u=o+28|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Og(o){return o=o|0,n[o+28>>2]|0}function Ey(o,l){o=o|0,l=l|0;var u=0;u=o+32|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function df(o){return o=o|0,n[o+32>>2]|0}function Do(o,l){o=o|0,l=l|0;var u=0;u=o+36|0,(n[u>>2]|0)!=(l|0)&&(n[u>>2]=l,Oe(o))}function Sl(o){return o=o|0,n[o+36>>2]|0}function Bh(o,l){o=o|0,l=y(l);var u=0;u=o+40|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function Lg(o,l){o=o|0,l=y(l);var u=0;u=o+44|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function Dl(o,l){o=o|0,l=y(l);var u=0;u=o+48|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function Pl(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+52|0,d=o+56|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Iy(o,l){o=o|0,l=y(l);var u=0,A=0;A=o+52|0,u=o+56|0,y(h[A>>2])==l&&(n[u>>2]|0)==2||(h[A>>2]=l,A=Mt(l)|0,n[u>>2]=A?3:2,Oe(o))}function UA(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+52|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Cy(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+132+(l<<3)|0,l=o+132+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function wy(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=m?0:2,d=o+132+(l<<3)|0,l=o+132+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function _A(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=l+132+(u<<3)|0,l=n[A+4>>2]|0,u=o,n[u>>2]=n[A>>2],n[u+4>>2]=l}function HA(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+60+(l<<3)|0,l=o+60+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function Y(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=m?0:2,d=o+60+(l<<3)|0,l=o+60+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function xt(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=l+60+(u<<3)|0,l=n[A+4>>2]|0,u=o,n[u>>2]=n[A>>2],n[u+4>>2]=l}function jA(o,l){o=o|0,l=l|0;var u=0;u=o+60+(l<<3)+4|0,(n[u>>2]|0)!=3&&(h[o+60+(l<<3)>>2]=y(le),n[u>>2]=3,Oe(o))}function Po(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+204+(l<<3)|0,l=o+204+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function mf(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=m?0:2,d=o+204+(l<<3)|0,l=o+204+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function yt(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=l+204+(u<<3)|0,l=n[A+4>>2]|0,u=o,n[u>>2]=n[A>>2],n[u+4>>2]=l}function gu(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0,m=0;m=Mt(u)|0,A=(m^1)&1,d=o+276+(l<<3)|0,l=o+276+(l<<3)+4|0,m|y(h[d>>2])==u&&(n[l>>2]|0)==(A|0)||(h[d>>2]=u,n[l>>2]=A,Oe(o))}function By(o,l){return o=o|0,l=l|0,y(h[o+276+(l<<3)>>2])}function Mg(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+348|0,d=o+352|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function e2(o,l){o=o|0,l=y(l);var u=0,A=0;A=o+348|0,u=o+352|0,y(h[A>>2])==l&&(n[u>>2]|0)==2||(h[A>>2]=l,A=Mt(l)|0,n[u>>2]=A?3:2,Oe(o))}function vh(o){o=o|0;var l=0;l=o+352|0,(n[l>>2]|0)!=3&&(h[o+348>>2]=y(le),n[l>>2]=3,Oe(o))}function ur(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+348|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Ki(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+356|0,d=o+360|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function yf(o,l){o=o|0,l=y(l);var u=0,A=0;A=o+356|0,u=o+360|0,y(h[A>>2])==l&&(n[u>>2]|0)==2||(h[A>>2]=l,A=Mt(l)|0,n[u>>2]=A?3:2,Oe(o))}function qa(o){o=o|0;var l=0;l=o+360|0,(n[l>>2]|0)!=3&&(h[o+356>>2]=y(le),n[l>>2]=3,Oe(o))}function Ug(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+356|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function du(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+364|0,d=o+368|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Ef(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+364|0,d=o+368|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function wt(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+364|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function di(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+372|0,d=o+376|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function GA(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+372|0,d=o+376|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Wa(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+372|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Aa(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+380|0,d=o+384|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Ya(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+380|0,d=o+384|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function _g(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+380|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function Sh(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=(m^1)&1,A=o+388|0,d=o+392|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function Hg(o,l){o=o|0,l=y(l);var u=0,A=0,d=0,m=0;m=Mt(l)|0,u=m?0:2,A=o+388|0,d=o+392|0,m|y(h[A>>2])==l&&(n[d>>2]|0)==(u|0)||(h[A>>2]=l,n[d>>2]=u,Oe(o))}function vy(o,l){o=o|0,l=l|0;var u=0,A=0;A=l+388|0,u=n[A+4>>2]|0,l=o,n[l>>2]=n[A>>2],n[l+4>>2]=u}function qA(o,l){o=o|0,l=y(l);var u=0;u=o+396|0,y(h[u>>2])!=l&&(h[u>>2]=l,Oe(o))}function jg(o){return o=o|0,y(h[o+396>>2])}function mu(o){return o=o|0,y(h[o+400>>2])}function yu(o){return o=o|0,y(h[o+404>>2])}function If(o){return o=o|0,y(h[o+408>>2])}function Ts(o){return o=o|0,y(h[o+412>>2])}function Eu(o){return o=o|0,y(h[o+416>>2])}function Gn(o){return o=o|0,y(h[o+420>>2])}function ns(o,l){switch(o=o|0,l=l|0,wi(o,(l|0)<6,2918),l|0){case 0:{l=(n[o+496>>2]|0)==2?5:4;break}case 2:{l=(n[o+496>>2]|0)==2?4:5;break}default:}return y(h[o+424+(l<<2)>>2])}function bi(o,l){switch(o=o|0,l=l|0,wi(o,(l|0)<6,2918),l|0){case 0:{l=(n[o+496>>2]|0)==2?5:4;break}case 2:{l=(n[o+496>>2]|0)==2?4:5;break}default:}return y(h[o+448+(l<<2)>>2])}function WA(o,l){switch(o=o|0,l=l|0,wi(o,(l|0)<6,2918),l|0){case 0:{l=(n[o+496>>2]|0)==2?5:4;break}case 2:{l=(n[o+496>>2]|0)==2?4:5;break}default:}return y(h[o+472+(l<<2)>>2])}function Cf(o,l){o=o|0,l=l|0;var u=0,A=$e;return u=n[o+4>>2]|0,(u|0)==(n[l+4>>2]|0)?u?(A=y(h[o>>2]),o=y(se(y(A-y(h[l>>2]))))<y(999999974e-13)):o=1:o=0,o|0}function mn(o,l){o=y(o),l=y(l);var u=0;return Mt(o)|0?u=Mt(l)|0:u=y(se(y(o-l)))<y(999999974e-13),u|0}function Gg(o,l){o=o|0,l=l|0,qg(o,l)}function qg(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u+4|0,n[A>>2]=0,n[A+4>>2]=0,n[A+8>>2]=0,cu(A|0,o|0,l|0,0),xo(o,3,(s[A+11>>0]|0)<0?n[A>>2]|0:A,u),b6e(A),I=u}function is(o,l,u,A){o=y(o),l=y(l),u=u|0,A=A|0;var d=$e;o=y(o*l),d=y(cU(o,y(1)));do if(mn(d,y(0))|0)o=y(o-d);else{if(o=y(o-d),mn(d,y(1))|0){o=y(o+y(1));break}if(u){o=y(o+y(1));break}A||(d>y(.5)?d=y(1):(A=mn(d,y(.5))|0,d=y(A?1:0)),o=y(o+d))}while(!1);return y(o/l)}function bl(o,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=cr+72|0,Le=cr+56|0,Lt=cr+8|0,ct=cr,We=(n[2279]|0)+1|0,n[2279]=We,Rr=o+984|0,s[Rr>>0]|0&&(n[o+512>>2]|0)!=(n[2278]|0)?Xe=4:(n[o+516>>2]|0)==(A|0)?Hr=0:Xe=4,(Xe|0)==4&&(n[o+520>>2]=0,n[o+924>>2]=-1,n[o+928>>2]=-1,h[o+932>>2]=y(-1),h[o+936>>2]=y(-1),Hr=1);e:do if(n[o+964>>2]|0)if(Qe=y(yn(o,2,B)),tt=y(yn(o,0,B)),q=o+916|0,To=y(h[q>>2]),Ro=y(h[o+920>>2]),Hn=y(h[o+932>>2]),bl(d,l,m,u,n[o+924>>2]|0,To,n[o+928>>2]|0,Ro,Hn,y(h[o+936>>2]),Qe,tt,L)|0)Xe=22;else if(Ye=n[o+520>>2]|0,!Ye)Xe=21;else for(ae=0;;){if(q=o+524+(ae*24|0)|0,Hn=y(h[q>>2]),Ro=y(h[o+524+(ae*24|0)+4>>2]),To=y(h[o+524+(ae*24|0)+16>>2]),bl(d,l,m,u,n[o+524+(ae*24|0)+8>>2]|0,Hn,n[o+524+(ae*24|0)+12>>2]|0,Ro,To,y(h[o+524+(ae*24|0)+20>>2]),Qe,tt,L)|0){Xe=22;break e}if(ae=ae+1|0,ae>>>0>=Ye>>>0){Xe=21;break}}else{if(R){if(q=o+916|0,!(mn(y(h[q>>2]),l)|0)){Xe=21;break}if(!(mn(y(h[o+920>>2]),u)|0)){Xe=21;break}if((n[o+924>>2]|0)!=(d|0)){Xe=21;break}q=(n[o+928>>2]|0)==(m|0)?q:0,Xe=22;break}if(Ye=n[o+520>>2]|0,!Ye)Xe=21;else for(ae=0;;){if(q=o+524+(ae*24|0)|0,mn(y(h[q>>2]),l)|0&&mn(y(h[o+524+(ae*24|0)+4>>2]),u)|0&&(n[o+524+(ae*24|0)+8>>2]|0)==(d|0)&&(n[o+524+(ae*24|0)+12>>2]|0)==(m|0)){Xe=22;break e}if(ae=ae+1|0,ae>>>0>=Ye>>>0){Xe=21;break}}}while(!1);do if((Xe|0)==21)s[11697]|0?(q=0,Xe=28):(q=0,Xe=31);else if((Xe|0)==22){if(ae=(s[11697]|0)!=0,!((q|0)!=0&(Hr^1)))if(ae){Xe=28;break}else{Xe=31;break}Le=q+16|0,n[o+908>>2]=n[Le>>2],Ye=q+20|0,n[o+912>>2]=n[Ye>>2],(s[11698]|0)==0|ae^1||(n[ct>>2]=Iu(We)|0,n[ct+4>>2]=We,xo(o,4,2972,ct),ae=n[o+972>>2]|0,ae|0&&ip[ae&127](o),d=pa(d,R)|0,m=pa(m,R)|0,Xa=+y(h[Le>>2]),Fo=+y(h[Ye>>2]),n[Lt>>2]=d,n[Lt+4>>2]=m,E[Lt+8>>3]=+l,E[Lt+16>>3]=+u,E[Lt+24>>3]=Xa,E[Lt+32>>3]=Fo,n[Lt+40>>2]=M,xo(o,4,2989,Lt))}while(!1);return(Xe|0)==28&&(ae=Iu(We)|0,n[Le>>2]=ae,n[Le+4>>2]=We,n[Le+8>>2]=Hr?3047:11699,xo(o,4,3038,Le),ae=n[o+972>>2]|0,ae|0&&ip[ae&127](o),Lt=pa(d,R)|0,Xe=pa(m,R)|0,n[He>>2]=Lt,n[He+4>>2]=Xe,E[He+8>>3]=+l,E[He+16>>3]=+u,n[He+24>>2]=M,xo(o,4,3049,He),Xe=31),(Xe|0)==31&&(Fs(o,l,u,A,d,m,B,k,R,L),s[11697]|0&&(ae=n[2279]|0,Lt=Iu(ae)|0,n[Gr>>2]=Lt,n[Gr+4>>2]=ae,n[Gr+8>>2]=Hr?3047:11699,xo(o,4,3083,Gr),ae=n[o+972>>2]|0,ae|0&&ip[ae&127](o),Lt=pa(d,R)|0,Gr=pa(m,R)|0,Fo=+y(h[o+908>>2]),Xa=+y(h[o+912>>2]),n[fr>>2]=Lt,n[fr+4>>2]=Gr,E[fr+8>>3]=Fo,E[fr+16>>3]=Xa,n[fr+24>>2]=M,xo(o,4,3092,fr)),n[o+516>>2]=A,q||(ae=o+520|0,q=n[ae>>2]|0,(q|0)==16&&(s[11697]|0&&xo(o,4,3124,$t),n[ae>>2]=0,q=0),R?q=o+916|0:(n[ae>>2]=q+1,q=o+524+(q*24|0)|0),h[q>>2]=l,h[q+4>>2]=u,n[q+8>>2]=d,n[q+12>>2]=m,n[q+16>>2]=n[o+908>>2],n[q+20>>2]=n[o+912>>2],q=0)),R&&(n[o+416>>2]=n[o+908>>2],n[o+420>>2]=n[o+912>>2],s[o+985>>0]=1,s[Rr>>0]=0),n[2279]=(n[2279]|0)+-1,n[o+512>>2]=n[2278],I=cr,Hr|(q|0)==0|0}function yn(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return A=y(K(o,l,u)),y(A+y(re(o,l,u)))}function xo(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=I,I=I+16|0,d=m,n[d>>2]=A,o?A=n[o+976>>2]|0:A=0,bh(A,o,l,u,d),I=m}function Iu(o){return o=o|0,(o>>>0>60?3201:3201+(60-o)|0)|0}function pa(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;return d=I,I=I+32|0,u=d+12|0,A=d,n[u>>2]=n[254],n[u+4>>2]=n[255],n[u+8>>2]=n[256],n[A>>2]=n[257],n[A+4>>2]=n[258],n[A+8>>2]=n[259],(o|0)>2?o=11699:o=n[(l?A:u)+(o<<2)>>2]|0,I=d,o|0}function Fs(o,l,u,A,d,m,B,k,R,M){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=m|0,B=y(B),k=y(k),R=R|0,M=M|0;var L=0,q=0,ae=0,Ye=0,Le=$e,Qe=$e,tt=$e,Xe=$e,ct=$e,He=$e,We=$e,Lt=0,Gr=0,fr=0,$t=$e,Rr=$e,Hr=0,cr=$e,Hn=0,Ro=0,To=0,Fo=0,Xa=0,Wh=0,Yh=0,gc=0,Vh=0,Tf=0,Ff=0,Jh=0,Kh=0,zh=0,on=0,dc=0,Zh=0,bu=0,Xh=$e,$h=$e,Nf=$e,Of=$e,xu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ui?d:m,Ec=ui?m:d,Nr=ui?Qu:lo,ct=ui?lo:Qu,ku=y(yn(o,2,B)),Xe=y(yn(o,0,B)),Qe=y(y(Xr(o+364|0,B))-Nr),tt=y(y(Xr(o+380|0,B))-Nr),He=y(y(Xr(o+372|0,k))-ct),We=y(y(Xr(o+388|0,k))-ct),Nf=ui?Qe:He,Of=ui?tt:We,ku=y(l-ku),l=y(ku-Nr),Mt(l)|0?Nr=l:Nr=y($n(y(pd(l,tt)),Qe)),up=y(u-Xe),l=y(up-ct),Mt(l)|0?No=l:No=y($n(y(pd(l,We)),He)),Qe=ui?Nr:No,Wn=ui?No:Nr;e:do if((fr|0)==1)for(A=0,q=0;;){if(L=Is(o,q)|0,!A)y(KA(L))>y(0)&&y(Qh(L))>y(0)?A=L:A=0;else if(n2(L)|0){Ye=0;break e}if(q=q+1|0,q>>>0>=co>>>0){Ye=A;break}}else Ye=0;while(!1);Lt=Ye+500|0,Gr=Ye+504|0,A=0,L=0,l=y(0),ae=0;do{if(q=n[(n[Lo>>2]|0)+(ae<<2)>>2]|0,(n[q+36>>2]|0)==1)by(q),s[q+985>>0]=1,s[q+984>>0]=0;else{vf(q),R&&Ph(q,At(q,Us)|0,Qe,Wn,Nr);do if((n[q+24>>2]|0)!=1)if((q|0)==(Ye|0)){n[Lt>>2]=n[2278],h[Gr>>2]=y(0);break}else{lb(o,q,Nr,d,No,Nr,No,m,Us,M);break}else L|0&&(n[L+960>>2]=q),n[q+960>>2]=0,L=q,A=A|0?A:q;while(!1);Ms=y(h[q+504>>2]),l=y(l+y(Ms+y(yn(q,Mr,Nr))))}ae=ae+1|0}while((ae|0)!=(co|0));for(To=l>Qe,yc=bu&((fr|0)==2&To)?1:fr,Hn=(Ec|0)==1,Xa=Hn&(R^1),Wh=(yc|0)==1,Yh=(yc|0)==2,gc=976+(Mr<<2)|0,Vh=(Ec|2|0)==2,zh=Hn&(bu^1),Tf=1040+(Ar<<2)|0,Ff=1040+(Mr<<2)|0,Jh=976+(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e=y(0),u=y(0)):on=101}else on=101;e:do if((on|0)==101)switch(on=0,Zh|0){case 1:{L=0,Xe=y(Qe*y(.5)),u=y(0);break e}case 2:{L=0,Xe=Qe,u=y(0);break e}case 3:{if(m>>>0<=1){L=0,Xe=y(0),u=y(0);break e}u=y((m+-1|0)>>>0),L=0,Xe=y(0),u=y(y($n(Qe,y(0)))/u);break e}case 5:{u=y(Qe/y((m+1|0)>>>0)),L=0,Xe=u;break e}case 4:{u=y(Qe/y(m>>>0)),L=0,Xe=y(u*y(.5));break e}default:{L=0,Xe=y(0),u=y(0);break e}}while(!1);if(l=y(Xh+Xe),Lt){tt=y(Qe/y(L|0)),ae=n[Lo>>2]|0,q=Hr,Qe=y(0);do{L=n[ae+(q<<2)>>2]|0;e:do if((n[L+36>>2]|0)!=1){switch(n[L+24>>2]|0){case 1:{if(ha(L,Mr)|0){if(!R)break e;zt=y(zA(L,Mr,cr)),zt=y(zt+y(vr(o,Mr))),zt=y(zt+y(K(L,Mr,Nr))),h[L+400+(n[Ff>>2]<<2)>>2]=zt;break e}break}case 0:if(Bi=(n[(kl(L,Mr)|0)+4>>2]|0)==3,zt=y(tt+l),l=Bi?zt:l,R&&(Bi=L+400+(n[Ff>>2]<<2)|0,h[Bi>>2]=y(l+y(h[Bi>>2]))),Bi=(n[(Ql(L,Mr)|0)+4>>2]|0)==3,zt=y(tt+l),l=Bi?zt:l,Xa){zt=y(u+y(yn(L,Mr,Nr))),Qe=Wn,l=y(l+y(zt+y(h[L+504>>2])));break e}else{l=y(l+y(u+y(ZA(L,Mr,Nr)))),Qe=y($n(Qe,y(ZA(L,Ar,Nr))));break e}default:}R&&(zt=y(Xe+y(vr(o,Mr))),Bi=L+400+(n[Ff>>2]<<2)|0,h[Bi>>2]=y(zt+y(h[Bi>>2])))}while(!1);q=q+1|0}while((q|0)!=(fr|0))}else Qe=y(0);if(u=y($h+l),Vh?Xe=y(y(qn(o,Ar,y(lo+Qe),Ru,B))-lo):Xe=Wn,tt=y(y(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4>>2]|0)==3){l=Le;break}if((n[(kl(ae,Ar)|0)+4>>2]|0)==3){l=y(Le+y($n(y(0),l)));break}switch(L|0){case 1:{l=Le;break e}case 2:{l=y(Le+y(l*y(.5)));break e}default:{l=y(Le+l);break e}}}while(!1);zt=y(Ms+l),Bi=ae+400+(n[Tf>>2]<<2)|0,h[Bi>>2]=y(zt+y(h[Bi>>2]))}while(!1);q=q+1|0}while((q|0)!=(fr|0))}if(Ms=y(Ms+tt),xu=y($n(xu,u)),m=Fo+1|0,fr>>>0>=co>>>0)break;l=cr,Hr=fr,Fo=m}do if(R){if(L=m>>>0>1,!L&&!(HL(o)|0))break;if(!(Mt(Wn)|0)){l=y(Wn-Ms);e:do switch(n[o+12>>2]|0){case 3:{Le=y(Le+l),He=y(0);break}case 2:{Le=y(Le+y(l*y(.5))),He=y(0);break}case 4:{Wn>Ms?He=y(l/y(m>>>0)):He=y(0);break}case 7:if(Wn>Ms){Le=y(Le+y(l/y(m<<1>>>0))),He=y(l/y(m>>>0)),He=L?He:y(0);break e}else{Le=y(Le+y(l*y(.5))),He=y(0);break e}case 6:{He=y(l/y(Fo>>>0)),He=Wn>Ms&L?He:y(0);break}default:He=y(0)}while(!1);if(m|0)for(Lt=1040+(Ar<<2)|0,Gr=976+(Ar<<2)|0,Ye=0,q=0;;){e:do if(q>>>0<co>>>0)for(Qe=y(0),tt=y(0),l=y(0),ae=q;;){L=n[(n[Lo>>2]|0)+(ae<<2)>>2]|0;do if((n[L+36>>2]|0)!=1&&!(n[L+24>>2]|0)){if((n[L+940>>2]|0)!=(Ye|0))break e;if(jL(L,Ar)|0&&(zt=y(h[L+908+(n[Gr>>2]<<2)>>2]),l=y($n(l,y(zt+y(yn(L,Ar,Nr)))))),(ss(o,L)|0)!=5)break;ao=y(Yg(L)),ao=y(ao+y(K(L,0,Nr))),zt=y(h[L+912>>2]),zt=y(y(zt+y(yn(L,0,Nr)))-ao),ao=y($n(tt,ao)),zt=y($n(Qe,zt)),Qe=zt,tt=ao,l=y($n(l,y(ao+zt)))}while(!1);if(L=ae+1|0,L>>>0<co>>>0)ae=L;else{ae=L;break}}else tt=y(0),l=y(0),ae=q;while(!1);if(ct=y(He+l),u=Le,Le=y(Le+ct),q>>>0<ae>>>0){Xe=y(u+tt),L=q;do{q=n[(n[Lo>>2]|0)+(L<<2)>>2]|0;e:do if((n[q+36>>2]|0)!=1&&!(n[q+24>>2]|0))switch(ss(o,q)|0){case 1:{zt=y(u+y(K(q,Ar,Nr))),h[q+400+(n[Lt>>2]<<2)>>2]=zt;break e}case 3:{zt=y(y(Le-y(re(q,Ar,Nr)))-y(h[q+908+(n[Gr>>2]<<2)>>2])),h[q+400+(n[Lt>>2]<<2)>>2]=zt;break e}case 2:{zt=y(u+y(y(ct-y(h[q+908+(n[Gr>>2]<<2)>>2]))*y(.5))),h[q+400+(n[Lt>>2]<<2)>>2]=zt;break e}case 4:{if(zt=y(u+y(K(q,Ar,Nr))),h[q+400+(n[Lt>>2]<<2)>>2]=zt,io(q,Ar,Wn)|0||(ui?(Qe=y(h[q+908>>2]),l=y(Qe+y(yn(q,Mr,Nr))),tt=ct):(tt=y(h[q+912>>2]),tt=y(tt+y(yn(q,Ar,Nr))),l=ct,Qe=y(h[q+908>>2])),mn(l,Qe)|0&&mn(tt,y(h[q+912>>2]))|0))break e;xl(q,l,tt,Us,1,1,Nr,No,1,3501,M)|0;break e}case 5:{h[q+404>>2]=y(y(Xe-y(Yg(q)))+y(zA(q,0,Wn)));break e}default:break e}while(!1);L=L+1|0}while((L|0)!=(ae|0))}if(Ye=Ye+1|0,(Ye|0)==(m|0))break;q=ae}}}while(!1);if(h[o+908>>2]=y(qn(o,2,ku,B,B)),h[o+912>>2]=y(qn(o,0,up,k,B)),yc|0&&(fp=n[o+32>>2]|0,Ap=(yc|0)==2,!(Ap&(fp|0)!=2))?Ap&(fp|0)==2&&(l=y(Qu+cr),l=y($n(y(pd(l,y(Vg(o,Mr,xu,Oo)))),Qu)),on=198):(l=y(qn(o,Mr,xu,Oo,B)),on=198),(on|0)==198&&(h[o+908+(n[976+(Mr<<2)>>2]<<2)>>2]=l),Ec|0&&(hp=n[o+32>>2]|0,gp=(Ec|0)==2,!(gp&(hp|0)!=2))?gp&(hp|0)==2&&(l=y(lo+Wn),l=y($n(y(pd(l,y(Vg(o,Ar,y(lo+Ms),Ru)))),lo)),on=204):(l=y(qn(o,Ar,y(lo+Ms),Ru,B)),on=204),(on|0)==204&&(h[o+908+(n[976+(Ar<<2)>>2]<<2)>>2]=l),R){if((n[pp>>2]|0)==2){q=976+(Ar<<2)|0,ae=1040+(Ar<<2)|0,L=0;do Ye=Is(o,L)|0,n[Ye+24>>2]|0||(dp=n[q>>2]|0,zt=y(h[o+908+(dp<<2)>>2]),Bi=Ye+400+(n[ae>>2]<<2)|0,zt=y(zt-y(h[Bi>>2])),h[Bi>>2]=y(zt-y(h[Ye+908+(dp<<2)>>2]))),L=L+1|0;while((L|0)!=(co|0))}if(A|0){L=ui?yc:d;do qL(o,A,Nr,L,No,Us,M),A=n[A+960>>2]|0;while(A|0)}if(L=(Mr|2|0)==3,q=(Ar|2|0)==3,L|q){A=0;do ae=n[(n[Lo>>2]|0)+(A<<2)>>2]|0,(n[ae+36>>2]|0)!=1&&(L&&i2(o,ae,Mr),q&&i2(o,ae,Ar)),A=A+1|0;while((A|0)!=(co|0))}}}while(!1);I=Ic}function Dh(o,l){o=o|0,l=y(l);var u=0;Ha(o,l>=y(0),3147),u=l==y(0),h[o+4>>2]=u?y(0):l}function YA(o,l,u,A){o=o|0,l=y(l),u=y(u),A=A|0;var d=$e,m=$e,B=0,k=0,R=0;n[2278]=(n[2278]|0)+1,vf(o),io(o,2,l)|0?(d=y(Xr(n[o+992>>2]|0,l)),R=1,d=y(d+y(yn(o,2,l)))):(d=y(Xr(o+380|0,l)),d>=y(0)?R=2:(R=((Mt(l)|0)^1)&1,d=l)),io(o,0,u)|0?(m=y(Xr(n[o+996>>2]|0,u)),k=1,m=y(m+y(yn(o,0,l)))):(m=y(Xr(o+388|0,u)),m>=y(0)?k=2:(k=((Mt(u)|0)^1)&1,m=u)),B=o+976|0,xl(o,d,m,A,R,k,l,u,1,3189,n[B>>2]|0)|0&&(Ph(o,n[o+496>>2]|0,l,u,l),VA(o,y(h[(n[B>>2]|0)+4>>2]),y(0),y(0)),s[11696]|0)&&Gg(o,7)}function vf(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;k=I,I=I+32|0,B=k+24|0,m=k+16|0,A=k+8|0,d=k,u=0;do l=o+380+(u<<3)|0,n[o+380+(u<<3)+4>>2]|0&&(R=l,M=n[R+4>>2]|0,L=A,n[L>>2]=n[R>>2],n[L+4>>2]=M,L=o+364+(u<<3)|0,M=n[L+4>>2]|0,R=d,n[R>>2]=n[L>>2],n[R+4>>2]=M,n[m>>2]=n[A>>2],n[m+4>>2]=n[A+4>>2],n[B>>2]=n[d>>2],n[B+4>>2]=n[d+4>>2],Cf(m,B)|0)||(l=o+348+(u<<3)|0),n[o+992+(u<<2)>>2]=l,u=u+1|0;while((u|0)!=2);I=k}function io(o,l,u){o=o|0,l=l|0,u=y(u);var A=0;switch(o=n[o+992+(n[976+(l<<2)>>2]<<2)>>2]|0,n[o+4>>2]|0){case 0:case 3:{o=0;break}case 1:{y(h[o>>2])<y(0)?o=0:A=5;break}case 2:{y(h[o>>2])<y(0)?o=0:o=(Mt(u)|0)^1;break}default:A=5}return(A|0)==5&&(o=1),o|0}function Xr(o,l){switch(o=o|0,l=y(l),n[o+4>>2]|0){case 2:{l=y(y(y(h[o>>2])*l)/y(100));break}case 1:{l=y(h[o>>2]);break}default:l=y(le)}return y(l)}function Ph(o,l,u,A,d){o=o|0,l=l|0,u=y(u),A=y(A),d=y(d);var m=0,B=$e;l=n[o+944>>2]|0?l:1,m=dr(n[o+4>>2]|0,l)|0,l=Py(m,l)|0,u=y(ub(o,m,u)),A=y(ub(o,l,A)),B=y(u+y(K(o,m,d))),h[o+400+(n[1040+(m<<2)>>2]<<2)>>2]=B,u=y(u+y(re(o,m,d))),h[o+400+(n[1e3+(m<<2)>>2]<<2)>>2]=u,u=y(A+y(K(o,l,d))),h[o+400+(n[1040+(l<<2)>>2]<<2)>>2]=u,d=y(A+y(re(o,l,d))),h[o+400+(n[1e3+(l<<2)>>2]<<2)>>2]=d}function VA(o,l,u,A){o=o|0,l=y(l),u=y(u),A=y(A);var d=0,m=0,B=$e,k=$e,R=0,M=0,L=$e,q=0,ae=$e,Ye=$e,Le=$e,Qe=$e;if(l!=y(0)&&(d=o+400|0,Qe=y(h[d>>2]),m=o+404|0,Le=y(h[m>>2]),q=o+416|0,Ye=y(h[q>>2]),M=o+420|0,B=y(h[M>>2]),ae=y(Qe+u),L=y(Le+A),A=y(ae+Ye),k=y(L+B),R=(n[o+988>>2]|0)==1,h[d>>2]=y(is(Qe,l,0,R)),h[m>>2]=y(is(Le,l,0,R)),u=y(cU(y(Ye*l),y(1))),mn(u,y(0))|0?m=0:m=(mn(u,y(1))|0)^1,u=y(cU(y(B*l),y(1))),mn(u,y(0))|0?d=0:d=(mn(u,y(1))|0)^1,Qe=y(is(A,l,R&m,R&(m^1))),h[q>>2]=y(Qe-y(is(ae,l,0,R))),Qe=y(is(k,l,R&d,R&(d^1))),h[M>>2]=y(Qe-y(is(L,l,0,R))),m=(n[o+952>>2]|0)-(n[o+948>>2]|0)>>2,m|0)){d=0;do VA(Is(o,d)|0,l,ae,L),d=d+1|0;while((d|0)!=(m|0))}}function Sy(o,l,u,A,d){switch(o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,u|0){case 5:case 0:{o=dX(n[489]|0,A,d)|0;break}default:o=v6e(A,d)|0}return o|0}function Wg(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;d=I,I=I+16|0,m=d,n[m>>2]=A,bh(o,0,l,u,m),I=d}function bh(o,l,u,A,d){if(o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,o=o|0?o:956,LX[n[o+8>>2]&1](o,l,u,A,d)|0,(u|0)==5)Nt();else return}function pc(o,l,u){o=o|0,l=l|0,u=u|0,s[o+l>>0]=u&1}function Dy(o,l){o=o|0,l=l|0;var u=0,A=0;n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,u=l+4|0,A=(n[u>>2]|0)-(n[l>>2]|0)>>2,A|0&&(xh(o,A),kt(o,n[l>>2]|0,n[u>>2]|0,A))}function xh(o,l){o=o|0,l=l|0;var u=0;if((O(o)|0)>>>0<l>>>0&&sn(o),l>>>0>1073741823)Nt();else{u=Kt(l<<2)|0,n[o+4>>2]=u,n[o>>2]=u,n[o+8>>2]=u+(l<<2);return}}function kt(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,A=o+4|0,o=u-l|0,(o|0)>0&&(Qr(n[A>>2]|0,l|0,o|0)|0,n[A>>2]=(n[A>>2]|0)+(o>>>2<<2))}function O(o){return o=o|0,1073741823}function K(o,l,u){return o=o|0,l=l|0,u=y(u),de(l)|0&&n[o+96>>2]|0?o=o+92|0:o=kn(o+60|0,n[1040+(l<<2)>>2]|0,992)|0,y(Je(o,u))}function re(o,l,u){return o=o|0,l=l|0,u=y(u),de(l)|0&&n[o+104>>2]|0?o=o+100|0:o=kn(o+60|0,n[1e3+(l<<2)>>2]|0,992)|0,y(Je(o,u))}function de(o){return o=o|0,(o|1|0)==3|0}function Je(o,l){return o=o|0,l=y(l),(n[o+4>>2]|0)==3?l=y(0):l=y(Xr(o,l)),y(l)}function At(o,l){return o=o|0,l=l|0,o=n[o>>2]|0,(o|0?o:(l|0)>1?l:1)|0}function dr(o,l){o=o|0,l=l|0;var u=0;e:do if((l|0)==2){switch(o|0){case 2:{o=3;break e}case 3:break;default:{u=4;break e}}o=2}else u=4;while(!1);return o|0}function vr(o,l){o=o|0,l=l|0;var u=$e;return de(l)|0&&n[o+312>>2]|0&&(u=y(h[o+308>>2]),u>=y(0))||(u=y($n(y(h[(kn(o+276|0,n[1040+(l<<2)>>2]|0,992)|0)>>2]),y(0)))),y(u)}function Un(o,l){o=o|0,l=l|0;var u=$e;return de(l)|0&&n[o+320>>2]|0&&(u=y(h[o+316>>2]),u>=y(0))||(u=y($n(y(h[(kn(o+276|0,n[1e3+(l<<2)>>2]|0,992)|0)>>2]),y(0)))),y(u)}function mi(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return de(l)|0&&n[o+240>>2]|0&&(A=y(Xr(o+236|0,u)),A>=y(0))||(A=y($n(y(Xr(kn(o+204|0,n[1040+(l<<2)>>2]|0,992)|0,u)),y(0)))),y(A)}function Cs(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return de(l)|0&&n[o+248>>2]|0&&(A=y(Xr(o+244|0,u)),A>=y(0))||(A=y($n(y(Xr(kn(o+204|0,n[1e3+(l<<2)>>2]|0,992)|0,u)),y(0)))),y(A)}function JA(o,l,u,A,d,m,B){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=y(m),B=y(B);var k=$e,R=$e,M=$e,L=$e,q=$e,ae=$e,Ye=0,Le=0,Qe=0;Qe=I,I=I+16|0,Ye=Qe,Le=o+964|0,wi(o,(n[Le>>2]|0)!=0,3519),k=y(Va(o,2,l)),R=y(Va(o,0,l)),M=y(yn(o,2,l)),L=y(yn(o,0,l)),Mt(l)|0?q=l:q=y($n(y(0),y(y(l-M)-k))),Mt(u)|0?ae=u:ae=y($n(y(0),y(y(u-L)-R))),(A|0)==1&(d|0)==1?(h[o+908>>2]=y(qn(o,2,y(l-M),m,m)),l=y(qn(o,0,y(u-L),B,m))):(MX[n[Le>>2]&1](Ye,o,q,A,ae,d),q=y(k+y(h[Ye>>2])),ae=y(l-M),h[o+908>>2]=y(qn(o,2,(A|2|0)==2?q:ae,m,m)),ae=y(R+y(h[Ye+4>>2])),l=y(u-L),l=y(qn(o,0,(d|2|0)==2?ae:l,B,m))),h[o+912>>2]=l,I=Qe}function ab(o,l,u,A,d,m,B){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=y(m),B=y(B);var k=$e,R=$e,M=$e,L=$e;M=y(Va(o,2,m)),k=y(Va(o,0,m)),L=y(yn(o,2,m)),R=y(yn(o,0,m)),l=y(l-L),h[o+908>>2]=y(qn(o,2,(A|2|0)==2?M:l,m,m)),u=y(u-R),h[o+912>>2]=y(qn(o,0,(d|2|0)==2?k:u,B,m))}function t2(o,l,u,A,d,m,B){o=o|0,l=y(l),u=y(u),A=A|0,d=d|0,m=y(m),B=y(B);var k=0,R=$e,M=$e;return k=(A|0)==2,!(l<=y(0)&k)&&!(u<=y(0)&(d|0)==2)&&!((A|0)==1&(d|0)==1)?o=0:(R=y(yn(o,0,m)),M=y(yn(o,2,m)),k=l<y(0)&k|(Mt(l)|0),l=y(l-M),h[o+908>>2]=y(qn(o,2,k?y(0):l,m,m)),l=y(u-R),k=u<y(0)&(d|0)==2|(Mt(u)|0),h[o+912>>2]=y(qn(o,0,k?y(0):l,B,m)),o=1),o|0}function Py(o,l){return o=o|0,l=l|0,Jg(o)|0?o=dr(2,l)|0:o=0,o|0}function kh(o,l,u){return o=o|0,l=l|0,u=y(u),u=y(mi(o,l,u)),y(u+y(vr(o,l)))}function r2(o,l,u){return o=o|0,l=l|0,u=y(u),u=y(Cs(o,l,u)),y(u+y(Un(o,l)))}function Va(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return A=y(kh(o,l,u)),y(A+y(r2(o,l,u)))}function n2(o){return o=o|0,n[o+24>>2]|0?o=0:y(KA(o))!=y(0)?o=1:o=y(Qh(o))!=y(0),o|0}function KA(o){o=o|0;var l=$e;if(n[o+944>>2]|0){if(l=y(h[o+44>>2]),Mt(l)|0)return l=y(h[o+40>>2]),o=l>y(0)&((Mt(l)|0)^1),y(o?l:y(0))}else l=y(0);return y(l)}function Qh(o){o=o|0;var l=$e,u=0,A=$e;do if(n[o+944>>2]|0){if(l=y(h[o+48>>2]),Mt(l)|0){if(u=s[(n[o+976>>2]|0)+2>>0]|0,!(u<<24>>24)&&(A=y(h[o+40>>2]),A<y(0)&((Mt(A)|0)^1))){l=y(-A);break}l=u<<24>>24?y(1):y(0)}}else l=y(0);while(!1);return y(l)}function by(o){o=o|0;var l=0,u=0;if(eE(o+400|0,0,540)|0,s[o+985>>0]=1,te(o),u=Mi(o)|0,u|0){l=o+948|0,o=0;do by(n[(n[l>>2]|0)+(o<<2)>>2]|0),o=o+1|0;while((o|0)!=(u|0))}}function lb(o,l,u,A,d,m,B,k,R,M){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=y(m),B=y(B),k=k|0,R=R|0,M=M|0;var L=0,q=$e,ae=0,Ye=0,Le=$e,Qe=$e,tt=0,Xe=$e,ct=0,He=$e,We=0,Lt=0,Gr=0,fr=0,$t=0,Rr=0,Hr=0,cr=0,Hn=0,Ro=0;Hn=I,I=I+16|0,Gr=Hn+12|0,fr=Hn+8|0,$t=Hn+4|0,Rr=Hn,cr=dr(n[o+4>>2]|0,R)|0,We=de(cr)|0,q=y(Xr(WL(l)|0,We?m:B)),Lt=io(l,2,m)|0,Hr=io(l,0,B)|0;do if(!(Mt(q)|0)&&!(Mt(We?u:d)|0)){if(L=l+504|0,!(Mt(y(h[L>>2]))|0)&&(!(s2(n[l+976>>2]|0,0)|0)||(n[l+500>>2]|0)==(n[2278]|0)))break;h[L>>2]=y($n(q,y(Va(l,cr,m))))}else ae=7;while(!1);do if((ae|0)==7){if(ct=We^1,!(ct|Lt^1)){B=y(Xr(n[l+992>>2]|0,m)),h[l+504>>2]=y($n(B,y(Va(l,2,m))));break}if(!(We|Hr^1)){B=y(Xr(n[l+996>>2]|0,B)),h[l+504>>2]=y($n(B,y(Va(l,0,m))));break}h[Gr>>2]=y(le),h[fr>>2]=y(le),n[$t>>2]=0,n[Rr>>2]=0,Xe=y(yn(l,2,m)),He=y(yn(l,0,m)),Lt?(Le=y(Xe+y(Xr(n[l+992>>2]|0,m))),h[Gr>>2]=Le,n[$t>>2]=1,Ye=1):(Ye=0,Le=y(le)),Hr?(q=y(He+y(Xr(n[l+996>>2]|0,B))),h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de(l)|0&&n[o+96>>2]|0?l=4:l=n[1040+(l<<2)>>2]|0,o+60+(l<<3)|0}function Ql(o,l){return o=o|0,l=l|0,de(l)|0&&n[o+104>>2]|0?l=5:l=n[1e3+(l<<2)>>2]|0,o+60+(l<<3)|0}function Cu(o,l,u,A,d,m){switch(o=o|0,l=l|0,u=y(u),A=y(A),d=d|0,m=m|0,u=y(Xr(o+380+(n[976+(l<<2)>>2]<<3)|0,u)),u=y(u+y(yn(o,l,A))),n[d>>2]|0){case 2:case 1:{d=Mt(u)|0,A=y(h[m>>2]),h[m>>2]=d|A<u?A:u;break}case 0:{Mt(u)|0||(n[d>>2]=2,h[m>>2]=u);break}default:}}function ha(o,l){return o=o|0,l=l|0,o=o+132|0,de(l)|0&&n[(kn(o,4,948)|0)+4>>2]|0?o=1:o=(n[(kn(o,n[1040+(l<<2)>>2]|0,948)|0)+4>>2]|0)!=0,o|0}function zA(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0;return o=o+132|0,de(l)|0&&(A=kn(o,4,948)|0,(n[A+4>>2]|0)!=0)?d=4:(A=kn(o,n[1040+(l<<2)>>2]|0,948)|0,n[A+4>>2]|0?d=4:u=y(0)),(d|0)==4&&(u=y(Xr(A,u))),y(u)}function ZA(o,l,u){o=o|0,l=l|0,u=y(u);var A=$e;return A=y(h[o+908+(n[976+(l<<2)>>2]<<2)>>2]),A=y(A+y(K(o,l,u))),y(A+y(re(o,l,u)))}function HL(o){o=o|0;var l=0,u=0,A=0;e:do if(Jg(n[o+4>>2]|0)|0)l=0;else if((n[o+16>>2]|0)!=5)if(u=Mi(o)|0,!u)l=0;else for(l=0;;){if(A=Is(o,l)|0,!(n[A+24>>2]|0)&&(n[A+20>>2]|0)==5){l=1;break e}if(l=l+1|0,l>>>0>=u>>>0){l=0;break}}else l=1;while(!1);return l|0}function jL(o,l){o=o|0,l=l|0;var u=$e;return u=y(h[o+908+(n[976+(l<<2)>>2]<<2)>>2]),u>=y(0)&((Mt(u)|0)^1)|0}function Yg(o){o=o|0;var l=$e,u=0,A=0,d=0,m=0,B=0,k=0,R=$e;if(u=n[o+968>>2]|0,u)R=y(h[o+908>>2]),l=y(h[o+912>>2]),l=y(TX[u&0](o,R,l)),wi(o,(Mt(l)|0)^1,3573);else{m=Mi(o)|0;do if(m|0){for(u=0,d=0;;){if(A=Is(o,d)|0,n[A+940>>2]|0){B=8;break}if((n[A+24>>2]|0)!=1)if(k=(ss(o,A)|0)==5,k){u=A;break}else u=u|0?u:A;if(d=d+1|0,d>>>0>=m>>>0){B=8;break}}if((B|0)==8&&!u)break;return l=y(Yg(u)),y(l+y(h[u+404>>2]))}while(!1);l=y(h[o+912>>2])}return y(l)}function Vg(o,l,u,A){o=o|0,l=l|0,u=y(u),A=y(A);var d=$e,m=0;return Jg(l)|0?(l=1,m=3):de(l)|0?(l=0,m=3):(A=y(le),d=y(le)),(m|0)==3&&(d=y(Xr(o+364+(l<<3)|0,A)),A=y(Xr(o+380+(l<<3)|0,A))),m=A<u&(A>=y(0)&((Mt(A)|0)^1)),u=m?A:u,m=d>=y(0)&((Mt(d)|0)^1)&u<d,y(m?d:u)}function qL(o,l,u,A,d,m,B){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=m|0,B=B|0;var k=$e,R=$e,M=0,L=0,q=$e,ae=$e,Ye=$e,Le=0,Qe=0,tt=0,Xe=0,ct=$e,He=0;tt=dr(n[o+4>>2]|0,m)|0,Le=Py(tt,m)|0,Qe=de(tt)|0,q=y(yn(l,2,u)),ae=y(yn(l,0,u)),io(l,2,u)|0?k=y(q+y(Xr(n[l+992>>2]|0,u))):ha(l,2)|0&&xy(l,2)|0?(k=y(h[o+908>>2]),R=y(vr(o,2)),R=y(k-y(R+y(Un(o,2)))),k=y(zA(l,2,u)),k=y(qn(l,2,y(R-y(k+y(Rh(l,2,u)))),u,u))):k=y(le),io(l,0,d)|0?R=y(ae+y(Xr(n[l+996>>2]|0,d))):ha(l,0)|0&&xy(l,0)|0?(R=y(h[o+912>>2]),ct=y(vr(o,0)),ct=y(R-y(ct+y(Un(o,0)))),R=y(zA(l,0,d)),R=y(qn(l,0,y(ct-y(R+y(Rh(l,0,d)))),d,u))):R=y(le),M=Mt(k)|0,L=Mt(R)|0;do if(M^L&&(Ye=y(h[l+396>>2]),!(Mt(Ye)|0)))if(M){k=y(q+y(y(R-ae)*Ye));break}else{ct=y(ae+y(y(k-q)/Ye)),R=L?ct:R;break}while(!1);L=Mt(k)|0,M=Mt(R)|0,L|M&&(He=(L^1)&1,A=u>y(0)&((A|0)!=0&L),k=Qe?k:A?u:k,xl(l,k,R,m,Qe?He:A?2:He,L&(M^1)&1,k,R,0,3623,B)|0,k=y(h[l+908>>2]),k=y(k+y(yn(l,2,u))),R=y(h[l+912>>2]),R=y(R+y(yn(l,0,u)))),xl(l,k,R,m,1,1,k,R,1,3635,B)|0,xy(l,tt)|0&&!(ha(l,tt)|0)?(He=n[976+(tt<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),ct=y(ct-y(Un(o,tt))),ct=y(ct-y(re(l,tt,u))),ct=y(ct-y(Rh(l,tt,Qe?u:d))),h[l+400+(n[1040+(tt<<2)>>2]<<2)>>2]=ct):Xe=21;do if((Xe|0)==21){if(!(ha(l,tt)|0)&&(n[o+8>>2]|0)==1){He=n[976+(tt<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(y(ct-y(h[l+908+(He<<2)>>2]))*y(.5)),h[l+400+(n[1040+(tt<<2)>>2]<<2)>>2]=ct;break}!(ha(l,tt)|0)&&(n[o+8>>2]|0)==2&&(He=n[976+(tt<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),h[l+400+(n[1040+(tt<<2)>>2]<<2)>>2]=ct)}while(!1);xy(l,Le)|0&&!(ha(l,Le)|0)?(He=n[976+(Le<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),ct=y(ct-y(Un(o,Le))),ct=y(ct-y(re(l,Le,u))),ct=y(ct-y(Rh(l,Le,Qe?d:u))),h[l+400+(n[1040+(Le<<2)>>2]<<2)>>2]=ct):Xe=30;do if((Xe|0)==30&&!(ha(l,Le)|0)){if((ss(o,l)|0)==2){He=n[976+(Le<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(y(ct-y(h[l+908+(He<<2)>>2]))*y(.5)),h[l+400+(n[1040+(Le<<2)>>2]<<2)>>2]=ct;break}He=(ss(o,l)|0)==3,He^(n[o+28>>2]|0)==2&&(He=n[976+(Le<<2)>>2]|0,ct=y(h[o+908+(He<<2)>>2]),ct=y(ct-y(h[l+908+(He<<2)>>2])),h[l+400+(n[1040+(Le<<2)>>2]<<2)>>2]=ct)}while(!1)}function i2(o,l,u){o=o|0,l=l|0,u=u|0;var A=$e,d=0;d=n[976+(u<<2)>>2]|0,A=y(h[l+908+(d<<2)>>2]),A=y(y(h[o+908+(d<<2)>>2])-A),A=y(A-y(h[l+400+(n[1040+(u<<2)>>2]<<2)>>2])),h[l+400+(n[1e3+(u<<2)>>2]<<2)>>2]=A}function Jg(o){return o=o|0,(o|1|0)==1|0}function WL(o){o=o|0;var l=$e;switch(n[o+56>>2]|0){case 0:case 3:{l=y(h[o+40>>2]),l>y(0)&((Mt(l)|0)^1)?o=s[(n[o+976>>2]|0)+2>>0]|0?1056:992:o=1056;break}default:o=o+52|0}return o|0}function s2(o,l){return o=o|0,l=l|0,(s[o+l>>0]|0)!=0|0}function xy(o,l){return o=o|0,l=l|0,o=o+132|0,de(l)|0&&n[(kn(o,5,948)|0)+4>>2]|0?o=1:o=(n[(kn(o,n[1e3+(l<<2)>>2]|0,948)|0)+4>>2]|0)!=0,o|0}function Rh(o,l,u){o=o|0,l=l|0,u=y(u);var A=0,d=0;return o=o+132|0,de(l)|0&&(A=kn(o,5,948)|0,(n[A+4>>2]|0)!=0)?d=4:(A=kn(o,n[1e3+(l<<2)>>2]|0,948)|0,n[A+4>>2]|0?d=4:u=y(0)),(d|0)==4&&(u=y(Xr(A,u))),y(u)}function ub(o,l,u){return o=o|0,l=l|0,u=y(u),ha(o,l)|0?u=y(zA(o,l,u)):u=y(-y(Rh(o,l,u))),y(u)}function fb(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function ky(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>1073741823)Nt();else{d=Kt(l<<2)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<2)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<2)}function Ab(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>2)<<2)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function Qy(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-4-l|0)>>>2)<<2)),o=n[o>>2]|0,o|0&&It(o)}function pb(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;if(B=o+4|0,k=n[B>>2]|0,d=k-A|0,m=d>>2,o=l+(m<<2)|0,o>>>0<u>>>0){A=k;do n[A>>2]=n[o>>2],o=o+4|0,A=(n[B>>2]|0)+4|0,n[B>>2]=A;while(o>>>0<u>>>0)}m|0&&Q2(k+(0-m<<2)|0,l|0,d|0)|0}function hb(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0;return k=l+4|0,R=n[k>>2]|0,d=n[o>>2]|0,B=u,m=B-d|0,A=R+(0-(m>>2)<<2)|0,n[k>>2]=A,(m|0)>0&&Qr(A|0,d|0,m|0)|0,d=o+4|0,m=l+8|0,A=(n[d>>2]|0)-B|0,(A|0)>0&&(Qr(n[m>>2]|0,u|0,A|0)|0,n[m>>2]=(n[m>>2]|0)+(A>>>2<<2)),B=n[o>>2]|0,n[o>>2]=n[k>>2],n[k>>2]=B,B=n[d>>2]|0,n[d>>2]=n[m>>2],n[m>>2]=B,B=o+8|0,u=l+12|0,o=n[B>>2]|0,n[B>>2]=n[u>>2],n[u>>2]=o,n[l>>2]=n[k>>2],R|0}function o2(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;if(B=n[l>>2]|0,m=n[u>>2]|0,(B|0)!=(m|0)){d=o+8|0,u=((m+-4-B|0)>>>2)+1|0,o=B,A=n[d>>2]|0;do n[A>>2]=n[o>>2],A=(n[d>>2]|0)+4|0,n[d>>2]=A,o=o+4|0;while((o|0)!=(m|0));n[l>>2]=B+(u<<2)}}function a2(){ua()}function gb(){var o=0;return o=Kt(4)|0,l2(o),o|0}function l2(o){o=o|0,n[o>>2]=Ac()|0}function db(o){o=o|0,o|0&&(Kg(o),It(o))}function Kg(o){o=o|0,st(n[o>>2]|0)}function YL(o,l,u){o=o|0,l=l|0,u=u|0,pc(n[o>>2]|0,l,u)}function Ry(o,l){o=o|0,l=y(l),Dh(n[o>>2]|0,l)}function Ty(o,l){return o=o|0,l=l|0,s2(n[o>>2]|0,l)|0}function Fy(){var o=0;return o=Kt(8)|0,zg(o,0),o|0}function zg(o,l){o=o|0,l=l|0,l?l=fa(n[l>>2]|0)|0:l=rs()|0,n[o>>2]=l,n[o+4>>2]=0,Rn(l,o)}function Ny(o){o=o|0;var l=0;return l=Kt(8)|0,zg(l,o),l|0}function Zg(o){o=o|0,o|0&&(Oy(o),It(o))}function Oy(o){o=o|0;var l=0;uc(n[o>>2]|0),l=o+4|0,o=n[l>>2]|0,n[l>>2]=0,o|0&&(Sf(o),It(o))}function Sf(o){o=o|0,Df(o)}function Df(o){o=o|0,o=n[o>>2]|0,o|0&&Na(o|0)}function c2(o){return o=o|0,Ga(o)|0}function u2(o){o=o|0;var l=0,u=0;u=o+4|0,l=n[u>>2]|0,n[u>>2]=0,l|0&&(Sf(l),It(l)),fc(n[o>>2]|0)}function Ly(o,l){o=o|0,l=l|0,An(n[o>>2]|0,n[l>>2]|0)}function VL(o,l){o=o|0,l=l|0,wh(n[o>>2]|0,l)}function JL(o,l,u){o=o|0,l=l|0,u=+u,Cy(n[o>>2]|0,l,y(u))}function My(o,l,u){o=o|0,l=l|0,u=+u,wy(n[o>>2]|0,l,y(u))}function f2(o,l){o=o|0,l=l|0,Eh(n[o>>2]|0,l)}function A2(o,l){o=o|0,l=l|0,So(n[o>>2]|0,l)}function xr(o,l){o=o|0,l=l|0,Ch(n[o>>2]|0,l)}function so(o,l){o=o|0,l=l|0,my(n[o>>2]|0,l)}function zi(o,l){o=o|0,l=l|0,Ng(n[o>>2]|0,l)}function Ns(o,l){o=o|0,l=l|0,vo(n[o>>2]|0,l)}function XA(o,l,u){o=o|0,l=l|0,u=+u,HA(n[o>>2]|0,l,y(u))}function p2(o,l,u){o=o|0,l=l|0,u=+u,Y(n[o>>2]|0,l,y(u))}function ws(o,l){o=o|0,l=l|0,jA(n[o>>2]|0,l)}function Uy(o,l){o=o|0,l=l|0,Ey(n[o>>2]|0,l)}function Th(o,l){o=o|0,l=l|0,Do(n[o>>2]|0,l)}function Xg(o,l){o=o|0,l=+l,Bh(n[o>>2]|0,y(l))}function Fh(o,l){o=o|0,l=+l,Pl(n[o>>2]|0,y(l))}function h2(o,l){o=o|0,l=+l,Iy(n[o>>2]|0,y(l))}function g2(o,l){o=o|0,l=+l,Lg(n[o>>2]|0,y(l))}function d2(o,l){o=o|0,l=+l,Dl(n[o>>2]|0,y(l))}function m2(o,l){o=o|0,l=+l,Mg(n[o>>2]|0,y(l))}function Pf(o,l){o=o|0,l=+l,e2(n[o>>2]|0,y(l))}function sr(o){o=o|0,vh(n[o>>2]|0)}function _y(o,l){o=o|0,l=+l,Ki(n[o>>2]|0,y(l))}function y2(o,l){o=o|0,l=+l,yf(n[o>>2]|0,y(l))}function hc(o){o=o|0,qa(n[o>>2]|0)}function bf(o,l){o=o|0,l=+l,du(n[o>>2]|0,y(l))}function $g(o,l){o=o|0,l=+l,Ef(n[o>>2]|0,y(l))}function ed(o,l){o=o|0,l=+l,di(n[o>>2]|0,y(l))}function E2(o,l){o=o|0,l=+l,GA(n[o>>2]|0,y(l))}function I2(o,l){o=o|0,l=+l,Aa(n[o>>2]|0,y(l))}function wu(o,l){o=o|0,l=+l,Ya(n[o>>2]|0,y(l))}function td(o,l){o=o|0,l=+l,Sh(n[o>>2]|0,y(l))}function C2(o,l){o=o|0,l=+l,Hg(n[o>>2]|0,y(l))}function Hy(o,l){o=o|0,l=+l,qA(n[o>>2]|0,y(l))}function Bu(o,l,u){o=o|0,l=l|0,u=+u,gu(n[o>>2]|0,l,y(u))}function jy(o,l,u){o=o|0,l=l|0,u=+u,Po(n[o>>2]|0,l,y(u))}function rd(o,l,u){o=o|0,l=l|0,u=+u,mf(n[o>>2]|0,l,y(u))}function nd(o){return o=o|0,Fg(n[o>>2]|0)|0}function ko(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,_A(d,n[l>>2]|0,u),Bs(o,d),I=A}function Bs(o,l){o=o|0,l=l|0,Rl(o,n[l+4>>2]|0,+y(h[l>>2]))}function Rl(o,l,u){o=o|0,l=l|0,u=+u,n[o>>2]=l,E[o+8>>3]=u}function Gy(o){return o=o|0,$1(n[o>>2]|0)|0}function ga(o){return o=o|0,Ih(n[o>>2]|0)|0}function mb(o){return o=o|0,hu(n[o>>2]|0)|0}function Nh(o){return o=o|0,X1(n[o>>2]|0)|0}function w2(o){return o=o|0,Og(n[o>>2]|0)|0}function KL(o){return o=o|0,yy(n[o>>2]|0)|0}function yb(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,xt(d,n[l>>2]|0,u),Bs(o,d),I=A}function Eb(o){return o=o|0,df(n[o>>2]|0)|0}function qy(o){return o=o|0,Sl(n[o>>2]|0)|0}function B2(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,UA(A,n[l>>2]|0),Bs(o,A),I=u}function Oh(o){return o=o|0,+ +y(li(n[o>>2]|0))}function Ib(o){return o=o|0,+ +y(Gi(n[o>>2]|0))}function Cb(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,ur(A,n[l>>2]|0),Bs(o,A),I=u}function id(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,Ug(A,n[l>>2]|0),Bs(o,A),I=u}function zL(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,wt(A,n[l>>2]|0),Bs(o,A),I=u}function ZL(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,Wa(A,n[l>>2]|0),Bs(o,A),I=u}function wb(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,_g(A,n[l>>2]|0),Bs(o,A),I=u}function Bb(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,vy(A,n[l>>2]|0),Bs(o,A),I=u}function $A(o){return o=o|0,+ +y(jg(n[o>>2]|0))}function XL(o,l){return o=o|0,l=l|0,+ +y(By(n[o>>2]|0,l))}function $L(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,yt(d,n[l>>2]|0,u),Bs(o,d),I=A}function vu(o,l,u){o=o|0,l=l|0,u=u|0,lr(n[o>>2]|0,n[l>>2]|0,u)}function eM(o,l){o=o|0,l=l|0,gf(n[o>>2]|0,n[l>>2]|0)}function vb(o){return o=o|0,Mi(n[o>>2]|0)|0}function tM(o){return o=o|0,o=Et(n[o>>2]|0)|0,o?o=c2(o)|0:o=0,o|0}function Sb(o,l){return o=o|0,l=l|0,o=Is(n[o>>2]|0,l)|0,o?o=c2(o)|0:o=0,o|0}function xf(o,l){o=o|0,l=l|0;var u=0,A=0;A=Kt(4)|0,Db(A,l),u=o+4|0,l=n[u>>2]|0,n[u>>2]=A,l|0&&(Sf(l),It(l)),St(n[o>>2]|0,1)}function Db(o,l){o=o|0,l=l|0,sM(o,l)}function rM(o,l,u,A,d,m){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=m|0;var B=0,k=0;B=I,I=I+16|0,k=B,Pb(k,Ga(l)|0,+u,A,+d,m),h[o>>2]=y(+E[k>>3]),h[o+4>>2]=y(+E[k+8>>3]),I=B}function Pb(o,l,u,A,d,m){o=o|0,l=l|0,u=+u,A=A|0,d=+d,m=m|0;var B=0,k=0,R=0,M=0,L=0;B=I,I=I+32|0,L=B+8|0,M=B+20|0,R=B,k=B+16|0,E[L>>3]=u,n[M>>2]=A,E[R>>3]=d,n[k>>2]=m,Wy(o,n[l+4>>2]|0,L,M,R,k),I=B}function Wy(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0;B=I,I=I+16|0,k=B,Fl(k),l=Os(l)|0,bb(o,l,+E[u>>3],n[A>>2]|0,+E[d>>3],n[m>>2]|0),Nl(k),I=B}function Os(o){return o=o|0,n[o>>2]|0}function bb(o,l,u,A,d,m){o=o|0,l=l|0,u=+u,A=A|0,d=+d,m=m|0;var B=0;B=da(v2()|0)|0,u=+Ja(u),A=Yy(A)|0,d=+Ja(d),nM(o,Kn(0,B|0,l|0,+u,A|0,+d,Yy(m)|0)|0)}function v2(){var o=0;return s[7608]|0||(D2(9120),o=7608,n[o>>2]=1,n[o+4>>2]=0),9120}function da(o){return o=o|0,n[o+8>>2]|0}function Ja(o){return o=+o,+ +kf(o)}function Yy(o){return o=o|0,sd(o)|0}function nM(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;d=I,I=I+32|0,u=d,A=l,A&1?(Ka(u,0),Me(A|0,u|0)|0,S2(o,u),iM(u)):(n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=n[l+8>>2],n[o+12>>2]=n[l+12>>2]),I=d}function Ka(o,l){o=o|0,l=l|0,Su(o,l),n[o+8>>2]=0,s[o+24>>0]=0}function S2(o,l){o=o|0,l=l|0,l=l+8|0,n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=n[l+8>>2],n[o+12>>2]=n[l+12>>2]}function iM(o){o=o|0,s[o+24>>0]=0}function Su(o,l){o=o|0,l=l|0,n[o>>2]=l}function sd(o){return o=o|0,o|0}function kf(o){return o=+o,+o}function D2(o){o=o|0,Qo(o,P2()|0,4)}function P2(){return 1064}function Qo(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u,n[o+8>>2]=ji(l|0,u+1|0)|0}function sM(o,l){o=o|0,l=l|0,l=n[l>>2]|0,n[o>>2]=l,au(l|0)}function xb(o){o=o|0;var l=0,u=0;u=o+4|0,l=n[u>>2]|0,n[u>>2]=0,l|0&&(Sf(l),It(l)),St(n[o>>2]|0,0)}function kb(o){o=o|0,Pt(n[o>>2]|0)}function Vy(o){return o=o|0,tr(n[o>>2]|0)|0}function oM(o,l,u,A){o=o|0,l=+l,u=+u,A=A|0,YA(n[o>>2]|0,y(l),y(u),A)}function aM(o){return o=o|0,+ +y(mu(n[o>>2]|0))}function v(o){return o=o|0,+ +y(If(n[o>>2]|0))}function D(o){return o=o|0,+ +y(yu(n[o>>2]|0))}function Q(o){return o=o|0,+ +y(Ts(n[o>>2]|0))}function H(o){return o=o|0,+ +y(Eu(n[o>>2]|0))}function V(o){return o=o|0,+ +y(Gn(n[o>>2]|0))}function ne(o,l){o=o|0,l=l|0,E[o>>3]=+y(mu(n[l>>2]|0)),E[o+8>>3]=+y(If(n[l>>2]|0)),E[o+16>>3]=+y(yu(n[l>>2]|0)),E[o+24>>3]=+y(Ts(n[l>>2]|0)),E[o+32>>3]=+y(Eu(n[l>>2]|0)),E[o+40>>3]=+y(Gn(n[l>>2]|0))}function Se(o,l){return o=o|0,l=l|0,+ +y(ns(n[o>>2]|0,l))}function _e(o,l){return o=o|0,l=l|0,+ +y(bi(n[o>>2]|0,l))}function pt(o,l){return o=o|0,l=l|0,+ +y(WA(n[o>>2]|0,l))}function Wt(){return Qn()|0}function Sr(){Lr(),Xt(),zn(),yi(),za(),et()}function Lr(){u4e(11713,4938,1)}function Xt(){x_e(10448)}function zn(){u_e(10408)}function yi(){TUe(10324)}function za(){HLe(10096)}function et(){qe(9132)}function qe(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Xe=0,ct=0,He=0,We=0,Lt=0,Gr=0,fr=0,$t=0,Rr=0,Hr=0,cr=0,Hn=0,Ro=0,To=0,Fo=0,Xa=0,Wh=0,Yh=0,gc=0,Vh=0,Tf=0,Ff=0,Jh=0,Kh=0,zh=0,on=0,dc=0,Zh=0,bu=0,Xh=0,$h=0,Nf=0,Of=0,xu=0,oo=0,Ll=0,ma=0,mc=0,op=0,ap=0,Lf=0,lp=0,cp=0,ao=0,Ms=0,yc=0,Wn=0,up=0,No=0,ku=0,Oo=0,Qu=0,fp=0,Ap=0,Ru=0,lo=0,Ec=0,pp=0,hp=0,gp=0,Nr=0,ui=0,Us=0,Lo=0,co=0,Mr=0,Ar=0,Ic=0;l=I,I=I+672|0,u=l+656|0,Ic=l+648|0,Ar=l+640|0,Mr=l+632|0,co=l+624|0,Lo=l+616|0,Us=l+608|0,ui=l+600|0,Nr=l+592|0,gp=l+584|0,hp=l+576|0,pp=l+568|0,Ec=l+560|0,lo=l+552|0,Ru=l+544|0,Ap=l+536|0,fp=l+528|0,Qu=l+520|0,Oo=l+512|0,ku=l+504|0,No=l+496|0,up=l+488|0,Wn=l+480|0,yc=l+472|0,Ms=l+464|0,ao=l+456|0,cp=l+448|0,lp=l+440|0,Lf=l+432|0,ap=l+424|0,op=l+416|0,mc=l+408|0,ma=l+400|0,Ll=l+392|0,oo=l+384|0,xu=l+376|0,Of=l+368|0,Nf=l+360|0,$h=l+352|0,Xh=l+344|0,bu=l+336|0,Zh=l+328|0,dc=l+320|0,on=l+312|0,zh=l+304|0,Kh=l+296|0,Jh=l+288|0,Ff=l+280|0,Tf=l+272|0,Vh=l+264|0,gc=l+256|0,Yh=l+248|0,Wh=l+240|0,Xa=l+232|0,Fo=l+224|0,To=l+216|0,Ro=l+208|0,Hn=l+200|0,cr=l+192|0,Hr=l+184|0,Rr=l+176|0,$t=l+168|0,fr=l+160|0,Gr=l+152|0,Lt=l+144|0,We=l+136|0,He=l+128|0,ct=l+120|0,Xe=l+112|0,tt=l+104|0,Qe=l+96|0,Le=l+88|0,Ye=l+80|0,ae=l+72|0,q=l+64|0,L=l+56|0,M=l+48|0,R=l+40|0,k=l+32|0,B=l+24|0,m=l+16|0,d=l+8|0,A=l,gt(o,3646),Zt(o,3651,2)|0,Dr(o,3665,2)|0,Xn(o,3682,18)|0,n[Ic>>2]=19,n[Ic+4>>2]=0,n[u>>2]=n[Ic>>2],n[u+4>>2]=n[Ic+4>>2],kr(o,3690,u)|0,n[Ar>>2]=1,n[Ar+4>>2]=0,n[u>>2]=n[Ar>>2],n[u+4>>2]=n[Ar+4>>2],Tn(o,3696,u)|0,n[Mr>>2]=2,n[Mr+4>>2]=0,n[u>>2]=n[Mr>>2],n[u+4>>2]=n[Mr+4>>2],_n(o,3706,u)|0,n[co>>2]=1,n[co+4>>2]=0,n[u>>2]=n[co>>2],n[u+4>>2]=n[co+4>>2],zr(o,3722,u)|0,n[Lo>>2]=2,n[Lo+4>>2]=0,n[u>>2]=n[Lo>>2],n[u+4>>2]=n[Lo+4>>2],z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q+4>>2],ep(o,4669,u)|0,n[L>>2]=6,n[L+4>>2]=0,n[u>>2]=n[L>>2],n[u+4>>2]=n[L+4>>2],ep(o,4686,u)|0,n[M>>2]=7,n[M+4>>2]=0,n[u>>2]=n[M>>2],n[u+4>>2]=n[M+4>>2],ep(o,4701,u)|0,n[R>>2]=8,n[R+4>>2]=0,n[u>>2]=n[R>>2],n[u+4>>2]=n[R+4>>2],ep(o,4719,u)|0,n[k>>2]=9,n[k+4>>2]=0,n[u>>2]=n[k>>2],n[u+4>>2]=n[k+4>>2],ep(o,4736,u)|0,n[B>>2]=21,n[B+4>>2]=0,n[u>>2]=n[B>>2],n[u+4>>2]=n[B+4>>2],Dke(o,4754,u)|0,n[m>>2]=2,n[m+4>>2]=0,n[u>>2]=n[m>>2],n[u+4>>2]=n[m+4>>2],Qb(o,4772,u)|0,n[d>>2]=3,n[d+4>>2]=0,n[u>>2]=n[d>>2],n[u+4>>2]=n[d+4>>2],Qb(o,4790,u)|0,n[A>>2]=4,n[A+4>>2]=0,n[u>>2]=n[A>>2],n[u+4>>2]=n[A+4>>2],Qb(o,4808,u)|0,I=l}function gt(o,l){o=o|0,l=l|0;var u=0;u=RLe()|0,n[o>>2]=u,TLe(u,l),jh(n[o>>2]|0)}function Zt(o,l,u){return o=o|0,l=l|0,u=u|0,yLe(o,Bn(l)|0,u,0),o|0}function Dr(o,l,u){return o=o|0,l=l|0,u=u|0,rLe(o,Bn(l)|0,u,0),o|0}function Xn(o,l,u){return o=o|0,l=l|0,u=u|0,jOe(o,Bn(l)|0,u,0),o|0}function kr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],DOe(o,l,d),I=A,o|0}function Tn(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],aOe(o,l,d),I=A,o|0}function _n(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],WNe(o,l,d),I=A,o|0}function zr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xNe(o,l,d),I=A,o|0}function ci(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],pNe(o,l,d),I=A,o|0}function Du(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],ZFe(o,l,d),I=A,o|0}function lM(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],NFe(o,l,d),I=A,o|0}function od(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],aFe(o,l,d),I=A,o|0}function ep(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],WTe(o,l,d),I=A,o|0}function Qb(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xTe(o,l,d),I=A,o|0}function yke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],pTe(o,l,d),I=A,o|0}function Eke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],ZRe(o,l,d),I=A,o|0}function Ike(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],ORe(o,l,d),I=A,o|0}function Cke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],CRe(o,l,d),I=A,o|0}function wke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],iRe(o,l,d),I=A,o|0}function Bke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],HQe(o,l,d),I=A,o|0}function vke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],SQe(o,l,d),I=A,o|0}function Ske(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],aQe(o,l,d),I=A,o|0}function Dke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Pke(o,l,d),I=A,o|0}function Pke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],bke(o,u,d,1),I=A}function Bn(o){return o=o|0,o|0}function bke(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=cM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=xke(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,kke(m,A)|0,A),I=d}function cM(){var o=0,l=0;if(s[7616]|0||(pz(9136),gr(24,9136,U|0)|0,l=7616,n[l>>2]=1,n[l+4>>2]=0),!(_r(9136)|0)){o=9136,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));pz(9136)}return 9136}function xke(o){return o=o|0,0}function kke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=cM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Az(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(Tke(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function vn(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0;B=I,I=I+32|0,ae=B+24|0,q=B+20|0,R=B+16|0,L=B+12|0,M=B+8|0,k=B+4|0,Ye=B,n[q>>2]=l,n[R>>2]=u,n[L>>2]=A,n[M>>2]=d,n[k>>2]=m,m=o+28|0,n[Ye>>2]=n[m>>2],n[ae>>2]=n[Ye>>2],Qke(o+24|0,ae,q,L,M,R,k)|0,n[m>>2]=n[n[m>>2]>>2],I=B}function Qke(o,l,u,A,d,m,B){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0,o=Rke(l)|0,l=Kt(24)|0,fz(l+4|0,n[u>>2]|0,n[A>>2]|0,n[d>>2]|0,n[m>>2]|0,n[B>>2]|0),n[l>>2]=n[o>>2],n[o>>2]=l,l|0}function Rke(o){return o=o|0,n[o>>2]|0}function fz(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,n[o>>2]=l,n[o+4>>2]=u,n[o+8>>2]=A,n[o+12>>2]=d,n[o+16>>2]=m}function yr(o,l){return o=o|0,l=l|0,l|o|0}function Az(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function Tke(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=Fke(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,Nke(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Az(m,A,u),n[R>>2]=(n[R>>2]|0)+12,Oke(o,k),Lke(k),I=M;return}}function Fke(o){return o=o|0,357913941}function Nke(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function Oke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function Lke(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function pz(o){o=o|0,_ke(o)}function Mke(o){o=o|0,Uke(o+24|0)}function _r(o){return o=o|0,n[o>>2]|0}function Uke(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function _ke(o){o=o|0;var l=0;l=en()|0,tn(o,2,3,l,Hke()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function en(){return 9228}function Hke(){return 1140}function jke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=Gke(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=qke(l,A)|0,I=u,l|0}function tn(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,n[o>>2]=l,n[o+4>>2]=u,n[o+8>>2]=A,n[o+12>>2]=d,n[o+16>>2]=m}function Gke(o){return o=o|0,(n[(cM()|0)+24>>2]|0)+(o*12|0)|0}function qke(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;return d=I,I=I+48|0,A=d,u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),sp[u&31](A,o),A=Wke(A)|0,I=d,A|0}function Wke(o){o=o|0;var l=0,u=0,A=0,d=0;return d=I,I=I+32|0,l=d+12|0,u=d,A=uM(hz()|0)|0,A?(fM(l,A),AM(u,l),Yke(o,u),o=pM(l)|0):o=Vke(o)|0,I=d,o|0}function hz(){var o=0;return s[7632]|0||(nQe(9184),gr(25,9184,U|0)|0,o=7632,n[o>>2]=1,n[o+4>>2]=0),9184}function uM(o){return o=o|0,n[o+36>>2]|0}function fM(o,l){o=o|0,l=l|0,n[o>>2]=l,n[o+4>>2]=o,n[o+8>>2]=0}function AM(o,l){o=o|0,l=l|0,n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=0}function Yke(o,l){o=o|0,l=l|0,Zke(l,o,o+8|0,o+16|0,o+24|0,o+32|0,o+40|0)|0}function pM(o){return o=o|0,n[(n[o+4>>2]|0)+8>>2]|0}function Vke(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,R=0;R=I,I=I+16|0,u=R+4|0,A=R,d=Tl(8)|0,m=d,B=Kt(48)|0,k=B,l=k+48|0;do n[k>>2]=n[o>>2],k=k+4|0,o=o+4|0;while((k|0)<(l|0));return l=m+4|0,n[l>>2]=B,k=Kt(8)|0,B=n[l>>2]|0,n[A>>2]=0,n[u>>2]=n[A>>2],gz(k,B,u),n[d>>2]=k,I=R,m|0}function gz(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1092,n[u+12>>2]=l,n[o+4>>2]=u}function Jke(o){o=o|0,$y(o),It(o)}function Kke(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function zke(o){o=o|0,It(o)}function Zke(o,l,u,A,d,m,B){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0,m=Xke(n[o>>2]|0,l,u,A,d,m,B)|0,B=o+4|0,n[(n[B>>2]|0)+8>>2]=m,n[(n[B>>2]|0)+8>>2]|0}function Xke(o,l,u,A,d,m,B){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0;var k=0,R=0;return k=I,I=I+16|0,R=k,Fl(R),o=Os(o)|0,B=$ke(o,+E[l>>3],+E[u>>3],+E[A>>3],+E[d>>3],+E[m>>3],+E[B>>3])|0,Nl(R),I=k,B|0}function $ke(o,l,u,A,d,m,B){o=o|0,l=+l,u=+u,A=+A,d=+d,m=+m,B=+B;var k=0;return k=da(eQe()|0)|0,l=+Ja(l),u=+Ja(u),A=+Ja(A),d=+Ja(d),m=+Ja(m),ro(0,k|0,o|0,+l,+u,+A,+d,+m,+ +Ja(B))|0}function eQe(){var o=0;return s[7624]|0||(tQe(9172),o=7624,n[o>>2]=1,n[o+4>>2]=0),9172}function tQe(o){o=o|0,Qo(o,rQe()|0,6)}function rQe(){return 1112}function nQe(o){o=o|0,Lh(o)}function iQe(o){o=o|0,dz(o+24|0),mz(o+16|0)}function dz(o){o=o|0,oQe(o)}function mz(o){o=o|0,sQe(o)}function sQe(o){o=o|0;var l=0,u=0;if(l=n[o>>2]|0,l|0)do u=l,l=n[l>>2]|0,It(u);while(l|0);n[o>>2]=0}function oQe(o){o=o|0;var l=0,u=0;if(l=n[o>>2]|0,l|0)do u=l,l=n[l>>2]|0,It(u);while(l|0);n[o>>2]=0}function Lh(o){o=o|0;var l=0;n[o+16>>2]=0,n[o+20>>2]=0,l=o+24|0,n[l>>2]=0,n[o+28>>2]=l,n[o+36>>2]=0,s[o+40>>0]=0,s[o+41>>0]=0}function aQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],lQe(o,u,d,0),I=A}function lQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=hM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=cQe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,uQe(m,A)|0,A),I=d}function hM(){var o=0,l=0;if(s[7640]|0||(Ez(9232),gr(26,9232,U|0)|0,l=7640,n[l>>2]=1,n[l+4>>2]=0),!(_r(9232)|0)){o=9232,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Ez(9232)}return 9232}function cQe(o){return o=o|0,0}function uQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=hM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],yz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(fQe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function yz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function fQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=AQe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,pQe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],yz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,hQe(o,k),gQe(k),I=M;return}}function AQe(o){return o=o|0,357913941}function pQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function hQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function gQe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Ez(o){o=o|0,yQe(o)}function dQe(o){o=o|0,mQe(o+24|0)}function mQe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function yQe(o){o=o|0;var l=0;l=en()|0,tn(o,2,1,l,EQe()|0,3),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function EQe(){return 1144}function IQe(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0;var m=0,B=0,k=0,R=0;m=I,I=I+16|0,B=m+8|0,k=m,R=CQe(o)|0,o=n[R+4>>2]|0,n[k>>2]=n[R>>2],n[k+4>>2]=o,n[B>>2]=n[k>>2],n[B+4>>2]=n[k+4>>2],wQe(l,B,u,A,d),I=m}function CQe(o){return o=o|0,(n[(hM()|0)+24>>2]|0)+(o*12|0)|0}function wQe(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0;var m=0,B=0,k=0,R=0,M=0;M=I,I=I+16|0,B=M+2|0,k=M+1|0,R=M,m=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(m=n[(n[o>>2]|0)+m>>2]|0),Qf(B,u),u=+Rf(B,u),Qf(k,A),A=+Rf(k,A),tp(R,d),R=rp(R,d)|0,FX[m&1](o,u,A,R),I=M}function Qf(o,l){o=o|0,l=+l}function Rf(o,l){return o=o|0,l=+l,+ +vQe(l)}function tp(o,l){o=o|0,l=l|0}function rp(o,l){return o=o|0,l=l|0,BQe(l)|0}function BQe(o){return o=o|0,o|0}function vQe(o){return o=+o,+o}function SQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],DQe(o,u,d,1),I=A}function DQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=gM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=PQe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,bQe(m,A)|0,A),I=d}function gM(){var o=0,l=0;if(s[7648]|0||(Cz(9268),gr(27,9268,U|0)|0,l=7648,n[l>>2]=1,n[l+4>>2]=0),!(_r(9268)|0)){o=9268,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Cz(9268)}return 9268}function PQe(o){return o=o|0,0}function bQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=gM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Iz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(xQe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Iz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function xQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=kQe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,QQe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Iz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,RQe(o,k),TQe(k),I=M;return}}function kQe(o){return o=o|0,357913941}function QQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function RQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function TQe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Cz(o){o=o|0,OQe(o)}function FQe(o){o=o|0,NQe(o+24|0)}function NQe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function OQe(o){o=o|0;var l=0;l=en()|0,tn(o,2,4,l,LQe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function LQe(){return 1160}function MQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=UQe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=_Qe(l,A)|0,I=u,l|0}function UQe(o){return o=o|0,(n[(gM()|0)+24>>2]|0)+(o*12|0)|0}function _Qe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),wz(gd[u&31](o)|0)|0}function wz(o){return o=o|0,o&1|0}function HQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],jQe(o,u,d,0),I=A}function jQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=dM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=GQe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,qQe(m,A)|0,A),I=d}function dM(){var o=0,l=0;if(s[7656]|0||(vz(9304),gr(28,9304,U|0)|0,l=7656,n[l>>2]=1,n[l+4>>2]=0),!(_r(9304)|0)){o=9304,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));vz(9304)}return 9304}function GQe(o){return o=o|0,0}function qQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=dM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Bz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(WQe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Bz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function WQe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=YQe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,VQe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Bz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,JQe(o,k),KQe(k),I=M;return}}function YQe(o){return o=o|0,357913941}function VQe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function JQe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function KQe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function vz(o){o=o|0,XQe(o)}function zQe(o){o=o|0,ZQe(o+24|0)}function ZQe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function XQe(o){o=o|0;var l=0;l=en()|0,tn(o,2,5,l,$Qe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function $Qe(){return 1164}function eRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=tRe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],rRe(l,d,u),I=A}function tRe(o){return o=o|0,(n[(dM()|0)+24>>2]|0)+(o*12|0)|0}function rRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),Mh(d,u),u=Uh(d,u)|0,sp[A&31](o,u),_h(d),I=m}function Mh(o,l){o=o|0,l=l|0,nRe(o,l)}function Uh(o,l){return o=o|0,l=l|0,o|0}function _h(o){o=o|0,Sf(o)}function nRe(o,l){o=o|0,l=l|0,mM(o,l)}function mM(o,l){o=o|0,l=l|0,n[o>>2]=l}function iRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],sRe(o,u,d,0),I=A}function sRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=yM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=oRe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,aRe(m,A)|0,A),I=d}function yM(){var o=0,l=0;if(s[7664]|0||(Dz(9340),gr(29,9340,U|0)|0,l=7664,n[l>>2]=1,n[l+4>>2]=0),!(_r(9340)|0)){o=9340,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Dz(9340)}return 9340}function oRe(o){return o=o|0,0}function aRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=yM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Sz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(lRe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Sz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function lRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=cRe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,uRe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Sz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,fRe(o,k),ARe(k),I=M;return}}function cRe(o){return o=o|0,357913941}function uRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function fRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function ARe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Dz(o){o=o|0,gRe(o)}function pRe(o){o=o|0,hRe(o+24|0)}function hRe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function gRe(o){o=o|0;var l=0;l=en()|0,tn(o,2,4,l,dRe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function dRe(){return 1180}function mRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=yRe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=ERe(l,d,u)|0,I=A,u|0}function yRe(o){return o=o|0,(n[(yM()|0)+24>>2]|0)+(o*12|0)|0}function ERe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;return m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),ad(d,u),d=ld(d,u)|0,d=Rb(hU[A&15](o,d)|0)|0,I=m,d|0}function ad(o,l){o=o|0,l=l|0}function ld(o,l){return o=o|0,l=l|0,IRe(l)|0}function Rb(o){return o=o|0,o|0}function IRe(o){return o=o|0,o|0}function CRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],wRe(o,u,d,0),I=A}function wRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=EM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=BRe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,vRe(m,A)|0,A),I=d}function EM(){var o=0,l=0;if(s[7672]|0||(bz(9376),gr(30,9376,U|0)|0,l=7672,n[l>>2]=1,n[l+4>>2]=0),!(_r(9376)|0)){o=9376,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));bz(9376)}return 9376}function BRe(o){return o=o|0,0}function vRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=EM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Pz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(SRe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Pz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function SRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=DRe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,PRe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Pz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,bRe(o,k),xRe(k),I=M;return}}function DRe(o){return o=o|0,357913941}function PRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function bRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function xRe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function bz(o){o=o|0,RRe(o)}function kRe(o){o=o|0,QRe(o+24|0)}function QRe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function RRe(o){o=o|0;var l=0;l=en()|0,tn(o,2,5,l,xz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function xz(){return 1196}function TRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=FRe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=NRe(l,A)|0,I=u,l|0}function FRe(o){return o=o|0,(n[(EM()|0)+24>>2]|0)+(o*12|0)|0}function NRe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),Rb(gd[u&31](o)|0)|0}function ORe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],LRe(o,u,d,1),I=A}function LRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=IM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=MRe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,URe(m,A)|0,A),I=d}function IM(){var o=0,l=0;if(s[7680]|0||(Qz(9412),gr(31,9412,U|0)|0,l=7680,n[l>>2]=1,n[l+4>>2]=0),!(_r(9412)|0)){o=9412,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Qz(9412)}return 9412}function MRe(o){return o=o|0,0}function URe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=IM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],kz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(_Re(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function kz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function _Re(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=HRe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,jRe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],kz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,GRe(o,k),qRe(k),I=M;return}}function HRe(o){return o=o|0,357913941}function jRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function GRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function qRe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Qz(o){o=o|0,VRe(o)}function WRe(o){o=o|0,YRe(o+24|0)}function YRe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function VRe(o){o=o|0;var l=0;l=en()|0,tn(o,2,6,l,Rz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Rz(){return 1200}function JRe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=KRe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=zRe(l,A)|0,I=u,l|0}function KRe(o){return o=o|0,(n[(IM()|0)+24>>2]|0)+(o*12|0)|0}function zRe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),Tb(gd[u&31](o)|0)|0}function Tb(o){return o=o|0,o|0}function ZRe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],XRe(o,u,d,0),I=A}function XRe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=CM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=$Re(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,eTe(m,A)|0,A),I=d}function CM(){var o=0,l=0;if(s[7688]|0||(Fz(9448),gr(32,9448,U|0)|0,l=7688,n[l>>2]=1,n[l+4>>2]=0),!(_r(9448)|0)){o=9448,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Fz(9448)}return 9448}function $Re(o){return o=o|0,0}function eTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=CM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Tz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(tTe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Tz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function tTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=rTe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,nTe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Tz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,iTe(o,k),sTe(k),I=M;return}}function rTe(o){return o=o|0,357913941}function nTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function iTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function sTe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Fz(o){o=o|0,lTe(o)}function oTe(o){o=o|0,aTe(o+24|0)}function aTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function lTe(o){o=o|0;var l=0;l=en()|0,tn(o,2,6,l,Nz()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Nz(){return 1204}function cTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=uTe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],fTe(l,d,u),I=A}function uTe(o){return o=o|0,(n[(CM()|0)+24>>2]|0)+(o*12|0)|0}function fTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),wM(d,u),d=BM(d,u)|0,sp[A&31](o,d),I=m}function wM(o,l){o=o|0,l=l|0}function BM(o,l){return o=o|0,l=l|0,ATe(l)|0}function ATe(o){return o=o|0,o|0}function pTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],hTe(o,u,d,0),I=A}function hTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=vM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=gTe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,dTe(m,A)|0,A),I=d}function vM(){var o=0,l=0;if(s[7696]|0||(Lz(9484),gr(33,9484,U|0)|0,l=7696,n[l>>2]=1,n[l+4>>2]=0),!(_r(9484)|0)){o=9484,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Lz(9484)}return 9484}function gTe(o){return o=o|0,0}function dTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=vM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Oz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(mTe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Oz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function mTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=yTe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,ETe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Oz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,ITe(o,k),CTe(k),I=M;return}}function yTe(o){return o=o|0,357913941}function ETe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function ITe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function CTe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Lz(o){o=o|0,vTe(o)}function wTe(o){o=o|0,BTe(o+24|0)}function BTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function vTe(o){o=o|0;var l=0;l=en()|0,tn(o,2,1,l,STe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function STe(){return 1212}function DTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+8|0,B=d,k=PTe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],bTe(l,m,u,A),I=d}function PTe(o){return o=o|0,(n[(vM()|0)+24>>2]|0)+(o*12|0)|0}function bTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;k=I,I=I+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(d=n[(n[o>>2]|0)+d>>2]|0),wM(m,u),m=BM(m,u)|0,ad(B,A),B=ld(B,A)|0,F2[d&15](o,m,B),I=k}function xTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kTe(o,u,d,1),I=A}function kTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=SM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=QTe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,RTe(m,A)|0,A),I=d}function SM(){var o=0,l=0;if(s[7704]|0||(Uz(9520),gr(34,9520,U|0)|0,l=7704,n[l>>2]=1,n[l+4>>2]=0),!(_r(9520)|0)){o=9520,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Uz(9520)}return 9520}function QTe(o){return o=o|0,0}function RTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=SM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Mz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(TTe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Mz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function TTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=FTe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,NTe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Mz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,OTe(o,k),LTe(k),I=M;return}}function FTe(o){return o=o|0,357913941}function NTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function OTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function LTe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Uz(o){o=o|0,_Te(o)}function MTe(o){o=o|0,UTe(o+24|0)}function UTe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function _Te(o){o=o|0;var l=0;l=en()|0,tn(o,2,1,l,HTe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function HTe(){return 1224}function jTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;return d=I,I=I+16|0,m=d+8|0,B=d,k=GTe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],A=+qTe(l,m,u),I=d,+A}function GTe(o){return o=o|0,(n[(SM()|0)+24>>2]|0)+(o*12|0)|0}function qTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(d,u),d=rp(d,u)|0,B=+kf(+OX[A&7](o,d)),I=m,+B}function WTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],YTe(o,u,d,1),I=A}function YTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=DM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=VTe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,JTe(m,A)|0,A),I=d}function DM(){var o=0,l=0;if(s[7712]|0||(Hz(9556),gr(35,9556,U|0)|0,l=7712,n[l>>2]=1,n[l+4>>2]=0),!(_r(9556)|0)){o=9556,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Hz(9556)}return 9556}function VTe(o){return o=o|0,0}function JTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=DM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],_z(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(KTe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function _z(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function KTe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=zTe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,ZTe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],_z(m,A,u),n[R>>2]=(n[R>>2]|0)+12,XTe(o,k),$Te(k),I=M;return}}function zTe(o){return o=o|0,357913941}function ZTe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function XTe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function $Te(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Hz(o){o=o|0,rFe(o)}function eFe(o){o=o|0,tFe(o+24|0)}function tFe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function rFe(o){o=o|0;var l=0;l=en()|0,tn(o,2,5,l,nFe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function nFe(){return 1232}function iFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=sFe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=+oFe(l,d),I=A,+u}function sFe(o){return o=o|0,(n[(DM()|0)+24>>2]|0)+(o*12|0)|0}function oFe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),+ +kf(+NX[u&15](o))}function aFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],lFe(o,u,d,1),I=A}function lFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=PM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=cFe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,uFe(m,A)|0,A),I=d}function PM(){var o=0,l=0;if(s[7720]|0||(Gz(9592),gr(36,9592,U|0)|0,l=7720,n[l>>2]=1,n[l+4>>2]=0),!(_r(9592)|0)){o=9592,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Gz(9592)}return 9592}function cFe(o){return o=o|0,0}function uFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=PM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],jz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(fFe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function jz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function fFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=AFe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,pFe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],jz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,hFe(o,k),gFe(k),I=M;return}}function AFe(o){return o=o|0,357913941}function pFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function hFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function gFe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Gz(o){o=o|0,yFe(o)}function dFe(o){o=o|0,mFe(o+24|0)}function mFe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function yFe(o){o=o|0;var l=0;l=en()|0,tn(o,2,7,l,EFe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function EFe(){return 1276}function IFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=CFe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=wFe(l,A)|0,I=u,l|0}function CFe(o){return o=o|0,(n[(PM()|0)+24>>2]|0)+(o*12|0)|0}function wFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;return d=I,I=I+16|0,A=d,u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),sp[u&31](A,o),A=qz(A)|0,I=d,A|0}function qz(o){o=o|0;var l=0,u=0,A=0,d=0;return d=I,I=I+32|0,l=d+12|0,u=d,A=uM(Wz()|0)|0,A?(fM(l,A),AM(u,l),BFe(o,u),o=pM(l)|0):o=vFe(o)|0,I=d,o|0}function Wz(){var o=0;return s[7736]|0||(FFe(9640),gr(25,9640,U|0)|0,o=7736,n[o>>2]=1,n[o+4>>2]=0),9640}function BFe(o,l){o=o|0,l=l|0,bFe(l,o,o+8|0)|0}function vFe(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;return u=I,I=I+16|0,d=u+4|0,B=u,A=Tl(8)|0,l=A,k=Kt(16)|0,n[k>>2]=n[o>>2],n[k+4>>2]=n[o+4>>2],n[k+8>>2]=n[o+8>>2],n[k+12>>2]=n[o+12>>2],m=l+4|0,n[m>>2]=k,o=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],bM(o,m,d),n[A>>2]=o,I=u,l|0}function bM(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1244,n[u+12>>2]=l,n[o+4>>2]=u}function SFe(o){o=o|0,$y(o),It(o)}function DFe(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function PFe(o){o=o|0,It(o)}function bFe(o,l,u){return o=o|0,l=l|0,u=u|0,l=xFe(n[o>>2]|0,l,u)|0,u=o+4|0,n[(n[u>>2]|0)+8>>2]=l,n[(n[u>>2]|0)+8>>2]|0}function xFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;return A=I,I=I+16|0,d=A,Fl(d),o=Os(o)|0,u=kFe(o,n[l>>2]|0,+E[u>>3])|0,Nl(d),I=A,u|0}function kFe(o,l,u){o=o|0,l=l|0,u=+u;var A=0;return A=da(QFe()|0)|0,l=Yy(l)|0,ou(0,A|0,o|0,l|0,+ +Ja(u))|0}function QFe(){var o=0;return s[7728]|0||(RFe(9628),o=7728,n[o>>2]=1,n[o+4>>2]=0),9628}function RFe(o){o=o|0,Qo(o,TFe()|0,2)}function TFe(){return 1264}function FFe(o){o=o|0,Lh(o)}function NFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],OFe(o,u,d,1),I=A}function OFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=xM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=LFe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,MFe(m,A)|0,A),I=d}function xM(){var o=0,l=0;if(s[7744]|0||(Vz(9684),gr(37,9684,U|0)|0,l=7744,n[l>>2]=1,n[l+4>>2]=0),!(_r(9684)|0)){o=9684,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Vz(9684)}return 9684}function LFe(o){return o=o|0,0}function MFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=xM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Yz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(UFe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Yz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function UFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=_Fe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,HFe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Yz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,jFe(o,k),GFe(k),I=M;return}}function _Fe(o){return o=o|0,357913941}function HFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function jFe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function GFe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Vz(o){o=o|0,YFe(o)}function qFe(o){o=o|0,WFe(o+24|0)}function WFe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function YFe(o){o=o|0;var l=0;l=en()|0,tn(o,2,5,l,VFe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function VFe(){return 1280}function JFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=KFe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=zFe(l,d,u)|0,I=A,u|0}function KFe(o){return o=o|0,(n[(xM()|0)+24>>2]|0)+(o*12|0)|0}function zFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return B=I,I=I+32|0,d=B,m=B+16|0,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(m,u),m=rp(m,u)|0,F2[A&15](d,o,m),m=qz(d)|0,I=B,m|0}function ZFe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],XFe(o,u,d,1),I=A}function XFe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=kM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=$Fe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,eNe(m,A)|0,A),I=d}function kM(){var o=0,l=0;if(s[7752]|0||(Kz(9720),gr(38,9720,U|0)|0,l=7752,n[l>>2]=1,n[l+4>>2]=0),!(_r(9720)|0)){o=9720,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Kz(9720)}return 9720}function $Fe(o){return o=o|0,0}function eNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=kM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Jz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(tNe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Jz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function tNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=rNe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,nNe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Jz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,iNe(o,k),sNe(k),I=M;return}}function rNe(o){return o=o|0,357913941}function nNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function iNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function sNe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Kz(o){o=o|0,lNe(o)}function oNe(o){o=o|0,aNe(o+24|0)}function aNe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function lNe(o){o=o|0;var l=0;l=en()|0,tn(o,2,8,l,cNe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function cNe(){return 1288}function uNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;return u=I,I=I+16|0,A=u+8|0,d=u,m=fNe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],l=ANe(l,A)|0,I=u,l|0}function fNe(o){return o=o|0,(n[(kM()|0)+24>>2]|0)+(o*12|0)|0}function ANe(o,l){o=o|0,l=l|0;var u=0;return u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),sd(gd[u&31](o)|0)|0}function pNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],hNe(o,u,d,0),I=A}function hNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=QM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=gNe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,dNe(m,A)|0,A),I=d}function QM(){var o=0,l=0;if(s[7760]|0||(Zz(9756),gr(39,9756,U|0)|0,l=7760,n[l>>2]=1,n[l+4>>2]=0),!(_r(9756)|0)){o=9756,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));Zz(9756)}return 9756}function gNe(o){return o=o|0,0}function dNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=QM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],zz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(mNe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function zz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function mNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=yNe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,ENe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],zz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,INe(o,k),CNe(k),I=M;return}}function yNe(o){return o=o|0,357913941}function ENe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function INe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function CNe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function Zz(o){o=o|0,vNe(o)}function wNe(o){o=o|0,BNe(o+24|0)}function BNe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function vNe(o){o=o|0;var l=0;l=en()|0,tn(o,2,8,l,SNe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function SNe(){return 1292}function DNe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=PNe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],bNe(l,d,u),I=A}function PNe(o){return o=o|0,(n[(QM()|0)+24>>2]|0)+(o*12|0)|0}function bNe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),Qf(d,u),u=+Rf(d,u),RX[A&31](o,u),I=m}function xNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kNe(o,u,d,0),I=A}function kNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=RM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=QNe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,RNe(m,A)|0,A),I=d}function RM(){var o=0,l=0;if(s[7768]|0||($z(9792),gr(40,9792,U|0)|0,l=7768,n[l>>2]=1,n[l+4>>2]=0),!(_r(9792)|0)){o=9792,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));$z(9792)}return 9792}function QNe(o){return o=o|0,0}function RNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=RM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],Xz(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(TNe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function Xz(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function TNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=FNe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,NNe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],Xz(m,A,u),n[R>>2]=(n[R>>2]|0)+12,ONe(o,k),LNe(k),I=M;return}}function FNe(o){return o=o|0,357913941}function NNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function ONe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function LNe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function $z(o){o=o|0,_Ne(o)}function MNe(o){o=o|0,UNe(o+24|0)}function UNe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function _Ne(o){o=o|0;var l=0;l=en()|0,tn(o,2,1,l,HNe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function HNe(){return 1300}function jNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+8|0,B=d,k=GNe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],qNe(l,m,u,A),I=d}function GNe(o){return o=o|0,(n[(RM()|0)+24>>2]|0)+(o*12|0)|0}function qNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A;var d=0,m=0,B=0,k=0;k=I,I=I+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(d=n[(n[o>>2]|0)+d>>2]|0),tp(m,u),m=rp(m,u)|0,Qf(B,A),A=+Rf(B,A),_X[d&15](o,m,A),I=k}function WNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],YNe(o,u,d,0),I=A}function YNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=TM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=VNe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,JNe(m,A)|0,A),I=d}function TM(){var o=0,l=0;if(s[7776]|0||(tZ(9828),gr(41,9828,U|0)|0,l=7776,n[l>>2]=1,n[l+4>>2]=0),!(_r(9828)|0)){o=9828,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));tZ(9828)}return 9828}function VNe(o){return o=o|0,0}function JNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=TM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],eZ(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(KNe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function eZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function KNe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=zNe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,ZNe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],eZ(m,A,u),n[R>>2]=(n[R>>2]|0)+12,XNe(o,k),$Ne(k),I=M;return}}function zNe(o){return o=o|0,357913941}function ZNe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function XNe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function $Ne(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function tZ(o){o=o|0,rOe(o)}function eOe(o){o=o|0,tOe(o+24|0)}function tOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function rOe(o){o=o|0;var l=0;l=en()|0,tn(o,2,7,l,nOe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function nOe(){return 1312}function iOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=sOe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],oOe(l,d,u),I=A}function sOe(o){return o=o|0,(n[(TM()|0)+24>>2]|0)+(o*12|0)|0}function oOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(d,u),d=rp(d,u)|0,sp[A&31](o,d),I=m}function aOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],lOe(o,u,d,0),I=A}function lOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=FM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=cOe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,uOe(m,A)|0,A),I=d}function FM(){var o=0,l=0;if(s[7784]|0||(nZ(9864),gr(42,9864,U|0)|0,l=7784,n[l>>2]=1,n[l+4>>2]=0),!(_r(9864)|0)){o=9864,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));nZ(9864)}return 9864}function cOe(o){return o=o|0,0}function uOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=FM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],rZ(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(fOe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function rZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function fOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=AOe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,pOe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],rZ(m,A,u),n[R>>2]=(n[R>>2]|0)+12,hOe(o,k),gOe(k),I=M;return}}function AOe(o){return o=o|0,357913941}function pOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function hOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function gOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function nZ(o){o=o|0,yOe(o)}function dOe(o){o=o|0,mOe(o+24|0)}function mOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function yOe(o){o=o|0;var l=0;l=en()|0,tn(o,2,8,l,EOe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function EOe(){return 1320}function IOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=COe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],wOe(l,d,u),I=A}function COe(o){return o=o|0,(n[(FM()|0)+24>>2]|0)+(o*12|0)|0}function wOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),BOe(d,u),d=vOe(d,u)|0,sp[A&31](o,d),I=m}function BOe(o,l){o=o|0,l=l|0}function vOe(o,l){return o=o|0,l=l|0,SOe(l)|0}function SOe(o){return o=o|0,o|0}function DOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],POe(o,u,d,0),I=A}function POe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=NM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=bOe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,xOe(m,A)|0,A),I=d}function NM(){var o=0,l=0;if(s[7792]|0||(sZ(9900),gr(43,9900,U|0)|0,l=7792,n[l>>2]=1,n[l+4>>2]=0),!(_r(9900)|0)){o=9900,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));sZ(9900)}return 9900}function bOe(o){return o=o|0,0}function xOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=NM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],iZ(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(kOe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function iZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function kOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=QOe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,ROe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],iZ(m,A,u),n[R>>2]=(n[R>>2]|0)+12,TOe(o,k),FOe(k),I=M;return}}function QOe(o){return o=o|0,357913941}function ROe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function TOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function FOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function sZ(o){o=o|0,LOe(o)}function NOe(o){o=o|0,OOe(o+24|0)}function OOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function LOe(o){o=o|0;var l=0;l=en()|0,tn(o,2,22,l,MOe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function MOe(){return 1344}function UOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0;u=I,I=I+16|0,A=u+8|0,d=u,m=_Oe(o)|0,o=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=o,n[A>>2]=n[d>>2],n[A+4>>2]=n[d+4>>2],HOe(l,A),I=u}function _Oe(o){return o=o|0,(n[(NM()|0)+24>>2]|0)+(o*12|0)|0}function HOe(o,l){o=o|0,l=l|0;var u=0;u=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(u=n[(n[o>>2]|0)+u>>2]|0),ip[u&127](o)}function jOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=OM()|0,o=GOe(u)|0,vn(m,l,d,o,qOe(u,A)|0,A)}function OM(){var o=0,l=0;if(s[7800]|0||(aZ(9936),gr(44,9936,U|0)|0,l=7800,n[l>>2]=1,n[l+4>>2]=0),!(_r(9936)|0)){o=9936,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));aZ(9936)}return 9936}function GOe(o){return o=o|0,o|0}function qOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=OM()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(oZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(WOe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function oZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function WOe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=YOe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,VOe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,oZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,JOe(o,d),KOe(d),I=k;return}}function YOe(o){return o=o|0,536870911}function VOe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function JOe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function KOe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function aZ(o){o=o|0,XOe(o)}function zOe(o){o=o|0,ZOe(o+24|0)}function ZOe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function XOe(o){o=o|0;var l=0;l=en()|0,tn(o,1,23,l,Nz()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function $Oe(o,l){o=o|0,l=l|0,tLe(n[(eLe(o)|0)>>2]|0,l)}function eLe(o){return o=o|0,(n[(OM()|0)+24>>2]|0)+(o<<3)|0}function tLe(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,wM(A,l),l=BM(A,l)|0,ip[o&127](l),I=u}function rLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=LM()|0,o=nLe(u)|0,vn(m,l,d,o,iLe(u,A)|0,A)}function LM(){var o=0,l=0;if(s[7808]|0||(cZ(9972),gr(45,9972,U|0)|0,l=7808,n[l>>2]=1,n[l+4>>2]=0),!(_r(9972)|0)){o=9972,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));cZ(9972)}return 9972}function nLe(o){return o=o|0,o|0}function iLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=LM()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(lZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(sLe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function lZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function sLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=oLe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,aLe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,lZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,lLe(o,d),cLe(d),I=k;return}}function oLe(o){return o=o|0,536870911}function aLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function lLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function cLe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function cZ(o){o=o|0,ALe(o)}function uLe(o){o=o|0,fLe(o+24|0)}function fLe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function ALe(o){o=o|0;var l=0;l=en()|0,tn(o,1,9,l,pLe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function pLe(){return 1348}function hLe(o,l){return o=o|0,l=l|0,dLe(n[(gLe(o)|0)>>2]|0,l)|0}function gLe(o){return o=o|0,(n[(LM()|0)+24>>2]|0)+(o<<3)|0}function dLe(o,l){o=o|0,l=l|0;var u=0,A=0;return u=I,I=I+16|0,A=u,uZ(A,l),l=fZ(A,l)|0,l=Rb(gd[o&31](l)|0)|0,I=u,l|0}function uZ(o,l){o=o|0,l=l|0}function fZ(o,l){return o=o|0,l=l|0,mLe(l)|0}function mLe(o){return o=o|0,o|0}function yLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=MM()|0,o=ELe(u)|0,vn(m,l,d,o,ILe(u,A)|0,A)}function MM(){var o=0,l=0;if(s[7816]|0||(pZ(10008),gr(46,10008,U|0)|0,l=7816,n[l>>2]=1,n[l+4>>2]=0),!(_r(10008)|0)){o=10008,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));pZ(10008)}return 10008}function ELe(o){return o=o|0,o|0}function ILe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=MM()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(AZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(CLe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function AZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function CLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=wLe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,BLe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,AZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,vLe(o,d),SLe(d),I=k;return}}function wLe(o){return o=o|0,536870911}function BLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function vLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function SLe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function pZ(o){o=o|0,bLe(o)}function DLe(o){o=o|0,PLe(o+24|0)}function PLe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function bLe(o){o=o|0;var l=0;l=en()|0,tn(o,1,15,l,xz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function xLe(o){return o=o|0,QLe(n[(kLe(o)|0)>>2]|0)|0}function kLe(o){return o=o|0,(n[(MM()|0)+24>>2]|0)+(o<<3)|0}function QLe(o){return o=o|0,Rb(Vb[o&7]()|0)|0}function RLe(){var o=0;return s[7832]|0||(_Le(10052),gr(25,10052,U|0)|0,o=7832,n[o>>2]=1,n[o+4>>2]=0),10052}function TLe(o,l){o=o|0,l=l|0,n[o>>2]=FLe()|0,n[o+4>>2]=NLe()|0,n[o+12>>2]=l,n[o+8>>2]=OLe()|0,n[o+32>>2]=2}function FLe(){return 11709}function NLe(){return 1188}function OLe(){return Fb()|0}function LLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(MLe(u),It(u)):l|0&&(Oy(l),It(l))}function Hh(o,l){return o=o|0,l=l|0,l&o|0}function MLe(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function Fb(){var o=0;return s[7824]|0||(n[2511]=ULe()|0,n[2512]=0,o=7824,n[o>>2]=1,n[o+4>>2]=0),10044}function ULe(){return 0}function _Le(o){o=o|0,Lh(o)}function HLe(o){o=o|0;var l=0,u=0,A=0,d=0,m=0;l=I,I=I+32|0,u=l+24|0,m=l+16|0,d=l+8|0,A=l,jLe(o,4827),GLe(o,4834,3)|0,qLe(o,3682,47)|0,n[m>>2]=9,n[m+4>>2]=0,n[u>>2]=n[m>>2],n[u+4>>2]=n[m+4>>2],WLe(o,4841,u)|0,n[d>>2]=1,n[d+4>>2]=0,n[u>>2]=n[d>>2],n[u+4>>2]=n[d+4>>2],YLe(o,4871,u)|0,n[A>>2]=10,n[A+4>>2]=0,n[u>>2]=n[A>>2],n[u+4>>2]=n[A+4>>2],VLe(o,4891,u)|0,I=l}function jLe(o,l){o=o|0,l=l|0;var u=0;u=SUe()|0,n[o>>2]=u,DUe(u,l),jh(n[o>>2]|0)}function GLe(o,l,u){return o=o|0,l=l|0,u=u|0,cUe(o,Bn(l)|0,u,0),o|0}function qLe(o,l,u){return o=o|0,l=l|0,u=u|0,JMe(o,Bn(l)|0,u,0),o|0}function WLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xMe(o,l,d),I=A,o|0}function YLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],uMe(o,l,d),I=A,o|0}function VLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=n[u+4>>2]|0,n[m>>2]=n[u>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],JLe(o,l,d),I=A,o|0}function JLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],KLe(o,u,d,1),I=A}function KLe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=UM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=zLe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,ZLe(m,A)|0,A),I=d}function UM(){var o=0,l=0;if(s[7840]|0||(gZ(10100),gr(48,10100,U|0)|0,l=7840,n[l>>2]=1,n[l+4>>2]=0),!(_r(10100)|0)){o=10100,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));gZ(10100)}return 10100}function zLe(o){return o=o|0,0}function ZLe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=UM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],hZ(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(XLe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function hZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function XLe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=$Le(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,eMe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],hZ(m,A,u),n[R>>2]=(n[R>>2]|0)+12,tMe(o,k),rMe(k),I=M;return}}function $Le(o){return o=o|0,357913941}function eMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function tMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function rMe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function gZ(o){o=o|0,sMe(o)}function nMe(o){o=o|0,iMe(o+24|0)}function iMe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function sMe(o){o=o|0;var l=0;l=en()|0,tn(o,2,6,l,oMe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function oMe(){return 1364}function aMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;return A=I,I=I+16|0,d=A+8|0,m=A,B=lMe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],u=cMe(l,d,u)|0,I=A,u|0}function lMe(o){return o=o|0,(n[(UM()|0)+24>>2]|0)+(o*12|0)|0}function cMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;return m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),tp(d,u),d=rp(d,u)|0,d=wz(hU[A&15](o,d)|0)|0,I=m,d|0}function uMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],fMe(o,u,d,0),I=A}function fMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=_M()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=AMe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,pMe(m,A)|0,A),I=d}function _M(){var o=0,l=0;if(s[7848]|0||(mZ(10136),gr(49,10136,U|0)|0,l=7848,n[l>>2]=1,n[l+4>>2]=0),!(_r(10136)|0)){o=10136,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));mZ(10136)}return 10136}function AMe(o){return o=o|0,0}function pMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=_M()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],dZ(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(hMe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function dZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function hMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=gMe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,dMe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],dZ(m,A,u),n[R>>2]=(n[R>>2]|0)+12,mMe(o,k),yMe(k),I=M;return}}function gMe(o){return o=o|0,357913941}function dMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function mMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function yMe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function mZ(o){o=o|0,CMe(o)}function EMe(o){o=o|0,IMe(o+24|0)}function IMe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function CMe(o){o=o|0;var l=0;l=en()|0,tn(o,2,9,l,wMe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function wMe(){return 1372}function BMe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,d=A+8|0,m=A,B=vMe(o)|0,o=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=o,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],SMe(l,d,u),I=A}function vMe(o){return o=o|0,(n[(_M()|0)+24>>2]|0)+(o*12|0)|0}function SMe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=$e;m=I,I=I+16|0,d=m,A=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(A=n[(n[o>>2]|0)+A>>2]|0),DMe(d,u),B=y(PMe(d,u)),QX[A&1](o,B),I=m}function DMe(o,l){o=o|0,l=+l}function PMe(o,l){return o=o|0,l=+l,y(bMe(l))}function bMe(o){return o=+o,y(o)}function xMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,d=A+8|0,m=A,k=n[u>>2]|0,B=n[u+4>>2]|0,u=Bn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kMe(o,u,d,0),I=A}function kMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0,R=0,M=0,L=0;d=I,I=I+32|0,m=d+16|0,L=d+8|0,k=d,M=n[u>>2]|0,R=n[u+4>>2]|0,B=n[o>>2]|0,o=HM()|0,n[L>>2]=M,n[L+4>>2]=R,n[m>>2]=n[L>>2],n[m+4>>2]=n[L+4>>2],u=QMe(m)|0,n[k>>2]=M,n[k+4>>2]=R,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],vn(B,l,o,u,RMe(m,A)|0,A),I=d}function HM(){var o=0,l=0;if(s[7856]|0||(EZ(10172),gr(50,10172,U|0)|0,l=7856,n[l>>2]=1,n[l+4>>2]=0),!(_r(10172)|0)){o=10172,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));EZ(10172)}return 10172}function QMe(o){return o=o|0,0}function RMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0;return L=I,I=I+32|0,d=L+24|0,B=L+16|0,k=L,R=L+8|0,m=n[o>>2]|0,A=n[o+4>>2]|0,n[k>>2]=m,n[k+4>>2]=A,q=HM()|0,M=q+24|0,o=yr(l,4)|0,n[R>>2]=o,l=q+28|0,u=n[l>>2]|0,u>>>0<(n[q+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=A,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],yZ(u,d,o),o=(n[l>>2]|0)+12|0,n[l>>2]=o):(TMe(M,k,R),o=n[l>>2]|0),I=L,((o-(n[M>>2]|0)|0)/12|0)+-1|0}function yZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=n[l+4>>2]|0,n[o>>2]=n[l>>2],n[o+4>>2]=A,n[o+8>>2]=u}function TMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;if(M=I,I=I+48|0,A=M+32|0,B=M+24|0,k=M,R=o+4|0,d=(((n[R>>2]|0)-(n[o>>2]|0)|0)/12|0)+1|0,m=FMe(o)|0,m>>>0<d>>>0)sn(o);else{L=n[o>>2]|0,ae=((n[o+8>>2]|0)-L|0)/12|0,q=ae<<1,NMe(k,ae>>>0<m>>>1>>>0?q>>>0<d>>>0?d:q:m,((n[R>>2]|0)-L|0)/12|0,o+8|0),R=k+8|0,m=n[R>>2]|0,d=n[l+4>>2]|0,u=n[u>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[A>>2]=n[B>>2],n[A+4>>2]=n[B+4>>2],yZ(m,A,u),n[R>>2]=(n[R>>2]|0)+12,OMe(o,k),LMe(k),I=M;return}}function FMe(o){return o=o|0,357913941}function NMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>357913941)Nt();else{d=Kt(l*12|0)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u*12|0)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l*12|0)}function OMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function LMe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~(((A+-12-l|0)>>>0)/12|0)*12|0)),o=n[o>>2]|0,o|0&&It(o)}function EZ(o){o=o|0,_Me(o)}function MMe(o){o=o|0,UMe(o+24|0)}function UMe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~(((l+-12-A|0)>>>0)/12|0)*12|0)),It(u))}function _Me(o){o=o|0;var l=0;l=en()|0,tn(o,2,3,l,HMe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function HMe(){return 1380}function jMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+8|0,B=d,k=GMe(o)|0,o=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=o,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],qMe(l,m,u,A),I=d}function GMe(o){return o=o|0,(n[(HM()|0)+24>>2]|0)+(o*12|0)|0}function qMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;k=I,I=I+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,o=o+(l>>1)|0,l&1&&(d=n[(n[o>>2]|0)+d>>2]|0),tp(m,u),m=rp(m,u)|0,WMe(B,A),B=YMe(B,A)|0,F2[d&15](o,m,B),I=k}function WMe(o,l){o=o|0,l=l|0}function YMe(o,l){return o=o|0,l=l|0,VMe(l)|0}function VMe(o){return o=o|0,(o|0)!=0|0}function JMe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=jM()|0,o=KMe(u)|0,vn(m,l,d,o,zMe(u,A)|0,A)}function jM(){var o=0,l=0;if(s[7864]|0||(CZ(10208),gr(51,10208,U|0)|0,l=7864,n[l>>2]=1,n[l+4>>2]=0),!(_r(10208)|0)){o=10208,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));CZ(10208)}return 10208}function KMe(o){return o=o|0,o|0}function zMe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=jM()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(IZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(ZMe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function IZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function ZMe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=XMe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,$Me(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,IZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,eUe(o,d),tUe(d),I=k;return}}function XMe(o){return o=o|0,536870911}function $Me(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function eUe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function tUe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function CZ(o){o=o|0,iUe(o)}function rUe(o){o=o|0,nUe(o+24|0)}function nUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function iUe(o){o=o|0;var l=0;l=en()|0,tn(o,1,24,l,sUe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function sUe(){return 1392}function oUe(o,l){o=o|0,l=l|0,lUe(n[(aUe(o)|0)>>2]|0,l)}function aUe(o){return o=o|0,(n[(jM()|0)+24>>2]|0)+(o<<3)|0}function lUe(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,uZ(A,l),l=fZ(A,l)|0,ip[o&127](l),I=u}function cUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=GM()|0,o=uUe(u)|0,vn(m,l,d,o,fUe(u,A)|0,A)}function GM(){var o=0,l=0;if(s[7872]|0||(BZ(10244),gr(52,10244,U|0)|0,l=7872,n[l>>2]=1,n[l+4>>2]=0),!(_r(10244)|0)){o=10244,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));BZ(10244)}return 10244}function uUe(o){return o=o|0,o|0}function fUe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=GM()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(wZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(AUe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function wZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function AUe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=pUe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,hUe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,wZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,gUe(o,d),dUe(d),I=k;return}}function pUe(o){return o=o|0,536870911}function hUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function gUe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function dUe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function BZ(o){o=o|0,EUe(o)}function mUe(o){o=o|0,yUe(o+24|0)}function yUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function EUe(o){o=o|0;var l=0;l=en()|0,tn(o,1,16,l,IUe()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function IUe(){return 1400}function CUe(o){return o=o|0,BUe(n[(wUe(o)|0)>>2]|0)|0}function wUe(o){return o=o|0,(n[(GM()|0)+24>>2]|0)+(o<<3)|0}function BUe(o){return o=o|0,vUe(Vb[o&7]()|0)|0}function vUe(o){return o=o|0,o|0}function SUe(){var o=0;return s[7880]|0||(RUe(10280),gr(25,10280,U|0)|0,o=7880,n[o>>2]=1,n[o+4>>2]=0),10280}function DUe(o,l){o=o|0,l=l|0,n[o>>2]=PUe()|0,n[o+4>>2]=bUe()|0,n[o+12>>2]=l,n[o+8>>2]=xUe()|0,n[o+32>>2]=4}function PUe(){return 11711}function bUe(){return 1356}function xUe(){return Fb()|0}function kUe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(QUe(u),It(u)):l|0&&(Kg(l),It(l))}function QUe(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function RUe(o){o=o|0,Lh(o)}function TUe(o){o=o|0,FUe(o,4920),NUe(o)|0,OUe(o)|0}function FUe(o,l){o=o|0,l=l|0;var u=0;u=Wz()|0,n[o>>2]=u,n_e(u,l),jh(n[o>>2]|0)}function NUe(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,VUe()|0),o|0}function OUe(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,LUe()|0),o|0}function LUe(){var o=0;return s[7888]|0||(vZ(10328),gr(53,10328,U|0)|0,o=7888,n[o>>2]=1,n[o+4>>2]=0),_r(10328)|0||vZ(10328),10328}function cd(o,l){o=o|0,l=l|0,vn(o,0,l,0,0,0)}function vZ(o){o=o|0,_Ue(o),ud(o,10)}function MUe(o){o=o|0,UUe(o+24|0)}function UUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function _Ue(o){o=o|0;var l=0;l=en()|0,tn(o,5,1,l,qUe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function HUe(o,l,u){o=o|0,l=l|0,u=+u,jUe(o,l,u)}function ud(o,l){o=o|0,l=l|0,n[o+20>>2]=l}function jUe(o,l,u){o=o|0,l=l|0,u=+u;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+16|0,m=A+8|0,k=A+13|0,d=A,B=A+12|0,tp(k,l),n[m>>2]=rp(k,l)|0,Qf(B,u),E[d>>3]=+Rf(B,u),GUe(o,m,d),I=A}function GUe(o,l,u){o=o|0,l=l|0,u=u|0,Rl(o+8|0,n[l>>2]|0,+E[u>>3]),s[o+24>>0]=1}function qUe(){return 1404}function WUe(o,l){return o=o|0,l=+l,YUe(o,l)|0}function YUe(o,l){o=o|0,l=+l;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return A=I,I=I+16|0,m=A+4|0,B=A+8|0,k=A,d=Tl(8)|0,u=d,R=Kt(16)|0,tp(m,o),o=rp(m,o)|0,Qf(B,l),Rl(R,o,+Rf(B,l)),B=u+4|0,n[B>>2]=R,o=Kt(8)|0,B=n[B>>2]|0,n[k>>2]=0,n[m>>2]=n[k>>2],bM(o,B,m),n[d>>2]=o,I=A,u|0}function VUe(){var o=0;return s[7896]|0||(SZ(10364),gr(54,10364,U|0)|0,o=7896,n[o>>2]=1,n[o+4>>2]=0),_r(10364)|0||SZ(10364),10364}function SZ(o){o=o|0,zUe(o),ud(o,55)}function JUe(o){o=o|0,KUe(o+24|0)}function KUe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function zUe(o){o=o|0;var l=0;l=en()|0,tn(o,5,4,l,e_e()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function ZUe(o){o=o|0,XUe(o)}function XUe(o){o=o|0,$Ue(o)}function $Ue(o){o=o|0,DZ(o+8|0),s[o+24>>0]=1}function DZ(o){o=o|0,n[o>>2]=0,E[o+8>>3]=0}function e_e(){return 1424}function t_e(){return r_e()|0}function r_e(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0;return l=I,I=I+16|0,d=l+4|0,B=l,u=Tl(8)|0,o=u,A=Kt(16)|0,DZ(A),m=o+4|0,n[m>>2]=A,A=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],bM(A,m,d),n[u>>2]=A,I=l,o|0}function n_e(o,l){o=o|0,l=l|0,n[o>>2]=i_e()|0,n[o+4>>2]=s_e()|0,n[o+12>>2]=l,n[o+8>>2]=o_e()|0,n[o+32>>2]=5}function i_e(){return 11710}function s_e(){return 1416}function o_e(){return Nb()|0}function a_e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(l_e(u),It(u)):l|0&&It(l)}function l_e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function Nb(){var o=0;return s[7904]|0||(n[2600]=c_e()|0,n[2601]=0,o=7904,n[o>>2]=1,n[o+4>>2]=0),10400}function c_e(){return n[357]|0}function u_e(o){o=o|0,f_e(o,4926),A_e(o)|0}function f_e(o,l){o=o|0,l=l|0;var u=0;u=hz()|0,n[o>>2]=u,B_e(u,l),jh(n[o>>2]|0)}function A_e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,p_e()|0),o|0}function p_e(){var o=0;return s[7912]|0||(PZ(10412),gr(56,10412,U|0)|0,o=7912,n[o>>2]=1,n[o+4>>2]=0),_r(10412)|0||PZ(10412),10412}function PZ(o){o=o|0,d_e(o),ud(o,57)}function h_e(o){o=o|0,g_e(o+24|0)}function g_e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function d_e(o){o=o|0;var l=0;l=en()|0,tn(o,5,5,l,I_e()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function m_e(o){o=o|0,y_e(o)}function y_e(o){o=o|0,E_e(o)}function E_e(o){o=o|0;var l=0,u=0;l=o+8|0,u=l+48|0;do n[l>>2]=0,l=l+4|0;while((l|0)<(u|0));s[o+56>>0]=1}function I_e(){return 1432}function C_e(){return w_e()|0}function w_e(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0,k=0;B=I,I=I+16|0,o=B+4|0,l=B,u=Tl(8)|0,A=u,d=Kt(48)|0,m=d,k=m+48|0;do n[m>>2]=0,m=m+4|0;while((m|0)<(k|0));return m=A+4|0,n[m>>2]=d,k=Kt(8)|0,m=n[m>>2]|0,n[l>>2]=0,n[o>>2]=n[l>>2],gz(k,m,o),n[u>>2]=k,I=B,A|0}function B_e(o,l){o=o|0,l=l|0,n[o>>2]=v_e()|0,n[o+4>>2]=S_e()|0,n[o+12>>2]=l,n[o+8>>2]=D_e()|0,n[o+32>>2]=6}function v_e(){return 11704}function S_e(){return 1436}function D_e(){return Nb()|0}function P_e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(b_e(u),It(u)):l|0&&It(l)}function b_e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function x_e(o){o=o|0,k_e(o,4933),Q_e(o)|0,R_e(o)|0}function k_e(o,l){o=o|0,l=l|0;var u=0;u=r4e()|0,n[o>>2]=u,n4e(u,l),jh(n[o>>2]|0)}function Q_e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,Y_e()|0),o|0}function R_e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,T_e()|0),o|0}function T_e(){var o=0;return s[7920]|0||(bZ(10452),gr(58,10452,U|0)|0,o=7920,n[o>>2]=1,n[o+4>>2]=0),_r(10452)|0||bZ(10452),10452}function bZ(o){o=o|0,O_e(o),ud(o,1)}function F_e(o){o=o|0,N_e(o+24|0)}function N_e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function O_e(o){o=o|0;var l=0;l=en()|0,tn(o,5,1,l,__e()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function L_e(o,l,u){o=o|0,l=+l,u=+u,M_e(o,l,u)}function M_e(o,l,u){o=o|0,l=+l,u=+u;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+32|0,m=A+8|0,k=A+17|0,d=A,B=A+16|0,Qf(k,l),E[m>>3]=+Rf(k,l),Qf(B,u),E[d>>3]=+Rf(B,u),U_e(o,m,d),I=A}function U_e(o,l,u){o=o|0,l=l|0,u=u|0,xZ(o+8|0,+E[l>>3],+E[u>>3]),s[o+24>>0]=1}function xZ(o,l,u){o=o|0,l=+l,u=+u,E[o>>3]=l,E[o+8>>3]=u}function __e(){return 1472}function H_e(o,l){return o=+o,l=+l,j_e(o,l)|0}function j_e(o,l){o=+o,l=+l;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return A=I,I=I+16|0,B=A+4|0,k=A+8|0,R=A,d=Tl(8)|0,u=d,m=Kt(16)|0,Qf(B,o),o=+Rf(B,o),Qf(k,l),xZ(m,o,+Rf(k,l)),k=u+4|0,n[k>>2]=m,m=Kt(8)|0,k=n[k>>2]|0,n[R>>2]=0,n[B>>2]=n[R>>2],kZ(m,k,B),n[d>>2]=m,I=A,u|0}function kZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1452,n[u+12>>2]=l,n[o+4>>2]=u}function G_e(o){o=o|0,$y(o),It(o)}function q_e(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function W_e(o){o=o|0,It(o)}function Y_e(){var o=0;return s[7928]|0||(QZ(10488),gr(59,10488,U|0)|0,o=7928,n[o>>2]=1,n[o+4>>2]=0),_r(10488)|0||QZ(10488),10488}function QZ(o){o=o|0,K_e(o),ud(o,60)}function V_e(o){o=o|0,J_e(o+24|0)}function J_e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function K_e(o){o=o|0;var l=0;l=en()|0,tn(o,5,6,l,$_e()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function z_e(o){o=o|0,Z_e(o)}function Z_e(o){o=o|0,X_e(o)}function X_e(o){o=o|0,RZ(o+8|0),s[o+24>>0]=1}function RZ(o){o=o|0,n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,n[o+12>>2]=0}function $_e(){return 1492}function e4e(){return t4e()|0}function t4e(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0;return l=I,I=I+16|0,d=l+4|0,B=l,u=Tl(8)|0,o=u,A=Kt(16)|0,RZ(A),m=o+4|0,n[m>>2]=A,A=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],kZ(A,m,d),n[u>>2]=A,I=l,o|0}function r4e(){var o=0;return s[7936]|0||(c4e(10524),gr(25,10524,U|0)|0,o=7936,n[o>>2]=1,n[o+4>>2]=0),10524}function n4e(o,l){o=o|0,l=l|0,n[o>>2]=i4e()|0,n[o+4>>2]=s4e()|0,n[o+12>>2]=l,n[o+8>>2]=o4e()|0,n[o+32>>2]=7}function i4e(){return 11700}function s4e(){return 1484}function o4e(){return Nb()|0}function a4e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(l4e(u),It(u)):l|0&&It(l)}function l4e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function c4e(o){o=o|0,Lh(o)}function u4e(o,l,u){o=o|0,l=l|0,u=u|0,o=Bn(l)|0,l=f4e(u)|0,u=A4e(u,0)|0,j4e(o,l,u,qM()|0,0)}function f4e(o){return o=o|0,o|0}function A4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=qM()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(FZ(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(E4e(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function qM(){var o=0,l=0;if(s[7944]|0||(TZ(10568),gr(61,10568,U|0)|0,l=7944,n[l>>2]=1,n[l+4>>2]=0),!(_r(10568)|0)){o=10568,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));TZ(10568)}return 10568}function TZ(o){o=o|0,g4e(o)}function p4e(o){o=o|0,h4e(o+24|0)}function h4e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function g4e(o){o=o|0;var l=0;l=en()|0,tn(o,1,17,l,Rz()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function d4e(o){return o=o|0,y4e(n[(m4e(o)|0)>>2]|0)|0}function m4e(o){return o=o|0,(n[(qM()|0)+24>>2]|0)+(o<<3)|0}function y4e(o){return o=o|0,Tb(Vb[o&7]()|0)|0}function FZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function E4e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=I4e(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,C4e(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,FZ(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,w4e(o,d),B4e(d),I=k;return}}function I4e(o){return o=o|0,536870911}function C4e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function w4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function B4e(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function v4e(){S4e()}function S4e(){D4e(10604)}function D4e(o){o=o|0,P4e(o,4955)}function P4e(o,l){o=o|0,l=l|0;var u=0;u=b4e()|0,n[o>>2]=u,x4e(u,l),jh(n[o>>2]|0)}function b4e(){var o=0;return s[7952]|0||(M4e(10612),gr(25,10612,U|0)|0,o=7952,n[o>>2]=1,n[o+4>>2]=0),10612}function x4e(o,l){o=o|0,l=l|0,n[o>>2]=T4e()|0,n[o+4>>2]=F4e()|0,n[o+12>>2]=l,n[o+8>>2]=N4e()|0,n[o+32>>2]=8}function jh(o){o=o|0;var l=0,u=0;l=I,I=I+16|0,u=l,Jy()|0,n[u>>2]=o,k4e(10608,u),I=l}function Jy(){return s[11714]|0||(n[2652]=0,gr(62,10608,U|0)|0,s[11714]=1),10608}function k4e(o,l){o=o|0,l=l|0;var u=0;u=Kt(8)|0,n[u+4>>2]=n[l>>2],n[u>>2]=n[o>>2],n[o>>2]=u}function Q4e(o){o=o|0,R4e(o)}function R4e(o){o=o|0;var l=0,u=0;if(l=n[o>>2]|0,l|0)do u=l,l=n[l>>2]|0,It(u);while(l|0);n[o>>2]=0}function T4e(){return 11715}function F4e(){return 1496}function N4e(){return Fb()|0}function O4e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(L4e(u),It(u)):l|0&&It(l)}function L4e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function M4e(o){o=o|0,Lh(o)}function U4e(o,l){o=o|0,l=l|0;var u=0,A=0;Jy()|0,u=n[2652]|0;e:do if(u|0){for(;A=n[u+4>>2]|0,!(A|0&&!(gX(WM(A)|0,o)|0));)if(u=n[u>>2]|0,!u)break e;_4e(A,l)}while(!1)}function WM(o){return o=o|0,n[o+12>>2]|0}function _4e(o,l){o=o|0,l=l|0;var u=0;o=o+36|0,u=n[o>>2]|0,u|0&&(Sf(u),It(u)),u=Kt(4)|0,Db(u,l),n[o>>2]=u}function YM(){return s[11716]|0||(n[2664]=0,gr(63,10656,U|0)|0,s[11716]=1),10656}function NZ(){var o=0;return s[11717]|0?o=n[2665]|0:(H4e(),n[2665]=1504,s[11717]=1,o=1504),o|0}function H4e(){s[11740]|0||(s[11718]=yr(yr(8,0)|0,0)|0,s[11719]=yr(yr(0,0)|0,0)|0,s[11720]=yr(yr(0,16)|0,0)|0,s[11721]=yr(yr(8,0)|0,0)|0,s[11722]=yr(yr(0,0)|0,0)|0,s[11723]=yr(yr(8,0)|0,0)|0,s[11724]=yr(yr(0,0)|0,0)|0,s[11725]=yr(yr(8,0)|0,0)|0,s[11726]=yr(yr(0,0)|0,0)|0,s[11727]=yr(yr(8,0)|0,0)|0,s[11728]=yr(yr(0,0)|0,0)|0,s[11729]=yr(yr(0,0)|0,32)|0,s[11730]=yr(yr(0,0)|0,32)|0,s[11740]=1)}function OZ(){return 1572}function j4e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,R=0,M=0,L=0;m=I,I=I+32|0,L=m+16|0,M=m+12|0,R=m+8|0,k=m+4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>2]|0}function x2(o){return o=o|0,n[o+16>>2]|0}function q4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;d=I,I=I+32|0,u=d,A=n[o>>2]|0,(n[o+8>>2]|0)-A>>2>>>0<l>>>0&&(WZ(u,l,(n[o+4>>2]|0)-A>>2,o+8|0),YZ(o,u),VZ(u)),I=d}function JM(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0;if(B=I,I=I+32|0,u=B,A=o+4|0,d=((n[A>>2]|0)-(n[o>>2]|0)>>2)+1|0,m=qZ(o)|0,m>>>0<d>>>0)sn(o);else{k=n[o>>2]|0,M=(n[o+8>>2]|0)-k|0,R=M>>1,WZ(u,M>>2>>>0<m>>>1>>>0?R>>>0<d>>>0?d:R:m,(n[A>>2]|0)-k>>2,o+8|0),m=u+8|0,n[n[m>>2]>>2]=n[l>>2],n[m>>2]=(n[m>>2]|0)+4,YZ(o,u),VZ(u),I=B;return}}function k2(o){return o=o|0,n[o+8>>2]|0}function W4e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0;if(B=I,I=I+32|0,u=B,A=o+4|0,d=((n[A>>2]|0)-(n[o>>2]|0)>>2)+1|0,m=GZ(o)|0,m>>>0<d>>>0)sn(o);else{k=n[o>>2]|0,M=(n[o+8>>2]|0)-k|0,R=M>>1,f3e(u,M>>2>>>0<m>>>1>>>0?R>>>0<d>>>0?d:R:m,(n[A>>2]|0)-k>>2,o+8|0),m=u+8|0,n[n[m>>2]>>2]=n[l>>2],n[m>>2]=(n[m>>2]|0)+4,A3e(o,u),p3e(u),I=B;return}}function Ob(o){return o=o|0,n[o>>2]|0}function Y4e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,V4e(o,l,u,A,d,m)}function KM(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>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m+8|0,n[R+8>>2]=n[q>>2],n[q>>2]=0,n[L>>2]=0,n[m>>2]=0,lu(0,M|0,o|0,l|0,u|0,A|0,d|0,Z4e(R)|0)|0,KM(R),np(k),I=B}function z4e(){var o=0;return s[7968]|0||(s3e(10708),o=7968,n[o>>2]=1,n[o+4>>2]=0),10708}function fd(o){return o=o|0,_Z(o)|0}function MZ(o){return o=o|0,UZ(o)|0}function ZM(o){return o=o|0,Tb(o)|0}function XM(o){return o=o|0,$4e(o)|0}function Z4e(o){return o=o|0,X4e(o)|0}function X4e(o){o=o|0;var l=0,u=0,A=0;if(A=(n[o+4>>2]|0)-(n[o>>2]|0)|0,u=A>>2,A=Tl(A+4|0)|0,n[A>>2]=u,u|0){l=0;do n[A+4+(l<<2)>>2]=UZ(n[(n[o>>2]|0)+(l<<2)>>2]|0)|0,l=l+1|0;while((l|0)!=(u|0))}return A|0}function UZ(o){return o=o|0,o|0}function $4e(o){o=o|0;var l=0,u=0,A=0;if(A=(n[o+4>>2]|0)-(n[o>>2]|0)|0,u=A>>2,A=Tl(A+4|0)|0,n[A>>2]=u,u|0){l=0;do n[A+4+(l<<2)>>2]=_Z((n[o>>2]|0)+(l<<2)|0)|0,l=l+1|0;while((l|0)!=(u|0))}return A|0}function _Z(o){o=o|0;var l=0,u=0,A=0,d=0;return d=I,I=I+32|0,l=d+12|0,u=d,A=uM(HZ()|0)|0,A?(fM(l,A),AM(u,l),Nje(o,u),o=pM(l)|0):o=e3e(o)|0,I=d,o|0}function HZ(){var o=0;return s[7960]|0||(i3e(10664),gr(25,10664,U|0)|0,o=7960,n[o>>2]=1,n[o+4>>2]=0),10664}function e3e(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;return u=I,I=I+16|0,d=u+4|0,B=u,A=Tl(8)|0,l=A,k=Kt(4)|0,n[k>>2]=n[o>>2],m=l+4|0,n[m>>2]=k,o=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],jZ(o,m,d),n[A>>2]=o,I=u,l|0}function jZ(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1656,n[u+12>>2]=l,n[o+4>>2]=u}function t3e(o){o=o|0,$y(o),It(o)}function r3e(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function n3e(o){o=o|0,It(o)}function i3e(o){o=o|0,Lh(o)}function s3e(o){o=o|0,Qo(o,o3e()|0,5)}function o3e(){return 1676}function a3e(o,l){o=o|0,l=l|0;var u=0;if((GZ(o)|0)>>>0<l>>>0&&sn(o),l>>>0>1073741823)Nt();else{u=Kt(l<<2)|0,n[o+4>>2]=u,n[o>>2]=u,n[o+8>>2]=u+(l<<2);return}}function l3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,A=o+4|0,o=u-l|0,(o|0)>0&&(Qr(n[A>>2]|0,l|0,o|0)|0,n[A>>2]=(n[A>>2]|0)+(o>>>2<<2))}function GZ(o){return o=o|0,1073741823}function c3e(o,l){o=o|0,l=l|0;var u=0;if((qZ(o)|0)>>>0<l>>>0&&sn(o),l>>>0>1073741823)Nt();else{u=Kt(l<<2)|0,n[o+4>>2]=u,n[o>>2]=u,n[o+8>>2]=u+(l<<2);return}}function u3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,A=o+4|0,o=u-l|0,(o|0)>0&&(Qr(n[A>>2]|0,l|0,o|0)|0,n[A>>2]=(n[A>>2]|0)+(o>>>2<<2))}function qZ(o){return o=o|0,1073741823}function f3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>1073741823)Nt();else{d=Kt(l<<2)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<2)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<2)}function A3e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A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|0,k3e(o,l,u)}function Ky(o){return o=o|0,o|0}function m3e(o,l,u){o=o|0,l=l|0,u=u|0,D3e(o,l,u)}function JZ(o){return o=o|0,o+16|0}function y3e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;if(m=I,I=I+16|0,d=m+8|0,u=m,n[o>>2]=0,A=n[l>>2]|0,n[d>>2]=A,n[u>>2]=o,u=S3e(u)|0,A|0){if(A=Kt(12)|0,B=(zZ(d)|0)+4|0,o=n[B+4>>2]|0,l=A+4|0,n[l>>2]=n[B>>2],n[l+4>>2]=o,l=n[n[d>>2]>>2]|0,n[d>>2]=l,!l)o=A;else for(l=A;o=Kt(12)|0,R=(zZ(d)|0)+4|0,k=n[R+4>>2]|0,B=o+4|0,n[B>>2]=n[R>>2],n[B+4>>2]=k,n[l>>2]=o,B=n[n[d>>2]>>2]|0,n[d>>2]=B,B;)l=o;n[o>>2]=n[u>>2],n[u>>2]=A}I=m}function E3e(o,l,u){o=o|0,l=l|0,u=u|0,I3e(o,l,u)}function KZ(o){return o=o|0,o+24|0}function I3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+32|0,B=A+24|0,d=A+16|0,k=A+12|0,m=A,Fl(d),o=Os(o)|0,n[k>>2]=n[l>>2],zM(m,u),n[B>>2]=n[k>>2],C3e(o,B,m),np(m),Nl(d),I=A}function C3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=I,I=I+32|0,B=A+16|0,k=A+12|0,d=A,m=da(w3e()|0)|0,n[k>>2]=n[l>>2],n[B>>2]=n[k>>2],l=fd(B)|0,n[d>>2]=n[u>>2],B=u+4|0,n[d+4>>2]=n[B>>2],k=u+8|0,n[d+8>>2]=n[k>>2],n[k>>2]=0,n[B>>2]=0,n[u>>2]=0,Rs(0,m|0,o|0,l|0,XM(d)|0)|0,np(d),I=A}function w3e(){var o=0;return s[7976]|0||(B3e(10720),o=7976,n[o>>2]=1,n[o+4>>2]=0),10720}function B3e(o){o=o|0,Qo(o,v3e()|0,2)}function v3e(){return 1732}function S3e(o){return o=o|0,n[o>>2]|0}function zZ(o){return o=o|0,n[o>>2]|0}function D3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+32|0,m=A+16|0,d=A+8|0,B=A,Fl(d),o=Os(o)|0,n[B>>2]=n[l>>2],u=n[u>>2]|0,n[m>>2]=n[B>>2],ZZ(o,m,u),Nl(d),I=A}function ZZ(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+16|0,m=A+4|0,B=A,d=da(P3e()|0)|0,n[B>>2]=n[l>>2],n[m>>2]=n[B>>2],l=fd(m)|0,Rs(0,d|0,o|0,l|0,MZ(u)|0)|0,I=A}function P3e(){var o=0;return s[7984]|0||(b3e(10732),o=7984,n[o>>2]=1,n[o+4>>2]=0),10732}function b3e(o){o=o|0,Qo(o,x3e()|0,2)}function x3e(){return 1744}function k3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;A=I,I=I+32|0,m=A+16|0,d=A+8|0,B=A,Fl(d),o=Os(o)|0,n[B>>2]=n[l>>2],u=n[u>>2]|0,n[m>>2]=n[B>>2],ZZ(o,m,u),Nl(d),I=A}function Q3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+32|0,B=d+16|0,m=d+8|0,k=d,Fl(m),o=Os(o)|0,n[k>>2]=n[l>>2],u=s[u>>0]|0,A=s[A>>0]|0,n[B>>2]=n[k>>2],R3e(o,B,u,A),Nl(m),I=d}function R3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,B=d+4|0,k=d,m=da(T3e()|0)|0,n[k>>2]=n[l>>2],n[B>>2]=n[k>>2],l=fd(B)|0,u=zy(u)|0,Li(0,m|0,o|0,l|0,u|0,zy(A)|0)|0,I=d}function T3e(){var o=0;return s[7992]|0||(N3e(10744),o=7992,n[o>>2]=1,n[o+4>>2]=0),10744}function zy(o){return o=o|0,F3e(o)|0}function F3e(o){return o=o|0,o&255|0}function N3e(o){o=o|0,Qo(o,O3e()|0,3)}function O3e(){return 1756}function L3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;switch(ae=I,I=I+32|0,k=ae+8|0,R=ae+4|0,M=ae+20|0,L=ae,mM(o,0),A=Fje(l)|0,n[k>>2]=0,q=k+4|0,n[q>>2]=0,n[k+8>>2]=0,A<<24>>24){case 0:{s[M>>0]=0,M3e(R,u,M),Lb(o,R)|0,Df(R);break}case 8:{q=iU(l)|0,s[M>>0]=8,Pu(L,n[q+4>>2]|0),U3e(R,u,M,L,q+8|0),Lb(o,R)|0,Df(R);break}case 9:{if(m=iU(l)|0,l=n[m+4>>2]|0,l|0)for(B=k+8|0,d=m+12|0;l=l+-1|0,Pu(R,n[d>>2]|0),A=n[q>>2]|0,A>>>0<(n[B>>2]|0)>>>0?(n[A>>2]=n[R>>2],n[q>>2]=(n[q>>2]|0)+4):JM(k,R),l;)d=d+4|0;s[M>>0]=9,Pu(L,n[m+8>>2]|0),_3e(R,u,M,L,k),Lb(o,R)|0,Df(R);break}default:q=iU(l)|0,s[M>>0]=A,Pu(L,n[q+4>>2]|0),H3e(R,u,M,L),Lb(o,R)|0,Df(R)}np(k),I=ae}function M3e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;A=I,I=I+16|0,d=A,Fl(d),l=Os(l)|0,e8e(o,l,s[u>>0]|0),Nl(d),I=A}function Lb(o,l){o=o|0,l=l|0;var u=0;return u=n[o>>2]|0,u|0&&Na(u|0),n[o>>2]=n[l>>2],n[l>>2]=0,o|0}function U3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,R=0;m=I,I=I+32|0,k=m+16|0,B=m+8|0,R=m,Fl(B),l=Os(l)|0,u=s[u>>0]|0,n[R>>2]=n[A>>2],d=n[d>>2]|0,n[k>>2]=n[R>>2],z3e(o,l,u,k,d),Nl(B),I=m}function _3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,R=0,M=0;m=I,I=I+32|0,R=m+24|0,B=m+16|0,M=m+12|0,k=m,Fl(B),l=Os(l)|0,u=s[u>>0]|0,n[M>>2]=n[A>>2],zM(k,d),n[R>>2]=n[M>>2],Y3e(o,l,u,R,k),np(k),Nl(B),I=m}function H3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+32|0,B=d+16|0,m=d+8|0,k=d,Fl(m),l=Os(l)|0,u=s[u>>0]|0,n[k>>2]=n[A>>2],n[B>>2]=n[k>>2],j3e(o,l,u,B),Nl(m),I=d}function j3e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0,B=0,k=0;d=I,I=I+16|0,m=d+4|0,k=d,B=da(G3e()|0)|0,u=zy(u)|0,n[k>>2]=n[A>>2],n[m>>2]=n[k>>2],Mb(o,Rs(0,B|0,l|0,u|0,fd(m)|0)|0),I=d}function G3e(){var o=0;return s[8e3]|0||(q3e(10756),o=8e3,n[o>>2]=1,n[o+4>>2]=0),10756}function Mb(o,l){o=o|0,l=l|0,mM(o,l)}function q3e(o){o=o|0,Qo(o,W3e()|0,2)}function W3e(){return 1772}function Y3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,R=0,M=0;m=I,I=I+32|0,R=m+16|0,M=m+12|0,B=m,k=da(V3e()|0)|0,u=zy(u)|0,n[M>>2]=n[A>>2],n[R>>2]=n[M>>2],A=fd(R)|0,n[B>>2]=n[d>>2],R=d+4|0,n[B+4>>2]=n[R>>2],M=d+8|0,n[B+8>>2]=n[M>>2],n[M>>2]=0,n[R>>2]=0,n[d>>2]=0,Mb(o,Li(0,k|0,l|0,u|0,A|0,XM(B)|0)|0),np(B),I=m}function V3e(){var o=0;return s[8008]|0||(J3e(10768),o=8008,n[o>>2]=1,n[o+4>>2]=0),10768}function J3e(o){o=o|0,Qo(o,K3e()|0,3)}function K3e(){return 1784}function z3e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,R=0;m=I,I=I+16|0,k=m+4|0,R=m,B=da(Z3e()|0)|0,u=zy(u)|0,n[R>>2]=n[A>>2],n[k>>2]=n[R>>2],A=fd(k)|0,Mb(o,Li(0,B|0,l|0,u|0,A|0,ZM(d)|0)|0),I=m}function Z3e(){var o=0;return s[8016]|0||(X3e(10780),o=8016,n[o>>2]=1,n[o+4>>2]=0),10780}function X3e(o){o=o|0,Qo(o,$3e()|0,3)}function $3e(){return 1800}function e8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;A=da(t8e()|0)|0,Mb(o,dn(0,A|0,l|0,zy(u)|0)|0)}function t8e(){var o=0;return s[8024]|0||(r8e(10792),o=8024,n[o>>2]=1,n[o+4>>2]=0),10792}function r8e(o){o=o|0,Qo(o,n8e()|0,1)}function n8e(){return 1816}function i8e(){s8e(),o8e(),a8e()}function s8e(){n[2702]=SX(65536)|0}function o8e(){P8e(10856)}function a8e(){l8e(10816)}function l8e(o){o=o|0,c8e(o,5044),u8e(o)|0}function c8e(o,l){o=o|0,l=l|0;var u=0;u=HZ()|0,n[o>>2]=u,C8e(u,l),jh(n[o>>2]|0)}function u8e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,f8e()|0),o|0}function f8e(){var o=0;return s[8032]|0||(XZ(10820),gr(64,10820,U|0)|0,o=8032,n[o>>2]=1,n[o+4>>2]=0),_r(10820)|0||XZ(10820),10820}function XZ(o){o=o|0,h8e(o),ud(o,25)}function A8e(o){o=o|0,p8e(o+24|0)}function p8e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function h8e(o){o=o|0;var l=0;l=en()|0,tn(o,5,18,l,y8e()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function g8e(o,l){o=o|0,l=l|0,d8e(o,l)}function d8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;u=I,I=I+16|0,A=u,d=u+4|0,ad(d,l),n[A>>2]=ld(d,l)|0,m8e(o,A),I=u}function m8e(o,l){o=o|0,l=l|0,$Z(o+4|0,n[l>>2]|0),s[o+8>>0]=1}function $Z(o,l){o=o|0,l=l|0,n[o>>2]=l}function y8e(){return 1824}function E8e(o){return o=o|0,I8e(o)|0}function I8e(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0;return u=I,I=I+16|0,d=u+4|0,B=u,A=Tl(8)|0,l=A,k=Kt(4)|0,ad(d,o),$Z(k,ld(d,o)|0),m=l+4|0,n[m>>2]=k,o=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],jZ(o,m,d),n[A>>2]=o,I=u,l|0}function Tl(o){o=o|0;var l=0,u=0;return o=o+7&-8,o>>>0<=32768&&(l=n[2701]|0,o>>>0<=(65536-l|0)>>>0)?(u=(n[2702]|0)+l|0,n[2701]=l+o,o=u):(o=SX(o+8|0)|0,n[o>>2]=n[2703],n[2703]=o,o=o+8|0),o|0}function C8e(o,l){o=o|0,l=l|0,n[o>>2]=w8e()|0,n[o+4>>2]=B8e()|0,n[o+12>>2]=l,n[o+8>>2]=v8e()|0,n[o+32>>2]=9}function w8e(){return 11744}function B8e(){return 1832}function v8e(){return Nb()|0}function S8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(D8e(u),It(u)):l|0&&It(l)}function D8e(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function P8e(o){o=o|0,b8e(o,5052),x8e(o)|0,k8e(o,5058,26)|0,Q8e(o,5069,1)|0,R8e(o,5077,10)|0,T8e(o,5087,19)|0,F8e(o,5094,27)|0}function b8e(o,l){o=o|0,l=l|0;var u=0;u=Dje()|0,n[o>>2]=u,Pje(u,l),jh(n[o>>2]|0)}function x8e(o){o=o|0;var l=0;return l=n[o>>2]|0,cd(l,Aje()|0),o|0}function k8e(o,l,u){return o=o|0,l=l|0,u=u|0,JHe(o,Bn(l)|0,u,0),o|0}function Q8e(o,l,u){return o=o|0,l=l|0,u=u|0,THe(o,Bn(l)|0,u,0),o|0}function R8e(o,l,u){return o=o|0,l=l|0,u=u|0,fHe(o,Bn(l)|0,u,0),o|0}function T8e(o,l,u){return o=o|0,l=l|0,u=u|0,z8e(o,Bn(l)|0,u,0),o|0}function eX(o,l){o=o|0,l=l|0;var u=0,A=0;e:for(;;){for(u=n[2703]|0;;){if((u|0)==(l|0))break e;if(A=n[u>>2]|0,n[2703]=A,!u)u=A;else break}It(u)}n[2701]=o}function F8e(o,l,u){return o=o|0,l=l|0,u=u|0,N8e(o,Bn(l)|0,u,0),o|0}function N8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=$M()|0,o=O8e(u)|0,vn(m,l,d,o,L8e(u,A)|0,A)}function $M(){var o=0,l=0;if(s[8040]|0||(rX(10860),gr(65,10860,U|0)|0,l=8040,n[l>>2]=1,n[l+4>>2]=0),!(_r(10860)|0)){o=10860,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));rX(10860)}return 10860}function O8e(o){return o=o|0,o|0}function L8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=$M()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(tX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(M8e(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function tX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function M8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=U8e(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,_8e(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,tX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,H8e(o,d),j8e(d),I=k;return}}function U8e(o){return o=o|0,536870911}function _8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function H8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function j8e(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function rX(o){o=o|0,W8e(o)}function G8e(o){o=o|0,q8e(o+24|0)}function q8e(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function W8e(o){o=o|0;var l=0;l=en()|0,tn(o,1,11,l,Y8e()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function Y8e(){return 1840}function V8e(o,l,u){o=o|0,l=l|0,u=u|0,K8e(n[(J8e(o)|0)>>2]|0,l,u)}function J8e(o){return o=o|0,(n[($M()|0)+24>>2]|0)+(o<<3)|0}function K8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;A=I,I=I+16|0,m=A+1|0,d=A,ad(m,l),l=ld(m,l)|0,ad(d,u),u=ld(d,u)|0,sp[o&31](l,u),I=A}function z8e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=eU()|0,o=Z8e(u)|0,vn(m,l,d,o,X8e(u,A)|0,A)}function eU(){var o=0,l=0;if(s[8048]|0||(iX(10896),gr(66,10896,U|0)|0,l=8048,n[l>>2]=1,n[l+4>>2]=0),!(_r(10896)|0)){o=10896,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));iX(10896)}return 10896}function Z8e(o){return o=o|0,o|0}function X8e(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=eU()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(nX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):($8e(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function nX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function $8e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=eHe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,tHe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,nX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,rHe(o,d),nHe(d),I=k;return}}function eHe(o){return o=o|0,536870911}function tHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function rHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function nHe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function iX(o){o=o|0,oHe(o)}function iHe(o){o=o|0,sHe(o+24|0)}function sHe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function oHe(o){o=o|0;var l=0;l=en()|0,tn(o,1,11,l,aHe()|0,1),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function aHe(){return 1852}function lHe(o,l){return o=o|0,l=l|0,uHe(n[(cHe(o)|0)>>2]|0,l)|0}function cHe(o){return o=o|0,(n[(eU()|0)+24>>2]|0)+(o<<3)|0}function uHe(o,l){o=o|0,l=l|0;var u=0,A=0;return u=I,I=I+16|0,A=u,ad(A,l),l=ld(A,l)|0,l=Tb(gd[o&31](l)|0)|0,I=u,l|0}function fHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=tU()|0,o=AHe(u)|0,vn(m,l,d,o,pHe(u,A)|0,A)}function tU(){var o=0,l=0;if(s[8056]|0||(oX(10932),gr(67,10932,U|0)|0,l=8056,n[l>>2]=1,n[l+4>>2]=0),!(_r(10932)|0)){o=10932,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));oX(10932)}return 10932}function AHe(o){return o=o|0,o|0}function pHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=tU()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(sX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(hHe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function sX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function hHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=gHe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,dHe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,sX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,mHe(o,d),yHe(d),I=k;return}}function gHe(o){return o=o|0,536870911}function dHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function mHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function yHe(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function oX(o){o=o|0,CHe(o)}function EHe(o){o=o|0,IHe(o+24|0)}function IHe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function CHe(o){o=o|0;var l=0;l=en()|0,tn(o,1,7,l,wHe()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function wHe(){return 1860}function BHe(o,l,u){return o=o|0,l=l|0,u=u|0,SHe(n[(vHe(o)|0)>>2]|0,l,u)|0}function vHe(o){return o=o|0,(n[(tU()|0)+24>>2]|0)+(o<<3)|0}function SHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0;return A=I,I=I+32|0,B=A+12|0,m=A+8|0,k=A,R=A+16|0,d=A+4|0,DHe(R,l),PHe(k,R,l),Mh(d,u),u=Uh(d,u)|0,n[B>>2]=n[k>>2],F2[o&15](m,B,u),u=bHe(m)|0,Df(m),_h(d),I=A,u|0}function DHe(o,l){o=o|0,l=l|0}function PHe(o,l,u){o=o|0,l=l|0,u=u|0,xHe(o,u)}function bHe(o){return o=o|0,Os(o)|0}function xHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0;d=I,I=I+16|0,u=d,A=l,A&1?(kHe(u,0),Me(A|0,u|0)|0,QHe(o,u),RHe(u)):n[o>>2]=n[l>>2],I=d}function kHe(o,l){o=o|0,l=l|0,Su(o,l),n[o+4>>2]=0,s[o+8>>0]=0}function QHe(o,l){o=o|0,l=l|0,n[o>>2]=n[l+4>>2]}function RHe(o){o=o|0,s[o+8>>0]=0}function THe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=rU()|0,o=FHe(u)|0,vn(m,l,d,o,NHe(u,A)|0,A)}function rU(){var o=0,l=0;if(s[8064]|0||(lX(10968),gr(68,10968,U|0)|0,l=8064,n[l>>2]=1,n[l+4>>2]=0),!(_r(10968)|0)){o=10968,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));lX(10968)}return 10968}function FHe(o){return o=o|0,o|0}function NHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=rU()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(aX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(OHe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function aX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function OHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=LHe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,MHe(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,aX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,UHe(o,d),_He(d),I=k;return}}function LHe(o){return o=o|0,536870911}function MHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function UHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function _He(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function lX(o){o=o|0,GHe(o)}function HHe(o){o=o|0,jHe(o+24|0)}function jHe(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function GHe(o){o=o|0;var l=0;l=en()|0,tn(o,1,1,l,qHe()|0,5),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function qHe(){return 1872}function WHe(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,VHe(n[(YHe(o)|0)>>2]|0,l,u,A,d,m)}function YHe(o){return o=o|0,(n[(rU()|0)+24>>2]|0)+(o<<3)|0}function VHe(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,R=0,M=0,L=0,q=0;B=I,I=I+32|0,k=B+16|0,R=B+12|0,M=B+8|0,L=B+4|0,q=B,Mh(k,l),l=Uh(k,l)|0,Mh(R,u),u=Uh(R,u)|0,Mh(M,A),A=Uh(M,A)|0,Mh(L,d),d=Uh(L,d)|0,Mh(q,m),m=Uh(q,m)|0,kX[o&1](l,u,A,d,m),_h(q),_h(L),_h(M),_h(R),_h(k),I=B}function JHe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;m=n[o>>2]|0,d=nU()|0,o=KHe(u)|0,vn(m,l,d,o,zHe(u,A)|0,A)}function nU(){var o=0,l=0;if(s[8072]|0||(uX(11004),gr(69,11004,U|0)|0,l=8072,n[l>>2]=1,n[l+4>>2]=0),!(_r(11004)|0)){o=11004,l=o+36|0;do n[o>>2]=0,o=o+4|0;while((o|0)<(l|0));uX(11004)}return 11004}function KHe(o){return o=o|0,o|0}function zHe(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0,k=0,R=0;return k=I,I=I+16|0,d=k,m=k+4|0,n[d>>2]=o,R=nU()|0,B=R+24|0,l=yr(l,4)|0,n[m>>2]=l,u=R+28|0,A=n[u>>2]|0,A>>>0<(n[R+32>>2]|0)>>>0?(cX(A,o,l),l=(n[u>>2]|0)+8|0,n[u>>2]=l):(ZHe(B,d,m),l=n[u>>2]|0),I=k,(l-(n[B>>2]|0)>>3)+-1|0}function cX(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,n[o+4>>2]=u}function ZHe(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0;if(k=I,I=I+32|0,d=k,m=o+4|0,B=((n[m>>2]|0)-(n[o>>2]|0)>>3)+1|0,A=XHe(o)|0,A>>>0<B>>>0)sn(o);else{R=n[o>>2]|0,L=(n[o+8>>2]|0)-R|0,M=L>>2,$He(d,L>>3>>>0<A>>>1>>>0?M>>>0<B>>>0?B:M:A,(n[m>>2]|0)-R>>3,o+8|0),B=d+8|0,cX(n[B>>2]|0,n[l>>2]|0,n[u>>2]|0),n[B>>2]=(n[B>>2]|0)+8,eje(o,d),tje(d),I=k;return}}function XHe(o){return o=o|0,536870911}function $He(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0;n[o+12>>2]=0,n[o+16>>2]=A;do if(l)if(l>>>0>536870911)Nt();else{d=Kt(l<<3)|0;break}else d=0;while(!1);n[o>>2]=d,A=d+(u<<3)|0,n[o+8>>2]=A,n[o+4>>2]=A,n[o+12>>2]=d+(l<<3)}function eje(o,l){o=o|0,l=l|0;var u=0,A=0,d=0,m=0,B=0;A=n[o>>2]|0,B=o+4|0,m=l+4|0,d=(n[B>>2]|0)-A|0,u=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=u,(d|0)>0?(Qr(u|0,A|0,d|0)|0,A=m,u=n[m>>2]|0):A=m,m=n[o>>2]|0,n[o>>2]=u,n[A>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=o+8|0,B=l+12|0,o=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=o,n[l>>2]=n[A>>2]}function tje(o){o=o|0;var l=0,u=0,A=0;l=n[o+4>>2]|0,u=o+8|0,A=n[u>>2]|0,(A|0)!=(l|0)&&(n[u>>2]=A+(~((A+-8-l|0)>>>3)<<3)),o=n[o>>2]|0,o|0&&It(o)}function uX(o){o=o|0,ije(o)}function rje(o){o=o|0,nje(o+24|0)}function nje(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function ije(o){o=o|0;var l=0;l=en()|0,tn(o,1,12,l,sje()|0,2),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function sje(){return 1896}function oje(o,l,u){o=o|0,l=l|0,u=u|0,lje(n[(aje(o)|0)>>2]|0,l,u)}function aje(o){return o=o|0,(n[(nU()|0)+24>>2]|0)+(o<<3)|0}function lje(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;A=I,I=I+16|0,m=A+4|0,d=A,cje(m,l),l=uje(m,l)|0,Mh(d,u),u=Uh(d,u)|0,sp[o&31](l,u),_h(d),I=A}function cje(o,l){o=o|0,l=l|0}function uje(o,l){return o=o|0,l=l|0,fje(l)|0}function fje(o){return o=o|0,o|0}function Aje(){var o=0;return s[8080]|0||(fX(11040),gr(70,11040,U|0)|0,o=8080,n[o>>2]=1,n[o+4>>2]=0),_r(11040)|0||fX(11040),11040}function fX(o){o=o|0,gje(o),ud(o,71)}function pje(o){o=o|0,hje(o+24|0)}function hje(o){o=o|0;var l=0,u=0,A=0;u=n[o>>2]|0,A=u,u|0&&(o=o+4|0,l=n[o>>2]|0,(l|0)!=(u|0)&&(n[o>>2]=l+(~((l+-8-A|0)>>>3)<<3)),It(u))}function gje(o){o=o|0;var l=0;l=en()|0,tn(o,5,7,l,Eje()|0,0),n[o+24>>2]=0,n[o+28>>2]=0,n[o+32>>2]=0}function dje(o){o=o|0,mje(o)}function mje(o){o=o|0,yje(o)}function yje(o){o=o|0,s[o+8>>0]=1}function Eje(){return 1936}function Ije(){return Cje()|0}function Cje(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0;return l=I,I=I+16|0,d=l+4|0,B=l,u=Tl(8)|0,o=u,m=o+4|0,n[m>>2]=Kt(1)|0,A=Kt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],wje(A,m,d),n[u>>2]=A,I=l,o|0}function wje(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]=l,u=Kt(16)|0,n[u+4>>2]=0,n[u+8>>2]=0,n[u>>2]=1916,n[u+12>>2]=l,n[o+4>>2]=u}function Bje(o){o=o|0,$y(o),It(o)}function vje(o){o=o|0,o=n[o+12>>2]|0,o|0&&It(o)}function Sje(o){o=o|0,It(o)}function Dje(){var o=0;return s[8088]|0||(Tje(11076),gr(25,11076,U|0)|0,o=8088,n[o>>2]=1,n[o+4>>2]=0),11076}function Pje(o,l){o=o|0,l=l|0,n[o>>2]=bje()|0,n[o+4>>2]=xje()|0,n[o+12>>2]=l,n[o+8>>2]=kje()|0,n[o+32>>2]=10}function bje(){return 11745}function xje(){return 1940}function kje(){return Fb()|0}function Qje(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,(Hh(A,896)|0)==512?u|0&&(Rje(u),It(u)):l|0&&It(l)}function Rje(o){o=o|0,o=n[o+4>>2]|0,o|0&&Gh(o)}function Tje(o){o=o|0,Lh(o)}function Pu(o,l){o=o|0,l=l|0,n[o>>2]=l}function iU(o){return o=o|0,n[o>>2]|0}function Fje(o){return o=o|0,s[n[o>>2]>>0]|0}function Nje(o,l){o=o|0,l=l|0;var u=0,A=0;u=I,I=I+16|0,A=u,n[A>>2]=n[o>>2],Oje(l,A)|0,I=u}function Oje(o,l){o=o|0,l=l|0;var u=0;return u=Lje(n[o>>2]|0,l)|0,l=o+4|0,n[(n[l>>2]|0)+8>>2]=u,n[(n[l>>2]|0)+8>>2]|0}function Lje(o,l){o=o|0,l=l|0;var u=0,A=0;return u=I,I=I+16|0,A=u,Fl(A),o=Os(o)|0,l=Mje(o,n[l>>2]|0)|0,Nl(A),I=u,l|0}function Fl(o){o=o|0,n[o>>2]=n[2701],n[o+4>>2]=n[2703]}function Mje(o,l){o=o|0,l=l|0;var u=0;return u=da(Uje()|0)|0,dn(0,u|0,o|0,ZM(l)|0)|0}function Nl(o){o=o|0,eX(n[o>>2]|0,n[o+4>>2]|0)}function Uje(){var o=0;return s[8096]|0||(_je(11120),o=8096,n[o>>2]=1,n[o+4>>2]=0),11120}function _je(o){o=o|0,Qo(o,Hje()|0,1)}function Hje(){return 1948}function jje(){Gje()}function Gje(){var o=0,l=0,u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0;if(Le=I,I=I+16|0,L=Le+4|0,q=Le,oa(65536,10804,n[2702]|0,10812),u=NZ()|0,l=n[u>>2]|0,o=n[l>>2]|0,o|0)for(A=n[u+8>>2]|0,u=n[u+4>>2]|0;pf(o|0,c[u>>0]|0|0,s[A>>0]|0),l=l+4|0,o=n[l>>2]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(A)|0,q=_r(A)|0,Qe=Ob(l)|0,uu(ae|0,k|0,R|0,M|0,L|0,0,q|0,Qe|0,sU(l)|0,oU(l)|0);break r}case 1:{B=k2(A)|0,k=b2(A)|0,R=(x2(A)|0)+1|0,M=Ub(A)|0,L=pX(l)|0,q=_r(A)|0,Qe=Ob(l)|0,uu(ae|0,B|0,k|0,R|0,M|0,L|0,q|0,Qe|0,sU(l)|0,oU(l)|0);break r}case 5:{M=k2(A)|0,L=b2(A)|0,q=(x2(A)|0)+1|0,Qe=Ub(A)|0,uu(ae|0,M|0,L|0,q|0,Qe|0,Zje(A)|0,_r(A)|0,0,0,0);break r}default:break r}while(!1);u=n[u>>2]|0}while(u|0)}if(o=n[o>>2]|0,!o)break e}Nt()}while(!1);ve(),I=Le}function qje(){return 11703}function Wje(o){o=o|0,s[o+40>>0]=0}function Yje(o){return o=o|0,(s[o+40>>0]|0)!=0|0}function Vje(o,l){return o=o|0,l=l|0,l=Xje(l)|0,o=n[l>>2]|0,n[l>>2]=n[o>>2],It(o),n[l>>2]|0}function Jje(o){o=o|0,s[o+40>>0]=1}function AX(o){return o=o|0,n[o+20>>2]|0}function Kje(o){return o=o|0,n[o+8>>2]|0}function zje(o){return o=o|0,n[o+32>>2]|0}function Ub(o){return o=o|0,n[o+4>>2]|0}function pX(o){return o=o|0,n[o+4>>2]|0}function sU(o){return o=o|0,n[o+8>>2]|0}function oU(o){return o=o|0,n[o+16>>2]|0}function Zje(o){return o=o|0,n[o+20>>2]|0}function Xje(o){return o=o|0,n[o>>2]|0}function _b(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Xe=0,ct=0,He=0,We=0,Lt=0;Lt=I,I=I+16|0,ae=Lt;do if(o>>>0<245){if(M=o>>>0<11?16:o+11&-8,o=M>>>3,q=n[2783]|0,u=q>>>o,u&3|0)return l=(u&1^1)+o|0,o=11172+(l<<1<<2)|0,u=o+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+24>>2]|0,l=n[R+12>>2]|0;do if((l|0)==(R|0)){if(o=R+20|0,l=n[o>>2]|0,!l&&(o=R+16|0,l=n[o>>2]|0,!l)){u=0;break}for(;;){if(u=l+20|0,A=n[u>>2]|0,A|0){l=A,o=u;continue}if(u=l+16|0,A=n[u>>2]|0,A)l=A,o=u;else break}n[o>>2]=0,u=l}else u=n[R+8>>2]|0,n[u+12>>2]=l,n[l+8>>2]=u,u=l;while(!1);do if(d|0){if(l=n[R+28>>2]|0,o=11436+(l<<2)|0,(R|0)==(n[o>>2]|0)){if(n[o>>2]=u,!u){n[2784]=k&~(1<<l);break}}else if(n[d+16+(((n[d+16>>2]|0)!=(R|0)&1)<<2)>>2]=u,!u)break;n[u+24>>2]=d,l=n[R+16>>2]|0,l|0&&(n[u+16>>2]=l,n[l+24>>2]=u),l=n[R+20>>2]|0,l|0&&(n[u+20>>2]=l,n[l+24>>2]=u)}while(!1);return m>>>0<16?(We=m+M|0,n[R+4>>2]=We|3,We=R+We+4|0,n[We>>2]=n[We>>2]|1):(n[R+4>>2]=M|3,n[B+4>>2]=m|1,n[B+m>>2]=m,L|0&&(A=n[2788]|0,l=L>>>3,u=11172+(l<<1<<2)|0,l=1<<l,q&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=q|l,l=u,o=u+8|0),n[o>>2]=A,n[l+12>>2]=A,n[A+8>>2]=l,n[A+12>>2]=u),n[2785]=m,n[2788]=B),We=R+8|0,I=Lt,We|0}else q=M}else q=M}else q=M}else if(o>>>0<=4294967231)if(o=o+11|0,M=o&-8,R=n[2784]|0,R){A=0-M|0,o=o>>>8,o?M>>>0>16777215?k=31:(q=(o+1048320|0)>>>16&8,He=o<<q,L=(He+520192|0)>>>16&4,He=He<<L,k=(He+245760|0)>>>16&2,k=14-(L|q|k)+(He<<k>>>15)|0,k=M>>>(k+7|0)&1|k<<1):k=0,u=n[11436+(k<<2)>>2]|0;e:do if(!u)u=0,o=0,He=57;else for(o=0,B=M<<((k|0)==31?0:25-(k>>>1)|0),m=0;;){if(d=(n[u+4>>2]&-8)-M|0,d>>>0<A>>>0)if(d)o=u,A=d;else{o=u,A=0,d=u,He=61;break e}if(d=n[u+20>>2]|0,u=n[u+16+(B>>>31<<2)>>2]|0,m=(d|0)==0|(d|0)==(u|0)?m:d,d=(u|0)==0,d){u=m,He=57;break}else B=B<<((d^1)&1)}while(!1);if((He|0)==57){if((u|0)==0&(o|0)==0){if(o=2<<k,o=R&(o|0-o),!o){q=M;break}q=(o&0-o)+-1|0,B=q>>>12&16,q=q>>>B,m=q>>>5&8,q=q>>>m,k=q>>>2&4,q=q>>>k,L=q>>>1&2,q=q>>>L,u=q>>>1&1,o=0,u=n[11436+((m|B|k|L|u)+(q>>>u)<<2)>>2]|0}u?(d=u,He=61):(k=o,B=A)}if((He|0)==61)for(;;)if(He=0,u=(n[d+4>>2]&-8)-M|0,q=u>>>0<A>>>0,u=q?u:A,o=q?d:o,d=n[d+16+(((n[d+16>>2]|0)==0&1)<<2)>>2]|0,d)A=u,He=61;else{k=o,B=u;break}if(k|0&&B>>>0<((n[2785]|0)-M|0)>>>0){if(m=k+M|0,k>>>0>=m>>>0)return We=0,I=Lt,We|0;d=n[k+24>>2]|0,l=n[k+12>>2]|0;do if((l|0)==(k|0)){if(o=k+20|0,l=n[o>>2]|0,!l&&(o=k+16|0,l=n[o>>2]|0,!l)){l=0;break}for(;;){if(u=l+20|0,A=n[u>>2]|0,A|0){l=A,o=u;continue}if(u=l+16|0,A=n[u>>2]|0,A)l=A,o=u;else break}n[o>>2]=0}else We=n[k+8>>2]|0,n[We+12>>2]=l,n[l+8>>2]=We;while(!1);do if(d){if(o=n[k+28>>2]|0,u=11436+(o<<2)|0,(k|0)==(n[u>>2]|0)){if(n[u>>2]=l,!l){A=R&~(1<<o),n[2784]=A;break}}else if(n[d+16+(((n[d+16>>2]|0)!=(k|0)&1)<<2)>>2]=l,!l){A=R;break}n[l+24>>2]=d,o=n[k+16>>2]|0,o|0&&(n[l+16>>2]=o,n[o+24>>2]=l),o=n[k+20>>2]|0,o&&(n[l+20>>2]=o,n[o+24>>2]=l),A=R}else A=R;while(!1);do if(B>>>0>=16){if(n[k+4>>2]=M|3,n[m+4>>2]=B|1,n[m+B>>2]=B,l=B>>>3,B>>>0<256){u=11172+(l<<1<<2)|0,o=n[2783]|0,l=1<<l,o&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=o|l,l=u,o=u+8|0),n[o>>2]=m,n[l+12>>2]=m,n[m+8>>2]=l,n[m+12>>2]=u;break}if(l=B>>>8,l?B>>>0>16777215?l=31:(He=(l+1048320|0)>>>16&8,We=l<<He,ct=(We+520192|0)>>>16&4,We=We<<ct,l=(We+245760|0)>>>16&2,l=14-(ct|He|l)+(We<<l>>>15)|0,l=B>>>(l+7|0)&1|l<<1):l=0,u=11436+(l<<2)|0,n[m+28>>2]=l,o=m+16|0,n[o+4>>2]=0,n[o>>2]=0,o=1<<l,!(A&o)){n[2784]=A|o,n[u>>2]=m,n[m+24>>2]=u,n[m+12>>2]=m,n[m+8>>2]=m;break}for(o=B<<((l|0)==31?0:25-(l>>>1)|0),u=n[u>>2]|0;;){if((n[u+4>>2]&-8|0)==(B|0)){He=97;break}if(A=u+16+(o>>>31<<2)|0,l=n[A>>2]|0,l)o=o<<1,u=l;else{He=96;break}}if((He|0)==96){n[A>>2]=m,n[m+24>>2]=u,n[m+12>>2]=m,n[m+8>>2]=m;break}else if((He|0)==97){He=u+8|0,We=n[He>>2]|0,n[We+12>>2]=m,n[He>>2]=m,n[m+8>>2]=We,n[m+12>>2]=u,n[m+24>>2]=0;break}}else We=B+M|0,n[k+4>>2]=We|3,We=k+We+4|0,n[We>>2]=n[We>>2]|1;while(!1);return We=k+8|0,I=Lt,We|0}else q=M}else q=M;else q=-1;while(!1);if(u=n[2785]|0,u>>>0>=q>>>0)return l=u-q|0,o=n[2788]|0,l>>>0>15?(We=o+q|0,n[2788]=We,n[2785]=l,n[We+4>>2]=l|1,n[We+l>>2]=l,n[o+4>>2]=q|3):(n[2785]=0,n[2788]=0,n[o+4>>2]=u|3,We=o+u+4|0,n[We>>2]=n[We>>2]|1),We=o+8|0,I=Lt,We|0;if(B=n[2786]|0,B>>>0>q>>>0)return ct=B-q|0,n[2786]=ct,We=n[2789]|0,He=We+q|0,n[2789]=He,n[He+4>>2]=ct|1,n[We+4>>2]=q|3,We=We+8|0,I=Lt,We|0;if(n[2901]|0?o=n[2903]|0:(n[2903]=4096,n[2902]=4096,n[2904]=-1,n[2905]=-1,n[2906]=0,n[2894]=0,o=ae&-16^1431655768,n[ae>>2]=o,n[2901]=o,o=4096),k=q+48|0,R=q+47|0,m=o+R|0,d=0-o|0,M=m&d,M>>>0<=q>>>0||(o=n[2893]|0,o|0&&(L=n[2891]|0,ae=L+M|0,ae>>>0<=L>>>0|ae>>>0>o>>>0)))return We=0,I=Lt,We|0;e:do if(n[2894]&4)l=0,He=133;else{u=n[2789]|0;t:do if(u){for(A=11580;o=n[A>>2]|0,!(o>>>0<=u>>>0&&(Qe=A+4|0,(o+(n[Qe>>2]|0)|0)>>>0>u>>>0));)if(o=n[A+8>>2]|0,o)A=o;else{He=118;break t}if(l=m-B&d,l>>>0<2147483647)if(o=qh(l|0)|0,(o|0)==((n[A>>2]|0)+(n[Qe>>2]|0)|0)){if((o|0)!=-1){B=l,m=o,He=135;break e}}else A=o,He=126;else l=0}else He=118;while(!1);do if((He|0)==118)if(u=qh(0)|0,(u|0)!=-1&&(l=u,Ye=n[2902]|0,Le=Ye+-1|0,l=(Le&l|0?(Le+l&0-Ye)-l|0:0)+M|0,Ye=n[2891]|0,Le=l+Ye|0,l>>>0>q>>>0&l>>>0<2147483647)){if(Qe=n[2893]|0,Qe|0&&Le>>>0<=Ye>>>0|Le>>>0>Qe>>>0){l=0;break}if(o=qh(l|0)|0,(o|0)==(u|0)){B=l,m=u,He=135;break e}else A=o,He=126}else l=0;while(!1);do if((He|0)==126){if(u=0-l|0,!(k>>>0>l>>>0&(l>>>0<2147483647&(A|0)!=-1)))if((A|0)==-1){l=0;break}else{B=l,m=A,He=135;break e}if(o=n[2903]|0,o=R-l+o&0-o,o>>>0>=2147483647){B=l,m=A,He=135;break e}if((qh(o|0)|0)==-1){qh(u|0)|0,l=0;break}else{B=o+l|0,m=A,He=135;break e}}while(!1);n[2894]=n[2894]|4,He=133}while(!1);if((He|0)==133&&M>>>0<2147483647&&(ct=qh(M|0)|0,Qe=qh(0)|0,tt=Qe-ct|0,Xe=tt>>>0>(q+40|0)>>>0,!((ct|0)==-1|Xe^1|ct>>>0<Qe>>>0&((ct|0)!=-1&(Qe|0)!=-1)^1))&&(B=Xe?tt:l,m=ct,He=135),(He|0)==135){l=(n[2891]|0)+B|0,n[2891]=l,l>>>0>(n[2892]|0)>>>0&&(n[2892]=l),R=n[2789]|0;do if(R){for(l=11580;;){if(o=n[l>>2]|0,u=l+4|0,A=n[u>>2]|0,(m|0)==(o+A|0)){He=145;break}if(d=n[l+8>>2]|0,d)l=d;else break}if((He|0)==145&&!(n[l+12>>2]&8|0)&&R>>>0<m>>>0&R>>>0>=o>>>0){n[u>>2]=A+B,We=R+8|0,We=We&7|0?0-We&7:0,He=R+We|0,We=(n[2786]|0)+(B-We)|0,n[2789]=He,n[2786]=We,n[He+4>>2]=We|1,n[He+We+4>>2]=40,n[2790]=n[2905];break}for(m>>>0<(n[2787]|0)>>>0&&(n[2787]=m),u=m+B|0,l=11580;;){if((n[l>>2]|0)==(u|0)){He=153;break}if(o=n[l+8>>2]|0,o)l=o;else break}if((He|0)==153&&!(n[l+12>>2]&8|0)){n[l>>2]=m,L=l+4|0,n[L>>2]=(n[L>>2]|0)+B,L=m+8|0,L=m+(L&7|0?0-L&7:0)|0,l=u+8|0,l=u+(l&7|0?0-l&7:0)|0,M=L+q|0,k=l-L-q|0,n[L+4>>2]=q|3;do if((l|0)!=(R|0)){if((l|0)==(n[2788]|0)){We=(n[2785]|0)+k|0,n[2785]=We,n[2788]=M,n[M+4>>2]=We|1,n[M+We>>2]=We;break}if(o=n[l+4>>2]|0,(o&3|0)==1){B=o&-8,A=o>>>3;e:do if(o>>>0<256)if(o=n[l+8>>2]|0,u=n[l+12>>2]|0,(u|0)==(o|0)){n[2783]=n[2783]&~(1<<A);break}else{n[o+12>>2]=u,n[u+8>>2]=o;break}else{m=n[l+24>>2]|0,o=n[l+12>>2]|0;do if((o|0)==(l|0)){if(A=l+16|0,u=A+4|0,o=n[u>>2]|0,!o)if(o=n[A>>2]|0,o)u=A;else{o=0;break}for(;;){if(A=o+20|0,d=n[A>>2]|0,d|0){o=d,u=A;continue}if(A=o+16|0,d=n[A>>2]|0,d)o=d,u=A;else break}n[u>>2]=0}else We=n[l+8>>2]|0,n[We+12>>2]=o,n[o+8>>2]=We;while(!1);if(!m)break;u=n[l+28>>2]|0,A=11436+(u<<2)|0;do if((l|0)!=(n[A>>2]|0)){if(n[m+16+(((n[m+16>>2]|0)!=(l|0)&1)<<2)>>2]=o,!o)break e}else{if(n[A>>2]=o,o|0)break;n[2784]=n[2784]&~(1<<u);break e}while(!1);if(n[o+24>>2]=m,u=l+16|0,A=n[u>>2]|0,A|0&&(n[o+16>>2]=A,n[A+24>>2]=o),u=n[u+4>>2]|0,!u)break;n[o+20>>2]=u,n[u+24>>2]=o}while(!1);l=l+B|0,d=B+k|0}else d=k;if(l=l+4|0,n[l>>2]=n[l>>2]&-2,n[M+4>>2]=d|1,n[M+d>>2]=d,l=d>>>3,d>>>0<256){u=11172+(l<<1<<2)|0,o=n[2783]|0,l=1<<l,o&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=o|l,l=u,o=u+8|0),n[o>>2]=M,n[l+12>>2]=M,n[M+8>>2]=l,n[M+12>>2]=u;break}l=d>>>8;do if(!l)l=0;else{if(d>>>0>16777215){l=31;break}He=(l+1048320|0)>>>16&8,We=l<<He,ct=(We+520192|0)>>>16&4,We=We<<ct,l=(We+245760|0)>>>16&2,l=14-(ct|He|l)+(We<<l>>>15)|0,l=d>>>(l+7|0)&1|l<<1}while(!1);if(A=11436+(l<<2)|0,n[M+28>>2]=l,o=M+16|0,n[o+4>>2]=0,n[o>>2]=0,o=n[2784]|0,u=1<<l,!(o&u)){n[2784]=o|u,n[A>>2]=M,n[M+24>>2]=A,n[M+12>>2]=M,n[M+8>>2]=M;break}for(o=d<<((l|0)==31?0:25-(l>>>1)|0),u=n[A>>2]|0;;){if((n[u+4>>2]&-8|0)==(d|0)){He=194;break}if(A=u+16+(o>>>31<<2)|0,l=n[A>>2]|0,l)o=o<<1,u=l;else{He=193;break}}if((He|0)==193){n[A>>2]=M,n[M+24>>2]=u,n[M+12>>2]=M,n[M+8>>2]=M;break}else if((He|0)==194){He=u+8|0,We=n[He>>2]|0,n[We+12>>2]=M,n[He>>2]=M,n[M+8>>2]=We,n[M+12>>2]=u,n[M+24>>2]=0;break}}else We=(n[2786]|0)+k|0,n[2786]=We,n[2789]=M,n[M+4>>2]=We|1;while(!1);return We=L+8|0,I=Lt,We|0}for(l=11580;o=n[l>>2]|0,!(o>>>0<=R>>>0&&(We=o+(n[l+4>>2]|0)|0,We>>>0>R>>>0));)l=n[l+8>>2]|0;d=We+-47|0,o=d+8|0,o=d+(o&7|0?0-o&7:0)|0,d=R+16|0,o=o>>>0<d>>>0?R:o,l=o+8|0,u=m+8|0,u=u&7|0?0-u&7:0,He=m+u|0,u=B+-40-u|0,n[2789]=He,n[2786]=u,n[He+4>>2]=u|1,n[He+u+4>>2]=40,n[2790]=n[2905],u=o+4|0,n[u>>2]=27,n[l>>2]=n[2895],n[l+4>>2]=n[2896],n[l+8>>2]=n[2897],n[l+12>>2]=n[2898],n[2895]=m,n[2896]=B,n[2898]=0,n[2897]=l,l=o+24|0;do He=l,l=l+4|0,n[l>>2]=7;while((He+8|0)>>>0<We>>>0);if((o|0)!=(R|0)){if(m=o-R|0,n[u>>2]=n[u>>2]&-2,n[R+4>>2]=m|1,n[o>>2]=m,l=m>>>3,m>>>0<256){u=11172+(l<<1<<2)|0,o=n[2783]|0,l=1<<l,o&l?(o=u+8|0,l=n[o>>2]|0):(n[2783]=o|l,l=u,o=u+8|0),n[o>>2]=R,n[l+12>>2]=R,n[R+8>>2]=l,n[R+12>>2]=u;break}if(l=m>>>8,l?m>>>0>16777215?u=31:(He=(l+1048320|0)>>>16&8,We=l<<He,ct=(We+520192|0)>>>16&4,We=We<<ct,u=(We+245760|0)>>>16&2,u=14-(ct|He|u)+(We<<u>>>15)|0,u=m>>>(u+7|0)&1|u<<1):u=0,A=11436+(u<<2)|0,n[R+28>>2]=u,n[R+20>>2]=0,n[d>>2]=0,l=n[2784]|0,o=1<<u,!(l&o)){n[2784]=l|o,n[A>>2]=R,n[R+24>>2]=A,n[R+12>>2]=R,n[R+8>>2]=R;break}for(o=m<<((u|0)==31?0:25-(u>>>1)|0),u=n[A>>2]|0;;){if((n[u+4>>2]&-8|0)==(m|0)){He=216;break}if(A=u+16+(o>>>31<<2)|0,l=n[A>>2]|0,l)o=o<<1,u=l;else{He=215;break}}if((He|0)==215){n[A>>2]=R,n[R+24>>2]=u,n[R+12>>2]=R,n[R+8>>2]=R;break}else if((He|0)==216){He=u+8|0,We=n[He>>2]|0,n[We+12>>2]=R,n[He>>2]=R,n[R+8>>2]=We,n[R+12>>2]=u,n[R+24>>2]=0;break}}}else{We=n[2787]|0,(We|0)==0|m>>>0<We>>>0&&(n[2787]=m),n[2895]=m,n[2896]=B,n[2898]=0,n[2792]=n[2901],n[2791]=-1,l=0;do We=11172+(l<<1<<2)|0,n[We+12>>2]=We,n[We+8>>2]=We,l=l+1|0;while((l|0)!=32);We=m+8|0,We=We&7|0?0-We&7:0,He=m+We|0,We=B+-40-We|0,n[2789]=He,n[2786]=We,n[He+4>>2]=We|1,n[He+We+4>>2]=40,n[2790]=n[2905]}while(!1);if(l=n[2786]|0,l>>>0>q>>>0)return ct=l-q|0,n[2786]=ct,We=n[2789]|0,He=We+q|0,n[2789]=He,n[He+4>>2]=ct|1,n[We+4>>2]=q|3,We=We+8|0,I=Lt,We|0}return n[(Zy()|0)>>2]=12,We=0,I=Lt,We|0}function Hb(o){o=o|0;var l=0,u=0,A=0,d=0,m=0,B=0,k=0,R=0;if(o){u=o+-8|0,d=n[2787]|0,o=n[o+-4>>2]|0,l=o&-8,R=u+l|0;do if(o&1)k=u,B=u;else{if(A=n[u>>2]|0,!(o&3)||(B=u+(0-A)|0,m=A+l|0,B>>>0<d>>>0))return;if((B|0)==(n[2788]|0)){if(o=R+4|0,l=n[o>>2]|0,(l&3|0)!=3){k=B,l=m;break}n[2785]=m,n[o>>2]=l&-2,n[B+4>>2]=m|1,n[B+m>>2]=m;return}if(u=A>>>3,A>>>0<256)if(o=n[B+8>>2]|0,l=n[B+12>>2]|0,(l|0)==(o|0)){n[2783]=n[2783]&~(1<<u),k=B,l=m;break}else{n[o+12>>2]=l,n[l+8>>2]=o,k=B,l=m;break}d=n[B+24>>2]|0,o=n[B+12>>2]|0;do if((o|0)==(B|0)){if(u=B+16|0,l=u+4|0,o=n[l>>2]|0,!o)if(o=n[u>>2]|0,o)l=u;else{o=0;break}for(;;){if(u=o+20|0,A=n[u>>2]|0,A|0){o=A,l=u;continue}if(u=o+16|0,A=n[u>>2]|0,A)o=A,l=u;else break}n[l>>2]=0}else k=n[B+8>>2]|0,n[k+12>>2]=o,n[o+8>>2]=k;while(!1);if(d){if(l=n[B+28>>2]|0,u=11436+(l<<2)|0,(B|0)==(n[u>>2]|0)){if(n[u>>2]=o,!o){n[2784]=n[2784]&~(1<<l),k=B,l=m;break}}else if(n[d+16+(((n[d+16>>2]|0)!=(B|0)&1)<<2)>>2]=o,!o){k=B,l=m;break}n[o+24>>2]=d,l=B+16|0,u=n[l>>2]|0,u|0&&(n[o+16>>2]=u,n[u+24>>2]=o),l=n[l+4>>2]|0,l?(n[o+20>>2]=l,n[l+24>>2]=o,k=B,l=m):(k=B,l=m)}else k=B,l=m}while(!1);if(!(B>>>0>=R>>>0)&&(o=R+4|0,A=n[o>>2]|0,!!(A&1))){if(A&2)n[o>>2]=A&-2,n[k+4>>2]=l|1,n[B+l>>2]=l,d=l;else{if(o=n[2788]|0,(R|0)==(n[2789]|0)){if(R=(n[2786]|0)+l|0,n[2786]=R,n[2789]=k,n[k+4>>2]=R|1,(k|0)!=(o|0))return;n[2788]=0,n[2785]=0;return}if((R|0)==(o|0)){R=(n[2785]|0)+l|0,n[2785]=R,n[2788]=B,n[k+4>>2]=R|1,n[B+R>>2]=R;return}d=(A&-8)+l|0,u=A>>>3;do if(A>>>0<256)if(l=n[R+8>>2]|0,o=n[R+12>>2]|0,(o|0)==(l|0)){n[2783]=n[2783]&~(1<<u);break}else{n[l+12>>2]=o,n[o+8>>2]=l;break}else{m=n[R+24>>2]|0,o=n[R+12>>2]|0;do if((o|0)==(R|0)){if(u=R+16|0,l=u+4|0,o=n[l>>2]|0,!o)if(o=n[u>>2]|0,o)l=u;else{u=0;break}for(;;){if(u=o+20|0,A=n[u>>2]|0,A|0){o=A,l=u;continue}if(u=o+16|0,A=n[u>>2]|0,A)o=A,l=u;else break}n[l>>2]=0,u=o}else u=n[R+8>>2]|0,n[u+12>>2]=o,n[o+8>>2]=u,u=o;while(!1);if(m|0){if(o=n[R+28>>2]|0,l=11436+(o<<2)|0,(R|0)==(n[l>>2]|0)){if(n[l>>2]=u,!u){n[2784]=n[2784]&~(1<<o);break}}else if(n[m+16+(((n[m+16>>2]|0)!=(R|0)&1)<<2)>>2]=u,!u)break;n[u+24>>2]=m,o=R+16|0,l=n[o>>2]|0,l|0&&(n[u+16>>2]=l,n[l+24>>2]=u),o=n[o+4>>2]|0,o|0&&(n[u+20>>2]=o,n[o+24>>2]=u)}}while(!1);if(n[k+4>>2]=d|1,n[B+d>>2]=d,(k|0)==(n[2788]|0)){n[2785]=d;return}}if(o=d>>>3,d>>>0<256){u=11172+(o<<1<<2)|0,l=n[2783]|0,o=1<<o,l&o?(l=u+8|0,o=n[l>>2]|0):(n[2783]=l|o,o=u,l=u+8|0),n[l>>2]=k,n[o+12>>2]=k,n[k+8>>2]=o,n[k+12>>2]=u;return}o=d>>>8,o?d>>>0>16777215?o=31:(B=(o+1048320|0)>>>16&8,R=o<<B,m=(R+520192|0)>>>16&4,R=R<<m,o=(R+245760|0)>>>16&2,o=14-(m|B|o)+(R<<o>>>15)|0,o=d>>>(o+7|0)&1|o<<1):o=0,A=11436+(o<<2)|0,n[k+28>>2]=o,n[k+20>>2]=0,n[k+16>>2]=0,l=n[2784]|0,u=1<<o;do if(l&u){for(l=d<<((o|0)==31?0:25-(o>>>1)|0),u=n[A>>2]|0;;){if((n[u+4>>2]&-8|0)==(d|0)){o=73;break}if(A=u+16+(l>>>31<<2)|0,o=n[A>>2]|0,o)l=l<<1,u=o;else{o=72;break}}if((o|0)==72){n[A>>2]=k,n[k+24>>2]=u,n[k+12>>2]=k,n[k+8>>2]=k;break}else if((o|0)==73){B=u+8|0,R=n[B>>2]|0,n[R+12>>2]=k,n[B>>2]=k,n[k+8>>2]=R,n[k+12>>2]=u,n[k+24>>2]=0;break}}else n[2784]=l|u,n[A>>2]=k,n[k+24>>2]=A,n[k+12>>2]=k,n[k+8>>2]=k;while(!1);if(R=(n[2791]|0)+-1|0,n[2791]=R,!R)o=11588;else return;for(;o=n[o>>2]|0,o;)o=o+8|0;n[2791]=-1}}}function $je(){return 11628}function e6e(o){o=o|0;var l=0,u=0;return l=I,I=I+16|0,u=l,n[u>>2]=n6e(n[o+60>>2]|0)|0,o=jb(Au(6,u|0)|0)|0,I=l,o|0}function hX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0;q=I,I=I+48|0,M=q+16|0,m=q,d=q+32|0,k=o+28|0,A=n[k>>2]|0,n[d>>2]=A,R=o+20|0,A=(n[R>>2]|0)-A|0,n[d+4>>2]=A,n[d+8>>2]=l,n[d+12>>2]=u,A=A+u|0,B=o+60|0,n[m>>2]=n[B>>2],n[m+4>>2]=d,n[m+8>>2]=2,m=jb(La(146,m|0)|0)|0;e:do if((A|0)!=(m|0)){for(l=2;!((m|0)<0);)if(A=A-m|0,Ye=n[d+4>>2]|0,ae=m>>>0>Ye>>>0,d=ae?d+8|0:d,l=(ae<<31>>31)+l|0,Ye=m-(ae?Ye:0)|0,n[d>>2]=(n[d>>2]|0)+Ye,ae=d+4|0,n[ae>>2]=(n[ae>>2]|0)-Ye,n[M>>2]=n[B>>2],n[M+4>>2]=d,n[M+8>>2]=l,m=jb(La(146,M|0)|0)|0,(A|0)==(m|0)){L=3;break e}n[o+16>>2]=0,n[k>>2]=0,n[R>>2]=0,n[o>>2]=n[o>>2]|32,(l|0)==2?u=0:u=u-(n[d+4>>2]|0)|0}else L=3;while(!1);return(L|0)==3&&(Ye=n[o+44>>2]|0,n[o+16>>2]=Ye+(n[o+48>>2]|0),n[k>>2]=Ye,n[R>>2]=Ye),I=q,u|0}function t6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;return d=I,I=I+32|0,m=d,A=d+20|0,n[m>>2]=n[o+60>>2],n[m+4>>2]=0,n[m+8>>2]=l,n[m+12>>2]=A,n[m+16>>2]=u,(jb(Oa(140,m|0)|0)|0)<0?(n[A>>2]=-1,o=-1):o=n[A>>2]|0,I=d,o|0}function jb(o){return o=o|0,o>>>0>4294963200&&(n[(Zy()|0)>>2]=0-o,o=-1),o|0}function Zy(){return(r6e()|0)+64|0}function r6e(){return aU()|0}function aU(){return 2084}function n6e(o){return o=o|0,o|0}function i6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;return d=I,I=I+32|0,A=d,n[o+36>>2]=1,!(n[o>>2]&64|0)&&(n[A>>2]=n[o+60>>2],n[A+4>>2]=21523,n[A+8>>2]=d+16,no(54,A|0)|0)&&(s[o+75>>0]=-1),A=hX(o,l,u)|0,I=d,A|0}function gX(o,l){o=o|0,l=l|0;var u=0,A=0;if(u=s[o>>0]|0,A=s[l>>0]|0,!(u<<24>>24)||u<<24>>24!=A<<24>>24)o=A;else{do o=o+1|0,l=l+1|0,u=s[o>>0]|0,A=s[l>>0]|0;while(!(!(u<<24>>24)||u<<24>>24!=A<<24>>24));o=A}return(u&255)-(o&255)|0}function s6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0;e:do if(!u)o=0;else{for(;A=s[o>>0]|0,d=s[l>>0]|0,A<<24>>24==d<<24>>24;)if(u=u+-1|0,u)o=o+1|0,l=l+1|0;else{o=0;break e}o=(A&255)-(d&255)|0}while(!1);return o|0}function dX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0;Qe=I,I=I+224|0,L=Qe+120|0,q=Qe+80|0,Ye=Qe,Le=Qe+136|0,A=q,d=A+40|0;do n[A>>2]=0,A=A+4|0;while((A|0)<(d|0));return n[L>>2]=n[u>>2],(lU(0,l,L,Ye,q)|0)<0?u=-1:((n[o+76>>2]|0)>-1?ae=o6e(o)|0:ae=0,u=n[o>>2]|0,M=u&32,(s[o+74>>0]|0)<1&&(n[o>>2]=u&-33),A=o+48|0,n[A>>2]|0?u=lU(o,l,L,Ye,q)|0:(d=o+44|0,m=n[d>>2]|0,n[d>>2]=Le,B=o+28|0,n[B>>2]=Le,k=o+20|0,n[k>>2]=Le,n[A>>2]=80,R=o+16|0,n[R>>2]=Le+80,u=lU(o,l,L,Ye,q)|0,m&&(Yb[n[o+36>>2]&7](o,0,0)|0,u=n[k>>2]|0?u:-1,n[d>>2]=m,n[A>>2]=0,n[R>>2]=0,n[B>>2]=0,n[k>>2]=0)),A=n[o>>2]|0,n[o>>2]=A|M,ae|0&&a6e(o),u=A&32|0?-1:u),I=Qe,u|0}function lU(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Xe=0,ct=0,He=0,We=0,Lt=0,Gr=0,fr=0,$t=0,Rr=0,Hr=0,cr=0;cr=I,I=I+64|0,fr=cr+16|0,$t=cr,Lt=cr+24|0,Rr=cr+8|0,Hr=cr+20|0,n[fr>>2]=l,ct=(o|0)!=0,He=Lt+40|0,We=He,Lt=Lt+39|0,Gr=Rr+4|0,B=0,m=0,L=0;e:for(;;){do if((m|0)>-1)if((B|0)>(2147483647-m|0)){n[(Zy()|0)>>2]=75,m=-1;break}else{m=B+m|0;break}while(!1);if(B=s[l>>0]|0,B<<24>>24)k=l;else{Xe=87;break}t:for(;;){switch(B<<24>>24){case 37:{B=k,Xe=9;break t}case 0:{B=k;break t}default:}tt=k+1|0,n[fr>>2]=tt,B=s[tt>>0]|0,k=tt}t:do if((Xe|0)==9)for(;;){if(Xe=0,(s[k+1>>0]|0)!=37)break t;if(B=B+1|0,k=k+2|0,n[fr>>2]=k,(s[k>>0]|0)==37)Xe=9;else break}while(!1);if(B=B-l|0,ct&&vs(o,l,B),B|0){l=k;continue}R=k+1|0,B=(s[R>>0]|0)+-48|0,B>>>0<10?(tt=(s[k+2>>0]|0)==36,Qe=tt?B:-1,L=tt?1:L,R=tt?k+3|0:R):Qe=-1,n[fr>>2]=R,B=s[R>>0]|0,k=(B<<24>>24)+-32|0;t:do if(k>>>0<32)for(M=0,q=B;;){if(B=1<<k,!(B&75913)){B=q;break t}if(M=B|M,R=R+1|0,n[fr>>2]=R,B=s[R>>0]|0,k=(B<<24>>24)+-32|0,k>>>0>=32)break;q=B}else M=0;while(!1);if(B<<24>>24==42){if(k=R+1|0,B=(s[k>>0]|0)+-48|0,B>>>0<10&&(s[R+2>>0]|0)==36)n[d+(B<<2)>>2]=10,B=n[A+((s[k>>0]|0)+-48<<3)>>2]|0,L=1,R=R+3|0;else{if(L|0){m=-1;break}ct?(L=(n[u>>2]|0)+3&-4,B=n[L>>2]|0,n[u>>2]=L+4,L=0,R=k):(B=0,L=0,R=k)}n[fr>>2]=R,tt=(B|0)<0,B=tt?0-B|0:B,M=tt?M|8192:M}else{if(B=mX(fr)|0,(B|0)<0){m=-1;break}R=n[fr>>2]|0}do if((s[R>>0]|0)==46){if((s[R+1>>0]|0)!=42){n[fr>>2]=R+1,k=mX(fr)|0,R=n[fr>>2]|0;break}if(q=R+2|0,k=(s[q>>0]|0)+-48|0,k>>>0<10&&(s[R+3>>0]|0)==36){n[d+(k<<2)>>2]=10,k=n[A+((s[q>>0]|0)+-48<<3)>>2]|0,R=R+4|0,n[fr>>2]=R;break}if(L|0){m=-1;break e}ct?(tt=(n[u>>2]|0)+3&-4,k=n[tt>>2]|0,n[u>>2]=tt+4):k=0,n[fr>>2]=q,R=q}else k=-1;while(!1);for(Le=0;;){if(((s[R>>0]|0)+-65|0)>>>0>57){m=-1;break e}if(tt=R+1|0,n[fr>>2]=tt,q=s[(s[R>>0]|0)+-65+(5178+(Le*58|0))>>0]|0,ae=q&255,(ae+-1|0)>>>0<8)Le=ae,R=tt;else break}if(!(q<<24>>24)){m=-1;break}Ye=(Qe|0)>-1;do if(q<<24>>24==19)if(Ye){m=-1;break e}else Xe=49;else{if(Ye){n[d+(Qe<<2)>>2]=ae,Ye=A+(Qe<<3)|0,Qe=n[Ye+4>>2]|0,Xe=$t,n[Xe>>2]=n[Ye>>2],n[Xe+4>>2]=Qe,Xe=49;break}if(!ct){m=0;break e}yX($t,ae,u)}while(!1);if((Xe|0)==49&&(Xe=0,!ct)){B=0,l=tt;continue}R=s[R>>0]|0,R=(Le|0)!=0&(R&15|0)==3?R&-33:R,Ye=M&-65537,Qe=M&8192|0?Ye:M;t:do switch(R|0){case 110:switch((Le&255)<<24>>24){case 0:{n[n[$t>>2]>>2]=m,B=0,l=tt;continue e}case 1:{n[n[$t>>2]>>2]=m,B=0,l=tt;continue e}case 2:{B=n[$t>>2]|0,n[B>>2]=m,n[B+4>>2]=((m|0)<0)<<31>>31,B=0,l=tt;continue e}case 3:{a[n[$t>>2]>>1]=m,B=0,l=tt;continue e}case 4:{s[n[$t>>2]>>0]=m,B=0,l=tt;continue e}case 6:{n[n[$t>>2]>>2]=m,B=0,l=tt;continue e}case 7:{B=n[$t>>2]|0,n[B>>2]=m,n[B+4>>2]=((m|0)<0)<<31>>31,B=0,l=tt;continue e}default:{B=0,l=tt;continue e}}case 112:{R=120,k=k>>>0>8?k:8,l=Qe|8,Xe=61;break}case 88:case 120:{l=Qe,Xe=61;break}case 111:{R=$t,l=n[R>>2]|0,R=n[R+4>>2]|0,ae=c6e(l,R,He)|0,Ye=We-ae|0,M=0,q=5642,k=(Qe&8|0)==0|(k|0)>(Ye|0)?k:Ye+1|0,Ye=Qe,Xe=67;break}case 105:case 100:if(R=$t,l=n[R>>2]|0,R=n[R+4>>2]|0,(R|0)<0){l=Gb(0,0,l|0,R|0)|0,R=ye,M=$t,n[M>>2]=l,n[M+4>>2]=R,M=1,q=5642,Xe=66;break t}else{M=(Qe&2049|0)!=0&1,q=Qe&2048|0?5643:Qe&1|0?5644:5642,Xe=66;break t}case 117:{R=$t,M=0,q=5642,l=n[R>>2]|0,R=n[R+4>>2]|0,Xe=66;break}case 99:{s[Lt>>0]=n[$t>>2],l=Lt,M=0,q=5642,ae=He,R=1,k=Ye;break}case 109:{R=u6e(n[(Zy()|0)>>2]|0)|0,Xe=71;break}case 115:{R=n[$t>>2]|0,R=R|0?R:5652,Xe=71;break}case 67:{n[Rr>>2]=n[$t>>2],n[Gr>>2]=0,n[$t>>2]=Rr,ae=-1,R=Rr,Xe=75;break}case 83:{l=n[$t>>2]|0,k?(ae=k,R=l,Xe=75):(Ls(o,32,B,0,Qe),l=0,Xe=84);break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{B=A6e(o,+E[$t>>3],B,k,Qe,R)|0,l=tt;continue e}default:M=0,q=5642,ae=He,R=k,k=Qe}while(!1);t:do if((Xe|0)==61)Qe=$t,Le=n[Qe>>2]|0,Qe=n[Qe+4>>2]|0,ae=l6e(Le,Qe,He,R&32)|0,q=(l&8|0)==0|(Le|0)==0&(Qe|0)==0,M=q?0:2,q=q?5642:5642+(R>>4)|0,Ye=l,l=Le,R=Qe,Xe=67;else if((Xe|0)==66)ae=Xy(l,R,He)|0,Ye=Qe,Xe=67;else if((Xe|0)==71)Xe=0,Qe=f6e(R,0,k)|0,Le=(Qe|0)==0,l=R,M=0,q=5642,ae=Le?R+k|0:Qe,R=Le?k:Qe-R|0,k=Ye;else if((Xe|0)==75){for(Xe=0,q=R,l=0,k=0;M=n[q>>2]|0,!(!M||(k=EX(Hr,M)|0,(k|0)<0|k>>>0>(ae-l|0)>>>0));)if(l=k+l|0,ae>>>0>l>>>0)q=q+4|0;else break;if((k|0)<0){m=-1;break e}if(Ls(o,32,B,l,Qe),!l)l=0,Xe=84;else for(M=0;;){if(k=n[R>>2]|0,!k){Xe=84;break t}if(k=EX(Hr,k)|0,M=k+M|0,(M|0)>(l|0)){Xe=84;break t}if(vs(o,Hr,k),M>>>0>=l>>>0){Xe=84;break}else R=R+4|0}}while(!1);if((Xe|0)==67)Xe=0,R=(l|0)!=0|(R|0)!=0,Qe=(k|0)!=0|R,R=((R^1)&1)+(We-ae)|0,l=Qe?ae:He,ae=He,R=Qe?(k|0)>(R|0)?k:R:k,k=(k|0)>-1?Ye&-65537:Ye;else if((Xe|0)==84){Xe=0,Ls(o,32,B,l,Qe^8192),B=(B|0)>(l|0)?B:l,l=tt;continue}Le=ae-l|0,Ye=(R|0)<(Le|0)?Le:R,Qe=Ye+M|0,B=(B|0)<(Qe|0)?Qe:B,Ls(o,32,B,Qe,k),vs(o,q,M),Ls(o,48,B,Qe,k^65536),Ls(o,48,Ye,Le,0),vs(o,l,Le),Ls(o,32,B,Qe,k^8192),l=tt}e:do if((Xe|0)==87&&!o)if(!L)m=0;else{for(m=1;l=n[d+(m<<2)>>2]|0,!!l;)if(yX(A+(m<<3)|0,l,u),m=m+1|0,(m|0)>=10){m=1;break e}for(;;){if(n[d+(m<<2)>>2]|0){m=-1;break e}if(m=m+1|0,(m|0)>=10){m=1;break}}}while(!1);return I=cr,m|0}function o6e(o){return o=o|0,0}function a6e(o){o=o|0}function vs(o,l,u){o=o|0,l=l|0,u=u|0,n[o>>2]&32||C6e(l,u,o)|0}function mX(o){o=o|0;var l=0,u=0,A=0;if(u=n[o>>2]|0,A=(s[u>>0]|0)+-48|0,A>>>0<10){l=0;do l=A+(l*10|0)|0,u=u+1|0,n[o>>2]=u,A=(s[u>>0]|0)+-48|0;while(A>>>0<10)}else l=0;return l|0}function yX(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;e:do if(l>>>0<=20)do switch(l|0){case 9:{A=(n[u>>2]|0)+3&-4,l=n[A>>2]|0,n[u>>2]=A+4,n[o>>2]=l;break e}case 10:{A=(n[u>>2]|0)+3&-4,l=n[A>>2]|0,n[u>>2]=A+4,A=o,n[A>>2]=l,n[A+4>>2]=((l|0)<0)<<31>>31;break e}case 11:{A=(n[u>>2]|0)+3&-4,l=n[A>>2]|0,n[u>>2]=A+4,A=o,n[A>>2]=l,n[A+4>>2]=0;break e}case 12:{A=(n[u>>2]|0)+7&-8,l=A,d=n[l>>2]|0,l=n[l+4>>2]|0,n[u>>2]=A+8,A=o,n[A>>2]=d,n[A+4>>2]=l;break e}case 13:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,A=(A&65535)<<16>>16,d=o,n[d>>2]=A,n[d+4>>2]=((A|0)<0)<<31>>31;break e}case 14:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,d=o,n[d>>2]=A&65535,n[d+4>>2]=0;break e}case 15:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,A=(A&255)<<24>>24,d=o,n[d>>2]=A,n[d+4>>2]=((A|0)<0)<<31>>31;break e}case 16:{d=(n[u>>2]|0)+3&-4,A=n[d>>2]|0,n[u>>2]=d+4,d=o,n[d>>2]=A&255,n[d+4>>2]=0;break e}case 17:{d=(n[u>>2]|0)+7&-8,m=+E[d>>3],n[u>>2]=d+8,E[o>>3]=m;break e}case 18:{d=(n[u>>2]|0)+7&-8,m=+E[d>>3],n[u>>2]=d+8,E[o>>3]=m;break e}default:break e}while(!1);while(!1)}function l6e(o,l,u,A){if(o=o|0,l=l|0,u=u|0,A=A|0,!((o|0)==0&(l|0)==0))do u=u+-1|0,s[u>>0]=c[5694+(o&15)>>0]|0|A,o=qb(o|0,l|0,4)|0,l=ye;while(!((o|0)==0&(l|0)==0));return u|0}function c6e(o,l,u){if(o=o|0,l=l|0,u=u|0,!((o|0)==0&(l|0)==0))do u=u+-1|0,s[u>>0]=o&7|48,o=qb(o|0,l|0,3)|0,l=ye;while(!((o|0)==0&(l|0)==0));return u|0}function Xy(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;if(l>>>0>0|(l|0)==0&o>>>0>4294967295){for(;A=AU(o|0,l|0,10,0)|0,u=u+-1|0,s[u>>0]=A&255|48,A=o,o=fU(o|0,l|0,10,0)|0,l>>>0>9|(l|0)==9&A>>>0>4294967295;)l=ye;l=o}else l=o;if(l)for(;u=u+-1|0,s[u>>0]=(l>>>0)%10|0|48,!(l>>>0<10);)l=(l>>>0)/10|0;return u|0}function u6e(o){return o=o|0,m6e(o,n[(d6e()|0)+188>>2]|0)|0}function f6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;m=l&255,A=(u|0)!=0;e:do if(A&(o&3|0)!=0)for(d=l&255;;){if((s[o>>0]|0)==d<<24>>24){B=6;break e}if(o=o+1|0,u=u+-1|0,A=(u|0)!=0,!(A&(o&3|0)!=0)){B=5;break}}else B=5;while(!1);(B|0)==5&&(A?B=6:u=0);e:do if((B|0)==6&&(d=l&255,(s[o>>0]|0)!=d<<24>>24)){A=Ue(m,16843009)|0;t:do if(u>>>0>3){for(;m=n[o>>2]^A,!((m&-2139062144^-2139062144)&m+-16843009|0);)if(o=o+4|0,u=u+-4|0,u>>>0<=3){B=11;break t}}else B=11;while(!1);if((B|0)==11&&!u){u=0;break}for(;;){if((s[o>>0]|0)==d<<24>>24)break e;if(o=o+1|0,u=u+-1|0,!u){u=0;break}}}while(!1);return(u|0?o:0)|0}function Ls(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0;var m=0,B=0;if(B=I,I=I+256|0,m=B,(u|0)>(A|0)&(d&73728|0)==0){if(d=u-A|0,eE(m|0,l|0,(d>>>0<256?d:256)|0)|0,d>>>0>255){l=u-A|0;do vs(o,m,256),d=d+-256|0;while(d>>>0>255);d=l&255}vs(o,m,d)}I=B}function EX(o,l){return o=o|0,l=l|0,o?o=h6e(o,l,0)|0:o=0,o|0}function A6e(o,l,u,A,d,m){o=o|0,l=+l,u=u|0,A=A|0,d=d|0,m=m|0;var B=0,k=0,R=0,M=0,L=0,q=0,ae=0,Ye=0,Le=0,Qe=0,tt=0,Xe=0,ct=0,He=0,We=0,Lt=0,Gr=0,fr=0,$t=0,Rr=0,Hr=0,cr=0,Hn=0;Hn=I,I=I+560|0,R=Hn+8|0,tt=Hn,cr=Hn+524|0,Hr=cr,M=Hn+512|0,n[tt>>2]=0,Rr=M+12|0,IX(l)|0,(ye|0)<0?(l=-l,fr=1,Gr=5659):(fr=(d&2049|0)!=0&1,Gr=d&2048|0?5662:d&1|0?5665:5660),IX(l)|0,$t=ye&2146435072;do if($t>>>0<2146435072|($t|0)==2146435072&!1){if(Ye=+p6e(l,tt)*2,B=Ye!=0,B&&(n[tt>>2]=(n[tt>>2]|0)+-1),ct=m|32,(ct|0)==97){Le=m&32,ae=Le|0?Gr+9|0:Gr,q=fr|2,B=12-A|0;do if(A>>>0>11|(B|0)==0)l=Ye;else{l=8;do B=B+-1|0,l=l*16;while(B|0);if((s[ae>>0]|0)==45){l=-(l+(-Ye-l));break}else{l=Ye+l-l;break}}while(!1);k=n[tt>>2]|0,B=(k|0)<0?0-k|0:k,B=Xy(B,((B|0)<0)<<31>>31,Rr)|0,(B|0)==(Rr|0)&&(B=M+11|0,s[B>>0]=48),s[B+-1>>0]=(k>>31&2)+43,L=B+-2|0,s[L>>0]=m+15,M=(A|0)<1,R=(d&8|0)==0,B=cr;do $t=~~l,k=B+1|0,s[B>>0]=c[5694+$t>>0]|Le,l=(l-+($t|0))*16,(k-Hr|0)==1&&!(R&(M&l==0))?(s[k>>0]=46,B=B+2|0):B=k;while(l!=0);$t=B-Hr|0,Hr=Rr-L|0,Rr=(A|0)!=0&($t+-2|0)<(A|0)?A+2|0:$t,B=Hr+q+Rr|0,Ls(o,32,u,B,d),vs(o,ae,q),Ls(o,48,u,B,d^65536),vs(o,cr,$t),Ls(o,48,Rr-$t|0,0,0),vs(o,L,Hr),Ls(o,32,u,B,d^8192);break}k=(A|0)<0?6:A,B?(B=(n[tt>>2]|0)+-28|0,n[tt>>2]=B,l=Ye*268435456):(l=Ye,B=n[tt>>2]|0),$t=(B|0)<0?R:R+288|0,R=$t;do We=~~l>>>0,n[R>>2]=We,R=R+4|0,l=(l-+(We>>>0))*1e9;while(l!=0);if((B|0)>0)for(M=$t,q=R;;){if(L=(B|0)<29?B:29,B=q+-4|0,B>>>0>=M>>>0){R=0;do He=DX(n[B>>2]|0,0,L|0)|0,He=uU(He|0,ye|0,R|0,0)|0,We=ye,Xe=AU(He|0,We|0,1e9,0)|0,n[B>>2]=Xe,R=fU(He|0,We|0,1e9,0)|0,B=B+-4|0;while(B>>>0>=M>>>0);R&&(M=M+-4|0,n[M>>2]=R)}for(R=q;!(R>>>0<=M>>>0);)if(B=R+-4|0,!(n[B>>2]|0))R=B;else break;if(B=(n[tt>>2]|0)-L|0,n[tt>>2]=B,(B|0)>0)q=R;else break}else M=$t;if((B|0)<0){A=((k+25|0)/9|0)+1|0,Qe=(ct|0)==102;do{if(Le=0-B|0,Le=(Le|0)<9?Le:9,M>>>0<R>>>0){L=(1<<Le)+-1|0,q=1e9>>>Le,ae=0,B=M;do We=n[B>>2]|0,n[B>>2]=(We>>>Le)+ae,ae=Ue(We&L,q)|0,B=B+4|0;while(B>>>0<R>>>0);B=n[M>>2]|0?M:M+4|0,ae?(n[R>>2]=ae,M=B,B=R+4|0):(M=B,B=R)}else M=n[M>>2]|0?M:M+4|0,B=R;R=Qe?$t:M,R=(B-R>>2|0)>(A|0)?R+(A<<2)|0:B,B=(n[tt>>2]|0)+Le|0,n[tt>>2]=B}while((B|0)<0);B=M,A=R}else B=M,A=R;if(We=$t,B>>>0<A>>>0){if(R=(We-B>>2)*9|0,L=n[B>>2]|0,L>>>0>=10){M=10;do M=M*10|0,R=R+1|0;while(L>>>0>=M>>>0)}}else R=0;if(Qe=(ct|0)==103,Xe=(k|0)!=0,M=k-((ct|0)!=102?R:0)+((Xe&Qe)<<31>>31)|0,(M|0)<(((A-We>>2)*9|0)+-9|0)){if(M=M+9216|0,Le=$t+4+(((M|0)/9|0)+-1024<<2)|0,M=((M|0)%9|0)+1|0,(M|0)<9){L=10;do L=L*10|0,M=M+1|0;while((M|0)!=9)}else L=10;if(q=n[Le>>2]|0,ae=(q>>>0)%(L>>>0)|0,M=(Le+4|0)==(A|0),M&(ae|0)==0)M=Le;else if(Ye=((q>>>0)/(L>>>0)|0)&1|0?9007199254740994:9007199254740992,He=(L|0)/2|0,l=ae>>>0<He>>>0?.5:M&(ae|0)==(He|0)?1:1.5,fr&&(He=(s[Gr>>0]|0)==45,l=He?-l:l,Ye=He?-Ye:Ye),M=q-ae|0,n[Le>>2]=M,Ye+l!=Ye){if(He=M+L|0,n[Le>>2]=He,He>>>0>999999999)for(R=Le;M=R+-4|0,n[R>>2]=0,M>>>0<B>>>0&&(B=B+-4|0,n[B>>2]=0),He=(n[M>>2]|0)+1|0,n[M>>2]=He,He>>>0>999999999;)R=M;else M=Le;if(R=(We-B>>2)*9|0,q=n[B>>2]|0,q>>>0>=10){L=10;do L=L*10|0,R=R+1|0;while(q>>>0>=L>>>0)}}else M=Le;M=M+4|0,M=A>>>0>M>>>0?M:A,He=B}else M=A,He=B;for(ct=M;;){if(ct>>>0<=He>>>0){tt=0;break}if(B=ct+-4|0,!(n[B>>2]|0))ct=B;else{tt=1;break}}A=0-R|0;do if(Qe)if(B=((Xe^1)&1)+k|0,(B|0)>(R|0)&(R|0)>-5?(L=m+-1|0,k=B+-1-R|0):(L=m+-2|0,k=B+-1|0),B=d&8,B)Le=B;else{if(tt&&(Lt=n[ct+-4>>2]|0,(Lt|0)!=0))if((Lt>>>0)%10|0)M=0;else{M=0,B=10;do B=B*10|0,M=M+1|0;while(!((Lt>>>0)%(B>>>0)|0|0))}else M=9;if(B=((ct-We>>2)*9|0)+-9|0,(L|32|0)==102){Le=B-M|0,Le=(Le|0)>0?Le:0,k=(k|0)<(Le|0)?k:Le,Le=0;break}else{Le=B+R-M|0,Le=(Le|0)>0?Le:0,k=(k|0)<(Le|0)?k:Le,Le=0;break}}else L=m,Le=d&8;while(!1);if(Qe=k|Le,q=(Qe|0)!=0&1,ae=(L|32|0)==102,ae)Xe=0,B=(R|0)>0?R:0;else{if(B=(R|0)<0?A:R,B=Xy(B,((B|0)<0)<<31>>31,Rr)|0,M=Rr,(M-B|0)<2)do B=B+-1|0,s[B>>0]=48;while((M-B|0)<2);s[B+-1>>0]=(R>>31&2)+43,B=B+-2|0,s[B>>0]=L,Xe=B,B=M-B|0}if(B=fr+1+k+q+B|0,Ls(o,32,u,B,d),vs(o,Gr,fr),Ls(o,48,u,B,d^65536),ae){L=He>>>0>$t>>>0?$t:He,Le=cr+9|0,q=Le,ae=cr+8|0,M=L;do{if(R=Xy(n[M>>2]|0,0,Le)|0,(M|0)==(L|0))(R|0)==(Le|0)&&(s[ae>>0]=48,R=ae);else if(R>>>0>cr>>>0){eE(cr|0,48,R-Hr|0)|0;do R=R+-1|0;while(R>>>0>cr>>>0)}vs(o,R,q-R|0),M=M+4|0}while(M>>>0<=$t>>>0);if(Qe|0&&vs(o,5710,1),M>>>0<ct>>>0&(k|0)>0)for(;;){if(R=Xy(n[M>>2]|0,0,Le)|0,R>>>0>cr>>>0){eE(cr|0,48,R-Hr|0)|0;do R=R+-1|0;while(R>>>0>cr>>>0)}if(vs(o,R,(k|0)<9?k:9),M=M+4|0,R=k+-9|0,M>>>0<ct>>>0&(k|0)>9)k=R;else{k=R;break}}Ls(o,48,k+9|0,9,0)}else{if(Qe=tt?ct:He+4|0,(k|0)>-1){tt=cr+9|0,Le=(Le|0)==0,A=tt,q=0-Hr|0,ae=cr+8|0,L=He;do{R=Xy(n[L>>2]|0,0,tt)|0,(R|0)==(tt|0)&&(s[ae>>0]=48,R=ae);do if((L|0)==(He|0)){if(M=R+1|0,vs(o,R,1),Le&(k|0)<1){R=M;break}vs(o,5710,1),R=M}else{if(R>>>0<=cr>>>0)break;eE(cr|0,48,R+q|0)|0;do R=R+-1|0;while(R>>>0>cr>>>0)}while(!1);Hr=A-R|0,vs(o,R,(k|0)>(Hr|0)?Hr:k),k=k-Hr|0,L=L+4|0}while(L>>>0<Qe>>>0&(k|0)>-1)}Ls(o,48,k+18|0,18,0),vs(o,Xe,Rr-Xe|0)}Ls(o,32,u,B,d^8192)}else cr=(m&32|0)!=0,B=fr+3|0,Ls(o,32,u,B,d&-65537),vs(o,Gr,fr),vs(o,l!=l|!1?cr?5686:5690:cr?5678:5682,3),Ls(o,32,u,B,d^8192);while(!1);return I=Hn,((B|0)<(u|0)?u:B)|0}function IX(o){o=+o;var l=0;return E[S>>3]=o,l=n[S>>2]|0,ye=n[S+4>>2]|0,l|0}function p6e(o,l){return o=+o,l=l|0,+ +CX(o,l)}function CX(o,l){o=+o,l=l|0;var u=0,A=0,d=0;switch(E[S>>3]=o,u=n[S>>2]|0,A=n[S+4>>2]|0,d=qb(u|0,A|0,52)|0,d&2047){case 0:{o!=0?(o=+CX(o*18446744073709552e3,l),u=(n[l>>2]|0)+-64|0):u=0,n[l>>2]=u;break}case 2047:break;default:n[l>>2]=(d&2047)+-1022,n[S>>2]=u,n[S+4>>2]=A&-2146435073|1071644672,o=+E[S>>3]}return+o}function h6e(o,l,u){o=o|0,l=l|0,u=u|0;do if(o){if(l>>>0<128){s[o>>0]=l,o=1;break}if(!(n[n[(g6e()|0)+188>>2]>>2]|0))if((l&-128|0)==57216){s[o>>0]=l,o=1;break}else{n[(Zy()|0)>>2]=84,o=-1;break}if(l>>>0<2048){s[o>>0]=l>>>6|192,s[o+1>>0]=l&63|128,o=2;break}if(l>>>0<55296|(l&-8192|0)==57344){s[o>>0]=l>>>12|224,s[o+1>>0]=l>>>6&63|128,s[o+2>>0]=l&63|128,o=3;break}if((l+-65536|0)>>>0<1048576){s[o>>0]=l>>>18|240,s[o+1>>0]=l>>>12&63|128,s[o+2>>0]=l>>>6&63|128,s[o+3>>0]=l&63|128,o=4;break}else{n[(Zy()|0)>>2]=84,o=-1;break}}else o=1;while(!1);return o|0}function g6e(){return aU()|0}function d6e(){return aU()|0}function m6e(o,l){o=o|0,l=l|0;var u=0,A=0;for(A=0;;){if((c[5712+A>>0]|0)==(o|0)){o=2;break}if(u=A+1|0,(u|0)==87){u=5800,A=87,o=5;break}else A=u}if((o|0)==2&&(A?(u=5800,o=5):u=5800),(o|0)==5)for(;;){do o=u,u=u+1|0;while(s[o>>0]|0);if(A=A+-1|0,A)o=5;else break}return y6e(u,n[l+20>>2]|0)|0}function y6e(o,l){return o=o|0,l=l|0,E6e(o,l)|0}function E6e(o,l){return o=o|0,l=l|0,l?l=I6e(n[l>>2]|0,n[l+4>>2]|0,o)|0:l=0,(l|0?l:o)|0}function I6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0,R=0,M=0,L=0,q=0,ae=0;ae=(n[o>>2]|0)+1794895138|0,m=Ad(n[o+8>>2]|0,ae)|0,A=Ad(n[o+12>>2]|0,ae)|0,d=Ad(n[o+16>>2]|0,ae)|0;e:do if(m>>>0<l>>>2>>>0&&(q=l-(m<<2)|0,A>>>0<q>>>0&d>>>0<q>>>0)&&!((d|A)&3|0)){for(q=A>>>2,L=d>>>2,M=0;;){if(k=m>>>1,R=M+k|0,B=R<<1,d=B+q|0,A=Ad(n[o+(d<<2)>>2]|0,ae)|0,d=Ad(n[o+(d+1<<2)>>2]|0,ae)|0,!(d>>>0<l>>>0&A>>>0<(l-d|0)>>>0)){A=0;break e}if(s[o+(d+A)>>0]|0){A=0;break e}if(A=gX(u,o+d|0)|0,!A)break;if(A=(A|0)<0,(m|0)==1){A=0;break e}else M=A?M:R,m=A?k:m-k|0}A=B+L|0,d=Ad(n[o+(A<<2)>>2]|0,ae)|0,A=Ad(n[o+(A+1<<2)>>2]|0,ae)|0,A>>>0<l>>>0&d>>>0<(l-A|0)>>>0?A=s[o+(A+d)>>0]|0?0:o+A|0:A=0}else A=0;while(!1);return A|0}function Ad(o,l){o=o|0,l=l|0;var u=0;return u=xX(o|0)|0,(l|0?u:o)|0}function C6e(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0,k=0;A=u+16|0,d=n[A>>2]|0,d?m=5:w6e(u)|0?A=0:(d=n[A>>2]|0,m=5);e:do if((m|0)==5){if(k=u+20|0,B=n[k>>2]|0,A=B,(d-B|0)>>>0<l>>>0){A=Yb[n[u+36>>2]&7](u,o,l)|0;break}t:do if((s[u+75>>0]|0)>-1){for(B=l;;){if(!B){m=0,d=o;break t}if(d=B+-1|0,(s[o+d>>0]|0)==10)break;B=d}if(A=Yb[n[u+36>>2]&7](u,o,B)|0,A>>>0<B>>>0)break e;m=B,d=o+B|0,l=l-B|0,A=n[k>>2]|0}else m=0,d=o;while(!1);Qr(A|0,d|0,l|0)|0,n[k>>2]=(n[k>>2]|0)+l,A=m+l|0}while(!1);return A|0}function w6e(o){o=o|0;var l=0,u=0;return l=o+74|0,u=s[l>>0]|0,s[l>>0]=u+255|u,l=n[o>>2]|0,l&8?(n[o>>2]=l|32,o=-1):(n[o+8>>2]=0,n[o+4>>2]=0,u=n[o+44>>2]|0,n[o+28>>2]=u,n[o+20>>2]=u,n[o+16>>2]=u+(n[o+48>>2]|0),o=0),o|0}function $n(o,l){o=y(o),l=y(l);var u=0,A=0;u=wX(o)|0;do if((u&2147483647)>>>0<=2139095040){if(A=wX(l)|0,(A&2147483647)>>>0<=2139095040)if((A^u|0)<0){o=(u|0)<0?l:o;break}else{o=o<l?l:o;break}}else o=l;while(!1);return y(o)}function wX(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function pd(o,l){o=y(o),l=y(l);var u=0,A=0;u=BX(o)|0;do if((u&2147483647)>>>0<=2139095040){if(A=BX(l)|0,(A&2147483647)>>>0<=2139095040)if((A^u|0)<0){o=(u|0)<0?o:l;break}else{o=o<l?o:l;break}}else o=l;while(!1);return y(o)}function BX(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function cU(o,l){o=y(o),l=y(l);var u=0,A=0,d=0,m=0,B=0,k=0,R=0,M=0;m=(h[S>>2]=o,n[S>>2]|0),k=(h[S>>2]=l,n[S>>2]|0),u=m>>>23&255,B=k>>>23&255,R=m&-2147483648,d=k<<1;e:do if(d|0&&!((u|0)==255|((B6e(l)|0)&2147483647)>>>0>2139095040)){if(A=m<<1,A>>>0<=d>>>0)return l=y(o*y(0)),y((A|0)==(d|0)?l:o);if(u)A=m&8388607|8388608;else{if(u=m<<9,(u|0)>-1){A=u,u=0;do u=u+-1|0,A=A<<1;while((A|0)>-1)}else u=0;A=m<<1-u}if(B)k=k&8388607|8388608;else{if(m=k<<9,(m|0)>-1){d=0;do d=d+-1|0,m=m<<1;while((m|0)>-1)}else d=0;B=d,k=k<<1-d}d=A-k|0,m=(d|0)>-1;t:do if((u|0)>(B|0)){for(;;){if(m)if(d)A=d;else break;if(A=A<<1,u=u+-1|0,d=A-k|0,m=(d|0)>-1,(u|0)<=(B|0))break t}l=y(o*y(0));break e}while(!1);if(m)if(d)A=d;else{l=y(o*y(0));break}if(A>>>0<8388608)do A=A<<1,u=u+-1|0;while(A>>>0<8388608);(u|0)>0?u=A+-8388608|u<<23:u=A>>>(1-u|0),l=(n[S>>2]=u|R,y(h[S>>2]))}else M=3;while(!1);return(M|0)==3&&(l=y(o*l),l=y(l/l)),y(l)}function B6e(o){return o=y(o),h[S>>2]=o,n[S>>2]|0|0}function v6e(o,l){return o=o|0,l=l|0,dX(n[582]|0,o,l)|0}function sn(o){o=o|0,Nt()}function $y(o){o=o|0}function S6e(o,l){return o=o|0,l=l|0,0}function D6e(o){return o=o|0,(vX(o+4|0)|0)==-1?(ip[n[(n[o>>2]|0)+8>>2]&127](o),o=1):o=0,o|0}function vX(o){o=o|0;var l=0;return l=n[o>>2]|0,n[o>>2]=l+-1,l+-1|0}function Gh(o){o=o|0,D6e(o)|0&&P6e(o)}function P6e(o){o=o|0;var l=0;l=o+8|0,n[l>>2]|0&&(vX(l)|0)!=-1||ip[n[(n[o>>2]|0)+16>>2]&127](o)}function Kt(o){o=o|0;var l=0;for(l=o|0?o:1;o=_b(l)|0,!(o|0);){if(o=x6e()|0,!o){o=0;break}UX[o&0]()}return o|0}function SX(o){return o=o|0,Kt(o)|0}function It(o){o=o|0,Hb(o)}function b6e(o){o=o|0,(s[o+11>>0]|0)<0&&It(n[o>>2]|0)}function x6e(){var o=0;return o=n[2923]|0,n[2923]=o+0,o|0}function k6e(){}function Gb(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,A=l-A-(u>>>0>o>>>0|0)>>>0,ye=A,o-u>>>0|0|0}function uU(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,u=o+u>>>0,ye=l+A+(u>>>0<o>>>0|0)>>>0,u|0|0}function eE(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0,B=0;if(m=o+u|0,l=l&255,(u|0)>=67){for(;o&3;)s[o>>0]=l,o=o+1|0;for(A=m&-4|0,d=A-64|0,B=l|l<<8|l<<16|l<<24;(o|0)<=(d|0);)n[o>>2]=B,n[o+4>>2]=B,n[o+8>>2]=B,n[o+12>>2]=B,n[o+16>>2]=B,n[o+20>>2]=B,n[o+24>>2]=B,n[o+28>>2]=B,n[o+32>>2]=B,n[o+36>>2]=B,n[o+40>>2]=B,n[o+44>>2]=B,n[o+48>>2]=B,n[o+52>>2]=B,n[o+56>>2]=B,n[o+60>>2]=B,o=o+64|0;for(;(o|0)<(A|0);)n[o>>2]=B,o=o+4|0}for(;(o|0)<(m|0);)s[o>>0]=l,o=o+1|0;return m-u|0}function DX(o,l,u){return o=o|0,l=l|0,u=u|0,(u|0)<32?(ye=l<<u|(o&(1<<u)-1<<32-u)>>>32-u,o<<u):(ye=o<<u-32,0)}function qb(o,l,u){return o=o|0,l=l|0,u=u|0,(u|0)<32?(ye=l>>>u,o>>>u|(l&(1<<u)-1)<<32-u):(ye=0,l>>>u-32|0)}function Qr(o,l,u){o=o|0,l=l|0,u=u|0;var A=0,d=0,m=0;if((u|0)>=8192)return OA(o|0,l|0,u|0)|0;if(m=o|0,d=o+u|0,(o&3)==(l&3)){for(;o&3;){if(!u)return m|0;s[o>>0]=s[l>>0]|0,o=o+1|0,l=l+1|0,u=u-1|0}for(u=d&-4|0,A=u-64|0;(o|0)<=(A|0);)n[o>>2]=n[l>>2],n[o+4>>2]=n[l+4>>2],n[o+8>>2]=n[l+8>>2],n[o+12>>2]=n[l+12>>2],n[o+16>>2]=n[l+16>>2],n[o+20>>2]=n[l+20>>2],n[o+24>>2]=n[l+24>>2],n[o+28>>2]=n[l+28>>2],n[o+32>>2]=n[l+32>>2],n[o+36>>2]=n[l+36>>2],n[o+40>>2]=n[l+40>>2],n[o+44>>2]=n[l+44>>2],n[o+48>>2]=n[l+48>>2],n[o+52>>2]=n[l+52>>2],n[o+56>>2]=n[l+56>>2],n[o+60>>2]=n[l+60>>2],o=o+64|0,l=l+64|0;for(;(o|0)<(u|0);)n[o>>2]=n[l>>2],o=o+4|0,l=l+4|0}else for(u=d-4|0;(o|0)<(u|0);)s[o>>0]=s[l>>0]|0,s[o+1>>0]=s[l+1>>0]|0,s[o+2>>0]=s[l+2>>0]|0,s[o+3>>0]=s[l+3>>0]|0,o=o+4|0,l=l+4|0;for(;(o|0)<(d|0);)s[o>>0]=s[l>>0]|0,o=o+1|0,l=l+1|0;return m|0}function PX(o){o=o|0;var l=0;return l=s[N+(o&255)>>0]|0,(l|0)<8?l|0:(l=s[N+(o>>8&255)>>0]|0,(l|0)<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)%(k>>>0)),Ye=0,Le=(M>>>0)/(k>>>0)>>>0,ye=Ye,Le|0;if(m=k-1|0,!(m&k))return d|0&&(n[d>>2]=o|0,n[d+4>>2]=m&M|l&0),Ye=0,Le=M>>>((PX(k|0)|0)>>>0),ye=Ye,Le|0;if(m=(P(k|0)|0)-(P(M|0)|0)|0,m>>>0<=30){l=m+1|0,k=31-m|0,B=l,o=M<<k|L>>>(l>>>0),l=M>>>(l>>>0),m=0,k=L<<k;break}return d?(n[d>>2]=o|0,n[d+4>>2]=R|l&0,Ye=0,Le=0,ye=Ye,Le|0):(Ye=0,Le=0,ye=Ye,Le|0)}while(!1);if(!B)M=k,R=0,k=0;else{q=u|0|0,L=ae|A&0,M=uU(q|0,L|0,-1,-1)|0,u=ye,R=k,k=0;do A=R,R=m>>>31|R<<1,m=k|m<<1,A=o<<1|A>>>31|0,ae=o>>>31|l<<1|0,Gb(M|0,u|0,A|0,ae|0)|0,Le=ye,Ye=Le>>31|((Le|0)<0?-1:0)<<1,k=Ye&1,o=Gb(A|0,ae|0,Ye&q|0,(((Le|0)<0?-1:0)>>31|((Le|0)<0?-1:0)<<1)&L|0)|0,l=ye,B=B-1|0;while(B|0);M=R,R=0}return B=0,d|0&&(n[d>>2]=o,n[d+4>>2]=l),Ye=(m|0)>>>31|(M|B)<<1|(B<<1|m>>>31)&0|R,Le=(m<<1|0)&-2|k,ye=Ye,Le|0}function fU(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,bX(o,l,u,A,0)|0}function qh(o){o=o|0;var l=0,u=0;return u=o+15&-16|0,l=n[C>>2]|0,o=l+u|0,(u|0)>0&(o|0)<(l|0)|(o|0)<0?(oe()|0,fu(12),-1):(n[C>>2]=o,(o|0)>($()|0)&&!(Z()|0)?(n[C>>2]=l,fu(12),-1):l|0)}function Q2(o,l,u){o=o|0,l=l|0,u=u|0;var A=0;if((l|0)<(o|0)&(o|0)<(l+u|0)){for(A=o,l=l+u|0,o=o+u|0;(u|0)>0;)o=o-1|0,l=l-1|0,u=u-1|0,s[o>>0]=s[l>>0]|0;o=A}else Qr(o,l,u)|0;return o|0}function AU(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0;var d=0,m=0;return m=I,I=I+16|0,d=m|0,bX(o,l,u,A,d)|0,I=m,ye=n[d+4>>2]|0,n[d>>2]|0|0}function xX(o){return o=o|0,(o&255)<<24|(o>>8&255)<<16|(o>>16&255)<<8|o>>>24|0}function Q6e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,kX[o&1](l|0,u|0,A|0,d|0,m|0)}function R6e(o,l,u){o=o|0,l=l|0,u=y(u),QX[o&1](l|0,y(u))}function T6e(o,l,u){o=o|0,l=l|0,u=+u,RX[o&31](l|0,+u)}function F6e(o,l,u,A){return o=o|0,l=l|0,u=y(u),A=y(A),y(TX[o&0](l|0,y(u),y(A)))}function N6e(o,l){o=o|0,l=l|0,ip[o&127](l|0)}function O6e(o,l,u){o=o|0,l=l|0,u=u|0,sp[o&31](l|0,u|0)}function L6e(o,l){return o=o|0,l=l|0,gd[o&31](l|0)|0}function M6e(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0,FX[o&1](l|0,+u,+A,d|0)}function U6e(o,l,u,A){o=o|0,l=l|0,u=+u,A=+A,EGe[o&1](l|0,+u,+A)}function _6e(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,Yb[o&7](l|0,u|0,A|0)|0}function H6e(o,l,u,A){return o=o|0,l=l|0,u=u|0,A=A|0,+IGe[o&1](l|0,u|0,A|0)}function j6e(o,l){return o=o|0,l=l|0,+NX[o&15](l|0)}function G6e(o,l,u){return o=o|0,l=l|0,u=+u,CGe[o&1](l|0,+u)|0}function q6e(o,l,u){return o=o|0,l=l|0,u=u|0,hU[o&15](l|0,u|0)|0}function W6e(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=+A,d=+d,m=m|0,wGe[o&1](l|0,u|0,+A,+d,m|0)}function Y6e(o,l,u,A,d,m,B){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,B=B|0,BGe[o&1](l|0,u|0,A|0,d|0,m|0,B|0)}function V6e(o,l,u){return o=o|0,l=l|0,u=u|0,+OX[o&7](l|0,u|0)}function J6e(o){return o=o|0,Vb[o&7]()|0}function K6e(o,l,u,A,d,m){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,LX[o&1](l|0,u|0,A|0,d|0,m|0)|0}function z6e(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=+d,vGe[o&1](l|0,u|0,A|0,+d)}function Z6e(o,l,u,A,d,m,B){o=o|0,l=l|0,u=u|0,A=y(A),d=d|0,m=y(m),B=B|0,MX[o&1](l|0,u|0,y(A),d|0,y(m),B|0)}function X6e(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,F2[o&15](l|0,u|0,A|0)}function $6e(o){o=o|0,UX[o&0]()}function eGe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A,_X[o&15](l|0,u|0,+A)}function tGe(o,l,u){return o=o|0,l=+l,u=+u,SGe[o&1](+l,+u)|0}function rGe(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,gU[o&15](l|0,u|0,A|0,d|0)}function nGe(o,l,u,A,d){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,F(0)}function iGe(o,l){o=o|0,l=y(l),F(1)}function Za(o,l){o=o|0,l=+l,F(2)}function sGe(o,l,u){return o=o|0,l=y(l),u=y(u),F(3),$e}function wr(o){o=o|0,F(4)}function R2(o,l){o=o|0,l=l|0,F(5)}function Ol(o){return o=o|0,F(6),0}function oGe(o,l,u,A){o=o|0,l=+l,u=+u,A=A|0,F(7)}function aGe(o,l,u){o=o|0,l=+l,u=+u,F(8)}function lGe(o,l,u){return o=o|0,l=l|0,u=u|0,F(9),0}function cGe(o,l,u){return o=o|0,l=l|0,u=u|0,F(10),0}function hd(o){return o=o|0,F(11),0}function uGe(o,l){return o=o|0,l=+l,F(12),0}function T2(o,l){return o=o|0,l=l|0,F(13),0}function fGe(o,l,u,A,d){o=o|0,l=l|0,u=+u,A=+A,d=d|0,F(14)}function AGe(o,l,u,A,d,m){o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,m=m|0,F(15)}function pU(o,l){return o=o|0,l=l|0,F(16),0}function pGe(){return F(17),0}function hGe(o,l,u,A,d){return o=o|0,l=l|0,u=u|0,A=A|0,d=d|0,F(18),0}function gGe(o,l,u,A){o=o|0,l=l|0,u=u|0,A=+A,F(19)}function dGe(o,l,u,A,d,m){o=o|0,l=l|0,u=y(u),A=A|0,d=y(d),m=m|0,F(20)}function Wb(o,l,u){o=o|0,l=l|0,u=u|0,F(21)}function mGe(){F(22)}function tE(o,l,u){o=o|0,l=l|0,u=+u,F(23)}function yGe(o,l){return o=+o,l=+l,F(24),0}function rE(o,l,u,A){o=o|0,l=l|0,u=u|0,A=A|0,F(25)}var kX=[nGe,h3e],QX=[iGe,Ry],RX=[Za,Xg,Fh,h2,g2,d2,m2,Pf,_y,y2,bf,$g,ed,E2,I2,wu,td,C2,Hy,Za,Za,Za,Za,Za,Za,Za,Za,Za,Za,Za,Za,Za],TX=[sGe],ip=[wr,$y,Jke,Kke,zke,SFe,DFe,PFe,G_e,q_e,W_e,t3e,r3e,n3e,Bje,vje,Sje,Bl,Zg,u2,sr,hc,xb,kb,Mke,iQe,dQe,FQe,zQe,pRe,kRe,WRe,oTe,wTe,MTe,eFe,dFe,qFe,oNe,wNe,MNe,eOe,dOe,NOe,zOe,uLe,DLe,db,nMe,EMe,MMe,rUe,mUe,MUe,JUe,ZUe,h_e,m_e,F_e,V_e,z_e,p4e,Q4e,dz,A8e,G8e,iHe,EHe,HHe,rje,pje,dje,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,wr,w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cpp:a2,dynCall_vii:O6e,___uremdi3:AU,dynCall_vid:T6e,stackAlloc:Ua,_nbind_init:jje,getTempRet0:MA,dynCall_di:j6e,dynCall_iid:G6e,setTempRet0:LA,_i64Add:uU,dynCall_fiff:F6e,dynCall_iiii:_6e,_emscripten_get_global_libc:$je,dynCall_viid:eGe,dynCall_viiid:z6e,dynCall_viififi:Z6e,dynCall_ii:L6e,__GLOBAL__sub_I_Binding_cc:i8e,dynCall_viiii:rGe,dynCall_iiiiii:K6e,stackSave:hf,dynCall_viiiii:Q6e,__GLOBAL__sub_I_nbind_cc:Sr,dynCall_vidd:U6e,_free:Hb,runPostSets:k6e,dynCall_viiiiii:Y6e,establishStackSpace:wn,_memmove:Q2,stackRestore:lc,_malloc:_b,__GLOBAL__sub_I_common_cc:v4e,dynCall_viddi:M6e,dynCall_dii:V6e,dynCall_v:$6e}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm;function ExitStatus(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function t(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=t)},Module.callMain=Module.callMain=function t(e){e=e||[],ensureInitRuntime();var r=e.length+1;function s(){for(var p=0;p<3;p++)a.push(0)}var a=[allocate(intArrayFromString(Module.thisProgram),\"i8\",ALLOC_NORMAL)];s();for(var n=0;n<r-1;n=n+1)a.push(allocate(intArrayFromString(e[n]),\"i8\",ALLOC_NORMAL)),s();a.push(0),a=allocate(a,\"i32\",ALLOC_NORMAL);try{var c=Module._main(r,a,0);exit(c,!0)}catch(p){if(p instanceof ExitStatus)return;if(p==\"SimulateInfiniteLoop\"){Module.noExitRuntime=!0;return}else{var f=p;p&&typeof p==\"object\"&&p.stack&&(f=[p,p.stack]),Module.printErr(\"exception thrown: \"+f),Module.quit(1,p)}}finally{calledMain=!0}};function run(t){if(t=t||Module.arguments,preloadStartTime===null&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0)||Module.calledRun)return;function e(){Module.calledRun||(Module.calledRun=!0,!ABORT&&(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(t),postRun()))}Module.setStatus?(Module.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){Module.setStatus(\"\")},1),e()},1)):e()}Module.run=Module.run=run;function exit(t,e){e&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=t,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(t)),ENVIRONMENT_IS_NODE&&process.exit(t),Module.quit(t,new ExitStatus(t)))}Module.exit=Module.exit=exit;var abortDecorators=[];function abort(t){Module.onAbort&&Module.onAbort(t),t!==void 0?(Module.print(t),Module.printErr(t),t=JSON.stringify(t)):t=\"\",ABORT=!0,EXITSTATUS=1;var e=`\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r=\"abort(\"+t+\") at \"+stackTrace()+e;throw abortDecorators&&abortDecorators.forEach(function(s){r=s(r,t)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit==\"function\"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var Fm=_((cKt,bwe)=>{\"use strict\";var Ipt=Dwe(),Cpt=Pwe(),j9=!1,G9=null;Cpt({},function(t,e){if(!j9){if(j9=!0,t)throw t;G9=e}});if(!j9)throw new Error(\"Failed to load the yoga module - it needed to be loaded synchronously, but didn't\");bwe.exports=Ipt(G9.bind,G9.lib)});var W9=_((uKt,q9)=>{\"use strict\";var xwe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);q9.exports=xwe;q9.exports.default=xwe});var Qwe=_((fKt,kwe)=>{\"use strict\";kwe.exports=function(){return/\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73)\\uDB40\\uDC7F|\\uD83D\\uDC68(?:\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83D[\\uDC66\\uDC67]|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C[\\uDFFB-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)\\uD83C\\uDFFB|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])|\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83D\\uDC69(?:\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|(?:(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)\\uFE0F|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\u200D[\\u2640\\u2642])|\\uD83C\\uDFF4\\u200D\\u2620)\\uFE0F|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83C\\uDDFD\\uD83C\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D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC70\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDCAA\\uDD74\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD36\\uDDB5\\uDDB6\\uDDBB\\uDDD2-\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5\\uDEEB\\uDEEC\\uDEF4-\\uDEFA\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795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-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g}});var GS=_((AKt,Y9)=>{\"use strict\";var wpt=dk(),Bpt=W9(),vpt=Qwe(),Rwe=t=>{if(typeof t!=\"string\"||t.length===0||(t=wpt(t),t.length===0))return 0;t=t.replace(vpt(),\"  \");let e=0;for(let r=0;r<t.length;r++){let s=t.codePointAt(r);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&r++,e+=Bpt(s)?2:1)}return e};Y9.exports=Rwe;Y9.exports.default=Rwe});var J9=_((pKt,V9)=>{\"use strict\";var Spt=GS(),Twe=t=>{let e=0;for(let r of t.split(`\n`))e=Math.max(e,Spt(r));return e};V9.exports=Twe;V9.exports.default=Twe});var Fwe=_(qS=>{\"use strict\";var Dpt=qS&&qS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qS,\"__esModule\",{value:!0});var Ppt=Dpt(J9()),K9={};qS.default=t=>{if(t.length===0)return{width:0,height:0};if(K9[t])return K9[t];let e=Ppt.default(t),r=t.split(`\n`).length;return K9[t]={width:e,height:r},{width:e,height:r}}});var Nwe=_(WS=>{\"use strict\";var bpt=WS&&WS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(WS,\"__esModule\",{value:!0});var Pn=bpt(Fm()),xpt=(t,e)=>{\"position\"in e&&t.setPositionType(e.position===\"absolute\"?Pn.default.POSITION_TYPE_ABSOLUTE:Pn.default.POSITION_TYPE_RELATIVE)},kpt=(t,e)=>{\"marginLeft\"in e&&t.setMargin(Pn.default.EDGE_START,e.marginLeft||0),\"marginRight\"in e&&t.setMargin(Pn.default.EDGE_END,e.marginRight||0),\"marginTop\"in e&&t.setMargin(Pn.default.EDGE_TOP,e.marginTop||0),\"marginBottom\"in e&&t.setMargin(Pn.default.EDGE_BOTTOM,e.marginBottom||0)},Qpt=(t,e)=>{\"paddingLeft\"in e&&t.setPadding(Pn.default.EDGE_LEFT,e.paddingLeft||0),\"paddingRight\"in e&&t.setPadding(Pn.default.EDGE_RIGHT,e.paddingRight||0),\"paddingTop\"in e&&t.setPadding(Pn.default.EDGE_TOP,e.paddingTop||0),\"paddingBottom\"in e&&t.setPadding(Pn.default.EDGE_BOTTOM,e.paddingBottom||0)},Rpt=(t,e)=>{var r;\"flexGrow\"in e&&t.setFlexGrow((r=e.flexGrow)!==null&&r!==void 0?r:0),\"flexShrink\"in e&&t.setFlexShrink(typeof e.flexShrink==\"number\"?e.flexShrink:1),\"flexDirection\"in e&&(e.flexDirection===\"row\"&&t.setFlexDirection(Pn.default.FLEX_DIRECTION_ROW),e.flexDirection===\"row-reverse\"&&t.setFlexDirection(Pn.default.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection===\"column\"&&t.setFlexDirection(Pn.default.FLEX_DIRECTION_COLUMN),e.flexDirection===\"column-reverse\"&&t.setFlexDirection(Pn.default.FLEX_DIRECTION_COLUMN_REVERSE)),\"flexBasis\"in e&&(typeof e.flexBasis==\"number\"?t.setFlexBasis(e.flexBasis):typeof e.flexBasis==\"string\"?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(NaN)),\"alignItems\"in e&&((e.alignItems===\"stretch\"||!e.alignItems)&&t.setAlignItems(Pn.default.ALIGN_STRETCH),e.alignItems===\"flex-start\"&&t.setAlignItems(Pn.default.ALIGN_FLEX_START),e.alignItems===\"center\"&&t.setAlignItems(Pn.default.ALIGN_CENTER),e.alignItems===\"flex-end\"&&t.setAlignItems(Pn.default.ALIGN_FLEX_END)),\"alignSelf\"in e&&((e.alignSelf===\"auto\"||!e.alignSelf)&&t.setAlignSelf(Pn.default.ALIGN_AUTO),e.alignSelf===\"flex-start\"&&t.setAlignSelf(Pn.default.ALIGN_FLEX_START),e.alignSelf===\"center\"&&t.setAlignSelf(Pn.default.ALIGN_CENTER),e.alignSelf===\"flex-end\"&&t.setAlignSelf(Pn.default.ALIGN_FLEX_END)),\"justifyContent\"in e&&((e.justifyContent===\"flex-start\"||!e.justifyContent)&&t.setJustifyContent(Pn.default.JUSTIFY_FLEX_START),e.justifyContent===\"center\"&&t.setJustifyContent(Pn.default.JUSTIFY_CENTER),e.justifyContent===\"flex-end\"&&t.setJustifyContent(Pn.default.JUSTIFY_FLEX_END),e.justifyContent===\"space-between\"&&t.setJustifyContent(Pn.default.JUSTIFY_SPACE_BETWEEN),e.justifyContent===\"space-around\"&&t.setJustifyContent(Pn.default.JUSTIFY_SPACE_AROUND))},Tpt=(t,e)=>{var r,s;\"width\"in e&&(typeof e.width==\"number\"?t.setWidth(e.width):typeof e.width==\"string\"?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),\"height\"in e&&(typeof e.height==\"number\"?t.setHeight(e.height):typeof e.height==\"string\"?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),\"minWidth\"in e&&(typeof e.minWidth==\"string\"?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth((r=e.minWidth)!==null&&r!==void 0?r:0)),\"minHeight\"in e&&(typeof e.minHeight==\"string\"?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight((s=e.minHeight)!==null&&s!==void 0?s:0))},Fpt=(t,e)=>{\"display\"in e&&t.setDisplay(e.display===\"flex\"?Pn.default.DISPLAY_FLEX:Pn.default.DISPLAY_NONE)},Npt=(t,e)=>{if(\"borderStyle\"in e){let r=typeof e.borderStyle==\"string\"?1:0;t.setBorder(Pn.default.EDGE_TOP,r),t.setBorder(Pn.default.EDGE_BOTTOM,r),t.setBorder(Pn.default.EDGE_LEFT,r),t.setBorder(Pn.default.EDGE_RIGHT,r)}};WS.default=(t,e={})=>{xpt(t,e),kpt(t,e),Qpt(t,e),Rpt(t,e),Tpt(t,e),Fpt(t,e),Npt(t,e)}});var Mwe=_((dKt,Lwe)=>{\"use strict\";var YS=GS(),Opt=dk(),Lpt=sk(),Z9=new Set([\"\\x1B\",\"\\x9B\"]),Mpt=39,Owe=t=>`${Z9.values().next().value}[${t}m`,Upt=t=>t.split(\" \").map(e=>YS(e)),z9=(t,e,r)=>{let s=[...e],a=!1,n=YS(Opt(t[t.length-1]));for(let[c,f]of s.entries()){let p=YS(f);if(n+p<=r?t[t.length-1]+=f:(t.push(f),n=0),Z9.has(f))a=!0;else if(a&&f===\"m\"){a=!1;continue}a||(n+=p,n===r&&c<s.length-1&&(t.push(\"\"),n=0))}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},_pt=t=>{let e=t.split(\" \"),r=e.length;for(;r>0&&!(YS(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(\" \")+e.slice(r).join(\"\")},Hpt=(t,e,r={})=>{if(r.trim!==!1&&t.trim()===\"\")return\"\";let s=\"\",a=\"\",n,c=Upt(t),f=[\"\"];for(let[p,h]of t.split(\" \").entries()){r.trim!==!1&&(f[f.length-1]=f[f.length-1].trimLeft());let E=YS(f[f.length-1]);if(p!==0&&(E>=e&&(r.wordWrap===!1||r.trim===!1)&&(f.push(\"\"),E=0),(E>0||r.trim===!1)&&(f[f.length-1]+=\" \",E++)),r.hard&&c[p]>e){let C=e-E,S=1+Math.floor((c[p]-C-1)/e);Math.floor((c[p]-1)/e)<S&&f.push(\"\"),z9(f,h,e);continue}if(E+c[p]>e&&E>0&&c[p]>0){if(r.wordWrap===!1&&E<e){z9(f,h,e);continue}f.push(\"\")}if(E+c[p]>e&&r.wordWrap===!1){z9(f,h,e);continue}f[f.length-1]+=h}r.trim!==!1&&(f=f.map(_pt)),s=f.join(`\n`);for(let[p,h]of[...s].entries()){if(a+=h,Z9.has(h)){let C=parseFloat(/\\d[^m]*/.exec(s.slice(p,p+4)));n=C===Mpt?null:C}let E=Lpt.codes.get(Number(n));n&&E&&(s[p+1]===`\n`?a+=Owe(E):h===`\n`&&(a+=Owe(n)))}return a};Lwe.exports=(t,e,r)=>String(t).normalize().replace(/\\r\\n/g,`\n`).split(`\n`).map(s=>Hpt(s,e,r)).join(`\n`)});var Hwe=_((mKt,_we)=>{\"use strict\";var Uwe=\"[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]\",jpt=t=>t&&t.exact?new RegExp(`^${Uwe}$`):new RegExp(Uwe,\"g\");_we.exports=jpt});var X9=_((yKt,Wwe)=>{\"use strict\";var Gpt=W9(),qpt=Hwe(),jwe=sk(),qwe=[\"\\x1B\",\"\\x9B\"],FF=t=>`${qwe[0]}[${t}m`,Gwe=(t,e,r)=>{let s=[];t=[...t];for(let a of t){let n=a;a.match(\";\")&&(a=a.split(\";\")[0][0]+\"0\");let c=jwe.codes.get(parseInt(a,10));if(c){let f=t.indexOf(c.toString());f>=0?t.splice(f,1):s.push(FF(e?c:n))}else if(e){s.push(FF(0));break}else s.push(FF(n))}if(e&&(s=s.filter((a,n)=>s.indexOf(a)===n),r!==void 0)){let a=FF(jwe.codes.get(parseInt(r,10)));s=s.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return s.join(\"\")};Wwe.exports=(t,e,r)=>{let s=[...t.normalize()],a=[];r=typeof r==\"number\"?r:s.length;let n=!1,c,f=0,p=\"\";for(let[h,E]of s.entries()){let C=!1;if(qwe.includes(E)){let S=/\\d[^m]*/.exec(t.slice(h,h+18));c=S&&S.length>0?S[0]:void 0,f<r&&(n=!0,c!==void 0&&a.push(c))}else n&&E===\"m\"&&(n=!1,C=!0);if(!n&&!C&&++f,!qpt({exact:!0}).test(E)&&Gpt(E.codePointAt())&&++f,f>e&&f<=r)p+=E;else if(f===e&&!n&&c!==void 0)p=Gwe(a);else if(f>=r){p+=Gwe(a,!0,c);break}}return p}});var Vwe=_((EKt,Ywe)=>{\"use strict\";var $0=X9(),Wpt=GS();function NF(t,e,r){if(t.charAt(e)===\" \")return e;for(let s=1;s<=3;s++)if(r){if(t.charAt(e+s)===\" \")return e+s}else if(t.charAt(e-s)===\" \")return e-s;return e}Ywe.exports=(t,e,r)=>{r={position:\"end\",preferTruncationOnSpace:!1,...r};let{position:s,space:a,preferTruncationOnSpace:n}=r,c=\"\\u2026\",f=1;if(typeof t!=\"string\")throw new TypeError(`Expected \\`input\\` to be a string, got ${typeof t}`);if(typeof e!=\"number\")throw new TypeError(`Expected \\`columns\\` to be a number, got ${typeof e}`);if(e<1)return\"\";if(e===1)return c;let p=Wpt(t);if(p<=e)return t;if(s===\"start\"){if(n){let h=NF(t,p-e+1,!0);return c+$0(t,h,p).trim()}return a===!0&&(c+=\" \",f=2),c+$0(t,p-e+f,p)}if(s===\"middle\"){a===!0&&(c=\" \"+c+\" \",f=3);let h=Math.floor(e/2);if(n){let E=NF(t,h),C=NF(t,p-(e-h)+1,!0);return $0(t,0,E)+c+$0(t,C,p).trim()}return $0(t,0,h)+c+$0(t,p-(e-h)+f,p)}if(s===\"end\"){if(n){let h=NF(t,e-1);return $0(t,0,h)+c}return a===!0&&(c=\" \"+c,f=2),$0(t,0,e-f)+c}throw new Error(`Expected \\`options.position\\` to be either \\`start\\`, \\`middle\\` or \\`end\\`, got ${s}`)}});var eW=_(VS=>{\"use strict\";var Jwe=VS&&VS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(VS,\"__esModule\",{value:!0});var Ypt=Jwe(Mwe()),Vpt=Jwe(Vwe()),$9={};VS.default=(t,e,r)=>{let s=t+String(e)+String(r);if($9[s])return $9[s];let a=t;if(r===\"wrap\"&&(a=Ypt.default(t,e,{trim:!1,hard:!0})),r.startsWith(\"truncate\")){let n=\"end\";r===\"truncate-middle\"&&(n=\"middle\"),r===\"truncate-start\"&&(n=\"start\"),a=Vpt.default(t,e,{position:n})}return $9[s]=a,a}});var rW=_(tW=>{\"use strict\";Object.defineProperty(tW,\"__esModule\",{value:!0});var Kwe=t=>{let e=\"\";if(t.childNodes.length>0)for(let r of t.childNodes){let s=\"\";r.nodeName===\"#text\"?s=r.nodeValue:((r.nodeName===\"ink-text\"||r.nodeName===\"ink-virtual-text\")&&(s=Kwe(r)),s.length>0&&typeof r.internal_transform==\"function\"&&(s=r.internal_transform(s))),e+=s}return e};tW.default=Kwe});var nW=_(Pi=>{\"use strict\";var JS=Pi&&Pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pi,\"__esModule\",{value:!0});Pi.setTextNodeValue=Pi.createTextNode=Pi.setStyle=Pi.setAttribute=Pi.removeChildNode=Pi.insertBeforeNode=Pi.appendChildNode=Pi.createNode=Pi.TEXT_NAME=void 0;var Jpt=JS(Fm()),zwe=JS(Fwe()),Kpt=JS(Nwe()),zpt=JS(eW()),Zpt=JS(rW());Pi.TEXT_NAME=\"#text\";Pi.createNode=t=>{var e;let r={nodeName:t,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:t===\"ink-virtual-text\"?void 0:Jpt.default.Node.create()};return t===\"ink-text\"&&((e=r.yogaNode)===null||e===void 0||e.setMeasureFunc(Xpt.bind(null,r))),r};Pi.appendChildNode=(t,e)=>{var r;e.parentNode&&Pi.removeChildNode(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&((r=t.yogaNode)===null||r===void 0||r.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName===\"ink-text\"||t.nodeName===\"ink-virtual-text\")&&OF(t)};Pi.insertBeforeNode=(t,e,r)=>{var s,a;e.parentNode&&Pi.removeChildNode(e.parentNode,e),e.parentNode=t;let n=t.childNodes.indexOf(r);if(n>=0){t.childNodes.splice(n,0,e),e.yogaNode&&((s=t.yogaNode)===null||s===void 0||s.insertChild(e.yogaNode,n));return}t.childNodes.push(e),e.yogaNode&&((a=t.yogaNode)===null||a===void 0||a.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName===\"ink-text\"||t.nodeName===\"ink-virtual-text\")&&OF(t)};Pi.removeChildNode=(t,e)=>{var r,s;e.yogaNode&&((s=(r=e.parentNode)===null||r===void 0?void 0:r.yogaNode)===null||s===void 0||s.removeChild(e.yogaNode)),e.parentNode=null;let a=t.childNodes.indexOf(e);a>=0&&t.childNodes.splice(a,1),(t.nodeName===\"ink-text\"||t.nodeName===\"ink-virtual-text\")&&OF(t)};Pi.setAttribute=(t,e,r)=>{t.attributes[e]=r};Pi.setStyle=(t,e)=>{t.style=e,t.yogaNode&&Kpt.default(t.yogaNode,e)};Pi.createTextNode=t=>{let e={nodeName:\"#text\",nodeValue:t,yogaNode:void 0,parentNode:null,style:{}};return Pi.setTextNodeValue(e,t),e};var Xpt=function(t,e){var r,s;let a=t.nodeName===\"#text\"?t.nodeValue:Zpt.default(t),n=zwe.default(a);if(n.width<=e||n.width>=1&&e>0&&e<1)return n;let c=(s=(r=t.style)===null||r===void 0?void 0:r.textWrap)!==null&&s!==void 0?s:\"wrap\",f=zpt.default(a,e,c);return zwe.default(f)},Zwe=t=>{var e;if(!(!t||!t.parentNode))return(e=t.yogaNode)!==null&&e!==void 0?e:Zwe(t.parentNode)},OF=t=>{let e=Zwe(t);e?.markDirty()};Pi.setTextNodeValue=(t,e)=>{typeof e!=\"string\"&&(e=String(e)),t.nodeValue=e,OF(t)}});var r1e=_(KS=>{\"use strict\";var t1e=KS&&KS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(KS,\"__esModule\",{value:!0});var Xwe=U9(),$pt=t1e(Iwe()),$we=t1e(Fm()),ea=nW(),e1e=t=>{t?.unsetMeasureFunc(),t?.freeRecursive()};KS.default=$pt.default({schedulePassiveEffects:Xwe.unstable_scheduleCallback,cancelPassiveEffects:Xwe.unstable_cancelCallback,now:Date.now,getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,shouldDeprioritizeSubtree:()=>!1,resetAfterCommit:t=>{if(t.isStaticDirty){t.isStaticDirty=!1,typeof t.onImmediateRender==\"function\"&&t.onImmediateRender();return}typeof t.onRender==\"function\"&&t.onRender()},getChildHostContext:(t,e)=>{let r=t.isInsideText,s=e===\"ink-text\"||e===\"ink-virtual-text\";return r===s?t:{isInsideText:s}},shouldSetTextContent:()=>!1,createInstance:(t,e,r,s)=>{if(s.isInsideText&&t===\"ink-box\")throw new Error(\"<Box> can\\u2019t be nested inside <Text> component\");let a=t===\"ink-text\"&&s.isInsideText?\"ink-virtual-text\":t,n=ea.createNode(a);for(let[c,f]of Object.entries(e))c!==\"children\"&&(c===\"style\"?ea.setStyle(n,f):c===\"internal_transform\"?n.internal_transform=f:c===\"internal_static\"?n.internal_static=!0:ea.setAttribute(n,c,f));return n},createTextInstance:(t,e,r)=>{if(!r.isInsideText)throw new Error(`Text string \"${t}\" must be rendered inside <Text> component`);return ea.createTextNode(t)},resetTextContent:()=>{},hideTextInstance:t=>{ea.setTextNodeValue(t,\"\")},unhideTextInstance:(t,e)=>{ea.setTextNodeValue(t,e)},getPublicInstance:t=>t,hideInstance:t=>{var e;(e=t.yogaNode)===null||e===void 0||e.setDisplay($we.default.DISPLAY_NONE)},unhideInstance:t=>{var e;(e=t.yogaNode)===null||e===void 0||e.setDisplay($we.default.DISPLAY_FLEX)},appendInitialChild:ea.appendChildNode,appendChild:ea.appendChildNode,insertBefore:ea.insertBeforeNode,finalizeInitialChildren:(t,e,r,s)=>(t.internal_static&&(s.isStaticDirty=!0,s.staticNode=t),!1),supportsMutation:!0,appendChildToContainer:ea.appendChildNode,insertInContainerBefore:ea.insertBeforeNode,removeChildFromContainer:(t,e)=>{ea.removeChildNode(t,e),e1e(e.yogaNode)},prepareUpdate:(t,e,r,s,a)=>{t.internal_static&&(a.isStaticDirty=!0);let n={},c=Object.keys(s);for(let f of c)if(s[f]!==r[f]){if(f===\"style\"&&typeof s.style==\"object\"&&typeof r.style==\"object\"){let h=s.style,E=r.style,C=Object.keys(h);for(let S of C){if(S===\"borderStyle\"||S===\"borderColor\"){if(typeof n.style!=\"object\"){let b={};n.style=b}n.style.borderStyle=h.borderStyle,n.style.borderColor=h.borderColor}if(h[S]!==E[S]){if(typeof n.style!=\"object\"){let b={};n.style=b}n.style[S]=h[S]}}continue}n[f]=s[f]}return n},commitUpdate:(t,e)=>{for(let[r,s]of Object.entries(e))r!==\"children\"&&(r===\"style\"?ea.setStyle(t,s):r===\"internal_transform\"?t.internal_transform=s:r===\"internal_static\"?t.internal_static=!0:ea.setAttribute(t,r,s))},commitTextUpdate:(t,e,r)=>{ea.setTextNodeValue(t,r)},removeChild:(t,e)=>{ea.removeChildNode(t,e),e1e(e.yogaNode)}})});var i1e=_((vKt,n1e)=>{\"use strict\";n1e.exports=(t,e=1,r)=>{if(r={indent:\" \",includeEmptyLines:!1,...r},typeof t!=\"string\")throw new TypeError(`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof t}\\``);if(typeof e!=\"number\")throw new TypeError(`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof e}\\``);if(typeof r.indent!=\"string\")throw new TypeError(`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof r.indent}\\``);if(e===0)return t;let s=r.includeEmptyLines?/^/gm:/^(?!\\s*$)/gm;return t.replace(s,r.indent.repeat(e))}});var s1e=_(zS=>{\"use strict\";var eht=zS&&zS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zS,\"__esModule\",{value:!0});var LF=eht(Fm());zS.default=t=>t.getComputedWidth()-t.getComputedPadding(LF.default.EDGE_LEFT)-t.getComputedPadding(LF.default.EDGE_RIGHT)-t.getComputedBorder(LF.default.EDGE_LEFT)-t.getComputedBorder(LF.default.EDGE_RIGHT)});var o1e=_((DKt,tht)=>{tht.exports={single:{topLeft:\"\\u250C\",topRight:\"\\u2510\",bottomRight:\"\\u2518\",bottomLeft:\"\\u2514\",vertical:\"\\u2502\",horizontal:\"\\u2500\"},double:{topLeft:\"\\u2554\",topRight:\"\\u2557\",bottomRight:\"\\u255D\",bottomLeft:\"\\u255A\",vertical:\"\\u2551\",horizontal:\"\\u2550\"},round:{topLeft:\"\\u256D\",topRight:\"\\u256E\",bottomRight:\"\\u256F\",bottomLeft:\"\\u2570\",vertical:\"\\u2502\",horizontal:\"\\u2500\"},bold:{topLeft:\"\\u250F\",topRight:\"\\u2513\",bottomRight:\"\\u251B\",bottomLeft:\"\\u2517\",vertical:\"\\u2503\",horizontal:\"\\u2501\"},singleDouble:{topLeft:\"\\u2553\",topRight:\"\\u2556\",bottomRight:\"\\u255C\",bottomLeft:\"\\u2559\",vertical:\"\\u2551\",horizontal:\"\\u2500\"},doubleSingle:{topLeft:\"\\u2552\",topRight:\"\\u2555\",bottomRight:\"\\u255B\",bottomLeft:\"\\u2558\",vertical:\"\\u2502\",horizontal:\"\\u2550\"},classic:{topLeft:\"+\",topRight:\"+\",bottomRight:\"+\",bottomLeft:\"+\",vertical:\"|\",horizontal:\"-\"}}});var l1e=_((PKt,iW)=>{\"use strict\";var a1e=o1e();iW.exports=a1e;iW.exports.default=a1e});var sW=_(XS=>{\"use strict\";var rht=XS&&XS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(XS,\"__esModule\",{value:!0});var ZS=rht(RE()),nht=/^(rgb|hsl|hsv|hwb)\\(\\s?(\\d+),\\s?(\\d+),\\s?(\\d+)\\s?\\)$/,iht=/^(ansi|ansi256)\\(\\s?(\\d+)\\s?\\)$/,MF=(t,e)=>e===\"foreground\"?t:\"bg\"+t[0].toUpperCase()+t.slice(1);XS.default=(t,e,r)=>{if(!e)return t;if(e in ZS.default){let a=MF(e,r);return ZS.default[a](t)}if(e.startsWith(\"#\")){let a=MF(\"hex\",r);return ZS.default[a](e)(t)}if(e.startsWith(\"ansi\")){let a=iht.exec(e);if(!a)return t;let n=MF(a[1],r),c=Number(a[2]);return ZS.default[n](c)(t)}if(e.startsWith(\"rgb\")||e.startsWith(\"hsl\")||e.startsWith(\"hsv\")||e.startsWith(\"hwb\")){let a=nht.exec(e);if(!a)return t;let n=MF(a[1],r),c=Number(a[2]),f=Number(a[3]),p=Number(a[4]);return ZS.default[n](c,f,p)(t)}return t}});var u1e=_($S=>{\"use strict\";var c1e=$S&&$S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($S,\"__esModule\",{value:!0});var sht=c1e(l1e()),oW=c1e(sW());$S.default=(t,e,r,s)=>{if(typeof r.style.borderStyle==\"string\"){let a=r.yogaNode.getComputedWidth(),n=r.yogaNode.getComputedHeight(),c=r.style.borderColor,f=sht.default[r.style.borderStyle],p=oW.default(f.topLeft+f.horizontal.repeat(a-2)+f.topRight,c,\"foreground\"),h=(oW.default(f.vertical,c,\"foreground\")+`\n`).repeat(n-2),E=oW.default(f.bottomLeft+f.horizontal.repeat(a-2)+f.bottomRight,c,\"foreground\");s.write(t,e,p,{transformers:[]}),s.write(t,e+1,h,{transformers:[]}),s.write(t+a-1,e+1,h,{transformers:[]}),s.write(t,e+n-1,E,{transformers:[]})}}});var A1e=_(eD=>{\"use strict\";var Nm=eD&&eD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eD,\"__esModule\",{value:!0});var oht=Nm(Fm()),aht=Nm(J9()),lht=Nm(i1e()),cht=Nm(eW()),uht=Nm(s1e()),fht=Nm(rW()),Aht=Nm(u1e()),pht=(t,e)=>{var r;let s=(r=t.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(s){let a=s.getComputedLeft(),n=s.getComputedTop();e=`\n`.repeat(n)+lht.default(e,a)}return e},f1e=(t,e,r)=>{var s;let{offsetX:a=0,offsetY:n=0,transformers:c=[],skipStaticElements:f}=r;if(f&&t.internal_static)return;let{yogaNode:p}=t;if(p){if(p.getDisplay()===oht.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),C=c;if(typeof t.internal_transform==\"function\"&&(C=[t.internal_transform,...c]),t.nodeName===\"ink-text\"){let S=fht.default(t);if(S.length>0){let b=aht.default(S),I=uht.default(p);if(b>I){let T=(s=t.style.textWrap)!==null&&s!==void 0?s:\"wrap\";S=cht.default(S,I,T)}S=pht(t,S),e.write(h,E,S,{transformers:C})}return}if(t.nodeName===\"ink-box\"&&Aht.default(h,E,t,e),t.nodeName===\"ink-root\"||t.nodeName===\"ink-box\")for(let S of t.childNodes)f1e(S,e,{offsetX:h,offsetY:E,transformers:C,skipStaticElements:f})}};eD.default=f1e});var g1e=_(tD=>{\"use strict\";var h1e=tD&&tD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tD,\"__esModule\",{value:!0});var p1e=h1e(X9()),hht=h1e(GS()),aW=class{constructor(e){this.writes=[];let{width:r,height:s}=e;this.width=r,this.height=s}write(e,r,s,a){let{transformers:n}=a;s&&this.writes.push({x:e,y:r,text:s,transformers:n})}get(){let e=[];for(let s=0;s<this.height;s++)e.push(\" \".repeat(this.width));for(let s of this.writes){let{x:a,y:n,text:c,transformers:f}=s,p=c.split(`\n`),h=0;for(let E of p){let C=e[n+h];if(!C)continue;let S=hht.default(E);for(let b of f)E=b(E);e[n+h]=p1e.default(C,0,a)+E+p1e.default(C,a+S),h++}}return{output:e.map(s=>s.trimRight()).join(`\n`),height:e.length}}};tD.default=aW});var y1e=_(rD=>{\"use strict\";var lW=rD&&rD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rD,\"__esModule\",{value:!0});var ght=lW(Fm()),d1e=lW(A1e()),m1e=lW(g1e());rD.default=(t,e)=>{var r;if(t.yogaNode.setWidth(e),t.yogaNode){t.yogaNode.calculateLayout(void 0,void 0,ght.default.DIRECTION_LTR);let s=new m1e.default({width:t.yogaNode.getComputedWidth(),height:t.yogaNode.getComputedHeight()});d1e.default(t,s,{skipStaticElements:!0});let a;!((r=t.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new m1e.default({width:t.staticNode.yogaNode.getComputedWidth(),height:t.staticNode.yogaNode.getComputedHeight()}),d1e.default(t.staticNode,a,{skipStaticElements:!1}));let{output:n,height:c}=s.get();return{output:n,outputHeight:c,staticOutput:a?`${a.get().output}\n`:\"\"}}return{output:\"\",outputHeight:0,staticOutput:\"\"}}});var w1e=_((TKt,C1e)=>{\"use strict\";var E1e=Ie(\"stream\"),I1e=[\"assert\",\"count\",\"countReset\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"table\",\"time\",\"timeEnd\",\"timeLog\",\"trace\",\"warn\"],cW={},dht=t=>{let e=new E1e.PassThrough,r=new E1e.PassThrough;e.write=a=>t(\"stdout\",a),r.write=a=>t(\"stderr\",a);let s=new console.Console(e,r);for(let a of I1e)cW[a]=console[a],console[a]=s[a];return()=>{for(let a of I1e)console[a]=cW[a];cW={}}};C1e.exports=dht});var fW=_(uW=>{\"use strict\";Object.defineProperty(uW,\"__esModule\",{value:!0});uW.default=new WeakMap});var pW=_(AW=>{\"use strict\";Object.defineProperty(AW,\"__esModule\",{value:!0});var mht=hn(),B1e=mht.createContext({exit:()=>{}});B1e.displayName=\"InternalAppContext\";AW.default=B1e});var gW=_(hW=>{\"use strict\";Object.defineProperty(hW,\"__esModule\",{value:!0});var yht=hn(),v1e=yht.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});v1e.displayName=\"InternalStdinContext\";hW.default=v1e});var mW=_(dW=>{\"use strict\";Object.defineProperty(dW,\"__esModule\",{value:!0});var Eht=hn(),S1e=Eht.createContext({stdout:void 0,write:()=>{}});S1e.displayName=\"InternalStdoutContext\";dW.default=S1e});var EW=_(yW=>{\"use strict\";Object.defineProperty(yW,\"__esModule\",{value:!0});var Iht=hn(),D1e=Iht.createContext({stderr:void 0,write:()=>{}});D1e.displayName=\"InternalStderrContext\";yW.default=D1e});var UF=_(IW=>{\"use strict\";Object.defineProperty(IW,\"__esModule\",{value:!0});var Cht=hn(),P1e=Cht.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});P1e.displayName=\"InternalFocusContext\";IW.default=P1e});var x1e=_((_Kt,b1e)=>{\"use strict\";var wht=/[|\\\\{}()[\\]^$+*?.-]/g;b1e.exports=t=>{if(typeof t!=\"string\")throw new TypeError(\"Expected a string\");return t.replace(wht,\"\\\\$&\")}});var T1e=_((HKt,R1e)=>{\"use strict\";var Bht=x1e(),vht=typeof process==\"object\"&&process&&typeof process.cwd==\"function\"?process.cwd():\".\",Q1e=[].concat(Ie(\"module\").builtinModules,\"bootstrap_node\",\"node\").map(t=>new RegExp(`(?:\\\\((?:node:)?${t}(?:\\\\.js)?:\\\\d+:\\\\d+\\\\)$|^\\\\s*at (?:node:)?${t}(?:\\\\.js)?:\\\\d+:\\\\d+$)`));Q1e.push(/\\((?:node:)?internal\\/[^:]+:\\d+:\\d+\\)$/,/\\s*at (?:node:)?internal\\/[^:]+:\\d+:\\d+$/,/\\/\\.node-spawn-wrap-\\w+-\\w+\\/node:\\d+:\\d+\\)?$/);var CW=class t{constructor(e){e={ignoredPackages:[],...e},\"internals\"in e||(e.internals=t.nodeInternals()),\"cwd\"in e||(e.cwd=vht),this._cwd=e.cwd.replace(/\\\\/g,\"/\"),this._internals=[].concat(e.internals,Sht(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...Q1e]}clean(e,r=0){r=\" \".repeat(r),Array.isArray(e)||(e=e.split(`\n`)),!/^\\s*at /.test(e[0])&&/^\\s*at /.test(e[1])&&(e=e.slice(1));let s=!1,a=null,n=[];return e.forEach(c=>{if(c=c.replace(/\\\\/g,\"/\"),this._internals.some(p=>p.test(c)))return;let f=/^\\s*at /.test(c);s?c=c.trimEnd().replace(/^(\\s+)at /,\"$1\"):(c=c.trim(),f&&(c=c.slice(3))),c=c.replace(`${this._cwd}/`,\"\"),c&&(f?(a&&(n.push(a),a=null),n.push(c)):(s=!0,a=c))}),n.map(c=>`${r}${c}\n`).join(\"\")}captureString(e,r=this.captureString){typeof e==\"function\"&&(r=e,e=1/0);let{stackTraceLimit:s}=Error;e&&(Error.stackTraceLimit=e);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=s,this.clean(n)}capture(e,r=this.capture){typeof e==\"function\"&&(r=e,e=1/0);let{prepareStackTrace:s,stackTraceLimit:a}=Error;Error.prepareStackTrace=(f,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,r);let{stack:c}=n;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:a}),c}at(e=this.at){let[r]=this.capture(1,e);if(!r)return{};let s={line:r.getLineNumber(),column:r.getColumnNumber()};k1e(s,r.getFileName(),this._cwd),r.isConstructor()&&(s.constructor=!0),r.isEval()&&(s.evalOrigin=r.getEvalOrigin()),r.isNative()&&(s.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!==\"Object\"&&a!==\"[object Object]\"&&(s.type=a);let n=r.getFunctionName();n&&(s.function=n);let c=r.getMethodName();return c&&n!==c&&(s.method=c),s}parseLine(e){let r=e&&e.match(Dht);if(!r)return null;let s=r[1]===\"new\",a=r[2],n=r[3],c=r[4],f=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],C=r[9],S=r[10]===\"native\",b=r[11]===\")\",I,T={};if(E&&(T.line=Number(E)),C&&(T.column=Number(C)),b&&h){let N=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===\")\")N++;else if(h.charAt(U)===\"(\"&&h.charAt(U-1)===\" \"&&(N--,N===-1&&h.charAt(U-1)===\" \")){let W=h.slice(0,U-1);h=h.slice(U+1),a+=` (${W}`;break}}if(a){let N=a.match(Pht);N&&(a=N[1],I=N[2])}return k1e(T,h,this._cwd),s&&(T.constructor=!0),n&&(T.evalOrigin=n,T.evalLine=f,T.evalColumn=p,T.evalFile=c&&c.replace(/\\\\/g,\"/\")),S&&(T.native=!0),a&&(T.function=a),I&&a!==I&&(T.method=I),T}};function k1e(t,e,r){e&&(e=e.replace(/\\\\/g,\"/\"),e.startsWith(`${r}/`)&&(e=e.slice(r.length+1)),t.file=e)}function Sht(t){if(t.length===0)return[];let e=t.map(r=>Bht(r));return new RegExp(`[/\\\\\\\\]node_modules[/\\\\\\\\](?:${e.join(\"|\")})[/\\\\\\\\][^:]+:\\\\d+:\\\\d+`)}var Dht=new RegExp(\"^(?:\\\\s*at )?(?:(new) )?(?:(.*?) \\\\()?(?:eval at ([^ ]+) \\\\((.+?):(\\\\d+):(\\\\d+)\\\\), )?(?:(.+?):(\\\\d+):(\\\\d+)|(native))(\\\\)?)$\"),Pht=/^(.*?) \\[as (.*?)\\]$/;R1e.exports=CW});var N1e=_((jKt,F1e)=>{\"use strict\";F1e.exports=(t,e)=>t.replace(/^\\t+/gm,r=>\" \".repeat(r.length*(e||2)))});var L1e=_((GKt,O1e)=>{\"use strict\";var bht=N1e(),xht=(t,e)=>{let r=[],s=t-e,a=t+e;for(let n=s;n<=a;n++)r.push(n);return r};O1e.exports=(t,e,r)=>{if(typeof t!=\"string\")throw new TypeError(\"Source code is missing.\");if(!e||e<1)throw new TypeError(\"Line number must start from `1`.\");if(t=bht(t).split(/\\r?\\n/),!(e>t.length))return r={around:3,...r},xht(e,r.around).filter(s=>t[s-1]!==void 0).map(s=>({line:s,value:t[s-1]}))}});var _F=_(rf=>{\"use strict\";var kht=rf&&rf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Qht=rf&&rf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Rht=rf&&rf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&kht(e,t,r);return Qht(e,t),e},Tht=rf&&rf.__rest||function(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols==\"function\")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(r[s[a]]=t[s[a]]);return r};Object.defineProperty(rf,\"__esModule\",{value:!0});var M1e=Rht(hn()),wW=M1e.forwardRef((t,e)=>{var{children:r}=t,s=Tht(t,[\"children\"]);let a=Object.assign(Object.assign({},s),{marginLeft:s.marginLeft||s.marginX||s.margin||0,marginRight:s.marginRight||s.marginX||s.margin||0,marginTop:s.marginTop||s.marginY||s.margin||0,marginBottom:s.marginBottom||s.marginY||s.margin||0,paddingLeft:s.paddingLeft||s.paddingX||s.padding||0,paddingRight:s.paddingRight||s.paddingX||s.padding||0,paddingTop:s.paddingTop||s.paddingY||s.padding||0,paddingBottom:s.paddingBottom||s.paddingY||s.padding||0});return M1e.default.createElement(\"ink-box\",{ref:e,style:a},r)});wW.displayName=\"Box\";wW.defaultProps={flexDirection:\"row\",flexGrow:0,flexShrink:1};rf.default=wW});var SW=_(nD=>{\"use strict\";var BW=nD&&nD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nD,\"__esModule\",{value:!0});var Fht=BW(hn()),yw=BW(RE()),U1e=BW(sW()),vW=({color:t,backgroundColor:e,dimColor:r,bold:s,italic:a,underline:n,strikethrough:c,inverse:f,wrap:p,children:h})=>{if(h==null)return null;let E=C=>(r&&(C=yw.default.dim(C)),t&&(C=U1e.default(C,t,\"foreground\")),e&&(C=U1e.default(C,e,\"background\")),s&&(C=yw.default.bold(C)),a&&(C=yw.default.italic(C)),n&&(C=yw.default.underline(C)),c&&(C=yw.default.strikethrough(C)),f&&(C=yw.default.inverse(C)),C);return Fht.default.createElement(\"ink-text\",{style:{flexGrow:0,flexShrink:1,flexDirection:\"row\",textWrap:p},internal_transform:E},h)};vW.displayName=\"Text\";vW.defaultProps={dimColor:!1,bold:!1,italic:!1,underline:!1,strikethrough:!1,wrap:\"wrap\"};nD.default=vW});var G1e=_(nf=>{\"use strict\";var Nht=nf&&nf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Oht=nf&&nf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Lht=nf&&nf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&Nht(e,t,r);return Oht(e,t),e},iD=nf&&nf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nf,\"__esModule\",{value:!0});var _1e=Lht(Ie(\"fs\")),Qs=iD(hn()),H1e=iD(T1e()),Mht=iD(L1e()),$p=iD(_F()),AA=iD(SW()),j1e=new H1e.default({cwd:process.cwd(),internals:H1e.default.nodeInternals()}),Uht=({error:t})=>{let e=t.stack?t.stack.split(`\n`).slice(1):void 0,r=e?j1e.parseLine(e[0]):void 0,s,a=0;if(r?.file&&r?.line&&_1e.existsSync(r.file)){let n=_1e.readFileSync(r.file,\"utf8\");if(s=Mht.default(n,r.line),s)for(let{line:c}of s)a=Math.max(a,String(c).length)}return Qs.default.createElement($p.default,{flexDirection:\"column\",padding:1},Qs.default.createElement($p.default,null,Qs.default.createElement(AA.default,{backgroundColor:\"red\",color:\"white\"},\" \",\"ERROR\",\" \"),Qs.default.createElement(AA.default,null,\" \",t.message)),r&&Qs.default.createElement($p.default,{marginTop:1},Qs.default.createElement(AA.default,{dimColor:!0},r.file,\":\",r.line,\":\",r.column)),r&&s&&Qs.default.createElement($p.default,{marginTop:1,flexDirection:\"column\"},s.map(({line:n,value:c})=>Qs.default.createElement($p.default,{key:n},Qs.default.createElement($p.default,{width:a+1},Qs.default.createElement(AA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?\"red\":void 0,color:n===r.line?\"white\":void 0},String(n).padStart(a,\" \"),\":\")),Qs.default.createElement(AA.default,{key:n,backgroundColor:n===r.line?\"red\":void 0,color:n===r.line?\"white\":void 0},\" \"+c)))),t.stack&&Qs.default.createElement($p.default,{marginTop:1,flexDirection:\"column\"},t.stack.split(`\n`).slice(1).map(n=>{let c=j1e.parseLine(n);return c?Qs.default.createElement($p.default,{key:n},Qs.default.createElement(AA.default,{dimColor:!0},\"- \"),Qs.default.createElement(AA.default,{dimColor:!0,bold:!0},c.function),Qs.default.createElement(AA.default,{dimColor:!0,color:\"gray\"},\" \",\"(\",c.file,\":\",c.line,\":\",c.column,\")\")):Qs.default.createElement($p.default,{key:n},Qs.default.createElement(AA.default,{dimColor:!0},\"- \"),Qs.default.createElement(AA.default,{dimColor:!0,bold:!0},n))})))};nf.default=Uht});var W1e=_(sf=>{\"use strict\";var _ht=sf&&sf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Hht=sf&&sf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jht=sf&&sf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&_ht(e,t,r);return Hht(e,t),e},Lm=sf&&sf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sf,\"__esModule\",{value:!0});var Om=jht(hn()),q1e=Lm(P9()),Ght=Lm(pW()),qht=Lm(gW()),Wht=Lm(mW()),Yht=Lm(EW()),Vht=Lm(UF()),Jht=Lm(G1e()),Kht=\"\t\",zht=\"\\x1B[Z\",Zht=\"\\x1B\",HF=class extends Om.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding(\"utf8\"),e){this.rawModeEnabledCount===0&&(r.addListener(\"data\",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener(\"data\",this.handleInput),r.pause())},this.handleInput=e=>{e===\"\u0003\"&&this.props.exitOnCtrlC&&this.handleExit(),e===Zht&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===Kht&&this.focusNext(),e===zht&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focus=e=>{this.setState(r=>r.focusables.some(a=>a?.id===e)?{activeFocusId:e}:r)},this.focusNext=()=>{this.setState(e=>{var r;let s=(r=e.focusables[0])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findNextFocusable(e)||s}})},this.focusPrevious=()=>{this.setState(e=>{var r;let s=(r=e.focusables[e.focusables.length-1])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findPreviousFocusable(e)||s}})},this.addFocusable=(e,{autoFocus:r})=>{this.setState(s=>{let a=s.activeFocusId;return!a&&r&&(a=e),{activeFocusId:a,focusables:[...s.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.filter(s=>s.id!==e)}))},this.activateFocusable=e=>{this.setState(r=>({focusables:r.focusables.map(s=>s.id!==e?s:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.map(s=>s.id!==e?s:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{var r;let s=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=s+1;a<e.focusables.length;a++)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id},this.findPreviousFocusable=e=>{var r;let s=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=s-1;a>=0;a--)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return Om.default.createElement(Ght.default.Provider,{value:{exit:this.handleExit}},Om.default.createElement(qht.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},Om.default.createElement(Wht.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},Om.default.createElement(Yht.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},Om.default.createElement(Vht.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?Om.default.createElement(Jht.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){q1e.default.hide(this.props.stdout)}componentWillUnmount(){q1e.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}};sf.default=HF;HF.displayName=\"InternalApp\"});var J1e=_(of=>{\"use strict\";var Xht=of&&of.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),$ht=of&&of.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e0t=of&&of.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&Xht(e,t,r);return $ht(e,t),e},af=of&&of.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(of,\"__esModule\",{value:!0});var t0t=af(hn()),Y1e=_Ce(),r0t=af(rwe()),n0t=af(w9()),i0t=af(lwe()),s0t=af(uwe()),DW=af(r1e()),o0t=af(y1e()),a0t=af(D9()),l0t=af(w1e()),c0t=e0t(nW()),u0t=af(fW()),f0t=af(W1e()),Ew=process.env.CI===\"false\"?!1:i0t.default,V1e=()=>{},PW=class{constructor(e){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:s,staticOutput:a}=o0t.default(this.rootNode,this.options.stdout.columns||80),n=a&&a!==`\n`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(Ew){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),s>=this.options.stdout.rows){this.options.stdout.write(n0t.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},s0t.default(this),this.options=e,this.rootNode=c0t.createNode(\"ink-root\"),this.rootNode.onRender=e.debug?this.onRender:Y1e(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=r0t.default.create(e.stdout),this.throttledLog=e.debug?this.log:Y1e(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput=\"\",this.fullStaticOutput=\"\",this.container=DW.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=a0t.default(this.unmount,{alwaysLast:!1}),e.patchConsole&&this.patchConsole(),Ew||(e.stdout.on(\"resize\",this.onRender),this.unsubscribeResize=()=>{e.stdout.off(\"resize\",this.onRender)})}render(e){let r=t0t.default.createElement(f0t.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);DW.default.updateContainer(r,this.container,null,V1e)}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(Ew){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(Ew){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole==\"function\"&&this.restoreConsole(),typeof this.unsubscribeResize==\"function\"&&this.unsubscribeResize(),Ew?this.options.stdout.write(this.lastOutput+`\n`):this.options.debug||this.log.done(),this.isUnmounted=!0,DW.default.updateContainer(null,this.container,null,V1e),u0t.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,r)=>{this.resolveExitPromise=e,this.rejectExitPromise=r})),this.exitPromise}clear(){!Ew&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=l0t.default((e,r)=>{e===\"stdout\"&&this.writeToStdout(r),e===\"stderr\"&&(r.startsWith(\"The above error occurred\")||this.writeToStderr(r))}))}};of.default=PW});var z1e=_(sD=>{\"use strict\";var K1e=sD&&sD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sD,\"__esModule\",{value:!0});var A0t=K1e(J1e()),jF=K1e(fW()),p0t=Ie(\"stream\"),h0t=(t,e)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},g0t(e)),s=d0t(r.stdout,()=>new A0t.default(r));return s.render(t),{rerender:s.render,unmount:()=>s.unmount(),waitUntilExit:s.waitUntilExit,cleanup:()=>jF.default.delete(r.stdout),clear:s.clear}};sD.default=h0t;var g0t=(t={})=>t instanceof p0t.Stream?{stdout:t,stdin:process.stdin}:t,d0t=(t,e)=>{let r;return jF.default.has(t)?r=jF.default.get(t):(r=e(),jF.default.set(t,r)),r}});var X1e=_(eh=>{\"use strict\";var m0t=eh&&eh.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),y0t=eh&&eh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E0t=eh&&eh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.hasOwnProperty.call(t,r)&&m0t(e,t,r);return y0t(e,t),e};Object.defineProperty(eh,\"__esModule\",{value:!0});var oD=E0t(hn()),Z1e=t=>{let{items:e,children:r,style:s}=t,[a,n]=oD.useState(0),c=oD.useMemo(()=>e.slice(a),[e,a]);oD.useLayoutEffect(()=>{n(e.length)},[e.length]);let f=c.map((h,E)=>r(h,a+E)),p=oD.useMemo(()=>Object.assign({position:\"absolute\",flexDirection:\"column\"},s),[s]);return oD.default.createElement(\"ink-box\",{internal_static:!0,style:p},f)};Z1e.displayName=\"Static\";eh.default=Z1e});var e2e=_(aD=>{\"use strict\";var I0t=aD&&aD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aD,\"__esModule\",{value:!0});var C0t=I0t(hn()),$1e=({children:t,transform:e})=>t==null?null:C0t.default.createElement(\"ink-text\",{style:{flexGrow:0,flexShrink:1,flexDirection:\"row\"},internal_transform:e},t);$1e.displayName=\"Transform\";aD.default=$1e});var r2e=_(lD=>{\"use strict\";var w0t=lD&&lD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lD,\"__esModule\",{value:!0});var B0t=w0t(hn()),t2e=({count:t=1})=>B0t.default.createElement(\"ink-text\",null,`\n`.repeat(t));t2e.displayName=\"Newline\";lD.default=t2e});var s2e=_(cD=>{\"use strict\";var n2e=cD&&cD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cD,\"__esModule\",{value:!0});var v0t=n2e(hn()),S0t=n2e(_F()),i2e=()=>v0t.default.createElement(S0t.default,{flexGrow:1});i2e.displayName=\"Spacer\";cD.default=i2e});var GF=_(uD=>{\"use strict\";var D0t=uD&&uD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uD,\"__esModule\",{value:!0});var P0t=hn(),b0t=D0t(gW()),x0t=()=>P0t.useContext(b0t.default);uD.default=x0t});var a2e=_(fD=>{\"use strict\";var k0t=fD&&fD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fD,\"__esModule\",{value:!0});var o2e=hn(),Q0t=k0t(GF()),R0t=(t,e={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=Q0t.default();o2e.useEffect(()=>{if(e.isActive!==!1)return s(!0),()=>{s(!1)}},[e.isActive,s]),o2e.useEffect(()=>{if(e.isActive===!1)return;let n=c=>{let f=String(c),p={upArrow:f===\"\\x1B[A\",downArrow:f===\"\\x1B[B\",leftArrow:f===\"\\x1B[D\",rightArrow:f===\"\\x1B[C\",pageDown:f===\"\\x1B[6~\",pageUp:f===\"\\x1B[5~\",return:f===\"\\r\",escape:f===\"\\x1B\",ctrl:!1,shift:!1,tab:f===\"\t\"||f===\"\\x1B[Z\",backspace:f===\"\\b\",delete:f===\"\\x7F\"||f===\"\\x1B[3~\",meta:!1};f<=\"\u001a\"&&!p.return&&(f=String.fromCharCode(f.charCodeAt(0)+97-1),p.ctrl=!0),f.startsWith(\"\\x1B\")&&(f=f.slice(1),p.meta=!0);let h=f>=\"A\"&&f<=\"Z\",E=f>=\"\\u0410\"&&f<=\"\\u042F\";f.length===1&&(h||E)&&(p.shift=!0),p.tab&&f===\"[Z\"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(f=\"\"),(!(f===\"c\"&&p.ctrl)||!a)&&t(f,p)};return r?.on(\"data\",n),()=>{r?.off(\"data\",n)}},[e.isActive,r,a,t])};fD.default=R0t});var l2e=_(AD=>{\"use strict\";var T0t=AD&&AD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(AD,\"__esModule\",{value:!0});var F0t=hn(),N0t=T0t(pW()),O0t=()=>F0t.useContext(N0t.default);AD.default=O0t});var c2e=_(pD=>{\"use strict\";var L0t=pD&&pD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pD,\"__esModule\",{value:!0});var M0t=hn(),U0t=L0t(mW()),_0t=()=>M0t.useContext(U0t.default);pD.default=_0t});var u2e=_(hD=>{\"use strict\";var H0t=hD&&hD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hD,\"__esModule\",{value:!0});var j0t=hn(),G0t=H0t(EW()),q0t=()=>j0t.useContext(G0t.default);hD.default=q0t});var A2e=_(dD=>{\"use strict\";var f2e=dD&&dD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dD,\"__esModule\",{value:!0});var gD=hn(),W0t=f2e(UF()),Y0t=f2e(GF()),V0t=({isActive:t=!0,autoFocus:e=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=Y0t.default(),{activeId:n,add:c,remove:f,activate:p,deactivate:h,focus:E}=gD.useContext(W0t.default),C=gD.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return gD.useEffect(()=>(c(C,{autoFocus:e}),()=>{f(C)}),[C,e]),gD.useEffect(()=>{t?p(C):h(C)},[t,C]),gD.useEffect(()=>{if(!(!s||!t))return a(!0),()=>{a(!1)}},[t]),{isFocused:!!C&&n===C,focus:E}};dD.default=V0t});var p2e=_(mD=>{\"use strict\";var J0t=mD&&mD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mD,\"__esModule\",{value:!0});var K0t=hn(),z0t=J0t(UF()),Z0t=()=>{let t=K0t.useContext(z0t.default);return{enableFocus:t.enableFocus,disableFocus:t.disableFocus,focusNext:t.focusNext,focusPrevious:t.focusPrevious,focus:t.focus}};mD.default=Z0t});var h2e=_(bW=>{\"use strict\";Object.defineProperty(bW,\"__esModule\",{value:!0});bW.default=t=>{var e,r,s,a;return{width:(r=(e=t.yogaNode)===null||e===void 0?void 0:e.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(s=t.yogaNode)===null||s===void 0?void 0:s.getComputedHeight())!==null&&a!==void 0?a:0}}});var Wc=_(mo=>{\"use strict\";Object.defineProperty(mo,\"__esModule\",{value:!0});var X0t=z1e();Object.defineProperty(mo,\"render\",{enumerable:!0,get:function(){return X0t.default}});var $0t=_F();Object.defineProperty(mo,\"Box\",{enumerable:!0,get:function(){return $0t.default}});var egt=SW();Object.defineProperty(mo,\"Text\",{enumerable:!0,get:function(){return egt.default}});var tgt=X1e();Object.defineProperty(mo,\"Static\",{enumerable:!0,get:function(){return tgt.default}});var rgt=e2e();Object.defineProperty(mo,\"Transform\",{enumerable:!0,get:function(){return rgt.default}});var ngt=r2e();Object.defineProperty(mo,\"Newline\",{enumerable:!0,get:function(){return ngt.default}});var igt=s2e();Object.defineProperty(mo,\"Spacer\",{enumerable:!0,get:function(){return igt.default}});var sgt=a2e();Object.defineProperty(mo,\"useInput\",{enumerable:!0,get:function(){return sgt.default}});var ogt=l2e();Object.defineProperty(mo,\"useApp\",{enumerable:!0,get:function(){return ogt.default}});var agt=GF();Object.defineProperty(mo,\"useStdin\",{enumerable:!0,get:function(){return agt.default}});var lgt=c2e();Object.defineProperty(mo,\"useStdout\",{enumerable:!0,get:function(){return lgt.default}});var cgt=u2e();Object.defineProperty(mo,\"useStderr\",{enumerable:!0,get:function(){return cgt.default}});var ugt=A2e();Object.defineProperty(mo,\"useFocus\",{enumerable:!0,get:function(){return ugt.default}});var fgt=p2e();Object.defineProperty(mo,\"useFocusManager\",{enumerable:!0,get:function(){return fgt.default}});var Agt=h2e();Object.defineProperty(mo,\"measureElement\",{enumerable:!0,get:function(){return Agt.default}})});var kW={};Vt(kW,{Gem:()=>xW});var g2e,Mm,xW,qF=Ze(()=>{g2e=ut(Wc()),Mm=ut(hn()),xW=(0,Mm.memo)(({active:t})=>{let e=(0,Mm.useMemo)(()=>t?\"\\u25C9\":\"\\u25EF\",[t]),r=(0,Mm.useMemo)(()=>t?\"green\":\"yellow\",[t]);return Mm.default.createElement(g2e.Text,{color:r},e)})});var m2e={};Vt(m2e,{useKeypress:()=>Um});function Um({active:t},e,r){let{stdin:s}=(0,d2e.useStdin)(),a=(0,WF.useCallback)((n,c)=>e(n,c),r);(0,WF.useEffect)(()=>{if(!(!t||!s))return s.on(\"keypress\",a),()=>{s.off(\"keypress\",a)}},[t,a,s])}var d2e,WF,yD=Ze(()=>{d2e=ut(Wc()),WF=ut(hn())});var E2e={};Vt(E2e,{FocusRequest:()=>y2e,useFocusRequest:()=>QW});var y2e,QW,RW=Ze(()=>{yD();y2e=(r=>(r.BEFORE=\"before\",r.AFTER=\"after\",r))(y2e||{}),QW=function({active:t},e,r){Um({active:t},(s,a)=>{a.name===\"tab\"&&(a.shift?e(\"before\"):e(\"after\"))},r)}});var I2e={};Vt(I2e,{useListInput:()=>ED});var ED,YF=Ze(()=>{yD();ED=function(t,e,{active:r,minus:s,plus:a,set:n,loop:c=!0}){Um({active:r},(f,p)=>{let h=e.indexOf(t);switch(p.name){case s:{let E=h-1;if(c){n(e[(e.length+E)%e.length]);return}if(E<0)return;n(e[E])}break;case a:{let E=h+1;if(c){n(e[E%e.length]);return}if(E>=e.length)return;n(e[E])}break}},[e,t,a,n,c])}});var VF={};Vt(VF,{ScrollableItems:()=>pgt});var eg,dl,pgt,JF=Ze(()=>{eg=ut(Wc()),dl=ut(hn());RW();YF();pgt=({active:t=!0,children:e=[],radius:r=10,size:s=1,loop:a=!0,onFocusRequest:n,willReachEnd:c})=>{let f=N=>{if(N.key===null)throw new Error(\"Expected all children to have a key\");return N.key},p=dl.default.Children.map(e,N=>f(N)),h=p[0],[E,C]=(0,dl.useState)(h),S=p.indexOf(E);(0,dl.useEffect)(()=>{p.includes(E)||C(h)},[e]),(0,dl.useEffect)(()=>{c&&S>=p.length-2&&c()},[S]),QW({active:t&&!!n},N=>{n?.(N)},[n]),ED(E,p,{active:t,minus:\"up\",plus:\"down\",set:C,loop:a});let b=S-r,I=S+r;I>p.length&&(b-=I-p.length,I=p.length),b<0&&(I+=-b,b=0),I>=p.length&&(I=p.length-1);let T=[];for(let N=b;N<=I;++N){let U=p[N],W=t&&U===E;T.push(dl.default.createElement(eg.Box,{key:U,height:s},dl.default.createElement(eg.Box,{marginLeft:1,marginRight:1},dl.default.createElement(eg.Text,null,W?dl.default.createElement(eg.Text,{color:\"cyan\",bold:!0},\">\"):\" \")),dl.default.createElement(eg.Box,null,dl.default.cloneElement(e[N],{active:W}))))}return dl.default.createElement(eg.Box,{flexDirection:\"column\",width:\"100%\"},T)}});var C2e,th,w2e,TW,B2e,FW=Ze(()=>{C2e=ut(Wc()),th=ut(hn()),w2e=Ie(\"readline\"),TW=th.default.createContext(null),B2e=({children:t})=>{let{stdin:e,setRawMode:r}=(0,C2e.useStdin)();(0,th.useEffect)(()=>{r&&r(!0),e&&(0,w2e.emitKeypressEvents)(e)},[e,r]);let[s,a]=(0,th.useState)(new Map),n=(0,th.useMemo)(()=>({getAll:()=>s,get:c=>s.get(c),set:(c,f)=>a(new Map([...s,[c,f]]))}),[s,a]);return th.default.createElement(TW.Provider,{value:n,children:t})}});var NW={};Vt(NW,{useMinistore:()=>hgt});function hgt(t,e){let r=(0,KF.useContext)(TW);if(r===null)throw new Error(\"Expected this hook to run with a ministore context attached\");if(typeof t>\"u\")return r.getAll();let s=(0,KF.useCallback)(n=>{r.set(t,n)},[t,r.set]),a=r.get(t);return typeof a>\"u\"&&(a=e),[a,s]}var KF,OW=Ze(()=>{KF=ut(hn());FW()});var ZF={};Vt(ZF,{renderForm:()=>ggt});async function ggt(t,e,{stdin:r,stdout:s,stderr:a}){let n,c=p=>{let{exit:h}=(0,zF.useApp)();Um({active:!0},(E,C)=>{C.name===\"return\"&&(n=p,h())},[h,p])},{waitUntilExit:f}=(0,zF.render)(LW.default.createElement(B2e,null,LW.default.createElement(t,{...e,useSubmit:c})),{stdin:r,stdout:s,stderr:a});return await f(),n}var zF,LW,XF=Ze(()=>{zF=ut(Wc()),LW=ut(hn());FW();yD()});var P2e=_(ID=>{\"use strict\";Object.defineProperty(ID,\"__esModule\",{value:!0});ID.UncontrolledTextInput=void 0;var S2e=hn(),MW=hn(),v2e=Wc(),_m=RE(),D2e=({value:t,placeholder:e=\"\",focus:r=!0,mask:s,highlightPastedText:a=!1,showCursor:n=!0,onChange:c,onSubmit:f})=>{let[{cursorOffset:p,cursorWidth:h},E]=MW.useState({cursorOffset:(t||\"\").length,cursorWidth:0});MW.useEffect(()=>{E(T=>{if(!r||!n)return T;let N=t||\"\";return T.cursorOffset>N.length-1?{cursorOffset:N.length,cursorWidth:0}:T})},[t,r,n]);let C=a?h:0,S=s?s.repeat(t.length):t,b=S,I=e?_m.grey(e):void 0;if(n&&r){I=e.length>0?_m.inverse(e[0])+_m.grey(e.slice(1)):_m.inverse(\" \"),b=S.length>0?\"\":_m.inverse(\" \");let T=0;for(let N of S)T>=p-C&&T<=p?b+=_m.inverse(N):b+=N,T++;S.length>0&&p===S.length&&(b+=_m.inverse(\" \"))}return v2e.useInput((T,N)=>{if(N.upArrow||N.downArrow||N.ctrl&&T===\"c\"||N.tab||N.shift&&N.tab)return;if(N.return){f&&f(t);return}let U=p,W=t,ee=0;N.leftArrow?n&&U--:N.rightArrow?n&&U++:N.backspace||N.delete?p>0&&(W=t.slice(0,p-1)+t.slice(p,t.length),U--):(W=t.slice(0,p)+T+t.slice(p,t.length),U+=T.length,T.length>1&&(ee=T.length)),p<0&&(U=0),p>t.length&&(U=t.length),E({cursorOffset:U,cursorWidth:ee}),W!==t&&c(W)},{isActive:r}),S2e.createElement(v2e.Text,null,e?S.length>0?b:I:b)};ID.default=D2e;ID.UncontrolledTextInput=({initialValue:t=\"\",...e})=>{let[r,s]=MW.useState(t);return S2e.createElement(D2e,Object.assign({},e,{value:r,onChange:s}))}});var k2e={};Vt(k2e,{Pad:()=>UW});var b2e,x2e,UW,_W=Ze(()=>{b2e=ut(Wc()),x2e=ut(hn()),UW=({length:t,active:e})=>{if(t===0)return null;let r=t>1?` ${\"-\".repeat(t-1)}`:\" \";return x2e.default.createElement(b2e.Text,{dimColor:!e},r)}});var Q2e={};Vt(Q2e,{ItemOptions:()=>dgt});var wD,tg,dgt,R2e=Ze(()=>{wD=ut(Wc()),tg=ut(hn());YF();qF();_W();dgt=function({active:t,skewer:e,options:r,value:s,onChange:a,sizes:n=[]}){let c=r.filter(({label:p})=>!!p).map(({value:p})=>p),f=r.findIndex(p=>p.value===s&&p.label!=\"\");return ED(s,c,{active:t,minus:\"left\",plus:\"right\",set:a}),tg.default.createElement(tg.default.Fragment,null,r.map(({label:p},h)=>{let E=h===f,C=n[h]-1||0,S=p.replace(/[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\"\"),b=Math.max(0,C-S.length-2);return p?tg.default.createElement(wD.Box,{key:p,width:C,marginLeft:1},tg.default.createElement(wD.Text,{wrap:\"truncate\"},tg.default.createElement(xW,{active:E}),\" \",p),e?tg.default.createElement(UW,{active:t,length:b}):null):tg.default.createElement(wD.Box,{key:`spacer-${h}`,width:C,marginLeft:1})}))}});var V2e=_((VZt,Y2e)=>{var ZW;Y2e.exports=()=>(typeof ZW>\"u\"&&(ZW=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"W4midoC5qbXRudsGgPTx9WbM6x6QwRgOjLr/GOIPlSLC3nJB5jZ9BXGdN9O3ILjKOQ1VVTOTyhiagEtbABF0bvv+pwVzOEIoEiqpkHNjocGMCve9WzcMZ8HTjWoZHXZgeqrltMRK9CV0qqKBVSbFngqcVz1hqG33qAlDRWBKCZ3h0834GWPct19RBMPlufdGrzzRWx/82JdE0srV0tbGKoGA8P2lqz2e/9H7IGN3krKPubn4n7REcgyzbNu+FbxskhKddObaesTHADpuvV5AUCaF6TGDWYjeJw4X8RCfFja1N/q8JkQ5tLDsXqlWCNfrC2HLTilFcH79mvoY9VJiBbKs4wr0ATtvLze3BdrLpvbP52V0hcV1VwiGIUXX60spKzAkcgFNwNfkOT/9aX19G+VYKxbXisXzbCmdLTdA2DgNU9Jhs1n+7/MiHdIqIVVry5wGW/JINhs2RffMr/36y+x/fr7e3M/ah3vcZreIhGHLnGhIT4RiN7wQNyxGmIxKtZi2KhG1Bk1LnZVdLj+tQUnQx3Js1fd8LApAIWJu/Us61lYmDowvlj798qfV1682Q43MXoj4EjMbIufC3pAJjZggPVTdvQZcxcB2czSECfgBtlQt+28q4qsLfKcypvZD5Tg6DqBV4BhcLWwecH6t+XW8js2E9QjW+nACmkFuoFv8YE9IrvBEiffHg4OgiOObzW6zbYMpQXoj1UE+8eX7U3w/nY5rwu14ZZXArv6mL92zgwXHF4iuzZr2+mrc9k4OMWkBA94A+1FDrT8edv8PtpUd+fhedTUUAuxGQYl8k+VJNVEmWEYJ0vjxja3jYQ9S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gLg2yhcOmd2okFEJRFhxHlB745zamCUoNMk7xDv/4n8tzw3m2rC0r7Ja5VC1urV2IDrMA+xxV/Mh7szka/F/3Sdo4y8B4EHmR2YMtmYLdbGd7+qsbLAQh3ps2DxnqSrYI6phwAMcE1BK+FImTFDumzavuVRJqYR13k0AZa8V1G4uGhMwLkRkuf2A7NOqsL6YWAStKL3LlzG8e3TN7DPbuosUtESzM/slfbbqolZQ53jCSfJVLOUXxZHLI1evqWbarh3dgAAMTxfl4QmzHC5Wv143nnaxnbRPkZ1TtZQbxjVjqtwW0cpTYtfBv6Ofg4P3tiXu8fdP0PjMN44/4uxk/JHwfMPVlRm7GvaQnJ2Sc1/2tr5Vbvbr1ZQ3NBKt58GVNb9ARdHJiRO7FNSbXLrjDVom5n3vC7F4gWRw0lw1GCCgzZyhdqUs4Y6JAlrZeDfLu3q93xJqaAOpveFHPscps5oO0AORqQ2O3uwo2XXIEA5P/WYz1/rXxh7/y7WospS9bQA=\",\"base64\")).toString()),ZW)});var hBe=_((yXt,pBe)=>{var oY=Symbol(\"arg flag\"),Yc=class t extends Error{constructor(e,r){super(e),this.name=\"ArgError\",this.code=r,Object.setPrototypeOf(this,t.prototype)}};function UD(t,{argv:e=process.argv.slice(2),permissive:r=!1,stopAtPositional:s=!1}={}){if(!t)throw new Yc(\"argument specification object is required\",\"ARG_CONFIG_NO_SPEC\");let a={_:[]},n={},c={};for(let f of Object.keys(t)){if(!f)throw new Yc(\"argument key cannot be an empty string\",\"ARG_CONFIG_EMPTY_KEY\");if(f[0]!==\"-\")throw new Yc(`argument key must start with '-' but found: '${f}'`,\"ARG_CONFIG_NONOPT_KEY\");if(f.length===1)throw new Yc(`argument key must have a name; singular '-' keys are not allowed: ${f}`,\"ARG_CONFIG_NONAME_KEY\");if(typeof t[f]==\"string\"){n[f]=t[f];continue}let p=t[f],h=!1;if(Array.isArray(p)&&p.length===1&&typeof p[0]==\"function\"){let[E]=p;p=(C,S,b=[])=>(b.push(E(C,S,b[b.length-1])),b),h=E===Boolean||E[oY]===!0}else if(typeof p==\"function\")h=p===Boolean||p[oY]===!0;else throw new Yc(`type missing or not a function or valid array type: ${f}`,\"ARG_CONFIG_VAD_TYPE\");if(f[1]!==\"-\"&&f.length>2)throw new Yc(`short argument keys (with a single hyphen) must have only one character: ${f}`,\"ARG_CONFIG_SHORTOPT_TOOLONG\");c[f]=[p,h]}for(let f=0,p=e.length;f<p;f++){let h=e[f];if(s&&a._.length>0){a._=a._.concat(e.slice(f));break}if(h===\"--\"){a._=a._.concat(e.slice(f+1));break}if(h.length>1&&h[0]===\"-\"){let E=h[1]===\"-\"||h.length===2?[h]:h.slice(1).split(\"\").map(C=>`-${C}`);for(let C=0;C<E.length;C++){let S=E[C],[b,I]=S[1]===\"-\"?S.split(/=(.*)/,2):[S,void 0],T=b;for(;T in n;)T=n[T];if(!(T in c))if(r){a._.push(S);continue}else throw new Yc(`unknown or unexpected option: ${b}`,\"ARG_UNKNOWN_OPTION\");let[N,U]=c[T];if(!U&&C+1<E.length)throw new Yc(`option requires argument (but was followed by another short argument): ${b}`,\"ARG_MISSING_REQUIRED_SHORTARG\");if(U)a[T]=N(!0,T,a[T]);else if(I===void 0){if(e.length<f+2||e[f+1].length>1&&e[f+1][0]===\"-\"&&!(e[f+1].match(/^-?\\d*(\\.(?=\\d))?\\d*$/)&&(N===Number||typeof BigInt<\"u\"&&N===BigInt))){let W=b===T?\"\":` (alias for ${T})`;throw new Yc(`option requires argument: ${b}${W}`,\"ARG_MISSING_REQUIRED_LONGARG\")}a[T]=N(e[f+1],T,a[T]),++f}else a[T]=N(I,T,a[T])}}else a._.push(h)}return a}UD.flag=t=>(t[oY]=!0,t);UD.COUNT=UD.flag((t,e,r)=>(r||0)+1);UD.ArgError=Yc;pBe.exports=UD});var wBe=_((JXt,CBe)=>{var uY;CBe.exports=()=>(typeof uY>\"u\"&&(uY=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"W7YZIYpg4/ADhvxMjEQIGwcAGt8pgGWB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mO/E/fv65K911gFohqGSVGLnzgM71eBIw8LF2+BLqq+mPqi8ovIVdliBIwN+MDY4zKOxfyM4zPjWIdHsZM19d1SrB7nmiLRA8+AP2XBcFaAm6B/sJ2iJA8=\",\"base64\")).toString()),uY)});var PBe=_((dY,mY)=>{(function(t){dY&&typeof dY==\"object\"&&typeof mY<\"u\"?mY.exports=t():typeof define==\"function\"&&define.amd?define([],t):typeof window<\"u\"?window.isWindows=t():typeof global<\"u\"?global.isWindows=t():typeof self<\"u\"?self.isWindows=t():this.isWindows=t()})(function(){\"use strict\";return function(){return process&&(process.platform===\"win32\"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var QBe=_((Y$t,kBe)=>{\"use strict\";yY.ifExists=mdt;var Dw=Ie(\"util\"),Vc=Ie(\"path\"),bBe=PBe(),hdt=/^#!\\s*(?:\\/usr\\/bin\\/env)?\\s*([^ \\t]+)(.*)$/,gdt={createPwshFile:!0,createCmdFile:bBe(),fs:Ie(\"fs\")},ddt=new Map([[\".js\",\"node\"],[\".cjs\",\"node\"],[\".mjs\",\"node\"],[\".cmd\",\"cmd\"],[\".bat\",\"cmd\"],[\".ps1\",\"pwsh\"],[\".sh\",\"sh\"]]);function xBe(t){let e={...gdt,...t},r=e.fs;return e.fs_={chmod:r.chmod?Dw.promisify(r.chmod):async()=>{},mkdir:Dw.promisify(r.mkdir),readFile:Dw.promisify(r.readFile),stat:Dw.promisify(r.stat),unlink:Dw.promisify(r.unlink),writeFile:Dw.promisify(r.writeFile)},e}async function yY(t,e,r){let s=xBe(r);await s.fs_.stat(t),await Edt(t,e,s)}function mdt(t,e,r){return yY(t,e,r).catch(()=>{})}function ydt(t,e){return e.fs_.unlink(t).catch(()=>{})}async function Edt(t,e,r){let s=await vdt(t,r);return await Idt(e,r),Cdt(t,e,s,r)}function Idt(t,e){return e.fs_.mkdir(Vc.dirname(t),{recursive:!0})}function Cdt(t,e,r,s){let a=xBe(s),n=[{generator:Pdt,extension:\"\"}];return a.createCmdFile&&n.push({generator:Ddt,extension:\".cmd\"}),a.createPwshFile&&n.push({generator:bdt,extension:\".ps1\"}),Promise.all(n.map(c=>Sdt(t,e+c.extension,r,c.generator,a)))}function wdt(t,e){return ydt(t,e)}function Bdt(t,e){return xdt(t,e)}async function vdt(t,e){let a=(await e.fs_.readFile(t,\"utf8\")).trim().split(/\\r*\\n/)[0].match(hdt);if(!a){let n=Vc.extname(t).toLowerCase();return{program:ddt.get(n)||null,additionalArgs:\"\"}}return{program:a[1],additionalArgs:a[2]}}async function Sdt(t,e,r,s,a){let n=a.preserveSymlinks?\"--preserve-symlinks\":\"\",c=[r.additionalArgs,n].filter(f=>f).join(\" \");return a=Object.assign({},a,{prog:r.program,args:c}),await wdt(e,a),await a.fs_.writeFile(e,s(t,e,a),\"utf8\"),Bdt(e,a)}function Ddt(t,e,r){let a=Vc.relative(Vc.dirname(e),t).split(\"/\").join(\"\\\\\"),n=Vc.isAbsolute(a)?`\"${a}\"`:`\"%~dp0\\\\${a}\"`,c,f=r.prog,p=r.args||\"\",h=EY(r.nodePath).win32;f?(c=`\"%~dp0\\\\${f}.exe\"`,a=n):(f=n,p=\"\",a=\"\");let E=r.progArgs?`${r.progArgs.join(\" \")} `:\"\",C=h?`@SET NODE_PATH=${h}\\r\n`:\"\";return c?C+=`@IF EXIST ${c} (\\r\n  ${c} ${p} ${a} ${E}%*\\r\n) ELSE (\\r\n  @SETLOCAL\\r\n  @SET PATHEXT=%PATHEXT:;.JS;=;%\\r\n  ${f} ${p} ${a} ${E}%*\\r\n)\\r\n`:C+=`@${f} ${p} ${a} ${E}%*\\r\n`,C}function Pdt(t,e,r){let s=Vc.relative(Vc.dirname(e),t),a=r.prog&&r.prog.split(\"\\\\\").join(\"/\"),n;s=s.split(\"\\\\\").join(\"/\");let c=Vc.isAbsolute(s)?`\"${s}\"`:`\"$basedir/${s}\"`,f=r.args||\"\",p=EY(r.nodePath).posix;a?(n=`\"$basedir/${r.prog}\"`,s=c):(a=c,f=\"\",s=\"\");let h=r.progArgs?`${r.progArgs.join(\" \")} `:\"\",E=`#!/bin/sh\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\\\\\,/,g')\")\n\ncase \\`uname\\` in\n    *CYGWIN*) basedir=\\`cygpath -w \"$basedir\"\\`;;\nesac\n\n`,C=r.nodePath?`export NODE_PATH=\"${p}\"\n`:\"\";return n?E+=`${C}if [ -x ${n} ]; then\n  exec ${n} ${f} ${s} ${h}\"$@\"\nelse\n  exec ${a} ${f} ${s} ${h}\"$@\"\nfi\n`:E+=`${C}${a} ${f} ${s} ${h}\"$@\"\nexit $?\n`,E}function bdt(t,e,r){let s=Vc.relative(Vc.dirname(e),t),a=r.prog&&r.prog.split(\"\\\\\").join(\"/\"),n=a&&`\"${a}$exe\"`,c;s=s.split(\"\\\\\").join(\"/\");let f=Vc.isAbsolute(s)?`\"${s}\"`:`\"$basedir/${s}\"`,p=r.args||\"\",h=EY(r.nodePath),E=h.win32,C=h.posix;n?(c=`\"$basedir/${r.prog}$exe\"`,s=f):(n=f,p=\"\",s=\"\");let S=r.progArgs?`${r.progArgs.join(\" \")} `:\"\",b=`#!/usr/bin/env pwsh\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n\n$exe=\"\"\n${r.nodePath?`$env_node_path=$env:NODE_PATH\n$env:NODE_PATH=\"${E}\"\n`:\"\"}if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n  # Fix case when both the Windows and Linux builds of Node\n  # are installed in the same directory\n  $exe=\".exe\"\n}`;return r.nodePath&&(b+=` else {\n  $env:NODE_PATH=\"${C}\"\n}`),c?b+=`\n$ret=0\nif (Test-Path ${c}) {\n  # Support pipeline input\n  if ($MyInvocation.ExpectingInput) {\n    $input | & ${c} ${p} ${s} ${S}$args\n  } else {\n    & ${c} ${p} ${s} ${S}$args\n  }\n  $ret=$LASTEXITCODE\n} else {\n  # Support pipeline input\n  if ($MyInvocation.ExpectingInput) {\n    $input | & ${n} ${p} ${s} ${S}$args\n  } else {\n    & ${n} ${p} ${s} ${S}$args\n  }\n  $ret=$LASTEXITCODE\n}\n${r.nodePath?`$env:NODE_PATH=$env_node_path\n`:\"\"}exit $ret\n`:b+=`\n# Support pipeline input\nif ($MyInvocation.ExpectingInput) {\n  $input | & ${n} ${p} ${s} ${S}$args\n} else {\n  & ${n} ${p} ${s} ${S}$args\n}\n${r.nodePath?`$env:NODE_PATH=$env_node_path\n`:\"\"}exit $LASTEXITCODE\n`,b}function xdt(t,e){return e.fs_.chmod(t,493)}function EY(t){if(!t)return{win32:\"\",posix:\"\"};let e=typeof t==\"string\"?t.split(Vc.delimiter):Array.from(t),r={};for(let s=0;s<e.length;s++){let a=e[s].split(\"/\").join(\"\\\\\"),n=bBe()?e[s].split(\"\\\\\").join(\"/\").replace(/^([^:\\\\/]*):/,(c,f)=>`/mnt/${f.toLowerCase()}`):e[s];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[s]={win32:a,posix:n}}return r}kBe.exports=yY});var TY=_((Ctr,zBe)=>{zBe.exports=Ie(\"stream\")});var eve=_((wtr,$Be)=>{\"use strict\";function ZBe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,s)}return r}function cmt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZBe(Object(r),!0).forEach(function(s){umt(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZBe(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function umt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fmt(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function XBe(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,\"value\"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function Amt(t,e,r){return e&&XBe(t.prototype,e),r&&XBe(t,r),t}var pmt=Ie(\"buffer\"),AN=pmt.Buffer,hmt=Ie(\"util\"),FY=hmt.inspect,gmt=FY&&FY.custom||\"inspect\";function dmt(t,e,r){AN.prototype.copy.call(t,e,r)}$Be.exports=function(){function t(){fmt(this,t),this.head=null,this.tail=null,this.length=0}return Amt(t,[{key:\"push\",value:function(r){var s={data:r,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:\"unshift\",value:function(r){var s={data:r,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}},{key:\"shift\",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:\"clear\",value:function(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function(r){if(this.length===0)return\"\";for(var s=this.head,a=\"\"+s.data;s=s.next;)a+=r+s.data;return a}},{key:\"concat\",value:function(r){if(this.length===0)return AN.alloc(0);for(var s=AN.allocUnsafe(r>>>0),a=this.head,n=0;a;)dmt(a.data,s,n),n+=a.data.length,a=a.next;return s}},{key:\"consume\",value:function(r,s){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=s?this._getString(r):this._getBuffer(r),a}},{key:\"first\",value:function(){return this.head.data}},{key:\"_getString\",value:function(r){var s=this.head,a=1,n=s.data;for(r-=n.length;s=s.next;){var c=s.data,f=r>c.length?c.length:r;if(f===c.length?n+=c:n+=c.slice(0,r),r-=f,r===0){f===c.length?(++a,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=c.slice(f));break}++a}return this.length-=a,n}},{key:\"_getBuffer\",value:function(r){var s=AN.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(s),r-=a.data.length;a=a.next;){var c=a.data,f=r>c.length?c.length:r;if(c.copy(s,s.length-r,0,f),r-=f,r===0){f===c.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=c.slice(f));break}++n}return this.length-=n,s}},{key:gmt,value:function(r,s){return FY(this,cmt({},s,{depth:0,customInspect:!1}))}}]),t}()});var OY=_((Btr,rve)=>{\"use strict\";function mmt(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(NY,this,t)):process.nextTick(NY,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(n){!e&&n?r._writableState?r._writableState.errorEmitted?process.nextTick(pN,r):(r._writableState.errorEmitted=!0,process.nextTick(tve,r,n)):process.nextTick(tve,r,n):e?(process.nextTick(pN,r),e(n)):process.nextTick(pN,r)}),this)}function tve(t,e){NY(t,e),pN(t)}function pN(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit(\"close\")}function ymt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function NY(t,e){t.emit(\"error\",e)}function Emt(t,e){var r=t._readableState,s=t._writableState;r&&r.autoDestroy||s&&s.autoDestroy?t.destroy(e):t.emit(\"error\",e)}rve.exports={destroy:mmt,undestroy:ymt,errorOrDestroy:Emt}});var lg=_((vtr,sve)=>{\"use strict\";var ive={};function Kc(t,e,r){r||(r=Error);function s(n,c,f){return typeof e==\"string\"?e:e(n,c,f)}class a extends r{constructor(c,f,p){super(s(c,f,p))}}a.prototype.name=r.name,a.prototype.code=t,ive[t]=a}function nve(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(s=>String(s)),r>2?`one of ${e} ${t.slice(0,r-1).join(\", \")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function Imt(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Cmt(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function wmt(t,e,r){return typeof r!=\"number\"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Kc(\"ERR_INVALID_OPT_VALUE\",function(t,e){return'The value \"'+e+'\" is invalid for option \"'+t+'\"'},TypeError);Kc(\"ERR_INVALID_ARG_TYPE\",function(t,e,r){let s;typeof e==\"string\"&&Imt(e,\"not \")?(s=\"must not be\",e=e.replace(/^not /,\"\")):s=\"must be\";let a;if(Cmt(t,\" argument\"))a=`The ${t} ${s} ${nve(e,\"type\")}`;else{let n=wmt(t,\".\")?\"property\":\"argument\";a=`The \"${t}\" ${n} ${s} ${nve(e,\"type\")}`}return a+=`. Received type ${typeof r}`,a},TypeError);Kc(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\");Kc(\"ERR_METHOD_NOT_IMPLEMENTED\",function(t){return\"The \"+t+\" method is not implemented\"});Kc(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\");Kc(\"ERR_STREAM_DESTROYED\",function(t){return\"Cannot call \"+t+\" after a stream was destroyed\"});Kc(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\");Kc(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\");Kc(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\");Kc(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError);Kc(\"ERR_UNKNOWN_ENCODING\",function(t){return\"Unknown encoding: \"+t},TypeError);Kc(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\");sve.exports.codes=ive});var LY=_((Str,ove)=>{\"use strict\";var Bmt=lg().codes.ERR_INVALID_OPT_VALUE;function vmt(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Smt(t,e,r,s){var a=vmt(e,s,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var n=s?r:\"highWaterMark\";throw new Bmt(n,a)}return Math.floor(a)}return t.objectMode?16:16*1024}ove.exports={getHighWaterMark:Smt}});var ave=_((Dtr,MY)=>{typeof Object.create==\"function\"?MY.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:MY.exports=function(e,r){if(r){e.super_=r;var s=function(){};s.prototype=r.prototype,e.prototype=new s,e.prototype.constructor=e}}});var cg=_((Ptr,_Y)=>{try{if(UY=Ie(\"util\"),typeof UY.inherits!=\"function\")throw\"\";_Y.exports=UY.inherits}catch{_Y.exports=ave()}var UY});var cve=_((btr,lve)=>{lve.exports=Ie(\"util\").deprecate});var GY=_((xtr,gve)=>{\"use strict\";gve.exports=Yi;function fve(t){var e=this;this.next=null,this.entry=null,this.finish=function(){Xmt(e,t)}}var Rw;Yi.WritableState=XD;var Dmt={deprecate:cve()},Ave=TY(),gN=Ie(\"buffer\").Buffer,Pmt=global.Uint8Array||function(){};function bmt(t){return gN.from(t)}function xmt(t){return gN.isBuffer(t)||t instanceof Pmt}var jY=OY(),kmt=LY(),Qmt=kmt.getHighWaterMark,ug=lg().codes,Rmt=ug.ERR_INVALID_ARG_TYPE,Tmt=ug.ERR_METHOD_NOT_IMPLEMENTED,Fmt=ug.ERR_MULTIPLE_CALLBACK,Nmt=ug.ERR_STREAM_CANNOT_PIPE,Omt=ug.ERR_STREAM_DESTROYED,Lmt=ug.ERR_STREAM_NULL_VALUES,Mmt=ug.ERR_STREAM_WRITE_AFTER_END,Umt=ug.ERR_UNKNOWN_ENCODING,Tw=jY.errorOrDestroy;cg()(Yi,Ave);function _mt(){}function XD(t,e,r){Rw=Rw||Ym(),t=t||{},typeof r!=\"boolean\"&&(r=e instanceof Rw),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Qmt(this,t,\"writableHighWaterMark\",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=t.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){Vmt(e,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new fve(this)}XD.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(XD.prototype,\"buffer\",{get:Dmt.deprecate(function(){return this.getBuffer()},\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch{}})();var hN;typeof Symbol==\"function\"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==\"function\"?(hN=Function.prototype[Symbol.hasInstance],Object.defineProperty(Yi,Symbol.hasInstance,{value:function(e){return hN.call(this,e)?!0:this!==Yi?!1:e&&e._writableState instanceof XD}})):hN=function(e){return e instanceof this};function Yi(t){Rw=Rw||Ym();var e=this instanceof Rw;if(!e&&!hN.call(Yi,this))return new Yi(t);this._writableState=new XD(t,this,e),this.writable=!0,t&&(typeof t.write==\"function\"&&(this._write=t.write),typeof t.writev==\"function\"&&(this._writev=t.writev),typeof t.destroy==\"function\"&&(this._destroy=t.destroy),typeof t.final==\"function\"&&(this._final=t.final)),Ave.call(this)}Yi.prototype.pipe=function(){Tw(this,new Nmt)};function Hmt(t,e){var r=new Mmt;Tw(t,r),process.nextTick(e,r)}function jmt(t,e,r,s){var a;return r===null?a=new Lmt:typeof r!=\"string\"&&!e.objectMode&&(a=new Rmt(\"chunk\",[\"string\",\"Buffer\"],r)),a?(Tw(t,a),process.nextTick(s,a),!1):!0}Yi.prototype.write=function(t,e,r){var s=this._writableState,a=!1,n=!s.objectMode&&xmt(t);return n&&!gN.isBuffer(t)&&(t=bmt(t)),typeof e==\"function\"&&(r=e,e=null),n?e=\"buffer\":e||(e=s.defaultEncoding),typeof r!=\"function\"&&(r=_mt),s.ending?Hmt(this,r):(n||jmt(this,s,t,r))&&(s.pendingcb++,a=qmt(this,s,n,t,e,r)),a};Yi.prototype.cork=function(){this._writableState.corked++};Yi.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&pve(this,t))};Yi.prototype.setDefaultEncoding=function(e){if(typeof e==\"string\"&&(e=e.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((e+\"\").toLowerCase())>-1))throw new Umt(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Yi.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Gmt(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e==\"string\"&&(e=gN.from(e,r)),e}Object.defineProperty(Yi.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function qmt(t,e,r,s,a,n){if(!r){var c=Gmt(e,s,a);s!==c&&(r=!0,a=\"buffer\",s=c)}var f=e.objectMode?1:s.length;e.length+=f;var p=e.length<e.highWaterMark;if(p||(e.needDrain=!0),e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:s,encoding:a,isBuf:r,callback:n,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else HY(t,e,!1,f,s,a,n);return p}function HY(t,e,r,s,a,n,c){e.writelen=s,e.writecb=c,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Omt(\"write\")):r?t._writev(a,e.onwrite):t._write(a,n,e.onwrite),e.sync=!1}function Wmt(t,e,r,s,a){--e.pendingcb,r?(process.nextTick(a,s),process.nextTick(ZD,t,e),t._writableState.errorEmitted=!0,Tw(t,s)):(a(s),t._writableState.errorEmitted=!0,Tw(t,s),ZD(t,e))}function Ymt(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function Vmt(t,e){var r=t._writableState,s=r.sync,a=r.writecb;if(typeof a!=\"function\")throw new Fmt;if(Ymt(r),e)Wmt(t,r,s,e,a);else{var n=hve(r)||t.destroyed;!n&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&pve(t,r),s?process.nextTick(uve,t,r,n,a):uve(t,r,n,a)}}function uve(t,e,r,s){r||Jmt(t,e),e.pendingcb--,s(),ZD(t,e)}function Jmt(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit(\"drain\"))}function pve(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var s=e.bufferedRequestCount,a=new Array(s),n=e.corkedRequestsFree;n.entry=r;for(var c=0,f=!0;r;)a[c]=r,r.isBuf||(f=!1),r=r.next,c+=1;a.allBuffers=f,HY(t,e,!0,e.length,a,\"\",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new fve(e),e.bufferedRequestCount=0}else{for(;r;){var p=r.chunk,h=r.encoding,E=r.callback,C=e.objectMode?1:p.length;if(HY(t,e,!1,C,p,h,E),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Yi.prototype._write=function(t,e,r){r(new Tmt(\"_write()\"))};Yi.prototype._writev=null;Yi.prototype.end=function(t,e,r){var s=this._writableState;return typeof t==\"function\"?(r=t,t=null,e=null):typeof e==\"function\"&&(r=e,e=null),t!=null&&this.write(t,e),s.corked&&(s.corked=1,this.uncork()),s.ending||Zmt(this,s,r),this};Object.defineProperty(Yi.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}});function hve(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function Kmt(t,e){t._final(function(r){e.pendingcb--,r&&Tw(t,r),e.prefinished=!0,t.emit(\"prefinish\"),ZD(t,e)})}function zmt(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final==\"function\"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(Kmt,t,e)):(e.prefinished=!0,t.emit(\"prefinish\")))}function ZD(t,e){var r=hve(e);if(r&&(zmt(t,e),e.pendingcb===0&&(e.finished=!0,t.emit(\"finish\"),e.autoDestroy))){var s=t._readableState;(!s||s.autoDestroy&&s.endEmitted)&&t.destroy()}return r}function Zmt(t,e,r){e.ending=!0,ZD(t,e),r&&(e.finished?process.nextTick(r):t.once(\"finish\",r)),e.ended=!0,t.writable=!1}function Xmt(t,e,r){var s=t.entry;for(t.entry=null;s;){var a=s.callback;e.pendingcb--,a(r),s=s.next}e.corkedRequestsFree.next=t}Object.defineProperty(Yi.prototype,\"destroyed\",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Yi.prototype.destroy=jY.destroy;Yi.prototype._undestroy=jY.undestroy;Yi.prototype._destroy=function(t,e){e(t)}});var Ym=_((ktr,mve)=>{\"use strict\";var $mt=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};mve.exports=dA;var dve=YY(),WY=GY();cg()(dA,dve);for(qY=$mt(WY.prototype),dN=0;dN<qY.length;dN++)mN=qY[dN],dA.prototype[mN]||(dA.prototype[mN]=WY.prototype[mN]);var qY,mN,dN;function dA(t){if(!(this instanceof dA))return new dA(t);dve.call(this,t),WY.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once(\"end\",eyt)))}Object.defineProperty(dA.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(dA.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(dA.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}});function eyt(){this._writableState.ended||process.nextTick(tyt,this)}function tyt(t){t.end()}Object.defineProperty(dA.prototype,\"destroyed\",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Ive=_((VY,Eve)=>{var yN=Ie(\"buffer\"),ah=yN.Buffer;function yve(t,e){for(var r in t)e[r]=t[r]}ah.from&&ah.alloc&&ah.allocUnsafe&&ah.allocUnsafeSlow?Eve.exports=yN:(yve(yN,VY),VY.Buffer=Fw);function Fw(t,e,r){return ah(t,e,r)}yve(ah,Fw);Fw.from=function(t,e,r){if(typeof t==\"number\")throw new TypeError(\"Argument must not be a number\");return ah(t,e,r)};Fw.alloc=function(t,e,r){if(typeof t!=\"number\")throw new TypeError(\"Argument must be a number\");var s=ah(t);return e!==void 0?typeof r==\"string\"?s.fill(e,r):s.fill(e):s.fill(0),s};Fw.allocUnsafe=function(t){if(typeof t!=\"number\")throw new TypeError(\"Argument must be a number\");return ah(t)};Fw.allocUnsafeSlow=function(t){if(typeof t!=\"number\")throw new TypeError(\"Argument must be a number\");return yN.SlowBuffer(t)}});var zY=_(wve=>{\"use strict\";var KY=Ive().Buffer,Cve=KY.isEncoding||function(t){switch(t=\"\"+t,t&&t.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function ryt(t){if(!t)return\"utf8\";for(var e;;)switch(t){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return t;default:if(e)return;t=(\"\"+t).toLowerCase(),e=!0}}function nyt(t){var e=ryt(t);if(typeof e!=\"string\"&&(KY.isEncoding===Cve||!Cve(t)))throw new Error(\"Unknown encoding: \"+t);return e||t}wve.StringDecoder=$D;function $D(t){this.encoding=nyt(t);var e;switch(this.encoding){case\"utf16le\":this.text=cyt,this.end=uyt,e=4;break;case\"utf8\":this.fillLast=oyt,e=4;break;case\"base64\":this.text=fyt,this.end=Ayt,e=3;break;default:this.write=pyt,this.end=hyt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=KY.allocUnsafe(e)}$D.prototype.write=function(t){if(t.length===0)return\"\";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||\"\"};$D.prototype.end=lyt;$D.prototype.text=ayt;$D.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function JY(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function iyt(t,e,r){var s=e.length-1;if(s<r)return 0;var a=JY(e[s]);return a>=0?(a>0&&(t.lastNeed=a-1),a):--s<r||a===-2?0:(a=JY(e[s]),a>=0?(a>0&&(t.lastNeed=a-2),a):--s<r||a===-2?0:(a=JY(e[s]),a>=0?(a>0&&(a===2?a=0:t.lastNeed=a-3),a):0))}function syt(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,\"\\uFFFD\";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,\"\\uFFFD\";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,\"\\uFFFD\"}}function oyt(t){var e=this.lastTotal-this.lastNeed,r=syt(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function ayt(t,e){var r=iyt(this,t,e);if(!this.lastNeed)return t.toString(\"utf8\",e);this.lastTotal=r;var s=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,s),t.toString(\"utf8\",e,s)}function lyt(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+\"\\uFFFD\":e}function cyt(t,e){if((t.length-e)%2===0){var r=t.toString(\"utf16le\",e);if(r){var s=r.charCodeAt(r.length-1);if(s>=55296&&s<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString(\"utf16le\",e,t.length-1)}function uyt(t){var e=t&&t.length?this.write(t):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString(\"utf16le\",0,r)}return e}function fyt(t,e){var r=(t.length-e)%3;return r===0?t.toString(\"base64\",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString(\"base64\",e,t.length-r))}function Ayt(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+this.lastChar.toString(\"base64\",0,3-this.lastNeed):e}function pyt(t){return t.toString(this.encoding)}function hyt(t){return t&&t.length?this.write(t):\"\"}});var EN=_((Rtr,Sve)=>{\"use strict\";var Bve=lg().codes.ERR_STREAM_PREMATURE_CLOSE;function gyt(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];t.apply(this,s)}}}function dyt(){}function myt(t){return t.setHeader&&typeof t.abort==\"function\"}function vve(t,e,r){if(typeof e==\"function\")return vve(t,null,e);e||(e={}),r=gyt(r||dyt);var s=e.readable||e.readable!==!1&&t.readable,a=e.writable||e.writable!==!1&&t.writable,n=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){a=!1,c=!0,s||r.call(t)},p=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,p=!0,a||r.call(t)},E=function(I){r.call(t,I)},C=function(){var I;if(s&&!p)return(!t._readableState||!t._readableState.ended)&&(I=new Bve),r.call(t,I);if(a&&!c)return(!t._writableState||!t._writableState.ended)&&(I=new Bve),r.call(t,I)},S=function(){t.req.on(\"finish\",f)};return myt(t)?(t.on(\"complete\",f),t.on(\"abort\",C),t.req?S():t.on(\"request\",S)):a&&!t._writableState&&(t.on(\"end\",n),t.on(\"close\",n)),t.on(\"end\",h),t.on(\"finish\",f),e.error!==!1&&t.on(\"error\",E),t.on(\"close\",C),function(){t.removeListener(\"complete\",f),t.removeListener(\"abort\",C),t.removeListener(\"request\",S),t.req&&t.req.removeListener(\"finish\",f),t.removeListener(\"end\",n),t.removeListener(\"close\",n),t.removeListener(\"finish\",f),t.removeListener(\"end\",h),t.removeListener(\"error\",E),t.removeListener(\"close\",C)}}Sve.exports=vve});var Pve=_((Ttr,Dve)=>{\"use strict\";var IN;function fg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var yyt=EN(),Ag=Symbol(\"lastResolve\"),Vm=Symbol(\"lastReject\"),eP=Symbol(\"error\"),CN=Symbol(\"ended\"),Jm=Symbol(\"lastPromise\"),ZY=Symbol(\"handlePromise\"),Km=Symbol(\"stream\");function pg(t,e){return{value:t,done:e}}function Eyt(t){var e=t[Ag];if(e!==null){var r=t[Km].read();r!==null&&(t[Jm]=null,t[Ag]=null,t[Vm]=null,e(pg(r,!1)))}}function Iyt(t){process.nextTick(Eyt,t)}function Cyt(t,e){return function(r,s){t.then(function(){if(e[CN]){r(pg(void 0,!0));return}e[ZY](r,s)},s)}}var wyt=Object.getPrototypeOf(function(){}),Byt=Object.setPrototypeOf((IN={get stream(){return this[Km]},next:function(){var e=this,r=this[eP];if(r!==null)return Promise.reject(r);if(this[CN])return Promise.resolve(pg(void 0,!0));if(this[Km].destroyed)return new Promise(function(c,f){process.nextTick(function(){e[eP]?f(e[eP]):c(pg(void 0,!0))})});var s=this[Jm],a;if(s)a=new Promise(Cyt(s,this));else{var n=this[Km].read();if(n!==null)return Promise.resolve(pg(n,!1));a=new Promise(this[ZY])}return this[Jm]=a,a}},fg(IN,Symbol.asyncIterator,function(){return this}),fg(IN,\"return\",function(){var e=this;return new Promise(function(r,s){e[Km].destroy(null,function(a){if(a){s(a);return}r(pg(void 0,!0))})})}),IN),wyt),vyt=function(e){var r,s=Object.create(Byt,(r={},fg(r,Km,{value:e,writable:!0}),fg(r,Ag,{value:null,writable:!0}),fg(r,Vm,{value:null,writable:!0}),fg(r,eP,{value:null,writable:!0}),fg(r,CN,{value:e._readableState.endEmitted,writable:!0}),fg(r,ZY,{value:function(n,c){var f=s[Km].read();f?(s[Jm]=null,s[Ag]=null,s[Vm]=null,n(pg(f,!1))):(s[Ag]=n,s[Vm]=c)},writable:!0}),r));return s[Jm]=null,yyt(e,function(a){if(a&&a.code!==\"ERR_STREAM_PREMATURE_CLOSE\"){var n=s[Vm];n!==null&&(s[Jm]=null,s[Ag]=null,s[Vm]=null,n(a)),s[eP]=a;return}var c=s[Ag];c!==null&&(s[Jm]=null,s[Ag]=null,s[Vm]=null,c(pg(void 0,!0))),s[CN]=!0}),e.on(\"readable\",Iyt.bind(null,s)),s};Dve.exports=vyt});var Qve=_((Ftr,kve)=>{\"use strict\";function bve(t,e,r,s,a,n,c){try{var f=t[n](c),p=f.value}catch(h){r(h);return}f.done?e(p):Promise.resolve(p).then(s,a)}function Syt(t){return function(){var e=this,r=arguments;return new Promise(function(s,a){var n=t.apply(e,r);function c(p){bve(n,s,a,c,f,\"next\",p)}function f(p){bve(n,s,a,c,f,\"throw\",p)}c(void 0)})}}function xve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,s)}return r}function Dyt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xve(Object(r),!0).forEach(function(s){Pyt(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xve(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function Pyt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var byt=lg().codes.ERR_INVALID_ARG_TYPE;function xyt(t,e,r){var s;if(e&&typeof e.next==\"function\")s=e;else if(e&&e[Symbol.asyncIterator])s=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])s=e[Symbol.iterator]();else throw new byt(\"iterable\",[\"Iterable\"],e);var a=new t(Dyt({objectMode:!0},r)),n=!1;a._read=function(){n||(n=!0,c())};function c(){return f.apply(this,arguments)}function f(){return f=Syt(function*(){try{var p=yield s.next(),h=p.value,E=p.done;E?a.push(null):a.push(yield h)?c():n=!1}catch(C){a.destroy(C)}}),f.apply(this,arguments)}return a}kve.exports=xyt});var YY=_((Otr,Hve)=>{\"use strict\";Hve.exports=bn;var Nw;bn.ReadableState=Nve;var Ntr=Ie(\"events\").EventEmitter,Fve=function(e,r){return e.listeners(r).length},rP=TY(),wN=Ie(\"buffer\").Buffer,kyt=global.Uint8Array||function(){};function Qyt(t){return wN.from(t)}function Ryt(t){return wN.isBuffer(t)||t instanceof kyt}var XY=Ie(\"util\"),cn;XY&&XY.debuglog?cn=XY.debuglog(\"stream\"):cn=function(){};var Tyt=eve(),sV=OY(),Fyt=LY(),Nyt=Fyt.getHighWaterMark,BN=lg().codes,Oyt=BN.ERR_INVALID_ARG_TYPE,Lyt=BN.ERR_STREAM_PUSH_AFTER_EOF,Myt=BN.ERR_METHOD_NOT_IMPLEMENTED,Uyt=BN.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ow,$Y,eV;cg()(bn,rP);var tP=sV.errorOrDestroy,tV=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function _yt(t,e,r){if(typeof t.prependListener==\"function\")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Nve(t,e,r){Nw=Nw||Ym(),t=t||{},typeof r!=\"boolean\"&&(r=e instanceof Nw),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=Nyt(this,t,\"readableHighWaterMark\",r),this.buffer=new Tyt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Ow||(Ow=zY().StringDecoder),this.decoder=new Ow(t.encoding),this.encoding=t.encoding)}function bn(t){if(Nw=Nw||Ym(),!(this instanceof bn))return new bn(t);var e=this instanceof Nw;this._readableState=new Nve(t,this,e),this.readable=!0,t&&(typeof t.read==\"function\"&&(this._read=t.read),typeof t.destroy==\"function\"&&(this._destroy=t.destroy)),rP.call(this)}Object.defineProperty(bn.prototype,\"destroyed\",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});bn.prototype.destroy=sV.destroy;bn.prototype._undestroy=sV.undestroy;bn.prototype._destroy=function(t,e){e(t)};bn.prototype.push=function(t,e){var r=this._readableState,s;return r.objectMode?s=!0:typeof t==\"string\"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=wN.from(t,e),e=\"\"),s=!0),Ove(this,t,e,!1,s)};bn.prototype.unshift=function(t){return Ove(this,t,null,!0,!1)};function Ove(t,e,r,s,a){cn(\"readableAddChunk\",e);var n=t._readableState;if(e===null)n.reading=!1,Gyt(t,n);else{var c;if(a||(c=Hyt(n,e)),c)tP(t,c);else if(n.objectMode||e&&e.length>0)if(typeof e!=\"string\"&&!n.objectMode&&Object.getPrototypeOf(e)!==wN.prototype&&(e=Qyt(e)),s)n.endEmitted?tP(t,new Uyt):rV(t,n,e,!0);else if(n.ended)tP(t,new Lyt);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?rV(t,n,e,!1):iV(t,n)):rV(t,n,e,!1)}else s||(n.reading=!1,iV(t,n))}return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function rV(t,e,r,s){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit(\"data\",r)):(e.length+=e.objectMode?1:r.length,s?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&vN(t)),iV(t,e)}function Hyt(t,e){var r;return!Ryt(e)&&typeof e!=\"string\"&&e!==void 0&&!t.objectMode&&(r=new Oyt(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],e)),r}bn.prototype.isPaused=function(){return this._readableState.flowing===!1};bn.prototype.setEncoding=function(t){Ow||(Ow=zY().StringDecoder);var e=new Ow(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,s=\"\";r!==null;)s+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),s!==\"\"&&this._readableState.buffer.push(s),this._readableState.length=s.length,this};var Rve=1073741824;function jyt(t){return t>=Rve?t=Rve:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Tve(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=jyt(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}bn.prototype.read=function(t){cn(\"read\",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return cn(\"read: emitReadable\",e.length,e.ended),e.length===0&&e.ended?nV(this):vN(this),null;if(t=Tve(t,e),t===0&&e.ended)return e.length===0&&nV(this),null;var s=e.needReadable;cn(\"need readable\",s),(e.length===0||e.length-t<e.highWaterMark)&&(s=!0,cn(\"length less than watermark\",s)),e.ended||e.reading?(s=!1,cn(\"reading or ended\",s)):s&&(cn(\"do read\"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Tve(r,e)));var a;return t>0?a=Uve(t,e):a=null,a===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&nV(this)),a!==null&&this.emit(\"data\",a),a};function Gyt(t,e){if(cn(\"onEofChunk\"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?vN(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Lve(t)))}}function vN(t){var e=t._readableState;cn(\"emitReadable\",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(cn(\"emitReadable\",e.flowing),e.emittedReadable=!0,process.nextTick(Lve,t))}function Lve(t){var e=t._readableState;cn(\"emitReadable_\",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit(\"readable\"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,oV(t)}function iV(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(qyt,t,e))}function qyt(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(cn(\"maybeReadMore read 0\"),t.read(0),r===e.length)break}e.readingMore=!1}bn.prototype._read=function(t){tP(this,new Myt(\"_read()\"))};bn.prototype.pipe=function(t,e){var r=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t);break}s.pipesCount+=1,cn(\"pipe count=%d opts=%j\",s.pipesCount,e);var a=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,n=a?f:T;s.endEmitted?process.nextTick(n):r.once(\"end\",n),t.on(\"unpipe\",c);function c(N,U){cn(\"onunpipe\"),N===r&&U&&U.hasUnpiped===!1&&(U.hasUnpiped=!0,E())}function f(){cn(\"onend\"),t.end()}var p=Wyt(r);t.on(\"drain\",p);var h=!1;function E(){cn(\"cleanup\"),t.removeListener(\"close\",b),t.removeListener(\"finish\",I),t.removeListener(\"drain\",p),t.removeListener(\"error\",S),t.removeListener(\"unpipe\",c),r.removeListener(\"end\",f),r.removeListener(\"end\",T),r.removeListener(\"data\",C),h=!0,s.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&p()}r.on(\"data\",C);function C(N){cn(\"ondata\");var U=t.write(N);cn(\"dest.write\",U),U===!1&&((s.pipesCount===1&&s.pipes===t||s.pipesCount>1&&_ve(s.pipes,t)!==-1)&&!h&&(cn(\"false write response, pause\",s.awaitDrain),s.awaitDrain++),r.pause())}function S(N){cn(\"onerror\",N),T(),t.removeListener(\"error\",S),Fve(t,\"error\")===0&&tP(t,N)}_yt(t,\"error\",S);function b(){t.removeListener(\"finish\",I),T()}t.once(\"close\",b);function I(){cn(\"onfinish\"),t.removeListener(\"close\",b),T()}t.once(\"finish\",I);function T(){cn(\"unpipe\"),r.unpipe(t)}return t.emit(\"pipe\",r),s.flowing||(cn(\"pipe resume\"),r.resume()),t};function Wyt(t){return function(){var r=t._readableState;cn(\"pipeOnDrain\",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Fve(t,\"data\")&&(r.flowing=!0,oV(t))}}bn.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit(\"unpipe\",this,r),this);if(!t){var s=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n<a;n++)s[n].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var c=_ve(e.pipes,t);return c===-1?this:(e.pipes.splice(c,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit(\"unpipe\",this,r),this)};bn.prototype.on=function(t,e){var r=rP.prototype.on.call(this,t,e),s=this._readableState;return t===\"data\"?(s.readableListening=this.listenerCount(\"readable\")>0,s.flowing!==!1&&this.resume()):t===\"readable\"&&!s.endEmitted&&!s.readableListening&&(s.readableListening=s.needReadable=!0,s.flowing=!1,s.emittedReadable=!1,cn(\"on readable\",s.length,s.reading),s.length?vN(this):s.reading||process.nextTick(Yyt,this)),r};bn.prototype.addListener=bn.prototype.on;bn.prototype.removeListener=function(t,e){var r=rP.prototype.removeListener.call(this,t,e);return t===\"readable\"&&process.nextTick(Mve,this),r};bn.prototype.removeAllListeners=function(t){var e=rP.prototype.removeAllListeners.apply(this,arguments);return(t===\"readable\"||t===void 0)&&process.nextTick(Mve,this),e};function Mve(t){var e=t._readableState;e.readableListening=t.listenerCount(\"readable\")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount(\"data\")>0&&t.resume()}function Yyt(t){cn(\"readable nexttick read 0\"),t.read(0)}bn.prototype.resume=function(){var t=this._readableState;return t.flowing||(cn(\"resume\"),t.flowing=!t.readableListening,Vyt(this,t)),t.paused=!1,this};function Vyt(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(Jyt,t,e))}function Jyt(t,e){cn(\"resume\",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit(\"resume\"),oV(t),e.flowing&&!e.reading&&t.read(0)}bn.prototype.pause=function(){return cn(\"call pause flowing=%j\",this._readableState.flowing),this._readableState.flowing!==!1&&(cn(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this};function oV(t){var e=t._readableState;for(cn(\"flow\",e.flowing);e.flowing&&t.read()!==null;);}bn.prototype.wrap=function(t){var e=this,r=this._readableState,s=!1;t.on(\"end\",function(){if(cn(\"wrapped end\"),r.decoder&&!r.ended){var c=r.decoder.end();c&&c.length&&e.push(c)}e.push(null)}),t.on(\"data\",function(c){if(cn(\"wrapped data\"),r.decoder&&(c=r.decoder.write(c)),!(r.objectMode&&c==null)&&!(!r.objectMode&&(!c||!c.length))){var f=e.push(c);f||(s=!0,t.pause())}});for(var a in t)this[a]===void 0&&typeof t[a]==\"function\"&&(this[a]=function(f){return function(){return t[f].apply(t,arguments)}}(a));for(var n=0;n<tV.length;n++)t.on(tV[n],this.emit.bind(this,tV[n]));return this._read=function(c){cn(\"wrapped _read\",c),s&&(s=!1,t.resume())},this};typeof Symbol==\"function\"&&(bn.prototype[Symbol.asyncIterator]=function(){return $Y===void 0&&($Y=Pve()),$Y(this)});Object.defineProperty(bn.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(bn.prototype,\"readableBuffer\",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(bn.prototype,\"readableFlowing\",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});bn._fromList=Uve;Object.defineProperty(bn.prototype,\"readableLength\",{enumerable:!1,get:function(){return this._readableState.length}});function Uve(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(\"\"):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function nV(t){var e=t._readableState;cn(\"endReadable\",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(Kyt,e,t))}function Kyt(t,e){if(cn(\"endReadableNT\",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit(\"end\"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol==\"function\"&&(bn.from=function(t,e){return eV===void 0&&(eV=Qve()),eV(bn,t,e)});function _ve(t,e){for(var r=0,s=t.length;r<s;r++)if(t[r]===e)return r;return-1}});var aV=_((Ltr,Gve)=>{\"use strict\";Gve.exports=lh;var SN=lg().codes,zyt=SN.ERR_METHOD_NOT_IMPLEMENTED,Zyt=SN.ERR_MULTIPLE_CALLBACK,Xyt=SN.ERR_TRANSFORM_ALREADY_TRANSFORMING,$yt=SN.ERR_TRANSFORM_WITH_LENGTH_0,DN=Ym();cg()(lh,DN);function eEt(t,e){var r=this._transformState;r.transforming=!1;var s=r.writecb;if(s===null)return this.emit(\"error\",new Zyt);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),s(t);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function lh(t){if(!(this instanceof lh))return new lh(t);DN.call(this,t),this._transformState={afterTransform:eEt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform==\"function\"&&(this._transform=t.transform),typeof t.flush==\"function\"&&(this._flush=t.flush)),this.on(\"prefinish\",tEt)}function tEt(){var t=this;typeof this._flush==\"function\"&&!this._readableState.destroyed?this._flush(function(e,r){jve(t,e,r)}):jve(this,null,null)}lh.prototype.push=function(t,e){return this._transformState.needTransform=!1,DN.prototype.push.call(this,t,e)};lh.prototype._transform=function(t,e,r){r(new zyt(\"_transform()\"))};lh.prototype._write=function(t,e,r){var s=this._transformState;if(s.writecb=r,s.writechunk=t,s.writeencoding=e,!s.transforming){var a=this._readableState;(s.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}};lh.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};lh.prototype._destroy=function(t,e){DN.prototype._destroy.call(this,t,function(r){e(r)})};function jve(t,e,r){if(e)return t.emit(\"error\",e);if(r!=null&&t.push(r),t._writableState.length)throw new $yt;if(t._transformState.transforming)throw new Xyt;return t.push(null)}});var Yve=_((Mtr,Wve)=>{\"use strict\";Wve.exports=nP;var qve=aV();cg()(nP,qve);function nP(t){if(!(this instanceof nP))return new nP(t);qve.call(this,t)}nP.prototype._transform=function(t,e,r){r(null,t)}});var Zve=_((Utr,zve)=>{\"use strict\";var lV;function rEt(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Kve=lg().codes,nEt=Kve.ERR_MISSING_ARGS,iEt=Kve.ERR_STREAM_DESTROYED;function Vve(t){if(t)throw t}function sEt(t){return t.setHeader&&typeof t.abort==\"function\"}function oEt(t,e,r,s){s=rEt(s);var a=!1;t.on(\"close\",function(){a=!0}),lV===void 0&&(lV=EN()),lV(t,{readable:e,writable:r},function(c){if(c)return s(c);a=!0,s()});var n=!1;return function(c){if(!a&&!n){if(n=!0,sEt(t))return t.abort();if(typeof t.destroy==\"function\")return t.destroy();s(c||new iEt(\"pipe\"))}}}function Jve(t){t()}function aEt(t,e){return t.pipe(e)}function lEt(t){return!t.length||typeof t[t.length-1]!=\"function\"?Vve:t.pop()}function cEt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var s=lEt(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new nEt(\"streams\");var a,n=e.map(function(c,f){var p=f<e.length-1,h=f>0;return oEt(c,p,h,function(E){a||(a=E),E&&n.forEach(Jve),!p&&(n.forEach(Jve),s(a))})});return e.reduce(aEt)}zve.exports=cEt});var Lw=_((zc,sP)=>{var iP=Ie(\"stream\");process.env.READABLE_STREAM===\"disable\"&&iP?(sP.exports=iP.Readable,Object.assign(sP.exports,iP),sP.exports.Stream=iP):(zc=sP.exports=YY(),zc.Stream=iP||zc,zc.Readable=zc,zc.Writable=GY(),zc.Duplex=Ym(),zc.Transform=aV(),zc.PassThrough=Yve(),zc.finished=EN(),zc.pipeline=Zve())});var eSe=_((_tr,$ve)=>{\"use strict\";var{Buffer:cf}=Ie(\"buffer\"),Xve=Symbol.for(\"BufferList\");function Ci(t){if(!(this instanceof Ci))return new Ci(t);Ci._init.call(this,t)}Ci._init=function(e){Object.defineProperty(this,Xve,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};Ci.prototype._new=function(e){return new Ci(e)};Ci.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let s=0;s<this._bufs.length;s++){let a=r+this._bufs[s].length;if(e<a||s===this._bufs.length-1)return[s,e-r];r=a}};Ci.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let s=0;s<e;s++)r+=this._bufs[s].length;return r};Ci.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};Ci.prototype.slice=function(e,r){return typeof e==\"number\"&&e<0&&(e+=this.length),typeof r==\"number\"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};Ci.prototype.copy=function(e,r,s,a){if((typeof s!=\"number\"||s<0)&&(s=0),(typeof a!=\"number\"||a>this.length)&&(a=this.length),s>=this.length||a<=0)return e||cf.alloc(0);let n=!!e,c=this._offset(s),f=a-s,p=f,h=n&&r||0,E=c[1];if(s===0&&a===this.length){if(!n)return this._bufs.length===1?this._bufs[0]:cf.concat(this._bufs,this.length);for(let C=0;C<this._bufs.length;C++)this._bufs[C].copy(e,h),h+=this._bufs[C].length;return e}if(p<=this._bufs[c[0]].length-E)return n?this._bufs[c[0]].copy(e,r,E,E+p):this._bufs[c[0]].slice(E,E+p);n||(e=cf.allocUnsafe(f));for(let C=c[0];C<this._bufs.length;C++){let S=this._bufs[C].length-E;if(p>S)this._bufs[C].copy(e,h,E),h+=S;else{this._bufs[C].copy(e,h,E,E+p),h+=S;break}p-=S,E&&(E=0)}return e.length>h?e.slice(0,h):e};Ci.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!=\"number\"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let s=this._offset(e),a=this._offset(r),n=this._bufs.slice(s[0],a[0]+1);return a[1]===0?n.pop():n[n.length-1]=n[n.length-1].slice(0,a[1]),s[1]!==0&&(n[0]=n[0].slice(s[1])),this._new(n)};Ci.prototype.toString=function(e,r,s){return this.slice(r,s).toString(e)};Ci.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};Ci.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};Ci.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(cf.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e==\"number\"&&(e=e.toString()),this._appendBuffer(cf.from(e));return this};Ci.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};Ci.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e==\"string\"&&(r=e,e=void 0),typeof t==\"function\"||Array.isArray(t))throw new TypeError('The \"value\" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t==\"number\"?t=cf.from([t]):typeof t==\"string\"?t=cf.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=cf.from(t.buffer,t.byteOffset,t.byteLength):cf.isBuffer(t)||(t=cf.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let s=this._offset(e),a=s[0],n=s[1];for(;a<this._bufs.length;a++){let c=this._bufs[a];for(;n<c.length;)if(c.length-n>=t.length){let p=c.indexOf(t,n);if(p!==-1)return this._reverseOffset([a,p]);n=c.length-t.length+1}else{let p=this._reverseOffset([a,n]);if(this._match(p,t))return p;n++}n=0}return-1};Ci.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?Ci.prototype[r]=function(s,a){return this.slice(s,s+a)[r](0,a)}:Ci.prototype[r]=function(s=0){return this.slice(s,s+t[r])[r](0)}})(e)})();Ci.prototype._isBufferList=function(e){return e instanceof Ci||Ci.isBufferList(e)};Ci.isBufferList=function(e){return e!=null&&e[Xve]};$ve.exports=Ci});var tSe=_((Htr,PN)=>{\"use strict\";var cV=Lw().Duplex,uEt=cg(),oP=eSe();function ra(t){if(!(this instanceof ra))return new ra(t);if(typeof t==\"function\"){this._callback=t;let e=function(s){this._callback&&(this._callback(s),this._callback=null)}.bind(this);this.on(\"pipe\",function(s){s.on(\"error\",e)}),this.on(\"unpipe\",function(s){s.removeListener(\"error\",e)}),t=null}oP._init.call(this,t),cV.call(this)}uEt(ra,cV);Object.assign(ra.prototype,oP.prototype);ra.prototype._new=function(e){return new ra(e)};ra.prototype._write=function(e,r,s){this._appendBuffer(e),typeof s==\"function\"&&s()};ra.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};ra.prototype.end=function(e){cV.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};ra.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};ra.prototype._isBufferList=function(e){return e instanceof ra||e instanceof oP||ra.isBufferList(e)};ra.isBufferList=oP.isBufferList;PN.exports=ra;PN.exports.BufferListStream=ra;PN.exports.BufferList=oP});var AV=_(Uw=>{var fEt=Buffer.alloc,AEt=\"0000000000000000000\",pEt=\"7777777777777777777\",rSe=48,nSe=Buffer.from(\"ustar\\0\",\"binary\"),hEt=Buffer.from(\"00\",\"binary\"),gEt=Buffer.from(\"ustar \",\"binary\"),dEt=Buffer.from(\" \\0\",\"binary\"),mEt=parseInt(\"7777\",8),aP=257,fV=263,yEt=function(t,e,r){return typeof t!=\"number\"?r:(t=~~t,t>=e?e:t>=0||(t+=e,t>=0)?t:0)},EEt=function(t){switch(t){case 0:return\"file\";case 1:return\"link\";case 2:return\"symlink\";case 3:return\"character-device\";case 4:return\"block-device\";case 5:return\"directory\";case 6:return\"fifo\";case 7:return\"contiguous-file\";case 72:return\"pax-header\";case 55:return\"pax-global-header\";case 27:return\"gnu-long-link-path\";case 28:case 30:return\"gnu-long-path\"}return null},IEt=function(t){switch(t){case\"file\":return 0;case\"link\":return 1;case\"symlink\":return 2;case\"character-device\":return 3;case\"block-device\":return 4;case\"directory\":return 5;case\"fifo\":return 6;case\"contiguous-file\":return 7;case\"pax-header\":return 72}return 0},iSe=function(t,e,r,s){for(;r<s;r++)if(t[r]===e)return r;return s},sSe=function(t){for(var e=256,r=0;r<148;r++)e+=t[r];for(var s=156;s<512;s++)e+=t[s];return e},hg=function(t,e){return t=t.toString(8),t.length>e?pEt.slice(0,e)+\" \":AEt.slice(0,e-t.length)+t+\" \"};function CEt(t){var e;if(t[0]===128)e=!0;else if(t[0]===255)e=!1;else return null;for(var r=[],s=t.length-1;s>0;s--){var a=t[s];e?r.push(a):r.push(255-a)}var n=0,c=r.length;for(s=0;s<c;s++)n+=r[s]*Math.pow(256,s);return e?n:-1*n}var gg=function(t,e,r){if(t=t.slice(e,e+r),e=0,t[e]&128)return CEt(t);for(;e<t.length&&t[e]===32;)e++;for(var s=yEt(iSe(t,32,e,t.length),t.length,t.length);e<s&&t[e]===0;)e++;return s===e?0:parseInt(t.slice(e,s).toString(),8)},Mw=function(t,e,r,s){return t.slice(e,iSe(t,0,e,e+r)).toString(s)},uV=function(t){var e=Buffer.byteLength(t),r=Math.floor(Math.log(e)/Math.log(10))+1;return e+r>=Math.pow(10,r)&&r++,e+r+t};Uw.decodeLongPath=function(t,e){return Mw(t,0,t.length,e)};Uw.encodePax=function(t){var e=\"\";t.name&&(e+=uV(\" path=\"+t.name+`\n`)),t.linkname&&(e+=uV(\" linkpath=\"+t.linkname+`\n`));var r=t.pax;if(r)for(var s in r)e+=uV(\" \"+s+\"=\"+r[s]+`\n`);return Buffer.from(e)};Uw.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var s=parseInt(t.slice(0,r).toString(),10);if(!s)return e;var a=t.slice(r+1,s-1).toString(),n=a.indexOf(\"=\");if(n===-1)return e;e[a.slice(0,n)]=a.slice(n+1),t=t.slice(s)}return e};Uw.encode=function(t){var e=fEt(512),r=t.name,s=\"\";if(t.typeflag===5&&r[r.length-1]!==\"/\"&&(r+=\"/\"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf(\"/\");if(a===-1)return null;s+=s?\"/\"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(s)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(hg(t.mode&mEt,6),100),e.write(hg(t.uid,6),108),e.write(hg(t.gid,6),116),e.write(hg(t.size,11),124),e.write(hg(t.mtime.getTime()/1e3|0,11),136),e[156]=rSe+IEt(t.type),t.linkname&&e.write(t.linkname,157),nSe.copy(e,aP),hEt.copy(e,fV),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(hg(t.devmajor||0,6),329),e.write(hg(t.devminor||0,6),337),s&&e.write(s,345),e.write(hg(sSe(e),6),148),e)};Uw.decode=function(t,e,r){var s=t[156]===0?0:t[156]-rSe,a=Mw(t,0,100,e),n=gg(t,100,8),c=gg(t,108,8),f=gg(t,116,8),p=gg(t,124,12),h=gg(t,136,12),E=EEt(s),C=t[157]===0?null:Mw(t,157,100,e),S=Mw(t,265,32),b=Mw(t,297,32),I=gg(t,329,8),T=gg(t,337,8),N=sSe(t);if(N===8*32)return null;if(N!==gg(t,148,8))throw new Error(\"Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?\");if(nSe.compare(t,aP,aP+6)===0)t[345]&&(a=Mw(t,345,155,e)+\"/\"+a);else if(!(gEt.compare(t,aP,aP+6)===0&&dEt.compare(t,fV,fV+2)===0)){if(!r)throw new Error(\"Invalid tar header: unknown format.\")}return s===0&&a&&a[a.length-1]===\"/\"&&(s=5),{name:a,mode:n,uid:c,gid:f,size:p,mtime:new Date(1e3*h),type:E,linkname:C,uname:S,gname:b,devmajor:I,devminor:T}}});var ASe=_((Gtr,fSe)=>{var aSe=Ie(\"util\"),wEt=tSe(),lP=AV(),lSe=Lw().Writable,cSe=Lw().PassThrough,uSe=function(){},oSe=function(t){return t&=511,t&&512-t},BEt=function(t,e){var r=new bN(t,e);return r.end(),r},vEt=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},bN=function(t,e){this._parent=t,this.offset=e,cSe.call(this,{autoDestroy:!1})};aSe.inherits(bN,cSe);bN.prototype.destroy=function(t){this._parent.destroy(t)};var ch=function(t){if(!(this instanceof ch))return new ch(t);lSe.call(this,t),t=t||{},this._offset=0,this._buffer=wEt(),this._missing=0,this._partial=!1,this._onparse=uSe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,s=function(){e._continue()},a=function(S){if(e._locked=!1,S)return e.destroy(S);e._stream||s()},n=function(){e._stream=null;var S=oSe(e._header.size);S?e._parse(S,c):e._parse(512,C),e._locked||s()},c=function(){e._buffer.consume(oSe(e._header.size)),e._parse(512,C),s()},f=function(){var S=e._header.size;e._paxGlobal=lP.decodePax(r.slice(0,S)),r.consume(S),n()},p=function(){var S=e._header.size;e._pax=lP.decodePax(r.slice(0,S)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(S),n()},h=function(){var S=e._header.size;this._gnuLongPath=lP.decodeLongPath(r.slice(0,S),t.filenameEncoding),r.consume(S),n()},E=function(){var S=e._header.size;this._gnuLongLinkPath=lP.decodeLongPath(r.slice(0,S),t.filenameEncoding),r.consume(S),n()},C=function(){var S=e._offset,b;try{b=e._header=lP.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(I){e.emit(\"error\",I)}if(r.consume(512),!b){e._parse(512,C),s();return}if(b.type===\"gnu-long-path\"){e._parse(b.size,h),s();return}if(b.type===\"gnu-long-link-path\"){e._parse(b.size,E),s();return}if(b.type===\"pax-global-header\"){e._parse(b.size,f),s();return}if(b.type===\"pax-header\"){e._parse(b.size,p),s();return}if(e._gnuLongPath&&(b.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(b.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=b=vEt(b,e._pax),e._pax=null),e._locked=!0,!b.size||b.type===\"directory\"){e._parse(512,C),e.emit(\"entry\",b,BEt(e,S),a);return}e._stream=new bN(e,S),e.emit(\"entry\",b,e._stream,a),e._parse(b.size,n),s()};this._onheader=C,this._parse(512,C)};aSe.inherits(ch,lSe);ch.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit(\"error\",t),this.emit(\"close\"),this._stream&&this._stream.emit(\"close\"))};ch.prototype._parse=function(t,e){this._destroyed||(this._offset+=t,this._missing=t,e===this._onheader&&(this._partial=!1),this._onparse=e)};ch.prototype._continue=function(){if(!this._destroyed){var t=this._cb;this._cb=uSe,this._overflow?this._write(this._overflow,void 0,t):t()}};ch.prototype._write=function(t,e,r){if(!this._destroyed){var s=this._stream,a=this._buffer,n=this._missing;if(t.length&&(this._partial=!0),t.length<n)return this._missing-=t.length,this._overflow=null,s?s.write(t,r):(a.append(t),r());this._cb=r,this._missing=0;var c=null;t.length>n&&(c=t.slice(n),t=t.slice(0,n)),s?s.end(t):a.append(t),this._overflow=c,this._onparse()}};ch.prototype._final=function(t){if(this._partial)return this.destroy(new Error(\"Unexpected end of data\"));t()};fSe.exports=ch});var hSe=_((qtr,pSe)=>{pSe.exports=Ie(\"fs\").constants||Ie(\"constants\")});var ESe=_((Wtr,ySe)=>{var _w=hSe(),gSe=aH(),kN=cg(),SEt=Buffer.alloc,dSe=Lw().Readable,Hw=Lw().Writable,DEt=Ie(\"string_decoder\").StringDecoder,xN=AV(),PEt=parseInt(\"755\",8),bEt=parseInt(\"644\",8),mSe=SEt(1024),hV=function(){},pV=function(t,e){e&=511,e&&t.push(mSe.slice(0,512-e))};function xEt(t){switch(t&_w.S_IFMT){case _w.S_IFBLK:return\"block-device\";case _w.S_IFCHR:return\"character-device\";case _w.S_IFDIR:return\"directory\";case _w.S_IFIFO:return\"fifo\";case _w.S_IFLNK:return\"symlink\"}return\"file\"}var QN=function(t){Hw.call(this),this.written=0,this._to=t,this._destroyed=!1};kN(QN,Hw);QN.prototype._write=function(t,e,r){if(this.written+=t.length,this._to.push(t))return r();this._to._drain=r};QN.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit(\"close\"))};var RN=function(){Hw.call(this),this.linkname=\"\",this._decoder=new DEt(\"utf-8\"),this._destroyed=!1};kN(RN,Hw);RN.prototype._write=function(t,e,r){this.linkname+=this._decoder.write(t),r()};RN.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit(\"close\"))};var cP=function(){Hw.call(this),this._destroyed=!1};kN(cP,Hw);cP.prototype._write=function(t,e,r){r(new Error(\"No body allowed for this entry\"))};cP.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit(\"close\"))};var mA=function(t){if(!(this instanceof mA))return new mA(t);dSe.call(this,t),this._drain=hV,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};kN(mA,dSe);mA.prototype.entry=function(t,e,r){if(this._stream)throw new Error(\"already piping an entry\");if(!(this._finalized||this._destroyed)){typeof e==\"function\"&&(r=e,e=null),r||(r=hV);var s=this;if((!t.size||t.type===\"symlink\")&&(t.size=0),t.type||(t.type=xEt(t.mode)),t.mode||(t.mode=t.type===\"directory\"?PEt:bEt),t.uid||(t.uid=0),t.gid||(t.gid=0),t.mtime||(t.mtime=new Date),typeof e==\"string\"&&(e=Buffer.from(e)),Buffer.isBuffer(e)){t.size=e.length,this._encode(t);var a=this.push(e);return pV(s,t.size),a?process.nextTick(r):this._drain=r,new cP}if(t.type===\"symlink\"&&!t.linkname){var n=new RN;return gSe(n,function(f){if(f)return s.destroy(),r(f);t.linkname=n.linkname,s._encode(t),r()}),n}if(this._encode(t),t.type!==\"file\"&&t.type!==\"contiguous-file\")return process.nextTick(r),new cP;var c=new QN(this);return this._stream=c,gSe(c,function(f){if(s._stream=null,f)return s.destroy(),r(f);if(c.written!==t.size)return s.destroy(),r(new Error(\"size mismatch\"));pV(s,t.size),s._finalizing&&s.finalize(),r()}),c}};mA.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(mSe),this.push(null))};mA.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit(\"error\",t),this.emit(\"close\"),this._stream&&this._stream.destroy&&this._stream.destroy())};mA.prototype._encode=function(t){if(!t.pax){var e=xN.encode(t);if(e){this.push(e);return}}this._encodePax(t)};mA.prototype._encodePax=function(t){var e=xN.encodePax({name:t.name,linkname:t.linkname,pax:t.pax}),r={name:\"PaxHeader\",mode:t.mode,uid:t.uid,gid:t.gid,size:e.length,mtime:t.mtime,type:\"pax-header\",linkname:t.linkname&&\"PaxHeader\",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};this.push(xN.encode(r)),this.push(e),pV(this,e.length),r.size=t.size,r.type=t.type,this.push(xN.encode(r))};mA.prototype._read=function(t){var e=this._drain;this._drain=hV,e()};ySe.exports=mA});var ISe=_(gV=>{gV.extract=ASe();gV.pack=ESe()});var TSe=_(Ra=>{\"use strict\";var jEt=Ra&&Ra.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ra,\"__esModule\",{value:!0});Ra.Minipass=Ra.isWritable=Ra.isReadable=Ra.isStream=void 0;var bSe=typeof process==\"object\"&&process?process:{stdout:null,stderr:null},PV=Ie(\"node:events\"),RSe=jEt(Ie(\"node:stream\")),GEt=Ie(\"node:string_decoder\"),qEt=t=>!!t&&typeof t==\"object\"&&(t instanceof HN||t instanceof RSe.default||(0,Ra.isReadable)(t)||(0,Ra.isWritable)(t));Ra.isStream=qEt;var WEt=t=>!!t&&typeof t==\"object\"&&t instanceof PV.EventEmitter&&typeof t.pipe==\"function\"&&t.pipe!==RSe.default.Writable.prototype.pipe;Ra.isReadable=WEt;var YEt=t=>!!t&&typeof t==\"object\"&&t instanceof PV.EventEmitter&&typeof t.write==\"function\"&&typeof t.end==\"function\";Ra.isWritable=YEt;var uh=Symbol(\"EOF\"),fh=Symbol(\"maybeEmitEnd\"),dg=Symbol(\"emittedEnd\"),NN=Symbol(\"emittingEnd\"),uP=Symbol(\"emittedError\"),ON=Symbol(\"closed\"),xSe=Symbol(\"read\"),LN=Symbol(\"flush\"),kSe=Symbol(\"flushChunk\"),uf=Symbol(\"encoding\"),Gw=Symbol(\"decoder\"),Ks=Symbol(\"flowing\"),fP=Symbol(\"paused\"),qw=Symbol(\"resume\"),zs=Symbol(\"buffer\"),Qa=Symbol(\"pipes\"),Zs=Symbol(\"bufferLength\"),CV=Symbol(\"bufferPush\"),MN=Symbol(\"bufferShift\"),na=Symbol(\"objectMode\"),es=Symbol(\"destroyed\"),wV=Symbol(\"error\"),BV=Symbol(\"emitData\"),QSe=Symbol(\"emitEnd\"),vV=Symbol(\"emitEnd2\"),EA=Symbol(\"async\"),SV=Symbol(\"abort\"),UN=Symbol(\"aborted\"),AP=Symbol(\"signal\"),zm=Symbol(\"dataListeners\"),rc=Symbol(\"discarded\"),pP=t=>Promise.resolve().then(t),VEt=t=>t(),JEt=t=>t===\"end\"||t===\"finish\"||t===\"prefinish\",KEt=t=>t instanceof ArrayBuffer||!!t&&typeof t==\"object\"&&t.constructor&&t.constructor.name===\"ArrayBuffer\"&&t.byteLength>=0,zEt=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),_N=class{src;dest;opts;ondrain;constructor(e,r,s){this.src=e,this.dest=r,this.opts=s,this.ondrain=()=>e[qw](),this.dest.on(\"drain\",this.ondrain)}unpipe(){this.dest.removeListener(\"drain\",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},DV=class extends _N{unpipe(){this.src.removeListener(\"error\",this.proxyErrors),super.unpipe()}constructor(e,r,s){super(e,r,s),this.proxyErrors=a=>r.emit(\"error\",a),e.on(\"error\",this.proxyErrors)}},ZEt=t=>!!t.objectMode,XEt=t=>!t.objectMode&&!!t.encoding&&t.encoding!==\"buffer\",HN=class extends PV.EventEmitter{[Ks]=!1;[fP]=!1;[Qa]=[];[zs]=[];[na];[uf];[EA];[Gw];[uh]=!1;[dg]=!1;[NN]=!1;[ON]=!1;[uP]=null;[Zs]=0;[es]=!1;[AP];[UN]=!1;[zm]=0;[rc]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding==\"string\")throw new TypeError(\"Encoding and objectMode may not be used together\");ZEt(r)?(this[na]=!0,this[uf]=null):XEt(r)?(this[uf]=r.encoding,this[na]=!1):(this[na]=!1,this[uf]=null),this[EA]=!!r.async,this[Gw]=this[uf]?new GEt.StringDecoder(this[uf]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,\"buffer\",{get:()=>this[zs]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,\"pipes\",{get:()=>this[Qa]});let{signal:s}=r;s&&(this[AP]=s,s.aborted?this[SV]():s.addEventListener(\"abort\",()=>this[SV]()))}get bufferLength(){return this[Zs]}get encoding(){return this[uf]}set encoding(e){throw new Error(\"Encoding must be set at instantiation time\")}setEncoding(e){throw new Error(\"Encoding must be set at instantiation time\")}get objectMode(){return this[na]}set objectMode(e){throw new Error(\"objectMode must be set at instantiation time\")}get async(){return this[EA]}set async(e){this[EA]=this[EA]||!!e}[SV](){this[UN]=!0,this.emit(\"abort\",this[AP]?.reason),this.destroy(this[AP]?.reason)}get aborted(){return this[UN]}set aborted(e){}write(e,r,s){if(this[UN])return!1;if(this[uh])throw new Error(\"write after end\");if(this[es])return this.emit(\"error\",Object.assign(new Error(\"Cannot call write after a stream was destroyed\"),{code:\"ERR_STREAM_DESTROYED\"})),!0;typeof r==\"function\"&&(s=r,r=\"utf8\"),r||(r=\"utf8\");let a=this[EA]?pP:VEt;if(!this[na]&&!Buffer.isBuffer(e)){if(zEt(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(KEt(e))e=Buffer.from(e);else if(typeof e!=\"string\")throw new Error(\"Non-contiguous data written to non-objectMode stream\")}return this[na]?(this[Ks]&&this[Zs]!==0&&this[LN](!0),this[Ks]?this.emit(\"data\",e):this[CV](e),this[Zs]!==0&&this.emit(\"readable\"),s&&a(s),this[Ks]):e.length?(typeof e==\"string\"&&!(r===this[uf]&&!this[Gw]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[uf]&&(e=this[Gw].write(e)),this[Ks]&&this[Zs]!==0&&this[LN](!0),this[Ks]?this.emit(\"data\",e):this[CV](e),this[Zs]!==0&&this.emit(\"readable\"),s&&a(s),this[Ks]):(this[Zs]!==0&&this.emit(\"readable\"),s&&a(s),this[Ks])}read(e){if(this[es])return null;if(this[rc]=!1,this[Zs]===0||e===0||e&&e>this[Zs])return this[fh](),null;this[na]&&(e=null),this[zs].length>1&&!this[na]&&(this[zs]=[this[uf]?this[zs].join(\"\"):Buffer.concat(this[zs],this[Zs])]);let r=this[xSe](e||null,this[zs][0]);return this[fh](),r}[xSe](e,r){if(this[na])this[MN]();else{let s=r;e===s.length||e===null?this[MN]():typeof s==\"string\"?(this[zs][0]=s.slice(e),r=s.slice(0,e),this[Zs]-=e):(this[zs][0]=s.subarray(e),r=s.subarray(0,e),this[Zs]-=e)}return this.emit(\"data\",r),!this[zs].length&&!this[uh]&&this.emit(\"drain\"),r}end(e,r,s){return typeof e==\"function\"&&(s=e,e=void 0),typeof r==\"function\"&&(s=r,r=\"utf8\"),e!==void 0&&this.write(e,r),s&&this.once(\"end\",s),this[uh]=!0,this.writable=!1,(this[Ks]||!this[fP])&&this[fh](),this}[qw](){this[es]||(!this[zm]&&!this[Qa].length&&(this[rc]=!0),this[fP]=!1,this[Ks]=!0,this.emit(\"resume\"),this[zs].length?this[LN]():this[uh]?this[fh]():this.emit(\"drain\"))}resume(){return this[qw]()}pause(){this[Ks]=!1,this[fP]=!0,this[rc]=!1}get destroyed(){return this[es]}get flowing(){return this[Ks]}get paused(){return this[fP]}[CV](e){this[na]?this[Zs]+=1:this[Zs]+=e.length,this[zs].push(e)}[MN](){return this[na]?this[Zs]-=1:this[Zs]-=this[zs][0].length,this[zs].shift()}[LN](e=!1){do;while(this[kSe](this[MN]())&&this[zs].length);!e&&!this[zs].length&&!this[uh]&&this.emit(\"drain\")}[kSe](e){return this.emit(\"data\",e),this[Ks]}pipe(e,r){if(this[es])return e;this[rc]=!1;let s=this[dg];return r=r||{},e===bSe.stdout||e===bSe.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,s?r.end&&e.end():(this[Qa].push(r.proxyErrors?new DV(this,e,r):new _N(this,e,r)),this[EA]?pP(()=>this[qw]()):this[qw]()),e}unpipe(e){let r=this[Qa].find(s=>s.dest===e);r&&(this[Qa].length===1?(this[Ks]&&this[zm]===0&&(this[Ks]=!1),this[Qa]=[]):this[Qa].splice(this[Qa].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let s=super.on(e,r);if(e===\"data\")this[rc]=!1,this[zm]++,!this[Qa].length&&!this[Ks]&&this[qw]();else if(e===\"readable\"&&this[Zs]!==0)super.emit(\"readable\");else if(JEt(e)&&this[dg])super.emit(e),this.removeAllListeners(e);else if(e===\"error\"&&this[uP]){let a=r;this[EA]?pP(()=>a.call(this,this[uP])):a.call(this,this[uP])}return s}removeListener(e,r){return this.off(e,r)}off(e,r){let s=super.off(e,r);return e===\"data\"&&(this[zm]=this.listeners(\"data\").length,this[zm]===0&&!this[rc]&&!this[Qa].length&&(this[Ks]=!1)),s}removeAllListeners(e){let r=super.removeAllListeners(e);return(e===\"data\"||e===void 0)&&(this[zm]=0,!this[rc]&&!this[Qa].length&&(this[Ks]=!1)),r}get emittedEnd(){return this[dg]}[fh](){!this[NN]&&!this[dg]&&!this[es]&&this[zs].length===0&&this[uh]&&(this[NN]=!0,this.emit(\"end\"),this.emit(\"prefinish\"),this.emit(\"finish\"),this[ON]&&this.emit(\"close\"),this[NN]=!1)}emit(e,...r){let s=r[0];if(e!==\"error\"&&e!==\"close\"&&e!==es&&this[es])return!1;if(e===\"data\")return!this[na]&&!s?!1:this[EA]?(pP(()=>this[BV](s)),!0):this[BV](s);if(e===\"end\")return this[QSe]();if(e===\"close\"){if(this[ON]=!0,!this[dg]&&!this[es])return!1;let n=super.emit(\"close\");return this.removeAllListeners(\"close\"),n}else if(e===\"error\"){this[uP]=s,super.emit(wV,s);let n=!this[AP]||this.listeners(\"error\").length?super.emit(\"error\",s):!1;return this[fh](),n}else if(e===\"resume\"){let n=super.emit(\"resume\");return this[fh](),n}else if(e===\"finish\"||e===\"prefinish\"){let n=super.emit(e);return this.removeAllListeners(e),n}let a=super.emit(e,...r);return this[fh](),a}[BV](e){for(let s of this[Qa])s.dest.write(e)===!1&&this.pause();let r=this[rc]?!1:super.emit(\"data\",e);return this[fh](),r}[QSe](){return this[dg]?!1:(this[dg]=!0,this.readable=!1,this[EA]?(pP(()=>this[vV]()),!0):this[vV]())}[vV](){if(this[Gw]){let r=this[Gw].end();if(r){for(let s of this[Qa])s.dest.write(r);this[rc]||super.emit(\"data\",r)}}for(let r of this[Qa])r.end();let e=super.emit(\"end\");return this.removeAllListeners(\"end\"),e}async collect(){let e=Object.assign([],{dataLength:0});this[na]||(e.dataLength=0);let r=this.promise();return this.on(\"data\",s=>{e.push(s),this[na]||(e.dataLength+=s.length)}),await r,e}async concat(){if(this[na])throw new Error(\"cannot concat in objectMode\");let e=await this.collect();return this[uf]?e.join(\"\"):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(es,()=>r(new Error(\"stream destroyed\"))),this.on(\"error\",s=>r(s)),this.on(\"end\",()=>e())})}[Symbol.asyncIterator](){this[rc]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let a=this.read();if(a!==null)return Promise.resolve({done:!1,value:a});if(this[uh])return r();let n,c,f=C=>{this.off(\"data\",p),this.off(\"end\",h),this.off(es,E),r(),c(C)},p=C=>{this.off(\"error\",f),this.off(\"end\",h),this.off(es,E),this.pause(),n({value:C,done:!!this[uh]})},h=()=>{this.off(\"error\",f),this.off(\"data\",p),this.off(es,E),r(),n({done:!0,value:void 0})},E=()=>f(new Error(\"stream destroyed\"));return new Promise((C,S)=>{c=S,n=C,this.once(es,E),this.once(\"error\",f),this.once(\"end\",h),this.once(\"data\",p)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[rc]=!1;let e=!1,r=()=>(this.pause(),this.off(wV,r),this.off(es,r),this.off(\"end\",r),e=!0,{done:!0,value:void 0}),s=()=>{if(e)return r();let a=this.read();return a===null?r():{done:!1,value:a}};return this.once(\"end\",r),this.once(wV,r),this.once(es,r),{next:s,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[es])return e?this.emit(\"error\",e):this.emit(es),this;this[es]=!0,this[rc]=!0,this[zs].length=0,this[Zs]=0;let r=this;return typeof r.close==\"function\"&&!this[ON]&&r.close(),e?this.emit(\"error\",e):this.emit(es),this}static get isStream(){return Ra.isStream}};Ra.Minipass=HN});var OSe=_((prr,IA)=>{\"use strict\";var gP=Ie(\"crypto\"),{Minipass:$Et}=TSe(),xV=[\"sha512\",\"sha384\",\"sha256\"],QV=[\"sha512\"],eIt=/^[a-z0-9+/]+(?:=?=?)$/i,tIt=/^([a-z0-9]+)-([^?]+)([?\\S*]*)$/,rIt=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\\?[\\x21-\\x7E]*)?$/,nIt=/^[\\x21-\\x7E]+$/,dP=t=>t?.length?`?${t.join(\"?\")}`:\"\",kV=class extends $Et{#t;#r;#i;constructor(e){super(),this.size=0,this.opts=e,this.#e(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...QV],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(gP.createHash)}#e(){this.sri=this.opts?.integrity?nc(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=dP(this.opts?.options)}on(e,r){return e===\"size\"&&this.#r?r(this.#r):e===\"integrity\"&&this.#t?r(this.#t):e===\"verified\"&&this.#i?r(this.#i):super.on(e,r)}emit(e,r){return e===\"end\"&&this.#n(),super.emit(e,r)}write(e){return this.size+=e.length,this.hashes.forEach(r=>r.update(e)),super.write(e)}#n(){this.goodSri||this.#e();let e=nc(this.hashes.map((s,a)=>`${this.algorithms[a]}-${s.digest(\"base64\")}${this.optString}`).join(\" \"),this.opts),r=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize==\"number\"&&this.size!==this.expectedSize){let s=new Error(`stream size mismatch when checking ${this.sri}.\n  Wanted: ${this.expectedSize}\n  Found: ${this.size}`);s.code=\"EBADSIZE\",s.found=this.size,s.expected=this.expectedSize,s.sri=this.sri,this.emit(\"error\",s)}else if(this.sri&&!r){let s=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);s.code=\"EINTEGRITY\",s.found=e,s.expected=this.digests,s.algorithm=this.algorithm,s.sri=this.sri,this.emit(\"error\",s)}else this.#r=this.size,this.emit(\"size\",this.size),this.#t=e,this.emit(\"integrity\",e),r&&(this.#i=r,this.emit(\"verified\",r))}},Ah=class{get isHash(){return!0}constructor(e,r){let s=r?.strict;this.source=e.trim(),this.digest=\"\",this.algorithm=\"\",this.options=[];let a=this.source.match(s?rIt:tIt);if(!a||s&&!xV.includes(a[1]))return;this.algorithm=a[1],this.digest=a[2];let n=a[3];n&&(this.options=n.slice(1).split(\"?\"))}hexDigest(){return this.digest&&Buffer.from(this.digest,\"base64\").toString(\"hex\")}toJSON(){return this.toString()}match(e,r){let s=nc(e,r);if(!s)return!1;if(s.isIntegrity){let a=s.pickAlgorithm(r,[this.algorithm]);if(!a)return!1;let n=s[a].find(c=>c.digest===this.digest);return n||!1}return s.digest===this.digest?s:!1}toString(e){return e?.strict&&!(xV.includes(this.algorithm)&&this.digest.match(eIt)&&this.options.every(r=>r.match(nIt)))?\"\":`${this.algorithm}-${this.digest}${dP(this.options)}`}};function FSe(t,e,r,s){let a=t!==\"\",n=!1,c=\"\",f=s.length-1;for(let h=0;h<f;h++){let E=Ah.prototype.toString.call(s[h],r);E&&(n=!0,c+=E,c+=e)}let p=Ah.prototype.toString.call(s[f],r);return p&&(n=!0,c+=p),a&&n?t+e+c:t+c}var Zm=class{get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let r=e?.sep||\" \",s=\"\";if(e?.strict){r=r.replace(/\\S+/g,\" \");for(let a of xV)this[a]&&(s=FSe(s,r,e,this[a]))}else for(let a of Object.keys(this))s=FSe(s,r,e,this[a]);return s}concat(e,r){let s=typeof e==\"string\"?e:hP(e,r);return nc(`${this.toString(r)} ${s}`,r)}hexDigest(){return nc(this,{single:!0}).hexDigest()}merge(e,r){let s=nc(e,r);for(let a in s)if(this[a]){if(!this[a].find(n=>s[a].find(c=>n.digest===c.digest)))throw new Error(\"hashes do not match, cannot update integrity\")}else this[a]=s[a]}match(e,r){let s=nc(e,r);if(!s)return!1;let a=s.pickAlgorithm(r,Object.keys(this));return!!a&&this[a]&&s[a]&&this[a].find(n=>s[a].find(c=>n.digest===c.digest))||!1}pickAlgorithm(e,r){let s=e?.pickAlgorithm||fIt,a=Object.keys(this).filter(n=>r?.length?r.includes(n):!0);return a.length?a.reduce((n,c)=>s(n,c)||n):null}};IA.exports.parse=nc;function nc(t,e){if(!t)return null;if(typeof t==\"string\")return bV(t,e);if(t.algorithm&&t.digest){let r=new Zm;return r[t.algorithm]=[t],bV(hP(r,e),e)}else return bV(hP(t,e),e)}function bV(t,e){if(e?.single)return new Ah(t,e);let r=t.trim().split(/\\s+/).reduce((s,a)=>{let n=new Ah(a,e);if(n.algorithm&&n.digest){let c=n.algorithm;s[c]||(s[c]=[]),s[c].push(n)}return s},new Zm);return r.isEmpty()?null:r}IA.exports.stringify=hP;function hP(t,e){return t.algorithm&&t.digest?Ah.prototype.toString.call(t,e):typeof t==\"string\"?hP(nc(t,e),e):Zm.prototype.toString.call(t,e)}IA.exports.fromHex=iIt;function iIt(t,e,r){let s=dP(r?.options);return nc(`${e}-${Buffer.from(t,\"hex\").toString(\"base64\")}${s}`,r)}IA.exports.fromData=sIt;function sIt(t,e){let r=e?.algorithms||[...QV],s=dP(e?.options);return r.reduce((a,n)=>{let c=gP.createHash(n).update(t).digest(\"base64\"),f=new Ah(`${n}-${c}${s}`,e);if(f.algorithm&&f.digest){let p=f.algorithm;a[p]||(a[p]=[]),a[p].push(f)}return a},new Zm)}IA.exports.fromStream=oIt;function oIt(t,e){let r=RV(e);return new Promise((s,a)=>{t.pipe(r),t.on(\"error\",a),r.on(\"error\",a);let n;r.on(\"integrity\",c=>{n=c}),r.on(\"end\",()=>s(n)),r.resume()})}IA.exports.checkData=aIt;function aIt(t,e,r){if(e=nc(e,r),!e||!Object.keys(e).length){if(r?.error)throw Object.assign(new Error(\"No valid integrity hashes to check against\"),{code:\"EINTEGRITY\"});return!1}let s=e.pickAlgorithm(r),a=gP.createHash(s).update(t).digest(\"base64\"),n=nc({algorithm:s,digest:a}),c=n.match(e,r);if(r=r||{},c||!r.error)return c;if(typeof r.size==\"number\"&&t.length!==r.size){let f=new Error(`data size mismatch when checking ${e}.\n  Wanted: ${r.size}\n  Found: ${t.length}`);throw f.code=\"EBADSIZE\",f.found=t.length,f.expected=r.size,f.sri=e,f}else{let f=new Error(`Integrity checksum failed when using ${s}: Wanted ${e}, but got ${n}. (${t.length} bytes)`);throw f.code=\"EINTEGRITY\",f.found=n,f.expected=e,f.algorithm=s,f.sri=e,f}}IA.exports.checkStream=lIt;function lIt(t,e,r){if(r=r||Object.create(null),r.integrity=e,e=nc(e,r),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error(\"No valid integrity hashes to check against\"),{code:\"EINTEGRITY\"}));let s=RV(r);return new Promise((a,n)=>{t.pipe(s),t.on(\"error\",n),s.on(\"error\",n);let c;s.on(\"verified\",f=>{c=f}),s.on(\"end\",()=>a(c)),s.resume()})}IA.exports.integrityStream=RV;function RV(t=Object.create(null)){return new kV(t)}IA.exports.create=cIt;function cIt(t){let e=t?.algorithms||[...QV],r=dP(t?.options),s=e.map(gP.createHash);return{update:function(a,n){return s.forEach(c=>c.update(a,n)),this},digest:function(){return e.reduce((n,c)=>{let f=s.shift().digest(\"base64\"),p=new Ah(`${c}-${f}${r}`,t);if(p.algorithm&&p.digest){let h=p.algorithm;n[h]||(n[h]=[]),n[h].push(p)}return n},new Zm)}}}var uIt=gP.getHashes(),NSe=[\"md5\",\"whirlpool\",\"sha1\",\"sha224\",\"sha256\",\"sha384\",\"sha512\",\"sha3\",\"sha3-256\",\"sha3-384\",\"sha3-512\",\"sha3_256\",\"sha3_384\",\"sha3_512\"].filter(t=>uIt.includes(t));function fIt(t,e){return NSe.indexOf(t.toLowerCase())>=NSe.indexOf(e.toLowerCase())?t:e}});var TV=_(mg=>{\"use strict\";Object.defineProperty(mg,\"__esModule\",{value:!0});mg.Signature=mg.Envelope=void 0;mg.Envelope={fromJSON(t){return{payload:jN(t.payload)?Buffer.from(LSe(t.payload)):Buffer.alloc(0),payloadType:jN(t.payloadType)?globalThis.String(t.payloadType):\"\",signatures:globalThis.Array.isArray(t?.signatures)?t.signatures.map(e=>mg.Signature.fromJSON(e)):[]}},toJSON(t){let e={};return t.payload.length!==0&&(e.payload=MSe(t.payload)),t.payloadType!==\"\"&&(e.payloadType=t.payloadType),t.signatures?.length&&(e.signatures=t.signatures.map(r=>mg.Signature.toJSON(r))),e}};mg.Signature={fromJSON(t){return{sig:jN(t.sig)?Buffer.from(LSe(t.sig)):Buffer.alloc(0),keyid:jN(t.keyid)?globalThis.String(t.keyid):\"\"}},toJSON(t){let e={};return t.sig.length!==0&&(e.sig=MSe(t.sig)),t.keyid!==\"\"&&(e.keyid=t.keyid),e}};function LSe(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function MSe(t){return globalThis.Buffer.from(t).toString(\"base64\")}function jN(t){return t!=null}});var _Se=_(GN=>{\"use strict\";Object.defineProperty(GN,\"__esModule\",{value:!0});GN.Timestamp=void 0;GN.Timestamp={fromJSON(t){return{seconds:USe(t.seconds)?globalThis.String(t.seconds):\"0\",nanos:USe(t.nanos)?globalThis.Number(t.nanos):0}},toJSON(t){let e={};return t.seconds!==\"0\"&&(e.seconds=t.seconds),t.nanos!==0&&(e.nanos=Math.round(t.nanos)),e}};function USe(t){return t!=null}});var Ww=_(Ur=>{\"use strict\";Object.defineProperty(Ur,\"__esModule\",{value:!0});Ur.TimeRange=Ur.X509CertificateChain=Ur.SubjectAlternativeName=Ur.X509Certificate=Ur.DistinguishedName=Ur.ObjectIdentifierValuePair=Ur.ObjectIdentifier=Ur.PublicKeyIdentifier=Ur.PublicKey=Ur.RFC3161SignedTimestamp=Ur.LogId=Ur.MessageSignature=Ur.HashOutput=Ur.SubjectAlternativeNameType=Ur.PublicKeyDetails=Ur.HashAlgorithm=void 0;Ur.hashAlgorithmFromJSON=jSe;Ur.hashAlgorithmToJSON=GSe;Ur.publicKeyDetailsFromJSON=qSe;Ur.publicKeyDetailsToJSON=WSe;Ur.subjectAlternativeNameTypeFromJSON=YSe;Ur.subjectAlternativeNameTypeToJSON=VSe;var AIt=_Se(),yl;(function(t){t[t.HASH_ALGORITHM_UNSPECIFIED=0]=\"HASH_ALGORITHM_UNSPECIFIED\",t[t.SHA2_256=1]=\"SHA2_256\",t[t.SHA2_384=2]=\"SHA2_384\",t[t.SHA2_512=3]=\"SHA2_512\",t[t.SHA3_256=4]=\"SHA3_256\",t[t.SHA3_384=5]=\"SHA3_384\"})(yl||(Ur.HashAlgorithm=yl={}));function jSe(t){switch(t){case 0:case\"HASH_ALGORITHM_UNSPECIFIED\":return yl.HASH_ALGORITHM_UNSPECIFIED;case 1:case\"SHA2_256\":return yl.SHA2_256;case 2:case\"SHA2_384\":return yl.SHA2_384;case 3:case\"SHA2_512\":return yl.SHA2_512;case 4:case\"SHA3_256\":return yl.SHA3_256;case 5:case\"SHA3_384\":return yl.SHA3_384;default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum HashAlgorithm\")}}function GSe(t){switch(t){case yl.HASH_ALGORITHM_UNSPECIFIED:return\"HASH_ALGORITHM_UNSPECIFIED\";case yl.SHA2_256:return\"SHA2_256\";case yl.SHA2_384:return\"SHA2_384\";case yl.SHA2_512:return\"SHA2_512\";case yl.SHA3_256:return\"SHA3_256\";case yl.SHA3_384:return\"SHA3_384\";default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum HashAlgorithm\")}}var rn;(function(t){t[t.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]=\"PUBLIC_KEY_DETAILS_UNSPECIFIED\",t[t.PKCS1_RSA_PKCS1V5=1]=\"PKCS1_RSA_PKCS1V5\",t[t.PKCS1_RSA_PSS=2]=\"PKCS1_RSA_PSS\",t[t.PKIX_RSA_PKCS1V5=3]=\"PKIX_RSA_PKCS1V5\",t[t.PKIX_RSA_PSS=4]=\"PKIX_RSA_PSS\",t[t.PKIX_RSA_PKCS1V15_2048_SHA256=9]=\"PKIX_RSA_PKCS1V15_2048_SHA256\",t[t.PKIX_RSA_PKCS1V15_3072_SHA256=10]=\"PKIX_RSA_PKCS1V15_3072_SHA256\",t[t.PKIX_RSA_PKCS1V15_4096_SHA256=11]=\"PKIX_RSA_PKCS1V15_4096_SHA256\",t[t.PKIX_RSA_PSS_2048_SHA256=16]=\"PKIX_RSA_PSS_2048_SHA256\",t[t.PKIX_RSA_PSS_3072_SHA256=17]=\"PKIX_RSA_PSS_3072_SHA256\",t[t.PKIX_RSA_PSS_4096_SHA256=18]=\"PKIX_RSA_PSS_4096_SHA256\",t[t.PKIX_ECDSA_P256_HMAC_SHA_256=6]=\"PKIX_ECDSA_P256_HMAC_SHA_256\",t[t.PKIX_ECDSA_P256_SHA_256=5]=\"PKIX_ECDSA_P256_SHA_256\",t[t.PKIX_ECDSA_P384_SHA_384=12]=\"PKIX_ECDSA_P384_SHA_384\",t[t.PKIX_ECDSA_P521_SHA_512=13]=\"PKIX_ECDSA_P521_SHA_512\",t[t.PKIX_ED25519=7]=\"PKIX_ED25519\",t[t.PKIX_ED25519_PH=8]=\"PKIX_ED25519_PH\",t[t.LMS_SHA256=14]=\"LMS_SHA256\",t[t.LMOTS_SHA256=15]=\"LMOTS_SHA256\"})(rn||(Ur.PublicKeyDetails=rn={}));function qSe(t){switch(t){case 0:case\"PUBLIC_KEY_DETAILS_UNSPECIFIED\":return rn.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case\"PKCS1_RSA_PKCS1V5\":return rn.PKCS1_RSA_PKCS1V5;case 2:case\"PKCS1_RSA_PSS\":return rn.PKCS1_RSA_PSS;case 3:case\"PKIX_RSA_PKCS1V5\":return rn.PKIX_RSA_PKCS1V5;case 4:case\"PKIX_RSA_PSS\":return rn.PKIX_RSA_PSS;case 9:case\"PKIX_RSA_PKCS1V15_2048_SHA256\":return rn.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case\"PKIX_RSA_PKCS1V15_3072_SHA256\":return rn.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case\"PKIX_RSA_PKCS1V15_4096_SHA256\":return rn.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case\"PKIX_RSA_PSS_2048_SHA256\":return rn.PKIX_RSA_PSS_2048_SHA256;case 17:case\"PKIX_RSA_PSS_3072_SHA256\":return rn.PKIX_RSA_PSS_3072_SHA256;case 18:case\"PKIX_RSA_PSS_4096_SHA256\":return rn.PKIX_RSA_PSS_4096_SHA256;case 6:case\"PKIX_ECDSA_P256_HMAC_SHA_256\":return rn.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case\"PKIX_ECDSA_P256_SHA_256\":return rn.PKIX_ECDSA_P256_SHA_256;case 12:case\"PKIX_ECDSA_P384_SHA_384\":return rn.PKIX_ECDSA_P384_SHA_384;case 13:case\"PKIX_ECDSA_P521_SHA_512\":return rn.PKIX_ECDSA_P521_SHA_512;case 7:case\"PKIX_ED25519\":return rn.PKIX_ED25519;case 8:case\"PKIX_ED25519_PH\":return rn.PKIX_ED25519_PH;case 14:case\"LMS_SHA256\":return rn.LMS_SHA256;case 15:case\"LMOTS_SHA256\":return rn.LMOTS_SHA256;default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum PublicKeyDetails\")}}function WSe(t){switch(t){case rn.PUBLIC_KEY_DETAILS_UNSPECIFIED:return\"PUBLIC_KEY_DETAILS_UNSPECIFIED\";case rn.PKCS1_RSA_PKCS1V5:return\"PKCS1_RSA_PKCS1V5\";case rn.PKCS1_RSA_PSS:return\"PKCS1_RSA_PSS\";case rn.PKIX_RSA_PKCS1V5:return\"PKIX_RSA_PKCS1V5\";case rn.PKIX_RSA_PSS:return\"PKIX_RSA_PSS\";case rn.PKIX_RSA_PKCS1V15_2048_SHA256:return\"PKIX_RSA_PKCS1V15_2048_SHA256\";case rn.PKIX_RSA_PKCS1V15_3072_SHA256:return\"PKIX_RSA_PKCS1V15_3072_SHA256\";case rn.PKIX_RSA_PKCS1V15_4096_SHA256:return\"PKIX_RSA_PKCS1V15_4096_SHA256\";case rn.PKIX_RSA_PSS_2048_SHA256:return\"PKIX_RSA_PSS_2048_SHA256\";case rn.PKIX_RSA_PSS_3072_SHA256:return\"PKIX_RSA_PSS_3072_SHA256\";case rn.PKIX_RSA_PSS_4096_SHA256:return\"PKIX_RSA_PSS_4096_SHA256\";case rn.PKIX_ECDSA_P256_HMAC_SHA_256:return\"PKIX_ECDSA_P256_HMAC_SHA_256\";case rn.PKIX_ECDSA_P256_SHA_256:return\"PKIX_ECDSA_P256_SHA_256\";case rn.PKIX_ECDSA_P384_SHA_384:return\"PKIX_ECDSA_P384_SHA_384\";case rn.PKIX_ECDSA_P521_SHA_512:return\"PKIX_ECDSA_P521_SHA_512\";case rn.PKIX_ED25519:return\"PKIX_ED25519\";case rn.PKIX_ED25519_PH:return\"PKIX_ED25519_PH\";case rn.LMS_SHA256:return\"LMS_SHA256\";case rn.LMOTS_SHA256:return\"LMOTS_SHA256\";default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum PublicKeyDetails\")}}var CA;(function(t){t[t.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]=\"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\",t[t.EMAIL=1]=\"EMAIL\",t[t.URI=2]=\"URI\",t[t.OTHER_NAME=3]=\"OTHER_NAME\"})(CA||(Ur.SubjectAlternativeNameType=CA={}));function YSe(t){switch(t){case 0:case\"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\":return CA.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case\"EMAIL\":return CA.EMAIL;case 2:case\"URI\":return CA.URI;case 3:case\"OTHER_NAME\":return CA.OTHER_NAME;default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum SubjectAlternativeNameType\")}}function VSe(t){switch(t){case CA.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return\"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\";case CA.EMAIL:return\"EMAIL\";case CA.URI:return\"URI\";case CA.OTHER_NAME:return\"OTHER_NAME\";default:throw new globalThis.Error(\"Unrecognized enum value \"+t+\" for enum SubjectAlternativeNameType\")}}Ur.HashOutput={fromJSON(t){return{algorithm:ds(t.algorithm)?jSe(t.algorithm):0,digest:ds(t.digest)?Buffer.from(Xm(t.digest)):Buffer.alloc(0)}},toJSON(t){let e={};return t.algorithm!==0&&(e.algorithm=GSe(t.algorithm)),t.digest.length!==0&&(e.digest=$m(t.digest)),e}};Ur.MessageSignature={fromJSON(t){return{messageDigest:ds(t.messageDigest)?Ur.HashOutput.fromJSON(t.messageDigest):void 0,signature:ds(t.signature)?Buffer.from(Xm(t.signature)):Buffer.alloc(0)}},toJSON(t){let e={};return t.messageDigest!==void 0&&(e.messageDigest=Ur.HashOutput.toJSON(t.messageDigest)),t.signature.length!==0&&(e.signature=$m(t.signature)),e}};Ur.LogId={fromJSON(t){return{keyId:ds(t.keyId)?Buffer.from(Xm(t.keyId)):Buffer.alloc(0)}},toJSON(t){let e={};return t.keyId.length!==0&&(e.keyId=$m(t.keyId)),e}};Ur.RFC3161SignedTimestamp={fromJSON(t){return{signedTimestamp:ds(t.signedTimestamp)?Buffer.from(Xm(t.signedTimestamp)):Buffer.alloc(0)}},toJSON(t){let e={};return t.signedTimestamp.length!==0&&(e.signedTimestamp=$m(t.signedTimestamp)),e}};Ur.PublicKey={fromJSON(t){return{rawBytes:ds(t.rawBytes)?Buffer.from(Xm(t.rawBytes)):void 0,keyDetails:ds(t.keyDetails)?qSe(t.keyDetails):0,validFor:ds(t.validFor)?Ur.TimeRange.fromJSON(t.validFor):void 0}},toJSON(t){let e={};return t.rawBytes!==void 0&&(e.rawBytes=$m(t.rawBytes)),t.keyDetails!==0&&(e.keyDetails=WSe(t.keyDetails)),t.validFor!==void 0&&(e.validFor=Ur.TimeRange.toJSON(t.validFor)),e}};Ur.PublicKeyIdentifier={fromJSON(t){return{hint:ds(t.hint)?globalThis.String(t.hint):\"\"}},toJSON(t){let e={};return t.hint!==\"\"&&(e.hint=t.hint),e}};Ur.ObjectIdentifier={fromJSON(t){return{id:globalThis.Array.isArray(t?.id)?t.id.map(e=>globalThis.Number(e)):[]}},toJSON(t){let e={};return t.id?.length&&(e.id=t.id.map(r=>Math.round(r))),e}};Ur.ObjectIdentifierValuePair={fromJSON(t){return{oid:ds(t.oid)?Ur.ObjectIdentifier.fromJSON(t.oid):void 0,value:ds(t.value)?Buffer.from(Xm(t.value)):Buffer.alloc(0)}},toJSON(t){let e={};return t.oid!==void 0&&(e.oid=Ur.ObjectIdentifier.toJSON(t.oid)),t.value.length!==0&&(e.value=$m(t.value)),e}};Ur.DistinguishedName={fromJSON(t){return{organization:ds(t.organization)?globalThis.String(t.organization):\"\",commonName:ds(t.commonName)?globalThis.String(t.commonName):\"\"}},toJSON(t){let e={};return t.organization!==\"\"&&(e.organization=t.organization),t.commonName!==\"\"&&(e.commonName=t.commonName),e}};Ur.X509Certificate={fromJSON(t){return{rawBytes:ds(t.rawBytes)?Buffer.from(Xm(t.rawBytes)):Buffer.alloc(0)}},toJSON(t){let e={};return t.rawBytes.length!==0&&(e.rawBytes=$m(t.rawBytes)),e}};Ur.SubjectAlternativeName={fromJSON(t){return{type:ds(t.type)?YSe(t.type):0,identity:ds(t.regexp)?{$case:\"regexp\",regexp:globalThis.String(t.regexp)}:ds(t.value)?{$case:\"value\",value:globalThis.String(t.value)}:void 0}},toJSON(t){let e={};return t.type!==0&&(e.type=VSe(t.type)),t.identity?.$case===\"regexp\"?e.regexp=t.identity.regexp:t.identity?.$case===\"value\"&&(e.value=t.identity.value),e}};Ur.X509CertificateChain={fromJSON(t){return{certificates:globalThis.Array.isArray(t?.certificates)?t.certificates.map(e=>Ur.X509Certificate.fromJSON(e)):[]}},toJSON(t){let e={};return t.certificates?.length&&(e.certificates=t.certificates.map(r=>Ur.X509Certificate.toJSON(r))),e}};Ur.TimeRange={fromJSON(t){return{start:ds(t.start)?HSe(t.start):void 0,end:ds(t.end)?HSe(t.end):void 0}},toJSON(t){let e={};return t.start!==void 0&&(e.start=t.start.toISOString()),t.end!==void 0&&(e.end=t.end.toISOString()),e}};function Xm(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function $m(t){return globalThis.Buffer.from(t).toString(\"base64\")}function pIt(t){let e=(globalThis.Number(t.seconds)||0)*1e3;return e+=(t.nanos||0)/1e6,new globalThis.Date(e)}function HSe(t){return t instanceof globalThis.Date?t:typeof t==\"string\"?new globalThis.Date(t):pIt(AIt.Timestamp.fromJSON(t))}function ds(t){return t!=null}});var FV=_(ms=>{\"use strict\";Object.defineProperty(ms,\"__esModule\",{value:!0});ms.TransparencyLogEntry=ms.InclusionPromise=ms.InclusionProof=ms.Checkpoint=ms.KindVersion=void 0;var JSe=Ww();ms.KindVersion={fromJSON(t){return{kind:Ta(t.kind)?globalThis.String(t.kind):\"\",version:Ta(t.version)?globalThis.String(t.version):\"\"}},toJSON(t){let e={};return t.kind!==\"\"&&(e.kind=t.kind),t.version!==\"\"&&(e.version=t.version),e}};ms.Checkpoint={fromJSON(t){return{envelope:Ta(t.envelope)?globalThis.String(t.envelope):\"\"}},toJSON(t){let e={};return t.envelope!==\"\"&&(e.envelope=t.envelope),e}};ms.InclusionProof={fromJSON(t){return{logIndex:Ta(t.logIndex)?globalThis.String(t.logIndex):\"0\",rootHash:Ta(t.rootHash)?Buffer.from(qN(t.rootHash)):Buffer.alloc(0),treeSize:Ta(t.treeSize)?globalThis.String(t.treeSize):\"0\",hashes:globalThis.Array.isArray(t?.hashes)?t.hashes.map(e=>Buffer.from(qN(e))):[],checkpoint:Ta(t.checkpoint)?ms.Checkpoint.fromJSON(t.checkpoint):void 0}},toJSON(t){let e={};return t.logIndex!==\"0\"&&(e.logIndex=t.logIndex),t.rootHash.length!==0&&(e.rootHash=WN(t.rootHash)),t.treeSize!==\"0\"&&(e.treeSize=t.treeSize),t.hashes?.length&&(e.hashes=t.hashes.map(r=>WN(r))),t.checkpoint!==void 0&&(e.checkpoint=ms.Checkpoint.toJSON(t.checkpoint)),e}};ms.InclusionPromise={fromJSON(t){return{signedEntryTimestamp:Ta(t.signedEntryTimestamp)?Buffer.from(qN(t.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(t){let e={};return t.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=WN(t.signedEntryTimestamp)),e}};ms.TransparencyLogEntry={fromJSON(t){return{logIndex:Ta(t.logIndex)?globalThis.String(t.logIndex):\"0\",logId:Ta(t.logId)?JSe.LogId.fromJSON(t.logId):void 0,kindVersion:Ta(t.kindVersion)?ms.KindVersion.fromJSON(t.kindVersion):void 0,integratedTime:Ta(t.integratedTime)?globalThis.String(t.integratedTime):\"0\",inclusionPromise:Ta(t.inclusionPromise)?ms.InclusionPromise.fromJSON(t.inclusionPromise):void 0,inclusionProof:Ta(t.inclusionProof)?ms.InclusionProof.fromJSON(t.inclusionProof):void 0,canonicalizedBody:Ta(t.canonicalizedBody)?Buffer.from(qN(t.canonicalizedBody)):Buffer.alloc(0)}},toJSON(t){let e={};return t.logIndex!==\"0\"&&(e.logIndex=t.logIndex),t.logId!==void 0&&(e.logId=JSe.LogId.toJSON(t.logId)),t.kindVersion!==void 0&&(e.kindVersion=ms.KindVersion.toJSON(t.kindVersion)),t.integratedTime!==\"0\"&&(e.integratedTime=t.integratedTime),t.inclusionPromise!==void 0&&(e.inclusionPromise=ms.InclusionPromise.toJSON(t.inclusionPromise)),t.inclusionProof!==void 0&&(e.inclusionProof=ms.InclusionProof.toJSON(t.inclusionProof)),t.canonicalizedBody.length!==0&&(e.canonicalizedBody=WN(t.canonicalizedBody)),e}};function qN(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function WN(t){return globalThis.Buffer.from(t).toString(\"base64\")}function Ta(t){return t!=null}});var NV=_(Zc=>{\"use strict\";Object.defineProperty(Zc,\"__esModule\",{value:!0});Zc.Bundle=Zc.VerificationMaterial=Zc.TimestampVerificationData=void 0;var KSe=TV(),wA=Ww(),zSe=FV();Zc.TimestampVerificationData={fromJSON(t){return{rfc3161Timestamps:globalThis.Array.isArray(t?.rfc3161Timestamps)?t.rfc3161Timestamps.map(e=>wA.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(t){let e={};return t.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=t.rfc3161Timestamps.map(r=>wA.RFC3161SignedTimestamp.toJSON(r))),e}};Zc.VerificationMaterial={fromJSON(t){return{content:yg(t.publicKey)?{$case:\"publicKey\",publicKey:wA.PublicKeyIdentifier.fromJSON(t.publicKey)}:yg(t.x509CertificateChain)?{$case:\"x509CertificateChain\",x509CertificateChain:wA.X509CertificateChain.fromJSON(t.x509CertificateChain)}:yg(t.certificate)?{$case:\"certificate\",certificate:wA.X509Certificate.fromJSON(t.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(t?.tlogEntries)?t.tlogEntries.map(e=>zSe.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:yg(t.timestampVerificationData)?Zc.TimestampVerificationData.fromJSON(t.timestampVerificationData):void 0}},toJSON(t){let e={};return t.content?.$case===\"publicKey\"?e.publicKey=wA.PublicKeyIdentifier.toJSON(t.content.publicKey):t.content?.$case===\"x509CertificateChain\"?e.x509CertificateChain=wA.X509CertificateChain.toJSON(t.content.x509CertificateChain):t.content?.$case===\"certificate\"&&(e.certificate=wA.X509Certificate.toJSON(t.content.certificate)),t.tlogEntries?.length&&(e.tlogEntries=t.tlogEntries.map(r=>zSe.TransparencyLogEntry.toJSON(r))),t.timestampVerificationData!==void 0&&(e.timestampVerificationData=Zc.TimestampVerificationData.toJSON(t.timestampVerificationData)),e}};Zc.Bundle={fromJSON(t){return{mediaType:yg(t.mediaType)?globalThis.String(t.mediaType):\"\",verificationMaterial:yg(t.verificationMaterial)?Zc.VerificationMaterial.fromJSON(t.verificationMaterial):void 0,content:yg(t.messageSignature)?{$case:\"messageSignature\",messageSignature:wA.MessageSignature.fromJSON(t.messageSignature)}:yg(t.dsseEnvelope)?{$case:\"dsseEnvelope\",dsseEnvelope:KSe.Envelope.fromJSON(t.dsseEnvelope)}:void 0}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.verificationMaterial!==void 0&&(e.verificationMaterial=Zc.VerificationMaterial.toJSON(t.verificationMaterial)),t.content?.$case===\"messageSignature\"?e.messageSignature=wA.MessageSignature.toJSON(t.content.messageSignature):t.content?.$case===\"dsseEnvelope\"&&(e.dsseEnvelope=KSe.Envelope.toJSON(t.content.dsseEnvelope)),e}};function yg(t){return t!=null}});var OV=_(Ti=>{\"use strict\";Object.defineProperty(Ti,\"__esModule\",{value:!0});Ti.ClientTrustConfig=Ti.SigningConfig=Ti.TrustedRoot=Ti.CertificateAuthority=Ti.TransparencyLogInstance=void 0;var El=Ww();Ti.TransparencyLogInstance={fromJSON(t){return{baseUrl:ia(t.baseUrl)?globalThis.String(t.baseUrl):\"\",hashAlgorithm:ia(t.hashAlgorithm)?(0,El.hashAlgorithmFromJSON)(t.hashAlgorithm):0,publicKey:ia(t.publicKey)?El.PublicKey.fromJSON(t.publicKey):void 0,logId:ia(t.logId)?El.LogId.fromJSON(t.logId):void 0,checkpointKeyId:ia(t.checkpointKeyId)?El.LogId.fromJSON(t.checkpointKeyId):void 0}},toJSON(t){let e={};return t.baseUrl!==\"\"&&(e.baseUrl=t.baseUrl),t.hashAlgorithm!==0&&(e.hashAlgorithm=(0,El.hashAlgorithmToJSON)(t.hashAlgorithm)),t.publicKey!==void 0&&(e.publicKey=El.PublicKey.toJSON(t.publicKey)),t.logId!==void 0&&(e.logId=El.LogId.toJSON(t.logId)),t.checkpointKeyId!==void 0&&(e.checkpointKeyId=El.LogId.toJSON(t.checkpointKeyId)),e}};Ti.CertificateAuthority={fromJSON(t){return{subject:ia(t.subject)?El.DistinguishedName.fromJSON(t.subject):void 0,uri:ia(t.uri)?globalThis.String(t.uri):\"\",certChain:ia(t.certChain)?El.X509CertificateChain.fromJSON(t.certChain):void 0,validFor:ia(t.validFor)?El.TimeRange.fromJSON(t.validFor):void 0}},toJSON(t){let e={};return t.subject!==void 0&&(e.subject=El.DistinguishedName.toJSON(t.subject)),t.uri!==\"\"&&(e.uri=t.uri),t.certChain!==void 0&&(e.certChain=El.X509CertificateChain.toJSON(t.certChain)),t.validFor!==void 0&&(e.validFor=El.TimeRange.toJSON(t.validFor)),e}};Ti.TrustedRoot={fromJSON(t){return{mediaType:ia(t.mediaType)?globalThis.String(t.mediaType):\"\",tlogs:globalThis.Array.isArray(t?.tlogs)?t.tlogs.map(e=>Ti.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(t?.certificateAuthorities)?t.certificateAuthorities.map(e=>Ti.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(t?.ctlogs)?t.ctlogs.map(e=>Ti.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(t?.timestampAuthorities)?t.timestampAuthorities.map(e=>Ti.CertificateAuthority.fromJSON(e)):[]}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.tlogs?.length&&(e.tlogs=t.tlogs.map(r=>Ti.TransparencyLogInstance.toJSON(r))),t.certificateAuthorities?.length&&(e.certificateAuthorities=t.certificateAuthorities.map(r=>Ti.CertificateAuthority.toJSON(r))),t.ctlogs?.length&&(e.ctlogs=t.ctlogs.map(r=>Ti.TransparencyLogInstance.toJSON(r))),t.timestampAuthorities?.length&&(e.timestampAuthorities=t.timestampAuthorities.map(r=>Ti.CertificateAuthority.toJSON(r))),e}};Ti.SigningConfig={fromJSON(t){return{mediaType:ia(t.mediaType)?globalThis.String(t.mediaType):\"\",caUrl:ia(t.caUrl)?globalThis.String(t.caUrl):\"\",oidcUrl:ia(t.oidcUrl)?globalThis.String(t.oidcUrl):\"\",tlogUrls:globalThis.Array.isArray(t?.tlogUrls)?t.tlogUrls.map(e=>globalThis.String(e)):[],tsaUrls:globalThis.Array.isArray(t?.tsaUrls)?t.tsaUrls.map(e=>globalThis.String(e)):[]}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.caUrl!==\"\"&&(e.caUrl=t.caUrl),t.oidcUrl!==\"\"&&(e.oidcUrl=t.oidcUrl),t.tlogUrls?.length&&(e.tlogUrls=t.tlogUrls),t.tsaUrls?.length&&(e.tsaUrls=t.tsaUrls),e}};Ti.ClientTrustConfig={fromJSON(t){return{mediaType:ia(t.mediaType)?globalThis.String(t.mediaType):\"\",trustedRoot:ia(t.trustedRoot)?Ti.TrustedRoot.fromJSON(t.trustedRoot):void 0,signingConfig:ia(t.signingConfig)?Ti.SigningConfig.fromJSON(t.signingConfig):void 0}},toJSON(t){let e={};return t.mediaType!==\"\"&&(e.mediaType=t.mediaType),t.trustedRoot!==void 0&&(e.trustedRoot=Ti.TrustedRoot.toJSON(t.trustedRoot)),t.signingConfig!==void 0&&(e.signingConfig=Ti.SigningConfig.toJSON(t.signingConfig)),e}};function ia(t){return t!=null}});var $Se=_(Vr=>{\"use strict\";Object.defineProperty(Vr,\"__esModule\",{value:!0});Vr.Input=Vr.Artifact=Vr.ArtifactVerificationOptions_ObserverTimestampOptions=Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=Vr.ArtifactVerificationOptions_TimestampAuthorityOptions=Vr.ArtifactVerificationOptions_CtlogOptions=Vr.ArtifactVerificationOptions_TlogOptions=Vr.ArtifactVerificationOptions=Vr.PublicKeyIdentities=Vr.CertificateIdentities=Vr.CertificateIdentity=void 0;var ZSe=NV(),Eg=Ww(),XSe=OV();Vr.CertificateIdentity={fromJSON(t){return{issuer:gi(t.issuer)?globalThis.String(t.issuer):\"\",san:gi(t.san)?Eg.SubjectAlternativeName.fromJSON(t.san):void 0,oids:globalThis.Array.isArray(t?.oids)?t.oids.map(e=>Eg.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(t){let e={};return t.issuer!==\"\"&&(e.issuer=t.issuer),t.san!==void 0&&(e.san=Eg.SubjectAlternativeName.toJSON(t.san)),t.oids?.length&&(e.oids=t.oids.map(r=>Eg.ObjectIdentifierValuePair.toJSON(r))),e}};Vr.CertificateIdentities={fromJSON(t){return{identities:globalThis.Array.isArray(t?.identities)?t.identities.map(e=>Vr.CertificateIdentity.fromJSON(e)):[]}},toJSON(t){let e={};return t.identities?.length&&(e.identities=t.identities.map(r=>Vr.CertificateIdentity.toJSON(r))),e}};Vr.PublicKeyIdentities={fromJSON(t){return{publicKeys:globalThis.Array.isArray(t?.publicKeys)?t.publicKeys.map(e=>Eg.PublicKey.fromJSON(e)):[]}},toJSON(t){let e={};return t.publicKeys?.length&&(e.publicKeys=t.publicKeys.map(r=>Eg.PublicKey.toJSON(r))),e}};Vr.ArtifactVerificationOptions={fromJSON(t){return{signers:gi(t.certificateIdentities)?{$case:\"certificateIdentities\",certificateIdentities:Vr.CertificateIdentities.fromJSON(t.certificateIdentities)}:gi(t.publicKeys)?{$case:\"publicKeys\",publicKeys:Vr.PublicKeyIdentities.fromJSON(t.publicKeys)}:void 0,tlogOptions:gi(t.tlogOptions)?Vr.ArtifactVerificationOptions_TlogOptions.fromJSON(t.tlogOptions):void 0,ctlogOptions:gi(t.ctlogOptions)?Vr.ArtifactVerificationOptions_CtlogOptions.fromJSON(t.ctlogOptions):void 0,tsaOptions:gi(t.tsaOptions)?Vr.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(t.tsaOptions):void 0,integratedTsOptions:gi(t.integratedTsOptions)?Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(t.integratedTsOptions):void 0,observerOptions:gi(t.observerOptions)?Vr.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(t.observerOptions):void 0}},toJSON(t){let e={};return t.signers?.$case===\"certificateIdentities\"?e.certificateIdentities=Vr.CertificateIdentities.toJSON(t.signers.certificateIdentities):t.signers?.$case===\"publicKeys\"&&(e.publicKeys=Vr.PublicKeyIdentities.toJSON(t.signers.publicKeys)),t.tlogOptions!==void 0&&(e.tlogOptions=Vr.ArtifactVerificationOptions_TlogOptions.toJSON(t.tlogOptions)),t.ctlogOptions!==void 0&&(e.ctlogOptions=Vr.ArtifactVerificationOptions_CtlogOptions.toJSON(t.ctlogOptions)),t.tsaOptions!==void 0&&(e.tsaOptions=Vr.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(t.tsaOptions)),t.integratedTsOptions!==void 0&&(e.integratedTsOptions=Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(t.integratedTsOptions)),t.observerOptions!==void 0&&(e.observerOptions=Vr.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(t.observerOptions)),e}};Vr.ArtifactVerificationOptions_TlogOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,performOnlineVerification:gi(t.performOnlineVerification)?globalThis.Boolean(t.performOnlineVerification):!1,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.performOnlineVerification!==!1&&(e.performOnlineVerification=t.performOnlineVerification),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_CtlogOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(t){return{threshold:gi(t.threshold)?globalThis.Number(t.threshold):0,disable:gi(t.disable)?globalThis.Boolean(t.disable):!1}},toJSON(t){let e={};return t.threshold!==0&&(e.threshold=Math.round(t.threshold)),t.disable!==!1&&(e.disable=t.disable),e}};Vr.Artifact={fromJSON(t){return{data:gi(t.artifactUri)?{$case:\"artifactUri\",artifactUri:globalThis.String(t.artifactUri)}:gi(t.artifact)?{$case:\"artifact\",artifact:Buffer.from(hIt(t.artifact))}:gi(t.artifactDigest)?{$case:\"artifactDigest\",artifactDigest:Eg.HashOutput.fromJSON(t.artifactDigest)}:void 0}},toJSON(t){let e={};return t.data?.$case===\"artifactUri\"?e.artifactUri=t.data.artifactUri:t.data?.$case===\"artifact\"?e.artifact=gIt(t.data.artifact):t.data?.$case===\"artifactDigest\"&&(e.artifactDigest=Eg.HashOutput.toJSON(t.data.artifactDigest)),e}};Vr.Input={fromJSON(t){return{artifactTrustRoot:gi(t.artifactTrustRoot)?XSe.TrustedRoot.fromJSON(t.artifactTrustRoot):void 0,artifactVerificationOptions:gi(t.artifactVerificationOptions)?Vr.ArtifactVerificationOptions.fromJSON(t.artifactVerificationOptions):void 0,bundle:gi(t.bundle)?ZSe.Bundle.fromJSON(t.bundle):void 0,artifact:gi(t.artifact)?Vr.Artifact.fromJSON(t.artifact):void 0}},toJSON(t){let e={};return t.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=XSe.TrustedRoot.toJSON(t.artifactTrustRoot)),t.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=Vr.ArtifactVerificationOptions.toJSON(t.artifactVerificationOptions)),t.bundle!==void 0&&(e.bundle=ZSe.Bundle.toJSON(t.bundle)),t.artifact!==void 0&&(e.artifact=Vr.Artifact.toJSON(t.artifact)),e}};function hIt(t){return Uint8Array.from(globalThis.Buffer.from(t,\"base64\"))}function gIt(t){return globalThis.Buffer.from(t).toString(\"base64\")}function gi(t){return t!=null}});var mP=_(Xc=>{\"use strict\";var dIt=Xc&&Xc.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Yw=Xc&&Xc.__exportStar||function(t,e){for(var r in t)r!==\"default\"&&!Object.prototype.hasOwnProperty.call(e,r)&&dIt(e,t,r)};Object.defineProperty(Xc,\"__esModule\",{value:!0});Yw(TV(),Xc);Yw(NV(),Xc);Yw(Ww(),Xc);Yw(FV(),Xc);Yw(OV(),Xc);Yw($Se(),Xc)});var YN=_(Il=>{\"use strict\";Object.defineProperty(Il,\"__esModule\",{value:!0});Il.BUNDLE_V03_MEDIA_TYPE=Il.BUNDLE_V03_LEGACY_MEDIA_TYPE=Il.BUNDLE_V02_MEDIA_TYPE=Il.BUNDLE_V01_MEDIA_TYPE=void 0;Il.isBundleWithCertificateChain=mIt;Il.isBundleWithPublicKey=yIt;Il.isBundleWithMessageSignature=EIt;Il.isBundleWithDsseEnvelope=IIt;Il.BUNDLE_V01_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle+json;version=0.1\";Il.BUNDLE_V02_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle+json;version=0.2\";Il.BUNDLE_V03_LEGACY_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle+json;version=0.3\";Il.BUNDLE_V03_MEDIA_TYPE=\"application/vnd.dev.sigstore.bundle.v0.3+json\";function mIt(t){return t.verificationMaterial.content.$case===\"x509CertificateChain\"}function yIt(t){return t.verificationMaterial.content.$case===\"publicKey\"}function EIt(t){return t.content.$case===\"messageSignature\"}function IIt(t){return t.content.$case===\"dsseEnvelope\"}});var tDe=_(JN=>{\"use strict\";Object.defineProperty(JN,\"__esModule\",{value:!0});JN.toMessageSignatureBundle=wIt;JN.toDSSEBundle=BIt;var CIt=mP(),VN=YN();function wIt(t){return{mediaType:t.certificateChain?VN.BUNDLE_V02_MEDIA_TYPE:VN.BUNDLE_V03_MEDIA_TYPE,content:{$case:\"messageSignature\",messageSignature:{messageDigest:{algorithm:CIt.HashAlgorithm.SHA2_256,digest:t.digest},signature:t.signature}},verificationMaterial:eDe(t)}}function BIt(t){return{mediaType:t.certificateChain?VN.BUNDLE_V02_MEDIA_TYPE:VN.BUNDLE_V03_MEDIA_TYPE,content:{$case:\"dsseEnvelope\",dsseEnvelope:vIt(t)},verificationMaterial:eDe(t)}}function vIt(t){return{payloadType:t.artifactType,payload:t.artifact,signatures:[SIt(t)]}}function SIt(t){return{keyid:t.keyHint||\"\",sig:t.signature}}function eDe(t){return{content:DIt(t),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}function DIt(t){return t.certificate?t.certificateChain?{$case:\"x509CertificateChain\",x509CertificateChain:{certificates:[{rawBytes:t.certificate}]}}:{$case:\"certificate\",certificate:{rawBytes:t.certificate}}:{$case:\"publicKey\",publicKey:{hint:t.keyHint||\"\"}}}});var MV=_(KN=>{\"use strict\";Object.defineProperty(KN,\"__esModule\",{value:!0});KN.ValidationError=void 0;var LV=class extends Error{constructor(e,r){super(e),this.fields=r}};KN.ValidationError=LV});var UV=_(ey=>{\"use strict\";Object.defineProperty(ey,\"__esModule\",{value:!0});ey.assertBundle=PIt;ey.assertBundleV01=rDe;ey.isBundleV01=bIt;ey.assertBundleV02=xIt;ey.assertBundleLatest=kIt;var zN=MV();function PIt(t){let e=ZN(t);if(e.length>0)throw new zN.ValidationError(\"invalid bundle\",e)}function rDe(t){let e=[];if(e.push(...ZN(t)),e.push(...QIt(t)),e.length>0)throw new zN.ValidationError(\"invalid v0.1 bundle\",e)}function bIt(t){try{return rDe(t),!0}catch{return!1}}function xIt(t){let e=[];if(e.push(...ZN(t)),e.push(...nDe(t)),e.length>0)throw new zN.ValidationError(\"invalid v0.2 bundle\",e)}function kIt(t){let e=[];if(e.push(...ZN(t)),e.push(...nDe(t)),e.push(...RIt(t)),e.length>0)throw new zN.ValidationError(\"invalid bundle\",e)}function ZN(t){let e=[];if((t.mediaType===void 0||!t.mediaType.match(/^application\\/vnd\\.dev\\.sigstore\\.bundle\\+json;version=\\d\\.\\d/)&&!t.mediaType.match(/^application\\/vnd\\.dev\\.sigstore\\.bundle\\.v\\d\\.\\d\\+json/))&&e.push(\"mediaType\"),t.content===void 0)e.push(\"content\");else switch(t.content.$case){case\"messageSignature\":t.content.messageSignature.messageDigest===void 0?e.push(\"content.messageSignature.messageDigest\"):t.content.messageSignature.messageDigest.digest.length===0&&e.push(\"content.messageSignature.messageDigest.digest\"),t.content.messageSignature.signature.length===0&&e.push(\"content.messageSignature.signature\");break;case\"dsseEnvelope\":t.content.dsseEnvelope.payload.length===0&&e.push(\"content.dsseEnvelope.payload\"),t.content.dsseEnvelope.signatures.length!==1?e.push(\"content.dsseEnvelope.signatures\"):t.content.dsseEnvelope.signatures[0].sig.length===0&&e.push(\"content.dsseEnvelope.signatures[0].sig\");break}if(t.verificationMaterial===void 0)e.push(\"verificationMaterial\");else{if(t.verificationMaterial.content===void 0)e.push(\"verificationMaterial.content\");else switch(t.verificationMaterial.content.$case){case\"x509CertificateChain\":t.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push(\"verificationMaterial.content.x509CertificateChain.certificates\"),t.verificationMaterial.content.x509CertificateChain.certificates.forEach((r,s)=>{r.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${s}].rawBytes`)});break;case\"certificate\":t.verificationMaterial.content.certificate.rawBytes.length===0&&e.push(\"verificationMaterial.content.certificate.rawBytes\");break}t.verificationMaterial.tlogEntries===void 0?e.push(\"verificationMaterial.tlogEntries\"):t.verificationMaterial.tlogEntries.length>0&&t.verificationMaterial.tlogEntries.forEach((r,s)=>{r.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].logId`),r.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].kindVersion`)})}return e}function QIt(t){let e=[];return t.verificationMaterial&&t.verificationMaterial.tlogEntries?.length>0&&t.verificationMaterial.tlogEntries.forEach((r,s)=>{r.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].inclusionPromise`)}),e}function nDe(t){let e=[];return t.verificationMaterial&&t.verificationMaterial.tlogEntries?.length>0&&t.verificationMaterial.tlogEntries.forEach((r,s)=>{r.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${s}].inclusionProof`):r.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${s}].inclusionProof.checkpoint`)}),e}function RIt(t){let e=[];return t.verificationMaterial?.content?.$case===\"x509CertificateChain\"&&e.push(\"verificationMaterial.content.$case\"),e}});var sDe=_(BA=>{\"use strict\";Object.defineProperty(BA,\"__esModule\",{value:!0});BA.envelopeToJSON=BA.envelopeFromJSON=BA.bundleToJSON=BA.bundleFromJSON=void 0;var XN=mP(),iDe=YN(),_V=UV(),TIt=t=>{let e=XN.Bundle.fromJSON(t);switch(e.mediaType){case iDe.BUNDLE_V01_MEDIA_TYPE:(0,_V.assertBundleV01)(e);break;case iDe.BUNDLE_V02_MEDIA_TYPE:(0,_V.assertBundleV02)(e);break;default:(0,_V.assertBundleLatest)(e);break}return e};BA.bundleFromJSON=TIt;var FIt=t=>XN.Bundle.toJSON(t);BA.bundleToJSON=FIt;var NIt=t=>XN.Envelope.fromJSON(t);BA.envelopeFromJSON=NIt;var OIt=t=>XN.Envelope.toJSON(t);BA.envelopeToJSON=OIt});var EP=_(Zr=>{\"use strict\";Object.defineProperty(Zr,\"__esModule\",{value:!0});Zr.isBundleV01=Zr.assertBundleV02=Zr.assertBundleV01=Zr.assertBundleLatest=Zr.assertBundle=Zr.envelopeToJSON=Zr.envelopeFromJSON=Zr.bundleToJSON=Zr.bundleFromJSON=Zr.ValidationError=Zr.isBundleWithPublicKey=Zr.isBundleWithMessageSignature=Zr.isBundleWithDsseEnvelope=Zr.isBundleWithCertificateChain=Zr.BUNDLE_V03_MEDIA_TYPE=Zr.BUNDLE_V03_LEGACY_MEDIA_TYPE=Zr.BUNDLE_V02_MEDIA_TYPE=Zr.BUNDLE_V01_MEDIA_TYPE=Zr.toMessageSignatureBundle=Zr.toDSSEBundle=void 0;var oDe=tDe();Object.defineProperty(Zr,\"toDSSEBundle\",{enumerable:!0,get:function(){return oDe.toDSSEBundle}});Object.defineProperty(Zr,\"toMessageSignatureBundle\",{enumerable:!0,get:function(){return oDe.toMessageSignatureBundle}});var Ig=YN();Object.defineProperty(Zr,\"BUNDLE_V01_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V01_MEDIA_TYPE}});Object.defineProperty(Zr,\"BUNDLE_V02_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V02_MEDIA_TYPE}});Object.defineProperty(Zr,\"BUNDLE_V03_LEGACY_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V03_LEGACY_MEDIA_TYPE}});Object.defineProperty(Zr,\"BUNDLE_V03_MEDIA_TYPE\",{enumerable:!0,get:function(){return Ig.BUNDLE_V03_MEDIA_TYPE}});Object.defineProperty(Zr,\"isBundleWithCertificateChain\",{enumerable:!0,get:function(){return Ig.isBundleWithCertificateChain}});Object.defineProperty(Zr,\"isBundleWithDsseEnvelope\",{enumerable:!0,get:function(){return Ig.isBundleWithDsseEnvelope}});Object.defineProperty(Zr,\"isBundleWithMessageSignature\",{enumerable:!0,get:function(){return Ig.isBundleWithMessageSignature}});Object.defineProperty(Zr,\"isBundleWithPublicKey\",{enumerable:!0,get:function(){return Ig.isBundleWithPublicKey}});var LIt=MV();Object.defineProperty(Zr,\"ValidationError\",{enumerable:!0,get:function(){return LIt.ValidationError}});var $N=sDe();Object.defineProperty(Zr,\"bundleFromJSON\",{enumerable:!0,get:function(){return $N.bundleFromJSON}});Object.defineProperty(Zr,\"bundleToJSON\",{enumerable:!0,get:function(){return $N.bundleToJSON}});Object.defineProperty(Zr,\"envelopeFromJSON\",{enumerable:!0,get:function(){return $N.envelopeFromJSON}});Object.defineProperty(Zr,\"envelopeToJSON\",{enumerable:!0,get:function(){return $N.envelopeToJSON}});var yP=UV();Object.defineProperty(Zr,\"assertBundle\",{enumerable:!0,get:function(){return yP.assertBundle}});Object.defineProperty(Zr,\"assertBundleLatest\",{enumerable:!0,get:function(){return yP.assertBundleLatest}});Object.defineProperty(Zr,\"assertBundleV01\",{enumerable:!0,get:function(){return yP.assertBundleV01}});Object.defineProperty(Zr,\"assertBundleV02\",{enumerable:!0,get:function(){return yP.assertBundleV02}});Object.defineProperty(Zr,\"isBundleV01\",{enumerable:!0,get:function(){return yP.isBundleV01}})});var IP=_(tO=>{\"use strict\";Object.defineProperty(tO,\"__esModule\",{value:!0});tO.ByteStream=void 0;var HV=class extends Error{},eO=class t{constructor(e){this.start=0,e?(this.buf=e,this.view=Buffer.from(e)):(this.buf=new ArrayBuffer(0),this.view=Buffer.from(this.buf))}get buffer(){return this.view.subarray(0,this.start)}get length(){return this.view.byteLength}get position(){return this.start}seek(e){this.start=e}slice(e,r){let s=e+r;if(s>this.length)throw new HV(\"request past end of buffer\");return this.view.subarray(e,s)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let r=new Uint16Array([e]),s=new Uint8Array(r.buffer);this.view[this.start]=s[1],this.view[this.start+1]=s[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let r=new Uint32Array([e]),s=new Uint8Array(r.buffer);this.view[this.start]=s[2],this.view[this.start+1]=s[1],this.view[this.start+2]=s[0],this.start+=3}appendView(e){this.ensureCapacity(e.length),this.view.set(e,this.start),this.start+=e.length}getBlock(e){if(e<=0)return Buffer.alloc(0);if(this.start+e>this.view.length)throw new Error(\"request past end of buffer\");let r=this.view.subarray(this.start,this.start+e);return this.start+=e,r}getUint8(){return this.getBlock(1)[0]}getUint16(){let e=this.getBlock(2);return e[0]<<8|e[1]}ensureCapacity(e){if(this.start+e>this.view.byteLength){let r=t.BLOCK_SIZE+(e>t.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+r)}}realloc(e){let r=new ArrayBuffer(e),s=Buffer.from(r);s.set(this.view),this.buf=r,this.view=s}};tO.ByteStream=eO;eO.BLOCK_SIZE=1024});var rO=_(Vw=>{\"use strict\";Object.defineProperty(Vw,\"__esModule\",{value:!0});Vw.ASN1TypeError=Vw.ASN1ParseError=void 0;var jV=class extends Error{};Vw.ASN1ParseError=jV;var GV=class extends Error{};Vw.ASN1TypeError=GV});var lDe=_(nO=>{\"use strict\";Object.defineProperty(nO,\"__esModule\",{value:!0});nO.decodeLength=MIt;nO.encodeLength=UIt;var aDe=rO();function MIt(t){let e=t.getUint8();if(!(e&128))return e;let r=e&127;if(r>6)throw new aDe.ASN1ParseError(\"length exceeds 6 byte limit\");let s=0;for(let a=0;a<r;a++)s=s*256+t.getUint8();if(s===0)throw new aDe.ASN1ParseError(\"indefinite length encoding not supported\");return s}function UIt(t){if(t<128)return Buffer.from([t]);let e=BigInt(t),r=[];for(;e>0n;)r.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|r.length,...r])}});var uDe=_(Cg=>{\"use strict\";Object.defineProperty(Cg,\"__esModule\",{value:!0});Cg.parseInteger=jIt;Cg.parseStringASCII=cDe;Cg.parseTime=GIt;Cg.parseOID=qIt;Cg.parseBoolean=WIt;Cg.parseBitString=YIt;var _It=/^(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\.\\d{3})?Z$/,HIt=/^(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\.\\d{3})?Z$/;function jIt(t){let e=0,r=t.length,s=t[e],a=s>127,n=a?255:0;for(;s==n&&++e<r;)s=t[e];if(r-e===0)return BigInt(a?-1:0);s=a?s-256:s;let f=BigInt(s);for(let p=e+1;p<r;++p)f=f*BigInt(256)+BigInt(t[p]);return f}function cDe(t){return t.toString(\"ascii\")}function GIt(t,e){let r=cDe(t),s=e?_It.exec(r):HIt.exec(r);if(!s)throw new Error(\"invalid time\");if(e){let a=Number(s[1]);a+=a>=50?1900:2e3,s[1]=a.toString()}return new Date(`${s[1]}-${s[2]}-${s[3]}T${s[4]}:${s[5]}:${s[6]}Z`)}function qIt(t){let e=0,r=t.length,s=t[e++],a=Math.floor(s/40),n=s%40,c=`${a}.${n}`,f=0;for(;e<r;++e)s=t[e],f=(f<<7)+(s&127),s&128||(c+=`.${f}`,f=0);return c}function WIt(t){return t[0]!==0}function YIt(t){let e=t[0],r=1,s=t.length,a=[];for(let n=r;n<s;++n){let c=t[n],f=n===s-1?e:0;for(let p=7;p>=f;--p)a.push(c>>p&1)}return a}});var ADe=_(iO=>{\"use strict\";Object.defineProperty(iO,\"__esModule\",{value:!0});iO.ASN1Tag=void 0;var fDe=rO(),ty={BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,OBJECT_IDENTIFIER:6,SEQUENCE:16,SET:17,PRINTABLE_STRING:19,UTC_TIME:23,GENERALIZED_TIME:24},qV={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},WV=class{constructor(e){if(this.number=e&31,this.constructed=(e&32)===32,this.class=e>>6,this.number===31)throw new fDe.ASN1ParseError(\"long form tags not supported\");if(this.class===qV.UNIVERSAL&&this.number===0)throw new fDe.ASN1ParseError(\"unsupported tag 0x00\")}isUniversal(){return this.class===qV.UNIVERSAL}isContextSpecific(e){let r=this.class===qV.CONTEXT_SPECIFIC;return e!==void 0?r&&this.number===e:r}isBoolean(){return this.isUniversal()&&this.number===ty.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===ty.INTEGER}isBitString(){return this.isUniversal()&&this.number===ty.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===ty.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===ty.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===ty.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===ty.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};iO.ASN1Tag=WV});var dDe=_(oO=>{\"use strict\";Object.defineProperty(oO,\"__esModule\",{value:!0});oO.ASN1Obj=void 0;var YV=IP(),ry=rO(),hDe=lDe(),Jw=uDe(),VIt=ADe(),sO=class{constructor(e,r,s){this.tag=e,this.value=r,this.subs=s}static parseBuffer(e){return gDe(new YV.ByteStream(e))}toDER(){let e=new YV.ByteStream;if(this.subs.length>0)for(let a of this.subs)e.appendView(a.toDER());else e.appendView(this.value);let r=e.buffer,s=new YV.ByteStream;return s.appendChar(this.tag.toDER()),s.appendView((0,hDe.encodeLength)(r.length)),s.appendView(r),s.buffer}toBoolean(){if(!this.tag.isBoolean())throw new ry.ASN1TypeError(\"not a boolean\");return(0,Jw.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new ry.ASN1TypeError(\"not an integer\");return(0,Jw.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new ry.ASN1TypeError(\"not an OID\");return(0,Jw.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,Jw.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,Jw.parseTime)(this.value,!1);default:throw new ry.ASN1TypeError(\"not a date\")}}toBitString(){if(!this.tag.isBitString())throw new ry.ASN1TypeError(\"not a bit string\");return(0,Jw.parseBitString)(this.value)}};oO.ASN1Obj=sO;function gDe(t){let e=new VIt.ASN1Tag(t.getUint8()),r=(0,hDe.decodeLength)(t),s=t.slice(t.position,r),a=t.position,n=[];if(e.constructed)n=pDe(t,r);else if(e.isOctetString())try{n=pDe(t,r)}catch{}return n.length===0&&t.seek(a+r),new sO(e,s,n)}function pDe(t,e){let r=t.position+e;if(r>t.length)throw new ry.ASN1ParseError(\"invalid length\");let s=[];for(;t.position<r;)s.push(gDe(t));if(t.position!==r)throw new ry.ASN1ParseError(\"invalid length\");return s}});var lO=_(aO=>{\"use strict\";Object.defineProperty(aO,\"__esModule\",{value:!0});aO.ASN1Obj=void 0;var JIt=dDe();Object.defineProperty(aO,\"ASN1Obj\",{enumerable:!0,get:function(){return JIt.ASN1Obj}})});var Kw=_(wg=>{\"use strict\";var KIt=wg&&wg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wg,\"__esModule\",{value:!0});wg.createPublicKey=zIt;wg.digest=ZIt;wg.verify=XIt;wg.bufferEqual=$It;var CP=KIt(Ie(\"crypto\"));function zIt(t,e=\"spki\"){return typeof t==\"string\"?CP.default.createPublicKey(t):CP.default.createPublicKey({key:t,format:\"der\",type:e})}function ZIt(t,...e){let r=CP.default.createHash(t);for(let s of e)r.update(s);return r.digest()}function XIt(t,e,r,s){try{return CP.default.verify(s,t,e,r)}catch{return!1}}function $It(t,e){try{return CP.default.timingSafeEqual(t,e)}catch{return!1}}});var mDe=_(VV=>{\"use strict\";Object.defineProperty(VV,\"__esModule\",{value:!0});VV.preAuthEncoding=tCt;var eCt=\"DSSEv1\";function tCt(t,e){let r=[eCt,t.length,t,e.length,\"\"].join(\" \");return Buffer.concat([Buffer.from(r,\"ascii\"),e])}});var IDe=_(cO=>{\"use strict\";Object.defineProperty(cO,\"__esModule\",{value:!0});cO.base64Encode=rCt;cO.base64Decode=nCt;var yDe=\"base64\",EDe=\"utf-8\";function rCt(t){return Buffer.from(t,EDe).toString(yDe)}function nCt(t){return Buffer.from(t,yDe).toString(EDe)}});var CDe=_(KV=>{\"use strict\";Object.defineProperty(KV,\"__esModule\",{value:!0});KV.canonicalize=JV;function JV(t){let e=\"\";if(t===null||typeof t!=\"object\"||t.toJSON!=null)e+=JSON.stringify(t);else if(Array.isArray(t)){e+=\"[\";let r=!0;t.forEach(s=>{r||(e+=\",\"),r=!1,e+=JV(s)}),e+=\"]\"}else{e+=\"{\";let r=!0;Object.keys(t).sort().forEach(s=>{r||(e+=\",\"),r=!1,e+=JSON.stringify(s),e+=\":\",e+=JV(t[s])}),e+=\"}\"}return e}});var zV=_(uO=>{\"use strict\";Object.defineProperty(uO,\"__esModule\",{value:!0});uO.toDER=oCt;uO.fromDER=aCt;var iCt=/-----BEGIN (.*)-----/,sCt=/-----END (.*)-----/;function oCt(t){let e=\"\";return t.split(`\n`).forEach(r=>{r.match(iCt)||r.match(sCt)||(e+=r)}),Buffer.from(e,\"base64\")}function aCt(t,e=\"CERTIFICATE\"){let s=t.toString(\"base64\").match(/.{1,64}/g)||\"\";return[`-----BEGIN ${e}-----`,...s,`-----END ${e}-----`].join(`\n`).concat(`\n`)}});var fO=_(zw=>{\"use strict\";Object.defineProperty(zw,\"__esModule\",{value:!0});zw.SHA2_HASH_ALGOS=zw.ECDSA_SIGNATURE_ALGOS=void 0;zw.ECDSA_SIGNATURE_ALGOS={\"1.2.840.10045.4.3.1\":\"sha224\",\"1.2.840.10045.4.3.2\":\"sha256\",\"1.2.840.10045.4.3.3\":\"sha384\",\"1.2.840.10045.4.3.4\":\"sha512\"};zw.SHA2_HASH_ALGOS={\"2.16.840.1.101.3.4.2.1\":\"sha256\",\"2.16.840.1.101.3.4.2.2\":\"sha384\",\"2.16.840.1.101.3.4.2.3\":\"sha512\"}});var XV=_(AO=>{\"use strict\";Object.defineProperty(AO,\"__esModule\",{value:!0});AO.RFC3161TimestampVerificationError=void 0;var ZV=class extends Error{};AO.RFC3161TimestampVerificationError=ZV});var BDe=_(vA=>{\"use strict\";var lCt=vA&&vA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),cCt=vA&&vA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uCt=vA&&vA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&lCt(e,t,r);return cCt(e,t),e};Object.defineProperty(vA,\"__esModule\",{value:!0});vA.TSTInfo=void 0;var wDe=uCt(Kw()),fCt=fO(),ACt=XV(),$V=class{constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return fCt.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let r=wDe.digest(this.messageImprintHashAlgorithm,e);if(!wDe.bufferEqual(r,this.messageImprintHashedMessage))throw new ACt.RFC3161TimestampVerificationError(\"message imprint does not match artifact\")}get messageImprintObj(){return this.root.subs[2]}};vA.TSTInfo=$V});var SDe=_(SA=>{\"use strict\";var pCt=SA&&SA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),hCt=SA&&SA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gCt=SA&&SA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&pCt(e,t,r);return hCt(e,t),e};Object.defineProperty(SA,\"__esModule\",{value:!0});SA.RFC3161Timestamp=void 0;var dCt=lO(),e7=gCt(Kw()),vDe=fO(),wP=XV(),mCt=BDe(),yCt=\"1.2.840.113549.1.7.2\",ECt=\"1.2.840.113549.1.9.16.1.4\",ICt=\"1.2.840.113549.1.9.4\",t7=class t{constructor(e){this.root=e}static parse(e){let r=dCt.ASN1Obj.parseBuffer(e);return new t(r)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return vDe.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return vDe.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new mCt.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,r){if(!this.timeStampTokenObj)throw new wP.RFC3161TimestampVerificationError(\"timeStampToken is missing\");if(this.contentType!==yCt)throw new wP.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==ECt)throw new wP.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(r)}verifyMessageDigest(){let e=e7.digest(this.signerDigestAlgorithm,this.tstInfo.raw),r=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!e7.bufferEqual(e,r))throw new wP.RFC3161TimestampVerificationError(\"signed data does not match tstInfo\")}verifySignature(e){let r=this.signedAttrsObj.toDER();if(r[0]=49,!e7.verify(r,e,this.signatureValue,this.signatureAlgorithm))throw new wP.RFC3161TimestampVerificationError(\"signature verification failed\")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(r=>r.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let e=this.signedDataObj;return e.subs[e.subs.length-1]}get signerInfoObj(){return this.signerInfosObj.subs[0]}get eContentTypeObj(){return this.encapContentInfoObj.subs[0]}get eContentObj(){return this.encapContentInfoObj.subs[1]}get signedAttrsObj(){return this.signerInfoObj.subs.find(r=>r.tag.isContextSpecific(0))}get messageDigestAttributeObj(){return this.signedAttrsObj.subs.find(r=>r.subs[0].tag.isOID()&&r.subs[0].toOID()===ICt)}get signerSidObj(){return this.signerInfoObj.subs[1]}get signerDigestAlgorithmObj(){return this.signerInfoObj.subs[2]}get signatureAlgorithmObj(){return this.signerInfoObj.subs[4]}get signatureValueObj(){return this.signerInfoObj.subs[5]}};SA.RFC3161Timestamp=t7});var DDe=_(pO=>{\"use strict\";Object.defineProperty(pO,\"__esModule\",{value:!0});pO.RFC3161Timestamp=void 0;var CCt=SDe();Object.defineProperty(pO,\"RFC3161Timestamp\",{enumerable:!0,get:function(){return CCt.RFC3161Timestamp}})});var bDe=_(DA=>{\"use strict\";var wCt=DA&&DA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),BCt=DA&&DA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vCt=DA&&DA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&wCt(e,t,r);return BCt(e,t),e};Object.defineProperty(DA,\"__esModule\",{value:!0});DA.SignedCertificateTimestamp=void 0;var SCt=vCt(Kw()),PDe=IP(),r7=class t{constructor(e){this.version=e.version,this.logID=e.logID,this.timestamp=e.timestamp,this.extensions=e.extensions,this.hashAlgorithm=e.hashAlgorithm,this.signatureAlgorithm=e.signatureAlgorithm,this.signature=e.signature}get datetime(){return new Date(Number(this.timestamp.readBigInt64BE()))}get algorithm(){switch(this.hashAlgorithm){case 0:return\"none\";case 1:return\"md5\";case 2:return\"sha1\";case 3:return\"sha224\";case 4:return\"sha256\";case 5:return\"sha384\";case 6:return\"sha512\";default:return\"unknown\"}}verify(e,r){let s=new PDe.ByteStream;return s.appendChar(this.version),s.appendChar(0),s.appendView(this.timestamp),s.appendUint16(1),s.appendView(e),s.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&s.appendView(this.extensions),SCt.verify(s.buffer,r,this.signature,this.algorithm)}static parse(e){let r=new PDe.ByteStream(e),s=r.getUint8(),a=r.getBlock(32),n=r.getBlock(8),c=r.getUint16(),f=r.getBlock(c),p=r.getUint8(),h=r.getUint8(),E=r.getUint16(),C=r.getBlock(E);if(r.position!==e.length)throw new Error(\"SCT buffer length mismatch\");return new t({version:s,logID:a,timestamp:n,extensions:f,hashAlgorithm:p,signatureAlgorithm:h,signature:C})}};DA.SignedCertificateTimestamp=r7});var c7=_(sa=>{\"use strict\";Object.defineProperty(sa,\"__esModule\",{value:!0});sa.X509SCTExtension=sa.X509SubjectKeyIDExtension=sa.X509AuthorityKeyIDExtension=sa.X509SubjectAlternativeNameExtension=sa.X509KeyUsageExtension=sa.X509BasicConstraintsExtension=sa.X509Extension=void 0;var DCt=IP(),PCt=bDe(),ph=class{constructor(e){this.root=e}get oid(){return this.root.subs[0].toOID()}get critical(){return this.root.subs.length===3?this.root.subs[1].toBoolean():!1}get value(){return this.extnValueObj.value}get valueObj(){return this.extnValueObj}get extnValueObj(){return this.root.subs[this.root.subs.length-1]}};sa.X509Extension=ph;var n7=class extends ph{get isCA(){return this.sequence.subs[0]?.toBoolean()??!1}get pathLenConstraint(){return this.sequence.subs.length>1?this.sequence.subs[1].toInteger():void 0}get sequence(){return this.extnValueObj.subs[0]}};sa.X509BasicConstraintsExtension=n7;var i7=class extends ph{get digitalSignature(){return this.bitString[0]===1}get keyCertSign(){return this.bitString[5]===1}get crlSign(){return this.bitString[6]===1}get bitString(){return this.extnValueObj.subs[0].toBitString()}};sa.X509KeyUsageExtension=i7;var s7=class extends ph{get rfc822Name(){return this.findGeneralName(1)?.value.toString(\"ascii\")}get uri(){return this.findGeneralName(6)?.value.toString(\"ascii\")}otherName(e){let r=this.findGeneralName(0);return r===void 0||r.subs[0].toOID()!==e?void 0:r.subs[1].subs[0].value.toString(\"ascii\")}findGeneralName(e){return this.generalNames.find(r=>r.tag.isContextSpecific(e))}get generalNames(){return this.extnValueObj.subs[0].subs}};sa.X509SubjectAlternativeNameExtension=s7;var o7=class extends ph{get keyIdentifier(){return this.findSequenceMember(0)?.value}findSequenceMember(e){return this.sequence.subs.find(r=>r.tag.isContextSpecific(e))}get sequence(){return this.extnValueObj.subs[0]}};sa.X509AuthorityKeyIDExtension=o7;var a7=class extends ph{get keyIdentifier(){return this.extnValueObj.subs[0].value}};sa.X509SubjectKeyIDExtension=a7;var l7=class extends ph{constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,r=new DCt.ByteStream(e),s=r.getUint16()+2,a=[];for(;r.position<s;){let n=r.getUint16(),c=r.getBlock(n);a.push(PCt.SignedCertificateTimestamp.parse(c))}if(r.position!==s)throw new Error(\"SCT list length does not match actual length\");return a}};sa.X509SCTExtension=l7});var QDe=_(ic=>{\"use strict\";var bCt=ic&&ic.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),xCt=ic&&ic.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kDe=ic&&ic.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&bCt(e,t,r);return xCt(e,t),e};Object.defineProperty(ic,\"__esModule\",{value:!0});ic.X509Certificate=ic.EXTENSION_OID_SCT=void 0;var kCt=lO(),xDe=kDe(Kw()),QCt=fO(),RCt=kDe(zV()),ny=c7(),TCt=\"2.5.29.14\",FCt=\"2.5.29.15\",NCt=\"2.5.29.17\",OCt=\"2.5.29.19\",LCt=\"2.5.29.35\";ic.EXTENSION_OID_SCT=\"1.3.6.1.4.1.11129.2.4.2\";var u7=class t{constructor(e){this.root=e}static parse(e){let r=typeof e==\"string\"?RCt.toDER(e):e,s=kCt.ASN1Obj.parseBuffer(r);return new t(s)}get tbsCertificate(){return this.tbsCertificateObj}get version(){return`v${(this.versionObj.subs[0].toInteger()+BigInt(1)).toString()}`}get serialNumber(){return this.serialNumberObj.value}get notBefore(){return this.validityObj.subs[0].toDate()}get notAfter(){return this.validityObj.subs[1].toDate()}get issuer(){return this.issuerObj.value}get subject(){return this.subjectObj.value}get publicKey(){return this.subjectPublicKeyInfoObj.toDER()}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return QCt.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value.subarray(1)}get subjectAltName(){let e=this.extSubjectAltName;return e?.uri||e?.rfc822Name}get extensions(){return this.extensionsObj?.subs[0]?.subs||[]}get extKeyUsage(){let e=this.findExtension(FCt);return e?new ny.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(OCt);return e?new ny.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(NCt);return e?new ny.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(LCt);return e?new ny.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(TCt);return e?new ny.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(ic.EXTENSION_OID_SCT);return e?new ny.X509SCTExtension(e):void 0}get isCA(){let e=this.extBasicConstraints?.isCA||!1;return this.extKeyUsage?e&&this.extKeyUsage.keyCertSign:e}extension(e){let r=this.findExtension(e);return r?new ny.X509Extension(r):void 0}verify(e){let r=e?.publicKey||this.publicKey,s=xDe.createPublicKey(r);return xDe.verify(this.tbsCertificate.toDER(),s,this.signatureValue,this.signatureAlgorithm)}validForDate(e){return this.notBefore<=e&&e<=this.notAfter}equals(e){return this.root.toDER().equals(e.root.toDER())}clone(){let e=this.root.toDER(),r=Buffer.alloc(e.length);return e.copy(r),t.parse(r)}findExtension(e){return this.extensions.find(r=>r.subs[0].toOID()===e)}get tbsCertificateObj(){return this.root.subs[0]}get signatureAlgorithmObj(){return this.root.subs[1]}get signatureValueObj(){return this.root.subs[2]}get versionObj(){return this.tbsCertificateObj.subs[0]}get serialNumberObj(){return this.tbsCertificateObj.subs[1]}get issuerObj(){return this.tbsCertificateObj.subs[3]}get validityObj(){return this.tbsCertificateObj.subs[4]}get subjectObj(){return this.tbsCertificateObj.subs[5]}get subjectPublicKeyInfoObj(){return this.tbsCertificateObj.subs[6]}get extensionsObj(){return this.tbsCertificateObj.subs.find(e=>e.tag.isContextSpecific(3))}};ic.X509Certificate=u7});var TDe=_(Bg=>{\"use strict\";Object.defineProperty(Bg,\"__esModule\",{value:!0});Bg.X509SCTExtension=Bg.X509Certificate=Bg.EXTENSION_OID_SCT=void 0;var RDe=QDe();Object.defineProperty(Bg,\"EXTENSION_OID_SCT\",{enumerable:!0,get:function(){return RDe.EXTENSION_OID_SCT}});Object.defineProperty(Bg,\"X509Certificate\",{enumerable:!0,get:function(){return RDe.X509Certificate}});var MCt=c7();Object.defineProperty(Bg,\"X509SCTExtension\",{enumerable:!0,get:function(){return MCt.X509SCTExtension}})});var Cl=_(Jn=>{\"use strict\";var UCt=Jn&&Jn.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),_Ct=Jn&&Jn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BP=Jn&&Jn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&UCt(e,t,r);return _Ct(e,t),e};Object.defineProperty(Jn,\"__esModule\",{value:!0});Jn.X509SCTExtension=Jn.X509Certificate=Jn.EXTENSION_OID_SCT=Jn.ByteStream=Jn.RFC3161Timestamp=Jn.pem=Jn.json=Jn.encoding=Jn.dsse=Jn.crypto=Jn.ASN1Obj=void 0;var HCt=lO();Object.defineProperty(Jn,\"ASN1Obj\",{enumerable:!0,get:function(){return HCt.ASN1Obj}});Jn.crypto=BP(Kw());Jn.dsse=BP(mDe());Jn.encoding=BP(IDe());Jn.json=BP(CDe());Jn.pem=BP(zV());var jCt=DDe();Object.defineProperty(Jn,\"RFC3161Timestamp\",{enumerable:!0,get:function(){return jCt.RFC3161Timestamp}});var GCt=IP();Object.defineProperty(Jn,\"ByteStream\",{enumerable:!0,get:function(){return GCt.ByteStream}});var f7=TDe();Object.defineProperty(Jn,\"EXTENSION_OID_SCT\",{enumerable:!0,get:function(){return f7.EXTENSION_OID_SCT}});Object.defineProperty(Jn,\"X509Certificate\",{enumerable:!0,get:function(){return f7.X509Certificate}});Object.defineProperty(Jn,\"X509SCTExtension\",{enumerable:!0,get:function(){return f7.X509SCTExtension}})});var FDe=_(A7=>{\"use strict\";Object.defineProperty(A7,\"__esModule\",{value:!0});A7.extractJWTSubject=WCt;var qCt=Cl();function WCt(t){let e=t.split(\".\",3),r=JSON.parse(qCt.encoding.base64Decode(e[1]));switch(r.iss){case\"https://accounts.google.com\":case\"https://oauth2.sigstore.dev/auth\":return r.email;default:return r.sub}}});var NDe=_((Zrr,YCt)=>{YCt.exports={name:\"@sigstore/sign\",version:\"3.1.0\",description:\"Sigstore signing library\",main:\"dist/index.js\",types:\"dist/index.d.ts\",scripts:{clean:\"shx rm -rf dist *.tsbuildinfo\",build:\"tsc --build\",test:\"jest\"},files:[\"dist\"],author:\"bdehamer@github.com\",license:\"Apache-2.0\",repository:{type:\"git\",url:\"git+https://github.com/sigstore/sigstore-js.git\"},bugs:{url:\"https://github.com/sigstore/sigstore-js/issues\"},homepage:\"https://github.com/sigstore/sigstore-js/tree/main/packages/sign#readme\",publishConfig:{provenance:!0},devDependencies:{\"@sigstore/jest\":\"^0.0.0\",\"@sigstore/mock\":\"^0.10.0\",\"@sigstore/rekor-types\":\"^3.0.0\",\"@types/make-fetch-happen\":\"^10.0.4\",\"@types/promise-retry\":\"^1.1.6\"},dependencies:{\"@sigstore/bundle\":\"^3.1.0\",\"@sigstore/core\":\"^2.0.0\",\"@sigstore/protobuf-specs\":\"^0.4.0\",\"make-fetch-happen\":\"^14.0.2\",\"proc-log\":\"^5.0.0\",\"promise-retry\":\"^2.0.1\"},engines:{node:\"^18.17.0 || >=20.5.0\"}}});var LDe=_(Zw=>{\"use strict\";var VCt=Zw&&Zw.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zw,\"__esModule\",{value:!0});Zw.getUserAgent=void 0;var ODe=VCt(Ie(\"os\")),JCt=()=>{let t=NDe().version,e=process.version,r=ODe.default.platform(),s=ODe.default.arch();return`sigstore-js/${t} (Node ${e}) (${r}/${s})`};Zw.getUserAgent=JCt});var vg=_(Vi=>{\"use strict\";var KCt=Vi&&Vi.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),zCt=Vi&&Vi.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MDe=Vi&&Vi.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s[s.length]=a);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),a=0;a<s.length;a++)s[a]!==\"default\"&&KCt(r,e,s[a]);return zCt(r,e),r}}();Object.defineProperty(Vi,\"__esModule\",{value:!0});Vi.ua=Vi.oidc=Vi.pem=Vi.json=Vi.encoding=Vi.dsse=Vi.crypto=void 0;var vP=Cl();Object.defineProperty(Vi,\"crypto\",{enumerable:!0,get:function(){return vP.crypto}});Object.defineProperty(Vi,\"dsse\",{enumerable:!0,get:function(){return vP.dsse}});Object.defineProperty(Vi,\"encoding\",{enumerable:!0,get:function(){return vP.encoding}});Object.defineProperty(Vi,\"json\",{enumerable:!0,get:function(){return vP.json}});Object.defineProperty(Vi,\"pem\",{enumerable:!0,get:function(){return vP.pem}});Vi.oidc=MDe(FDe());Vi.ua=MDe(LDe())});var h7=_(hO=>{\"use strict\";Object.defineProperty(hO,\"__esModule\",{value:!0});hO.BaseBundleBuilder=void 0;var p7=class{constructor(e){this.signer=e.signer,this.witnesses=e.witnesses}async create(e){let r=await this.prepare(e).then(f=>this.signer.sign(f)),s=await this.package(e,r),a=await Promise.all(this.witnesses.map(f=>f.testify(s.content,ZCt(r.key)))),n=[],c=[];return a.forEach(({tlogEntries:f,rfc3161Timestamps:p})=>{n.push(...f??[]),c.push(...p??[])}),s.verificationMaterial.tlogEntries=n,s.verificationMaterial.timestampVerificationData={rfc3161Timestamps:c},s}async prepare(e){return e.data}};hO.BaseBundleBuilder=p7;function ZCt(t){switch(t.$case){case\"publicKey\":return t.publicKey;case\"x509Certificate\":return t.certificate}}});var d7=_(PA=>{\"use strict\";var XCt=PA&&PA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),$Ct=PA&&PA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ewt=PA&&PA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s[s.length]=a);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),a=0;a<s.length;a++)s[a]!==\"default\"&&XCt(r,e,s[a]);return $Ct(r,e),r}}();Object.defineProperty(PA,\"__esModule\",{value:!0});PA.toMessageSignatureBundle=twt;PA.toDSSEBundle=rwt;var UDe=ewt(EP()),g7=vg();function twt(t,e){let r=g7.crypto.digest(\"sha256\",t.data);return UDe.toMessageSignatureBundle({digest:r,signature:e.signature,certificate:e.key.$case===\"x509Certificate\"?g7.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case===\"publicKey\"?e.key.hint:void 0,certificateChain:!0})}function rwt(t,e,r){return UDe.toDSSEBundle({artifact:t.data,artifactType:t.type,signature:e.signature,certificate:e.key.$case===\"x509Certificate\"?g7.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case===\"publicKey\"?e.key.hint:void 0,certificateChain:r})}});var HDe=_(gO=>{\"use strict\";Object.defineProperty(gO,\"__esModule\",{value:!0});gO.DSSEBundleBuilder=void 0;var nwt=vg(),iwt=h7(),swt=d7(),m7=class extends iwt.BaseBundleBuilder{constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let r=_De(e);return nwt.dsse.preAuthEncoding(r.type,r.data)}async package(e,r){return(0,swt.toDSSEBundle)(_De(e),r,this.certificateChain)}};gO.DSSEBundleBuilder=m7;function _De(t){return{...t,type:t.type??\"\"}}});var jDe=_(dO=>{\"use strict\";Object.defineProperty(dO,\"__esModule\",{value:!0});dO.MessageSignatureBundleBuilder=void 0;var owt=h7(),awt=d7(),y7=class extends owt.BaseBundleBuilder{constructor(e){super(e)}async package(e,r){return(0,awt.toMessageSignatureBundle)(e,r)}};dO.MessageSignatureBundleBuilder=y7});var GDe=_(Xw=>{\"use strict\";Object.defineProperty(Xw,\"__esModule\",{value:!0});Xw.MessageSignatureBundleBuilder=Xw.DSSEBundleBuilder=void 0;var lwt=HDe();Object.defineProperty(Xw,\"DSSEBundleBuilder\",{enumerable:!0,get:function(){return lwt.DSSEBundleBuilder}});var cwt=jDe();Object.defineProperty(Xw,\"MessageSignatureBundleBuilder\",{enumerable:!0,get:function(){return cwt.MessageSignatureBundleBuilder}})});var yO=_(mO=>{\"use strict\";Object.defineProperty(mO,\"__esModule\",{value:!0});mO.HTTPError=void 0;var E7=class extends Error{constructor({status:e,message:r,location:s}){super(`(${e}) ${r}`),this.statusCode=e,this.location=s}};mO.HTTPError=E7});var $w=_(SP=>{\"use strict\";Object.defineProperty(SP,\"__esModule\",{value:!0});SP.InternalError=void 0;SP.internalError=fwt;var uwt=yO(),EO=class extends Error{constructor({code:e,message:r,cause:s}){super(r),this.name=this.constructor.name,this.cause=s,this.code=e}};SP.InternalError=EO;function fwt(t,e,r){throw t instanceof uwt.HTTPError&&(r+=` - ${t.message}`),new EO({code:e,message:r,cause:t})}});var IO=_((anr,qDe)=>{qDe.exports=fetch});var WDe=_(e1=>{\"use strict\";var Awt=e1&&e1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e1,\"__esModule\",{value:!0});e1.CIContextProvider=void 0;var pwt=Awt(IO()),hwt=[gwt,dwt],I7=class{constructor(e=\"sigstore\"){this.audience=e}async getToken(){return Promise.any(hwt.map(e=>e(this.audience))).catch(()=>Promise.reject(\"CI: no tokens available\"))}};e1.CIContextProvider=I7;async function gwt(t){if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL||!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN)return Promise.reject(\"no token available\");let e=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);return e.searchParams.append(\"audience\",t),(await(0,pwt.default)(e.href,{retry:2,headers:{Accept:\"application/json\",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(s=>s.value)}async function dwt(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject(\"no token available\")}});var YDe=_(CO=>{\"use strict\";Object.defineProperty(CO,\"__esModule\",{value:!0});CO.CIContextProvider=void 0;var mwt=WDe();Object.defineProperty(CO,\"CIContextProvider\",{enumerable:!0,get:function(){return mwt.CIContextProvider}})});var JDe=_((unr,VDe)=>{var ywt=Symbol(\"proc-log.meta\");VDe.exports={META:ywt,output:{LEVELS:[\"standard\",\"error\",\"buffer\",\"flush\"],KEYS:{standard:\"standard\",error:\"error\",buffer:\"buffer\",flush:\"flush\"},standard:function(...t){return process.emit(\"output\",\"standard\",...t)},error:function(...t){return process.emit(\"output\",\"error\",...t)},buffer:function(...t){return process.emit(\"output\",\"buffer\",...t)},flush:function(...t){return process.emit(\"output\",\"flush\",...t)}},log:{LEVELS:[\"notice\",\"error\",\"warn\",\"info\",\"verbose\",\"http\",\"silly\",\"timing\",\"pause\",\"resume\"],KEYS:{notice:\"notice\",error:\"error\",warn:\"warn\",info:\"info\",verbose:\"verbose\",http:\"http\",silly:\"silly\",timing:\"timing\",pause:\"pause\",resume:\"resume\"},error:function(...t){return process.emit(\"log\",\"error\",...t)},notice:function(...t){return process.emit(\"log\",\"notice\",...t)},warn:function(...t){return process.emit(\"log\",\"warn\",...t)},info:function(...t){return process.emit(\"log\",\"info\",...t)},verbose:function(...t){return process.emit(\"log\",\"verbose\",...t)},http:function(...t){return process.emit(\"log\",\"http\",...t)},silly:function(...t){return process.emit(\"log\",\"silly\",...t)},timing:function(...t){return process.emit(\"log\",\"timing\",...t)},pause:function(){return process.emit(\"log\",\"pause\")},resume:function(){return process.emit(\"log\",\"resume\")}},time:{LEVELS:[\"start\",\"end\"],KEYS:{start:\"start\",end:\"end\"},start:function(t,e){process.emit(\"time\",\"start\",t);function r(){return process.emit(\"time\",\"end\",t)}if(typeof e==\"function\"){let s=e();return s&&s.finally?s.finally(r):(r(),s)}return r},end:function(t){return process.emit(\"time\",\"end\",t)}},input:{LEVELS:[\"start\",\"end\",\"read\"],KEYS:{start:\"start\",end:\"end\",read:\"read\"},start:function(t){process.emit(\"input\",\"start\");function e(){return process.emit(\"input\",\"end\")}if(typeof t==\"function\"){let r=t();return r&&r.finally?r.finally(e):(e(),r)}return e},end:function(){return process.emit(\"input\",\"end\")},read:function(...t){let e,r,s=new Promise((a,n)=>{e=a,r=n});return process.emit(\"input\",\"read\",e,r,...t),s}}}});var ZDe=_((fnr,zDe)=>{\"use strict\";function KDe(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Ewt(t,e,r){if(!t||typeof t==\"string\")throw new TypeError(\"Please pass an Error to err-code\");r||(r={}),typeof e==\"object\"&&(r=e,e=void 0),e!=null&&(r.code=e);try{return KDe(t,r)}catch{r.message=t.message,r.stack=t.stack;let a=function(){};return a.prototype=Object.create(Object.getPrototypeOf(t)),KDe(new a,r)}}zDe.exports=Ewt});var $De=_((Anr,XDe)=>{function $c(t,e){typeof e==\"boolean\"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}XDe.exports=$c;$c.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};$c.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};$c.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error(\"RetryOperation timeout occurred\")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var s=this,a=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},r);return this._options.unref&&a.unref(),!0};$c.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};$c.prototype.try=function(t){console.log(\"Using RetryOperation.try() is deprecated\"),this.attempt(t)};$c.prototype.start=function(t){console.log(\"Using RetryOperation.start() is deprecated\"),this.attempt(t)};$c.prototype.start=$c.prototype.try;$c.prototype.errors=function(){return this._errors};$c.prototype.attempts=function(){return this._attempts};$c.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,s=0;s<this._errors.length;s++){var a=this._errors[s],n=a.message,c=(t[n]||0)+1;t[n]=c,c>=r&&(e=a,r=c)}return e}});var ePe=_(iy=>{var Iwt=$De();iy.operation=function(t){var e=iy.timeouts(t);return new Iwt(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};iy.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error(\"minTimeout is greater than maxTimeout\");for(var s=[],a=0;a<e.retries;a++)s.push(this.createTimeout(a,e));return t&&t.forever&&!s.length&&s.push(this.createTimeout(a,e)),s.sort(function(n,c){return n-c}),s};iy.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,s=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return s=Math.min(s,e.maxTimeout),s};iy.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var s in t)typeof t[s]==\"function\"&&r.push(s)}for(var a=0;a<r.length;a++){var n=r[a],c=t[n];t[n]=function(p){var h=iy.operation(e),E=Array.prototype.slice.call(arguments,1),C=E.pop();E.push(function(S){h.retry(S)||(S&&(arguments[0]=h.mainError()),C.apply(this,arguments))}),h.attempt(function(){p.apply(t,E)})}.bind(t,c),t[n].options=e}}});var rPe=_((hnr,tPe)=>{tPe.exports=ePe()});var sPe=_((gnr,iPe)=>{\"use strict\";var Cwt=ZDe(),wwt=rPe(),Bwt=Object.prototype.hasOwnProperty;function nPe(t){return t&&t.code===\"EPROMISERETRY\"&&Bwt.call(t,\"retried\")}function vwt(t,e){var r,s;return typeof t==\"object\"&&typeof e==\"function\"&&(r=e,e=t,t=r),s=wwt.operation(e),new Promise(function(a,n){s.attempt(function(c){Promise.resolve().then(function(){return t(function(f){throw nPe(f)&&(f=f.retried),Cwt(new Error(\"Retrying\"),\"EPROMISERETRY\",{retried:f})},c)}).then(a,function(f){nPe(f)&&(f=f.retried,s.retry(f||new Error))||n(f)})})})}iPe.exports=vwt});var wO=_(DP=>{\"use strict\";var aPe=DP&&DP.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(DP,\"__esModule\",{value:!0});DP.fetchWithRetry=Owt;var Swt=Ie(\"http2\"),Dwt=aPe(IO()),oPe=JDe(),Pwt=aPe(sPe()),bwt=vg(),xwt=yO(),{HTTP2_HEADER_LOCATION:kwt,HTTP2_HEADER_CONTENT_TYPE:Qwt,HTTP2_HEADER_USER_AGENT:Rwt,HTTP_STATUS_INTERNAL_SERVER_ERROR:Twt,HTTP_STATUS_TOO_MANY_REQUESTS:Fwt,HTTP_STATUS_REQUEST_TIMEOUT:Nwt}=Swt.constants;async function Owt(t,e){return(0,Pwt.default)(async(r,s)=>{let a=e.method||\"POST\",n={[Rwt]:bwt.ua.getUserAgent(),...e.headers},c=await(0,Dwt.default)(t,{method:a,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(f=>(oPe.log.http(\"fetch\",`${a} ${t} attempt ${s} failed with ${f}`),r(f)));if(c.ok)return c;{let f=await Lwt(c);if(oPe.log.http(\"fetch\",`${a} ${t} attempt ${s} failed with ${c.status}`),Mwt(c.status))return r(f);throw f}},Uwt(e.retry))}var Lwt=async t=>{let e=t.statusText,r=t.headers.get(kwt)||void 0;if(t.headers.get(Qwt)?.includes(\"application/json\"))try{e=(await t.json()).message||e}catch{}return new xwt.HTTPError({status:t.status,message:e,location:r})},Mwt=t=>[Nwt,Fwt].includes(t)||t>=Twt,Uwt=t=>typeof t==\"boolean\"?{retries:t?1:0}:typeof t==\"number\"?{retries:t}:{retries:0,...t}});var lPe=_(BO=>{\"use strict\";Object.defineProperty(BO,\"__esModule\",{value:!0});BO.Fulcio=void 0;var _wt=wO(),C7=class{constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:r,retry:s,timeout:a}=this.options,n=`${r}/api/v2/signingCert`;return(await(0,_wt.fetchWithRetry)(n,{headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(e),timeout:a,retry:s})).json()}};BO.Fulcio=C7});var cPe=_(vO=>{\"use strict\";Object.defineProperty(vO,\"__esModule\",{value:!0});vO.CAClient=void 0;var Hwt=$w(),jwt=lPe(),w7=class{constructor(e){this.fulcio=new jwt.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,r,s){let a=Gwt(e,r,s);try{let n=await this.fulcio.createSigningCertificate(a);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,Hwt.internalError)(n,\"CA_CREATE_SIGNING_CERTIFICATE_ERROR\",\"error creating signing certificate\")}}};vO.CAClient=w7;function Gwt(t,e,r){return{credentials:{oidcIdentityToken:t},publicKeyRequest:{publicKey:{algorithm:\"ECDSA\",content:e},proofOfPossession:r.toString(\"base64\")}}}});var fPe=_(t1=>{\"use strict\";var qwt=t1&&t1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t1,\"__esModule\",{value:!0});t1.EphemeralSigner=void 0;var uPe=qwt(Ie(\"crypto\")),Wwt=\"ec\",Ywt=\"P-256\",B7=class{constructor(){this.keypair=uPe.default.generateKeyPairSync(Wwt,{namedCurve:Ywt})}async sign(e){let r=uPe.default.sign(null,e,this.keypair.privateKey),s=this.keypair.publicKey.export({format:\"pem\",type:\"spki\"}).toString(\"ascii\");return{signature:r,key:{$case:\"publicKey\",publicKey:s}}}};t1.EphemeralSigner=B7});var APe=_(sy=>{\"use strict\";Object.defineProperty(sy,\"__esModule\",{value:!0});sy.FulcioSigner=sy.DEFAULT_FULCIO_URL=void 0;var v7=$w(),Vwt=vg(),Jwt=cPe(),Kwt=fPe();sy.DEFAULT_FULCIO_URL=\"https://fulcio.sigstore.dev\";var S7=class{constructor(e){this.ca=new Jwt.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||sy.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new Kwt.EphemeralSigner}async sign(e){let r=await this.getIdentityToken(),s;try{s=Vwt.oidc.extractJWTSubject(r)}catch(f){throw new v7.InternalError({code:\"IDENTITY_TOKEN_PARSE_ERROR\",message:`invalid identity token: ${r}`,cause:f})}let a=await this.keyHolder.sign(Buffer.from(s));if(a.key.$case!==\"publicKey\")throw new v7.InternalError({code:\"CA_CREATE_SIGNING_CERTIFICATE_ERROR\",message:\"unexpected format for signing key\"});let n=await this.ca.createSigningCertificate(r,a.key.publicKey,a.signature);return{signature:(await this.keyHolder.sign(e)).signature,key:{$case:\"x509Certificate\",certificate:n[0]}}}async getIdentityToken(){try{return await this.identityProvider.getToken()}catch(e){throw new v7.InternalError({code:\"IDENTITY_TOKEN_READ_ERROR\",message:\"error retrieving identity token\",cause:e})}}};sy.FulcioSigner=S7});var hPe=_(r1=>{\"use strict\";Object.defineProperty(r1,\"__esModule\",{value:!0});r1.FulcioSigner=r1.DEFAULT_FULCIO_URL=void 0;var pPe=APe();Object.defineProperty(r1,\"DEFAULT_FULCIO_URL\",{enumerable:!0,get:function(){return pPe.DEFAULT_FULCIO_URL}});Object.defineProperty(r1,\"FulcioSigner\",{enumerable:!0,get:function(){return pPe.FulcioSigner}})});var mPe=_(SO=>{\"use strict\";Object.defineProperty(SO,\"__esModule\",{value:!0});SO.Rekor=void 0;var gPe=wO(),D7=class{constructor(e){this.options=e}async createEntry(e){let{baseURL:r,timeout:s,retry:a}=this.options,n=`${r}/api/v1/log/entries`,f=await(await(0,gPe.fetchWithRetry)(n,{headers:{\"Content-Type\":\"application/json\",Accept:\"application/json\"},body:JSON.stringify(e),timeout:s,retry:a})).json();return dPe(f)}async getEntry(e){let{baseURL:r,timeout:s,retry:a}=this.options,n=`${r}/api/v1/log/entries/${e}`,f=await(await(0,gPe.fetchWithRetry)(n,{method:\"GET\",headers:{Accept:\"application/json\"},timeout:s,retry:a})).json();return dPe(f)}};SO.Rekor=D7;function dPe(t){let e=Object.entries(t);if(e.length!=1)throw new Error(\"Received multiple entries in Rekor response\");let[r,s]=e[0];return{...s,uuid:r}}});var EPe=_(DO=>{\"use strict\";Object.defineProperty(DO,\"__esModule\",{value:!0});DO.TLogClient=void 0;var yPe=$w(),zwt=yO(),Zwt=mPe(),P7=class{constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new Zwt.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let r;try{r=await this.rekor.createEntry(e)}catch(s){if(Xwt(s)&&this.fetchOnConflict){let a=s.location.split(\"/\").pop()||\"\";try{r=await this.rekor.getEntry(a)}catch(n){(0,yPe.internalError)(n,\"TLOG_FETCH_ENTRY_ERROR\",\"error fetching tlog entry\")}}else(0,yPe.internalError)(s,\"TLOG_CREATE_ENTRY_ERROR\",\"error creating tlog entry\")}return r}};DO.TLogClient=P7;function Xwt(t){return t instanceof zwt.HTTPError&&t.statusCode===409&&t.location!==void 0}});var IPe=_(b7=>{\"use strict\";Object.defineProperty(b7,\"__esModule\",{value:!0});b7.toProposedEntry=e1t;var $wt=EP(),Sg=vg(),PP=\"sha256\";function e1t(t,e,r=\"dsse\"){switch(t.$case){case\"dsseEnvelope\":return r===\"intoto\"?n1t(t.dsseEnvelope,e):r1t(t.dsseEnvelope,e);case\"messageSignature\":return t1t(t.messageSignature,e)}}function t1t(t,e){let r=t.messageDigest.digest.toString(\"hex\"),s=t.signature.toString(\"base64\"),a=Sg.encoding.base64Encode(e);return{apiVersion:\"0.0.1\",kind:\"hashedrekord\",spec:{data:{hash:{algorithm:PP,value:r}},signature:{content:s,publicKey:{content:a}}}}}function r1t(t,e){let r=JSON.stringify((0,$wt.envelopeToJSON)(t)),s=Sg.encoding.base64Encode(e);return{apiVersion:\"0.0.1\",kind:\"dsse\",spec:{proposedContent:{envelope:r,verifiers:[s]}}}}function n1t(t,e){let r=Sg.crypto.digest(PP,t.payload).toString(\"hex\"),s=i1t(t,e),a=Sg.encoding.base64Encode(t.payload.toString(\"base64\")),n=Sg.encoding.base64Encode(t.signatures[0].sig.toString(\"base64\")),c=t.signatures[0].keyid,f=Sg.encoding.base64Encode(e),p={payloadType:t.payloadType,payload:a,signatures:[{sig:n,publicKey:f}]};return c.length>0&&(p.signatures[0].keyid=c),{apiVersion:\"0.0.2\",kind:\"intoto\",spec:{content:{envelope:p,hash:{algorithm:PP,value:s},payloadHash:{algorithm:PP,value:r}}}}}function i1t(t,e){let r={payloadType:t.payloadType,payload:t.payload.toString(\"base64\"),signatures:[{sig:t.signatures[0].sig.toString(\"base64\"),publicKey:e}]};return t.signatures[0].keyid.length>0&&(r.signatures[0].keyid=t.signatures[0].keyid),Sg.crypto.digest(PP,Sg.json.canonicalize(r)).toString(\"hex\")}});var CPe=_(oy=>{\"use strict\";Object.defineProperty(oy,\"__esModule\",{value:!0});oy.RekorWitness=oy.DEFAULT_REKOR_URL=void 0;var s1t=vg(),o1t=EPe(),a1t=IPe();oy.DEFAULT_REKOR_URL=\"https://rekor.sigstore.dev\";var x7=class{constructor(e){this.entryType=e.entryType,this.tlog=new o1t.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||oy.DEFAULT_REKOR_URL})}async testify(e,r){let s=(0,a1t.toProposedEntry)(e,r,this.entryType),a=await this.tlog.createEntry(s);return l1t(a)}};oy.RekorWitness=x7;function l1t(t){let e=Buffer.from(t.logID,\"hex\"),r=s1t.encoding.base64Decode(t.body),s=JSON.parse(r),a=t?.verification?.signedEntryTimestamp?c1t(t.verification.signedEntryTimestamp):void 0,n=t?.verification?.inclusionProof?u1t(t.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:t.logIndex.toString(),logId:{keyId:e},integratedTime:t.integratedTime.toString(),kindVersion:{kind:s.kind,version:s.apiVersion},inclusionPromise:a,inclusionProof:n,canonicalizedBody:Buffer.from(t.body,\"base64\")}]}}function c1t(t){return{signedEntryTimestamp:Buffer.from(t,\"base64\")}}function u1t(t){return{logIndex:t.logIndex.toString(),treeSize:t.treeSize.toString(),rootHash:Buffer.from(t.rootHash,\"hex\"),hashes:t.hashes.map(e=>Buffer.from(e,\"hex\")),checkpoint:{envelope:t.checkpoint}}}});var wPe=_(PO=>{\"use strict\";Object.defineProperty(PO,\"__esModule\",{value:!0});PO.TimestampAuthority=void 0;var f1t=wO(),k7=class{constructor(e){this.options=e}async createTimestamp(e){let{baseURL:r,timeout:s,retry:a}=this.options,n=`${r}/api/v1/timestamp`;return(await(0,f1t.fetchWithRetry)(n,{headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(e),timeout:s,retry:a})).buffer()}};PO.TimestampAuthority=k7});var vPe=_(bO=>{\"use strict\";Object.defineProperty(bO,\"__esModule\",{value:!0});bO.TSAClient=void 0;var A1t=$w(),p1t=wPe(),h1t=vg(),BPe=\"sha256\",Q7=class{constructor(e){this.tsa=new p1t.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let r={artifactHash:h1t.crypto.digest(BPe,e).toString(\"base64\"),hashAlgorithm:BPe};try{return await this.tsa.createTimestamp(r)}catch(s){(0,A1t.internalError)(s,\"TSA_CREATE_TIMESTAMP_ERROR\",\"error creating timestamp\")}}};bO.TSAClient=Q7});var SPe=_(xO=>{\"use strict\";Object.defineProperty(xO,\"__esModule\",{value:!0});xO.TSAWitness=void 0;var g1t=vPe(),R7=class{constructor(e){this.tsa=new g1t.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let r=d1t(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(r)}]}}};xO.TSAWitness=R7;function d1t(t){switch(t.$case){case\"dsseEnvelope\":return t.dsseEnvelope.signatures[0].sig;case\"messageSignature\":return t.messageSignature.signature}}});var PPe=_(Dg=>{\"use strict\";Object.defineProperty(Dg,\"__esModule\",{value:!0});Dg.TSAWitness=Dg.RekorWitness=Dg.DEFAULT_REKOR_URL=void 0;var DPe=CPe();Object.defineProperty(Dg,\"DEFAULT_REKOR_URL\",{enumerable:!0,get:function(){return DPe.DEFAULT_REKOR_URL}});Object.defineProperty(Dg,\"RekorWitness\",{enumerable:!0,get:function(){return DPe.RekorWitness}});var m1t=SPe();Object.defineProperty(Dg,\"TSAWitness\",{enumerable:!0,get:function(){return m1t.TSAWitness}})});var F7=_(ys=>{\"use strict\";Object.defineProperty(ys,\"__esModule\",{value:!0});ys.TSAWitness=ys.RekorWitness=ys.DEFAULT_REKOR_URL=ys.FulcioSigner=ys.DEFAULT_FULCIO_URL=ys.CIContextProvider=ys.InternalError=ys.MessageSignatureBundleBuilder=ys.DSSEBundleBuilder=void 0;var bPe=GDe();Object.defineProperty(ys,\"DSSEBundleBuilder\",{enumerable:!0,get:function(){return bPe.DSSEBundleBuilder}});Object.defineProperty(ys,\"MessageSignatureBundleBuilder\",{enumerable:!0,get:function(){return bPe.MessageSignatureBundleBuilder}});var y1t=$w();Object.defineProperty(ys,\"InternalError\",{enumerable:!0,get:function(){return y1t.InternalError}});var E1t=YDe();Object.defineProperty(ys,\"CIContextProvider\",{enumerable:!0,get:function(){return E1t.CIContextProvider}});var xPe=hPe();Object.defineProperty(ys,\"DEFAULT_FULCIO_URL\",{enumerable:!0,get:function(){return xPe.DEFAULT_FULCIO_URL}});Object.defineProperty(ys,\"FulcioSigner\",{enumerable:!0,get:function(){return xPe.FulcioSigner}});var T7=PPe();Object.defineProperty(ys,\"DEFAULT_REKOR_URL\",{enumerable:!0,get:function(){return T7.DEFAULT_REKOR_URL}});Object.defineProperty(ys,\"RekorWitness\",{enumerable:!0,get:function(){return T7.RekorWitness}});Object.defineProperty(ys,\"TSAWitness\",{enumerable:!0,get:function(){return T7.TSAWitness}})});var QPe=_(bP=>{\"use strict\";var kPe=bP&&bP.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bP,\"__esModule\",{value:!0});bP.appDataPath=C1t;var I1t=kPe(Ie(\"os\")),n1=kPe(Ie(\"path\"));function C1t(t){let e=I1t.default.homedir();switch(process.platform){case\"darwin\":{let r=n1.default.join(e,\"Library\",\"Application Support\");return n1.default.join(r,t)}case\"win32\":{let r=process.env.LOCALAPPDATA||n1.default.join(e,\"AppData\",\"Local\");return n1.default.join(r,t,\"Data\")}default:{let r=process.env.XDG_DATA_HOME||n1.default.join(e,\".local\",\"share\");return n1.default.join(r,t)}}}});var bA=_(wl=>{\"use strict\";Object.defineProperty(wl,\"__esModule\",{value:!0});wl.UnsupportedAlgorithmError=wl.CryptoError=wl.LengthOrHashMismatchError=wl.UnsignedMetadataError=wl.RepositoryError=wl.ValueError=void 0;var N7=class extends Error{};wl.ValueError=N7;var xP=class extends Error{};wl.RepositoryError=xP;var O7=class extends xP{};wl.UnsignedMetadataError=O7;var L7=class extends xP{};wl.LengthOrHashMismatchError=L7;var kO=class extends Error{};wl.CryptoError=kO;var M7=class extends kO{};wl.UnsupportedAlgorithmError=M7});var TPe=_(Pg=>{\"use strict\";Object.defineProperty(Pg,\"__esModule\",{value:!0});Pg.isDefined=w1t;Pg.isObject=RPe;Pg.isStringArray=B1t;Pg.isObjectArray=v1t;Pg.isStringRecord=S1t;Pg.isObjectRecord=D1t;function w1t(t){return t!==void 0}function RPe(t){return typeof t==\"object\"&&t!==null}function B1t(t){return Array.isArray(t)&&t.every(e=>typeof e==\"string\")}function v1t(t){return Array.isArray(t)&&t.every(RPe)}function S1t(t){return typeof t==\"object\"&&t!==null&&Object.keys(t).every(e=>typeof e==\"string\")&&Object.values(t).every(e=>typeof e==\"string\")}function D1t(t){return typeof t==\"object\"&&t!==null&&Object.keys(t).every(e=>typeof e==\"string\")&&Object.values(t).every(e=>typeof e==\"object\"&&e!==null)}});var _7=_((Fnr,OPe)=>{var FPe=\",\",P1t=\":\",b1t=\"[\",x1t=\"]\",k1t=\"{\",Q1t=\"}\";function U7(t){let e=[];if(typeof t==\"string\")e.push(NPe(t));else if(typeof t==\"boolean\")e.push(JSON.stringify(t));else if(Number.isInteger(t))e.push(JSON.stringify(t));else if(t===null)e.push(JSON.stringify(t));else if(Array.isArray(t)){e.push(b1t);let r=!0;t.forEach(s=>{r||e.push(FPe),r=!1,e.push(U7(s))}),e.push(x1t)}else if(typeof t==\"object\"){e.push(k1t);let r=!0;Object.keys(t).sort().forEach(s=>{r||e.push(FPe),r=!1,e.push(NPe(s)),e.push(P1t),e.push(U7(t[s]))}),e.push(Q1t)}else throw new TypeError(\"cannot encode \"+t.toString());return e.join(\"\")}function NPe(t){return'\"'+t.replace(/\\\\/g,\"\\\\\\\\\").replace(/\"/g,'\\\\\"')+'\"'}OPe.exports={canonicalize:U7}});var LPe=_(i1=>{\"use strict\";var R1t=i1&&i1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i1,\"__esModule\",{value:!0});i1.verifySignature=void 0;var T1t=_7(),F1t=R1t(Ie(\"crypto\")),N1t=(t,e,r)=>{let s=Buffer.from((0,T1t.canonicalize)(t));return F1t.default.verify(void 0,s,e,Buffer.from(r,\"hex\"))};i1.verifySignature=N1t});var ff=_(eu=>{\"use strict\";var O1t=eu&&eu.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),L1t=eu&&eu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MPe=eu&&eu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&O1t(e,t,r);return L1t(e,t),e};Object.defineProperty(eu,\"__esModule\",{value:!0});eu.crypto=eu.guard=void 0;eu.guard=MPe(TPe());eu.crypto=MPe(LPe())});var ay=_(hh=>{\"use strict\";var M1t=hh&&hh.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hh,\"__esModule\",{value:!0});hh.Signed=hh.MetadataKind=void 0;hh.isMetadataKind=_1t;var U1t=M1t(Ie(\"util\")),kP=bA(),H7=ff(),UPe=[\"1\",\"0\",\"31\"],j7;(function(t){t.Root=\"root\",t.Timestamp=\"timestamp\",t.Snapshot=\"snapshot\",t.Targets=\"targets\"})(j7||(hh.MetadataKind=j7={}));function _1t(t){return typeof t==\"string\"&&Object.values(j7).includes(t)}var G7=class t{constructor(e){this.specVersion=e.specVersion||UPe.join(\".\");let r=this.specVersion.split(\".\");if(!(r.length===2||r.length===3)||!r.every(s=>H1t(s)))throw new kP.ValueError(\"Failed to parse specVersion\");if(r[0]!=UPe[0])throw new kP.ValueError(\"Unsupported specVersion\");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof t?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&U1t.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}isExpired(e){return e||(e=new Date),e>=new Date(this.expires)}static commonFieldsFromJSON(e){let{spec_version:r,expires:s,version:a,...n}=e;if(H7.guard.isDefined(r)){if(typeof r!=\"string\")throw new TypeError(\"spec_version must be a string\")}else throw new kP.ValueError(\"spec_version is not defined\");if(H7.guard.isDefined(s)){if(typeof s!=\"string\")throw new TypeError(\"expires must be a string\")}else throw new kP.ValueError(\"expires is not defined\");if(H7.guard.isDefined(a)){if(typeof a!=\"number\")throw new TypeError(\"version must be a number\")}else throw new kP.ValueError(\"version is not defined\");return{specVersion:r,expires:s,version:a,unrecognizedFields:n}}};hh.Signed=G7;function H1t(t){return!isNaN(Number(t))}});var QP=_(xg=>{\"use strict\";var _Pe=xg&&xg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xg,\"__esModule\",{value:!0});xg.TargetFile=xg.MetaFile=void 0;var HPe=_Pe(Ie(\"crypto\")),RO=_Pe(Ie(\"util\")),bg=bA(),QO=ff(),q7=class t{constructor(e){if(e.version<=0)throw new bg.ValueError(\"Metafile version must be at least 1\");e.length!==void 0&&jPe(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof t?this.version===e.version&&this.length===e.length&&RO.default.isDeepStrictEqual(this.hashes,e.hashes)&&RO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new bg.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([r,s])=>{let a;try{a=HPe.default.createHash(r)}catch{throw new bg.LengthOrHashMismatchError(`Hash algorithm ${r} not supported`)}let n=a.update(e).digest(\"hex\");if(n!==s)throw new bg.LengthOrHashMismatchError(`Expected hash ${s} but got ${n}`)})}toJSON(){let e={version:this.version,...this.unrecognizedFields};return this.length!==void 0&&(e.length=this.length),this.hashes&&(e.hashes=this.hashes),e}static fromJSON(e){let{version:r,length:s,hashes:a,...n}=e;if(typeof r!=\"number\")throw new TypeError(\"version must be a number\");if(QO.guard.isDefined(s)&&typeof s!=\"number\")throw new TypeError(\"length must be a number\");if(QO.guard.isDefined(a)&&!QO.guard.isStringRecord(a))throw new TypeError(\"hashes must be string keys and values\");return new t({version:r,length:s,hashes:a,unrecognizedFields:n})}};xg.MetaFile=q7;var W7=class t{constructor(e){jPe(e.length),this.length=e.length,this.path=e.path,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}get custom(){let e=this.unrecognizedFields.custom;return!e||Array.isArray(e)||typeof e!=\"object\"?{}:e}equals(e){return e instanceof t?this.length===e.length&&this.path===e.path&&RO.default.isDeepStrictEqual(this.hashes,e.hashes)&&RO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let r=0,s=Object.keys(this.hashes).reduce((a,n)=>{try{a[n]=HPe.default.createHash(n)}catch{throw new bg.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return a},{});for await(let a of e)r+=a.length,Object.values(s).forEach(n=>{n.update(a)});if(r!==this.length)throw new bg.LengthOrHashMismatchError(`Expected length ${this.length} but got ${r}`);Object.entries(s).forEach(([a,n])=>{let c=this.hashes[a],f=n.digest(\"hex\");if(f!==c)throw new bg.LengthOrHashMismatchError(`Expected hash ${c} but got ${f}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,r){let{length:s,hashes:a,...n}=r;if(typeof s!=\"number\")throw new TypeError(\"length must be a number\");if(!QO.guard.isStringRecord(a))throw new TypeError(\"hashes must have string keys and values\");return new t({length:s,path:e,hashes:a,unrecognizedFields:n})}};xg.TargetFile=W7;function jPe(t){if(t<0)throw new bg.ValueError(\"Length must be at least 0\")}});var GPe=_(Y7=>{\"use strict\";Object.defineProperty(Y7,\"__esModule\",{value:!0});Y7.encodeOIDString=G1t;var j1t=6;function G1t(t){let e=t.split(\".\"),r=parseInt(e[0],10)*40+parseInt(e[1],10),s=[];e.slice(2).forEach(n=>{let c=q1t(parseInt(n,10));s.push(...c)});let a=Buffer.from([r,...s]);return Buffer.from([j1t,a.length,...a])}function q1t(t){let e=[],r=0;for(;t>0;)e.unshift(t&127|r),t>>=7,r=128;return e}});var VPe=_(TP=>{\"use strict\";var W1t=TP&&TP.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(TP,\"__esModule\",{value:!0});TP.getPublicKey=K1t;var s1=W1t(Ie(\"crypto\")),RP=bA(),V7=GPe(),TO=48,qPe=3,WPe=0,Y1t=\"1.3.101.112\",V1t=\"1.2.840.10045.2.1\",J1t=\"1.2.840.10045.3.1.7\",J7=\"-----BEGIN PUBLIC KEY-----\";function K1t(t){switch(t.keyType){case\"rsa\":return z1t(t);case\"ed25519\":return Z1t(t);case\"ecdsa\":case\"ecdsa-sha2-nistp256\":case\"ecdsa-sha2-nistp384\":return X1t(t);default:throw new RP.UnsupportedAlgorithmError(`Unsupported key type: ${t.keyType}`)}}function z1t(t){if(!t.keyVal.startsWith(J7))throw new RP.CryptoError(\"Invalid key format\");let e=s1.default.createPublicKey(t.keyVal);switch(t.scheme){case\"rsassa-pss-sha256\":return{key:e,padding:s1.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new RP.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${t.scheme}`)}}function Z1t(t){let e;if(t.keyVal.startsWith(J7))e=s1.default.createPublicKey(t.keyVal);else{if(!YPe(t.keyVal))throw new RP.CryptoError(\"Invalid key format\");e=s1.default.createPublicKey({key:$1t.hexToDER(t.keyVal),format:\"der\",type:\"spki\"})}return{key:e}}function X1t(t){let e;if(t.keyVal.startsWith(J7))e=s1.default.createPublicKey(t.keyVal);else{if(!YPe(t.keyVal))throw new RP.CryptoError(\"Invalid key format\");e=s1.default.createPublicKey({key:e2t.hexToDER(t.keyVal),format:\"der\",type:\"spki\"})}return{key:e}}var $1t={hexToDER:t=>{let e=Buffer.from(t,\"hex\"),r=(0,V7.encodeOIDString)(Y1t),s=Buffer.concat([Buffer.concat([Buffer.from([TO]),Buffer.from([r.length]),r]),Buffer.concat([Buffer.from([qPe]),Buffer.from([e.length+1]),Buffer.from([WPe]),e])]);return Buffer.concat([Buffer.from([TO]),Buffer.from([s.length]),s])}},e2t={hexToDER:t=>{let e=Buffer.from(t,\"hex\"),r=Buffer.concat([Buffer.from([qPe]),Buffer.from([e.length+1]),Buffer.from([WPe]),e]),s=Buffer.concat([(0,V7.encodeOIDString)(V1t),(0,V7.encodeOIDString)(J1t)]),a=Buffer.concat([Buffer.from([TO]),Buffer.from([s.length]),s]);return Buffer.concat([Buffer.from([TO]),Buffer.from([a.length+r.length]),a,r])}},YPe=t=>/^[0-9a-fA-F]+$/.test(t)});var FO=_(o1=>{\"use strict\";var t2t=o1&&o1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o1,\"__esModule\",{value:!0});o1.Key=void 0;var JPe=t2t(Ie(\"util\")),FP=bA(),KPe=ff(),r2t=VPe(),K7=class t{constructor(e){let{keyID:r,keyType:s,scheme:a,keyVal:n,unrecognizedFields:c}=e;this.keyID=r,this.keyType=s,this.scheme=a,this.keyVal=n,this.unrecognizedFields=c||{}}verifySignature(e){let r=e.signatures[this.keyID];if(!r)throw new FP.UnsignedMetadataError(\"no signature for key found in metadata\");if(!this.keyVal.public)throw new FP.UnsignedMetadataError(\"no public key found\");let s=(0,r2t.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),a=e.signed.toJSON();try{if(!KPe.crypto.verifySignature(a,s,r.sig))throw new FP.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof FP.UnsignedMetadataError?n:new FP.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof t?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&JPe.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&JPe.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keytype:this.keyType,scheme:this.scheme,keyval:this.keyVal,...this.unrecognizedFields}}static fromJSON(e,r){let{keytype:s,scheme:a,keyval:n,...c}=r;if(typeof s!=\"string\")throw new TypeError(\"keytype must be a string\");if(typeof a!=\"string\")throw new TypeError(\"scheme must be a string\");if(!KPe.guard.isStringRecord(n))throw new TypeError(\"keyval must be a string record\");return new t({keyID:e,keyType:s,scheme:a,keyVal:n,unrecognizedFields:c})}};o1.Key=K7});var ebe=_((jnr,$Pe)=>{\"use strict\";$Pe.exports=ZPe;function ZPe(t,e,r){t instanceof RegExp&&(t=zPe(t,r)),e instanceof RegExp&&(e=zPe(e,r));var s=XPe(t,e,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+t.length,s[1]),post:r.slice(s[1]+e.length)}}function zPe(t,e){var r=e.match(t);return r?r[0]:null}ZPe.range=XPe;function XPe(t,e,r){var s,a,n,c,f,p=r.indexOf(t),h=r.indexOf(e,p+1),E=p;if(p>=0&&h>0){for(s=[],n=r.length;E>=0&&!f;)E==p?(s.push(E),p=r.indexOf(t,E+1)):s.length==1?f=[s.pop(),h]:(a=s.pop(),a<n&&(n=a,c=h),h=r.indexOf(e,E+1)),E=p<h&&p>=0?p:h;s.length&&(f=[n,c])}return f}});var lbe=_((Gnr,abe)=>{var tbe=ebe();abe.exports=s2t;var rbe=\"\\0SLASH\"+Math.random()+\"\\0\",nbe=\"\\0OPEN\"+Math.random()+\"\\0\",Z7=\"\\0CLOSE\"+Math.random()+\"\\0\",ibe=\"\\0COMMA\"+Math.random()+\"\\0\",sbe=\"\\0PERIOD\"+Math.random()+\"\\0\";function z7(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function n2t(t){return t.split(\"\\\\\\\\\").join(rbe).split(\"\\\\{\").join(nbe).split(\"\\\\}\").join(Z7).split(\"\\\\,\").join(ibe).split(\"\\\\.\").join(sbe)}function i2t(t){return t.split(rbe).join(\"\\\\\").split(nbe).join(\"{\").split(Z7).join(\"}\").split(ibe).join(\",\").split(sbe).join(\".\")}function obe(t){if(!t)return[\"\"];var e=[],r=tbe(\"{\",\"}\",t);if(!r)return t.split(\",\");var s=r.pre,a=r.body,n=r.post,c=s.split(\",\");c[c.length-1]+=\"{\"+a+\"}\";var f=obe(n);return n.length&&(c[c.length-1]+=f.shift(),c.push.apply(c,f)),e.push.apply(e,c),e}function s2t(t){return t?(t.substr(0,2)===\"{}\"&&(t=\"\\\\{\\\\}\"+t.substr(2)),NP(n2t(t),!0).map(i2t)):[]}function o2t(t){return\"{\"+t+\"}\"}function a2t(t){return/^-?0\\d/.test(t)}function l2t(t,e){return t<=e}function c2t(t,e){return t>=e}function NP(t,e){var r=[],s=tbe(\"{\",\"}\",t);if(!s)return[t];var a=s.pre,n=s.post.length?NP(s.post,!1):[\"\"];if(/\\$$/.test(s.pre))for(var c=0;c<n.length;c++){var f=a+\"{\"+s.body+\"}\"+n[c];r.push(f)}else{var p=/^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(s.body),h=/^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(s.body),E=p||h,C=s.body.indexOf(\",\")>=0;if(!E&&!C)return s.post.match(/,.*\\}/)?(t=s.pre+\"{\"+s.body+Z7+s.post,NP(t)):[t];var S;if(E)S=s.body.split(/\\.\\./);else if(S=obe(s.body),S.length===1&&(S=NP(S[0],!1).map(o2t),S.length===1))return n.map(function(Ce){return s.pre+S[0]+Ce});var b;if(E){var I=z7(S[0]),T=z7(S[1]),N=Math.max(S[0].length,S[1].length),U=S.length==3?Math.abs(z7(S[2])):1,W=l2t,ee=T<I;ee&&(U*=-1,W=c2t);var ie=S.some(a2t);b=[];for(var ue=I;W(ue,T);ue+=U){var le;if(h)le=String.fromCharCode(ue),le===\"\\\\\"&&(le=\"\");else if(le=String(ue),ie){var me=N-le.length;if(me>0){var pe=new Array(me+1).join(\"0\");ue<0?le=\"-\"+pe+le.slice(1):le=pe+le}}b.push(le)}}else{b=[];for(var Be=0;Be<S.length;Be++)b.push.apply(b,NP(S[Be],!1))}for(var Be=0;Be<b.length;Be++)for(var c=0;c<n.length;c++){var f=a+b[Be]+n[c];(!e||E||f)&&r.push(f)}}return r}});var cbe=_(NO=>{\"use strict\";Object.defineProperty(NO,\"__esModule\",{value:!0});NO.assertValidPattern=void 0;var u2t=1024*64,f2t=t=>{if(typeof t!=\"string\")throw new TypeError(\"invalid pattern\");if(t.length>u2t)throw new TypeError(\"pattern is too long\")};NO.assertValidPattern=f2t});var fbe=_(OO=>{\"use strict\";Object.defineProperty(OO,\"__esModule\",{value:!0});OO.parseClass=void 0;var A2t={\"[:alnum:]\":[\"\\\\p{L}\\\\p{Nl}\\\\p{Nd}\",!0],\"[:alpha:]\":[\"\\\\p{L}\\\\p{Nl}\",!0],\"[:ascii:]\":[\"\\\\x00-\\\\x7f\",!1],\"[:blank:]\":[\"\\\\p{Zs}\\\\t\",!0],\"[:cntrl:]\":[\"\\\\p{Cc}\",!0],\"[:digit:]\":[\"\\\\p{Nd}\",!0],\"[:graph:]\":[\"\\\\p{Z}\\\\p{C}\",!0,!0],\"[:lower:]\":[\"\\\\p{Ll}\",!0],\"[:print:]\":[\"\\\\p{C}\",!0],\"[:punct:]\":[\"\\\\p{P}\",!0],\"[:space:]\":[\"\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f\",!0],\"[:upper:]\":[\"\\\\p{Lu}\",!0],\"[:word:]\":[\"\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}\",!0],\"[:xdigit:]\":[\"A-Fa-f0-9\",!1]},OP=t=>t.replace(/[[\\]\\\\-]/g,\"\\\\$&\"),p2t=t=>t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),ube=t=>t.join(\"\"),h2t=(t,e)=>{let r=e;if(t.charAt(r)!==\"[\")throw new Error(\"not in a brace expression\");let s=[],a=[],n=r+1,c=!1,f=!1,p=!1,h=!1,E=r,C=\"\";e:for(;n<t.length;){let T=t.charAt(n);if((T===\"!\"||T===\"^\")&&n===r+1){h=!0,n++;continue}if(T===\"]\"&&c&&!p){E=n+1;break}if(c=!0,T===\"\\\\\"&&!p){p=!0,n++;continue}if(T===\"[\"&&!p){for(let[N,[U,W,ee]]of Object.entries(A2t))if(t.startsWith(N,n)){if(C)return[\"$.\",!1,t.length-r,!0];n+=N.length,ee?a.push(U):s.push(U),f=f||W;continue e}}if(p=!1,C){T>C?s.push(OP(C)+\"-\"+OP(T)):T===C&&s.push(OP(T)),C=\"\",n++;continue}if(t.startsWith(\"-]\",n+1)){s.push(OP(T+\"-\")),n+=2;continue}if(t.startsWith(\"-\",n+1)){C=T,n+=2;continue}s.push(OP(T)),n++}if(E<n)return[\"\",!1,0,!1];if(!s.length&&!a.length)return[\"$.\",!1,t.length-r,!0];if(a.length===0&&s.length===1&&/^\\\\?.$/.test(s[0])&&!h){let T=s[0].length===2?s[0].slice(-1):s[0];return[p2t(T),!1,E-r,!1]}let S=\"[\"+(h?\"^\":\"\")+ube(s)+\"]\",b=\"[\"+(h?\"\":\"^\")+ube(a)+\"]\";return[s.length&&a.length?\"(\"+S+\"|\"+b+\")\":s.length?S:b,f,E-r,!0]};OO.parseClass=h2t});var MO=_(LO=>{\"use strict\";Object.defineProperty(LO,\"__esModule\",{value:!0});LO.unescape=void 0;var g2t=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\\[([^\\/\\\\])\\]/g,\"$1\"):t.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g,\"$1$2\").replace(/\\\\([^\\/])/g,\"$1\");LO.unescape=g2t});var eJ=_(HO=>{\"use strict\";Object.defineProperty(HO,\"__esModule\",{value:!0});HO.AST=void 0;var d2t=fbe(),UO=MO(),m2t=new Set([\"!\",\"?\",\"+\",\"*\",\"@\"]),Abe=t=>m2t.has(t),y2t=\"(?!(?:^|/)\\\\.\\\\.?(?:$|/))\",_O=\"(?!\\\\.)\",E2t=new Set([\"[\",\".\"]),I2t=new Set([\"..\",\".\"]),C2t=new Set(\"().*{}+?[]^$\\\\!\"),w2t=t=>t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),$7=\"[^/]\",pbe=$7+\"*?\",hbe=$7+\"+?\",X7=class t{type;#t;#r;#i=!1;#e=[];#n;#o;#l;#a=!1;#s;#c;#f=!1;constructor(e,r,s={}){this.type=e,e&&(this.#r=!0),this.#n=r,this.#t=this.#n?this.#n.#t:this,this.#s=this.#t===this?s:this.#t.#s,this.#l=this.#t===this?[]:this.#t.#l,e===\"!\"&&!this.#t.#a&&this.#l.push(this),this.#o=this.#n?this.#n.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!=\"string\"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+\"(\"+this.#e.map(e=>String(e)).join(\"|\")+\")\":this.#c=this.#e.map(e=>String(e)).join(\"\")}#p(){if(this!==this.#t)throw new Error(\"should only call on root\");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#l.pop();){if(e.type!==\"!\")continue;let r=e,s=r.#n;for(;s;){for(let a=r.#o+1;!s.type&&a<s.#e.length;a++)for(let n of e.#e){if(typeof n==\"string\")throw new Error(\"string part in extglob AST??\");n.copyIn(s.#e[a])}r=s,s=r.#n}}return this}push(...e){for(let r of e)if(r!==\"\"){if(typeof r!=\"string\"&&!(r instanceof t&&r.#n===this))throw new Error(\"invalid part: \"+r);this.#e.push(r)}}toJSON(){let e=this.type===null?this.#e.slice().map(r=>typeof r==\"string\"?r:r.toJSON()):[this.type,...this.#e.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&this.#n?.type===\"!\")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#n?.isStart())return!1;if(this.#o===0)return!0;let e=this.#n;for(let r=0;r<this.#o;r++){let s=e.#e[r];if(!(s instanceof t&&s.type===\"!\"))return!1}return!0}isEnd(){if(this.#t===this||this.#n?.type===\"!\")return!0;if(!this.#n?.isEnd())return!1;if(!this.type)return this.#n?.isEnd();let e=this.#n?this.#n.#e.length:0;return this.#o===e-1}copyIn(e){typeof e==\"string\"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let s of this.#e)r.copyIn(s);return r}static#u(e,r,s,a){let n=!1,c=!1,f=-1,p=!1;if(r.type===null){let b=s,I=\"\";for(;b<e.length;){let T=e.charAt(b++);if(n||T===\"\\\\\"){n=!n,I+=T;continue}if(c){b===f+1?(T===\"^\"||T===\"!\")&&(p=!0):T===\"]\"&&!(b===f+2&&p)&&(c=!1),I+=T;continue}else if(T===\"[\"){c=!0,f=b,p=!1,I+=T;continue}if(!a.noext&&Abe(T)&&e.charAt(b)===\"(\"){r.push(I),I=\"\";let N=new t(T,r);b=t.#u(e,N,b,a),r.push(N);continue}I+=T}return r.push(I),b}let h=s+1,E=new t(null,r),C=[],S=\"\";for(;h<e.length;){let b=e.charAt(h++);if(n||b===\"\\\\\"){n=!n,S+=b;continue}if(c){h===f+1?(b===\"^\"||b===\"!\")&&(p=!0):b===\"]\"&&!(h===f+2&&p)&&(c=!1),S+=b;continue}else if(b===\"[\"){c=!0,f=h,p=!1,S+=b;continue}if(Abe(b)&&e.charAt(h)===\"(\"){E.push(S),S=\"\";let I=new t(b,E);E.push(I),h=t.#u(e,I,h,a);continue}if(b===\"|\"){E.push(S),S=\"\",C.push(E),E=new t(null,r);continue}if(b===\")\")return S===\"\"&&r.#e.length===0&&(r.#f=!0),E.push(S),S=\"\",r.push(...C,E),h;S+=b}return r.type=null,r.#r=void 0,r.#e=[e.substring(s-1)],h}static fromGlob(e,r={}){let s=new t(null,void 0,r);return t.#u(e,s,0,r),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,s,a,n]=this.toRegExpSource();if(!(a||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let f=(this.#s.nocase?\"i\":\"\")+(n?\"u\":\"\");return Object.assign(new RegExp(`^${r}$`,f),{_src:r,_glob:e})}get options(){return this.#s}toRegExpSource(e){let r=e??!!this.#s.dot;if(this.#t===this&&this.#p(),!this.type){let p=this.isStart()&&this.isEnd(),h=this.#e.map(b=>{let[I,T,N,U]=typeof b==\"string\"?t.#h(b,this.#r,p):b.toRegExpSource(e);return this.#r=this.#r||N,this.#i=this.#i||U,I}).join(\"\"),E=\"\";if(this.isStart()&&typeof this.#e[0]==\"string\"&&!(this.#e.length===1&&I2t.has(this.#e[0]))){let I=E2t,T=r&&I.has(h.charAt(0))||h.startsWith(\"\\\\.\")&&I.has(h.charAt(2))||h.startsWith(\"\\\\.\\\\.\")&&I.has(h.charAt(4)),N=!r&&!e&&I.has(h.charAt(0));E=T?y2t:N?_O:\"\"}let C=\"\";return this.isEnd()&&this.#t.#a&&this.#n?.type===\"!\"&&(C=\"(?:$|\\\\/)\"),[E+h+C,(0,UO.unescape)(h),this.#r=!!this.#r,this.#i]}let s=this.type===\"*\"||this.type===\"+\",a=this.type===\"!\"?\"(?:(?!(?:\":\"(?:\",n=this.#A(r);if(this.isStart()&&this.isEnd()&&!n&&this.type!==\"!\"){let p=this.toString();return this.#e=[p],this.type=null,this.#r=void 0,[p,(0,UO.unescape)(this.toString()),!1,!1]}let c=!s||e||r||!_O?\"\":this.#A(!0);c===n&&(c=\"\"),c&&(n=`(?:${n})(?:${c})*?`);let f=\"\";if(this.type===\"!\"&&this.#f)f=(this.isStart()&&!r?_O:\"\")+hbe;else{let p=this.type===\"!\"?\"))\"+(this.isStart()&&!r&&!e?_O:\"\")+pbe+\")\":this.type===\"@\"?\")\":this.type===\"?\"?\")?\":this.type===\"+\"&&c?\")\":this.type===\"*\"&&c?\")?\":`)${this.type}`;f=a+n+p}return[f,(0,UO.unescape)(n),this.#r=!!this.#r,this.#i]}#A(e){return this.#e.map(r=>{if(typeof r==\"string\")throw new Error(\"string type in extglob ast??\");let[s,a,n,c]=r.toRegExpSource(e);return this.#i=this.#i||c,s}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join(\"|\")}static#h(e,r,s=!1){let a=!1,n=\"\",c=!1;for(let f=0;f<e.length;f++){let p=e.charAt(f);if(a){a=!1,n+=(C2t.has(p)?\"\\\\\":\"\")+p;continue}if(p===\"\\\\\"){f===e.length-1?n+=\"\\\\\\\\\":a=!0;continue}if(p===\"[\"){let[h,E,C,S]=(0,d2t.parseClass)(e,f);if(C){n+=h,c=c||E,f+=C-1,r=r||S;continue}}if(p===\"*\"){s&&e===\"*\"?n+=hbe:n+=pbe,r=!0;continue}if(p===\"?\"){n+=$7,r=!0;continue}n+=w2t(p)}return[n,(0,UO.unescape)(e),!!r,c]}};HO.AST=X7});var tJ=_(jO=>{\"use strict\";Object.defineProperty(jO,\"__esModule\",{value:!0});jO.escape=void 0;var B2t=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\\]]/g,\"[$&]\"):t.replace(/[?*()[\\]\\\\]/g,\"\\\\$&\");jO.escape=B2t});var Cbe=_(pr=>{\"use strict\";var v2t=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,\"__esModule\",{value:!0});pr.unescape=pr.escape=pr.AST=pr.Minimatch=pr.match=pr.makeRe=pr.braceExpand=pr.defaults=pr.filter=pr.GLOBSTAR=pr.sep=pr.minimatch=void 0;var S2t=v2t(lbe()),GO=cbe(),mbe=eJ(),D2t=tJ(),P2t=MO(),b2t=(t,e,r={})=>((0,GO.assertValidPattern)(e),!r.nocomment&&e.charAt(0)===\"#\"?!1:new ly(e,r).match(t));pr.minimatch=b2t;var x2t=/^\\*+([^+@!?\\*\\[\\(]*)$/,k2t=t=>e=>!e.startsWith(\".\")&&e.endsWith(t),Q2t=t=>e=>e.endsWith(t),R2t=t=>(t=t.toLowerCase(),e=>!e.startsWith(\".\")&&e.toLowerCase().endsWith(t)),T2t=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),F2t=/^\\*+\\.\\*+$/,N2t=t=>!t.startsWith(\".\")&&t.includes(\".\"),O2t=t=>t!==\".\"&&t!==\"..\"&&t.includes(\".\"),L2t=/^\\.\\*+$/,M2t=t=>t!==\".\"&&t!==\"..\"&&t.startsWith(\".\"),U2t=/^\\*+$/,_2t=t=>t.length!==0&&!t.startsWith(\".\"),H2t=t=>t.length!==0&&t!==\".\"&&t!==\"..\",j2t=/^\\?+([^+@!?\\*\\[\\(]*)?$/,G2t=([t,e=\"\"])=>{let r=ybe([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},q2t=([t,e=\"\"])=>{let r=Ebe([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},W2t=([t,e=\"\"])=>{let r=Ebe([t]);return e?s=>r(s)&&s.endsWith(e):r},Y2t=([t,e=\"\"])=>{let r=ybe([t]);return e?s=>r(s)&&s.endsWith(e):r},ybe=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(\".\")},Ebe=([t])=>{let e=t.length;return r=>r.length===e&&r!==\".\"&&r!==\"..\"},Ibe=typeof process==\"object\"&&process?typeof process.env==\"object\"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:\"posix\",gbe={win32:{sep:\"\\\\\"},posix:{sep:\"/\"}};pr.sep=Ibe===\"win32\"?gbe.win32.sep:gbe.posix.sep;pr.minimatch.sep=pr.sep;pr.GLOBSTAR=Symbol(\"globstar **\");pr.minimatch.GLOBSTAR=pr.GLOBSTAR;var V2t=\"[^/]\",J2t=V2t+\"*?\",K2t=\"(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?\",z2t=\"(?:(?!(?:\\\\/|^)\\\\.).)*?\",Z2t=(t,e={})=>r=>(0,pr.minimatch)(r,t,e);pr.filter=Z2t;pr.minimatch.filter=pr.filter;var tu=(t,e={})=>Object.assign({},t,e),X2t=t=>{if(!t||typeof t!=\"object\"||!Object.keys(t).length)return pr.minimatch;let e=pr.minimatch;return Object.assign((s,a,n={})=>e(s,a,tu(t,n)),{Minimatch:class extends e.Minimatch{constructor(a,n={}){super(a,tu(t,n))}static defaults(a){return e.defaults(tu(t,a)).Minimatch}},AST:class extends e.AST{constructor(a,n,c={}){super(a,n,tu(t,c))}static fromGlob(a,n={}){return e.AST.fromGlob(a,tu(t,n))}},unescape:(s,a={})=>e.unescape(s,tu(t,a)),escape:(s,a={})=>e.escape(s,tu(t,a)),filter:(s,a={})=>e.filter(s,tu(t,a)),defaults:s=>e.defaults(tu(t,s)),makeRe:(s,a={})=>e.makeRe(s,tu(t,a)),braceExpand:(s,a={})=>e.braceExpand(s,tu(t,a)),match:(s,a,n={})=>e.match(s,a,tu(t,n)),sep:e.sep,GLOBSTAR:pr.GLOBSTAR})};pr.defaults=X2t;pr.minimatch.defaults=pr.defaults;var $2t=(t,e={})=>((0,GO.assertValidPattern)(t),e.nobrace||!/\\{(?:(?!\\{).)*\\}/.test(t)?[t]:(0,S2t.default)(t));pr.braceExpand=$2t;pr.minimatch.braceExpand=pr.braceExpand;var eBt=(t,e={})=>new ly(t,e).makeRe();pr.makeRe=eBt;pr.minimatch.makeRe=pr.makeRe;var tBt=(t,e,r={})=>{let s=new ly(e,r);return t=t.filter(a=>s.match(a)),s.options.nonull&&!t.length&&t.push(e),t};pr.match=tBt;pr.minimatch.match=pr.match;var dbe=/[?*]|[+@!]\\(.*?\\)|\\[|\\]/,rBt=t=>t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\"),ly=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){(0,GO.assertValidPattern)(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||Ibe,this.isWindows=this.platform===\"win32\",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\\\/g,\"/\")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!=\"string\")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)===\"#\"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let a=this.globParts.map((n,c,f)=>{if(this.isWindows&&this.windowsNoMagicRoot){let p=n[0]===\"\"&&n[1]===\"\"&&(n[2]===\"?\"||!dbe.test(n[2]))&&!dbe.test(n[3]),h=/^[a-z]:/i.test(n[0]);if(p)return[...n.slice(0,4),...n.slice(4).map(E=>this.parse(E))];if(h)return[n[0],...n.slice(1).map(E=>this.parse(E))]}return n.map(p=>this.parse(p))});if(this.debug(this.pattern,a),this.set=a.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let c=this.set[n];c[0]===\"\"&&c[1]===\"\"&&this.globParts[n][2]===\"?\"&&typeof c[3]==\"string\"&&/^[a-z]:$/i.test(c[3])&&(c[2]=\"?\")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let s=0;s<e.length;s++)for(let a=0;a<e[s].length;a++)e[s][a]===\"**\"&&(e[s][a]=\"*\");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let s=-1;for(;(s=r.indexOf(\"**\",s+1))!==-1;){let a=s;for(;r[a+1]===\"**\";)a++;a!==s&&r.splice(s,a-s)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((s,a)=>{let n=s[s.length-1];return a===\"**\"&&n===\"**\"?s:a===\"..\"&&n&&n!==\"..\"&&n!==\".\"&&n!==\"**\"?(s.pop(),s):(s.push(a),s)},[]),r.length===0?[\"\"]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let a=1;a<e.length-1;a++){let n=e[a];a===1&&n===\"\"&&e[0]===\"\"||(n===\".\"||n===\"\")&&(r=!0,e.splice(a,1),a--)}e[0]===\".\"&&e.length===2&&(e[1]===\".\"||e[1]===\"\")&&(r=!0,e.pop())}let s=0;for(;(s=e.indexOf(\"..\",s+1))!==-1;){let a=e[s-1];a&&a!==\".\"&&a!==\"..\"&&a!==\"**\"&&(r=!0,e.splice(s-1,2),s-=2)}}while(r);return e.length===0?[\"\"]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let s of e){let a=-1;for(;(a=s.indexOf(\"**\",a+1))!==-1;){let c=a;for(;s[c+1]===\"**\";)c++;c>a&&s.splice(a+1,c-a);let f=s[a+1],p=s[a+2],h=s[a+3];if(f!==\"..\"||!p||p===\".\"||p===\"..\"||!h||h===\".\"||h===\"..\")continue;r=!0,s.splice(a,1);let E=s.slice(0);E[a]=\"**\",e.push(E),a--}if(!this.preserveMultipleSlashes){for(let c=1;c<s.length-1;c++){let f=s[c];c===1&&f===\"\"&&s[0]===\"\"||(f===\".\"||f===\"\")&&(r=!0,s.splice(c,1),c--)}s[0]===\".\"&&s.length===2&&(s[1]===\".\"||s[1]===\"\")&&(r=!0,s.pop())}let n=0;for(;(n=s.indexOf(\"..\",n+1))!==-1;){let c=s[n-1];if(c&&c!==\".\"&&c!==\"..\"&&c!==\"**\"){r=!0;let p=n===1&&s[n+1]===\"**\"?[\".\"]:[];s.splice(n-1,2,...p),s.length===0&&s.push(\"\"),n-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let s=r+1;s<e.length;s++){let a=this.partsMatch(e[r],e[s],!this.preserveMultipleSlashes);if(a){e[r]=[],e[s]=a;break}}return e.filter(r=>r.length)}partsMatch(e,r,s=!1){let a=0,n=0,c=[],f=\"\";for(;a<e.length&&n<r.length;)if(e[a]===r[n])c.push(f===\"b\"?r[n]:e[a]),a++,n++;else if(s&&e[a]===\"**\"&&r[n]===e[a+1])c.push(e[a]),a++;else if(s&&r[n]===\"**\"&&e[a]===r[n+1])c.push(r[n]),n++;else if(e[a]===\"*\"&&r[n]&&(this.options.dot||!r[n].startsWith(\".\"))&&r[n]!==\"**\"){if(f===\"b\")return!1;f=\"a\",c.push(e[a]),a++,n++}else if(r[n]===\"*\"&&e[a]&&(this.options.dot||!e[a].startsWith(\".\"))&&e[a]!==\"**\"){if(f===\"a\")return!1;f=\"b\",c.push(r[n]),a++,n++}else return!1;return e.length===r.length&&c}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,s=0;for(let a=0;a<e.length&&e.charAt(a)===\"!\";a++)r=!r,s++;s&&(this.pattern=e.slice(s)),this.negate=r}matchOne(e,r,s=!1){let a=this.options;if(this.isWindows){let T=typeof e[0]==\"string\"&&/^[a-z]:$/i.test(e[0]),N=!T&&e[0]===\"\"&&e[1]===\"\"&&e[2]===\"?\"&&/^[a-z]:$/i.test(e[3]),U=typeof r[0]==\"string\"&&/^[a-z]:$/i.test(r[0]),W=!U&&r[0]===\"\"&&r[1]===\"\"&&r[2]===\"?\"&&typeof r[3]==\"string\"&&/^[a-z]:$/i.test(r[3]),ee=N?3:T?0:void 0,ie=W?3:U?0:void 0;if(typeof ee==\"number\"&&typeof ie==\"number\"){let[ue,le]=[e[ee],r[ie]];ue.toLowerCase()===le.toLowerCase()&&(r[ie]=ue,ie>ee?r=r.slice(ie):ee>ie&&(e=e.slice(ee)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug(\"matchOne\",this,{file:e,pattern:r}),this.debug(\"matchOne\",e.length,r.length);for(var c=0,f=0,p=e.length,h=r.length;c<p&&f<h;c++,f++){this.debug(\"matchOne loop\");var E=r[f],C=e[c];if(this.debug(r,E,C),E===!1)return!1;if(E===pr.GLOBSTAR){this.debug(\"GLOBSTAR\",[r,E,C]);var S=c,b=f+1;if(b===h){for(this.debug(\"** at the end\");c<p;c++)if(e[c]===\".\"||e[c]===\"..\"||!a.dot&&e[c].charAt(0)===\".\")return!1;return!0}for(;S<p;){var I=e[S];if(this.debug(`\nglobstar while`,e,S,r,b,I),this.matchOne(e.slice(S),r.slice(b),s))return this.debug(\"globstar found match!\",S,p,I),!0;if(I===\".\"||I===\"..\"||!a.dot&&I.charAt(0)===\".\"){this.debug(\"dot detected!\",e,S,r,b);break}this.debug(\"globstar swallow a segment, and continue\"),S++}return!!(s&&(this.debug(`\n>>> no match, partial?`,e,S,r,b),S===p))}let T;if(typeof E==\"string\"?(T=C===E,this.debug(\"string match\",E,C,T)):(T=E.test(C),this.debug(\"pattern match\",E,C,T)),!T)return!1}if(c===p&&f===h)return!0;if(c===p)return s;if(f===h)return c===p-1&&e[c]===\"\";throw new Error(\"wtf?\")}braceExpand(){return(0,pr.braceExpand)(this.pattern,this.options)}parse(e){(0,GO.assertValidPattern)(e);let r=this.options;if(e===\"**\")return pr.GLOBSTAR;if(e===\"\")return\"\";let s,a=null;(s=e.match(U2t))?a=r.dot?H2t:_2t:(s=e.match(x2t))?a=(r.nocase?r.dot?T2t:R2t:r.dot?Q2t:k2t)(s[1]):(s=e.match(j2t))?a=(r.nocase?r.dot?q2t:G2t:r.dot?W2t:Y2t)(s):(s=e.match(F2t))?a=r.dot?O2t:N2t:(s=e.match(L2t))&&(a=M2t);let n=mbe.AST.fromGlob(e,this.options).toMMPattern();return a&&typeof n==\"object\"&&Reflect.defineProperty(n,\"test\",{value:a}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,s=r.noglobstar?J2t:r.dot?K2t:z2t,a=new Set(r.nocase?[\"i\"]:[]),n=e.map(p=>{let h=p.map(E=>{if(E instanceof RegExp)for(let C of E.flags.split(\"\"))a.add(C);return typeof E==\"string\"?rBt(E):E===pr.GLOBSTAR?pr.GLOBSTAR:E._src});return h.forEach((E,C)=>{let S=h[C+1],b=h[C-1];E!==pr.GLOBSTAR||b===pr.GLOBSTAR||(b===void 0?S!==void 0&&S!==pr.GLOBSTAR?h[C+1]=\"(?:\\\\/|\"+s+\"\\\\/)?\"+S:h[C]=s:S===void 0?h[C-1]=b+\"(?:\\\\/|\"+s+\")?\":S!==pr.GLOBSTAR&&(h[C-1]=b+\"(?:\\\\/|\\\\/\"+s+\"\\\\/)\"+S,h[C+1]=pr.GLOBSTAR))}),h.filter(E=>E!==pr.GLOBSTAR).join(\"/\")}).join(\"|\"),[c,f]=e.length>1?[\"(?:\",\")\"]:[\"\",\"\"];n=\"^\"+c+n+f+\"$\",this.negate&&(n=\"^(?!\"+n+\").+$\");try{this.regexp=new RegExp(n,[...a].join(\"\"))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(\"/\"):this.isWindows&&/^\\/\\/[^\\/]+/.test(e)?[\"\",...e.split(/\\/+/)]:e.split(/\\/+/)}match(e,r=this.partial){if(this.debug(\"match\",e,this.pattern),this.comment)return!1;if(this.empty)return e===\"\";if(e===\"/\"&&r)return!0;let s=this.options;this.isWindows&&(e=e.split(\"\\\\\").join(\"/\"));let a=this.slashSplit(e);this.debug(this.pattern,\"split\",a);let n=this.set;this.debug(this.pattern,\"set\",n);let c=a[a.length-1];if(!c)for(let f=a.length-2;!c&&f>=0;f--)c=a[f];for(let f=0;f<n.length;f++){let p=n[f],h=a;if(s.matchBase&&p.length===1&&(h=[c]),this.matchOne(h,p,r))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(e){return pr.minimatch.defaults(e).Minimatch}};pr.Minimatch=ly;var nBt=eJ();Object.defineProperty(pr,\"AST\",{enumerable:!0,get:function(){return nBt.AST}});var iBt=tJ();Object.defineProperty(pr,\"escape\",{enumerable:!0,get:function(){return iBt.escape}});var sBt=MO();Object.defineProperty(pr,\"unescape\",{enumerable:!0,get:function(){return sBt.unescape}});pr.minimatch.AST=mbe.AST;pr.minimatch.Minimatch=ly;pr.minimatch.escape=D2t.escape;pr.minimatch.unescape=P2t.unescape});var iJ=_(ru=>{\"use strict\";var wbe=ru&&ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ru,\"__esModule\",{value:!0});ru.SuccinctRoles=ru.DelegatedRole=ru.Role=ru.TOP_LEVEL_ROLE_NAMES=void 0;var Bbe=wbe(Ie(\"crypto\")),oBt=Cbe(),qO=wbe(Ie(\"util\")),WO=bA(),cy=ff();ru.TOP_LEVEL_ROLE_NAMES=[\"root\",\"targets\",\"snapshot\",\"timestamp\"];var LP=class t{constructor(e){let{keyIDs:r,threshold:s,unrecognizedFields:a}=e;if(aBt(r))throw new WO.ValueError(\"duplicate key IDs found\");if(s<1)throw new WO.ValueError(\"threshold must be at least 1\");this.keyIDs=r,this.threshold=s,this.unrecognizedFields=a||{}}equals(e){return e instanceof t?this.threshold===e.threshold&&qO.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&qO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:r,threshold:s,...a}=e;if(!cy.guard.isStringArray(r))throw new TypeError(\"keyids must be an array\");if(typeof s!=\"number\")throw new TypeError(\"threshold must be a number\");return new t({keyIDs:r,threshold:s,unrecognizedFields:a})}};ru.Role=LP;function aBt(t){return new Set(t).size!==t.length}var rJ=class t extends LP{constructor(e){super(e);let{name:r,terminating:s,paths:a,pathHashPrefixes:n}=e;if(this.name=r,this.terminating=s,e.paths&&e.pathHashPrefixes)throw new WO.ValueError(\"paths and pathHashPrefixes are mutually exclusive\");this.paths=a,this.pathHashPrefixes=n}equals(e){return e instanceof t?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&qO.default.isDeepStrictEqual(this.paths,e.paths)&&qO.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(r=>cBt(e,r));if(this.pathHashPrefixes){let s=Bbe.default.createHash(\"sha256\").update(e).digest(\"hex\");return this.pathHashPrefixes.some(a=>s.startsWith(a))}return!1}toJSON(){let e={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(e.paths=this.paths),this.pathHashPrefixes&&(e.path_hash_prefixes=this.pathHashPrefixes),e}static fromJSON(e){let{keyids:r,threshold:s,name:a,terminating:n,paths:c,path_hash_prefixes:f,...p}=e;if(!cy.guard.isStringArray(r))throw new TypeError(\"keyids must be an array of strings\");if(typeof s!=\"number\")throw new TypeError(\"threshold must be a number\");if(typeof a!=\"string\")throw new TypeError(\"name must be a string\");if(typeof n!=\"boolean\")throw new TypeError(\"terminating must be a boolean\");if(cy.guard.isDefined(c)&&!cy.guard.isStringArray(c))throw new TypeError(\"paths must be an array of strings\");if(cy.guard.isDefined(f)&&!cy.guard.isStringArray(f))throw new TypeError(\"path_hash_prefixes must be an array of strings\");return new t({keyIDs:r,threshold:s,name:a,terminating:n,paths:c,pathHashPrefixes:f,unrecognizedFields:p})}};ru.DelegatedRole=rJ;var lBt=(t,e)=>t.map((r,s)=>[r,e[s]]);function cBt(t,e){let r=t.split(\"/\"),s=e.split(\"/\");return s.length!=r.length?!1:lBt(r,s).every(([a,n])=>(0,oBt.minimatch)(a,n))}var nJ=class t extends LP{constructor(e){super(e);let{bitLength:r,namePrefix:s}=e;if(r<=0||r>32)throw new WO.ValueError(\"bitLength must be between 1 and 32\");this.bitLength=r,this.namePrefix=s,this.numberOfBins=Math.pow(2,r),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof t?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let a=Bbe.default.createHash(\"sha256\").update(e).digest().subarray(0,4),n=32-this.bitLength,f=(a.readUInt32BE()>>>n).toString(16).padStart(this.suffixLen,\"0\");return`${this.namePrefix}-${f}`}*getRoles(){for(let e=0;e<this.numberOfBins;e++){let r=e.toString(16).padStart(this.suffixLen,\"0\");yield`${this.namePrefix}-${r}`}}isDelegatedRole(e){let r=this.namePrefix+\"-\";if(!e.startsWith(r))return!1;let s=e.slice(r.length,e.length);if(s.length!=this.suffixLen||!s.match(/^[0-9a-fA-F]+$/))return!1;let a=parseInt(s,16);return 0<=a&&a<this.numberOfBins}toJSON(){return{...super.toJSON(),bit_length:this.bitLength,name_prefix:this.namePrefix}}static fromJSON(e){let{keyids:r,threshold:s,bit_length:a,name_prefix:n,...c}=e;if(!cy.guard.isStringArray(r))throw new TypeError(\"keyids must be an array of strings\");if(typeof s!=\"number\")throw new TypeError(\"threshold must be a number\");if(typeof a!=\"number\")throw new TypeError(\"bit_length must be a number\");if(typeof n!=\"string\")throw new TypeError(\"name_prefix must be a string\");return new t({keyIDs:r,threshold:s,bitLength:a,namePrefix:n,unrecognizedFields:c})}};ru.SuccinctRoles=nJ});var aJ=_(a1=>{\"use strict\";var uBt=a1&&a1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(a1,\"__esModule\",{value:!0});a1.Root=void 0;var vbe=uBt(Ie(\"util\")),sJ=ay(),Sbe=bA(),fBt=FO(),YO=iJ(),VO=ff(),oJ=class t extends sJ.Signed{constructor(e){if(super(e),this.type=sJ.MetadataKind.Root,this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=YO.TOP_LEVEL_ROLE_NAMES.reduce((r,s)=>({...r,[s]:new YO.Role({keyIDs:[],threshold:1})}),{});else{let r=new Set(Object.keys(e.roles));if(!YO.TOP_LEVEL_ROLE_NAMES.every(s=>r.has(s)))throw new Sbe.ValueError(\"missing top-level role\");this.roles=e.roles}}addKey(e,r){if(!this.roles[r])throw new Sbe.ValueError(`role ${r} does not exist`);this.roles[r].keyIDs.includes(e.keyID)||this.roles[r].keyIDs.push(e.keyID),this.keys[e.keyID]=e}equals(e){return e instanceof t?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&vbe.default.isDeepStrictEqual(this.keys,e.keys)&&vbe.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:ABt(this.keys),roles:pBt(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:r,...s}=sJ.Signed.commonFieldsFromJSON(e),{keys:a,roles:n,consistent_snapshot:c,...f}=r;if(typeof c!=\"boolean\")throw new TypeError(\"consistent_snapshot must be a boolean\");return new t({...s,keys:hBt(a),roles:gBt(n),consistentSnapshot:c,unrecognizedFields:f})}};a1.Root=oJ;function ABt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function pBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function hBt(t){let e;if(VO.guard.isDefined(t)){if(!VO.guard.isObjectRecord(t))throw new TypeError(\"keys must be an object\");e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:fBt.Key.fromJSON(s,a)}),{})}return e}function gBt(t){let e;if(VO.guard.isDefined(t)){if(!VO.guard.isObjectRecord(t))throw new TypeError(\"roles must be an object\");e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:YO.Role.fromJSON(a)}),{})}return e}});var cJ=_(JO=>{\"use strict\";Object.defineProperty(JO,\"__esModule\",{value:!0});JO.Signature=void 0;var lJ=class t{constructor(e){let{keyID:r,sig:s}=e;this.keyID=r,this.sig=s}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:r,sig:s}=e;if(typeof r!=\"string\")throw new TypeError(\"keyid must be a string\");if(typeof s!=\"string\")throw new TypeError(\"sig must be a string\");return new t({keyID:r,sig:s})}};JO.Signature=lJ});var AJ=_(l1=>{\"use strict\";var dBt=l1&&l1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(l1,\"__esModule\",{value:!0});l1.Snapshot=void 0;var mBt=dBt(Ie(\"util\")),uJ=ay(),Pbe=QP(),Dbe=ff(),fJ=class t extends uJ.Signed{constructor(e){super(e),this.type=uJ.MetadataKind.Snapshot,this.meta=e.meta||{\"targets.json\":new Pbe.MetaFile({version:1})}}equals(e){return e instanceof t?super.equals(e)&&mBt.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:yBt(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:r,...s}=uJ.Signed.commonFieldsFromJSON(e),{meta:a,...n}=r;return new t({...s,meta:EBt(a),unrecognizedFields:n})}};l1.Snapshot=fJ;function yBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function EBt(t){let e;if(Dbe.guard.isDefined(t))if(Dbe.guard.isObjectRecord(t))e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:Pbe.MetaFile.fromJSON(a)}),{});else throw new TypeError(\"meta field is malformed\");return e}});var bbe=_(c1=>{\"use strict\";var IBt=c1&&c1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(c1,\"__esModule\",{value:!0});c1.Delegations=void 0;var KO=IBt(Ie(\"util\")),CBt=bA(),wBt=FO(),pJ=iJ(),zO=ff(),hJ=class t{constructor(e){if(this.keys=e.keys,this.unrecognizedFields=e.unrecognizedFields||{},e.roles&&Object.keys(e.roles).some(r=>pJ.TOP_LEVEL_ROLE_NAMES.includes(r)))throw new CBt.ValueError(\"Delegated role name conflicts with top-level role name\");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof t?KO.default.isDeepStrictEqual(this.keys,e.keys)&&KO.default.isDeepStrictEqual(this.roles,e.roles)&&KO.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&KO.default.isDeepStrictEqual(this.succinctRoles,e.succinctRoles):!1}*rolesForTarget(e){if(this.roles)for(let r of Object.values(this.roles))r.isDelegatedPath(e)&&(yield{role:r.name,terminating:r.terminating});else this.succinctRoles&&(yield{role:this.succinctRoles.getRoleForTarget(e),terminating:!0})}toJSON(){let e={keys:BBt(this.keys),...this.unrecognizedFields};return this.roles?e.roles=vBt(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:r,roles:s,succinct_roles:a,...n}=e,c;return zO.guard.isObject(a)&&(c=pJ.SuccinctRoles.fromJSON(a)),new t({keys:SBt(r),roles:DBt(s),unrecognizedFields:n,succinctRoles:c})}};c1.Delegations=hJ;function BBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function vBt(t){return Object.values(t).map(e=>e.toJSON())}function SBt(t){if(!zO.guard.isObjectRecord(t))throw new TypeError(\"keys is malformed\");return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:wBt.Key.fromJSON(r,s)}),{})}function DBt(t){let e;if(zO.guard.isDefined(t)){if(!zO.guard.isObjectArray(t))throw new TypeError(\"roles is malformed\");e=t.reduce((r,s)=>{let a=pJ.DelegatedRole.fromJSON(s);return{...r,[a.name]:a}},{})}return e}});var mJ=_(u1=>{\"use strict\";var PBt=u1&&u1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(u1,\"__esModule\",{value:!0});u1.Targets=void 0;var xbe=PBt(Ie(\"util\")),gJ=ay(),bBt=bbe(),xBt=QP(),ZO=ff(),dJ=class t extends gJ.Signed{constructor(e){super(e),this.type=gJ.MetadataKind.Targets,this.targets=e.targets||{},this.delegations=e.delegations}addTarget(e){this.targets[e.path]=e}equals(e){return e instanceof t?super.equals(e)&&xbe.default.isDeepStrictEqual(this.targets,e.targets)&&xbe.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:kBt(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:r,...s}=gJ.Signed.commonFieldsFromJSON(e),{targets:a,delegations:n,...c}=r;return new t({...s,targets:QBt(a),delegations:RBt(n),unrecognizedFields:c})}};u1.Targets=dJ;function kBt(t){return Object.entries(t).reduce((e,[r,s])=>({...e,[r]:s.toJSON()}),{})}function QBt(t){let e;if(ZO.guard.isDefined(t))if(ZO.guard.isObjectRecord(t))e=Object.entries(t).reduce((r,[s,a])=>({...r,[s]:xBt.TargetFile.fromJSON(s,a)}),{});else throw new TypeError(\"targets must be an object\");return e}function RBt(t){let e;if(ZO.guard.isDefined(t))if(ZO.guard.isObject(t))e=bBt.Delegations.fromJSON(t);else throw new TypeError(\"delegations must be an object\");return e}});var CJ=_(XO=>{\"use strict\";Object.defineProperty(XO,\"__esModule\",{value:!0});XO.Timestamp=void 0;var yJ=ay(),kbe=QP(),EJ=ff(),IJ=class t extends yJ.Signed{constructor(e){super(e),this.type=yJ.MetadataKind.Timestamp,this.snapshotMeta=e.snapshotMeta||new kbe.MetaFile({version:1})}equals(e){return e instanceof t?super.equals(e)&&this.snapshotMeta.equals(e.snapshotMeta):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,meta:{\"snapshot.json\":this.snapshotMeta.toJSON()},...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:r,...s}=yJ.Signed.commonFieldsFromJSON(e),{meta:a,...n}=r;return new t({...s,snapshotMeta:TBt(a),unrecognizedFields:n})}};XO.Timestamp=IJ;function TBt(t){let e;if(EJ.guard.isDefined(t)){let r=t[\"snapshot.json\"];if(!EJ.guard.isDefined(r)||!EJ.guard.isObject(r))throw new TypeError(\"missing snapshot.json in meta\");e=kbe.MetaFile.fromJSON(r)}return e}});var Rbe=_(A1=>{\"use strict\";var FBt=A1&&A1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A1,\"__esModule\",{value:!0});A1.Metadata=void 0;var NBt=_7(),Qbe=FBt(Ie(\"util\")),f1=ay(),MP=bA(),OBt=aJ(),LBt=cJ(),MBt=AJ(),UBt=mJ(),_Bt=CJ(),wJ=ff(),BJ=class t{constructor(e,r,s){this.signed=e,this.signatures=r||{},this.unrecognizedFields=s||{}}sign(e,r=!0){let s=Buffer.from((0,NBt.canonicalize)(this.signed.toJSON())),a=e(s);r||(this.signatures={}),this.signatures[a.keyID]=a}verifyDelegate(e,r){let s,a={};switch(this.signed.type){case f1.MetadataKind.Root:a=this.signed.keys,s=this.signed.roles[e];break;case f1.MetadataKind.Targets:if(!this.signed.delegations)throw new MP.ValueError(`No delegations found for ${e}`);a=this.signed.delegations.keys,this.signed.delegations.roles?s=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(s=this.signed.delegations.succinctRoles);break;default:throw new TypeError(\"invalid metadata type\")}if(!s)throw new MP.ValueError(`no delegation found for ${e}`);let n=new Set;if(s.keyIDs.forEach(c=>{let f=a[c];if(f)try{f.verifySignature(r),n.add(f.keyID)}catch{}}),n.size<s.threshold)throw new MP.UnsignedMetadataError(`${e} was signed by ${n.size}/${s.threshold} keys`)}equals(e){return e instanceof t?this.signed.equals(e.signed)&&Qbe.default.isDeepStrictEqual(this.signatures,e.signatures)&&Qbe.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{signatures:Object.values(this.signatures).map(r=>r.toJSON()),signed:this.signed.toJSON(),...this.unrecognizedFields}}static fromJSON(e,r){let{signed:s,signatures:a,...n}=r;if(!wJ.guard.isDefined(s)||!wJ.guard.isObject(s))throw new TypeError(\"signed is not defined\");if(e!==s._type)throw new MP.ValueError(`expected '${e}', got ${s._type}`);if(!wJ.guard.isObjectArray(a))throw new TypeError(\"signatures is not an array\");let c;switch(e){case f1.MetadataKind.Root:c=OBt.Root.fromJSON(s);break;case f1.MetadataKind.Timestamp:c=_Bt.Timestamp.fromJSON(s);break;case f1.MetadataKind.Snapshot:c=MBt.Snapshot.fromJSON(s);break;case f1.MetadataKind.Targets:c=UBt.Targets.fromJSON(s);break;default:throw new TypeError(\"invalid metadata type\")}let f={};return a.forEach(p=>{let h=LBt.Signature.fromJSON(p);if(f[h.keyID])throw new MP.ValueError(`multiple signatures found for keyid: ${h.keyID}`);f[h.keyID]=h}),new t(c,f,n)}};A1.Metadata=BJ});var $O=_(Fi=>{\"use strict\";Object.defineProperty(Fi,\"__esModule\",{value:!0});Fi.Timestamp=Fi.Targets=Fi.Snapshot=Fi.Signature=Fi.Root=Fi.Metadata=Fi.Key=Fi.TargetFile=Fi.MetaFile=Fi.ValueError=Fi.MetadataKind=void 0;var HBt=ay();Object.defineProperty(Fi,\"MetadataKind\",{enumerable:!0,get:function(){return HBt.MetadataKind}});var jBt=bA();Object.defineProperty(Fi,\"ValueError\",{enumerable:!0,get:function(){return jBt.ValueError}});var Tbe=QP();Object.defineProperty(Fi,\"MetaFile\",{enumerable:!0,get:function(){return Tbe.MetaFile}});Object.defineProperty(Fi,\"TargetFile\",{enumerable:!0,get:function(){return Tbe.TargetFile}});var GBt=FO();Object.defineProperty(Fi,\"Key\",{enumerable:!0,get:function(){return GBt.Key}});var qBt=Rbe();Object.defineProperty(Fi,\"Metadata\",{enumerable:!0,get:function(){return qBt.Metadata}});var WBt=aJ();Object.defineProperty(Fi,\"Root\",{enumerable:!0,get:function(){return WBt.Root}});var YBt=cJ();Object.defineProperty(Fi,\"Signature\",{enumerable:!0,get:function(){return YBt.Signature}});var VBt=AJ();Object.defineProperty(Fi,\"Snapshot\",{enumerable:!0,get:function(){return VBt.Snapshot}});var JBt=mJ();Object.defineProperty(Fi,\"Targets\",{enumerable:!0,get:function(){return JBt.Targets}});var KBt=CJ();Object.defineProperty(Fi,\"Timestamp\",{enumerable:!0,get:function(){return KBt.Timestamp}})});var Nbe=_((air,Fbe)=>{var p1=1e3,h1=p1*60,g1=h1*60,uy=g1*24,zBt=uy*7,ZBt=uy*365.25;Fbe.exports=function(t,e){e=e||{};var r=typeof t;if(r===\"string\"&&t.length>0)return XBt(t);if(r===\"number\"&&isFinite(t))return e.long?evt(t):$Bt(t);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(t))};function XBt(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),s=(e[2]||\"ms\").toLowerCase();switch(s){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return r*ZBt;case\"weeks\":case\"week\":case\"w\":return r*zBt;case\"days\":case\"day\":case\"d\":return r*uy;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return r*g1;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return r*h1;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return r*p1;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return r;default:return}}}}function $Bt(t){var e=Math.abs(t);return e>=uy?Math.round(t/uy)+\"d\":e>=g1?Math.round(t/g1)+\"h\":e>=h1?Math.round(t/h1)+\"m\":e>=p1?Math.round(t/p1)+\"s\":t+\"ms\"}function evt(t){var e=Math.abs(t);return e>=uy?eL(t,e,uy,\"day\"):e>=g1?eL(t,e,g1,\"hour\"):e>=h1?eL(t,e,h1,\"minute\"):e>=p1?eL(t,e,p1,\"second\"):t+\" ms\"}function eL(t,e,r,s){var a=e>=r*1.5;return Math.round(t/r)+\" \"+s+(a?\"s\":\"\")}});var vJ=_((lir,Obe)=>{function tvt(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=a,r.enabled=f,r.humanize=Nbe(),r.destroy=h,Object.keys(t).forEach(E=>{r[E]=t[E]}),r.names=[],r.skips=[],r.formatters={};function e(E){let C=0;for(let S=0;S<E.length;S++)C=(C<<5)-C+E.charCodeAt(S),C|=0;return r.colors[Math.abs(C)%r.colors.length]}r.selectColor=e;function r(E){let C,S=null,b,I;function T(...N){if(!T.enabled)return;let U=T,W=Number(new Date),ee=W-(C||W);U.diff=ee,U.prev=C,U.curr=W,C=W,N[0]=r.coerce(N[0]),typeof N[0]!=\"string\"&&N.unshift(\"%O\");let ie=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(le,me)=>{if(le===\"%%\")return\"%\";ie++;let pe=r.formatters[me];if(typeof pe==\"function\"){let Be=N[ie];le=pe.call(U,Be),N.splice(ie,1),ie--}return le}),r.formatArgs.call(U,N),(U.log||r.log).apply(U,N)}return T.namespace=E,T.useColors=r.useColors(),T.color=r.selectColor(E),T.extend=s,T.destroy=r.destroy,Object.defineProperty(T,\"enabled\",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(b!==r.namespaces&&(b=r.namespaces,I=r.enabled(E)),I),set:N=>{S=N}}),typeof r.init==\"function\"&&r.init(T),T}function s(E,C){let S=r(this.namespace+(typeof C>\"u\"?\":\":C)+E);return S.log=this.log,S}function a(E){r.save(E),r.namespaces=E,r.names=[],r.skips=[];let C=(typeof E==\"string\"?E:\"\").trim().replace(\" \",\",\").split(\",\").filter(Boolean);for(let S of C)S[0]===\"-\"?r.skips.push(S.slice(1)):r.names.push(S)}function n(E,C){let S=0,b=0,I=-1,T=0;for(;S<E.length;)if(b<C.length&&(C[b]===E[S]||C[b]===\"*\"))C[b]===\"*\"?(I=b,T=S,b++):(S++,b++);else if(I!==-1)b=I+1,T++,S=T;else return!1;for(;b<C.length&&C[b]===\"*\";)b++;return b===C.length}function c(){let E=[...r.names,...r.skips.map(C=>\"-\"+C)].join(\",\");return r.enable(\"\"),E}function f(E){for(let C of r.skips)if(n(E,C))return!1;for(let C of r.names)if(n(E,C))return!0;return!1}function p(E){return E instanceof Error?E.stack||E.message:E}function h(){console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\")}return r.enable(r.load()),r}Obe.exports=tvt});var Lbe=_((sc,tL)=>{sc.formatArgs=nvt;sc.save=ivt;sc.load=svt;sc.useColors=rvt;sc.storage=ovt();sc.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})();sc.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"];function rvt(){if(typeof window<\"u\"&&window.process&&(window.process.type===\"renderer\"||window.process.__nwjs))return!0;if(typeof navigator<\"u\"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))return!1;let t;return typeof document<\"u\"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<\"u\"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<\"u\"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<\"u\"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/)}function nvt(t){if(t[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+t[0]+(this.useColors?\"%c \":\" \")+\"+\"+tL.exports.humanize(this.diff),!this.useColors)return;let e=\"color: \"+this.color;t.splice(1,0,e,\"color: inherit\");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,a=>{a!==\"%%\"&&(r++,a===\"%c\"&&(s=r))}),t.splice(s,0,e)}sc.log=console.debug||console.log||(()=>{});function ivt(t){try{t?sc.storage.setItem(\"debug\",t):sc.storage.removeItem(\"debug\")}catch{}}function svt(){let t;try{t=sc.storage.getItem(\"debug\")}catch{}return!t&&typeof process<\"u\"&&\"env\"in process&&(t=process.env.DEBUG),t}function ovt(){try{return localStorage}catch{}}tL.exports=vJ()(sc);var{formatters:avt}=tL.exports;avt.j=function(t){try{return JSON.stringify(t)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}});var Ube=_((Xs,nL)=>{var lvt=Ie(\"tty\"),rL=Ie(\"util\");Xs.init=gvt;Xs.log=Avt;Xs.formatArgs=uvt;Xs.save=pvt;Xs.load=hvt;Xs.useColors=cvt;Xs.destroy=rL.deprecate(()=>{},\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\");Xs.colors=[6,2,3,4,5,1];try{let t=Ie(\"supports-color\");t&&(t.stderr||t).level>=2&&(Xs.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Xs.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(a,n)=>n.toUpperCase()),s=process.env[e];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s===\"null\"?s=null:s=Number(s),t[r]=s,t},{});function cvt(){return\"colors\"in Xs.inspectOpts?!!Xs.inspectOpts.colors:lvt.isatty(process.stderr.fd)}function uvt(t){let{namespace:e,useColors:r}=this;if(r){let s=this.color,a=\"\\x1B[3\"+(s<8?s:\"8;5;\"+s),n=`  ${a};1m${e} \\x1B[0m`;t[0]=n+t[0].split(`\n`).join(`\n`+n),t.push(a+\"m+\"+nL.exports.humanize(this.diff)+\"\\x1B[0m\")}else t[0]=fvt()+e+\" \"+t[0]}function fvt(){return Xs.inspectOpts.hideDate?\"\":new Date().toISOString()+\" \"}function Avt(...t){return process.stderr.write(rL.formatWithOptions(Xs.inspectOpts,...t)+`\n`)}function pvt(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function hvt(){return process.env.DEBUG}function gvt(t){t.inspectOpts={};let e=Object.keys(Xs.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Xs.inspectOpts[e[r]]}nL.exports=vJ()(Xs);var{formatters:Mbe}=nL.exports;Mbe.o=function(t){return this.inspectOpts.colors=this.useColors,rL.inspect(t,this.inspectOpts).split(`\n`).map(e=>e.trim()).join(\" \")};Mbe.O=function(t){return this.inspectOpts.colors=this.useColors,rL.inspect(t,this.inspectOpts)}});var DJ=_((cir,SJ)=>{typeof process>\"u\"||process.type===\"renderer\"||process.browser===!0||process.__nwjs?SJ.exports=Lbe():SJ.exports=Ube()});var sL=_(Ji=>{\"use strict\";Object.defineProperty(Ji,\"__esModule\",{value:!0});Ji.DownloadHTTPError=Ji.DownloadLengthMismatchError=Ji.DownloadError=Ji.ExpiredMetadataError=Ji.EqualVersionError=Ji.BadVersionError=Ji.RepositoryError=Ji.PersistError=Ji.RuntimeError=Ji.ValueError=void 0;var PJ=class extends Error{};Ji.ValueError=PJ;var bJ=class extends Error{};Ji.RuntimeError=bJ;var xJ=class extends Error{};Ji.PersistError=xJ;var UP=class extends Error{};Ji.RepositoryError=UP;var iL=class extends UP{};Ji.BadVersionError=iL;var kJ=class extends iL{};Ji.EqualVersionError=kJ;var QJ=class extends UP{};Ji.ExpiredMetadataError=QJ;var _P=class extends Error{};Ji.DownloadError=_P;var RJ=class extends _P{};Ji.DownloadLengthMismatchError=RJ;var TJ=class extends _P{constructor(e,r){super(e),this.statusCode=r}};Ji.DownloadHTTPError=TJ});var Hbe=_(d1=>{\"use strict\";var NJ=d1&&d1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d1,\"__esModule\",{value:!0});d1.withTempFile=void 0;var FJ=NJ(Ie(\"fs/promises\")),dvt=NJ(Ie(\"os\")),_be=NJ(Ie(\"path\")),mvt=async t=>yvt(async e=>t(_be.default.join(e,\"tempfile\")));d1.withTempFile=mvt;var yvt=async t=>{let e=await FJ.default.realpath(dvt.default.tmpdir()),r=await FJ.default.mkdtemp(e+_be.default.sep);try{return await t(r)}finally{await FJ.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}}});var LJ=_(kg=>{\"use strict\";var aL=kg&&kg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kg,\"__esModule\",{value:!0});kg.DefaultFetcher=kg.BaseFetcher=void 0;var Evt=aL(DJ()),jbe=aL(Ie(\"fs\")),Ivt=aL(IO()),Cvt=aL(Ie(\"util\")),Gbe=sL(),wvt=Hbe(),Bvt=(0,Evt.default)(\"tuf:fetch\"),oL=class{async downloadFile(e,r,s){return(0,wvt.withTempFile)(async a=>{let n=await this.fetch(e),c=0,f=jbe.default.createWriteStream(a);try{for await(let p of n){let h=Buffer.from(p);if(c+=h.length,c>r)throw new Gbe.DownloadLengthMismatchError(\"Max length reached\");await vvt(f,h)}}finally{await Cvt.default.promisify(f.close).bind(f)()}return s(a)})}async downloadBytes(e,r){return this.downloadFile(e,r,async s=>{let a=jbe.default.createReadStream(s),n=[];for await(let c of a)n.push(c);return Buffer.concat(n)})}};kg.BaseFetcher=oL;var OJ=class extends oL{constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){Bvt(\"GET %s\",e);let r=await(0,Ivt.default)(e,{timeout:this.timeout,retry:this.retry});if(!r.ok||!r?.body)throw new Gbe.DownloadHTTPError(\"Failed to download\",r.status);return r.body}};kg.DefaultFetcher=OJ;var vvt=async(t,e)=>new Promise((r,s)=>{t.write(e,a=>{a&&s(a),r(!0)})})});var qbe=_(lL=>{\"use strict\";Object.defineProperty(lL,\"__esModule\",{value:!0});lL.defaultConfig=void 0;lL.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var Wbe=_(cL=>{\"use strict\";Object.defineProperty(cL,\"__esModule\",{value:!0});cL.TrustedMetadataStore=void 0;var Es=$O(),_i=sL(),MJ=class{constructor(e){this.trustedSet={},this.referenceTime=new Date,this.loadTrustedRoot(e)}get root(){if(!this.trustedSet.root)throw new ReferenceError(\"No trusted root metadata\");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(e){return this.trustedSet[e]}updateRoot(e){let r=JSON.parse(e.toString(\"utf8\")),s=Es.Metadata.fromJSON(Es.MetadataKind.Root,r);if(s.signed.type!=Es.MetadataKind.Root)throw new _i.RepositoryError(`Expected 'root', got ${s.signed.type}`);if(this.root.verifyDelegate(Es.MetadataKind.Root,s),s.signed.version!=this.root.signed.version+1)throw new _i.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${s.signed.version}`);return s.verifyDelegate(Es.MetadataKind.Root,s),this.trustedSet.root=s,s}updateTimestamp(e){if(this.snapshot)throw new _i.RuntimeError(\"Cannot update timestamp after snapshot\");if(this.root.signed.isExpired(this.referenceTime))throw new _i.ExpiredMetadataError(\"Final root.json is expired\");let r=JSON.parse(e.toString(\"utf8\")),s=Es.Metadata.fromJSON(Es.MetadataKind.Timestamp,r);if(s.signed.type!=Es.MetadataKind.Timestamp)throw new _i.RepositoryError(`Expected 'timestamp', got ${s.signed.type}`);if(this.root.verifyDelegate(Es.MetadataKind.Timestamp,s),this.timestamp){if(s.signed.version<this.timestamp.signed.version)throw new _i.BadVersionError(`New timestamp version ${s.signed.version} is less than current version ${this.timestamp.signed.version}`);if(s.signed.version===this.timestamp.signed.version)throw new _i.EqualVersionError(`New timestamp version ${s.signed.version} is equal to current version ${this.timestamp.signed.version}`);let a=this.timestamp.signed.snapshotMeta,n=s.signed.snapshotMeta;if(n.version<a.version)throw new _i.BadVersionError(`New snapshot version ${n.version} is less than current version ${a.version}`)}return this.trustedSet.timestamp=s,this.checkFinalTimestamp(),s}updateSnapshot(e,r=!1){if(!this.timestamp)throw new _i.RuntimeError(\"Cannot update snapshot before timestamp\");if(this.targets)throw new _i.RuntimeError(\"Cannot update snapshot after targets\");this.checkFinalTimestamp();let s=this.timestamp.signed.snapshotMeta;r||s.verify(e);let a=JSON.parse(e.toString(\"utf8\")),n=Es.Metadata.fromJSON(Es.MetadataKind.Snapshot,a);if(n.signed.type!=Es.MetadataKind.Snapshot)throw new _i.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(Es.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([c,f])=>{let p=n.signed.meta[c];if(!p)throw new _i.RepositoryError(`Missing file ${c} in new snapshot`);if(p.version<f.version)throw new _i.BadVersionError(`New version ${p.version} of ${c} is less than current version ${f.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,r,s){if(!this.snapshot)throw new _i.RuntimeError(\"Cannot update delegated targets before snapshot\");this.checkFinalSnapsnot();let a=this.trustedSet[s];if(!a)throw new _i.RuntimeError(`No trusted ${s} metadata`);let n=this.snapshot.signed.meta?.[`${r}.json`];if(!n)throw new _i.RepositoryError(`Missing ${r}.json in snapshot`);n.verify(e);let c=JSON.parse(e.toString(\"utf8\")),f=Es.Metadata.fromJSON(Es.MetadataKind.Targets,c);if(f.signed.type!=Es.MetadataKind.Targets)throw new _i.RepositoryError(`Expected 'targets', got ${f.signed.type}`);a.verifyDelegate(r,f);let p=f.signed.version;if(p!=n.version)throw new _i.BadVersionError(`Version ${p} of ${r} does not match snapshot version ${n.version}`);if(f.signed.isExpired(this.referenceTime))throw new _i.ExpiredMetadataError(`${r}.json is expired`);this.trustedSet[r]=f}loadTrustedRoot(e){let r=JSON.parse(e.toString(\"utf8\")),s=Es.Metadata.fromJSON(Es.MetadataKind.Root,r);if(s.signed.type!=Es.MetadataKind.Root)throw new _i.RepositoryError(`Expected 'root', got ${s.signed.type}`);s.verifyDelegate(Es.MetadataKind.Root,s),this.trustedSet.root=s}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError(\"No trusted timestamp metadata\");if(this.timestamp.signed.isExpired(this.referenceTime))throw new _i.ExpiredMetadataError(\"Final timestamp.json is expired\")}checkFinalSnapsnot(){if(!this.snapshot)throw new ReferenceError(\"No trusted snapshot metadata\");if(!this.timestamp)throw new ReferenceError(\"No trusted timestamp metadata\");if(this.snapshot.signed.isExpired(this.referenceTime))throw new _i.ExpiredMetadataError(\"snapshot.json is expired\");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new _i.BadVersionError(\"Snapshot version doesn't match timestamp\")}};cL.TrustedMetadataStore=MJ});var Ybe=_(UJ=>{\"use strict\";Object.defineProperty(UJ,\"__esModule\",{value:!0});UJ.join=Dvt;var Svt=Ie(\"url\");function Dvt(t,e){return new Svt.URL(Pvt(t)+bvt(e)).toString()}function Pvt(t){return t.endsWith(\"/\")?t:t+\"/\"}function bvt(t){return t.startsWith(\"/\")?t.slice(1):t}});var Vbe=_(nu=>{\"use strict\";var xvt=nu&&nu.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),kvt=nu&&nu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jJ=nu&&nu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!==\"default\"&&Object.prototype.hasOwnProperty.call(t,r)&&xvt(e,t,r);return kvt(e,t),e},Qvt=nu&&nu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nu,\"__esModule\",{value:!0});nu.Updater=void 0;var xA=$O(),Rvt=Qvt(DJ()),m1=jJ(Ie(\"fs\")),uL=jJ(Ie(\"path\")),Tvt=qbe(),fy=sL(),Fvt=LJ(),Nvt=Wbe(),HP=jJ(Ybe()),_J=(0,Rvt.default)(\"tuf:cache\"),HJ=class{constructor(e){let{metadataDir:r,metadataBaseUrl:s,targetDir:a,targetBaseUrl:n,fetcher:c,config:f}=e;this.dir=r,this.metadataBaseUrl=s,this.targetDir=a,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let p=this.loadLocalMetadata(xA.MetadataKind.Root);this.trustedSet=new Nvt.TrustedMetadataStore(p),this.config={...Tvt.defaultConfig,...f},this.fetcher=c||new Fvt.DefaultFetcher({timeout:this.config.fetchTimeout,retry:this.config.fetchRetries??this.config.fetchRetry})}async refresh(){if(this.forceCache)try{await this.loadTimestamp({checkRemote:!1})}catch{await this.loadRoot(),await this.loadTimestamp()}else await this.loadRoot(),await this.loadTimestamp();await this.loadSnapshot(),await this.loadTargets(xA.MetadataKind.Targets,xA.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,r,s){let a=r||this.generateTargetPath(e);if(!s){if(!this.targetBaseUrl)throw new fy.ValueError(\"Target base URL not set\");s=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let p=Object.values(e.hashes),{dir:h,base:E}=uL.parse(n),C=`${p[0]}.${E}`;n=h?`${h}/${C}`:C}let f=HP.join(s,n);return await this.fetcher.downloadFile(f,e.length,async p=>{await e.verify(m1.createReadStream(p)),_J(\"WRITE %s\",a),m1.copyFileSync(p,a)}),a}async findCachedTarget(e,r){r||(r=this.generateTargetPath(e));try{if(m1.existsSync(r))return await e.verify(m1.createReadStream(r)),r}catch{return}}loadLocalMetadata(e){let r=uL.join(this.dir,`${e}.json`);return _J(\"READ %s\",r),m1.readFileSync(r)}async loadRoot(){let r=this.trustedSet.root.signed.version+1,s=r+this.config.maxRootRotations;for(let a=r;a<s;a++){let n=HP.join(this.metadataBaseUrl,`${a}.root.json`);try{let c=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(c),this.persistMetadata(xA.MetadataKind.Root,c)}catch(c){if(c instanceof fy.DownloadHTTPError&&[403,404].includes(c.statusCode))break;throw c}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let a=this.loadLocalMetadata(xA.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(a),!e)return}catch{}let r=HP.join(this.metadataBaseUrl,\"timestamp.json\"),s=await this.fetcher.downloadBytes(r,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(s)}catch(a){if(a instanceof fy.EqualVersionError)return;throw a}this.persistMetadata(xA.MetadataKind.Timestamp,s)}async loadSnapshot(){try{let e=this.loadLocalMetadata(xA.MetadataKind.Snapshot);this.trustedSet.updateSnapshot(e,!0)}catch{if(!this.trustedSet.timestamp)throw new ReferenceError(\"No timestamp metadata\");let r=this.trustedSet.timestamp.signed.snapshotMeta,s=r.length||this.config.snapshotMaxLength,a=this.trustedSet.root.signed.consistentSnapshot?r.version:void 0,n=HP.join(this.metadataBaseUrl,a?`${a}.snapshot.json`:\"snapshot.json\");try{let c=await this.fetcher.downloadBytes(n,s);this.trustedSet.updateSnapshot(c),this.persistMetadata(xA.MetadataKind.Snapshot,c)}catch(c){throw new fy.RuntimeError(`Unable to load snapshot metadata error ${c}`)}}}async loadTargets(e,r){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let s=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(s,e,r)}catch{if(!this.trustedSet.snapshot)throw new ReferenceError(\"No snapshot metadata\");let a=this.trustedSet.snapshot.signed.meta[`${e}.json`],n=a.length||this.config.targetsMaxLength,c=this.trustedSet.root.signed.consistentSnapshot?a.version:void 0,f=encodeURIComponent(e),p=HP.join(this.metadataBaseUrl,c?`${c}.${f}.json`:`${f}.json`);try{let h=await this.fetcher.downloadBytes(p,n);this.trustedSet.updateDelegatedTargets(h,e,r),this.persistMetadata(e,h)}catch(h){throw new fy.RuntimeError(`Unable to load targets error ${h}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let r=[{roleName:xA.MetadataKind.Targets,parentRoleName:xA.MetadataKind.Root}],s=new Set;for(;s.size<=this.config.maxDelegations&&r.length>0;){let{roleName:a,parentRoleName:n}=r.pop();if(s.has(a))continue;let c=(await this.loadTargets(a,n))?.signed;if(!c)continue;let f=c.targets?.[e];if(f)return f;if(s.add(a),c.delegations){let p=[],h=c.delegations.rolesForTarget(e);for(let{role:E,terminating:C}of h)if(p.push({roleName:E,parentRoleName:a}),C){r.splice(0);break}p.reverse(),r.push(...p)}}}generateTargetPath(e){if(!this.targetDir)throw new fy.ValueError(\"Target directory not set\");let r=encodeURIComponent(e.path);return uL.join(this.targetDir,r)}persistMetadata(e,r){let s=encodeURIComponent(e);try{let a=uL.join(this.dir,`${s}.json`);_J(\"WRITE %s\",a),m1.writeFileSync(a,r.toString(\"utf8\"))}catch(a){throw new fy.PersistError(`Failed to persist metadata ${s} error: ${a}`)}}};nu.Updater=HJ});var Jbe=_(Qg=>{\"use strict\";Object.defineProperty(Qg,\"__esModule\",{value:!0});Qg.Updater=Qg.BaseFetcher=Qg.TargetFile=void 0;var Ovt=$O();Object.defineProperty(Qg,\"TargetFile\",{enumerable:!0,get:function(){return Ovt.TargetFile}});var Lvt=LJ();Object.defineProperty(Qg,\"BaseFetcher\",{enumerable:!0,get:function(){return Lvt.BaseFetcher}});var Mvt=Vbe();Object.defineProperty(Qg,\"Updater\",{enumerable:!0,get:function(){return Mvt.Updater}})});var qJ=_(fL=>{\"use strict\";Object.defineProperty(fL,\"__esModule\",{value:!0});fL.TUFError=void 0;var GJ=class extends Error{constructor({code:e,message:r,cause:s}){super(r),this.code=e,this.cause=s,this.name=this.constructor.name}};fL.TUFError=GJ});var Kbe=_(jP=>{\"use strict\";var Uvt=jP&&jP.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jP,\"__esModule\",{value:!0});jP.readTarget=Hvt;var _vt=Uvt(Ie(\"fs\")),AL=qJ();async function Hvt(t,e){let r=await jvt(t,e);return new Promise((s,a)=>{_vt.default.readFile(r,\"utf-8\",(n,c)=>{n?a(new AL.TUFError({code:\"TUF_READ_TARGET_ERROR\",message:`error reading target ${r}`,cause:n})):s(c)})})}async function jvt(t,e){let r;try{r=await t.getTargetInfo(e)}catch(a){throw new AL.TUFError({code:\"TUF_REFRESH_METADATA_ERROR\",message:\"error refreshing TUF metadata\",cause:a})}if(!r)throw new AL.TUFError({code:\"TUF_FIND_TARGET_ERROR\",message:`target ${e} not found`});let s=await t.findCachedTarget(r);if(!s)try{s=await t.downloadTarget(r)}catch(a){throw new AL.TUFError({code:\"TUF_DOWNLOAD_TARGET_ERROR\",message:`error downloading target ${s}`,cause:a})}return s}});var zbe=_((Iir,Gvt)=>{Gvt.exports={\"https://tuf-repo-cdn.sigstore.dev\":{\"root.json\":\"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiMzA0NjAyMjEwMDhhYjFmNmYxN2Q0ZjllNmQ3ZGNmMWM4ODkxMmI2YjUzY2MxMDM4ODY0NGFlMWYwOWJjMzdhMDgyY2QwNjAwM2UwMjIxMDBlMTQ1ZWY0YzdiNzgyZDRlODEwN2I1MzQzN2U2NjlkMDQ3Njg5MmNlOTk5OTAzYWUzM2QxNDQ0ODM2Njk5NmU3IgogIH0sCiAgewogICAia2V5aWQiOiAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICJzaWciOiAiMzA0NTAyMjEwMGM3NjhiMmY4NmRhOTk1NjkwMTljMTYwYTA4MWRhNTRhZTM2YzM0YzBhMzEyMGQzY2I2OWI1M2I3ZDExMzc1OGUwMjIwNGY2NzE1MThmNjE3YjIwZDQ2NTM3ZmFlNmMzYjYzYmFlODkxM2Y0ZjE5NjIxNTYxMDVjYzRmMDE5YWMzNWM2YSIKICB9LAogIHsKICAgImtleWlkIjogIjIyZjRjYWVjNmQ4ZTZmOTU1NWF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TVBybnpweDZJWndxZW1mVUpONHhCRVpmemErcFl0L2l5b2QrOXRacjIwUlJXU3YvbzBVd1F6QU9CZ05WSFE4QkFmOEVCQU1DQVFZd0VnWURWUjBUQVFIL0JBZ3dCZ0VCL3dJQkFqQWRCZ05WSFE0RUZnUVU5TllZbG9ibkFHNGMwL3FqeHlIL2xxL3d6K1F3Q2dZSUtvWkl6ajBFQXdNRGFBQXdaUUl4QUxaTFo4QmdSWHpLeExNTU45VklsTytlNGhyQm5OQmdGN3R6N0hucm93djJOZXRaRXJJQUNLRnltQmx2V0R2dE1BSXdaTytraTZzc1ExYnNabzk4TzhtRUFmMk5aN2lpQ2dERFUwVndqZWNvNnp5ZWgwekJUczkvN2dWNkFITlE1M3hEIgogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfSwKICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIzLTA0LTE0VDAwOjAwOjAwLjAwMFoiCiAgICAgIH0KICAgIH0KICBdCn0K\",\"registry.npmjs.org%2Fkeys.json\":\"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K\"}}}});var Xbe=_(y1=>{\"use strict\";var Zbe=y1&&y1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(y1,\"__esModule\",{value:!0});y1.TUFClient=void 0;var Rg=Zbe(Ie(\"fs\")),GP=Zbe(Ie(\"path\")),qvt=Jbe(),Wvt=pL(),Yvt=Kbe(),YJ=\"targets\",WJ=class{constructor(e){let r=new URL(e.mirrorURL),s=encodeURIComponent(r.host+r.pathname.replace(/\\/$/,\"\")),a=GP.default.join(e.cachePath,s);Vvt(a),Jvt({cachePath:a,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=Kvt({mirrorURL:e.mirrorURL,cachePath:a,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,Yvt.readTarget)(this.updater,e)}};y1.TUFClient=WJ;function Vvt(t){let e=GP.default.join(t,YJ);Rg.default.existsSync(t)||Rg.default.mkdirSync(t,{recursive:!0}),Rg.default.existsSync(e)||Rg.default.mkdirSync(e)}function Jvt({cachePath:t,mirrorURL:e,tufRootPath:r,forceInit:s}){let a=GP.default.join(t,\"root.json\");if(!Rg.default.existsSync(a)||s)if(r)Rg.default.copyFileSync(r,a);else{let c=zbe()[e];if(!c)throw new Wvt.TUFError({code:\"TUF_INIT_CACHE_ERROR\",message:`No root.json found for mirror: ${e}`});Rg.default.writeFileSync(a,Buffer.from(c[\"root.json\"],\"base64\")),Object.entries(c.targets).forEach(([f,p])=>{Rg.default.writeFileSync(GP.default.join(t,YJ,f),Buffer.from(p,\"base64\"))})}}function Kvt(t){let e={fetchTimeout:t.timeout,fetchRetry:t.retry};return new qvt.Updater({metadataBaseUrl:t.mirrorURL,targetBaseUrl:`${t.mirrorURL}/targets`,metadataDir:t.cachePath,targetDir:GP.default.join(t.cachePath,YJ),forceCache:t.forceCache,config:e})}});var pL=_(gh=>{\"use strict\";Object.defineProperty(gh,\"__esModule\",{value:!0});gh.TUFError=gh.DEFAULT_MIRROR_URL=void 0;gh.getTrustedRoot=nSt;gh.initTUF=iSt;var zvt=mP(),Zvt=QPe(),Xvt=Xbe();gh.DEFAULT_MIRROR_URL=\"https://tuf-repo-cdn.sigstore.dev\";var $vt=\"sigstore-js\",eSt={retries:2},tSt=5e3,rSt=\"trusted_root.json\";async function nSt(t={}){let r=await $be(t).getTarget(rSt);return zvt.TrustedRoot.fromJSON(JSON.parse(r))}async function iSt(t={}){let e=$be(t);return e.refresh().then(()=>e)}function $be(t){return new Xvt.TUFClient({cachePath:t.cachePath||(0,Zvt.appDataPath)($vt),rootPath:t.rootPath,mirrorURL:t.mirrorURL||gh.DEFAULT_MIRROR_URL,retry:t.retry??eSt,timeout:t.timeout??tSt,forceCache:t.forceCache??!1,forceInit:t.forceInit??t.force??!1})}var sSt=qJ();Object.defineProperty(gh,\"TUFError\",{enumerable:!0,get:function(){return sSt.TUFError}})});var exe=_(hL=>{\"use strict\";Object.defineProperty(hL,\"__esModule\",{value:!0});hL.DSSESignatureContent=void 0;var qP=Cl(),VJ=class{constructor(e){this.env=e}compareDigest(e){return qP.crypto.bufferEqual(e,qP.crypto.digest(\"sha256\",this.env.payload))}compareSignature(e){return qP.crypto.bufferEqual(e,this.signature)}verifySignature(e){return qP.crypto.verify(this.preAuthEncoding,e,this.signature)}get signature(){return this.env.signatures.length>0?this.env.signatures[0].sig:Buffer.from(\"\")}get preAuthEncoding(){return qP.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};hL.DSSESignatureContent=VJ});var txe=_(gL=>{\"use strict\";Object.defineProperty(gL,\"__esModule\",{value:!0});gL.MessageSignatureContent=void 0;var JJ=Cl(),KJ=class{constructor(e,r){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=r}compareSignature(e){return JJ.crypto.bufferEqual(e,this.signature)}compareDigest(e){return JJ.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return JJ.crypto.verify(this.artifact,e,this.signature)}};gL.MessageSignatureContent=KJ});var nxe=_(dL=>{\"use strict\";Object.defineProperty(dL,\"__esModule\",{value:!0});dL.toSignedEntity=lSt;dL.signatureContent=rxe;var zJ=Cl(),oSt=exe(),aSt=txe();function lSt(t,e){let{tlogEntries:r,timestampVerificationData:s}=t.verificationMaterial,a=[];for(let n of r)a.push({$case:\"transparency-log\",tlogEntry:n});for(let n of s?.rfc3161Timestamps??[])a.push({$case:\"timestamp-authority\",timestamp:zJ.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:rxe(t,e),key:cSt(t),tlogEntries:r,timestamps:a}}function rxe(t,e){switch(t.content.$case){case\"dsseEnvelope\":return new oSt.DSSESignatureContent(t.content.dsseEnvelope);case\"messageSignature\":return new aSt.MessageSignatureContent(t.content.messageSignature,e)}}function cSt(t){switch(t.verificationMaterial.content.$case){case\"publicKey\":return{$case:\"public-key\",hint:t.verificationMaterial.content.publicKey.hint};case\"x509CertificateChain\":return{$case:\"certificate\",certificate:zJ.X509Certificate.parse(t.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case\"certificate\":return{$case:\"certificate\",certificate:zJ.X509Certificate.parse(t.verificationMaterial.content.certificate.rawBytes)}}}});var Eo=_(E1=>{\"use strict\";Object.defineProperty(E1,\"__esModule\",{value:!0});E1.PolicyError=E1.VerificationError=void 0;var mL=class extends Error{constructor({code:e,message:r,cause:s}){super(r),this.code=e,this.cause=s,this.name=this.constructor.name}},ZJ=class extends mL{};E1.VerificationError=ZJ;var XJ=class extends mL{};E1.PolicyError=XJ});var ixe=_(yL=>{\"use strict\";Object.defineProperty(yL,\"__esModule\",{value:!0});yL.filterCertAuthorities=uSt;yL.filterTLogAuthorities=fSt;function uSt(t,e){return t.filter(r=>r.validFor.start<=e.start&&r.validFor.end>=e.end)}function fSt(t,e){return t.filter(r=>e.logID&&!r.logID.equals(e.logID)?!1:r.validFor.start<=e.targetDate&&e.targetDate<=r.validFor.end)}});var py=_(Ay=>{\"use strict\";Object.defineProperty(Ay,\"__esModule\",{value:!0});Ay.filterTLogAuthorities=Ay.filterCertAuthorities=void 0;Ay.toTrustMaterial=pSt;var $J=Cl(),WP=mP(),ASt=Eo(),eK=new Date(0),tK=new Date(864e13),axe=ixe();Object.defineProperty(Ay,\"filterCertAuthorities\",{enumerable:!0,get:function(){return axe.filterCertAuthorities}});Object.defineProperty(Ay,\"filterTLogAuthorities\",{enumerable:!0,get:function(){return axe.filterTLogAuthorities}});function pSt(t,e){let r=typeof e==\"function\"?e:hSt(e);return{certificateAuthorities:t.certificateAuthorities.map(oxe),timestampAuthorities:t.timestampAuthorities.map(oxe),tlogs:t.tlogs.map(sxe),ctlogs:t.ctlogs.map(sxe),publicKey:r}}function sxe(t){let e=t.publicKey.keyDetails,r=e===WP.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===WP.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===WP.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===WP.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===WP.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?\"pkcs1\":\"spki\";return{logID:t.logId.keyId,publicKey:$J.crypto.createPublicKey(t.publicKey.rawBytes,r),validFor:{start:t.publicKey.validFor?.start||eK,end:t.publicKey.validFor?.end||tK}}}function oxe(t){return{certChain:t.certChain.certificates.map(e=>$J.X509Certificate.parse(e.rawBytes)),validFor:{start:t.validFor?.start||eK,end:t.validFor?.end||tK}}}function hSt(t){return e=>{let r=(t||{})[e];if(!r)throw new ASt.VerificationError({code:\"PUBLIC_KEY_ERROR\",message:`key not found: ${e}`});return{publicKey:$J.crypto.createPublicKey(r.rawBytes),validFor:s=>(r.validFor?.start||eK)<=s&&(r.validFor?.end||tK)>=s}}}});var rK=_(YP=>{\"use strict\";Object.defineProperty(YP,\"__esModule\",{value:!0});YP.CertificateChainVerifier=void 0;YP.verifyCertificateChain=dSt;var hy=Eo(),gSt=py();function dSt(t,e){let r=(0,gSt.filterCertAuthorities)(e,{start:t.notBefore,end:t.notAfter}),s;for(let a of r)try{return new EL({trustedCerts:a.certChain,untrustedCert:t}).verify()}catch(n){s=n}throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"Failed to verify certificate chain\",cause:s})}var EL=class{constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=mSt([...e.trustedCerts,e.untrustedCert])}verify(){let e=this.sort();return this.checkPath(e),e}sort(){let e=this.untrustedCert,r=this.buildPaths(e);if(r=r.filter(a=>a.some(n=>this.trustedCerts.includes(n))),r.length===0)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"no trusted certificate path found\"});let s=r.reduce((a,n)=>a.length<n.length?a:n);return[e,...s].slice(0,-1)}buildPaths(e){let r=[],s=this.findIssuer(e);if(s.length===0)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"no valid certificate path found\"});for(let a=0;a<s.length;a++){let n=s[a];if(n.equals(e)){r.push([e]);continue}let c=this.buildPaths(n);for(let f=0;f<c.length;f++)r.push([n,...c[f]])}return r}findIssuer(e){let r=[],s;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(s=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(a=>{if(s&&a.extSubjectKeyID){a.extSubjectKeyID.keyIdentifier.equals(s)&&r.push(a);return}a.subject.equals(e.issuer)&&r.push(a)}),r=r.filter(a=>{try{return e.verify(a)}catch{return!1}}),r)}checkPath(e){if(e.length<1)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"certificate chain must contain at least one certificate\"});if(!e.slice(1).every(s=>s.isCA))throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"intermediate certificate is not a CA\"});for(let s=e.length-2;s>=0;s--)if(!e[s].issuer.equals(e[s+1].subject))throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"incorrect certificate name chaining\"});for(let s=0;s<e.length;s++){let a=e[s];if(a.extBasicConstraints?.isCA){let n=a.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<s-1)throw new hy.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"path length constraint exceeded\"})}}}};YP.CertificateChainVerifier=EL;function mSt(t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++)t[e].equals(t[r])&&(t.splice(r,1),r--);return t}});var lxe=_(nK=>{\"use strict\";Object.defineProperty(nK,\"__esModule\",{value:!0});nK.verifySCTs=ISt;var IL=Cl(),ySt=Eo(),ESt=py();function ISt(t,e,r){let s,a=t.clone();for(let p=0;p<a.extensions.length;p++){let h=a.extensions[p];if(h.subs[0].toOID()===IL.EXTENSION_OID_SCT){s=new IL.X509SCTExtension(h),a.extensions.splice(p,1);break}}if(!s)return[];if(s.signedCertificateTimestamps.length===0)return[];let n=new IL.ByteStream,c=IL.crypto.digest(\"sha256\",e.publicKey);n.appendView(c);let f=a.tbsCertificate.toDER();return n.appendUint24(f.length),n.appendView(f),s.signedCertificateTimestamps.map(p=>{if(!(0,ESt.filterTLogAuthorities)(r,{logID:p.logID,targetDate:p.datetime}).some(C=>p.verify(n.buffer,C.publicKey)))throw new ySt.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"SCT verification failed\"});return p.logID})}});var uxe=_(CL=>{\"use strict\";Object.defineProperty(CL,\"__esModule\",{value:!0});CL.verifyPublicKey=DSt;CL.verifyCertificate=PSt;var CSt=Cl(),cxe=Eo(),wSt=rK(),BSt=lxe(),vSt=\"1.3.6.1.4.1.57264.1.1\",SSt=\"1.3.6.1.4.1.57264.1.8\";function DSt(t,e,r){let s=r.publicKey(t);return e.forEach(a=>{if(!s.validFor(a))throw new cxe.VerificationError({code:\"PUBLIC_KEY_ERROR\",message:`Public key is not valid for timestamp: ${a.toISOString()}`})}),{key:s.publicKey}}function PSt(t,e,r){let s=(0,wSt.verifyCertificateChain)(t,r.certificateAuthorities);if(!e.every(n=>s.every(c=>c.validForDate(n))))throw new cxe.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"certificate is not valid or expired at the specified date\"});return{scts:(0,BSt.verifySCTs)(s[0],s[1],r.ctlogs),signer:bSt(s[0])}}function bSt(t){let e,r=t.extension(SSt);r?e=r.valueObj.subs?.[0]?.value.toString(\"ascii\"):e=t.extension(vSt)?.value.toString(\"ascii\");let s={extensions:{issuer:e},subjectAlternativeName:t.subjectAltName};return{key:CSt.crypto.createPublicKey(t.publicKey),identity:s}}});var Axe=_(wL=>{\"use strict\";Object.defineProperty(wL,\"__esModule\",{value:!0});wL.verifySubjectAlternativeName=xSt;wL.verifyExtensions=kSt;var fxe=Eo();function xSt(t,e){if(e===void 0||!e.match(t))throw new fxe.PolicyError({code:\"UNTRUSTED_SIGNER_ERROR\",message:`certificate identity error - expected ${t}, got ${e}`})}function kSt(t,e={}){let r;for(r in t)if(e[r]!==t[r])throw new fxe.PolicyError({code:\"UNTRUSTED_SIGNER_ERROR\",message:`invalid certificate extension - expected ${r}=${t[r]}, got ${r}=${e[r]}`})}});var pxe=_(lK=>{\"use strict\";Object.defineProperty(lK,\"__esModule\",{value:!0});lK.verifyCheckpoint=TSt;var sK=Cl(),I1=Eo(),QSt=py(),iK=`\n\n`,RSt=/\\u2014 (\\S+) (\\S+)\\n/g;function TSt(t,e){let r=(0,QSt.filterTLogAuthorities)(e,{targetDate:new Date(Number(t.integratedTime)*1e3)}),s=t.inclusionProof,a=oK.fromString(s.checkpoint.envelope),n=aK.fromString(a.note);if(!FSt(a,r))throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"invalid checkpoint signature\"});if(!sK.crypto.bufferEqual(n.logHash,s.rootHash))throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"root hash mismatch\"})}function FSt(t,e){let r=Buffer.from(t.note,\"utf-8\");return t.signatures.every(s=>{let a=e.find(n=>sK.crypto.bufferEqual(n.logID.subarray(0,4),s.keyHint));return a?sK.crypto.verify(r,a.publicKey,s.signature):!1})}var oK=class t{constructor(e,r){this.note=e,this.signatures=r}static fromString(e){if(!e.includes(iK))throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"missing checkpoint separator\"});let r=e.indexOf(iK),s=e.slice(0,r+1),n=e.slice(r+iK.length).matchAll(RSt),c=Array.from(n,f=>{let[,p,h]=f,E=Buffer.from(h,\"base64\");if(E.length<5)throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"malformed checkpoint signature\"});return{name:p,keyHint:E.subarray(0,4),signature:E.subarray(4)}});if(c.length===0)throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"no signatures found in checkpoint\"});return new t(s,c)}},aK=class t{constructor(e,r,s,a){this.origin=e,this.logSize=r,this.logHash=s,this.rest=a}static fromString(e){let r=e.trimEnd().split(`\n`);if(r.length<3)throw new I1.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"too few lines in checkpoint header\"});let s=r[0],a=BigInt(r[1]),n=Buffer.from(r[2],\"base64\"),c=r.slice(3);return new t(s,a,n,c)}}});var hxe=_(AK=>{\"use strict\";Object.defineProperty(AK,\"__esModule\",{value:!0});AK.verifyMerkleInclusion=LSt;var fK=Cl(),cK=Eo(),NSt=Buffer.from([0]),OSt=Buffer.from([1]);function LSt(t){let e=t.inclusionProof,r=BigInt(e.logIndex),s=BigInt(e.treeSize);if(r<0n||r>=s)throw new cK.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:`invalid index: ${r}`});let{inner:a,border:n}=MSt(r,s);if(e.hashes.length!==a+n)throw new cK.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"invalid hash count\"});let c=e.hashes.slice(0,a),f=e.hashes.slice(a),p=qSt(t.canonicalizedBody),h=_St(USt(p,c,r),f);if(!fK.crypto.bufferEqual(h,e.rootHash))throw new cK.VerificationError({code:\"TLOG_INCLUSION_PROOF_ERROR\",message:\"calculated root hash does not match inclusion proof\"})}function MSt(t,e){let r=HSt(t,e),s=jSt(t>>BigInt(r));return{inner:r,border:s}}function USt(t,e,r){return e.reduce((s,a,n)=>r>>BigInt(n)&BigInt(1)?uK(a,s):uK(s,a),t)}function _St(t,e){return e.reduce((r,s)=>uK(s,r),t)}function HSt(t,e){return GSt(t^e-BigInt(1))}function jSt(t){return t.toString(2).split(\"1\").length-1}function GSt(t){return t===0n?0:t.toString(2).length}function uK(t,e){return fK.crypto.digest(\"sha256\",OSt,t,e)}function qSt(t){return fK.crypto.digest(\"sha256\",NSt,t)}});var dxe=_(pK=>{\"use strict\";Object.defineProperty(pK,\"__esModule\",{value:!0});pK.verifyTLogSET=VSt;var gxe=Cl(),WSt=Eo(),YSt=py();function VSt(t,e){if(!(0,YSt.filterTLogAuthorities)(e,{logID:t.logId.keyId,targetDate:new Date(Number(t.integratedTime)*1e3)}).some(a=>{let n=JSt(t),c=Buffer.from(gxe.json.canonicalize(n),\"utf8\"),f=t.inclusionPromise.signedEntryTimestamp;return gxe.crypto.verify(c,a.publicKey,f)}))throw new WSt.VerificationError({code:\"TLOG_INCLUSION_PROMISE_ERROR\",message:\"inclusion promise could not be verified\"})}function JSt(t){let{integratedTime:e,logIndex:r,logId:s,canonicalizedBody:a}=t;return{body:a.toString(\"base64\"),integratedTime:Number(e),logIndex:Number(r),logID:s.keyId.toString(\"hex\")}}});var mxe=_(dK=>{\"use strict\";Object.defineProperty(dK,\"__esModule\",{value:!0});dK.verifyRFC3161Timestamp=ZSt;var hK=Cl(),gK=Eo(),KSt=rK(),zSt=py();function ZSt(t,e,r){let s=t.signingTime;if(r=(0,zSt.filterCertAuthorities)(r,{start:s,end:s}),r=$St(r,{serialNumber:t.signerSerialNumber,issuer:t.signerIssuer}),!r.some(n=>{try{return XSt(t,e,n),!0}catch{return!1}}))throw new gK.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"timestamp could not be verified\"})}function XSt(t,e,r){let[s,...a]=r.certChain,n=hK.crypto.createPublicKey(s.publicKey),c=t.signingTime;try{new KSt.CertificateChainVerifier({untrustedCert:s,trustedCerts:a}).verify()}catch{throw new gK.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"invalid certificate chain\"})}if(!r.certChain.every(p=>p.validForDate(c)))throw new gK.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"timestamp was signed with an expired certificate\"});t.verify(e,n)}function $St(t,e){return t.filter(r=>r.certChain.length>0&&hK.crypto.bufferEqual(r.certChain[0].serialNumber,e.serialNumber)&&hK.crypto.bufferEqual(r.certChain[0].issuer,e.issuer))}});var yxe=_(BL=>{\"use strict\";Object.defineProperty(BL,\"__esModule\",{value:!0});BL.verifyTSATimestamp=sDt;BL.verifyTLogTimestamp=oDt;var eDt=Eo(),tDt=pxe(),rDt=hxe(),nDt=dxe(),iDt=mxe();function sDt(t,e,r){return(0,iDt.verifyRFC3161Timestamp)(t,e,r),{type:\"timestamp-authority\",logID:t.signerSerialNumber,timestamp:t.signingTime}}function oDt(t,e){let r=!1;if(aDt(t)&&((0,nDt.verifyTLogSET)(t,e),r=!0),lDt(t)&&((0,rDt.verifyMerkleInclusion)(t),(0,tDt.verifyCheckpoint)(t,e),r=!0),!r)throw new eDt.VerificationError({code:\"TLOG_MISSING_INCLUSION_ERROR\",message:\"inclusion could not be verified\"});return{type:\"transparency-log\",logID:t.logId.keyId,timestamp:new Date(Number(t.integratedTime)*1e3)}}function aDt(t){return t.inclusionPromise!==void 0}function lDt(t){return t.inclusionProof!==void 0}});var Exe=_(mK=>{\"use strict\";Object.defineProperty(mK,\"__esModule\",{value:!0});mK.verifyDSSETLogBody=cDt;var vL=Eo();function cDt(t,e){switch(t.apiVersion){case\"0.0.1\":return uDt(t,e);default:throw new vL.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported dsse version: ${t.apiVersion}`})}}function uDt(t,e){if(t.spec.signatures?.length!==1)throw new vL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"signature count mismatch\"});let r=t.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(r,\"base64\")))throw new vL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"tlog entry signature mismatch\"});let s=t.spec.payloadHash?.value||\"\";if(!e.compareDigest(Buffer.from(s,\"hex\")))throw new vL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"DSSE payload hash mismatch\"})}});var Ixe=_(EK=>{\"use strict\";Object.defineProperty(EK,\"__esModule\",{value:!0});EK.verifyHashedRekordTLogBody=fDt;var yK=Eo();function fDt(t,e){switch(t.apiVersion){case\"0.0.1\":return ADt(t,e);default:throw new yK.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported hashedrekord version: ${t.apiVersion}`})}}function ADt(t,e){let r=t.spec.signature.content||\"\";if(!e.compareSignature(Buffer.from(r,\"base64\")))throw new yK.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"signature mismatch\"});let s=t.spec.data.hash?.value||\"\";if(!e.compareDigest(Buffer.from(s,\"hex\")))throw new yK.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"digest mismatch\"})}});var Cxe=_(IK=>{\"use strict\";Object.defineProperty(IK,\"__esModule\",{value:!0});IK.verifyIntotoTLogBody=pDt;var SL=Eo();function pDt(t,e){switch(t.apiVersion){case\"0.0.2\":return hDt(t,e);default:throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported intoto version: ${t.apiVersion}`})}}function hDt(t,e){if(t.spec.content.envelope.signatures?.length!==1)throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"signature count mismatch\"});let r=gDt(t.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(r,\"base64\")))throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"tlog entry signature mismatch\"});let s=t.spec.content.payloadHash?.value||\"\";if(!e.compareDigest(Buffer.from(s,\"hex\")))throw new SL.VerificationError({code:\"TLOG_BODY_ERROR\",message:\"DSSE payload hash mismatch\"})}function gDt(t){return Buffer.from(t,\"base64\").toString(\"utf-8\")}});var Bxe=_(CK=>{\"use strict\";Object.defineProperty(CK,\"__esModule\",{value:!0});CK.verifyTLogBody=EDt;var wxe=Eo(),dDt=Exe(),mDt=Ixe(),yDt=Cxe();function EDt(t,e){let{kind:r,version:s}=t.kindVersion,a=JSON.parse(t.canonicalizedBody.toString(\"utf8\"));if(r!==a.kind||s!==a.apiVersion)throw new wxe.VerificationError({code:\"TLOG_BODY_ERROR\",message:`kind/version mismatch - expected: ${r}/${s}, received: ${a.kind}/${a.apiVersion}`});switch(a.kind){case\"dsse\":return(0,dDt.verifyDSSETLogBody)(a,e);case\"intoto\":return(0,yDt.verifyIntotoTLogBody)(a,e);case\"hashedrekord\":return(0,mDt.verifyHashedRekordTLogBody)(a,e);default:throw new wxe.VerificationError({code:\"TLOG_BODY_ERROR\",message:`unsupported kind: ${r}`})}}});var bxe=_(DL=>{\"use strict\";Object.defineProperty(DL,\"__esModule\",{value:!0});DL.Verifier=void 0;var IDt=Ie(\"util\"),C1=Eo(),vxe=uxe(),Sxe=Axe(),Dxe=yxe(),CDt=Bxe(),wK=class{constructor(e,r={}){this.trustMaterial=e,this.options={ctlogThreshold:r.ctlogThreshold??1,tlogThreshold:r.tlogThreshold??1,tsaThreshold:r.tsaThreshold??0}}verify(e,r){let s=this.verifyTimestamps(e),a=this.verifySigningKey(e,s);return this.verifyTLogs(e),this.verifySignature(e,a),r&&this.verifyPolicy(r,a.identity||{}),a}verifyTimestamps(e){let r=0,s=0,a=e.timestamps.map(n=>{switch(n.$case){case\"timestamp-authority\":return s++,(0,Dxe.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case\"transparency-log\":return r++,(0,Dxe.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(Pxe(a))throw new C1.VerificationError({code:\"TIMESTAMP_ERROR\",message:\"duplicate timestamp\"});if(r<this.options.tlogThreshold)throw new C1.VerificationError({code:\"TIMESTAMP_ERROR\",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${r}`});if(s<this.options.tsaThreshold)throw new C1.VerificationError({code:\"TIMESTAMP_ERROR\",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${s}`});return a.map(n=>n.timestamp)}verifySigningKey({key:e},r){switch(e.$case){case\"public-key\":return(0,vxe.verifyPublicKey)(e.hint,r,this.trustMaterial);case\"certificate\":{let s=(0,vxe.verifyCertificate)(e.certificate,r,this.trustMaterial);if(Pxe(s.scts))throw new C1.VerificationError({code:\"CERTIFICATE_ERROR\",message:\"duplicate SCT\"});if(s.scts.length<this.options.ctlogThreshold)throw new C1.VerificationError({code:\"CERTIFICATE_ERROR\",message:`expected ${this.options.ctlogThreshold} SCTs, got ${s.scts.length}`});return s.signer}}}verifyTLogs({signature:e,tlogEntries:r}){r.forEach(s=>(0,CDt.verifyTLogBody)(s,e))}verifySignature(e,r){if(!e.signature.verifySignature(r.key))throw new C1.VerificationError({code:\"SIGNATURE_ERROR\",message:\"signature verification failed\"})}verifyPolicy(e,r){e.subjectAlternativeName&&(0,Sxe.verifySubjectAlternativeName)(e.subjectAlternativeName,r.subjectAlternativeName),e.extensions&&(0,Sxe.verifyExtensions)(e.extensions,r.extensions)}};DL.Verifier=wK;function Pxe(t){for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++)if((0,IDt.isDeepStrictEqual)(t[e],t[r]))return!0;return!1}});var PL=_(iu=>{\"use strict\";Object.defineProperty(iu,\"__esModule\",{value:!0});iu.Verifier=iu.toTrustMaterial=iu.VerificationError=iu.PolicyError=iu.toSignedEntity=void 0;var wDt=nxe();Object.defineProperty(iu,\"toSignedEntity\",{enumerable:!0,get:function(){return wDt.toSignedEntity}});var xxe=Eo();Object.defineProperty(iu,\"PolicyError\",{enumerable:!0,get:function(){return xxe.PolicyError}});Object.defineProperty(iu,\"VerificationError\",{enumerable:!0,get:function(){return xxe.VerificationError}});var BDt=py();Object.defineProperty(iu,\"toTrustMaterial\",{enumerable:!0,get:function(){return BDt.toTrustMaterial}});var vDt=bxe();Object.defineProperty(iu,\"Verifier\",{enumerable:!0,get:function(){return vDt.Verifier}})});var kxe=_(Fa=>{\"use strict\";Object.defineProperty(Fa,\"__esModule\",{value:!0});Fa.DEFAULT_TIMEOUT=Fa.DEFAULT_RETRY=void 0;Fa.createBundleBuilder=PDt;Fa.createKeyFinder=bDt;Fa.createVerificationPolicy=xDt;var SDt=Cl(),w1=F7(),DDt=PL();Fa.DEFAULT_RETRY={retries:2};Fa.DEFAULT_TIMEOUT=5e3;function PDt(t,e){let r={signer:kDt(e),witnesses:RDt(e)};switch(t){case\"messageSignature\":return new w1.MessageSignatureBundleBuilder(r);case\"dsseEnvelope\":return new w1.DSSEBundleBuilder({...r,certificateChain:e.legacyCompatibility})}}function bDt(t){return e=>{let r=t(e);if(!r)throw new DDt.VerificationError({code:\"PUBLIC_KEY_ERROR\",message:`key not found: ${e}`});return{publicKey:SDt.crypto.createPublicKey(r),validFor:()=>!0}}}function xDt(t){let e={},r=t.certificateIdentityEmail||t.certificateIdentityURI;return r&&(e.subjectAlternativeName=r),t.certificateIssuer&&(e.extensions={issuer:t.certificateIssuer}),e}function kDt(t){return new w1.FulcioSigner({fulcioBaseURL:t.fulcioURL,identityProvider:t.identityProvider||QDt(t),retry:t.retry??Fa.DEFAULT_RETRY,timeout:t.timeout??Fa.DEFAULT_TIMEOUT})}function QDt(t){let e=t.identityToken;return e?{getToken:()=>Promise.resolve(e)}:new w1.CIContextProvider(\"sigstore\")}function RDt(t){let e=[];return TDt(t)&&e.push(new w1.RekorWitness({rekorBaseURL:t.rekorURL,entryType:t.legacyCompatibility?\"intoto\":\"dsse\",fetchOnConflict:!1,retry:t.retry??Fa.DEFAULT_RETRY,timeout:t.timeout??Fa.DEFAULT_TIMEOUT})),FDt(t)&&e.push(new w1.TSAWitness({tsaBaseURL:t.tsaServerURL,retry:t.retry??Fa.DEFAULT_RETRY,timeout:t.timeout??Fa.DEFAULT_TIMEOUT})),e}function TDt(t){return t.tlogUpload!==!1}function FDt(t){return t.tsaServerURL!==void 0}});var Txe=_(su=>{\"use strict\";var NDt=su&&su.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||(\"get\"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),ODt=su&&su.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qxe=su&&su.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(s[s.length]=a);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),a=0;a<s.length;a++)s[a]!==\"default\"&&NDt(r,e,s[a]);return ODt(r,e),r}}();Object.defineProperty(su,\"__esModule\",{value:!0});su.sign=MDt;su.attest=UDt;su.verify=_Dt;su.createVerifier=Rxe;var vK=EP(),LDt=Qxe(pL()),BK=PL(),B1=Qxe(kxe());async function MDt(t,e={}){let s=await B1.createBundleBuilder(\"messageSignature\",e).create({data:t});return(0,vK.bundleToJSON)(s)}async function UDt(t,e,r={}){let a=await B1.createBundleBuilder(\"dsseEnvelope\",r).create({data:t,type:e});return(0,vK.bundleToJSON)(a)}async function _Dt(t,e,r){let s;return Buffer.isBuffer(e)?s=e:r=e,Rxe(r).then(a=>a.verify(t,s))}async function Rxe(t={}){let e=await LDt.getTrustedRoot({mirrorURL:t.tufMirrorURL,rootPath:t.tufRootPath,cachePath:t.tufCachePath,forceCache:t.tufForceCache,retry:t.retry??B1.DEFAULT_RETRY,timeout:t.timeout??B1.DEFAULT_TIMEOUT}),r=t.keySelector?B1.createKeyFinder(t.keySelector):void 0,s=(0,BK.toTrustMaterial)(e,r),a={ctlogThreshold:t.ctLogThreshold,tlogThreshold:t.tlogThreshold},n=new BK.Verifier(s,a),c=B1.createVerificationPolicy(t);return{verify:(f,p)=>{let h=(0,vK.bundleFromJSON)(f),E=(0,BK.toSignedEntity)(h,p);n.verify(E,c)}}}});var Nxe=_(Ni=>{\"use strict\";Object.defineProperty(Ni,\"__esModule\",{value:!0});Ni.verify=Ni.sign=Ni.createVerifier=Ni.attest=Ni.VerificationError=Ni.PolicyError=Ni.TUFError=Ni.InternalError=Ni.DEFAULT_REKOR_URL=Ni.DEFAULT_FULCIO_URL=Ni.ValidationError=void 0;var HDt=EP();Object.defineProperty(Ni,\"ValidationError\",{enumerable:!0,get:function(){return HDt.ValidationError}});var SK=F7();Object.defineProperty(Ni,\"DEFAULT_FULCIO_URL\",{enumerable:!0,get:function(){return SK.DEFAULT_FULCIO_URL}});Object.defineProperty(Ni,\"DEFAULT_REKOR_URL\",{enumerable:!0,get:function(){return SK.DEFAULT_REKOR_URL}});Object.defineProperty(Ni,\"InternalError\",{enumerable:!0,get:function(){return SK.InternalError}});var jDt=pL();Object.defineProperty(Ni,\"TUFError\",{enumerable:!0,get:function(){return jDt.TUFError}});var Fxe=PL();Object.defineProperty(Ni,\"PolicyError\",{enumerable:!0,get:function(){return Fxe.PolicyError}});Object.defineProperty(Ni,\"VerificationError\",{enumerable:!0,get:function(){return Fxe.VerificationError}});var bL=Txe();Object.defineProperty(Ni,\"attest\",{enumerable:!0,get:function(){return bL.attest}});Object.defineProperty(Ni,\"createVerifier\",{enumerable:!0,get:function(){return bL.createVerifier}});Object.defineProperty(Ni,\"sign\",{enumerable:!0,get:function(){return bL.sign}});Object.defineProperty(Ni,\"verify\",{enumerable:!0,get:function(){return bL.verify}})});Dt();Ge();Dt();var pke=Ie(\"child_process\"),hke=ut(Fd());Yt();var $I=new Map([]);var Gv={};Vt(Gv,{BaseCommand:()=>ft,WorkspaceRequiredError:()=>ar,getCli:()=>Bde,getDynamicLibs:()=>wde,getPluginConfiguration:()=>tC,openWorkspace:()=>eC,pluginCommands:()=>$I,runExit:()=>YT});Yt();var ft=class extends ot{constructor(){super(...arguments);this.cwd=ge.String(\"--cwd\",{hidden:!0})}validateAndExecute(){if(typeof this.cwd<\"u\")throw new nt(\"The --cwd option is ambiguous when used anywhere else than the very first parameter provided in the command line, before even the command path\");return super.validateAndExecute()}};Ge();Dt();Yt();var ar=class extends nt{constructor(e,r){let s=J.relative(e,r),a=J.join(e,Ut.fileName);super(`This command can only be run from within a workspace of your project (${s} isn't a workspace of ${a}).`)}};Ge();Dt();eA();wc();pv();Yt();var hat=ut(Ai());Ul();var wde=()=>new Map([[\"@yarnpkg/cli\",Gv],[\"@yarnpkg/core\",jv],[\"@yarnpkg/fslib\",_2],[\"@yarnpkg/libzip\",fv],[\"@yarnpkg/parsers\",J2],[\"@yarnpkg/shell\",mv],[\"clipanion\",oB],[\"semver\",hat],[\"typanion\",Ea]]);Ge();async function eC(t,e){let{project:r,workspace:s}=await Rt.find(t,e);if(!s)throw new ar(r.cwd,e);return s}Ge();Dt();eA();wc();pv();Yt();var fbt=ut(Ai());Ul();var f5={};Vt(f5,{AddCommand:()=>sC,BinCommand:()=>oC,CacheCleanCommand:()=>aC,ClipanionCommand:()=>pC,ConfigCommand:()=>fC,ConfigGetCommand:()=>lC,ConfigSetCommand:()=>cC,ConfigUnsetCommand:()=>uC,DedupeCommand:()=>AC,EntryCommand:()=>gC,ExecCommand:()=>mC,ExplainCommand:()=>IC,ExplainPeerRequirementsCommand:()=>yC,HelpCommand:()=>hC,InfoCommand:()=>CC,LinkCommand:()=>BC,NodeCommand:()=>vC,PluginCheckCommand:()=>SC,PluginImportCommand:()=>bC,PluginImportSourcesCommand:()=>xC,PluginListCommand:()=>DC,PluginRemoveCommand:()=>kC,PluginRuntimeCommand:()=>QC,RebuildCommand:()=>RC,RemoveCommand:()=>TC,RunCommand:()=>NC,RunIndexCommand:()=>FC,SetResolutionCommand:()=>OC,SetVersionCommand:()=>EC,SetVersionSourcesCommand:()=>PC,UnlinkCommand:()=>LC,UpCommand:()=>MC,VersionCommand:()=>dC,WhyCommand:()=>UC,WorkspaceCommand:()=>qC,WorkspacesListCommand:()=>GC,YarnCommand:()=>wC,dedupeUtils:()=>tF,default:()=>bct,suggestUtils:()=>Zu});var Yye=ut(Fd());Ge();Ge();Ge();Yt();var uye=ut(Vv());Ul();var Zu={};Vt(Zu,{Modifier:()=>jq,Strategy:()=>$T,Target:()=>Jv,WorkspaceModifier:()=>sye,applyModifier:()=>Flt,extractDescriptorFromPath:()=>Gq,extractRangeModifier:()=>oye,fetchDescriptorFrom:()=>qq,findProjectDescriptors:()=>cye,getModifier:()=>Kv,getSuggestedDescriptors:()=>zv,makeWorkspaceDescriptor:()=>lye,toWorkspaceModifier:()=>aye});Ge();Ge();Dt();var Hq=ut(Ai()),Rlt=\"workspace:\",Jv=(s=>(s.REGULAR=\"dependencies\",s.DEVELOPMENT=\"devDependencies\",s.PEER=\"peerDependencies\",s))(Jv||{}),jq=(s=>(s.CARET=\"^\",s.TILDE=\"~\",s.EXACT=\"\",s))(jq||{}),sye=(s=>(s.CARET=\"^\",s.TILDE=\"~\",s.EXACT=\"*\",s))(sye||{}),$T=(n=>(n.KEEP=\"keep\",n.REUSE=\"reuse\",n.PROJECT=\"project\",n.LATEST=\"latest\",n.CACHE=\"cache\",n))($T||{});function Kv(t,e){return t.exact?\"\":t.caret?\"^\":t.tilde?\"~\":e.configuration.get(\"defaultSemverRangePrefix\")}var Tlt=/^([\\^~]?)[0-9]+(?:\\.[0-9]+){0,2}(?:-\\S+)?$/;function oye(t,{project:e}){let r=t.match(Tlt);return r?r[1]:e.configuration.get(\"defaultSemverRangePrefix\")}function Flt(t,e){let{protocol:r,source:s,params:a,selector:n}=G.parseRange(t.range);return Hq.default.valid(n)&&(n=`${e}${t.range}`),G.makeDescriptor(t,G.makeRange({protocol:r,source:s,params:a,selector:n}))}function aye(t){switch(t){case\"^\":return\"^\";case\"~\":return\"~\";case\"\":return\"*\";default:throw new Error(`Assertion failed: Unknown modifier: \"${t}\"`)}}function lye(t,e){return G.makeDescriptor(t.anchoredDescriptor,`${Rlt}${aye(e)}`)}async function cye(t,{project:e,target:r}){let s=new Map,a=n=>{let c=s.get(n.descriptorHash);return c||s.set(n.descriptorHash,c={descriptor:n,locators:[]}),c};for(let n of e.workspaces)if(r===\"peerDependencies\"){let c=n.manifest.peerDependencies.get(t.identHash);c!==void 0&&a(c).locators.push(n.anchoredLocator)}else{let c=n.manifest.dependencies.get(t.identHash),f=n.manifest.devDependencies.get(t.identHash);r===\"devDependencies\"?f!==void 0?a(f).locators.push(n.anchoredLocator):c!==void 0&&a(c).locators.push(n.anchoredLocator):c!==void 0?a(c).locators.push(n.anchoredLocator):f!==void 0&&a(f).locators.push(n.anchoredLocator)}return s}async function Gq(t,{cwd:e,workspace:r}){return await Olt(async s=>{J.isAbsolute(t)||(t=J.relative(r.cwd,J.resolve(e,t)),t.match(/^\\.{0,2}\\//)||(t=`./${t}`));let{project:a}=r,n=await qq(G.makeIdent(null,\"archive\"),t,{project:r.project,cache:s,workspace:r});if(!n)throw new Error(\"Assertion failed: The descriptor should have been found\");let c=new ki,f=a.configuration.makeResolver(),p=a.configuration.makeFetcher(),h={checksums:a.storedChecksums,project:a,cache:s,fetcher:p,report:c,resolver:f},E=f.bindDescriptor(n,r.anchoredLocator,h),C=G.convertDescriptorToLocator(E),S=await p.fetch(C,h),b=await Ut.find(S.prefixPath,{baseFs:S.packageFs});if(!b.name)throw new Error(\"Target path doesn't have a name\");return G.makeDescriptor(b.name,t)})}function Nlt(t){if(t.range===\"unknown\")return{type:\"resolve\",range:\"latest\"};if(Fr.validRange(t.range))return{type:\"fixed\",range:t.range};if(Mp.test(t.range))return{type:\"resolve\",range:t.range};let e=t.range.match(/^(?:jsr:|npm:)(.*)/);if(!e)return{type:\"fixed\",range:t.range};let[,r]=e,s=`${G.stringifyIdent(t)}@`;return r.startsWith(s)&&(r=r.slice(s.length)),Fr.validRange(r)?{type:\"fixed\",range:t.range}:Mp.test(r)?{type:\"resolve\",range:t.range}:{type:\"fixed\",range:t.range}}async function zv(t,{project:e,workspace:r,cache:s,target:a,fixed:n,modifier:c,strategies:f,maxResults:p=1/0}){if(!(p>=0))throw new Error(`Invalid maxResults (${p})`);let h=!n||t.range===\"unknown\"?Nlt(t):{type:\"fixed\",range:t.range};if(h.type===\"fixed\")return{suggestions:[{descriptor:t,name:`Use ${G.prettyDescriptor(e.configuration,t)}`,reason:\"(unambiguous explicit request)\"}],rejections:[]};let E=typeof r<\"u\"&&r!==null&&r.manifest[a].get(t.identHash)||null,C=[],S=[],b=async I=>{try{await I()}catch(T){S.push(T)}};for(let I of f){if(C.length>=p)break;switch(I){case\"keep\":await b(async()=>{E&&C.push({descriptor:E,name:`Keep ${G.prettyDescriptor(e.configuration,E)}`,reason:\"(no changes)\"})});break;case\"reuse\":await b(async()=>{for(let{descriptor:T,locators:N}of(await cye(t,{project:e,target:a})).values()){if(N.length===1&&N[0].locatorHash===r.anchoredLocator.locatorHash&&f.includes(\"keep\"))continue;let U=`(originally used by ${G.prettyLocator(e.configuration,N[0])}`;U+=N.length>1?` and ${N.length-1} other${N.length>2?\"s\":\"\"})`:\")\",C.push({descriptor:T,name:`Reuse ${G.prettyDescriptor(e.configuration,T)}`,reason:U})}});break;case\"cache\":await b(async()=>{for(let T of e.storedDescriptors.values())T.identHash===t.identHash&&C.push({descriptor:T,name:`Reuse ${G.prettyDescriptor(e.configuration,T)}`,reason:\"(already used somewhere in the lockfile)\"})});break;case\"project\":await b(async()=>{if(r.manifest.name!==null&&t.identHash===r.manifest.name.identHash)return;let T=e.tryWorkspaceByIdent(t);if(T===null)return;let N=lye(T,c);C.push({descriptor:N,name:`Attach ${G.prettyDescriptor(e.configuration,N)}`,reason:`(local workspace at ${he.pretty(e.configuration,T.relativeCwd,he.Type.PATH)})`})});break;case\"latest\":{let T=e.configuration.get(\"enableNetwork\"),N=e.configuration.get(\"enableOfflineMode\");await b(async()=>{if(a===\"peerDependencies\")C.push({descriptor:G.makeDescriptor(t,\"*\"),name:\"Use *\",reason:\"(catch-all peer dependency pattern)\"});else if(!T&&!N)C.push({descriptor:null,name:\"Resolve from latest\",reason:he.pretty(e.configuration,\"(unavailable because enableNetwork is toggled off)\",\"grey\")});else{let U=await qq(t,h.range,{project:e,cache:s,workspace:r,modifier:c});U&&C.push({descriptor:U,name:`Use ${G.prettyDescriptor(e.configuration,U)}`,reason:`(resolved from ${N?\"the cache\":\"latest\"})`})}})}break}}return{suggestions:C.slice(0,p),rejections:S.slice(0,p)}}async function qq(t,e,{project:r,cache:s,workspace:a,preserveModifier:n=!0,modifier:c}){let f=r.configuration.normalizeDependency(G.makeDescriptor(t,e)),p=new ki,h=r.configuration.makeFetcher(),E=r.configuration.makeResolver(),C={project:r,fetcher:h,cache:s,checksums:r.storedChecksums,report:p,cacheOptions:{skipIntegrityCheck:!0}},S={...C,resolver:E,fetchOptions:C},b=E.bindDescriptor(f,a.anchoredLocator,S),I=await E.getCandidates(b,{},S);if(I.length===0)return null;let T=I[0],{protocol:N,source:U,params:W,selector:ee}=G.parseRange(G.convertToManifestRange(T.reference));if(N===r.configuration.get(\"defaultProtocol\")&&(N=null),Hq.default.valid(ee)){let ie=ee;if(typeof c<\"u\")ee=c+ee;else if(n!==!1){let me=typeof n==\"string\"?n:f.range;ee=oye(me,{project:r})+ee}let ue=G.makeDescriptor(T,G.makeRange({protocol:N,source:U,params:W,selector:ee}));(await E.getCandidates(r.configuration.normalizeDependency(ue),{},S)).length!==1&&(ee=ie)}return G.makeDescriptor(T,G.makeRange({protocol:N,source:U,params:W,selector:ee}))}async function Olt(t){return await ce.mktempPromise(async e=>{let r=ze.create(e);return r.useWithSource(e,{enableMirror:!1,compressionLevel:0},e,{overwrite:!0}),await t(new Kr(e,{configuration:r,check:!1,immutable:!1}))})}var sC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.fixed=ge.Boolean(\"-F,--fixed\",!1,{description:\"Store dependency tags as-is instead of resolving them\"});this.exact=ge.Boolean(\"-E,--exact\",!1,{description:\"Don't use any semver modifier on the resolved range\"});this.tilde=ge.Boolean(\"-T,--tilde\",!1,{description:\"Use the `~` semver modifier on the resolved range\"});this.caret=ge.Boolean(\"-C,--caret\",!1,{description:\"Use the `^` semver modifier on the resolved range\"});this.dev=ge.Boolean(\"-D,--dev\",!1,{description:\"Add a package as a dev dependency\"});this.peer=ge.Boolean(\"-P,--peer\",!1,{description:\"Add a package as a peer dependency\"});this.optional=ge.Boolean(\"-O,--optional\",!1,{description:\"Add / upgrade a package to an optional regular / peer dependency\"});this.preferDev=ge.Boolean(\"--prefer-dev\",!1,{description:\"Add / upgrade a package to a dev dependency\"});this.interactive=ge.Boolean(\"-i,--interactive\",{description:\"Reuse the specified package from other workspaces in the project\"});this.cached=ge.Boolean(\"--cached\",!1,{description:\"Reuse the highest version already used somewhere within the project\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.silent=ge.Boolean(\"--silent\",{hidden:!0});this.packages=ge.Rest()}static{this.paths=[[\"add\"]]}static{this.usage=ot.Usage({description:\"add dependencies to the project\",details:\"\\n      This command adds a package to the package.json for the nearest workspace.\\n\\n      - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\\n\\n      - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\\n\\n      - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\\n\\n      - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\\\"peerDependenciesMeta\\\": { \\\"<package>\\\": { \\\"optional\\\": true } }`\\n\\n      - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\\n\\n      - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\\n\\n      If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\\n\\n      If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n\\n      For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/protocols.\\n    \",examples:[[\"Add a regular package to the current workspace\",\"$0 add lodash\"],[\"Add a specific version for a package to the current workspace\",\"$0 add lodash@1.2.3\"],[\"Add a package from a GitHub repository (the master branch) to the current workspace using a URL\",\"$0 add lodash@https://github.com/lodash/lodash\"],[\"Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol\",\"$0 add lodash@github:lodash/lodash\"],[\"Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)\",\"$0 add lodash@lodash/lodash\"],[\"Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)\",\"$0 add lodash-es@lodash/lodash#es\"],[\"Add a local package (gzipped tarball format) to the current workspace\",\"$0 add local-package-name@file:../path/to/local-package-name-v0.1.2.tgz\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.fixed,f=r.isInteractive({interactive:this.interactive,stdout:this.context.stdout}),p=f||r.get(\"preferReuse\"),h=Kv(this,s),E=[p?\"reuse\":void 0,\"project\",this.cached?\"cache\":void 0,\"latest\"].filter(W=>typeof W<\"u\"),C=f?1/0:1,S=W=>{let ee=G.tryParseDescriptor(W.slice(4));return ee?ee.range===\"unknown\"?G.makeDescriptor(ee,`jsr:${G.stringifyIdent(ee)}@latest`):G.makeDescriptor(ee,`jsr:${ee.range}`):null},b=await Promise.all(this.packages.map(async W=>{let ee=W.match(/^\\.{0,2}\\//)?await Gq(W,{cwd:this.context.cwd,workspace:a}):W.startsWith(\"jsr:\")?S(W):G.tryParseDescriptor(W),ie=W.match(/^(https?:|git@github)/);if(ie)throw new nt(`It seems you are trying to add a package using a ${he.pretty(r,`${ie[0]}...`,he.Type.RANGE)} url; we now require package names to be explicitly specified.\nTry running the command again with the package name prefixed: ${he.pretty(r,\"yarn add\",he.Type.CODE)} ${he.pretty(r,G.makeDescriptor(G.makeIdent(null,\"my-package\"),`${ie[0]}...`),he.Type.DESCRIPTOR)}`);if(!ee)throw new nt(`The ${he.pretty(r,W,he.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let ue=Llt(a,ee,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(ue.map(async me=>{let pe=await zv(ee,{project:s,workspace:a,cache:n,fixed:c,target:me,modifier:h,strategies:E,maxResults:C});return{request:ee,suggestedDescriptors:pe,target:me}}))})).then(W=>W.flat()),I=await lA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async W=>{for(let{request:ee,suggestedDescriptors:{suggestions:ie,rejections:ue}}of b)if(ie.filter(me=>me.descriptor!==null).length===0){let[me]=ue;if(typeof me>\"u\")throw new Error(\"Assertion failed: Expected an error to have been set\");s.configuration.get(\"enableNetwork\")?W.reportError(27,`${G.prettyDescriptor(r,ee)} can't be resolved to a satisfying range`):W.reportError(27,`${G.prettyDescriptor(r,ee)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),W.reportSeparator(),W.reportExceptionOnce(me)}});if(I.hasErrors())return I.exitCode();let T=!1,N=[],U=[];for(let{suggestedDescriptors:{suggestions:W},target:ee}of b){let ie,ue=W.filter(Be=>Be.descriptor!==null),le=ue[0].descriptor,me=ue.every(Be=>G.areDescriptorsEqual(Be.descriptor,le));ue.length===1||me?ie=le:(T=!0,{answer:ie}=await(0,uye.prompt)({type:\"select\",name:\"answer\",message:\"Which range do you want to use?\",choices:W.map(({descriptor:Be,name:Ce,reason:g})=>Be?{name:Ce,hint:g,descriptor:Be}:{name:Ce,hint:g,disabled:!0}),onCancel:()=>process.exit(130),result(Be){return this.find(Be,\"descriptor\")},stdin:this.context.stdin,stdout:this.context.stdout}));let pe=a.manifest[ee].get(ie.identHash);(typeof pe>\"u\"||pe.descriptorHash!==ie.descriptorHash)&&(a.manifest[ee].set(ie.identHash,ie),this.optional&&(ee===\"dependencies\"?a.manifest.ensureDependencyMeta({...ie,range:\"unknown\"}).optional=!0:ee===\"peerDependencies\"&&(a.manifest.ensurePeerDependencyMeta({...ie,range:\"unknown\"}).optional=!0)),typeof pe>\"u\"?N.push([a,ee,ie,E]):U.push([a,ee,pe,ie]))}return await r.triggerMultipleHooks(W=>W.afterWorkspaceDependencyAddition,N),await r.triggerMultipleHooks(W=>W.afterWorkspaceDependencyReplacement,U),T&&this.context.stdout.write(`\n`),await s.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function Llt(t,e,{dev:r,peer:s,preferDev:a,optional:n}){let c=t.manifest.dependencies.has(e.identHash),f=t.manifest.devDependencies.has(e.identHash),p=t.manifest.peerDependencies.has(e.identHash);if((r||s)&&c)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!s&&p)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&f)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!s&&p)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new nt(`Package \"${G.prettyIdent(t.project.configuration,e)}\" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return s&&h.push(\"peerDependencies\"),(r||a)&&h.push(\"devDependencies\"),n&&h.push(\"dependencies\"),h.length>0?h:f?[\"devDependencies\"]:p?[\"peerDependencies\"]:[\"dependencies\"]}Ge();Ge();Yt();var oC=class extends ft{constructor(){super(...arguments);this.verbose=ge.Boolean(\"-v,--verbose\",!1,{description:\"Print both the binary name and the locator of the package that provides the binary\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.name=ge.String({required:!1})}static{this.paths=[[\"bin\"]]}static{this.usage=ot.Usage({description:\"get the path to a binary script\",details:`\n      When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \\`-v,--verbose\\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.\n\n      When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.\n    `,examples:[[\"List all the available binaries\",\"$0 bin\"],[\"Print the path to a specific binary\",\"$0 bin eslint\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Rt.find(r,this.context.cwd);if(await s.restoreInstallState(),this.name){let f=(await In.getPackageAccessibleBinaries(a,{project:s})).get(this.name);if(!f)throw new nt(`Couldn't find a binary named \"${this.name}\" for package \"${G.prettyLocator(r,a)}\"`);let[,p]=f;return this.context.stdout.write(`${p}\n`),0}return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async c=>{let f=await In.getPackageAccessibleBinaries(a,{project:s}),h=Array.from(f.keys()).reduce((E,C)=>Math.max(E,C.length),0);for(let[E,[C,S]]of f)c.reportJson({name:E,source:G.stringifyIdent(C),path:S});if(this.verbose)for(let[E,[C]]of f)c.reportInfo(null,`${E.padEnd(h,\" \")}   ${G.prettyLocator(r,C)}`);else for(let E of f.keys())c.reportInfo(null,E)})).exitCode()}};Ge();Dt();Yt();var aC=class extends ft{constructor(){super(...arguments);this.mirror=ge.Boolean(\"--mirror\",!1,{description:\"Remove the global cache files instead of the local cache files\"});this.all=ge.Boolean(\"--all\",!1,{description:\"Remove both the global cache files and the local cache files of the current project\"})}static{this.paths=[[\"cache\",\"clean\"],[\"cache\",\"clear\"]]}static{this.usage=ot.Usage({description:\"remove the shared cache files\",details:`\n      This command will remove all the files from the cache.\n    `,examples:[[\"Remove all the local archives\",\"$0 cache clean\"],[\"Remove all the archives stored in the ~/.yarn directory\",\"$0 cache clean --mirror\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(!r.get(\"enableCacheClean\"))throw new nt(\"Cache cleaning is currently disabled. To enable it, set `enableCacheClean: true` in your configuration file. Note: Cache cleaning is typically not required and should be avoided when using Zero-Installs.\");let s=await Kr.find(r);return(await Ot.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&s.mirrorCwd!==null,c=!this.mirror;n&&(await ce.removePromise(s.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await ce.removePromise(s.cwd)})).exitCode()}};Ge();Yt();ql();var Wq=Ie(\"util\"),lC=class extends ft{constructor(){super(...arguments);this.why=ge.Boolean(\"--why\",!1,{description:\"Print the explanation for why a setting has its value\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.unsafe=ge.Boolean(\"--no-redacted\",!1,{description:\"Don't redact secrets (such as tokens) from the output\"});this.name=ge.String()}static{this.paths=[[\"config\",\"get\"]]}static{this.usage=ot.Usage({description:\"read a configuration settings\",details:`\n      This command will print a configuration setting.\n\n      Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \\`--no-redacted\\` to get the untransformed value.\n    `,examples:[[\"Print a simple configuration setting\",\"yarn config get yarnPath\"],[\"Print a complex configuration setting\",\"yarn config get packageExtensions\"],[\"Print a nested field from the configuration\",`yarn config get 'npmScopes[\"my-company\"].npmRegistryServer'`],[\"Print a token from the configuration\",\"yarn config get npmAuthToken --no-redacted\"],[\"Print a configuration setting as JSON\",\"yarn config get packageExtensions --json\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=this.name.replace(/[.[].*$/,\"\"),a=this.name.replace(/^[^.[]*/,\"\");if(typeof r.settings.get(s)>\"u\")throw new nt(`Couldn't find a configuration settings named \"${s}\"`);let c=r.getSpecial(s,{hideSecrets:!this.unsafe,getNativePaths:!0}),f=je.convertMapsToIndexableObjects(c),p=a?va(f,a):f,h=await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p==\"string\")return this.context.stdout.write(`${p}\n`),h.exitCode();Wq.inspect.styles.name=\"cyan\",this.context.stdout.write(`${(0,Wq.inspect)(p,{depth:1/0,colors:r.get(\"enableColors\"),compact:!1})}\n`)}return h.exitCode()}};Ge();Yt();ql();var Yq=Ie(\"util\"),cC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Set complex configuration settings to JSON values\"});this.home=ge.Boolean(\"-H,--home\",!1,{description:\"Update the home configuration instead of the project configuration\"});this.name=ge.String();this.value=ge.String()}static{this.paths=[[\"config\",\"set\"]]}static{this.usage=ot.Usage({description:\"change a configuration settings\",details:`\n      This command will set a configuration setting.\n\n      When used without the \\`--json\\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).\n\n      When used with the \\`--json\\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.\n    `,examples:[[\"Set a simple configuration setting (a string, a number, or a boolean)\",\"yarn config set initScope myScope\"],[\"Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag\",'yarn config set initScope --json \\\\\"myScope\\\\\"'],[\"Set a complex configuration setting (an Array) using the `--json` flag\",`yarn config set unsafeHttpWhitelist --json '[\"*.example.com\", \"example.com\"]'`],[\"Set a complex configuration setting (an Object) using the `--json` flag\",`yarn config set packageExtensions --json '{ \"@babel/parser@*\": { \"dependencies\": { \"@babel/types\": \"*\" } } }'`],[\"Set a nested configuration setting\",'yarn config set npmScopes.company.npmRegistryServer \"https://npm.example.com\"'],[\"Set a nested configuration setting using indexed access for non-simple keys\",`yarn config set 'npmRegistries[\"//npm.example.com\"].npmAuthToken' \"ffffffff-ffff-ffff-ffff-ffffffffffff\"`]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new nt(\"This command must be run from within a project folder\");return r.projectCwd},a=this.name.replace(/[.[].*$/,\"\"),n=this.name.replace(/^[^.[]*\\.?/,\"\");if(typeof r.settings.get(a)>\"u\")throw new nt(`Couldn't find a configuration settings named \"${a}\"`);if(a===\"enableStrictSettings\")throw new nt(\"This setting only affects the file it's in, and thus cannot be set from the CLI\");let f=this.json?JSON.parse(this.value):this.value;await(this.home?I=>ze.updateHomeConfiguration(I):I=>ze.updateConfiguration(s(),I))(I=>{if(n){let T=f0(I);return Jd(T,this.name,f),T}else return{...I,[a]:f}});let E=(await ze.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),C=je.convertMapsToIndexableObjects(E),S=n?va(C,n):C;return(await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async I=>{Yq.inspect.styles.name=\"cyan\",I.reportInfo(0,`Successfully set ${this.name} to ${(0,Yq.inspect)(S,{depth:1/0,colors:r.get(\"enableColors\"),compact:!1})}`)})).exitCode()}};Ge();Yt();ql();var uC=class extends ft{constructor(){super(...arguments);this.home=ge.Boolean(\"-H,--home\",!1,{description:\"Update the home configuration instead of the project configuration\"});this.name=ge.String()}static{this.paths=[[\"config\",\"unset\"]]}static{this.usage=ot.Usage({description:\"unset a configuration setting\",details:`\n      This command will unset a configuration setting.\n    `,examples:[[\"Unset a simple configuration setting\",\"yarn config unset initScope\"],[\"Unset a complex configuration setting\",\"yarn config unset packageExtensions\"],[\"Unset a nested configuration setting\",\"yarn config unset npmScopes.company.npmRegistryServer\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new nt(\"This command must be run from within a project folder\");return r.projectCwd},a=this.name.replace(/[.[].*$/,\"\"),n=this.name.replace(/^[^.[]*\\.?/,\"\");if(typeof r.settings.get(a)>\"u\")throw new nt(`Couldn't find a configuration settings named \"${a}\"`);let f=this.home?h=>ze.updateHomeConfiguration(h):h=>ze.updateConfiguration(s(),h);return(await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await f(C=>{if(!vB(C,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,C;let S=n?f0(C):{...C};return A0(S,this.name),S}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ge();Dt();Yt();var eF=Ie(\"util\"),fC=class extends ft{constructor(){super(...arguments);this.noDefaults=ge.Boolean(\"--no-defaults\",!1,{description:\"Omit the default values from the display\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.verbose=ge.Boolean(\"-v,--verbose\",{hidden:!0});this.why=ge.Boolean(\"--why\",{hidden:!0});this.names=ge.Rest()}static{this.paths=[[\"config\"]]}static{this.usage=ot.Usage({description:\"display the current configuration\",details:`\n      This command prints the current active configuration settings.\n    `,examples:[[\"Print the active configuration settings\",\"$0 config\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins,{strict:!1}),s=await SI({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:\"The --verbose option is deprecated, the settings' descriptions are now always displayed\"},{option:this.why,message:\"The --why option is deprecated, the settings' sources are now always displayed\"}]);if(s!==null)return s;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,c=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async f=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)f.reportError(34,`Invalid configuration key \"${p}\" in ${h}`);f.reportSeparator()}if(this.json)for(let p of a){if(this.noDefaults&&!r.sources.has(p))continue;let h=r.settings.get(p);typeof h>\"u\"&&f.reportError(34,`No configuration key named \"${p}\"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),C=r.sources.get(p)??\"<default>\",S=C&&C[0]!==\"<\"?fe.fromPortablePath(C):C;f.reportJson({key:p,effective:E,source:S,...h})}else{let p={breakLength:1/0,colors:r.get(\"enableColors\"),maxArrayLength:2},h={},E={children:h};for(let C of a){if(this.noDefaults&&!r.sources.has(C))continue;let S=r.settings.get(C),b=r.sources.get(C)??\"<default>\",I=r.getSpecial(C,{hideSecrets:!0,getNativePaths:!0}),T={Description:{label:\"Description\",value:he.tuple(he.Type.MARKDOWN,{text:S.description,format:this.cli.format(),paragraphs:!1})},Source:{label:\"Source\",value:he.tuple(b[0]===\"<\"?he.Type.CODE:he.Type.PATH,b)}};h[C]={value:he.tuple(he.Type.CODE,C),children:T};let N=(U,W)=>{for(let[ee,ie]of W)if(ie instanceof Map){let ue={};U[ee]={children:ue},N(ue,ie)}else U[ee]={label:ee,value:he.tuple(he.Type.NO_HINT,(0,eF.inspect)(ie,p))}};I instanceof Map?N(T,I):T.Value={label:\"Value\",value:he.tuple(he.Type.NO_HINT,(0,eF.inspect)(I,p))}}a.length!==1&&(n=void 0),xs.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<\"u\"){let f=a[0],p=(0,eF.inspect)(r.getSpecial(f,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get(\"enableColors\")});this.context.stdout.write(`\n`),this.context.stdout.write(`${p}\n`)}return c.exitCode()}};Ge();Yt();Ul();var tF={};Vt(tF,{Strategy:()=>Zv,acceptedStrategies:()=>Mlt,dedupe:()=>Vq});Ge();Ge();var fye=ut(Go()),Zv=(e=>(e.HIGHEST=\"highest\",e))(Zv||{}),Mlt=new Set(Object.values(Zv)),Ult={highest:async(t,e,{resolver:r,fetcher:s,resolveOptions:a,fetchOptions:n})=>{let c=new Map;for(let[p,h]of t.storedResolutions){let E=t.storedDescriptors.get(p);if(typeof E>\"u\")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);je.getSetWithDefault(c,E.identHash).add(h)}let f=new Map(je.mapAndFilter(t.storedDescriptors.values(),p=>G.isVirtualDescriptor(p)?je.mapAndFilter.skip:[p.descriptorHash,je.makeDeferred()]));for(let p of t.storedDescriptors.values()){let h=f.get(p.descriptorHash);if(typeof h>\"u\")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=t.storedResolutions.get(p.descriptorHash);if(typeof E>\"u\")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let C=t.originalPackages.get(E);if(typeof C>\"u\")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let S=r.getResolutionDependencies(p,a),b=Object.fromEntries(await je.allSettledSafe(Object.entries(S).map(async([ee,ie])=>{let ue=f.get(ie.descriptorHash);if(typeof ue>\"u\")throw new Error(`Assertion failed: The descriptor (${ie.descriptorHash}) should have been registered`);let le=await ue.promise;if(!le)throw new Error(\"Assertion failed: Expected the dependency to have been through the dedupe process itself\");return[ee,le.updatedPackage]})));if(e.length&&!fye.default.isMatch(G.stringifyIdent(p),e)||!r.shouldPersistResolution(C,a))return C;let I=c.get(p.identHash);if(typeof I>\"u\")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(I.size===1)return C;let T=[...I].map(ee=>{let ie=t.originalPackages.get(ee);if(typeof ie>\"u\")throw new Error(`Assertion failed: The package (${ee}) should have been registered`);return ie}),N=await r.getSatisfying(p,b,T,a),U=N.locators?.[0];if(typeof U>\"u\"||!N.sorted)return C;let W=t.originalPackages.get(U.locatorHash);if(typeof W>\"u\")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return W}).then(async S=>{let b=await t.preparePackage(S,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:C,updatedPackage:S,resolvedPackage:b})}).catch(S=>{h.reject(S)})}return[...f.values()].map(p=>p.promise)}};async function Vq(t,{strategy:e,patterns:r,cache:s,report:a}){let{configuration:n}=t,c=new ki,f=n.makeResolver(),p=n.makeFetcher(),h={cache:s,checksums:t.storedChecksums,fetcher:p,project:t,report:c,cacheOptions:{skipIntegrityCheck:!0}},E={project:t,resolver:f,report:c,fetchOptions:h};return await a.startTimerPromise(\"Deduplication step\",async()=>{let C=Ult[e],S=await C(t,r,{resolver:f,resolveOptions:E,fetcher:p,fetchOptions:h}),b=Ao.progressViaCounter(S.length);await a.reportProgress(b);let I=0;await Promise.all(S.map(U=>U.then(W=>{if(W===null||W.currentPackage.locatorHash===W.updatedPackage.locatorHash)return;I++;let{descriptor:ee,currentPackage:ie,updatedPackage:ue}=W;a.reportInfo(0,`${G.prettyDescriptor(n,ee)} can be deduped from ${G.prettyLocator(n,ie)} to ${G.prettyLocator(n,ue)}`),a.reportJson({descriptor:G.stringifyDescriptor(ee),currentResolution:G.stringifyLocator(ie),updatedResolution:G.stringifyLocator(ue)}),t.storedResolutions.set(ee.descriptorHash,ue.locatorHash)}).finally(()=>b.tick())));let T;switch(I){case 0:T=\"No packages\";break;case 1:T=\"One package\";break;default:T=`${I} packages`}let N=he.pretty(n,e,he.Type.CODE);return a.reportInfo(0,`${T} can be deduped using the ${N} strategy`),I})}var AC=class extends ft{constructor(){super(...arguments);this.strategy=ge.String(\"-s,--strategy\",\"highest\",{description:\"The strategy to use when deduping dependencies\",validator:fo(Zv)});this.check=ge.Boolean(\"-c,--check\",!1,{description:\"Exit with exit code 1 when duplicates are found, without persisting the dependency tree\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.patterns=ge.Rest()}static{this.paths=[[\"dedupe\"]]}static{this.usage=ot.Usage({description:\"deduplicate dependencies with overlapping ranges\",details:\"\\n      Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\\n\\n      This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\\n\\n      - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded. It's also guaranteed that it never takes more than a single pass to dedupe the entire dependency tree.\\n\\n      **Note:** Even though it never produces a wrong dependency tree, this command should be used with caution, as it modifies the dependency tree, which can sometimes cause problems when packages don't strictly follow semver recommendations. Because of this, it is recommended to also review the changes manually.\\n\\n      If set, the `-c,--check` flag will only report the found duplicates, without persisting the modified dependency tree. If changes are found, the command will exit with a non-zero exit code, making it suitable for CI purposes.\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n\\n      This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\\n\\n      ### In-depth explanation:\\n\\n      Yarn doesn't deduplicate dependencies by default, otherwise installs wouldn't be deterministic and the lockfile would be useless. What it actually does is that it tries to not duplicate dependencies in the first place.\\n\\n      **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@*`will cause Yarn to reuse `foo@2.3.4`, even if the latest `foo` is actually `foo@2.10.14`, thus preventing unnecessary duplication.\\n\\n      Duplication happens when Yarn can't unlock dependencies that have already been locked inside the lockfile.\\n\\n      **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@2.10.14` will cause Yarn to install `foo@2.10.14` because the existing resolution doesn't satisfy the range `2.10.14`. This behavior can lead to (sometimes) unwanted duplication, since now the lockfile contains 2 separate resolutions for the 2 `foo` descriptors, even though they have overlapping ranges, which means that the lockfile can be simplified so that both descriptors resolve to `foo@2.10.14`.\\n    \",examples:[[\"Dedupe all packages\",\"$0 dedupe\"],[\"Dedupe all packages using a specific strategy\",\"$0 dedupe --strategy highest\"],[\"Dedupe a specific package\",\"$0 dedupe lodash\"],[\"Dedupe all packages with the `@babel/*` scope\",\"$0 dedupe '@babel/*'\"],[\"Check for duplicates (can be used as a CI step)\",\"$0 dedupe --check\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd),a=await Kr.find(r);await s.restoreInstallState({restoreResolutions:!1});let n=0,c=await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout,json:this.json},async f=>{n=await Vq(s,{strategy:this.strategy,patterns:this.patterns,cache:a,report:f})});return c.hasErrors()?c.exitCode():this.check?n?1:0:await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:a,mode:this.mode})}};Ge();Yt();var pC=class extends ft{static{this.paths=[[\"--clipanion=definitions\"]]}async execute(){let{plugins:e}=await ze.find(this.context.cwd,this.context.plugins),r=[];for(let c of e){let{commands:f}=c[1];if(f){let h=Ca.from(f).definitions();r.push([c[0],h])}}let s=this.cli.definitions(),a=(c,f)=>c.split(\" \").slice(1).join()===f.split(\" \").slice(1).join(),n=Aye()[\"@yarnpkg/builder\"].bundles.standard;for(let c of r){let f=c[1];for(let p of f)s.find(h=>a(h.path,p.path)).plugin={name:c[0],isDefault:n.includes(c[0])}}this.context.stdout.write(`${JSON.stringify(s,null,2)}\n`)}};var hC=class extends ft{static{this.paths=[[\"help\"],[\"--help\"],[\"-h\"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ge();Dt();Yt();var gC=class extends ft{constructor(){super(...arguments);this.leadingArgument=ge.String();this.args=ge.Proxy()}async execute(){if(this.leadingArgument.match(/[\\\\/]/)&&!G.tryParseIdent(this.leadingArgument)){let r=J.resolve(this.context.cwd,fe.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run([\"run\",this.leadingArgument,...this.args])}};Ge();var dC=class extends ft{static{this.paths=[[\"-v\"],[\"--version\"]]}async execute(){this.context.stdout.write(`${fn||\"<unknown>\"}\n`)}};Ge();Ge();Yt();var mC=class extends ft{constructor(){super(...arguments);this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"exec\"]]}static{this.usage=ot.Usage({description:\"execute a shell script\",details:`\n      This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.\n\n      It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).\n    `,examples:[[\"Execute a single shell command\",\"$0 exec echo Hello World\"],[\"Execute a shell script\",'$0 exec \"tsc & babel src --out-dir lib\"']]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Rt.find(r,this.context.cwd);return await s.restoreInstallState(),await In.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:s})}};Ge();Yt();Ul();var yC=class extends ft{constructor(){super(...arguments);this.hash=ge.String({required:!1,validator:Nx(wE(),[X2(/^p[0-9a-f]{6}$/)])})}static{this.paths=[[\"explain\",\"peer-requirements\"]]}static{this.usage=ot.Usage({description:\"explain a set of peer requirements\",details:`\n      A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters.\n\n      When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not.\n\n      When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement.\n\n      **Note:** A hash is a seven-letter code consisting of the letter 'p' followed by six characters that can be obtained from peer dependency warnings or from the list of all peer requirements(\\`yarn explain peer-requirements\\`).\n    `,examples:[[\"Explain the corresponding peer requirement for a hash\",\"$0 explain peer-requirements p1a4ed\"],[\"List all peer requirements\",\"$0 explain peer-requirements\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);return await s.restoreInstallState({restoreResolutions:!1}),await s.applyLightResolution(),typeof this.hash<\"u\"?await Hlt(this.hash,s,{stdout:this.context.stdout}):await jlt(s,{stdout:this.context.stdout})}};async function Hlt(t,e,r){let s=e.peerRequirementNodes.get(t);if(typeof s>\"u\")throw new Error(`No peerDependency requirements found for hash: \"${t}\"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:he.tuple(he.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:he.tuple(he.Type.NO_HINT,\"...\")}]:[]}:(a.add(p.requester.locatorHash),{value:he.tuple(he.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[G.stringifyLocator(h.requester),n(h)]))}),c=e.peerWarnings.find(p=>p.hash===t);return(await Ot.start({configuration:e.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=he.mark(e.configuration),E=c?h.Cross:h.Check;if(p.reportInfo(0,`Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} is requested to provide ${he.pretty(e.configuration,s.ident,he.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,he.pretty(e.configuration,s.subject,he.Type.LOCATOR)),xs.emitTree({children:Object.fromEntries(Array.from(s.requests.values(),C=>[G.stringifyLocator(C.requester),n(C)]))},{configuration:e.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),s.provided.range===\"missing:\"){let C=c?\"\":\" , but all peer requests are optional\";p.reportInfo(0,`${E} Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} does not provide ${he.pretty(e.configuration,s.ident,he.Type.IDENT)}${C}.`)}else{let C=e.storedResolutions.get(s.provided.descriptorHash);if(!C)throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let S=e.storedPackages.get(C);if(!S)throw new Error(\"Assertion failed: Expected the package to be registered\");p.reportInfo(0,`${E} Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} provides ${he.pretty(e.configuration,s.ident,he.Type.IDENT)} with version ${G.prettyReference(e.configuration,S.version??\"0.0.0\")}, ${c?\"which does not satisfy all requests.\":\"which satisfies all requests\"}`),c?.type===3&&(c.range?p.reportInfo(0,`  The combined requested range is ${he.pretty(e.configuration,c.range,he.Type.RANGE)}`):p.reportInfo(0,\"  Unfortunately, the requested ranges have no overlap\"))}})).exitCode()}async function jlt(t,e){return(await Ot.start({configuration:t.configuration,stdout:e.stdout,includeFooter:!1,includePrefix:!1},async s=>{let a=he.mark(t.configuration),n=je.sortMap(t.peerRequirementNodes,[([,c])=>G.stringifyLocator(c.subject),([,c])=>G.stringifyIdent(c.ident)]);for(let[,c]of n.values()){if(!c.root)continue;let f=t.peerWarnings.find(E=>E.hash===c.hash),p=[...G.allPeerRequests(c)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=\" and 1 other dependency\":h=\"\",c.provided.range!==\"missing:\"){let E=t.storedResolutions.get(c.provided.descriptorHash);if(!E)throw new Error(\"Assertion failed: Expected the resolution to have been registered\");let C=t.storedPackages.get(E);if(!C)throw new Error(\"Assertion failed: Expected the provided package to have been registered\");let S=`${he.pretty(t.configuration,c.hash,he.Type.CODE)} \\u2192 ${f?a.Cross:a.Check} ${G.prettyLocator(t.configuration,c.subject)} provides ${G.prettyLocator(t.configuration,C)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,S):s.reportInfo(0,S)}else{let E=`${he.pretty(t.configuration,c.hash,he.Type.CODE)} \\u2192 ${f?a.Cross:a.Check} ${G.prettyLocator(t.configuration,c.subject)} doesn't provide ${G.prettyIdent(t.configuration,c.ident)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,E):s.reportInfo(0,E)}}})).exitCode()}Ge();Yt();Ul();Ge();Ge();Dt();Yt();var pye=ut(Ai()),EC=class extends ft{constructor(){super(...arguments);this.useYarnPath=ge.Boolean(\"--yarn-path\",{description:\"Set the yarnPath setting even if the version can be accessed by Corepack\"});this.onlyIfNeeded=ge.Boolean(\"--only-if-needed\",!1,{description:\"Only lock the Yarn version if it isn't already locked\"});this.version=ge.String()}static{this.paths=[[\"set\",\"version\"]]}static{this.usage=ot.Usage({description:\"lock the Yarn version used by the project\",details:\"\\n      This command will set a specific release of Yarn to be used by Corepack: https://nodejs.org/api/corepack.html.\\n\\n      By default it only will set the `packageManager` field at the root of your project, but if the referenced release cannot be represented this way, if you already have `yarnPath` configured, or if you set the `--yarn-path` command line flag, then the release will also be downloaded from the Yarn GitHub repository, stored inside your project, and referenced via the `yarnPath` settings from your project `.yarnrc.yml` file.\\n\\n      A very good use case for this command is to enforce the version of Yarn used by any single member of your team inside the same project - by doing this you ensure that you have control over Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting different behavior.\\n\\n      The version specifier can be:\\n\\n      - a tag:\\n        - `latest` / `berry` / `stable` -> the most recent stable berry (`>=2.0.0`) release\\n        - `canary` -> the most recent canary (release candidate) berry (`>=2.0.0`) release\\n        - `classic` -> the most recent classic (`^0.x || ^1.x`) release\\n\\n      - a semver range (e.g. `2.x`) -> the most recent version satisfying the range (limited to berry releases)\\n\\n      - a semver version (e.g. `2.4.1`, `1.22.1`)\\n\\n      - a local file referenced through either a relative or absolute path\\n\\n      - `self` -> the version used to invoke the command\\n    \",examples:[[\"Download the latest release from the Yarn repository\",\"$0 set version latest\"],[\"Download the latest canary release from the Yarn repository\",\"$0 set version canary\"],[\"Download the latest classic release from the Yarn repository\",\"$0 set version classic\"],[\"Download the most recent Yarn 3 build\",\"$0 set version 3.x\"],[\"Download a specific Yarn 2 build\",\"$0 set version 2.0.0-rc.30\"],[\"Switch back to a specific Yarn 1 release\",\"$0 set version 1.22.1\"],[\"Use a release from the local filesystem\",\"$0 set version ./yarn.cjs\"],[\"Use a release from a URL\",\"$0 set version https://repo.yarnpkg.com/3.1.0/packages/yarnpkg-cli/bin/yarn.js\"],[\"Download the version used to invoke the command\",\"$0 set version self\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(this.onlyIfNeeded&&r.get(\"yarnPath\")){let f=r.sources.get(\"yarnPath\");if(!f)throw new Error(\"Assertion failed: Expected 'yarnPath' to have a source\");let p=r.projectCwd??r.startingCwd;if(J.contains(p,f))return 0}let s=()=>{if(typeof fn>\"u\")throw new nt(\"The --install flag can only be used without explicit version specifier from the Yarn CLI\");return`file://${process.argv[1]}`},a,n=(f,p)=>({version:p,url:f.replace(/\\{\\}/g,p)});if(this.version===\"self\")a={url:s(),version:fn??\"self\"};else if(this.version===\"latest\"||this.version===\"berry\"||this.version===\"stable\")a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",await Xv(r,\"stable\"));else if(this.version===\"canary\")a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",await Xv(r,\"canary\"));else if(this.version===\"classic\")a={url:\"https://classic.yarnpkg.com/latest.js\",version:\"classic\"};else if(this.version.match(/^https?:/))a={url:this.version,version:\"remote\"};else if(this.version.match(/^\\.{0,2}[\\\\/]/)||fe.isAbsolute(this.version))a={url:`file://${J.resolve(fe.toPortablePath(this.version))}`,version:\"file\"};else if(Fr.satisfiesWithPrereleases(this.version,\">=2.0.0\"))a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",this.version);else if(Fr.satisfiesWithPrereleases(this.version,\"^0.x || ^1.x\"))a=n(\"https://github.com/yarnpkg/yarn/releases/download/v{}/yarn-{}.js\",this.version);else if(Fr.validRange(this.version))a=n(\"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js\",await Glt(r,this.version));else throw new nt(`Invalid version descriptor \"${this.version}\"`);return(await Ot.start({configuration:r,stdout:this.context.stdout,includeLogs:!this.context.quiet},async f=>{let p=async()=>{let h=\"file://\";return a.url.startsWith(h)?(f.reportInfo(0,`Retrieving ${he.pretty(r,a.url,he.Type.PATH)}`),await ce.readFilePromise(a.url.slice(h.length))):(f.reportInfo(0,`Downloading ${he.pretty(r,a.url,he.Type.URL)}`),await ln.get(a.url,{configuration:r}))};await Jq(r,a.version,p,{report:f,useYarnPath:this.useYarnPath})})).exitCode()}};async function Glt(t,e){let s=(await ln.get(\"https://repo.yarnpkg.com/tags\",{configuration:t,jsonResponse:!0})).tags.filter(a=>Fr.satisfiesWithPrereleases(a,e));if(s.length===0)throw new nt(`No matching release found for range ${he.pretty(t,e,he.Type.RANGE)}.`);return s[0]}async function Xv(t,e){let r=await ln.get(\"https://repo.yarnpkg.com/tags\",{configuration:t,jsonResponse:!0});if(!r.latest[e])throw new nt(`Tag ${he.pretty(t,e,he.Type.RANGE)} not found`);return r.latest[e]}async function Jq(t,e,r,{report:s,useYarnPath:a}){let n,c=async()=>(typeof n>\"u\"&&(n=await r()),n);if(e===null){let ee=await c();await ce.mktempPromise(async ie=>{let ue=J.join(ie,\"yarn.cjs\");await ce.writeFilePromise(ue,ee);let{stdout:le}=await qr.execvp(process.execPath,[fe.fromPortablePath(ue),\"--version\"],{cwd:ie,env:{...t.env,YARN_IGNORE_PATH:\"1\"}});if(e=le.trim(),!pye.default.valid(e))throw new Error(`Invalid semver version. ${he.pretty(t,\"yarn --version\",he.Type.CODE)} returned:\n${e}`)})}let f=t.projectCwd??t.startingCwd,p=J.resolve(f,\".yarn/releases\"),h=J.resolve(p,`yarn-${e}.cjs`),E=J.relative(t.startingCwd,h),C=je.isTaggedYarnVersion(e),S=t.get(\"yarnPath\"),b=!C,I=b||!!S||!!a;if(a===!1){if(b)throw new jt(0,\"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack\");I=!1}else!I&&!process.env.COREPACK_ROOT&&(s.reportWarning(0,`You don't seem to have ${he.applyHyperlink(t,\"Corepack\",\"https://nodejs.org/api/corepack.html\")} enabled; we'll have to rely on ${he.applyHyperlink(t,\"yarnPath\",\"https://yarnpkg.com/configuration/yarnrc#yarnPath\")} instead`),I=!0);if(I){let ee=await c();s.reportInfo(0,`Saving the new release in ${he.pretty(t,E,\"magenta\")}`),await ce.removePromise(J.dirname(h)),await ce.mkdirPromise(J.dirname(h),{recursive:!0}),await ce.writeFilePromise(h,ee,{mode:493}),await ze.updateConfiguration(f,{yarnPath:J.relative(f,h)})}else await ce.removePromise(J.dirname(h)),await ze.updateConfiguration(f,{yarnPath:ze.deleteProperty});let T=await Ut.tryFind(f)||new Ut;T.packageManager=`yarn@${C?e:await Xv(t,\"stable\")}`;let N={};T.exportTo(N);let U=J.join(f,Ut.fileName),W=`${JSON.stringify(N,null,T.indent)}\n`;return await ce.changeFilePromise(U,W,{automaticNewlines:!0}),{bundleVersion:e}}function hye(t){return Br[jx(t)]}var qlt=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\\n\\n(?<details>(?:.(?!##))+)/gs;async function Wlt(t){let r=`https://repo.yarnpkg.com/${je.isTaggedYarnVersion(fn)?fn:await Xv(t,\"canary\")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,s=await ln.get(r,{configuration:t});return new Map(Array.from(s.toString().matchAll(qlt),({groups:a})=>{if(!a)throw new Error(\"Assertion failed: Expected the match to have been successful\");let n=hye(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected \"${a.name}\" to be named \"${n}\"`);return[a.code,a.details]}))}var IC=class extends ft{constructor(){super(...arguments);this.code=ge.String({required:!1,validator:$2(wE(),[X2(/^YN[0-9]{4}$/)])});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"explain\"]]}static{this.usage=ot.Usage({description:\"explain an error code\",details:`\n      When the code argument is specified, this command prints its name and its details.\n\n      When used without arguments, this command lists all error codes and their names.\n    `,examples:[[\"Explain an error code\",\"$0 explain YN0006\"],[\"List all error codes\",\"$0 explain\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(typeof this.code<\"u\"){let s=hye(this.code),a=he.pretty(r,s,he.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await Wlt(r)).get(this.code),p=typeof f<\"u\"?he.jsonOrPretty(this.json,r,he.tuple(he.Type.MARKDOWN,{text:f,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.\n\nYou can help us by editing this page on GitHub \\u{1F642}:\n${he.jsonOrPretty(this.json,r,he.tuple(he.Type.URL,\"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx\"))}\n`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:s,details:p})}\n`):this.context.stdout.write(`${n}\n\n${p}\n`)}else{let s={children:je.mapAndFilter(Object.entries(Br),([a,n])=>Number.isNaN(Number(a))?je.mapAndFilter.skip:{label:Yf(Number(a)),value:he.tuple(he.Type.CODE,n)})};xs.emitTree(s,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ge();Dt();Yt();var gye=ut(Go()),CC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Print versions of a package from the whole project\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Print information for all packages, including transitive dependencies\"});this.extra=ge.Array(\"-X,--extra\",[],{description:\"An array of requests of extra data provided by plugins\"});this.cache=ge.Boolean(\"--cache\",!1,{description:\"Print information about the cache entry of a package (path, size, checksum)\"});this.dependents=ge.Boolean(\"--dependents\",!1,{description:\"Print all dependents for each matching package\"});this.manifest=ge.Boolean(\"--manifest\",!1,{description:\"Print data obtained by looking at the package archive (license, homepage, ...)\"});this.nameOnly=ge.Boolean(\"--name-only\",!1,{description:\"Only print the name for the matching packages\"});this.virtuals=ge.Boolean(\"--virtuals\",!1,{description:\"Print each instance of the virtual packages\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.patterns=ge.Rest()}static{this.paths=[[\"info\"]]}static{this.usage=ot.Usage({description:\"see information related to packages\",details:\"\\n      This command prints various information related to the specified packages, accepting glob patterns.\\n\\n      By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\\n\\n      Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\\n\\n      Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\\n    \",examples:[[\"Show information about Lodash\",\"$0 info lodash\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a&&!this.all)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=new Set(this.extra);this.cache&&c.add(\"cache\"),this.dependents&&c.add(\"dependents\"),this.manifest&&c.add(\"manifest\");let f=(ie,{recursive:ue})=>{let le=ie.anchoredLocator.locatorHash,me=new Map,pe=[le];for(;pe.length>0;){let Be=pe.shift();if(me.has(Be))continue;let Ce=s.storedPackages.get(Be);if(typeof Ce>\"u\")throw new Error(\"Assertion failed: Expected the package to be registered\");if(me.set(Be,Ce),G.isVirtualLocator(Ce)&&pe.push(G.devirtualizeLocator(Ce).locatorHash),!(!ue&&Be!==le))for(let g of Ce.dependencies.values()){let we=s.storedResolutions.get(g.descriptorHash);if(typeof we>\"u\")throw new Error(\"Assertion failed: Expected the resolution to be registered\");pe.push(we)}}return me.values()},p=({recursive:ie})=>{let ue=new Map;for(let le of s.workspaces)for(let me of f(le,{recursive:ie}))ue.set(me.locatorHash,me);return ue.values()},h=({all:ie,recursive:ue})=>ie&&ue?s.storedPackages.values():ie?p({recursive:ue}):f(a,{recursive:ue}),E=({all:ie,recursive:ue})=>{let le=h({all:ie,recursive:ue}),me=this.patterns.map(Ce=>{let g=G.parseLocator(Ce),we=gye.default.makeRe(G.stringifyIdent(g)),ye=G.isVirtualLocator(g),Ae=ye?G.devirtualizeLocator(g):g;return se=>{let X=G.stringifyIdent(se);if(!we.test(X))return!1;if(g.reference===\"unknown\")return!0;let De=G.isVirtualLocator(se),Te=De?G.devirtualizeLocator(se):se;return!(ye&&De&&g.reference!==se.reference||Ae.reference!==Te.reference)}}),pe=je.sortMap([...le],Ce=>G.stringifyLocator(Ce));return{selection:pe.filter(Ce=>me.length===0||me.some(g=>g(Ce))),sortedLookup:pe}},{selection:C,sortedLookup:S}=E({all:this.all,recursive:this.recursive});if(C.length===0)throw new nt(\"No package matched your request\");let b=new Map;if(this.dependents)for(let ie of S)for(let ue of ie.dependencies.values()){let le=s.storedResolutions.get(ue.descriptorHash);if(typeof le>\"u\")throw new Error(\"Assertion failed: Expected the resolution to be registered\");je.getArrayWithDefault(b,le).push(ie)}let I=new Map;for(let ie of S){if(!G.isVirtualLocator(ie))continue;let ue=G.devirtualizeLocator(ie);je.getArrayWithDefault(I,ue.locatorHash).push(ie)}let T={},N={children:T},U=r.makeFetcher(),W={project:s,fetcher:U,cache:n,checksums:s.storedChecksums,report:new ki,cacheOptions:{skipIntegrityCheck:!0}},ee=[async(ie,ue,le)=>{if(!ue.has(\"manifest\"))return;let me=await U.fetch(ie,W),pe;try{pe=await Ut.find(me.prefixPath,{baseFs:me.packageFs})}finally{me.releaseFs?.()}le(\"Manifest\",{License:he.tuple(he.Type.NO_HINT,pe.license),Homepage:he.tuple(he.Type.URL,pe.raw.homepage??null)})},async(ie,ue,le)=>{if(!ue.has(\"cache\"))return;let me=s.storedChecksums.get(ie.locatorHash)??null,pe=n.getLocatorPath(ie,me),Be;if(pe!==null)try{Be=await ce.statPromise(pe)}catch{}let Ce=typeof Be<\"u\"?[Be.size,he.Type.SIZE]:void 0;le(\"Cache\",{Checksum:he.tuple(he.Type.NO_HINT,me),Path:he.tuple(he.Type.PATH,pe),Size:Ce})}];for(let ie of C){let ue=G.isVirtualLocator(ie);if(!this.virtuals&&ue)continue;let le={},me={value:[ie,he.Type.LOCATOR],children:le};if(T[G.stringifyLocator(ie)]=me,this.nameOnly){delete me.children;continue}let pe=I.get(ie.locatorHash);typeof pe<\"u\"&&(le.Instances={label:\"Instances\",value:he.tuple(he.Type.NUMBER,pe.length)}),le.Version={label:\"Version\",value:he.tuple(he.Type.NO_HINT,ie.version)};let Be=(g,we)=>{let ye={};if(le[g]=ye,Array.isArray(we))ye.children=we.map(Ae=>({value:Ae}));else{let Ae={};ye.children=Ae;for(let[se,X]of Object.entries(we))typeof X>\"u\"||(Ae[se]={label:se,value:X})}};if(!ue){for(let g of ee)await g(ie,c,Be);await r.triggerHook(g=>g.fetchPackageInfo,ie,c,Be)}ie.bin.size>0&&!ue&&Be(\"Exported Binaries\",[...ie.bin.keys()].map(g=>he.tuple(he.Type.PATH,g)));let Ce=b.get(ie.locatorHash);typeof Ce<\"u\"&&Ce.length>0&&Be(\"Dependents\",Ce.map(g=>he.tuple(he.Type.LOCATOR,g))),ie.dependencies.size>0&&!ue&&Be(\"Dependencies\",[...ie.dependencies.values()].map(g=>{let we=s.storedResolutions.get(g.descriptorHash),ye=typeof we<\"u\"?s.storedPackages.get(we)??null:null;return he.tuple(he.Type.RESOLUTION,{descriptor:g,locator:ye})})),ie.peerDependencies.size>0&&ue&&Be(\"Peer dependencies\",[...ie.peerDependencies.values()].map(g=>{let we=ie.dependencies.get(g.identHash),ye=typeof we<\"u\"?s.storedResolutions.get(we.descriptorHash)??null:null,Ae=ye!==null?s.storedPackages.get(ye)??null:null;return he.tuple(he.Type.RESOLUTION,{descriptor:g,locator:Ae})}))}xs.emitTree(N,{configuration:r,json:this.json,stdout:this.context.stdout,separators:this.nameOnly?0:2})}};Ge();Dt();wc();var rF=ut(Fd());Yt();var Kq=ut(Ai());Ul();var Ylt=[{selector:t=>t===-1,name:\"nodeLinker\",value:\"node-modules\"},{selector:t=>t!==-1&&t<8,name:\"enableGlobalCache\",value:!1},{selector:t=>t!==-1&&t<8,name:\"compressionLevel\",value:\"mixed\"}],wC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.immutable=ge.Boolean(\"--immutable\",{description:\"Abort with an error exit code if the lockfile was to be modified\"});this.immutableCache=ge.Boolean(\"--immutable-cache\",{description:\"Abort with an error exit code if the cache folder was to be modified\"});this.refreshLockfile=ge.Boolean(\"--refresh-lockfile\",{description:\"Refresh the package metadata stored in the lockfile\"});this.checkCache=ge.Boolean(\"--check-cache\",{description:\"Always refetch the packages and ensure that their checksums are consistent\"});this.checkResolutions=ge.Boolean(\"--check-resolutions\",{description:\"Validates that the package resolutions are coherent\"});this.inlineBuilds=ge.Boolean(\"--inline-builds\",{description:\"Verbosely print the output of the build steps of dependencies\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.cacheFolder=ge.String(\"--cache-folder\",{hidden:!0});this.frozenLockfile=ge.Boolean(\"--frozen-lockfile\",{hidden:!0});this.ignoreEngines=ge.Boolean(\"--ignore-engines\",{hidden:!0});this.nonInteractive=ge.Boolean(\"--non-interactive\",{hidden:!0});this.preferOffline=ge.Boolean(\"--prefer-offline\",{hidden:!0});this.production=ge.Boolean(\"--production\",{hidden:!0});this.registry=ge.String(\"--registry\",{hidden:!0});this.silent=ge.Boolean(\"--silent\",{hidden:!0});this.networkTimeout=ge.String(\"--network-timeout\",{hidden:!0})}static{this.paths=[[\"install\"],ot.Default]}static{this.usage=ot.Usage({description:\"install the project dependencies\",details:\"\\n      This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:\\n\\n      - **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).\\n\\n      - **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of `cacheFolder` in `yarn config` to see where the cache files are stored).\\n\\n      - **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the `.pnp.cjs` file you might know).\\n\\n      - **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail.\\n\\n      Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your `.pnp.cjs` file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.\\n\\n      If the `--immutable` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the `immutablePatterns` configuration setting). For backward compatibility we offer an alias under the name of `--frozen-lockfile`, but it will be removed in a later release.\\n\\n      If the `--immutable-cache` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).\\n\\n      If the `--refresh-lockfile` option is set, Yarn will keep the same resolution for the packages currently in the lockfile but will refresh their metadata. If used together with `--immutable`, it can validate that the lockfile information are consistent. This flag is enabled by default when Yarn detects it runs within a pull request context.\\n\\n      If the `--check-cache` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.\\n\\n      If the `--inline-builds` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n    \",examples:[[\"Install the project\",\"$0 install\"],[\"Validate a project when using Zero-Installs\",\"$0 install --immutable --immutable-cache\"],[\"Validate a project when using Zero-Installs (slightly safer if you accept external PRs)\",\"$0 install --immutable --immutable-cache --check-cache\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);typeof this.inlineBuilds<\"u\"&&r.useWithSource(\"<cli>\",{enableInlineBuilds:this.inlineBuilds},r.startingCwd,{overwrite:!0});let s=!!process.env.FUNCTION_TARGET||!!process.env.GOOGLE_RUNTIME,a=await SI({configuration:r,stdout:this.context.stdout},[{option:this.ignoreEngines,message:\"The --ignore-engines option is deprecated; engine checking isn't a core feature anymore\",error:!rF.default.VERCEL},{option:this.registry,message:\"The --registry option is deprecated; prefer setting npmRegistryServer in your .yarnrc.yml file\"},{option:this.preferOffline,message:\"The --prefer-offline flag is deprecated; use the --cached flag with 'yarn add' instead\",error:!rF.default.VERCEL},{option:this.production,message:\"The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead\",error:!0},{option:this.nonInteractive,message:\"The --non-interactive option is deprecated\",error:!s},{option:this.frozenLockfile,message:\"The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead\",callback:()=>this.immutable=this.frozenLockfile},{option:this.cacheFolder,message:\"The cache-folder option has been deprecated; use rc settings instead\",error:!rF.default.NETLIFY}]);if(a!==null)return a;let n=this.mode===\"update-lockfile\";if(n&&(this.immutable||this.immutableCache))throw new nt(`${he.pretty(r,\"--immutable\",he.Type.CODE)} and ${he.pretty(r,\"--immutable-cache\",he.Type.CODE)} cannot be used with ${he.pretty(r,\"--mode=update-lockfile\",he.Type.CODE)}`);let c=(this.immutable??r.get(\"enableImmutableInstalls\"))&&!n,f=this.immutableCache&&!n;if(r.projectCwd!==null){let T=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{let U=!1;await Klt(r,c)&&(N.reportInfo(48,\"Automatically removed core plugins that are now builtins \\u{1F44D}\"),U=!0),await Jlt(r,c)&&(N.reportInfo(48,\"Automatically fixed merge conflicts \\u{1F44D}\"),U=!0),U&&N.reportSeparator()});if(T.hasErrors())return T.exitCode()}if(r.projectCwd!==null){let T=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{if(ze.telemetry?.isNew)ze.telemetry.commitTips(),N.reportInfo(65,\"Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry\"),N.reportInfo(65,`Run ${he.pretty(r,\"yarn config set --home enableTelemetry 0\",he.Type.CODE)} to disable`),N.reportSeparator();else if(ze.telemetry?.shouldShowTips){let U=await ln.get(\"https://repo.yarnpkg.com/tags\",{configuration:r,jsonResponse:!0}).catch(()=>null);if(U!==null){let W=null;if(fn!==null){let ie=Kq.default.prerelease(fn)?\"canary\":\"stable\",ue=U.latest[ie];Kq.default.gt(ue,fn)&&(W=[ie,ue])}if(W)ze.telemetry.commitTips(),N.reportInfo(88,`${he.applyStyle(r,`A new ${W[0]} version of Yarn is available:`,he.Style.BOLD)} ${G.prettyReference(r,W[1])}!`),N.reportInfo(88,`Upgrade now by running ${he.pretty(r,`yarn set version ${W[1]}`,he.Type.CODE)}`),N.reportSeparator();else{let ee=ze.telemetry.selectTip(U.tips);ee&&(N.reportInfo(89,he.pretty(r,ee.message,he.Type.MARKDOWN_INLINE)),ee.url&&N.reportInfo(89,`Learn more at ${ee.url}`),N.reportSeparator())}}}});if(T.hasErrors())return T.exitCode()}let{project:p,workspace:h}=await Rt.find(r,this.context.cwd),E=p.lockfileLastVersion;if(E!==null){let T=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{let U={};for(let W of Ylt)W.selector(E)&&typeof r.sources.get(W.name)>\"u\"&&(r.use(\"<compat>\",{[W.name]:W.value},p.cwd,{overwrite:!0}),U[W.name]=W.value);Object.keys(U).length>0&&(await ze.updateConfiguration(p.cwd,U),N.reportInfo(87,\"Migrated your project to the latest Yarn version \\u{1F680}\"),N.reportSeparator())});if(T.hasErrors())return T.exitCode()}let C=await Kr.find(r,{immutable:f,check:this.checkCache});if(!h)throw new ar(p.cwd,this.context.cwd);await p.restoreInstallState({restoreResolutions:!1});let S=r.get(\"enableHardenedMode\");S&&typeof r.sources.get(\"enableHardenedMode\")>\"u\"&&await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async T=>{T.reportWarning(0,\"Yarn detected that the current workflow is executed from a public pull request. For safety the hardened mode has been enabled.\"),T.reportWarning(0,`It will prevent malicious lockfile manipulations, in exchange for a slower install time. You can opt-out if necessary; check our ${he.applyHyperlink(r,\"documentation\",\"https://yarnpkg.com/features/security#hardened-mode\")} for more details.`),T.reportSeparator()}),(this.refreshLockfile??S)&&(p.lockfileNeedsRefresh=!0);let b=this.checkResolutions??S;return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,forceSectionAlignment:!0,includeLogs:!0,includeVersion:!0},async T=>{await p.install({cache:C,report:T,immutable:c,checkResolutions:b,mode:this.mode})})).exitCode()}},Vlt=\"<<<<<<<\";async function Jlt(t,e){if(!t.projectCwd)return!1;let r=J.join(t.projectCwd,Er.lockfile);if(!await ce.existsPromise(r)||!(await ce.readFilePromise(r,\"utf8\")).includes(Vlt))return!1;if(e)throw new jt(47,\"Cannot autofix a lockfile when running an immutable install\");let a=await qr.execvp(\"git\",[\"rev-parse\",\"MERGE_HEAD\",\"HEAD\"],{cwd:t.projectCwd});if(a.code!==0&&(a=await qr.execvp(\"git\",[\"rev-parse\",\"REBASE_HEAD\",\"HEAD\"],{cwd:t.projectCwd})),a.code!==0&&(a=await qr.execvp(\"git\",[\"rev-parse\",\"CHERRY_PICK_HEAD\",\"HEAD\"],{cwd:t.projectCwd})),a.code!==0)throw new jt(83,\"Git returned an error when trying to find the commits pertaining to the conflict\");let n=await Promise.all(a.stdout.trim().split(/\\n/).map(async f=>{let p=await qr.execvp(\"git\",[\"show\",`${f}:./${Er.lockfile}`],{cwd:t.projectCwd});if(p.code!==0)throw new jt(83,`Git returned an error when trying to access the lockfile content in ${f}`);try{return as(p.stdout)}catch{throw new jt(46,\"A variant of the conflicting lockfile failed to parse\")}}));n=n.filter(f=>!!f.__metadata);for(let f of n){if(f.__metadata.version<7)for(let p of Object.keys(f)){if(p===\"__metadata\")continue;let h=G.parseDescriptor(p,!0),E=t.normalizeDependency(h),C=G.stringifyDescriptor(E);C!==p&&(f[C]=f[p],delete f[p])}for(let p of Object.keys(f)){if(p===\"__metadata\")continue;let h=f[p].checksum;typeof h>\"u\"||h.includes(\"/\")||(f[p].checksum=`${f.__metadata.cacheKey}/${h}`)}}let c=Object.assign({},...n);c.__metadata.version=`${Math.min(...n.map(f=>parseInt(f.__metadata.version??0)))}`,c.__metadata.cacheKey=\"merged\";for(let[f,p]of Object.entries(c))typeof p==\"string\"&&delete c[f];return await ce.changeFilePromise(r,nl(c),{automaticNewlines:!0}),!0}async function Klt(t,e){if(!t.projectCwd)return!1;let r=[],s=J.join(t.projectCwd,\".yarn/plugins/@yarnpkg\");return await ze.updateConfiguration(t.projectCwd,{plugins:n=>{if(!Array.isArray(n))return n;let c=n.filter(f=>{if(!f.path)return!0;let p=J.resolve(t.projectCwd,f.path),h=ov.has(f.spec)&&J.contains(s,p);return h&&r.push(p),!h});return c.length===0?ze.deleteProperty:c.length===n.length?n:c}},{immutable:e})?(await Promise.all(r.map(async n=>{await ce.removePromise(n)})),!0):!1}Ge();Dt();Yt();var BC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Link all workspaces belonging to the target projects to the current one\"});this.private=ge.Boolean(\"-p,--private\",!1,{description:\"Also link private workspaces belonging to the target projects to the current one\"});this.relative=ge.Boolean(\"-r,--relative\",!1,{description:\"Link workspaces using relative paths instead of absolute paths\"});this.destinations=ge.Rest()}static{this.paths=[[\"link\"]]}static{this.usage=ot.Usage({description:\"connect the local project to another one\",details:\"\\n      This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\\n    \",examples:[[\"Register one or more remote workspaces for use in the current project\",\"$0 link ~/ts-loader ~/jest\"],[\"Register all workspaces from a remote project for use in the current project\",\"$0 link ~/jest --all\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=s.topLevelWorkspace,f=[];for(let p of this.destinations){let h=J.resolve(this.context.cwd,fe.toPortablePath(p)),E=await ze.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Rt.find(E,h);if(s.cwd===C.cwd)throw new nt(`Invalid destination '${p}'; Can't link the project to itself`);if(!S)throw new ar(C.cwd,h);if(this.all){let b=!1;for(let I of C.workspaces)I.manifest.name&&(!I.manifest.private||this.private)&&(f.push(I),b=!0);if(!b)throw new nt(`No workspace found to be linked in the target project: ${p}`)}else{if(!S.manifest.name)throw new nt(`The target workspace at '${p}' doesn't have a name and thus cannot be linked`);if(S.manifest.private&&!this.private)throw new nt(`The target workspace at '${p}' is marked private - use the --private flag to link it anyway`);f.push(S)}}for(let p of f){let h=G.stringifyIdent(p.anchoredLocator),E=this.relative?J.relative(s.cwd,p.cwd):p.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${E}`})}return await s.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Yt();var vC=class extends ft{constructor(){super(...arguments);this.args=ge.Proxy()}static{this.paths=[[\"node\"]]}static{this.usage=ot.Usage({description:\"run node with the hook already setup\",details:`\n      This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).\n\n      The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.\n    `,examples:[[\"Run a Node script\",\"$0 node ./my-script.js\"]]})}async execute(){return this.cli.run([\"exec\",\"node\",...this.args])}};Ge();Yt();var SC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"plugin\",\"check\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"find all third-party plugins that differ from their own spec\",details:`\n      Check only the plugins from https.\n\n      If this command detects any plugin differences in the CI environment, it will throw an error.\n    `,examples:[[\"find all third-party plugins that differ from their own spec\",\"$0 plugin check\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=await ze.findRcFiles(this.context.cwd);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let c of s)if(c.data?.plugins)for(let f of c.data.plugins){if(!f.checksum||!f.spec.match(/^https?:/))continue;let p=await ln.get(f.spec,{configuration:r}),h=Nn.makeHash(p);if(f.checksum===h)continue;let E=he.pretty(r,f.path,he.Type.PATH),C=he.pretty(r,f.spec,he.Type.URL),S=`${E} is different from the file provided by ${C}`;n.reportJson({...f,newChecksum:h}),n.reportError(0,S)}})).exitCode()}};Ge();Ge();Dt();Yt();var Iye=Ie(\"os\");Ge();Dt();Yt();var dye=Ie(\"os\");Ge();wc();Yt();var zlt=\"https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml\";async function Sm(t,e){let r=await ln.get(zlt,{configuration:t}),s=as(r.toString());return Object.fromEntries(Object.entries(s).filter(([a,n])=>!e||Fr.satisfiesWithPrereleases(e,n.range??\"<4.0.0-rc.1\")))}var DC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"plugin\",\"list\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"list the available official plugins\",details:\"\\n      This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\\n    \",examples:[[\"List the official plugins\",\"$0 plugin list\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Sm(r,fn);for(let[c,{experimental:f,...p}]of Object.entries(n)){let h=c;f&&(h+=\" [experimental]\"),a.reportJson({name:c,experimental:f,...p}),a.reportInfo(null,h)}})).exitCode()}};var Zlt=/^[0-9]+$/,Xlt=process.platform===\"win32\";function mye(t){return Zlt.test(t)?`pull/${t}/head`:t}var $lt=({repository:t,branch:e},r)=>[[\"git\",\"init\",fe.fromPortablePath(r)],[\"git\",\"remote\",\"add\",\"origin\",t],[\"git\",\"fetch\",\"origin\",\"--depth=1\",mye(e)],[\"git\",\"reset\",\"--hard\",\"FETCH_HEAD\"]],ect=({branch:t})=>[[\"git\",\"fetch\",\"origin\",\"--depth=1\",mye(t),\"--force\"],[\"git\",\"reset\",\"--hard\",\"FETCH_HEAD\"],[\"git\",\"clean\",\"-dfx\",\"-e\",\"packages/yarnpkg-cli/bundles\"]],tct=({plugins:t,noMinify:e},r,s)=>[[\"yarn\",\"build:cli\",...new Array().concat(...t.map(a=>[\"--plugin\",J.resolve(s,a)])),...e?[\"--no-minify\"]:[],\"|\"],[Xlt?\"move\":\"mv\",\"packages/yarnpkg-cli/bundles/yarn.js\",fe.fromPortablePath(r),\"|\"]],PC=class extends ft{constructor(){super(...arguments);this.installPath=ge.String(\"--path\",{description:\"The path where the repository should be cloned to\"});this.repository=ge.String(\"--repository\",\"https://github.com/yarnpkg/berry.git\",{description:\"The repository that should be cloned\"});this.branch=ge.String(\"--branch\",\"master\",{description:\"The branch of the repository that should be cloned\"});this.plugins=ge.Array(\"--plugin\",[],{description:\"An array of additional plugins that should be included in the bundle\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"If set, the bundle will be built but not added to the project\"});this.noMinify=ge.Boolean(\"--no-minify\",!1,{description:\"Build a bundle for development (debugging) - non-minified and non-mangled\"});this.force=ge.Boolean(\"-f,--force\",!1,{description:\"Always clone the repository instead of trying to fetch the latest commits\"});this.skipPlugins=ge.Boolean(\"--skip-plugins\",!1,{description:\"Skip updating the contrib plugins\"})}static{this.paths=[[\"set\",\"version\",\"from\",\"sources\"]]}static{this.usage=ot.Usage({description:\"build Yarn from master\",details:`\n      This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.\n\n      By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \\`--skip-plugins\\` flag.\n    `,examples:[[\"Build Yarn from master\",\"$0 set version from sources\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd),a=typeof this.installPath<\"u\"?J.resolve(this.context.cwd,fe.toPortablePath(this.installPath)):J.resolve(fe.toPortablePath((0,dye.tmpdir)()),\"yarnpkg-sources\",Nn.makeHash(this.repository).slice(0,6));return(await Ot.start({configuration:r,stdout:this.context.stdout},async c=>{await zq(this,{configuration:r,report:c,target:a}),c.reportSeparator(),c.reportInfo(0,\"Building a fresh bundle\"),c.reportSeparator();let f=await qr.execvp(\"git\",[\"rev-parse\",\"--short\",\"HEAD\"],{cwd:a,strict:!0}),p=J.join(a,`packages/yarnpkg-cli/bundles/yarn-${f.stdout.trim()}.js`);ce.existsSync(p)||(await $v(tct(this,p,a),{configuration:r,context:this.context,target:a}),c.reportSeparator());let h=await ce.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await Jq(r,null,async()=>h,{report:c});this.skipPlugins||await rct(this,E,{project:s,report:c,target:a})}})).exitCode()}};async function $v(t,{configuration:e,context:r,target:s}){for(let[a,...n]of t){let c=n[n.length-1]===\"|\";if(c&&n.pop(),c)await qr.pipevp(a,n,{cwd:s,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${he.pretty(e,`  $ ${[a,...n].join(\" \")}`,\"grey\")}\n`);try{await qr.execvp(a,n,{cwd:s,strict:!0})}catch(f){throw r.stdout.write(f.stdout||f.stack),f}}}}async function zq(t,{configuration:e,report:r,target:s}){let a=!1;if(!t.force&&ce.existsSync(J.join(s,\".git\"))){r.reportInfo(0,\"Fetching the latest commits\"),r.reportSeparator();try{await $v(ect(t),{configuration:e,context:t.context,target:s}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,\"Repository update failed; we'll try to regenerate it\")}}a||(r.reportInfo(0,\"Cloning the remote repository\"),r.reportSeparator(),await ce.removePromise(s),await ce.mkdirPromise(s,{recursive:!0}),await $v($lt(t,s),{configuration:e,context:t.context,target:s}))}async function rct(t,e,{project:r,report:s,target:a}){let n=await Sm(r.configuration,e),c=new Set(Object.keys(n));for(let f of r.configuration.plugins.keys())c.has(f)&&await Zq(f,t,{project:r,report:s,target:a})}Ge();Ge();Dt();Yt();var yye=ut(Ai()),Eye=Ie(\"vm\");var bC=class extends ft{constructor(){super(...arguments);this.name=ge.String();this.checksum=ge.Boolean(\"--checksum\",!0,{description:\"Whether to care if this plugin is modified\"})}static{this.paths=[[\"plugin\",\"import\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"download a plugin\",details:`\n      This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.\n\n      Three types of plugin references are accepted:\n\n      - If the plugin is stored within the Yarn repository, it can be referenced by name.\n      - Third-party plugins can be referenced directly through their public urls.\n      - Local plugins can be referenced by their path on the disk.\n\n      If the \\`--no-checksum\\` option is set, Yarn will no longer care if the plugin is modified.\n\n      Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \\`@yarnpkg/builder\\` package).\n    `,examples:[['Download and activate the \"@yarnpkg/plugin-exec\" plugin',\"$0 plugin import @yarnpkg/plugin-exec\"],['Download and activate the \"@yarnpkg/plugin-exec\" plugin (shorthand)',\"$0 plugin import exec\"],[\"Download and activate a community plugin\",\"$0 plugin import https://example.org/path/to/plugin.js\"],[\"Activate a local plugin\",\"$0 plugin import ./path/to/plugin.js\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await Rt.find(r,this.context.cwd),c,f;if(this.name.match(/^\\.{0,2}[\\\\/]/)||fe.isAbsolute(this.name)){let p=J.resolve(this.context.cwd,fe.toPortablePath(this.name));a.reportInfo(0,`Reading ${he.pretty(r,p,he.Type.PATH)}`),c=J.relative(n.cwd,p),f=await ce.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new jt(52,`Plugin specifier \"${this.name}\" is neither a plugin name nor a valid url`)}c=this.name,p=this.name}else{let h=G.parseLocator(this.name.replace(/^((@yarnpkg\\/)?plugin-)?/,\"@yarnpkg/plugin-\"));if(h.reference!==\"unknown\"&&!yye.default.valid(h.reference))throw new jt(0,\"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.\");let E=G.stringifyIdent(h),C=await Sm(r,fn);if(!Object.hasOwn(C,E)){let S=`Couldn't find a plugin named ${G.prettyIdent(r,h)} on the remote registry.\n`;throw r.plugins.has(E)?S+=`A plugin named ${G.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:S+=`Note that only the plugins referenced on our website (${he.pretty(r,\"https://github.com/yarnpkg/berry/blob/master/plugins.yml\",he.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${he.pretty(r,\"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js\",he.Type.URL)}).`,new jt(51,S)}c=E,p=C[E].url,h.reference!==\"unknown\"?p=p.replace(/\\/master\\//,`/${E}/${h.reference}/`):fn!==null&&(p=p.replace(/\\/master\\//,`/@yarnpkg/cli/${fn}/`))}a.reportInfo(0,`Downloading ${he.pretty(r,p,\"green\")}`),f=await ln.get(p,{configuration:r})}await Xq(c,f,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function Xq(t,e,{checksum:r=!0,project:s,report:a}){let{configuration:n}=s,c={},f={exports:c};(0,Eye.runInNewContext)(e.toString(),{module:f,exports:c});let h=`.yarn/plugins/${f.exports.name}.cjs`,E=J.resolve(s.cwd,h);a.reportInfo(0,`Saving the new plugin in ${he.pretty(n,h,\"magenta\")}`),await ce.mkdirPromise(J.dirname(E),{recursive:!0}),await ce.writeFilePromise(E,e);let C={path:h,spec:t};r&&(C.checksum=Nn.makeHash(e)),await ze.addPlugin(s.cwd,[C])}var nct=({pluginName:t,noMinify:e},r)=>[[\"yarn\",`build:${t}`,...e?[\"--no-minify\"]:[],\"|\"]],xC=class extends ft{constructor(){super(...arguments);this.installPath=ge.String(\"--path\",{description:\"The path where the repository should be cloned to\"});this.repository=ge.String(\"--repository\",\"https://github.com/yarnpkg/berry.git\",{description:\"The repository that should be cloned\"});this.branch=ge.String(\"--branch\",\"master\",{description:\"The branch of the repository that should be cloned\"});this.noMinify=ge.Boolean(\"--no-minify\",!1,{description:\"Build a plugin for development (debugging) - non-minified and non-mangled\"});this.force=ge.Boolean(\"-f,--force\",!1,{description:\"Always clone the repository instead of trying to fetch the latest commits\"});this.name=ge.String()}static{this.paths=[[\"plugin\",\"import\",\"from\",\"sources\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"build a plugin from sources\",details:`\n      This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.\n\n      The plugins can be referenced by their short name if sourced from the official Yarn repository.\n    `,examples:[['Build and activate the \"@yarnpkg/plugin-exec\" plugin',\"$0 plugin import from sources @yarnpkg/plugin-exec\"],['Build and activate the \"@yarnpkg/plugin-exec\" plugin (shorthand)',\"$0 plugin import from sources exec\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=typeof this.installPath<\"u\"?J.resolve(this.context.cwd,fe.toPortablePath(this.installPath)):J.resolve(fe.toPortablePath((0,Iye.tmpdir)()),\"yarnpkg-sources\",Nn.makeHash(this.repository).slice(0,6));return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:c}=await Rt.find(r,this.context.cwd),f=G.parseIdent(this.name.replace(/^((@yarnpkg\\/)?plugin-)?/,\"@yarnpkg/plugin-\")),p=G.stringifyIdent(f),h=await Sm(r,fn);if(!Object.hasOwn(h,p))throw new jt(51,`Couldn't find a plugin named \"${p}\" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await zq(this,{configuration:r,report:n,target:s}),await Zq(E,this,{project:c,report:n,target:s})})).exitCode()}};async function Zq(t,{context:e,noMinify:r},{project:s,report:a,target:n}){let c=t.replace(/@yarnpkg\\//,\"\"),{configuration:f}=s;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${c}`),a.reportSeparator(),await $v(nct({pluginName:c,noMinify:r},n),{configuration:f,context:e,target:n}),a.reportSeparator();let p=J.resolve(n,`packages/${c}/bundles/${t}.js`),h=await ce.readFilePromise(p);await Xq(t,h,{project:s,report:a})}Ge();Dt();Yt();var kC=class extends ft{constructor(){super(...arguments);this.name=ge.String()}static{this.paths=[[\"plugin\",\"remove\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"remove a plugin\",details:`\n      This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.\n\n      **Note:** The plugins have to be referenced by their name property, which can be obtained using the \\`yarn plugin runtime\\` command. Shorthands are not allowed.\n   `,examples:[[\"Remove a plugin imported from the Yarn repository\",\"$0 plugin remove @yarnpkg/plugin-typescript\"],[\"Remove a plugin imported from a local file\",\"$0 plugin remove my-local-plugin\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=G.parseIdent(c);if(!r.plugins.has(c))throw new nt(`${G.prettyIdent(r,f)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${c}.cjs`,h=J.resolve(s.cwd,p);ce.existsSync(h)&&(n.reportInfo(0,`Removing ${he.pretty(r,p,he.Type.PATH)}...`),await ce.removePromise(h)),n.reportInfo(0,\"Updating the configuration...\"),await ze.updateConfiguration(s.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let C=E.filter(S=>S.path!==p);return C.length===0?ze.deleteProperty:C.length===E.length?E:C}})})).exitCode()}};Ge();Yt();var QC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"plugin\",\"runtime\"]]}static{this.usage=ot.Usage({category:\"Plugin-related commands\",description:\"list the active plugins\",details:`\n      This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.\n    `,examples:[[\"List the currently active plugins\",\"$0 plugin runtime\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let c=this.context.plugins.plugins.has(n),f=n;c&&(f+=\" [builtin]\"),a.reportJson({name:n,builtin:c}),a.reportInfo(null,`${f}`)}})).exitCode()}};Ge();Ge();Yt();var RC=class extends ft{constructor(){super(...arguments);this.idents=ge.Rest()}static{this.paths=[[\"rebuild\"]]}static{this.usage=ot.Usage({description:\"rebuild the project's native packages\",details:`\n      This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.\n\n      Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).\n\n      By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.\n    `,examples:[[\"Rebuild all packages\",\"$0 rebuild\"],[\"Rebuild fsevents only\",\"$0 rebuild fsevents\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=new Set;for(let f of this.idents)c.add(G.parseIdent(f).identHash);if(await s.restoreInstallState({restoreResolutions:!1}),await s.resolveEverything({cache:n,report:new ki}),c.size>0)for(let f of s.storedPackages.values())c.has(f.identHash)&&(s.storedBuildState.delete(f.locatorHash),s.skippedBuilds.delete(f.locatorHash));else s.storedBuildState.clear(),s.skippedBuilds.clear();return await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();Yt();var $q=ut(Go());Ul();var TC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Apply the operation to all workspaces from the current project\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.patterns=ge.Rest()}static{this.paths=[[\"remove\"]]}static{this.usage=ot.Usage({description:\"remove dependencies from the project\",details:`\n      This command will remove the packages matching the specified patterns from the current workspace.\n\n      If the \\`--mode=<mode>\\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n      - \\`skip-build\\` will not run the build scripts at all. Note that this is different from setting \\`enableScripts\\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n      - \\`update-lockfile\\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n      This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n    `,examples:[[\"Remove a dependency from the current project\",\"$0 remove lodash\"],[\"Remove a dependency from all workspaces at once\",\"$0 remove lodash --all\"],[\"Remove all dependencies starting with `eslint-`\",\"$0 remove 'eslint-*'\"],[\"Remove all dependencies with the `@babel` scope\",\"$0 remove '@babel/*'\"],[\"Remove all dependencies matching `react-dom` or `react-helmet`\",\"$0 remove 'react-{dom,helmet}'\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.all?s.workspaces:[a],f=[\"dependencies\",\"devDependencies\",\"peerDependencies\"],p=[],h=!1,E=[];for(let I of this.patterns){let T=!1,N=G.parseIdent(I);for(let U of c){let W=[...U.manifest.peerDependenciesMeta.keys()];for(let ee of(0,$q.default)(W,I))U.manifest.peerDependenciesMeta.delete(ee),h=!0,T=!0;for(let ee of f){let ie=U.manifest.getForScope(ee),ue=[...ie.values()].map(le=>G.stringifyIdent(le));for(let le of(0,$q.default)(ue,G.stringifyIdent(N))){let{identHash:me}=G.parseIdent(le),pe=ie.get(me);if(typeof pe>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");U.manifest[ee].delete(me),E.push([U,ee,pe]),h=!0,T=!0}}}T||p.push(I)}let C=p.length>1?\"Patterns\":\"Pattern\",S=p.length>1?\"don't\":\"doesn't\",b=this.all?\"any\":\"this\";if(p.length>0)throw new nt(`${C} ${he.prettyList(r,p,he.Type.CODE)} ${S} match any packages referenced by ${b} workspace`);return h?(await r.triggerMultipleHooks(I=>I.afterWorkspaceDependencyRemoval,E),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ge();Ge();Yt();var Cye=Ie(\"util\"),FC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"run\"]]}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async c=>{let f=a.manifest.scripts,p=je.sortMap(f.keys(),C=>C),h={breakLength:1/0,colors:r.get(\"enableColors\"),maxArrayLength:2},E=p.reduce((C,S)=>Math.max(C,S.length),0);for(let[C,S]of f.entries())c.reportInfo(null,`${C.padEnd(E,\" \")}   ${(0,Cye.inspect)(S,h)}`),c.reportJson({name:C,script:S})})).exitCode()}};Ge();Ge();Yt();var NC=class extends ft{constructor(){super(...arguments);this.inspect=ge.String(\"--inspect\",!1,{tolerateBoolean:!0,description:\"Forwarded to the underlying Node process when executing a binary\"});this.inspectBrk=ge.String(\"--inspect-brk\",!1,{tolerateBoolean:!0,description:\"Forwarded to the underlying Node process when executing a binary\"});this.topLevel=ge.Boolean(\"-T,--top-level\",!1,{description:\"Check the root workspace for scripts and/or binaries instead of the current one\"});this.binariesOnly=ge.Boolean(\"-B,--binaries-only\",!1,{description:\"Ignore any user defined scripts and only check for binaries\"});this.require=ge.String(\"--require\",{description:\"Forwarded to the underlying Node process when executing a binary\"});this.silent=ge.Boolean(\"--silent\",{hidden:!0});this.scriptName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"run\"]]}static{this.usage=ot.Usage({description:\"run a script defined in the package.json\",details:`\n      This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:\n\n      - If the \\`scripts\\` field from your local package.json contains a matching script name, its definition will get executed.\n\n      - Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.\n\n      - Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.\n\n      Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).\n    `,examples:[[\"Run the tests from the local workspace\",\"$0 run test\"],['Same thing, but without the \"run\" keyword',\"$0 test\"],[\"Inspect Webpack while running\",\"$0 run --inspect-brk webpack\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a,locator:n}=await Rt.find(r,this.context.cwd);await s.restoreInstallState();let c=this.topLevel?s.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await In.hasPackageScript(c,this.scriptName,{project:s}))return await In.executePackageScript(c,this.scriptName,this.args,{project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let f=await In.getPackageAccessibleBinaries(c,{project:s});if(f.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect==\"string\"?h.push(`--inspect=${this.inspect}`):h.push(\"--inspect\")),this.inspectBrk&&(typeof this.inspectBrk==\"string\"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push(\"--inspect-brk\")),this.require&&h.push(`--require=${this.require}`),await In.executePackageAccessibleBinary(c,this.scriptName,this.args,{cwd:this.context.cwd,project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:f})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(\":\")){let E=(await Promise.all(s.workspaces.map(async C=>C.manifest.scripts.has(this.scriptName)?C:null))).filter(C=>C!==null);if(E.length===1)return await In.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName===\"node-gyp\"?new nt(`Couldn't find a script name \"${this.scriptName}\" in the top-level (used by ${G.prettyLocator(r,n)}). This typically happens because some package depends on \"node-gyp\" to build itself, but didn't list it in their dependencies. To fix that, please run \"yarn add node-gyp\" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new nt(`Couldn't find a script name \"${this.scriptName}\" in the top-level (used by ${G.prettyLocator(r,n)}).`);{if(this.scriptName===\"global\")throw new nt(\"The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead\");let h=[this.scriptName].concat(this.args);for(let[E,C]of $I)for(let S of C)if(h.length>=S.length&&JSON.stringify(h.slice(0,S.length))===JSON.stringify(S))throw new nt(`Couldn't find a script named \"${this.scriptName}\", but a matching command can be found in the ${E} plugin. You can install it with \"yarn plugin import ${E}\".`);throw new nt(`Couldn't find a script named \"${this.scriptName}\".`)}}};Ge();Ge();Yt();var OC=class extends ft{constructor(){super(...arguments);this.descriptor=ge.String();this.resolution=ge.String()}static{this.paths=[[\"set\",\"resolution\"]]}static{this.usage=ot.Usage({description:\"enforce a package resolution\",details:'\\n      This command updates the resolution table so that `descriptor` is resolved by `resolution`.\\n\\n      Note that by default this command only affect the current resolution table - meaning that this \"manual override\" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\\n\\n      Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\\n    ',examples:[[\"Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0\",\"$0 set resolution lodash@npm:^1.2.3 npm:1.5.0\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(await s.restoreInstallState({restoreResolutions:!1}),!a)throw new ar(s.cwd,this.context.cwd);let c=G.parseDescriptor(this.descriptor,!0),f=G.makeDescriptor(c,this.resolution);return s.storedDescriptors.set(c.descriptorHash,c),s.storedDescriptors.set(f.descriptorHash,f),s.resolutionAliases.set(c.descriptorHash,f.descriptorHash),await s.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Ge();Dt();Yt();var wye=ut(Go()),LC=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Unlink all workspaces belonging to the target project from the current one\"});this.leadingArguments=ge.Rest()}static{this.paths=[[\"unlink\"]]}static{this.usage=ot.Usage({description:\"disconnect the local project from another one\",details:`\n      This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.\n    `,examples:[[\"Unregister a remote workspace in the current project\",\"$0 unlink ~/ts-loader\"],[\"Unregister all workspaces from a remote project in the current project\",\"$0 unlink ~/jest --all\"],[\"Unregister all previously linked workspaces\",\"$0 unlink --all\"],[\"Unregister all workspaces matching a glob\",\"$0 unlink '@babel/*' 'pkg-{a,b}'\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=s.topLevelWorkspace,f=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of c.manifest.resolutions)h.startsWith(\"portal:\")&&f.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=J.resolve(this.context.cwd,fe.toPortablePath(p));if(je.isPathLike(p)){let E=await ze.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Rt.find(E,h);if(!S)throw new ar(C.cwd,h);if(this.all){for(let b of C.workspaces)b.manifest.name&&f.add(G.stringifyIdent(b.anchoredLocator));if(f.size===0)throw new nt(\"No workspace found to be unlinked in the target project\")}else{if(!S.manifest.name)throw new nt(\"The target workspace doesn't have a name and thus cannot be unlinked\");f.add(G.stringifyIdent(S.anchoredLocator))}}else{let E=[...c.manifest.resolutions.map(({pattern:C})=>C.descriptor.fullName)];for(let C of(0,wye.default)(E,p))f.add(C)}}return c.manifest.resolutions=c.manifest.resolutions.filter(({pattern:p})=>!f.has(p.descriptor.fullName)),await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();Yt();var Bye=ut(Vv()),e5=ut(Go());Ul();var MC=class extends ft{constructor(){super(...arguments);this.interactive=ge.Boolean(\"-i,--interactive\",{description:\"Offer various choices, depending on the detected upgrade paths\"});this.fixed=ge.Boolean(\"-F,--fixed\",!1,{description:\"Store dependency tags as-is instead of resolving them\"});this.exact=ge.Boolean(\"-E,--exact\",!1,{description:\"Don't use any semver modifier on the resolved range\"});this.tilde=ge.Boolean(\"-T,--tilde\",!1,{description:\"Use the `~` semver modifier on the resolved range\"});this.caret=ge.Boolean(\"-C,--caret\",!1,{description:\"Use the `^` semver modifier on the resolved range\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Resolve again ALL resolutions for those packages\"});this.mode=ge.String(\"--mode\",{description:\"Change what artifacts installs generate\",validator:fo($l)});this.patterns=ge.Rest()}static{this.paths=[[\"up\"]]}static{this.usage=ot.Usage({description:\"upgrade dependencies across the project\",details:\"\\n      This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\\n\\n      If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\\n\\n      If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\\n\\n      The, `-C,--caret`, `-E,--exact` and  `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\\n\\n      If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\\n\\n      - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\\n\\n      - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\\n\\n      Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\\n\\n      This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\\n\\n      **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\\n    \",examples:[[\"Upgrade all instances of lodash to the latest release\",\"$0 up lodash\"],[\"Upgrade all instances of lodash to the latest release, but ask confirmation for each\",\"$0 up lodash -i\"],[\"Upgrade all instances of lodash to 1.2.3\",\"$0 up lodash@1.2.3\"],[\"Upgrade all instances of packages with the `@babel` scope to the latest release\",\"$0 up '@babel/*'\"],[\"Upgrade all instances of packages containing the word `jest` to the latest release\",\"$0 up '*jest*'\"],[\"Upgrade all instances of packages with the `@babel` scope to 7.0.0\",\"$0 up '@babel/*@7.0.0'\"]]})}static{this.schema=[tB(\"recursive\",qf.Forbids,[\"interactive\",\"exact\",\"tilde\",\"caret\"],{ignore:[void 0,!1]})]}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=[...s.storedDescriptors.values()],f=c.map(E=>G.stringifyIdent(E)),p=new Set;for(let E of this.patterns){if(G.parseDescriptor(E).range!==\"unknown\")throw new nt(\"Ranges aren't allowed when using --recursive\");for(let C of(0,e5.default)(f,E)){let S=G.parseIdent(C);p.add(S.identHash)}}let h=c.filter(E=>p.has(E.identHash));for(let E of h)s.storedDescriptors.delete(E.descriptorHash),s.storedResolutions.delete(E.descriptorHash);return await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}async executeUpClassic(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.fixed,f=r.isInteractive({interactive:this.interactive,stdout:this.context.stdout}),p=Kv(this,s),h=f?[\"keep\",\"reuse\",\"project\",\"latest\"]:[\"project\",\"latest\"],E=[],C=[];for(let N of this.patterns){let U=!1,W=G.parseDescriptor(N),ee=G.stringifyIdent(W);for(let ie of s.workspaces)for(let ue of[\"dependencies\",\"devDependencies\"]){let me=[...ie.manifest.getForScope(ue).values()].map(Be=>G.stringifyIdent(Be)),pe=ee===\"*\"?me:(0,e5.default)(me,ee);for(let Be of pe){let Ce=G.parseIdent(Be),g=ie.manifest[ue].get(Ce.identHash);if(typeof g>\"u\")throw new Error(\"Assertion failed: Expected the descriptor to be registered\");let we=G.makeDescriptor(Ce,W.range);E.push(Promise.resolve().then(async()=>[ie,ue,g,await zv(we,{project:s,workspace:ie,cache:n,target:ue,fixed:c,modifier:p,strategies:h})])),U=!0}}U||C.push(N)}if(C.length>1)throw new nt(`Patterns ${he.prettyList(r,C,he.Type.CODE)} don't match any packages referenced by any workspace`);if(C.length>0)throw new nt(`Pattern ${he.prettyList(r,C,he.Type.CODE)} doesn't match any packages referenced by any workspace`);let S=await Promise.all(E),b=await lA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async N=>{for(let[,,U,{suggestions:W,rejections:ee}]of S){let ie=W.filter(ue=>ue.descriptor!==null);if(ie.length===0){let[ue]=ee;if(typeof ue>\"u\")throw new Error(\"Assertion failed: Expected an error to have been set\");let le=this.cli.error(ue);s.configuration.get(\"enableNetwork\")?N.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range\n\n${le}`):N.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)\n\n${le}`)}else ie.length>1&&!f&&N.reportError(27,`${G.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(b.hasErrors())return b.exitCode();let I=!1,T=[];for(let[N,U,,{suggestions:W}]of S){let ee,ie=W.filter(pe=>pe.descriptor!==null),ue=ie[0].descriptor,le=ie.every(pe=>G.areDescriptorsEqual(pe.descriptor,ue));ie.length===1||le?ee=ue:(I=!0,{answer:ee}=await(0,Bye.prompt)({type:\"select\",name:\"answer\",message:`Which range do you want to use in ${G.prettyWorkspace(r,N)} \\u276F ${U}?`,choices:W.map(({descriptor:pe,name:Be,reason:Ce})=>pe?{name:Be,hint:Ce,descriptor:pe}:{name:Be,hint:Ce,disabled:!0}),onCancel:()=>process.exit(130),result(pe){return this.find(pe,\"descriptor\")},stdin:this.context.stdin,stdout:this.context.stdout}));let me=N.manifest[U].get(ee.identHash);if(typeof me>\"u\")throw new Error(\"Assertion failed: This descriptor should have a matching entry\");if(me.descriptorHash!==ee.descriptorHash)N.manifest[U].set(ee.identHash,ee),T.push([N,U,me,ee]);else{let pe=r.makeResolver(),Be={project:s,resolver:pe},Ce=r.normalizeDependency(me),g=pe.bindDescriptor(Ce,N.anchoredLocator,Be);s.forgetResolution(g)}}return await r.triggerMultipleHooks(N=>N.afterWorkspaceDependencyReplacement,T),I&&this.context.stdout.write(`\n`),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ge();Ge();Ge();Yt();var UC=class extends ft{constructor(){super(...arguments);this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"List, for each workspace, what are all the paths that lead to the dependency\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.peers=ge.Boolean(\"--peers\",!1,{description:\"Also print the peer dependencies that match the specified name\"});this.package=ge.String()}static{this.paths=[[\"why\"]]}static{this.usage=ot.Usage({description:\"display the reason why a package is needed\",details:`\n      This command prints the exact reasons why a package appears in the dependency tree.\n\n      If \\`-R,--recursive\\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named \"Foo\" when looking for \"Bar\", it means that \"Foo\" already got printed higher in the tree.\n    `,examples:[[\"Explain why lodash is used in your project\",\"$0 why lodash\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=G.parseIdent(this.package).identHash,c=this.recursive?sct(s,n,{configuration:r,peers:this.peers}):ict(s,n,{configuration:r,peers:this.peers});xs.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function ict(t,e,{configuration:r,peers:s}){let a=je.sortMap(t.storedPackages.values(),f=>G.stringifyLocator(f)),n={},c={children:n};for(let f of a){let p={};for(let E of f.dependencies.values()){if(!s&&f.peerDependencies.has(E.identHash))continue;let C=t.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(\"Assertion failed: The resolution should have been registered\");let S=t.storedPackages.get(C);if(!S)throw new Error(\"Assertion failed: The package should have been registered\");if(S.identHash!==e)continue;{let I=G.stringifyLocator(f);n[I]={value:[f,he.Type.LOCATOR],children:p}}let b=G.stringifyLocator(S);p[b]={value:[{descriptor:E,locator:S},he.Type.DEPENDENT]}}}return c}function sct(t,e,{configuration:r,peers:s}){let a=je.sortMap(t.workspaces,S=>G.stringifyLocator(S.anchoredLocator)),n=new Set,c=new Set,f=S=>{if(n.has(S.locatorHash))return c.has(S.locatorHash);if(n.add(S.locatorHash),S.identHash===e)return c.add(S.locatorHash),!0;let b=!1;S.identHash===e&&(b=!0);for(let I of S.dependencies.values()){if(!s&&S.peerDependencies.has(I.identHash))continue;let T=t.storedResolutions.get(I.descriptorHash);if(!T)throw new Error(\"Assertion failed: The resolution should have been registered\");let N=t.storedPackages.get(T);if(!N)throw new Error(\"Assertion failed: The package should have been registered\");f(N)&&(b=!0)}return b&&c.add(S.locatorHash),b};for(let S of a)f(S.anchoredPackage);let p=new Set,h={},E={children:h},C=(S,b,I)=>{if(!c.has(S.locatorHash))return;let T=I!==null?he.tuple(he.Type.DEPENDENT,{locator:S,descriptor:I}):he.tuple(he.Type.LOCATOR,S),N={},U={value:T,children:N},W=G.stringifyLocator(S);if(b[W]=U,!(I!==null&&t.tryWorkspaceByLocator(S))&&!p.has(S.locatorHash)){p.add(S.locatorHash);for(let ee of S.dependencies.values()){if(!s&&S.peerDependencies.has(ee.identHash))continue;let ie=t.storedResolutions.get(ee.descriptorHash);if(!ie)throw new Error(\"Assertion failed: The resolution should have been registered\");let ue=t.storedPackages.get(ie);if(!ue)throw new Error(\"Assertion failed: The package should have been registered\");C(ue,N,ee)}}};for(let S of a)C(S.anchoredPackage,h,null);return E}Ge();var u5={};Vt(u5,{GitFetcher:()=>tS,GitResolver:()=>rS,default:()=>Dct,gitUtils:()=>ka});Ge();Dt();var ka={};Vt(ka,{TreeishProtocols:()=>eS,clone:()=>c5,fetchBase:()=>qye,fetchChangedFiles:()=>Wye,fetchChangedWorkspaces:()=>vct,fetchRoot:()=>Gye,isGitUrl:()=>jC,lsRemote:()=>jye,normalizeLocator:()=>Bct,normalizeRepoUrl:()=>_C,resolveUrl:()=>l5,splitRepoUrl:()=>W0,validateRepoUrl:()=>a5});Ge();Dt();Yt();ql();var _ye=ut(Lye()),HC=ut(Ie(\"querystring\")),s5=ut(Ai());function i5(t,e,r){let s=t.indexOf(r);return t.lastIndexOf(e,s>-1?s:1/0)}function Mye(t){try{return new URL(t)}catch{return}}function Cct(t){let e=i5(t,\"@\",\"#\"),r=i5(t,\":\",\"#\");return r>e&&(t=`${t.slice(0,r)}/${t.slice(r+1)}`),i5(t,\":\",\"#\")===-1&&t.indexOf(\"//\")===-1&&(t=`ssh://${t}`),t}function Uye(t){return Mye(t)||Mye(Cct(t))}function _C(t,{git:e=!1}={}){if(t=t.replace(/^git\\+https:/,\"https:\"),t=t.replace(/^(?:github:|https:\\/\\/github\\.com\\/|git:\\/\\/github\\.com\\/)?(?!\\.{1,2}\\/)([a-zA-Z0-9._-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\\.git)?(#.*)?$/,\"https://github.com/$1/$2.git$3\"),t=t.replace(/^https:\\/\\/github\\.com\\/(?!\\.{1,2}\\/)([a-zA-Z0-9._-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\\/tarball\\/(.+)?$/,\"https://github.com/$1/$2.git#$3\"),e){let r=Uye(t);r&&(t=r.href),t=t.replace(/^git\\+([^:]+):/,\"$1:\")}return t}function Hye(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||\"ssh\"} -o BatchMode=yes`}}var wct=[/^ssh:/,/^git(?:\\+[^:]+)?:/,/^(?:git\\+)?https?:[^#]+\\/[^#]+(?:\\.git)(?:#.*)?$/,/^git@[^#]+\\/[^#]+\\.git(?:#.*)?$/,/^(?:github:|https:\\/\\/github\\.com\\/)?(?!\\.{1,2}\\/)([a-zA-Z._0-9-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\\.git)?(?:#.*)?$/,/^https:\\/\\/github\\.com\\/(?!\\.{1,2}\\/)([a-zA-Z0-9._-]+)\\/(?!\\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\\/tarball\\/(.+)?$/],eS=(a=>(a.Commit=\"commit\",a.Head=\"head\",a.Tag=\"tag\",a.Semver=\"semver\",a))(eS||{});function jC(t){return t?wct.some(e=>!!t.match(e)):!1}function W0(t){t=_C(t);let e=t.indexOf(\"#\");if(e===-1)return{repo:t,treeish:{protocol:\"head\",request:\"HEAD\"},extra:{}};let r=t.slice(0,e),s=t.slice(e+1);if(s.match(/^[a-z]+=/)){let a=HC.default.parse(s);for(let[p,h]of Object.entries(a))if(typeof h!=\"string\")throw new Error(`Assertion failed: The ${p} parameter must be a literal string`);let n=Object.values(eS).find(p=>Object.hasOwn(a,p)),[c,f]=typeof n<\"u\"?[n,a[n]]:[\"head\",\"HEAD\"];for(let p of Object.values(eS))delete a[p];return{repo:r,treeish:{protocol:c,request:f},extra:a}}else{let a=s.indexOf(\":\"),[n,c]=a===-1?[null,s]:[s.slice(0,a),s.slice(a+1)];return{repo:r,treeish:{protocol:n,request:c},extra:{}}}}function Bct(t){return G.makeLocator(t,_C(t.reference))}function a5(t,{configuration:e}){let r=_C(t,{git:!0});if(!ln.getNetworkSettings(`https://${(0,_ye.default)(r).resource}`,{configuration:e}).enableNetwork)throw new jt(80,`Request to '${r}' has been blocked because of your configuration settings`);return r}async function jye(t,e){let r=a5(t,{configuration:e}),s=await o5(\"listing refs\",[\"ls-remote\",r],{cwd:e.startingCwd,env:Hye()},{configuration:e,normalizedRepoUrl:r}),a=new Map,n=/^([a-f0-9]{40})\\t([^\\n]+)/gm,c;for(;(c=n.exec(s.stdout))!==null;)a.set(c[2],c[1]);return a}async function l5(t,e){let{repo:r,treeish:{protocol:s,request:a},extra:n}=W0(t),c=await jye(r,e),f=(h,E)=>{switch(h){case\"commit\":{if(!E.match(/^[a-f0-9]{40}$/))throw new Error(\"Invalid commit hash\");return HC.default.stringify({...n,commit:E})}case\"head\":{let C=c.get(E===\"HEAD\"?E:`refs/heads/${E}`);if(typeof C>\"u\")throw new Error(`Unknown head (\"${E}\")`);return HC.default.stringify({...n,commit:C})}case\"tag\":{let C=c.get(`refs/tags/${E}`);if(typeof C>\"u\")throw new Error(`Unknown tag (\"${E}\")`);return HC.default.stringify({...n,commit:C})}case\"semver\":{let C=Fr.validRange(E);if(!C)throw new Error(`Invalid range (\"${E}\")`);let S=new Map([...c.entries()].filter(([I])=>I.startsWith(\"refs/tags/\")).map(([I,T])=>[s5.default.parse(I.slice(10)),T]).filter(I=>I[0]!==null)),b=s5.default.maxSatisfying([...S.keys()],C);if(b===null)throw new Error(`No matching range (\"${E}\")`);return HC.default.stringify({...n,commit:S.get(b)})}case null:{let C;if((C=p(\"commit\",E))!==null||(C=p(\"tag\",E))!==null||(C=p(\"head\",E))!==null)return C;throw E.match(/^[a-f0-9]+$/)?new Error(`Couldn't resolve \"${E}\" as either a commit, a tag, or a head - if a commit, use the 40-characters commit hash`):new Error(`Couldn't resolve \"${E}\" as either a commit, a tag, or a head`)}default:throw new Error(`Invalid Git resolution protocol (\"${h}\")`)}},p=(h,E)=>{try{return f(h,E)}catch{return null}};return _C(`${r}#${f(s,a)}`)}async function c5(t,e){return await e.getLimit(\"cloneConcurrency\")(async()=>{let{repo:r,treeish:{protocol:s,request:a}}=W0(t);if(s!==\"commit\")throw new Error(\"Invalid treeish protocol when cloning\");let n=a5(r,{configuration:e}),c=await ce.mktempPromise(),f={cwd:c,env:Hye()};return await o5(\"cloning the repository\",[\"clone\",\"-c core.autocrlf=false\",n,fe.fromPortablePath(c)],f,{configuration:e,normalizedRepoUrl:n}),await o5(\"switching branch\",[\"checkout\",`${a}`],f,{configuration:e,normalizedRepoUrl:n}),c})}async function Gye(t){let e,r=t;do{if(e=r,await ce.existsPromise(J.join(e,\".git\")))return e;r=J.dirname(e)}while(r!==e);return null}async function qye(t,{baseRefs:e}){if(e.length===0)throw new nt(\"Can't run this command with zero base refs specified.\");let r=[];for(let f of e){let{code:p}=await qr.execvp(\"git\",[\"merge-base\",f,\"HEAD\"],{cwd:t});p===0&&r.push(f)}if(r.length===0)throw new nt(`No ancestor could be found between any of HEAD and ${e.join(\", \")}`);let{stdout:s}=await qr.execvp(\"git\",[\"merge-base\",\"HEAD\",...r],{cwd:t,strict:!0}),a=s.trim(),{stdout:n}=await qr.execvp(\"git\",[\"show\",\"--quiet\",\"--pretty=format:%s\",a],{cwd:t,strict:!0}),c=n.trim();return{hash:a,title:c}}async function Wye(t,{base:e,project:r}){let s=je.buildIgnorePattern(r.configuration.get(\"changesetIgnorePatterns\")),{stdout:a}=await qr.execvp(\"git\",[\"diff\",\"--name-only\",`${e}`],{cwd:t,strict:!0}),n=a.split(/\\r\\n|\\r|\\n/).filter(h=>h.length>0).map(h=>J.resolve(t,fe.toPortablePath(h))),{stdout:c}=await qr.execvp(\"git\",[\"ls-files\",\"--others\",\"--exclude-standard\"],{cwd:t,strict:!0}),f=c.split(/\\r\\n|\\r|\\n/).filter(h=>h.length>0).map(h=>J.resolve(t,fe.toPortablePath(h))),p=[...new Set([...n,...f].sort())];return s?p.filter(h=>!J.relative(r.cwd,h).match(s)):p}async function vct({ref:t,project:e}){if(e.configuration.projectCwd===null)throw new nt(\"This command can only be run from within a Yarn project\");let r=[J.resolve(e.cwd,Er.lockfile),J.resolve(e.cwd,e.configuration.get(\"cacheFolder\")),J.resolve(e.cwd,e.configuration.get(\"installStatePath\")),J.resolve(e.cwd,e.configuration.get(\"virtualFolder\"))];await e.configuration.triggerHook(c=>c.populateYarnPaths,e,c=>{c!=null&&r.push(c)});let s=await Gye(e.configuration.projectCwd);if(s==null)throw new nt(\"This command can only be run on Git repositories\");let a=await qye(s,{baseRefs:typeof t==\"string\"?[t]:e.configuration.get(\"changesetBaseRefs\")}),n=await Wye(s,{base:a.hash,project:e});return new Set(je.mapAndFilter(n,c=>{let f=e.tryWorkspaceByFilePath(c);return f===null?je.mapAndFilter.skip:r.some(p=>c.startsWith(p))?je.mapAndFilter.skip:f}))}async function o5(t,e,r,{configuration:s,normalizedRepoUrl:a}){try{return await qr.execvp(\"git\",e,{...r,strict:!0})}catch(n){if(!(n instanceof qr.ExecError))throw n;let c=n.reportExtra,f=n.stderr.toString();throw new jt(1,`Failed ${t}`,p=>{p.reportError(1,`  ${he.prettyField(s,{label:\"Repository URL\",value:he.tuple(he.Type.URL,a)})}`);for(let h of f.matchAll(/^(.+?): (.*)$/gm)){let[,E,C]=h;E=E.toLowerCase();let S=E===\"error\"?\"Error\":`${PB(E)} Error`;p.reportError(1,`  ${he.prettyField(s,{label:S,value:he.tuple(he.Type.NO_HINT,C)})}`)}c?.(p)})}}var tS=class{supports(e,r){return jC(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,a=new Map(r.checksums);a.set(e.locatorHash,s);let n={...r,checksums:a},c=await this.downloadHosted(e,n);if(c!==null)return c;let[f,p,h]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote repository`),loader:()=>this.cloneFromRemote(e,n),...r.cacheOptions});return{packageFs:f,releaseFs:p,prefixPath:G.getIdentVendorPath(e),checksum:h}}async downloadHosted(e,r){return r.project.configuration.reduceHook(s=>s.fetchHostedRepository,null,e,r)}async cloneFromRemote(e,r){let s=W0(e.reference),a=await c5(e.reference,r.project.configuration),n=J.resolve(a,s.extra.cwd??vt.dot),c=J.join(n,\"package.tgz\");await In.prepareExternalProject(n,c,{configuration:r.project.configuration,report:r.report,workspace:s.extra.workspace,locator:e});let f=await ce.readFilePromise(c);return await je.releaseAfterUseAsync(async()=>await ps.convertToZip(f,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1}))}};Ge();Ge();var rS=class{supportsDescriptor(e,r){return jC(e.range)}supportsLocator(e,r){return jC(e.reference)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=await l5(e.range,s.project.configuration);return[G.makeLocator(e,a)]}async getSatisfying(e,r,s,a){let n=W0(e.range);return{locators:s.filter(f=>{if(f.identHash!==e.identHash)return!1;let p=W0(f.reference);return!(n.repo!==p.repo||n.treeish.protocol===\"commit\"&&n.treeish.request!==p.treeish.request)}),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var Sct={configuration:{changesetBaseRefs:{description:\"The base git refs that the current HEAD is compared against when detecting changes. Supports git branches, tags, and commits.\",type:\"STRING\",isArray:!0,isNullable:!1,default:[\"master\",\"origin/master\",\"upstream/master\",\"main\",\"origin/main\",\"upstream/main\"]},changesetIgnorePatterns:{description:\"Array of glob patterns; files matching them will be ignored when fetching the changed files\",type:\"STRING\",default:[],isArray:!0},cloneConcurrency:{description:\"Maximal number of concurrent clones\",type:\"NUMBER\",default:2}},fetchers:[tS],resolvers:[rS]};var Dct=Sct;Yt();var GC=class extends ft{constructor(){super(...arguments);this.since=ge.String(\"--since\",{description:\"Only include workspaces that have been changed since the specified ref.\",tolerateBoolean:!0});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Find packages via dependencies/devDependencies instead of using the workspaces field\"});this.noPrivate=ge.Boolean(\"--no-private\",{description:\"Exclude workspaces that have the private field set to true\"});this.verbose=ge.Boolean(\"-v,--verbose\",!1,{description:\"Also return the cross-dependencies between workspaces\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"workspaces\",\"list\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"list all available workspaces\",details:\"\\n      This command will print the list of all workspaces in the project.\\n\\n      - If `--since` is set, Yarn will only list workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\\n\\n      - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\\n\\n      - If `--no-private` is set, Yarn will not list any workspaces that have the `private` field set to `true`.\\n\\n      - If both the `-v,--verbose` and `--json` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{let c=this.since?await ka.fetchChangedWorkspaces({ref:this.since,project:s}):s.workspaces,f=new Set(c);if(this.recursive)for(let p of[...c].map(h=>h.getRecursiveWorkspaceDependents()))for(let h of p)f.add(h);for(let p of f){let{manifest:h}=p;if(h.private&&this.noPrivate)continue;let E;if(this.verbose){let C=new Set,S=new Set;for(let b of Ut.hardDependencies)for(let[I,T]of h.getForScope(b)){let N=s.tryWorkspaceByDescriptor(T);N===null?s.workspacesByIdent.has(I)&&S.add(T):C.add(N)}E={workspaceDependencies:Array.from(C).map(b=>b.relativeCwd),mismatchedWorkspaceDependencies:Array.from(S).map(b=>G.stringifyDescriptor(b))}}n.reportInfo(null,`${p.relativeCwd}`),n.reportJson({location:p.relativeCwd,name:h.name?G.stringifyIdent(h.name):null,...E})}})).exitCode()}};Ge();Ge();Yt();var qC=class extends ft{constructor(){super(...arguments);this.workspaceName=ge.String();this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"workspace\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"run a command within the specified workspace\",details:`\n      This command will run a given sub-command on a single workspace.\n    `,examples:[[\"Add a package to a single workspace\",\"yarn workspace components add -D react\"],[\"Run build script on a single workspace\",\"yarn workspace components run build\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=s.workspaces,c=new Map(n.map(p=>[G.stringifyIdent(p.anchoredLocator),p])),f=c.get(this.workspaceName);if(f===void 0){let p=Array.from(c.keys()).sort();throw new nt(`Workspace '${this.workspaceName}' not found. Did you mean any of the following:\n  - ${p.join(`\n  - `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:f.cwd})}};var Pct={configuration:{enableImmutableInstalls:{description:\"If true (the default on CI), prevents the install command from modifying the lockfile\",type:\"BOOLEAN\",default:Yye.isCI},defaultSemverRangePrefix:{description:\"The default save prefix: '^', '~' or ''\",type:\"STRING\",values:[\"^\",\"~\",\"\"],default:\"^\"},preferReuse:{description:\"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.\",type:\"BOOLEAN\",default:!1}},commands:[aC,lC,cC,uC,OC,PC,EC,GC,pC,hC,gC,dC,sC,oC,fC,AC,mC,yC,IC,CC,wC,BC,LC,vC,SC,xC,bC,kC,DC,QC,RC,TC,FC,NC,MC,UC,qC]},bct=Pct;var d5={};Vt(d5,{default:()=>kct});Ge();var Qt={optional:!0},A5=[[\"@tailwindcss/aspect-ratio@<0.2.1\",{peerDependencies:{tailwindcss:\"^2.0.2\"}}],[\"@tailwindcss/line-clamp@<0.2.1\",{peerDependencies:{tailwindcss:\"^2.0.2\"}}],[\"@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0\",{peerDependencies:{postcss:\"^8.0.0\"}}],[\"@samverschueren/stream-to-observable@<0.3.1\",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],[\"any-observable@<0.5.1\",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],[\"@pm2/agent@<1.0.4\",{dependencies:{debug:\"*\"}}],[\"debug@<4.2.0\",{peerDependenciesMeta:{\"supports-color\":Qt}}],[\"got@<11\",{dependencies:{\"@types/responselike\":\"^1.0.0\",\"@types/keyv\":\"^3.1.1\"}}],[\"cacheable-lookup@<4.1.2\",{dependencies:{\"@types/keyv\":\"^3.1.1\"}}],[\"http-link-dataloader@*\",{peerDependencies:{graphql:\"^0.13.1 || ^14.0.0\"}}],[\"typescript-language-server@*\",{dependencies:{\"vscode-jsonrpc\":\"^5.0.1\",\"vscode-languageserver-protocol\":\"^3.15.0\"}}],[\"postcss-syntax@*\",{peerDependenciesMeta:{\"postcss-html\":Qt,\"postcss-jsx\":Qt,\"postcss-less\":Qt,\"postcss-markdown\":Qt,\"postcss-scss\":Qt}}],[\"jss-plugin-rule-value-function@<=10.1.1\",{dependencies:{\"tiny-warning\":\"^1.0.2\"}}],[\"ink-select-input@<4.1.0\",{peerDependencies:{react:\"^16.8.2\"}}],[\"license-webpack-plugin@<2.3.18\",{peerDependenciesMeta:{webpack:Qt}}],[\"snowpack@>=3.3.0\",{dependencies:{\"node-gyp\":\"^7.1.0\"}}],[\"promise-inflight@*\",{peerDependenciesMeta:{bluebird:Qt}}],[\"reactcss@*\",{peerDependencies:{react:\"*\"}}],[\"react-color@<=2.19.0\",{peerDependencies:{react:\"*\"}}],[\"gatsby-plugin-i18n@*\",{dependencies:{ramda:\"^0.24.1\"}}],[\"useragent@^2.0.0\",{dependencies:{request:\"^2.88.0\",yamlparser:\"0.0.x\",semver:\"5.5.x\"}}],[\"@apollographql/apollo-tools@<=0.5.2\",{peerDependencies:{graphql:\"^14.2.1 || ^15.0.0\"}}],[\"material-table@^2.0.0\",{dependencies:{\"@babel/runtime\":\"^7.11.2\"}}],[\"@babel/parser@*\",{dependencies:{\"@babel/types\":\"^7.8.3\"}}],[\"fork-ts-checker-webpack-plugin@<=6.3.4\",{peerDependencies:{eslint:\">= 6\",typescript:\">= 2.7\",webpack:\">= 4\",\"vue-template-compiler\":\"*\"},peerDependenciesMeta:{eslint:Qt,\"vue-template-compiler\":Qt}}],[\"rc-animate@<=3.1.1\",{peerDependencies:{react:\">=16.9.0\",\"react-dom\":\">=16.9.0\"}}],[\"react-bootstrap-table2-paginator@*\",{dependencies:{classnames:\"^2.2.6\"}}],[\"react-draggable@<=4.4.3\",{peerDependencies:{react:\">= 16.3.0\",\"react-dom\":\">= 16.3.0\"}}],[\"apollo-upload-client@<14\",{peerDependencies:{graphql:\"14 - 15\"}}],[\"react-instantsearch-core@<=6.7.0\",{peerDependencies:{algoliasearch:\">= 3.1 < 5\"}}],[\"react-instantsearch-dom@<=6.7.0\",{dependencies:{\"react-fast-compare\":\"^3.0.0\"}}],[\"ws@<7.2.1\",{peerDependencies:{bufferutil:\"^4.0.1\",\"utf-8-validate\":\"^5.0.2\"},peerDependenciesMeta:{bufferutil:Qt,\"utf-8-validate\":Qt}}],[\"react-portal@<4.2.2\",{peerDependencies:{\"react-dom\":\"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0\"}}],[\"react-scripts@<=4.0.1\",{peerDependencies:{react:\"*\"}}],[\"testcafe@<=1.10.1\",{dependencies:{\"@babel/plugin-transform-for-of\":\"^7.12.1\",\"@babel/runtime\":\"^7.12.5\"}}],[\"testcafe-legacy-api@<=4.2.0\",{dependencies:{\"testcafe-hammerhead\":\"^17.0.1\",\"read-file-relative\":\"^1.2.0\"}}],[\"@google-cloud/firestore@<=4.9.3\",{dependencies:{protobufjs:\"^6.8.6\"}}],[\"gatsby-source-apiserver@*\",{dependencies:{\"babel-polyfill\":\"^6.26.0\"}}],[\"@webpack-cli/package-utils@<=1.0.1-alpha.4\",{dependencies:{\"cross-spawn\":\"^7.0.3\"}}],[\"gatsby-remark-prismjs@<3.3.28\",{dependencies:{lodash:\"^4\"}}],[\"gatsby-plugin-favicon@*\",{peerDependencies:{webpack:\"*\"}}],[\"gatsby-plugin-sharp@<=4.6.0-next.3\",{dependencies:{debug:\"^4.3.1\"}}],[\"gatsby-react-router-scroll@<=5.6.0-next.0\",{dependencies:{\"prop-types\":\"^15.7.2\"}}],[\"@rebass/forms@*\",{dependencies:{\"@styled-system/should-forward-prop\":\"^5.0.0\"},peerDependencies:{react:\"^16.8.6\"}}],[\"rebass@*\",{peerDependencies:{react:\"^16.8.6\"}}],[\"@ant-design/react-slick@<=0.28.3\",{peerDependencies:{react:\">=16.0.0\"}}],[\"mqtt@<4.2.7\",{dependencies:{duplexify:\"^4.1.1\"}}],[\"vue-cli-plugin-vuetify@<=2.0.3\",{dependencies:{semver:\"^6.3.0\"},peerDependenciesMeta:{\"sass-loader\":Qt,\"vuetify-loader\":Qt}}],[\"vue-cli-plugin-vuetify@<=2.0.4\",{dependencies:{\"null-loader\":\"^3.0.0\"}}],[\"vue-cli-plugin-vuetify@>=2.4.3\",{peerDependencies:{vue:\"*\"}}],[\"@vuetify/cli-plugin-utils@<=0.0.4\",{dependencies:{semver:\"^6.3.0\"},peerDependenciesMeta:{\"sass-loader\":Qt}}],[\"@vue/cli-plugin-typescript@<=5.0.0-alpha.0\",{dependencies:{\"babel-loader\":\"^8.1.0\"}}],[\"@vue/cli-plugin-typescript@<=5.0.0-beta.0\",{dependencies:{\"@babel/core\":\"^7.12.16\"},peerDependencies:{\"vue-template-compiler\":\"^2.0.0\"},peerDependenciesMeta:{\"vue-template-compiler\":Qt}}],[\"cordova-ios@<=6.3.0\",{dependencies:{underscore:\"^1.9.2\"}}],[\"cordova-lib@<=10.0.1\",{dependencies:{underscore:\"^1.9.2\"}}],[\"git-node-fs@*\",{peerDependencies:{\"js-git\":\"^0.7.8\"},peerDependenciesMeta:{\"js-git\":Qt}}],[\"consolidate@<0.16.0\",{peerDependencies:{mustache:\"^3.0.0\"},peerDependenciesMeta:{mustache:Qt}}],[\"consolidate@<=0.16.0\",{peerDependencies:{velocityjs:\"^2.0.1\",tinyliquid:\"^0.2.34\",\"liquid-node\":\"^3.0.1\",jade:\"^1.11.0\",\"then-jade\":\"*\",dust:\"^0.3.0\",\"dustjs-helpers\":\"^1.7.4\",\"dustjs-linkedin\":\"^2.7.5\",swig:\"^1.4.2\",\"swig-templates\":\"^2.0.3\",\"razor-tmpl\":\"^1.3.1\",atpl:\">=0.7.6\",liquor:\"^0.0.5\",twig:\"^1.15.2\",ejs:\"^3.1.5\",eco:\"^1.1.0-rc-3\",jazz:\"^0.0.18\",jqtpl:\"~1.1.0\",hamljs:\"^0.6.2\",hamlet:\"^0.3.3\",whiskers:\"^0.4.0\",\"haml-coffee\":\"^1.14.1\",\"hogan.js\":\"^3.0.2\",templayed:\">=0.2.3\",handlebars:\"^4.7.6\",underscore:\"^1.11.0\",lodash:\"^4.17.20\",pug:\"^3.0.0\",\"then-pug\":\"*\",qejs:\"^3.0.5\",walrus:\"^0.10.1\",mustache:\"^4.0.1\",just:\"^0.1.8\",ect:\"^0.5.9\",mote:\"^0.2.0\",toffee:\"^0.3.6\",dot:\"^1.1.3\",\"bracket-template\":\"^1.1.5\",ractive:\"^1.3.12\",nunjucks:\"^3.2.2\",htmling:\"^0.0.8\",\"babel-core\":\"^6.26.3\",plates:\"~0.4.11\",\"react-dom\":\"^16.13.1\",react:\"^16.13.1\",\"arc-templates\":\"^0.5.3\",vash:\"^0.13.0\",slm:\"^2.0.0\",marko:\"^3.14.4\",teacup:\"^2.0.0\",\"coffee-script\":\"^1.12.7\",squirrelly:\"^5.1.0\",twing:\"^5.0.2\"},peerDependenciesMeta:{velocityjs:Qt,tinyliquid:Qt,\"liquid-node\":Qt,jade:Qt,\"then-jade\":Qt,dust:Qt,\"dustjs-helpers\":Qt,\"dustjs-linkedin\":Qt,swig:Qt,\"swig-templates\":Qt,\"razor-tmpl\":Qt,atpl:Qt,liquor:Qt,twig:Qt,ejs:Qt,eco:Qt,jazz:Qt,jqtpl:Qt,hamljs:Qt,hamlet:Qt,whiskers:Qt,\"haml-coffee\":Qt,\"hogan.js\":Qt,templayed:Qt,handlebars:Qt,underscore:Qt,lodash:Qt,pug:Qt,\"then-pug\":Qt,qejs:Qt,walrus:Qt,mustache:Qt,just:Qt,ect:Qt,mote:Qt,toffee:Qt,dot:Qt,\"bracket-template\":Qt,ractive:Qt,nunjucks:Qt,htmling:Qt,\"babel-core\":Qt,plates:Qt,\"react-dom\":Qt,react:Qt,\"arc-templates\":Qt,vash:Qt,slm:Qt,marko:Qt,teacup:Qt,\"coffee-script\":Qt,squirrelly:Qt,twing:Qt}}],[\"vue-loader@<=16.3.3\",{peerDependencies:{\"@vue/compiler-sfc\":\"^3.0.8\",webpack:\"^4.1.0 || ^5.0.0-0\"},peerDependenciesMeta:{\"@vue/compiler-sfc\":Qt}}],[\"vue-loader@^16.7.0\",{peerDependencies:{\"@vue/compiler-sfc\":\"^3.0.8\",vue:\"^3.2.13\"},peerDependenciesMeta:{\"@vue/compiler-sfc\":Qt,vue:Qt}}],[\"scss-parser@<=1.0.5\",{dependencies:{lodash:\"^4.17.21\"}}],[\"query-ast@<1.0.5\",{dependencies:{lodash:\"^4.17.21\"}}],[\"redux-thunk@<=2.3.0\",{peerDependencies:{redux:\"^4.0.0\"}}],[\"skypack@<=0.3.2\",{dependencies:{tar:\"^6.1.0\"}}],[\"@npmcli/metavuln-calculator@<2.0.0\",{dependencies:{\"json-parse-even-better-errors\":\"^2.3.1\"}}],[\"bin-links@<2.3.0\",{dependencies:{\"mkdirp-infer-owner\":\"^1.0.2\"}}],[\"rollup-plugin-polyfill-node@<=0.8.0\",{peerDependencies:{rollup:\"^1.20.0 || ^2.0.0\"}}],[\"snowpack@<3.8.6\",{dependencies:{\"magic-string\":\"^0.25.7\"}}],[\"elm-webpack-loader@*\",{dependencies:{temp:\"^0.9.4\"}}],[\"winston-transport@<=4.4.0\",{dependencies:{logform:\"^2.2.0\"}}],[\"jest-vue-preprocessor@*\",{dependencies:{\"@babel/core\":\"7.8.7\",\"@babel/template\":\"7.8.6\"},peerDependencies:{pug:\"^2.0.4\"},peerDependenciesMeta:{pug:Qt}}],[\"redux-persist@*\",{peerDependencies:{react:\">=16\"},peerDependenciesMeta:{react:Qt}}],[\"sodium@>=3\",{dependencies:{\"node-gyp\":\"^3.8.0\"}}],[\"babel-plugin-graphql-tag@<=3.1.0\",{peerDependencies:{graphql:\"^14.0.0 || ^15.0.0\"}}],[\"@playwright/test@<=1.14.1\",{dependencies:{\"jest-matcher-utils\":\"^26.4.2\"}}],...[\"babel-plugin-remove-graphql-queries@<3.14.0-next.1\",\"babel-preset-gatsby-package@<1.14.0-next.1\",\"create-gatsby@<1.14.0-next.1\",\"gatsby-admin@<0.24.0-next.1\",\"gatsby-cli@<3.14.0-next.1\",\"gatsby-core-utils@<2.14.0-next.1\",\"gatsby-design-tokens@<3.14.0-next.1\",\"gatsby-legacy-polyfills@<1.14.0-next.1\",\"gatsby-plugin-benchmark-reporting@<1.14.0-next.1\",\"gatsby-plugin-graphql-config@<0.23.0-next.1\",\"gatsby-plugin-image@<1.14.0-next.1\",\"gatsby-plugin-mdx@<2.14.0-next.1\",\"gatsby-plugin-netlify-cms@<5.14.0-next.1\",\"gatsby-plugin-no-sourcemaps@<3.14.0-next.1\",\"gatsby-plugin-page-creator@<3.14.0-next.1\",\"gatsby-plugin-preact@<5.14.0-next.1\",\"gatsby-plugin-preload-fonts@<2.14.0-next.1\",\"gatsby-plugin-schema-snapshot@<2.14.0-next.1\",\"gatsby-plugin-styletron@<6.14.0-next.1\",\"gatsby-plugin-subfont@<3.14.0-next.1\",\"gatsby-plugin-utils@<1.14.0-next.1\",\"gatsby-recipes@<0.25.0-next.1\",\"gatsby-source-shopify@<5.6.0-next.1\",\"gatsby-source-wikipedia@<3.14.0-next.1\",\"gatsby-transformer-screenshot@<3.14.0-next.1\",\"gatsby-worker@<0.5.0-next.1\"].map(t=>[t,{dependencies:{\"@babel/runtime\":\"^7.14.8\"}}]),[\"gatsby-core-utils@<2.14.0-next.1\",{dependencies:{got:\"8.3.2\"}}],[\"gatsby-plugin-gatsby-cloud@<=3.1.0-next.0\",{dependencies:{\"gatsby-core-utils\":\"^2.13.0-next.0\"}}],[\"gatsby-plugin-gatsby-cloud@<=3.2.0-next.1\",{peerDependencies:{webpack:\"*\"}}],[\"babel-plugin-remove-graphql-queries@<=3.14.0-next.1\",{dependencies:{\"gatsby-core-utils\":\"^2.8.0-next.1\"}}],[\"gatsby-plugin-netlify@3.13.0-next.1\",{dependencies:{\"gatsby-core-utils\":\"^2.13.0-next.0\"}}],[\"clipanion-v3-codemod@<=0.2.0\",{peerDependencies:{jscodeshift:\"^0.11.0\"}}],[\"react-live@*\",{peerDependencies:{\"react-dom\":\"*\",react:\"*\"}}],[\"webpack@<4.44.1\",{peerDependenciesMeta:{\"webpack-cli\":Qt,\"webpack-command\":Qt}}],[\"webpack@<5.0.0-beta.23\",{peerDependenciesMeta:{\"webpack-cli\":Qt}}],[\"webpack-dev-server@<3.10.2\",{peerDependenciesMeta:{\"webpack-cli\":Qt}}],[\"@docusaurus/responsive-loader@<1.5.0\",{peerDependenciesMeta:{sharp:Qt,jimp:Qt}}],[\"eslint-module-utils@*\",{peerDependenciesMeta:{\"eslint-import-resolver-node\":Qt,\"eslint-import-resolver-typescript\":Qt,\"eslint-import-resolver-webpack\":Qt,\"@typescript-eslint/parser\":Qt}}],[\"eslint-plugin-import@*\",{peerDependenciesMeta:{\"@typescript-eslint/parser\":Qt}}],[\"critters-webpack-plugin@<3.0.2\",{peerDependenciesMeta:{\"html-webpack-plugin\":Qt}}],[\"terser@<=5.10.0\",{dependencies:{acorn:\"^8.5.0\"}}],[\"babel-preset-react-app@10.0.x <10.0.2\",{dependencies:{\"@babel/plugin-proposal-private-property-in-object\":\"^7.16.7\"}}],[\"eslint-config-react-app@*\",{peerDependenciesMeta:{typescript:Qt}}],[\"@vue/eslint-config-typescript@<11.0.0\",{peerDependenciesMeta:{typescript:Qt}}],[\"unplugin-vue2-script-setup@<0.9.1\",{peerDependencies:{\"@vue/composition-api\":\"^1.4.3\",\"@vue/runtime-dom\":\"^3.2.26\"}}],[\"@cypress/snapshot@*\",{dependencies:{debug:\"^3.2.7\"}}],[\"auto-relay@<=0.14.0\",{peerDependencies:{\"reflect-metadata\":\"^0.1.13\"}}],[\"vue-template-babel-compiler@<1.2.0\",{peerDependencies:{\"vue-template-compiler\":\"^2.6.0\"}}],[\"@parcel/transformer-image@<2.5.0\",{peerDependencies:{\"@parcel/core\":\"*\"}}],[\"@parcel/transformer-js@<2.5.0\",{peerDependencies:{\"@parcel/core\":\"*\"}}],[\"parcel@*\",{peerDependenciesMeta:{\"@parcel/core\":Qt}}],[\"react-scripts@*\",{peerDependencies:{eslint:\"*\"}}],[\"focus-trap-react@^8.0.0\",{dependencies:{tabbable:\"^5.3.2\"}}],[\"react-rnd@<10.3.7\",{peerDependencies:{react:\">=16.3.0\",\"react-dom\":\">=16.3.0\"}}],[\"connect-mongo@<5.0.0\",{peerDependencies:{\"express-session\":\"^1.17.1\"}}],[\"vue-i18n@<9\",{peerDependencies:{vue:\"^2\"}}],[\"vue-router@<4\",{peerDependencies:{vue:\"^2\"}}],[\"unified@<10\",{dependencies:{\"@types/unist\":\"^2.0.0\"}}],[\"react-github-btn@<=1.3.0\",{peerDependencies:{react:\">=16.3.0\"}}],[\"react-dev-utils@*\",{peerDependencies:{typescript:\">=2.7\",webpack:\">=4\"},peerDependenciesMeta:{typescript:Qt}}],[\"@asyncapi/react-component@<=1.0.0-next.39\",{peerDependencies:{react:\">=16.8.0\",\"react-dom\":\">=16.8.0\"}}],[\"xo@*\",{peerDependencies:{webpack:\">=1.11.0\"},peerDependenciesMeta:{webpack:Qt}}],[\"babel-plugin-remove-graphql-queries@<=4.20.0-next.0\",{dependencies:{\"@babel/types\":\"^7.15.4\"}}],[\"gatsby-plugin-page-creator@<=4.20.0-next.1\",{dependencies:{\"fs-extra\":\"^10.1.0\"}}],[\"gatsby-plugin-utils@<=3.14.0-next.1\",{dependencies:{fastq:\"^1.13.0\"},peerDependencies:{graphql:\"^15.0.0\"}}],[\"gatsby-plugin-mdx@<3.1.0-next.1\",{dependencies:{mkdirp:\"^1.0.4\"}}],[\"gatsby-plugin-mdx@^2\",{peerDependencies:{gatsby:\"^3.0.0-next\"}}],[\"fdir@<=5.2.0\",{peerDependencies:{picomatch:\"2.x\"},peerDependenciesMeta:{picomatch:Qt}}],[\"babel-plugin-transform-typescript-metadata@<=0.3.2\",{peerDependencies:{\"@babel/core\":\"^7\",\"@babel/traverse\":\"^7\"},peerDependenciesMeta:{\"@babel/traverse\":Qt}}],[\"graphql-compose@>=9.0.10\",{peerDependencies:{graphql:\"^14.2.0 || ^15.0.0 || ^16.0.0\"}}],[\"vite-plugin-vuetify@<=1.0.2\",{peerDependencies:{vue:\"^3.0.0\"}}],[\"webpack-plugin-vuetify@<=2.0.1\",{peerDependencies:{vue:\"^3.2.6\"}}],[\"eslint-import-resolver-vite@<2.0.1\",{dependencies:{debug:\"^4.3.4\",resolve:\"^1.22.8\"}}],[\"notistack@^3.0.0\",{dependencies:{csstype:\"^3.0.10\"}}],[\"@fastify/type-provider-typebox@^5.0.0\",{peerDependencies:{fastify:\"^5.0.0\"}}],[\"@fastify/type-provider-typebox@^4.0.0\",{peerDependencies:{fastify:\"^4.0.0\"}}]];var p5;function Vye(){return typeof p5>\"u\"&&(p5=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"G7weAByFTVk3Vs7UfHhq4yykgEM7pbW7TI43SG2S5tvGrwHBAzdz+s/npQ6tgEvobvxisrPIadkXeUAJotBn5bDZ5kAhcRqsIHe3F75Walet5hNalwgFDtxb0BiDUjiUQkjG0yW2hto9HPgiCkm316d6bC0kST72YN7D7rfkhCE9x4J0XwB0yavalxpUu2t9xszHrmtwalOxT7VslsxWcB1qpqZwERUra4psWhTV8BgwWeizurec82Caf1ABL11YMfbf8FJ9JBceZOkgmvrQPbC9DUldX/yMbmX06UQluCEjSwUoyO+EZPIjofr+/oAZUck2enraRD+oWLlnlYnj8xB+gwSo9lmmks4fXv574qSqcWA6z21uYkzMu3EWj+K23RxeQlLqiE35/rC8GcS4CGkKHKKq+zAIQwD9iRDNfiAqueLLpicFFrNsAI4zeTD/eO9MHcnRa5m8UT+M2+V+AkFST4BlKneiAQRSdST8KEAIyFlULt6wa9EBd0Ds28VmpaxquJdVt+nwdEs5xUskI13OVtFyY0UrQIRAlCuvvWivvlSKQfTO+2Q8OyUR1W5RvetaPz4jD27hdtwHFFA1Ptx6Ee/t2cY2rg2G46M1pNDRf2pWhvpy8pqMnuI3++4OF3+7OFIWXGjh+o7Nr2jNvbiYcQdQS1h903/jVFgOpA0yJ78z+x759bFA0rq+6aY5qPB4FzS3oYoLupDUhD9nDz6F6H7hpnlMf18KNKDu4IKjTWwrAnY6MFQw1W6ymOALHlFyCZmQhldg1MQHaMVVQTVgDC60TfaBqG++Y8PEoFhN/PBTZT175KNP/BlHDYGOOBmnBdzqJKplZ/ljiVG0ZBzfqeBRrrUkn6rA54462SgiliKoYVnbeptMdXNfAuaupIEi0bApF10TlgHfmEJAPUVidRVFyDupSem5po5vErPqWKhKbUIp0LozpYsIKK57dM/HKr+nguF+7924IIWMICkQ8JUigs9D+W+c4LnNoRtPPKNRUiCYmP+Jfo2lfKCKw8qpraEeWU3uiNRO6zcyKQoXPR5htmzzLznke7b4YbXW3I1lIRzmgG02Udb58U+7TpwyN7XymCgH+wuPDthZVQvRZuEP+SnLtMicz9m5zASWOBiAcLmkuFlTKuHspSIhCBD0yUPKcxu81A+4YD78rA2vtwsUEday9WNyrShyrl60rWmA+SmbYZkQOwFJWArxRYYc5jGhA5ikxYw1rx3ei4NmeX/lKiwpZ9Ln1tV2Ae7sArvxuVLbJjqJRjW1vFXAyHpvLG+8MJ6T2Ubx5M2KDa2SN6vuIGxJ9WQM9Mk3Q7aCNiZONXllhqq24DmoLbQfW2rYWsOgHWjtOmIQMyMKdiHZDjoyIq5+U700nZ6odJAoYXPQBvFNiQ78d5jaXliBqLTJEqUCwi+LiH2mx92EmNKDsJL74Z613+3lf20pxkV1+erOrjj8pW00vsPaahKUM+05ssd5uwM7K482KWEf3TCwlg/o3e5ngto7qSMz7YteIgCsF1UOcsLk7F7MxWbvrPMY473ew0G+noVL8EPbkmEMftMSeL6HFub/zy+2JQ==\",\"base64\")).toString()),p5}var h5;function Jye(){return typeof h5>\"u\"&&(h5=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"G8MSIIzURnVBnObTcvb3XE6v2S9Qgc2K801Oa5otNKEtK8BINZNcaQHy+9/vf/WXBimwutXC33P2DPc64pps5rz7NGGWaOKNSPL4Y2KRE8twut2lFOIN+OXPtRmPMRhMTILib2bEQx43az2I5d3YS8Roa5UZpF/ujHb3Djd3GDvYUfvFYSUQ39vb2cmifp/rgB4J/65JK3wRBTvMBoNBmn3mbXC63/gbBkW/2IRPri0O8bcsRBsmarF328pAln04nyJFkwUA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zNOEgCWPyTct22V2mEi2krizn5VDo9B19/X2DB3hCGRMM7ONbtnAcIx/OWB1u5uPbW1gsH8irXxT/IzG0PoXWYjhbMsH3KTuoOl5o17PulcgvsfTSnKFM354GWI8luqZnrswWjiXy3G+Vbyo1KMopFmmvBwNELgaS8z8dNZchx/Cl/xjddxhMcyqtzFyONb2Zdu90NkI8pAeufe7YlXrp53v8Dj/l8vWeVspRKBGXScBBPI/HinSTGmLDOGGOCIyH0JFdOZx0gWsacNlQLJMIrBhqRxXxHF/5pseWwejlAAvZ3klZSDSYY8mkToaWejXhgNomeGtx1DTLEUFMRkgF5yFB22WYdJnaWN14r1YJj81hGi45+jrADS5nYRhCiSlCJJ1nL8pYX+HDSMhdTEWyRcgHVp/IsUIZYMfT+YYncUQPgcxNGCHfZ88vDdrcUuaGIl6zhAsiaq7R5dfqrqXH/JcBhfjT8D0azayIyEz75Nxp6YkcyDxlJq3EXnJUpqDohJJOysL1t1uNiHESlvsxPb5cpbW0+ICZqJmUZus1BMW0F5IVBODLIo2zHHjA0=\",\"base64\")).toString()),h5}var g5;function Kye(){return typeof g5>\"u\"&&(g5=Ie(\"zlib\").brotliDecompressSync(Buffer.from(\"m9XmPqMRsZ7bFo1U5CxexdgYepcdMsrcAbbqv7/rCXGM7SZhmJ2jPScITf1tA+qxuDFE8KC9mQaCs84ftss/pB0UrlDfSS52Q7rXyYIcHbrGG2egYMqC8FFfnNfZVLU+4ZieJEVLu1qxY0MYkbD8opX7TYstjKzqxwBObq8HUIQwogljOgs72xyCrxj0q79cf/hN2Ys/0fU6gkRgxFedikACuQLS4lvO/N5NpZ85m+BdO3c5VplDLMcfEDt6umRCbfM16uxnqUKPvPFg/qtuzzId3SjAxZFoZRqK3pdtWt/C+VU6+zuX09NsoBs3MwobpU1yyoXZnzA1EmiMRS5GfJeLxV51/jSXrfgTWr1af9hwKvqCfSVHiQuk+uO/N16Cror2c1QlthM7WkS/86azhK3b47PG6f5TAJVtrK7g+zlR2boyKBV+QkdOX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/mh/hiOQXtjzhatQ85YkdsD7v/8VPmJEog7ZUKj2jCxvO6LsXNCcLK7+niPQryHDEdafxurmo3xH/8VbK/jwV5rg03y/tvC9T1Rd8JKI2usEZSQgV1ss8+gJtjtpcD\",\"base64\")).toString()),g5}var zye=new Map([[G.makeIdent(null,\"fsevents\").identHash,Vye],[G.makeIdent(null,\"resolve\").identHash,Jye],[G.makeIdent(null,\"typescript\").identHash,Kye]]),xct={hooks:{registerPackageExtensions:async(t,e)=>{for(let[r,s]of A5)e(G.parseDescriptor(r,!0),s)},getBuiltinPatch:async(t,e)=>{let r=\"compat/\";if(!e.startsWith(r))return;let s=G.parseIdent(e.slice(r.length)),a=zye.get(s.identHash)?.();return typeof a<\"u\"?a:null},reduceDependency:async(t,e,r,s)=>typeof zye.get(t.identHash)>\"u\"?t:G.makeDescriptor(t,G.makeRange({protocol:\"patch:\",source:G.stringifyDescriptor(t),selector:`optional!builtin<compat/${G.stringifyIdent(t)}>`,params:null}))}},kct=xct;var T5={};Vt(T5,{ConstraintsCheckCommand:()=>XC,ConstraintsQueryCommand:()=>zC,ConstraintsSourceCommand:()=>ZC,default:()=>Kct});Ge();Ge();iS();var YC=class{constructor(e){this.project=e}createEnvironment(){let e=new WC([\"cwd\",\"ident\"]),r=new WC([\"workspace\",\"type\",\"ident\"]),s=new WC([\"ident\"]),a={manifestUpdates:new Map,reportedErrors:new Map},n=new Map,c=new Map;for(let f of this.project.storedPackages.values()){let p=Array.from(f.peerDependencies.values(),h=>[G.stringifyIdent(h),h.range]);n.set(f.locatorHash,{workspace:null,ident:G.stringifyIdent(f),version:f.version,dependencies:new Map,peerDependencies:new Map(p.filter(([h])=>f.peerDependenciesMeta.get(h)?.optional!==!0)),optionalPeerDependencies:new Map(p.filter(([h])=>f.peerDependenciesMeta.get(h)?.optional===!0))})}for(let f of this.project.storedPackages.values()){let p=n.get(f.locatorHash);p.dependencies=new Map(Array.from(f.dependencies.values(),h=>{let E=this.project.storedResolutions.get(h.descriptorHash);if(typeof E>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");let C=n.get(E);if(typeof C>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");return[G.stringifyIdent(h),C]})),p.dependencies.delete(p.ident)}for(let f of this.project.workspaces){let p=G.stringifyIdent(f.anchoredLocator),h=f.manifest.exportTo({}),E=n.get(f.anchoredLocator.locatorHash);if(typeof E>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");let C=(T,N,{caller:U=fs.getCaller()}={})=>{let W=nS(T),ee=je.getMapWithDefault(a.manifestUpdates,f.cwd),ie=je.getMapWithDefault(ee,W),ue=je.getSetWithDefault(ie,N);U!==null&&ue.add(U)},S=T=>C(T,void 0,{caller:fs.getCaller()}),b=T=>{je.getArrayWithDefault(a.reportedErrors,f.cwd).push(T)},I=e.insert({cwd:f.relativeCwd,ident:p,manifest:h,pkg:E,set:C,unset:S,error:b});c.set(f,I);for(let T of Ut.allDependencies)for(let N of f.manifest[T].values()){let U=G.stringifyIdent(N),W=()=>{C([T,U],void 0,{caller:fs.getCaller()})},ee=ue=>{C([T,U],ue,{caller:fs.getCaller()})},ie=null;if(T!==\"peerDependencies\"&&(T!==\"dependencies\"||!f.manifest.devDependencies.has(N.identHash))){let ue=f.anchoredPackage.dependencies.get(N.identHash);if(ue){if(typeof ue>\"u\")throw new Error(\"Assertion failed: The dependency should have been registered\");let le=this.project.storedResolutions.get(ue.descriptorHash);if(typeof le>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");let me=n.get(le);if(typeof me>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");ie=me}}r.insert({workspace:I,ident:U,range:N.range,type:T,resolution:ie,update:ee,delete:W,error:b})}}for(let f of this.project.storedPackages.values()){let p=this.project.tryWorkspaceByLocator(f);if(!p)continue;let h=c.get(p);if(typeof h>\"u\")throw new Error(\"Assertion failed: The workspace should have been registered\");let E=n.get(f.locatorHash);if(typeof E>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");E.workspace=h}return{workspaces:e,dependencies:r,packages:s,result:a}}async process(){let e=this.createEnvironment(),r={Yarn:{workspace:a=>e.workspaces.find(a)[0]??null,workspaces:a=>e.workspaces.find(a),dependency:a=>e.dependencies.find(a)[0]??null,dependencies:a=>e.dependencies.find(a),package:a=>e.packages.find(a)[0]??null,packages:a=>e.packages.find(a)}},s=await this.project.loadUserConfig();return s?.constraints?(await s.constraints(r),e.result):null}};Ge();Ge();Yt();var zC=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.query=ge.String()}static{this.paths=[[\"constraints\",\"query\"]]}static{this.usage=ot.Usage({category:\"Constraints-related commands\",description:\"query the constraints fact database\",details:`\n      This command will output all matches to the given prolog query.\n    `,examples:[[\"List all dependencies throughout the workspace\",\"yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'\"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(lS(),aS)),s=await ze.find(this.context.cwd,this.context.plugins),{project:a}=await Rt.find(s,this.context.cwd),n=await r.find(a),c=this.query;return c.endsWith(\".\")||(c=`${c}.`),(await Ot.start({configuration:s,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(c)){let E=Array.from(Object.entries(h)),C=E.length,S=E.reduce((b,[I])=>Math.max(b,I.length),0);for(let b=0;b<C;b++){let[I,T]=E[b];p.reportInfo(null,`${Vct(b,C)}${I.padEnd(S,\" \")} = ${Yct(T)}`)}p.reportJson(h)}})).exitCode()}};function Yct(t){return typeof t!=\"string\"?`${t}`:t.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?t:`'${t}'`}function Vct(t,e){let r=t===0,s=t===e-1;return r&&s?\"\":r?\"\\u250C \":s?\"\\u2514 \":\"\\u2502 \"}Ge();Yt();var ZC=class extends ft{constructor(){super(...arguments);this.verbose=ge.Boolean(\"-v,--verbose\",!1,{description:\"Also print the fact database automatically compiled from the workspace manifests\"})}static{this.paths=[[\"constraints\",\"source\"]]}static{this.usage=ot.Usage({category:\"Constraints-related commands\",description:\"print the source code for the constraints\",details:\"\\n      This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\\n    \",examples:[[\"Prints the source code\",\"yarn constraints source\"],[\"Print the source code and the fact database\",\"yarn constraints source -v\"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(lS(),aS)),s=await ze.find(this.context.cwd,this.context.plugins),{project:a}=await Rt.find(s,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ge();Ge();Yt();iS();var XC=class extends ft{constructor(){super(...arguments);this.fix=ge.Boolean(\"--fix\",!1,{description:\"Attempt to automatically fix unambiguous issues, following a multi-pass process\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"constraints\"]]}static{this.usage=ot.Usage({category:\"Constraints-related commands\",description:\"check that the project constraints are met\",details:`\n      This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.\n\n      If the \\`--fix\\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.\n\n      For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.\n    `,examples:[[\"Check that all constraints are satisfied\",\"yarn constraints\"],[\"Autofix all unmet constraints\",\"yarn constraints --fix\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);await s.restoreInstallState();let a=await s.loadUserConfig(),n;if(a?.constraints)n=new YC(s);else{let{Constraints:h}=await Promise.resolve().then(()=>(lS(),aS));n=await h.find(s)}let c,f=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:C,remainingErrors:S}=nF(s,E,{fix:this.fix}),b=[];for(let[I,T]of C){let N=I.manifest.indent;I.manifest=new Ut,I.manifest.indent=N,I.manifest.load(T),b.push(I.persistManifest())}if(await Promise.all(b),!(C.size>0&&h>1)){c=Zye(S,{configuration:r}),f=!1,p=!0;for(let[,I]of S)for(let T of I)T.fixable?f=!0:p=!1}}if(c.children.length===0)return 0;if(f){let h=p?`Those errors can all be fixed by running ${he.pretty(r,\"yarn constraints --fix\",he.Type.CODE)}`:`Errors prefixed by '\\u2699' can be fixed by running ${he.pretty(r,\"yarn constraints --fix\",he.Type.CODE)}`;await Ot.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return c.children=je.sortMap(c.children,h=>h.value[1]),xs.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};iS();var Jct={configuration:{enableConstraintsChecks:{description:\"If true, constraints will run during installs\",type:\"BOOLEAN\",default:!1},constraintsPath:{description:\"The path of the constraints file.\",type:\"ABSOLUTE_PATH\",default:\"./constraints.pro\"}},commands:[zC,ZC,XC],hooks:{async validateProjectAfterInstall(t,{reportError:e}){if(!t.configuration.get(\"enableConstraintsChecks\"))return;let r=await t.loadUserConfig(),s;if(r?.constraints)s=new YC(t);else{let{Constraints:c}=await Promise.resolve().then(()=>(lS(),aS));s=await c.find(t)}let a=await s.process();if(!a)return;let{remainingErrors:n}=nF(t,a);if(n.size!==0)if(t.configuration.isCI)for(let[c,f]of n)for(let p of f)e(84,`${he.pretty(t.configuration,c.anchoredLocator,he.Type.IDENT)}: ${p.text}`);else e(84,`Constraint check failed; run ${he.pretty(t.configuration,\"yarn constraints\",he.Type.CODE)} for more details`)}}},Kct=Jct;var F5={};Vt(F5,{CreateCommand:()=>$C,DlxCommand:()=>ew,default:()=>Zct});Ge();Yt();var $C=class extends ft{constructor(){super(...arguments);this.pkg=ge.String(\"-p,--package\",{description:\"The package to run the provided command from\"});this.quiet=ge.Boolean(\"-q,--quiet\",!1,{description:\"Only report critical errors instead of printing the full install logs\"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"create\"]]}async execute(){let r=[];this.pkg&&r.push(\"--package\",this.pkg),this.quiet&&r.push(\"--quiet\");let s=this.command.replace(/^(@[^@/]+)(@|$)/,\"$1/create$2\"),a=G.parseDescriptor(s),n=a.name.match(/^create(-|$)/)?a:a.scope?G.makeIdent(a.scope,`create-${a.name}`):G.makeIdent(null,`create-${a.name}`),c=G.stringifyIdent(n);return a.range!==\"unknown\"&&(c+=`@${a.range}`),this.cli.run([\"dlx\",...r,c,...this.args])}};Ge();Ge();Dt();Yt();var ew=class extends ft{constructor(){super(...arguments);this.packages=ge.Array(\"-p,--package\",{description:\"The package(s) to install before running the command\"});this.quiet=ge.Boolean(\"-q,--quiet\",!1,{description:\"Only report critical errors instead of printing the full install logs\"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"dlx\"]]}static{this.usage=ot.Usage({description:\"run a package in a temporary environment\",details:\"\\n      This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\\n\\n      By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\\n\\n      Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\\n    \",examples:[[\"Use create-vite to scaffold a new Vite project\",\"yarn dlx create-vite\"],[\"Install multiple packages for a single command\",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e \"console.log('hello!')\"`]]})}async execute(){return ze.telemetry=null,await ce.mktempPromise(async r=>{let s=J.join(r,`dlx-${process.pid}`);await ce.mkdirPromise(s),await ce.writeFilePromise(J.join(s,\"package.json\"),`{}\n`),await ce.writeFilePromise(J.join(s,\"yarn.lock\"),\"\");let a=J.join(s,\".yarnrc.yml\"),n=await ze.findProjectCwd(this.context.cwd),f={enableGlobalCache:!(await ze.find(this.context.cwd,null,{strict:!1})).get(\"enableGlobalCache\"),enableTelemetry:!1,logFilters:[{code:Yf(68),level:he.LogLevel.Discard}]},p=n!==null?J.join(n,\".yarnrc.yml\"):null;p!==null&&ce.existsSync(p)?(await ce.copyFilePromise(p,a),await ze.updateConfiguration(s,N=>{let U=je.toMerged(N,f);return Array.isArray(N.plugins)&&(U.plugins=N.plugins.map(W=>{let ee=typeof W==\"string\"?W:W.path,ie=fe.isAbsolute(ee)?ee:fe.resolve(fe.fromPortablePath(n),ee);return typeof W==\"string\"?ie:{path:ie,spec:W.spec}})),U})):await ce.writeJsonPromise(a,f);let h=this.packages??[this.command],E=G.parseDescriptor(this.command).name,C=await this.cli.run([\"add\",\"--fixed\",\"--\",...h],{cwd:s,quiet:this.quiet});if(C!==0)return C;this.quiet||this.context.stdout.write(`\n`);let S=await ze.find(s,this.context.plugins),{project:b,workspace:I}=await Rt.find(S,s);if(I===null)throw new ar(b.cwd,s);await b.restoreInstallState();let T=await In.getWorkspaceAccessibleBinaries(I);return T.has(E)===!1&&T.size===1&&typeof this.packages>\"u\"&&(E=Array.from(T)[0][0]),await In.executeWorkspaceAccessibleBinary(I,E,this.args,{packageAccessibleBinaries:T,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var zct={commands:[$C,ew]},Zct=zct;var L5={};Vt(L5,{ExecFetcher:()=>uS,ExecResolver:()=>fS,default:()=>eut,execUtils:()=>aF});Ge();Ge();Dt();var cA=\"exec:\";var aF={};Vt(aF,{loadGeneratorFile:()=>cS,makeLocator:()=>O5,makeSpec:()=>BEe,parseSpec:()=>N5});Ge();Dt();function N5(t){let{params:e,selector:r}=G.parseRange(t),s=fe.toPortablePath(r);return{parentLocator:e&&typeof e.locator==\"string\"?G.parseLocator(e.locator):null,path:s}}function BEe({parentLocator:t,path:e,generatorHash:r,protocol:s}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<\"u\"?{hash:r}:{};return G.makeRange({protocol:s,source:e,selector:e,params:{...n,...a}})}function O5(t,{parentLocator:e,path:r,generatorHash:s,protocol:a}){return G.makeLocator(t,BEe({parentLocator:e,path:r,generatorHash:s,protocol:a}))}async function cS(t,e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(t,{protocol:e}),n=J.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=J.join(c.prefixPath,a);return await f.readFilePromise(p,\"utf8\")}var uS=class{supports(e,r){return!!e.reference.startsWith(cA)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:cA});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async fetchFromDisk(e,r){let s=await cS(e.reference,cA,r);return ce.mktempPromise(async a=>{let n=J.join(a,\"generator.js\");return await ce.writeFilePromise(n,s),ce.mktempPromise(async c=>{if(await this.generatePackage(c,e,n,r),!ce.existsSync(J.join(c,\"build\")))throw new Error(\"The script should have generated a build directory\");return await ps.makeArchiveFromDirectory(J.join(c,\"build\"),{prefixPath:G.getIdentVendorPath(e),compressionLevel:r.project.configuration.get(\"compressionLevel\")})})})}async generatePackage(e,r,s,a){return await ce.mktempPromise(async n=>{let c=await In.makeScriptEnv({project:a.project,binFolder:n}),f=J.join(e,\"runtime.js\");return await ce.mktempPromise(async p=>{let h=J.join(p,\"buildfile.log\"),E=J.join(e,\"generator\"),C=J.join(e,\"build\");await ce.mkdirPromise(E),await ce.mkdirPromise(C);let S={tempDir:fe.fromPortablePath(E),buildDir:fe.fromPortablePath(C),locator:G.stringifyLocator(r)};await ce.writeFilePromise(f,`\n          // Expose 'Module' as a global variable\n          Object.defineProperty(global, 'Module', {\n            get: () => require('module'),\n            configurable: true,\n            enumerable: false,\n          });\n\n          // Expose non-hidden built-in modules as global variables\n          for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {\n            Object.defineProperty(global, name, {\n              get: () => require(name),\n              configurable: true,\n              enumerable: false,\n            });\n          }\n\n          // Expose the 'execEnv' global variable\n          Object.defineProperty(global, 'execEnv', {\n            value: {\n              ...${JSON.stringify(S)},\n            },\n            enumerable: true,\n          });\n        `);let b=c.NODE_OPTIONS||\"\",I=/\\s*--require\\s+\\S*\\.pnp\\.c?js\\s*/g;b=b.replace(I,\" \").trim(),c.NODE_OPTIONS=b;let{stdout:T,stderr:N}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${G.stringifyLocator(r)})\n`,prefix:G.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await qr.pipevp(process.execPath,[\"--require\",fe.fromPortablePath(f),fe.fromPortablePath(s),G.stringifyIdent(r)],{cwd:e,env:c,stdin:null,stdout:T,stderr:N});if(U!==0)throw ce.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${he.pretty(a.project.configuration,h,he.Type.PATH)})`)})})}};Ge();Ge();var Xct=2,fS=class{supportsDescriptor(e,r){return!!e.range.startsWith(cA)}supportsLocator(e,r){return!!e.reference.startsWith(cA)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{path:a,parentLocator:n}=N5(e.range);if(n===null)throw new Error(\"Assertion failed: The descriptor should have been bound\");let c=await cS(G.makeRange({protocol:cA,source:a,selector:a,params:{locator:G.stringifyLocator(n)}}),cA,s.fetchOptions),f=Nn.makeHash(`${Xct}`,c).slice(0,6);return[O5(e,{parentLocator:n,path:a,generatorHash:f,protocol:cA})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var $ct={fetchers:[uS],resolvers:[fS]},eut=$ct;var U5={};Vt(U5,{FileFetcher:()=>gS,FileResolver:()=>dS,TarballFileFetcher:()=>mS,TarballFileResolver:()=>yS,default:()=>nut,fileUtils:()=>xm});Ge();Dt();var tw=/^(?:[a-zA-Z]:[\\\\/]|\\.{0,2}\\/)/,AS=/^[^?]*\\.(?:tar\\.gz|tgz)(?:::.*)?$/,$i=\"file:\";var xm={};Vt(xm,{fetchArchiveFromLocator:()=>hS,makeArchiveFromLocator:()=>lF,makeBufferFromLocator:()=>M5,makeLocator:()=>rw,makeSpec:()=>vEe,parseSpec:()=>pS});Ge();Dt();function pS(t){let{params:e,selector:r}=G.parseRange(t),s=fe.toPortablePath(r);return{parentLocator:e&&typeof e.locator==\"string\"?G.parseLocator(e.locator):null,path:s}}function vEe({parentLocator:t,path:e,hash:r,protocol:s}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<\"u\"?{hash:r}:{};return G.makeRange({protocol:s,source:e,selector:e,params:{...n,...a}})}function rw(t,{parentLocator:e,path:r,hash:s,protocol:a}){return G.makeLocator(t,vEe({parentLocator:e,path:r,hash:s,protocol:a}))}async function hS(t,e){let{parentLocator:r,path:s}=G.parseFileStyleRange(t.reference,{protocol:$i}),a=J.isAbsolute(s)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await e.fetcher.fetch(r,e),n=a.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let c=n.packageFs,f=J.join(n.prefixPath,s);return await je.releaseAfterUseAsync(async()=>await c.readFilePromise(f),n.releaseFs)}async function lF(t,{protocol:e,fetchOptions:r,inMemory:s=!1}){let{parentLocator:a,path:n}=G.parseFileStyleRange(t.reference,{protocol:e}),c=J.isAbsolute(n)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let p=f.packageFs,h=J.join(f.prefixPath,n);return await je.releaseAfterUseAsync(async()=>await ps.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:G.getIdentVendorPath(t),compressionLevel:r.project.configuration.get(\"compressionLevel\"),inMemory:s}),f.releaseFs)}async function M5(t,{protocol:e,fetchOptions:r}){return(await lF(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var gS=class{supports(e,r){return!!e.reference.startsWith($i)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:$i});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async fetchFromDisk(e,r){return lF(e,{protocol:$i,fetchOptions:r})}};Ge();Ge();var tut=2,dS=class{supportsDescriptor(e,r){return e.range.match(tw)?!0:!!e.range.startsWith($i)}supportsLocator(e,r){return!!e.reference.startsWith($i)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return tw.test(e.range)&&(e=G.makeDescriptor(e,`${$i}${e.range}`)),G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{path:a,parentLocator:n}=pS(e.range);if(n===null)throw new Error(\"Assertion failed: The descriptor should have been bound\");let c=await M5(G.makeLocator(e,G.makeRange({protocol:$i,source:a,selector:a,params:{locator:G.stringifyLocator(n)}})),{protocol:$i,fetchOptions:s.fetchOptions}),f=Nn.makeHash(`${tut}`,c).slice(0,6);return[rw(e,{parentLocator:n,path:a,hash:f,protocol:$i})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};Ge();var mS=class{supports(e,r){return AS.test(e.reference)?!!e.reference.startsWith($i):!1}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromDisk(e,r){let s=await hS(e,r);return await ps.convertToZip(s,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();Ge();Ge();var yS=class{supportsDescriptor(e,r){return AS.test(e.range)?!!(e.range.startsWith($i)||tw.test(e.range)):!1}supportsLocator(e,r){return AS.test(e.reference)?!!e.reference.startsWith($i):!1}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return tw.test(e.range)&&(e=G.makeDescriptor(e,`${$i}${e.range}`)),G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{path:a,parentLocator:n}=pS(e.range);if(n===null)throw new Error(\"Assertion failed: The descriptor should have been bound\");let c=rw(e,{parentLocator:n,path:a,hash:\"\",protocol:$i}),f=await hS(c,s.fetchOptions),p=Nn.makeHash(f).slice(0,6);return[rw(e,{parentLocator:n,path:a,hash:p,protocol:$i})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var rut={fetchers:[mS,gS],resolvers:[yS,dS]},nut=rut;var j5={};Vt(j5,{GithubFetcher:()=>ES,default:()=>sut,githubUtils:()=>cF});Ge();Dt();var cF={};Vt(cF,{invalidGithubUrlMessage:()=>PEe,isGithubUrl:()=>_5,parseGithubUrl:()=>H5});var SEe=ut(Ie(\"querystring\")),DEe=[/^https?:\\/\\/(?:([^/]+?)@)?github.com\\/([^/#]+)\\/([^/#]+)\\/tarball\\/([^/#]+)(?:#(.*))?$/,/^https?:\\/\\/(?:([^/]+?)@)?github.com\\/([^/#]+)\\/([^/#]+?)(?:\\.git)?(?:#(.*))?$/];function _5(t){return t?DEe.some(e=>!!t.match(e)):!1}function H5(t){let e;for(let f of DEe)if(e=t.match(f),e)break;if(!e)throw new Error(PEe(t));let[,r,s,a,n=\"master\"]=e,{commit:c}=SEe.default.parse(n);return n=c||n.replace(/[^:]*:/,\"\"),{auth:r,username:s,reponame:a,treeish:n}}function PEe(t){return`Input cannot be parsed as a valid GitHub URL ('${t}').`}var ES=class{supports(e,r){return!!_5(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from GitHub`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s=await ln.get(this.getLocatorUrl(e,r),{configuration:r.project.configuration});return await ce.mktempPromise(async a=>{let n=new Sn(a);await ps.extractArchiveTo(s,n,{stripComponents:1});let c=ka.splitRepoUrl(e.reference),f=J.join(a,\"package.tgz\");await In.prepareExternalProject(a,f,{configuration:r.project.configuration,report:r.report,workspace:c.extra.workspace,locator:e});let p=await ce.readFilePromise(f);return await ps.convertToZip(p,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})})}getLocatorUrl(e,r){let{auth:s,username:a,reponame:n,treeish:c}=H5(e.reference);return`https://${s?`${s}@`:\"\"}github.com/${a}/${n}/archive/${c}.tar.gz`}};var iut={hooks:{async fetchHostedRepository(t,e,r){if(t!==null)return t;let s=new ES;if(!s.supports(e,r))return null;try{return await s.fetch(e,r)}catch{return null}}}},sut=iut;var G5={};Vt(G5,{TarballHttpFetcher:()=>CS,TarballHttpResolver:()=>wS,default:()=>aut});Ge();function IS(t){let e;try{e=new URL(t)}catch{return!1}return!(e.protocol!==\"http:\"&&e.protocol!==\"https:\"||!e.pathname.match(/(\\.tar\\.gz|\\.tgz|\\/[^.]+)$/))}var CS=class{supports(e,r){return IS(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s=await ln.get(e.reference,{configuration:r.project.configuration});return await ps.convertToZip(s,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();Ge();var wS=class{supportsDescriptor(e,r){return IS(e.range)}supportsLocator(e,r){return IS(e.reference)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){return[G.convertDescriptorToLocator(e)]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"HARD\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var out={fetchers:[CS],resolvers:[wS]},aut=out;var q5={};Vt(q5,{InitCommand:()=>z0,InitInitializerCommand:()=>nw,default:()=>cut});Yt();Ge();Ge();Dt();Yt();var z0=class extends ft{constructor(){super(...arguments);this.private=ge.Boolean(\"-p,--private\",!1,{description:\"Initialize a private package\"});this.workspace=ge.Boolean(\"-w,--workspace\",!1,{description:\"Initialize a workspace root with a `packages/` directory\"});this.install=ge.String(\"-i,--install\",!1,{tolerateBoolean:!0,description:\"Initialize a package with a specific bundle that will be locked in the project\"});this.name=ge.String(\"-n,--name\",{description:\"Initialize a package with the given name\"});this.usev2=ge.Boolean(\"-2\",!1,{hidden:!0});this.yes=ge.Boolean(\"-y,--yes\",{hidden:!0})}static{this.paths=[[\"init\"]]}static{this.usage=ot.Usage({description:\"create a new package\",details:\"\\n      This command will setup a new package in your local directory.\\n\\n      If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\\n\\n      If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\\n\\n      If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\\n\\n      The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\\n    \",examples:[[\"Create a new package in the local directory\",\"yarn init\"],[\"Create a new private package in the local directory\",\"yarn init -p\"],[\"Create a new package and store the Yarn release inside\",\"yarn init -i=latest\"],[\"Create a new private package and defines it as a workspace root\",\"yarn init -w\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=typeof this.install==\"string\"?this.install:this.usev2||this.install===!0?\"latest\":null;return s!==null?await this.executeProxy(r,s):await this.executeRegular(r)}async executeProxy(r,s){if(r.projectCwd!==null&&r.projectCwd!==this.context.cwd)throw new nt(\"Cannot use the --install flag from within a project subdirectory\");ce.existsSync(this.context.cwd)||await ce.mkdirPromise(this.context.cwd,{recursive:!0});let a=J.join(this.context.cwd,Er.lockfile);ce.existsSync(a)||await ce.writeFilePromise(a,\"\");let n=await this.cli.run([\"set\",\"version\",s],{quiet:!0});if(n!==0)return n;let c=[];return this.private&&c.push(\"-p\"),this.workspace&&c.push(\"-w\"),this.name&&c.push(`-n=${this.name}`),this.yes&&c.push(\"-y\"),await ce.mktempPromise(async f=>{let{code:p}=await qr.pipevp(\"yarn\",[\"init\",...c],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await In.makeScriptEnv({binFolder:f})});return p})}async initialize(){}async executeRegular(r){let s=null;try{s=(await Rt.find(r,this.context.cwd)).project}catch{s=null}ce.existsSync(this.context.cwd)||await ce.mkdirPromise(this.context.cwd,{recursive:!0});let a=await Ut.tryFind(this.context.cwd),n=a??new Ut,c=Object.fromEntries(r.get(\"initFields\").entries());n.load(c),n.name=n.name??G.makeIdent(r.get(\"initScope\"),this.name??J.basename(this.context.cwd)),n.packageManager=fn&&je.isTaggedYarnVersion(fn)?`yarn@${fn}`:null,(!a&&this.workspace||this.private)&&(n.private=!0),this.workspace&&n.workspaceDefinitions.length===0&&(await ce.mkdirPromise(J.join(this.context.cwd,\"packages\"),{recursive:!0}),n.workspaceDefinitions=[{pattern:\"packages/*\"}]);let f={};n.exportTo(f);let p=J.join(this.context.cwd,Ut.fileName);await ce.changeFilePromise(p,`${JSON.stringify(f,null,2)}\n`,{automaticNewlines:!0});let h=[p],E=J.join(this.context.cwd,\"README.md\");if(ce.existsSync(E)||(await ce.writeFilePromise(E,`# ${G.stringifyIdent(n.name)}\n`),h.push(E)),!s||s.cwd===this.context.cwd){let C=J.join(this.context.cwd,Er.lockfile);ce.existsSync(C)||(await ce.writeFilePromise(C,\"\"),h.push(C));let b=[\".yarn/*\",\"!.yarn/patches\",\"!.yarn/plugins\",\"!.yarn/releases\",\"!.yarn/sdks\",\"!.yarn/versions\",\"\",\"# Whether you use PnP or not, the node_modules folder is often used to store\",\"# build artifacts that should be gitignored\",\"node_modules\",\"\",\"# Swap the comments on the following lines if you wish to use zero-installs\",\"# In that case, don't forget to run `yarn config set enableGlobalCache false`!\",\"# Documentation here: https://yarnpkg.com/features/caching#zero-installs\",\"\",\"#!.yarn/cache\",\".pnp.*\"].map(ue=>`${ue}\n`).join(\"\"),I=J.join(this.context.cwd,\".gitignore\");ce.existsSync(I)||(await ce.writeFilePromise(I,b),h.push(I));let N=[\"/.yarn/**            linguist-vendored\",\"/.yarn/releases/*    binary\",\"/.yarn/plugins/**/*  binary\",\"/.pnp.*              binary linguist-generated\"].map(ue=>`${ue}\n`).join(\"\"),U=J.join(this.context.cwd,\".gitattributes\");ce.existsSync(U)||(await ce.writeFilePromise(U,N),h.push(U));let W={\"*\":{charset:\"utf-8\",endOfLine:\"lf\",indentSize:2,indentStyle:\"space\",insertFinalNewline:!0}};je.mergeIntoTarget(W,r.get(\"initEditorConfig\"));let ee=`root = true\n`;for(let[ue,le]of Object.entries(W)){ee+=`\n[${ue}]\n`;for(let[me,pe]of Object.entries(le)){let Be=me.replace(/[A-Z]/g,Ce=>`_${Ce.toLowerCase()}`);ee+=`${Be} = ${pe}\n`}}let ie=J.join(this.context.cwd,\".editorconfig\");ce.existsSync(ie)||(await ce.writeFilePromise(ie,ee),h.push(ie)),await this.cli.run([\"install\"],{quiet:!0}),await this.initialize(),ce.existsSync(J.join(this.context.cwd,\".git\"))||(await qr.execvp(\"git\",[\"init\"],{cwd:this.context.cwd}),await qr.execvp(\"git\",[\"add\",\"--\",...h],{cwd:this.context.cwd}),await qr.execvp(\"git\",[\"commit\",\"--allow-empty\",\"-m\",\"First commit\"],{cwd:this.context.cwd}))}}};var nw=class extends z0{constructor(){super(...arguments);this.initializer=ge.String();this.argv=ge.Proxy()}static{this.paths=[[\"init\"]]}async initialize(){this.context.stdout.write(`\n`),await this.cli.run([\"dlx\",this.initializer,...this.argv],{quiet:!0})}};var lut={configuration:{initScope:{description:\"Scope used when creating packages via the init command\",type:\"STRING\",default:null},initFields:{description:\"Additional fields to set when creating packages via the init command\",type:\"MAP\",valueDefinition:{description:\"\",type:\"ANY\"}},initEditorConfig:{description:\"Extra rules to define in the generator editorconfig\",type:\"MAP\",valueDefinition:{description:\"\",type:\"ANY\"}}},commands:[z0,nw]},cut=lut;var HW={};Vt(HW,{SearchCommand:()=>Iw,UpgradeInteractiveCommand:()=>Cw,default:()=>ygt});Ge();var xEe=ut(Ie(\"os\"));function iw({stdout:t}){if(xEe.default.endianness()===\"BE\")throw new Error(\"Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures\");if(!t.isTTY)throw new Error(\"Interactive commands can only be used inside a TTY environment\")}Yt();var HIe=ut(l9()),c9={appId:\"OFCNCOG2CU\",apiKey:\"6fe4476ee5a1832882e326b506d14126\",indexName:\"npm-search\"},oAt=(0,HIe.default)(c9.appId,c9.apiKey).initIndex(c9.indexName),u9=async(t,e=0)=>await oAt.search(t,{analyticsTags:[\"yarn-plugin-interactive-tools\"],attributesToRetrieve:[\"name\",\"version\",\"owner\",\"repository\",\"humanDownloadsLast30Days\"],page:e,hitsPerPage:10});var CD=[\"regular\",\"dev\",\"peer\"],Iw=class extends ft{static{this.paths=[[\"search\"]]}static{this.usage=ot.Usage({category:\"Interactive commands\",description:\"open the search interface\",details:`\n    This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.\n    `,examples:[[\"Open the search window\",\"yarn search\"]]})}async execute(){iw(this.context);let{Gem:e}=await Promise.resolve().then(()=>(qF(),kW)),{ScrollableItems:r}=await Promise.resolve().then(()=>(JF(),VF)),{useKeypress:s}=await Promise.resolve().then(()=>(yD(),m2e)),{useMinistore:a}=await Promise.resolve().then(()=>(OW(),NW)),{renderForm:n}=await Promise.resolve().then(()=>(XF(),ZF)),{default:c}=await Promise.resolve().then(()=>ut(P2e())),{Box:f,Text:p}=await Promise.resolve().then(()=>ut(Wc())),{default:h,useEffect:E,useState:C}=await Promise.resolve().then(()=>ut(hn())),S=await ze.find(this.context.cwd,this.context.plugins),b=()=>h.createElement(f,{flexDirection:\"row\"},h.createElement(f,{flexDirection:\"column\",width:48},h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to move between packages.\")),h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<space>\"),\" to select a package.\")),h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<space>\"),\" again to change the target.\"))),h.createElement(f,{flexDirection:\"column\"},h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to install the selected packages.\")),h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),I=()=>h.createElement(h.Fragment,null,h.createElement(f,{width:15},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Owner\")),h.createElement(f,{width:11},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Version\")),h.createElement(f,{width:10},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Downloads\"))),T=()=>h.createElement(f,{width:17},h.createElement(p,{bold:!0,underline:!0,color:\"gray\"},\"Target\")),N=({hit:pe,active:Be})=>{let[Ce,g]=a(pe.name,null);s({active:Be},(Ae,se)=>{if(se.name!==\"space\")return;if(!Ce){g(CD[0]);return}let X=CD.indexOf(Ce)+1;X===CD.length?g(null):g(CD[X])},[Ce,g]);let we=G.parseIdent(pe.name),ye=G.prettyIdent(S,we);return h.createElement(f,null,h.createElement(f,{width:45},h.createElement(p,{bold:!0,wrap:\"wrap\"},ye)),h.createElement(f,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:\"truncate\"},pe.owner.name)),h.createElement(f,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:\"truncate\"},pe.version)),h.createElement(f,{width:16,marginLeft:1},h.createElement(p,null,pe.humanDownloadsLast30Days)))},U=({name:pe,active:Be})=>{let[Ce]=a(pe,null),g=G.parseIdent(pe);return h.createElement(f,null,h.createElement(f,{width:47},h.createElement(p,{bold:!0},\" - \",G.prettyIdent(S,g))),CD.map(we=>h.createElement(f,{key:we,width:14,marginLeft:1},h.createElement(p,null,\" \",h.createElement(e,{active:Ce===we}),\" \",h.createElement(p,{bold:!0},we)))))},W=()=>h.createElement(f,{marginTop:1},h.createElement(p,null,\"Powered by Algolia.\")),ie=await n(({useSubmit:pe})=>{let Be=a();pe(Be);let Ce=Array.from(Be.keys()).filter(j=>Be.get(j)!==null),[g,we]=C(\"\"),[ye,Ae]=C(0),[se,X]=C([]),De=j=>{j.match(/\\t| /)||we(j)},Te=async()=>{Ae(0);let j=await u9(g);j.query===g&&X(j.hits)},mt=async()=>{let j=await u9(g,ye+1);j.query===g&&j.page-1===ye&&(Ae(j.page),X([...se,...j.hits]))};return E(()=>{g?Te():X([])},[g]),h.createElement(f,{flexDirection:\"column\"},h.createElement(b,null),h.createElement(f,{flexDirection:\"row\",marginTop:1},h.createElement(p,{bold:!0},\"Search: \"),h.createElement(f,{width:41},h.createElement(c,{value:g,onChange:De,placeholder:\"i.e. babel, webpack, react...\",showCursor:!1})),h.createElement(I,null)),se.length?h.createElement(r,{radius:2,loop:!1,children:se.map(j=>h.createElement(N,{key:j.name,hit:j,active:!1})),willReachEnd:mt}):h.createElement(p,{color:\"gray\"},\"Start typing...\"),h.createElement(f,{flexDirection:\"row\",marginTop:1},h.createElement(f,{width:49},h.createElement(p,{bold:!0},\"Selected:\")),h.createElement(T,null)),Ce.length?Ce.map(j=>h.createElement(U,{key:j,name:j,active:!1})):h.createElement(p,{color:\"gray\"},\"No selected packages...\"),h.createElement(W,null))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof ie>\"u\")return 1;let ue=Array.from(ie.keys()).filter(pe=>ie.get(pe)===\"regular\"),le=Array.from(ie.keys()).filter(pe=>ie.get(pe)===\"dev\"),me=Array.from(ie.keys()).filter(pe=>ie.get(pe)===\"peer\");return ue.length&&await this.cli.run([\"add\",...ue]),le.length&&await this.cli.run([\"add\",\"--dev\",...le]),me&&await this.cli.run([\"add\",\"--peer\",...me]),0}};Ge();Yt();GG();var F2e=ut(Ai()),T2e=/^((?:[\\^~]|>=?)?)([0-9]+)(\\.[0-9]+)(\\.[0-9]+)((?:-\\S+)?)$/;function N2e(t,e){return t.length>0?[t.slice(0,e)].concat(N2e(t.slice(e),e)):[]}var Cw=class extends ft{static{this.paths=[[\"upgrade-interactive\"]]}static{this.usage=ot.Usage({category:\"Interactive commands\",description:\"open the upgrade interface\",details:`\n      This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.\n    `,examples:[[\"Open the upgrade window\",\"yarn upgrade-interactive\"]]})}async execute(){iw(this.context);let{ItemOptions:e}=await Promise.resolve().then(()=>(R2e(),Q2e)),{Pad:r}=await Promise.resolve().then(()=>(_W(),k2e)),{ScrollableItems:s}=await Promise.resolve().then(()=>(JF(),VF)),{useMinistore:a}=await Promise.resolve().then(()=>(OW(),NW)),{renderForm:n}=await Promise.resolve().then(()=>(XF(),ZF)),{Box:c,Text:f}=await Promise.resolve().then(()=>ut(Wc())),{default:p,useEffect:h,useRef:E,useState:C}=await Promise.resolve().then(()=>ut(hn())),S=await ze.find(this.context.cwd,this.context.plugins),{project:b,workspace:I}=await Rt.find(S,this.context.cwd),T=await Kr.find(S);if(!I)throw new ar(b.cwd,this.context.cwd);await b.restoreInstallState({restoreResolutions:!1});let N=this.context.stdout.rows-7,U=(we,ye)=>{let Ae=pde(we,ye),se=\"\";for(let X of Ae)X.added?se+=he.pretty(S,X.value,\"green\"):X.removed||(se+=X.value);return se},W=(we,ye)=>{if(we===ye)return ye;let Ae=G.parseRange(we),se=G.parseRange(ye),X=Ae.selector.match(T2e),De=se.selector.match(T2e);if(!X||!De)return U(we,ye);let Te=[\"gray\",\"red\",\"yellow\",\"green\",\"magenta\"],mt=null,j=\"\";for(let rt=1;rt<Te.length;++rt)mt!==null||X[rt]!==De[rt]?(mt===null&&(mt=Te[rt-1]),j+=he.pretty(S,De[rt],mt)):j+=De[rt];return j},ee=async(we,ye,Ae)=>{let se=await Zu.fetchDescriptorFrom(we,Ae,{project:b,cache:T,preserveModifier:ye,workspace:I});return se!==null?se.range:we.range},ie=async we=>{let ye=F2e.default.valid(we.range)?`^${we.range}`:we.range,[Ae,se]=await Promise.all([ee(we,we.range,ye).catch(()=>null),ee(we,we.range,\"latest\").catch(()=>null)]),X=[{value:null,label:we.range}];return Ae&&Ae!==we.range?X.push({value:Ae,label:W(we.range,Ae)}):X.push({value:null,label:\"\"}),se&&se!==Ae&&se!==we.range?X.push({value:se,label:W(we.range,se)}):X.push({value:null,label:\"\"}),X},ue=()=>p.createElement(c,{flexDirection:\"row\"},p.createElement(c,{flexDirection:\"column\",width:49},p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to select packages.\")),p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<left>\"),\"/\",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<right>\"),\" to select versions.\"))),p.createElement(c,{flexDirection:\"column\"},p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to install.\")),p.createElement(c,{marginLeft:1},p.createElement(f,null,\"Press \",p.createElement(f,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),le=()=>p.createElement(c,{flexDirection:\"row\",paddingTop:1,paddingBottom:1},p.createElement(c,{width:50},p.createElement(f,{bold:!0},p.createElement(f,{color:\"greenBright\"},\"?\"),\" Pick the packages you want to upgrade.\")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:\"gray\"},\"Current\")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:\"gray\"},\"Range\")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:\"gray\"},\"Latest\"))),me=({active:we,descriptor:ye,suggestions:Ae})=>{let[se,X]=a(ye.descriptorHash,null),De=G.stringifyIdent(ye),Te=Math.max(0,45-De.length);return p.createElement(p.Fragment,null,p.createElement(c,null,p.createElement(c,{width:45},p.createElement(f,{bold:!0},G.prettyIdent(S,ye)),p.createElement(r,{active:we,length:Te})),p.createElement(e,{active:we,options:Ae,value:se,skewer:!0,onChange:X,sizes:[17,17,17]})))},pe=({dependencies:we})=>{let[ye,Ae]=C(we.map(()=>null)),se=E(!0),X=async De=>{let Te=await ie(De);return Te.filter(mt=>mt.label!==\"\").length<=1?null:{descriptor:De,suggestions:Te}};return h(()=>()=>{se.current=!1},[]),h(()=>{let De=Math.trunc(N*1.75),Te=we.slice(0,De),mt=we.slice(De),j=N2e(mt,N),rt=Te.map(X).reduce(async(Fe,Ne)=>{await Fe;let be=await Ne;be!==null&&se.current&&Ae(Ve=>{let ke=Ve.findIndex(Ue=>Ue===null),it=[...Ve];return it[ke]=be,it})},Promise.resolve());j.reduce((Fe,Ne)=>Promise.all(Ne.map(be=>Promise.resolve().then(()=>X(be)))).then(async be=>{be=be.filter(Ve=>Ve!==null),await Fe,se.current&&Ae(Ve=>{let ke=Ve.findIndex(it=>it===null);return Ve.slice(0,ke).concat(be).concat(Ve.slice(ke+be.length))})}),rt).then(()=>{se.current&&Ae(Fe=>Fe.filter(Ne=>Ne!==null))})},[]),ye.length?p.createElement(s,{radius:N>>1,children:ye.map((De,Te)=>De!==null?p.createElement(me,{key:Te,active:!1,descriptor:De.descriptor,suggestions:De.suggestions}):p.createElement(f,{key:Te},\"Loading...\"))}):p.createElement(f,null,\"No upgrades found\")},Ce=await n(({useSubmit:we})=>{we(a());let ye=new Map;for(let se of b.workspaces)for(let X of[\"dependencies\",\"devDependencies\"])for(let De of se.manifest[X].values())b.tryWorkspaceByDescriptor(De)===null&&(De.range.startsWith(\"link:\")||ye.set(De.descriptorHash,De));let Ae=je.sortMap(ye.values(),se=>G.stringifyDescriptor(se));return p.createElement(c,{flexDirection:\"column\"},p.createElement(ue,null),p.createElement(le,null),p.createElement(pe,{dependencies:Ae}))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof Ce>\"u\")return 1;let g=!1;for(let we of b.workspaces)for(let ye of[\"dependencies\",\"devDependencies\"]){let Ae=we.manifest[ye];for(let se of Ae.values()){let X=Ce.get(se.descriptorHash);typeof X<\"u\"&&X!==null&&(Ae.set(se.identHash,G.makeDescriptor(se,X)),g=!0)}}return g?await b.installWithNewReport({quiet:this.context.quiet,stdout:this.context.stdout},{cache:T}):0}};var mgt={commands:[Iw,Cw]},ygt=mgt;var GW={};Vt(GW,{default:()=>wgt});Ge();var BD=\"jsr:\";Ge();Ge();function ww(t){let e=t.range.slice(4);if(Fr.validRange(e))return G.makeDescriptor(t,`npm:${G.stringifyIdent(G.wrapIdentIntoScope(t,\"jsr\"))}@${e}`);let r=G.tryParseDescriptor(e,!0);if(r!==null)return G.makeDescriptor(t,`npm:${G.stringifyIdent(G.wrapIdentIntoScope(r,\"jsr\"))}@${r.range}`);throw new Error(`Invalid range: ${t.range}`)}function Bw(t){return G.makeLocator(G.wrapIdentIntoScope(t,\"jsr\"),`npm:${t.reference.slice(4)}`)}function jW(t){return G.makeLocator(G.unwrapIdentFromScope(t,\"jsr\"),`jsr:${t.reference.slice(4)}`)}var $F=class{supports(e,r){return e.reference.startsWith(BD)}getLocalPath(e,r){let s=Bw(e);return r.fetcher.getLocalPath(s,r)}fetch(e,r){let s=Bw(e);return r.fetcher.fetch(s,r)}};var eN=class{supportsDescriptor(e,r){return!!e.range.startsWith(BD)}supportsLocator(e,r){return!!e.reference.startsWith(BD)}shouldPersistResolution(e,r){let s=Bw(e);return r.resolver.shouldPersistResolution(s,r)}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{inner:ww(e)}}async getCandidates(e,r,s){let a=s.project.configuration.normalizeDependency(ww(e));return(await s.resolver.getCandidates(a,r,s)).map(c=>jW(c))}async getSatisfying(e,r,s,a){let n=a.project.configuration.normalizeDependency(ww(e));return a.resolver.getSatisfying(n,r,s,a)}async resolve(e,r){let s=Bw(e),a=await r.resolver.resolve(s,r);return{...a,...jW(a)}}};var Egt=[\"dependencies\",\"devDependencies\",\"peerDependencies\"];function Igt(t,e){for(let r of Egt)for(let s of t.manifest.getForScope(r).values()){if(!s.range.startsWith(\"jsr:\"))continue;let a=ww(s),n=r===\"dependencies\"?G.makeDescriptor(s,\"unknown\"):null,c=n!==null&&t.manifest.ensureDependencyMeta(n).optional?\"optionalDependencies\":r;e[c][G.stringifyIdent(s)]=a.range}}var Cgt={hooks:{beforeWorkspacePacking:Igt},resolvers:[eN],fetchers:[$F]},wgt=Cgt;var qW={};Vt(qW,{LinkFetcher:()=>vD,LinkResolver:()=>SD,PortalFetcher:()=>DD,PortalResolver:()=>PD,default:()=>vgt});Ge();Dt();var rh=\"portal:\",nh=\"link:\";var vD=class{supports(e,r){return!!e.reference.startsWith(nh)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:nh});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:nh}),n=J.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,n.localPath),localPath:vt.root}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=J.resolve(c.localPath??c.packageFs.getRealPath(),c.prefixPath,a);return n.localPath?{packageFs:new Sn(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot,discardFromLookup:!0,localPath:p}:{packageFs:new Hf(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot,discardFromLookup:!0}}};Ge();Dt();var SD=class{supportsDescriptor(e,r){return!!e.range.startsWith(nh)}supportsLocator(e,r){return!!e.reference.startsWith(nh)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(nh.length);return[G.makeLocator(e,`${nh}${fe.toPortablePath(a)}`)]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){return{...e,version:\"0.0.0\",languageName:r.project.configuration.get(\"defaultLanguageName\"),linkType:\"SOFT\",conditions:null,dependencies:new Map,peerDependencies:new Map,dependenciesMeta:new Map,peerDependenciesMeta:new Map,bin:new Map}}};Ge();Dt();var DD=class{supports(e,r){return!!e.reference.startsWith(rh)}getLocalPath(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:rh});if(J.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:J.resolve(n,a)}async fetch(e,r){let{parentLocator:s,path:a}=G.parseFileStyleRange(e.reference,{protocol:rh}),n=J.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,n.localPath),localPath:vt.root}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=J.resolve(c.localPath??c.packageFs.getRealPath(),c.prefixPath,a);return n.localPath?{packageFs:new Sn(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot,localPath:p}:{packageFs:new Hf(p,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:vt.dot}}};Ge();Ge();Dt();var PD=class{supportsDescriptor(e,r){return!!e.range.startsWith(rh)}supportsLocator(e,r){return!!e.reference.startsWith(rh)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(rh.length);return[G.makeLocator(e,`${rh}${fe.toPortablePath(a)}`)]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ut.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||\"0.0.0\",languageName:a.languageName||r.project.configuration.get(\"defaultLanguageName\"),linkType:\"SOFT\",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var Bgt={fetchers:[vD,DD],resolvers:[SD,PD]},vgt=Bgt;var PY={};Vt(PY,{NodeModulesLinker:()=>jD,NodeModulesMode:()=>BY,PnpLooseLinker:()=>GD,default:()=>Hdt});Dt();Ge();Dt();Dt();var YW=(t,e)=>`${t}@${e}`,O2e=(t,e)=>{let r=e.indexOf(\"#\"),s=r>=0?e.substring(r+1):e;return YW(t,s)};var M2e=(t,e={})=>{let r=e.debugLevel||Number(process.env.NM_DEBUG_LEVEL||-1),s=e.check||r>=9,a=e.hoistingLimits||new Map,n={check:s,debugLevel:r,hoistingLimits:a,fastLookupPossible:!0},c;n.debugLevel>=0&&(c=Date.now());let f=Qgt(t,n),p=!1,h=0;do{let E=VW(f,[f],new Set([f.locator]),new Map,n);p=E.anotherRoundNeeded||E.isGraphChanged,n.fastLookupPossible=!1,h++}while(p);if(n.debugLevel>=0&&console.log(`hoist time: ${Date.now()-c}ms, rounds: ${h}`),n.debugLevel>=1){let E=bD(f);if(VW(f,[f],new Set([f.locator]),new Map,n).isGraphChanged)throw new Error(`The hoisting result is not terminal, prev tree:\n${E}, next tree:\n${bD(f)}`);let S=U2e(f);if(S)throw new Error(`${S}, after hoisting finished:\n${bD(f)}`)}return n.debugLevel>=2&&console.log(bD(f)),Rgt(f)},Sgt=t=>{let e=t[t.length-1],r=new Map,s=new Set,a=n=>{if(!s.has(n)){s.add(n);for(let c of n.hoistedDependencies.values())r.set(c.name,c);for(let c of n.dependencies.values())n.peerNames.has(c.name)||a(c)}};return a(e),r},Dgt=t=>{let e=t[t.length-1],r=new Map,s=new Set,a=new Set,n=(c,f)=>{if(s.has(c))return;s.add(c);for(let h of c.hoistedDependencies.values())if(!f.has(h.name)){let E;for(let C of t)E=C.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of c.dependencies.values())p.add(h.name);for(let h of c.dependencies.values())c.peerNames.has(h.name)||n(h,p)};return n(e,a),r},L2e=(t,e)=>{if(e.decoupled)return e;let{name:r,references:s,ident:a,locator:n,dependencies:c,originalDependencies:f,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:C,hoistPriority:S,dependencyKind:b,hoistedFrom:I,hoistedTo:T}=e,N={name:r,references:new Set(s),ident:a,locator:n,dependencies:new Map(c),originalDependencies:new Map(f),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:C,hoistPriority:S,dependencyKind:b,hoistedFrom:new Map(I),hoistedTo:new Map(T)},U=N.dependencies.get(r);return U&&U.ident==N.ident&&N.dependencies.set(r,N),t.dependencies.set(N.name,N),N},Pgt=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let a of t.dependencies.values())t.peerNames.has(a.name)||r.set(a.name,[a.ident]);let s=Array.from(e.keys());s.sort((a,n)=>{let c=e.get(a),f=e.get(n);if(f.hoistPriority!==c.hoistPriority)return f.hoistPriority-c.hoistPriority;{let p=c.dependents.size+c.peerDependents.size;return f.dependents.size+f.peerDependents.size-p}});for(let a of s){let n=a.substring(0,a.indexOf(\"@\",1)),c=a.substring(n.length+1);if(!t.peerNames.has(n)){let f=r.get(n);f||(f=[],r.set(n,f)),f.indexOf(c)<0&&f.push(c)}}return r},WW=t=>{let e=new Set,r=(s,a=new Set)=>{if(!a.has(s)){a.add(s);for(let n of s.peerNames)if(!t.peerNames.has(n)){let c=t.dependencies.get(n);c&&!e.has(c)&&r(c,a)}e.add(s)}};for(let s of t.dependencies.values())t.peerNames.has(s.name)||r(s);return e},VW=(t,e,r,s,a,n=new Set)=>{let c=e[e.length-1];if(n.has(c))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(c);let f=Tgt(c),p=Pgt(c,f),h=t==c?new Map:a.fastLookupPossible?Sgt(e):Dgt(e),E,C=!1,S=!1,b=new Map(Array.from(p.entries()).map(([T,N])=>[T,N[0]])),I=new Map;do{let T=kgt(t,e,r,h,b,p,s,I,a);T.isGraphChanged&&(S=!0),T.anotherRoundNeeded&&(C=!0),E=!1;for(let[N,U]of p)U.length>1&&!c.dependencies.has(N)&&(b.delete(N),U.shift(),b.set(N,U[0]),E=!0)}while(E);for(let T of c.dependencies.values())if(!c.peerNames.has(T.name)&&!r.has(T.locator)){r.add(T.locator);let N=VW(t,[...e,T],r,I,a);N.isGraphChanged&&(S=!0),N.anotherRoundNeeded&&(C=!0),r.delete(T.locator)}return{anotherRoundNeeded:C,isGraphChanged:S}},bgt=t=>{for(let[e,r]of t.dependencies)if(!t.peerNames.has(e)&&r.ident!==t.ident)return!0;return!1},xgt=(t,e,r,s,a,n,c,f,{outputReason:p,fastLookupPossible:h})=>{let E,C=null,S=new Set;p&&(E=`${Array.from(e).map(N=>yo(N)).join(\"\\u2192\")}`);let b=r[r.length-1],T=!(s.ident===b.ident);if(p&&!T&&(C=\"- self-reference\"),T&&(T=s.dependencyKind!==1,p&&!T&&(C=\"- workspace\")),T&&s.dependencyKind===2&&(T=!bgt(s),p&&!T&&(C=\"- external soft link with unhoisted dependencies\")),T&&(T=!t.peerNames.has(s.name),p&&!T&&(C=`- cannot shadow peer: ${yo(t.originalDependencies.get(s.name).locator)} at ${E}`)),T){let N=!1,U=a.get(s.name);if(N=!U||U.ident===s.ident,p&&!N&&(C=`- filled by: ${yo(U.locator)} at ${E}`),N)for(let W=r.length-1;W>=1;W--){let ie=r[W].dependencies.get(s.name);if(ie&&ie.ident!==s.ident){N=!1;let ue=f.get(b);ue||(ue=new Set,f.set(b,ue)),ue.add(s.name),p&&(C=`- filled by ${yo(ie.locator)} at ${r.slice(0,W).map(le=>yo(le.locator)).join(\"\\u2192\")}`);break}}T=N}if(T&&(T=n.get(s.name)===s.ident,p&&!T&&(C=`- filled by: ${yo(c.get(s.name)[0])} at ${E}`)),T){let N=!0,U=new Set(s.peerNames);for(let W=r.length-1;W>=1;W--){let ee=r[W];for(let ie of U){if(ee.peerNames.has(ie)&&ee.originalDependencies.has(ie))continue;let ue=ee.dependencies.get(ie);ue&&t.dependencies.get(ie)!==ue&&(W===r.length-1?S.add(ue):(S=null,N=!1,p&&(C=`- peer dependency ${yo(ue.locator)} from parent ${yo(ee.locator)} was not hoisted to ${E}`))),U.delete(ie)}if(!N)break}T=N}if(T&&!h)for(let N of s.hoistedDependencies.values()){let U=a.get(N.name)||t.dependencies.get(N.name);if(!U||N.ident!==U.ident){T=!1,p&&(C=`- previously hoisted dependency mismatch, needed: ${yo(N.locator)}, available: ${yo(U?.locator)}`);break}}return S!==null&&S.size>0?{isHoistable:2,dependsOn:S,reason:C}:{isHoistable:T?0:1,reason:C}},tN=t=>`${t.name}@${t.locator}`,kgt=(t,e,r,s,a,n,c,f,p)=>{let h=e[e.length-1],E=new Set,C=!1,S=!1,b=(U,W,ee,ie,ue)=>{if(E.has(ie))return;let le=[...W,tN(ie)],me=[...ee,tN(ie)],pe=new Map,Be=new Map;for(let Ae of WW(ie)){let se=xgt(h,r,[h,...U,ie],Ae,s,a,n,f,{outputReason:p.debugLevel>=2,fastLookupPossible:p.fastLookupPossible});if(Be.set(Ae,se),se.isHoistable===2)for(let X of se.dependsOn){let De=pe.get(X.name)||new Set;De.add(Ae.name),pe.set(X.name,De)}}let Ce=new Set,g=(Ae,se,X)=>{if(!Ce.has(Ae)){Ce.add(Ae),Be.set(Ae,{isHoistable:1,reason:X});for(let De of pe.get(Ae.name)||[])g(ie.dependencies.get(De),se,p.debugLevel>=2?`- peer dependency ${yo(Ae.locator)} from parent ${yo(ie.locator)} was not hoisted`:\"\")}};for(let[Ae,se]of Be)se.isHoistable===1&&g(Ae,se,se.reason);let we=!1;for(let Ae of Be.keys())if(!Ce.has(Ae)){S=!0;let se=c.get(ie);se&&se.has(Ae.name)&&(C=!0),we=!0,ie.dependencies.delete(Ae.name),ie.hoistedDependencies.set(Ae.name,Ae),ie.reasons.delete(Ae.name);let X=h.dependencies.get(Ae.name);if(p.debugLevel>=2){let De=Array.from(W).concat([ie.locator]).map(mt=>yo(mt)).join(\"\\u2192\"),Te=h.hoistedFrom.get(Ae.name);Te||(Te=[],h.hoistedFrom.set(Ae.name,Te)),Te.push(De),ie.hoistedTo.set(Ae.name,Array.from(e).map(mt=>yo(mt.locator)).join(\"\\u2192\"))}if(!X)h.ident!==Ae.ident&&(h.dependencies.set(Ae.name,Ae),ue.add(Ae));else for(let De of Ae.references)X.references.add(De)}if(ie.dependencyKind===2&&we&&(C=!0),p.check){let Ae=U2e(t);if(Ae)throw new Error(`${Ae}, after hoisting dependencies of ${[h,...U,ie].map(se=>yo(se.locator)).join(\"\\u2192\")}:\n${bD(t)}`)}let ye=WW(ie);for(let Ae of ye)if(Ce.has(Ae)){let se=Be.get(Ae);if((a.get(Ae.name)===Ae.ident||!ie.reasons.has(Ae.name))&&se.isHoistable!==0&&ie.reasons.set(Ae.name,se.reason),!Ae.isHoistBorder&&me.indexOf(tN(Ae))<0){E.add(ie);let De=L2e(ie,Ae);b([...U,ie],le,me,De,T),E.delete(ie)}}},I,T=new Set(WW(h)),N=Array.from(e).map(U=>tN(U));do{I=T,T=new Set;for(let U of I){if(U.locator===h.locator||U.isHoistBorder)continue;let W=L2e(h,U);b([],Array.from(r),N,W,T)}}while(T.size>0);return{anotherRoundNeeded:C,isGraphChanged:S}},U2e=t=>{let e=[],r=new Set,s=new Set,a=(n,c,f)=>{if(r.has(n)||(r.add(n),s.has(n)))return;let p=new Map(c);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),C=()=>`${Array.from(s).concat([n]).map(S=>yo(S.locator)).join(\"\\u2192\")}`;if(n.peerNames.has(h.name)){let S=c.get(h.name);(S!==E||!S||S.ident!==h.ident)&&e.push(`${C()} - broken peer promise: expected ${h.ident} but found ${S&&S.ident}`)}else{let S=f.hoistedFrom.get(n.name),b=n.hoistedTo.get(h.name),I=`${S?` hoisted from ${S.join(\", \")}`:\"\"}`,T=`${b?` hoisted to ${b}`:\"\"}`,N=`${C()}${I}`;E?E.ident!==h.ident&&e.push(`${N} - broken require promise for ${h.name}${T}: expected ${h.ident}, but found: ${E.ident}`):e.push(`${N} - broken require promise: no required dependency ${h.name}${T} found`)}}s.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);s.delete(n)};return a(t,t.dependencies,t),e.join(`\n`)},Qgt=(t,e)=>{let{identName:r,name:s,reference:a,peerNames:n}=t,c={name:s,references:new Set([a]),locator:YW(r,a),ident:O2e(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},f=new Map([[t,c]]),p=(h,E)=>{let C=f.get(h),S=!!C;if(!C){let{name:b,identName:I,reference:T,peerNames:N,hoistPriority:U,dependencyKind:W}=h,ee=e.hoistingLimits.get(E.locator);C={name:b,references:new Set([T]),locator:YW(I,T),ident:O2e(I,T),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(N),reasons:new Map,decoupled:!0,isHoistBorder:ee?ee.has(b):!1,hoistPriority:U||0,dependencyKind:W||0,hoistedFrom:new Map,hoistedTo:new Map},f.set(h,C)}if(E.dependencies.set(h.name,C),E.originalDependencies.set(h.name,C),S){let b=new Set,I=T=>{if(!b.has(T)){b.add(T),T.decoupled=!1;for(let N of T.dependencies.values())T.peerNames.has(N.name)||I(N)}};I(C)}else for(let b of h.dependencies)p(b,C)};for(let h of t.dependencies)p(h,c);return c},JW=t=>t.substring(0,t.indexOf(\"@\",1)),Rgt=t=>{let e={name:t.name,identName:JW(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),s=(a,n,c)=>{let f=r.has(a),p;if(n===a)p=c;else{let{name:h,references:E,locator:C}=a;p={name:h,identName:JW(C),references:E,dependencies:new Set}}if(c.dependencies.add(p),!f){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||s(h,a,p);r.delete(a)}};for(let a of t.dependencies.values())s(a,t,e);return e},Tgt=t=>{let e=new Map,r=new Set([t]),s=c=>`${c.name}@${c.ident}`,a=c=>{let f=s(c),p=e.get(f);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(f,p)),p},n=(c,f)=>{let p=!!r.has(f);if(a(f).dependents.add(c.ident),!p){r.add(f);for(let E of f.dependencies.values()){let C=a(E);C.hoistPriority=Math.max(C.hoistPriority,E.hoistPriority),f.peerNames.has(E.name)?C.peerDependents.add(f.ident):n(f,E)}}};for(let c of t.dependencies.values())t.peerNames.has(c.name)||n(t,c);return e},yo=t=>{if(!t)return\"none\";let e=t.indexOf(\"@\",1),r=t.substring(0,e);r.endsWith(\"$wsroot$\")&&(r=`wh:${r.replace(\"$wsroot$\",\"\")}`);let s=t.substring(e+1);if(s===\"workspace:.\")return\".\";if(s){let a=(s.indexOf(\"#\")>0?s.split(\"#\")[1]:s).replace(\"npm:\",\"\");return s.startsWith(\"virtual\")&&(r=`v:${r}`),a.startsWith(\"workspace\")&&(r=`w:${r}`,a=\"\"),`${r}${a?`@${a}`:\"\"}`}else return`${r}`};var bD=t=>{let e=0,r=(a,n,c=\"\")=>{if(e>5e4||n.has(a))return\"\";e++;let f=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p=\"\";n.add(a);for(let h=0;h<f.length;h++){let E=f[h];if(!a.peerNames.has(E.name)&&E!==a){let C=a.reasons.get(E.name),S=JW(E.locator);p+=`${c}${h<f.length-1?\"\\u251C\\u2500\":\"\\u2514\\u2500\"}${(n.has(E)?\">\":\"\")+(S!==E.name?`a:${E.name}:`:\"\")+yo(E.locator)+(C?` ${C}`:\"\")}\n`,p+=r(E,n,`${c}${h<f.length-1?\"\\u2502 \":\"  \"}`)}}return n.delete(a),p};return r(t,new Set)+(e>5e4?`\nTree is too large, part of the tree has been dunped\n`:\"\")};var xD=(s=>(s.WORKSPACES=\"workspaces\",s.DEPENDENCIES=\"dependencies\",s.NONE=\"none\",s))(xD||{}),_2e=\"node_modules\",rg=\"$wsroot$\";var kD=(t,e)=>{let{packageTree:r,hoistingLimits:s,errors:a,preserveSymlinksRequired:n}=Ngt(t,e),c=null;if(a.length===0){let f=M2e(r,{hoistingLimits:s});c=Lgt(t,f,e)}return{tree:c,errors:a,preserveSymlinksRequired:n}},pA=t=>`${t.name}@${t.reference}`,zW=t=>{let e=new Map;for(let[r,s]of t.entries())if(!s.dirList){let a=e.get(s.locator);a||(a={target:s.target,linkType:s.linkType,locations:[],aliases:s.aliases},e.set(s.locator,a)),a.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((s,a)=>{let n=s.split(J.delimiter).length,c=a.split(J.delimiter).length;return a===s?0:n!==c?c-n:a>s?1:-1});return e},H2e=(t,e)=>{let r=G.isVirtualLocator(t)?G.devirtualizeLocator(t):t,s=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e;return G.areLocatorsEqual(r,s)},KW=(t,e,r,s)=>{if(t.linkType!==\"SOFT\")return!1;let a=fe.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith(\"virtual:\")?r.resolveVirtual(t.packageLocation):t.packageLocation);return J.contains(s,a)===null},Fgt=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error(\"Assertion failed: Expected the top-level package to have been registered\");if(t.findPackageLocator(e.packageLocation)===null)throw new Error(\"Assertion failed: Expected the top-level package to have a physical locator\");let s=fe.toPortablePath(e.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},c=t.getDependencyTreeRoots(),f=new Map,p=new Set,h=(S,b)=>{let I=pA(S);if(p.has(I))return;p.add(I);let T=t.getPackageInformation(S);if(T){let N=b?pA(b):\"\";if(pA(S)!==N&&T.linkType===\"SOFT\"&&!S.reference.startsWith(\"link:\")&&!KW(T,S,t,s)){let U=j2e(T,S,t);(!f.get(U)||S.reference.startsWith(\"workspace:\"))&&f.set(U,S)}for(let[U,W]of T.packageDependencies)W!==null&&(T.packagePeers.has(U)||h(t.getLocator(U,W),S))}};for(let S of c)h(S,null);let E=s.split(J.sep);for(let S of f.values()){let b=t.getPackageInformation(S),T=fe.toPortablePath(b.packageLocation.slice(0,-1)).split(J.sep).slice(E.length),N=n;for(let U of T){let W=N.children.get(U);W||(W={children:new Map},N.children.set(U,W)),N=W}N.workspaceLocator=S}let C=(S,b)=>{if(S.workspaceLocator){let I=pA(b),T=a.get(I);T||(T=new Set,a.set(I,T)),T.add(S.workspaceLocator)}for(let I of S.children.values())C(I,S.workspaceLocator||b)};for(let S of n.children.values())C(S,n.workspaceLocator);return a},Ngt=(t,e)=>{let r=[],s=!1,a=new Map,n=Fgt(t),c=t.getPackageInformation(t.topLevel);if(c===null)throw new Error(\"Assertion failed: Expected the top-level package to have been registered\");let f=t.findPackageLocator(c.packageLocation);if(f===null)throw new Error(\"Assertion failed: Expected the top-level package to have a physical locator\");let p=fe.toPortablePath(c.packageLocation.slice(0,-1)),h={name:f.name,identName:f.name,reference:f.reference,peerNames:c.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,C=(b,I)=>`${pA(I)}:${b}`,S=(b,I,T,N,U,W,ee,ie)=>{let ue=C(b,T),le=E.get(ue),me=!!le;!me&&T.name===f.name&&T.reference===f.reference&&(le=h,E.set(ue,h));let pe=KW(I,T,t,p);if(!le){let Ae=0;pe?Ae=2:I.linkType===\"SOFT\"&&T.name.endsWith(rg)&&(Ae=1),le={name:b,identName:T.name,reference:T.reference,dependencies:new Set,peerNames:Ae===1?new Set:I.packagePeers,dependencyKind:Ae},E.set(ue,le)}let Be;if(pe?Be=2:U.linkType===\"SOFT\"?Be=1:Be=0,le.hoistPriority=Math.max(le.hoistPriority||0,Be),ie&&!pe){let Ae=pA({name:N.identName,reference:N.reference}),se=a.get(Ae)||new Set;a.set(Ae,se),se.add(le.name)}let Ce=new Map(I.packageDependencies);if(e.project){let Ae=e.project.workspacesByCwd.get(fe.toPortablePath(I.packageLocation.slice(0,-1)));if(Ae){let se=new Set([...Array.from(Ae.manifest.peerDependencies.values(),X=>G.stringifyIdent(X)),...Array.from(Ae.manifest.peerDependenciesMeta.keys())]);for(let X of se)Ce.has(X)||(Ce.set(X,W.get(X)||null),le.peerNames.add(X))}}let g=pA({name:T.name.replace(rg,\"\"),reference:T.reference}),we=n.get(g);if(we)for(let Ae of we)Ce.set(`${Ae.name}${rg}`,Ae.reference);(I!==U||I.linkType!==\"SOFT\"||!pe&&(!e.selfReferencesByCwd||e.selfReferencesByCwd.get(ee)))&&N.dependencies.add(le);let ye=T!==f&&I.linkType===\"SOFT\"&&!T.name.endsWith(rg)&&!pe;if(!me&&!ye){let Ae=new Map;for(let[se,X]of Ce)if(X!==null){let De=t.getLocator(se,X),Te=t.getLocator(se.replace(rg,\"\"),X),mt=t.getPackageInformation(Te);if(mt===null)throw new Error(\"Assertion failed: Expected the package to have been registered\");let j=KW(mt,De,t,p);if(e.validateExternalSoftLinks&&e.project&&j){mt.packageDependencies.size>0&&(s=!0);for(let[Ve,ke]of mt.packageDependencies)if(ke!==null){let it=G.parseLocator(Array.isArray(ke)?`${ke[0]}@${ke[1]}`:`${Ve}@${ke}`);if(pA(it)!==pA(De)){let Ue=Ce.get(Ve);if(Ue){let x=G.parseLocator(Array.isArray(Ue)?`${Ue[0]}@${Ue[1]}`:`${Ve}@${Ue}`);H2e(x,it)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(De.name))} into ${G.prettyLocator(e.project.configuration,G.parseLocator(`${T.name}@${T.reference}`))} dependency ${G.prettyLocator(e.project.configuration,it)} conflicts with parent dependency ${G.prettyLocator(e.project.configuration,x)}`})}else{let x=Ae.get(Ve);if(x){let w=x.target,P=G.parseLocator(Array.isArray(w)?`${w[0]}@${w[1]}`:`${Ve}@${w}`);H2e(P,it)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(De.name))} into ${G.prettyLocator(e.project.configuration,G.parseLocator(`${T.name}@${T.reference}`))} dependency ${G.prettyLocator(e.project.configuration,it)} conflicts with dependency ${G.prettyLocator(e.project.configuration,P)} from sibling portal ${G.prettyIdent(e.project.configuration,G.parseIdent(x.portal.name))}`})}else Ae.set(Ve,{target:it.reference,portal:De})}}}}let rt=e.hoistingLimitsByCwd?.get(ee),Fe=j?ee:J.relative(p,fe.toPortablePath(mt.packageLocation))||vt.dot,Ne=e.hoistingLimitsByCwd?.get(Fe);S(se,mt,De,le,I,Ce,Fe,rt===\"dependencies\"||Ne===\"dependencies\"||Ne===\"workspaces\")}}};return S(f.name,c,f,h,c,c.packageDependencies,vt.dot,!1),{packageTree:h,hoistingLimits:a,errors:r,preserveSymlinksRequired:s}};function j2e(t,e,r){let s=r.resolveVirtual&&e.reference&&e.reference.startsWith(\"virtual:\")?r.resolveVirtual(t.packageLocation):t.packageLocation;return fe.toPortablePath(s||t.packageLocation)}function Ogt(t,e,r){let s=e.getLocator(t.name.replace(rg,\"\"),t.reference),a=e.getPackageInformation(s);if(a===null)throw new Error(\"Assertion failed: Expected the package to be registered\");return r.pnpifyFs?{linkType:\"SOFT\",target:fe.toPortablePath(a.packageLocation)}:{linkType:a.linkType,target:j2e(a,t,e)}}var Lgt=(t,e,r)=>{let s=new Map,a=(E,C,S)=>{let{linkType:b,target:I}=Ogt(E,t,r);return{locator:pA(E),nodePath:C,target:I,linkType:b,aliases:S}},n=E=>{let[C,S]=E.split(\"/\");return S?{scope:C,name:S}:{scope:null,name:C}},c=new Set,f=(E,C,S)=>{if(c.has(E))return;c.add(E);let b=Array.from(E.references).sort().join(\"#\");for(let I of E.dependencies){let T=Array.from(I.references).sort().join(\"#\");if(I.identName===E.identName.replace(rg,\"\")&&T===b)continue;let N=Array.from(I.references).sort(),U={name:I.identName,reference:N[0]},{name:W,scope:ee}=n(I.name),ie=ee?[ee,W]:[W],ue=J.join(C,_2e),le=J.join(ue,...ie),me=`${S}/${U.name}`,pe=a(U,S,N.slice(1)),Be=!1;if(pe.linkType===\"SOFT\"&&r.project){let Ce=r.project.workspacesByCwd.get(pe.target.slice(0,-1));Be=!!(Ce&&!Ce.manifest.name)}if(!I.name.endsWith(rg)&&!Be){let Ce=s.get(le);if(Ce){if(Ce.dirList)throw new Error(`Assertion failed: ${le} cannot merge dir node with leaf node`);{let ye=G.parseLocator(Ce.locator),Ae=G.parseLocator(pe.locator);if(Ce.linkType!==pe.linkType)throw new Error(`Assertion failed: ${le} cannot merge nodes with different link types ${Ce.nodePath}/${G.stringifyLocator(ye)} and ${S}/${G.stringifyLocator(Ae)}`);if(ye.identHash!==Ae.identHash)throw new Error(`Assertion failed: ${le} cannot merge nodes with different idents ${Ce.nodePath}/${G.stringifyLocator(ye)} and ${S}/s${G.stringifyLocator(Ae)}`);pe.aliases=[...pe.aliases,...Ce.aliases,G.parseLocator(Ce.locator).reference]}}s.set(le,pe);let g=le.split(\"/\"),we=g.indexOf(_2e);for(let ye=g.length-1;we>=0&&ye>we;ye--){let Ae=fe.toPortablePath(g.slice(0,ye).join(J.sep)),se=g[ye],X=s.get(Ae);if(!X)s.set(Ae,{dirList:new Set([se])});else if(X.dirList){if(X.dirList.has(se))break;X.dirList.add(se)}}}f(I,pe.linkType===\"SOFT\"?pe.target:le,me)}},p=a({name:e.name,reference:Array.from(e.references)[0]},\"\",[]),h=p.target;return s.set(h,p),f(e,h,\"\"),s};Ge();Ge();Dt();Dt();eA();wc();var gY={};Vt(gY,{PnpInstaller:()=>Gm,PnpLinker:()=>sg,UnplugCommand:()=>Sw,default:()=>pdt,getPnpPath:()=>og,jsInstallUtils:()=>gA,pnpUtils:()=>HD,quotePathIfNeeded:()=>DBe});Dt();var SBe=Ie(\"url\");Ge();Ge();Dt();Dt();var G2e={DEFAULT:{collapsed:!1,next:{\"*\":\"DEFAULT\"}},TOP_LEVEL:{collapsed:!1,next:{fallbackExclusionList:\"FALLBACK_EXCLUSION_LIST\",packageRegistryData:\"PACKAGE_REGISTRY_DATA\",\"*\":\"DEFAULT\"}},FALLBACK_EXCLUSION_LIST:{collapsed:!1,next:{\"*\":\"FALLBACK_EXCLUSION_ENTRIES\"}},FALLBACK_EXCLUSION_ENTRIES:{collapsed:!0,next:{\"*\":\"FALLBACK_EXCLUSION_DATA\"}},FALLBACK_EXCLUSION_DATA:{collapsed:!0,next:{\"*\":\"DEFAULT\"}},PACKAGE_REGISTRY_DATA:{collapsed:!1,next:{\"*\":\"PACKAGE_REGISTRY_ENTRIES\"}},PACKAGE_REGISTRY_ENTRIES:{collapsed:!0,next:{\"*\":\"PACKAGE_STORE_DATA\"}},PACKAGE_STORE_DATA:{collapsed:!1,next:{\"*\":\"PACKAGE_STORE_ENTRIES\"}},PACKAGE_STORE_ENTRIES:{collapsed:!0,next:{\"*\":\"PACKAGE_INFORMATION_DATA\"}},PACKAGE_INFORMATION_DATA:{collapsed:!1,next:{packageDependencies:\"PACKAGE_DEPENDENCIES\",\"*\":\"DEFAULT\"}},PACKAGE_DEPENDENCIES:{collapsed:!1,next:{\"*\":\"PACKAGE_DEPENDENCY\"}},PACKAGE_DEPENDENCY:{collapsed:!0,next:{\"*\":\"DEFAULT\"}}};function Mgt(t,e,r){let s=\"\";s+=\"[\";for(let a=0,n=t.length;a<n;++a)s+=rN(String(a),t[a],e,r).replace(/^ +/g,\"\"),a+1<n&&(s+=\", \");return s+=\"]\",s}function Ugt(t,e,r){let s=`${r}  `,a=\"\";a+=r,a+=`[\n`;for(let n=0,c=t.length;n<c;++n)a+=s+rN(String(n),t[n],e,s).replace(/^ +/,\"\"),n+1<c&&(a+=\",\"),a+=`\n`;return a+=r,a+=\"]\",a}function _gt(t,e,r){let s=Object.keys(t),a=\"\";a+=\"{\";for(let n=0,c=s.length,f=0;n<c;++n){let p=s[n],h=t[p];typeof h>\"u\"||(f!==0&&(a+=\", \"),a+=JSON.stringify(p),a+=\": \",a+=rN(p,h,e,r).replace(/^ +/g,\"\"),f+=1)}return a+=\"}\",a}function Hgt(t,e,r){let s=Object.keys(t),a=`${r}  `,n=\"\";n+=r,n+=`{\n`;let c=0;for(let f=0,p=s.length;f<p;++f){let h=s[f],E=t[h];typeof E>\"u\"||(c!==0&&(n+=\",\",n+=`\n`),n+=a,n+=JSON.stringify(h),n+=\": \",n+=rN(h,E,e,a).replace(/^ +/g,\"\"),c+=1)}return c!==0&&(n+=`\n`),n+=r,n+=\"}\",n}function rN(t,e,r,s){let{next:a}=G2e[r],n=a[t]||a[\"*\"];return q2e(e,n,s)}function q2e(t,e,r){let{collapsed:s}=G2e[e];return Array.isArray(t)?s?Mgt(t,e,r):Ugt(t,e,r):typeof t==\"object\"&&t!==null?s?_gt(t,e,r):Hgt(t,e,r):JSON.stringify(t)}function W2e(t){return q2e(t,\"TOP_LEVEL\",\"\")}function QD(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let s=[];for(let n of e)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function jgt(t){let e=new Map,r=QD(t.fallbackExclusionList||[],[({name:s,reference:a})=>s,({name:s,reference:a})=>a]);for(let{name:s,reference:a}of r){let n=e.get(s);typeof n>\"u\"&&e.set(s,n=new Set),n.add(a)}return Array.from(e).map(([s,a])=>[s,Array.from(a)])}function Ggt(t){return QD(t.fallbackPool||[],([e])=>e)}function qgt(t){let e=[],r=t.dependencyTreeRoots.find(s=>t.packageRegistry.get(s.name)?.get(s.reference)?.packageLocation===\"./\");for(let[s,a]of QD(t.packageRegistry,([n])=>n===null?\"0\":`1${n}`)){if(s===null)continue;let n=[];e.push([s,n]);for(let[c,{packageLocation:f,packageDependencies:p,packagePeers:h,linkType:E,discardFromLookup:C}]of QD(a,([S])=>S===null?\"0\":`1${S}`)){if(c===null)continue;let S=[];s!==null&&c!==null&&!p.has(s)&&S.push([s,c]);for(let[U,W]of p)S.push([U,W]);let b=QD(S,([U])=>U),I=h&&h.size>0?Array.from(h):void 0,N={packageLocation:f,packageDependencies:b,packagePeers:I,linkType:E,discardFromLookup:C||void 0};n.push([c,N]),r&&s===r.name&&c===r.reference&&e.unshift([null,[[null,N]]])}}return e}function RD(t){return{__info:[\"This file is automatically generated. Do not touch it, or risk\",\"your modifications being lost.\"],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,pnpZipBackend:t.pnpZipBackend,fallbackExclusionList:jgt(t),fallbackPool:Ggt(t),packageRegistryData:qgt(t)}}var J2e=ut(V2e());function K2e(t,e){return[t?`${t}\n`:\"\",`/* eslint-disable */\n`,`// @ts-nocheck\n`,`\"use strict\";\n`,`\n`,e,`\n`,(0,J2e.default)()].join(\"\")}function Wgt(t){return JSON.stringify(t,null,2)}function Ygt(t){return`'${t.replace(/\\\\/g,\"\\\\\\\\\").replace(/'/g,\"\\\\'\").replace(/\\n/g,`\\\\\n`)}'`}function Vgt(t){return[`const RAW_RUNTIME_STATE =\n`,`${Ygt(W2e(t))};\n\n`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {\n`,`  return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});\n`,`}\n`].join(\"\")}function Jgt(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {\n`,`  const fs = require('fs');\n`,`  const path = require('path');\n`,`  const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(Er.pnpData)});\n`,`  return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});\n`,`}\n`].join(\"\")}function z2e(t){let e=RD(t),r=Vgt(e);return K2e(t.shebang,r)}function Z2e(t){let e=RD(t),r=Jgt(),s=K2e(t.shebang,r);return{dataFile:Wgt(e),loaderFile:s}}Dt();function XW(t,{basePath:e}){let r=fe.toPortablePath(e),s=J.resolve(r),a=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,n=new Map,c=new Map(t.packageRegistryData.map(([C,S])=>[C,new Map(S.map(([b,I])=>{if(C===null!=(b===null))throw new Error(\"Assertion failed: The name and reference should be null, or neither should\");let T=I.discardFromLookup??!1,N={name:C,reference:b},U=n.get(I.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&T,T||(U.locator=N)):n.set(I.packageLocation,{locator:N,discardFromLookup:T});let W=null;return[b,{packageDependencies:new Map(I.packageDependencies),packagePeers:new Set(I.packagePeers),linkType:I.linkType,discardFromLookup:T,get packageLocation(){return W||(W=J.join(s,I.packageLocation))}}]}))])),f=new Map(t.fallbackExclusionList.map(([C,S])=>[C,new Set(S)])),p=new Map(t.fallbackPool),h=t.dependencyTreeRoots,E=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:f,pnpZipBackend:t.pnpZipBackend,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:c}}Dt();Dt();var sh=Ie(\"module\"),jm=Ie(\"url\"),lY=Ie(\"util\");var ta=Ie(\"url\");var tBe=ut(Ie(\"assert\"));var $W=Array.isArray,TD=JSON.stringify,FD=Object.getOwnPropertyNames,Hm=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),eY=(t,e)=>RegExp.prototype.exec.call(t,e),tY=(t,...e)=>RegExp.prototype[Symbol.replace].apply(t,e),ng=(t,...e)=>String.prototype.endsWith.apply(t,e),rY=(t,...e)=>String.prototype.includes.apply(t,e),nY=(t,...e)=>String.prototype.lastIndexOf.apply(t,e),ND=(t,...e)=>String.prototype.indexOf.apply(t,e),X2e=(t,...e)=>String.prototype.replace.apply(t,e),ig=(t,...e)=>String.prototype.slice.apply(t,e),hA=(t,...e)=>String.prototype.startsWith.apply(t,e),$2e=Map,eBe=JSON.parse;function OD(t,e,r){return class extends r{constructor(...s){super(e(...s)),this.code=t,this.name=`${r.name} [${t}]`}}}var rBe=OD(\"ERR_PACKAGE_IMPORT_NOT_DEFINED\",(t,e,r)=>`Package import specifier \"${t}\" is not defined${e?` in package ${e}package.json`:\"\"} imported from ${r}`,TypeError),iY=OD(\"ERR_INVALID_MODULE_SPECIFIER\",(t,e,r=void 0)=>`Invalid module \"${t}\" ${e}${r?` imported from ${r}`:\"\"}`,TypeError),nBe=OD(\"ERR_INVALID_PACKAGE_TARGET\",(t,e,r,s=!1,a=void 0)=>{let n=typeof r==\"string\"&&!s&&r.length&&!hA(r,\"./\");return e===\".\"?((0,tBe.default)(s===!1),`Invalid \"exports\" main target ${TD(r)} defined in the package config ${t}package.json${a?` imported from ${a}`:\"\"}${n?'; targets must start with \"./\"':\"\"}`):`Invalid \"${s?\"imports\":\"exports\"}\" target ${TD(r)} defined for '${e}' in the package config ${t}package.json${a?` imported from ${a}`:\"\"}${n?'; targets must start with \"./\"':\"\"}`},Error),LD=OD(\"ERR_INVALID_PACKAGE_CONFIG\",(t,e,r)=>`Invalid package config ${t}${e?` while importing ${e}`:\"\"}${r?`. ${r}`:\"\"}`,Error),iBe=OD(\"ERR_PACKAGE_PATH_NOT_EXPORTED\",(t,e,r=void 0)=>e===\".\"?`No \"exports\" main defined in ${t}package.json${r?` imported from ${r}`:\"\"}`:`Package subpath '${e}' is not defined by \"exports\" in ${t}package.json${r?` imported from ${r}`:\"\"}`,Error);var iN=Ie(\"url\");function sBe(t,e){let r=Object.create(null);for(let s=0;s<e.length;s++){let a=e[s];Hm(t,a)&&(r[a]=t[a])}return r}var nN=new $2e;function Kgt(t,e,r,s){let a=nN.get(t);if(a!==void 0)return a;let n=s(t);if(n===void 0){let b={pjsonPath:t,exists:!1,main:void 0,name:void 0,type:\"none\",exports:void 0,imports:void 0};return nN.set(t,b),b}let c;try{c=eBe(n)}catch(b){throw new LD(t,(r?`\"${e}\" from `:\"\")+(0,iN.fileURLToPath)(r||e),b.message)}let{imports:f,main:p,name:h,type:E}=sBe(c,[\"imports\",\"main\",\"name\",\"type\"]),C=Hm(c,\"exports\")?c.exports:void 0;(typeof f!=\"object\"||f===null)&&(f=void 0),typeof p!=\"string\"&&(p=void 0),typeof h!=\"string\"&&(h=void 0),E!==\"module\"&&E!==\"commonjs\"&&(E=\"none\");let S={pjsonPath:t,exists:!0,main:p,name:h,type:E,exports:C,imports:f};return nN.set(t,S),S}function oBe(t,e){let r=new URL(\"./package.json\",t);for(;;){let n=r.pathname;if(ng(n,\"node_modules/package.json\"))break;let c=Kgt((0,iN.fileURLToPath)(r),t,void 0,e);if(c.exists)return c;let f=r;if(r=new URL(\"../package.json\",r),r.pathname===f.pathname)break}let s=(0,iN.fileURLToPath)(r),a={pjsonPath:s,exists:!1,main:void 0,name:void 0,type:\"none\",exports:void 0,imports:void 0};return nN.set(s,a),a}function zgt(t,e,r){throw new rBe(t,e&&(0,ta.fileURLToPath)(new URL(\".\",e)),(0,ta.fileURLToPath)(r))}function Zgt(t,e,r,s){let a=`request is not a valid subpath for the \"${r?\"imports\":\"exports\"}\" resolution of ${(0,ta.fileURLToPath)(e)}`;throw new iY(t,a,s&&(0,ta.fileURLToPath)(s))}function MD(t,e,r,s,a){throw typeof e==\"object\"&&e!==null?e=TD(e,null,\"\"):e=`${e}`,new nBe((0,ta.fileURLToPath)(new URL(\".\",r)),t,e,s,a&&(0,ta.fileURLToPath)(a))}var aBe=/(^|\\\\|\\/)((\\.|%2e)(\\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\\\|\\/|$)/i,lBe=/\\*/g;function Xgt(t,e,r,s,a,n,c,f){if(e!==\"\"&&!n&&t[t.length-1]!==\"/\"&&MD(r,t,s,c,a),!hA(t,\"./\")){if(c&&!hA(t,\"../\")&&!hA(t,\"/\")){let C=!1;try{new URL(t),C=!0}catch{}if(!C)return n?tY(lBe,t,()=>e):t+e}MD(r,t,s,c,a)}eY(aBe,ig(t,2))!==null&&MD(r,t,s,c,a);let p=new URL(t,s),h=p.pathname,E=new URL(\".\",s).pathname;if(hA(h,E)||MD(r,t,s,c,a),e===\"\")return p;if(eY(aBe,e)!==null){let C=n?X2e(r,\"*\",()=>e):r+e;Zgt(C,s,c,a)}return n?new URL(tY(lBe,p.href,()=>e)):new URL(e,p)}function $gt(t){let e=+t;return`${e}`!==t?!1:e>=0&&e<4294967295}function vw(t,e,r,s,a,n,c,f){if(typeof e==\"string\")return Xgt(e,r,s,t,a,n,c,f);if($W(e)){if(e.length===0)return null;let p;for(let h=0;h<e.length;h++){let E=e[h],C;try{C=vw(t,E,r,s,a,n,c,f)}catch(S){if(p=S,S.code===\"ERR_INVALID_PACKAGE_TARGET\")continue;throw S}if(C!==void 0){if(C===null){p=null;continue}return C}}if(p==null)return p;throw p}else if(typeof e==\"object\"&&e!==null){let p=FD(e);for(let h=0;h<p.length;h++){let E=p[h];if($gt(E))throw new LD((0,ta.fileURLToPath)(t),a,'\"exports\" cannot contain numeric property keys.')}for(let h=0;h<p.length;h++){let E=p[h];if(E===\"default\"||f.has(E)){let C=e[E],S=vw(t,C,r,s,a,n,c,f);if(S===void 0)continue;return S}}return}else if(e===null)return null;MD(s,e,t,c,a)}function uBe(t,e){let r=ND(t,\"*\"),s=ND(e,\"*\"),a=r===-1?t.length:r+1,n=s===-1?e.length:s+1;return a>n?-1:n>a||r===-1?1:s===-1||t.length>e.length?-1:e.length>t.length?1:0}function edt(t,e,r){if(typeof t==\"string\"||$W(t))return!0;if(typeof t!=\"object\"||t===null)return!1;let s=FD(t),a=!1,n=0;for(let c=0;c<s.length;c++){let f=s[c],p=f===\"\"||f[0]!==\".\";if(n++===0)a=p;else if(a!==p)throw new LD((0,ta.fileURLToPath)(e),r,`\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return a}function sY(t,e,r){throw new iBe((0,ta.fileURLToPath)(new URL(\".\",e)),t,r&&(0,ta.fileURLToPath)(r))}var cBe=new Set;function tdt(t,e,r){let s=(0,ta.fileURLToPath)(e);cBe.has(s+\"|\"+t)||(cBe.add(s+\"|\"+t),process.emitWarning(`Use of deprecated trailing slash pattern mapping \"${t}\" in the \"exports\" field module resolution of the package at ${s}${r?` imported from ${(0,ta.fileURLToPath)(r)}`:\"\"}. Mapping specifiers ending in \"/\" is no longer supported.`,\"DeprecationWarning\",\"DEP0155\"))}function fBe({packageJSONUrl:t,packageSubpath:e,exports:r,base:s,conditions:a}){if(edt(r,t,s)&&(r={\".\":r}),Hm(r,e)&&!rY(e,\"*\")&&!ng(e,\"/\")){let p=r[e],h=vw(t,p,\"\",e,s,!1,!1,a);return h==null&&sY(e,t,s),h}let n=\"\",c,f=FD(r);for(let p=0;p<f.length;p++){let h=f[p],E=ND(h,\"*\");if(E!==-1&&hA(e,ig(h,0,E))){ng(e,\"/\")&&tdt(e,t,s);let C=ig(h,E+1);e.length>=h.length&&ng(e,C)&&uBe(n,h)===1&&nY(h,\"*\")===E&&(n=h,c=ig(e,E,e.length-C.length))}}if(n){let p=r[n],h=vw(t,p,c,n,s,!0,!1,a);return h==null&&sY(e,t,s),h}sY(e,t,s)}function ABe({name:t,base:e,conditions:r,readFileSyncFn:s}){if(t===\"#\"||hA(t,\"#/\")||ng(t,\"/\")){let c=\"is not a valid internal imports specifier name\";throw new iY(t,c,(0,ta.fileURLToPath)(e))}let a,n=oBe(e,s);if(n.exists){a=(0,ta.pathToFileURL)(n.pjsonPath);let c=n.imports;if(c)if(Hm(c,t)&&!rY(t,\"*\")){let f=vw(a,c[t],\"\",t,e,!1,!0,r);if(f!=null)return f}else{let f=\"\",p,h=FD(c);for(let E=0;E<h.length;E++){let C=h[E],S=ND(C,\"*\");if(S!==-1&&hA(t,ig(C,0,S))){let b=ig(C,S+1);t.length>=C.length&&ng(t,b)&&uBe(f,C)===1&&nY(C,\"*\")===S&&(f=C,p=ig(t,S,t.length-b.length))}}if(f){let E=c[f],C=vw(a,E,p,f,e,!0,!0,r);if(C!=null)return C}}}zgt(t,a,e)}Dt();var rdt=new Set([\"BUILTIN_NODE_RESOLUTION_FAILED\",\"MISSING_DEPENDENCY\",\"MISSING_PEER_DEPENDENCY\",\"QUALIFIED_PATH_RESOLUTION_FAILED\",\"UNDECLARED_DEPENDENCY\"]);function gs(t,e,r={},s){s??=rdt.has(t)?\"MODULE_NOT_FOUND\":t;let a={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:{...a,value:s},pnpCode:{...a,value:t},data:{...a,value:r}})}function lf(t){return fe.normalize(fe.fromPortablePath(t))}var dBe=ut(hBe());function mBe(t){return ndt(),aY[t]}var aY;function ndt(){aY||(aY={\"--conditions\":[],...gBe(idt()),...gBe(process.execArgv)})}function gBe(t){return(0,dBe.default)({\"--conditions\":[String],\"-C\":\"--conditions\"},{argv:t,permissive:!0})}function idt(){let t=[],e=sdt(process.env.NODE_OPTIONS||\"\",t);return t.length,e}function sdt(t,e){let r=[],s=!1,a=!0;for(let n=0;n<t.length;++n){let c=t[n];if(c===\"\\\\\"&&s){if(n+1===t.length)return e.push(`invalid value for NODE_OPTIONS (invalid escape)\n`),r;c=t[++n]}else if(c===\" \"&&!s){a=!0;continue}else if(c==='\"'){s=!s;continue}a?(r.push(c),a=!1):r[r.length-1]+=c}return s&&e.push(`invalid value for NODE_OPTIONS (unterminated string)\n`),r}Dt();var[ml,ih]=process.versions.node.split(\".\").map(t=>parseInt(t,10)),yBe=ml>19||ml===19&&ih>=2||ml===18&&ih>=13,IXt=ml===20&&ih<6||ml===19&&ih>=3,CXt=ml>19||ml===19&&ih>=6,wXt=ml>=21||ml===20&&ih>=10||ml===18&&ih>=19,BXt=ml>=21||ml===20&&ih>=10||ml===18&&ih>=20,vXt=ml>=22;function EBe(t){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send)if(t=t.map(e=>fe.fromPortablePath(uo.resolveVirtual(fe.toPortablePath(e)))),yBe)process.send({\"watch:require\":t});else for(let e of t)process.send({\"watch:require\":e})}function cY(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,s=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\\\/]|\\\\\\\\|\\.{0,2}(?:\\/|$))((?:node:)?(?:@[^/]+\\/)?[^/]+)\\/*(.*|)$/,n=/^(\\/|\\.{1,2}(\\/|$))/,c=/\\/$/,f=/^\\.{0,2}\\//,p={name:null,reference:null},h=[],E=new Set;if(t.enableTopLevelFallback===!0&&h.push(p),e.compatibilityMode!==!1)for(let Fe of[\"react-scripts\",\"gatsby\"]){let Ne=t.packageRegistry.get(Fe);if(Ne)for(let be of Ne.keys()){if(be===null)throw new Error(\"Assertion failed: This reference shouldn't be null\");h.push({name:Fe,reference:be})}}let{ignorePattern:C,packageRegistry:S,packageLocatorsByLocations:b}=t;function I(Fe,Ne){return{fn:Fe,args:Ne,error:null,result:null}}function T(Fe){let Ne=process.stderr?.hasColors?.()??process.stdout.isTTY,be=(it,Ue)=>`\\x1B[${it}m${Ue}\\x1B[0m`,Ve=Fe.error;console.error(Ve?be(\"31;1\",`\\u2716 ${Fe.error?.message.replace(/\\n.*/s,\"\")}`):be(\"33;1\",\"\\u203C Resolution\")),Fe.args.length>0&&console.error();for(let it of Fe.args)console.error(`  ${be(\"37;1\",\"In \\u2190\")} ${(0,lY.inspect)(it,{colors:Ne,compact:!0})}`);Fe.result&&(console.error(),console.error(`  ${be(\"37;1\",\"Out \\u2192\")} ${(0,lY.inspect)(Fe.result,{colors:Ne,compact:!0})}`));let ke=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(ke.length>0){console.error();for(let it of ke)console.error(`  ${be(\"38;5;244\",it)}`)}console.error()}function N(Fe,Ne){if(e.allowDebug===!1)return Ne;if(Number.isFinite(s)){if(s>=2)return(...be)=>{let Ve=I(Fe,be);try{return Ve.result=Ne(...be)}catch(ke){throw Ve.error=ke}finally{T(Ve)}};if(s>=1)return(...be)=>{try{return Ne(...be)}catch(Ve){let ke=I(Fe,be);throw ke.error=Ve,T(ke),Ve}}}return Ne}function U(Fe){let Ne=g(Fe);if(!Ne)throw gs(\"INTERNAL\",\"Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)\");return Ne}function W(Fe){if(Fe.name===null)return!0;for(let Ne of t.dependencyTreeRoots)if(Ne.name===Fe.name&&Ne.reference===Fe.reference)return!0;return!1}let ee=new Set([\"node\",\"require\",...mBe(\"--conditions\")]);function ie(Fe,Ne=ee,be){let Ve=Ae(J.join(Fe,\"internal.js\"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(Ve===null)throw gs(\"INTERNAL\",`The locator that owns the \"${Fe}\" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:ke}=U(Ve),it=J.join(ke,Er.manifest);if(!e.fakeFs.existsSync(it))return null;let Ue=JSON.parse(e.fakeFs.readFileSync(it,\"utf8\"));if(Ue.exports==null)return null;let x=J.contains(ke,Fe);if(x===null)throw gs(\"INTERNAL\",\"unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)\");x!==\".\"&&!f.test(x)&&(x=`./${x}`);try{let w=fBe({packageJSONUrl:(0,jm.pathToFileURL)(fe.fromPortablePath(it)),packageSubpath:x,exports:Ue.exports,base:be?(0,jm.pathToFileURL)(fe.fromPortablePath(be)):null,conditions:Ne});return fe.toPortablePath((0,jm.fileURLToPath)(w))}catch(w){throw gs(\"EXPORTS_RESOLUTION_FAILED\",w.message,{unqualifiedPath:lf(Fe),locator:Ve,pkgJson:Ue,subpath:lf(x),conditions:Ne},w.code)}}function ue(Fe,Ne,{extensions:be}){let Ve;try{Ne.push(Fe),Ve=e.fakeFs.statSync(Fe)}catch{}if(Ve&&!Ve.isDirectory())return e.fakeFs.realpathSync(Fe);if(Ve&&Ve.isDirectory()){let ke;try{ke=JSON.parse(e.fakeFs.readFileSync(J.join(Fe,Er.manifest),\"utf8\"))}catch{}let it;if(ke&&ke.main&&(it=J.resolve(Fe,ke.main)),it&&it!==Fe){let Ue=ue(it,Ne,{extensions:be});if(Ue!==null)return Ue}}for(let ke=0,it=be.length;ke<it;ke++){let Ue=`${Fe}${be[ke]}`;if(Ne.push(Ue),e.fakeFs.existsSync(Ue))return Ue}if(Ve&&Ve.isDirectory())for(let ke=0,it=be.length;ke<it;ke++){let Ue=J.format({dir:Fe,name:\"index\",ext:be[ke]});if(Ne.push(Ue),e.fakeFs.existsSync(Ue))return Ue}return null}function le(Fe){let Ne=new sh.Module(Fe,null);return Ne.filename=Fe,Ne.paths=sh.Module._nodeModulePaths(Fe),Ne}function me(Fe,Ne){return Ne.endsWith(\"/\")&&(Ne=J.join(Ne,\"internal.js\")),sh.Module._resolveFilename(fe.fromPortablePath(Fe),le(fe.fromPortablePath(Ne)),!1,{plugnplay:!1})}function pe(Fe){if(C===null)return!1;let Ne=J.contains(t.basePath,Fe);return Ne===null?!1:!!C.test(Ne.replace(/\\/$/,\"\"))}let Be={std:3,resolveVirtual:1,getAllLocators:1},Ce=p;function g({name:Fe,reference:Ne}){let be=S.get(Fe);if(!be)return null;let Ve=be.get(Ne);return Ve||null}function we({name:Fe,reference:Ne}){let be=[];for(let[Ve,ke]of S)if(Ve!==null)for(let[it,Ue]of ke)it===null||Ue.packageDependencies.get(Fe)!==Ne||Ve===Fe&&it===Ne||be.push({name:Ve,reference:it});return be}function ye(Fe,Ne){let be=new Map,Ve=new Set,ke=Ue=>{let x=JSON.stringify(Ue.name);if(Ve.has(x))return;Ve.add(x);let w=we(Ue);for(let P of w)if(U(P).packagePeers.has(Fe))ke(P);else{let F=be.get(P.name);typeof F>\"u\"&&be.set(P.name,F=new Set),F.add(P.reference)}};ke(Ne);let it=[];for(let Ue of[...be.keys()].sort())for(let x of[...be.get(Ue)].sort())it.push({name:Ue,reference:x});return it}function Ae(Fe,{resolveIgnored:Ne=!1,includeDiscardFromLookup:be=!1}={}){if(pe(Fe)&&!Ne)return null;let Ve=J.relative(t.basePath,Fe);Ve.match(n)||(Ve=`./${Ve}`),Ve.endsWith(\"/\")||(Ve=`${Ve}/`);do{let ke=b.get(Ve);if(typeof ke>\"u\"||ke.discardFromLookup&&!be){Ve=Ve.substring(0,Ve.lastIndexOf(\"/\",Ve.length-2)+1);continue}return ke.locator}while(Ve!==\"\");return null}function se(Fe){try{return e.fakeFs.readFileSync(fe.toPortablePath(Fe),\"utf8\")}catch(Ne){if(Ne.code===\"ENOENT\")return;throw Ne}}function X(Fe,Ne,{considerBuiltins:be=!0}={}){if(Fe.startsWith(\"#\"))throw new Error(\"resolveToUnqualified can not handle private import mappings\");if(Fe===\"pnpapi\")return fe.toPortablePath(e.pnpapiResolution);if(be&&(0,sh.isBuiltin)(Fe))return null;let Ve=lf(Fe),ke=Ne&&lf(Ne);if(Ne&&pe(Ne)&&(!J.isAbsolute(Fe)||Ae(Fe)===null)){let x=me(Fe,Ne);if(x===!1)throw gs(\"BUILTIN_NODE_RESOLUTION_FAILED\",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp)\n\nRequire request: \"${Ve}\"\nRequired by: ${ke}\n`,{request:Ve,issuer:ke});return fe.toPortablePath(x)}let it,Ue=Fe.match(a);if(Ue){if(!Ne)throw gs(\"API_ERROR\",\"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute\",{request:Ve,issuer:ke});let[,x,w]=Ue,P=Ae(Ne);if(!P){let Re=me(Fe,Ne);if(Re===!1)throw gs(\"BUILTIN_NODE_RESOLUTION_FAILED\",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).\n\nRequire path: \"${Ve}\"\nRequired by: ${ke}\n`,{request:Ve,issuer:ke});return fe.toPortablePath(Re)}let F=U(P).packageDependencies.get(x),z=null;if(F==null&&P.name!==null){let Re=t.fallbackExclusionList.get(P.name);if(!Re||!Re.has(P.reference)){for(let Ct=0,qt=h.length;Ct<qt;++Ct){let bt=U(h[Ct]).packageDependencies.get(x);if(bt!=null){r?z=bt:F=bt;break}}if(t.enableTopLevelFallback&&F==null&&z===null){let Ct=t.fallbackPool.get(x);Ct!=null&&(z=Ct)}}}let Z=null;if(F===null)if(W(P))Z=gs(\"MISSING_PEER_DEPENDENCY\",`Your application tried to access ${x} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,dependencyName:x});else{let Re=ye(x,P);Re.every(lt=>W(lt))?Z=gs(\"MISSING_PEER_DEPENDENCY\",`${P.name} tried to access ${x} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${P.name}@${P.reference} (via ${ke})\n${Re.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference}\n`).join(\"\")}\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},P),dependencyName:x,brokenAncestors:Re}):Z=gs(\"MISSING_PEER_DEPENDENCY\",`${P.name} tried to access ${x} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${P.name}@${P.reference} (via ${ke})\n\n${Re.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference}\n`).join(\"\")}\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},P),dependencyName:x,brokenAncestors:Re})}else F===void 0&&(!be&&(0,sh.isBuiltin)(Fe)?W(P)?Z=gs(\"UNDECLARED_DEPENDENCY\",`Your application tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,dependencyName:x}):Z=gs(\"UNDECLARED_DEPENDENCY\",`${P.name} tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in ${P.name}'s dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},P),dependencyName:x}):W(P)?Z=gs(\"UNDECLARED_DEPENDENCY\",`Your application tried to access ${x}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${ke}\n`,{request:Ve,issuer:ke,dependencyName:x}):Z=gs(\"UNDECLARED_DEPENDENCY\",`${P.name} tried to access ${x}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: ${x}${x!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${P.name}@${P.reference} (via ${ke})\n`,{request:Ve,issuer:ke,issuerLocator:Object.assign({},P),dependencyName:x}));if(F==null){if(z===null||Z===null)throw Z||new Error(\"Assertion failed: Expected an error to have been set\");F=z;let Re=Z.message.replace(/\\n.*/g,\"\");Z.message=Re,!E.has(Re)&&s!==0&&(E.add(Re),process.emitWarning(Z))}let $=Array.isArray(F)?{name:F[0],reference:F[1]}:{name:x,reference:F},oe=U($);if(!oe.packageLocation)throw gs(\"MISSING_DEPENDENCY\",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.\n\nRequired package: ${$.name}@${$.reference}${$.name!==Ve?` (via \"${Ve}\")`:\"\"}\nRequired by: ${P.name}@${P.reference} (via ${ke})\n`,{request:Ve,issuer:ke,dependencyLocator:Object.assign({},$)});let xe=oe.packageLocation;w?it=J.join(xe,w):it=xe}else if(J.isAbsolute(Fe))it=J.normalize(Fe);else{if(!Ne)throw gs(\"API_ERROR\",\"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute\",{request:Ve,issuer:ke});let x=J.resolve(Ne);Ne.match(c)?it=J.normalize(J.join(x,Fe)):it=J.normalize(J.join(J.dirname(x),Fe))}return J.normalize(it)}function De(Fe,Ne,be=ee,Ve){if(n.test(Fe))return Ne;let ke=ie(Ne,be,Ve);return ke?J.normalize(ke):Ne}function Te(Fe,{extensions:Ne=Object.keys(sh.Module._extensions)}={}){let be=[],Ve=ue(Fe,be,{extensions:Ne});if(Ve)return J.normalize(Ve);{EBe(be.map(Ue=>fe.fromPortablePath(Ue)));let ke=lf(Fe),it=Ae(Fe);if(it){let{packageLocation:Ue}=U(it),x=!0;try{e.fakeFs.accessSync(Ue)}catch(w){if(w?.code===\"ENOENT\")x=!1;else{let P=(w?.message??w??\"empty exception thrown\").replace(/^[A-Z]/,y=>y.toLowerCase());throw gs(\"QUALIFIED_PATH_RESOLUTION_FAILED\",`Required package exists but could not be accessed (${P}).\n\nMissing package: ${it.name}@${it.reference}\nExpected package location: ${lf(Ue)}\n`,{unqualifiedPath:ke,extensions:Ne})}}if(!x){let w=Ue.includes(\"/unplugged/\")?\"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).\":\"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.\";throw gs(\"QUALIFIED_PATH_RESOLUTION_FAILED\",`${w}\n\nMissing package: ${it.name}@${it.reference}\nExpected package location: ${lf(Ue)}\n`,{unqualifiedPath:ke,extensions:Ne})}}throw gs(\"QUALIFIED_PATH_RESOLUTION_FAILED\",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.\n\nSource path: ${ke}\n${be.map(Ue=>`Not found: ${lf(Ue)}\n`).join(\"\")}`,{unqualifiedPath:ke,extensions:Ne})}}function mt(Fe,Ne,be){if(!Ne)throw new Error(\"Assertion failed: An issuer is required to resolve private import mappings\");let Ve=ABe({name:Fe,base:(0,jm.pathToFileURL)(fe.fromPortablePath(Ne)),conditions:be.conditions??ee,readFileSyncFn:se});if(Ve instanceof URL)return Te(fe.toPortablePath((0,jm.fileURLToPath)(Ve)),{extensions:be.extensions});if(Ve.startsWith(\"#\"))throw new Error(\"Mapping from one private import to another isn't allowed\");return j(Ve,Ne,be)}function j(Fe,Ne,be={}){try{if(Fe.startsWith(\"#\"))return mt(Fe,Ne,be);let{considerBuiltins:Ve,extensions:ke,conditions:it}=be,Ue=X(Fe,Ne,{considerBuiltins:Ve});if(Fe===\"pnpapi\")return Ue;if(Ue===null)return null;let x=()=>Ne!==null?pe(Ne):!1,w=(!Ve||!(0,sh.isBuiltin)(Fe))&&!x()?De(Fe,Ue,it,Ne):Ue;return Te(w,{extensions:ke})}catch(Ve){throw Object.hasOwn(Ve,\"pnpCode\")&&Object.assign(Ve.data,{request:lf(Fe),issuer:Ne&&lf(Ne)}),Ve}}function rt(Fe){let Ne=J.normalize(Fe),be=uo.resolveVirtual(Ne);return be!==Ne?be:null}return{VERSIONS:Be,topLevel:Ce,getLocator:(Fe,Ne)=>Array.isArray(Ne)?{name:Ne[0],reference:Ne[1]}:{name:Fe,reference:Ne},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let Fe=[];for(let[Ne,be]of S)for(let Ve of be.keys())Ne!==null&&Ve!==null&&Fe.push({name:Ne,reference:Ve});return Fe},getPackageInformation:Fe=>{let Ne=g(Fe);if(Ne===null)return null;let be=fe.fromPortablePath(Ne.packageLocation);return{...Ne,packageLocation:be}},findPackageLocator:Fe=>Ae(fe.toPortablePath(Fe)),resolveToUnqualified:N(\"resolveToUnqualified\",(Fe,Ne,be)=>{let Ve=Ne!==null?fe.toPortablePath(Ne):null,ke=X(fe.toPortablePath(Fe),Ve,be);return ke===null?null:fe.fromPortablePath(ke)}),resolveUnqualified:N(\"resolveUnqualified\",(Fe,Ne)=>fe.fromPortablePath(Te(fe.toPortablePath(Fe),Ne))),resolveRequest:N(\"resolveRequest\",(Fe,Ne,be)=>{let Ve=Ne!==null?fe.toPortablePath(Ne):null,ke=j(fe.toPortablePath(Fe),Ve,be);return ke===null?null:fe.fromPortablePath(ke)}),resolveVirtual:N(\"resolveVirtual\",Fe=>{let Ne=rt(fe.toPortablePath(Fe));return Ne!==null?fe.fromPortablePath(Ne):null})}}Dt();var IBe=(t,e,r)=>{let s=RD(t),a=XW(s,{basePath:e}),n=fe.join(e,Er.pnpCjs);return cY(a,{fakeFs:r,pnpapiResolution:n})};var fY=ut(wBe());Yt();var gA={};Vt(gA,{checkManifestCompatibility:()=>BBe,extractBuildRequest:()=>sN,getExtractHint:()=>AY,hasBindingGyp:()=>pY});Ge();Dt();function BBe(t){return G.isPackageCompatible(t,fs.getArchitectureSet())}function sN(t,e,r,{configuration:s}){let a=[];for(let n of[\"preinstall\",\"install\",\"postinstall\"])e.manifest.scripts.has(n)&&a.push({type:0,script:n});return!e.manifest.scripts.has(\"install\")&&e.misc.hasBindingGyp&&a.push({type:1,script:\"node-gyp rebuild\"}),a.length===0?null:t.linkType!==\"HARD\"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${G.prettyLocator(s,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${G.prettyLocator(s,t)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!s.get(\"enableScripts\")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${G.prettyLocator(s,t)} lists build scripts, but all build scripts have been disabled.`)}:BBe(t)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${G.prettyLocator(s,t)} The ${fs.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var adt=new Set([\".exe\",\".bin\",\".h\",\".hh\",\".hpp\",\".c\",\".cc\",\".cpp\",\".java\",\".jar\",\".node\"]);function AY(t){return t.packageFs.getExtractHint({relevantExtensions:adt})}function pY(t){let e=J.join(t.prefixPath,\"binding.gyp\");return t.packageFs.existsSync(e)}var HD={};Vt(HD,{getUnpluggedPath:()=>_D});Ge();Dt();function _D(t,{configuration:e}){return J.resolve(e.get(\"pnpUnpluggedFolder\"),G.slugifyLocator(t))}var ldt=new Set([G.makeIdent(null,\"open\").identHash,G.makeIdent(null,\"opn\").identHash]),sg=class{constructor(){this.mode=\"strict\";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:\"PnpLinker\",version:2})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error(\"Assertion failed: Expected the PnP linker to be enabled\");let s=og(r.project).cjs;if(!ce.existsSync(s))throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let a=je.getFactoryWithDefault(this.pnpCache,s,()=>je.dynamicRequire(s,{cachingStrategy:je.CachingStrategy.FsTime})),n={name:G.stringifyIdent(e),reference:e.reference},c=a.getPackageInformation(n);if(!c)throw new nt(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed PnP map - running an install might help`);return fe.toPortablePath(c.packageLocation)}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=og(r.project).cjs;if(!ce.existsSync(s))return null;let n=je.getFactoryWithDefault(this.pnpCache,s,()=>je.dynamicRequire(s,{cachingStrategy:je.CachingStrategy.FsTime})).findPackageLocator(fe.fromPortablePath(e));return n?G.makeLocator(G.parseIdent(n.name),n.reference):null}makeInstaller(e){return new Gm(e)}isEnabled(e){return!(e.project.configuration.get(\"nodeLinker\")!==\"pnp\"||e.project.configuration.get(\"pnpMode\")!==this.mode)}},Gm=class{constructor(e){this.opts=e;this.mode=\"strict\";this.asyncActions=new je.AsyncActions(10);this.packageRegistry=new Map;this.virtualTemplates=new Map;this.isESMLoaderRequired=!1;this.customData={store:new Map};this.unpluggedPaths=new Set;this.opts=e}attachCustomData(e){this.customData=e}async installPackage(e,r,s){let a=G.stringifyIdent(e),n=e.reference,c=!!this.opts.project.tryWorkspaceByLocator(e),f=G.isVirtualLocator(e),p=e.peerDependencies.size>0&&!f,h=!p&&!c,E=!p&&e.linkType!==\"SOFT\",C,S;if(h||E){let ee=f?G.devirtualizeLocator(e):e;C=this.customData.store.get(ee.locatorHash),typeof C>\"u\"&&(C=await cdt(r),e.linkType===\"HARD\"&&this.customData.store.set(ee.locatorHash,C)),C.manifest.type===\"module\"&&(this.isESMLoaderRequired=!0),S=this.opts.project.getDependencyMeta(ee,e.version)}let b=h?sN(e,C,S,{configuration:this.opts.project.configuration}):null,I=E?await this.unplugPackageIfNeeded(e,C,r,S,s):r.packageFs;if(J.isAbsolute(r.prefixPath))throw new Error(`Assertion failed: Expected the prefix path (${r.prefixPath}) to be relative to the parent`);let T=J.resolve(I.getRealPath(),r.prefixPath),N=hY(this.opts.project.cwd,T),U=new Map,W=new Set;if(f){for(let ee of e.peerDependencies.values())U.set(G.stringifyIdent(ee),null),W.add(G.stringifyIdent(ee));if(!c){let ee=G.devirtualizeLocator(e);this.virtualTemplates.set(ee.locatorHash,{location:hY(this.opts.project.cwd,uo.resolveVirtual(T)),locator:ee})}}return je.getMapWithDefault(this.packageRegistry,a).set(n,{packageLocation:N,packageDependencies:U,packagePeers:W,linkType:e.linkType,discardFromLookup:r.discardFromLookup||!1}),{packageLocation:T,buildRequest:b}}async attachInternalDependencies(e,r){let s=this.getPackageInformation(e);for(let[a,n]of r){let c=G.areIdentsEqual(a,n)?n.reference:[G.stringifyIdent(n),n.reference];s.packageDependencies.set(G.stringifyIdent(a),c)}}async attachExternalDependents(e,r){for(let s of r)this.getDiskInformation(s).packageDependencies.set(G.stringifyIdent(e),e.reference)}async finalizeInstall(){if(this.opts.project.configuration.get(\"pnpMode\")!==this.mode)return;let e=og(this.opts.project);if(this.isEsmEnabled()||await ce.removePromise(e.esmLoader),this.opts.project.configuration.get(\"nodeLinker\")!==\"pnp\"){await ce.removePromise(e.cjs),await ce.removePromise(e.data),await ce.removePromise(e.esmLoader),await ce.removePromise(this.opts.project.configuration.get(\"pnpUnpluggedFolder\"));return}for(let{locator:C,location:S}of this.virtualTemplates.values())je.getMapWithDefault(this.packageRegistry,G.stringifyIdent(C)).set(C.reference,{packageLocation:S,packageDependencies:new Map,packagePeers:new Set,linkType:\"SOFT\",discardFromLookup:!1});let r=this.opts.project.configuration.get(\"pnpFallbackMode\"),s=this.opts.project.workspaces.map(({anchoredLocator:C})=>({name:G.stringifyIdent(C),reference:C.reference})),a=r!==\"none\",n=[],c=new Map,f=je.buildIgnorePattern([\".yarn/sdks/**\",...this.opts.project.configuration.get(\"pnpIgnorePatterns\")]),p=this.packageRegistry,h=this.opts.project.configuration.get(\"pnpShebang\"),E=this.opts.project.configuration.get(\"pnpZipBackend\");if(r===\"dependencies-only\")for(let C of this.opts.project.storedPackages.values())this.opts.project.tryWorkspaceByLocator(C)&&n.push({name:G.stringifyIdent(C),reference:C.reference});return await this.asyncActions.wait(),await this.finalizeInstallWithPnp({dependencyTreeRoots:s,enableTopLevelFallback:a,fallbackExclusionList:n,fallbackPool:c,ignorePattern:f,pnpZipBackend:E,packageRegistry:p,shebang:h}),{customData:this.customData}}async transformPnpSettings(e){}isEsmEnabled(){if(this.opts.project.configuration.sources.has(\"pnpEnableEsmLoader\"))return this.opts.project.configuration.get(\"pnpEnableEsmLoader\");if(this.isESMLoaderRequired)return!0;for(let e of this.opts.project.workspaces)if(e.manifest.type===\"module\")return!0;return!1}async finalizeInstallWithPnp(e){let r=og(this.opts.project),s=await this.locateNodeModules(e.ignorePattern);if(s.length>0){this.opts.report.reportWarning(31,\"One or more node_modules have been detected and will be removed. This operation may take some time.\");for(let n of s)await ce.removePromise(n)}if(await this.transformPnpSettings(e),this.opts.project.configuration.get(\"pnpEnableInlining\")){let n=z2e(e);await ce.changeFilePromise(r.cjs,n,{automaticNewlines:!0,mode:493}),await ce.removePromise(r.data)}else{let{dataFile:n,loaderFile:c}=Z2e(e);await ce.changeFilePromise(r.cjs,c,{automaticNewlines:!0,mode:493}),await ce.changeFilePromise(r.data,n,{automaticNewlines:!0,mode:420})}this.isEsmEnabled()&&(this.opts.report.reportWarning(0,\"ESM support for PnP uses the experimental loader API and is therefore experimental\"),await ce.changeFilePromise(r.esmLoader,(0,fY.default)(),{automaticNewlines:!0,mode:420}));let a=this.opts.project.configuration.get(\"pnpUnpluggedFolder\");if(this.unpluggedPaths.size===0)await ce.removePromise(a);else for(let n of await ce.readdirPromise(a)){let c=J.resolve(a,n);this.unpluggedPaths.has(c)||await ce.removePromise(c)}}async locateNodeModules(e){let r=[],s=e?new RegExp(e):null;for(let a of this.opts.project.workspaces){let n=J.join(a.cwd,\"node_modules\");if(s&&s.test(J.relative(this.opts.project.cwd,a.cwd))||!ce.existsSync(n))continue;let c=await ce.readdirPromise(n,{withFileTypes:!0}),f=c.filter(p=>!p.isDirectory()||p.name===\".bin\"||!p.name.startsWith(\".\"));if(f.length===c.length)r.push(n);else for(let p of f)r.push(J.join(n,p.name))}return r}async unplugPackageIfNeeded(e,r,s,a,n){return this.shouldBeUnplugged(e,r,a)?this.unplugPackage(e,s,n):s.packageFs}shouldBeUnplugged(e,r,s){return typeof s.unplugged<\"u\"?s.unplugged:ldt.has(e.identHash)||e.conditions!=null?!0:r.manifest.preferUnplugged!==null?r.manifest.preferUnplugged:!!(sN(e,r,s,{configuration:this.opts.project.configuration})?.skipped===!1||r.misc.extractHint)}async unplugPackage(e,r,s){let a=_D(e,{configuration:this.opts.project.configuration});return this.opts.project.disabledLocators.has(e.locatorHash)?new _f(a,{baseFs:r.packageFs,pathUtils:J}):(this.unpluggedPaths.add(a),s.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{let n=J.join(a,r.prefixPath,\".ready\");await ce.existsPromise(n)||(this.opts.project.storedBuildState.delete(e.locatorHash),await ce.mkdirPromise(a,{recursive:!0}),await ce.copyPromise(a,vt.dot,{baseFs:r.packageFs,overwrite:!1}),await ce.writeFilePromise(n,\"\"))})),new Sn(a))}getPackageInformation(e){let r=G.stringifyIdent(e),s=e.reference,a=this.packageRegistry.get(r);if(!a)throw new Error(`Assertion failed: The package information store should have been available (for ${G.prettyIdent(this.opts.project.configuration,e)})`);let n=a.get(s);if(!n)throw new Error(`Assertion failed: The package information should have been available (for ${G.prettyLocator(this.opts.project.configuration,e)})`);return n}getDiskInformation(e){let r=je.getMapWithDefault(this.packageRegistry,\"@@disk\"),s=hY(this.opts.project.cwd,e);return je.getFactoryWithDefault(r,s,()=>({packageLocation:s,packageDependencies:new Map,packagePeers:new Set,linkType:\"SOFT\",discardFromLookup:!1}))}};function hY(t,e){let r=J.relative(t,e);return r.match(/^\\.{0,2}\\//)||(r=`./${r}`),r.replace(/\\/?$/,\"/\")}async function cdt(t){let e=await Ut.tryFind(t.prefixPath,{baseFs:t.packageFs})??new Ut,r=new Set([\"preinstall\",\"install\",\"postinstall\"]);for(let s of e.scripts.keys())r.has(s)||e.scripts.delete(s);return{manifest:{scripts:e.scripts,preferUnplugged:e.preferUnplugged,type:e.type},misc:{extractHint:AY(t),hasBindingGyp:pY(t)}}}Ge();Ge();Yt();var vBe=ut(Go());var Sw=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Unplug direct dependencies from the entire project\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Unplug both direct and transitive dependencies\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.patterns=ge.Rest()}static{this.paths=[[\"unplug\"]]}static{this.usage=ot.Usage({description:\"force the unpacking of a list of packages\",details:\"\\n      This command will add the selectors matching the specified patterns to the list of packages that must be unplugged when installed.\\n\\n      A package being unplugged means that instead of being referenced directly through its archive, it will be unpacked at install time in the directory configured via `pnpUnpluggedFolder`. Note that unpacking packages this way is generally not recommended because it'll make it harder to store your packages within the repository. However, it's a good approach to quickly and safely debug some packages, and can even sometimes be required depending on the context (for example when the package contains shellscripts).\\n\\n      Running the command will set a persistent flag inside your top-level `package.json`, in the `dependenciesMeta` field. As such, to undo its effects, you'll need to revert the changes made to the manifest and run `yarn install` to apply the modification.\\n\\n      By default, only direct dependencies from the current workspace are affected. If `-A,--all` is set, direct dependencies from the entire project are affected. Using the `-R,--recursive` flag will affect transitive dependencies as well as direct ones.\\n\\n      This command accepts glob patterns inside the scope and name components (not the range). Make sure to escape the patterns to prevent your own shell from trying to expand them.\\n    \",examples:[[\"Unplug the lodash dependency from the active workspace\",\"yarn unplug lodash\"],[\"Unplug all instances of lodash referenced by any workspace\",\"yarn unplug lodash -A\"],[\"Unplug all instances of lodash referenced by the active workspace and its dependencies\",\"yarn unplug lodash -R\"],[\"Unplug all instances of lodash, anywhere\",\"yarn unplug lodash -AR\"],[\"Unplug one specific version of lodash\",\"yarn unplug lodash@1.2.3\"],[\"Unplug all packages with the `@babel` scope\",\"yarn unplug '@babel/*'\"],[\"Unplug all packages (only for testing, not recommended)\",\"yarn unplug -R '*'\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);if(r.get(\"nodeLinker\")!==\"pnp\")throw new nt(\"This command can only be used if the `nodeLinker` option is set to `pnp`\");await s.restoreInstallState();let c=new Set(this.patterns),f=this.patterns.map(b=>{let I=G.parseDescriptor(b),T=I.range!==\"unknown\"?I:G.makeDescriptor(I,\"*\");if(!Fr.validRange(T.range))throw new nt(`The range of the descriptor patterns must be a valid semver range (${G.prettyDescriptor(r,T)})`);return N=>{let U=G.stringifyIdent(N);return!vBe.default.isMatch(U,G.stringifyIdent(T))||N.version&&!Fr.satisfiesWithPrereleases(N.version,T.range)?!1:(c.delete(b),!0)}}),p=()=>{let b=[];for(let I of s.storedPackages.values())!s.tryWorkspaceByLocator(I)&&!G.isVirtualLocator(I)&&f.some(T=>T(I))&&b.push(I);return b},h=b=>{let I=new Set,T=[],N=(U,W)=>{if(I.has(U.locatorHash))return;let ee=!!s.tryWorkspaceByLocator(U);if(!(W>0&&!this.recursive&&ee)&&(I.add(U.locatorHash),!s.tryWorkspaceByLocator(U)&&f.some(ie=>ie(U))&&T.push(U),!(W>0&&!this.recursive)))for(let ie of U.dependencies.values()){let ue=s.storedResolutions.get(ie.descriptorHash);if(!ue)throw new Error(\"Assertion failed: The resolution should have been registered\");let le=s.storedPackages.get(ue);if(!le)throw new Error(\"Assertion failed: The package should have been registered\");N(le,W+1)}};for(let U of b)N(U.anchoredPackage,0);return T},E,C;if(this.all&&this.recursive?(E=p(),C=\"the project\"):this.all?(E=h(s.workspaces),C=\"any workspace\"):(E=h([a]),C=\"this workspace\"),c.size>1)throw new nt(`Patterns ${he.prettyList(r,c,he.Type.CODE)} don't match any packages referenced by ${C}`);if(c.size>0)throw new nt(`Pattern ${he.prettyList(r,c,he.Type.CODE)} doesn't match any packages referenced by ${C}`);E=je.sortMap(E,b=>G.stringifyLocator(b));let S=await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async b=>{for(let I of E){let T=I.version??\"unknown\",N=s.topLevelWorkspace.manifest.ensureDependencyMeta(G.makeDescriptor(I,T));N.unplugged=!0,b.reportInfo(0,`Will unpack ${G.prettyLocator(r,I)} to ${he.pretty(r,_D(I,{configuration:r}),he.Type.PATH)}`),b.reportJson({locator:G.stringifyLocator(I),version:T})}await s.topLevelWorkspace.persistManifest(),this.json||b.reportSeparator()});return S.hasErrors()?S.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};var og=t=>({cjs:J.join(t.cwd,Er.pnpCjs),data:J.join(t.cwd,Er.pnpData),esmLoader:J.join(t.cwd,Er.pnpEsmLoader)}),DBe=t=>/\\s/.test(t)?JSON.stringify(t):t;async function udt(t,e,r){let s=/\\s*--require\\s+\\S*\\.pnp\\.c?js\\s*/g,a=/\\s*--experimental-loader\\s+\\S*\\.pnp\\.loader\\.mjs\\s*/,n=(e.NODE_OPTIONS??\"\").replace(s,\" \").replace(a,\" \").trim();if(t.configuration.get(\"nodeLinker\")!==\"pnp\"){e.NODE_OPTIONS=n||void 0;return}let c=og(t),f=`--require ${DBe(fe.fromPortablePath(c.cjs))}`;ce.existsSync(c.esmLoader)&&(f=`${f} --experimental-loader ${(0,SBe.pathToFileURL)(fe.fromPortablePath(c.esmLoader)).href}`),ce.existsSync(c.cjs)&&(e.NODE_OPTIONS=n?`${f} ${n}`:f)}async function fdt(t,e){let r=og(t);e(r.cjs),e(r.data),e(r.esmLoader),e(t.configuration.get(\"pnpUnpluggedFolder\"))}var Adt={hooks:{populateYarnPaths:fdt,setupScriptEnvironment:udt},configuration:{nodeLinker:{description:'The linker used for installing Node packages, one of: \"pnp\", \"pnpm\", or \"node-modules\"',type:\"STRING\",default:\"pnp\"},minizip:{description:\"Whether Yarn should use minizip to extract archives\",type:\"BOOLEAN\",default:!1},winLinkType:{description:\"Whether Yarn should use Windows Junctions or symlinks when creating links on Windows.\",type:\"STRING\",values:[\"junctions\",\"symlinks\"],default:\"junctions\"},pnpMode:{description:\"If 'strict', generates standard PnP maps. If 'loose', merges them with the n_m resolution.\",type:\"STRING\",default:\"strict\"},pnpShebang:{description:\"String to prepend to the generated PnP script\",type:\"STRING\",default:\"#!/usr/bin/env node\"},pnpIgnorePatterns:{description:\"Array of glob patterns; files matching them will use the classic resolution\",type:\"STRING\",default:[],isArray:!0},pnpZipBackend:{description:\"Whether to use the experimental js implementation for the ZipFS\",type:\"STRING\",values:[\"libzip\",\"js\"],default:\"libzip\"},pnpEnableEsmLoader:{description:\"If true, Yarn will generate an ESM loader (`.pnp.loader.mjs`). If this is not explicitly set Yarn tries to automatically detect whether ESM support is required.\",type:\"BOOLEAN\",default:!1},pnpEnableInlining:{description:\"If true, the PnP data will be inlined along with the generated loader\",type:\"BOOLEAN\",default:!0},pnpFallbackMode:{description:\"If true, the generated PnP loader will follow the top-level fallback rule\",type:\"STRING\",default:\"dependencies-only\"},pnpUnpluggedFolder:{description:\"Folder where the unplugged packages must be stored\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/unplugged\"}},linkers:[sg],commands:[Sw]},pdt=Adt;var FBe=ut(QBe());Yt();var wY=ut(Ie(\"crypto\")),NBe=ut(Ie(\"fs\")),OBe=1,Ri=\"node_modules\",oN=\".bin\",LBe=\".yarn-state.yml\",kdt=1e3,BY=(s=>(s.CLASSIC=\"classic\",s.HARDLINKS_LOCAL=\"hardlinks-local\",s.HARDLINKS_GLOBAL=\"hardlinks-global\",s))(BY||{}),jD=class{constructor(){this.installStateCache=new Map}getCustomDataKey(){return JSON.stringify({name:\"NodeModulesLinker\",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error(\"Assertion failed: Expected the node-modules linker to be enabled\");let s=r.project.tryWorkspaceByLocator(e);if(s)return s.cwd;let a=await je.getFactoryWithDefault(this.installStateCache,r.project.cwd,async()=>await CY(r.project,{unrollAliases:!0}));if(a===null)throw new nt(\"Couldn't find the node_modules state file - running an install might help (findPackageLocation)\");let n=a.locatorMap.get(G.stringifyLocator(e));if(!n){let p=new nt(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed node_modules map - running an install might help`);throw p.code=\"LOCATOR_NOT_INSTALLED\",p}let c=n.locations.sort((p,h)=>p.split(J.sep).length-h.split(J.sep).length),f=J.join(r.project.configuration.startingCwd,Ri);return c.find(p=>J.contains(f,p))||n.locations[0]}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=await je.getFactoryWithDefault(this.installStateCache,r.project.cwd,async()=>await CY(r.project,{unrollAliases:!0}));if(s===null)return null;let{locationRoot:a,segments:n}=aN(J.resolve(e),{skipPrefix:r.project.cwd}),c=s.locationTree.get(a);if(!c)return null;let f=c.locator;for(let p of n){if(c=c.children.get(p),!c)break;f=c.locator||f}return G.parseLocator(f)}makeInstaller(e){return new IY(e)}isEnabled(e){return e.project.configuration.get(\"nodeLinker\")===\"node-modules\"}},IY=class{constructor(e){this.opts=e;this.localStore=new Map;this.realLocatorChecksums=new Map;this.customData={store:new Map}}attachCustomData(e){this.customData=e}async installPackage(e,r){let s=J.resolve(r.packageFs.getRealPath(),r.prefixPath),a=this.customData.store.get(e.locatorHash);if(typeof a>\"u\"&&(a=await Qdt(e,r),e.linkType===\"HARD\"&&this.customData.store.set(e.locatorHash,a)),!G.isPackageCompatible(e,this.opts.project.configuration.getSupportedArchitectures()))return{packageLocation:null,buildRequest:null};let n=new Map,c=new Set;n.has(G.stringifyIdent(e))||n.set(G.stringifyIdent(e),e.reference);let f=e;if(G.isVirtualLocator(e)){f=G.devirtualizeLocator(e);for(let E of e.peerDependencies.values())n.set(G.stringifyIdent(E),null),c.add(G.stringifyIdent(E))}let p={packageLocation:`${fe.fromPortablePath(s)}/`,packageDependencies:n,packagePeers:c,linkType:e.linkType,discardFromLookup:r.discardFromLookup??!1};this.localStore.set(e.locatorHash,{pkg:e,customPackageData:a,dependencyMeta:this.opts.project.getDependencyMeta(e,e.version),pnpNode:p});let h=r.checksum?r.checksum.substring(r.checksum.indexOf(\"/\")+1):null;return this.realLocatorChecksums.set(f.locatorHash,h),{packageLocation:s,buildRequest:null}}async attachInternalDependencies(e,r){let s=this.localStore.get(e.locatorHash);if(typeof s>\"u\")throw new Error(\"Assertion failed: Expected information object to have been registered\");for(let[a,n]of r){let c=G.areIdentsEqual(a,n)?n.reference:[G.stringifyIdent(n),n.reference];s.pnpNode.packageDependencies.set(G.stringifyIdent(a),c)}}async attachExternalDependents(e,r){throw new Error(\"External dependencies haven't been implemented for the node-modules linker\")}async finalizeInstall(){if(this.opts.project.configuration.get(\"nodeLinker\")!==\"node-modules\")return;let e=new uo({baseFs:new $f({maxOpenFiles:80,readOnlyArchives:!0})}),r=await CY(this.opts.project),s=this.opts.project.configuration.get(\"nmMode\");(r===null||s!==r.nmMode)&&(this.opts.project.storedBuildState.clear(),r={locatorMap:new Map,binSymlinks:new Map,locationTree:new Map,nmMode:s,mtimeMs:0});let a=new Map(this.opts.project.workspaces.map(S=>{let b=this.opts.project.configuration.get(\"nmHoistingLimits\");try{b=je.validateEnum(xD,S.manifest.installConfig?.hoistingLimits??b)}catch{let I=G.prettyWorkspace(this.opts.project.configuration,S);this.opts.report.reportWarning(57,`${I}: Invalid 'installConfig.hoistingLimits' value. Expected one of ${Object.values(xD).join(\", \")}, using default: \"${b}\"`)}return[S.relativeCwd,b]})),n=new Map(this.opts.project.workspaces.map(S=>{let b=this.opts.project.configuration.get(\"nmSelfReferences\");return b=S.manifest.installConfig?.selfReferences??b,[S.relativeCwd,b]})),c={VERSIONS:{std:1},topLevel:{name:null,reference:null},getLocator:(S,b)=>Array.isArray(b)?{name:b[0],reference:b[1]}:{name:S,reference:b},getDependencyTreeRoots:()=>this.opts.project.workspaces.map(S=>{let b=S.anchoredLocator;return{name:G.stringifyIdent(b),reference:b.reference}}),getPackageInformation:S=>{let b=S.reference===null?this.opts.project.topLevelWorkspace.anchoredLocator:G.makeLocator(G.parseIdent(S.name),S.reference),I=this.localStore.get(b.locatorHash);if(typeof I>\"u\")throw new Error(\"Assertion failed: Expected the package reference to have been registered\");return I.pnpNode},findPackageLocator:S=>{let b=this.opts.project.tryWorkspaceByCwd(fe.toPortablePath(S));if(b!==null){let I=b.anchoredLocator;return{name:G.stringifyIdent(I),reference:I.reference}}throw new Error(\"Assertion failed: Unimplemented\")},resolveToUnqualified:()=>{throw new Error(\"Assertion failed: Unimplemented\")},resolveUnqualified:()=>{throw new Error(\"Assertion failed: Unimplemented\")},resolveRequest:()=>{throw new Error(\"Assertion failed: Unimplemented\")},resolveVirtual:S=>fe.fromPortablePath(uo.resolveVirtual(fe.toPortablePath(S)))},{tree:f,errors:p,preserveSymlinksRequired:h}=kD(c,{pnpifyFs:!1,validateExternalSoftLinks:!0,hoistingLimitsByCwd:a,project:this.opts.project,selfReferencesByCwd:n});if(!f){for(let{messageName:S,text:b}of p)this.opts.report.reportError(S,b);return}let E=zW(f);await Mdt(r,E,{baseFs:e,project:this.opts.project,report:this.opts.report,realLocatorChecksums:this.realLocatorChecksums,loadManifest:async S=>{let b=G.parseLocator(S),I=this.localStore.get(b.locatorHash);if(typeof I>\"u\")throw new Error(\"Assertion failed: Expected the slot to exist\");return I.customPackageData.manifest}});let C=[];for(let[S,b]of E.entries()){if(_Be(S))continue;let I=G.parseLocator(S),T=this.localStore.get(I.locatorHash);if(typeof T>\"u\")throw new Error(\"Assertion failed: Expected the slot to exist\");if(this.opts.project.tryWorkspaceByLocator(T.pkg))continue;let N=gA.extractBuildRequest(T.pkg,T.customPackageData,T.dependencyMeta,{configuration:this.opts.project.configuration});N&&C.push({buildLocations:b.locations,locator:I,buildRequest:N})}return h&&this.opts.report.reportWarning(72,`The application uses portals and that's why ${he.pretty(this.opts.project.configuration,\"--preserve-symlinks\",he.Type.CODE)} Node option is required for launching it`),{customData:this.customData,records:C}}};async function Qdt(t,e){let r=await Ut.tryFind(e.prefixPath,{baseFs:e.packageFs})??new Ut,s=new Set([\"preinstall\",\"install\",\"postinstall\"]);for(let a of r.scripts.keys())s.has(a)||r.scripts.delete(a);return{manifest:{bin:r.bin,scripts:r.scripts},misc:{hasBindingGyp:gA.hasBindingGyp(e)}}}async function Rdt(t,e,r,s,{installChangedByUser:a}){let n=\"\";n+=`# Warning: This file is automatically generated. Removing it is fine, but will\n`,n+=`# cause your node_modules installation to become invalidated.\n`,n+=`\n`,n+=`__metadata:\n`,n+=`  version: ${OBe}\n`,n+=`  nmMode: ${s.value}\n`;let c=Array.from(e.keys()).sort(),f=G.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let E of c){let C=e.get(E);n+=`\n`,n+=`${JSON.stringify(E)}:\n`,n+=`  locations:\n`;for(let S of C.locations){let b=J.contains(t.cwd,S);if(b===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=`    - ${JSON.stringify(b)}\n`}if(C.aliases.length>0){n+=`  aliases:\n`;for(let S of C.aliases)n+=`    - ${JSON.stringify(S)}\n`}if(E===f&&r.size>0){n+=`  bin:\n`;for(let[S,b]of r){let I=J.contains(t.cwd,S);if(I===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=`    ${JSON.stringify(I)}:\n`;for(let[T,N]of b){let U=J.relative(J.join(S,Ri),N);n+=`      ${JSON.stringify(T)}: ${JSON.stringify(U)}\n`}}}}let p=t.cwd,h=J.join(p,Ri,LBe);a&&await ce.removePromise(h),await ce.changeFilePromise(h,n,{automaticNewlines:!0})}async function CY(t,{unrollAliases:e=!1}={}){let r=t.cwd,s=J.join(r,Ri,LBe),a;try{a=await ce.statPromise(s)}catch{}if(!a)return null;let n=as(await ce.readFilePromise(s,\"utf8\"));if(n.__metadata.version>OBe)return null;let c=n.__metadata.nmMode||\"classic\",f=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let C=E.locations.map(b=>J.join(r,b)),S=E.bin;if(S)for(let[b,I]of Object.entries(S)){let T=J.join(r,fe.toPortablePath(b)),N=je.getMapWithDefault(p,T);for(let[U,W]of Object.entries(I))N.set(U,fe.toPortablePath([T,Ri,W].join(J.sep)))}if(f.set(h,{target:vt.dot,linkType:\"HARD\",locations:C,aliases:E.aliases||[]}),e&&E.aliases)for(let b of E.aliases){let{scope:I,name:T}=G.parseLocator(h),N=G.makeLocator(G.makeIdent(I,T),b),U=G.stringifyLocator(N);f.set(U,{target:vt.dot,linkType:\"HARD\",locations:C,aliases:[]})}}return{locatorMap:f,binSymlinks:p,locationTree:MBe(f,{skipPrefix:t.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var Pw=async(t,e)=>{if(t.split(J.sep).indexOf(Ri)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{let r;if(!e.innerLoop&&(r=await ce.lstatPromise(t),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!e.isWorkspaceDir)){await ce.unlinkPromise(t);return}let s=await ce.readdirPromise(t,{withFileTypes:!0});for(let n of s){let c=J.join(t,n.name);n.isDirectory()?(n.name!==Ri||e&&e.innerLoop)&&await Pw(c,{innerLoop:!0,contentsOnly:!1}):await ce.unlinkPromise(c)}let a=!e.innerLoop&&e.isWorkspaceDir&&r?.isSymbolicLink();!e.contentsOnly&&!a&&await ce.rmdirPromise(t)}catch(r){if(r.code!==\"ENOENT\"&&r.code!==\"ENOTEMPTY\")throw r}},RBe=4,aN=(t,{skipPrefix:e})=>{let r=J.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let s=r.split(J.sep).filter(p=>p!==\"\"),a=s.indexOf(Ri),n=s.slice(0,a).join(J.sep),c=J.join(e,n),f=s.slice(a);return{locationRoot:c,segments:f}},MBe=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let s=()=>({children:new Map,linkType:\"HARD\"});for(let[a,n]of t.entries()){if(n.linkType===\"SOFT\"&&J.contains(e,n.target)!==null){let f=je.getFactoryWithDefault(r,n.target,s);f.locator=a,f.linkType=n.linkType}for(let c of n.locations){let{locationRoot:f,segments:p}=aN(c,{skipPrefix:e}),h=je.getFactoryWithDefault(r,f,s);for(let E=0;E<p.length;++E){let C=p[E];if(C!==\".\"){let S=je.getFactoryWithDefault(h.children,C,s);h.children.set(C,S),h=S}E===p.length-1&&(h.locator=a,h.linkType=n.linkType)}}}return r},vY=async(t,e,r)=>{if(process.platform===\"win32\"&&r===\"junctions\"){let s;try{s=await ce.lstatPromise(t)}catch{}if(!s||s.isDirectory()){await ce.symlinkPromise(t,e,\"junction\");return}}await ce.symlinkPromise(J.relative(J.dirname(e),t),e)};async function UBe(t,e,r){let s=J.join(t,`${wY.default.randomBytes(16).toString(\"hex\")}.tmp`);try{await ce.writeFilePromise(s,r);try{await ce.linkPromise(s,e)}catch{}}finally{await ce.unlinkPromise(s)}}async function Tdt({srcPath:t,dstPath:e,entry:r,globalHardlinksStore:s,baseFs:a,nmMode:n}){if(r.kind===\"file\"){if(n.value===\"hardlinks-global\"&&s&&r.digest){let f=J.join(s,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await ce.statPromise(f);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-kdt))if(await Nn.checksumFile(f,{baseFs:ce,algorithm:\"sha1\"})!==r.digest){let C=J.join(s,`${wY.default.randomBytes(16).toString(\"hex\")}.tmp`);await ce.renamePromise(f,C);let S=await a.readFilePromise(t);await ce.writeFilePromise(C,S);try{await ce.linkPromise(C,f),r.mtimeMs=new Date().getTime(),await ce.unlinkPromise(C)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await ce.linkPromise(f,e),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(t);await UBe(s,f,h),r.mtimeMs=new Date().getTime();try{await ce.linkPromise(f,e)}catch(E){E&&E.code&&E.code==\"EXDEV\"&&(n.value=\"hardlinks-local\",await a.copyFilePromise(t,e))}}}else await a.copyFilePromise(t,e);let c=r.mode&511;c!==420&&await ce.chmodPromise(e,c)}}var Fdt=async(t,e,{baseFs:r,globalHardlinksStore:s,nmMode:a,windowsLinkType:n,packageChecksum:c})=>{await ce.mkdirPromise(t,{recursive:!0});let f=async(E=vt.dot)=>{let C=J.join(e,E),S=await r.readdirPromise(C,{withFileTypes:!0}),b=new Map;for(let I of S){let T=J.join(E,I.name),N,U=J.join(C,I.name);if(I.isFile()){if(N={kind:\"file\",mode:(await r.lstatPromise(U)).mode},a.value===\"hardlinks-global\"){let W=await Nn.checksumFile(U,{baseFs:r,algorithm:\"sha1\"});N.digest=W}}else if(I.isDirectory())N={kind:\"directory\"};else if(I.isSymbolicLink())N={kind:\"symlink\",symlinkTo:await r.readlinkPromise(U)};else throw new Error(`Unsupported file type (file: ${U}, mode: 0o${await r.statSync(U).mode.toString(8).padStart(6,\"0\")})`);if(b.set(T,N),I.isDirectory()&&T!==Ri){let W=await f(T);for(let[ee,ie]of W)b.set(ee,ie)}}return b},p;if(a.value===\"hardlinks-global\"&&s&&c){let E=J.join(s,c.substring(0,2),`${c.substring(2)}.json`);try{p=new Map(Object.entries(JSON.parse(await ce.readFilePromise(E,\"utf8\"))))}catch{p=await f()}}else p=await f();let h=!1;for(let[E,C]of p){let S=J.join(e,E),b=J.join(t,E);if(C.kind===\"directory\")await ce.mkdirPromise(b,{recursive:!0});else if(C.kind===\"file\"){let I=C.mtimeMs;await Tdt({srcPath:S,dstPath:b,entry:C,nmMode:a,baseFs:r,globalHardlinksStore:s}),C.mtimeMs!==I&&(h=!0)}else C.kind===\"symlink\"&&await vY(J.resolve(J.dirname(b),C.symlinkTo),b,n)}if(a.value===\"hardlinks-global\"&&s&&h&&c){let E=J.join(s,c.substring(0,2),`${c.substring(2)}.json`);await ce.removePromise(E),await UBe(s,E,Buffer.from(JSON.stringify(Object.fromEntries(p))))}};function Ndt(t,e,r,s){let a=new Map,n=new Map,c=new Map,f=!1,p=(h,E,C,S,b)=>{let I=!0,T=J.join(h,E),N=new Set;if(E===Ri||E.startsWith(\"@\")){let W;try{W=ce.statSync(T)}catch{}I=!!W,W?W.mtimeMs>r?(f=!0,N=new Set(ce.readdirSync(T))):N=new Set(C.children.get(E).children.keys()):f=!0;let ee=e.get(h);if(ee){let ie=J.join(h,Ri,oN),ue;try{ue=ce.statSync(ie)}catch{}if(!ue)f=!0;else if(ue.mtimeMs>r){f=!0;let le=new Set(ce.readdirSync(ie)),me=new Map;n.set(h,me);for(let[pe,Be]of ee)le.has(pe)&&me.set(pe,Be)}else n.set(h,ee)}}else I=b.has(E);let U=C.children.get(E);if(I){let{linkType:W,locator:ee}=U,ie={children:new Map,linkType:W,locator:ee};if(S.children.set(E,ie),ee){let ue=je.getSetWithDefault(c,ee);ue.add(T),c.set(ee,ue)}for(let ue of U.children.keys())p(T,ue,U,ie,N)}else U.locator&&s.storedBuildState.delete(G.parseLocator(U.locator).locatorHash)};for(let[h,E]of t){let{linkType:C,locator:S}=E,b={children:new Map,linkType:C,locator:S};if(a.set(h,b),S){let I=je.getSetWithDefault(c,E.locator);I.add(h),c.set(E.locator,I)}E.children.has(Ri)&&p(h,Ri,E,b,new Set)}return{locationTree:a,binSymlinks:n,locatorLocations:c,installChangedByUser:f}}function _Be(t){let e=G.parseDescriptor(t);return G.isVirtualDescriptor(e)&&(e=G.devirtualizeDescriptor(e)),e.range.startsWith(\"link:\")}async function Odt(t,e,r,{loadManifest:s}){let a=new Map;for(let[f,{locations:p}]of t){let h=_Be(f)?null:await s(f,p[0]),E=new Map;if(h)for(let[C,S]of h.bin){let b=J.join(p[0],S);S!==\"\"&&ce.existsSync(b)&&E.set(C,S)}a.set(f,E)}let n=new Map,c=(f,p,h)=>{let E=new Map,C=J.contains(r,f);if(h.locator&&C!==null){let S=a.get(h.locator);for(let[b,I]of S){let T=J.join(f,fe.toPortablePath(I));E.set(b,T)}for(let[b,I]of h.children){let T=J.join(f,b),N=c(T,T,I);N.size>0&&n.set(f,new Map([...n.get(f)||new Map,...N]))}}else for(let[S,b]of h.children){let I=c(J.join(f,S),p,b);for(let[T,N]of I)E.set(T,N)}return E};for(let[f,p]of e){let h=c(f,f,p);h.size>0&&n.set(f,new Map([...n.get(f)||new Map,...h]))}return n}var TBe=(t,e)=>{if(!t||!e)return t===e;let r=G.parseLocator(t);G.isVirtualLocator(r)&&(r=G.devirtualizeLocator(r));let s=G.parseLocator(e);return G.isVirtualLocator(s)&&(s=G.devirtualizeLocator(s)),G.areLocatorsEqual(r,s)};function SY(t){return J.join(t.get(\"globalFolder\"),\"store\")}function Ldt(t,e){let r=s=>{let a=s.split(J.sep),n=a.lastIndexOf(Ri);if(n<0||n==a.length-1)throw new Error(`Assertion failed. Path is outside of any node_modules package ${s}`);return a.slice(0,n+(a[n+1].startsWith(\"@\")?3:2)).join(J.sep)};for(let s of t.values())for(let[a,n]of s)e.has(r(n))&&s.delete(a)}async function Mdt(t,e,{baseFs:r,project:s,report:a,loadManifest:n,realLocatorChecksums:c}){let f=J.join(s.cwd,Ri),{locationTree:p,binSymlinks:h,locatorLocations:E,installChangedByUser:C}=Ndt(t.locationTree,t.binSymlinks,t.mtimeMs,s),S=MBe(e,{skipPrefix:s.cwd}),b=[],I=async({srcDir:Be,dstDir:Ce,linkType:g,globalHardlinksStore:we,nmMode:ye,windowsLinkType:Ae,packageChecksum:se})=>{let X=(async()=>{try{g===\"SOFT\"?(await ce.mkdirPromise(J.dirname(Ce),{recursive:!0}),await vY(J.resolve(Be),Ce,Ae)):await Fdt(Ce,Be,{baseFs:r,globalHardlinksStore:we,nmMode:ye,windowsLinkType:Ae,packageChecksum:se})}catch(De){throw De.message=`While persisting ${Be} -> ${Ce} ${De.message}`,De}finally{ie.tick()}})().then(()=>b.splice(b.indexOf(X),1));b.push(X),b.length>RBe&&await Promise.race(b)},T=async(Be,Ce,g)=>{let we=(async()=>{let ye=async(Ae,se,X)=>{try{X.innerLoop||await ce.mkdirPromise(se,{recursive:!0});let De=await ce.readdirPromise(Ae,{withFileTypes:!0});for(let Te of De){if(!X.innerLoop&&Te.name===oN)continue;let mt=J.join(Ae,Te.name),j=J.join(se,Te.name);Te.isDirectory()?(Te.name!==Ri||X&&X.innerLoop)&&(await ce.mkdirPromise(j,{recursive:!0}),await ye(mt,j,{...X,innerLoop:!0})):me.value===\"hardlinks-local\"||me.value===\"hardlinks-global\"?await ce.linkPromise(mt,j):await ce.copyFilePromise(mt,j,NBe.default.constants.COPYFILE_FICLONE)}}catch(De){throw X.innerLoop||(De.message=`While cloning ${Ae} -> ${se} ${De.message}`),De}finally{X.innerLoop||ie.tick()}};await ye(Be,Ce,g)})().then(()=>b.splice(b.indexOf(we),1));b.push(we),b.length>RBe&&await Promise.race(b)},N=async(Be,Ce,g)=>{if(g)for(let[we,ye]of Ce.children){let Ae=g.children.get(we);await N(J.join(Be,we),ye,Ae)}else{Ce.children.has(Ri)&&await Pw(J.join(Be,Ri),{contentsOnly:!1});let we=J.basename(Be)===Ri&&p.has(J.join(J.dirname(Be)));await Pw(Be,{contentsOnly:Be===f,isWorkspaceDir:we})}};for(let[Be,Ce]of p){let g=S.get(Be);for(let[we,ye]of Ce.children){if(we===\".\")continue;let Ae=g&&g.children.get(we),se=J.join(Be,we);await N(se,ye,Ae)}}let U=async(Be,Ce,g)=>{if(g){TBe(Ce.locator,g.locator)||await Pw(Be,{contentsOnly:Ce.linkType===\"HARD\"});for(let[we,ye]of Ce.children){let Ae=g.children.get(we);await U(J.join(Be,we),ye,Ae)}}else{Ce.children.has(Ri)&&await Pw(J.join(Be,Ri),{contentsOnly:!0});let we=J.basename(Be)===Ri&&S.has(J.join(J.dirname(Be)));await Pw(Be,{contentsOnly:Ce.linkType===\"HARD\",isWorkspaceDir:we})}};for(let[Be,Ce]of S){let g=p.get(Be);for(let[we,ye]of Ce.children){if(we===\".\")continue;let Ae=g&&g.children.get(we);await U(J.join(Be,we),ye,Ae)}}let W=new Map,ee=[];for(let[Be,Ce]of E)for(let g of Ce){let{locationRoot:we,segments:ye}=aN(g,{skipPrefix:s.cwd}),Ae=S.get(we),se=we;if(Ae){for(let X of ye)if(se=J.join(se,X),Ae=Ae.children.get(X),!Ae)break;if(Ae){let X=TBe(Ae.locator,Be),De=e.get(Ae.locator),Te=De.target,mt=se,j=De.linkType;if(X)W.has(Te)||W.set(Te,mt);else if(Te!==mt){let rt=G.parseLocator(Ae.locator);G.isVirtualLocator(rt)&&(rt=G.devirtualizeLocator(rt)),ee.push({srcDir:Te,dstDir:mt,linkType:j,realLocatorHash:rt.locatorHash})}}}}for(let[Be,{locations:Ce}]of e.entries())for(let g of Ce){let{locationRoot:we,segments:ye}=aN(g,{skipPrefix:s.cwd}),Ae=p.get(we),se=S.get(we),X=we,De=e.get(Be),Te=G.parseLocator(Be);G.isVirtualLocator(Te)&&(Te=G.devirtualizeLocator(Te));let mt=Te.locatorHash,j=De.target,rt=g;if(j===rt)continue;let Fe=De.linkType;for(let Ne of ye)se=se.children.get(Ne);if(!Ae)ee.push({srcDir:j,dstDir:rt,linkType:Fe,realLocatorHash:mt});else for(let Ne of ye)if(X=J.join(X,Ne),Ae=Ae.children.get(Ne),!Ae){ee.push({srcDir:j,dstDir:rt,linkType:Fe,realLocatorHash:mt});break}}let ie=Ao.progressViaCounter(ee.length),ue=a.reportProgress(ie),le=s.configuration.get(\"nmMode\"),me={value:le},pe=s.configuration.get(\"winLinkType\");try{let Be=me.value===\"hardlinks-global\"?`${SY(s.configuration)}/v1`:null;if(Be&&!await ce.existsPromise(Be)){await ce.mkdirpPromise(Be);for(let g=0;g<256;g++)await ce.mkdirPromise(J.join(Be,g.toString(16).padStart(2,\"0\")))}for(let g of ee)(g.linkType===\"SOFT\"||!W.has(g.srcDir))&&(W.set(g.srcDir,g.dstDir),await I({...g,globalHardlinksStore:Be,nmMode:me,windowsLinkType:pe,packageChecksum:c.get(g.realLocatorHash)||null}));await Promise.all(b),b.length=0;for(let g of ee){let we=W.get(g.srcDir);g.linkType!==\"SOFT\"&&g.dstDir!==we&&await T(we,g.dstDir,{nmMode:me})}await Promise.all(b),await ce.mkdirPromise(f,{recursive:!0}),Ldt(h,new Set(ee.map(g=>g.dstDir)));let Ce=await Odt(e,S,s.cwd,{loadManifest:n});await Udt(h,Ce,s.cwd,pe),await Rdt(s,e,Ce,me,{installChangedByUser:C}),le==\"hardlinks-global\"&&me.value==\"hardlinks-local\"&&a.reportWarningOnce(74,\"'nmMode' has been downgraded to 'hardlinks-local' due to global cache and install folder being on different devices\")}finally{ue.stop()}}async function Udt(t,e,r,s){for(let a of t.keys()){if(J.contains(r,a)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${a}`);if(!e.has(a)){let n=J.join(a,Ri,oN);await ce.removePromise(n)}}for(let[a,n]of e){if(J.contains(r,a)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${a}`);let c=J.join(a,Ri,oN),f=t.get(a)||new Map;await ce.mkdirPromise(c,{recursive:!0});for(let p of f.keys())n.has(p)||(await ce.removePromise(J.join(c,p)),process.platform===\"win32\"&&await ce.removePromise(J.join(c,`${p}.cmd`)));for(let[p,h]of n){let E=f.get(p),C=J.join(c,p);E!==h&&(process.platform===\"win32\"?await(0,FBe.default)(fe.fromPortablePath(h),fe.fromPortablePath(C),{createPwshFile:!1}):(await ce.removePromise(C),await vY(h,C,s),J.contains(r,await ce.realpathPromise(h))!==null&&await ce.chmodPromise(h,493)))}}}Ge();Dt();eA();var GD=class extends sg{constructor(){super(...arguments);this.mode=\"loose\"}makeInstaller(r){return new DY(r)}},DY=class extends Gm{constructor(){super(...arguments);this.mode=\"loose\"}async transformPnpSettings(r){let s=new uo({baseFs:new $f({maxOpenFiles:80,readOnlyArchives:!0})}),a=IBe(r,this.opts.project.cwd,s),{tree:n,errors:c}=kD(a,{pnpifyFs:!1,project:this.opts.project});if(!n){for(let{messageName:C,text:S}of c)this.opts.report.reportError(C,S);return}let f=new Map;r.fallbackPool=f;let p=(C,S)=>{let b=G.parseLocator(S.locator),I=G.stringifyIdent(b);I===C?f.set(C,b.reference):f.set(C,[I,b.reference])},h=J.join(this.opts.project.cwd,Er.nodeModules),E=n.get(h);if(!(typeof E>\"u\")){if(\"target\"in E)throw new Error(\"Assertion failed: Expected the root junction point to be a directory\");for(let C of E.dirList){let S=J.join(h,C),b=n.get(S);if(typeof b>\"u\")throw new Error(\"Assertion failed: Expected the child to have been registered\");if(\"target\"in b)p(C,b);else for(let I of b.dirList){let T=J.join(S,I),N=n.get(T);if(typeof N>\"u\")throw new Error(\"Assertion failed: Expected the subchild to have been registered\");if(\"target\"in N)p(`${C}/${I}`,N);else throw new Error(\"Assertion failed: Expected the leaf junction to be a package\")}}}}};var _dt={hooks:{cleanGlobalArtifacts:async t=>{let e=SY(t);await ce.removePromise(e)}},configuration:{nmHoistingLimits:{description:\"Prevents packages to be hoisted past specific levels\",type:\"STRING\",values:[\"workspaces\",\"dependencies\",\"none\"],default:\"none\"},nmMode:{description:\"Defines in which measure Yarn must use hardlinks and symlinks when generated `node_modules` directories.\",type:\"STRING\",values:[\"classic\",\"hardlinks-local\",\"hardlinks-global\"],default:\"classic\"},nmSelfReferences:{description:\"Defines whether the linker should generate self-referencing symlinks for workspaces.\",type:\"BOOLEAN\",default:!0}},linkers:[jD,GD]},Hdt=_dt;var PK={};Vt(PK,{NpmHttpFetcher:()=>VD,NpmRemapResolver:()=>JD,NpmSemverFetcher:()=>oh,NpmSemverResolver:()=>KD,NpmTagResolver:()=>zD,default:()=>rPt,npmConfigUtils:()=>hi,npmHttpUtils:()=>an,npmPublishUtils:()=>v1});Ge();var JBe=ut(Ai());var oi=\"npm:\";var an={};Vt(an,{AuthType:()=>WBe,customPackageError:()=>qm,del:()=>imt,get:()=>Wm,getIdentUrl:()=>WD,getPackageMetadata:()=>Qw,handleInvalidAuthenticationError:()=>ag,post:()=>rmt,put:()=>nmt});Ge();Ge();Dt();var kY=ut(Vv());ql();var qBe=ut(Ai());var hi={};Vt(hi,{RegistryType:()=>jBe,getAuditRegistry:()=>jdt,getAuthConfiguration:()=>xY,getDefaultRegistry:()=>qD,getPublishRegistry:()=>Gdt,getRegistryConfiguration:()=>GBe,getScopeConfiguration:()=>bY,getScopeRegistry:()=>bw,isPackageApproved:()=>xw,normalizeRegistry:()=>Jc});Ge();var HBe=ut(Go()),jBe=(s=>(s.AUDIT_REGISTRY=\"npmAuditRegistry\",s.FETCH_REGISTRY=\"npmRegistryServer\",s.PUBLISH_REGISTRY=\"npmPublishRegistry\",s))(jBe||{});function Jc(t){return t.replace(/\\/$/,\"\")}function jdt({configuration:t}){return qD({configuration:t,type:\"npmAuditRegistry\"})}function Gdt(t,{configuration:e}){return t.publishConfig?.registry?Jc(t.publishConfig.registry):t.name?bw(t.name.scope,{configuration:e,type:\"npmPublishRegistry\"}):qD({configuration:e,type:\"npmPublishRegistry\"})}function bw(t,{configuration:e,type:r=\"npmRegistryServer\"}){let s=bY(t,{configuration:e});if(s===null)return qD({configuration:e,type:r});let a=s.get(r);return a===null?qD({configuration:e,type:r}):Jc(a)}function qD({configuration:t,type:e=\"npmRegistryServer\"}){let r=t.get(e);return Jc(r!==null?r:t.get(\"npmRegistryServer\"))}function GBe(t,{configuration:e}){let r=e.get(\"npmRegistries\"),s=Jc(t),a=r.get(s);if(typeof a<\"u\")return a;let n=r.get(s.replace(/^[a-z]+:/,\"\"));return typeof n<\"u\"?n:null}var qdt=new Map([[\"npmRegistryServer\",\"https://npm.jsr.io/\"]]);function bY(t,{configuration:e}){if(t===null)return null;let s=e.get(\"npmScopes\").get(t);return s||(t===\"jsr\"?qdt:null)}function xY(t,{configuration:e,ident:r}){let s=r&&bY(r.scope,{configuration:e});return s?.get(\"npmAuthIdent\")||s?.get(\"npmAuthToken\")?s:GBe(t,{configuration:e})||e}function Wdt({configuration:t,version:e,publishTimes:r}){let s=t.get(\"npmMinimalAgeGate\");if(s){let a=r?.[e];if(typeof a>\"u\"||(new Date().getTime()-new Date(a).getTime())/60/1e3<s)return!0}return!1}function Ydt(t,e,r){let s=G.tryParseDescriptor(r);if(!s||s.identHash!==t.identHash&&!HBe.default.isMatch(G.stringifyIdent(t),G.stringifyIdent(s)))return!1;if(s.range===\"unknown\")return!0;let a=Fr.validRange(s.range);return!(!a||!a.test(e))}function Vdt({configuration:t,ident:e,version:r}){return t.get(\"npmPreapprovedPackages\").some(s=>Ydt(e,r,s))}function xw(t){return!Wdt(t)||Vdt(t)}var WBe=(a=>(a[a.NO_AUTH=0]=\"NO_AUTH\",a[a.BEST_EFFORT=1]=\"BEST_EFFORT\",a[a.CONFIGURATION=2]=\"CONFIGURATION\",a[a.ALWAYS_AUTH=3]=\"ALWAYS_AUTH\",a))(WBe||{});async function ag(t,{attemptedAs:e,registry:r,headers:s,configuration:a}){if(cN(t))throw new jt(41,\"Invalid OTP token\");if(t.originalError?.name===\"HTTPError\"&&t.originalError?.response.statusCode===401)throw new jt(41,`Invalid authentication (${typeof e!=\"string\"?`as ${await omt(r,s,{configuration:a})}`:`attempted as ${e}`})`)}function qm(t,e){let r=t.response?.statusCode;return r?r===404?\"Package not found\":r>=500&&r<600?`The registry appears to be down (using a ${he.applyHyperlink(e,\"local cache\",\"https://yarnpkg.com/advanced/lexicon#local-cache\")} might have protected you against such outages)`:null:null}function WD(t){return t.scope?`/@${t.scope}%2f${t.name}`:`/${t.name}`}var YBe=new Map,Jdt=new Map;async function Kdt(t){return await je.getFactoryWithDefault(YBe,t,async()=>{let e=null;try{e=await ce.readJsonPromise(t)}catch{}return e})}async function zdt(t,e,{configuration:r,cached:s,registry:a,headers:n,version:c,...f}){return await je.getFactoryWithDefault(Jdt,t,async()=>await Wm(WD(e),{...f,customErrorMessage:qm,configuration:r,registry:a,ident:e,headers:{...n,\"If-None-Match\":s?.etag,\"If-Modified-Since\":s?.lastModified},wrapNetworkRequest:async p=>async()=>{let h=await p();if(h.statusCode===304){if(s===null)throw new Error(\"Assertion failed: cachedMetadata should not be null\");return{...h,body:s.metadata}}let E=Xdt(JSON.parse(h.body.toString())),C={metadata:E,etag:h.headers.etag,lastModified:h.headers[\"last-modified\"]};return YBe.set(t,Promise.resolve(C)),Promise.resolve().then(async()=>{let S=`${t}-${process.pid}.tmp`;await ce.mkdirPromise(J.dirname(S),{recursive:!0}),await ce.writeJsonPromise(S,C,{compact:!0}),await ce.renamePromise(S,t)}).catch(()=>{}),{...h,body:E}}}))}function Zdt(t){return t.scope!==null?`@${t.scope}-${t.name}-${t.scope.length}`:t.name}async function Qw(t,{cache:e,project:r,registry:s,headers:a,version:n,...c}){let{configuration:f}=r;s=YD(f,{ident:t,registry:s});let p=emt(f,s),h=J.join(p,`${Zdt(t)}.json`),E=null;if(!r.lockfileNeedsRefresh&&(E=await Kdt(h),E)){if(typeof n<\"u\"&&typeof E.metadata.versions[n]<\"u\")return E.metadata;if(f.get(\"enableOfflineMode\")){let C=structuredClone(E.metadata),S=new Set;if(e){for(let I of Object.keys(C.versions)){let T=G.makeLocator(t,`npm:${I}`),N=e.getLocatorMirrorPath(T);(!N||!ce.existsSync(N))&&(delete C.versions[I],S.add(I))}let b=C[\"dist-tags\"].latest;if(S.has(b)){let I=Object.keys(E.metadata.versions).sort(qBe.default.compare),T=I.indexOf(b);for(;S.has(I[T])&&T>=0;)T-=1;T>=0?C[\"dist-tags\"].latest=I[T]:delete C[\"dist-tags\"].latest}}return C}}return await zdt(h,t,{...c,configuration:f,cached:E,registry:s,headers:a,version:n})}var VBe=[\"name\",\"dist.tarball\",\"bin\",\"scripts\",\"os\",\"cpu\",\"libc\",\"dependencies\",\"dependenciesMeta\",\"optionalDependencies\",\"peerDependencies\",\"peerDependenciesMeta\",\"deprecated\"];function Xdt(t){return{\"dist-tags\":t[\"dist-tags\"],versions:Object.fromEntries(Object.entries(t.versions).map(([e,r])=>[e,Kd(r,VBe)])),time:t.time}}var $dt=Nn.makeHash(\"time\",...VBe).slice(0,6);function emt(t,e){let r=tmt(t),s=new URL(e);return J.join(r,$dt,s.hostname)}function tmt(t){return J.join(t.get(\"globalFolder\"),\"metadata/npm\")}async function Wm(t,{configuration:e,headers:r,ident:s,authType:a,allowOidc:n,registry:c,...f}){c=YD(e,{ident:s,registry:c}),s&&s.scope&&typeof a>\"u\"&&(a=1);let p=await lN(c,{authType:a,allowOidc:n,configuration:e,ident:s});p&&(r={...r,authorization:p});try{return await ln.get(t.charAt(0)===\"/\"?`${c}${t}`:t,{configuration:e,headers:r,...f})}catch(h){throw await ag(h,{registry:c,configuration:e,headers:r}),h}}async function rmt(t,e,{attemptedAs:r,configuration:s,headers:a,ident:n,authType:c=3,allowOidc:f,registry:p,otp:h,...E}){p=YD(s,{ident:n,registry:p});let C=await lN(p,{authType:c,allowOidc:f,configuration:s,ident:n});C&&(a={...a,authorization:C}),h&&(a={...a,...kw(h)});try{return await ln.post(p+t,e,{configuration:s,headers:a,...E})}catch(S){if(!cN(S)||h)throw await ag(S,{attemptedAs:r,registry:p,configuration:s,headers:a}),S;h=await QY(S,{configuration:s});let b={...a,...kw(h)};try{return await ln.post(`${p}${t}`,e,{configuration:s,headers:b,...E})}catch(I){throw await ag(I,{attemptedAs:r,registry:p,configuration:s,headers:a}),I}}}async function nmt(t,e,{attemptedAs:r,configuration:s,headers:a,ident:n,authType:c=3,allowOidc:f,registry:p,otp:h,...E}){p=YD(s,{ident:n,registry:p});let C=await lN(p,{authType:c,allowOidc:f,configuration:s,ident:n});C&&(a={...a,authorization:C}),h&&(a={...a,...kw(h)});try{return await ln.put(p+t,e,{configuration:s,headers:a,...E})}catch(S){if(!cN(S))throw await ag(S,{attemptedAs:r,registry:p,configuration:s,headers:a}),S;h=await QY(S,{configuration:s});let b={...a,...kw(h)};try{return await ln.put(`${p}${t}`,e,{configuration:s,headers:b,...E})}catch(I){throw await ag(I,{attemptedAs:r,registry:p,configuration:s,headers:a}),I}}}async function imt(t,{attemptedAs:e,configuration:r,headers:s,ident:a,authType:n=3,allowOidc:c,registry:f,otp:p,...h}){f=YD(r,{ident:a,registry:f});let E=await lN(f,{authType:n,allowOidc:c,configuration:r,ident:a});E&&(s={...s,authorization:E}),p&&(s={...s,...kw(p)});try{return await ln.del(f+t,{configuration:r,headers:s,...h})}catch(C){if(!cN(C)||p)throw await ag(C,{attemptedAs:e,registry:f,configuration:r,headers:s}),C;p=await QY(C,{configuration:r});let S={...s,...kw(p)};try{return await ln.del(`${f}${t}`,{configuration:r,headers:S,...h})}catch(b){throw await ag(b,{attemptedAs:e,registry:f,configuration:r,headers:s}),b}}}function YD(t,{ident:e,registry:r}){if(typeof r>\"u\"&&e)return bw(e.scope,{configuration:t});if(typeof r!=\"string\")throw new Error(\"Assertion failed: The registry should be a string\");return Jc(r)}async function lN(t,{authType:e=2,allowOidc:r=!1,configuration:s,ident:a}){let n=xY(t,{configuration:s,ident:a}),c=smt(n,e);if(!c)return null;let f=await s.reduceHook(p=>p.getNpmAuthenticationHeader,void 0,t,{configuration:s,ident:a});if(f)return f;if(n.get(\"npmAuthToken\"))return`Bearer ${n.get(\"npmAuthToken\")}`;if(n.get(\"npmAuthIdent\")){let p=n.get(\"npmAuthIdent\");return p.includes(\":\")?`Basic ${Buffer.from(p).toString(\"base64\")}`:`Basic ${p}`}if(r&&a){let p=await amt(t,{configuration:s,ident:a});if(p)return`Bearer ${p}`}if(c&&e!==1)throw new jt(33,\"No authentication configured for request\");return null}function smt(t,e){switch(e){case 2:return t.get(\"npmAlwaysAuth\");case 1:case 3:return!0;case 0:return!1;default:throw new Error(\"Unreachable\")}}async function omt(t,e,{configuration:r}){if(typeof e>\"u\"||typeof e.authorization>\"u\")return\"an anonymous user\";try{return(await ln.get(new URL(`${t}/-/whoami`).href,{configuration:r,headers:e,jsonResponse:!0})).username??\"an unknown user\"}catch{return\"an unknown user\"}}async function QY(t,{configuration:e}){let r=t.originalError?.response.headers[\"npm-notice\"];if(r&&(await Ot.start({configuration:e,stdout:process.stdout,includeFooter:!1},async a=>{if(a.reportInfo(0,r.replace(/(https?:\\/\\/\\S+)/g,he.pretty(e,\"$1\",he.Type.URL))),!process.env.YARN_IS_TEST_ENV){let n=r.match(/open (https?:\\/\\/\\S+)/i);if(n&&fs.openUrl){let{openNow:c}=await(0,kY.prompt)({type:\"confirm\",name:\"openNow\",message:\"Do you want to try to open this url now?\",required:!0,initial:!0,onCancel:()=>process.exit(130)});c&&(await fs.openUrl(n[1])||(a.reportSeparator(),a.reportWarning(0,\"We failed to automatically open the url; you'll have to open it yourself in your browser of choice.\")))}}}),process.stdout.write(`\n`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||\"\";let{otp:s}=await(0,kY.prompt)({type:\"password\",name:\"otp\",message:\"One-time password:\",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`\n`),s}function cN(t){if(t.originalError?.name!==\"HTTPError\")return!1;try{return(t.originalError?.response.headers[\"www-authenticate\"].split(/,\\s*/).map(r=>r.toLowerCase())).includes(\"otp\")}catch{return!1}}function kw(t){return{\"npm-otp\":t}}async function amt(t,{configuration:e,ident:r}){let s=null;if(process.env.GITLAB)s=process.env.NPM_ID_TOKEN||null;else if(process.env.GITHUB_ACTIONS){if(!(process.env.ACTIONS_ID_TOKEN_REQUEST_URL&&process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN))return null;let a=`npm:${new URL(t).host.replace(\"registry.yarnpkg.com\",\"registry.npmjs.org\").replace(\"yarn.npmjs.org\",\"registry.npmjs.org\")}`,n=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);n.searchParams.append(\"audience\",a),s=(await ln.get(n.href,{configuration:e,jsonResponse:!0,headers:{Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).value}if(!s)return null;try{return(await ln.post(`${t}/-/npm/v1/oidc/token/exchange/package${WD(r)}`,null,{configuration:e,jsonResponse:!0,headers:{Authorization:`Bearer ${s}`}})).token||null}catch{}return null}var VD=class{supports(e,r){if(!e.reference.startsWith(oi))return!1;let{selector:s,params:a}=G.parseRange(e.reference);return!(!JBe.default.valid(s)||a===null||typeof a.__archiveUrl!=\"string\")}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let{params:s}=G.parseRange(e.reference);if(s===null||typeof s.__archiveUrl!=\"string\")throw new Error(\"Assertion failed: The archiveUrl querystring parameter should have been available\");let a=await Wm(s.__archiveUrl,{customErrorMessage:qm,configuration:r.project.configuration,ident:e});return await ps.convertToZip(a,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ge();var JD=class{supportsDescriptor(e,r){return!(!e.range.startsWith(oi)||!G.tryParseDescriptor(e.range.slice(oi.length),!0))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error(\"Unreachable\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){let s=r.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(oi.length),!0));return r.resolver.getResolutionDependencies(s,r)}async getCandidates(e,r,s){let a=s.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(oi.length),!0));return await s.resolver.getCandidates(a,r,s)}async getSatisfying(e,r,s,a){let n=a.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(oi.length),!0));return a.resolver.getSatisfying(n,r,s,a)}resolve(e,r){throw new Error(\"Unreachable\")}};Ge();Ge();var KBe=ut(Ai());var oh=class t{supports(e,r){if(!e.reference.startsWith(oi))return!1;let s=new URL(e.reference);return!(!KBe.default.valid(s.pathname)||s.searchParams.has(\"__archiveUrl\"))}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s;try{s=await Wm(t.getLocatorUrl(e),{customErrorMessage:qm,configuration:r.project.configuration,ident:e})}catch{s=await Wm(t.getLocatorUrl(e).replace(/%2f/g,\"/\"),{customErrorMessage:qm,configuration:r.project.configuration,ident:e})}return await ps.convertToZip(s,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,r,{configuration:s}){let a=bw(e.scope,{configuration:s}),n=t.getLocatorUrl(e);return r=r.replace(/^https?:(\\/\\/(?:[^/]+\\.)?npmjs.org(?:$|\\/))/,\"https:$1\"),a=a.replace(/^https:\\/\\/registry\\.npmjs\\.org($|\\/)/,\"https://registry.yarnpkg.com$1\"),r=r.replace(/^https:\\/\\/registry\\.npmjs\\.org($|\\/)/,\"https://registry.yarnpkg.com$1\"),r===a+n||r===a+n.replace(/%2f/g,\"/\")}static getLocatorUrl(e){let r=Fr.clean(e.reference.slice(oi.length));if(r===null)throw new jt(10,\"The npm semver resolver got selected, but the version isn't semver\");return`${WD(e)}/-/${e.name}-${r}.tgz`}};Ge();Ge();Ge();var RY=ut(Ai());var uN=G.makeIdent(null,\"node-gyp\"),lmt=/\\b(node-gyp|prebuild-install)\\b/,KD=class{supportsDescriptor(e,r){return e.range.startsWith(oi)?!!Fr.validRange(e.range.slice(oi.length)):!1}supportsLocator(e,r){if(!e.reference.startsWith(oi))return!1;let{selector:s}=G.parseRange(e.reference);return!!RY.default.valid(s)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=Fr.validRange(e.range.slice(oi.length));if(a===null)throw new Error(`Expected a valid range, got ${e.range.slice(oi.length)}`);let n=await Qw(e,{cache:s.fetchOptions?.cache,project:s.project,version:RY.default.valid(a.raw)?a.raw:void 0}),c=je.mapAndFilter(Object.keys(n.versions),h=>{try{let E=new Fr.SemVer(h);if(a.test(E))return xw({configuration:s.project.configuration,ident:e,version:h,publishTimes:n.time})?E:je.mapAndFilter.skip}catch{}return je.mapAndFilter.skip}),f=c.filter(h=>!n.versions[h.raw].deprecated),p=f.length>0?f:c;return p.sort((h,E)=>-h.compare(E)),p.map(h=>{let E=G.makeLocator(e,`${oi}${h.raw}`),C=n.versions[h.raw].dist.tarball;return oh.isConventionalTarballUrl(E,C,{configuration:s.project.configuration})?E:G.bindLocator(E,{__archiveUrl:C})})}async getSatisfying(e,r,s,a){let n=Fr.validRange(e.range.slice(oi.length));if(n===null)throw new Error(`Expected a valid range, got ${e.range.slice(oi.length)}`);return{locators:je.mapAndFilter(s,p=>{if(p.identHash!==e.identHash)return je.mapAndFilter.skip;let h=G.tryParseRange(p.reference,{requireProtocol:oi});if(!h)return je.mapAndFilter.skip;let E=new Fr.SemVer(h.selector);return n.test(E)?{locator:p,version:E}:je.mapAndFilter.skip}).sort((p,h)=>-p.version.compare(h.version)).map(({locator:p})=>p),sorted:!0}}async resolve(e,r){let{selector:s}=G.parseRange(e.reference),a=Fr.clean(s);if(a===null)throw new jt(10,\"The npm semver resolver got selected, but the version isn't semver\");let n=await Qw(e,{cache:r.fetchOptions?.cache,project:r.project,version:a});if(!Object.hasOwn(n,\"versions\"))throw new jt(15,'Registry returned invalid data for - missing \"versions\" field');if(!Object.hasOwn(n.versions,a))throw new jt(16,`Registry failed to return reference \"${a}\"`);let c=new Ut;if(c.load(n.versions[a]),!c.dependencies.has(uN.identHash)&&!c.peerDependencies.has(uN.identHash)){for(let f of c.scripts.values())if(f.match(lmt)){c.dependencies.set(uN.identHash,G.makeDescriptor(uN,\"latest\"));break}}return{...e,version:a,languageName:\"node\",linkType:\"HARD\",conditions:c.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(c.dependencies),peerDependencies:c.peerDependencies,dependenciesMeta:c.dependenciesMeta,peerDependenciesMeta:c.peerDependenciesMeta,bin:c.bin}}};Ge();Ge();var fN=ut(Ai());var zD=class{supportsDescriptor(e,r){return!(!e.range.startsWith(oi)||!Mp.test(e.range.slice(oi.length)))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error(\"Unreachable\")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){let a=e.range.slice(oi.length),n=await Qw(e,{cache:s.fetchOptions?.cache,project:s.project});if(!Object.hasOwn(n,\"dist-tags\"))throw new jt(15,'Registry returned invalid data - missing \"dist-tags\" field');let c=n[\"dist-tags\"];if(!Object.hasOwn(c,a))throw new jt(16,`Registry failed to return tag \"${a}\"`);let f=Object.keys(n.versions),p=n.time,h=c[a];if(a===\"latest\"&&!xw({configuration:s.project.configuration,ident:e,version:h,publishTimes:p})){let S=h.includes(\"-\"),b=fN.default.rsort(f).find(I=>fN.default.lt(I,h)&&(S||!I.includes(\"-\"))&&xw({configuration:s.project.configuration,ident:e,version:I,publishTimes:p}));if(!b)throw new jt(16,`The version for tag \"${a}\" is quarantined, and no lower version is available`);h=b}let E=G.makeLocator(e,`${oi}${h}`),C=n.versions[h].dist.tarball;return oh.isConventionalTarballUrl(E,C,{configuration:s.project.configuration})?[E]:[G.bindLocator(E,{__archiveUrl:C})]}async getSatisfying(e,r,s,a){let n=[];for(let c of s){if(c.identHash!==e.identHash)continue;let f=G.tryParseRange(c.reference,{requireProtocol:oi});if(!(!f||!fN.default.valid(f.selector))){if(f.params?.__archiveUrl){let p=G.makeRange({protocol:oi,selector:f.selector,source:null,params:null}),[h]=await a.resolver.getCandidates(G.makeDescriptor(e,p),r,a);if(c.reference!==h.reference)continue}n.push(c)}}return{locators:n,sorted:!1}}async resolve(e,r){throw new Error(\"Unreachable\")}};var v1={};Vt(v1,{getGitHead:()=>$Dt,getPublishAccess:()=>Uxe,getReadmeContent:()=>_xe,makePublishBody:()=>XDt});Ge();Ge();Dt();var IV={};Vt(IV,{PackCommand:()=>jw,default:()=>HEt,packUtils:()=>yA});Ge();Ge();Ge();Dt();Yt();var yA={};Vt(yA,{genPackList:()=>FN,genPackStream:()=>EV,genPackageManifest:()=>DSe,hasPackScripts:()=>mV,prepareForPack:()=>yV});Ge();Dt();var dV=ut(Go()),vSe=ut(ISe()),SSe=Ie(\"zlib\"),kEt=[\"/package.json\",\"/readme\",\"/readme.*\",\"/license\",\"/license.*\",\"/licence\",\"/licence.*\",\"/changelog\",\"/changelog.*\"],QEt=[\"/package.tgz\",\".github\",\".git\",\".hg\",\"node_modules\",\".npmignore\",\".gitignore\",\".#*\",\".DS_Store\"];async function mV(t){return!!(In.hasWorkspaceScript(t,\"prepack\")||In.hasWorkspaceScript(t,\"postpack\"))}async function yV(t,{report:e},r){await In.maybeExecuteWorkspaceLifecycleScript(t,\"prepack\",{report:e});try{let s=J.join(t.cwd,Ut.fileName);await ce.existsPromise(s)&&await t.manifest.loadFile(s,{baseFs:ce}),await r()}finally{await In.maybeExecuteWorkspaceLifecycleScript(t,\"postpack\",{report:e})}}async function EV(t,e){typeof e>\"u\"&&(e=await FN(t));let r=new Set;for(let n of t.manifest.publishConfig?.executableFiles??new Set)r.add(J.normalize(n));for(let n of t.manifest.bin.values())r.add(J.normalize(n));let s=vSe.default.pack();process.nextTick(async()=>{for(let n of e){let c=J.normalize(n),f=J.resolve(t.cwd,c),p=J.join(\"package\",c),h=await ce.lstatPromise(f),E={name:p,mtime:new Date(fi.SAFE_TIME*1e3)},C=r.has(c)?493:420,S,b,I=new Promise((N,U)=>{S=N,b=U}),T=N=>{N?b(N):S()};if(h.isFile()){let N;c===\"package.json\"?N=Buffer.from(JSON.stringify(await DSe(t),null,2)):N=await ce.readFilePromise(f),s.entry({...E,mode:C,type:\"file\"},N,T)}else h.isSymbolicLink()?s.entry({...E,mode:C,type:\"symlink\",linkname:await ce.readlinkPromise(f)},T):T(new Error(`Unsupported file type ${h.mode} for ${fe.fromPortablePath(c)}`));await I}s.finalize()});let a=(0,SSe.createGzip)();return s.pipe(a),a}async function DSe(t){let e=JSON.parse(JSON.stringify(t.manifest.raw));return await t.project.configuration.triggerHook(r=>r.beforeWorkspacePacking,t,e),e}async function FN(t){let e=t.project,r=e.configuration,s={accept:[],reject:[]};for(let C of QEt)s.reject.push(C);for(let C of kEt)s.accept.push(C);s.reject.push(r.get(\"rcFilename\"));let a=C=>{if(C===null||!C.startsWith(`${t.cwd}/`))return;let S=J.relative(t.cwd,C),b=J.resolve(vt.root,S);s.reject.push(b)};a(J.resolve(e.cwd,Er.lockfile)),a(r.get(\"cacheFolder\")),a(r.get(\"globalFolder\")),a(r.get(\"installStatePath\")),a(r.get(\"virtualFolder\")),a(r.get(\"yarnPath\")),await r.triggerHook(C=>C.populateYarnPaths,e,C=>{a(C)});for(let C of e.workspaces){let S=J.relative(t.cwd,C.cwd);S!==\"\"&&!S.match(/^(\\.\\.)?\\//)&&s.reject.push(`/${S}`)}let n={accept:[],reject:[]},c=t.manifest.publishConfig?.main??t.manifest.main,f=t.manifest.publishConfig?.module??t.manifest.module,p=t.manifest.publishConfig?.browser??t.manifest.browser,h=t.manifest.publishConfig?.bin??t.manifest.bin;c!=null&&n.accept.push(J.resolve(vt.root,c)),f!=null&&n.accept.push(J.resolve(vt.root,f)),typeof p==\"string\"&&n.accept.push(J.resolve(vt.root,p));for(let C of h.values())n.accept.push(J.resolve(vt.root,C));if(p instanceof Map)for(let[C,S]of p.entries())n.accept.push(J.resolve(vt.root,C)),typeof S==\"string\"&&n.accept.push(J.resolve(vt.root,S));let E=t.manifest.files!==null;if(E){n.reject.push(\"/*\");for(let C of t.manifest.files)PSe(n.accept,C,{cwd:vt.root})}return await REt(t.cwd,{hasExplicitFileList:E,globalList:s,ignoreList:n})}async function REt(t,{hasExplicitFileList:e,globalList:r,ignoreList:s}){let a=[],n=new Hf(t),c=[[vt.root,[s]]];for(;c.length>0;){let[f,p]=c.pop(),h=await n.lstatPromise(f);if(!wSe(f,{globalList:r,ignoreLists:h.isDirectory()?null:p}))if(h.isDirectory()){let E=await n.readdirPromise(f),C=!1,S=!1;if(!e||f!==vt.root)for(let T of E)C=C||T===\".gitignore\",S=S||T===\".npmignore\";let b=S?await CSe(n,f,\".npmignore\"):C?await CSe(n,f,\".gitignore\"):null,I=b!==null?[b].concat(p):p;wSe(f,{globalList:r,ignoreLists:p})&&(I=[...p,{accept:[],reject:[\"**/*\"]}]);for(let T of E)c.push([J.resolve(f,T),I])}else(h.isFile()||h.isSymbolicLink())&&a.push(J.relative(vt.root,f))}return a.sort()}async function CSe(t,e,r){let s={accept:[],reject:[]},a=await t.readFilePromise(J.join(e,r),\"utf8\");for(let n of a.split(/\\n/g))PSe(s.reject,n,{cwd:e});return s}function TEt(t,{cwd:e}){let r=t[0]===\"!\";return r&&(t=t.slice(1)),t.match(/\\.{0,1}\\//)&&(t=J.resolve(e,t)),r&&(t=`!${t}`),t}function PSe(t,e,{cwd:r}){let s=e.trim();s===\"\"||s[0]===\"#\"||t.push(TEt(s,{cwd:r}))}function wSe(t,{globalList:e,ignoreLists:r}){let s=TN(t,e.accept);if(s!==0)return s===2;let a=TN(t,e.reject);if(a!==0)return a===1;if(r!==null)for(let n of r){let c=TN(t,n.accept);if(c!==0)return c===2;let f=TN(t,n.reject);if(f!==0)return f===1}return!1}function TN(t,e){let r=e,s=[];for(let a=0;a<e.length;++a)e[a][0]!==\"!\"?r!==e&&r.push(e[a]):(r===e&&(r=e.slice(0,a)),s.push(e[a].slice(1)));return BSe(t,s)?2:BSe(t,r)?1:0}function BSe(t,e){let r=e,s=[];for(let a=0;a<e.length;++a)e[a].includes(\"/\")?r!==e&&r.push(e[a]):(r===e&&(r=e.slice(0,a)),s.push(e[a]));return!!(dV.default.isMatch(t,r,{dot:!0,nocase:!0})||dV.default.isMatch(t,s,{dot:!0,basename:!0,nocase:!0}))}var jw=class extends ft{constructor(){super(...arguments);this.installIfNeeded=ge.Boolean(\"--install-if-needed\",!1,{description:\"Run a preliminary `yarn install` if the package contains build scripts\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"Print the file paths without actually generating the package archive\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.out=ge.String(\"-o,--out\",{description:\"Create the archive at the specified path\"});this.filename=ge.String(\"--filename\",{hidden:!0})}static{this.paths=[[\"pack\"]]}static{this.usage=ot.Usage({description:\"generate a tarball from the active workspace\",details:\"\\n      This command will turn the active workspace into a compressed archive suitable for publishing. The archive will by default be stored at the root of the workspace (`package.tgz`).\\n\\n      If the `-o,--out` is set the archive will be created at the specified path. The `%s` and `%v` variables can be used within the path and will be respectively replaced by the package name and version.\\n    \",examples:[[\"Create an archive from the active workspace\",\"yarn pack\"],[\"List the files that would be made part of the workspace's archive\",\"yarn pack --dry-run\"],[\"Name and output the archive in a dedicated folder\",\"yarn pack --out /artifacts/%s-%v.tgz\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await mV(a)&&(this.installIfNeeded?await s.install({cache:await Kr.find(r),report:new ki}):await s.restoreInstallState());let n=this.out??this.filename,c=typeof n<\"u\"?J.resolve(this.context.cwd,FEt(n,{workspace:a})):J.resolve(a.cwd,\"package.tgz\");return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async p=>{await yV(a,{report:p},async()=>{p.reportJson({base:fe.fromPortablePath(a.cwd)});let h=await FN(a);for(let E of h)p.reportInfo(null,fe.fromPortablePath(E)),p.reportJson({location:fe.fromPortablePath(E)});if(!this.dryRun){let E=await EV(a,h);await ce.mkdirPromise(J.dirname(c),{recursive:!0});let C=ce.createWriteStream(c);E.pipe(C),await new Promise(S=>{C.on(\"finish\",S)})}}),this.dryRun||(p.reportInfo(0,`Package archive generated in ${he.pretty(r,c,he.Type.PATH)}`),p.reportJson({output:fe.fromPortablePath(c)}))})).exitCode()}};function FEt(t,{workspace:e}){let r=t.replace(\"%s\",NEt(e)).replace(\"%v\",OEt(e));return fe.toPortablePath(r)}function NEt(t){return t.manifest.name!==null?G.slugifyIdent(t.manifest.name):\"package\"}function OEt(t){return t.manifest.version!==null?t.manifest.version:\"unknown\"}var LEt=[\"dependencies\",\"devDependencies\",\"peerDependencies\"],MEt=\"workspace:\",UEt=(t,e)=>{e.publishConfig&&(e.publishConfig.type&&(e.type=e.publishConfig.type),e.publishConfig.main&&(e.main=e.publishConfig.main),e.publishConfig.browser&&(e.browser=e.publishConfig.browser),e.publishConfig.module&&(e.module=e.publishConfig.module),e.publishConfig.exports&&(e.exports=e.publishConfig.exports),e.publishConfig.imports&&(e.imports=e.publishConfig.imports),e.publishConfig.bin&&(e.bin=e.publishConfig.bin));let r=t.project;for(let s of LEt)for(let a of t.manifest.getForScope(s).values()){let n=r.tryWorkspaceByDescriptor(a),c=G.parseRange(a.range);if(c.protocol===MEt)if(n===null){if(r.tryWorkspaceByIdent(a)===null)throw new jt(21,`${G.prettyDescriptor(r.configuration,a)}: No local workspace found for this range`)}else{let f;G.areDescriptorsEqual(a,n.anchoredDescriptor)||c.selector===\"*\"?f=n.manifest.version??\"0.0.0\":c.selector===\"~\"||c.selector===\"^\"?f=`${c.selector}${n.manifest.version??\"0.0.0\"}`:f=c.selector;let p=s===\"dependencies\"?G.makeDescriptor(a,\"unknown\"):null,h=p!==null&&t.manifest.ensureDependencyMeta(p).optional?\"optionalDependencies\":s;e[h][G.stringifyIdent(a)]=f}}},_Et={hooks:{beforeWorkspacePacking:UEt},commands:[jw]},HEt=_Et;var Mxe=ut(OSe());Ge();var Oxe=ut(Nxe()),{env:Bt}=process,GDt=\"application/vnd.in-toto+json\",qDt=\"https://in-toto.io/Statement/v0.1\",WDt=\"https://in-toto.io/Statement/v1\",YDt=\"https://slsa.dev/provenance/v0.2\",VDt=\"https://slsa.dev/provenance/v1\",JDt=\"https://github.com/actions/runner\",KDt=\"https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1\",zDt=\"https://github.com/npm/cli/gitlab\",ZDt=\"v0alpha1\",Lxe=async(t,e)=>{let r;if(Bt.GITHUB_ACTIONS){if(!Bt.ACTIONS_ID_TOKEN_REQUEST_URL)throw new jt(91,'Provenance generation in GitHub Actions requires \"write\" access to the \"id-token\" permission');let s=(Bt.GITHUB_WORKFLOW_REF||\"\").replace(`${Bt.GITHUB_REPOSITORY}/`,\"\"),a=s.indexOf(\"@\"),n=s.slice(0,a),c=s.slice(a+1);r={_type:WDt,subject:t,predicateType:VDt,predicate:{buildDefinition:{buildType:KDt,externalParameters:{workflow:{ref:c,repository:`${Bt.GITHUB_SERVER_URL}/${Bt.GITHUB_REPOSITORY}`,path:n}},internalParameters:{github:{event_name:Bt.GITHUB_EVENT_NAME,repository_id:Bt.GITHUB_REPOSITORY_ID,repository_owner_id:Bt.GITHUB_REPOSITORY_OWNER_ID}},resolvedDependencies:[{uri:`git+${Bt.GITHUB_SERVER_URL}/${Bt.GITHUB_REPOSITORY}@${Bt.GITHUB_REF}`,digest:{gitCommit:Bt.GITHUB_SHA}}]},runDetails:{builder:{id:`${JDt}/${Bt.RUNNER_ENVIRONMENT}`},metadata:{invocationId:`${Bt.GITHUB_SERVER_URL}/${Bt.GITHUB_REPOSITORY}/actions/runs/${Bt.GITHUB_RUN_ID}/attempts/${Bt.GITHUB_RUN_ATTEMPT}`}}}}}else if(Bt.GITLAB_CI){if(!Bt.SIGSTORE_ID_TOKEN)throw new jt(91,`Provenance generation in GitLab CI requires \"SIGSTORE_ID_TOKEN\" with \"sigstore\" audience to be present in \"id_tokens\". For more info see:\nhttps://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html`);r={_type:qDt,subject:t,predicateType:YDt,predicate:{buildType:`${zDt}/${ZDt}`,builder:{id:`${Bt.CI_PROJECT_URL}/-/runners/${Bt.CI_RUNNER_ID}`},invocation:{configSource:{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA},entryPoint:Bt.CI_JOB_NAME},parameters:{CI:Bt.CI,CI_API_GRAPHQL_URL:Bt.CI_API_GRAPHQL_URL,CI_API_V4_URL:Bt.CI_API_V4_URL,CI_BUILD_BEFORE_SHA:Bt.CI_BUILD_BEFORE_SHA,CI_BUILD_ID:Bt.CI_BUILD_ID,CI_BUILD_NAME:Bt.CI_BUILD_NAME,CI_BUILD_REF:Bt.CI_BUILD_REF,CI_BUILD_REF_NAME:Bt.CI_BUILD_REF_NAME,CI_BUILD_REF_SLUG:Bt.CI_BUILD_REF_SLUG,CI_BUILD_STAGE:Bt.CI_BUILD_STAGE,CI_COMMIT_BEFORE_SHA:Bt.CI_COMMIT_BEFORE_SHA,CI_COMMIT_BRANCH:Bt.CI_COMMIT_BRANCH,CI_COMMIT_REF_NAME:Bt.CI_COMMIT_REF_NAME,CI_COMMIT_REF_PROTECTED:Bt.CI_COMMIT_REF_PROTECTED,CI_COMMIT_REF_SLUG:Bt.CI_COMMIT_REF_SLUG,CI_COMMIT_SHA:Bt.CI_COMMIT_SHA,CI_COMMIT_SHORT_SHA:Bt.CI_COMMIT_SHORT_SHA,CI_COMMIT_TIMESTAMP:Bt.CI_COMMIT_TIMESTAMP,CI_COMMIT_TITLE:Bt.CI_COMMIT_TITLE,CI_CONFIG_PATH:Bt.CI_CONFIG_PATH,CI_DEFAULT_BRANCH:Bt.CI_DEFAULT_BRANCH,CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_SERVER:Bt.CI_DEPENDENCY_PROXY_SERVER,CI_DEPENDENCY_PROXY_USER:Bt.CI_DEPENDENCY_PROXY_USER,CI_JOB_ID:Bt.CI_JOB_ID,CI_JOB_NAME:Bt.CI_JOB_NAME,CI_JOB_NAME_SLUG:Bt.CI_JOB_NAME_SLUG,CI_JOB_STAGE:Bt.CI_JOB_STAGE,CI_JOB_STARTED_AT:Bt.CI_JOB_STARTED_AT,CI_JOB_URL:Bt.CI_JOB_URL,CI_NODE_TOTAL:Bt.CI_NODE_TOTAL,CI_PAGES_DOMAIN:Bt.CI_PAGES_DOMAIN,CI_PAGES_URL:Bt.CI_PAGES_URL,CI_PIPELINE_CREATED_AT:Bt.CI_PIPELINE_CREATED_AT,CI_PIPELINE_ID:Bt.CI_PIPELINE_ID,CI_PIPELINE_IID:Bt.CI_PIPELINE_IID,CI_PIPELINE_SOURCE:Bt.CI_PIPELINE_SOURCE,CI_PIPELINE_URL:Bt.CI_PIPELINE_URL,CI_PROJECT_CLASSIFICATION_LABEL:Bt.CI_PROJECT_CLASSIFICATION_LABEL,CI_PROJECT_DESCRIPTION:Bt.CI_PROJECT_DESCRIPTION,CI_PROJECT_ID:Bt.CI_PROJECT_ID,CI_PROJECT_NAME:Bt.CI_PROJECT_NAME,CI_PROJECT_NAMESPACE:Bt.CI_PROJECT_NAMESPACE,CI_PROJECT_NAMESPACE_ID:Bt.CI_PROJECT_NAMESPACE_ID,CI_PROJECT_PATH:Bt.CI_PROJECT_PATH,CI_PROJECT_PATH_SLUG:Bt.CI_PROJECT_PATH_SLUG,CI_PROJECT_REPOSITORY_LANGUAGES:Bt.CI_PROJECT_REPOSITORY_LANGUAGES,CI_PROJECT_ROOT_NAMESPACE:Bt.CI_PROJECT_ROOT_NAMESPACE,CI_PROJECT_TITLE:Bt.CI_PROJECT_TITLE,CI_PROJECT_URL:Bt.CI_PROJECT_URL,CI_PROJECT_VISIBILITY:Bt.CI_PROJECT_VISIBILITY,CI_REGISTRY:Bt.CI_REGISTRY,CI_REGISTRY_IMAGE:Bt.CI_REGISTRY_IMAGE,CI_REGISTRY_USER:Bt.CI_REGISTRY_USER,CI_RUNNER_DESCRIPTION:Bt.CI_RUNNER_DESCRIPTION,CI_RUNNER_ID:Bt.CI_RUNNER_ID,CI_RUNNER_TAGS:Bt.CI_RUNNER_TAGS,CI_SERVER_HOST:Bt.CI_SERVER_HOST,CI_SERVER_NAME:Bt.CI_SERVER_NAME,CI_SERVER_PORT:Bt.CI_SERVER_PORT,CI_SERVER_PROTOCOL:Bt.CI_SERVER_PROTOCOL,CI_SERVER_REVISION:Bt.CI_SERVER_REVISION,CI_SERVER_SHELL_SSH_HOST:Bt.CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT:Bt.CI_SERVER_SHELL_SSH_PORT,CI_SERVER_URL:Bt.CI_SERVER_URL,CI_SERVER_VERSION:Bt.CI_SERVER_VERSION,CI_SERVER_VERSION_MAJOR:Bt.CI_SERVER_VERSION_MAJOR,CI_SERVER_VERSION_MINOR:Bt.CI_SERVER_VERSION_MINOR,CI_SERVER_VERSION_PATCH:Bt.CI_SERVER_VERSION_PATCH,CI_TEMPLATE_REGISTRY_HOST:Bt.CI_TEMPLATE_REGISTRY_HOST,GITLAB_CI:Bt.GITLAB_CI,GITLAB_FEATURES:Bt.GITLAB_FEATURES,GITLAB_USER_ID:Bt.GITLAB_USER_ID,GITLAB_USER_LOGIN:Bt.GITLAB_USER_LOGIN,RUNNER_GENERATE_ARTIFACTS_METADATA:Bt.RUNNER_GENERATE_ARTIFACTS_METADATA},environment:{name:Bt.CI_RUNNER_DESCRIPTION,architecture:Bt.CI_RUNNER_EXECUTABLE_ARCH,server:Bt.CI_SERVER_URL,project:Bt.CI_PROJECT_PATH,job:{id:Bt.CI_JOB_ID},pipeline:{id:Bt.CI_PIPELINE_ID,ref:Bt.CI_CONFIG_PATH}}},metadata:{buildInvocationId:`${Bt.CI_JOB_URL}`,completeness:{parameters:!0,environment:!0,materials:!1},reproducible:!1},materials:[{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA}}]}}}else throw new jt(91,\"Provenance generation is only supported in GitHub Actions and GitLab CI\");return Oxe.attest(Buffer.from(JSON.stringify(r)),GDt,e)};async function XDt(t,e,{access:r,tag:s,registry:a,gitHead:n,provenance:c}){let f=t.manifest.name,p=t.manifest.version,h=G.stringifyIdent(f),E=Mxe.default.fromData(e,{algorithms:[\"sha1\",\"sha512\"]}),C=r??Uxe(t,f),S=await _xe(t),b=await yA.genPackageManifest(t),I=`${h}-${p}.tgz`,T=new URL(`${Jc(a)}/${h}/-/${I}`),N={[I]:{content_type:\"application/octet-stream\",data:e.toString(\"base64\"),length:e.length}};if(c){let U={name:`pkg:npm/${h.replace(/^@/,\"%40\")}@${p}`,digest:{sha512:E.sha512[0].hexDigest()}},W=await Lxe([U]),ee=JSON.stringify(W);N[`${h}-${p}.sigstore`]={content_type:W.mediaType,data:ee,length:ee.length}}return{_id:h,_attachments:N,name:h,access:C,\"dist-tags\":{[s]:p},versions:{[p]:{...b,_id:`${h}@${p}`,name:h,version:p,gitHead:n,dist:{shasum:E.sha1[0].hexDigest(),integrity:E.sha512[0].toString(),tarball:T.toString()}}},readme:S}}async function $Dt(t){try{let{stdout:e}=await qr.execvp(\"git\",[\"rev-parse\",\"--revs-only\",\"HEAD\"],{cwd:t});return e.trim()===\"\"?void 0:e.trim()}catch{return}}function Uxe(t,e){let r=t.project.configuration;return t.manifest.publishConfig&&typeof t.manifest.publishConfig.access==\"string\"?t.manifest.publishConfig.access:r.get(\"npmPublishAccess\")!==null?r.get(\"npmPublishAccess\"):e.scope?\"restricted\":\"public\"}async function _xe(t){let e=fe.toPortablePath(`${t.cwd}/README.md`),r=t.manifest.name,a=`# ${G.stringifyIdent(r)}\n`;try{a=await ce.readFilePromise(e,\"utf8\")}catch(n){if(n.code===\"ENOENT\")return a;throw n}return a}var DK={npmAlwaysAuth:{description:\"URL of the selected npm registry (note: npm enterprise isn't supported)\",type:\"BOOLEAN\",default:!1},npmAuthIdent:{description:\"Authentication identity for the npm registry (_auth in npm and yarn v1)\",type:\"SECRET\",default:null},npmAuthToken:{description:\"Authentication token for the npm registry (_authToken in npm and yarn v1)\",type:\"SECRET\",default:null}},Hxe={npmAuditRegistry:{description:\"Registry to query for audit reports\",type:\"STRING\",default:null},npmPublishRegistry:{description:\"Registry to push packages to\",type:\"STRING\",default:null},npmRegistryServer:{description:\"URL of the selected npm registry (note: npm enterprise isn't supported)\",type:\"STRING\",default:\"https://registry.yarnpkg.com\"}},ePt={npmMinimalAgeGate:{description:\"Minimum age of a package version according to the publish date on the npm registry in minutes to be considered for installation\",type:\"NUMBER\",default:0},npmPreapprovedPackages:{description:\"Array of package descriptors or package name glob patterns to exclude from the minimum release age check\",type:\"STRING\",isArray:!0,default:[]}},tPt={configuration:{...DK,...Hxe,...ePt,npmScopes:{description:\"Settings per package scope\",type:\"MAP\",valueDefinition:{description:\"\",type:\"SHAPE\",properties:{...DK,...Hxe}}},npmRegistries:{description:\"Settings per registry\",type:\"MAP\",normalizeKeys:Jc,valueDefinition:{description:\"\",type:\"SHAPE\",properties:{...DK}}}},fetchers:[VD,oh],resolvers:[JD,KD,zD]},rPt=tPt;var OK={};Vt(OK,{NpmAuditCommand:()=>D1,NpmInfoCommand:()=>P1,NpmLoginCommand:()=>b1,NpmLogoutCommand:()=>k1,NpmPublishCommand:()=>Q1,NpmTagAddCommand:()=>T1,NpmTagListCommand:()=>R1,NpmTagRemoveCommand:()=>F1,NpmWhoamiCommand:()=>N1,default:()=>cPt,npmAuditTypes:()=>KP,npmAuditUtils:()=>xL});Ge();Ge();Yt();var RK=ut(Go());Ul();var KP={};Vt(KP,{Environment:()=>VP,Severity:()=>JP});var VP=(s=>(s.All=\"all\",s.Production=\"production\",s.Development=\"development\",s))(VP||{}),JP=(n=>(n.Info=\"info\",n.Low=\"low\",n.Moderate=\"moderate\",n.High=\"high\",n.Critical=\"critical\",n))(JP||{});var xL={};Vt(xL,{allSeverities:()=>S1,getPackages:()=>QK,getReportTree:()=>xK,getSeverityInclusions:()=>bK,getTopLevelDependencies:()=>kK});Ge();var jxe=ut(Ai());var S1=[\"info\",\"low\",\"moderate\",\"high\",\"critical\"];function bK(t){if(typeof t>\"u\")return new Set(S1);let e=S1.indexOf(t),r=S1.slice(e);return new Set(r)}function xK(t){let e={},r={children:e};for(let[s,a]of je.sortMap(Object.entries(t),n=>n[0]))for(let n of je.sortMap(a,c=>`${c.id}`))e[`${s}/${n.id}`]={value:he.tuple(he.Type.IDENT,G.parseIdent(s)),children:{ID:typeof n.id<\"u\"&&{label:\"ID\",value:he.tuple(he.Type.ID,n.id)},Issue:{label:\"Issue\",value:he.tuple(he.Type.NO_HINT,n.title)},URL:typeof n.url<\"u\"&&{label:\"URL\",value:he.tuple(he.Type.URL,n.url)},Severity:{label:\"Severity\",value:he.tuple(he.Type.NO_HINT,n.severity)},\"Vulnerable Versions\":{label:\"Vulnerable Versions\",value:he.tuple(he.Type.RANGE,n.vulnerable_versions)},\"Tree Versions\":{label:\"Tree Versions\",children:[...n.versions].sort(jxe.default.compare).map(c=>({value:he.tuple(he.Type.REFERENCE,c)}))},Dependents:{label:\"Dependents\",children:je.sortMap(n.dependents,c=>G.stringifyLocator(c)).map(c=>({value:he.tuple(he.Type.LOCATOR,c)}))}}};return r}function kK(t,e,{all:r,environment:s}){let a=[],n=r?t.workspaces:[e],c=[\"all\",\"production\"].includes(s),f=[\"all\",\"development\"].includes(s);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!f:!c)||a.push({workspace:p,dependency:h});return a}function QK(t,e,{recursive:r}){let s=new Map,a=new Set,n=[],c=(f,p)=>{let h=t.storedResolutions.get(p.descriptorHash);if(typeof h>\"u\")throw new Error(\"Assertion failed: The resolution should have been registered\");if(!a.has(h))a.add(h);else return;let E=t.storedPackages.get(h);if(typeof E>\"u\")throw new Error(\"Assertion failed: The package should have been registered\");if(G.ensureDevirtualizedLocator(E).reference.startsWith(\"npm:\")&&E.version!==null){let S=G.stringifyIdent(E),b=je.getMapWithDefault(s,S);je.getArrayWithDefault(b,E.version).push(f)}if(r)for(let S of E.dependencies.values())n.push([E,S])};for(let{workspace:f,dependency:p}of e)n.push([f.anchoredLocator,p]);for(;n.length>0;){let[f,p]=n.shift();c(f,p)}return s}var D1=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Audit dependencies from all workspaces\"});this.recursive=ge.Boolean(\"-R,--recursive\",!1,{description:\"Audit transitive dependencies as well\"});this.environment=ge.String(\"--environment\",\"all\",{description:\"Which environments to cover\",validator:fo(VP)});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.noDeprecations=ge.Boolean(\"--no-deprecations\",!1,{description:\"Don't warn about deprecated packages\"});this.severity=ge.String(\"--severity\",\"info\",{description:\"Minimal severity requested for packages to be displayed\",validator:fo(JP)});this.excludes=ge.Array(\"--exclude\",[],{description:\"Array of glob patterns of packages to exclude from audit\"});this.ignores=ge.Array(\"--ignore\",[],{description:\"Array of glob patterns of advisory ID's to ignore in the audit report\"})}static{this.paths=[[\"npm\",\"audit\"]]}static{this.usage=ot.Usage({description:\"perform a vulnerability audit against the installed packages\",details:`\n      This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).\n\n      For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \\`-A,--all\\`. To extend this search to both direct and transitive dependencies, use \\`-R,--recursive\\`.\n\n      Applying the \\`--severity\\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${S1.map(r=>`\\`${r}\\``).join(\", \")}.\n\n      If the \\`--json\\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.\n\n      If certain packages produce false positives for a particular environment, the \\`--exclude\\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \\`npmAuditExcludePackages\\` option.\n\n      If particular advisories are needed to be ignored, the \\`--ignore\\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \\`npmAuditIgnoreAdvisories\\` option.\n\n      To understand the dependency tree requiring vulnerable packages, check the raw report with the \\`--json\\` flag or use \\`yarn why package\\` to get more information as to who depends on them.\n    `,examples:[[\"Checks for known security issues with the installed packages. The output is a list of known issues.\",\"yarn npm audit\"],[\"Audit dependencies in all workspaces\",\"yarn npm audit --all\"],[\"Limit auditing to `dependencies` (excludes `devDependencies`)\",\"yarn npm audit --environment production\"],[\"Show audit report as valid JSON\",\"yarn npm audit --json\"],[\"Audit all direct and transitive dependencies\",\"yarn npm audit --recursive\"],[\"Output moderate (or more severe) vulnerabilities\",\"yarn npm audit --severity moderate\"],[\"Exclude certain packages\",\"yarn npm audit --exclude package1 --exclude package2\"],[\"Ignore specific advisories\",\"yarn npm audit --ignore 1234567 --ignore 7654321\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=kK(s,a,{all:this.all,environment:this.environment}),c=QK(s,n,{recursive:this.recursive}),f=Array.from(new Set([...r.get(\"npmAuditExcludePackages\"),...this.excludes])),p=Object.create(null);for(let[N,U]of c)f.some(W=>RK.default.isMatch(N,W))||(p[N]=[...U.keys()]);let h=hi.getAuditRegistry({configuration:r}),E,C=await lA.start({configuration:r,stdout:this.context.stdout},async()=>{let N=an.post(\"/-/npm/v1/security/advisories/bulk\",p,{authType:an.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([ee,ie])=>{let ue=await an.getPackageMetadata(G.parseIdent(ee),{project:s});return je.mapAndFilter(ie,le=>{let{deprecated:me}=ue.versions[le];return me?[ee,le,me]:je.mapAndFilter.skip})})),W=await N;for(let[ee,ie,ue]of U.flat(1))Object.hasOwn(W,ee)&&W[ee].some(le=>Fr.satisfiesWithPrereleases(ie,le.vulnerable_versions))||(W[ee]??=[],W[ee].push({id:`${ee} (deprecation)`,title:(typeof ue==\"string\"?ue:\"\").trim()||\"This package has been deprecated.\",severity:\"moderate\",vulnerable_versions:ie}));E=W});if(C.hasErrors())return C.exitCode();let S=bK(this.severity),b=Array.from(new Set([...r.get(\"npmAuditIgnoreAdvisories\"),...this.ignores])),I=Object.create(null);for(let[N,U]of Object.entries(E)){let W=U.filter(ee=>!RK.default.isMatch(`${ee.id}`,b)&&S.has(ee.severity));W.length>0&&(I[N]=W.map(ee=>{let ie=c.get(N);if(typeof ie>\"u\")throw new Error(\"Assertion failed: Expected the registry to only return packages that were requested\");let ue=[...ie.keys()].filter(me=>Fr.satisfiesWithPrereleases(me,ee.vulnerable_versions)),le=new Map;for(let me of ue)for(let pe of ie.get(me))le.set(pe.locatorHash,pe);return{...ee,versions:ue,dependents:[...le.values()]}}))}let T=Object.keys(I).length>0;return T?(xs.emitTree(xK(I),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async N=>{N.reportInfo(1,\"No audit suggestions\")}),T?1:0)}};Ge();Ge();Dt();Yt();var TK=ut(Ai()),FK=Ie(\"util\"),P1=class extends ft{constructor(){super(...arguments);this.fields=ge.String(\"-f,--fields\",{description:\"A comma-separated list of manifest fields that should be displayed\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.packages=ge.Rest()}static{this.paths=[[\"npm\",\"info\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"show information about a package\",details:\"\\n      This command fetches information about a package from the npm registry and prints it in a tree format.\\n\\n      The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\\n\\n      Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\\n\\n      If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\\n\\n      By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\\n    \",examples:[[\"Show all available information about react (except the `dist`, `readme`, and `users` fields)\",\"yarn npm info react\"],[\"Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)\",\"yarn npm info react --json\"],[\"Show all available information about react@16.12.0\",\"yarn npm info react@16.12.0\"],[\"Show all available information about react@next\",\"yarn npm info react@next\"],[\"Show the description of react\",\"yarn npm info react --fields description\"],[\"Show all available versions of react\",\"yarn npm info react --fields versions\"],[\"Show the readme of react\",\"yarn npm info react --fields readme\"],[\"Show a few fields of react\",\"yarn npm info react --fields homepage,repository\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd),a=typeof this.fields<\"u\"?new Set([\"name\",...this.fields.split(/\\s*,\\s*/)]):null,n=[],c=!1,f=await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async p=>{for(let h of this.packages){let E;if(h===\".\"){let ie=s.topLevelWorkspace;if(!ie.manifest.name)throw new nt(`Missing ${he.pretty(r,\"name\",he.Type.CODE)} field in ${fe.fromPortablePath(J.join(ie.cwd,Er.manifest))}`);E=G.makeDescriptor(ie.manifest.name,\"unknown\")}else E=G.parseDescriptor(h);let C=an.getIdentUrl(E),S=NK(await an.get(C,{configuration:r,ident:E,jsonResponse:!0,customErrorMessage:an.customPackageError})),b=Object.keys(S.versions).sort(TK.default.compareLoose),T=S[\"dist-tags\"].latest||b[b.length-1],N=Fr.validRange(E.range);if(N){let ie=TK.default.maxSatisfying(b,N);ie!==null?T=ie:(p.reportWarning(0,`Unmet range ${G.prettyRange(r,E.range)}; falling back to the latest version`),c=!0)}else Object.hasOwn(S[\"dist-tags\"],E.range)?T=S[\"dist-tags\"][E.range]:E.range!==\"unknown\"&&(p.reportWarning(0,`Unknown tag ${G.prettyRange(r,E.range)}; falling back to the latest version`),c=!0);let U=S.versions[T],W={...S,...U,version:T,versions:b},ee;if(a!==null){ee={};for(let ie of a){let ue=W[ie];if(typeof ue<\"u\")ee[ie]=ue;else{p.reportWarning(1,`The ${he.pretty(r,ie,he.Type.CODE)} field doesn't exist inside ${G.prettyIdent(r,E)}'s information`),c=!0;continue}}}else this.json||(delete W.dist,delete W.readme,delete W.users),ee=W;p.reportJson(ee),this.json||n.push(ee)}});FK.inspect.styles.name=\"cyan\";for(let p of n)(p!==n[0]||c)&&this.context.stdout.write(`\n`),this.context.stdout.write(`${(0,FK.inspect)(p,{depth:1/0,colors:!0,compact:!1})}\n`);return f.exitCode()}};function NK(t){if(Array.isArray(t)){let e=[];for(let r of t)r=NK(r),r&&e.push(r);return e}else if(typeof t==\"object\"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith(\"_\"))continue;let s=NK(t[r]);s&&(e[r]=s)}return e}else return t||null}Ge();Ge();Yt();var Gxe=ut(Vv()),b1=class extends ft{constructor(){super(...arguments);this.scope=ge.String(\"-s,--scope\",{description:\"Login to the registry configured for a given scope\"});this.publish=ge.Boolean(\"--publish\",!1,{description:\"Login to the publish registry\"});this.alwaysAuth=ge.Boolean(\"--always-auth\",{description:\"Set the npmAlwaysAuth configuration\"})}static{this.paths=[[\"npm\",\"login\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"store new login info to access the npm registry\",details:\"\\n      This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\\n\\n      Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\\n\\n      Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\\n    \",examples:[[\"Login to the default registry\",\"yarn npm login\"],[\"Login to the registry linked to the @my-scope registry\",\"yarn npm login --scope my-scope\"],[\"Login to the publish registry for the current package\",\"yarn npm login --publish\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=await kL({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ot.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let c=await sPt({configuration:r,registry:s,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),f=await nPt(s,c,r);return await iPt(s,f,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,\"Successfully logged in\")})).exitCode()}};async function kL({scope:t,publish:e,configuration:r,cwd:s}){return t&&e?hi.getScopeRegistry(t,{configuration:r,type:hi.RegistryType.PUBLISH_REGISTRY}):t?hi.getScopeRegistry(t,{configuration:r}):e?hi.getPublishRegistry((await eC(r,s)).manifest,{configuration:r}):hi.getDefaultRegistry({configuration:r})}async function nPt(t,e,r){let s=`/-/user/org.couchdb.user:${encodeURIComponent(e.name)}`,a={_id:`org.couchdb.user:${e.name}`,name:e.name,password:e.password,type:\"user\",roles:[],date:new Date().toISOString()},n={attemptedAs:e.name,configuration:r,registry:t,jsonResponse:!0,authType:an.AuthType.NO_AUTH};try{return(await an.put(s,a,n)).token}catch(E){if(!(E.originalError?.name===\"HTTPError\"&&E.originalError?.response.statusCode===409))throw E}let c={...n,authType:an.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${e.name}:${e.password}`).toString(\"base64\")}`}},f=await an.get(s,c);for(let[E,C]of Object.entries(f))(!a[E]||E===\"roles\")&&(a[E]=C);let p=`${s}/-rev/${a._rev}`;return(await an.put(p,a,c)).token}async function iPt(t,e,{alwaysAuth:r,scope:s}){let a=c=>f=>{let p=je.isIndexableObject(f)?f:{},h=p[c],E=je.isIndexableObject(h)?h:{};return{...p,[c]:{...E,...r!==void 0?{npmAlwaysAuth:r}:{},npmAuthToken:e}}},n=s?{npmScopes:a(s)}:{npmRegistries:a(t)};return await ze.updateHomeConfiguration(n)}async function sPt({configuration:t,registry:e,report:r,stdin:s,stdout:a}){r.reportInfo(0,`Logging in to ${he.pretty(t,e,he.Type.URL)}`);let n=!1;if(e.match(/^https:\\/\\/npm\\.pkg\\.github\\.com(\\/|$)/)&&(r.reportInfo(0,\"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions.\"),n=!0),r.reportSeparator(),t.env.YARN_IS_TEST_ENV)return{name:t.env.YARN_INJECT_NPM_USER||\"\",password:t.env.YARN_INJECT_NPM_PASSWORD||\"\"};let c=await(0,Gxe.prompt)([{type:\"input\",name:\"name\",message:\"Username:\",required:!0,onCancel:()=>process.exit(130),stdin:s,stdout:a},{type:\"password\",name:\"password\",message:n?\"Token:\":\"Password:\",required:!0,onCancel:()=>process.exit(130),stdin:s,stdout:a}]);return r.reportSeparator(),c}Ge();Ge();Yt();var x1=new Set([\"npmAuthIdent\",\"npmAuthToken\"]),k1=class extends ft{constructor(){super(...arguments);this.scope=ge.String(\"-s,--scope\",{description:\"Logout of the registry configured for a given scope\"});this.publish=ge.Boolean(\"--publish\",!1,{description:\"Logout of the publish registry\"});this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Logout of all registries\"})}static{this.paths=[[\"npm\",\"logout\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"logout of the npm registry\",details:\"\\n      This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\\n\\n      Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\\n\\n      Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\\n\\n      Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\\n    \",examples:[[\"Logout of the default registry\",\"yarn npm logout\"],[\"Logout of the @my-scope scope\",\"yarn npm logout --scope my-scope\"],[\"Logout of the publish registry for the current package\",\"yarn npm logout --publish\"],[\"Logout of all registries\",\"yarn npm logout --all\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=async()=>{let n=await kL({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),c=await ze.find(this.context.cwd,this.context.plugins),f=G.makeIdent(this.scope??null,\"pkg\");return!hi.getAuthConfiguration(n,{configuration:c,ident:f}).get(\"npmAuthToken\")};return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{if(this.all&&(await aPt(),n.reportInfo(0,\"Successfully logged out from everything\")),this.scope){await qxe(\"npmScopes\",this.scope),await s()?n.reportInfo(0,`Successfully logged out from ${this.scope}`):n.reportWarning(0,\"Scope authentication settings removed, but some other ones settings still apply to it\");return}let c=await kL({configuration:r,cwd:this.context.cwd,publish:this.publish});await qxe(\"npmRegistries\",c),await s()?n.reportInfo(0,`Successfully logged out from ${c}`):n.reportWarning(0,\"Registry authentication settings removed, but some other ones settings still apply to it\")})).exitCode()}};function oPt(t,e){let r=t[e];if(!je.isIndexableObject(r))return!1;let s=new Set(Object.keys(r));if([...x1].every(n=>!s.has(n)))return!1;for(let n of x1)s.delete(n);if(s.size===0)return t[e]=void 0,!0;let a={...r};for(let n of x1)delete a[n];return t[e]=a,!0}async function aPt(){let t=e=>{let r=!1,s=je.isIndexableObject(e)?{...e}:{};s.npmAuthToken&&(delete s.npmAuthToken,r=!0);for(let a of Object.keys(s))oPt(s,a)&&(r=!0);if(Object.keys(s).length!==0)return r?s:e};return await ze.updateHomeConfiguration({npmRegistries:t,npmScopes:t})}async function qxe(t,e){return await ze.updateHomeConfiguration({[t]:r=>{let s=je.isIndexableObject(r)?r:{};if(!Object.hasOwn(s,e))return r;let a=s[e],n=je.isIndexableObject(a)?a:{},c=new Set(Object.keys(n));if([...x1].every(p=>!c.has(p)))return r;for(let p of x1)c.delete(p);if(c.size===0)return Object.keys(s).length===1?void 0:{...s,[e]:void 0};let f={};for(let p of x1)f[p]=void 0;return{...s,[e]:{...n,...f}}}})}Ge();Dt();Yt();var Q1=class extends ft{constructor(){super(...arguments);this.access=ge.String(\"--access\",{description:\"The access for the published package (public or restricted)\"});this.tag=ge.String(\"--tag\",\"latest\",{description:\"The tag on the registry that the package should be attached to\"});this.tolerateRepublish=ge.Boolean(\"--tolerate-republish\",!1,{description:\"Warn and exit when republishing an already existing version of a package\"});this.otp=ge.String(\"--otp\",{description:\"The OTP token to use with the command\"});this.provenance=ge.Boolean(\"--provenance\",!1,{description:\"Generate provenance for the package. Only available in GitHub Actions and GitLab CI. Can be set globally through the `npmPublishProvenance` setting or the `YARN_NPM_CONFIG_PROVENANCE` environment variable, or per-package through the `publishConfig.provenance` field in package.json.\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"Show what would be published without actually publishing\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Output the result in JSON format\"})}static{this.paths=[[\"npm\",\"publish\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"publish the active workspace to the npm registry\",details:'\\n      This command will pack the active workspace into a fresh archive and upload it to the npm registry.\\n\\n      The package will by default be attached to the `latest` tag on the registry, but this behavior can be overridden by using the `--tag` option.\\n\\n      Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka \"private packages\"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\\n    ',examples:[[\"Publish the active workspace\",\"yarn npm publish\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);if(a.manifest.private)throw new nt(\"Private workspaces cannot be published\");if(a.manifest.name===null||a.manifest.version===null)throw new nt(\"Workspaces must have valid names and versions to be published on an external registry\");await s.restoreInstallState();let n=a.manifest.name,c=a.manifest.version,f=hi.getPublishRegistry(a.manifest,{configuration:r});return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async h=>{if(this.tolerateRepublish)try{let E=await an.get(an.getIdentUrl(n),{configuration:r,registry:f,ident:n,jsonResponse:!0});if(!Object.hasOwn(E,\"versions\"))throw new jt(15,'Registry returned invalid data for - missing \"versions\" field');if(Object.hasOwn(E.versions,c)){let C=`Registry already knows about version ${c}; skipping.`;h.reportWarning(0,C),h.reportJson({name:n.name,version:c,registry:f,warning:C,skipped:!0});return}}catch(E){if(E.originalError?.response?.statusCode!==404)throw E}await In.maybeExecuteWorkspaceLifecycleScript(a,\"prepublish\",{report:h}),await yA.prepareForPack(a,{report:h},async()=>{let E=await yA.genPackList(a);for(let W of E)h.reportInfo(null,fe.fromPortablePath(W)),h.reportJson({file:fe.fromPortablePath(W)});let C=await yA.genPackStream(a,E),S=await je.bufferStream(C),b=await v1.getGitHead(a.cwd),I=!1,T=\"\";a.manifest.publishConfig&&\"provenance\"in a.manifest.publishConfig?(I=!!a.manifest.publishConfig.provenance,T=I?\"Generating provenance statement because `publishConfig.provenance` field is set.\":\"Skipping provenance statement because `publishConfig.provenance` field is set to false.\"):this.provenance?(I=!0,T=\"Generating provenance statement because `--provenance` flag is set.\"):r.get(\"npmPublishProvenance\")&&(I=!0,T=\"Generating provenance statement because `npmPublishProvenance` setting is set.\"),T&&(h.reportInfo(null,T),h.reportJson({type:\"provenance\",enabled:I,provenanceMessage:T}));let N=await v1.makePublishBody(a,S,{access:this.access,tag:this.tag,registry:f,gitHead:b,provenance:I});this.dryRun||await an.put(an.getIdentUrl(n),N,{configuration:r,registry:f,ident:n,otp:this.otp,jsonResponse:!0,allowOidc:!!(process.env.CI&&(process.env.GITHUB_ACTIONS||process.env.GITLAB))});let U=this.dryRun?`[DRY RUN] Package would be published to ${f} with tag ${this.tag}`:\"Package archive published\";h.reportInfo(0,U),h.reportJson({name:n.name,version:c,registry:f,tag:this.tag||\"latest\",files:E.map(W=>fe.fromPortablePath(W)),access:this.access||null,dryRun:this.dryRun,published:!this.dryRun,message:U,provenance:!!I})})})).exitCode()}};Ge();Yt();var Wxe=ut(Ai());Ge();Dt();Yt();var R1=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.package=ge.String({required:!1})}static{this.paths=[[\"npm\",\"tag\",\"list\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"list all dist-tags of a package\",details:`\n      This command will list all tags of a package from the npm registry.\n\n      If the package is not specified, Yarn will default to the current workspace.\n    `,examples:[[\"List all tags of package `my-pkg`\",\"yarn npm tag list my-pkg\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n;if(typeof this.package<\"u\")n=G.parseIdent(this.package);else{if(!a)throw new ar(s.cwd,this.context.cwd);if(!a.manifest.name)throw new nt(`Missing 'name' field in ${fe.fromPortablePath(J.join(a.cwd,Er.manifest))}`);n=a.manifest.name}let c=await zP(n,r),p={children:je.sortMap(Object.entries(c),([h])=>h).map(([h,E])=>({value:he.tuple(he.Type.RESOLUTION,{descriptor:G.makeDescriptor(n,h),locator:G.makeLocator(n,E)})}))};return xs.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function zP(t,e){let r=`/-/package${an.getIdentUrl(t)}/dist-tags`;return an.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:an.customPackageError})}var T1=class extends ft{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[[\"npm\",\"tag\",\"add\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"add a tag for a specific version of a package\",details:`\n      This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.\n    `,examples:[[\"Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`\",\"yarn npm tag add my-pkg@2.3.4-beta.4 beta\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=G.parseDescriptor(this.package,!0),c=n.range;if(!Wxe.default.valid(c))throw new nt(`The range ${he.pretty(r,n.range,he.Type.RANGE)} must be a valid semver version`);let f=hi.getPublishRegistry(a.manifest,{configuration:r}),p=he.pretty(r,n,he.Type.IDENT),h=he.pretty(r,c,he.Type.RANGE),E=he.pretty(r,this.tag,he.Type.CODE);return(await Ot.start({configuration:r,stdout:this.context.stdout},async S=>{let b=await zP(n,r);Object.hasOwn(b,this.tag)&&b[this.tag]===c&&S.reportWarning(0,`Tag ${E} is already set to version ${h}`);let I=`/-/package${an.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await an.put(I,c,{configuration:r,registry:f,ident:n,jsonRequest:!0,jsonResponse:!0}),S.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ge();Yt();var F1=class extends ft{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[[\"npm\",\"tag\",\"remove\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"remove a tag from a package\",details:`\n      This command will remove a tag from a package from the npm registry.\n    `,examples:[[\"Remove the `beta` tag from package `my-pkg`\",\"yarn npm tag remove my-pkg beta\"]]})}async execute(){if(this.tag===\"latest\")throw new nt(\"The 'latest' tag cannot be removed.\");let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=G.parseIdent(this.package),c=hi.getPublishRegistry(a.manifest,{configuration:r}),f=he.pretty(r,this.tag,he.Type.CODE),p=he.pretty(r,n,he.Type.IDENT),h=await zP(n,r);if(!Object.hasOwn(h,this.tag))throw new nt(`${f} is not a tag of package ${p}`);return(await Ot.start({configuration:r,stdout:this.context.stdout},async C=>{let S=`/-/package${an.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await an.del(S,{configuration:r,registry:c,ident:n,jsonResponse:!0}),C.reportInfo(0,`Tag ${f} removed from package ${p}`)})).exitCode()}};Ge();Ge();Yt();var N1=class extends ft{constructor(){super(...arguments);this.scope=ge.String(\"-s,--scope\",{description:\"Print username for the registry configured for a given scope\"});this.publish=ge.Boolean(\"--publish\",!1,{description:\"Print username for the publish registry\"})}static{this.paths=[[\"npm\",\"whoami\"]]}static{this.usage=ot.Usage({category:\"Npm-related commands\",description:\"display the name of the authenticated user\",details:\"\\n      Print the username associated with the current authentication settings to the standard output.\\n\\n      When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\\n\\n      When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\\n    \",examples:[[\"Print username for the default registry\",\"yarn npm whoami\"],[\"Print username for the registry on a given scope\",\"yarn npm whoami --scope company\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s;return this.scope&&this.publish?s=hi.getScopeRegistry(this.scope,{configuration:r,type:hi.RegistryType.PUBLISH_REGISTRY}):this.scope?s=hi.getScopeRegistry(this.scope,{configuration:r}):this.publish?s=hi.getPublishRegistry((await eC(r,this.context.cwd)).manifest,{configuration:r}):s=hi.getDefaultRegistry({configuration:r}),(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let c;try{c=await an.get(\"/-/whoami\",{configuration:r,registry:s,authType:an.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?G.makeIdent(this.scope,\"\"):void 0})}catch(f){if(f.response?.statusCode===401||f.response?.statusCode===403){n.reportError(41,\"Authentication failed - your credentials may have expired\");return}else throw f}n.reportInfo(0,c.username)})).exitCode()}};var lPt={configuration:{npmPublishAccess:{description:\"Default access of the published packages\",type:\"STRING\",default:null},npmPublishProvenance:{description:\"Whether to generate provenance for the published packages\",type:\"BOOLEAN\",default:!1},npmAuditExcludePackages:{description:\"Array of glob patterns of packages to exclude from npm audit\",type:\"STRING\",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:\"Array of glob patterns of advisory IDs to exclude from npm audit\",type:\"STRING\",default:[],isArray:!0}},commands:[D1,P1,b1,k1,Q1,T1,R1,F1,N1]},cPt=lPt;var GK={};Vt(GK,{PatchCommand:()=>H1,PatchCommitCommand:()=>_1,PatchFetcher:()=>tb,PatchResolver:()=>rb,default:()=>PPt,patchUtils:()=>gy});Ge();Ge();Dt();eA();var gy={};Vt(gy,{applyPatchFile:()=>RL,diffFolders:()=>HK,ensureUnpatchedDescriptor:()=>LK,ensureUnpatchedLocator:()=>FL,extractPackageToDisk:()=>_K,extractPatchFlags:()=>Xxe,isParentRequired:()=>UK,isPatchDescriptor:()=>TL,isPatchLocator:()=>Tg,loadPatchFiles:()=>eb,makeDescriptor:()=>NL,makeLocator:()=>MK,makePatchHash:()=>jK,parseDescriptor:()=>XP,parseLocator:()=>$P,parsePatchFile:()=>ZP,unpatchDescriptor:()=>vPt,unpatchLocator:()=>SPt});Ge();Dt();Ge();Dt();var uPt=/^@@ -(\\d+)(,(\\d+))? \\+(\\d+)(,(\\d+))? @@.*/;function O1(t){return J.relative(vt.root,J.resolve(vt.root,fe.toPortablePath(t)))}function fPt(t){let e=t.trim().match(uPt);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var APt=420,pPt=493;var Yxe=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),hPt=t=>({header:fPt(t),parts:[]}),gPt={\"@\":\"header\",\"-\":\"deletion\",\"+\":\"insertion\",\" \":\"context\",\"\\\\\":\"pragma\",undefined:\"context\"};function dPt(t){let e=[],r=Yxe(),s=\"parsing header\",a=null,n=null;function c(){a&&(n&&(a.parts.push(n),n=null),r.hunks.push(a),a=null)}function f(){c(),e.push(r),r=Yxe()}for(let p=0;p<t.length;p++){let h=t[p];if(s===\"parsing header\")if(h.startsWith(\"@@\"))s=\"parsing hunks\",r.hunks=[],p-=1;else if(h.startsWith(\"diff --git \")){r&&r.diffLineFromPath&&f();let E=h.match(/^diff --git a\\/(.*?) b\\/(.*?)\\s*$/);if(!E)throw new Error(`Bad diff line: ${h}`);r.diffLineFromPath=E[1],r.diffLineToPath=E[2]}else if(h.startsWith(\"old mode \"))r.oldMode=h.slice(9).trim();else if(h.startsWith(\"new mode \"))r.newMode=h.slice(9).trim();else if(h.startsWith(\"deleted file mode \"))r.deletedFileMode=h.slice(18).trim();else if(h.startsWith(\"new file mode \"))r.newFileMode=h.slice(14).trim();else if(h.startsWith(\"rename from \"))r.renameFrom=h.slice(12).trim();else if(h.startsWith(\"rename to \"))r.renameTo=h.slice(10).trim();else if(h.startsWith(\"index \")){let E=h.match(/(\\w+)\\.\\.(\\w+)/);if(!E)continue;r.beforeHash=E[1],r.afterHash=E[2]}else h.startsWith(\"semver exclusivity \")?r.semverExclusivity=h.slice(19).trim():h.startsWith(\"--- \")?r.fromPath=h.slice(6).trim():h.startsWith(\"+++ \")&&(r.toPath=h.slice(6).trim());else{let E=gPt[h[0]]||null;switch(E){case\"header\":c(),a=hPt(h);break;case null:s=\"parsing header\",f(),p-=1;break;case\"pragma\":{if(!h.startsWith(\"\\\\ No newline at end of file\"))throw new Error(`Unrecognized pragma in patch file: ${h}`);if(!n)throw new Error(\"Bad parser state: No newline at EOF pragma encountered without context\");n.noNewlineAtEndOfFile=!0}break;case\"context\":case\"deletion\":case\"insertion\":{if(!a)throw new Error(\"Bad parser state: Hunk lines encountered before hunk header\");n&&n.type!==E&&(a.parts.push(n),n=null),n||(n={type:E,lines:[],noNewlineAtEndOfFile:!1}),n.lines.push(h.slice(1))}break;default:je.assertNever(E);break}}}f();for(let{hunks:p}of e)if(p)for(let h of p)yPt(h);return e}function mPt(t){let e=[];for(let r of t){let{semverExclusivity:s,diffLineFromPath:a,diffLineToPath:n,oldMode:c,newMode:f,deletedFileMode:p,newFileMode:h,renameFrom:E,renameTo:C,beforeHash:S,afterHash:b,fromPath:I,toPath:T,hunks:N}=r,U=E?\"rename\":p?\"file deletion\":h?\"file creation\":N&&N.length>0?\"patch\":\"mode change\",W=null;switch(U){case\"rename\":{if(!E||!C)throw new Error(\"Bad parser state: rename from & to not given\");e.push({type:\"rename\",semverExclusivity:s,fromPath:O1(E),toPath:O1(C)}),W=C}break;case\"file deletion\":{let ee=a||I;if(!ee)throw new Error(\"Bad parse state: no path given for file deletion\");e.push({type:\"file deletion\",semverExclusivity:s,hunk:N&&N[0]||null,path:O1(ee),mode:QL(p),hash:S})}break;case\"file creation\":{let ee=n||T;if(!ee)throw new Error(\"Bad parse state: no path given for file creation\");e.push({type:\"file creation\",semverExclusivity:s,hunk:N&&N[0]||null,path:O1(ee),mode:QL(h),hash:b})}break;case\"patch\":case\"mode change\":W=T||n;break;default:je.assertNever(U);break}W&&c&&f&&c!==f&&e.push({type:\"mode change\",semverExclusivity:s,path:O1(W),oldMode:QL(c),newMode:QL(f)}),W&&N&&N.length&&e.push({type:\"patch\",semverExclusivity:s,path:O1(W),hunks:N,beforeHash:S,afterHash:b})}if(e.length===0)throw new Error(\"Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string\");return e}function QL(t){let e=parseInt(t,8)&511;if(e!==APt&&e!==pPt)throw new Error(`Unexpected file mode string: ${t}`);return e}function ZP(t){let e=t.split(/\\n/g);return e[e.length-1]===\"\"&&e.pop(),mPt(dPt(e))}function yPt(t){let e=0,r=0;for(let{type:s,lines:a}of t.parts)switch(s){case\"context\":r+=a.length,e+=a.length;break;case\"deletion\":e+=a.length;break;case\"insertion\":r+=a.length;break;default:je.assertNever(s);break}if(e!==t.header.original.length||r!==t.header.patched.length){let s=a=>a<0?a:`+${a}`;throw new Error(`hunk header integrity check failed (expected @@ ${s(t.header.original.length)} ${s(t.header.patched.length)} @@, got @@ ${s(e)} ${s(r)} @@)`)}}Ge();Dt();var L1=class extends Error{constructor(r,s){super(`Cannot apply hunk #${r+1}`);this.hunk=s}};async function M1(t,e,r){let s=await t.lstatPromise(e),a=await r();typeof a<\"u\"&&(e=a),await t.lutimesPromise(e,s.atime,s.mtime)}async function RL(t,{baseFs:e=new Yn,dryRun:r=!1,version:s=null}={}){for(let a of t)if(!(a.semverExclusivity!==null&&s!==null&&!Fr.satisfiesWithPrereleases(s,a.semverExclusivity)))switch(a.type){case\"file deletion\":if(r){if(!e.existsSync(a.path))throw new Error(`Trying to delete a file that doesn't exist: ${a.path}`)}else await M1(e,J.dirname(a.path),async()=>{await e.unlinkPromise(a.path)});break;case\"rename\":if(r){if(!e.existsSync(a.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${a.fromPath}`)}else await M1(e,J.dirname(a.fromPath),async()=>{await M1(e,J.dirname(a.toPath),async()=>{await M1(e,a.fromPath,async()=>(await e.movePromise(a.fromPath,a.toPath),a.toPath))})});break;case\"file creation\":if(r){if(e.existsSync(a.path))throw new Error(`Trying to create a file that already exists: ${a.path}`)}else{let n=a.hunk?a.hunk.parts[0].lines.join(`\n`)+(a.hunk.parts[0].noNewlineAtEndOfFile?\"\":`\n`):\"\";await e.mkdirpPromise(J.dirname(a.path),{chmod:493,utimes:[fi.SAFE_TIME,fi.SAFE_TIME]}),await e.writeFilePromise(a.path,n,{mode:a.mode}),await e.utimesPromise(a.path,fi.SAFE_TIME,fi.SAFE_TIME)}break;case\"patch\":await M1(e,a.path,async()=>{await CPt(a,{baseFs:e,dryRun:r})});break;case\"mode change\":{let c=(await e.statPromise(a.path)).mode;if(Vxe(a.newMode)!==Vxe(c))continue;await M1(e,a.path,async()=>{await e.chmodPromise(a.path,a.newMode)})}break;default:je.assertNever(a);break}}function Vxe(t){return(t&64)>0}function Jxe(t){return t.replace(/\\s+$/,\"\")}function IPt(t,e){return Jxe(t)===Jxe(e)}async function CPt({hunks:t,path:e},{baseFs:r,dryRun:s=!1}){let a=await r.statSync(e).mode,c=(await r.readFileSync(e,\"utf8\")).split(/\\n/),f=[],p=0,h=0;for(let C of t){let S=Math.max(h,C.header.patched.start+p),b=Math.max(0,S-h),I=Math.max(0,c.length-S-C.header.original.length),T=Math.max(b,I),N=0,U=0,W=null;for(;N<=T;){if(N<=b&&(U=S-N,W=Kxe(C,c,U),W!==null)){N=-N;break}if(N<=I&&(U=S+N,W=Kxe(C,c,U),W!==null))break;N+=1}if(W===null)throw new L1(t.indexOf(C),C);f.push(W),p+=N,h=U+C.header.original.length}if(s)return;let E=0;for(let C of f)for(let S of C)switch(S.type){case\"splice\":{let b=S.index+E;c.splice(b,S.numToDelete,...S.linesToInsert),E+=S.linesToInsert.length-S.numToDelete}break;case\"pop\":c.pop();break;case\"push\":c.push(S.line);break;default:je.assertNever(S);break}await r.writeFilePromise(e,c.join(`\n`),{mode:a})}function Kxe(t,e,r){let s=[];for(let a of t.parts)switch(a.type){case\"context\":case\"deletion\":{for(let n of a.lines){let c=e[r];if(c==null||!IPt(c,n))return null;r+=1}a.type===\"deletion\"&&(s.push({type:\"splice\",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&s.push({type:\"push\",line:\"\"}))}break;case\"insertion\":s.push({type:\"splice\",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&s.push({type:\"pop\"});break;default:je.assertNever(a.type);break}return s}var BPt=/^builtin<([^>]+)>$/;function U1(t,e){let{protocol:r,source:s,selector:a,params:n}=G.parseRange(t);if(r!==\"patch:\")throw new Error(\"Invalid patch range\");if(s===null)throw new Error(\"Patch locators must explicitly define their source\");let c=a?a.split(/&/).map(E=>fe.toPortablePath(E)):[],f=n&&typeof n.locator==\"string\"?G.parseLocator(n.locator):null,p=n&&typeof n.version==\"string\"?n.version:null,h=e(s);return{parentLocator:f,sourceItem:h,patchPaths:c,sourceVersion:p}}function TL(t){return t.range.startsWith(\"patch:\")}function Tg(t){return t.reference.startsWith(\"patch:\")}function XP(t){let{sourceItem:e,...r}=U1(t.range,G.parseDescriptor);return{...r,sourceDescriptor:e}}function $P(t){let{sourceItem:e,...r}=U1(t.reference,G.parseLocator);return{...r,sourceLocator:e}}function vPt(t){let{sourceItem:e}=U1(t.range,G.parseDescriptor);return e}function SPt(t){let{sourceItem:e}=U1(t.reference,G.parseLocator);return e}function LK(t){if(!TL(t))return t;let{sourceItem:e}=U1(t.range,G.parseDescriptor);return e}function FL(t){if(!Tg(t))return t;let{sourceItem:e}=U1(t.reference,G.parseLocator);return e}function zxe({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:s,patchHash:a},n){let c=t!==null?{locator:G.stringifyLocator(t)}:{},f=typeof s<\"u\"?{version:s}:{},p=typeof a<\"u\"?{hash:a}:{};return G.makeRange({protocol:\"patch:\",source:n(e),selector:r.join(\"&\"),params:{...f,...p,...c}})}function NL(t,{parentLocator:e,sourceDescriptor:r,patchPaths:s}){return G.makeDescriptor(t,zxe({parentLocator:e,sourceItem:r,patchPaths:s},G.stringifyDescriptor))}function MK(t,{parentLocator:e,sourcePackage:r,patchPaths:s,patchHash:a}){return G.makeLocator(t,zxe({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:s,patchHash:a},G.stringifyLocator))}function Zxe({onAbsolute:t,onRelative:e,onProject:r,onBuiltin:s},a){let n=a.lastIndexOf(\"!\");n!==-1&&(a=a.slice(n+1));let c=a.match(BPt);return c!==null?s(c[1]):a.startsWith(\"~/\")?r(a.slice(2)):J.isAbsolute(a)?t(a):e(a)}function Xxe(t){let e=t.lastIndexOf(\"!\");return{optional:(e!==-1?new Set(t.slice(0,e).split(/!/)):new Set).has(\"optional\")}}function UK(t){return Zxe({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},t)}async function eb(t,e,r){let s=t!==null?await r.fetcher.fetch(t,r):null,a=s&&s.localPath?{packageFs:new Sn(vt.root),prefixPath:J.relative(vt.root,s.localPath)}:s;s&&s!==a&&s.releaseFs&&s.releaseFs();let n=await je.releaseAfterUseAsync(async()=>await Promise.all(e.map(async c=>{let f=Xxe(c),p=await Zxe({onAbsolute:async h=>await ce.readFilePromise(h,\"utf8\"),onRelative:async h=>{if(a===null)throw new Error(\"Assertion failed: The parent locator should have been fetched\");return await a.packageFs.readFilePromise(J.join(a.prefixPath,h),\"utf8\")},onProject:async h=>await ce.readFilePromise(J.join(r.project.cwd,h),\"utf8\"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},c);return{...f,source:p}})));for(let c of n)typeof c.source==\"string\"&&(c.source=c.source.replace(/\\r\\n?/g,`\n`));return n}async function _K(t,{cache:e,project:r}){let s=r.storedPackages.get(t.locatorHash);if(typeof s>\"u\")throw new Error(\"Assertion failed: Expected the package to be registered\");let a=FL(t),n=r.storedChecksums,c=new ki,f=await ce.mktempPromise(),p=J.join(f,\"source\"),h=J.join(f,\"user\"),E=J.join(f,\".yarn-patch.json\"),C=r.configuration.makeFetcher(),S=[];try{let b,I;if(t.locatorHash===a.locatorHash){let T=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c});S.push(()=>T.releaseFs?.()),b=T,I=T}else b=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>b.releaseFs?.()),I=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>I.releaseFs?.());await Promise.all([ce.copyPromise(p,b.prefixPath,{baseFs:b.packageFs}),ce.copyPromise(h,I.prefixPath,{baseFs:I.packageFs}),ce.writeJsonPromise(E,{locator:G.stringifyLocator(t),version:s.version})])}finally{for(let b of S)b()}return ce.detachTemp(f),h}async function HK(t,e){let r=fe.fromPortablePath(t).replace(/\\\\/g,\"/\"),s=fe.fromPortablePath(e).replace(/\\\\/g,\"/\"),{stdout:a,stderr:n}=await qr.execvp(\"git\",[\"-c\",\"core.safecrlf=false\",\"diff\",\"--src-prefix=a/\",\"--dst-prefix=b/\",\"--ignore-cr-at-eol\",\"--full-index\",\"--no-index\",\"--no-renames\",\"--text\",r,s],{cwd:fe.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:\"1\",HOME:\"\",XDG_CONFIG_HOME:\"\",USERPROFILE:\"\"}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.\nThe following error was reported by 'git':\n${n}`);let c=r.startsWith(\"/\")?f=>f.slice(1):f=>f;return a.replace(new RegExp(`(a|b)(${je.escapeRegExp(`/${c(r)}/`)})`,\"g\"),\"$1/\").replace(new RegExp(`(a|b)${je.escapeRegExp(`/${c(s)}/`)}`,\"g\"),\"$1/\").replace(new RegExp(je.escapeRegExp(`${r}/`),\"g\"),\"\").replace(new RegExp(je.escapeRegExp(`${s}/`),\"g\"),\"\")}function jK(t,e){let r=[];for(let{source:s}of t){if(s===null)continue;let a=ZP(s);for(let n of a){let{semverExclusivity:c,...f}=n;c!==null&&e!==null&&!Fr.satisfiesWithPrereleases(e,c)||r.push(JSON.stringify(f))}}return Nn.makeHash(`${3}`,...r).slice(0,6)}Ge();function $xe(t,{configuration:e,report:r}){for(let s of t.parts)for(let a of s.lines)switch(s.type){case\"context\":r.reportInfo(null,`  ${he.pretty(e,a,\"grey\")}`);break;case\"deletion\":r.reportError(28,`- ${he.pretty(e,a,he.Type.REMOVED)}`);break;case\"insertion\":r.reportError(28,`+ ${he.pretty(e,a,he.Type.ADDED)}`);break;default:je.assertNever(s.type)}}var tb=class{supports(e,r){return!!Tg(e)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async patchPackage(e,r){let{parentLocator:s,sourceLocator:a,sourceVersion:n,patchPaths:c}=$P(e),f=await eb(s,c,r),p=await ce.mktempPromise(),h=J.join(p,\"current.zip\"),E=await r.fetcher.fetch(a,r),C=G.getIdentVendorPath(e),S=new As(h,{create:!0,level:r.project.configuration.get(\"compressionLevel\")});await je.releaseAfterUseAsync(async()=>{await S.copyPromise(C,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),S.saveAndClose();for(let{source:b,optional:I}of f){if(b===null)continue;let T=new As(h,{level:r.project.configuration.get(\"compressionLevel\")}),N=new Sn(J.resolve(vt.root,C),{baseFs:T});try{await RL(ZP(b),{baseFs:N,version:n})}catch(U){if(!(U instanceof L1))throw U;let W=r.project.configuration.get(\"enableInlineHunks\"),ee=!W&&!I?\" (set enableInlineHunks for details)\":\"\",ie=`${G.prettyLocator(r.project.configuration,e)}: ${U.message}${ee}`,ue=le=>{W&&$xe(U.hunk,{configuration:r.project.configuration,report:le})};if(T.discardAndClose(),I){r.report.reportWarningOnce(66,ie,{reportExtra:ue});continue}else throw new jt(66,ie,ue)}T.saveAndClose()}return new As(h,{level:r.project.configuration.get(\"compressionLevel\")})}};Ge();var rb=class{supportsDescriptor(e,r){return!!TL(e)}supportsLocator(e,r){return!!Tg(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){let{patchPaths:a}=XP(e);return a.every(n=>!UK(n))?e:G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:s}=XP(e);return{sourceDescriptor:r.project.configuration.normalizeDependency(s)}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error(\"Assertion failed: This resolver cannot be used unless a fetcher is configured\");let{parentLocator:a,patchPaths:n}=XP(e),c=await eb(a,n,s.fetchOptions),f=r.sourceDescriptor;if(typeof f>\"u\")throw new Error(\"Assertion failed: The dependency should have been resolved\");let p=jK(c,f.version);return[MK(e,{parentLocator:a,sourcePackage:f,patchPaths:n,patchHash:p})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let{sourceLocator:s}=$P(e);return{...await r.resolver.resolve(s,r),...e}}};Ge();Dt();Yt();var _1=class extends ft{constructor(){super(...arguments);this.save=ge.Boolean(\"-s,--save\",!1,{description:\"Add the patch to your resolution entries\"});this.patchFolder=ge.String()}static{this.paths=[[\"patch-commit\"]]}static{this.usage=ot.Usage({description:\"generate a patch out of a directory\",details:\"\\n      By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\\n\\n      With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\\n\\n      Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=J.resolve(this.context.cwd,fe.toPortablePath(this.patchFolder)),c=J.join(n,\"../source\"),f=J.join(n,\"../.yarn-patch.json\");if(!ce.existsSync(c))throw new nt(\"The argument folder didn't get created by 'yarn patch'\");let p=await HK(c,n),h=await ce.readJsonPromise(f),E=G.parseLocator(h.locator,!0);if(!s.storedPackages.has(E.locatorHash))throw new nt(\"No package found in the project for the given locator\");if(!this.save){this.context.stdout.write(p);return}let C=r.get(\"patchFolder\"),S=J.join(C,`${G.slugifyLocator(E)}.patch`);await ce.mkdirPromise(C,{recursive:!0}),await ce.writeFilePromise(S,p);let b=[],I=new Map;for(let T of s.storedPackages.values()){if(G.isVirtualLocator(T))continue;let N=T.dependencies.get(E.identHash);if(!N)continue;let U=G.ensureDevirtualizedDescriptor(N),W=LK(U),ee=s.storedResolutions.get(W.descriptorHash);if(!ee)throw new Error(\"Assertion failed: Expected the resolution to have been registered\");if(!s.storedPackages.get(ee))throw new Error(\"Assertion failed: Expected the package to have been registered\");let ue=s.tryWorkspaceByLocator(T);if(ue)b.push(ue);else{let le=s.originalPackages.get(T.locatorHash);if(!le)throw new Error(\"Assertion failed: Expected the original package to have been registered\");let me=le.dependencies.get(N.identHash);if(!me)throw new Error(\"Assertion failed: Expected the original dependency to have been registered\");I.set(me.descriptorHash,me)}}for(let T of b)for(let N of Ut.hardDependencies){let U=T.manifest[N].get(E.identHash);if(!U)continue;let W=NL(U,{parentLocator:null,sourceDescriptor:G.convertLocatorToDescriptor(E),patchPaths:[J.join(Er.home,J.relative(s.cwd,S))]});T.manifest[N].set(U.identHash,W)}for(let T of I.values()){let N=NL(T,{parentLocator:null,sourceDescriptor:G.convertLocatorToDescriptor(E),patchPaths:[J.join(Er.home,J.relative(s.cwd,S))]});s.topLevelWorkspace.manifest.resolutions.push({pattern:{descriptor:{fullName:G.stringifyIdent(N),description:T.range}},reference:N.range})}await s.persist()}};Ge();Dt();Yt();var H1=class extends ft{constructor(){super(...arguments);this.update=ge.Boolean(\"-u,--update\",!1,{description:\"Reapply local patches that already apply to this packages\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.package=ge.String()}static{this.paths=[[\"patch\"]]}static{this.usage=ot.Usage({description:\"prepare a package for patching\",details:\"\\n      This command will cause a package to be extracted in a temporary directory intended to be editable at will.\\n\\n      Once you're done with your changes, run `yarn patch-commit -s path` (with `path` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\\n\\n      Calling the command when you already have a patch won't import it by default (in other words, the default behavior is to reset existing patches). However, adding the `-u,--update` flag will import any current patch.\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=G.parseLocator(this.package);if(c.reference===\"unknown\"){let f=je.mapAndFilter([...s.storedPackages.values()],p=>p.identHash!==c.identHash?je.mapAndFilter.skip:G.isVirtualLocator(p)?je.mapAndFilter.skip:Tg(p)!==this.update?je.mapAndFilter.skip:p);if(f.length===0)throw new nt(\"No package found in the project for the given locator\");if(f.length>1)throw new nt(`Multiple candidate packages found; explicitly choose one of them (use \\`yarn why <package>\\` to get more information as to who depends on them):\n${f.map(p=>`\n- ${G.prettyLocator(r,p)}`).join(\"\")}`);c=f[0]}if(!s.storedPackages.has(c.locatorHash))throw new nt(\"No package found in the project for the given locator\");await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=FL(c),h=await _K(c,{cache:n,project:s});f.reportJson({locator:G.stringifyLocator(p),path:fe.fromPortablePath(h)});let E=this.update?\" along with its current modifications\":\"\";f.reportInfo(0,`Package ${G.prettyLocator(r,p)} got extracted with success${E}!`),f.reportInfo(0,`You can now edit the following folder: ${he.pretty(r,fe.fromPortablePath(h),\"magenta\")}`),f.reportInfo(0,`Once you are done run ${he.pretty(r,`yarn patch-commit -s ${process.platform===\"win32\"?'\"':\"\"}${fe.fromPortablePath(h)}${process.platform===\"win32\"?'\"':\"\"}`,\"cyan\")} and Yarn will store a patchfile based on your changes.`)})}};var DPt={configuration:{enableInlineHunks:{description:\"If true, the installs will print unmatched patch hunks\",type:\"BOOLEAN\",default:!1},patchFolder:{description:\"Folder where the patch files must be written\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/patches\"}},commands:[_1,H1],fetchers:[tb],resolvers:[rb]},PPt=DPt;var YK={};Vt(YK,{PnpmLinker:()=>nb,default:()=>TPt});Ge();Dt();Yt();var nb=class{getCustomDataKey(){return JSON.stringify({name:\"PnpmLinker\",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error(\"Assertion failed: Expected the pnpm linker to be enabled\");let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(e.locatorHash);if(typeof n>\"u\")throw new nt(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=e.match(/(^.*\\/node_modules\\/(@[^/]*\\/)?[^/]+)(\\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let c=e,f=e;do{f=c,c=J.dirname(f);let p=a.locatorByPath.get(f);if(p)return p}while(c!==f);return null}makeInstaller(e){return new qK(e)}isEnabled(e){return e.project.configuration.get(\"nodeLinker\")===\"pnpm\"}},qK=class{constructor(e){this.opts=e;this.asyncActions=new je.AsyncActions(10);this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.indexFolderPromise=$b(ce,{indexPath:J.join(e.project.configuration.get(\"globalFolder\"),\"index\")})}attachCustomData(e){}async installPackage(e,r,s){switch(e.linkType){case\"SOFT\":return this.installPackageSoft(e,r,s);case\"HARD\":return this.installPackageHard(e,r,s)}throw new Error(\"Assertion failed: Unsupported package link type\")}async installPackageSoft(e,r,s){let a=J.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(e)?J.join(a,Er.nodeModules):null;return this.customData.pathsByLocator.set(e.locatorHash,{packageLocation:a,dependenciesLocation:n}),{packageLocation:a,buildRequest:null}}async installPackageHard(e,r,s){let a=xPt(e,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,G.stringifyLocator(e)),this.customData.pathsByLocator.set(e.locatorHash,a),s.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await ce.mkdirPromise(n,{recursive:!0}),await ce.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:\"HardlinkFromIndex\",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let f=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e,p={manifest:await Ut.tryFind(r.prefixPath,{baseFs:r.packageFs})??new Ut,misc:{hasBindingGyp:gA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(f,e.version),E=gA.extractBuildRequest(e,p,h,{configuration:this.opts.project.configuration});return{packageLocation:n,buildRequest:E}}async attachInternalDependencies(e,r){if(this.opts.project.configuration.get(\"nodeLinker\")!==\"pnpm\"||!eke(e,{project:this.opts.project}))return;let s=this.customData.pathsByLocator.get(e.locatorHash);if(typeof s>\"u\")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(e)})`);let{dependenciesLocation:a}=s;a&&this.asyncActions.reduce(e.locatorHash,async n=>{await ce.mkdirPromise(a,{recursive:!0});let c=await kPt(a),f=new Map(c),p=[n],h=(C,S)=>{let b=S;eke(S,{project:this.opts.project})||(this.opts.report.reportWarningOnce(0,\"The pnpm linker doesn't support providing different versions to workspaces' peer dependencies\"),b=G.devirtualizeLocator(S));let I=this.customData.pathsByLocator.get(b.locatorHash);if(typeof I>\"u\")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(S)})`);let T=G.stringifyIdent(C),N=J.join(a,T),U=J.relative(J.dirname(N),I.packageLocation),W=f.get(T);f.delete(T),p.push(Promise.resolve().then(async()=>{if(W){if(W.isSymbolicLink()&&await ce.readlinkPromise(N)===U)return;await ce.removePromise(N)}await ce.mkdirpPromise(J.dirname(N)),process.platform==\"win32\"&&this.opts.project.configuration.get(\"winLinkType\")===\"junctions\"?await ce.symlinkPromise(I.packageLocation,N,\"junction\"):await ce.symlinkPromise(U,N)}))},E=!1;for(let[C,S]of r)C.identHash===e.identHash&&(E=!0),h(C,S);!E&&!this.opts.project.tryWorkspaceByLocator(e)&&h(G.convertLocatorToDescriptor(e),e),p.push(QPt(a,f)),await Promise.all(p)})}async attachExternalDependents(e,r){throw new Error(\"External dependencies haven't been implemented for the pnpm linker\")}async finalizeInstall(){let e=tke(this.opts.project);if(this.opts.project.configuration.get(\"nodeLinker\")!==\"pnpm\")await ce.removePromise(e);else{let r;try{r=new Set(await ce.readdirPromise(e))}catch{r=new Set}for(let{dependenciesLocation:s}of this.customData.pathsByLocator.values()){if(!s)continue;let a=J.contains(e,s);if(a===null)continue;let[n]=a.split(J.sep);r.delete(n)}await Promise.all([...r].map(async s=>{await ce.removePromise(J.join(e,s))}))}return await this.asyncActions.wait(),await WK(e),this.opts.project.configuration.get(\"nodeLinker\")!==\"node-modules\"&&await WK(bPt(this.opts.project)),{customData:this.customData}}};function bPt(t){return J.join(t.cwd,Er.nodeModules)}function tke(t){return t.configuration.get(\"pnpmStoreFolder\")}function xPt(t,{project:e}){let r=G.slugifyLocator(t),s=tke(e),a=J.join(s,r,\"package\"),n=J.join(s,r,Er.nodeModules);return{packageLocation:a,dependenciesLocation:n}}function eke(t,{project:e}){return!G.isVirtualLocator(t)||!e.tryWorkspaceByLocator(t)}async function kPt(t){let e=new Map,r=[];try{r=await ce.readdirPromise(t,{withFileTypes:!0})}catch(s){if(s.code!==\"ENOENT\")throw s}try{for(let s of r)if(!s.name.startsWith(\".\"))if(s.name.startsWith(\"@\")){let a=await ce.readdirPromise(J.join(t,s.name),{withFileTypes:!0});if(a.length===0)e.set(s.name,s);else for(let n of a)e.set(`${s.name}/${n.name}`,n)}else e.set(s.name,s)}catch(s){if(s.code!==\"ENOENT\")throw s}return e}async function QPt(t,e){let r=[],s=new Set;for(let a of e.keys()){r.push(ce.removePromise(J.join(t,a)));let n=G.tryParseIdent(a)?.scope;n&&s.add(`@${n}`)}return Promise.all(r).then(()=>Promise.all([...s].map(a=>WK(J.join(t,a)))))}async function WK(t){try{await ce.rmdirPromise(t)}catch(e){if(e.code!==\"ENOENT\"&&e.code!==\"ENOTEMPTY\"&&e.code!==\"EBUSY\")throw e}}var RPt={configuration:{pnpmStoreFolder:{description:\"By default, the store is stored in the 'node_modules/.store' of the project. Sometimes in CI scenario's it is convenient to store this in a different location so it can be cached and reused.\",type:\"ABSOLUTE_PATH\",default:\"./node_modules/.store\"}},linkers:[nb]},TPt=RPt;var $K={};Vt($K,{StageCommand:()=>j1,default:()=>qPt,stageUtils:()=>LL});Ge();Dt();Yt();Ge();Dt();var LL={};Vt(LL,{ActionType:()=>VK,checkConsensus:()=>OL,expandDirectory:()=>zK,findConsensus:()=>ZK,findVcsRoot:()=>JK,genCommitMessage:()=>XK,getCommitPrefix:()=>rke,isYarnFile:()=>KK});Dt();var VK=(n=>(n[n.CREATE=0]=\"CREATE\",n[n.DELETE=1]=\"DELETE\",n[n.ADD=2]=\"ADD\",n[n.REMOVE=3]=\"REMOVE\",n[n.MODIFY=4]=\"MODIFY\",n))(VK||{});async function JK(t,{marker:e}){do if(!ce.existsSync(J.join(t,e)))t=J.dirname(t);else return t;while(t!==\"/\");return null}function KK(t,{roots:e,names:r}){if(r.has(J.basename(t)))return!0;do if(!e.has(t))t=J.dirname(t);else return!0;while(t!==\"/\");return!1}function zK(t){let e=[],r=[t];for(;r.length>0;){let s=r.pop(),a=ce.readdirSync(s);for(let n of a){let c=J.resolve(s,n);ce.lstatSync(c).isDirectory()?r.push(c):e.push(c)}}return e}function OL(t,e){let r=0,s=0;for(let a of t)a!==\"wip\"&&(e.test(a)?r+=1:s+=1);return r>=s}function ZK(t){let e=OL(t,/^(\\w\\(\\w+\\):\\s*)?\\w+s/),r=OL(t,/^(\\w\\(\\w+\\):\\s*)?[A-Z]/),s=OL(t,/^\\w\\(\\w+\\):/);return{useThirdPerson:e,useUpperCase:r,useComponent:s}}function rke(t){return t.useComponent?\"chore(yarn): \":\"\"}var FPt=new Map([[0,\"create\"],[1,\"delete\"],[2,\"add\"],[3,\"remove\"],[4,\"update\"]]);function XK(t,e){let r=rke(t),s=[],a=e.slice().sort((n,c)=>n[0]-c[0]);for(;a.length>0;){let[n,c]=a.shift(),f=FPt.get(n);t.useUpperCase&&s.length===0&&(f=`${f[0].toUpperCase()}${f.slice(1)}`),t.useThirdPerson&&(f+=\"s\");let p=[c];for(;a.length>0&&a[0][0]===n;){let[,E]=a.shift();p.push(E)}p.sort();let h=p.shift();p.length===1?h+=\" (and one other)\":p.length>1&&(h+=` (and ${p.length} others)`),s.push(`${f} ${h}`)}return`${r}${s.join(\", \")}`}var NPt=\"Commit generated via `yarn stage`\",OPt=11;async function nke(t){let{code:e,stdout:r}=await qr.execvp(\"git\",[\"log\",\"-1\",\"--pretty=format:%H\"],{cwd:t});return e===0?r.trim():null}async function LPt(t,e){let r=[],s=e.filter(h=>J.basename(h.path)===\"package.json\");for(let{action:h,path:E}of s){let C=J.relative(t,E);if(h===4){let S=await nke(t),{stdout:b}=await qr.execvp(\"git\",[\"show\",`${S}:${C}`],{cwd:t,strict:!0}),I=await Ut.fromText(b),T=await Ut.fromFile(E),N=new Map([...T.dependencies,...T.devDependencies]),U=new Map([...I.dependencies,...I.devDependencies]);for(let[W,ee]of U){let ie=G.stringifyIdent(ee),ue=N.get(W);ue?ue.range!==ee.range&&r.push([4,`${ie} to ${ue.range}`]):r.push([3,ie])}for(let[W,ee]of N)U.has(W)||r.push([2,G.stringifyIdent(ee)])}else if(h===0){let S=await Ut.fromFile(E);S.name?r.push([0,G.stringifyIdent(S.name)]):r.push([0,\"a package\"])}else if(h===1){let S=await nke(t),{stdout:b}=await qr.execvp(\"git\",[\"show\",`${S}:${C}`],{cwd:t,strict:!0}),I=await Ut.fromText(b);I.name?r.push([1,G.stringifyIdent(I.name)]):r.push([1,\"a package\"])}else throw new Error(\"Assertion failed: Unsupported action type\")}let{code:a,stdout:n}=await qr.execvp(\"git\",[\"log\",`-${OPt}`,\"--pretty=format:%s\"],{cwd:t}),c=a===0?n.split(/\\n/g).filter(h=>h!==\"\"):[],f=ZK(c);return XK(f,r)}var MPt={0:[\" A \",\"?? \"],4:[\" M \"],1:[\" D \"]},UPt={0:[\"A  \"],4:[\"M  \"],1:[\"D  \"]},ike={async findRoot(t){return await JK(t,{marker:\".git\"})},async filterChanges(t,e,r,s){let{stdout:a}=await qr.execvp(\"git\",[\"status\",\"-s\"],{cwd:t,strict:!0}),n=a.toString().split(/\\n/g),c=s?.staged?UPt:MPt;return[].concat(...n.map(p=>{if(p===\"\")return[];let h=p.slice(0,3),E=J.resolve(t,p.slice(3));if(!s?.staged&&h===\"?? \"&&p.endsWith(\"/\"))return zK(E).map(C=>({action:0,path:C}));{let S=[0,4,1].find(b=>c[b].includes(h));return S!==void 0?[{action:S,path:E}]:[]}})).filter(p=>KK(p.path,{roots:e,names:r}))},async genCommitMessage(t,e){return await LPt(t,e)},async makeStage(t,e){let r=e.map(s=>fe.fromPortablePath(s.path));await qr.execvp(\"git\",[\"add\",\"--\",...r],{cwd:t,strict:!0})},async makeCommit(t,e,r){let s=e.map(a=>fe.fromPortablePath(a.path));await qr.execvp(\"git\",[\"add\",\"-N\",\"--\",...s],{cwd:t,strict:!0}),await qr.execvp(\"git\",[\"commit\",\"-m\",`${r}\n\n${NPt}\n`,\"--\",...s],{cwd:t,strict:!0})},async makeReset(t,e){let r=e.map(s=>fe.fromPortablePath(s.path));await qr.execvp(\"git\",[\"reset\",\"HEAD\",\"--\",...r],{cwd:t,strict:!0})}};var _Pt=[ike],j1=class extends ft{constructor(){super(...arguments);this.commit=ge.Boolean(\"-c,--commit\",!1,{description:\"Commit the staged files\"});this.reset=ge.Boolean(\"-r,--reset\",!1,{description:\"Remove all files from the staging area\"});this.dryRun=ge.Boolean(\"-n,--dry-run\",!1,{description:\"Print the commit message and the list of modified files without staging / committing\"});this.update=ge.Boolean(\"-u,--update\",!1,{hidden:!0})}static{this.paths=[[\"stage\"]]}static{this.usage=ot.Usage({description:\"add all yarn files to your vcs\",details:\"\\n      This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\\n\\n      Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\\n\\n      Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\\n    \",examples:[[\"Adds all modified project files to the staging area\",\"yarn stage\"],[\"Creates a new commit containing all modified project files\",\"yarn stage --commit\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd),{driver:a,root:n}=await HPt(s.cwd),c=[r.get(\"cacheFolder\"),r.get(\"globalFolder\"),r.get(\"virtualFolder\"),r.get(\"yarnPath\")];await r.triggerHook(C=>C.populateYarnPaths,s,C=>{c.push(C)});let f=new Set;for(let C of c)for(let S of jPt(n,C))f.add(S);let p=new Set([r.get(\"rcFilename\"),Er.lockfile,Er.manifest]),h=await a.filterChanges(n,f,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E}\n`);else for(let C of h)this.context.stdout.write(`${fe.fromPortablePath(C.path)}\n`);else if(this.reset){let C=await a.filterChanges(n,f,p,{staged:!0});C.length===0?this.context.stdout.write(\"No staged changes found!\"):await a.makeReset(n,C)}else h.length===0?this.context.stdout.write(\"No changes found!\"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function HPt(t){let e=null,r=null;for(let s of _Pt)if((r=await s.findRoot(t))!==null){e=s;break}if(e===null||r===null)throw new nt(\"No stage driver has been found for your current project\");return{driver:e,root:r}}function jPt(t,e){let r=[];if(e===null)return r;for(;;){(e===t||e.startsWith(`${t}/`))&&r.push(e);let s;try{s=ce.statSync(e)}catch{break}if(s.isSymbolicLink())e=J.resolve(J.dirname(e),ce.readlinkSync(e));else break}return r}var GPt={commands:[j1]},qPt=GPt;var ez={};Vt(ez,{default:()=>XPt});Ge();Ge();Dt();var ake=ut(Ai());Ge();var ske=ut(l9()),WPt=\"e8e1bd300d860104bb8c58453ffa1eb4\",YPt=\"OFCNCOG2CU\",oke=async(t,e)=>{let r=G.stringifyIdent(t),a=VPt(e).initIndex(\"npm-search\");try{return(await a.getObject(r,{attributesToRetrieve:[\"types\"]})).types?.ts===\"definitely-typed\"}catch{return!1}},VPt=t=>(0,ske.default)(YPt,WPt,{requester:{async send(r){try{let s=await ln.request(r.url,r.data||null,{configuration:t,headers:r.headers});return{content:s.body,isTimedOut:!1,status:s.statusCode}}catch(s){return{content:s.response.body,isTimedOut:!1,status:s.response.statusCode}}}}});var lke=t=>t.scope?`${t.scope}__${t.name}`:`${t.name}`,JPt=async(t,e,r,s)=>{if(r.scope===\"types\")return;let{project:a}=t,{configuration:n}=a;if(!(n.get(\"tsEnableAutoTypes\")??(ce.existsSync(J.join(t.cwd,\"tsconfig.json\"))||ce.existsSync(J.join(a.cwd,\"tsconfig.json\")))))return;let f=n.makeResolver(),p={project:a,resolver:f,report:new ki};if(!await oke(r,n))return;let E=lke(r),C=G.parseRange(r.range).selector;if(!Fr.validRange(C)){let N=n.normalizeDependency(r),U=await f.getCandidates(N,{},p);C=G.parseRange(U[0].reference).selector}let S=ake.default.coerce(C);if(S===null)return;let b=`${Zu.Modifier.CARET}${S.major}`,I=G.makeDescriptor(G.makeIdent(\"types\",E),b),T=je.mapAndFind(a.workspaces,N=>{let U=N.manifest.dependencies.get(r.identHash)?.descriptorHash,W=N.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&W!==r.descriptorHash)return je.mapAndFind.skip;let ee=[];for(let ie of Ut.allDependencies){let ue=N.manifest[ie].get(I.identHash);typeof ue>\"u\"||ee.push([ie,ue])}return ee.length===0?je.mapAndFind.skip:ee});if(typeof T<\"u\")for(let[N,U]of T)t.manifest[N].set(U.identHash,U);else{try{let N=n.normalizeDependency(I);if((await f.getCandidates(N,{},p)).length===0)return}catch{return}t.manifest[Zu.Target.DEVELOPMENT].set(I.identHash,I)}},KPt=async(t,e,r)=>{if(r.scope===\"types\")return;let{project:s}=t,{configuration:a}=s;if(!(a.get(\"tsEnableAutoTypes\")??(ce.existsSync(J.join(t.cwd,\"tsconfig.json\"))||ce.existsSync(J.join(s.cwd,\"tsconfig.json\")))))return;let c=lke(r),f=G.makeIdent(\"types\",c);for(let p of Ut.allDependencies)typeof t.manifest[p].get(f.identHash)>\"u\"||t.manifest[p].delete(f.identHash)},zPt=(t,e)=>{e.publishConfig&&e.publishConfig.typings&&(e.typings=e.publishConfig.typings),e.publishConfig&&e.publishConfig.types&&(e.types=e.publishConfig.types)},ZPt={configuration:{tsEnableAutoTypes:{description:\"Whether Yarn should auto-install @types/ dependencies on 'yarn add'\",type:\"BOOLEAN\",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:JPt,afterWorkspaceDependencyRemoval:KPt,beforeWorkspacePacking:zPt}},XPt=ZPt;var sz={};Vt(sz,{VersionApplyCommand:()=>Y1,VersionCheckCommand:()=>V1,VersionCommand:()=>J1,default:()=>nbt,versionUtils:()=>W1});Ge();Ge();Yt();var W1={};Vt(W1,{Decision:()=>G1,applyPrerelease:()=>cke,applyReleases:()=>iz,applyStrategy:()=>ib,clearVersionFiles:()=>tz,getUndecidedDependentWorkspaces:()=>ob,getUndecidedWorkspaces:()=>ML,openVersionFile:()=>q1,requireMoreDecisions:()=>ebt,resolveVersionFiles:()=>sb,suggestStrategy:()=>nz,updateVersionFiles:()=>rz,validateReleaseDecision:()=>dy});Ge();Dt();wc();Yt();ql();var kA=ut(Ai()),$Pt=/^(>=|[~^]|)(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$/,G1=(h=>(h.UNDECIDED=\"undecided\",h.DECLINE=\"decline\",h.MAJOR=\"major\",h.MINOR=\"minor\",h.PATCH=\"patch\",h.PREMAJOR=\"premajor\",h.PREMINOR=\"preminor\",h.PREPATCH=\"prepatch\",h.PRERELEASE=\"prerelease\",h))(G1||{});function dy(t){let e=kA.default.valid(t);return e||je.validateEnum(N4(G1,\"UNDECIDED\"),t)}async function sb(t,{prerelease:e=null}={}){let r=new Map,s=t.configuration.get(\"deferredVersionFolder\");if(!ce.existsSync(s))return r;let a=await ce.readdirPromise(s);for(let n of a){if(!n.endsWith(\".yml\"))continue;let c=J.join(s,n),f=await ce.readFilePromise(c,\"utf8\"),p=as(f);for(let[h,E]of Object.entries(p.releases||{})){if(E===\"decline\")continue;let C=G.parseIdent(h),S=t.tryWorkspaceByIdent(C);if(S===null)throw new Error(`Assertion failed: Expected a release definition file to only reference existing workspaces (${J.basename(c)} references ${h})`);if(S.manifest.version===null)throw new Error(`Assertion failed: Expected the workspace to have a version (${G.prettyLocator(t.configuration,S.anchoredLocator)})`);let b=S.manifest.raw.stableVersion??S.manifest.version,I=r.get(S),T=ib(E===\"prerelease\"?S.manifest.version:b,dy(E));if(T===null)throw new Error(`Assertion failed: Expected ${b} to support being bumped via strategy ${E}`);let N=typeof I<\"u\"?kA.default.gt(T,I)?T:I:T;r.set(S,N)}}return e&&(r=new Map([...r].map(([n,c])=>[n,cke(c,{current:n.manifest.version,prerelease:e})]))),r}async function tz(t){let e=t.configuration.get(\"deferredVersionFolder\");ce.existsSync(e)&&await ce.removePromise(e)}async function rz(t,e){let r=new Set(e),s=t.configuration.get(\"deferredVersionFolder\");if(!ce.existsSync(s))return;let a=await ce.readdirPromise(s);for(let n of a){if(!n.endsWith(\".yml\"))continue;let c=J.join(s,n),f=await ce.readFilePromise(c,\"utf8\"),p=as(f),h=p?.releases;if(h){for(let E of Object.keys(h)){let C=G.parseIdent(E),S=t.tryWorkspaceByIdent(C);(S===null||r.has(S))&&delete p.releases[E]}Object.keys(p.releases).length>0?await ce.changeFilePromise(c,nl(new nl.PreserveOrdering(p))):await ce.unlinkPromise(c)}}}async function q1(t,{allowEmpty:e=!1}={}){let r=t.configuration;if(r.projectCwd===null)throw new nt(\"This command can only be run from within a Yarn project\");let s=await ka.fetchRoot(r.projectCwd),a=s!==null?await ka.fetchBase(s,{baseRefs:r.get(\"changesetBaseRefs\")}):null,n=s!==null?await ka.fetchChangedFiles(s,{base:a.hash,project:t}):[],c=r.get(\"deferredVersionFolder\"),f=n.filter(b=>J.contains(c,b)!==null);if(f.length>1)throw new nt(`Your current branch contains multiple versioning files; this isn't supported:\n- ${f.map(b=>fe.fromPortablePath(b)).join(`\n- `)}`);let p=new Set(je.mapAndFilter(n,b=>{let I=t.tryWorkspaceByFilePath(b);return I===null?je.mapAndFilter.skip:I}));if(f.length===0&&p.size===0&&!e)return null;let h=f.length===1?f[0]:J.join(c,`${Nn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=ce.existsSync(h)?await ce.readFilePromise(h,\"utf8\"):\"{}\",C=as(E),S=new Map;for(let b of C.declined||[]){let I=G.parseIdent(b),T=t.getWorkspaceByIdent(I);S.set(T,\"decline\")}for(let[b,I]of Object.entries(C.releases||{})){let T=G.parseIdent(b),N=t.getWorkspaceByIdent(T);S.set(N,dy(I))}return{project:t,root:s,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(b=>b.manifest.version!==null)),releases:S,async saveAll(){let b={},I=[],T=[];for(let N of t.workspaces){if(N.manifest.version===null)continue;let U=G.stringifyIdent(N.anchoredLocator),W=S.get(N);W===\"decline\"?I.push(U):typeof W<\"u\"?b[U]=dy(W):p.has(N)&&T.push(U)}await ce.mkdirPromise(J.dirname(h),{recursive:!0}),await ce.changeFilePromise(h,nl(new nl.PreserveOrdering({releases:Object.keys(b).length>0?b:void 0,declined:I.length>0?I:void 0,undecided:T.length>0?T:void 0})))}}}function ebt(t){return ML(t).size>0||ob(t).length>0}function ML(t){let e=new Set;for(let r of t.changedWorkspaces)r.manifest.version!==null&&(t.releases.has(r)||e.add(r));return e}function ob(t,{include:e=new Set}={}){let r=[],s=new Map(je.mapAndFilter([...t.releases],([n,c])=>c===\"decline\"?je.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(je.mapAndFilter([...t.releases],([n,c])=>c!==\"decline\"?je.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of t.project.workspaces)if(!(!e.has(n)&&(a.has(n.anchoredLocator.locatorHash)||s.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let c of Ut.hardDependencies)for(let f of n.manifest.getForScope(c).values()){let p=t.project.tryWorkspaceByDescriptor(f);p!==null&&s.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function nz(t,e){let r=kA.default.clean(e);for(let s of Object.values(G1))if(s!==\"undecided\"&&s!==\"decline\"&&kA.default.inc(t,s)===r)return s;return null}function ib(t,e){if(kA.default.valid(e))return e;if(t===null)throw new nt(`Cannot apply the release strategy \"${e}\" unless the workspace already has a valid version`);if(!kA.default.valid(t))throw new nt(`Cannot apply the release strategy \"${e}\" on a non-semver version (${t})`);let r=kA.default.inc(t,e);if(r===null)throw new nt(`Cannot apply the release strategy \"${e}\" on the specified version (${t})`);return r}function iz(t,e,{report:r,exact:s}){let a=new Map;for(let n of t.workspaces)for(let c of Ut.allDependencies)for(let f of n.manifest[c].values()){let p=t.tryWorkspaceByDescriptor(f);if(p===null||!e.has(p))continue;je.getArrayWithDefault(a,p).push([n,c,f.identHash])}for(let[n,c]of e){let f=n.manifest.version;n.manifest.version=c,kA.default.prerelease(c)===null?delete n.manifest.raw.stableVersion:n.manifest.raw.stableVersion||(n.manifest.raw.stableVersion=f);let p=n.manifest.name!==null?G.stringifyIdent(n.manifest.name):null;r.reportInfo(0,`${G.prettyLocator(t.configuration,n.anchoredLocator)}: Bumped to ${c}`),r.reportJson({cwd:fe.fromPortablePath(n.cwd),ident:p,oldVersion:f,newVersion:c});let h=a.get(n);if(!(typeof h>\"u\"))for(let[E,C,S]of h){let b=E.manifest[C].get(S);if(typeof b>\"u\")throw new Error(\"Assertion failed: The dependency should have existed\");let I=b.range,T=!1;if(I.startsWith(Ei.protocol)&&(I=I.slice(Ei.protocol.length),T=!0,I===n.relativeCwd))continue;let N=I.match($Pt);if(!N){r.reportWarning(0,`Couldn't auto-upgrade range ${I} (in ${G.prettyLocator(t.configuration,E.anchoredLocator)})`);continue}let U=s?`${c}`:`${N[1]}${c}`;T&&(U=`${Ei.protocol}${U}`);let W=G.makeDescriptor(b,U);E.manifest[C].set(S,W)}}}var tbt=new Map([[\"%n\",{extract:t=>t.length>=1?[t[0],t.slice(1)]:null,generate:(t=0)=>`${t+1}`}]]);function cke(t,{current:e,prerelease:r}){let s=new kA.default.SemVer(e),a=s.prerelease.slice(),n=[];s.prerelease=[],s.format()!==t&&(a.length=0);let c=!0,f=r.split(/\\./g);for(let p of f){let h=tbt.get(p);if(typeof h>\"u\")n.push(p),a[0]===p?a.shift():c=!1;else{let E=c?h.extract(a):null;E!==null&&typeof E[0]==\"number\"?(n.push(h.generate(E[0])),a=E[1]):(n.push(h.generate()),c=!1)}}return s.prerelease&&(s.prerelease=[]),`${t}-${n.join(\".\")}`}var Y1=class extends ft{constructor(){super(...arguments);this.all=ge.Boolean(\"--all\",!1,{description:\"Apply the deferred version changes on all workspaces\"});this.dryRun=ge.Boolean(\"--dry-run\",!1,{description:\"Print the versions without actually generating the package archive\"});this.prerelease=ge.String(\"--prerelease\",{description:\"Add a prerelease identifier to new versions\",tolerateBoolean:!0});this.exact=ge.Boolean(\"--exact\",!1,{description:\"Use the exact version of each package, removes any range. Useful for nightly releases where the range might match another version.\"});this.recursive=ge.Boolean(\"-R,--recursive\",{description:\"Release the transitive workspaces as well\"});this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"})}static{this.paths=[[\"version\",\"apply\"]]}static{this.usage=ot.Usage({category:\"Release-related commands\",description:\"apply all the deferred version bumps at once\",details:`\n      This command will apply the deferred version changes and remove their definitions from the repository.\n\n      Note that if \\`--prerelease\\` is set, the given prerelease identifier (by default \\`rc.%n\\`) will be used on all new versions and the version definitions will be kept as-is.\n\n      By default only the current workspace will be bumped, but you can configure this behavior by using one of:\n\n      - \\`--recursive\\` to also apply the version bump on its dependencies\n      - \\`--all\\` to apply the version bump on all packages in the repository\n\n      Note that this command will also update the \\`workspace:\\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.\n    `,examples:[[\"Apply the version change to the local workspace\",\"yarn version apply\"],[\"Apply the version change to all the workspaces in the local workspace\",\"yarn version apply --all\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=this.prerelease?typeof this.prerelease!=\"boolean\"?this.prerelease:\"rc.%n\":null,h=await sb(s,{prerelease:p}),E=new Map;if(this.all)E=h;else{let C=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let S of C){let b=h.get(S);typeof b<\"u\"&&E.set(S,b)}}if(E.size===0){let C=h.size>0?\" Did you want to add --all?\":\"\";f.reportWarning(0,`The current workspace doesn't seem to require a version bump.${C}`);return}iz(s,E,{report:f,exact:this.exact}),this.dryRun||(p||(this.all?await tz(s):await rz(s,[...E.keys()])),f.reportSeparator())});return this.dryRun||c.hasErrors()?c.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ge();Dt();Yt();var UL=ut(Ai());var V1=class extends ft{constructor(){super(...arguments);this.interactive=ge.Boolean(\"-i,--interactive\",{description:\"Open an interactive interface used to set version bumps\"})}static{this.paths=[[\"version\",\"check\"]]}static{this.usage=ot.Usage({category:\"Release-related commands\",description:\"check that all the relevant packages have been bumped\",details:\"\\n      **Warning:** This command currently requires Git.\\n\\n      This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\\n\\n      In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\\n\\n      In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\\n    \",examples:[[\"Check whether the modified packages need a bump\",\"yarn version check\"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){iw(this.context);let{Gem:r}=await Promise.resolve().then(()=>(qF(),kW)),{ScrollableItems:s}=await Promise.resolve().then(()=>(JF(),VF)),{FocusRequest:a}=await Promise.resolve().then(()=>(RW(),E2e)),{useListInput:n}=await Promise.resolve().then(()=>(YF(),I2e)),{renderForm:c}=await Promise.resolve().then(()=>(XF(),ZF)),{Box:f,Text:p}=await Promise.resolve().then(()=>ut(Wc())),{default:h,useCallback:E,useState:C}=await Promise.resolve().then(()=>ut(hn())),S=await ze.find(this.context.cwd,this.context.plugins),{project:b,workspace:I}=await Rt.find(S,this.context.cwd);if(!I)throw new ar(b.cwd,this.context.cwd);await b.restoreInstallState();let T=await q1(b);if(T===null||T.releaseRoots.size===0)return 0;if(T.root===null)throw new nt(\"This command can only be run on Git repositories\");let N=()=>h.createElement(f,{flexDirection:\"row\",paddingBottom:1},h.createElement(f,{flexDirection:\"column\",width:60},h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<up>\"),\"/\",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<down>\"),\" to select workspaces.\")),h.createElement(f,null,h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<left>\"),\"/\",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<right>\"),\" to select release strategies.\"))),h.createElement(f,{flexDirection:\"column\"},h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<enter>\"),\" to save.\")),h.createElement(f,{marginLeft:1},h.createElement(p,null,\"Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<ctrl+c>\"),\" to abort.\")))),U=({workspace:me,active:pe,decision:Be,setDecision:Ce})=>{let g=me.manifest.raw.stableVersion??me.manifest.version;if(g===null)throw new Error(`Assertion failed: The version should have been set (${G.prettyLocator(S,me.anchoredLocator)})`);if(UL.default.prerelease(g)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${g})`);let we=[\"undecided\",\"decline\",\"patch\",\"minor\",\"major\"];n(Be,we,{active:pe,minus:\"left\",plus:\"right\",set:Ce});let ye=Be===\"undecided\"?h.createElement(p,{color:\"yellow\"},g):Be===\"decline\"?h.createElement(p,{color:\"green\"},g):h.createElement(p,null,h.createElement(p,{color:\"magenta\"},g),\" \\u2192 \",h.createElement(p,{color:\"green\"},UL.default.valid(Be)?Be:UL.default.inc(g,Be)));return h.createElement(f,{flexDirection:\"column\"},h.createElement(f,null,h.createElement(p,null,G.prettyLocator(S,me.anchoredLocator),\" - \",ye)),h.createElement(f,null,we.map(Ae=>h.createElement(f,{key:Ae,paddingLeft:2},h.createElement(p,null,h.createElement(r,{active:Ae===Be}),\" \",Ae)))))},W=me=>{let pe=new Set(T.releaseRoots),Be=new Map([...me].filter(([Ce])=>pe.has(Ce)));for(;;){let Ce=ob({project:T.project,releases:Be}),g=!1;if(Ce.length>0){for(let[we]of Ce)if(!pe.has(we)){pe.add(we),g=!0;let ye=me.get(we);typeof ye<\"u\"&&Be.set(we,ye)}}if(!g)break}return{relevantWorkspaces:pe,relevantReleases:Be}},ee=()=>{let[me,pe]=C(()=>new Map(T.releases)),Be=E((Ce,g)=>{let we=new Map(me);g!==\"undecided\"?we.set(Ce,g):we.delete(Ce);let{relevantReleases:ye}=W(we);pe(ye)},[me,pe]);return[me,Be]},ie=({workspaces:me,releases:pe})=>{let Be=[];Be.push(`${me.size} total`);let Ce=0,g=0;for(let we of me){let ye=pe.get(we);typeof ye>\"u\"?g+=1:ye!==\"decline\"&&(Ce+=1)}return Be.push(`${Ce} release${Ce===1?\"\":\"s\"}`),Be.push(`${g} remaining`),h.createElement(p,{color:\"yellow\"},Be.join(\", \"))},le=await c(({useSubmit:me})=>{let[pe,Be]=ee();me(pe);let{relevantWorkspaces:Ce}=W(pe),g=new Set([...Ce].filter(se=>!T.releaseRoots.has(se))),[we,ye]=C(0),Ae=E(se=>{switch(se){case a.BEFORE:ye(we-1);break;case a.AFTER:ye(we+1);break}},[we,ye]);return h.createElement(f,{flexDirection:\"column\"},h.createElement(N,null),h.createElement(f,null,h.createElement(p,{wrap:\"wrap\"},\"The following files have been modified in your local checkout.\")),h.createElement(f,{flexDirection:\"column\",marginTop:1,paddingLeft:2},[...T.changedFiles].map(se=>h.createElement(f,{key:se},h.createElement(p,null,h.createElement(p,{color:\"grey\"},fe.fromPortablePath(T.root)),fe.sep,fe.relative(fe.fromPortablePath(T.root),fe.fromPortablePath(se)))))),T.releaseRoots.size>0&&h.createElement(h.Fragment,null,h.createElement(f,{marginTop:1},h.createElement(p,{wrap:\"wrap\"},\"Because of those files having been modified, the following workspaces may need to be released again (note that private workspaces are also shown here, because even though they won't be published, releasing them will allow us to flag their dependents for potential re-release):\")),g.size>3?h.createElement(f,{marginTop:1},h.createElement(ie,{workspaces:T.releaseRoots,releases:pe})):null,h.createElement(f,{marginTop:1,flexDirection:\"column\"},h.createElement(s,{active:we%2===0,radius:1,size:2,onFocusRequest:Ae},[...T.releaseRoots].map(se=>h.createElement(U,{key:se.cwd,workspace:se,decision:pe.get(se)||\"undecided\",setDecision:X=>Be(se,X)}))))),g.size>0?h.createElement(h.Fragment,null,h.createElement(f,{marginTop:1},h.createElement(p,{wrap:\"wrap\"},\"The following workspaces depend on other workspaces that have been marked for release, and thus may need to be released as well:\")),h.createElement(f,null,h.createElement(p,null,\"(Press \",h.createElement(p,{bold:!0,color:\"cyanBright\"},\"<tab>\"),\" to move the focus between the workspace groups.)\")),g.size>5?h.createElement(f,{marginTop:1},h.createElement(ie,{workspaces:g,releases:pe})):null,h.createElement(f,{marginTop:1,flexDirection:\"column\"},h.createElement(s,{active:we%2===1,radius:2,size:2,onFocusRequest:Ae},[...g].map(se=>h.createElement(U,{key:se.cwd,workspace:se,decision:pe.get(se)||\"undecided\",setDecision:X=>Be(se,X)}))))):null)},{versionFile:T},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof le>\"u\")return 1;T.releases.clear();for(let[me,pe]of le)T.releases.set(me,pe);await T.saveAll()}async executeStandard(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return await s.restoreInstallState(),(await Ot.start({configuration:r,stdout:this.context.stdout},async c=>{let f=await q1(s);if(f===null||f.releaseRoots.size===0)return;if(f.root===null)throw new nt(\"This command can only be run on Git repositories\");if(c.reportInfo(0,`Your PR was started right after ${he.pretty(r,f.baseHash.slice(0,7),\"yellow\")} ${he.pretty(r,f.baseTitle,\"magenta\")}`),f.changedFiles.size>0){c.reportInfo(0,\"You have changed the following files since then:\"),c.reportSeparator();for(let S of f.changedFiles)c.reportInfo(null,`${he.pretty(r,fe.fromPortablePath(f.root),\"gray\")}${fe.sep}${fe.relative(fe.fromPortablePath(f.root),fe.fromPortablePath(S))}`)}let p=!1,h=!1,E=ML(f);if(E.size>0){p||c.reportSeparator();for(let S of E)c.reportError(0,`${G.prettyLocator(r,S.anchoredLocator)} has been modified but doesn't have a release strategy attached`);p=!0}let C=ob(f);for(let[S,b]of C)h||c.reportSeparator(),c.reportError(0,`${G.prettyLocator(r,S.anchoredLocator)} doesn't have a release strategy attached, but depends on ${G.prettyWorkspace(r,b)} which is planned for release.`),h=!0;(p||h)&&(c.reportSeparator(),c.reportInfo(0,\"This command detected that at least some workspaces have received modifications without explicit instructions as to how they had to be released (if needed).\"),c.reportInfo(0,\"To correct these errors, run `yarn version check --interactive` then follow the instructions.\"))})).exitCode()}};Ge();Yt();var _L=ut(Ai());var J1=class extends ft{constructor(){super(...arguments);this.deferred=ge.Boolean(\"-d,--deferred\",{description:\"Prepare the version to be bumped during the next release cycle\"});this.immediate=ge.Boolean(\"-i,--immediate\",{description:\"Bump the version immediately\"});this.strategy=ge.String()}static{this.paths=[[\"version\"]]}static{this.usage=ot.Usage({category:\"Release-related commands\",description:\"apply a new version to the current package\",details:\"\\n      This command will bump the version number for the given package, following the specified strategy:\\n\\n      - If `major`, the first number from the semver range will be increased (`X.0.0`).\\n      - If `minor`, the second number from the semver range will be increased (`0.X.0`).\\n      - If `patch`, the third number from the semver range will be increased (`0.0.X`).\\n      - If prefixed by `pre` (`premajor`, ...), a `-0` suffix will be set (`0.0.0-0`).\\n      - If `prerelease`, the suffix will be increased (`0.0.0-X`); the third number from the semver range will also be increased if there was no suffix in the previous version.\\n      - If `decline`, the nonce will be increased for `yarn version check` to pass without version bump.\\n      - If a valid semver range, it will be used as new version.\\n      - If unspecified, Yarn will ask you for guidance.\\n\\n      For more information about the `--deferred` flag, consult our documentation (https://yarnpkg.com/features/release-workflow#deferred-versioning).\\n    \",examples:[[\"Immediately bump the version to the next major\",\"yarn version major\"],[\"Prepare the version to be bumped to the next major\",\"yarn version major --deferred\"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=r.get(\"preferDeferredVersions\");this.deferred&&(n=!0),this.immediate&&(n=!1);let c=_L.default.valid(this.strategy),f=this.strategy===\"decline\",p;if(c)if(a.manifest.version!==null){let E=nz(a.manifest.version,this.strategy);E!==null?p=E:p=this.strategy}else p=this.strategy;else{let E=a.manifest.version;if(!f){if(E===null)throw new nt(\"Can't bump the version if there wasn't a version to begin with - use 0.0.0 as initial version then run the command again.\");if(typeof E!=\"string\"||!_L.default.valid(E))throw new nt(`Can't bump the version (${E}) if it's not valid semver`)}p=dy(this.strategy)}if(!n){let C=(await sb(s)).get(a);if(typeof C<\"u\"&&p!==\"decline\"){let S=ib(a.manifest.version,p);if(_L.default.lt(S,C))throw new nt(`Can't bump the version to one that would be lower than the current deferred one (${C})`)}}let h=await q1(s,{allowEmpty:!0});return h.releases.set(a,p),await h.saveAll(),n?0:await this.cli.run([\"version\",\"apply\"])}};var rbt={configuration:{deferredVersionFolder:{description:\"Folder where are stored the versioning files\",type:\"ABSOLUTE_PATH\",default:\"./.yarn/versions\"},preferDeferredVersions:{description:\"If true, running `yarn version` will assume the `--deferred` flag unless `--immediate` is set\",type:\"BOOLEAN\",default:!1}},commands:[Y1,V1,J1]},nbt=rbt;var oz={};Vt(oz,{WorkspacesFocusCommand:()=>K1,WorkspacesForeachCommand:()=>Z1,default:()=>obt});Ge();Ge();Yt();var K1=class extends ft{constructor(){super(...arguments);this.json=ge.Boolean(\"--json\",!1,{description:\"Format the output as an NDJSON stream\"});this.production=ge.Boolean(\"--production\",!1,{description:\"Only install regular dependencies by omitting dev dependencies\"});this.all=ge.Boolean(\"-A,--all\",!1,{description:\"Install the entire project\"});this.workspaces=ge.Rest()}static{this.paths=[[\"workspaces\",\"focus\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"install a single workspace and its dependencies\",details:\"\\n      This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\\n\\n      Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.cjs` file, at the cost of introducing an extra complexity.\\n\\n      If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\\n    \"})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await Kr.find(r);await s.restoreInstallState({restoreResolutions:!1});let c;if(this.all)c=new Set(s.workspaces);else if(this.workspaces.length===0){if(!a)throw new ar(s.cwd,this.context.cwd);c=new Set([a])}else c=new Set(this.workspaces.map(f=>s.getWorkspaceByIdent(G.parseIdent(f))));for(let f of c)for(let p of this.production?[\"dependencies\"]:Ut.hardDependencies)for(let h of f.manifest.getForScope(p).values()){let E=s.tryWorkspaceByDescriptor(h);E!==null&&c.add(E)}for(let f of s.workspaces)c.has(f)?this.production&&f.manifest.devDependencies.clear():(f.manifest.installConfig=f.manifest.installConfig||{},f.manifest.installConfig.selfReferences=!1,f.manifest.dependencies.clear(),f.manifest.devDependencies.clear(),f.manifest.peerDependencies.clear(),f.manifest.scripts.clear());return await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n,persistProject:!1})}};Ge();Ge();Ge();Yt();var z1=ut(Go()),fke=ut(Ld());Ul();var Z1=class extends ft{constructor(){super(...arguments);this.from=ge.Array(\"--from\",{description:\"An array of glob pattern idents or paths from which to base any recursion\"});this.all=ge.Boolean(\"-A,--all\",{description:\"Run the command on all workspaces of a project\"});this.recursive=ge.Boolean(\"-R,--recursive\",{description:\"Run the command on the current workspace and all of its recursive dependencies\"});this.worktree=ge.Boolean(\"-W,--worktree\",{description:\"Run the command on all workspaces of the current worktree\"});this.verbose=ge.Counter(\"-v,--verbose\",{description:\"Increase level of logging verbosity up to 2 times\"});this.parallel=ge.Boolean(\"-p,--parallel\",!1,{description:\"Run the commands in parallel\"});this.interlaced=ge.Boolean(\"-i,--interlaced\",!1,{description:\"Print the output of commands in real-time instead of buffering it\"});this.jobs=ge.String(\"-j,--jobs\",{description:\"The maximum number of parallel tasks that the execution will be limited to; or `unlimited`\",validator:h_([fo([\"unlimited\"]),$2(p_(),[d_(),g_(1)])])});this.topological=ge.Boolean(\"-t,--topological\",!1,{description:\"Run the command after all workspaces it depends on (regular) have finished\"});this.topologicalDev=ge.Boolean(\"--topological-dev\",!1,{description:\"Run the command after all workspaces it depends on (regular + dev) have finished\"});this.include=ge.Array(\"--include\",[],{description:\"An array of glob pattern idents or paths; only matching workspaces will be traversed\"});this.exclude=ge.Array(\"--exclude\",[],{description:\"An array of glob pattern idents or paths; matching workspaces won't be traversed\"});this.publicOnly=ge.Boolean(\"--no-private\",{description:\"Avoid running the command on private workspaces\"});this.since=ge.String(\"--since\",{description:\"Only include workspaces that have been changed since the specified ref.\",tolerateBoolean:!0});this.dryRun=ge.Boolean(\"-n,--dry-run\",{description:\"Print the commands that would be run, without actually running them\"});this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[[\"workspaces\",\"foreach\"]]}static{this.usage=ot.Usage({category:\"Workspace-related commands\",description:\"run a command on all workspaces\",details:\"\\n      This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\\n\\n      - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`, or disabled by setting `-j unlimited`.\\n\\n      - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\\n\\n      - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\\n\\n      - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project.\\n\\n      - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\\n\\n      - If `-W,--worktree` is set, Yarn will find workspaces to run the command on by looking at the current worktree.\\n\\n      - If `--from` is set, Yarn will use the packages matching the 'from' glob as the starting point for any recursive search.\\n\\n      - If `--since` is set, Yarn will only run the command on workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\\n\\n      - If `--dry-run` is set, Yarn will explain what it would do without actually doing anything.\\n\\n      - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them. You can also use the `--no-private` flag to avoid running the command in private workspaces.\\n\\n      The `-v,--verbose` flag can be passed up to twice: once to prefix output lines with the originating workspace's name, and again to include start/finish/timing log lines. Maximum verbosity is enabled by default in terminal environments.\\n\\n      If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\\n    \",examples:[[\"Publish all packages\",\"yarn workspaces foreach -A --no-private npm publish --tolerate-republish\"],[\"Run the build script on all descendant packages\",\"yarn workspaces foreach -A run build\"],[\"Run the build script on current and all descendant packages in parallel, building package dependencies first\",\"yarn workspaces foreach -Apt run build\"],[\"Run the build script on several packages and all their dependencies, building dependencies first\",\"yarn workspaces foreach -Rpt --from '{workspace-a,workspace-b}' run build\"]]})}static{this.schema=[tB(\"all\",qf.Forbids,[\"from\",\"recursive\",\"since\",\"worktree\"],{missingIf:\"undefined\"}),m_([\"all\",\"recursive\",\"since\",\"worktree\"],{missingIf:\"undefined\"})]}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!this.all&&!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=this.cli.process([this.commandName,...this.args]),c=n.path.length===1&&n.path[0]===\"run\"&&typeof n.scriptName<\"u\"?n.scriptName:null;if(n.path.length===0)throw new nt(\"Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script\");let f=Ce=>{this.dryRun&&this.context.stdout.write(`${Ce}\n`)},p=()=>{let Ce=this.from.map(g=>z1.default.matcher(g));return s.workspaces.filter(g=>{let we=G.stringifyIdent(g.anchoredLocator),ye=g.relativeCwd;return Ce.some(Ae=>Ae(we)||Ae(ye))})},h=[];if(this.since?(f(\"Option --since is set; selecting the changed workspaces as root for workspace selection\"),h=Array.from(await ka.fetchChangedWorkspaces({ref:this.since,project:s}))):this.from?(f(\"Option --from is set; selecting the specified workspaces\"),h=[...p()]):this.worktree?(f(\"Option --worktree is set; selecting the current workspace\"),h=[a]):this.recursive?(f(\"Option --recursive is set; selecting the current workspace\"),h=[a]):this.all&&(f(\"Option --all is set; selecting all workspaces\"),h=[...s.workspaces]),this.dryRun&&!this.all){for(let Ce of h)f(`\n- ${Ce.relativeCwd}\n  ${G.prettyLocator(r,Ce.anchoredLocator)}`);h.length>0&&f(\"\")}let E;if(this.recursive?this.since?(f(\"Option --recursive --since is set; recursively selecting all dependent workspaces\"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceDependents()]).flat())):(f(\"Option --recursive is set; recursively selecting all transitive dependencies\"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(f(\"Option --worktree is set; recursively selecting all nested workspaces\"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let Ce of E)f(`\n- ${Ce.relativeCwd}\n  ${G.prettyLocator(r,Ce.anchoredLocator)}`);let C=[],S=!1;if(c?.includes(\":\")){for(let Ce of s.workspaces)if(Ce.manifest.scripts.has(c)&&(S=!S,S===!1))break}for(let Ce of h){if(c&&!Ce.manifest.scripts.has(c)&&!S&&!(await In.getWorkspaceAccessibleBinaries(Ce)).has(c)){f(`Excluding ${Ce.relativeCwd} because it doesn't have a \"${c}\" script`);continue}if(!(c===r.env.npm_lifecycle_event&&Ce.cwd===a.cwd)){if(this.include.length>0&&!z1.default.isMatch(G.stringifyIdent(Ce.anchoredLocator),this.include)&&!z1.default.isMatch(Ce.relativeCwd,this.include)){f(`Excluding ${Ce.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&(z1.default.isMatch(G.stringifyIdent(Ce.anchoredLocator),this.exclude)||z1.default.isMatch(Ce.relativeCwd,this.exclude))){f(`Excluding ${Ce.relativeCwd} because it matches the --exclude filter`);continue}if(this.publicOnly&&Ce.manifest.private===!0){f(`Excluding ${Ce.relativeCwd} because it's a private workspace and --no-private was set`);continue}C.push(Ce)}}if(this.dryRun)return 0;let b=this.verbose??(this.context.stdout.isTTY?1/0:0),I=b>0,T=b>1,N=this.parallel?this.jobs===\"unlimited\"?1/0:Number(this.jobs)||Math.ceil(fs.availableParallelism()/2):1,U=N===1?!1:this.parallel,W=U?this.interlaced:!0,ee=(0,fke.default)(N),ie=new Map,ue=new Set,le=0,me=null,pe=!1,Be=await Ot.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async Ce=>{let g=async(we,{commandIndex:ye})=>{if(pe)return-1;!U&&T&&ye>1&&Ce.reportSeparator();let Ae=ibt(we,{configuration:r,label:I,commandIndex:ye}),[se,X]=uke(Ce,{prefix:Ae,interlaced:W}),[De,Te]=uke(Ce,{prefix:Ae,interlaced:W});try{T&&Ce.reportInfo(null,`${Ae?`${Ae} `:\"\"}Process started`);let mt=Date.now(),j=await this.cli.run([this.commandName,...this.args],{cwd:we.cwd,stdout:se,stderr:De})||0;se.end(),De.end(),await X,await Te;let rt=Date.now();if(T){let Fe=r.get(\"enableTimers\")?`, completed in ${he.pretty(r,rt-mt,he.Type.DURATION)}`:\"\";Ce.reportInfo(null,`${Ae?`${Ae} `:\"\"}Process exited (exit code ${j})${Fe}`)}return j===130&&(pe=!0,me=j),j}catch(mt){throw se.end(),De.end(),await X,await Te,mt}};for(let we of C)ie.set(we.anchoredLocator.locatorHash,we);for(;ie.size>0&&!Ce.hasErrors();){let we=[];for(let[X,De]of ie){if(ue.has(De.anchoredDescriptor.descriptorHash))continue;let Te=!0;if(this.topological||this.topologicalDev){let mt=this.topologicalDev?new Map([...De.manifest.dependencies,...De.manifest.devDependencies]):De.manifest.dependencies;for(let j of mt.values()){let rt=s.tryWorkspaceByDescriptor(j);if(Te=rt===null||!ie.has(rt.anchoredLocator.locatorHash),!Te)break}}if(Te&&(ue.add(De.anchoredDescriptor.descriptorHash),we.push(ee(async()=>{let mt=await g(De,{commandIndex:++le});return ie.delete(X),ue.delete(De.anchoredDescriptor.descriptorHash),{workspace:De,exitCode:mt}})),!U))break}if(we.length===0){let X=Array.from(ie.values()).map(De=>G.prettyLocator(r,De.anchoredLocator)).join(\", \");Ce.reportError(3,`Dependency cycle detected (${X})`);return}let ye=await Promise.all(we);ye.forEach(({workspace:X,exitCode:De})=>{De!==0&&Ce.reportError(0,`The command failed in workspace ${G.prettyLocator(r,X.anchoredLocator)} with exit code ${De}`)});let se=ye.map(X=>X.exitCode).find(X=>X!==0);(this.topological||this.topologicalDev)&&typeof se<\"u\"&&Ce.reportError(0,\"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph\")}});return me!==null?me:Be.exitCode()}};function uke(t,{prefix:e,interlaced:r}){let s=t.createStreamReporter(e),a=new je.DefaultStream;a.pipe(s,{end:!1}),a.on(\"finish\",()=>{s.end()});let n=new Promise(f=>{s.on(\"finish\",()=>{f(a.active)})});if(r)return[a,n];let c=new je.BufferStream;return c.pipe(a,{end:!1}),c.on(\"finish\",()=>{a.end()}),[c,n]}function ibt(t,{configuration:e,commandIndex:r,label:s}){if(!s)return null;let n=`[${G.stringifyIdent(t.anchoredLocator)}]:`,c=[\"#2E86AB\",\"#A23B72\",\"#F18F01\",\"#C73E1D\",\"#CCE2A3\"],f=c[r%c.length];return he.pretty(e,n,f)}var sbt={commands:[K1,Z1]},obt=sbt;var uz={};Vt(uz,{default:()=>ubt});Ge();Ge();var az=\"catalog:\";var lz=t=>t.startsWith(az),abt=t=>t.range.slice(az.length)||null,Ake=t=>t===null?\"default catalog\":`catalog \"${t}\"`,lbt=t=>t.scope?`@${t.scope}/${t.name}`:t.name,cz=(t,e,r,s)=>{let a=abt(e),n;if(a===null)n=t.configuration.get(\"catalog\");else try{let E=t.configuration.get(\"catalogs\");E&&(n=E.get(a))}catch{n=void 0}if(!n||n.size===0)throw new jt(82,`${G.prettyDescriptor(t.configuration,e)}: ${Ake(a)} not found or empty`);let c=lbt(e),f=n.get(c);if(!f)throw new jt(82,`${G.prettyDescriptor(t.configuration,e)}: entry not found in ${Ake(a)}`);let p=t.configuration.normalizeDependency(G.makeDescriptor(e,f));return r.bindDescriptor(p,t.topLevelWorkspace.anchoredLocator,s)};var cbt={configuration:{catalog:{description:\"The default catalog of packages\",type:\"MAP\",valueDefinition:{description:\"The catalog of packages\",type:\"STRING\"}},catalogs:{description:\"Named catalogs of packages\",type:\"MAP\",valueDefinition:{description:\"A named catalog\",type:\"MAP\",valueDefinition:{description:\"Package version in the catalog\",type:\"STRING\"}}}},hooks:{beforeWorkspacePacking:(t,e)=>{let r=t.project,s=r.configuration.makeResolver(),a={project:r,resolver:s,report:new ki};for(let n of Ut.allDependencies){let c=e[n];if(c)for(let[f,p]of Object.entries(c)){if(typeof p!=\"string\"||!lz(p))continue;let h=G.parseIdent(f),E=G.makeDescriptor(h,p),C=cz(r,E,s,a),{protocol:S,source:b,params:I,selector:T}=G.parseRange(G.convertToManifestRange(C.range));S===t.project.configuration.get(\"defaultProtocol\")&&(S=null),c[f]=G.makeRange({protocol:S,source:b,params:I,selector:T})}}},reduceDependency:async(t,e,r,s,{resolver:a,resolveOptions:n})=>lz(t.range)?cz(e,t,a,n):t}},ubt=cbt;var tC=()=>({modules:new Map([[\"@yarnpkg/cli\",Gv],[\"@yarnpkg/core\",jv],[\"@yarnpkg/fslib\",_2],[\"@yarnpkg/libzip\",fv],[\"@yarnpkg/parsers\",J2],[\"@yarnpkg/shell\",mv],[\"clipanion\",oB],[\"semver\",fbt],[\"typanion\",Ea],[\"@yarnpkg/plugin-essentials\",f5],[\"@yarnpkg/plugin-compat\",d5],[\"@yarnpkg/plugin-constraints\",T5],[\"@yarnpkg/plugin-dlx\",F5],[\"@yarnpkg/plugin-exec\",L5],[\"@yarnpkg/plugin-file\",U5],[\"@yarnpkg/plugin-git\",u5],[\"@yarnpkg/plugin-github\",j5],[\"@yarnpkg/plugin-http\",G5],[\"@yarnpkg/plugin-init\",q5],[\"@yarnpkg/plugin-interactive-tools\",HW],[\"@yarnpkg/plugin-jsr\",GW],[\"@yarnpkg/plugin-link\",qW],[\"@yarnpkg/plugin-nm\",PY],[\"@yarnpkg/plugin-npm\",PK],[\"@yarnpkg/plugin-npm-cli\",OK],[\"@yarnpkg/plugin-pack\",IV],[\"@yarnpkg/plugin-patch\",GK],[\"@yarnpkg/plugin-pnp\",gY],[\"@yarnpkg/plugin-pnpm\",YK],[\"@yarnpkg/plugin-stage\",$K],[\"@yarnpkg/plugin-typescript\",ez],[\"@yarnpkg/plugin-version\",sz],[\"@yarnpkg/plugin-workspace-tools\",oz],[\"@yarnpkg/plugin-catalog\",uz]]),plugins:new Set([\"@yarnpkg/plugin-essentials\",\"@yarnpkg/plugin-compat\",\"@yarnpkg/plugin-constraints\",\"@yarnpkg/plugin-dlx\",\"@yarnpkg/plugin-exec\",\"@yarnpkg/plugin-file\",\"@yarnpkg/plugin-git\",\"@yarnpkg/plugin-github\",\"@yarnpkg/plugin-http\",\"@yarnpkg/plugin-init\",\"@yarnpkg/plugin-interactive-tools\",\"@yarnpkg/plugin-jsr\",\"@yarnpkg/plugin-link\",\"@yarnpkg/plugin-nm\",\"@yarnpkg/plugin-npm\",\"@yarnpkg/plugin-npm-cli\",\"@yarnpkg/plugin-pack\",\"@yarnpkg/plugin-patch\",\"@yarnpkg/plugin-pnp\",\"@yarnpkg/plugin-pnpm\",\"@yarnpkg/plugin-stage\",\"@yarnpkg/plugin-typescript\",\"@yarnpkg/plugin-version\",\"@yarnpkg/plugin-workspace-tools\",\"@yarnpkg/plugin-catalog\"])});function gke({cwd:t,pluginConfiguration:e}){let r=new Ca({binaryLabel:\"Yarn Package Manager\",binaryName:\"yarn\",binaryVersion:fn??\"<unknown>\"});return Object.assign(r,{defaultContext:{...Ca.defaultContext,cwd:t,plugins:e,quiet:!1,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr}})}function Abt(t){if(je.parseOptionalBoolean(process.env.YARN_IGNORE_NODE))return!0;let r=process.versions.node,s=\">=18.12.0\";if(Fr.satisfiesWithPrereleases(r,s))return!0;let a=new nt(`This tool requires a Node version compatible with ${s} (got ${r}). Upgrade Node, or set \\`YARN_IGNORE_NODE=1\\` in your environment.`);return Ca.defaultContext.stdout.write(t.error(a)),!1}async function dke({selfPath:t,pluginConfiguration:e}){return await ze.find(fe.toPortablePath(process.cwd()),e,{strict:!1,usePathCheck:t})}function pbt(t,e,{yarnPath:r}){if(!ce.existsSync(r))return t.error(new Error(`The \"yarn-path\" option has been set, but the specified location doesn't exist (${r}).`)),1;process.on(\"SIGINT\",()=>{});let s={stdio:\"inherit\",env:{...process.env,YARN_IGNORE_PATH:\"1\"}};try{(0,pke.execFileSync)(process.execPath,[fe.fromPortablePath(r),...e],s)}catch(a){return a.status??1}return 0}function hbt(t,e){let r=null,s=e;return e.length>=2&&e[0]===\"--cwd\"?(r=fe.toPortablePath(e[1]),s=e.slice(2)):e.length>=1&&e[0].startsWith(\"--cwd=\")?(r=fe.toPortablePath(e[0].slice(6)),s=e.slice(1)):e[0]===\"add\"&&e[e.length-2]===\"--cwd\"&&(r=fe.toPortablePath(e[e.length-1]),s=e.slice(0,e.length-2)),t.defaultContext.cwd=r!==null?J.resolve(r):J.cwd(),s}function gbt(t,{configuration:e}){if(!e.get(\"enableTelemetry\")||hke.isCI||!process.stdout.isTTY)return;ze.telemetry=new XI(e,\"puba9cdc10ec5790a2cf4969dd413a47270\");let s=/^@yarnpkg\\/plugin-(.*)$/;for(let a of e.plugins.keys())$I.has(a.match(s)?.[1]??\"\")&&ze.telemetry?.reportPluginName(a);t.binaryVersion&&ze.telemetry.reportVersion(t.binaryVersion)}function mke(t,{configuration:e}){for(let r of e.plugins.values())for(let s of r.commands||[])t.register(s)}async function dbt(t,e,{selfPath:r,pluginConfiguration:s}){if(!Abt(t))return 1;let a=await dke({selfPath:r,pluginConfiguration:s}),n=a.get(\"yarnPath\"),c=a.get(\"ignorePath\");if(n&&!c)return pbt(t,e,{yarnPath:n});delete process.env.YARN_IGNORE_PATH;let f=hbt(t,e);gbt(t,{configuration:a}),mke(t,{configuration:a});let p=t.process(f,t.defaultContext);return p.help||ze.telemetry?.reportCommandName(p.path.join(\" \")),await t.run(p,t.defaultContext)}async function Bde({cwd:t=J.cwd(),pluginConfiguration:e=tC()}={}){let r=gke({cwd:t,pluginConfiguration:e}),s=await dke({pluginConfiguration:e,selfPath:null});return mke(r,{configuration:s}),r}async function YT(t,{cwd:e=J.cwd(),selfPath:r,pluginConfiguration:s}){let a=gke({cwd:e,pluginConfiguration:s});function n(){Ca.defaultContext.stdout.write(`ERROR: Yarn is terminating due to an unexpected empty event loop.\nPlease report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once(\"beforeExit\",n);try{process.exitCode=42,process.exitCode=await dbt(a,t,{selfPath:r,pluginConfiguration:s})}catch(c){Ca.defaultContext.stdout.write(a.error(c)),process.exitCode=1}finally{process.off(\"beforeExit\",n),await ce.rmtempPromise()}}YT(process.argv.slice(2),{cwd:J.cwd(),selfPath:fe.toPortablePath(fe.resolve(process.argv[1])),pluginConfiguration:tC()});})();\n/**\n  @license\n  Copyright (c) 2015, Rebecca Turner\n\n  Permission to use, copy, modify, and/or distribute this software for any\n  purpose with or without fee is hereby granted, provided that the above\n  copyright notice and this permission notice appear in all copies.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n  FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n  PERFORMANCE OF THIS SOFTWARE.\n */\n/**\n  @license\n  Copyright Node.js contributors. All rights reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to\n  deal in the Software without restriction, including without limitation the\n  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n  sell copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n  IN THE SOFTWARE.\n*/\n/**\n  @license\n  The MIT License (MIT)\n\n  Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n*/\n/**\n  @license\n  Copyright Joyent, Inc. and other Node contributors.\n\n  Permission is hereby granted, free of charge, to any person obtaining a\n  copy of this software and associated documentation files (the\n  \"Software\"), to deal in the Software without restriction, including\n  without limitation the rights to use, copy, modify, merge, publish,\n  distribute, sublicense, and/or sell copies of the Software, and to permit\n  persons to whom the Software is furnished to do so, subject to the\n  following conditions:\n\n  The above copyright notice and this permission notice shall be included\n  in all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n  NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n  USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n/*! Bundled license information:\n\nis-number/index.js:\n  (*!\n   * is-number <https://github.com/jonschlinkert/is-number>\n   *\n   * Copyright (c) 2014-present, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n\nto-regex-range/index.js:\n  (*!\n   * to-regex-range <https://github.com/micromatch/to-regex-range>\n   *\n   * Copyright (c) 2015-present, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n\nfill-range/index.js:\n  (*!\n   * fill-range <https://github.com/jonschlinkert/fill-range>\n   *\n   * Copyright (c) 2014-present, Jon Schlinkert.\n   * Licensed under the MIT License.\n   *)\n\nis-extglob/index.js:\n  (*!\n   * is-extglob <https://github.com/jonschlinkert/is-extglob>\n   *\n   * Copyright (c) 2014-2016, Jon Schlinkert.\n   * Licensed under the MIT License.\n   *)\n\nis-glob/index.js:\n  (*!\n   * is-glob <https://github.com/jonschlinkert/is-glob>\n   *\n   * Copyright (c) 2014-2017, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n\nqueue-microtask/index.js:\n  (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\nrun-parallel/index.js:\n  (*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\ngit-url-parse/lib/index.js:\n  (*!\n   * buildToken\n   * Builds OAuth token prefix (helper function)\n   *\n   * @name buildToken\n   * @function\n   * @param {GitUrl} obj The parsed Git url object.\n   * @return {String} token prefix\n   *)\n\nobject-assign/index.js:\n  (*\n  object-assign\n  (c) Sindre Sorhus\n  @license MIT\n  *)\n\nreact/cjs/react.production.min.js:\n  (** @license React v17.0.2\n   * react.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nscheduler/cjs/scheduler.production.min.js:\n  (** @license React v0.20.2\n   * scheduler.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nreact-reconciler/cjs/react-reconciler.production.min.js:\n  (** @license React v0.26.2\n   * react-reconciler.production.min.js\n   *\n   * Copyright (c) Facebook, Inc. and its affiliates.\n   *\n   * This source code is licensed under the MIT license found in the\n   * LICENSE file in the root directory of this source tree.\n   *)\n\nis-windows/index.js:\n  (*!\n   * is-windows <https://github.com/jonschlinkert/is-windows>\n   *\n   * Copyright © 2015-2018, Jon Schlinkert.\n   * Released under the MIT License.\n   *)\n*/\n"
  },
  {
    "path": ".yarnrc.yml",
    "content": "nodeLinker: node-modules\n\nyarnPath: .yarn/releases/yarn-4.10.3.cjs\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Smithy Typescript Codegen Changelog\n\n[Commit logs](https://github.com/smithy-lang/smithy-typescript/commits/main/smithy-typescript-codegen)\n\n## 0.49.1 (2026-04-30)\n\n### Bug Fixes\n\n- Fixed compression edge case in Endpoint BDD generation ([#1989](https://github.com/smithy-lang/smithy-typescript/pull/1989))\n\n## 0.49.0 (2026-04-28)\n\n### Features\n\n- Endpoint logic is now generated as a compact binary decision diagram ([#1948](https://github.com/smithy-lang/smithy-typescript/pull/1948))\n- Waiters are generated with typed final result values ([#1852](https://github.com/smithy-lang/smithy-typescript/pull/1852))\n\n## 0.48.0 (2026-04-08)\n\n### Features\n\n- Generated nullable types for sparse collections ([#1943](https://github.com/smithy-lang/smithy-typescript/pull/1943))\n- Enabled type-only symbols in Schema mode ([#1938](https://github.com/smithy-lang/smithy-typescript/pull/1938))\n\n## 0.47.0 (2026-03-17)\n\n### Features\n\n- Added `versionScheme` option for automatic versioning of generated packages ([#1914](https://github.com/smithy-lang/smithy-typescript/pull/1914))\n- (experimental) Added option to generate request/response/error snapshots from service models ([#7788](https://github.com/aws/aws-sdk-js-v3/issues/7788))\n\n## 0.46.0 (2026-03-05)\n\n### Features\n\n- Upgraded smithy version to 1.68.0 ([#1902](https://github.com/smithy-lang/smithy-typescript/pull/1902))\n- Generated shape member tsdoc now includes deprecated-since when the `@deprecated` trait provides this information ([#1903](https://github.com/smithy-lang/smithy-typescript/pull/1903))\n\n### Bug Fixes\n\n- Downleveled types now cover TypeScript versions <4.5 ([#1906](https://github.com/smithy-lang/smithy-typescript/pull/1906))\n\n## 0.45.0 (2026-02-19)\n\n### Features\n\n- Upgraded smithy version to 1.67.0 ([#1868](https://github.com/smithy-lang/smithy-typescript/pull/1868))\n\n### Bug Fixes\n\n- Created composite type registry on protocol instances ([#1867](https://github.com/smithy-lang/smithy-typescript/pull/1867))\n\n## 0.44.0 (2026-02-06)\n\n### Chores\n\n- Synchronized version bump for 0.44.0 in smithy-typescript-aws-codegen.\n- Deprecated use of `@aws-sdk/types` in this codegen library (continues to be available in the AWS library) ([#1863](https://github.com/smithy-lang/smithy-typescript/pull/1863))\n\n\n## 0.43.1 (2026-01-30)\n\n### Bug Fixes\n\n- Fixed paginator capitalization issue when generating from a model with non-TitleCase operation shapes ([#1860](https://github.com/smithy-lang/smithy-typescript/pull/1860))\n\n## 0.43.0 (2026-01-28)\n\n### Features\n\n- Generated workspace clean commands replaced `rimraf` with `premove` ([#1834](https://github.com/smithy-lang/smithy-typescript/pull/1834))\n- Generated aggregate clients now contain paginators and waiters ([#1853](https://github.com/smithy-lang/smithy-typescript/pull/1853))\n\n### Chores\n\n- Updated to smithy v1.66.0 ([#1850](https://github.com/smithy-lang/smithy-typescript/pull/1850))\n\n## 0.42.0 (2026-01-15)\n\n### Features\n\n- Updated schema codegen to include required member information for optional use by `@smithy/typecheck` ([#1835](https://github.com/smithy-lang/smithy-typescript/pull/1835))\n\n### Chores\n\n- Set the minimum required Node.js version to v20 for generated clients ([#1837](https://github.com/smithy-lang/smithy-typescript/pull/1837))\n\n## 0.41.1 (2026-01-08)\n\n### Bug Fixes\n\n- Fixed deserialization bug in CBOR BigDecimal values ([#1830](https://github.com/smithy-lang/smithy-typescript/pull/1830))\n\n### Chores\n\n- Upgraded generated clients to use rimraf v5 ([#1829](https://github.com/smithy-lang/smithy-typescript/pull/1829))\n\n## 0.41.0 (2026-01-02)\n\n### Features\n\n- Changed default serialization/deserialization for clients to schema-based ([#1600](https://github.com/smithy-lang/smithy-typescript/issues/1600))\n\n### Bug Fixes\n\n- Fixed const/let generation in waiters ([#1826](https://github.com/smithy-lang/smithy-typescript/pull/1826))\n\n## 0.40.0 (2025-12-22)\n\n### Features\n\n- Upgraded smithy version to 1.65.0 ([#1819](https://github.com/smithy-lang/smithy-typescript/pull/1819))\n\n### Bug Fixes\n\n- Fixed TypeScript client codegen conflict between known config keys and clientContextParams ([#1788](https://github.com/smithy-lang/smithy-typescript/pull/1788))\n- Exported star from models_N ([#1817](https://github.com/smithy-lang/smithy-typescript/pull/1817))\n\n## 0.39.1 (2025-12-10)\n\n### Bug Fixes\n\n- Fixed an NPE related to auth schemes ([#1804](https://github.com/smithy-lang/smithy-typescript/pull/1804))\n\n## 0.39.0 (2025-12-05)\n\n### Features\n\n- Added type import API for TypeScriptWriter ([#1786](https://github.com/smithy-lang/smithy-typescript/pull/1786))\n- Added `generateIndexTests` setting for generation of optional API surface tests ([#1789](https://github.com/smithy-lang/smithy-typescript/pull/1789))\n- Generated well-formatted TypeScript source code ([#1780](https://github.com/smithy-lang/smithy-typescript/pull/1780))\n\n### Chores\n\n- Reduced `info` level logging output.\n  To restore previous logging output, use the `fine` logging level. ([#1796](https://github.com/smithy-lang/smithy-typescript/pull/1796))\n\n## 0.38.0 (2025-11-20)\n\n### Features\n\n- Upgraded to smithy version 1.64.0 ([#1784](https://github.com/smithy-lang/smithy-typescript/pull/1784))\n- Divided codegen models folder into enums, errors, and other interfaces ([#1770](https://github.com/smithy-lang/smithy-typescript/pull/1770))\n\n## 0.37.0 (2025-11-04)\n\n### Features\n\n- Upgraded smithy version to 1.63.0 ([#1761](https://github.com/smithy-lang/smithy-typescript/pull/1761))\n\n### Bug Fixes\n\n- Added default description for deprecatedTrait ([#1541](https://github.com/smithy-lang/smithy-typescript/pull/1541))\n\n## 0.36.1 (2025-10-06)\n\n### Features\n\n- Added 'pnpm' to 'PackageManager' ([#1658](https://github.com/smithy-lang/smithy-typescript/pull/1658))\n\n### Bug Fixes\n\n- Fixed CBOR eventstream codegen ([#1731](https://github.com/smithy-lang/smithy-typescript/pull/1731))\n\n## 0.36.0 (2025-09-30)\n\n### Features\n\n- Upgraded smithy version to 1.62.0 ([#1714](https://github.com/smithy-lang/smithy-typescript/pull/1714))\n- Replaced 'uuid' with '@smithy/uuid' ([#1706](https://github.com/smithy-lang/smithy-typescript/pull/1706))\n\n## 0.35.0 (2025-09-18)\n\n### Features\n\n- `Command` class examples now generate with a reference to the `Client` constructor input type ([#1690](https://github.com/smithy-lang/smithy-typescript/pull/1690))\n\n### Bug Fixes\n\n- Fixed header type codegen for event streams ([#1694](https://github.com/smithy-lang/smithy-typescript/pull/1694))\n\n## 0.34.1 (2025-09-10)\n\n### Bug Fixes\n\n- Fixed event stream serialization when the `@eventStreamPayload` member is a string ([#1674](https://github.com/smithy-lang/smithy-typescript/pull/1674))\n\n## 0.34.0 (2025-07-30)\n\n### Features\n\n- Upgraded smithy version to 1.61.0 ([#1640](https://github.com/smithy-lang/smithy-typescript/pull/1640))\n\n## 0.33.0 (2025-07-10)\n\n### Features\n\n- Upgraded smithy version to 1.60.3 ([#1640](https://github.com/smithy-lang/smithy-typescript/pull/1640))\n- Upgraded fast-xml-parser to 5.2.5 ([#1641](https://github.com/smithy-lang/smithy-typescript/pull/1641))\n\n### Bug Fixes\n\n- Avoided using model.getServiceShapes() for endpoint generation ([#1642](https://github.com/smithy-lang/smithy-typescript/pull/1642))\n\n## 0.32.0 (2025-06-26)\n\n### Features\n\n- BigIntger and BigDecimal numeric support for Smithy RPCv2 CBOR protocol ([#1603](https://github.com/smithy-lang/smithy-typescript/pull/1603))\n\n## 0.31.1 (2025-06-23)\n\n### Bug Fixes\n\n- use undefined placeholder for unhandled trait ([#1629](https://github.com/smithy-lang/smithy-typescript/pull/1629))\n- Added EndpointRequired config resolver to replace CustomEndpoint ([#1628](https://github.com/smithy-lang/smithy-typescript/pull/1628))\n- Corrected criteria for event stream member detection ([#1624](https://github.com/smithy-lang/smithy-typescript/pull/1624))\n- Located event stream member more carefully ([#1623](https://github.com/smithy-lang/smithy-typescript/pull/1623))\n\n### Chores\n\n- Omitting the endpoint polymorphs from resolved config types ([#1626](https://github.com/smithy-lang/smithy-typescript/pull/1626))\n- Allowed protocol generators to declare error aliases ([#1622](https://github.com/smithy-lang/smithy-typescript/pull/1622))\n- Allowed endpoint params to be explicitly undefined if not required ([#1618](https://github.com/smithy-lang/smithy-typescript/pull/1618))\n\n## 0.31.0 (2025-06-09)\n\n## Features\n\n- Upgraded smithy version to 1.58.0 ([#1616](https://github.com/smithy-lang/smithy-typescript/pull/1616))\n- Added schema code generation and related allow-list ([#1599](https://github.com/smithy-lang/smithy-typescript/pull/1599))\n\n### Chores\n\n- Updated synthetic error namespace ([#1611](https://github.com/smithy-lang/smithy-typescript/pull/1611))\n- Generated default endpoint ruleset to make code generation consistent for ruleset trait ([#1589](https://github.com/smithy-lang/smithy-typescript/pull/1589))\n\n## 0.30.0 (2025-05-08)\n\n### Features\n\n- Upgraded smithy version to 1.57.1 ([#1576](https://github.com/smithy-lang/smithy-typescript/pull/1576))\n- Added authSchemePreference client config ([#1567](https://github.com/smithy-lang/smithy-typescript/pull/1567))\n- Improved generated protocol test assertion messages ([#1572](https://github.com/smithy-lang/smithy-typescript/pull/1572))\n\n### Bug Fixes\n\n- Allowed overwriting a protocol's priority during protocol selection ([#1585](https://github.com/smithy-lang/smithy-typescript/pull/1585))\n\n## 0.29.1 (2025-04-24)\n\n### Chores\n\n- Bumped version to match release of smithy-aws-typescript-codegen\n\n## 0.29.0 (2025-04-11)\n\n### Features\n\n- Upgraded smithy version to 1.55.0 ([#1560](https://github.com/smithy-lang/smithy-typescript/pull/1560))\n\n### Bug Fixes\n\n- Fixed bug with JMESPath flatten level codegen ([#1559](https://github.com/smithy-lang/smithy-typescript/pull/1559))\n\n## 0.28.0 (2025-04-01)\n\n### Bug Fixes\n\n- Used backticks for example strings containing doublequotes ([#1556](https://github.com/smithy-lang/smithy-typescript/pull/1556))\n- Generated client.initConfig reference for tracking config object custody ([#1550](https://github.com/smithy-lang/smithy-typescript/pull/1550))\n- Used generic type for client config ([#1549](https://github.com/smithy-lang/smithy-typescript/pull/1549))\n- Allowed authscheme resolver to access client ref ([#1548](https://github.com/smithy-lang/smithy-typescript/pull/1548))\n\n### Documentation\n\n- Added doc examples to operations ([#1078](https://github.com/smithy-lang/smithy-typescript/pull/1078))\n- Replaced GitHub org from 'awslabs' to 'smithy-lang' ([#1545](https://github.com/smithy-lang/smithy-typescript/pull/1545))\n\n## 0.27.0 (2025-03-04)\n\n### Features\n\n- Support MultiSelect List in OperationContextParams ([#1536](https://github.com/smithy-lang/smithy-typescript/pull/1536))\n- Support MultiSelect Flatten in OperationContextParams ([#1537](https://github.com/smithy-lang/smithy-typescript/pull/1537))\n- Upgrade smithy version to 1.53.0 ([#1538](https://github.com/smithy-lang/smithy-typescript/pull/1538))\n- Upgrade smithy version to 1.54.0 ([#1540](https://github.com/smithy-lang/smithy-typescript/pull/1540))\n\n### Bug Fixes\n\n- Fixed union member serialization in CBOR ([#1526](https://github.com/smithy-lang/smithy-typescript/pull/1526))\n- Fixed allocation of strings starting with underscore and other cases ([#1527](https://github.com/smithy-lang/smithy-typescript/pull/1527))\n\n### Documentation\n\n- Moved description block before deprecated tag ([#1516](https://github.com/smithy-lang/smithy-typescript/pull/1516))\n\n## 0.26.0 (2025-01-22)\n\n### Features\n\n- Dropped support for Node.js 16 ([#1487](https://github.com/smithy-lang/smithy-typescript/pull/1487))\n- Upgraded smithyGradleVersion to 1.2.0 ([#1499](https://github.com/smithy-lang/smithy-typescript/pull/1499))\n- Passed client configuration to loadNodeConfig calls ([#1471](https://github.com/smithy-lang/smithy-typescript/pull/1471))\n- Removed String extension in LazyJsonString ([#1468](https://github.com/smithy-lang/smithy-typescript/pull/1468))\n- Upgraded vitest to 2.1.8 ([#1496](https://github.com/smithy-lang/smithy-typescript/pull/1496))\n\n### Bug Fixes\n\n- Fixed code generation issue for operationContextParam ([#1475](https://github.com/smithy-lang/smithy-typescript/pull/1475))\n- Resolved obj and array JS literals from JMESPath types for waiters ([#1462](https://github.com/smithy-lang/smithy-typescript/pull/1462))\n\n## 0.25.0 (2024-11-18)\n\n### Features\n\n- Upgraded smithyVersion to 1.52.0 ([#1434](https://github.com/smithy-lang/smithy-typescript/pull/1434))\n- Added default accepts=application/cbor header for Smithy RPC v2 CBOR protocol ([#1427](https://github.com/smithy-lang/smithy-typescript/pull/1427))\n- Added `| undefined` for optional type properties to support `exactOptionalPropertyTypes` ([#1448](https://github.com/smithy-lang/smithy-typescript/pull/1448))\n\n### Bug Fixes\n\n- Added uuid types import when adding uuid import ([#1428](https://github.com/smithy-lang/smithy-typescript/pull/1428))\n\n## 0.24.0 (2024-09-30)\n\n### Features\n\n- Use spread operator for Command endpoint params only when necessary ([#1396](https://github.com/smithy-lang/smithy-typescript/pull/1396))\n- Improve IDE type navigation assistance for command classes ([#1373](https://github.com/smithy-lang/smithy-typescript/pull/1373))\n\n### Bug Fixes\n\n- Allow empty string field values for headers ([#1412](https://github.com/smithy-lang/smithy-typescript/pull/1412))\n\n## 0.23.0 (2024-09-09)\n\n### Features\n\n- codegen: Added Smithy RPCv2 CBOR protocol generator ([#1280](https://github.com/smithy-lang/smithy-typescript/pull/1280))\n\n- codegen: Added support for string array parameters in endpoints ([#1376](https://github.com/smithy-lang/smithy-typescript/pull/1376))\n\n- codegen: Added support for operation context params in endpoints ([#1379](https://github.com/smithy-lang/smithy-typescript/pull/1379))\n\n### Bug Fixes\n\n- Added logic to resolve the service specific endpoint once per client instance instead of for each request ([#1382](https://github.com/smithy-lang/smithy-typescript/pull/1382))\n\n- Fixed a bug that prevented a concrete client type (e.g., `S3Client`) to be converted to a `NodeJsClient` ([#1389](https://github.com/smithy-lang/smithy-typescript/pull/1389))\n\n### Documentation\n\n## 0.22.0 (2024-08-06)\n\n### Features\n\n- codegen: Enabled the new identity and auth behavior by default and add a legacy auth mode ([#1352](https://github.com/smithy-lang/smithy-typescript/pull/1352))\n\n- codegen: Added logic to skip the application of the `CustomEndpoints` plugin for models using Endpoints-2.0 ([#1337](https://github.com/smithy-lang/smithy-typescript/pull/1337))\n\n- codegen: Added automatic default idempotency tokens in headers for requests when a token is not explicitly provided ([#1327](https://github.com/smithy-lang/smithy-typescript/pull/1327))\n\n- codegen: Added a set of built-in integration plugins to code-generator ([#1321](https://github.com/smithy-lang/smithy-typescript/pull/1321))\n\n### Bug Fixes\n\n- codegen: Fixed inconsistent ordering issue when writing client params during code-generation ([#1355](https://github.com/smithy-lang/smithy-typescript/pull/1355))\n\n- codegen: Fixed incorrect usage of string templates when generating commands ([#1354](https://github.com/smithy-lang/smithy-typescript/pull/1354))\n\n- codegen: Fixed serialization of `:event-type` in event-streams where the member target-id was being used instead of the member name ([#1349](https://github.com/smithy-lang/smithy-typescript/pull/1349))\n\n- codegen: Fixed issue where content-type was being set when input body was empty ([#1304](https://github.com/smithy-lang/smithy-typescript/pull/1304))\n\n## 0.21.1 (2024-06-05)\n\n### Features\n\n- Added logging for `CredentialsProviderError` ([#1290](https://github.com/smithy-lang/smithy-typescript/pull/1290))\n\n### Bug Fixes\n\n- Fixed issues with serializing millisecond precision timestamps for certain formats ([#1289](https://github.com/smithy-lang/smithy-typescript/pull/1289),\n  [#1295](https://github.com/smithy-lang/smithy-typescript/pull/1295))\n- Fixed issue where `export` was used instead of the clearer `export type` ([#1284](https://github.com/smithy-lang/smithy-typescript/pull/1284))\n\n## 0.21.0 (2024-05-22)\n\n### Breaking Changes\n\n- Update Engines to Node.js 16, Node.js 14 is not officialy supported anymore ([#1258](https://github.com/smithy-lang/smithy-typescript/pull/1258))\n\n### Features\n\n- Bumped TypeScript to ~5.2.x in smithy JS packages ([#1275](https://github.com/smithy-lang/smithy-typescript/pull/1275))\n- `@smithy/fetch-http-handler`, `@smithy/node-http-handler`: Improveed stream collection performance ([#1272](https://github.com/smithy-lang/smithy-typescript/pull/1272))\n- Improved support for fetch and web-streams in Node.js ([#1256](https://github.com/smithy-lang/smithy-typescript/pull/1256))\n- `@smithy/node-http-handler`, `\"@smithy/util-stream`: Handle web streams in streamCollector and sdkStreamMixin\n- Added service client doc generator only when typedoc is selected ([#1253](https://github.com/smithy-lang/smithy-typescript/pull/1253))\n\n### Bug Fixes\n\n- `@smithy/types`: Fixed type transforms account for no-args operation methods ([#1262](https://github.com/smithy-lang/smithy-typescript/pull/1262))\n- Check dependencies when adding imports ([#1239](https://github.com/smithy-lang/smithy-typescript/pull/1239))\n- Fixed typo in `HttpResponse` docs ([#958](https://github.com/smithy-lang/smithy-typescript/pull/958))\n- Fixed URI escape path ([#1224](https://github.com/smithy-lang/smithy-typescript/pull/1224)) ([#1226](https://github.com/smithy-lang/smithy-typescript/pull/1226))\n\n## 0.20.1 (2024-04-05)\n\n### Features\n\n- Updated SigV4 with its own header formatter to avoid import of entire eventstream-codec package ([#1233](https://github.com/smithy-lang/smithy-typescript/pull/1233))\n- Updated Smithy Version to 1.47.0 ([#1225](https://github.com/smithy-lang/smithy-typescript/pull/1225))\n\n### Bug Fixes\n\n- Fix middleware-endpoint to check for s3 arn parts ([#1227](https://github.com/smithy-lang/smithy-typescript/pull/1227))\n\n## 0.20.0 (2024-03-21)\n\n### Features\n\n- codegen: Identity and Auth, support for the `@auth` Smithy trait. See https://smithy.io/2.0/spec/authentication-traits.html#auth-trait.\n- codegen: Support request compression ([#1129](https://github.com/smithy-lang/smithy-typescript/pull/1129))\n- codegen: Allow commands to be constructed without arg if all arg fields optional ([#1206](https://github.com/smithy-lang/smithy-typescript/pull/1206))\n- codegen: Generate unified error dispatcher ([#1150](https://github.com/smithy-lang/smithy-typescript/pull/1150))\n- codegen: Generate Commands using Command classBuilder ([#1118](https://github.com/smithy-lang/smithy-typescript/pull/1118))\n- codegen: Paginator factory ([#1115](https://github.com/smithy-lang/smithy-typescript/pull/1115))\n- codegen: Generate paginators using a factory ([#1114](https://github.com/smithy-lang/smithy-typescript/pull/1114))\n- codegen: XML serde reduction ([#1108](https://github.com/smithy-lang/smithy-typescript/pull/1108))\n- codegen: Add requestBuilder, generate requests using a builder pattern ([#1107](https://github.com/smithy-lang/smithy-typescript/pull/1107))\n- codegen-docs: Add deprecation message in shape docs ([#1209](https://github.com/smithy-lang/smithy-typescript/pull/1209))\n- codegen-docs: Move documentation before release tag and deprecation ([#1211](https://github.com/smithy-lang/smithy-typescript/pull/1211))\n- codegen-docs: Move deprecation after description in docs ([#1212](https://github.com/smithy-lang/smithy-typescript/pull/1212))\n- codegen-docs: Add more information about BLOB values in structures ([#1182](https://github.com/smithy-lang/smithy-typescript/pull/1182))\n- `@smithy/types`: Assertive client type helper ([#1076](https://github.com/smithy-lang/smithy-typescript/pull/1076))\n- `@smithy/*`: `dist-cjs` artifacts are now generated as a bundle ([#1146](https://github.com/smithy-lang/smithy-typescript/pull/1146))\n- `@smithy/util-base64`: Encoders now accept strings ([#1176](https://github.com/smithy-lang/smithy-typescript/pull/1176))\n- `@smithy/node-http-handler`: Enable ctor arg passthrough for requestHandler ([#1167](https://github.com/smithy-lang/smithy-typescript/pull/1167))\n- `@smithy/node-http-handler`: Add checked socket exhaustion warning when throughput is slow ([#1164](https://github.com/smithy-lang/smithy-typescript/pull/1164))\n- `@smithy/node-http-handler`: Allow http(s).Agent ctor arg in lieu of instance ([#1165](https://github.com/smithy-lang/smithy-typescript/pull/1165))\n- `@smithy/node-http-handler`: Reduce buffer copies ([#867](https://github.com/smithy-lang/smithy-typescript/pull/867))\n\n### Bug Fixes\n\n- codegen: Empty the contents of the dependencyVersions.properties file when creating it ([#1213](https://github.com/smithy-lang/smithy-typescript/pull/1213))\n- codegen: Import \\_json function at call sites ([#1174](https://github.com/smithy-lang/smithy-typescript/pull/1174))\n- codegen: Model bucketing edge case with resource shape ([#1123](https://github.com/smithy-lang/smithy-typescript/pull/1123))\n- codegen: Use `TopDownIndex::getContainedOperations()` for operation iterations ([#1109](https://github.com/smithy-lang/smithy-typescript/pull/1109))\n- codegen: Accommodate services with the world Client in their names ([#1102](https://github.com/smithy-lang/smithy-typescript/pull/1102))\n- `@smithy/middleware-retry`: Retry after clock skew correction ([#1170](https://github.com/smithy-lang/smithy-typescript/pull/1170))\n- `@smithy/middleware-retry`: Warn streaming requests are not retryable ([#1092](https://github.com/smithy-lang/smithy-typescript/pull/1092))\n- `@smithy/core`: Handle multi-part token paths in paginator ([#1160](https://github.com/smithy-lang/smithy-typescript/pull/1160))\n- `@smithy/util-utf8`: Use Node.js implementations in react-native ([#1070](https://github.com/smithy-lang/smithy-typescript/pull/1070))\n- `@smithy/smithy-client`: Apply filtering when walking json arrays ([#1086](https://github.com/smithy-lang/smithy-typescript/pull/1086))\n- `@smithy/util-body-length-browser`: Increase performance of body length calculation for larger payloads on browser ([#1088](https://github.com/smithy-lang/smithy-typescript/pull/1088))\n- `@smithy/middleware-serde`: Allow error deserializers to populate error response body ([#1180](https://github.com/smithy-lang/smithy-typescript/pull/1180))\n- `@smithy/shared-ini-file-loader`: Process sso-session names with config prefix separator ([#1173](https://github.com/smithy-lang/smithy-typescript/pull/1173))\n- `@smithy/shared-ini-file-loader`: Process config files for profile names containing prefix separator ([#1100](https://github.com/smithy-lang/smithy-typescript/pull/1100))\n- `@smithy/shared-ini-file-loader`: Allow dot, solidus, percent and colon characters in profile names ([#1067](https://github.com/smithy-lang/smithy-typescript/pull/1067))\n\n### Documentation\n\n- Add readme content for signature-v4 ([#1087](https://github.com/smithy-lang/smithy-typescript/pull/1087))\n- Sigv4 README.md brackets ([#1103](https://github.com/smithy-lang/smithy-typescript/pull/1103))\n- Fix README `smithy-build.json` examples ([#1082](https://github.com/smithy-lang/smithy-typescript/pull/1082))\n\n## 0.19.0 (2023-11-02)\n\n### Features\n\n- Updated codegen plugins to match idiomatic plugin names([#1057](https://github.com/awslabs/smithy-typescript/pull/1057))\n- Added flag for blocking imds v1 fallback behavior ([#1059](https://github.com/awslabs/smithy-typescript/pull/1059))\n- Upgraded@babel/traverse from 7.21.2 to 7.23.2 ([#1041](https://github.com/awslabs/smithy-typescript/pull/1041))\n- Upgraded browserify-sign from 4.2.1 to 4.2.2 ([#1058](https://github.com/awslabs/smithy-typescript/pull/1058))\n- Updated to use migrated `util-endpoints` ([#1044](https://github.com/awslabs/smithy-typescript/pull/1044))\n- Re-exported existing endpoint types ([#1055](https://github.com/awslabs/smithy-typescript/pull/1055))\n- Added util-endpoints package ([#1043](https://github.com/awslabs/smithy-typescript/pull/1043))\n- Allow TypeScriptIntegration to write prior to the config object literal ([#1054](https://github.com/awslabs/smithy-typescript/pull/1054))\n- Updated to transform inputs for platform specific type helpers ([#1046](https://github.com/awslabs/smithy-typescript/pull/1046))\n- Made `unionShape` deserializer overridable ([#1040](https://github.com/awslabs/smithy-typescript/pull/1040), [#1045](https://github.com/awslabs/smithy-typescript/pull/1045))\n- Update to generate enum Record keys when target is enum ([#1037](https://github.com/awslabs/smithy-typescript/pull/1037))\n- Removed \"| string\" and \"| number\" from enum targeted members ([#1028](https://github.com/awslabs/smithy-typescript/pull/1003))\n- Added `-p` for `mkdir` in `build-generated-test-packages` ([#1010](https://github.com/awslabs/smithy-typescript/pull/1003))\n- Added logging for `buildAndCopyToNodeModules()` ([#1003](https://github.com/awslabs/smithy-typescript/pull/1003))\n- Reorganized models in `smithy-typescript-codegen-test` ([#995](https://github.com/awslabs/smithy-typescript/pull/995))\n- Updated to export empty model index if no `model_*` files exist ([#996](https://github.com/awslabs/smithy-typescript/pull/996))\n- Read service specific endpoints for environment or config ([#1014](https://github.com/awslabs/smithy-typescript/pull/1014))\n- Updated to populate `sso-session` and services sections when loading config files ([#993](https://github.com/awslabs/smithy-typescript/pull/993))\n- Added export `CONFIG_PREFIX_SEPARATOR` from `loadSharedConfigFiles` ([#992](https://github.com/awslabs/smithy-typescript/pull/992))\n- Updated to pass configuration file as second parameter to `configSelector` ([#990](https://github.com/awslabs/smithy-typescript/pull/990))\n- Updated to populate subsection using dot separator in section key when parsing INI files ([#989](https://github.com/awslabs/smithy-typescript/pull/989))\n- Added support for reading values from main section when parsing INI files ([#986](https://github.com/awslabs/smithy-typescript/pull/986))\n\n### Bug Fixes\n\n- Exported `RuntimeExtension` and Client `ExtensionConfiguration` interfaces ([#1057](https://github.com/awslabs/smithy-typescript/pull/1057))\n- Removed `TARGET_NAMESPACE` from `TypeScriptSettings` ([#1057](https://github.com/awslabs/smithy-typescript/pull/1057))\n- Updated Server Codegen to generate without a protocol ([#1057](https://github.com/awslabs/smithy-typescript/pull/1057))\n- Updated to use partial record for enum keyed types ([#1049](https://github.com/awslabs/smithy-typescript/pull/1049))\n- Allowed lowercase type names for endpoint parameters ([#1050](https://github.com/awslabs/smithy-typescript/pull/1050))\n- Added parsing for profile name with invalid '+' character ([#1047](https://github.com/awslabs/smithy-typescript/pull/1047))\n- Added missing map shape reference ([#1038](https://github.com/awslabs/smithy-typescript/pull/1038))\n- Adds parsing for profile name with invalid '@' character ([#1036](https://github.com/awslabs/smithy-typescript/pull/1036))\n- Treat absence of prefix whitespace as section keys when reading ini files ([#1029](https://github.com/awslabs/smithy-typescript/pull/1029))\n- Added missing dependency of `@smithy/shared-ini-file-loader` ([#1027](https://github.com/awslabs/smithy-typescript/pull/1027))\n- Fixed operation index file codegen ([#1025](https://github.com/awslabs/smithy-typescript/pull/1025))\n- Removed extra `$` from `HttpApiKeyAuthSigner` ([#1006](https://github.com/awslabs/smithy-typescript/pull/1006))\n- Added await to `signer.sign()` in `httpSigningMiddleware` ([#1005](https://github.com/awslabs/smithy-typescript/pull/1005))\n- Fixed `@httpApiKeyAuth` scheme property ([#1001](https://github.com/awslabs/smithy-typescript/pull/1001))\n- Fixed `HttpAuthSchemeParameters` codegen ([#998](https://github.com/awslabs/smithy-typescript/pull/998))\n- Fixed `resolveHttpAuthSchemeConfig` imports ([#997](https://github.com/awslabs/smithy-typescript/pull/997))\n- Updated default `keepalive=false` for fetch ([#1016](https://github.com/awslabs/smithy-typescript/pull/1016))\n\n## 0.18.0 (2023-10-04)\n\n### Features\n\n- Add SSDK codegen test ([#825](https://github.com/awslabs/smithy-typescript/pull/825))\n- Add test script when specs are generated ([#821](https://github.com/awslabs/smithy-typescript/pull/821))\n- Move vitest config to js ([#833](https://github.com/awslabs/smithy-typescript/pull/833))\n- Add PackageContainer interface ([#837](https://github.com/awslabs/smithy-typescript/pull/837))\n- Add codegen for improved streaming payload types ([#840](https://github.com/awslabs/smithy-typescript/pull/840))\n- Set public release tags on client config interface components ([#850](https://github.com/awslabs/smithy-typescript/pull/850))\n- Check for Optional Configuration in client constructor ([#859](https://github.com/awslabs/smithy-typescript/pull/859))\n- Add matchSettings() to RuntimeClientPlugins ([#856](https://github.com/awslabs/smithy-typescript/pull/856))\n- Add experimentalIdentityAndAuth flag ([#857](https://github.com/awslabs/smithy-typescript/pull/857))\n- Add extensions to client runtime config ([#852](https://github.com/awslabs/smithy-typescript/pull/852))\n- Use ASCII replacement for character 0xE2 ([#866](https://github.com/awslabs/smithy-typescript/pull/866))\n- Add more auth traits to generic client tests ([#882](https://github.com/awslabs/smithy-typescript/pull/882))\n- Rename defaultClientConfiguration to defaultExtensionConfiguration ([#888](https://github.com/awslabs/smithy-typescript/pull/888))\n- Update codegen to use defaultExtensionConfiguration ([#889](https://github.com/awslabs/smithy-typescript/pull/889))\n- Add matchSettings() to TypeScriptIntegration and TypeScriptCodegenPlugin ([#901](https://github.com/awslabs/smithy-typescript/pull/901))\n- Add codegen and TS integration points for config ([#881](https://github.com/awslabs/smithy-typescript/pull/881))\n- Add generic @httpApiKeyAuth support ([#883](https://github.com/awslabs/smithy-typescript/pull/883))\n- Add generic @httpBearerAuth support ([#884](https://github.com/awslabs/smithy-typescript/pull/884))\n- Add generic @aws.auth#sigv4 support ([#885](https://github.com/awslabs/smithy-typescript/pull/885))\n- Update HttpAuthOption and HttpAuthScheme codegen ([#907](https://github.com/awslabs/smithy-typescript/pull/907))\n- Update ExtensionConfigurations to generate for clients only ([#911](https://github.com/awslabs/smithy-typescript/pull/911))\n- Add codegen for http component in runtime extension ([#913](https://github.com/awslabs/smithy-typescript/pull/913))\n- Add codegen for HttpAuthExtensionConfiguration ([#910](https://github.com/awslabs/smithy-typescript/pull/910))\n- Add HttpAuthScheme interfaces for auth scheme resolution ([#928](https://github.com/awslabs/smithy-typescript/pull/928))\n- Add service and operation names to HandlerExecutionContext ([#934](https://github.com/awslabs/smithy-typescript/pull/934))\n- Add httpSigningMiddleware to authorize and sign requests ([#930](https://github.com/awslabs/smithy-typescript/pull/930))\n- Make writeDocs() with Runnable public ([#939](https://github.com/awslabs/smithy-typescript/pull/939))\n- Refactor HttpAuthScheme properties to builders ([#941](https://github.com/awslabs/smithy-typescript/pull/941))\n- Reorganize http auth module constants ([#942](https://github.com/awslabs/smithy-typescript/pull/942))\n- Rename to generateDefaultHttpAuthSchemeProviderFunction() ([#946](https://github.com/awslabs/smithy-typescript/pull/946))\n- Add traitId to HttpAuthScheme ([#947](https://github.com/awslabs/smithy-typescript/pull/947))\n- Add customizing default httpAuthSchemeProvider and httpAuthSchemeParametersProvider ([#943](https://github.com/awslabs/smithy-typescript/pull/943))\n- Add partial support for aws.auth#sigv4a ([#950](https://github.com/awslabs/smithy-typescript/pull/950))\n- Update @smithy.rules#endpointRuleSet codegen ([#945](https://github.com/awslabs/smithy-typescript/pull/945))\n- Add collect\\*() methods to dedupe ConfigFields and HttpAuthSchemeParameter ([#948](https://github.com/awslabs/smithy-typescript/pull/948))\n- Add httpAuthSchemeMiddleware to select an auth scheme ([#929](https://github.com/awslabs/smithy-typescript/pull/929))\n- Add SmithyContextCodeSection to CommandGenerator ([#957](https://github.com/awslabs/smithy-typescript/pull/957))\n- Add link for retryModes input enum ([#962](https://github.com/awslabs/smithy-typescript/pull/962))\n- Add aliases for httpSigningMiddleware ([#970](https://github.com/awslabs/smithy-typescript/pull/970))\n- Update endpoint rules engine tests ([#976](https://github.com/awslabs/smithy-typescript/pull/976))\n- Upgrade to Smithy 1.39.0 ([#976](https://github.com/awslabs/smithy-typescript/pull/976))\n\n### Bug fixes\n\n- Fix types import ([#831](https://github.com/awslabs/smithy-typescript/pull/831))\n- Allow lowercase endpoint param ([#923](https://github.com/awslabs/smithy-typescript/pull/923))\n- Generate jsdocs for operations with no documentation ([#971](https://github.com/awslabs/smithy-typescript/pull/971))\n- Fix missing release tag on shape members ([#854](https://github.com/awslabs/smithy-typescript/pull/854))\n\n## 0.17.1 (2023-07-07)\n\n### Bug fixes\n\n- Fixed @smithy/protocol-http import in HttpApiKeyAuth spec ([#817](https://github.com/awslabs/smithy-typescript/pull/817))\n\n## 0.17.0 (2023-07-06)\n\n### Features\n\n- Upgraded to Smithy 1.33.0 ([#808](https://github.com/awslabs/smithy-typescript/pull/808))\n- Updated enum validator to not remove \"internal\" tagged members ([#807](https://github.com/awslabs/smithy-typescript/pull/807))\n\n### Bug fixes\n\n- Fixed @aws-smithy/server-common version ([#806](https://github.com/awslabs/smithy-typescript/pull/806))\n\n## 0.16.0 (2023-06-30)\n\n### Features\n\n- Updated code generator to use @smithy scoped npm packages ([#791](https://github.com/awslabs/smithy-typescript/pull/791), [#766](https://github.com/awslabs/smithy-typescript/pull/766))\n- Improved blob payload input and output types ([#777](https://github.com/awslabs/smithy-typescript/pull/777))\n- Added packageDocumentation and improved interface inheritance ([#770](https://github.com/awslabs/smithy-typescript/pull/770))\n- Updated code generator to use runtime-agnostic util-stream package ([#775](https://github.com/awslabs/smithy-typescript/pull/775))\n\n### Bug fixes\n\n- Fixed endpoint parameter name conflict ([#772](https://github.com/awslabs/smithy-typescript/pull/772))\n- Stopped trimming collection query param output values ([#764](https://github.com/awslabs/smithy-typescript/pull/764))\n\n## 0.15.0 (2023-05-10)\n\n### Features\n\n- Add Gradle composite build ([#761](https://github.com/awslabs/smithy-typescript/pull/761))\n- Improve generated command documentation ([#757](https://github.com/awslabs/smithy-typescript/pull/757))\n- Bump SSDK libs version to 1.0.0-alpha.10 ([#738](https://github.com/awslabs/smithy-typescript/pull/738))\n- Use aggregated client runtime generator ([#736](https://github.com/awslabs/smithy-typescript/pull/736))\n- Add SerdeElision KnowledgeIndex and serde helper function ([#735](https://github.com/awslabs/smithy-typescript/pull/735), [#759](https://github.com/awslabs/smithy-typescript/pull/759))\n- Shorten internal serde function names ([#730](https://github.com/awslabs/smithy-typescript/pull/730))\n- Reduce generated HTTP request header code ([#729](https://github.com/awslabs/smithy-typescript/pull/729))\n- Improve documentation truncation ([#728](https://github.com/awslabs/smithy-typescript/pull/728))\n- Export `enum` as `const` to reduce generated code ([#726](https://github.com/awslabs/smithy-typescript/pull/726))\n- Add structural hint to commmand examples ([#723](https://github.com/awslabs/smithy-typescript/pull/723))\n- Skip generating unused sensitive filter functions ([#722](https://github.com/awslabs/smithy-typescript/pull/722))\n- Add DefaultReadmeGenerator ([#721](https://github.com/awslabs/smithy-typescript/pull/721))\n- Add TSDocs release tags ([#719](https://github.com/awslabs/smithy-typescript/pull/719))\n- Add thrown exceptions to generated command documentation ([#715](https://github.com/awslabs/smithy-typescript/pull/715))\n- Remove internal enum values from validation message ([#713](https://github.com/awslabs/smithy-typescript/pull/713))\n- Omit aggregated client from paginators ([#712](https://github.com/awslabs/smithy-typescript/pull/712))\n- Add NodeJS runtime support to SSDK ([#703](https://github.com/awslabs/smithy-typescript/pull/703))\n- Remove reflected values from validation message ([#695](https://github.com/awslabs/smithy-typescript/pull/695))\n- Add AddClientRuntimeConfig for generic clients ([#693](https://github.com/awslabs/smithy-typescript/pull/693))\n\n### Bug Fixes\n\n- Fix creating empty model files when chunking ([#714](https://github.com/awslabs/smithy-typescript/pull/714))\n\n## 0.14.0 (2023-02-09)\n\n### Features\n\n- Upgrade TypeScript `lib` to use `es2018` for SSDK libs ([#678](https://github.com/awslabs/smithy-typescript/pull/678))\n- Bump SSDK libs version to 1.0.0-alpha.8 ([#689](https://github.com/awslabs/smithy-typescript/pull/689))\n- Add a code generator setting to generate `@required` members without `| undefined`. **WARNING**: Using this mode may lead to backwards incompatible impact for clients when a service removes `@required` from a member. ([#566](https://github.com/awslabs/smithy-typescript/pull/566), [#688](https://github.com/awslabs/smithy-typescript/pull/688))\n\n## 0.13.0 (2023-01-31)\n\n### Features\n\n- Upgrade tsconfig.es.json target to ES2020 ([#603](https://github.com/awslabs/smithy-typescript/pull/603))\n- Upgrade to Java 17 ([#621](https://github.com/awslabs/smithy-typescript/pull/621))\n- Upgrade to node >= 14.0.0 ([#623](https://github.com/awslabs/smithy-typescript/pull/623), [#625](https://github.com/awslabs/smithy-typescript/pull/625), [#628](https://github.com/awslabs/smithy-typescript/pull/628))\n- Upgrade to Smithy 1.27.2 ([#682](https://github.com/awslabs/smithy-typescript/pull/682))\n- Add mavenCentral as plugin repository ([#629](https://github.com/awslabs/smithy-typescript/pull/629))\n- Add intEnum generation with validation and tests ([#605](https://github.com/awslabs/smithy-typescript/pull/605), [#654](https://github.com/awslabs/smithy-typescript/pull/654))\n- Use util-base64 instead of platform-based dependencies ([#627](https://github.com/awslabs/smithy-typescript/pull/627), [#631](https://github.com/awslabs/smithy-typescript/pull/631))\n- Use util-base8 instead of platform-based dependencies ([#672](https://github.com/awslabs/smithy-typescript/pull/672), [#677](https://github.com/awslabs/smithy-typescript/pull/677))\n- Add util-retry dependency ([#650](https://github.com/awslabs/smithy-typescript/pull/650))\n- Replace Hash with Checksum ([#668](https://github.com/awslabs/smithy-typescript/pull/668))\n- Allow deferred resolution for api key config ([#588](https://github.com/awslabs/smithy-typescript/pull/588))\n- Stream improvement serde ([#593](https://github.com/awslabs/smithy-typescript/pull/593))\n- Support delegation of determining errors for an operation ([#598](https://github.com/awslabs/smithy-typescript/pull/598))\n- Reduce object copying in iterators ([#638](https://github.com/awslabs/smithy-typescript/pull/638))\n- Refactor writeAdditionalFiles and writeAdditionalExports logic into integration.customize() ([#607](https://github.com/awslabs/smithy-typescript/pull/607))\n- Expose static endpoint param instructions provider ([#590](https://github.com/awslabs/smithy-typescript/pull/590))\n- Add unit tests for endpoints v2 generator ([#674](https://github.com/awslabs/smithy-typescript/pull/674))\n- Use util-utf8 on server and tests ()\n- Bump ssdk lib version to 1.0.0-alpha.7([#675](https://github.com/awslabs/smithy-typescript/pull/675))\n- Clients parse datetime offsets ([#681](https://github.com/awslabs/smithy-typescript/pull/681))\n\n### Bug Fixes\n\n- Call parseErrorBody when parsing error structures ([#597](https://github.com/awslabs/smithy-typescript/pull/597))\n- Fix broken reference to `fail()` after jest-upgrade ([#645](https://github.com/awslabs/smithy-typescript/pull/645))\n- Validate required input query params ([#647](https://github.com/awslabs/smithy-typescript/pull/647), [#646](https://github.com/awslabs/smithy-typescript/pull/646))\n- Include x-amz-request-id in request id deser ([#606](https://github.com/awslabs/smithy-typescript/pull/606))\n- Add idempotencyToken generation if member is queryParam ([#655](https://github.com/awslabs/smithy-typescript/pull/655))\n- Fix Error printout for protocol-response tests ([#657](https://github.com/awslabs/smithy-typescript/pull/657))\n- Fix codegen for windows platforms ([#661](https://github.com/awslabs/smithy-typescript/pull/661))\n- Fix consistency with type aliases ([#670](https://github.com/awslabs/smithy-typescript/pull/670), [#671](https://github.com/awslabs/smithy-typescript/pull/671))\n- Fix misc endpoints 2.0 bugs ([#592](https://github.com/awslabs/smithy-typescript/pull/592), [#600](https://github.com/awslabs/smithy-typescript/pull/600), [#614](https://github.com/awslabs/smithy-typescript/pull/614), [#615](https://github.com/awslabs/smithy-typescript/pull/615), [#616](https://github.com/awslabs/smithy-typescript/pull/616), [#617](https://github.com/awslabs/smithy-typescript/pull/617), [#618](https://github.com/awslabs/smithy-typescript/pull/618), [#619](https://github.com/awslabs/smithy-typescript/pull/619), [#622](https://github.com/awslabs/smithy-typescript/pull/622), [#626](https://github.com/awslabs/smithy-typescript/pull/626), [#634](https://github.com/awslabs/smithy-typescript/pull/634), [#644](https://github.com/awslabs/smithy-typescript/pull/644), [#652](https://github.com/awslabs/smithy-typescript/pull/652), [#658](https://github.com/awslabs/smithy-typescript/pull/658))\n\n## 0.12.0 (2022-09-19)\n\n### Features\n\n- Migrated the code generator to use Smithy's new and recommended DirectedCodegen. ([#585](https://github.com/awslabs/smithy-typescript/pull/585))\n- Added support for endpoints v2. ([#586](https://github.com/awslabs/smithy-typescript/pull/586))\n- Updated Smithy version to `1.25.x` which bring Smithy IDL v2 support. ([#589](https://github.com/awslabs/smithy-typescript/pull/589))\n- Updated SSDK library version to `1.0.0-alpha6`. ([#583](https://github.com/awslabs/smithy-typescript/pull/583))\n- Added different package description for client v/s server. ([#582](https://github.com/awslabs/smithy-typescript/pull/582))\n- Overrode typescript version for typedoc. ([#561](https://github.com/awslabs/smithy-typescript/pull/561))\n- Removed namespaces that only contain log filters. ([#574](https://github.com/awslabs/smithy-typescript/pull/574))\n- Added support for event stream for RPC protocols. ([#573](https://github.com/awslabs/smithy-typescript/pull/573))\n- Added fallback to status code for unmodeled errors. ([#565](https://github.com/awslabs/smithy-typescript/pull/565))\n- Added support for generating protocol specific event payload. ([#554](https://github.com/awslabs/smithy-typescript/pull/554))\n- Used Record type instead of Object. ([#556](https://github.com/awslabs/smithy-typescript/pull/556), [#557](https://github.com/awslabs/smithy-typescript/pull/557), [#558](https://github.com/awslabs/smithy-typescript/pull/558), [#562](https://github.com/awslabs/smithy-typescript/pull/562))\n- Removed explicit reference to MetadataBearer from error shapes. ([#545](https://github.com/awslabs/smithy-typescript/pull/545))\n- Added codegen indicator comment to generated files. ([#538](https://github.com/awslabs/smithy-typescript/pull/538))\n- Added check to stop pagination on same token. ([#534](https://github.com/awslabs/smithy-typescript/pull/534))\n\n### Bug Fixes\n\n- Fixed code generation for server protocol tests. ([#577](https://github.com/awslabs/smithy-typescript/pull/577))\n- Fixed missing Content-Type header in some events. ([#567](https://github.com/awslabs/smithy-typescript/pull/567))\n\n## 0.11.0 (2022-04-04)\n\n### Features\n\n- Removed MetadataBearer from output type. ([#530](https://github.com/awslabs/smithy-typescript/pull/530))\n- Updated Smithy version to `1.19.x`. ([#531](https://github.com/awslabs/smithy-typescript/pull/531))\n- Updated `typescript` to `~4.6.2`. ([#527](https://github.com/awslabs/smithy-typescript/pull/527))\n- Set bodyLengthChecker type to BodyLengthCalculator. ([#524](https://github.com/awslabs/smithy-typescript/pull/524))\n\n### Bug Fixes\n\n- Added missing export for `httpApiKeyAuth` middleware. ([#528](https://github.com/awslabs/smithy-typescript/pull/528))\n\n## 0.10.0 (2022-03-02)\n\n### Features\n\n- Bumped SSDK library versions to 1.0.0-alpha5. ([#520](https://github.com/awslabs/smithy-typescript/pull/520))\n- Added support for `List<String>` in function parameters list. ([#516](https://github.com/awslabs/smithy-typescript/pull/516))\n- Updated generation of exceptions for easier handling. ([#502](https://github.com/awslabs/smithy-typescript/pull/502))\n- Updated clean script to delete \\*.tsbuildinfo. ([#514](https://github.com/awslabs/smithy-typescript/pull/514))\n\n### Bug Fixes\n\n- Fixed scripts for npm by extracting run command out. ([#519](https://github.com/awslabs/smithy-typescript/pull/519))\n- Fixed the generation of collections of documents in protocol tests. ([#513](https://github.com/awslabs/smithy-typescript/pull/513))\n\n## 0.9.0 (2022-02-14)\n\n### Features\n\n- Updated Smithy version to `1.17.x`. ([#505](https://github.com/awslabs/smithy-typescript/pull/505))\n- Added support for `@httpApiKeyAuth`. ([#473](https://github.com/awslabs/smithy-typescript/pull/473))\n- Added a default `prepack` script to generated packages. ([#479](https://github.com/awslabs/smithy-typescript/pull/479))\n- Added TypeScript contextual keywords to the reserved words list.\n  ([#500](https://github.com/awslabs/smithy-typescript/pull/500))\n- Changed generated builds to run concurrently. ([#498](https://github.com/awslabs/smithy-typescript/pull/498))\n- Added support for `defaultsMode`. ([#495](https://github.com/awslabs/smithy-typescript/pull/495))\n- Updated generated packages to use `@tsconfig/recommended`.\n  ([#493](https://github.com/awslabs/smithy-typescript/pull/493))\n- Removed `filterSensitiveLog` from exceptions. ([#488](https://github.com/awslabs/smithy-typescript/pull/488))\n- Bumped SSDK library versions to 1.0.0-alpha4. ([#480](https://github.com/awslabs/smithy-typescript/pull/480))\n- Removed test dependencies and configuration from generated packages.\n  ([#483](https://github.com/awslabs/smithy-typescript/pull/483))\n- Updated minimum supported Node version to 12.\n  ([#481](https://github.com/awslabs/smithy-typescript/pull/481),\n  [#482](https://github.com/awslabs/smithy-typescript/pull/482))\n- Added option to configure package manager, supporting `yarn` and `npm`.\n  ([#476](https://github.com/awslabs/smithy-typescript/pull/476))\n- Switched pattern validation to re2-wasm to avoid native dependency.\n  ([#467](https://github.com/awslabs/smithy-typescript/pull/467))\n\n### Bug Fixes\n\n- Updated protocol tests to check for `ErrorName`. ([#490](https://github.com/awslabs/smithy-typescript/pull/490))\n- Added escaping for regex literals in path segments. ([#477](https://github.com/awslabs/smithy-typescript/pull/477))\n- Fix greedy label matching. ([#474](https://github.com/awslabs/smithy-typescript/pull/474))\n\n### Documentation\n\n- Updated README example. ([#501](https://github.com/awslabs/smithy-typescript/pull/501))\n\n## 0.8.0 (2021-11-23)\n\n### Features\n\n- Updated Smithy version dependency to be more specific. ([#465](https://github.com/awslabs/smithy-typescript/pull/465))\n- Updated Smithy version to `1.14.x`. ([#468](https://github.com/awslabs/smithy-typescript/pull/468))\n\n### Bug Fixes\n\n- Fixed the generated comment for link to client config. ([#466](https://github.com/awslabs/smithy-typescript/pull/466))\n\n## 0.7.0 (2021-11-03)\n\n### Features\n\n- Updated parsing of timestamps and unions to be stricter. ([#412](https://github.com/awslabs/smithy-typescript/pull/412), [#414](https://github.com/awslabs/smithy-typescript/pull/414))\n- Reduced published package size. ([#427](https://github.com/awslabs/smithy-typescript/pull/427), [#443](https://github.com/awslabs/smithy-typescript/pull/443), [#446](https://github.com/awslabs/smithy-typescript/pull/446), [#444](https://github.com/awslabs/smithy-typescript/pull/444), [#452](https://github.com/awslabs/smithy-typescript/pull/452))\n- Added handling for more complex Accept header values. ([#431](https://github.com/awslabs/smithy-typescript/pull/431))\n- Moved source files to `src` folder. ([#434](https://github.com/awslabs/smithy-typescript/pull/434), [#437](https://github.com/awslabs/smithy-typescript/pull/437), [#438](https://github.com/awslabs/smithy-typescript/pull/438))\n- Added ability to ts-ignore a default import. ([#445](https://github.com/awslabs/smithy-typescript/pull/445))\n- Updated Smithy version to `1.12.0`. ([#448](https://github.com/awslabs/smithy-typescript/pull/448))\n- Switched to re2 for pattern validation. ([#451](https://github.com/awslabs/smithy-typescript/pull/451))\n\n### Bug Fixes\n\n- Used base64 en/decoder from context in bindings. ([#419](https://github.com/awslabs/smithy-typescript/pull/419))\n- Downgraded `typescript` to `~4.3.5`. ([#418](https://github.com/awslabs/smithy-typescript/pull/418))\n- Fixed XML protocol test to compare payload with outmost node. ([#433](https://github.com/awslabs/smithy-typescript/pull/433))\n- Fixed handling of multi-value query parameters to align with API Gateway behavior. ([#449](https://github.com/awslabs/smithy-typescript/pull/449))\n\n## 0.6.0 (2021-09-02)\n\n### Features\n\n- Updated parsing of request and response payloads for Http binding protocols to be stricter. ([#405](https://github.com/awslabs/smithy-typescript/pull/405))\n- Updated number parsing to be stricter based on size. ([#397](https://github.com/awslabs/smithy-typescript/pull/397), [#404](https://github.com/awslabs/smithy-typescript/pull/404))\n- Added handling for Content-Type and Accept headers in SSDK. ([#394](https://github.com/awslabs/smithy-typescript/pull/394))\n- Added a generator for `@httpMalformedRequestTests`. ([#393](https://github.com/awslabs/smithy-typescript/pull/393))\n- Added warning for unsupported Node.js version. ([#392](https://github.com/awslabs/smithy-typescript/pull/392))\n\n### Bug Fixes\n\n- Allowed setting prefix path for rpc protocols. ([#406](https://github.com/awslabs/smithy-typescript/pull/406))\n- Fixed SSDK codegen for different casing of operation name, by using operation symbol name consistently. ([#402](https://github.com/awslabs/smithy-typescript/pull/402))\n- Fixed processing of runtime config for generic clients. ([#401](https://github.com/awslabs/smithy-typescript/pull/401))\n\n## 0.5.0 (2021-07-23)\n\n### Features\n\n- Bumped `tslib` version to `2.3.0`. ([#387](https://github.com/awslabs/smithy-typescript/pull/387))\n- Calculate content-length for SSDKs. ([#386](https://github.com/awslabs/smithy-typescript/pull/386))\n\n### Bug Fixes\n\n- Update dependency versioning to pull from `smithy-aws-typescript-codegen` or use `latest`. ([#388](https://github.com/awslabs/smithy-typescript/pull/388))\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "## Code of Conduct\nThis project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).\nFor more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact\nopensource-codeofconduct@amazon.com with any additional questions or comments.\n"
  },
  {
    "path": "CODE_REVIEW.md",
    "content": "# Code Review\n\nGeneral guide for code review.\n\n## TypeScript source code\n\nThis covers the `@smithy/*` scoped core runtime for JavaScript.\n\n### Runtime Environments\n\nWe support the Node.js runtime, modern commonly used browsers, and react-native. To ensure that these runtime\nenvironments are API-equivalent, we have validation scripts in the core package that require all Node.js/browser/native\nimplementations to have equivalent API surfaces. Exported runtime symbols and type symbols are examined.\n\n- For any usage of the `node:` modules or functionality not present in browsers, an alternate implementation must be\n  provided for browsers. The native implementation defaults to the browser one unless a separate `index.native.ts` is\n  implemented.\n    - In some cases, there is no alternate in browsers. This must be clearly indicated at the `index.ts` level by the\n      symbol `Symbol.for(\"node-only\")` when implementing export symbol matching. Examples may be found in `@smithy/core`\n      submodule indexes.\n\n### Language Target Level\n\n- The runtime code must be understood by the\n  stated [minimum supported language level](https://aws.amazon.com/blogs/developer/aws-sdk-for-javascript-aligns-with-node-js-release-schedule/).\n- We do not use experimental language features that require polyfills or transform steps to run in Node.js.\n    - caveat: our 3rd supported runtime environment, react-native, may require polyfills. The react-native runtime has\n      historically been non-standard to the point that we should not let it influence the default Node.js\n      implementation.\n\n### Code priorities\n\n1. Correctness & Security\n2. Runtime performance\n3. Brevity and initialization performance\n4. Readability\n\nWhen making a trade-off between readability and performance, prioritize _performance_. Readability can be provided by\ncomments, whereas performance cannot.\n\nWithin performance, balance throughput performance and code-size, which affects initialization time. There will also be\na point where performance gains are small enough that an optimization should not be made. This is not predefined and\nleft to the reviewer.\n\n### Building blocks for runtime performance\n\n- Stable memory allocation: for hot code, pre-allocate the workspace (e.g. a byte array), work within it, and only allow\n  it to be garbage-collected after leaving the hot code path.\n- Minimize intermediate collections like `Object.keys()`.\n- Minimize copying like `{ ...data }`.\n- Minimize function scope depth.\n- Minimize function scope traversal including recursion.\n- Minimize object allocation, including the creation of closures.\n\n### API surface\n\nWe want to provide as small an API surface as possible.\n\nThis is not because we don't want to provide features to our users. We want to avoid situations where users have built\nsolutions on top of non-public APIs that we later change or remove.\n\nTo ensure that we have visibility on the API surface of the runtime, we have an API snapshot check that runs during\nintegration testing.\n\n- `export *` statements are banned for new code. `export *` creates an API surface that\n  is not diff-visible between changes, and leads to leaking implementation details.\n- Things of interest to the reader must appear closer to the top.\n    - One concrete implementation for this is that in classes, `public` methods must come before `protected`. `private`\n      comes last. For non-classes, apply the same reasoning with your own judgment.\n\n```ts\n/**\n * Description goes here.\n *\n * @example\n * const impl = new Impl();\n *\n * @public\n */\nexport class Impl {\n    public prop1;\n    private prop2;\n\n    public constructor() {\n    }\n\n    /**\n     * Static factory.\n     */\n    public static method1() {\n    }\n\n    /**\n     * @returns something.\n     */\n    public method2() {\n    }\n\n    private static method3() {\n    }\n\n    private method4() {\n    }\n}\n\nconst moduleInternal = () => {\n};\n```\n\n### Code comment block documentation (tsdoc)\n\nWe write code comments to the https://tsdoc.org/ specification.\n\n- The free-form description (optional) of a symbol must come first. All annotations must come below this description.\n- For any symbol exported from a package, it must have an access level annotation, `@public` or `@internal`.\n    - In limited circumstances `@alpha` and `@beta` may be used.\n- For non-exported symbols, you do not need to write comments for all symbols. Use your judgment here.\n- You may opt to write a free-form description of a method in lieu of writing the API annotations `@param` and\n  `@returns` etc.\n- Comments explain \"why?\", not \"how?\". The code says \"how\".\n\n# Java source code - \"codegen\"\n\n- Optimize performance by creating cached `KnowledgeIndex` objects. Avoid repeated traversal of a service model for\n  static information.\n- Avoid excessive logging to the WARN and INFO channels."
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing Guidelines\n\nThank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional\ndocumentation, we greatly value feedback and contributions from our community.\n\nPlease read through this document before submitting any issues or pull requests to ensure we have all the necessary\ninformation to effectively respond to your bug report or contribution.\n\n## Gradle Composite Build\n\nThe `smithy-typescript` repository uses Gradle as a build tool and has Gradle based dependencies such as `smithy`.\nTo improve development experience when making changes to the dependencies locally, we can\nuse the [Gradle composite build feature](https://docs.gradle.org/current/userguide/composite_builds.html),\nwhich allows picking up any local changes from dependencies automatically and rebuilding them when `smithy-typescript` is rebuilt.\n\nThis also makes IDE integration more pleasant, as Intellij IDEA will open the included projects as modules when the Gradle build is imported.\n\nIn order to utilise this feature, create a file `local.properties` in the project directory with the following content:\n\n```\nsmithy=/Volumes/workplace/smithy\n```\n\n## Experimental Features\n\nThe `smithy-typescript` repository is under heavy development, and has experimental features that can affect consumers\nof code generation packages and TypeScript packages. These features are enabled via opt-in settings in\n`smithy-build.json`. Note that any contributions related to these features MUST be reviewed carefully for opt-in\nbehavior via feature flags as to not break any existing customers. Here are the experimental features that are currently\nunder development:\n\n| Experimental Feature | Flag | Description |\n| -------------------- | ---- | ----------- |\n| N/A                  | N/A  | N/A         |\n\n## Reporting Bugs/Feature Requests\n\nWe welcome you to use the GitHub issue tracker to report bugs or suggest features.\n\nWhen filing an issue, please check [existing open](https://github.com/smithy-lang/smithy-typescript/issues), or [recently closed](https://github.com/smithy-lang/smithy-typescript/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already\nreported the issue. Please try to include as much information as you can. Details like these are incredibly useful:\n\n- A reproducible test case or series of steps\n- The version of our code being used\n- Any modifications you've made relevant to the bug\n- Anything unusual about your environment or deployment\n\n## Contributing via Pull Requests\n\nContributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:\n\n1. You are working against the latest source on the _main_ branch.\n2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.\n3. You open an issue to discuss any significant work - we would hate for your time to be wasted.\n\nTo send us a pull request, please:\n\n1. Fork the repository.\n2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.\n3. Ensure local tests pass.\n4. Commit to your fork using clear commit messages.\n5. Send us a pull request, answering any default questions in the pull request interface.\n6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.\n\nIf you are modifying one or more of the NPM packages in the `/packages` directory please follow these additional steps before opening a pull request:\n\n1. After modifying the source, run `yarn changeset add`.\n2. Follow the prompts and select the appropriate change level (`major`, `minor` or `patch`) for each of the NPM packages you have modified.\n3. Add the generated changeset file to your commit: `git add .changeset/<generated file name>.md`.\n4. Commit to your fork using clear commit messages.\n5. Send the pull request.\n\nGitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and\n[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).\n\n## Keeping code generation in sync with aws-sdk-js-v3\n\nAny changes made to the `smithy-typescript-codegen` package need to be compatible with aws-sdk-js-v3. Maintainers and reviewers\nMUST ensure that code generation is kept in sync between the two repositories by creating an equivalent PR in aws-sdk-js-v3.\n\nProcedure to keep code generation in sync while making changes to `smithy-typescript-codegen`:\n\n1. Fork and clone [aws/aws-sdk-js-v3][aws-sdk-js-v3].\n2. Run `yarn` to install dependencies.\n3. Run `generate-clients` with `HEAD` commit as follows:\n   ```sh\n   yarn generate-clients --commit HEAD\n   ```\n4. If the clients are updated, post a pull request on aws-sdk-js-v3. If the clients are not updated, no further action is needed.\n5. When PR on smithy-typescript is merged, rebase the PR on aws-sdk-js-v3 and add merged commit as default.\n\n## Finding contributions to work on\n\nLooking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/smithy-lang/smithy-typescript/labels/help%20wanted) issues is a great place to start.\n\n## Code of Conduct\n\nThis project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).\nFor more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact\nopensource-codeofconduct@amazon.com with any additional questions or comments.\n\n## Security issue notifications\n\nIf you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.\n\n## Licensing\n\nSee the [LICENSE](https://github.com/smithy-lang/smithy-typescript/blob/main/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.\n\nWe may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.\n\n[aws-sdk-js-v3]: https://github.com/aws/aws-sdk-js-v3\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"
  },
  {
    "path": "Makefile",
    "content": ".PHONY: build sync api-snapshot ct cti cwt cwti\n\nbuild:\n\t./gradlew clean build publishToMavenLocal\n\nsync:\n\tgh repo sync $$GITHUB_USERNAME/smithy-typescript -b main\n\tgit fetch --all\n\ngenerate-protocol-tests:\n\trm -rf ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen\n\t./gradlew :smithy-typescript-protocol-test-codegen:build\n\trm -rf ./private/smithy-rpcv2-cbor\n\trm -rf ./private/smithy-rpcv2-cbor-schema\n\trm -rf ./private/my-local-model\n\trm -rf ./private/my-local-model-schema\n\tcp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/smithy-rpcv2-cbor/typescript-codegen ./private/smithy-rpcv2-cbor\n\tcp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/smithy-rpcv2-cbor-schema/typescript-codegen ./private/smithy-rpcv2-cbor-schema\n\tcp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model/typescript-client-codegen/ ./private/my-local-model\n\tcp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model-schema/typescript-client-codegen/ ./private/my-local-model-schema\n\tnode ./scripts/post-protocol-test-codegen\n\tyarn\n\tyarn turbo run build -F=\"./private/*\" --only\n\tmake test-protocols;\n\ntest-protocols:\n\t(cd ./private/smithy-rpcv2-cbor && npx vitest run --globals && yarn test:index)\n\t(cd ./private/smithy-rpcv2-cbor-schema && npx vitest run --globals && yarn test:index)\n\t(cd ./private/my-local-model-schema && npx vitest run --globals && yarn test:index)\n\t(cd ./private/smithy-rpcv2-cbor-schema && yarn test:integration)\n\t(cd ./private/my-local-model-schema && yarn test:integration)\n\nbenchmark:\n\t(cd ./private/my-local-model-schema && npx vitest run --globals)\n\n# \"build generate test\"\nbgt:\n\tmake build generate-protocol-tests\n\ngt:\n\tmake generate-protocol-tests\n\ntest-unit:\n\tyarn g:vitest run -c vitest.config.mts\n\ntest-browser:\n\tyarn g:vitest run -c vitest.config.browser.mts\n\ntest-bundlers:\n\t(cd ./testbed/bundlers && make run)\n\n# typecheck for test code.\ntest-types:\n\tnpx tsc -p tsconfig.test.json\n\ntest-integration:\n\tnode ./scripts/validation/no-generic-byte-arrays.js;\n\tnode ./scripts/check-dependencies.js;\n\tnode ./scripts/runtime-dep-version-check.js;\n\tmake test-browser;\n\tyarn g:vitest run -c vitest.config.integ.mts;\n\tmake test-types;\n\tmake test-bundlers;\n\nturbo-clean:\n\t@read -p \"Are you sure you want to delete your local cache? [y/N]: \" ans && [ $${ans:-N} = y ]\n\t@echo \"\\nDeleted cache folders: \\n--------\"\n\t@find . -name '.turbo' -type d -prune -print -exec rm -rf '{}' + && echo '\\n'\n\napi-snapshot:\n\tyarn build\n\tnode scripts/validation/api-snapshot-validation.js --write\n\tgit diff --exit-code api-snapshot/\n\nS ?= $(word 2,$(MAKECMDGOALS))\n\n# make ct retry, for example, to run a subset of core unit tests.\nct:\n\tcd packages/core && yarn g:vitest run src/submodules/$(S)\ncwt:\n\tcd packages/core && yarn g:vitest watch src/submodules/$(S)\n\n# same as ct, but for integration tests.\ncti:\n\tcd packages/core && yarn g:vitest run -c vitest.config.integ.mts src/submodules/$(S)\ncwti:\n\tcd packages/core && yarn g:vitest watch -c vitest.config.integ.mts src/submodules/$(S)\n\n# swallow extra positional args (e.g. make ct endpoints)\n%:\n\t@:"
  },
  {
    "path": "NOTICE",
    "content": "Smithy Typescript\nCopyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. \n"
  },
  {
    "path": "README.md",
    "content": "# <img alt=\"Smithy\" src=\"https://github.com/smithy-lang/smithy/blob/main/docs/_static/smithy-anvil.svg?raw=true\" width=\"32\"> Smithy TypeScript\n\n> **WARNING: Smithy TypeScript is currently in [Developer Preview](https://aws.amazon.com/blogs/devops/smithy-server-and-client-generator-for-typescript). All interfaces and supported JavaScript platforms are subject to change.**\n\n`smithy-typescript` includes the reference implementations of the [Smithy](https://smithy.io/) code generators for [TypeScript](https://www.typescriptlang.org/).\n\nFor Client SDK code generation, the `typescript-client-codegen` plugin provides a framework for generating extensible TypeScript clients that can support multiple JavaScript platforms, including Node.js, Browser, and React-Native. See [the section on generating a client to see how to get started](#generating-a-client), or [the `typescript-client-codegen` documentation](#client-sdk-code-generation-typescript-client-codegen-plugin).\n\n> Note: Node.js support includes versions >= 20, and is subject to change.\n\nFor Server SDK code generation, the `typescript-server-codegen` plugin provides a framework for generating server scaffolding at a higher level of abstraction and with type safety. More documentation can be found at in [the `typescript-server-codegen` documentation](#server-sdk-code-generation-typescript-server-codegen-plugin), or [smithy.io](https://smithy.io/2.0/languages/typescript/ts-ssdk/index.html).\n\n## Generating a client\n\nThe Smithy TypeScript `typescript-client-codegen` code generator in this repository generates TypeScript clients from Smithy models, and can be built with both the idiomatic [Smithy CLI](#using-smithy-typescript-with-the-smithy-cli) or through [Gradle](#using-smithy-typescript-with-gradle).\n\n> The Smithy CLI is a prerequisite for this section when using the `smithy init` commands. See [the installation guide](https://smithy.io/2.0/guides/smithy-cli/cli_installation.html) for how to install the Smithy CLI. If installing the Smithy CLI is not preferred, the templates used can be found in the [Smithy Examples repository](https://github.com/smithy-lang/smithy-examples).\n\nFor additional configuration, see [the `typescript-client-codegen` documentation](#client-sdk-code-generation-typescript-client-codegen-plugin) and [the documentation for `smithy-build.json`](https://smithy.io/2.0/guides/building-models/build-config.html).\n\n### Using Smithy TypeScript with the Smithy CLI\n\nUsing the Smithy CLI, a new Smithy CLI project can be created using the default `smithy init` template. In this example, the project will be called `smithy-typescript-example-client`.\n\n```shell\nsmithy init -o smithy-typescript-example-client\ncd smithy-typescript-example-client/\n```\n\nThis will create a project with the following directory structure:\n\n```text\nsmithy-typescript-example-client/\n├── README.md\n├── models\n│   └── weather.smithy\n└── smithy-build.json\n```\n\nTo add a minimal `typescript-client-codegen` plugin, add the following to `smithy-build.json`:\n\n```json\n// smithy-build.json\n{\n  \"version\": \"1.0\",\n  \"sources\": [\"models\"],\n  // Add the Smithy TypeScript code generator dependency\n  \"maven\": {\n    \"dependencies\": [\"software.amazon.smithy.typescript:smithy-typescript-codegen:0.49.1\"]\n  },\n  \"plugins\": {\n    // Add the Smithy TypeScript client plugin\n    \"typescript-client-codegen\": {\n      // Minimal configuration: add package name and version\n      \"package\": \"@smithy/typescript-example-client\",\n      \"packageVersion\": \"0.0.1\"\n    }\n  }\n}\n```\n\nAfter `smithy-build.json` has been configured, run `smithy build`. This will code generate the TypeScript client under the `source` projection, found in the `build/smithy/source/typescript-client-codegen` directory.\n\nVerify the client is able to compile by running the following:\n\n```shell\ncd build/smithy/source/typescript-client-codegen\n# Yarn is used in this example, but equivalent commands using other package managers can be used, e.g. npm and pnpm\nyarn\nyarn build\n```\n\n> Note that running the NPM scripts to verify the generated TypeScript client is NOT part of the code generation process, and needs to be explicitly executed after the client is generated.\n\n### Using Smithy TypeScript with Gradle\n\nUsing the Smithy CLI, a new Gradle project can be created using the `quickstart-gradle` template. In this example, the project will be called `smithy-typescript-example-client-gradle`.\n\n```shell\nsmithy init -t quickstart-gradle -o smithy-typescript-example-client-gradle\ncd smithy-typescript-example-client-gradle/\n```\n\nThis will create a project with the following directory structure:\n\n```text\nsmithy-typescript-example-client-gradle/\n├── README.md\n├── build.gradle.kts\n├── gradle\n│   └── wrapper\n│       ├── gradle-wrapper.jar\n│       └── gradle-wrapper.properties\n├── gradle.properties\n├── gradlew\n├── gradlew.bat\n├── models\n│   └── weather.smithy\n├── settings.gradle.kts\n└── smithy-build.json\n```\n\nTo add a minimal `typescript-client-codegen` plugin, add the following to `smithy-build.json`:\n\n```json\n// smithy-build.json\n{\n  \"version\": \"1.0\",\n  \"sources\": [\"models\"],\n  \"plugins\": {\n    // Add the Smithy TypeScript client plugin\n    \"typescript-client-codegen\": {\n      // Minimal configuration: add package name and version\n      \"package\": \"@smithy/typescript-example-client\",\n      \"packageVersion\": \"0.0.1\"\n    }\n  }\n}\n```\n\n> Note: Maven dependencies cannot be configured in `smithy-build.json` for Gradle projects.\n\nThen, add the `smithy-typescript-codegen` dependency in `build.gradle.kts`:\n\n```kotlin\nplugins {\n    id(\"java-library\")\n    id(\"software.amazon.smithy.gradle.smithy-jar\").version(\"0.10.1\")\n}\n\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n\ndependencies {\n    val smithyVersion: String by project\n\n    smithyCli(\"software.amazon.smithy:smithy-cli:$smithyVersion\")\n\n    // Add the Smithy TypeScript code generator dependency\n    implementation(\"software.amazon.smithy.typescript:smithy-typescript-codegen:0.49.1\")\n\n    // Uncomment below to add various smithy dependencies (see full list of smithy dependencies in https://github.com/awslabs/smithy)\n    // implementation(\"software.amazon.smithy:smithy-model:$smithyVersion\")\n    // implementation(\"software.amazon.smithy:smithy-linters:$smithyVersion\")\n}\n```\n\nAfter `smithy-build.json` and `build.gradle.kts` have been configured, run `./gradlew clean build`. This will code generate the TypeScript client under the `source` projection, found in the `build/smithyprojections/quickstart-gradle/source/typescript-client-codegen` directory.\n\nVerify the client is able to compile by running the following:\n\n```shell\ncd build/smithyprojections/quickstart-gradle/source/typescript-client-codegen\n# Yarn is used in this example, but equivalent commands using other package managers can be used, e.g. npm and pnpm\nyarn\nyarn build\n```\n\n> Note that running the NPM scripts to verify the generated TypeScript client is NOT part of the code generation process, and needs to be explicitly executed after the client is generated.\n\nFor another example of a Gradle project using Smithy Typescript, the `smithy-typescript-codegen-test` package can be referenced as it builds different TypeScript artifacts through projections.\n\nSee [the Smithy documentation](https://smithy.io/2.0/guides/building-models/gradle-plugin.html) for more information on build Smithy projects with Gradle.\n\n> Note: the Smithy Gradle Plugin is under heavy development and is subject to breaking changes.\n\n## TypeScript code generation\n\nBy default, the Smithy TypeScript code generators provide the code generation framework to generate TypeScript artifacts (e.g. types, interfaces, implementations) of specified Smithy models. However there are implementations for code generation and TypeScript that either need to be implemented or consumed from third-party packages:\n\n- Protocols: Protocols define how operation shapes (for clients and servers, these are usually inputs and outputs) are serialized and deserialized on the wire. This behavior can be defined in Smithy through [protocol traits](https://smithy.io/2.0/spec/protocol-traits.html) with corresponding implementations of [the `ProtocolGenerator` interface](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/ProtocolGenerator.java). For example, [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3), a customer of Smithy TypeScript, implements the [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) in the `software.amazon.smithy.typescript:smithy-aws-typescript-codegen` package. See [the section on protocol generator implementations for more details](#protocol-generator-implementations).\n- Publishing: There is no idiomatic utility to publish generated artifacts since package distribution can vary depending on different technical requirements. For example, [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3), a customer of Smithy TypeScript, has custom tooling to manage versioning, change logs, and publishing in a monorepo. See [the section on publishing client packages for more details](#publishing-a-client-sdk-package).\n- Endpoint resolution (clients): Endpoint resolution is not implemented by default due to a variety of different implementations. In most cases, providing a default provider in the runtime config for the client config `endpoint` property should suffice. More complex use cases include [the `@smithy.rules#endpointRuleSet` trait](https://smithy.io/2.0/additional-specs/rules-engine/specification.html#smithy-rules-endpointruleset-trait) which provides [a complete DSL for endpoint resolution](https://smithy.io/2.0/additional-specs/rules-engine/index.html). See [the section on handling endpoint resolution for more details](#handling-endpoint-resolution).\n- Operation handler implementations (servers): The server code generator provides the scaffolding for operations. The operation handlers defining the business logic of the Smithy service need to be implemented manually.\n\n### Client SDK code generation: `typescript-client-codegen` plugin\n\n#### `typescript-client-codegen` plugin configuration\n\n> Note: Although plugin configuration is maintained with backward compatibility in mind, breaking changes may still occur.\n\n[`TypeScriptSettings`](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java) contains all of the settings enabled from `smithy-build.json` and helper methods and types. The up-to-date list of top-level properties enabled for `typescript-client-codegen` can be found in `TypeScriptSettings.ArtifactType.CLIENT`.\n\n| Setting                   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `package`                 | Yes      | Name of the package in `package.json`.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| `packageVersion`          | Yes      | Version of the package in `package.json`. Will be overwritten if using `versioningScheme` and the scheme is recognized, but is required as a fallback value.                                                                                                                                                                                                                                                                                                                            |\n| `versioningScheme`        | No       | Default=\"\". Overwrites `packageVersion`. Applies automatic versioning to the generated package. \"@smithy/core\" will use the version of `@smithy/core` contemporary to the code generator. If the `versioningScheme` value is not recognized, then `packageVersion` will be used. `@aws-sdk/client` is recognized only when this code generator is used in conjunction with `smithy-aws-typescript-codegen`, in which case the highest contemporary AWS SDK client version will be used. |\n| `packageDescription`      | No       | Description of the package in `package.json`. The default value is `${package} client`                                                                                                                                                                                                                                                                                                                                                                                                  |\n| `packageJson`             | No       | Custom `package.json` properties that will be merged with the base `package.json`. The default value is an empty object.                                                                                                                                                                                                                                                                                                                                                                |\n| `packageManager`          | No       | Configured package manager for the package. The default value is `yarn`.                                                                                                                                                                                                                                                                                                                                                                                                                |\n| `service`                 | No       | The Shape ID of the service to generate a client for. If not provided, the code generator will attempt to infer the service Shape ID. If there is exactly 1 service found in the model, then the service is used as the inferred Shape ID. If no services are found, then code generation fails. If more than 1 service is found, then code generation fails.                                                                                                                           |\n| `protocol`                | No       | The Shape ID of the protocol used to generate serialization and deserialization. If not provided, the code generator will attempt to resolve the highest priority service protocol supported in code generation (registered through `TypeScriptIntegration`). If no protocols are found, code generation will use serialization and deserialization error stubs.                                                                                                                        |\n| `private`                 | No       | Whether the package is `private` in `package.json`. The default value is `false`.                                                                                                                                                                                                                                                                                                                                                                                                       |\n| `requiredMemberMode`      | No       | **NOT RECOMMENDED DUE TO BACKWARD COMPATIBILITY CONCERNS.** Sets whether members marked with the `@required` trait are allowed to be `undefined`. See more details on the risks in `TypeScriptSettings.RequiredMemberMode`. The default value is `nullable`.                                                                                                                                                                                                                            |\n| `bigNumberMode`           | No       | use `\"native\"` to serialize and deserialize Smithy BigInteger and BigDecimal to `bigint` and `@smithy/core/serde`'s `NumericValue`. Otherwise, use `\"big.js\"` to serialize and deserialize with that numeric library.                                                                                                                                                                                                                                                                   |\n| `createDefaultReadme`     | No       | Whether to generate a default `README.md` for the package. The default value is `false`.                                                                                                                                                                                                                                                                                                                                                                                                |\n| `useLegacyAuth`           | No       | **NOT RECOMMENDED, AVAILABLE ONLY FOR BACKWARD COMPATIBILITY CONCERNS.** Flag that enables using legacy auth. When in doubt, use the default identity and auth behavior (not configuring `useLegacyAuth`) as the golden path.                                                                                                                                                                                                                                                           |\n| `serviceProtocolPriority` | No       | Map of service `ShapeId` strings to lists of protocol `ShapeId` strings. Used to override protocol selection behavior.                                                                                                                                                                                                                                                                                                                                                                  |\n| `defaultProtocolPriority` | No       | List of protocol `ShapeId` strings. Lower precedence than `serviceProtocolPriority` but applies to all services.                                                                                                                                                                                                                                                                                                                                                                        |\n| `generateIndexTests`      | No       | Default=`false`. Whether to generate a set of tests that does a basic validation of the export surface of the generated client package. The tests can be run with the script `test:index` in the generated package.                                                                                                                                                                                                                                                                     |\n| `generateSnapshotTests`   | No       | Default=`false`. Whether to generate snapshot tests along with the client.                                                                                                                                                                                                                                                                                                                                                                                                              |\n\n#### `typescript-client-codegen` plugin artifacts\n\nSmithy TypeScript clients are extensible (see [the AWS blog post on the middleware stack](https://aws.amazon.com/blogs/developer/middleware-stack-modular-aws-sdk-js/)), robust, and support multiple JavaScript platforms. The main components of a client are the following (`$SERVICE` is the name of a Smithy service, `$OPERATION` is the name of a Smithy operation, `$N` is a number starting from 0):\n\n- Client classes: A standalone tree-shakeable client defined in `src/$SERVICEClient.ts` and an aggregated client defined in `src/$SERVICE.ts`. The client classes are the entry point to calling a service, defining the input configuration of the service and adding any service-level middleware.\n\n  ```typescript\n  import { $SERVICEClient, $SERVICE } from \"...\"; // example client package\n\n  const individualClient = new $SERVICEClient({\n    // Input configuration with type hints\n  });\n\n  const aggregatedClient = new $SERVICE({\n    // Input configuration with type hints\n  });\n  ```\n\n- Command classes: Individual commands defined in `src/commands/$OPERATIONCommand.ts`. These classes include operation-level middleware and additional values to the client resolved configuration through the middleware context.\n\n  ```typescript\n  import { $SERVICEClient, $OPERATIONCommand, $OPERATIONCommandOutput } from \"...\"; // example client package\n\n  const individualClient = new $SERVICEClient({\n    // Input configuration with type hints\n  });\n\n  const response: Promise<$OPERATIONCommandOutput> = individualClient.send(\n    new $OPERATIONCommand({\n      // Operation input with type hints\n      // Operations can also be called callback style or with HandlerOptions\n    })\n  );\n  ```\n\n- Models: Types and interfaces exported from `models/index.ts`, found individually in `models/model_$N.ts`, and errors including a base `$SERVICEServicexception.ts`.\n\n  ```typescript\n  import { $SERVICEClient, $SERVICEServiceException, $OPERATIONCommand, $OPERATIONCommandOutput } from \"...\"; // example client package\n\n  const individualClient = new $SERVICEClient({\n    // Input configuration with type hints\n  });\n\n  try {\n    // $OPERATIONCommandOutput generated from the Smithy model\n    const response: $OPERATIONCommandOutput = await individualClient.send(new $OPERATIONCommand({}));\n  } catch (error) {\n    // If more errors are defined in the Smithy model, then more extensive checks can be made\n    if (error instanceof $SERVICEServiceException) {\n      console.error(\"Oh no, a service exception was thrown!\");\n    }\n    throw error;\n  }\n  ```\n\n- Runtime Configurations: Populated default values for a client input configuration for different platforms, currently supporting Node.js, Browser, and React-Native. All of these have a shared runtime configuration that is overwritten with more specific platform values. Not every client input configuration needs a default value, but it is best practice to provide a reasonable default. For example, the `extensions` property defaults to an empty array when no runtime extensions are specified.\n\n  ```text\n  Least-specific\n\n  ┌──────────────────────────────────────────────────────────┐\n  │ Shared Runtime Configuration (`runtimeConfig.shared.ts`) │\n  └──────────────────────────────────────────────────────────┘\n                 │                                   │\n  ┌──────────────────────────────┐ ┌─────────────────────────────────────-┐\n  │ Node.js (`runtimeConfig.ts`) │ │ Browser (`runtimeConfig.browser.ts`) │\n  └──────────────────────────────┘ └──────────────────────────────────────┘\n                                                     │\n                                   ┌─────────────────────────────────────────-┐\n                                   │ React-Native (`runtimeConfig.native.ts`) │\n                                   └──────────────────────────────────────────┘\n\n  Most-specific (overrides values from parent)\n  ```\n\n- Runtime Extensions: Interfaces to implement extensions enabling alternative default values to the runtime configuration. See [the section on customizing TypeScript Client Configuration for more details](#typescript-client-configuration).\n- Package Configuration files: `package.json` and TypeScript configuration files for different platforms.\n\nOther directories could include code generated [paginators](https://smithy.io/2.0/spec/behavior-traits.html#pagination), [waiters](https://smithy.io/2.0/additional-specs/waiters.html), endpoint resolvers, etc., but are usually generated only when traits are present. If code-generating custom files for the SDK client, it is recommended to use a separate directory for separation of concerns.\n\nHere is the directory structure of the generated artifacts from [the example client in the getting started section](#using-smithy-typescript-with-the-smithy-cli).\n\n```\nbuild/smithy/source/typescript-client-codegen/\n├── package.json\n├── src\n│   ├── Weather.ts\n│   ├── WeatherClient.ts\n│   ├── commands\n│   ├── extensionConfiguration.ts\n│   ├── index.ts\n│   ├── models\n│   ├── pagination\n│   ├── runtimeConfig.browser.ts\n│   ├── runtimeConfig.native.ts\n│   ├── runtimeConfig.shared.ts\n│   ├── runtimeConfig.ts\n│   └── runtimeExtensions.ts\n├── tsconfig.cjs.json\n├── tsconfig.es.json\n├── tsconfig.json\n├── tsconfig.types.json\n└── typedoc.json\n```\n\n#### Code generation implementations not included\n\nSmithy TypeScript provides default code generation implementations for generating TypeScript clients, but also requires customers to either implement or consume certain implementations where there is no default.\n\nFor Smithy TypeScript clients, the main implementations not provided are [protocol generators](#protocol-generator-implementations) and [handling endpoint resolution](#handling-endpoint-resolution) (see [the TypeScript code generation section](#typescript-code-generation)).\n\n> If there are items missing from this section, feel free to [create an issue](https://github.com/smithy-lang/smithy-typescript/issues/new).\n\n##### Protocol generator implementations\n\nProtocols define how operation inputs and outputs are serialized and deserialized on the wire. This behavior can be defined in Smithy through [protocol traits](https://smithy.io/2.0/spec/protocol-traits.html) with corresponding implementations of [the `ProtocolGenerator` interface](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/ProtocolGenerator.java) in Smithy TypeScript. Besides the `ProtocolGenerator` interface, Smithy TypeScript has additional abstract classes that partially implement the `ProtocolGenerator` interface and can be extended: [`HttpBindingProtocolGenerator` for HTTP binding protocols](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java) and [`HttpRpcProtocolGenerator` for HTTP RPC protocols](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpRpcProtocolGenerator.java).\n\nOnce a `ProtocolGenerator` is implemented, the implementation can be registered through a `TypeScriptIntegration`:\n\n- `TypeScriptIntegration` with `ProtocolGenerator` implementation:\n\n  ```java\n  // src/main/java/typescript/example/client/gradle/ExampleClientProtocolGeneratorIntegration.java\n  package typescript.example.client.gradle;\n\n  // ...\n\n  public class ExampleClientProtocolGeneratorIntegration implements TypeScriptIntegration {\n      // ProtocolGenerator implementation is inline for brevity, but should be in its\n      // own file\n      private static class ExampleClientProtocolGenerator implements ProtocolGenerator {\n          // Protocol generator for a @example.client#protocol protocol trait\n          @Override\n          public ShapeId getProtocol() {\n              return ShapeId.from(\"example.client#protocol\");\n          }\n          // Implement ProtocolGenerator methods ...\n      }\n\n      @Override\n      public List<ProtocolGenerator> getProtocolGenerators() {\n          return List.of(new ExampleClientProtocolGenerator());\n      }\n  }\n  ```\n\n- Registering the `TypeScriptIntegration`:\n  ```java\n  // src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration\n  typescript.example.client.gradle.ExampleClientProtocolGeneratorIntegration\n  ```\n\nSee [the section on customizations via `TypeScriptIntegration` for more details](#customizations-via-typescriptintegration).\n\n> Note: [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3), a customer of Smithy TypeScript, implements the [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) and can be consumed by adding the `software.amazon.smithy.typescript:smithy-aws-typescript-codegen` package.\n\n##### Handling endpoint resolution\n\nEndpoint resolution is not implemented by default due to the inherent complexity. By default, if no endpoint resolution is provided, customers will not be able to pass in an endpoint to the client (TypeScript will fail to compile).\n\nSmithy TypeScript has the `CustomEndpoints` configuration which can be used to add the `endpoint` property to the client configuration, and the `TypeScriptIntegration::getRuntimeConfigWriters()` method can be used to provide a default endpoint:\n\n- `TypeScriptIntegration` implementation:\n\n  ```java\n  // src/main/java/typescript/example/client/gradle/ExampleClientEndpointResolutionIntegration.java\n  package typescript.example.client.gradle;\n\n  // ...\n\n  public class ExampleClientEndpointResolutionIntegration implements TypeScriptIntegration {\n      @Override\n      public List<RuntimeClientPlugin> getClientPlugins() {\n          return List.of(\n              RuntimeClientPlugin.builder()\n                  .withConventions(\n                      TypeScriptDependency.CONFIG_RESOLVER.dependency,\n                      \"CustomEndpoints\",\n                      Convention.HAS_CONFIG)\n                  .build());\n      }\n\n      @Override\n      public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n          TypeScriptSettings settings,\n          Model model,\n          SymbolProvider symbolProvider,\n          LanguageTarget target\n      ) {\n          // Runtime config value also be specified per platform by using the `target`\n          // argument, e.g.\n          // if (target.equals(LanguageTarget.NODE)) { ... }\n          if (target.equals(LanguageTarget.SHARED)) {\n              // This example provides an arbitrary endpoint on the shared runtime config\n              return Map.of(\"endpoint\", w -> w.write(\"$S\", \"https://www.example.com\"));\n          }\n          // No need to redefine endpoint for other targets since it's inherited from the\n          // shared target\n          return Collections.emptyMap();\n      }\n  }\n  ```\n\n- Registering the `TypeScriptIntegration`:\n  ```java\n  // src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration\n  typescript.example.client.gradle.ExampleClientEndpointResolutionIntegration\n  ```\n\nCustomers can then pass in an endpoint to the client configuration:\n\n```typescript\nimport { $SERVICEClient } from \"...\"; // example client package\n\n// Without providing the endpoint, a \"No valid endpoint provider available.\" error will be thrown\nconst individualClient = new $SERVICEClient({\n  // string\n  endpoint: \"https://www.example.com\",\n});\n```\n\nSee [the section on customizations via `TypeScriptIntegration` for more details](#customizations-via-typescriptintegration).\n\n#### Publishing a Client SDK package\n\n> Note: There is no prescribed way to publish NPM packages since there are many ways to maintain SDKs. Some publishing tools include using [`npm publish`](https://docs.npmjs.com/cli/v8/commands/npm-publish) or [`yarn publish`](https://classic.yarnpkg.com/lang/en/docs/cli/publish/) directly, or managing a monorepo with tools like [`turbo`](https://turbo.build/repo/docs/handbook/publishing-packages). This section provides tips for how a general publishing workflow could work.\n\nA generated client is a package that is ready to be published. After running `smithy build`, the generated client artifacts will be in the build directory under the projection and plugin name. For example, generated client artifacts for the source projection using the `typescript-client-codegen` plugin in a Smithy CLI project would be in the `build/smithy/source/typescript-client-codegen/` directory. A common practice is to copy the generated client artifacts into a source control repository. After the artifacts are staged, any modifications that are needed prior to publishing the generated client artifacts specific to the SDK should be run, e.g. adding a `README.md`, editing changelog entries. Finally, with a chosen publishing tool for the SDK, publish the artifacts after running the `prepack` script per client package.\n\n### Server SDK code generation: `typescript-server-codegen` plugin\n\nFor documentation of `typescript-server-codegen` artifacts and implementation, see [the Smithy TypeScript Server SDK walkthrough](https://smithy.io/2.0/languages/typescript/ts-ssdk/index.html) and [Developer Preview announcement blog post](https://aws.amazon.com/blogs/devops/smithy-server-and-client-generator-for-typescript).\n\n#### `typescript-server-codegen` plugin configuration\n\n> Note: Although plugin configuration is maintained with backward compatibility in mind, breaking changes may still occur.\n\n[`TypeScriptSettings`](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java) contains all of the settings enabled from `smithy-build.json` and helper methods and types. The up-to-date list of top-level properties enabled for `typescript-server-codegen` can be found in `TypeScriptSettings.ArtifactType.SSDK`.\n\n| Setting                    | Required | Description                                                                                                                                                                                                                                                                                                                                                      |\n| -------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `package`                  | Yes      | Name of the package in `package.json`.                                                                                                                                                                                                                                                                                                                           |\n| `packageVersion`           | Yes      | Version of the package in `package.json`.                                                                                                                                                                                                                                                                                                                        |\n| `packageDescription`       | No       | Description of the package in `package.json`. The default value is `${package} server`.                                                                                                                                                                                                                                                                          |\n| `packageJson`              | No       | Custom `package.json`properties that will be merged with the base `package.json`. The default value is an empty object.                                                                                                                                                                                                                                          |\n| `packageManager`           | No       | Configured package manager for the package. The default value is `yarn`.                                                                                                                                                                                                                                                                                         |\n| `service`                  | No       | The Shape ID of the service to generate a client for. If not provided, the code generator will attempt to infer the service Shape ID. If there is exactly 1 service found in the model, then the service is used as the inferred Shape ID. If no services are found, then code generation fails. If more than 1 service is found, then code generation fails.    |\n| `protocol`                 | No       | The Shape ID of the protocol used to generate serialization and deserialization. If not provided, the code generator will attempt to resolve the highest priority service protocol supported in code generation (registered through `TypeScriptIntegration`). If no protocols are found, code generation will use serialization and deserialization error stubs. |\n| `private`                  | No       | Whether the package is `private` in `package.json`. The default value is `false`.                                                                                                                                                                                                                                                                                |\n| `requiredMemberMode`       | No       | **NOT RECOMMENDED DUE TO BACKWARD COMPATIBILITY CONCERNS.** Sets whether members marked with the `@required` trait are allowed to be `undefined`. See more details on the risks in `TypeScriptSettings.RequiredMemberMode`. The default value is `nullable`.                                                                                                     |\n| `createDefaultReadme`      | No       | Whether to generate a default `README.md` for the package. The default value is `false`.                                                                                                                                                                                                                                                                         |\n| `disableDefaultValidation` | No       | Whether or not default validation is disabled. See [the documentation for Smithy TypeScript SSDK validation](https://smithy.io/2.0/languages/typescript/ts-ssdk/validation.html) to learn more. The default value is `false`.                                                                                                                                    |\n\n### Adding customizations to Smithy TypeScript\n\n#### Using third-party packages\n\nThird-party packages may provide implementations and integrations for code generation, and can be consumed like any other Java dependency. For example, [AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3) implements AWS customizations, protocols, and other utilities used for code generating the SDK, and can be consumed by importing the `software.amazon.smithy.typescript:smithy-aws-typescript-codegen` package.\n\nIn an idiomatic Smithy CLI project, the dependency can be added similar to how the core `smithy-typescript-codegen` dependency is added in [the section using Smithy TypeScript with the Smithy CLI](#using-smithy-typescript-with-the-smithy-cli).\n\nIn a Gradle project, the dependency can be added similar to how the core `smithy-typescript-codegen` dependency is added in [the section using Smithy TypeScript with Gradle](#using-smithy-typescript-with-gradle).\n\nIf a third-party package does not publish artifacts to an external code repository (e.g. Maven), the code may need to be built from source and published to the build environment's Maven Local Repository, typically through a command similar to `./gradlew publishToMavenLocal`.\n\n> Note: Currently there is no utility to remove or disable integrations that are loaded. If a third-party package's integration has behavior that is not expected (e.g. customizing without reacting to the model, settings, or feature flags), it may be an sign that the underlying implementation does not follow best practices.\n\n#### Customizations via `TypeScriptIntegration`\n\nSmithy TypeScript code generation can be customized by implementing [the `TypeScriptIntegration` interface](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/TypeScriptIntegration.java), which also extends [the `SmithyIntegration` interface](https://github.com/smithy-lang/smithy/blob/main/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SmithyIntegration.java). These integrations are typically implemented and packaged in Java Gradle projects that depend on `smithy-typescript-codegen` (for the `TypeScriptIntegration` interface) and built as consumable Java libraries.\n\nEach `TypeScriptIntegration` implementation consists of two paired changes:\n\n- An implementation of `TypeScriptIntegration`, and\n\n  ```java\n  // src/main/java/example/smithy/typescript/integration/ExampleSmithyTypeScriptIntegration.java\n\n  package example.smithy.typescript.integration;\n\n  // Import the TypeScriptIntegration interface\n  import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\n\n  public final class ExampleSmithyTypeScriptIntegration implements TypeScriptIntegration {\n    // Implement TypeScriptIntegration or SmithyIntegration methods, e.g. SmithyIntegration::customize\n  }\n  ```\n\n- A corresponding entry in the service loader for `TypeScriptIntegration`\n\n  ```java\n  // src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration\n  // Note that entry is the canonical name of the implemented TypeScriptIntegration\n  // To add more integrations, add an entry per line\n\n  example.smithy.typescript.integration.ExampleSmithyTypeScriptIntegration\n  ```\n\nOnce the Java libary is built, the library can be [consumed as a third-party package](#using-third-party-packages), and the integrations will automatically be loaded via [Java SPI](https://docs.oracle.com/javase/tutorial/ext/basics/spi.html).\n\nThe easiest way to see how the individual methods on `TypeScriptIntegration` (and by extension `SmithyIntegration`) are used in the code generation process is by searching by usage at a given Smithy TypeScript version, as method usages are subject to change.\n\n> Note: if an existing integration point does not exist on `TypeScriptIntegration` or `SmithyIntegration`, check if [the `RuntimeClientPlugin` abstraction](smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/RuntimeClientPlugin.java) has an integration point. If not, [create a feature request](https://github.com/smithy-lang/smithy-typescript/issues/new) with the incompatible use case.\n\n> Note: Although the `TypeScriptIntegration` interface is maintained with backward compatibility in mind, the interface may be subject to breaking changes as it is annotated with `@SmithyUnstableApi`. Methods may also have additional individual annotations that should be noted (e.g. `@SmithyInternalApi`).\n\nAn example of a Java Gradle project that provides customizations can be found in [`smithy-typescript-codegen-test/example-weather-customizations`](smithy-typescript-codegen-test/example-weather-customizations).\n\n#### TypeScript client configuration\n\nDuring code generation, code generators should provide a default value for each client's input configuration property through a client's runtime configuration. If there are use cases in which configuration may need a specific set of values (e.g. specific features like using HTTP/2), writing a `RuntimeExtension` that has those specific configuration property values may make sense.\n\nFor example, a team that publishes a client for the `Weather` service in a package named `@example/weather` may write and publish a `RuntimeExtension` that provides the configuration values needed to use HTTP/2 with the service:\n\n```typescript\n// Http2HandlerRuntimeExtension.ts published in package @example/weather-http-2-runtime-extension\n\nimport { RuntimeExtension, WeatherExtensionConfiguration } from \"@example/weather\";\nimport { NodeHttp2Handler } from \"@smithy/node-http-handler\";\n\nexport class Http2HandlerRuntimeExtension implements RuntimeExtension {\n  configure(extensionConfiguration: WeatherExtensionConfiguration): void {\n    console.log(\"Enabling HTTP/2\");\n    extensionConfiguration.setHttpHandler(new NodeHttp2Handler());\n  }\n}\n```\n\nThen customers can opt-in to using the extension at runtime using the `extensions` configuration property:\n\n```typescript\nimport { WeatherClient } from \"@example/weather\";\nimport { Http2HandlerRuntimeExtension } from \"@example/weather-http-2-runtime-extension\";\n\nconst client = new WeatherClient({\n  extensions: [new Http2HandlerRuntimeExtension()],\n});\n```\n\nFor more documentation, see [the `typescript-client-codegen` section](#client-sdk-code-generation-typescript-client-codegen-plugin).\n\n## Local Development\n\nThis repository is in developer preview, so local changes may be needed to both build and test the code generators.\n\nSee [the contributing guide](CONTRIBUTING.md) for more details.\n\n### Using local code generation changes\n\nSmithy TypeScript code generators depend on Smithy and the Smithy Gradle Plugin, and will by default use the version specified in `gradle.properties`. Any changes to dependencies require recursively republishing dependent packages.\n\n```text\nDependents of Smithy TypeScript\n└──Smithy TypeScript\n   ├── Smithy\n   └── Smithy Gradle Plugin\n```\n\nFor simplicity, only Smithy and Smithy TypeScript instructions are documented.\n\n> Note: the Smithy Gradle Plugin is under heavy development, so it may be difficult to test different versions.\n\n#### Smithy\n\nIf using local [Smithy](https://github.com/smithy-lang/smithy) changes, build `software.amazon.smithy.*` packages and publish the packages to a Maven Local Repository:\n\n```shell\ngit clone https://github.com/smithy-lang/smithy.git\ncd smithy\n# Make intended changes, e.g. checking out a certain commit\n./gradlew publishToMavenLocal\n```\n\nThen, update the `gradle.properties` property `smithyVersion` in the Smithy TypeScript repository locally to the artifacts' version if different than the current `smithyVersion`.\n\n#### Smithy TypeScript\n\nIf using local Smithy TypeScript changes, build the `software.amazon.smithy.typescript.*` packages and publish them to a Maven Local Repository:\n\n```shell\ngit clone https://github.com/smithy-lang/smithy-typescript.git\ncd smithy-typescript\n# Make intended changes, e.g. bumping the codegen artifact version\n./gradlew publishToMavenLocal\n```\n\nThen, update the dependent package code to depend on the published version if different than the current version.\n\n### TypeScript packages changes\n\nAll TypeScript packages are included in a [Yarn](https://yarnpkg.com/) workspace at the root of the repository:\n\n- Smithy Client SDK packages are in the `packages/` directory, and\n- Smithy Server SDK packages are in the `smithy-typescript-ssdk-libs/` directory.\n\nAt the root of the repository, scripts defined in the root `package.json` are managed by [Turbo](https://turbo.build/). Commonly used commands during development include:\n\n- `yarn build`: build all of the packages in the repository\n- `yarn test`: run the unit tests of all of the packages in the repository\n- `yarn test:integration`: build test clients in `smithy-typescript-codegen-test` via the `build-generated-test-packages.js` script, and then run the integration tests of all of the packages in the repository\n\nEach individual package will have at least the `build` script, and may have the `test` and `test:integration` scripts.\n\nFor Smithy Client SDK packages, changelogs and versioning are managed by [`changesets`](https://github.com/changesets/changesets). When making changes to these package, a changeset file will need to be added via `yarn changeset add` with an appropriate changelog message and version bump. See [the contribution guide](CONTRIBUTING.md#contributing-via-pull-requests) for more details.\n\n### Testing\n\nFor both code generation and TypeScript package changes, unit tests and integration tests needs to pass.\n\n- To run tests for TypeScript packages, run the following at the root level: `yarn test`.\n- To run tests for code generation, run the following at the root level: `./gradlew clean build check`.\n- To run integration tests that test both code generation and TypeScript packages using the test clients in `smithy-typescript-codegen-test`, run the following at the root level: `yarn test:integration`.\n\nAll of these checks will also run in GitHub actions when submitting a pull request or merging to `main`.\n\n#### Updating `smithy-typescript-codegen-test` models\n\nThe `smithy-typescript-codegen-test` contains test models that test whether TypeScript packages compile correctly and code generated.\n\nThese models can be edited to test additional traits, integrations, and settings, but new projections and smithy models can also be added to test changes in isolation.\n\nTo use a generated artifact in an integration test, update the `build-generated-test-packages.js` file to build and copy the generated artifacts to `node_modules/`. Then, import the package like any other dependency in `*.integ.spec.ts` test files.\n\n### Troubleshooting\n\nMany Gradle issues can be fixed by stopping the Gradle daemon by running `./gradlew --stop`.\n\n## License\n\nThis library is licensed under the Apache 2.0 License.\n"
  },
  {
    "path": "api-extractor.json",
    "content": "{\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json\",\n  \"mainEntryPointFilePath\": \"<projectFolder>/lib/index.d.ts\",\n  \"compiler\": {},\n  \"apiReport\": {\n    \"enabled\": true,\n    \"reportFolder\": \"./api-extractor/\",\n    \"reportTempFolder\": \"./api-extractor/\",\n    \"includeForgottenExports\": true\n  },\n  \"docModel\": {\n    \"enabled\": true,\n    \"apiJsonFilePath\": \"./api-extractor/<unscopedPackageName>.api.json\"\n  },\n  \"dtsRollup\": {\n    \"enabled\": false,\n    \"untrimmedFilePath\": \"./dist/<unscopedPackageName>.d.ts\"\n  },\n  \"tsdocMetadata\": {},\n  \"messages\": {\n    \"compilerMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"warning\"\n      }\n    },\n    \"extractorMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"warning\"\n      }\n    },\n    \"tsdocMessageReporting\": {\n      \"default\": {\n        \"logLevel\": \"warning\"\n      }\n    },\n    \"extractorMessageReporting\": {\n      \"ae-wrong-input-file-type\": {\n        \"logLevel\": \"none\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "api-extractor.packages.json",
    "content": "{\n  \"extends\": \"./api-extractor.json\",\n  \"docModel\": {\n    \"apiJsonFilePath\": \"./api-extractor-packages/<unscopedPackageName>.api.json\"\n  },\n  \"apiReport\": {\n    \"reportFolder\": \"./api-extractor-packages/\",\n    \"reportTempFolder\": \"./api-extractor-packages/\"\n  }\n}\n"
  },
  {
    "path": "api-snapshot/api.json",
    "content": "{\n  \"@smithy/abort-controller\": {\n    \"AbortController\": \"function\",\n    \"AbortHandler\": \"type(interface)\",\n    \"AbortSignal\": \"function\",\n    \"IAbortController\": \"type(interface)\",\n    \"IAbortSignal\": \"type(interface)\"\n  },\n  \"@smithy/chunked-blob-reader\": {\n    \"blobReader\": \"function\"\n  },\n  \"@smithy/chunked-blob-reader-native\": {\n    \"blobReader\": \"function\"\n  },\n  \"@smithy/config-resolver\": {\n    \"CONFIG_USE_DUALSTACK_ENDPOINT\": \"string\",\n    \"CONFIG_USE_FIPS_ENDPOINT\": \"string\",\n    \"CustomEndpointsInputConfig\": \"type(interface)\",\n    \"CustomEndpointsResolvedConfig\": \"type(interface)\",\n    \"DEFAULT_USE_DUALSTACK_ENDPOINT\": \"boolean\",\n    \"DEFAULT_USE_FIPS_ENDPOINT\": \"boolean\",\n    \"EndpointsInputConfig\": \"type(interface)\",\n    \"EndpointsResolvedConfig\": \"type(interface)\",\n    \"EndpointVariant\": \"type(object)\",\n    \"EndpointVariantTag\": \"type(union)\",\n    \"ENV_USE_DUALSTACK_ENDPOINT\": \"string\",\n    \"ENV_USE_FIPS_ENDPOINT\": \"string\",\n    \"getRegionInfo\": \"function\",\n    \"GetRegionInfoOptions\": \"type(interface)\",\n    \"NODE_REGION_CONFIG_FILE_OPTIONS\": \"object\",\n    \"NODE_REGION_CONFIG_OPTIONS\": \"object\",\n    \"NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS\": \"object\",\n    \"NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS\": \"object\",\n    \"nodeDualstackConfigSelectors\": \"object\",\n    \"nodeFipsConfigSelectors\": \"object\",\n    \"PartitionHash\": \"type(object)\",\n    \"REGION_ENV_NAME\": \"string\",\n    \"REGION_INI_NAME\": \"string\",\n    \"RegionHash\": \"type(object)\",\n    \"RegionInputConfig\": \"type(interface)\",\n    \"RegionResolvedConfig\": \"type(interface)\",\n    \"resolveCustomEndpointsConfig\": \"function\",\n    \"resolveEndpointsConfig\": \"function\",\n    \"resolveRegionConfig\": \"function\"\n  },\n  \"@smithy/core\": {\n    \"createIsIdentityExpiredFunction\": \"function\",\n    \"createPaginator\": \"function\",\n    \"DefaultIdentityProviderConfig\": \"function\",\n    \"doesIdentityRequireRefresh\": \"function\",\n    \"EXPIRATION_MS\": \"number\",\n    \"getHttpAuthSchemeEndpointRuleSetPlugin\": \"function\",\n    \"getHttpAuthSchemePlugin\": \"function\",\n    \"getHttpSigningPlugin\": \"function\",\n    \"getSmithyContext\": \"function\",\n    \"HttpApiKeyAuthSigner\": \"function\",\n    \"httpAuthSchemeEndpointRuleSetMiddlewareOptions\": \"object\",\n    \"httpAuthSchemeMiddleware\": \"function\",\n    \"httpAuthSchemeMiddlewareOptions\": \"object\",\n    \"HttpBearerAuthSigner\": \"function\",\n    \"httpSigningMiddleware\": \"function\",\n    \"httpSigningMiddlewareOptions\": \"object\",\n    \"isIdentityExpired\": \"function\",\n    \"MemoizedIdentityProvider\": \"type(interface)\",\n    \"memoizeIdentityProvider\": \"function\",\n    \"NoAuthSigner\": \"function\",\n    \"normalizeProvider\": \"function\",\n    \"PreviouslyResolved\": \"type(interface)\",\n    \"requestBuilder\": \"function\",\n    \"setFeature\": \"function\"\n  },\n  \"@smithy/core/cbor\": {\n    \"buildHttpRpcRequest\": \"function\",\n    \"cbor\": \"object\",\n    \"CborCodec\": \"function\",\n    \"CborShapeDeserializer\": \"function\",\n    \"CborShapeSerializer\": \"function\",\n    \"checkCborResponse\": \"function\",\n    \"dateToTag\": \"function\",\n    \"loadSmithyRpcV2CborErrorCode\": \"function\",\n    \"parseCborBody\": \"function\",\n    \"parseCborErrorBody\": \"function\",\n    \"SmithyRpcV2CborProtocol\": \"function\",\n    \"tag\": \"function\",\n    \"tagSymbol\": \"symbol\"\n  },\n  \"@smithy/core/checksum\": {\n    \"blobHasher\": \"function\",\n    \"blobReader\": \"function\",\n    \"fileStreamHasher\": \"function(node-only)\",\n    \"Md5\": \"function\",\n    \"readableStreamHasher\": \"function(node-only)\"\n  },\n  \"@smithy/core/client\": {\n    \"_json\": \"function\",\n    \"AlgorithmId\": \"object\",\n    \"checkExceptions\": \"function\",\n    \"ChecksumAlgorithm\": \"type(interface)\",\n    \"ChecksumConfiguration\": \"type(interface)\",\n    \"Client\": \"function\",\n    \"Command\": \"function\",\n    \"CommandImpl\": \"type(interface)\",\n    \"ConditionalLazyValueInstruction\": \"type(object)\",\n    \"ConditionalValueInstruction\": \"type(object)\",\n    \"constructStack\": \"function\",\n    \"convertMap\": \"function\",\n    \"createAggregatedClient\": \"function\",\n    \"createWaiter\": \"function\",\n    \"decorateServiceException\": \"function\",\n    \"DefaultExtensionRuntimeConfigType\": \"type(intersection)\",\n    \"DefaultsMode\": \"type(union)\",\n    \"DefaultsModeConfigs\": \"type(interface)\",\n    \"emitWarningIfUnsupportedVersion\": \"function\",\n    \"ExceptionOptionType\": \"type(object)\",\n    \"FilterStatus\": \"type(alias)\",\n    \"FilterStatusSupplier\": \"type(object)\",\n    \"getArrayIfSingleItem\": \"function\",\n    \"getChecksumConfiguration\": \"function\",\n    \"getDefaultClientConfiguration\": \"function\",\n    \"getDefaultExtensionConfiguration\": \"function\",\n    \"getRetryConfiguration\": \"function\",\n    \"getSmithyContext\": \"function\",\n    \"getValueFromTextNode\": \"function\",\n    \"invalidFunction\": \"function\",\n    \"invalidProvider\": \"function\",\n    \"isSerializableHeaderValue\": \"function\",\n    \"LazyValueInstruction\": \"type(object)\",\n    \"loadConfigsForDefaultMode\": \"function\",\n    \"map\": \"function\",\n    \"NoOpLogger\": \"function\",\n    \"normalizeProvider\": \"function\",\n    \"ObjectMappingInstruction\": \"type(alias)\",\n    \"ObjectMappingInstructions\": \"type(object)\",\n    \"PartialChecksumRuntimeConfigType\": \"type(object)\",\n    \"PartialRetryRuntimeConfigType\": \"type(object)\",\n    \"resolveChecksumRuntimeConfig\": \"function\",\n    \"ResolvedDefaultsMode\": \"type(union)\",\n    \"resolveDefaultRuntimeConfig\": \"function\",\n    \"resolveRetryRuntimeConfig\": \"function\",\n    \"schemaLogFilter\": \"function\",\n    \"SENSITIVE_STRING\": \"string\",\n    \"serializeDateTime\": \"function\",\n    \"serializeFloat\": \"function\",\n    \"ServiceException\": \"function\",\n    \"ServiceExceptionOptions\": \"type(interface)\",\n    \"SimpleValueInstruction\": \"type(object)\",\n    \"SmithyConfiguration\": \"type(interface)\",\n    \"SmithyResolvedConfiguration\": \"type(object)\",\n    \"SourceMappingInstruction\": \"type(object)\",\n    \"SourceMappingInstructions\": \"type(object)\",\n    \"take\": \"function\",\n    \"throwDefaultError\": \"function\",\n    \"UnfilteredValue\": \"type(alias)\",\n    \"Value\": \"type(alias)\",\n    \"ValueFilteringFunction\": \"type(object)\",\n    \"ValueMapper\": \"type(object)\",\n    \"ValueSupplier\": \"type(object)\",\n    \"WaiterConfiguration\": \"type(interface)\",\n    \"WaiterOptions\": \"type(intersection)\",\n    \"WaiterResult\": \"type(object)\",\n    \"waiterServiceDefaults\": \"object\",\n    \"WaiterState\": \"object\",\n    \"withBaseException\": \"function\"\n  },\n  \"@smithy/core/config\": {\n    \"booleanSelector\": \"function\",\n    \"chain\": \"function\",\n    \"CONFIG_PREFIX_SEPARATOR\": \"string(node-only)\",\n    \"CONFIG_USE_DUALSTACK_ENDPOINT\": \"string(node-only)\",\n    \"CONFIG_USE_FIPS_ENDPOINT\": \"string(node-only)\",\n    \"CredentialsProviderError\": \"function\",\n    \"CustomEndpointsInputConfig\": \"type(interface)\",\n    \"CustomEndpointsResolvedConfig\": \"type(interface)\",\n    \"DEFAULT_PROFILE\": \"string\",\n    \"DEFAULT_USE_DUALSTACK_ENDPOINT\": \"boolean\",\n    \"DEFAULT_USE_FIPS_ENDPOINT\": \"boolean\",\n    \"EndpointsInputConfig\": \"type(interface)\",\n    \"EndpointsResolvedConfig\": \"type(interface)\",\n    \"EndpointVariant\": \"type(object)\",\n    \"EndpointVariantTag\": \"type(union)\",\n    \"ENV_PROFILE\": \"string(node-only)\",\n    \"ENV_USE_DUALSTACK_ENDPOINT\": \"string(node-only)\",\n    \"ENV_USE_FIPS_ENDPOINT\": \"string(node-only)\",\n    \"EnvOptions\": \"type(interface)\",\n    \"externalDataInterceptor\": \"object(node-only)\",\n    \"fromStatic\": \"function(node-only)\",\n    \"fromValue\": \"function\",\n    \"getHomeDir\": \"function(node-only)\",\n    \"getProfileName\": \"function(node-only)\",\n    \"getRegionInfo\": \"function\",\n    \"GetRegionInfoOptions\": \"type(interface)\",\n    \"getSSOTokenFilepath\": \"function(node-only)\",\n    \"getSSOTokenFromFile\": \"function(node-only)\",\n    \"GetterFromConfig\": \"type(object)\",\n    \"GetterFromEnv\": \"type(object)\",\n    \"loadConfig\": \"function(node-only)\",\n    \"LoadedConfigSelectors\": \"type(interface)\",\n    \"loadSharedConfigFiles\": \"function(node-only)\",\n    \"loadSsoSessionData\": \"function(node-only)\",\n    \"LocalConfigOptions\": \"type(intersection)\",\n    \"memoize\": \"function\",\n    \"NODE_REGION_CONFIG_FILE_OPTIONS\": \"object(node-only)\",\n    \"NODE_REGION_CONFIG_OPTIONS\": \"object(node-only)\",\n    \"NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS\": \"object(node-only)\",\n    \"NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS\": \"object(node-only)\",\n    \"nodeDualstackConfigSelectors\": \"object(node-only)\",\n    \"nodeFipsConfigSelectors\": \"object(node-only)\",\n    \"NodeSharedConfigInit\": \"type(interface)\",\n    \"numberSelector\": \"function\",\n    \"ParsedIniData\": \"type(object)\",\n    \"parseKnownFiles\": \"function(node-only)\",\n    \"PartitionHash\": \"type(object)\",\n    \"Profile\": \"type(object)\",\n    \"ProviderError\": \"function\",\n    \"ProviderErrorOptionsType\": \"type(object)\",\n    \"readFile\": \"function(node-only)\",\n    \"ReadFileOptions\": \"type(interface)\",\n    \"REGION_ENV_NAME\": \"string(node-only)\",\n    \"REGION_INI_NAME\": \"string(node-only)\",\n    \"RegionHash\": \"type(object)\",\n    \"RegionInputConfig\": \"type(interface)\",\n    \"RegionResolvedConfig\": \"type(interface)\",\n    \"resolveCustomEndpointsConfig\": \"function\",\n    \"resolveDefaultsModeConfig\": \"function\",\n    \"ResolveDefaultsModeConfigOptions\": \"type(interface)\",\n    \"resolveEndpointsConfig\": \"function\",\n    \"resolveRegionConfig\": \"function\",\n    \"SelectorType\": \"object\",\n    \"SharedConfigFiles\": \"type(object)\",\n    \"SharedConfigInit\": \"type(interface)\",\n    \"SourceProfileInit\": \"type(interface)\",\n    \"SsoSessionInit\": \"type(interface)\",\n    \"SSOToken\": \"type(interface)\",\n    \"TokenProviderError\": \"function\"\n  },\n  \"@smithy/core/endpoints\": {\n    \"BinaryDecisionDiagram\": \"function\",\n    \"BuiltInParamInstruction\": \"type(interface)\",\n    \"ClientContextParamInstruction\": \"type(interface)\",\n    \"ConditionObject\": \"type(intersection)\",\n    \"ContextParamInstruction\": \"type(interface)\",\n    \"customEndpointFunctions\": \"object\",\n    \"decideEndpoint\": \"function\",\n    \"DeprecatedObject\": \"type(object)\",\n    \"EndpointCache\": \"function\",\n    \"EndpointError\": \"function\",\n    \"EndpointFunctions\": \"type(object)\",\n    \"EndpointInputConfig\": \"type(interface)\",\n    \"endpointMiddleware\": \"function\",\n    \"endpointMiddlewareOptions\": \"object\",\n    \"EndpointObject\": \"type(object)\",\n    \"EndpointObjectHeaders\": \"type(object)\",\n    \"EndpointObjectProperties\": \"type(object)\",\n    \"EndpointParameterInstructions\": \"type(interface)\",\n    \"EndpointParameterInstructionsSupplier\": \"type(object)\",\n    \"EndpointParams\": \"type(object)\",\n    \"EndpointRequiredInputConfig\": \"type(interface)\",\n    \"EndpointRequiredResolvedConfig\": \"type(interface)\",\n    \"EndpointResolvedConfig\": \"type(interface)\",\n    \"EndpointResolverOptions\": \"type(object)\",\n    \"EndpointRuleObject\": \"type(object)\",\n    \"ErrorRuleObject\": \"type(object)\",\n    \"EvaluateOptions\": \"type(intersection)\",\n    \"Expression\": \"type(union)\",\n    \"FunctionArgv\": \"type(object)\",\n    \"FunctionObject\": \"type(object)\",\n    \"FunctionReturn\": \"type(union)\",\n    \"getEndpointFromInstructions\": \"function\",\n    \"getEndpointPlugin\": \"function\",\n    \"isIpAddress\": \"function\",\n    \"isValidHostLabel\": \"function\",\n    \"middlewareEndpointToEndpointV1\": \"function\",\n    \"OperationContextParamInstruction\": \"type(interface)\",\n    \"ParameterObject\": \"type(object)\",\n    \"ReferenceObject\": \"type(object)\",\n    \"ReferenceRecord\": \"type(object)\",\n    \"resolveEndpoint\": \"function\",\n    \"resolveEndpointConfig\": \"function\",\n    \"resolveEndpointRequiredConfig\": \"function\",\n    \"resolveParams\": \"function\",\n    \"RuleSetObject\": \"type(object)\",\n    \"RuleSetRules\": \"type(object)\",\n    \"StaticContextParamInstruction\": \"type(interface)\",\n    \"toEndpointV1\": \"function\",\n    \"TreeRuleObject\": \"type(object)\"\n  },\n  \"@smithy/core/event-streams\": {\n    \"BinaryHeaderValue\": \"type(object)\",\n    \"BooleanHeaderValue\": \"type(object)\",\n    \"ByteHeaderValue\": \"type(object)\",\n    \"EventStreamCodec\": \"function\",\n    \"EventStreamMarshaller\": \"function\",\n    \"EventStreamMarshallerOptions\": \"type(interface)\",\n    \"EventStreamSerde\": \"function\",\n    \"EventStreamSerdeInputConfig\": \"type(interface)\",\n    \"eventStreamSerdeProvider\": \"function\",\n    \"EventStreamSerdeResolvedConfig\": \"type(interface)\",\n    \"getChunkedStream\": \"function\",\n    \"getMessageUnmarshaller\": \"function\",\n    \"getUnmarshalledStream\": \"function\",\n    \"HeaderMarshaller\": \"function\",\n    \"Int64\": \"function\",\n    \"IntegerHeaderValue\": \"type(object)\",\n    \"iterableToReadableStream\": \"function\",\n    \"LongHeaderValue\": \"type(object)\",\n    \"Message\": \"type(interface)\",\n    \"MessageDecoderStream\": \"function\",\n    \"MessageDecoderStreamOptions\": \"type(interface)\",\n    \"MessageEncoderStream\": \"function\",\n    \"MessageEncoderStreamOptions\": \"type(interface)\",\n    \"MessageHeaders\": \"type(object)\",\n    \"MessageHeaderValue\": \"type(union)\",\n    \"readableStreamToIterable\": \"function\",\n    \"resolveEventStreamSerdeConfig\": \"function\",\n    \"ShortHeaderValue\": \"type(object)\",\n    \"SmithyMessageDecoderStream\": \"function\",\n    \"SmithyMessageDecoderStreamOptions\": \"type(interface)\",\n    \"SmithyMessageEncoderStream\": \"function\",\n    \"SmithyMessageEncoderStreamOptions\": \"type(interface)\",\n    \"StringHeaderValue\": \"type(object)\",\n    \"TimestampHeaderValue\": \"type(object)\",\n    \"UniversalEventStreamMarshaller\": \"function\",\n    \"UniversalEventStreamMarshallerOptions\": \"type(interface)\",\n    \"universalEventStreamSerdeProvider\": \"function\",\n    \"UnmarshalledStreamOptions\": \"type(object)\",\n    \"UuidHeaderValue\": \"type(object)\"\n  },\n  \"@smithy/core/protocols\": {\n    \"buildQueryString\": \"function\",\n    \"collectBody\": \"function\",\n    \"contentLengthMiddleware\": \"function\",\n    \"contentLengthMiddlewareOptions\": \"object\",\n    \"determineTimestampFormat\": \"function\",\n    \"escapeUri\": \"function\",\n    \"escapeUriPath\": \"function\",\n    \"extendedEncodeURIComponent\": \"function\",\n    \"Field\": \"function\",\n    \"FieldOptions\": \"type(object)\",\n    \"FieldPosition\": \"type(union)\",\n    \"Fields\": \"function\",\n    \"FieldsOptions\": \"type(object)\",\n    \"FromStringShapeDeserializer\": \"function\",\n    \"getContentLengthPlugin\": \"function\",\n    \"getHttpHandlerExtensionConfiguration\": \"function\",\n    \"HeaderBag\": \"type(object)\",\n    \"HttpBindingProtocol\": \"function\",\n    \"HttpHandler\": \"type(intersection)\",\n    \"HttpHandlerExtensionConfigType\": \"type(object)\",\n    \"HttpHandlerExtensionConfiguration\": \"type(interface)\",\n    \"HttpHandlerOptions\": \"type(object)\",\n    \"HttpHandlerUserInput\": \"type(union)\",\n    \"HttpInterceptingShapeDeserializer\": \"function\",\n    \"HttpInterceptingShapeSerializer\": \"function\",\n    \"HttpMessage\": \"type(object)\",\n    \"HttpProtocol\": \"function\",\n    \"HttpRequest\": \"function\",\n    \"HttpResponse\": \"function\",\n    \"IHttpRequest\": \"type(interface)\",\n    \"isValidHostname\": \"function\",\n    \"parseQueryString\": \"function\",\n    \"parseUrl\": \"function\",\n    \"requestBuilder\": \"function\",\n    \"RequestBuilder\": \"function\",\n    \"resolvedPath\": \"function\",\n    \"resolveHttpHandlerRuntimeConfig\": \"function\",\n    \"RpcProtocol\": \"function\",\n    \"SerdeContext\": \"function\",\n    \"ToStringShapeSerializer\": \"function\"\n  },\n  \"@smithy/core/retry\": {\n    \"AdaptiveRetryStrategy\": \"function\",\n    \"AdaptiveRetryStrategyOptions\": \"type(interface)\",\n    \"CONFIG_MAX_ATTEMPTS\": \"string(node-only)\",\n    \"CONFIG_RETRY_MODE\": \"string(node-only)\",\n    \"ConfiguredRetryStrategy\": \"function\",\n    \"DEFAULT_MAX_ATTEMPTS\": \"number\",\n    \"DEFAULT_RETRY_DELAY_BASE\": \"number\",\n    \"DEFAULT_RETRY_MODE\": \"string\",\n    \"defaultDelayDecider\": \"function\",\n    \"DefaultRateLimiter\": \"function\",\n    \"DefaultRateLimiterOptions\": \"type(interface)\",\n    \"defaultRetryDecider\": \"function\",\n    \"DeprecatedAdaptiveRetryStrategy\": \"function\",\n    \"DeprecatedAdaptiveRetryStrategyOptions\": \"type(interface)\",\n    \"DeprecatedStandardRetryStrategy\": \"function\",\n    \"DeprecatedStandardRetryStrategyOptions\": \"type(interface)\",\n    \"ENV_MAX_ATTEMPTS\": \"string(node-only)\",\n    \"ENV_RETRY_MODE\": \"string(node-only)\",\n    \"getOmitRetryHeadersPlugin\": \"function\",\n    \"getRetryAfterHint\": \"function\",\n    \"getRetryPlugin\": \"function\",\n    \"INITIAL_RETRY_TOKENS\": \"number\",\n    \"INVOCATION_ID_HEADER\": \"string\",\n    \"isBrowserNetworkError\": \"function\",\n    \"isClockSkewCorrectedError\": \"function\",\n    \"isClockSkewError\": \"function\",\n    \"isNodeJsHttp2TransientError\": \"function\",\n    \"isRetryableByTrait\": \"function\",\n    \"isServerError\": \"function\",\n    \"isThrottlingError\": \"function\",\n    \"isTransientError\": \"function\",\n    \"MAXIMUM_RETRY_DELAY\": \"number\",\n    \"NO_RETRY_INCREMENT\": \"number\",\n    \"NODE_MAX_ATTEMPT_CONFIG_OPTIONS\": \"object(node-only)\",\n    \"NODE_RETRY_MODE_CONFIG_OPTIONS\": \"object(node-only)\",\n    \"omitRetryHeadersMiddleware\": \"function\",\n    \"omitRetryHeadersMiddlewareOptions\": \"object\",\n    \"PreviouslyResolved\": \"type(interface)\",\n    \"RateLimiter\": \"type(interface)\",\n    \"REQUEST_HEADER\": \"string\",\n    \"resolveRetryConfig\": \"function\",\n    \"Retry\": \"function\",\n    \"RETRY_COST\": \"number\",\n    \"RETRY_MODES\": \"object\",\n    \"RetryInputConfig\": \"type(interface)\",\n    \"retryMiddleware\": \"function\",\n    \"retryMiddlewareOptions\": \"object\",\n    \"RetryResolvedConfig\": \"type(interface)\",\n    \"StandardRetryStrategy\": \"function\",\n    \"StandardRetryStrategyOptions\": \"type(object)\",\n    \"THROTTLING_RETRY_DELAY_BASE\": \"number\",\n    \"TIMEOUT_RETRY_COST\": \"number\"\n  },\n  \"@smithy/core/schema\": {\n    \"deref\": \"function\",\n    \"deserializerMiddlewareOption\": \"object\",\n    \"error\": \"function\",\n    \"ErrorSchema\": \"function\",\n    \"getSchemaSerdePlugin\": \"function\",\n    \"isStaticSchema\": \"function\",\n    \"list\": \"function\",\n    \"ListSchema\": \"function\",\n    \"map\": \"function\",\n    \"MapSchema\": \"function\",\n    \"NormalizedSchema\": \"function\",\n    \"op\": \"function\",\n    \"operation\": \"function\",\n    \"OperationSchema\": \"function\",\n    \"Schema\": \"function\",\n    \"SCHEMA\": \"object\",\n    \"serializerMiddlewareOption\": \"object\",\n    \"sim\": \"function\",\n    \"simAdapter\": \"function\",\n    \"SimpleSchema\": \"function\",\n    \"simpleSchemaCacheN\": \"object\",\n    \"simpleSchemaCacheS\": \"object\",\n    \"struct\": \"function\",\n    \"StructureSchema\": \"function\",\n    \"traitsCache\": \"object\",\n    \"translateTraits\": \"function\",\n    \"TypeRegistry\": \"function\"\n  },\n  \"@smithy/core/serde\": {\n    \"_parseEpochTimestamp\": \"function\",\n    \"_parseRfc3339DateTimeWithOffset\": \"function\",\n    \"_parseRfc7231DateTime\": \"function\",\n    \"AutomaticJsonStringConversion\": \"type(alias)\",\n    \"calculateBodyLength\": \"function\",\n    \"ChecksumStream\": \"function\",\n    \"ChecksumStreamInit\": \"type(interface)\",\n    \"copyDocumentWithTransform\": \"function\",\n    \"createBufferedReadable\": \"function\",\n    \"createChecksumStream\": \"function\",\n    \"dateToUtcString\": \"function\",\n    \"deserializerMiddleware\": \"function\",\n    \"deserializerMiddlewareOption\": \"object\",\n    \"expectBoolean\": \"function\",\n    \"expectByte\": \"function\",\n    \"expectFloat32\": \"function\",\n    \"expectInt\": \"function\",\n    \"expectInt32\": \"function\",\n    \"expectLong\": \"function\",\n    \"expectNonNull\": \"function\",\n    \"expectNumber\": \"function\",\n    \"expectObject\": \"function\",\n    \"expectShort\": \"function\",\n    \"expectString\": \"function\",\n    \"expectUnion\": \"function\",\n    \"fromArrayBuffer\": \"function(node-only)\",\n    \"fromBase64\": \"function\",\n    \"fromHex\": \"function\",\n    \"fromString\": \"function(node-only)\",\n    \"fromUtf8\": \"function\",\n    \"generateIdempotencyToken\": \"function\",\n    \"getAwsChunkedEncodingStream\": \"function\",\n    \"getSerdePlugin\": \"function\",\n    \"handleFloat\": \"function\",\n    \"Hash\": \"function(node-only)\",\n    \"headStream\": \"function\",\n    \"isArrayBuffer\": \"function\",\n    \"isBlob\": \"function\",\n    \"isReadableStream\": \"function\",\n    \"LazyJsonString\": \"function\",\n    \"limitedParseDouble\": \"function\",\n    \"limitedParseFloat\": \"function\",\n    \"limitedParseFloat32\": \"function\",\n    \"logger\": \"object\",\n    \"NumericType\": \"type(alias)\",\n    \"NumericValue\": \"function\",\n    \"nv\": \"function\",\n    \"parseBoolean\": \"function\",\n    \"parseEpochTimestamp\": \"function\",\n    \"parseRfc3339DateTime\": \"function\",\n    \"parseRfc3339DateTimeWithOffset\": \"function\",\n    \"parseRfc7231DateTime\": \"function\",\n    \"quoteHeader\": \"function\",\n    \"sdkStreamMixin\": \"function\",\n    \"serializerMiddleware\": \"function\",\n    \"serializerMiddlewareOption\": \"object\",\n    \"splitEvery\": \"function\",\n    \"splitHeader\": \"function\",\n    \"splitStream\": \"function\",\n    \"strictParseByte\": \"function\",\n    \"strictParseDouble\": \"function\",\n    \"strictParseFloat\": \"function\",\n    \"strictParseFloat32\": \"function\",\n    \"strictParseInt\": \"function\",\n    \"strictParseInt32\": \"function\",\n    \"strictParseLong\": \"function\",\n    \"strictParseShort\": \"function\",\n    \"StringEncoding\": \"type(union)\",\n    \"toBase64\": \"function\",\n    \"toHex\": \"function\",\n    \"toUint8Array\": \"function\",\n    \"toUtf8\": \"function\",\n    \"Uint8ArrayBlobAdapter\": \"function\",\n    \"V1OrV2Endpoint\": \"type(object)\",\n    \"v4\": \"function\"\n  },\n  \"@smithy/credential-provider-imds\": {\n    \"DEFAULT_MAX_RETRIES\": \"number\",\n    \"DEFAULT_TIMEOUT\": \"number\",\n    \"Endpoint\": \"object\",\n    \"ENV_CMDS_AUTH_TOKEN\": \"string\",\n    \"ENV_CMDS_FULL_URI\": \"string\",\n    \"ENV_CMDS_RELATIVE_URI\": \"string\",\n    \"fromContainerMetadata\": \"function\",\n    \"fromInstanceMetadata\": \"function\",\n    \"getInstanceMetadataEndpoint\": \"function\",\n    \"httpRequest\": \"function\",\n    \"InstanceMetadataCredentials\": \"type(interface)\",\n    \"providerConfigFromInit\": \"function\",\n    \"RemoteProviderConfig\": \"type(interface)\",\n    \"RemoteProviderInit\": \"type(interface)\"\n  },\n  \"@smithy/eventstream-codec\": {\n    \"BinaryHeaderValue\": \"type(object)\",\n    \"BooleanHeaderValue\": \"type(object)\",\n    \"ByteHeaderValue\": \"type(object)\",\n    \"EventStreamCodec\": \"function\",\n    \"HeaderMarshaller\": \"function\",\n    \"Int64\": \"function\",\n    \"IntegerHeaderValue\": \"type(object)\",\n    \"LongHeaderValue\": \"type(object)\",\n    \"Message\": \"type(interface)\",\n    \"MessageDecoderStream\": \"function\",\n    \"MessageDecoderStreamOptions\": \"type(interface)\",\n    \"MessageEncoderStream\": \"function\",\n    \"MessageEncoderStreamOptions\": \"type(interface)\",\n    \"MessageHeaders\": \"type(object)\",\n    \"MessageHeaderValue\": \"type(union)\",\n    \"ShortHeaderValue\": \"type(object)\",\n    \"SmithyMessageDecoderStream\": \"function\",\n    \"SmithyMessageDecoderStreamOptions\": \"type(interface)\",\n    \"SmithyMessageEncoderStream\": \"function\",\n    \"SmithyMessageEncoderStreamOptions\": \"type(interface)\",\n    \"StringHeaderValue\": \"type(object)\",\n    \"TimestampHeaderValue\": \"type(object)\",\n    \"UuidHeaderValue\": \"type(object)\"\n  },\n  \"@smithy/eventstream-serde-browser\": {\n    \"EventStreamMarshaller\": \"function\",\n    \"EventStreamMarshallerOptions\": \"type(interface)\",\n    \"eventStreamSerdeProvider\": \"function\",\n    \"iterableToReadableStream\": \"function\",\n    \"readableStreamtoIterable\": \"function\"\n  },\n  \"@smithy/eventstream-serde-config-resolver\": {\n    \"EventStreamSerdeInputConfig\": \"type(interface)\",\n    \"EventStreamSerdeResolvedConfig\": \"type(interface)\",\n    \"resolveEventStreamSerdeConfig\": \"function\"\n  },\n  \"@smithy/eventstream-serde-node\": {\n    \"EventStreamMarshaller\": \"function\",\n    \"EventStreamMarshallerOptions\": \"type(interface)\",\n    \"eventStreamSerdeProvider\": \"function\"\n  },\n  \"@smithy/eventstream-serde-universal\": {\n    \"EventStreamMarshaller\": \"function\",\n    \"EventStreamMarshallerOptions\": \"type(interface)\",\n    \"eventStreamSerdeProvider\": \"function\"\n  },\n  \"@smithy/experimental-identity-and-auth\": {\n    \"ApiKeyIdentity\": \"type(interface)\",\n    \"ApiKeyIdentityProvider\": \"type(object)\",\n    \"createEndpointRuleSetHttpAuthSchemeParametersProvider\": \"function\",\n    \"createEndpointRuleSetHttpAuthSchemeProvider\": \"function\",\n    \"createIsIdentityExpiredFunction\": \"function\",\n    \"DefaultEndpointResolver\": \"type(interface)\",\n    \"DefaultIdentityProviderConfig\": \"function\",\n    \"doesIdentityRequireRefresh\": \"function\",\n    \"EndpointRuleSetHttpAuthSchemeParametersProvider\": \"type(interface)\",\n    \"EndpointRuleSetHttpAuthSchemeProvider\": \"type(interface)\",\n    \"EndpointRuleSetSmithyContext\": \"type(interface)\",\n    \"EXPIRATION_MS\": \"number\",\n    \"getHttpAuthSchemeEndpointRuleSetPlugin\": \"function\",\n    \"getHttpAuthSchemePlugin\": \"function\",\n    \"getHttpSigningPlugin\": \"function\",\n    \"HttpApiKeyAuthLocation\": \"object\",\n    \"HttpApiKeyAuthSigner\": \"function\",\n    \"HttpAuthOption\": \"type(interface)\",\n    \"HttpAuthScheme\": \"type(interface)\",\n    \"httpAuthSchemeEndpointRuleSetMiddlewareOptions\": \"object\",\n    \"HttpAuthSchemeId\": \"type(string)\",\n    \"httpAuthSchemeMiddleware\": \"function\",\n    \"httpAuthSchemeMiddlewareOptions\": \"object\",\n    \"HttpAuthSchemeParameters\": \"type(interface)\",\n    \"HttpAuthSchemeParametersProvider\": \"type(interface)\",\n    \"HttpAuthSchemeProvider\": \"type(interface)\",\n    \"HttpBearerAuthSigner\": \"function\",\n    \"HttpSigner\": \"type(interface)\",\n    \"httpSigningMiddleware\": \"function\",\n    \"httpSigningMiddlewareOptions\": \"object\",\n    \"IdentityProviderConfig\": \"type(interface)\",\n    \"isIdentityExpired\": \"function\",\n    \"MemoizedIdentityProvider\": \"type(interface)\",\n    \"memoizeIdentityProvider\": \"function\",\n    \"NoAuthSigner\": \"function\",\n    \"PreviouslyResolved\": \"type(interface)\",\n    \"SelectedHttpAuthScheme\": \"type(interface)\",\n    \"SigV4Signer\": \"function\",\n    \"TokenIdentity\": \"type(interface)\",\n    \"TokenIdentityProvider\": \"type(object)\"\n  },\n  \"@smithy/fetch-http-handler\": {\n    \"AdditionalRequestParameters\": \"type(object)\",\n    \"FetchHttpHandler\": \"function\",\n    \"FetchHttpHandlerOptions\": \"type(interface)\",\n    \"keepAliveSupport\": \"object\",\n    \"streamCollector\": \"function\"\n  },\n  \"@smithy/hash-blob-browser\": {\n    \"blobHasher\": \"function\"\n  },\n  \"@smithy/hash-node\": {\n    \"Hash\": \"function\"\n  },\n  \"@smithy/hash-stream-node\": {\n    \"fileStreamHasher\": \"function\",\n    \"readableStreamHasher\": \"function\"\n  },\n  \"@smithy/invalid-dependency\": {\n    \"invalidFunction\": \"function\",\n    \"invalidProvider\": \"function\"\n  },\n  \"@smithy/is-array-buffer\": {\n    \"isArrayBuffer\": \"function\"\n  },\n  \"@smithy/md5-js\": {\n    \"Md5\": \"function\"\n  },\n  \"@smithy/middleware-apply-body-checksum\": {\n    \"applyMd5BodyChecksumMiddleware\": \"function\",\n    \"applyMd5BodyChecksumMiddlewareOptions\": \"object\",\n    \"getApplyMd5BodyChecksumPlugin\": \"function\",\n    \"Md5BodyChecksumInputConfig\": \"type(interface)\",\n    \"Md5BodyChecksumResolvedConfig\": \"type(interface)\",\n    \"resolveMd5BodyChecksumConfig\": \"function\"\n  },\n  \"@smithy/middleware-compression\": {\n    \"CompressionInputConfig\": \"type(interface)\",\n    \"compressionMiddleware\": \"function\",\n    \"CompressionMiddlewareConfig\": \"type(interface)\",\n    \"compressionMiddlewareOptions\": \"object\",\n    \"CompressionPreviouslyResolved\": \"type(interface)\",\n    \"CompressionResolvedConfig\": \"type(interface)\",\n    \"DEFAULT_DISABLE_REQUEST_COMPRESSION\": \"boolean\",\n    \"DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES\": \"number\",\n    \"getCompressionPlugin\": \"function\",\n    \"NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS\": \"object\",\n    \"NODE_DISABLE_REQUEST_COMPRESSION_ENV_NAME\": \"string\",\n    \"NODE_DISABLE_REQUEST_COMPRESSION_INI_NAME\": \"string\",\n    \"NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS\": \"object\",\n    \"NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_NAME\": \"string\",\n    \"NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_INI_NAME\": \"string\",\n    \"resolveCompressionConfig\": \"function\"\n  },\n  \"@smithy/middleware-content-length\": {\n    \"contentLengthMiddleware\": \"function\",\n    \"contentLengthMiddlewareOptions\": \"object\",\n    \"getContentLengthPlugin\": \"function\"\n  },\n  \"@smithy/middleware-endpoint\": {\n    \"BuiltInParamInstruction\": \"type(interface)\",\n    \"ClientContextParamInstruction\": \"type(interface)\",\n    \"ContextParamInstruction\": \"type(interface)\",\n    \"EndpointInputConfig\": \"type(interface)\",\n    \"endpointMiddleware\": \"function\",\n    \"endpointMiddlewareOptions\": \"object\",\n    \"EndpointParameterInstructions\": \"type(interface)\",\n    \"EndpointParameterInstructionsSupplier\": \"type(object)\",\n    \"EndpointRequiredInputConfig\": \"type(interface)\",\n    \"EndpointRequiredResolvedConfig\": \"type(interface)\",\n    \"EndpointResolvedConfig\": \"type(interface)\",\n    \"getEndpointFromInstructions\": \"function\",\n    \"getEndpointPlugin\": \"function\",\n    \"OperationContextParamInstruction\": \"type(interface)\",\n    \"resolveEndpointConfig\": \"function\",\n    \"resolveEndpointRequiredConfig\": \"function\",\n    \"resolveParams\": \"function\",\n    \"StaticContextParamInstruction\": \"type(interface)\",\n    \"toEndpointV1\": \"function\"\n  },\n  \"@smithy/middleware-retry\": {\n    \"AdaptiveRetryStrategy\": \"function\",\n    \"AdaptiveRetryStrategyOptions\": \"type(interface)\",\n    \"CONFIG_MAX_ATTEMPTS\": \"string\",\n    \"CONFIG_RETRY_MODE\": \"string\",\n    \"defaultDelayDecider\": \"function\",\n    \"defaultRetryDecider\": \"function\",\n    \"ENV_MAX_ATTEMPTS\": \"string\",\n    \"ENV_RETRY_MODE\": \"string\",\n    \"getOmitRetryHeadersPlugin\": \"function\",\n    \"getRetryAfterHint\": \"function\",\n    \"getRetryPlugin\": \"function\",\n    \"NODE_MAX_ATTEMPT_CONFIG_OPTIONS\": \"object\",\n    \"NODE_RETRY_MODE_CONFIG_OPTIONS\": \"object\",\n    \"omitRetryHeadersMiddleware\": \"function\",\n    \"omitRetryHeadersMiddlewareOptions\": \"object\",\n    \"PreviouslyResolved\": \"type(interface)\",\n    \"resolveRetryConfig\": \"function\",\n    \"RetryInputConfig\": \"type(interface)\",\n    \"retryMiddleware\": \"function\",\n    \"retryMiddlewareOptions\": \"object\",\n    \"RetryResolvedConfig\": \"type(interface)\",\n    \"StandardRetryStrategy\": \"function\",\n    \"StandardRetryStrategyOptions\": \"type(interface)\"\n  },\n  \"@smithy/middleware-serde\": {\n    \"deserializerMiddleware\": \"function\",\n    \"deserializerMiddlewareOption\": \"object\",\n    \"getSerdePlugin\": \"function\",\n    \"serializerMiddleware\": \"function\",\n    \"serializerMiddlewareOption\": \"object\",\n    \"V1OrV2Endpoint\": \"type(object)\"\n  },\n  \"@smithy/middleware-stack\": {\n    \"constructStack\": \"function\"\n  },\n  \"@smithy/node-config-provider\": {\n    \"EnvOptions\": \"type(interface)\",\n    \"GetterFromEnv\": \"type(object)\",\n    \"loadConfig\": \"function\",\n    \"LoadedConfigSelectors\": \"type(interface)\",\n    \"LocalConfigOptions\": \"type(intersection)\",\n    \"SharedConfigInit\": \"type(interface)\"\n  },\n  \"@smithy/node-http-handler\": {\n    \"DEFAULT_REQUEST_TIMEOUT\": \"number\",\n    \"NodeHttp2Handler\": \"function\",\n    \"NodeHttp2HandlerOptions\": \"type(interface)\",\n    \"NodeHttpHandler\": \"function\",\n    \"NodeHttpHandlerOptions\": \"type(interface)\",\n    \"streamCollector\": \"function\"\n  },\n  \"@smithy/property-provider\": {\n    \"chain\": \"function\",\n    \"CredentialsProviderError\": \"function\",\n    \"fromStatic\": \"function\",\n    \"memoize\": \"function\",\n    \"ProviderError\": \"function\",\n    \"ProviderErrorOptionsType\": \"type(object)\",\n    \"TokenProviderError\": \"function\"\n  },\n  \"@smithy/protocol-http\": {\n    \"Field\": \"function\",\n    \"FieldOptions\": \"type(object)\",\n    \"FieldPosition\": \"type(union)\",\n    \"Fields\": \"function\",\n    \"FieldsOptions\": \"type(object)\",\n    \"getHttpHandlerExtensionConfiguration\": \"function\",\n    \"HeaderBag\": \"type(object)\",\n    \"HttpHandler\": \"type(intersection)\",\n    \"HttpHandlerExtensionConfigType\": \"type(object)\",\n    \"HttpHandlerExtensionConfiguration\": \"type(interface)\",\n    \"HttpHandlerOptions\": \"type(object)\",\n    \"HttpHandlerUserInput\": \"type(union)\",\n    \"HttpMessage\": \"type(object)\",\n    \"HttpRequest\": \"function\",\n    \"HttpResponse\": \"function\",\n    \"IHttpRequest\": \"type(interface)\",\n    \"isValidHostname\": \"function\",\n    \"resolveHttpHandlerRuntimeConfig\": \"function\"\n  },\n  \"@smithy/querystring-builder\": {\n    \"buildQueryString\": \"function\"\n  },\n  \"@smithy/querystring-parser\": {\n    \"parseQueryString\": \"function\"\n  },\n  \"@smithy/service-client-documentation-generator\": {\n    \"load\": \"function\"\n  },\n  \"@smithy/service-error-classification\": {\n    \"isBrowserNetworkError\": \"function\",\n    \"isClockSkewCorrectedError\": \"function\",\n    \"isClockSkewError\": \"function\",\n    \"isNodeJsHttp2TransientError\": \"function\",\n    \"isRetryableByTrait\": \"function\",\n    \"isServerError\": \"function\",\n    \"isThrottlingError\": \"function\",\n    \"isTransientError\": \"function\"\n  },\n  \"@smithy/shared-ini-file-loader\": {\n    \"CONFIG_PREFIX_SEPARATOR\": \"string\",\n    \"DEFAULT_PROFILE\": \"string\",\n    \"ENV_PROFILE\": \"string\",\n    \"externalDataInterceptor\": \"object\",\n    \"getHomeDir\": \"function\",\n    \"getProfileName\": \"function\",\n    \"getSSOTokenFilepath\": \"function\",\n    \"getSSOTokenFromFile\": \"function\",\n    \"loadSharedConfigFiles\": \"function\",\n    \"loadSsoSessionData\": \"function\",\n    \"ParsedIniData\": \"type(object)\",\n    \"parseKnownFiles\": \"function\",\n    \"Profile\": \"type(object)\",\n    \"readFile\": \"function\",\n    \"ReadFileOptions\": \"type(interface)\",\n    \"SharedConfigFiles\": \"type(object)\",\n    \"SharedConfigInit\": \"type(interface)\",\n    \"SourceProfileInit\": \"type(interface)\",\n    \"SsoSessionInit\": \"type(interface)\",\n    \"SSOToken\": \"type(interface)\"\n  },\n  \"@smithy/signature-v4\": {\n    \"ALGORITHM_IDENTIFIER\": \"string\",\n    \"ALGORITHM_IDENTIFIER_V4A\": \"string\",\n    \"ALGORITHM_QUERY_PARAM\": \"string\",\n    \"ALWAYS_UNSIGNABLE_HEADERS\": \"object\",\n    \"AMZ_DATE_HEADER\": \"string\",\n    \"AMZ_DATE_QUERY_PARAM\": \"string\",\n    \"AUTH_HEADER\": \"string\",\n    \"clearCredentialCache\": \"function\",\n    \"createScope\": \"function\",\n    \"CREDENTIAL_QUERY_PARAM\": \"string\",\n    \"DATE_HEADER\": \"string\",\n    \"EVENT_ALGORITHM_IDENTIFIER\": \"string\",\n    \"EXPIRES_QUERY_PARAM\": \"string\",\n    \"GENERATED_HEADERS\": \"object\",\n    \"getCanonicalHeaders\": \"function\",\n    \"getCanonicalQuery\": \"function\",\n    \"getPayloadHash\": \"function\",\n    \"getSigningKey\": \"function\",\n    \"hasHeader\": \"function\",\n    \"HOST_HEADER\": \"string\",\n    \"KEY_TYPE_IDENTIFIER\": \"string\",\n    \"MAX_CACHE_SIZE\": \"number\",\n    \"MAX_PRESIGNED_TTL\": \"number\",\n    \"moveHeadersToQuery\": \"function\",\n    \"OptionalSigV4aSigner\": \"type(object)\",\n    \"prepareRequest\": \"function\",\n    \"PROXY_HEADER_PATTERN\": \"object\",\n    \"REGION_SET_PARAM\": \"string\",\n    \"SEC_HEADER_PATTERN\": \"object\",\n    \"SHA256_HEADER\": \"string\",\n    \"SIGNATURE_HEADER\": \"string\",\n    \"SIGNATURE_QUERY_PARAM\": \"string\",\n    \"SignatureV4\": \"function\",\n    \"signatureV4aContainer\": \"object\",\n    \"SignatureV4Base\": \"function\",\n    \"SignatureV4CryptoInit\": \"type(interface)\",\n    \"SignatureV4Init\": \"type(interface)\",\n    \"SIGNED_HEADERS_QUERY_PARAM\": \"string\",\n    \"TOKEN_HEADER\": \"string\",\n    \"TOKEN_QUERY_PARAM\": \"string\",\n    \"UNSIGNABLE_PATTERNS\": \"object\",\n    \"UNSIGNED_PAYLOAD\": \"string\"\n  },\n  \"@smithy/signature-v4a\": {\n    \"SignatureV4a\": \"function\"\n  },\n  \"@smithy/smithy-client\": {\n    \"_json\": \"function\",\n    \"_parseEpochTimestamp\": \"function\",\n    \"_parseRfc3339DateTimeWithOffset\": \"function\",\n    \"_parseRfc7231DateTime\": \"function\",\n    \"AutomaticJsonStringConversion\": \"type(alias)\",\n    \"Client\": \"function\",\n    \"collectBody\": \"function\",\n    \"Command\": \"function\",\n    \"CommandImpl\": \"type(interface)\",\n    \"ConditionalLazyValueInstruction\": \"type(object)\",\n    \"ConditionalValueInstruction\": \"type(object)\",\n    \"convertMap\": \"function\",\n    \"copyDocumentWithTransform\": \"function\",\n    \"createAggregatedClient\": \"function\",\n    \"dateToUtcString\": \"function\",\n    \"decorateServiceException\": \"function\",\n    \"DefaultExtensionRuntimeConfigType\": \"type(intersection)\",\n    \"DefaultsMode\": \"type(union)\",\n    \"DefaultsModeConfigs\": \"type(interface)\",\n    \"DocumentType\": \"type(union)\",\n    \"emitWarningIfUnsupportedVersion\": \"function\",\n    \"ExceptionOptionType\": \"type(object)\",\n    \"expectBoolean\": \"function\",\n    \"expectByte\": \"function\",\n    \"expectFloat32\": \"function\",\n    \"expectInt\": \"function\",\n    \"expectInt32\": \"function\",\n    \"expectLong\": \"function\",\n    \"expectNonNull\": \"function\",\n    \"expectNumber\": \"function\",\n    \"expectObject\": \"function\",\n    \"expectShort\": \"function\",\n    \"expectString\": \"function\",\n    \"expectUnion\": \"function\",\n    \"extendedEncodeURIComponent\": \"function\",\n    \"FilterStatus\": \"type(alias)\",\n    \"FilterStatusSupplier\": \"type(object)\",\n    \"generateIdempotencyToken\": \"function\",\n    \"getArrayIfSingleItem\": \"function\",\n    \"getDefaultClientConfiguration\": \"function\",\n    \"getDefaultExtensionConfiguration\": \"function\",\n    \"getValueFromTextNode\": \"function\",\n    \"handleFloat\": \"function\",\n    \"isSerializableHeaderValue\": \"function\",\n    \"LazyJsonString\": \"function\",\n    \"LazyValueInstruction\": \"type(object)\",\n    \"limitedParseDouble\": \"function\",\n    \"limitedParseFloat\": \"function\",\n    \"limitedParseFloat32\": \"function\",\n    \"loadConfigsForDefaultMode\": \"function\",\n    \"logger\": \"object\",\n    \"map\": \"function\",\n    \"NoOpLogger\": \"function\",\n    \"NumericType\": \"type(alias)\",\n    \"NumericValue\": \"function\",\n    \"nv\": \"function\",\n    \"ObjectMappingInstruction\": \"type(alias)\",\n    \"ObjectMappingInstructions\": \"type(object)\",\n    \"parseBoolean\": \"function\",\n    \"parseEpochTimestamp\": \"function\",\n    \"parseRfc3339DateTime\": \"function\",\n    \"parseRfc3339DateTimeWithOffset\": \"function\",\n    \"parseRfc7231DateTime\": \"function\",\n    \"quoteHeader\": \"function\",\n    \"ResolvedDefaultsMode\": \"type(union)\",\n    \"resolveDefaultRuntimeConfig\": \"function\",\n    \"resolvedPath\": \"function\",\n    \"SdkError\": \"type(intersection)\",\n    \"SENSITIVE_STRING\": \"string\",\n    \"serializeDateTime\": \"function\",\n    \"serializeFloat\": \"function\",\n    \"ServiceException\": \"function\",\n    \"ServiceExceptionOptions\": \"type(interface)\",\n    \"SimpleValueInstruction\": \"type(object)\",\n    \"SmithyConfiguration\": \"type(interface)\",\n    \"SmithyException\": \"type(interface)\",\n    \"SmithyResolvedConfiguration\": \"type(object)\",\n    \"SourceMappingInstruction\": \"type(object)\",\n    \"SourceMappingInstructions\": \"type(object)\",\n    \"splitEvery\": \"function\",\n    \"splitHeader\": \"function\",\n    \"strictParseByte\": \"function\",\n    \"strictParseDouble\": \"function\",\n    \"strictParseFloat\": \"function\",\n    \"strictParseFloat32\": \"function\",\n    \"strictParseInt\": \"function\",\n    \"strictParseInt32\": \"function\",\n    \"strictParseLong\": \"function\",\n    \"strictParseShort\": \"function\",\n    \"take\": \"function\",\n    \"throwDefaultError\": \"function\",\n    \"UnfilteredValue\": \"type(alias)\",\n    \"Value\": \"type(alias)\",\n    \"ValueFilteringFunction\": \"type(object)\",\n    \"ValueMapper\": \"type(object)\",\n    \"ValueSupplier\": \"type(object)\",\n    \"withBaseException\": \"function\"\n  },\n  \"@smithy/snapshot-testing\": {\n    \"customFields\": \"object\",\n    \"SnapshotProtocol\": \"function\",\n    \"SnapshotRunner\": \"function\",\n    \"snapshotTestingProtocolResponseSerializers\": \"object\"\n  },\n  \"@smithy/typecheck\": {\n    \"getRuntimeTypecheckPlugin\": \"function\",\n    \"RuntimeTypecheckBehavior\": \"type(union)\",\n    \"RuntimeTypecheckOptions\": \"type(object)\",\n    \"validateSchema\": \"function\"\n  },\n  \"@smithy/types\": {\n    \"$ClientProtocol\": \"type(interface)\",\n    \"$ClientProtocolCtor\": \"type(interface)\",\n    \"$Codec\": \"type(interface)\",\n    \"$MemberSchema\": \"type(object)\",\n    \"$OperationSchema\": \"type(interface)\",\n    \"$Schema\": \"type(union)\",\n    \"$SchemaRef\": \"type(union)\",\n    \"$ShapeDeserializer\": \"type(interface)\",\n    \"$ShapeSerializer\": \"type(interface)\",\n    \"AbortController\": \"type(interface)\",\n    \"AbortHandler\": \"type(interface)\",\n    \"AbortSignal\": \"type(interface)\",\n    \"AbsoluteLocation\": \"type(interface)\",\n    \"AlgorithmId\": \"object\",\n    \"ApiKeyIdentity\": \"type(interface)\",\n    \"ApiKeyIdentityProvider\": \"type(object)\",\n    \"AssertiveClient\": \"type(intersection)\",\n    \"AuthScheme\": \"type(interface)\",\n    \"AvailableMessage\": \"type(interface)\",\n    \"AvailableMessages\": \"type(interface)\",\n    \"AwsCredentialIdentity\": \"type(interface)\",\n    \"AwsCredentialIdentityProvider\": \"type(object)\",\n    \"BigDecimalSchema\": \"type(alias)\",\n    \"BigIntegerSchema\": \"type(alias)\",\n    \"BinaryHeaderValue\": \"type(object)\",\n    \"BlobPayloadInputTypes\": \"type(union)\",\n    \"BlobSchema\": \"type(alias)\",\n    \"BlobSchemas\": \"type(union)\",\n    \"BlobTypes\": \"type(union)\",\n    \"BodyLengthCalculator\": \"type(interface)\",\n    \"BooleanHeaderValue\": \"type(object)\",\n    \"BooleanSchema\": \"type(alias)\",\n    \"BrowserClient\": \"type(intersection)\",\n    \"BrowserRuntimeBlobTypes\": \"type(union)\",\n    \"BrowserRuntimeStreamingBlobPayloadInputTypes\": \"type(union)\",\n    \"BrowserRuntimeStreamingBlobPayloadOutputTypes\": \"type(union)\",\n    \"BrowserRuntimeStreamingBlobTypes\": \"type(union)\",\n    \"BrowserXhrClient\": \"type(intersection)\",\n    \"BuildHandler\": \"type(interface)\",\n    \"BuildHandlerArguments\": \"type(interface)\",\n    \"BuildHandlerOptions\": \"type(interface)\",\n    \"BuildHandlerOutput\": \"type(interface)\",\n    \"BuildMiddleware\": \"type(interface)\",\n    \"ByteHeaderValue\": \"type(object)\",\n    \"CacheKey\": \"type(interface)\",\n    \"CheckOptionalClientConfig\": \"type(alias)\",\n    \"Checksum\": \"type(interface)\",\n    \"ChecksumAlgorithm\": \"type(interface)\",\n    \"ChecksumConfiguration\": \"type(interface)\",\n    \"ChecksumConstructor\": \"type(interface)\",\n    \"Client\": \"type(interface)\",\n    \"ClientProtocol\": \"type(interface)\",\n    \"ClientProtocolCtor\": \"type(interface)\",\n    \"Codec\": \"type(interface)\",\n    \"CodecSettings\": \"type(object)\",\n    \"Command\": \"type(interface)\",\n    \"CommandIO\": \"type(interface)\",\n    \"ConditionObject\": \"type(intersection)\",\n    \"ConfigurableSerdeContext\": \"type(interface)\",\n    \"ConnectConfiguration\": \"type(interface)\",\n    \"ConnectionManager\": \"type(interface)\",\n    \"ConnectionManagerConfiguration\": \"type(interface)\",\n    \"ConnectionPool\": \"type(interface)\",\n    \"DateInput\": \"type(union)\",\n    \"Decoder\": \"type(interface)\",\n    \"DefaultClientConfiguration\": \"type(interface)\",\n    \"DefaultExtensionConfiguration\": \"type(interface)\",\n    \"DeprecatedObject\": \"type(object)\",\n    \"DeserializeHandler\": \"type(interface)\",\n    \"DeserializeHandlerArguments\": \"type(interface)\",\n    \"DeserializeHandlerOptions\": \"type(interface)\",\n    \"DeserializeHandlerOutput\": \"type(interface)\",\n    \"DeserializeMiddleware\": \"type(interface)\",\n    \"DocumentSchema\": \"type(alias)\",\n    \"DocumentType\": \"type(union)\",\n    \"Encoder\": \"type(interface)\",\n    \"Endpoint\": \"type(interface)\",\n    \"EndpointARN\": \"type(interface)\",\n    \"EndpointBearer\": \"type(interface)\",\n    \"EndpointObject\": \"type(object)\",\n    \"EndpointObjectHeaders\": \"type(object)\",\n    \"EndpointObjectProperties\": \"type(object)\",\n    \"EndpointObjectProperty\": \"type(union)\",\n    \"EndpointParameters\": \"type(object)\",\n    \"EndpointParams\": \"type(object)\",\n    \"EndpointPartition\": \"type(interface)\",\n    \"EndpointResolverOptions\": \"type(object)\",\n    \"EndpointRuleObject\": \"type(object)\",\n    \"EndpointURL\": \"type(interface)\",\n    \"EndpointURLScheme\": \"object\",\n    \"EndpointV2\": \"type(interface)\",\n    \"ErrorHandler\": \"type(interface)\",\n    \"ErrorRuleObject\": \"type(object)\",\n    \"EvaluateOptions\": \"type(intersection)\",\n    \"EventSigner\": \"type(interface)\",\n    \"EventSigningArguments\": \"type(interface)\",\n    \"EventStreamMarshaller\": \"type(interface)\",\n    \"EventStreamMarshallerDeserFn\": \"type(interface)\",\n    \"EventStreamMarshallerSerFn\": \"type(interface)\",\n    \"EventStreamPayloadHandler\": \"type(interface)\",\n    \"EventStreamPayloadHandlerProvider\": \"type(interface)\",\n    \"EventStreamRequestScopedCredentials\": \"type(interface)\",\n    \"EventStreamRequestSigner\": \"type(interface)\",\n    \"EventStreamSerdeContext\": \"type(interface)\",\n    \"EventStreamSerdeProvider\": \"type(interface)\",\n    \"EventStreamSignerProvider\": \"type(interface)\",\n    \"Exact\": \"type(alias)\",\n    \"ExponentialBackoffJitterType\": \"type(union)\",\n    \"ExponentialBackoffStrategyOptions\": \"type(interface)\",\n    \"Expression\": \"type(union)\",\n    \"FetchHttpHandlerOptions\": \"type(interface)\",\n    \"FieldOptions\": \"type(object)\",\n    \"FieldPosition\": \"object\",\n    \"FinalizeHandler\": \"type(interface)\",\n    \"FinalizeHandlerArguments\": \"type(interface)\",\n    \"FinalizeHandlerOutput\": \"type(interface)\",\n    \"FinalizeRequestHandlerOptions\": \"type(interface)\",\n    \"FinalizeRequestMiddleware\": \"type(interface)\",\n    \"FormattedEvent\": \"type(interface)\",\n    \"FunctionArgv\": \"type(object)\",\n    \"FunctionObject\": \"type(object)\",\n    \"FunctionReturn\": \"type(union)\",\n    \"GetAwsChunkedEncodingStream\": \"type(interface)\",\n    \"GetAwsChunkedEncodingStreamOptions\": \"type(interface)\",\n    \"getDefaultClientConfiguration\": \"function\",\n    \"GetOutputType\": \"type(alias)\",\n    \"Handler\": \"type(object)\",\n    \"HandlerExecutionContext\": \"type(interface)\",\n    \"HandlerOptions\": \"type(interface)\",\n    \"Hash\": \"type(interface)\",\n    \"HashConstructor\": \"type(interface)\",\n    \"HeaderBag\": \"type(object)\",\n    \"HeaderValue\": \"type(object)\",\n    \"HttpApiKeyAuthLocation\": \"object\",\n    \"HttpAuthDefinition\": \"type(interface)\",\n    \"HttpAuthLocation\": \"object\",\n    \"HttpAuthOption\": \"type(interface)\",\n    \"HttpAuthScheme\": \"type(interface)\",\n    \"HttpAuthSchemeId\": \"type(string)\",\n    \"HttpAuthSchemeParameters\": \"type(interface)\",\n    \"HttpAuthSchemeParametersProvider\": \"type(interface)\",\n    \"HttpAuthSchemeProvider\": \"type(interface)\",\n    \"HttpHandlerOptions\": \"type(interface)\",\n    \"HttpLabelBitMask\": \"type(alias)\",\n    \"HttpMessage\": \"type(interface)\",\n    \"HttpPayloadBitMask\": \"type(alias)\",\n    \"HttpQueryParamsBitMask\": \"type(alias)\",\n    \"HttpRequest\": \"type(interface)\",\n    \"HttpResponse\": \"type(interface)\",\n    \"HttpResponseCodeBitMask\": \"type(alias)\",\n    \"HttpSigner\": \"type(interface)\",\n    \"IdempotencyTokenBitMask\": \"type(alias)\",\n    \"IdempotentBitMask\": \"type(alias)\",\n    \"Identity\": \"type(interface)\",\n    \"IdentityProvider\": \"type(interface)\",\n    \"IdentityProviderConfig\": \"type(interface)\",\n    \"IniSection\": \"type(object)\",\n    \"IniSectionType\": \"object\",\n    \"InitializeHandler\": \"type(interface)\",\n    \"InitializeHandlerArguments\": \"type(interface)\",\n    \"InitializeHandlerOptions\": \"type(interface)\",\n    \"InitializeHandlerOutput\": \"type(interface)\",\n    \"InitializeMiddleware\": \"type(interface)\",\n    \"Int64\": \"type(interface)\",\n    \"IntegerHeaderValue\": \"type(object)\",\n    \"InvokeFunction\": \"type(interface)\",\n    \"InvokeMethod\": \"type(interface)\",\n    \"InvokeMethodOptionalArgs\": \"type(interface)\",\n    \"ListSchema\": \"type(interface)\",\n    \"ListSchemaModifier\": \"type(alias)\",\n    \"Logger\": \"type(interface)\",\n    \"LongHeaderValue\": \"type(object)\",\n    \"MapSchema\": \"type(interface)\",\n    \"MapSchemaModifier\": \"type(alias)\",\n    \"MemberSchema\": \"type(object)\",\n    \"MemoizedProvider\": \"type(interface)\",\n    \"Message\": \"type(interface)\",\n    \"MessageDecoder\": \"type(interface)\",\n    \"MessageEncoder\": \"type(interface)\",\n    \"MessageHeaders\": \"type(object)\",\n    \"MessageHeaderValue\": \"type(union)\",\n    \"MessageSigner\": \"type(interface)\",\n    \"MessageSigningArguments\": \"type(interface)\",\n    \"MetadataBearer\": \"type(interface)\",\n    \"MiddlewareStack\": \"type(interface)\",\n    \"MiddlewareType\": \"type(union)\",\n    \"Mutable\": \"type(object)\",\n    \"NarrowPayloadBlobOutputType\": \"type(intersection)\",\n    \"NarrowPayloadBlobTypes\": \"type(intersection)\",\n    \"NodeHttpHandlerOptions\": \"type(interface)\",\n    \"NodeJsClient\": \"type(intersection)\",\n    \"NodeJsHttp2Client\": \"type(intersection)\",\n    \"NodeJsRuntimeBlobTypes\": \"type(union)\",\n    \"NodeJsRuntimeStreamingBlobPayloadInputTypes\": \"type(union)\",\n    \"NodeJsRuntimeStreamingBlobPayloadOutputTypes\": \"type(union)\",\n    \"NodeJsRuntimeStreamingBlobTypes\": \"type(object)\",\n    \"NormalizedSchema\": \"type(interface)\",\n    \"NoUndefined\": \"type(alias)\",\n    \"NumericSchema\": \"type(alias)\",\n    \"OperationSchema\": \"type(interface)\",\n    \"OptionalParameter\": \"type(alias)\",\n    \"PaginationConfiguration\": \"type(interface)\",\n    \"Paginator\": \"type(object)\",\n    \"ParameterObject\": \"type(object)\",\n    \"ParsedIniData\": \"type(object)\",\n    \"Pluggable\": \"type(interface)\",\n    \"Priority\": \"type(union)\",\n    \"Profile\": \"type(interface)\",\n    \"Provider\": \"type(interface)\",\n    \"QueryParameterBag\": \"type(object)\",\n    \"randomValues\": \"type(interface)\",\n    \"RecursiveRequired\": \"type(alias)\",\n    \"ReferenceObject\": \"type(object)\",\n    \"ReferenceRecord\": \"type(object)\",\n    \"RegionInfo\": \"type(interface)\",\n    \"RegionInfoProvider\": \"type(interface)\",\n    \"RegionInfoProviderOptions\": \"type(interface)\",\n    \"Relation\": \"type(union)\",\n    \"RelativeLocation\": \"type(interface)\",\n    \"RelativeMiddlewareOptions\": \"type(intersection)\",\n    \"RequestContext\": \"type(interface)\",\n    \"RequestHandler\": \"type(interface)\",\n    \"RequestHandlerMetadata\": \"type(interface)\",\n    \"RequestHandlerOutput\": \"type(object)\",\n    \"RequestHandlerParams\": \"type(union)\",\n    \"RequestHandlerProtocol\": \"object\",\n    \"RequestPresigner\": \"type(interface)\",\n    \"RequestPresigningArguments\": \"type(interface)\",\n    \"RequestSerializer\": \"type(interface)\",\n    \"RequestSigner\": \"type(interface)\",\n    \"RequestSigningArguments\": \"type(interface)\",\n    \"resolveDefaultRuntimeConfig\": \"function\",\n    \"ResponseDeserializer\": \"type(interface)\",\n    \"ResponseMetadata\": \"type(interface)\",\n    \"RetryableTrait\": \"type(interface)\",\n    \"RetryBackoffStrategy\": \"type(interface)\",\n    \"RetryErrorInfo\": \"type(interface)\",\n    \"RetryErrorType\": \"type(union)\",\n    \"RetryStrategy\": \"type(interface)\",\n    \"RetryStrategyConfiguration\": \"type(interface)\",\n    \"RetryStrategyOptions\": \"type(interface)\",\n    \"RetryStrategyV2\": \"type(interface)\",\n    \"RetryToken\": \"type(interface)\",\n    \"RuleSetObject\": \"type(object)\",\n    \"RuleSetRules\": \"type(object)\",\n    \"Schema\": \"type(union)\",\n    \"SchemaRef\": \"type(union)\",\n    \"SchemaTraits\": \"type(union)\",\n    \"SchemaTraitsObject\": \"type(object)\",\n    \"SdkError\": \"type(intersection)\",\n    \"SdkStream\": \"type(intersection)\",\n    \"SdkStreamMixin\": \"type(interface)\",\n    \"SdkStreamMixinInjector\": \"type(interface)\",\n    \"SdkStreamSerdeContext\": \"type(interface)\",\n    \"SelectedHttpAuthScheme\": \"type(interface)\",\n    \"SensitiveBitMask\": \"type(alias)\",\n    \"SerdeContext\": \"type(interface)\",\n    \"SerdeFunctions\": \"type(interface)\",\n    \"SerializeHandler\": \"type(interface)\",\n    \"SerializeHandlerArguments\": \"type(interface)\",\n    \"SerializeHandlerOptions\": \"type(interface)\",\n    \"SerializeHandlerOutput\": \"type(interface)\",\n    \"SerializeMiddleware\": \"type(interface)\",\n    \"ShapeDeserializer\": \"type(interface)\",\n    \"ShapeName\": \"type(string)\",\n    \"ShapeNamespace\": \"type(string)\",\n    \"ShapeSerializer\": \"type(interface)\",\n    \"SharedConfigFiles\": \"type(interface)\",\n    \"ShortHeaderValue\": \"type(object)\",\n    \"SignableMessage\": \"type(interface)\",\n    \"SignedMessage\": \"type(interface)\",\n    \"SigningArguments\": \"type(interface)\",\n    \"SimpleSchema\": \"type(number)\",\n    \"SMITHY_CONTEXT_KEY\": \"string\",\n    \"SmithyException\": \"type(interface)\",\n    \"SmithyFeatures\": \"type(object)\",\n    \"SourceData\": \"type(union)\",\n    \"StandardRetryBackoffStrategy\": \"type(interface)\",\n    \"StandardRetryToken\": \"type(interface)\",\n    \"StaticErrorSchema\": \"type(object)\",\n    \"StaticListSchema\": \"type(object)\",\n    \"StaticMapSchema\": \"type(object)\",\n    \"StaticOperationSchema\": \"type(object)\",\n    \"StaticSchema\": \"type(union)\",\n    \"StaticSchemaIdError\": \"type(alias)\",\n    \"StaticSchemaIdList\": \"type(alias)\",\n    \"StaticSchemaIdMap\": \"type(alias)\",\n    \"StaticSchemaIdOperation\": \"type(alias)\",\n    \"StaticSchemaIdSimple\": \"type(alias)\",\n    \"StaticSchemaIdStruct\": \"type(alias)\",\n    \"StaticSchemaIdUnion\": \"type(alias)\",\n    \"StaticSimpleSchema\": \"type(object)\",\n    \"StaticStructureSchema\": \"type(object)\",\n    \"StaticUnionSchema\": \"type(object)\",\n    \"Step\": \"type(union)\",\n    \"StreamCollector\": \"type(interface)\",\n    \"StreamHasher\": \"type(interface)\",\n    \"StreamingBlobPayloadInputTypes\": \"type(union)\",\n    \"StreamingBlobPayloadOutputTypes\": \"type(union)\",\n    \"StreamingBlobSchema\": \"type(alias)\",\n    \"StreamingBlobTypes\": \"type(union)\",\n    \"StringHeaderValue\": \"type(object)\",\n    \"StringSchema\": \"type(alias)\",\n    \"StringSigner\": \"type(interface)\",\n    \"StructureSchema\": \"type(interface)\",\n    \"SuccessHandler\": \"type(interface)\",\n    \"Terminalware\": \"type(interface)\",\n    \"TimestampDateTimeSchema\": \"type(alias)\",\n    \"TimestampDefaultSchema\": \"type(alias)\",\n    \"TimestampEpochSecondsSchema\": \"type(alias)\",\n    \"TimestampHeaderValue\": \"type(object)\",\n    \"TimestampHttpDateSchema\": \"type(alias)\",\n    \"TimestampSchemas\": \"type(union)\",\n    \"TokenIdentity\": \"type(interface)\",\n    \"TokenIdentityProvider\": \"type(object)\",\n    \"TraitBitVector\": \"type(number)\",\n    \"TraitsSchema\": \"type(interface)\",\n    \"Transform\": \"type(alias)\",\n    \"TreeRuleObject\": \"type(object)\",\n    \"UncheckedClient\": \"type(intersection)\",\n    \"UnitSchema\": \"type(alias)\",\n    \"URI\": \"type(object)\",\n    \"UrlParser\": \"type(interface)\",\n    \"UserAgent\": \"type(object)\",\n    \"UserAgentPair\": \"type(object)\",\n    \"UuidHeaderValue\": \"type(object)\",\n    \"WaiterConfiguration\": \"type(interface)\",\n    \"WithSdkStreamMixin\": \"type(object)\"\n  },\n  \"@smithy/url-parser\": {\n    \"parseUrl\": \"function\"\n  },\n  \"@smithy/util-base64\": {\n    \"fromBase64\": \"function\",\n    \"toBase64\": \"function\"\n  },\n  \"@smithy/util-body-length-browser\": {\n    \"calculateBodyLength\": \"function\"\n  },\n  \"@smithy/util-body-length-node\": {\n    \"calculateBodyLength\": \"function\"\n  },\n  \"@smithy/util-buffer-from\": {\n    \"fromArrayBuffer\": \"function\",\n    \"fromString\": \"function\",\n    \"StringEncoding\": \"type(union)\"\n  },\n  \"@smithy/util-config-provider\": {\n    \"booleanSelector\": \"function\",\n    \"numberSelector\": \"function\",\n    \"SelectorType\": \"object\"\n  },\n  \"@smithy/util-defaults-mode-browser\": {\n    \"resolveDefaultsModeConfig\": \"function\",\n    \"ResolveDefaultsModeConfigOptions\": \"type(interface)\"\n  },\n  \"@smithy/util-defaults-mode-node\": {\n    \"resolveDefaultsModeConfig\": \"function\",\n    \"ResolveDefaultsModeConfigOptions\": \"type(interface)\"\n  },\n  \"@smithy/util-endpoints\": {\n    \"BinaryDecisionDiagram\": \"function\",\n    \"ConditionObject\": \"type(intersection)\",\n    \"customEndpointFunctions\": \"object\",\n    \"decideEndpoint\": \"function\",\n    \"DeprecatedObject\": \"type(object)\",\n    \"EndpointCache\": \"function\",\n    \"EndpointError\": \"function\",\n    \"EndpointFunctions\": \"type(object)\",\n    \"EndpointObject\": \"type(object)\",\n    \"EndpointObjectHeaders\": \"type(object)\",\n    \"EndpointObjectProperties\": \"type(object)\",\n    \"EndpointParams\": \"type(object)\",\n    \"EndpointResolverOptions\": \"type(object)\",\n    \"EndpointRuleObject\": \"type(object)\",\n    \"ErrorRuleObject\": \"type(object)\",\n    \"EvaluateOptions\": \"type(intersection)\",\n    \"Expression\": \"type(union)\",\n    \"FunctionArgv\": \"type(object)\",\n    \"FunctionObject\": \"type(object)\",\n    \"FunctionReturn\": \"type(union)\",\n    \"isIpAddress\": \"function\",\n    \"isValidHostLabel\": \"function\",\n    \"ParameterObject\": \"type(object)\",\n    \"ReferenceObject\": \"type(object)\",\n    \"ReferenceRecord\": \"type(object)\",\n    \"resolveEndpoint\": \"function\",\n    \"RuleSetObject\": \"type(object)\",\n    \"RuleSetRules\": \"type(object)\",\n    \"TreeRuleObject\": \"type(object)\"\n  },\n  \"@smithy/util-hex-encoding\": {\n    \"fromHex\": \"function\",\n    \"toHex\": \"function\"\n  },\n  \"@smithy/util-middleware\": {\n    \"getSmithyContext\": \"function\",\n    \"normalizeProvider\": \"function\"\n  },\n  \"@smithy/util-retry\": {\n    \"AdaptiveRetryStrategy\": \"function\",\n    \"AdaptiveRetryStrategyOptions\": \"type(interface)\",\n    \"ConfiguredRetryStrategy\": \"function\",\n    \"DEFAULT_MAX_ATTEMPTS\": \"number\",\n    \"DEFAULT_RETRY_DELAY_BASE\": \"number\",\n    \"DEFAULT_RETRY_MODE\": \"string\",\n    \"DefaultRateLimiter\": \"function\",\n    \"DefaultRateLimiterOptions\": \"type(interface)\",\n    \"INITIAL_RETRY_TOKENS\": \"number\",\n    \"INVOCATION_ID_HEADER\": \"string\",\n    \"MAXIMUM_RETRY_DELAY\": \"number\",\n    \"NO_RETRY_INCREMENT\": \"number\",\n    \"RateLimiter\": \"type(interface)\",\n    \"REQUEST_HEADER\": \"string\",\n    \"Retry\": \"function\",\n    \"RETRY_COST\": \"number\",\n    \"RETRY_MODES\": \"object\",\n    \"StandardRetryStrategy\": \"function\",\n    \"StandardRetryStrategyOptions\": \"type(object)\",\n    \"THROTTLING_RETRY_DELAY_BASE\": \"number\",\n    \"TIMEOUT_RETRY_COST\": \"number\"\n  },\n  \"@smithy/util-stream\": {\n    \"ChecksumStream\": \"function\",\n    \"ChecksumStreamInit\": \"type(interface)\",\n    \"createBufferedReadable\": \"function\",\n    \"createChecksumStream\": \"function\",\n    \"getAwsChunkedEncodingStream\": \"function\",\n    \"headStream\": \"function\",\n    \"isBlob\": \"function\",\n    \"isReadableStream\": \"function\",\n    \"sdkStreamMixin\": \"function\",\n    \"splitStream\": \"function\",\n    \"Uint8ArrayBlobAdapter\": \"function\"\n  },\n  \"@smithy/util-uri-escape\": {\n    \"escapeUri\": \"function\",\n    \"escapeUriPath\": \"function\"\n  },\n  \"@smithy/util-utf8\": {\n    \"fromUtf8\": \"function\",\n    \"StringEncoding\": \"type(union)\",\n    \"toUint8Array\": \"function\",\n    \"toUtf8\": \"function\"\n  },\n  \"@smithy/util-waiter\": {\n    \"checkExceptions\": \"function\",\n    \"createWaiter\": \"function\",\n    \"WaiterConfiguration\": \"type(interface)\",\n    \"WaiterOptions\": \"type(intersection)\",\n    \"WaiterResult\": \"type(object)\",\n    \"waiterServiceDefaults\": \"object\",\n    \"WaiterState\": \"object\"\n  },\n  \"@smithy/uuid\": {\n    \"v4\": \"function\"\n  },\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\"\n}"
  },
  {
    "path": "build.gradle.kts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport com.diffplug.spotless.FormatterFunc\nimport com.github.spotbugs.snom.Effort\nimport org.jreleaser.model.Active\nimport java.io.Serializable\nimport java.util.regex.Pattern\n\nplugins {\n    `java-library`\n    `maven-publish`\n    signing\n    checkstyle\n    jacoco\n    id(\"com.github.spotbugs\") version \"6.3.0\"\n    id(\"org.jreleaser\") version \"1.21.0\"\n    // spotless 8.x is incompatible with jreleaser 1.x (see https://github.com/jreleaser/jreleaser/issues/1989)\n    id(\"com.diffplug.spotless\") version \"7.2.1\"\n}\n\nallprojects {\n    group = \"software.amazon.smithy.typescript\"\n    version = \"0.49.1\"\n}\n\n// The root project doesn't produce a JAR.\ntasks[\"jar\"].enabled = false\n\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n\nsubprojects {\n    val subproject = this\n\n    /*\n     * Java\n     * ====================================================\n     */\n    if (subproject.name == \"smithy-typescript-codegen\") {\n        apply(plugin = \"java-library\")\n\n        java {\n            sourceCompatibility = JavaVersion.VERSION_17\n            targetCompatibility = JavaVersion.VERSION_17\n        }\n\n        tasks.withType<JavaCompile> {\n            options.encoding = \"UTF-8\"\n        }\n\n        // Use Junit5's test runner.\n        tasks.withType<Test> {\n            useJUnitPlatform()\n        }\n\n        // Apply junit 5 and hamcrest test dependencies to all java projects.\n        dependencies {\n            testImplementation(\"org.junit.jupiter:junit-jupiter-api:5.13.4\")\n            testImplementation(\"org.junit.jupiter:junit-jupiter-engine:5.13.4\")\n            testImplementation(\"org.junit.jupiter:junit-jupiter-params:5.13.4\")\n            testImplementation(\"org.hamcrest:hamcrest:3.0\")\n            testImplementation(\"org.mockito:mockito-junit-jupiter:5.19.0\")\n            testRuntimeOnly(\"org.junit.platform:junit-platform-launcher\")\n        }\n\n        // Reusable license copySpec\n        val licenseSpec =\n            copySpec {\n                from(\"${project.rootDir}/LICENSE\")\n                from(\"${project.rootDir}/NOTICE\")\n            }\n\n        // Set up tasks that build source and javadoc jars.\n        tasks.register<Jar>(\"sourcesJar\") {\n            metaInf.with(licenseSpec)\n            from(sourceSets.main.get().allSource)\n            archiveClassifier.set(\"sources\")\n        }\n\n        tasks.register<Jar>(\"javadocJar\") {\n            metaInf.with(licenseSpec)\n            from(tasks.javadoc)\n            archiveClassifier.set(\"javadoc\")\n        }\n\n        // Configure jars to include license related info\n        tasks.jar {\n            metaInf.with(licenseSpec)\n            inputs.property(\"moduleName\", subproject.extra[\"moduleName\"])\n            manifest {\n                attributes[\"Automatic-Module-Name\"] = subproject.extra[\"moduleName\"]\n            }\n        }\n\n        tasks {\n            javadoc {\n                // not enabled due to excessive output.\n                // if taking up the task of resolving javadoc issues, at\n                // that time this can be enabled again.\n                enabled = false\n            }\n        }\n\n        /*\n         * Maven\n         * ====================================================\n         */\n        apply(plugin = \"maven-publish\")\n        apply(plugin = \"signing\")\n\n        repositories {\n            mavenLocal()\n            mavenCentral()\n        }\n\n        publishing {\n            repositories {\n                maven {\n                    name = \"stagingRepository\"\n                    url =\n                        rootProject.layout.buildDirectory\n                            .dir(\"staging\")\n                            .get()\n                            .asFile\n                            .toURI()\n                }\n            }\n\n            publications {\n                create<MavenPublication>(\"mavenJava\") {\n                    from(components[\"java\"])\n\n                    // Ship the source and javadoc jars.\n                    artifact(tasks[\"sourcesJar\"])\n                    artifact(tasks[\"javadocJar\"])\n\n                    // Include extra information in the POMs.\n                    afterEvaluate {\n                        pom {\n                            name.set(subproject.extra[\"displayName\"].toString())\n                            description.set(subproject.description)\n                            url.set(\"https://github.com/smithy-lang/smithy-typescript\")\n                            licenses {\n                                license {\n                                    name.set(\"Apache License 2.0\")\n                                    url.set(\"https://www.apache.org/licenses/LICENSE-2.0.txt\")\n                                    distribution.set(\"repo\")\n                                }\n                            }\n                            developers {\n                                developer {\n                                    id.set(\"smithy\")\n                                    name.set(\"Smithy\")\n                                    organization.set(\"Amazon Web Services\")\n                                    organizationUrl.set(\"https://aws.amazon.com\")\n                                    roles.add(\"developer\")\n                                }\n                            }\n                            scm {\n                                url.set(\"https://github.com/smithy-lang/smithy-typescript.git\")\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        // Don't sign the artifacts if we didn't get a key and password to use.\n        val signingKey: String? by project\n        val signingPassword: String? by project\n        if (signingKey != null && signingPassword != null) {\n            signing {\n                useInMemoryPgpKeys(signingKey, signingPassword)\n                sign(publishing.publications[\"mavenJava\"])\n            }\n        }\n\n        /*\n         * CheckStyle\n         * ====================================================\n         */\n        apply(plugin = \"checkstyle\")\n\n        tasks[\"checkstyleTest\"].enabled = false\n\n        /*\n         * Tests\n         * ====================================================\n         *\n         * Configure the running of tests.\n         */\n\n        // Log on passed, skipped, and failed test events if the `-Plog-tests` property is set.\n\n        if (project.hasProperty(\"log-tests\")) {\n            tasks.test {\n                testLogging {\n                    events(\"passed\", \"skipped\", \"failed\")\n                    exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL\n                }\n            }\n        } else {\n            tasks.test {\n                testLogging {\n                    events(\"failed\")\n                    exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL\n                }\n            }\n        }\n\n        /*\n         * Code coverage\n         * ====================================================\n         */\n        apply(plugin = \"jacoco\")\n\n        // Always run the jacoco test report after testing.\n        tasks[\"test\"].finalizedBy(tasks[\"jacocoTestReport\"])\n\n        // Configure jacoco to generate an HTML report.\n        tasks.jacocoTestReport {\n            reports {\n                xml.required.set(false)\n                csv.required.set(false)\n                html.outputLocation.set(\n                    layout.buildDirectory\n                        .dir(\"reports/jacoco\")\n                        .get()\n                        .asFile,\n                )\n            }\n        }\n\n        /*\n         * Spotbugs\n         * ====================================================\n         */\n        apply(plugin = \"com.github.spotbugs\")\n\n        // We don't need to lint tests.\n        tasks[\"spotbugsTest\"].enabled = false\n\n        // Configure the bug filter for spotbugs.\n        spotbugs {\n            effort.set(Effort.MAX)\n            val excludeFile = File(\"${project.rootDir}/config/spotbugs/filter.xml\")\n            if (excludeFile.exists()) {\n                excludeFilter.set(excludeFile)\n            }\n        }\n\n        apply(plugin = \"com.diffplug.spotless\")\n\n        spotless {\n            java {\n                // Enforce a common license header on all files\n                licenseHeaderFile(\"${project.rootDir}/config/spotless/license-header.txt\")\n                    .onlyIfContentMatches(\"^((?!SKIPLICENSECHECK)[\\\\s\\\\S])*\\$\")\n                leadingTabsToSpaces()\n                endWithNewline()\n                eclipse().configFile(\"${project.rootDir}/config/spotless/formatting.xml\")\n\n                // Fixes for some strange formatting applied by eclipse:\n                // see: https://github.com/kamkie/demo-spring-jsf/blob/bcacb9dc90273a5f8d2569470c5bf67b171c7d62/build.gradle.kts#L159\n                // These have to be implemented with anonymous classes this way instead of lambdas because of:\n                // https://github.com/diffplug/spotless/issues/2387\n                custom(\n                    \"Lambda fix\",\n                    object : Serializable, FormatterFunc {\n                        override fun apply(input: String): String = input.replace(\"} )\", \"})\").replace(\"} ,\", \"},\")\n                    },\n                )\n                custom(\n                    \"Long literal fix\",\n                    object : Serializable, FormatterFunc {\n                        override fun apply(input: String): String = Pattern.compile(\"([0-9_]+) [Ll]\").matcher(input).replaceAll(\"\\$1L\")\n                    },\n                )\n\n                // Static first, then everything else alphabetically\n                removeUnusedImports()\n                importOrder(\"\\\\#\", \"\")\n                // Ignore generated code for formatter check\n                targetExclude(\"*/build/**/*.*\")\n            }\n\n            // Formatting for build.gradle.kts files\n            kotlinGradle {\n                ktlint()\n                leadingTabsToSpaces()\n                trimTrailingWhitespace()\n                endWithNewline()\n                licenseHeaderFile(\n                    \"${project.rootDir}/config/spotless/license-header.txt\",\n                    \"import|tasks|apply|plugins|rootProject\",\n                )\n            }\n            tasks {\n                // If the property \"noFormat\" is set, don't auto-format source file (like in CI)\n                if (!project.hasProperty(\"noFormat\")) {\n                    build {\n                        dependsOn(spotlessApply)\n                    }\n                }\n            }\n        }\n    }\n}\n\n/*\n * Jreleaser (https://jreleaser.org) config.\n */\njreleaser {\n    dryrun = false\n\n    // Used for creating a tagged release, uploading files and generating changelog.\n    // In the future we can set this up to push release tags to GitHub, but for now it's\n    // set up to do nothing.\n    // https://jreleaser.org/guide/latest/reference/release/index.html\n    release {\n        generic {\n            enabled = true\n            skipRelease = true\n        }\n    }\n\n    // Used to announce a release to configured announcers.\n    // https://jreleaser.org/guide/latest/reference/announce/index.html\n    announce {\n        active = Active.NEVER\n    }\n\n    // Signing configuration.\n    // https://jreleaser.org/guide/latest/reference/signing.html\n    signing {\n        active = Active.ALWAYS\n        armored = true\n    }\n\n    // Configuration for deploying to Maven Central.\n    // https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle\n    deploy {\n        maven {\n            mavenCentral {\n                create(\"maven-central\") {\n                    active = Active.ALWAYS\n                    url = \"https://central.sonatype.com/api/v1/publisher\"\n                    stagingRepositories.add(\n                        rootProject.layout.buildDirectory\n                            .dir(\"staging\")\n                            .get()\n                            .asFile.absolutePath,\n                    )\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "config/checkstyle/checkstyle.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n  ~ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n  ~ SPDX-License-Identifier: Apache-2.0\n  -->\n\n<!DOCTYPE module PUBLIC\n  \"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN\"\n  \"https://checkstyle.org/dtds/configuration_1_3.dtd\">\n\n<module name=\"Checker\">\n    <module name=\"SuppressWarningsFilter\"/>\n\n    <module name=\"SuppressionFilter\">\n        <property name=\"file\" value=\"${config_loc}/suppressions.xml\"/>\n    </module>\n\n    <module name=\"BeforeExecutionExclusionFileFilter\">\n        <property name=\"fileNamePattern\" value=\"(module\\-info\\.java$|Test.java$|src/test/java)\"/>\n    </module>\n\n    <!-- Files must contain a copyright header without a year. The check for 2019-2023 is retained for historical purposes. -->\n    <module name=\"RegexpHeader\">\n        <property name=\"header\"\n                  value=\"/\\*\\n \\* Copyright( 20(19|20|21|22|23)|) Amazon\\.com, Inc\\. or its affiliates\\. All Rights Reserved\\.\\n\"/>\n        <property name=\"fileExtensions\" value=\"java\"/>\n    </module>\n\n    <!-- Checks for whitespace                               -->\n    <!-- See http://checkstyle.sf.net/config_whitespace.html -->\n    <module name=\"FileTabCharacter\"/>\n\n    <module name=\"TreeWalker\">\n        <!-- Make comments and annotations available for the suppression comment filter. -->\n        <module name=\"SuppressWarningsHolder\"/>\n        <module name=\"SuppressionCommentFilter\"/>\n\n        <!-- Checks for imports                              -->\n        <!-- See http://checkstyle.sf.net/config_import.html -->\n        <module name=\"NoLineWrap\"/>\n        <module name=\"AvoidStarImport\"/>\n        <module name=\"IllegalImport\"/> <!-- defaults to sun.* packages -->\n        <module name=\"RedundantImport\"/>\n        <module name=\"UnusedImports\">\n            <property name=\"processJavadoc\" value=\"true\"/>\n        </module>\n        <module name=\"CustomImportOrder\">\n            <property name=\"sortImportsInGroupAlphabetically\" value=\"true\"/>\n            <property name=\"separateLineBetweenGroups\" value=\"true\"/>\n            <property name=\"customImportOrderRules\" value=\"STATIC###THIRD_PARTY_PACKAGE\"/>\n        </module>\n        <module name=\"AvoidStarImport\"/>\n\n        <!-- Checks for Javadoc comments.                     -->\n        <!-- See http://checkstyle.sf.net/config_javadoc.html -->\n        <module name=\"JavadocMethod\">\n            <property name=\"allowMissingParamTags\" value=\"true\"/>\n            <property name=\"allowMissingReturnTag\" value=\"true\"/>\n            <property name=\"allowedAnnotations\" value=\"Override, Test\"/>\n        </module>\n        <module name=\"JavadocStyle\"/>\n        <module name=\"NonEmptyAtclauseDescription\"/>\n        <module name=\"AtclauseOrder\">\n            <property name=\"tagOrder\" value=\"@param, @return, @throws, @deprecated\"/>\n            <property name=\"target\" value=\"CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF\"/>\n        </module>\n        <module name=\"MissingOverride\"/>\n\n        <!-- Checks for Naming Conventions.                  -->\n        <!-- See http://checkstyle.sf.net/config_naming.html -->\n        <module name=\"ConstantName\"/>\n        <module name=\"LocalFinalVariableName\"/>\n        <module name=\"LocalVariableName\"/>\n        <module name=\"MemberName\"/>\n        <module name=\"MethodName\"/>\n        <module name=\"PackageName\"/>\n        <module name=\"ParameterName\"/>\n        <module name=\"StaticVariableName\"/>\n        <module name=\"TypeName\"/>\n        <module name=\"AbbreviationAsWordInName\">\n            <property name=\"ignoreFinal\" value=\"false\"/>\n            <property name=\"allowedAbbreviationLength\" value=\"1\"/>\n            <property name=\"severity\" value=\"warning\"/>\n        </module>\n\n        <!-- Modifier Checks                                    -->\n        <!-- See http://checkstyle.sf.net/config_modifiers.html -->\n        <module name=\"ModifierOrder\"/>\n        <module name=\"RedundantModifier\"/>\n\n        <!-- Checks for common coding problems               -->\n        <!-- See http://checkstyle.sf.net/config_coding.html -->\n        <module name=\"EqualsHashCode\"/>\n        <module name=\"IllegalInstantiation\"/>\n        <module name=\"InnerAssignment\"/>\n        <module name=\"MissingSwitchDefault\"/>\n        <module name=\"SimplifyBooleanExpression\"/>\n        <module name=\"SimplifyBooleanReturn\"/>\n        <module name=\"NoFinalizer\"/>\n        <module name=\"DeclarationOrder\"/>\n        <module name=\"OneStatementPerLine\"/>\n        <module name=\"MultipleVariableDeclarations\"/>\n        <module name=\"IllegalTokenText\">\n            <property name=\"tokens\" value=\"STRING_LITERAL, CHAR_LITERAL\"/>\n            <property name=\"format\"\n                      value=\"\\\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\\\(0(10|11|12|14|15|42|47)|134)\"/>\n            <property name=\"message\" value=\"Avoid using corresponding octal or Unicode escape.\"/>\n        </module>\n\n        <!-- Checks for class design                         -->\n        <!-- See http://checkstyle.sf.net/config_design.html -->\n        <module name=\"FinalClass\"/>\n        <module name=\"HideUtilityClassConstructor\"/>\n        <module name=\"InterfaceIsType\"/>\n        <module name=\"OneTopLevelClass\"/>\n\n        <!-- Miscellaneous other checks.                   -->\n        <!-- See http://checkstyle.sf.net/config_misc.html -->\n        <module name=\"UpperEll\"/>\n        <module name=\"ArrayTypeStyle\"/>\n        <module name=\"OuterTypeFilename\"/>\n        <module name=\"AvoidEscapedUnicodeCharacters\">\n            <property name=\"allowEscapesForControlCharacters\" value=\"true\"/>\n            <property name=\"allowByTailComment\" value=\"true\"/>\n            <property name=\"allowNonPrintableEscapes\" value=\"true\"/>\n        </module>\n    </module>\n</module>\n"
  },
  {
    "path": "config/checkstyle/suppressions.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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  ~ A copy of the License is located at\n  ~\n  ~  http://aws.amazon.com/apache2.0\n  ~\n  ~ or in the \"license\" file accompanying this file. This file is distributed\n  ~ on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n  ~ express or implied. See the License for the specific language governing\n  ~ permissions and limitations under the License.\n  -->\n\n<!DOCTYPE suppressions PUBLIC\n        \"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN\"\n        \"https://checkstyle.org/dtds/suppressions_1_2.dtd\">\n<suppressions>\n</suppressions>\n"
  },
  {
    "path": "config/spotbugs/filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~ Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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  ~ A copy of the License is located at\n  ~\n  ~  http://aws.amazon.com/apache2.0\n  ~\n  ~ or in the \"license\" file accompanying this file. This file is distributed\n  ~ on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n  ~ express or implied. See the License for the specific language governing\n  ~ permissions and limitations under the License.\n  -->\n\n<FindBugsFilter>\n    <!-- Ignore all test files. -->\n    <Match>\n        <Class name=\"~Test\\.java$\"/>\n    </Match>\n\n    <!-- Exceptions aren't going to be serialized. -->\n    <Match>\n        <Bug pattern=\"SE_NO_SERIALVERSIONID,SE_BAD_FIELD\"/>\n    </Match>\n  \n    <Match>\n        <Bug pattern=\"EI_EXPOSE_REP\"/>\n    </Match>\n    <Match>\n        <Bug pattern=\"EI_EXPOSE_REP2\"/>\n    </Match>\n\n    <!-- Excessive Defensive checks on constructor exceptions. -->\n    <Match>\n        <Bug pattern=\"CT_CONSTRUCTOR_THROW\"/>\n    </Match>\n\n    <Match>\n        <Bug pattern=\"VA_FORMAT_STRING_USES_NEWLINE\"/>\n    </Match>\n</FindBugsFilter>\n"
  },
  {
    "path": "config/spotless/formatting.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<profiles version=\"20\">\n    <profile kind=\"CodeFormatterProfile\" name=\"PalantirStyle\" version=\"20\">\n        <setting id=\"org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines\" value=\"2147483647\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.align_type_members_on_columns\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.align_with_spaces\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_additive_operator\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant\" value=\"49\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field\" value=\"49\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable\" value=\"49\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method\" value=\"49\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package\" value=\"49\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type\" value=\"49\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_assertion_message\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_assignment\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_compact_if\" value=\"48\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_compact_loops\" value=\"48\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_conditional_expression\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_enum_constants\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header\" value=\"48\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_logical_operator\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_method_declaration\" value=\"12\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_module_statements\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_multiple_fields\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration\" value=\"48\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration\" value=\"48\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_record_components\" value=\"48\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_relational_operator\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_resources_in_try\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_shift_operator\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_string_concatenation\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_type_annotations\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_type_arguments\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_type_parameters\" value=\"16\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch\" value=\"80\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_after_imports\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_after_package\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_field\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_imports\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_member_type\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_method\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_before_package\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_between_import_groups\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations\" value=\"2\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_array_initializer\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_block\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_block_in_case\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_enum_constant\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_lambda_body\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_method_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_record_constructor\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_record_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_switch\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.brace_position_for_type_declaration\" value=\"end_of_line\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.format_block_comments\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.format_header\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.format_html\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.format_javadoc_comments\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.format_line_comments\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.format_source_code\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.indent_parameter_description\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.indent_root_tags\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.indent_tag_description\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.line_length\" value=\"120\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.compact_else_if\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.continuation_indentation\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.disabling_tag\" value=\"@formatter:off\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.enabling_tag\" value=\"@formatter:on\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_empty_lines\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_statements_compare_to_block\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_statements_compare_to_body\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.indentation.size\" value=\"4\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_label\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_additive_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_ellipsis\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_logical_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_not_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_relational_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_shift_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_after_unary_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_additive_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_ellipsis\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_logical_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_relational_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_semicolon\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_shift_operator\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation\" value=\"insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_before_unary_operator\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation\" value=\"do not insert\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.join_lines_in_comments\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.join_wrapped_lines\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_code_block_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_method_body_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line\" value=\"one_line_if_empty\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.lineSplit\" value=\"120\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block\" value=\"0\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration\"\n                 value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause\" value=\"separate_lines_if_wrapped\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.tabulation.char\" value=\"space\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.tabulation.size\" value=\"4\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.text_block_indentation\" value=\"1\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.use_on_off_tags\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_additive_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_assignment_operator\" value=\"false\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_conditional_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_logical_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_relational_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_shift_operator\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_before_string_concatenation\" value=\"true\"/>\n        <setting id=\"org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested\" value=\"true\"/>\n    </profile>\n</profiles>"
  },
  {
    "path": "config/spotless/license-header.txt",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n"
  },
  {
    "path": "gradle.properties",
    "content": "smithyVersion=1.69.0\nsmithyGradleVersion=1.3.0\norg.gradle.configuration-cache=true\norg.gradle.configuration-cache.inputs.unsafe.ignore.file-system-checks=build/jreleaser/marker.txt"
  },
  {
    "path": "gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015 the original authors.\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# SPDX-License-Identifier: Apache-2.0\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd -P \"${APP_HOME:-./}\" > /dev/null && printf '%s\\n' \"$PWD\" ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    if ! command -v java >/dev/null 2>&1\n    then\n        die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC2039,SC3045\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC2039,SC3045\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command:\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,\n#     and any embedded shellness will be escaped.\n#   * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be\n#     treated as '${Hostname}' itself on the command line.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -jar \"$APP_HOME/gradle/wrapper/gradle-wrapper.jar\" \\\n        \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n    die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n@rem SPDX-License-Identifier: Apache-2.0\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -jar \"%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\" %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif %ERRORLEVEL% equ 0 goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nset EXIT_CODE=%ERRORLEVEL%\r\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\r\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\nexit /b %EXIT_CODE%\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "jest.config.base.js",
    "content": "const { compilerOptions } = require(\"@tsconfig/recommended/tsconfig.json\");\n\nmodule.exports = {\n  preset: \"ts-jest\",\n  testMatch: [\"**/*.spec.ts\", \"!**/*.browser.spec.ts\", \"!**/*.integ.spec.ts\"],\n  transform: {\n    \"^.+\\\\.tsx?$\": [\n      \"ts-jest\",\n      {\n        ...compilerOptions,\n        noImplicitAny: false,\n        strictNullChecks: false,\n      },\n    ],\n  },\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"smithy-typescript\",\n  \"private\": true,\n  \"version\": \"1.0.0\",\n  \"description\": \"Smithy TypeScript packages\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"clean\": \"turbo run clean --force --parallel\",\n    \"build\": \"turbo run build\",\n    \"test\": \"make test-unit\",\n    \"test:integration\": \"yarn build-test-packages && make test-integration\",\n    \"test:protocols\": \"make generate-protocol-tests test-protocols benchmark\",\n    \"lint\": \"turbo run lint\",\n    \"lint-fix\": \"turbo run lint -- --fix\",\n    \"lint:pkgJson\": \"yarn lint:dependencies\",\n    \"lint:dependencies\": \"node scripts/check-dependencies.js\",\n    \"lint:versions\": \"node scripts/runtime-dep-version-check.js\",\n    \"lint:api\": \"node scripts/validation/api-snapshot-validation.js\",\n    \"format\": \"turbo run format --parallel\",\n    \"stage-release\": \"turbo run stage-release\",\n    \"extract:docs\": \"mkdir -p api-extractor-packages && turbo run extract:docs\",\n    \"release\": \"yarn changeset publish\",\n    \"build-test-packages\": \"./gradlew clean build && node ./scripts/build-generated-test-packages\",\n    \"g:tsc\": \"cd $INIT_CWD && tsc\",\n    \"g:vitest\": \"cd $INIT_CWD && vitest\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript/tree/main\"\n  },\n  \"author\": \"AWS Smithy Team\",\n  \"license\": \"UNLICENSED\",\n  \"dependencies\": {\n    \"@changesets/cli\": \"^2.27.5\",\n    \"glob\": \"^7.1.6\",\n    \"premove\": \"4.0.0\"\n  },\n  \"devDependencies\": {\n    \"@ianvs/prettier-plugin-sort-imports\": \"^4.7.1\",\n    \"@microsoft/api-extractor\": \"7.52.7\",\n    \"@rollup/plugin-json\": \"^6.1.0\",\n    \"@rollup/plugin-node-resolve\": \"^16.0.1\",\n    \"@rollup/plugin-typescript\": \"^12.1.4\",\n    \"@tsconfig/recommended\": \"1.0.2\",\n    \"@types/jest\": \"28.1.3\",\n    \"@types/jsdom\": \"20.0.1\",\n    \"@typescript-eslint/eslint-plugin\": \"8.32.0\",\n    \"@typescript-eslint/parser\": \"8.32.0\",\n    \"esbuild\": \"^0.25.9\",\n    \"eslint\": \"8.57.0\",\n    \"eslint-plugin-n\": \"^17.24.0\",\n    \"eslint-plugin-tsdoc\": \"0.2.17\",\n    \"get-port\": \"^7.1.0\",\n    \"happy-dom\": \"20.8.9\",\n    \"husky\": \"^4.2.3\",\n    \"jest\": \"29.7.0\",\n    \"prettier\": \"3.2.5\",\n    \"puppeteer\": \"^19.2.0\",\n    \"rollup\": \"^4.59.0\",\n    \"ts-jest\": \"29.1.2\",\n    \"tsx\": \"^4.21.0\",\n    \"turbo\": \"2.5.8\",\n    \"typescript\": \"~5.8.3\",\n    \"vite\": \"^7.1.11\",\n    \"vitest\": \"^3.2.4\",\n    \"webpack\": \"^5.104.1\",\n    \"webpack-cli\": \"^6.0.1\"\n  },\n  \"overrides\": {},\n  \"workspaces\": [\n    \"packages/*\",\n    \"smithy-typescript-ssdk-libs/*\",\n    \"private/*\"\n  ],\n  \"packageManager\": \"yarn@4.10.3\",\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"yarn lint:dependencies && yarn lint:versions & yarn lint:api\"\n    }\n  }\n}\n"
  },
  {
    "path": "packages/abort-controller/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/abort-controller/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.2.15\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.1.0\n\n### Minor Changes\n\n- c2a5595: use platform AbortController|AbortSignal implementations\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/abort-controller](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/abort-controller/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/abort-controller/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/abort-controller/README.md",
    "content": "# @smithy/abort-controller\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/abort-controller/latest.svg)](https://www.npmjs.com/package/@smithy/abort-controller)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/abort-controller.svg)](https://www.npmjs.com/package/@smithy/abort-controller)\n\n### :warning: Deprecated API :warning:\n\nThis is the legacy polyfill for AbortController. You should use the native AbortController\nclass instead.\n"
  },
  {
    "path": "packages/abort-controller/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/abort-controller/package.json",
    "content": "{\n  \"name\": \"@smithy/abort-controller\",\n  \"version\": \"4.2.15\",\n  \"description\": \"A simple abort controller library\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline abort-controller\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/abort-controller\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/abort-controller\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/abort-controller/src/AbortController.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { AbortController } from \"./AbortController\";\nimport { AbortSignal } from \"./AbortSignal\";\n\ndescribe(\"AbortController\", () => {\n  it(\"should communicate cancellation via its signal\", () => {\n    const source = new AbortController();\n    const { signal } = source;\n    expect(signal).toBeInstanceOf(AbortSignal);\n    expect(signal.aborted).toBe(false);\n\n    source.abort();\n    expect(signal.aborted).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/abort-controller/src/AbortController.ts",
    "content": "import { AbortController as DeprecatedAbortController } from \"@smithy/types\";\n\nimport { AbortSignal } from \"./AbortSignal\";\n\n/**\n * @public\n */\nexport { DeprecatedAbortController as IAbortController };\n\n/**\n * @deprecated This implementation was added as Node.js didn't support AbortController prior to 15.x\n * Use native implementation in browsers or Node.js \\>=15.4.0.\n *\n * @public\n */\nexport class AbortController implements DeprecatedAbortController {\n  public readonly signal: AbortSignal = new AbortSignal();\n\n  abort(): void {\n    this.signal.abort();\n  }\n}\n"
  },
  {
    "path": "packages/abort-controller/src/AbortSignal.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { AbortController } from \"./AbortController\";\n\ndescribe(\"AbortSignal\", () => {\n  it(\"should report aborted to be false until the signal is aborted\", () => {\n    const controller = new AbortController();\n    const { signal } = controller;\n    expect(signal.aborted).toBe(false);\n\n    controller.abort();\n    expect(signal.aborted).toBe(true);\n  });\n\n  it(\"should invoke the onabort handler when the signal is aborted\", () => {\n    const controller = new AbortController();\n    const { signal } = controller;\n    const abortHandler = vi.fn();\n    signal.onabort = abortHandler;\n    expect(abortHandler.mock.calls.length).toBe(0);\n    controller.abort();\n    expect(abortHandler.mock.calls.length).toBe(1);\n  });\n\n  it(\"should not invoke the onabort handler multiple time\", () => {\n    const controller = new AbortController();\n    const { signal } = controller;\n    const abortHandler = vi.fn();\n    signal.onabort = abortHandler;\n    expect(abortHandler.mock.calls.length).toBe(0);\n    controller.abort();\n    expect(abortHandler.mock.calls.length).toBe(1);\n    controller.abort();\n    expect(abortHandler.mock.calls.length).toBe(1);\n  });\n});\n"
  },
  {
    "path": "packages/abort-controller/src/AbortSignal.ts",
    "content": "import { AbortHandler, AbortSignal as DeprecatedAbortSignal } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport { AbortHandler, DeprecatedAbortSignal as IAbortSignal };\n\n/**\n * @public\n */\nexport class AbortSignal implements DeprecatedAbortSignal {\n  public onabort: AbortHandler | null = null;\n  private _aborted = false;\n\n  constructor() {\n    Object.defineProperty(this, \"_aborted\", {\n      value: false,\n      writable: true,\n    });\n  }\n\n  /**\n   * Whether the associated operation has already been cancelled.\n   */\n  get aborted(): boolean {\n    return this._aborted;\n  }\n\n  /**\n   * @internal\n   */\n  abort(): void {\n    this._aborted = true;\n    if (this.onabort) {\n      this.onabort(this);\n      this.onabort = null;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/abort-controller/src/index.ts",
    "content": "/**\n * This implementation was added as Node.js didn't support AbortController prior to 15.x\n * Use native implementation in browsers or Node.js \\>=15.4.0.\n *\n * @deprecated Use standard implementations in [Browsers](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [Node.js](https://nodejs.org/docs/latest/api/globals.html#class-abortcontroller)\n * @packageDocumentation\n */\nexport * from \"./AbortController\";\nexport * from \"./AbortSignal\";\n"
  },
  {
    "path": "packages/abort-controller/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/abort-controller/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/abort-controller/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/abort-controller/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/chunked-blob-reader/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/chunked-blob-reader/CHANGELOG.md",
    "content": "# @smithy/chunked-blob-reader\n\n## 5.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 5.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 5.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 5.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- ee92b6b: move core/serde checksum components to core/checksum\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/chunked-blob-reader/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/chunked-blob-reader/package.json",
    "content": "{\n  \"name\": \"@smithy/chunked-blob-reader\",\n  \"version\": \"5.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/chunked-blob-reader\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/chunked-blob-reader\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { blobReader } from \"@smithy/core/checksum\";\n"
  },
  {
    "path": "packages/chunked-blob-reader/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/CHANGELOG.md",
    "content": "# @smithy/chunked-blob-reader-native\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- ee92b6b: move core/serde checksum components to core/checksum\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/chunked-blob-reader-native/package.json",
    "content": "{\n  \"name\": \"@smithy/chunked-blob-reader-native\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/chunked-blob-reader-native\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/chunked-blob-reader-native\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { blobReader } from \"@smithy/core/checksum\";\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/chunked-blob-reader-native/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/config-resolver/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/config-resolver/CHANGELOG.md",
    "content": "# @smithy/config-resolver\n\n## 4.5.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.5.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.5.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/config-resolver/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/config-resolver/package.json",
    "content": "{\n  \"name\": \"@smithy/config-resolver\",\n  \"version\": \"4.5.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/config-resolver\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/config-resolver\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/config-resolver/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport {\n  ENV_USE_DUALSTACK_ENDPOINT,\n  CONFIG_USE_DUALSTACK_ENDPOINT,\n  DEFAULT_USE_DUALSTACK_ENDPOINT,\n  NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,\n  nodeDualstackConfigSelectors,\n  ENV_USE_FIPS_ENDPOINT,\n  CONFIG_USE_FIPS_ENDPOINT,\n  DEFAULT_USE_FIPS_ENDPOINT,\n  NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,\n  nodeFipsConfigSelectors,\n  resolveCustomEndpointsConfig,\n  resolveEndpointsConfig,\n  REGION_ENV_NAME,\n  REGION_INI_NAME,\n  NODE_REGION_CONFIG_OPTIONS,\n  NODE_REGION_CONFIG_FILE_OPTIONS,\n  resolveRegionConfig,\n  getRegionInfo,\n} from \"@smithy/core/config\";\nexport type {\n  CustomEndpointsInputConfig,\n  CustomEndpointsResolvedConfig,\n  EndpointsInputConfig,\n  EndpointsResolvedConfig,\n  RegionInputConfig,\n  RegionResolvedConfig,\n  PartitionHash,\n  RegionHash,\n  EndpointVariant,\n  EndpointVariantTag,\n  GetRegionInfoOptions,\n} from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/config-resolver/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/config-resolver/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/config-resolver/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/core/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n!*.d.ts"
  },
  {
    "path": "packages/core/CHANGELOG.md",
    "content": "# Change Log\n\n## 3.24.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n\n## 3.24.2\n\n### Patch Changes\n\n- 6d4eb8a: fix for browser utf8 variant not to include Buffer (Node.js)\n\n## 3.24.1\n\n### Patch Changes\n\n- 2dc5cf6: fix for uuid generation in Node.js 18.x\n- 1d0ff86: retrieve schemas with matching shape name if unambiguous\n\n## 3.24.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- 9194e9f: consolidate into core/endpoints\n- 7ec62a0: fix browser bundler metadata for @smithy/core\n- 62fed78: package consolidation for core/config\n- cad44fc: consolidate core/event-streams\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- ee92b6b: move core/serde checksum components to core/checksum\n- 0be0b36: clean up exported API surface\n- fb323fb: avoid sideEffects in core submodule indices\n- 545589a: Avoid throwing from waiter 403 warning checks when no responses have been observed.\n- 7fd6ac0: export surface equality for core, Node.js/browser/react-native\n\n## 3.23.17\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.25\n\n## 3.23.16\n\n### Patch Changes\n\n- a029f0e: Reduce intermediate allocations in hot paths\n  - @smithy/util-stream@4.5.24\n\n## 3.23.15\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/util-stream@4.5.23\n  - @smithy/protocol-http@5.3.14\n  - @smithy/url-parser@4.2.14\n  - @smithy/util-middleware@4.2.14\n\n## 3.23.14\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/protocol-http@5.3.13\n  - @smithy/url-parser@4.2.13\n  - @smithy/util-middleware@4.2.13\n  - @smithy/util-stream@4.5.22\n\n## 3.23.13\n\n### Patch Changes\n\n- 7198e09: Remove unnecessary shallow copy of input object and delete operations in `HttpBindingProtocol.serializeRequest` and `RpcProtocol.serializeRequest`. The body serializer is schema-driven and only reads members listed in the payload schema, making the spread and deletes redundant. This eliminates an O(n) copy and 5 delete operations per request.\n  - @smithy/util-stream@4.5.21\n\n## 3.23.12\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.20\n\n## 3.23.11\n\n### Patch Changes\n\n- 2edd638: feat(schema): add caching to NormalizedSchema.of() and translateTraits()\n  - @smithy/util-stream@4.5.19\n\n## 3.23.10\n\n### Patch Changes\n\n- 5340b11: apply resolved endpoint headers to final request\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/protocol-http@5.3.12\n  - @smithy/url-parser@4.2.12\n  - @smithy/util-middleware@4.2.12\n  - @smithy/util-stream@4.5.18\n\n## 3.23.9\n\n### Patch Changes\n\n- 6ef5430: fix typo in thrown error message\n- 6ef5430: default event stream body to empty byte array\n\n## 3.23.8\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-body-length-browser@4.2.2\n  - @smithy/middleware-serde@4.2.12\n  - @smithy/util-middleware@4.2.11\n  - @smithy/protocol-http@5.3.11\n  - @smithy/util-base64@4.3.2\n  - @smithy/util-stream@4.5.17\n  - @smithy/util-utf8@4.2.2\n  - @smithy/uuid@1.1.2\n\n## 3.23.7\n\n### Patch Changes\n\n- 11569eb: preserve null values for non-sparse collections in cbor deserializing\n  - @smithy/util-stream@4.5.16\n\n## 3.23.6\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/middleware-serde@4.2.11\n  - @smithy/protocol-http@5.3.10\n  - @smithy/util-middleware@4.2.10\n  - @smithy/util-stream@4.5.15\n\n## 3.23.5\n\n### Patch Changes\n\n- 026b177: fix(protocols): remove unsafe type cast in resolvedPath to handle null/undefined from labelValueProvider\n- cde9f09: fix extraneous serialization of idempotencyToken into http body\n\n## 3.23.4\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/middleware-serde@4.2.10\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-base64@4.3.1\n  - @smithy/util-body-length-browser@4.2.1\n  - @smithy/util-middleware@4.2.9\n  - @smithy/util-stream@4.5.14\n  - @smithy/util-utf8@4.2.1\n  - @smithy/uuid@1.1.1\n\n## 3.23.3\n\n### Patch Changes\n\n- Updated dependencies [ffe1843]\n  - @smithy/util-stream@4.5.13\n\n## 3.23.2\n\n### Patch Changes\n\n- c5db01c: fix for Unit event stream union targets\n\n## 3.23.1\n\n### Patch Changes\n\n- 6f96c01: omit absent resposne fields instead of assigning undefined\n\n## 3.23.0\n\n### Minor Changes\n\n- 4f05c6a: compose error TypeRegistry on protocol\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.12\n\n## 3.22.1\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.11\n\n## 3.22.0\n\n### Minor Changes\n\n- 472bf01: avoid autoboxing in NormalizedSchema::getSchema()\n\n## 3.21.1\n\n### Patch Changes\n\n- fa0e0c4: accept 0-byte event stream payloads as structure shapes\n\n## 3.21.0\n\n### Minor Changes\n\n- c2a6f46: improve schema struct iterator performance\n\n## 3.20.8\n\n### Patch Changes\n\n- 96cc077: limit scope of http label validation\n\n## 3.20.7\n\n### Patch Changes\n\n- ae6ef2e: client side httpLabel validation\n\n## 3.20.6\n\n### Patch Changes\n\n- 862c942: custom handling for \\_\\_type in structures\n\n## 3.20.5\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/middleware-serde@4.2.9\n  - @smithy/protocol-http@5.3.8\n  - @smithy/util-middleware@4.2.8\n  - @smithy/util-stream@4.5.10\n\n## 3.20.4\n\n### Patch Changes\n\n- Updated dependencies [87a5f20]\n  - @smithy/util-stream@4.5.9\n\n## 3.20.3\n\n### Patch Changes\n\n- 681d6c4: fix cbor bigDecimal serialization\n\n## 3.20.2\n\n### Patch Changes\n\n- dd55f1f: fix to conditionally set host prefix\n\n## 3.20.1\n\n### Patch Changes\n\n- aa954bc: fix for CBOR shape deserialization of BigDecimals\n\n## 3.20.0\n\n### Minor Changes\n\n- 9ccb841: add static union schema as a new type\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/middleware-serde@4.2.8\n  - @smithy/protocol-http@5.3.7\n  - @smithy/util-middleware@4.2.7\n  - @smithy/util-stream@4.5.8\n\n## 3.19.0\n\n### Minor Changes\n\n- 5a56762: make protocol selection easier\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/middleware-serde@4.2.7\n  - @smithy/protocol-http@5.3.6\n  - @smithy/util-middleware@4.2.6\n  - @smithy/util-stream@4.5.7\n\n## 3.18.7\n\n### Patch Changes\n\n- 541a18f: fix for CBOR date deserialization\n\n## 3.18.6\n\n### Patch Changes\n\n- 1d6db03: continue looking for event headers after event payload is found\n\n## 3.18.5\n\n### Patch Changes\n\n- 77c149f: drain stream in httpBindingProtocol with unit output\n\n## 3.18.4\n\n### Patch Changes\n\n- e659a06: set explicit enumerability on error.$response\n- Updated dependencies [e659a06]\n  - @smithy/middleware-serde@4.2.6\n\n## 3.18.3\n\n### Patch Changes\n\n- 5bcd041: fix for event stream binding deserialization\n\n## 3.18.2\n\n### Patch Changes\n\n- c8b148c: idempotency token generation for HttpBindingProtocol\n\n## 3.18.1\n\n### Patch Changes\n\n- 0976f42: generate idempotency token in ToStringShapeSerializer\n\n## 3.18.0\n\n### Minor Changes\n\n- 3926fd7: set release level for schemas\n\n### Patch Changes\n\n- e77f705: omit undefined values in cbor deserialization\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/middleware-serde@4.2.5\n  - @smithy/protocol-http@5.3.5\n  - @smithy/util-middleware@4.2.5\n  - @smithy/util-stream@4.5.6\n\n## 3.17.2\n\n### Patch Changes\n\n- 6da0ab3: export used types\n- df00095: fix schema date utils date parsing\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/middleware-serde@4.2.4\n  - @smithy/protocol-http@5.3.4\n  - @smithy/util-middleware@4.2.4\n  - @smithy/util-stream@4.5.5\n\n## 3.17.1\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.4\n\n## 3.17.0\n\n### Minor Changes\n\n- 8a2a912: remove usage of non-static schema classes\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n- Updated dependencies [7e359e2]\n  - @smithy/types@4.8.0\n  - @smithy/util-stream@4.5.3\n  - @smithy/middleware-serde@4.2.3\n  - @smithy/protocol-http@5.3.3\n  - @smithy/util-middleware@4.2.3\n\n## 3.16.1\n\n### Patch Changes\n\n- 052d261: fix ordering of static simple schema type\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/middleware-serde@4.2.2\n  - @smithy/protocol-http@5.3.2\n  - @smithy/util-middleware@4.2.2\n  - @smithy/util-stream@4.5.2\n\n## 3.16.0\n\n### Minor Changes\n\n- 7f8af58: generation of static schema\n- 8a2873c: implement SerdeContext base class\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/util-stream@4.5.1\n  - @smithy/middleware-serde@4.2.1\n  - @smithy/protocol-http@5.3.1\n  - @smithy/util-middleware@4.2.1\n\n## 3.15.0\n\n### Minor Changes\n\n- 813c9a5: refactoring to reduce code size\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/util-base64@4.3.0\n  - @smithy/util-stream@4.5.0\n\n## 3.14.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/middleware-serde@4.2.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-base64@4.2.0\n  - @smithy/util-body-length-browser@4.2.0\n  - @smithy/util-middleware@4.2.0\n  - @smithy/util-stream@4.4.0\n  - @smithy/util-utf8@4.2.0\n  - @smithy/uuid@1.1.0\n\n## 3.13.0\n\n### Minor Changes\n\n- 59e9952: separate error schema objects from error ctor\n\n## 3.12.0\n\n### Minor Changes\n\n- 97fe0d8: Replace 'uuid' with '@smithy/uuid'\n\n### Patch Changes\n\n- 3eb73f3: fix detection of member idempotencyToken trait\n\n## 3.11.1\n\n### Patch Changes\n\n- f8793be: prevent compilation from inserting Uint8Array type parameter\n- Updated dependencies [f8793be]\n  - @smithy/util-stream@4.3.2\n\n## 3.11.0\n\n### Minor Changes\n\n- bb7c1c1: schema code size optimizations\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/middleware-serde@4.1.1\n  - @smithy/protocol-http@5.2.1\n  - @smithy/util-middleware@4.1.1\n  - @smithy/util-stream@4.3.1\n\n## 3.10.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-body-length-browser@4.1.0\n  - @smithy/middleware-serde@4.1.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/util-base64@4.1.0\n  - @smithy/util-stream@4.3.0\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 3.9.2\n\n### Patch Changes\n\n- 06ac1f6: set explicit return type for cbor alloc\n\n## 3.9.1\n\n### Patch Changes\n\n- 29fad01: fix NumericValue typecheck\n\n## 3.9.0\n\n### Minor Changes\n\n- ab4f33f: CBOR protocol error handling fallbacks\n- d79dc91: schema serde eventstreams implementation\n\n## 3.8.0\n\n### Minor Changes\n\n- fd00602: handle idempotency token generation for CBOR protocol\n\n### Patch Changes\n\n- 64e033f: schema serde: http binding and cbor serializer refactoring\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/middleware-serde@4.0.9\n  - @smithy/protocol-http@5.1.3\n  - @smithy/util-middleware@4.0.5\n  - @smithy/util-stream@4.2.4\n\n## 3.7.2\n\n### Patch Changes\n\n- f4dcba0: fix offset calculation when decoding bigInteger in CBOR\n\n## 3.7.1\n\n### Patch Changes\n\n- 312801c: increase priority of types conditional exports\n- bb7975e: set sideEffects bundler metadata\n\n## 3.7.0\n\n### Minor Changes\n\n- d105c97: add instanceof overrides for schema classes\n\n### Patch Changes\n\n- @smithy/util-stream@4.2.3\n\n## 3.6.0\n\n### Minor Changes\n\n- 10a0534: support BigInt in cbor\n\n## 3.5.3\n\n### Patch Changes\n\n- 4a31774: allow old signature in protected method\n\n## 3.5.2\n\n### Patch Changes\n\n- 4642e7e: allow http prefix header and header to read from same binding\n- 147ceed: use smithy synthetic namespace for base errors\n- ae8f1f4: allow struct iterator acquisition on unit schema\n\n## 3.5.1\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/middleware-serde@4.0.8\n  - @smithy/protocol-http@5.1.2\n  - @smithy/util-middleware@4.0.4\n  - @smithy/util-stream@4.2.2\n\n## 3.5.0\n\n### Minor Changes\n\n- ae11e3a: add schema classes\n- 23812a9: add cbor protocol (alpha)\n\n### Patch Changes\n\n- Updated dependencies [ae11e3a]\n  - @smithy/middleware-serde@4.0.7\n\n## 3.4.0\n\n### Minor Changes\n\n- 06b0ce8: move serde functions from smithy-client to core/serde\n\n### Patch Changes\n\n- efb27ee: read code property of errors case-insensitively\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/middleware-serde@4.0.6\n  - @smithy/protocol-http@5.1.1\n  - @smithy/util-middleware@4.0.3\n  - @smithy/util-stream@4.2.1\n\n## 3.3.3\n\n### Patch Changes\n\n- Updated dependencies [786dd3a]\n  - @smithy/middleware-serde@4.0.5\n\n## 3.3.2\n\n### Patch Changes\n\n- Updated dependencies [103535a]\n  - @smithy/middleware-serde@4.0.4\n\n## 3.3.1\n\n### Patch Changes\n\n- 40ffcd5: copy input headers when building RPCv2 CBOR request\n\n## 3.3.0\n\n### Minor Changes\n\n- 5896264: Resolve auth schemes based on the preference list\n\n## 3.2.0\n\n### Minor Changes\n\n- 02ef79c: add numeric value container for serde\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/util-stream@4.2.0\n  - @smithy/types@4.2.0\n  - @smithy/middleware-serde@4.0.3\n  - @smithy/util-middleware@4.0.2\n\n## 3.1.5\n\n### Patch Changes\n\n- @smithy/util-stream@4.1.2\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [efedb20]\n  - @smithy/util-stream@4.1.1\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [d1d1f72]\n  - @smithy/util-stream@4.1.0\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [f5d0bac]\n  - @smithy/middleware-serde@4.0.2\n\n## 3.1.1\n\n### Patch Changes\n\n- @smithy/util-stream@4.0.2\n\n## 3.1.0\n\n### Minor Changes\n\n- 2aff9df: Added middleware support to pagination\n- 000b2ae: allow paginator token fallback to be specified by operation input\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/middleware-serde@4.0.1\n  - @smithy/protocol-http@5.0.1\n  - @smithy/util-middleware@4.0.1\n  - @smithy/util-stream@4.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-middleware@4.0.0\n  - @smithy/util-stream@4.0.0\n  - @smithy/util-utf8@4.0.0\n  - @smithy/middleware-serde@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n  - @smithy/util-body-length-browser@4.0.0\n\n## 2.5.7\n\n### Patch Changes\n\n- @smithy/util-stream@3.3.4\n\n## 2.5.6\n\n### Patch Changes\n\n- @smithy/util-stream@3.3.3\n\n## 2.5.5\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/middleware-serde@3.0.11\n  - @smithy/protocol-http@4.1.8\n  - @smithy/util-middleware@3.0.11\n  - @smithy/util-stream@3.3.2\n\n## 2.5.4\n\n### Patch Changes\n\n- 9c40f7b: make CBOR tags more distinct in JS\n\n## 2.5.3\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/middleware-serde@3.0.10\n  - @smithy/protocol-http@4.1.7\n  - @smithy/util-middleware@3.0.10\n  - @smithy/util-stream@3.3.1\n\n## 2.5.2\n\n### Patch Changes\n\n- c6ef519: avoid self referencing submodule import\n- Updated dependencies [c8d257b]\n- Updated dependencies [cd1929b]\n  - @smithy/util-stream@3.3.0\n  - @smithy/types@3.7.0\n  - @smithy/middleware-serde@3.0.9\n  - @smithy/protocol-http@4.1.6\n  - @smithy/util-middleware@3.0.9\n\n## 2.5.1\n\n### Patch Changes\n\n- Updated dependencies [ccdd49f]\n  - @smithy/util-stream@3.2.1\n\n## 2.5.0\n\n### Minor Changes\n\n- 84bec05: add feature identification map to smithy context\n- d07b0ab: feature detection for custom endpoint and gzip\n\n### Patch Changes\n\n- d07b0ab: reorganize smithy/core to be upstream of smithy/smithy-client\n- Updated dependencies [f4e0bd9]\n- Updated dependencies [84bec05]\n  - @smithy/util-stream@3.2.0\n  - @smithy/types@3.6.0\n  - @smithy/middleware-serde@3.0.8\n  - @smithy/protocol-http@4.1.5\n  - @smithy/util-middleware@3.0.8\n\n## 2.4.8\n\n### Patch Changes\n\n- Updated dependencies [75e0125]\n  - @smithy/smithy-client@3.4.0\n  - @smithy/middleware-retry@3.0.23\n\n## 2.4.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/middleware-endpoint@3.1.4\n  - @smithy/middleware-retry@3.0.22\n  - @smithy/middleware-serde@3.0.7\n  - @smithy/protocol-http@4.1.4\n  - @smithy/smithy-client@3.3.6\n  - @smithy/util-middleware@3.0.7\n\n## 2.4.6\n\n### Patch Changes\n\n- 18dd957: add compatibility types redirect\n- Updated dependencies [64600d8]\n  - @smithy/smithy-client@3.3.5\n  - @smithy/middleware-retry@3.0.21\n\n## 2.4.5\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.4\n- @smithy/middleware-retry@3.0.20\n\n## 2.4.4\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.3\n- @smithy/middleware-retry@3.0.19\n\n## 2.4.3\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/middleware-endpoint@3.1.3\n  - @smithy/middleware-retry@3.0.18\n  - @smithy/middleware-serde@3.0.6\n  - @smithy/protocol-http@4.1.3\n  - @smithy/smithy-client@3.3.2\n  - @smithy/util-middleware@3.0.6\n\n## 2.4.2\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/middleware-endpoint@3.1.2\n  - @smithy/middleware-retry@3.0.17\n  - @smithy/middleware-serde@3.0.5\n  - @smithy/protocol-http@4.1.2\n  - @smithy/smithy-client@3.3.1\n  - @smithy/util-middleware@3.0.5\n\n## 2.4.1\n\n### Patch Changes\n\n- Updated dependencies [c8c53ae]\n- Updated dependencies [2dad138]\n- Updated dependencies [d8df7bf]\n- Updated dependencies [9f3f2f5]\n  - @smithy/middleware-endpoint@3.1.1\n  - @smithy/types@3.4.0\n  - @smithy/smithy-client@3.3.0\n  - @smithy/middleware-retry@3.0.16\n  - @smithy/middleware-serde@3.0.4\n  - @smithy/protocol-http@4.1.1\n  - @smithy/util-middleware@3.0.4\n\n## 2.4.0\n\n### Minor Changes\n\n- 5865b65: cbor (de)serializer for JS\n\n### Patch Changes\n\n- Updated dependencies [5865b65]\n  - @smithy/smithy-client@3.2.0\n  - @smithy/middleware-retry@3.0.15\n\n## 2.3.2\n\n### Patch Changes\n\n- Updated dependencies [670553a]\n  - @smithy/smithy-client@3.1.12\n  - @smithy/middleware-retry@3.0.14\n\n## 2.3.1\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.11\n- @smithy/middleware-retry@3.0.13\n\n## 2.3.0\n\n### Minor Changes\n\n- 86862ea: switch to static HttpRequest clone method\n\n### Patch Changes\n\n- Updated dependencies [4a40961]\n- Updated dependencies [86862ea]\n  - @smithy/middleware-endpoint@3.1.0\n  - @smithy/protocol-http@4.1.0\n  - @smithy/smithy-client@3.1.10\n  - @smithy/middleware-retry@3.0.12\n  - @smithy/middleware-serde@3.0.3\n\n## 2.2.8\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.9\n- @smithy/middleware-retry@3.0.11\n\n## 2.2.7\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n  - @smithy/middleware-retry@3.0.10\n  - @smithy/smithy-client@3.1.8\n  - @smithy/middleware-serde@3.0.3\n\n## 2.2.6\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.0.5\n- @smithy/smithy-client@3.1.7\n- @smithy/middleware-retry@3.0.9\n\n## 2.2.5\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.6\n- @smithy/middleware-retry@3.0.8\n\n## 2.2.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/middleware-endpoint@3.0.4\n  - @smithy/middleware-retry@3.0.7\n  - @smithy/middleware-serde@3.0.3\n  - @smithy/protocol-http@4.0.3\n  - @smithy/smithy-client@3.1.5\n  - @smithy/util-middleware@3.0.3\n\n## 2.2.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/middleware-endpoint@3.0.3\n  - @smithy/middleware-retry@3.0.6\n  - @smithy/middleware-serde@3.0.2\n  - @smithy/protocol-http@4.0.2\n  - @smithy/smithy-client@3.1.4\n  - @smithy/util-middleware@3.0.2\n\n## 2.2.2\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.3\n- @smithy/middleware-retry@3.0.5\n\n## 2.2.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/middleware-endpoint@3.0.2\n  - @smithy/middleware-retry@3.0.4\n  - @smithy/middleware-serde@3.0.1\n  - @smithy/protocol-http@4.0.1\n  - @smithy/smithy-client@3.1.2\n  - @smithy/util-middleware@3.0.1\n\n## 2.2.0\n\n### Minor Changes\n\n- f9c50081: adds a module exports field in core\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [3689c949]\n  - @smithy/smithy-client@3.1.1\n  - @smithy/middleware-retry@3.0.3\n\n## 2.1.0\n\n### Minor Changes\n\n- ab3a90fa: enable package.json exports in core\n\n### Patch Changes\n\n- Updated dependencies [764047eb]\n  - @smithy/smithy-client@3.1.0\n  - @smithy/middleware-endpoint@3.0.1\n  - @smithy/middleware-retry@3.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- @smithy/smithy-client@3.0.1\n- @smithy/middleware-retry@3.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/middleware-endpoint@3.0.0\n  - @smithy/middleware-retry@3.0.0\n  - @smithy/middleware-serde@3.0.0\n  - @smithy/util-middleware@3.0.0\n  - @smithy/protocol-http@4.0.0\n  - @smithy/smithy-client@3.0.0\n\n## 1.4.2\n\n### Patch Changes\n\n- Updated dependencies [cc54b8d1]\n  - @smithy/middleware-endpoint@2.5.1\n  - @smithy/smithy-client@2.5.1\n  - @smithy/middleware-retry@2.3.1\n\n## 1.4.1\n\n### Patch Changes\n\n- Updated dependencies [e03a10ac]\n  - @smithy/middleware-retry@2.3.0\n\n## 1.4.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/middleware-endpoint@2.5.0\n  - @smithy/middleware-retry@2.2.0\n  - @smithy/middleware-serde@2.3.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/smithy-client@2.5.0\n  - @smithy/types@2.12.0\n\n## 1.3.8\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.5\n- @smithy/middleware-retry@2.1.7\n\n## 1.3.7\n\n### Patch Changes\n\n- Updated dependencies [32e3f6ff]\n  - @smithy/middleware-serde@2.2.1\n  - @smithy/middleware-endpoint@2.4.6\n  - @smithy/smithy-client@2.4.4\n  - @smithy/middleware-retry@2.1.6\n\n## 1.3.6\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n- Updated dependencies [49640d6c]\n  - @smithy/middleware-serde@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/middleware-endpoint@2.4.5\n  - @smithy/middleware-retry@2.1.5\n  - @smithy/protocol-http@3.2.2\n  - @smithy/smithy-client@2.4.3\n  - @smithy/util-middleware@2.1.4\n\n## 1.3.5\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.4.4\n- @smithy/smithy-client@2.4.2\n- @smithy/middleware-retry@2.1.4\n\n## 1.3.4\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/middleware-retry@2.1.3\n  - @smithy/types@2.10.1\n  - @smithy/middleware-endpoint@2.4.3\n  - @smithy/middleware-serde@2.1.3\n  - @smithy/protocol-http@3.2.1\n  - @smithy/smithy-client@2.4.1\n  - @smithy/util-middleware@2.1.3\n\n## 1.3.3\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/smithy-client@2.4.0\n  - @smithy/middleware-endpoint@2.4.2\n  - @smithy/middleware-retry@2.1.2\n  - @smithy/middleware-serde@2.1.2\n  - @smithy/util-middleware@2.1.2\n\n## 1.3.2\n\n### Patch Changes\n\n- 88980bc5: handle multi-part input token in paginator\n\n## 1.3.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/middleware-endpoint@2.4.1\n  - @smithy/middleware-retry@2.1.1\n  - @smithy/middleware-serde@2.1.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/smithy-client@2.3.1\n  - @smithy/types@2.9.1\n  - @smithy/util-middleware@2.1.1\n\n## 1.3.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/middleware-endpoint@2.4.0\n  - @smithy/middleware-retry@2.1.0\n  - @smithy/middleware-serde@2.1.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/smithy-client@2.3.0\n  - @smithy/types@2.9.0\n\n## 1.2.2\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/middleware-endpoint@2.3.0\n  - @smithy/types@2.8.0\n  - @smithy/smithy-client@2.2.1\n  - @smithy/middleware-retry@2.0.26\n  - @smithy/middleware-serde@2.0.16\n  - @smithy/protocol-http@3.0.12\n  - @smithy/util-middleware@2.0.9\n\n## 1.2.1\n\n### Patch Changes\n\n- Updated dependencies [164f3bbd]\n- Updated dependencies [164f3bbd]\n  - @smithy/smithy-client@2.2.0\n  - @smithy/middleware-retry@2.0.25\n\n## 1.2.0\n\n### Minor Changes\n\n- 12adf848: add paginator factory\n\n### Patch Changes\n\n- 3eb09aae: fix(core): strict core deps\n\n## 1.1.0\n\n### Minor Changes\n\n- 75cbb3e8: add requestBuilder\n\n## 1.0.5\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.2.3\n- @smithy/middleware-retry@2.0.24\n\n## 1.0.4\n\n### Patch Changes\n\n- @smithy/middleware-retry@2.0.23\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [44f78bd9]\n- Updated dependencies [340634a5]\n  - @smithy/middleware-retry@2.0.22\n  - @smithy/types@2.7.0\n  - @smithy/middleware-endpoint@2.2.2\n  - @smithy/middleware-serde@2.0.15\n  - @smithy/protocol-http@3.0.11\n\n## 1.0.2\n\n### Patch Changes\n\n- 8c674e70: Copy `getSmithyContext()` and `normalizeProvider()` to `@smithy/core`.\n- 9579a9a0: Add internal error and success handlers to `HttpSigner`.\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/middleware-endpoint@2.2.1\n  - @smithy/middleware-retry@2.0.21\n  - @smithy/middleware-serde@2.0.14\n  - @smithy/protocol-http@3.0.10\n\n## 1.0.1\n\n### Patch Changes\n\n- 4fca874e: Fix test script.\n\n## 1.0.0\n\n### Major Changes\n\n- 8044a814: feat(experimentalIdentityAndAuth): move `experimentalIdentityAndAuth` types and interfaces to `@smithy/types` and `@smithy/core`\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n- Updated dependencies [9e0a5a74]\n  - @smithy/middleware-endpoint@2.2.0\n  - @smithy/types@2.5.0\n  - @smithy/middleware-retry@2.0.20\n  - @smithy/middleware-serde@2.0.13\n  - @smithy/protocol-http@3.0.9\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n"
  },
  {
    "path": "packages/core/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/core/README.md",
    "content": "# @smithy/core\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/core/latest.svg)](https://www.npmjs.com/package/@smithy/core)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/core.svg)](https://www.npmjs.com/package/@smithy/core)\n\n### :warning: Internal API :warning:\n\n> This is an internal package.\n> That means this is used as a dependency for other, public packages, but\n> should not be taken directly as a dependency in your application's `package.json`.\n\n> If you are updating the version of this package, for example to bring in a\n> bug-fix, you should do so by updating your application lockfile with\n> e.g. `npm up @scope/package` or equivalent command in another\n> package manager, rather than taking a direct dependency.\n\n---\n\nThis package provides common or core functionality for generic Smithy clients.\n\nYou do not need to explicitly install this package, since it will be installed during code generation if used.\n\n## Development of `@smithy/core` submodules\n\nCore submodules are organized for distribution via the `package.json` `exports` field.\n\n`exports` is supported by default by the latest Node.js, webpack, and esbuild. For react-native, it can be\nenabled via instructions found at [reactnative.dev/blog](https://reactnative.dev/blog/2023/06/21/package-exports-support), but we also provide a compatibility redirect.\n\nThink of `@smithy/core` as a mono-package within the monorepo.\nIt preserves the benefits of modularization, for example to optimize Node.js initialization speed,\nwhile making it easier to have a consistent version of core dependencies, reducing package sprawl when\ninstalling a Smithy runtime client.\n\n### Guide for submodules\n\n- Each `index.ts` file corresponding to the pattern `./src/submodules/<MODULE_NAME>/index.ts` will be\n  published as a separate `dist-cjs` bundled submodule index using the `Inliner.js` build script.\n- create a folder as `./src/submodules/<SUBMODULE>` including an `index.ts` file and a `README.md` file.\n  - The linter will throw an error on missing submodule metadata in `package.json` and the various `tsconfig.json` files, but it will automatically fix them if possible.\n- a submodule is equivalent to a standalone `@smithy/<pkg>` package in that importing it in Node.js will resolve a separate bundle.\n- submodules may not relatively import files from other submodules. Instead, directly use the `@scope/pkg/submodule` name as the import.\n  - The linter will check for this and throw an error.\n- To the extent possible, correctly declaring submodule metadata is validated by the linter in `@smithy/core`.\n  The linter runs during `yarn build` and also as `yarn lint`.\n\n### When should I create an `@smithy/core/submodule` vs. `@smithy/new-package`?\n\nKeep in mind that the core package is installed by all downstream clients.\n\nIf the component functionality is upstream of multiple clients, it is\na good candidate for a core submodule. For example, if `middleware-retry` had been written\nafter the support for submodules was added, it would have been a submodule.\n\nIf the component's functionality is downstream of a client (rare), or only expected to be used by a very small\nsubset of clients, it could be written as a standalone package.\n"
  },
  {
    "path": "packages/core/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/core/cbor.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/cbor\" {\n  export * from \"@smithy/core/dist-types/submodules/cbor/index.d\";\n}\n"
  },
  {
    "path": "packages/core/cbor.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/cbor/index.js\");\n"
  },
  {
    "path": "packages/core/checksum.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for bundlers that do not support package.json exports field.\n */\nexport * from \"./dist-types/submodules/checksum/index.d\";\n"
  },
  {
    "path": "packages/core/checksum.js",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for bundlers that do not support package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/checksum/index.js\");\n"
  },
  {
    "path": "packages/core/client.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/client\" {\n  export * from \"@smithy/core/dist-types/submodules/client/index.d\";\n}\n"
  },
  {
    "path": "packages/core/client.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/client/index.js\");\n"
  },
  {
    "path": "packages/core/config.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for bundlers that do not support package.json exports field.\n */\nexport * from \"./dist-types/submodules/config/index.d\";\n"
  },
  {
    "path": "packages/core/config.js",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for bundlers that do not support package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/config/index.js\");\n"
  },
  {
    "path": "packages/core/endpoints.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/endpoints\" {\n  export * from \"@smithy/core/dist-types/submodules/endpoints/index.d\";\n}\n"
  },
  {
    "path": "packages/core/endpoints.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/endpoints/index.js\");\n"
  },
  {
    "path": "packages/core/event-streams.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/event-streams\" {\n  export * from \"@smithy/core/dist-types/submodules/event-streams/index.d\";\n}\n"
  },
  {
    "path": "packages/core/event-streams.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/event-streams/index.js\");\n"
  },
  {
    "path": "packages/core/package.json",
    "content": "{\n  \"name\": \"@smithy/core\",\n  \"version\": \"3.24.3\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline core\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"npx eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\" --fix && node ./scripts/lint\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:cbor:perf\": \"node ./scripts/cbor-perf.mjs\",\n    \"test:integration\": \"yarn g:vitest run -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"yarn g:vitest watch -c vitest.config.integ.mts\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist-types/index.d.ts\",\n      \"module\": \"./dist-es/index.js\",\n      \"node\": \"./dist-cjs/index.js\",\n      \"import\": \"./dist-es/index.js\",\n      \"require\": \"./dist-cjs/index.js\"\n    },\n    \"./package.json\": {\n      \"module\": \"./package.json\",\n      \"node\": \"./package.json\",\n      \"import\": \"./package.json\",\n      \"require\": \"./package.json\"\n    },\n    \"./cbor\": {\n      \"types\": \"./dist-types/submodules/cbor/index.d.ts\",\n      \"module\": \"./dist-es/submodules/cbor/index.js\",\n      \"node\": \"./dist-cjs/submodules/cbor/index.js\",\n      \"import\": \"./dist-es/submodules/cbor/index.js\",\n      \"require\": \"./dist-cjs/submodules/cbor/index.js\"\n    },\n    \"./protocols\": {\n      \"types\": \"./dist-types/submodules/protocols/index.d.ts\",\n      \"module\": \"./dist-es/submodules/protocols/index.js\",\n      \"node\": \"./dist-cjs/submodules/protocols/index.js\",\n      \"import\": \"./dist-es/submodules/protocols/index.js\",\n      \"require\": \"./dist-cjs/submodules/protocols/index.js\"\n    },\n    \"./serde\": {\n      \"types\": \"./dist-types/submodules/serde/index.d.ts\",\n      \"react-native\": {\n        \"import\": \"./dist-es/submodules/serde/index.native.js\",\n        \"require\": \"./dist-cjs/submodules/serde/index.native.js\"\n      },\n      \"browser\": {\n        \"import\": \"./dist-es/submodules/serde/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/serde/index.browser.js\"\n      },\n      \"module\": \"./dist-es/submodules/serde/index.js\",\n      \"node\": \"./dist-cjs/submodules/serde/index.js\",\n      \"import\": \"./dist-es/submodules/serde/index.js\",\n      \"require\": \"./dist-cjs/submodules/serde/index.js\"\n    },\n    \"./schema\": {\n      \"types\": \"./dist-types/submodules/schema/index.d.ts\",\n      \"module\": \"./dist-es/submodules/schema/index.js\",\n      \"node\": \"./dist-cjs/submodules/schema/index.js\",\n      \"import\": \"./dist-es/submodules/schema/index.js\",\n      \"require\": \"./dist-cjs/submodules/schema/index.js\"\n    },\n    \"./event-streams\": {\n      \"types\": \"./dist-types/submodules/event-streams/index.d.ts\",\n      \"react-native\": {\n        \"import\": \"./dist-es/submodules/event-streams/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/event-streams/index.browser.js\"\n      },\n      \"browser\": {\n        \"import\": \"./dist-es/submodules/event-streams/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/event-streams/index.browser.js\"\n      },\n      \"module\": \"./dist-es/submodules/event-streams/index.js\",\n      \"node\": \"./dist-cjs/submodules/event-streams/index.js\",\n      \"import\": \"./dist-es/submodules/event-streams/index.js\",\n      \"require\": \"./dist-cjs/submodules/event-streams/index.js\"\n    },\n    \"./endpoints\": {\n      \"types\": \"./dist-types/submodules/endpoints/index.d.ts\",\n      \"react-native\": {\n        \"import\": \"./dist-es/submodules/endpoints/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/endpoints/index.browser.js\"\n      },\n      \"browser\": {\n        \"import\": \"./dist-es/submodules/endpoints/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/endpoints/index.browser.js\"\n      },\n      \"module\": \"./dist-es/submodules/endpoints/index.js\",\n      \"node\": \"./dist-cjs/submodules/endpoints/index.js\",\n      \"import\": \"./dist-es/submodules/endpoints/index.js\",\n      \"require\": \"./dist-cjs/submodules/endpoints/index.js\"\n    },\n    \"./client\": {\n      \"types\": \"./dist-types/submodules/client/index.d.ts\",\n      \"module\": \"./dist-es/submodules/client/index.js\",\n      \"node\": \"./dist-cjs/submodules/client/index.js\",\n      \"import\": \"./dist-es/submodules/client/index.js\",\n      \"require\": \"./dist-cjs/submodules/client/index.js\"\n    },\n    \"./config\": {\n      \"types\": \"./dist-types/submodules/config/index.d.ts\",\n      \"react-native\": {\n        \"import\": \"./dist-es/submodules/config/index.native.js\",\n        \"require\": \"./dist-cjs/submodules/config/index.native.js\"\n      },\n      \"browser\": {\n        \"import\": \"./dist-es/submodules/config/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/config/index.browser.js\"\n      },\n      \"module\": \"./dist-es/submodules/config/index.js\",\n      \"node\": \"./dist-cjs/submodules/config/index.js\",\n      \"import\": \"./dist-es/submodules/config/index.js\",\n      \"require\": \"./dist-cjs/submodules/config/index.js\"\n    },\n    \"./checksum\": {\n      \"types\": \"./dist-types/submodules/checksum/index.d.ts\",\n      \"react-native\": {\n        \"import\": \"./dist-es/submodules/checksum/index.native.js\",\n        \"require\": \"./dist-cjs/submodules/checksum/index.native.js\"\n      },\n      \"browser\": {\n        \"import\": \"./dist-es/submodules/checksum/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/checksum/index.browser.js\"\n      },\n      \"module\": \"./dist-es/submodules/checksum/index.js\",\n      \"node\": \"./dist-cjs/submodules/checksum/index.js\",\n      \"import\": \"./dist-es/submodules/checksum/index.js\",\n      \"require\": \"./dist-cjs/submodules/checksum/index.js\"\n    },\n    \"./retry\": {\n      \"types\": \"./dist-types/submodules/retry/index.d.ts\",\n      \"react-native\": {\n        \"import\": \"./dist-es/submodules/retry/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/retry/index.browser.js\"\n      },\n      \"browser\": {\n        \"import\": \"./dist-es/submodules/retry/index.browser.js\",\n        \"require\": \"./dist-cjs/submodules/retry/index.browser.js\"\n      },\n      \"module\": \"./dist-es/submodules/retry/index.js\",\n      \"node\": \"./dist-cjs/submodules/retry/index.js\",\n      \"import\": \"./dist-es/submodules/retry/index.js\",\n      \"require\": \"./dist-cjs/submodules/retry/index.js\"\n    }\n  },\n  \"author\": {\n    \"name\": \"AWS Smithy Team\",\n    \"email\": \"\",\n    \"url\": \"https://smithy.io\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@aws-crypto/crc32\": \"5.2.0\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"./cbor.d.ts\",\n    \"./cbor.js\",\n    \"./endpoints.d.ts\",\n    \"./endpoints.js\",\n    \"./event-streams.d.ts\",\n    \"./event-streams.js\",\n    \"./protocols.d.ts\",\n    \"./protocols.js\",\n    \"./schema.d.ts\",\n    \"./schema.js\",\n    \"./serde.d.ts\",\n    \"./serde.js\",\n    \"dist-*/**\",\n    \"./client.d.ts\",\n    \"./client.js\",\n    \"./config.d.ts\",\n    \"./config.js\",\n    \"./checksum.d.ts\",\n    \"./checksum.js\",\n    \"./retry.d.ts\",\n    \"./retry.js\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/core\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"hash-test-vectors\": \"^1.3.2\",\n    \"json-bigint\": \"^1.0.0\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"browser\": {\n    \"./dist-es/submodules/checksum/index.js\": \"./dist-es/submodules/checksum/index.browser.js\",\n    \"./dist-es/submodules/config/index.js\": \"./dist-es/submodules/config/index.browser.js\",\n    \"./dist-es/submodules/endpoints/index.js\": \"./dist-es/submodules/endpoints/index.browser.js\",\n    \"./dist-es/submodules/event-streams/index.js\": \"./dist-es/submodules/event-streams/index.browser.js\",\n    \"./dist-es/submodules/retry/index.js\": \"./dist-es/submodules/retry/index.browser.js\",\n    \"./dist-es/submodules/serde/index.js\": \"./dist-es/submodules/serde/index.browser.js\"\n  },\n  \"react-native\": {\n    \"./dist-es/submodules/checksum/index.js\": \"./dist-es/submodules/checksum/index.native.js\",\n    \"./dist-cjs/submodules/checksum/index.js\": \"./dist-cjs/submodules/checksum/index.native.js\",\n    \"./dist-es/submodules/config/index.js\": \"./dist-es/submodules/config/index.native.js\",\n    \"./dist-cjs/submodules/config/index.js\": \"./dist-cjs/submodules/config/index.native.js\",\n    \"./dist-es/submodules/serde/index.js\": \"./dist-es/submodules/serde/index.native.js\",\n    \"./dist-cjs/submodules/serde/index.js\": \"./dist-cjs/submodules/serde/index.native.js\",\n    \"./dist-es/submodules/endpoints/index.js\": \"./dist-es/submodules/endpoints/index.browser.js\",\n    \"./dist-cjs/submodules/endpoints/index.js\": \"./dist-cjs/submodules/endpoints/index.browser.js\",\n    \"./dist-es/submodules/event-streams/index.js\": \"./dist-es/submodules/event-streams/index.browser.js\",\n    \"./dist-cjs/submodules/event-streams/index.js\": \"./dist-cjs/submodules/event-streams/index.browser.js\",\n    \"./dist-es/submodules/retry/index.js\": \"./dist-es/submodules/retry/index.browser.js\",\n    \"./dist-cjs/submodules/retry/index.js\": \"./dist-cjs/submodules/retry/index.browser.js\"\n  }\n}\n"
  },
  {
    "path": "packages/core/planning/consolidation.md",
    "content": "# Core Consolidation Plan\n\nThis is a consolidation plan for moving the monorepo's packages into the `@smithy/core` package,\nspecifically one of its submodules managed by package.json `exports` metadata.\n\nThe \"clients\" column shows two counts: direct dependents, then transitive dependents\n(i.e. clients that have the package anywhere in their dependency closure), comma-separated.\n\n### core/client\n\n| Package              | LoC  | Description/Rationale             | Clients  | Status |\n| -------------------- | ---- | --------------------------------- | -------- | ------ |\n| `smithy-client`      | 1504 | Client/command base classes       | 425, 425 | ✅     |\n| `middleware-stack`   | 394  | Core middleware infrastructure    | 425, 425 | ✅     |\n| `util-middleware`    | 28   | Middleware utilities              | 425, 425 | ✅     |\n| `invalid-dependency` | 19   | Placeholder used by smithy-client | 425, 425 | ✅     |\n| `util-waiter`        | 373  | Waiter utilities                  | 68, 69   | ✅     |\n\n### core/config\n\n| Package                      | LoC | Description/Rationale                             | Clients  | Status |\n| ---------------------------- | --- | ------------------------------------------------- | -------- | ------ |\n| `config-resolver`            | 628 | Always code-generated                             | 425, 425 | ✅     |\n| `util-config-provider`       | 42  | Only used by config-resolver                      | 0, 425   | ✅     |\n| `node-config-provider`       | 200 | Platform-specific, always present in Node clients | 425, 425 | ✅     |\n| `shared-ini-file-loader`     | 509 | Only consumer is node-config-provider             | 0, 425   | ✅     |\n| `property-provider`          | 309 | Provider chain utilities                          | 0, 425   | ✅     |\n| `util-defaults-mode-browser` | 152 | Platform-specific, always code-generated          | 425, 425 | ✅     |\n| `util-defaults-mode-node`    | 137 | Platform-specific, always code-generated          | 425, 425 | ✅     |\n\n### core/protocols\n\n| Package                     | LoC | Description/Rationale         | Clients  | Status |\n| --------------------------- | --- | ----------------------------- | -------- | ------ |\n| `protocol-http`             | 440 | HttpRequest/HttpResponse      | 425, 425 | ✅     |\n| `middleware-content-length` | 58  | Always code-generated         | 425, 425 | ✅     |\n| `util-uri-escape`           | 22  | Encoding primitive            | 0, 425   | ✅     |\n| `querystring-builder`       | 26  | Depends on uri-escape         | 0, 425   | ✅     |\n| `querystring-parser`        | 28  | No deps                       | 0, 425   | ✅     |\n| `url-parser`                | 25  | Depends on querystring-parser | 425, 425 | ✅     |\n\n### core/serde\n\n| Package                    | LoC  | Description/Rationale             | Clients  | Status    |\n| -------------------------- | ---- | --------------------------------- | -------- | --------- |\n| `util-base64`              | 164  | Encoding primitive                | 425, 425 | ✅        |\n| `util-body-length-browser` | 34   | Platform-specific, protocol-level | 425, 425 | ✅        |\n| `util-body-length-node`    | 39   | Platform-specific, protocol-level | 425, 425 | ✅        |\n| `util-utf8`                | 55   | Encoding primitive                | 425, 425 | ✅        |\n| `util-hex-encoding`        | 49   | Encoding primitive                | 0, 425   | ✅        |\n| `util-buffer-from`         | 29   | Supports utf8/base64              | 0, 425   | ✅        |\n| `is-array-buffer`          | 6    | Supports buffer-from              | 0, 425   | ✅        |\n| `middleware-serde`         | 228  | Always code-generated             | 425, 425 | ✅        |\n| `hash-node`                | 52   | Hashing                           | 425, 425 | ✅        |\n| `util-stream`              | 1009 | Stream utilities                  | 36, 425  | ✅        |\n| `util-stream-browser`      | 127  | Stream utilities                  | 0, 0     | ✅ unused |\n| `util-stream-node`         | 101  | Stream utilities                  | 0, 0     | ✅ unused |\n| `uuid`                     | 65   | Encoding/generation primitive     | 0, 425   | ✅        |\n\n### core/endpoints\n\n| Package               | LoC | Description/Rationale | Clients  | Status |\n| --------------------- | --- | --------------------- | -------- | ------ |\n| `util-endpoints`      | 995 | Endpoint rules engine | 425, 425 | ✅     |\n| `middleware-endpoint` | 755 | Always code-generated | 425, 425 | ✅     |\n\n### core/retry\n\n| Package                        | LoC | Description/Rationale          | Clients  | Status |\n| ------------------------------ | --- | ------------------------------ | -------- | ------ |\n| `util-retry`                   | 778 | Retry strategies, rate limiter | 425, 425 | ✅     |\n| `middleware-retry`             | 833 | Always code-generated          | 425, 425 | ✅     |\n| `service-error-classification` | 142 | Only consumer is retry         | 0, 425   | ✅     |\n\nThis is a separate module because the integration tests are very time-consuming, and we'll\nlikely want to run them separately.\n\n### core/event-streams\n\n| Package                             | LoC | Description/Rationale    | Clients | Status |\n| ----------------------------------- | --- | ------------------------ | ------- | ------ |\n| `eventstream-codec`                 | 763 | Binary codec             | 0, 37   | ✅     |\n| `eventstream-serde-universal`       | 246 | Platform-agnostic serde  | 0, 17   | ✅     |\n| `eventstream-serde-browser`         | 138 | Platform-specific        | 17, 17  | ✅     |\n| `eventstream-serde-node`            | 106 | Platform-specific        | 17, 17  | ✅     |\n| `eventstream-serde-config-resolver` | 38  | Config for event streams | 17, 17  | ✅     |\n\nClients currently depend on the platform specific `eventstream-serde-browser/node`, which\nin turn depends on `-universal`, and then `-codec`.\n\n### core/checksum\n\n| Package                      | LoC | Description/Rationale      | Clients | Status |\n| ---------------------------- | --- | -------------------------- | ------- | ------ |\n| `hash-blob-browser`          | 18  | S3, S3 Control             | 2, 2    | ✅     |\n| `hash-stream-node`           | 102 | S3, S3 Control             | 2, 2    | ✅     |\n| `md5-js`                     | 222 | S3, S3 Control, SQS        | 3, 3    | ✅     |\n| `chunked-blob-reader`        | 18  | Supports hash-blob-browser | 0, 3    | ✅     |\n| `chunked-blob-reader-native` | 47  | Supports hash-blob-browser | 0, 2    | ✅     |\n\n## Stay external\n\n| Package                                  | LoC  | Description/Rationale         | Clients  | Status                         |\n| ---------------------------------------- | ---- | ----------------------------- | -------- | ------------------------------ |\n| `types`                                  | 4666 | Root of dependency graph      | 425, 425 | ✅                             |\n| `core`                                   | 6761 | --                            | 425, 425 | ✅                             |\n| `signature-v4`                           | 1425 | Not all clients need signing  | 0, 425   | ✅                             |\n| `signature-v4a`                          | 9906 | Very large, optional          | 0, 0     | ✅                             |\n| `node-http-handler`                      | 1600 | Platform-specific, large      | 425, 425 | ✅                             |\n| `fetch-http-handler`                     | 329  | Platform-specific             | 425, 425 | ✅                             |\n| `middleware-compression`                 | 360  | Cloudwatch PutMetricData only | 1, 1     | ✅                             |\n| `middleware-apply-body-checksum`         | 104  | S3 Control only               | 1, 1     | ✅                             |\n| `credential-provider-imds`               | 682  | AWS-specific, optional        | 0, 425   | ✅                             |\n| `experimental-identity-and-auth`         | 876  | Experimental                  | 0, 0     | ✅ unused                      |\n| `abort-controller`                       | 70   | Standalone                    | 0, 0     | ✅ optional, deprecated add-on |\n| `typecheck`                              | 234  | Small utility                 | 0, 0     | ✅ optional add-on             |\n| `snapshot-testing`                       | 1468 | Dev/test tooling              | 31, 31   | ✅ devtool                     |\n| `service-client-documentation-generator` | 214  | Codegen tooling               | 0, 0     | ✅ devtool                     |\n"
  },
  {
    "path": "packages/core/planning/consolidation_checklist.md",
    "content": "# Consolidation checklist\n\nFor each group of packages being consolidated into a `@smithy/core` submodule:\n\n## Source migration\n\n- [ ] Copy source files (excluding barrel `index.ts`) into `core/src/submodules/<submodule>/<package>/`.\n- [ ] Use explicit named exports in the submodule's canonical `index.ts` — no `export *`.\n- [ ] Do not create intermediate barrel `index.ts` files in sub-folders; export directly from source files.\n- [ ] Fix internal imports within copied files (e.g. `@smithy/protocol-http` → relative path within the submodule).\n- [ ] Cross-submodule imports must use `@smithy/core/<submodule>`, not relative paths (lint enforces this).\n- [ ] If a dependency would create a cycle, inline the needed functions locally.\n- [ ] Save `CHANGELOG.md` as contextual artifacts alongside the new source folder.\n- [ ] Add consolidation notice to the top of each new changelog file.\n- [ ] For Node-only modules (e.g. `hash-node`), mark them as `false` in `browser` and `react-native` fields.\n- [ ] When merging platform-specific packages (e.g. `util-defaults-mode-browser` + `util-defaults-mode-node`), use `.browser.ts` and `.native.ts` variants in a single directory.\n\n## Old package cleanup\n\n- [ ] Delete README.md, CHANGELOG.md, all source files, and all test files in the old `packages/<package>` folder.\n- [ ] Delete all dependencies and browser/react-native replacement metadata in package.json.\n- [ ] Remove `typesVersions` metadata from package.json.\n- [ ] Preserve only the build, clean, and stage-release NPM scripts.\n- [ ] Take a dependency on `@smithy/core`.\n- [ ] Re-export from `@smithy/core` every symbol that was previously exported for backwards compatibility.\n- [ ] Delete leftover sub-directory barrel files (e.g. `src/endpointsConfig/index.ts`) — only `src/index.ts` should remain.\n\n## Dependency updates (TypeScript)\n\n- [ ] Remove the old package from `dependencies` in all `packages/*/package.json` and `private/*/package.json`.\n- [ ] Add `@smithy/core` as a dependency where not already present.\n- [ ] Do not add `@smithy/core` as a dependency to packages that core itself depends on (creates a cycle).\n- [ ] If a package in core's dependency chain has a type-only import from a consolidated package, inline the type to break the cycle.\n- [ ] Remove the old package from `core/package.json` dependencies.\n- [ ] Add any new transitive dependencies to `core/package.json` (e.g. `@smithy/util-buffer-from`).\n- [ ] Update all source imports (`from \"@smithy/old-package\"` → `from \"@smithy/core/<submodule>\"`).\n- [ ] Update `vi.mock()` paths in test files to match the new import paths. This includes mocks of the old package name (e.g. `vi.mock(\"@smithy/old-package\")` → `vi.mock(\"@smithy/core/<submodule>\")`) and mocks of relative paths that changed due to file relocation.\n- [ ] Don't forget `smithy-typescript-ssdk-libs/` packages.\n- [ ] Add the old package names to the banned imports list in `.eslintrc.js`, one group per submodule.\n\n## Browser/React-Native field updates\n\n- [ ] Mark all Node-only files as `false` in the `browser` field of `core/package.json`.\n- [ ] Mark all Node-only files as `false` in the `react-native` field (both `dist-es` and `dist-cjs` entries).\n- [ ] For `.browser.ts` variants, add replacement entries in the `browser` field.\n- [ ] For `.native.ts` variants, add replacement entries in the `react-native` field (both `dist-es` and `dist-cjs`).\n- [ ] Ensure exports from `browser: false` files are not re-exported from other non-false files. Move such exports to a browser-safe file (e.g. `constants.ts`).\n- [ ] Browser spec tests (`*.browser.spec.ts`) must import explicitly from the `.browser.ts` variant file, not the default — vitest does not resolve the `browser` field.\n\n## Dependency updates (Java codegen)\n\n- [ ] Move (don't delete) `TypeScriptDependency` enum values in the deprecated group at the end of the enum.\n- [ ] Update all `addImport` call sites to `addImportSubmodule` with `SMITHY_CORE` + `SmithyCoreSubmodules.<SUBMODULE>`.\n- [ ] Update all `addTypeImport` call sites to `addTypeImportSubmodule`.\n- [ ] Update all `addDependency(OLD)` to `addDependency(SMITHY_CORE)`.\n- [ ] Update `withConventions` calls to use `\"@smithy/core/<submodule>\"` as the package name string.\n- [ ] For `ExtensionConfigurationInterface` implementations, override `submodule()` to return the submodule path.\n- [ ] Add new submodule constants to `SmithyCoreSubmodules.java`.\n- [ ] Update downstream codegen (e.g. `smithy-aws-typescript-codegen`) call sites.\n- [ ] Ensure serde symbols (e.g. `expectNonNull`, `parseEpochTimestamp`) route to `SERDE`, not `CLIENT`, even if they were previously imported from `smithy-client`.\n\n## Verification\n\n- [ ] `make build` — Java codegen compiles and all tests pass.\n- [ ] `make generate-protocol-tests test-protocols` — regenerated private packages have correct deps and imports.\n- [ ] `yarn` — workspace resolution succeeds with no cyclic dependency errors from Turbo.\n- [ ] `yarn build` — all packages compile and build. Run this in the repo root, not just the changed packages.\n- [ ] `yarn test` — all unit tests pass.\n- [ ] `yarn test:integration` — includes bundler and browser tests.\n- [ ] `make bgt` — write the actual snapshot files.\n- [ ] `yarn lint` in `packages/core` — no cross-submodule relative import violations.\n- [ ] `api-snapshot` script snapshots submodule exports via `package.json` `exports` entries.\n"
  },
  {
    "path": "packages/core/protocols.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/protocols\" {\n  export * from \"@smithy/core/dist-types/submodules/protocols/index.d\";\n}\n"
  },
  {
    "path": "packages/core/protocols.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/protocols/index.js\");\n"
  },
  {
    "path": "packages/core/retry.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for bundlers that do not support package.json exports field.\n */\nexport * from \"./dist-types/submodules/retry/index.d\";\n"
  },
  {
    "path": "packages/core/retry.js",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for bundlers that do not support package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/retry/index.js\");\n"
  },
  {
    "path": "packages/core/schema.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/schema\" {\n  export * from \"@smithy/core/dist-types/submodules/schema/index.d\";\n}\n"
  },
  {
    "path": "packages/core/schema.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/schema/index.js\");\n"
  },
  {
    "path": "packages/core/scripts/cbor-perf.mjs",
    "content": "import { fromBase64, toBase64 } from \"@smithy/util-base64\";\n\nimport * as SmithyCbor from \"../dist-cjs/submodules/cbor/index.js\";\n\n/**\n * Control the test data size with this scalar.\n */\nconst DATA_SCALAR = 5;\n\nconst tests = [\n  {\n    name: \"string\",\n    data: (() => {\n      const buffer = [];\n      for (let i = 0; i < 3400 * DATA_SCALAR; ++i) {\n        buffer[i] = Math.random() + \"\";\n      }\n      return buffer.join(\"代码\");\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<char>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 9000 * DATA_SCALAR; ++i) {\n        list[i] = \"abcdefghijklmnopqrstuvwxyz\"[(Math.random() * 26) | 0];\n      }\n      return list;\n    })(),\n    run: false,\n  },\n  {\n    name: \"list<string(0,180)>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 900 * DATA_SCALAR; ++i) {\n        list[i] = \"string\".repeat((Math.random() * 35) | 0);\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<float(0,1)>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 6000 * DATA_SCALAR; ++i) {\n        list[i] = Math.random() * 2 - 1;\n      }\n      return list;\n    })(),\n    run: false,\n  },\n  {\n    name: \"list<float>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 6000 * DATA_SCALAR; ++i) {\n        list[i] = Math.random() * 3.4e38;\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<double>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 6000 * DATA_SCALAR; ++i) {\n        list[i] = Math.random() * Number.MAX_VALUE;\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"byte[]\",\n    data: (() => {\n      const list = new Uint8Array(100000 * DATA_SCALAR);\n      for (let i = 0; i < list.length; ++i) {\n        list[i] = ((Math.random() * 20000) | 0) % 255;\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<int>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 17000 * DATA_SCALAR; ++i) {\n        list[i] = ((Math.random() * 20000) | 0) - 10000;\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<long int>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 10000 * DATA_SCALAR; ++i) {\n        list[i] = Math.floor(Math.random() * 0x7fffffff * 2 - 0x7fffffff);\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<long long int>\",\n    data: (() => {\n      const list = [];\n      for (let i = 0; i < 10000 * DATA_SCALAR; ++i) {\n        list[i] = Math.floor(-18446744073709551615 + ((Math.random() * 2 * 18446744073709551615) | 0));\n      }\n      return list;\n    })(),\n    run: true,\n  },\n  {\n    name: \"map<int, char>\",\n    data: (() => {\n      const map = {};\n      for (let i = 0; i < 2000 * DATA_SCALAR; ++i) {\n        map[i] = \"abcdefg\"[(Math.random() * 5.999) | 0];\n      }\n      return map;\n    })(),\n    run: false,\n  },\n  {\n    name: \"map<string(0,30), string(0,450)>\",\n    data: (() => {\n      const map = {};\n      for (let i = 0; i < 324 * DATA_SCALAR; ++i) {\n        map[\"key\".repeat((Math.random() * 10) | 0) + i] = \"key\".repeat((Math.random() * 155) | 0) + i + Math.random();\n      }\n      return map;\n    })(),\n    run: true,\n  },\n  {\n    name: \"map<string(0,30), long int>\",\n    data: (() => {\n      const map = {};\n      for (let i = 0; i < 324 * DATA_SCALAR; ++i) {\n        map[\"key\".repeat((Math.random() * 10) | 0) + i] = Math.floor(Math.random() * 0x7fffffff * 2 - 0x7fffffff);\n      }\n      return map;\n    })(),\n    run: true,\n  },\n  {\n    name: \"list<struct> PutMetricData-like\",\n    data: (() => {\n      const collection = [];\n      for (let i = 0; i < 600 * DATA_SCALAR; ++i) {\n        collection[i] = {\n          MetricData: [\n            {\n              MetricName: \"PAGES_VISITED\",\n              Dimensions: [\n                {\n                  Name: \"UNIQUE_PAGES\",\n                  Value: \"URLS\",\n                },\n              ],\n              Unit: \"None\",\n              Value: 1.0,\n            },\n          ],\n          Namespace: \"SITE/TRAFFIC\",\n        };\n      }\n      return collection;\n    })(),\n    run: true,\n  },\n];\n\nconst { cbor } = SmithyCbor;\ncbor.resizeEncodingBuffer(10_000_000);\n\nconst SCALE = (3 * 100) / DATA_SCALAR;\nclass Row {\n  constructor(data) {\n    Object.assign(this, data);\n  }\n}\nconst rows = {};\n\nfor (const { name, data, run, nonScaling } of tests) {\n  if (!run) {\n    continue;\n  }\n  const scale = nonScaling ? 1 : SCALE;\n\n  const A = performance.now();\n  let cborSerialized;\n  {\n    for (let i = 0; i < scale; ++i) {\n      cborSerialized = cbor.serialize(data);\n    }\n  }\n  const B = performance.now();\n  let cborDeserialized;\n  {\n    for (let i = 0; i < scale; ++i) {\n      cborDeserialized = cbor.deserialize(cborSerialized);\n    }\n  }\n  const C = performance.now();\n  const D = performance.now();\n  const E = performance.now();\n  const F = performance.now();\n  const G = performance.now();\n\n  let jsonSerialized;\n  {\n    for (let i = 0; i < scale; ++i) {\n      if (name === \"byte[]\") {\n        jsonSerialized = JSON.stringify(toBase64(data));\n      } else {\n        jsonSerialized = JSON.stringify(data);\n      }\n    }\n  }\n  const H = performance.now();\n  let jsonDeserialized;\n  {\n    for (let i = 0; i < scale; ++i) {\n      if (name === \"byte[]\") {\n        jsonDeserialized = fromBase64(JSON.parse(jsonSerialized));\n      } else {\n        jsonDeserialized = JSON.parse(jsonSerialized);\n      }\n    }\n  }\n  const I = performance.now();\n  const bytes = cborSerialized.byteLength;\n  const megabytes = (cborSerialized.byteLength * scale) / 1_000_000;\n  const num_fmt = (ms) => ((megabytes / ms) * 1000).toFixed(0) + \"mb/s\";\n  const jsonBytes = Buffer.from(jsonSerialized).byteLength;\n  process.stdout.write(\".\");\n\n  rows[name] = new Row({\n    workload: `${(bytes < 1e6 ? bytes / 1e3 : bytes / 1e6).toFixed(0)}${bytes < 1e6 ? \"kb\" : \"mb\"} x ${scale}`,\n    cbor: ((bytes * scale) / 1e6).toFixed(0) + \"mb\",\n    json: ((jsonBytes * scale) / 1e6).toFixed(0) + \"mb\",\n    cbor_serde: [B - A, C - B].map(num_fmt).join(\", \"),\n    json_serde: [H - G, I - H].map(num_fmt).join(\", \"),\n    \"cbor relative performance\": [\n      (((H - G) / (B - A)) * 100).toFixed(0) + \"% ->\",\n      \"<- \" + (((I - H) / (C - B)) * 100).toFixed(0) + \"%\",\n      ((bytes / jsonBytes) * 100).toFixed(0) + \"% payload\",\n    ].join(\", \"),\n  });\n}\n\nconsole.log(\"\");\nconsole.table(rows);\n"
  },
  {
    "path": "packages/core/scripts/lint.js",
    "content": "const fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst root = path.join(__dirname, \"..\");\n\nconst pkgJson = require(path.join(root, \"package.json\"));\nconst tsconfigs = {\n  cjs: require(path.join(root, \"tsconfig.cjs.json\")),\n  es: require(path.join(root, \"tsconfig.es.json\")),\n  types: require(path.join(root, \"tsconfig.types.json\")),\n};\nconst submodules = fs.readdirSync(path.join(root, \"src\", \"submodules\"));\n\nconst errors = [];\n\nfor (const submodule of submodules) {\n  const submodulePath = path.join(root, \"src\", \"submodules\", submodule);\n  if (fs.existsSync(submodulePath) && fs.lstatSync(submodulePath).isDirectory()) {\n    // package.json metadata.\n    if (!pkgJson.exports[`./${submodule}`]) {\n      errors.push(`${submodule} submodule is missing exports statement in package.json`);\n      pkgJson.exports[`./${submodule}`] = {\n        types: `./dist-types/submodules/${submodule}/index.d.ts`,\n        module: `./dist-es/submodules/${submodule}/index.js`,\n        node: `./dist-cjs/submodules/${submodule}/index.js`,\n        import: `./dist-es/submodules/${submodule}/index.js`,\n        require: `./dist-cjs/submodules/${submodule}/index.js`,\n      };\n      fs.writeFileSync(path.join(root, \"package.json\"), JSON.stringify(pkgJson, null, 2) + \"\\n\");\n    }\n    if (!pkgJson.files.includes(`./${submodule}.js`) || !pkgJson.files.includes(`./${submodule}.d.ts`)) {\n      pkgJson.files.push(`./${submodule}.js`);\n      pkgJson.files.push(`./${submodule}.d.ts`);\n      errors.push(`package.json files array missing ${submodule}.js compatibility redirect file.`);\n      pkgJson.files = [...new Set(pkgJson.files)].sort();\n      fs.writeFileSync(path.join(root, \"package.json\"), JSON.stringify(pkgJson, null, 2) + \"\\n\");\n    }\n    // tsconfig metadata.\n    for (const [kind, tsconfig] of Object.entries(tsconfigs)) {\n      if (!tsconfig.compilerOptions.paths?.[`@smithy/core/${submodule}`]) {\n        errors.push(`${submodule} submodule is missing paths entry in tsconfig.${kind}.json`);\n\n        tsconfig.compilerOptions.paths[`@smithy/core/${submodule}`] = [`./src/submodules/${submodule}/index.ts`];\n        fs.writeFileSync(path.join(root, `tsconfig.${kind}.json`), JSON.stringify(tsconfig, null, 2) + \"\\n\");\n      }\n    }\n    // compatibility redirect file.\n    const compatibilityRedirectFile = path.join(root, `${submodule}.js`);\n    if (!fs.existsSync(compatibilityRedirectFile)) {\n      errors.push(`${submodule} is missing compatibility redirect file in the package root folder.`);\n      fs.writeFileSync(\n        compatibilityRedirectFile,\n        `\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/${submodule}/index.js\");\n`\n      );\n    }\n    // compatibility types file.\n    const compatibilityTypesFile = path.join(root, `${submodule}.d.ts`);\n    if (!fs.existsSync(compatibilityTypesFile)) {\n      errors.push(`${submodule} is missing compatibility types file in the package root folder.`);\n      fs.writeFileSync(\n        compatibilityTypesFile,\n        `\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/${submodule}\" {\n  export * from \"@smithy/core/dist-types/submodules/${submodule}/index.d\";\n}\n`\n      );\n    }\n  }\n}\n\n/**\n * Check that submodules with .browser.ts or .native.ts files have corresponding index variant files.\n */\nfor (const submodule of submodules) {\n  const submodulePath = path.join(root, \"src\", \"submodules\", submodule);\n  if (!fs.lstatSync(submodulePath).isDirectory()) continue;\n\n  let hasBrowserVariant = false;\n  let hasNativeVariant = false;\n\n  const scanDir = (dir) => {\n    for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n      if (entry.isDirectory()) {\n        scanDir(path.join(dir, entry.name));\n      } else if (!entry.name.includes(\".spec.\") && !entry.name.includes(\".integ.\")) {\n        if (entry.name.endsWith(\".browser.ts\")) hasBrowserVariant = true;\n        if (entry.name.endsWith(\".native.ts\")) hasNativeVariant = true;\n      }\n    }\n  };\n  scanDir(submodulePath);\n\n  if (hasBrowserVariant && !fs.existsSync(path.join(submodulePath, \"index.browser.ts\"))) {\n    errors.push(`${submodule} has .browser.ts variant files but is missing index.browser.ts`);\n  }\n  if (hasNativeVariant && !fs.existsSync(path.join(submodulePath, \"index.native.ts\"))) {\n    errors.push(`${submodule} has .native.ts variant files but is missing index.native.ts`);\n  }\n}\n\n/**\n * Check for cross-submodule relative imports.\n */\n\nconst walk = require(\"../../../scripts/utils/walk\");\n\n(async () => {\n  for await (const item of walk(path.join(root, \"src\", \"submodules\"))) {\n    // depth within the submodule where 1 is at the root of the submodule.\n    const depth = item.split(\"core/src/submodules/\")[1].split(\"/\").length - 1;\n    const sourceCode = fs.readFileSync(item, \"utf-8\");\n\n    const relativeImports = [];\n    relativeImports.push(\n      ...new Set(\n        [...(sourceCode.toString().match(/(from |import\\()\"(.*?)\";/g) || [])]\n          .map((_) => _.replace(/from \"/g, \"\").replace(/\";$/, \"\"))\n          .filter((_) => _.startsWith(\".\"))\n      )\n    );\n\n    for (const i of relativeImports) {\n      const relativeImportDepth = i.split(\"..\").length - 1;\n      if (relativeImportDepth >= depth) {\n        errors.push(\n          `relative import ${i} in ${item\n            .split(\"packages/\")\n            .pop()} crosses submodule boundaries. Use @scope/package/submodule import instead.`\n        );\n      }\n    }\n\n    const subModuleImports = [\n      ...new Set(\n        (sourceCode.toString().match(/(from |import\\()\"\\@smithy\\/core\\/(.*?)\";/g) || []).map(\n          (_) => _.match(/@smithy\\/core\\/(.*?)\"/)[1]\n        )\n      ),\n    ];\n    const ownModule = item.match(/src\\/submodules\\/(.*?)\\//)?.[1];\n\n    if (subModuleImports.includes(ownModule)) {\n      errors.push(`self-referencing submodule import found in ${item}`);\n    }\n  }\n})().then(() => {\n  if (errors.length) {\n    throw new Error(errors.join(\"\\n\"));\n  }\n});\n"
  },
  {
    "path": "packages/core/serde.d.ts",
    "content": "/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\ndeclare module \"@smithy/core/serde\" {\n  export * from \"@smithy/core/dist-types/submodules/serde/index.d\";\n}\n"
  },
  {
    "path": "packages/core/serde.js",
    "content": "\n/**\n * Do not edit:\n * This is a compatibility redirect for contexts that do not understand package.json exports field.\n */\nmodule.exports = require(\"./dist-cjs/submodules/serde/index.js\");\n"
  },
  {
    "path": "packages/core/src/core.integ.spec.ts",
    "content": "import { SmithyRpcV2CborProtocol, cbor } from \"@smithy/core/cbor\";\nimport type { HttpProtocol } from \"@smithy/core/protocols\";\nimport { HttpResponse } from \"@smithy/protocol-http\";\nimport { RpcV2ProtocolClient } from \"@smithy/smithy-rpcv2-cbor-schema\";\nimport { requireRequestsFrom } from \"@smithy/util-test/src\";\nimport { describe, expect, test as it } from \"vitest\";\nimport { GetNumbersCommand, XYZService, type GetNumbersCommandOutput } from \"xyz-schema\";\n\nimport { NumericValue } from \"./submodules/serde\";\n\ndescribe(\"@smithy/core\", () => {\n  it(\"should normalize the config.protocol field\", () => {\n    const withInstance = new RpcV2ProtocolClient({\n      endpoint: \"https://localhost\",\n      protocol: new SmithyRpcV2CborProtocol({\n        defaultNamespace: \"smithy.protocoltests.rpcv2Cbor\",\n      }),\n    });\n\n    expect(withInstance.config.protocol).toBeInstanceOf(SmithyRpcV2CborProtocol);\n    expect((withInstance.config.protocol as HttpProtocol).options.defaultNamespace).toEqual(\n      \"smithy.protocoltests.rpcv2Cbor\"\n    );\n\n    const withCtor = new RpcV2ProtocolClient({\n      endpoint: \"https://localhost\",\n      protocol: SmithyRpcV2CborProtocol,\n    });\n\n    expect(withCtor.config.protocol).toBeInstanceOf(SmithyRpcV2CborProtocol);\n    expect((withCtor.config.protocol as HttpProtocol).options.defaultNamespace).toEqual(\n      \"smithy.protocoltests.rpcv2Cbor\"\n    );\n\n    const withSettings = new RpcV2ProtocolClient({\n      endpoint: \"https://localhost\",\n      protocolSettings: {\n        defaultNamespace: \"ns\",\n      },\n    });\n\n    expect(withCtor.config.protocol).toBeInstanceOf(SmithyRpcV2CborProtocol);\n    expect((withSettings.config.protocol as HttpProtocol).options.defaultNamespace).toEqual(\"ns\");\n  });\n});\n\ndescribe(\"endpoint headers\", () => {\n  it(\"should apply endpoint-resolved headers to the outgoing request\", async () => {\n    const xyz = new XYZService({\n      endpoint: {\n        url: new URL(\"https://localhost\"),\n        headers: {\n          \"x-custom-header\": [\"value1\", \"value2\"],\n        },\n      },\n      apiKey: async () => ({ apiKey: \"my-api-key\" }),\n    });\n\n    requireRequestsFrom(xyz).toMatch({\n      hostname: \"localhost\",\n      headers: {\n        \"x-custom-header\": \"value1, value2\",\n      },\n    });\n\n    await xyz.send(new GetNumbersCommand({}));\n\n    expect.assertions(2);\n  });\n});\n\ndescribe(\"aggregated clients\", () => {\n  it(\"should contain paginator and waiter methods\", async () => {\n    const xyz = new XYZService({ endpoint: `https://localhost`, apiKey: async () => ({ apiKey: \"test-key\" }) });\n\n    expect(xyz.paginateGetNumbers).toBeInstanceOf(Function);\n    expect(xyz.waitUntilNumbersAligned).toBeInstanceOf(Function);\n\n    const testHandler = requireRequestsFrom(xyz).toMatch({\n      hostname: /^localhost$/,\n    });\n    for (const i of [0, 1, 2, 3, 4, 5, 6]) {\n      testHandler.respondWith(\n        new HttpResponse({\n          headers: {\n            \"smithy-protocol\": \"rpc-v2-cbor\",\n          },\n          statusCode: 200,\n          body: cbor.serialize({\n            bigInteger: BigInt(\"123\"),\n            bigDecimal: new NumericValue(\"123.456\", \"bigDecimal\"),\n            numbers: [1, 2, 3],\n            nextToken: \"nextToken\" + i,\n          } as GetNumbersCommandOutput),\n        })\n      );\n    }\n    testHandler.respondWith(\n      new HttpResponse({\n        headers: {\n          \"smithy-protocol\": \"rpc-v2-cbor\",\n        },\n        statusCode: 200,\n        body: cbor.serialize({} as GetNumbersCommandOutput),\n      }),\n      new HttpResponse({\n        headers: {\n          \"smithy-protocol\": \"rpc-v2-cbor\",\n        },\n        statusCode: 400,\n        body: cbor.serialize({\n          __type: \"firstError\",\n        }),\n      }),\n      new HttpResponse({\n        headers: {\n          \"smithy-protocol\": \"rpc-v2-cbor\",\n        },\n        statusCode: 400,\n        body: cbor.serialize({\n          __type: \"secondError\",\n        }),\n      }),\n      new HttpResponse({\n        headers: {\n          \"smithy-protocol\": \"rpc-v2-cbor\",\n        },\n        statusCode: 200,\n        body: cbor.serialize({\n          __type: \"finalAwaited\",\n        }),\n      })\n    );\n\n    // all args optional\n    for await (const page of xyz.paginateGetNumbers()) {\n      if (page.nextToken === \"nextToken3\") {\n        break;\n      }\n    }\n\n    for await (const page of xyz.paginateGetNumbers(\n      {\n        startToken: \"token\",\n        maxResults: 10,\n        bigDecimal: new NumericValue(\"0.0\", \"bigDecimal\"),\n        bigInteger: BigInt(100),\n      },\n      {\n        stopOnSameToken: true,\n        withCommand(command: any) {\n          return command;\n        },\n      }\n    )) {\n      expect(page.$metadata).toBeDefined();\n      expect(page.bigInteger).toBeDefined();\n      expect(page.bigDecimal).toBeDefined();\n      expect(page.numbers?.[0]).toBeDefined();\n      expect(page.nextToken).toBeDefined();\n      if (page.nextToken === \"nextToken6\") {\n        break;\n      }\n    }\n\n    await xyz.waitUntilNumbersAligned(\n      {\n        bigInteger: BigInt(1),\n      },\n      120\n    );\n\n    const result = await xyz.waitUntilNumbersAligned({}, { maxWaitTime: 8, minDelay: 0.001, maxDelay: 0.01 });\n    expect(result.reason).toMatchObject({\n      __type: \"finalAwaited\",\n    });\n\n    expect.assertions(29);\n  });\n}, 30_000);\n"
  },
  {
    "path": "packages/core/src/getSmithyContext.ts",
    "content": "import { SMITHY_CONTEXT_KEY, type HandlerExecutionContext } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const getSmithyContext = (context: HandlerExecutionContext): Record<string, unknown> =>\n  context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});\n"
  },
  {
    "path": "packages/core/src/index.ts",
    "content": "export * from \"./getSmithyContext\";\nexport * from \"./middleware-http-auth-scheme\";\nexport * from \"./middleware-http-signing\";\nexport * from \"./normalizeProvider\";\nexport { createPaginator } from \"./pagination/createPaginator\";\nexport * from \"./request-builder/requestBuilder\";\nexport * from \"./setFeature\";\nexport * from \"./util-identity-and-auth\";\n"
  },
  {
    "path": "packages/core/src/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.ts",
    "content": "import type {\n  HandlerExecutionContext,\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  IdentityProviderConfig,\n  Pluggable,\n  RelativeMiddlewareOptions,\n  SerializeHandlerOptions,\n} from \"@smithy/types\";\n\nimport { httpAuthSchemeMiddleware, type PreviouslyResolved } from \"./httpAuthSchemeMiddleware\";\n\n/**\n * @internal\n */\nexport const httpAuthSchemeEndpointRuleSetMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"serialize\",\n  tags: [\"HTTP_AUTH_SCHEME\"],\n  name: \"httpAuthSchemeMiddleware\",\n  override: true,\n  relation: \"before\",\n  toMiddleware: \"endpointV2Middleware\",\n};\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeEndpointRuleSetPluginOptions<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;\n  identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;\n}\n\n/**\n * @internal\n */\nexport const getHttpAuthSchemeEndpointRuleSetPlugin = <\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n>(\n  config: TConfig & PreviouslyResolved<TParameters>,\n  {\n    httpAuthSchemeParametersProvider,\n    identityProviderConfigProvider,\n  }: HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig, TContext, TParameters, TInput>\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(\n      httpAuthSchemeMiddleware(config, {\n        httpAuthSchemeParametersProvider,\n        identityProviderConfigProvider,\n      }),\n      httpAuthSchemeEndpointRuleSetMiddlewareOptions\n    );\n  },\n});\n"
  },
  {
    "path": "packages/core/src/middleware-http-auth-scheme/getHttpAuthSchemePlugin.ts",
    "content": "import type {\n  HandlerExecutionContext,\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  IdentityProviderConfig,\n  Pluggable,\n  RelativeMiddlewareOptions,\n  SerializeHandlerOptions,\n} from \"@smithy/types\";\n\nimport { httpAuthSchemeMiddleware, type PreviouslyResolved } from \"./httpAuthSchemeMiddleware\";\n\n/**\n * @internal\n */\nexport const httpAuthSchemeMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"serialize\",\n  tags: [\"HTTP_AUTH_SCHEME\"],\n  name: \"httpAuthSchemeMiddleware\",\n  override: true,\n  relation: \"before\",\n  toMiddleware: \"serializerMiddleware\",\n};\n\n/**\n * @internal\n */\ninterface HttpAuthSchemePluginOptions<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;\n  identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;\n}\n\n/**\n * @internal\n */\nexport const getHttpAuthSchemePlugin = <\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n>(\n  config: TConfig & PreviouslyResolved<TParameters>,\n  {\n    httpAuthSchemeParametersProvider,\n    identityProviderConfigProvider,\n  }: HttpAuthSchemePluginOptions<TConfig, TContext, TParameters, TInput>\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(\n      httpAuthSchemeMiddleware(config, {\n        httpAuthSchemeParametersProvider,\n        identityProviderConfigProvider,\n      }),\n      httpAuthSchemeMiddlewareOptions\n    );\n  },\n});\n"
  },
  {
    "path": "packages/core/src/middleware-http-auth-scheme/httpAuthSchemeMiddleware.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport type {\n  HandlerExecutionContext,\n  HttpAuthScheme,\n  HttpAuthSchemeId,\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  HttpAuthSchemeProvider,\n  IdentityProviderConfig,\n  Provider,\n  SMITHY_CONTEXT_KEY,\n  SelectedHttpAuthScheme,\n  SerializeHandler,\n  SerializeHandlerArguments,\n  SerializeHandlerOutput,\n  SerializeMiddleware,\n} from \"@smithy/types\";\n\nimport { resolveAuthOptions } from \"./resolveAuthOptions\";\n\n/**\n * @internal\n */\nexport interface PreviouslyResolved<TParameters extends HttpAuthSchemeParameters> {\n  authSchemePreference?: Provider<string[]>;\n  httpAuthSchemes: HttpAuthScheme[];\n  httpAuthSchemeProvider: HttpAuthSchemeProvider<TParameters>;\n}\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeMiddlewareOptions<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;\n  identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;\n}\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeMiddlewareSmithyContext extends Record<string, unknown> {\n  selectedHttpAuthScheme?: SelectedHttpAuthScheme;\n}\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeMiddlewareHandlerExecutionContext extends HandlerExecutionContext {\n  [SMITHY_CONTEXT_KEY]?: HttpAuthSchemeMiddlewareSmithyContext;\n}\n\n/**\n * Later HttpAuthSchemes with the same HttpAuthSchemeId will overwrite previous ones.\n *\n * @internal\n */\nfunction convertHttpAuthSchemesToMap(httpAuthSchemes: HttpAuthScheme[]): Map<HttpAuthSchemeId, HttpAuthScheme> {\n  const map = new Map();\n  for (const scheme of httpAuthSchemes) {\n    map.set(scheme.schemeId, scheme);\n  }\n  return map;\n}\n\n/**\n * @internal\n */\nexport const httpAuthSchemeMiddleware =\n  <\n    TInput extends object,\n    Output extends object,\n    TConfig extends object,\n    TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext,\n    TParameters extends HttpAuthSchemeParameters,\n  >(\n    config: TConfig & PreviouslyResolved<TParameters>,\n    mwOptions: HttpAuthSchemeMiddlewareOptions<TConfig, TContext, TParameters, TInput>\n  ): SerializeMiddleware<TInput, Output> =>\n  (\n    next: SerializeHandler<TInput, Output>,\n    context: HttpAuthSchemeMiddlewareHandlerExecutionContext\n  ): SerializeHandler<TInput, Output> =>\n  async (args: SerializeHandlerArguments<TInput>): Promise<SerializeHandlerOutput<Output>> => {\n    const options = config.httpAuthSchemeProvider(\n      await mwOptions.httpAuthSchemeParametersProvider(config, context as TContext, args.input)\n    );\n\n    const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];\n    const resolvedOptions = resolveAuthOptions(options, authSchemePreference);\n\n    const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);\n    const smithyContext: HttpAuthSchemeMiddlewareSmithyContext = getSmithyContext(context);\n    const failureReasons = [];\n    for (const option of resolvedOptions) {\n      const scheme = authSchemes.get(option.schemeId);\n      if (!scheme) {\n        failureReasons.push(`HttpAuthScheme \\`${option.schemeId}\\` was not enabled for this service.`);\n        continue;\n      }\n      const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));\n      if (!identityProvider) {\n        failureReasons.push(`HttpAuthScheme \\`${option.schemeId}\\` did not have an IdentityProvider configured.`);\n        continue;\n      }\n      const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};\n      option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);\n      option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);\n      smithyContext.selectedHttpAuthScheme = {\n        httpAuthOption: option,\n        identity: await identityProvider(option.identityProperties),\n        signer: scheme.signer,\n      };\n      break;\n    }\n    if (!smithyContext.selectedHttpAuthScheme) {\n      throw new Error(failureReasons.join(\"\\n\"));\n    }\n    return next(args);\n  };\n"
  },
  {
    "path": "packages/core/src/middleware-http-auth-scheme/index.ts",
    "content": "export * from \"./httpAuthSchemeMiddleware\";\nexport * from \"./getHttpAuthSchemeEndpointRuleSetPlugin\";\nexport * from \"./getHttpAuthSchemePlugin\";\n"
  },
  {
    "path": "packages/core/src/middleware-http-auth-scheme/resolveAuthOptions.spec.ts",
    "content": "import type { HttpAuthOption } from \"@smithy/types\";\nimport { describe, expect, it } from \"vitest\";\n\nimport { resolveAuthOptions } from \"./resolveAuthOptions\";\n\ndescribe(\"resolveAuthSchemes\", () => {\n  const sigv4 = \"sigv4\";\n  const sigv4a = \"sigv4a\";\n\n  const mockSigV4AuthScheme = { schemeId: `aws.auth#${sigv4}` } as HttpAuthOption;\n  const mockSigV4aAuthScheme = { schemeId: `aws.auth#${sigv4a}` } as HttpAuthOption;\n\n  it(\"should return candidate auth schemes is preference list is not available\", () => {\n    const candidateAuthSchemes = [mockSigV4AuthScheme, mockSigV4aAuthScheme];\n    expect(resolveAuthOptions(candidateAuthSchemes, [])).toEqual(candidateAuthSchemes);\n\n    // @ts-expect-error case where callee incorrectly passes undefined\n    expect(resolveAuthOptions(candidateAuthSchemes)).toEqual(candidateAuthSchemes);\n  });\n\n  it(\"should return auth scheme from preference if it's available\", () => {\n    expect(resolveAuthOptions([mockSigV4AuthScheme, mockSigV4aAuthScheme], [sigv4a])).toEqual([\n      mockSigV4aAuthScheme,\n      mockSigV4AuthScheme,\n    ]);\n\n    expect(resolveAuthOptions([mockSigV4AuthScheme, mockSigV4aAuthScheme], [sigv4a, sigv4])).toEqual([\n      mockSigV4aAuthScheme,\n      mockSigV4AuthScheme,\n    ]);\n\n    expect(resolveAuthOptions([mockSigV4AuthScheme, mockSigV4aAuthScheme], [sigv4, sigv4a])).toEqual([\n      mockSigV4AuthScheme,\n      mockSigV4aAuthScheme,\n    ]);\n  });\n\n  it(\"should ignore auth scheme from preference if it's not available\", () => {\n    expect(resolveAuthOptions([mockSigV4AuthScheme], [sigv4a])).toEqual([mockSigV4AuthScheme]);\n    expect(resolveAuthOptions([mockSigV4AuthScheme], [\"sigv3\"])).toEqual([mockSigV4AuthScheme]);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/middleware-http-auth-scheme/resolveAuthOptions.ts",
    "content": "import type { HttpAuthOption } from \"@smithy/types\";\n\n/**\n * Resolves list of auth options based on the supported ones, vs the preference list.\n *\n * @param candidateAuthOptions list of supported auth options selected by the standard\n *   resolution process (model-based, endpoints 2.0, etc.)\n * @param authSchemePreference list of auth schemes preferred by user.\n * @returns\n */\nexport const resolveAuthOptions = (\n  candidateAuthOptions: HttpAuthOption[],\n  authSchemePreference: string[]\n): HttpAuthOption[] => {\n  if (!authSchemePreference || authSchemePreference.length === 0) {\n    return candidateAuthOptions;\n  }\n\n  // reprioritize candidates based on user's preference\n  const preferredAuthOptions = [];\n\n  for (const preferredSchemeName of authSchemePreference) {\n    for (const candidateAuthOption of candidateAuthOptions) {\n      const candidateAuthSchemeName = candidateAuthOption.schemeId.split(\"#\")[1];\n      if (candidateAuthSchemeName === preferredSchemeName) {\n        preferredAuthOptions.push(candidateAuthOption);\n      }\n    }\n  }\n\n  // add any remaining candidates that weren't in the preference list\n  for (const candidateAuthOption of candidateAuthOptions) {\n    if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {\n      preferredAuthOptions.push(candidateAuthOption);\n    }\n  }\n\n  return preferredAuthOptions;\n};\n"
  },
  {
    "path": "packages/core/src/middleware-http-signing/getHttpSigningMiddleware.ts",
    "content": "import type { FinalizeRequestHandlerOptions, Pluggable, RelativeMiddlewareOptions } from \"@smithy/types\";\n\nimport { httpSigningMiddleware } from \"./httpSigningMiddleware\";\n\n/**\n * @internal\n */\nexport const httpSigningMiddlewareOptions: FinalizeRequestHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"finalizeRequest\",\n  tags: [\"HTTP_SIGNING\"],\n  name: \"httpSigningMiddleware\",\n  aliases: [\"apiKeyMiddleware\", \"tokenMiddleware\", \"awsAuthMiddleware\"],\n  override: true,\n  relation: \"after\",\n  toMiddleware: \"retryMiddleware\",\n};\n\n/**\n * @internal\n */\nexport const getHttpSigningPlugin = <Input extends object, Output extends object>(\n  config: object\n): Pluggable<Input, Output> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);\n  },\n});\n"
  },
  {
    "path": "packages/core/src/middleware-http-signing/httpSigningMiddleware.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { getSmithyContext } from \"@smithy/core/client\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport type {\n  ErrorHandler,\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  FinalizeHandlerOutput,\n  FinalizeRequestMiddleware,\n  HandlerExecutionContext,\n  SMITHY_CONTEXT_KEY,\n  SelectedHttpAuthScheme,\n  SuccessHandler,\n} from \"@smithy/types\";\n\n/**\n * @internal\n */\ninterface HttpSigningMiddlewareSmithyContext extends Record<string, unknown> {\n  selectedHttpAuthScheme?: SelectedHttpAuthScheme;\n}\n\n/**\n * @internal\n */\ninterface HttpSigningMiddlewareHandlerExecutionContext extends HandlerExecutionContext {\n  [SMITHY_CONTEXT_KEY]?: HttpSigningMiddlewareSmithyContext;\n}\n\nconst defaultErrorHandler: ErrorHandler = (signingProperties) => (error) => {\n  throw error;\n};\n\nconst defaultSuccessHandler: SuccessHandler = (\n  httpResponse: unknown,\n  signingProperties: Record<string, unknown>\n): void => {};\n\n/**\n * @internal\n */\nexport const httpSigningMiddleware =\n  <Input extends object, Output extends object>(config: object): FinalizeRequestMiddleware<Input, Output> =>\n  (\n    next: FinalizeHandler<Input, Output>,\n    context: HttpSigningMiddlewareHandlerExecutionContext\n  ): FinalizeHandler<Input, Output> =>\n  async (args: FinalizeHandlerArguments<Input>): Promise<FinalizeHandlerOutput<Output>> => {\n    if (!HttpRequest.isInstance(args.request)) {\n      return next(args);\n    }\n\n    const smithyContext: HttpSigningMiddlewareSmithyContext = getSmithyContext(context);\n    const scheme = smithyContext.selectedHttpAuthScheme;\n    if (!scheme) {\n      throw new Error(`No HttpAuthScheme was selected: unable to sign request`);\n    }\n    const {\n      httpAuthOption: { signingProperties = {} },\n      identity,\n      signer,\n    } = scheme;\n    const output = await next({\n      ...args,\n      request: await signer.sign(args.request, identity, signingProperties),\n    }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));\n    (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);\n    return output;\n  };\n"
  },
  {
    "path": "packages/core/src/middleware-http-signing/index.ts",
    "content": "export * from \"./httpSigningMiddleware\";\nexport * from \"./getHttpSigningMiddleware\";\n"
  },
  {
    "path": "packages/core/src/normalizeProvider.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { normalizeProvider } from \"./normalizeProvider\";\n\ndescribe(normalizeProvider.name, () => {\n  const testCases = [\n    true, // boolean\n    null, // null\n    undefined, // undefined\n    1, // number\n    \"\", // string\n    {}, // object\n  ];\n\n  it.each(testCases)(\"returns Provider if value is not a function: %s\", async (value) => {\n    const output = normalizeProvider(value);\n    expect(await output()).toEqual(value);\n  });\n\n  it.each(testCases)(\"returns Provider if value if a function which returns %s\", (value) => {\n    const mockValueProvider = () => Promise.resolve(value);\n    expect(normalizeProvider(mockValueProvider)).toBe(mockValueProvider);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/normalizeProvider.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\n/**\n * @internal\n *\n * @returns a provider function for the input value if it isn't already one.\n */\nexport const normalizeProvider = <T>(input: T | Provider<T>): Provider<T> => {\n  if (typeof input === \"function\") return input as Provider<T>;\n  const promisified = Promise.resolve(input);\n  return () => promisified;\n};\n"
  },
  {
    "path": "packages/core/src/pagination/createPaginator.spec.ts",
    "content": "import type { PaginationConfiguration } from \"@smithy/types\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { createPaginator } from \"./createPaginator\";\n\ndescribe(createPaginator.name, () => {\n  class Client {\n    private pages = 5;\n    async send() {\n      if (--this.pages > 0) {\n        return {\n          outToken: {\n            outToken2: {\n              outToken3: \"TOKEN_VALUE\",\n            },\n          },\n        };\n      }\n      return {};\n    }\n  }\n  class CommandObjectToken {\n    public middlewareStack = {\n      add: vi.fn(),\n      addRelativeTo: vi.fn(),\n    };\n    public constructor(public input: any) {\n      expect(input).toEqual({\n        sizeToken: 100,\n        inToken: {\n          outToken2: {\n            outToken3: \"TOKEN_VALUE\",\n          },\n        },\n      });\n    }\n  }\n\n  class ClientStringToken {\n    private pages = 5;\n    async send(command: any) {\n      if (--this.pages > 0) {\n        return {\n          outToken: command.input.inToken,\n        };\n      }\n      return {};\n    }\n  }\n  class CommandStringToken {\n    public middlewareStack = {\n      add: vi.fn(),\n      addRelativeTo: vi.fn(),\n    };\n    public constructor(public input: any) {\n      expect(input).toEqual({\n        sizeToken: 100,\n        inToken: \"TOKEN_VALUE\",\n      });\n    }\n  }\n\n  afterEach(() => {\n    vi.resetAllMocks();\n  });\n\n  it(\"should create a paginator\", async () => {\n    const paginate = createPaginator<PaginationConfiguration, { inToken?: string }, { outToken: string }>(\n      Client,\n      CommandObjectToken,\n      \"inToken\",\n      \"outToken\",\n      \"sizeToken\"\n    );\n\n    let pages = 0;\n\n    for await (const page of paginate(\n      {\n        client: new Client() as any,\n        pageSize: 100,\n        startingToken: {\n          outToken2: {\n            outToken3: \"TOKEN_VALUE\",\n          },\n        },\n      },\n      {}\n    )) {\n      pages += 1;\n      if (pages === 5) {\n        expect(page.outToken).toBeUndefined();\n      } else {\n        expect(page.outToken).toEqual({\n          outToken2: {\n            outToken3: \"TOKEN_VALUE\",\n          },\n        });\n      }\n    }\n\n    expect(pages).toEqual(5);\n  });\n\n  it(\"should prioritize token set in paginator config, fallback to token set in input parameters\", async () => {\n    class CommandExpectPaginatorConfigToken {\n      public constructor(public input: any) {\n        expect(input).toMatchObject({\n          inToken: \"abc\",\n        });\n      }\n    }\n    class CommandExpectOperationInputToken {\n      public constructor(public input: any) {\n        expect(input).toMatchObject({\n          inToken: \"xyz\",\n        });\n      }\n    }\n    {\n      const paginate = createPaginator<\n        PaginationConfiguration,\n        { inToken?: string; sizeToken?: number },\n        { outToken: string }\n      >(ClientStringToken, CommandExpectPaginatorConfigToken, \"inToken\", \"outToken\", \"sizeToken\");\n\n      let pages = 0;\n      const client = new ClientStringToken() as any;\n\n      for await (const page of paginate(\n        {\n          client,\n          startingToken: \"abc\",\n        },\n        {\n          inToken: \"xyz\",\n        }\n      )) {\n        pages += 1;\n        expect(page).toBeDefined();\n      }\n\n      expect(pages).toEqual(5);\n    }\n    {\n      const paginate = createPaginator<\n        PaginationConfiguration,\n        { inToken?: string; sizeToken?: number },\n        { outToken: string }\n      >(ClientStringToken, CommandExpectOperationInputToken, \"inToken\", \"outToken\", \"sizeToken\");\n\n      let pages = 0;\n      const client = new ClientStringToken() as any;\n\n      for await (const page of paginate(\n        {\n          client,\n        },\n        {\n          inToken: \"xyz\",\n        }\n      )) {\n        pages += 1;\n        expect(page).toBeDefined();\n      }\n\n      expect(pages).toEqual(5);\n    }\n  });\n\n  it(\"should prioritize page size set in operation input, fallback to page size set in paginator config (inverted from token priority)\", async () => {\n    class CommandExpectPaginatorPageSize {\n      public constructor(public input: any) {\n        expect(input).toMatchObject({\n          sizeToken: 100,\n        });\n      }\n    }\n    class CommandExpectOperationInputPageSize {\n      public constructor(public input: any) {\n        expect(input).toMatchObject({\n          sizeToken: 99,\n        });\n      }\n    }\n    {\n      const paginate = createPaginator<\n        PaginationConfiguration,\n        { inToken?: string; sizeToken?: number },\n        { outToken: string }\n      >(ClientStringToken, CommandExpectPaginatorPageSize, \"inToken\", \"outToken\", \"sizeToken\");\n\n      let pages = 0;\n      const client = new ClientStringToken() as any;\n\n      for await (const page of paginate(\n        {\n          client,\n          pageSize: 100,\n        },\n        {\n          inToken: \"abc\",\n        }\n      )) {\n        pages += 1;\n        expect(page).toBeDefined();\n      }\n\n      expect(pages).toEqual(5);\n    }\n    {\n      const paginate = createPaginator<\n        PaginationConfiguration,\n        { inToken?: string; sizeToken?: number },\n        { outToken: string }\n      >(ClientStringToken, CommandExpectOperationInputPageSize, \"inToken\", \"outToken\", \"sizeToken\");\n\n      let pages = 0;\n      const client = new ClientStringToken() as any;\n\n      for await (const page of paginate(\n        {\n          client,\n          pageSize: 100,\n        },\n        {\n          sizeToken: 99,\n          inToken: \"abc\",\n        }\n      )) {\n        pages += 1;\n        expect(page).toBeDefined();\n      }\n\n      expect(pages).toEqual(5);\n    }\n  });\n\n  it(\"should have the correct AsyncGenerator.TNext type\", async () => {\n    const paginate = createPaginator<\n      PaginationConfiguration,\n      { inToken?: string; sizeToken: number },\n      {\n        outToken: string;\n      }\n    >(ClientStringToken, CommandStringToken, \"inToken\", \"outToken.outToken2.outToken3\", \"sizeToken\");\n    const asyncGenerator = paginate(\n      { client: new ClientStringToken() as any },\n      { inToken: \"TOKEN_VALUE\", sizeToken: 100 }\n    );\n\n    const { value, done } = await asyncGenerator.next();\n    expect(value?.outToken).toBeTypeOf(\"string\");\n    expect(done).toBe(false);\n  });\n\n  it(\"should handle deep paths\", async () => {\n    const paginate = createPaginator<\n      PaginationConfiguration,\n      { inToken?: string },\n      {\n        outToken: {\n          outToken2: {\n            outToken3: string;\n          };\n        };\n      }\n    >(Client, CommandStringToken, \"inToken\", \"outToken.outToken2.outToken3\", \"sizeToken\");\n\n    let pages = 0;\n\n    for await (const page of paginate(\n      {\n        client: new Client() as any,\n        pageSize: 100,\n        startingToken: \"TOKEN_VALUE\",\n      },\n      {}\n    )) {\n      pages += 1;\n      if (pages === 5) {\n        expect(page.outToken).toBeUndefined();\n      } else {\n        expect(page.outToken.outToken2.outToken3).toEqual(\"TOKEN_VALUE\");\n      }\n    }\n\n    expect(pages).toEqual(5);\n  });\n\n  it(\"should allow modification of the instantiated command\", async () => {\n    const paginate = createPaginator<PaginationConfiguration, { inToken?: string }, { outToken: string }>(\n      Client,\n      CommandObjectToken,\n      \"inToken\",\n      \"outToken\",\n      \"sizeToken\"\n    );\n\n    let pages = 0;\n    const client: any = new Client();\n    vi.spyOn(client, \"send\");\n    const config = {\n      client,\n      pageSize: 100,\n      startingToken: {\n        outToken2: {\n          outToken3: \"TOKEN_VALUE\",\n        },\n      },\n      withCommand(command) {\n        command.middlewareStack.add((next) => (args) => next(args));\n        command.middlewareStack.addRelativeTo((next: any) => (args: any) => next(args), {\n          toMiddleware: \"\",\n          relation: \"before\",\n        });\n        expect(command.middlewareStack.add).toHaveBeenCalledTimes(1);\n        expect(command.middlewareStack.addRelativeTo).toHaveBeenCalledTimes(1);\n        return command;\n      },\n    } as Parameters<typeof paginate>[0];\n    vi.spyOn(config, \"withCommand\");\n\n    for await (const page of paginate(config, {})) {\n      pages += 1;\n      if (pages === 5) {\n        expect(page.outToken).toBeUndefined();\n      } else {\n        expect(page.outToken).toEqual({\n          outToken2: {\n            outToken3: \"TOKEN_VALUE\",\n          },\n        });\n      }\n    }\n\n    expect(pages).toEqual(5);\n    expect(client.send).toHaveBeenCalledTimes(5);\n    expect(config.withCommand).toHaveBeenCalledTimes(5);\n    expect(config.withCommand).toHaveBeenCalledWith(expect.any(CommandObjectToken));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/pagination/createPaginator.ts",
    "content": "import type { Client, Command, PaginationConfiguration, Paginator } from \"@smithy/types\";\n\n/**\n * @internal\n */\nconst makePagedClientRequest = async <ClientType extends Client<any, any, any>, InputType, OutputType>(\n  CommandCtor: any,\n  client: ClientType,\n  input: InputType,\n  withCommand: (command: Command<any, any, any, any, any>) => typeof command | undefined = (_) => _,\n  ...args: any[]\n): Promise<OutputType> => {\n  let command = new CommandCtor(input);\n  command = withCommand(command) ?? command;\n  return await client.send(command, ...args);\n};\n\n/**\n * Creates a paginator.\n *\n * @internal\n */\nexport function createPaginator<\n  PaginationConfigType extends PaginationConfiguration,\n  InputType extends object,\n  OutputType extends object,\n>(\n  ClientCtor: any,\n  CommandCtor: any,\n  inputTokenName: string,\n  outputTokenName: string,\n  pageSizeTokenName?: string\n): (config: PaginationConfigType, input: InputType, ...additionalArguments: any[]) => Paginator<OutputType> {\n  return async function* paginateOperation(\n    config: PaginationConfigType,\n    input: InputType,\n    ...additionalArguments: any[]\n  ): Paginator<OutputType> {\n    const _input = input as any;\n    // for legacy reasons this coalescing order is inverted from that of pageSize.\n    let token: any = config.startingToken ?? _input[inputTokenName];\n    let hasNext = true;\n    let page: OutputType;\n\n    while (hasNext) {\n      _input[inputTokenName] = token;\n      if (pageSizeTokenName) {\n        _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;\n      }\n      if (config.client instanceof ClientCtor) {\n        page = await makePagedClientRequest(\n          CommandCtor,\n          config.client,\n          input,\n          config.withCommand,\n          ...additionalArguments\n        );\n      } else {\n        throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);\n      }\n      yield page;\n      const prevToken = token;\n      token = get(page, outputTokenName);\n      hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));\n    }\n    return undefined;\n  };\n}\n\n/**\n * @internal\n */\nconst get = (fromObject: any, path: string): any => {\n  let cursor = fromObject;\n  const pathComponents = path.split(\".\");\n  for (const step of pathComponents) {\n    if (!cursor || typeof cursor !== \"object\") {\n      return undefined;\n    }\n    cursor = cursor[step];\n  }\n  return cursor;\n};\n"
  },
  {
    "path": "packages/core/src/request-builder/requestBuilder.ts",
    "content": "/**\n * Backwards compatibility re-export.\n *\n * @internal\n */\nexport { requestBuilder } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/core/src/setFeature.spec.ts",
    "content": "import type { HandlerExecutionContext } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { setFeature } from \"./setFeature\";\n\ndescribe(setFeature.name, () => {\n  it(\"creates the context object path if needed\", () => {\n    const context: HandlerExecutionContext = {};\n    setFeature(context, \"RETRY_MODE_STANDARD\", \"E\");\n    expect(context).toEqual({\n      __smithy_context: {\n        features: {\n          RETRY_MODE_STANDARD: \"E\",\n        },\n      },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/setFeature.ts",
    "content": "import type { HandlerExecutionContext, SmithyFeatures } from \"@smithy/types\";\n\n/**\n * Indicates to the request context that a given feature is active.\n * specification asks the library not to include a runtime lookup of all\n * the feature identifiers.\n *\n * @internal\n * @param context - handler execution context.\n * @param feature - readable name of feature.\n * @param value - encoding value of feature. This is required because the\n */\nexport function setFeature<F extends keyof SmithyFeatures>(\n  context: HandlerExecutionContext,\n  feature: F,\n  value: SmithyFeatures[F]\n) {\n  if (!context.__smithy_context) {\n    context.__smithy_context = {\n      features: {},\n    };\n  } else if (!context.__smithy_context.features) {\n    context.__smithy_context.features = {};\n  }\n  context.__smithy_context.features![feature] = value;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/CborCodec.spec.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport { nv } from \"@smithy/core/serde\";\nimport type {\n  BigDecimalSchema,\n  StaticSimpleSchema,\n  StaticStructureSchema,\n  StaticUnionSchema,\n  StringSchema,\n  TimestampDefaultSchema,\n} from \"@smithy/types\";\nimport { describe, expect, it } from \"vitest\";\n\nimport { CborCodec, CborShapeSerializer } from \"./CborCodec\";\nimport { cbor } from \"./cbor\";\nimport { tagSymbol } from \"./cbor-types\";\n\ndescribe(CborShapeSerializer.name, () => {\n  const codec = new CborCodec();\n\n  const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\n  const idempotencyTokenSchemas = [\n    NormalizedSchema.of([0, \"\", \"StringWithTraits\", 0b0100, 0] satisfies StaticSimpleSchema),\n    NormalizedSchema.of([0, \"\", \"StringWithTraits\", { idempotencyToken: 1 }, 0] satisfies StaticSimpleSchema),\n  ];\n\n  const plainSchemas = [\n    NormalizedSchema.of(0 satisfies StringSchema),\n    NormalizedSchema.of([0, \"\", \"StringWithTraits\", 0, 0] satisfies StaticSimpleSchema),\n    NormalizedSchema.of([0, \"\", \"StringWithTraits\", {}, 0] satisfies StaticSimpleSchema),\n  ];\n\n  const serializer = codec.createSerializer();\n  const deserializer = codec.createDeserializer();\n\n  const dateSchema = [\n    3,\n    \"ns\",\n    \"DateContainer\",\n    0,\n    [\"timestamp\"],\n    [4 satisfies TimestampDefaultSchema],\n  ] satisfies StaticStructureSchema;\n  const AB$ = [3, \"ns\", \"AB\", 0, [\"a\", \"b\"], [0, 19 satisfies BigDecimalSchema]] satisfies StaticStructureSchema;\n\n  describe(\"serialization\", () => {\n    it(\"should generate an idempotency token when the input for such a member is undefined\", () => {\n      for (const idempotencyTokenSchema of idempotencyTokenSchemas) {\n        for (const plainSchema of plainSchemas) {\n          const objectSchema = [\n            3,\n            \"ns\",\n            \"StructWithIdempotencyToken\",\n            0,\n            [\"idempotencyToken\", \"plainString\", \"memberTraitToken\"],\n            [idempotencyTokenSchema, plainSchema, [() => plainSchema, 0b0100]],\n          ] satisfies StaticStructureSchema;\n\n          serializer.write(objectSchema, {\n            idempotencyToken: undefined,\n            plainString: undefined,\n            memberTraitToken: undefined,\n          });\n          expect(cbor.deserialize(serializer.flush())).toMatchObject({\n            idempotencyToken: UUID_V4,\n            memberTraitToken: UUID_V4,\n          });\n\n          serializer.write(objectSchema, {\n            idempotencyToken: undefined,\n            plainString: \"abc\",\n          });\n          expect(cbor.deserialize(serializer.flush())).toMatchObject({\n            idempotencyToken: UUID_V4,\n            plainString: /^abc$/,\n            memberTraitToken: UUID_V4,\n          });\n\n          serializer.write(objectSchema, {\n            idempotencyToken: \"jrt\",\n            plainString: \"abc\",\n            memberTraitToken: \"qrf\",\n          });\n          expect(cbor.deserialize(serializer.flush())).toMatchObject({\n            idempotencyToken: \"jrt\",\n            plainString: /^abc$/,\n            memberTraitToken: \"qrf\",\n          });\n        }\n      }\n    });\n\n    it(\"should serialize Dates to tags if the schema is a timestamp\", () => {\n      serializer.write(dateSchema, { timestamp: new Date(1) });\n      const serialization = serializer.flush();\n\n      const parsedWithoutSchema = cbor.deserialize(serialization);\n      expect(parsedWithoutSchema).toEqual({\n        timestamp: {\n          tag: 1,\n          value: 0.001,\n          [tagSymbol]: true,\n        },\n      });\n    });\n\n    it(\"can serialize the $unknown union convention\", async () => {\n      const schema = [\n        3,\n        \"ns\",\n        \"Struct\",\n        0,\n        [\"union\"],\n        [[4, \"ns\", \"Union\", 0, [\"a\", \"b\", \"c\"], [0, 0, 0]] satisfies StaticUnionSchema],\n      ] satisfies StaticStructureSchema;\n\n      const ns = NormalizedSchema.of(schema);\n      const input = {\n        union: {\n          $unknown: [\"d\", {}],\n        },\n      };\n      serializer.write(ns, input);\n      const serialization = serializer.flush();\n      const objectEquivalent = cbor.deserialize(serialization);\n      expect(objectEquivalent).toEqual({\n        union: {\n          d: {},\n        },\n      });\n    });\n\n    it(\"should pass through NumericValue types if the schema is BigDecimal\", async () => {\n      const schema = [\n        3,\n        \"ns\",\n        \"Currency\",\n        0,\n        [\"price\"],\n        [19 satisfies BigDecimalSchema],\n      ] satisfies StaticStructureSchema;\n      const data = {\n        price: nv(\"0.99\"),\n      };\n      serializer.write(NormalizedSchema.of(schema), data);\n      const serialized = serializer.flush();\n      expect(cbor.deserialize(serialized)).toEqual({\n        price: nv(\"0.99\"),\n      });\n    });\n\n    it(\"serializes extra document members when encountering __type\", async () => {\n      const data = {\n        __type: \"ns#PlateOfFood\",\n        pasta: \"Macaroni\",\n        cheese: \"cheddar\",\n        a: \"a\",\n        b: nv(\"-.99\"),\n      };\n      serializer.write(AB$, data);\n      const serialization = serializer.flush();\n      expect(cbor.deserialize(serialization)).toEqual({\n        __type: \"ns#PlateOfFood\",\n        pasta: \"Macaroni\",\n        cheese: \"cheddar\",\n        a: \"a\",\n        b: nv(\"-0.99\"),\n      });\n    });\n  });\n\n  describe(\"deserialization\", () => {\n    it(\"should not create undefined values\", async () => {\n      const struct = [3, \"ns\", \"Struct\", 0, [\"sessionId\", \"tokenId\"], [0, 0]] satisfies StaticStructureSchema;\n\n      const data = cbor.serialize({\n        sessionId: \"abcd\",\n      });\n\n      const deserialized = deserializer.read(struct, data);\n\n      expect(deserialized).toEqual({\n        sessionId: \"abcd\",\n      });\n\n      expect(\"tokenId\" in deserialized).toEqual(false);\n    });\n\n    it(\"should deserialize tags to dates if the schema is a timestamp\", async () => {\n      const decoded = {\n        timestamp: {\n          tag: 1,\n          value: 0.001,\n          [tagSymbol]: true,\n        },\n      };\n\n      const deserialized = await deserializer.read(dateSchema, cbor.serialize(decoded));\n\n      expect(deserialized).toEqual({\n        timestamp: new Date(1),\n      });\n    });\n\n    it(\"should pass through NumericValue types if the schema is BigDecimal\", async () => {\n      const schema = [\n        3,\n        \"ns\",\n        \"Currency\",\n        0,\n        [\"price\"],\n        [19 satisfies BigDecimalSchema],\n      ] satisfies StaticStructureSchema;\n      const data = cbor.serialize({\n        price: nv(\"0.99\"),\n      });\n      const deserialized = await deserializer.read(NormalizedSchema.of(schema), data);\n      expect(deserialized).toEqual({\n        price: nv(\"0.99\"),\n      });\n    });\n\n    it(\"deserializes unknown union members to the $unknown conventional property\", async () => {\n      const schema = [\n        3,\n        \"ns\",\n        \"Struct\",\n        0,\n        [\"union\"],\n        [[4, \"ns\", \"Union\", 0, [\"a\", \"b\", \"c\"], [0, 0, 0]] satisfies StaticUnionSchema],\n      ] satisfies StaticStructureSchema;\n      const ns = NormalizedSchema.of(schema);\n      const receivedData = {\n        union: {\n          __type: \"ns.Union\",\n          d: {},\n        },\n      };\n      const serialization = cbor.serialize(receivedData);\n      const deserialized = await deserializer.read(ns, serialization);\n      expect(deserialized).toEqual({\n        union: {\n          $unknown: [\"d\", {}],\n        },\n      } satisfies Record<string, unknown>);\n    });\n\n    it(\"deserializes extra document members when encountering __type\", async () => {\n      expect(\n        await deserializer.read(\n          AB$,\n          cbor.serialize({\n            __type: \"ns#Other\",\n            __field__: \"xyz\",\n            blob: \"AAAA\",\n            nested: {},\n            a: \"a\",\n            b: nv(\"-0.99\"),\n          })\n        )\n      ).toEqual({\n        __type: \"ns#Other\",\n        __field__: \"xyz\",\n        blob: \"AAAA\",\n        nested: {},\n        a: \"a\",\n        b: nv(\"-0.99\"),\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/CborCodec.ts",
    "content": "import { SerdeContext } from \"@smithy/core/protocols\";\nimport { NormalizedSchema } from \"@smithy/core/schema\";\nimport { NumericValue, _parseEpochTimestamp, fromBase64, generateIdempotencyToken } from \"@smithy/core/serde\";\nimport type { Codec, DocumentSchema, Schema, ShapeDeserializer, ShapeSerializer } from \"@smithy/types\";\n\nimport { cbor } from \"./cbor\";\nimport { dateToTag } from \"./parseCborBody\";\n\n/**\n * @public\n */\nexport class CborCodec extends SerdeContext implements Codec<Uint8Array, Uint8Array> {\n  public createSerializer(): CborShapeSerializer {\n    const serializer = new CborShapeSerializer();\n    serializer.setSerdeContext(this.serdeContext!);\n    return serializer;\n  }\n\n  public createDeserializer(): CborShapeDeserializer {\n    const deserializer = new CborShapeDeserializer();\n    deserializer.setSerdeContext(this.serdeContext!);\n    return deserializer;\n  }\n}\n\n/**\n * @public\n */\nexport class CborShapeSerializer extends SerdeContext implements ShapeSerializer {\n  private value: unknown;\n\n  public write(schema: Schema, value: unknown): void {\n    this.value = this.serialize(schema, value);\n  }\n\n  /**\n   * Recursive serializer transform that copies and prepares the user input object\n   * for CBOR serialization.\n   */\n  public serialize(schema: Schema, source: unknown): any {\n    const ns = NormalizedSchema.of(schema);\n\n    if (source == null) {\n      if (ns.isIdempotencyToken()) {\n        return generateIdempotencyToken();\n      }\n      return source as null | undefined;\n    }\n\n    if (ns.isBlobSchema()) {\n      if (typeof source === \"string\") {\n        return (this.serdeContext?.base64Decoder ?? fromBase64)(source);\n      }\n      return source as Uint8Array;\n    }\n\n    if (ns.isTimestampSchema()) {\n      if (typeof source === \"number\" || typeof source === \"bigint\") {\n        return dateToTag(new Date((Number(source) / 1000) | 0));\n      }\n      return dateToTag(source as Date);\n    }\n\n    if (typeof source === \"function\" || typeof source === \"object\") {\n      const sourceObject = source as Record<string, unknown>;\n\n      if (ns.isListSchema() && Array.isArray(sourceObject)) {\n        const sparse = !!ns.getMergedTraits().sparse;\n        const newArray = [];\n        let i = 0;\n        for (const item of sourceObject) {\n          const value = this.serialize(ns.getValueSchema(), item);\n          if (value != null || sparse) {\n            newArray[i++] = value;\n          }\n        }\n        return newArray;\n      }\n      if (sourceObject instanceof Date) {\n        return dateToTag(sourceObject);\n      }\n      const newObject = {} as any;\n      if (ns.isMapSchema()) {\n        const sparse = !!ns.getMergedTraits().sparse;\n        for (const key in sourceObject) {\n          const value = this.serialize(ns.getValueSchema(), sourceObject[key]);\n          if (value != null || sparse) {\n            newObject[key] = value;\n          }\n        }\n      } else if (ns.isStructSchema()) {\n        for (const [key, memberSchema] of ns.structIterator()) {\n          const value = this.serialize(memberSchema, sourceObject[key]);\n          if (value != null) {\n            newObject[key] = value;\n          }\n        }\n        const isUnion = ns.isUnionSchema();\n        if (isUnion && Array.isArray(sourceObject.$unknown)) {\n          const [k, v] = sourceObject.$unknown;\n          newObject[k] = v;\n        } else if (typeof sourceObject.__type === \"string\") {\n          // This if-block is for backwards compatibility support and should not be copied\n          // to other implementations.\n          for (const k in sourceObject) {\n            if (!(k in newObject)) {\n              // we have no type information, so serialize with Document rules.\n              newObject[k] = this.serialize(15 satisfies DocumentSchema, sourceObject[k]);\n            }\n          }\n        }\n      } else if (ns.isDocumentSchema()) {\n        for (const key in sourceObject) {\n          newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]);\n        }\n      } else if (ns.isBigDecimalSchema()) {\n        return sourceObject;\n      }\n      return newObject;\n    }\n\n    return source;\n  }\n\n  public flush(): Uint8Array {\n    const buffer = cbor.serialize(this.value);\n    this.value = undefined;\n    return buffer as Uint8Array;\n  }\n}\n\n/**\n * @public\n */\nexport class CborShapeDeserializer extends SerdeContext implements ShapeDeserializer {\n  public read(schema: Schema, bytes: Uint8Array): any {\n    const data: any = cbor.deserialize(bytes);\n    return this.readValue(schema, data);\n  }\n\n  /**\n   * Public because it's called by the protocol implementation to deserialize errors.\n   * @internal\n   */\n  public readValue(_schema: Schema, value: any): any {\n    const ns = NormalizedSchema.of(_schema);\n\n    if (ns.isTimestampSchema()) {\n      // timestampFormat is ignored.\n      if (typeof value === \"number\") {\n        return _parseEpochTimestamp(value);\n      }\n      if (typeof value === \"object\") {\n        if (value.tag === 1 && \"value\" in value) {\n          return _parseEpochTimestamp(value.value);\n        }\n      }\n    }\n\n    if (ns.isBlobSchema()) {\n      if (typeof value === \"string\") {\n        return (this.serdeContext?.base64Decoder ?? fromBase64)(value);\n      }\n      return value as Uint8Array | undefined;\n    }\n\n    if (\n      typeof value === \"undefined\" ||\n      typeof value === \"boolean\" ||\n      typeof value === \"number\" ||\n      typeof value === \"string\" ||\n      typeof value === \"bigint\" ||\n      typeof value === \"symbol\"\n    ) {\n      return value;\n    } else if (typeof value === \"object\") {\n      if (value === null) {\n        return null;\n      }\n      if (\"byteLength\" in (value as Uint8Array)) {\n        return value;\n      }\n      if (value instanceof Date) {\n        return value;\n      }\n      if (ns.isDocumentSchema()) {\n        return value;\n      }\n\n      if (ns.isListSchema()) {\n        const newArray = [] as any[];\n        const memberSchema = ns.getValueSchema();\n\n        for (const item of value) {\n          const itemValue = this.readValue(memberSchema, item);\n          newArray.push(itemValue);\n        }\n        return newArray;\n      }\n\n      const newObject = {} as any;\n\n      if (ns.isMapSchema()) {\n        const targetSchema = ns.getValueSchema();\n\n        for (const key in value) {\n          const itemValue = this.readValue(targetSchema, value[key]);\n          newObject[key] = itemValue;\n        }\n      } else if (ns.isStructSchema()) {\n        const isUnion = ns.isUnionSchema();\n        let keys: Set<string> | undefined;\n        if (isUnion) {\n          keys = new Set<string>();\n          for (const k in value) {\n            if (k !== \"__type\") {\n              keys.add(k);\n            }\n          }\n        }\n        for (const [key, memberSchema] of ns.structIterator()) {\n          if (isUnion) {\n            keys!.delete(key);\n          }\n          if (value[key] != null) {\n            newObject[key] = this.readValue(memberSchema, value[key]);\n          }\n        }\n        if (isUnion && keys?.size === 1) {\n          let newObjectEmpty = true;\n          for (const _ in newObject) {\n            newObjectEmpty = false;\n            break;\n          }\n          if (newObjectEmpty) {\n            const k = keys!.values().next().value as string;\n            newObject.$unknown = [k, value[k]];\n          }\n        } else if (typeof value.__type === \"string\") {\n          // This if-block is for backwards compatibility support and should not be copied\n          // to other implementations.\n          for (const k in value) {\n            if (!(k in newObject)) {\n              // we have no type information, so copy as-is from CBOR-derived object.\n              newObject[k] = value[k];\n            }\n          }\n        }\n      } else if (value instanceof NumericValue) {\n        return value;\n      }\n      return newObject;\n    } else {\n      return value;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/SmithyRpcV2CborProtocol.spec.ts",
    "content": "import { op, type TypeRegistry } from \"@smithy/core/schema\";\nimport { HttpRequest, HttpResponse } from \"@smithy/protocol-http\";\nimport type {\n  $SchemaRef,\n  BlobSchema,\n  BooleanSchema,\n  MapSchemaModifier,\n  NumericSchema,\n  ResponseMetadata,\n  RetryableTrait,\n  StaticErrorSchema,\n  StaticOperationSchema,\n  StaticStructureSchema,\n  StringSchema,\n  TimestampDefaultSchema,\n} from \"@smithy/types\";\nimport { beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport { SmithyRpcV2CborProtocol } from \"./SmithyRpcV2CborProtocol\";\nimport { cbor } from \"./cbor\";\nimport { dateToTag } from \"./parseCborBody\";\n\ndescribe(SmithyRpcV2CborProtocol.name, () => {\n  const bytes = (arr: number[]) => Buffer.from(arr);\n\n  describe(\"serialization\", () => {\n    const testCases: Array<{\n      name: string;\n      schema: $SchemaRef;\n      input: any;\n      expected: {\n        request: any;\n        body: any;\n      };\n    }> = [\n      {\n        name: \"document with timestamp and blob\",\n        schema: [\n          3,\n          \"\",\n          \"MyExtendedDocument\",\n          {},\n          [\"timestamp\", \"blob\"],\n          [\n            [4 satisfies TimestampDefaultSchema, 0],\n            [21 satisfies BlobSchema, 0],\n          ],\n        ],\n        input: {\n          bool: true,\n          int: 5,\n          float: -3.001,\n          timestamp: new Date(1_000_000),\n          blob: bytes([97, 98, 99, 100]),\n        },\n        expected: {\n          request: {},\n          body: {\n            timestamp: dateToTag(new Date(1_000_000)),\n            blob: bytes([97, 98, 99, 100]),\n          },\n        },\n      },\n      {\n        name: \"do not write to header or query\",\n        schema: [\n          3,\n          \"\",\n          \"MyExtendedDocument\",\n          {},\n          [\"bool\", \"timestamp\", \"blob\", \"prefixHeaders\", \"searchParams\"],\n          [\n            [2 satisfies BooleanSchema, { httpQuery: \"bool\" }],\n            [4 satisfies TimestampDefaultSchema, { httpHeader: \"timestamp\" }],\n            [21 satisfies BlobSchema, { httpHeader: \"blob\" }],\n            [(128 satisfies MapSchemaModifier) | (0 satisfies StringSchema), { httpPrefixHeaders: \"anti-\" }],\n            [(128 satisfies MapSchemaModifier) | (0 satisfies StringSchema), { httpQueryParams: 1 }],\n          ],\n        ],\n        input: {\n          bool: true,\n          timestamp: new Date(1_000_000),\n          blob: bytes([97, 98, 99, 100]),\n          prefixHeaders: {\n            pasto: \"cheese dodecahedron\",\n            clockwise: \"left\",\n          },\n          searchParams: {\n            a: 1,\n            b: 2,\n          },\n        },\n        expected: {\n          request: {\n            headers: {},\n            query: {},\n          },\n          body: {\n            bool: true,\n            timestamp: dateToTag(new Date(1_000_000)),\n            blob: bytes([97, 98, 99, 100]),\n            prefixHeaders: {\n              pasto: \"cheese dodecahedron\",\n              clockwise: \"left\",\n            },\n            searchParams: {\n              a: 1,\n              b: 2,\n            },\n          },\n        },\n      },\n      {\n        name: \"sparse list and map\",\n        schema: [\n          3,\n          \"\",\n          \"MyShape\",\n          0,\n          [\"mySparseList\", \"myRegularList\", \"mySparseMap\", \"myRegularMap\"],\n          [\n            [() => [1, \"\", \"MySparseList\", { sparse: 1 }, 1 satisfies NumericSchema], {}],\n            [() => [1, \"\", \"MyList\", {}, 1 satisfies NumericSchema], {}],\n            [() => [2, \"\", \"MySparseMap\", { sparse: 1 }, 0 satisfies StringSchema, 1 satisfies NumericSchema], {}],\n            [() => [2, \"\", \"MyMap\", {}, 0 satisfies StringSchema, 1 satisfies NumericSchema], {}],\n          ],\n        ],\n        input: {\n          mySparseList: [null, 1, null, 2, null],\n          myRegularList: [null, 1, null, 2, null],\n          mySparseMap: {\n            0: null,\n            1: 1,\n            2: null,\n            3: 3,\n            4: null,\n          },\n          myRegularMap: {\n            0: null,\n            1: 1,\n            2: null,\n            3: 3,\n            4: null,\n          },\n        },\n        expected: {\n          request: {},\n          body: {\n            mySparseList: [null, 1, null, 2, null],\n            myRegularList: [1, 2],\n            mySparseMap: {\n              0: null,\n              1: 1,\n              2: null,\n              3: 3,\n              4: null,\n            },\n            myRegularMap: {\n              1: 1,\n              3: 3,\n            },\n          },\n        },\n      },\n    ];\n\n    for (const testCase of testCases) {\n      it(`should serialize HTTP Requests: ${testCase.name}`, async () => {\n        const protocol = new SmithyRpcV2CborProtocol({ defaultNamespace: \"\" });\n        const httpRequest = await protocol.serializeRequest(\n          {\n            namespace: \"ns\",\n            name: \"dummy\",\n            input: testCase.schema,\n            output: \"unit\",\n            traits: {},\n          },\n          testCase.input,\n          {\n            async endpoint() {\n              return {\n                protocol: \"https:\",\n                hostname: \"example.com\",\n                path: \"/\",\n              };\n            },\n          } as any\n        );\n\n        const body = httpRequest.body;\n        httpRequest.body = void 0;\n\n        expect(httpRequest).toEqual(\n          new HttpRequest({\n            protocol: \"https:\",\n            hostname: \"example.com\",\n            method: \"POST\",\n            path: \"/service/undefined/operation/undefined\",\n            ...testCase.expected.request,\n            headers: {\n              accept: \"application/cbor\",\n              \"content-type\": \"application/cbor\",\n              \"smithy-protocol\": \"rpc-v2-cbor\",\n              \"content-length\": String(body.byteLength),\n              ...testCase.expected.request.headers,\n            },\n          })\n        );\n\n        expect(cbor.deserialize(body)).toEqual(testCase.expected.body);\n      });\n    }\n  });\n\n  describe(\"deserialization\", () => {\n    const testCases = [\n      {\n        // Sparseness is not checked on deserialization, also see this smithy change: https://github.com/smithy-lang/smithy/pull/2972\n        name: \"sparseness is not checked on deserialization\",\n        schema: [\n          3,\n          \"\",\n          \"MyShape\",\n          0,\n          [\"mySparseList\", \"myRegularList\", \"mySparseMap\", \"myRegularMap\"],\n          [\n            [() => [1, \"\", \"MyList\", { sparse: 1 }, 1 satisfies NumericSchema], {}],\n            [() => [1, \"\", \"MyList\", {}, 1 satisfies NumericSchema], {}],\n            [() => [2, \"\", \"MyMap\", { sparse: 1 }, 0 satisfies StringSchema, 1 satisfies NumericSchema], {}],\n            [() => [2, \"\", \"MyMap\", {}, 0 satisfies StringSchema, 1 satisfies NumericSchema], {}],\n          ],\n        ] satisfies StaticStructureSchema,\n        mockOutput: {\n          mySparseList: [null, 1, null, 2, null],\n          myRegularList: [null, 1, null, 2, null],\n          mySparseMap: {\n            0: null,\n            1: 1,\n            2: null,\n            3: 3,\n            4: null,\n          },\n          myRegularMap: {\n            0: null,\n            1: 1,\n            2: null,\n            3: 3,\n            4: null,\n          },\n        },\n        expected: {\n          output: {\n            mySparseList: [null, 1, null, 2, null],\n            myRegularList: [null, 1, null, 2, null],\n            mySparseMap: {\n              0: null,\n              1: 1,\n              2: null,\n              3: 3,\n              4: null,\n            },\n            myRegularMap: {\n              0: null,\n              1: 1,\n              2: null,\n              3: 3,\n              4: null,\n            },\n          },\n        },\n      },\n    ];\n\n    for (const testCase of testCases) {\n      it(`should deserialize HTTP Responses: ${testCase.name}`, async () => {\n        const protocol = new SmithyRpcV2CborProtocol({\n          defaultNamespace: \"\",\n        });\n        const output = await protocol.deserializeResponse(\n          {\n            namespace: \"ns\",\n            name: \"dummy\",\n            input: \"unit\",\n            output: testCase.schema,\n            traits: {},\n          },\n          {} as any,\n          new HttpResponse({\n            statusCode: 200,\n            body: cbor.serialize(testCase.mockOutput),\n          })\n        );\n\n        delete (output as Partial<typeof output>).$metadata;\n        expect(output).toEqual(testCase.expected.output);\n      });\n    }\n  });\n\n  describe(\"error handling\", () => {\n    const protocol = new SmithyRpcV2CborProtocol({ defaultNamespace: \"ns\" });\n\n    const staticOperation = [\n      9,\n      \"ns\",\n      \"OperationWithModeledException\",\n      {},\n      [3, \"ns\", \"Input\", 0, [], []],\n      [3, \"ns\", \"Output\", 0, [], []],\n    ] satisfies StaticOperationSchema;\n\n    const operation = op(\n      staticOperation[1],\n      staticOperation[2],\n      staticOperation[3],\n      staticOperation[4],\n      staticOperation[5]\n    );\n\n    const errorResponse = new HttpResponse({\n      statusCode: 400,\n      headers: {},\n      body: cbor.serialize({\n        __type: \"ns#ModeledException\",\n        modeledProperty: \"oh no\",\n      }),\n    });\n\n    const errorResponseNoDiscriminator = new HttpResponse({\n      statusCode: 404,\n      headers: {},\n      body: cbor.serialize({\n        modeledProperty: \"oh no\",\n      }),\n    });\n\n    const serdeContext = {};\n\n    class ServiceBaseException extends Error {\n      public readonly $fault: \"client\" | \"server\" = \"client\";\n      public $response?: HttpResponse;\n      public $retryable?: RetryableTrait;\n      public $metadata: ResponseMetadata = {\n        httpStatusCode: 400,\n      };\n    }\n\n    class ModeledExceptionCtor extends ServiceBaseException {\n      public modeledProperty: string = \"\";\n    }\n\n    // protected access.\n    const registry = (protocol as any as { compositeErrorRegistry: TypeRegistry }).compositeErrorRegistry;\n\n    beforeEach(() => {\n      registry.clear();\n    });\n\n    const modeledExceptionSchema = [\n      -3,\n      \"ns\",\n      \"ModeledException\",\n      0,\n      [\"modeledProperty\"],\n      [0],\n    ] satisfies StaticErrorSchema;\n    const baseServiceExceptionSchema = [\n      -3,\n      \"smithy.ts.sdk.synthetic.ns\",\n      \"BaseServiceException\",\n      0,\n      [],\n      [],\n    ] satisfies StaticErrorSchema;\n\n    it(\"should throw the schema error ctor if one exists\", async () => {\n      // this is for modeled exceptions.\n      registry.registerError(modeledExceptionSchema, ModeledExceptionCtor);\n      registry.registerError(baseServiceExceptionSchema, ServiceBaseException);\n\n      try {\n        await protocol.deserializeResponse(operation, serdeContext as any, errorResponse);\n      } catch (e) {\n        expect(e).toBeInstanceOf(ModeledExceptionCtor);\n        expect((e as ModeledExceptionCtor).modeledProperty).toEqual(\"oh no\");\n        expect(e).toBeInstanceOf(ServiceBaseException);\n      }\n      expect.assertions(3);\n    });\n\n    it(\"should throw a base error if available in the namespace, when no error schema is modeled\", async () => {\n      // this is the expected fallback case for all generated clients.\n      registry.registerError(baseServiceExceptionSchema, ServiceBaseException);\n\n      try {\n        await protocol.deserializeResponse(operation, serdeContext as any, errorResponseNoDiscriminator);\n      } catch (e) {\n        expect(e).toBeInstanceOf(ServiceBaseException);\n      }\n      expect.assertions(1);\n    });\n\n    it(\"should fall back to a generic JS Error as a last resort\", async () => {\n      // this shouldn't happen, but in case the type registry is mutated incorrectly.\n      try {\n        await protocol.deserializeResponse(operation, serdeContext as any, errorResponse);\n      } catch (e) {\n        expect(e).toBeInstanceOf(Error);\n      }\n      expect.assertions(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/SmithyRpcV2CborProtocol.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport { RpcProtocol } from \"@smithy/core/protocols\";\nimport { NormalizedSchema, TypeRegistry, deref } from \"@smithy/core/schema\";\nimport type {\n  EndpointBearer,\n  HandlerExecutionContext,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  MetadataBearer,\n  OperationSchema,\n  ResponseMetadata,\n  SerdeFunctions,\n  StaticErrorSchema,\n} from \"@smithy/types\";\n\nimport { CborCodec } from \"./CborCodec\";\nimport { loadSmithyRpcV2CborErrorCode } from \"./parseCborBody\";\n\n/**\n * Client protocol for Smithy RPCv2 CBOR.\n *\n * @public\n */\nexport class SmithyRpcV2CborProtocol extends RpcProtocol {\n  /**\n   * @override\n   */\n  protected declare compositeErrorRegistry: TypeRegistry;\n  private codec = new CborCodec();\n  protected serializer = this.codec.createSerializer();\n  protected deserializer = this.codec.createDeserializer();\n\n  public constructor({\n    defaultNamespace,\n    errorTypeRegistries,\n  }: {\n    defaultNamespace: string;\n    errorTypeRegistries?: TypeRegistry[];\n  }) {\n    super({ defaultNamespace, errorTypeRegistries });\n  }\n\n  public getShapeId(): string {\n    return \"smithy.protocols#rpcv2Cbor\";\n  }\n\n  public getPayloadCodec(): CborCodec {\n    return this.codec;\n  }\n\n  public async serializeRequest<Input extends object>(\n    operationSchema: OperationSchema,\n    input: Input,\n    context: HandlerExecutionContext & SerdeFunctions & EndpointBearer\n  ): Promise<IHttpRequest> {\n    const request = await super.serializeRequest(operationSchema, input, context);\n    Object.assign(request.headers, {\n      \"content-type\": this.getDefaultContentType(),\n      \"smithy-protocol\": \"rpc-v2-cbor\",\n      accept: this.getDefaultContentType(),\n    });\n    if (deref(operationSchema.input) === \"unit\") {\n      delete request.body;\n      delete request.headers[\"content-type\"];\n    } else {\n      if (!request.body) {\n        this.serializer.write(15, {});\n        request.body = this.serializer.flush();\n      }\n      try {\n        request.headers[\"content-length\"] = String((request.body as Uint8Array).byteLength);\n      } catch (e) {}\n    }\n    const { service, operation } = getSmithyContext(context) as {\n      service: string;\n      operation: string;\n    };\n    const path = `/service/${service}/operation/${operation}`;\n    if (request.path.endsWith(\"/\")) {\n      request.path += path.slice(1);\n    } else {\n      request.path += path;\n    }\n    return request;\n  }\n\n  public async deserializeResponse<Output extends MetadataBearer>(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse\n  ): Promise<Output> {\n    return super.deserializeResponse<Output>(operationSchema, context, response);\n  }\n\n  protected async handleError(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    dataObject: any,\n    metadata: ResponseMetadata\n  ): Promise<never> {\n    const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? \"Unknown\";\n\n    const errorMetadata = {\n      $metadata: metadata,\n      $fault: response.statusCode <= 500 ? (\"client\" as const) : (\"server\" as const),\n    };\n\n    let namespace = this.options.defaultNamespace;\n    if (errorName.includes(\"#\")) {\n      [namespace] = errorName.split(\"#\");\n    }\n\n    const registry = this.compositeErrorRegistry;\n\n    const nsRegistry = TypeRegistry.for(namespace);\n    // Composition required for backwards compatibility.\n    // Previous generated clients did not export errorTypeRegistries.\n    registry.copyFrom(nsRegistry);\n\n    let errorSchema: StaticErrorSchema;\n    try {\n      errorSchema = registry.getSchema(errorName) as StaticErrorSchema;\n    } catch (e) {\n      if (dataObject.Message) {\n        dataObject.message = dataObject.Message;\n      }\n      const syntheticRegistry = TypeRegistry.for(\"smithy.ts.sdk.synthetic.\" + namespace);\n      // Composition required for backwards compatibility.\n      // Previous generated clients did not export errorTypeRegistries.\n      registry.copyFrom(syntheticRegistry);\n\n      const baseExceptionSchema = registry.getBaseException();\n      if (baseExceptionSchema) {\n        const ErrorCtor = registry.getErrorCtor(baseExceptionSchema);\n        throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);\n      }\n      throw Object.assign(new Error(errorName), errorMetadata, dataObject);\n    }\n\n    const ns = NormalizedSchema.of(errorSchema);\n    const ErrorCtor = registry.getErrorCtor(errorSchema);\n    const message = dataObject.message ?? dataObject.Message ?? \"Unknown\";\n    const exception = new ErrorCtor({});\n\n    const output = {} as any;\n    for (const [name, member] of ns.structIterator()) {\n      output[name] = this.deserializer.readValue(member, dataObject[name]);\n    }\n\n    throw Object.assign(\n      exception,\n      errorMetadata,\n      {\n        $fault: ns.getMergedTraits().error,\n        message,\n      },\n      output\n    );\n  }\n\n  protected getDefaultContentType(): string {\n    return \"application/cbor\";\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/byte-printer.ts",
    "content": "/**\n * Prints bytes as binary string with numbers.\n * @param bytes - to print.\n * @deprecated for testing only, do not use in runtime.\n */\nexport function printBytes(bytes: Uint8Array) {\n  return [...bytes].map((n) => {\n    const pad = (num: number) => (\"0\".repeat(8) + num.toString(2)).slice(-8);\n    const b = pad(n);\n    const [maj, min] = [b.slice(0, 3), b.slice(3)];\n\n    let dmaj: string = \"\";\n\n    switch (maj) {\n      case \"000\":\n        dmaj = \"0 - Uint64\";\n        break;\n      case \"001\":\n        dmaj = \"1 - Neg Uint64\";\n        break;\n      case \"010\":\n        dmaj = \"2 - unstructured bytestring\";\n        break;\n      case \"011\":\n        dmaj = \"3 - utf8 string\";\n        break;\n      case \"100\":\n        dmaj = \"4 - list\";\n        break;\n      case \"101\":\n        dmaj = \"5 - map\";\n        break;\n      case \"110\":\n        dmaj = \"6 - tag\";\n        break;\n      case \"111\":\n        dmaj = \"7 - special\";\n        break;\n      default:\n        dmaj = String(parseInt(maj, 2));\n    }\n\n    return `${maj}_${min} (${dmaj}, ${parseInt(min, 2)})`;\n  });\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/cbor-decode.ts",
    "content": "import { nv, toUtf8 } from \"@smithy/core/serde\";\n\nimport {\n  alloc,\n  extendedFloat16,\n  extendedFloat32,\n  extendedFloat64,\n  extendedOneByte,\n  majorList,\n  majorMap,\n  majorNegativeInt64,\n  majorTag,\n  majorUint64,\n  majorUnstructuredByteString,\n  majorUtf8String,\n  minorIndefinite,\n  specialFalse,\n  specialNull,\n  specialTrue,\n  specialUndefined,\n  tag,\n  type CborArgumentLength,\n  type CborArgumentLengthOffset,\n  type CborListType,\n  type CborMapType,\n  type CborOffset,\n  type CborUnstructuredByteStringType,\n  type CborValueType,\n  type Float32,\n  type Uint8,\n  type Uint32,\n  type Uint64,\n} from \"./cbor-types\";\n\nconst USE_TEXT_DECODER = typeof TextDecoder !== \"undefined\";\nconst USE_BUFFER = typeof Buffer !== \"undefined\";\n\nlet payload = alloc(0);\nlet dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);\nconst textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null;\n\n/**\n * This number stores the last offset of any decoded segment.\n */\nlet _offset: CborOffset = 0;\n\n/**\n * Sets the decode bytearray source and its data view.\n *\n * @internal\n * @param bytes - to be set as the decode source.\n */\nexport function setPayload(bytes: Uint8Array) {\n  payload = bytes;\n  dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);\n}\n\n/**\n * Decodes the data between the two indices.\n *\n * @internal\n */\nexport function decode(at: Uint32, to: Uint32): CborValueType {\n  if (at >= to) {\n    throw new Error(\"unexpected end of (decode) payload.\");\n  }\n\n  const major = (payload[at] & 0b1110_0000) >> 5;\n  const minor = payload[at] & 0b0001_1111;\n\n  switch (major) {\n    case majorUint64:\n    case majorNegativeInt64:\n    case majorTag:\n      let unsignedInt: number | Uint64;\n      let offset: number;\n\n      if (minor < 24) {\n        unsignedInt = minor;\n        offset = 1;\n      } else {\n        switch (minor) {\n          case extendedOneByte:\n          case extendedFloat16:\n          case extendedFloat32:\n          case extendedFloat64:\n            const countLength: CborArgumentLength = minorValueToArgumentLength[minor];\n            const countOffset = (countLength + 1) as CborArgumentLengthOffset;\n            offset = countOffset;\n\n            if (to - at < countOffset) {\n              throw new Error(`countLength ${countLength} greater than remaining buf len.`);\n            }\n            const countIndex = at + 1;\n            if (countLength === 1) {\n              unsignedInt = payload[countIndex];\n            } else if (countLength === 2) {\n              unsignedInt = dataView.getUint16(countIndex);\n            } else if (countLength === 4) {\n              unsignedInt = dataView.getUint32(countIndex);\n            } else {\n              unsignedInt = dataView.getBigUint64(countIndex);\n            }\n            break;\n          default:\n            throw new Error(`unexpected minor value ${minor}.`);\n        }\n      }\n\n      if (major === majorUint64) {\n        _offset = offset;\n        return castBigInt(unsignedInt);\n      } else if (major === majorNegativeInt64) {\n        let negativeInt: bigint | number;\n        if (typeof unsignedInt === \"bigint\") {\n          negativeInt = BigInt(-1) - unsignedInt;\n        } else {\n          negativeInt = -1 - unsignedInt;\n        }\n        _offset = offset;\n        return castBigInt(negativeInt);\n      } else {\n        /* major === majorTag */\n        if (minor === 2 || minor === 3) {\n          const length = decodeCount(at + offset, to);\n\n          let b = BigInt(0);\n          const start = at + offset + _offset;\n          for (let i = start; i < start + length; ++i) {\n            b = (b << BigInt(8)) | BigInt(payload[i]);\n          }\n          // the new offset is the sum of:\n          // 1. the local major offset (1)\n          // 2. the offset of the decoded count of the bigInteger\n          // 3. the length of the data bytes of the bigInteger\n          _offset = offset + _offset + length;\n          return minor === 3 ? -b - BigInt(1) : b;\n        } else if (minor === 4) {\n          const decimalFraction = decode(at + offset, to);\n          const [exponent, mantissa] = decimalFraction;\n          const normalizer = mantissa < 0 ? -1 : 1;\n          const mantissaStr = \"0\".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa));\n\n          let numericString: string;\n          const sign = mantissa < 0 ? \"-\" : \"\";\n\n          numericString =\n            exponent === 0\n              ? mantissaStr\n              : mantissaStr.slice(0, mantissaStr.length + exponent) + \".\" + mantissaStr.slice(exponent);\n          numericString = numericString.replace(/^0+/g, \"\");\n          if (numericString === \"\") {\n            numericString = \"0\";\n          }\n          if (numericString[0] === \".\") {\n            numericString = \"0\" + numericString;\n          }\n          numericString = sign + numericString;\n\n          // the new offset is the sum of:\n          // 1. the local major offset (1)\n          // 2. the offset of the decoded exponent mantissa pair\n          _offset = offset + _offset;\n          return nv(numericString);\n        } else {\n          const value = decode(at + offset, to);\n          const valueOffset = _offset;\n\n          _offset = offset + valueOffset;\n          return tag({ tag: castBigInt(unsignedInt), value });\n        }\n      }\n    case majorUtf8String:\n    case majorMap:\n    case majorList:\n    case majorUnstructuredByteString:\n      if (minor === minorIndefinite) {\n        switch (major) {\n          case majorUtf8String:\n            return decodeUtf8StringIndefinite(at, to);\n          case majorMap:\n            return decodeMapIndefinite(at, to);\n          case majorList:\n            return decodeListIndefinite(at, to);\n          case majorUnstructuredByteString:\n            return decodeUnstructuredByteStringIndefinite(at, to);\n        }\n      } else {\n        switch (major) {\n          case majorUtf8String:\n            return decodeUtf8String(at, to);\n          case majorMap:\n            return decodeMap(at, to);\n          case majorList:\n            return decodeList(at, to);\n          case majorUnstructuredByteString:\n            return decodeUnstructuredByteString(at, to);\n        }\n      }\n    default:\n      return decodeSpecial(at, to);\n  }\n}\n\nfunction bytesToUtf8(bytes: Uint8Array, at: number, to: number): string {\n  if (USE_BUFFER && bytes.constructor?.name === \"Buffer\") {\n    return (bytes as Buffer).toString(\"utf-8\", at, to);\n  }\n  if (textDecoder) {\n    return textDecoder!.decode(bytes.subarray(at, to));\n  }\n  return toUtf8(bytes.subarray(at, to));\n}\n\nfunction demote(bigInteger: bigint): number {\n  // cast is safe for string and array lengths, which do not\n  // exceed safe integer range.\n  const num = Number(bigInteger);\n  if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) {\n    console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`));\n  }\n  return num;\n}\n\nconst minorValueToArgumentLength = {\n  [extendedOneByte]: 1,\n  [extendedFloat16]: 2,\n  [extendedFloat32]: 4,\n  [extendedFloat64]: 8,\n} as const;\n\n/**\n * @internal\n */\nexport function bytesToFloat16(a: Uint8, b: Uint8): Float32 {\n  const sign = a >> 7;\n  const exponent = (a & 0b0111_1100) >> 2;\n  const fraction = ((a & 0b0000_0011) << 8) | b;\n\n  const scalar = sign === 0 ? 1 : -1;\n\n  let exponentComponent: number;\n  let summation: number;\n\n  if (exponent === 0b00000) {\n    if (fraction === 0b00000_00000) {\n      return 0;\n    } else {\n      exponentComponent = Math.pow(2, 1 - 15);\n      summation = 0;\n    }\n  } else if (exponent === 0b11111) {\n    if (fraction === 0b00000_00000) {\n      return scalar * Infinity;\n    } else {\n      return NaN;\n    }\n  } else {\n    exponentComponent = Math.pow(2, exponent - 15);\n    summation = 1;\n  }\n\n  summation += fraction / 1024;\n  return scalar * (exponentComponent * summation);\n}\n\nfunction decodeCount(at: Uint32, to: Uint32): number {\n  const minor = payload[at] & 0b0001_1111;\n\n  if (minor < 24) {\n    _offset = 1;\n    return minor;\n  }\n\n  if (\n    minor === extendedOneByte ||\n    minor === extendedFloat16 ||\n    minor === extendedFloat32 ||\n    minor === extendedFloat64\n  ) {\n    const countLength: CborArgumentLength = minorValueToArgumentLength[minor];\n    _offset = (countLength + 1) as CborArgumentLengthOffset;\n    if (to - at < _offset) {\n      throw new Error(`countLength ${countLength} greater than remaining buf len.`);\n    }\n    const countIndex = at + 1;\n\n    if (countLength === 1) {\n      return payload[countIndex];\n    } else if (countLength === 2) {\n      return dataView.getUint16(countIndex);\n    } else if (countLength === 4) {\n      return dataView.getUint32(countIndex);\n    }\n    return demote(dataView.getBigUint64(countIndex));\n  }\n\n  throw new Error(`unexpected minor value ${minor}.`);\n}\n\nfunction decodeUtf8String(at: Uint32, to: Uint32): string {\n  const length = decodeCount(at, to);\n  const offset = _offset;\n  at += offset;\n  if (to - at < length) {\n    throw new Error(`string len ${length} greater than remaining buf len.`);\n  }\n  const value = bytesToUtf8(payload, at, at + length);\n  _offset = offset + length;\n  return value;\n}\n\nfunction decodeUtf8StringIndefinite(at: Uint32, to: Uint32): string {\n  at += 1;\n  const vector = [];\n  for (const base = at; at < to; ) {\n    if (payload[at] === 0b1111_1111) {\n      const data = alloc(vector.length);\n      data.set(vector, 0);\n      _offset = at - base + 2;\n      return bytesToUtf8(data, 0, data.length);\n    }\n    const major = (payload[at] & 0b1110_0000) >> 5;\n    const minor = payload[at] & 0b0001_1111;\n    if (major !== majorUtf8String) {\n      throw new Error(`unexpected major type ${major} in indefinite string.`);\n    }\n    if (minor === minorIndefinite) {\n      throw new Error(\"nested indefinite string.\");\n    }\n    const bytes = decodeUnstructuredByteString(at, to);\n    const length = _offset;\n    at += length;\n    for (let i = 0; i < bytes.length; ++i) {\n      vector.push(bytes[i]);\n    }\n  }\n  throw new Error(\"expected break marker.\");\n}\n\nfunction decodeUnstructuredByteString(at: Uint32, to: Uint32): CborUnstructuredByteStringType {\n  const length = decodeCount(at, to);\n  const offset = _offset;\n\n  at += offset;\n  if (to - at < length) {\n    throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`);\n  }\n\n  const value = payload.subarray(at, at + length);\n  _offset = offset + length;\n  return value;\n}\n\nfunction decodeUnstructuredByteStringIndefinite(at: Uint32, to: Uint32): CborUnstructuredByteStringType {\n  at += 1;\n  const vector = [];\n\n  for (const base = at; at < to; ) {\n    if (payload[at] === 0b1111_1111) {\n      const data = alloc(vector.length);\n      data.set(vector, 0);\n      _offset = at - base + 2;\n      return data;\n    }\n\n    const major = (payload[at] & 0b1110_0000) >> 5;\n    const minor = payload[at] & 0b0001_1111;\n    if (major !== majorUnstructuredByteString) {\n      throw new Error(`unexpected major type ${major} in indefinite string.`);\n    }\n    if (minor === minorIndefinite) {\n      throw new Error(\"nested indefinite string.\");\n    }\n\n    const bytes = decodeUnstructuredByteString(at, to);\n    const length = _offset;\n    at += length;\n    for (let i = 0; i < bytes.length; ++i) {\n      vector.push(bytes[i]);\n    }\n  }\n  throw new Error(\"expected break marker.\");\n}\n\nfunction decodeList(at: Uint32, to: Uint32): CborListType {\n  const listDataLength = decodeCount(at, to);\n  const offset = _offset;\n  at += offset;\n  const base = at;\n  // perf: pre-allocate array length.\n  const list = Array(listDataLength);\n  for (let i = 0; i < listDataLength; ++i) {\n    const item = decode(at, to);\n    const itemOffset = _offset;\n    list[i] = item;\n    at += itemOffset;\n  }\n  _offset = offset + (at - base);\n  return list;\n}\n\nfunction decodeListIndefinite(at: Uint32, to: Uint32): CborListType {\n  at += 1;\n  const list = [] as CborListType;\n  for (const base = at; at < to; ) {\n    if (payload[at] === 0b1111_1111) {\n      _offset = at - base + 2;\n      return list;\n    }\n    const item = decode(at, to);\n    const n = _offset;\n    at += n;\n    list.push(item);\n  }\n  throw new Error(\"expected break marker.\");\n}\n\nfunction decodeMap(at: Uint32, to: Uint32): CborMapType {\n  const mapDataLength = decodeCount(at, to);\n  const offset = _offset;\n  at += offset;\n  const base = at;\n  const map = {} as CborMapType;\n  for (let i = 0; i < mapDataLength; ++i) {\n    if (at >= to) {\n      throw new Error(\"unexpected end of map payload.\");\n    }\n    const major = (payload[at] & 0b1110_0000) >> 5;\n    if (major !== majorUtf8String) {\n      throw new Error(`unexpected major type ${major} for map key at index ${at}.`);\n    }\n    const key = decode(at, to);\n    at += _offset;\n    const value = decode(at, to);\n    at += _offset;\n    map[key] = value;\n  }\n  _offset = offset + (at - base);\n  return map;\n}\n\nfunction decodeMapIndefinite(at: Uint32, to: Uint32): CborMapType {\n  at += 1;\n  const base = at;\n  const map = {} as CborMapType;\n  for (; at < to; ) {\n    if (at >= to) {\n      throw new Error(\"unexpected end of map payload.\");\n    }\n    if (payload[at] === 0b1111_1111) {\n      _offset = at - base + 2;\n      return map;\n    }\n    const major = (payload[at] & 0b1110_0000) >> 5;\n    if (major !== majorUtf8String) {\n      throw new Error(`unexpected major type ${major} for map key.`);\n    }\n    const key = decode(at, to);\n    at += _offset;\n    const value = decode(at, to);\n    at += _offset;\n    map[key] = value;\n  }\n  throw new Error(\"expected break marker.\");\n}\n\nfunction decodeSpecial(at: Uint32, to: Uint32): CborValueType {\n  const minor = payload[at] & 0b0001_1111;\n  switch (minor) {\n    case specialTrue:\n    case specialFalse:\n      _offset = 1;\n      return minor === specialTrue;\n    case specialNull:\n      _offset = 1;\n      return null;\n    case specialUndefined:\n      // Note: the Smithy spec requires that undefined is\n      // instead deserialized to null.\n      _offset = 1;\n      return null;\n    case extendedFloat16:\n      if (to - at < 3) {\n        throw new Error(\"incomplete float16 at end of buf.\");\n      }\n      _offset = 3;\n      return bytesToFloat16(payload[at + 1], payload[at + 2]);\n    case extendedFloat32:\n      if (to - at < 5) {\n        throw new Error(\"incomplete float32 at end of buf.\");\n      }\n      _offset = 5;\n      return dataView.getFloat32(at + 1);\n    case extendedFloat64:\n      if (to - at < 9) {\n        throw new Error(\"incomplete float64 at end of buf.\");\n      }\n      _offset = 9;\n      return dataView.getFloat64(at + 1);\n    default:\n      throw new Error(`unexpected minor value ${minor}.`);\n  }\n}\n\nfunction castBigInt(bigInt: bigint | number): number | bigint {\n  if (typeof bigInt === \"number\") {\n    return bigInt;\n  }\n  const num = Number(bigInt);\n  if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) {\n    return num;\n  }\n  return bigInt;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/cbor-encode.ts",
    "content": "import { NumericValue, fromUtf8 } from \"@smithy/core/serde\";\n\nimport {\n  alloc,\n  extendedFloat16,\n  extendedFloat32,\n  extendedFloat64,\n  majorList,\n  majorMap,\n  majorNegativeInt64,\n  majorSpecial,\n  majorTag,\n  majorUint64,\n  majorUnstructuredByteString,\n  majorUtf8String,\n  specialFalse,\n  specialNull,\n  specialTrue,\n  tagSymbol,\n  type CborMajorType,\n  type Uint64,\n} from \"./cbor-types\";\n\nconst USE_BUFFER = typeof Buffer !== \"undefined\";\n\nconst initialSize = 2048;\nlet data: Uint8Array = alloc(initialSize);\nlet dataView: DataView = new DataView(data.buffer, data.byteOffset, data.byteLength);\nlet cursor: number = 0;\n\nfunction ensureSpace(bytes: number) {\n  const remaining = data.byteLength - cursor;\n  if (remaining < bytes) {\n    if (cursor < 16_000_000) {\n      resize(Math.max(data.byteLength * 4, data.byteLength + bytes));\n    } else {\n      resize(data.byteLength + bytes + 16_000_000);\n    }\n  }\n}\n\n/**\n * @internal\n */\nexport function toUint8Array(): Uint8Array {\n  const out = alloc(cursor);\n  out.set(data.subarray(0, cursor), 0);\n  cursor = 0;\n  return out;\n}\n\nexport function resize(size: number) {\n  const old = data;\n  data = alloc(size);\n  if (old) {\n    if ((old as Buffer).copy) {\n      (old as Buffer).copy(data, 0, 0, old.byteLength);\n    } else {\n      data.set(old, 0);\n    }\n  }\n  dataView = new DataView(data.buffer, data.byteOffset, data.byteLength);\n}\n\nfunction encodeHeader(major: CborMajorType, value: Uint64 | number): void {\n  if (value < 24) {\n    data[cursor++] = (major << 5) | (value as number);\n  } else if (value < 1 << 8) {\n    data[cursor++] = (major << 5) | 24;\n    data[cursor++] = value as number;\n  } else if (value < 1 << 16) {\n    data[cursor++] = (major << 5) | extendedFloat16;\n    dataView.setUint16(cursor, value as number);\n    cursor += 2;\n  } else if (value < 2 ** 32) {\n    data[cursor++] = (major << 5) | extendedFloat32;\n    dataView.setUint32(cursor, value as number);\n    cursor += 4;\n  } else {\n    data[cursor++] = (major << 5) | extendedFloat64;\n    dataView.setBigUint64(cursor, typeof value === \"bigint\" ? value : BigInt(value));\n    cursor += 8;\n  }\n}\n\n/**\n * @param _input - JS data object.\n */\nexport function encode(_input: any): void {\n  const encodeStack = [_input];\n\n  while (encodeStack.length) {\n    const input = encodeStack.pop();\n\n    ensureSpace(typeof input === \"string\" ? input.length * 4 : 64);\n\n    if (typeof input === \"string\") {\n      if (USE_BUFFER) {\n        encodeHeader(majorUtf8String, Buffer.byteLength(input));\n        cursor += (data as Buffer).write(input, cursor);\n      } else {\n        const bytes = fromUtf8(input);\n        encodeHeader(majorUtf8String, bytes.byteLength);\n        data.set(bytes, cursor);\n        cursor += bytes.byteLength;\n      }\n      continue;\n    } else if (typeof input === \"number\") {\n      if (Number.isInteger(input)) {\n        const nonNegative = input >= 0;\n        const major = nonNegative ? majorUint64 : majorNegativeInt64;\n        const value = nonNegative ? input : -input - 1;\n        if (value < 24) {\n          data[cursor++] = (major << 5) | value;\n        } else if (value < 256 /* 2 ** 8 */) {\n          data[cursor++] = (major << 5) | 24;\n          data[cursor++] = value;\n        } else if (value < 65536 /* 2 ** 16 */) {\n          data[cursor++] = (major << 5) | extendedFloat16;\n          data[cursor++] = (value as number) >> 8;\n          data[cursor++] = value as number & 0b1111_1111;\n        } else if (value < 4294967296 /* 2 ** 32 */) {\n          data[cursor++] = (major << 5) | extendedFloat32;\n          dataView.setUint32(cursor, value);\n          cursor += 4;\n        } else {\n          data[cursor++] = (major << 5) | extendedFloat64;\n          dataView.setBigUint64(cursor, BigInt(value));\n          cursor += 8;\n        }\n        continue;\n      }\n      data[cursor++] = (majorSpecial << 5) | extendedFloat64;\n      dataView.setFloat64(cursor, input);\n      cursor += 8;\n      continue;\n    } else if (typeof input === \"bigint\") {\n      const nonNegative = input >= 0;\n      const major = nonNegative ? majorUint64 : majorNegativeInt64;\n      const value = nonNegative ? input : -input - BigInt(1);\n      const n = Number(value);\n      if (n < 24) {\n        data[cursor++] = (major << 5) | n;\n      } else if (n < 256 /* 2 ** 8 */) {\n        data[cursor++] = (major << 5) | 24;\n        data[cursor++] = n;\n      } else if (n < 65536 /* 2 ** 16 */) {\n        data[cursor++] = (major << 5) | extendedFloat16;\n        data[cursor++] = n >> 8;\n        data[cursor++] = n & 0b1111_1111;\n      } else if (n < 4294967296 /* 2 ** 32 */) {\n        data[cursor++] = (major << 5) | extendedFloat32;\n        dataView.setUint32(cursor, n);\n        cursor += 4;\n      } else if (value < BigInt(\"18446744073709551616\")) {\n        data[cursor++] = (major << 5) | extendedFloat64;\n        dataView.setBigUint64(cursor, value);\n        cursor += 8;\n      } else {\n        // refer to https://www.rfc-editor.org/rfc/rfc8949.html#name-bignums\n        const binaryBigInt = value.toString(2);\n        const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8));\n        let b = value;\n        let i = 0;\n        while (bigIntBytes.byteLength - ++i >= 0) {\n          bigIntBytes[bigIntBytes.byteLength - i] = Number(b & BigInt(255));\n          b >>= BigInt(8);\n        }\n        ensureSpace(bigIntBytes.byteLength * 2);\n        data[cursor++] = nonNegative ? 0b110_00010 : 0b110_00011;\n\n        if (USE_BUFFER) {\n          encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes));\n        } else {\n          encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength);\n        }\n        data.set(bigIntBytes, cursor);\n        cursor += bigIntBytes.byteLength;\n      }\n      continue;\n    } else if (input === null) {\n      data[cursor++] = (majorSpecial << 5) | specialNull;\n      continue;\n    } else if (typeof input === \"boolean\") {\n      data[cursor++] = (majorSpecial << 5) | (input ? specialTrue : specialFalse);\n      continue;\n    } else if (typeof input === \"undefined\") {\n      // Note: Smithy spec requires that undefined not be serialized\n      // though the CBOR spec includes it.\n      throw new Error(\"@smithy/core/cbor: client may not serialize undefined value.\");\n    } else if (Array.isArray(input)) {\n      for (let i = input.length - 1; i >= 0; --i) {\n        encodeStack.push(input[i]);\n      }\n      encodeHeader(majorList, input.length);\n      continue;\n    } else if (typeof input.byteLength === \"number\") {\n      ensureSpace(input.length * 2);\n      encodeHeader(majorUnstructuredByteString, input.length);\n      data.set(input, cursor);\n      cursor += input.byteLength;\n      continue;\n    } else if (typeof input === \"object\") {\n      if (input instanceof NumericValue) {\n        const decimalIndex = input.string.indexOf(\".\");\n        const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;\n        const mantissa = BigInt(input.string.replace(\".\", \"\"));\n\n        data[cursor++] = 0b110_00100; // major 6, tag 4.\n\n        encodeStack.push(mantissa);\n        encodeStack.push(exponent);\n        encodeHeader(majorList, 2);\n        continue;\n      }\n      if (input[tagSymbol]) {\n        if (\"tag\" in input && \"value\" in input) {\n          encodeStack.push(input.value);\n          encodeHeader(majorTag, input.tag);\n          continue;\n        } else {\n          throw new Error(\n            \"tag encountered with missing fields, need 'tag' and 'value', found: \" + JSON.stringify(input)\n          );\n        }\n      }\n      const keys = Object.keys(input);\n      for (let i = keys.length - 1; i >= 0; --i) {\n        const key = keys[i];\n        encodeStack.push(input[key]);\n        encodeStack.push(key);\n      }\n      encodeHeader(majorMap, keys.length);\n      continue;\n    }\n\n    throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/cbor-types.ts",
    "content": "export type CborItemType =\n  | undefined\n  | boolean\n  | number\n  | bigint\n  | [CborUnstructuredByteStringType, Uint64]\n  | string\n  | CborTagType;\n\nexport type CborTagType = {\n  tag: Uint64 | number;\n  value: CborValueType;\n  [tagSymbol]: true;\n};\nexport type CborUnstructuredByteStringType = Uint8Array;\nexport type CborListType<T = any> = Array<T>;\nexport type CborMapType<T = any> = Record<string, T>;\nexport type CborCollectionType<T = any> = CborMapType<T> | CborListType<T>;\n\nexport type CborValueType = CborItemType | CborCollectionType | any;\n\nexport type CborArgumentLength = 1 | 2 | 4 | 8;\nexport type CborArgumentLengthOffset = 1 | 2 | 3 | 5 | 9;\nexport type CborOffset = number;\n\nexport type Uint8 = number;\nexport type Uint32 = number;\nexport type Uint64 = bigint;\nexport type Float32 = number;\n\nexport type Int64 = bigint;\n\nexport type Float16Binary = number;\nexport type Float32Binary = number;\n\nexport type CborMajorType =\n  | typeof majorUint64\n  | typeof majorNegativeInt64\n  | typeof majorUnstructuredByteString\n  | typeof majorUtf8String\n  | typeof majorList\n  | typeof majorMap\n  | typeof majorTag\n  | typeof majorSpecial;\n\nexport const majorUint64 = 0; // 0b000\nexport const majorNegativeInt64 = 1; // 0b001\nexport const majorUnstructuredByteString = 2; // 0b010\nexport const majorUtf8String = 3; // 0b011\nexport const majorList = 4; // 0b100\nexport const majorMap = 5; // 0b101\nexport const majorTag = 6; // 0b110\nexport const majorSpecial = 7; // 0b111\n\nexport const specialFalse = 20; // 0b10100\nexport const specialTrue = 21; // 0b10101\nexport const specialNull = 22; // 0b10110\nexport const specialUndefined = 23; // 0b10111\n\nexport const extendedOneByte = 24; // 0b11000\nexport const extendedFloat16 = 25; // 0b11001\nexport const extendedFloat32 = 26; // 0b11010\nexport const extendedFloat64 = 27; // 0b11011\n\nexport const minorIndefinite = 31; // 0b11111\n\nexport function alloc(size: number): Uint8Array {\n  return typeof Buffer !== \"undefined\" ? Buffer.alloc(size) : new Uint8Array(size);\n}\n\n/**\n * The presence of this symbol as an object key indicates it should be considered a tag\n * for CBOR serialization purposes.\n * The object must also have the properties \"tag\" and \"value\".\n *\n * @public\n */\nexport const tagSymbol = Symbol(\"@smithy/core/cbor::tagSymbol\");\n\n/**\n * Applies the tag symbol to the object.\n *\n * @public\n */\nexport function tag(data: { tag: number | bigint; value: any; [tagSymbol]?: true }): {\n  tag: number | bigint;\n  value: any;\n  [tagSymbol]: true;\n} {\n  data[tagSymbol] = true;\n  return data as typeof data & { [tagSymbol]: true };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/cbor.spec.ts",
    "content": "import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { NumericValue, nv } from \"@smithy/core/serde\";\n// @ts-ignore\nimport JSONbig from \"json-bigint\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { printBytes } from \"./byte-printer\";\nimport { cbor } from \"./cbor\";\nimport { bytesToFloat16 } from \"./cbor-decode\";\nimport { tagSymbol } from \"./cbor-types\";\nimport { dateToTag } from \"./parseCborBody\";\n\n// syntax is ESM but the test target is CJS.\nconst here = __dirname;\n\nconst errorTests = JSONbig({ useNativeBigInt: true, alwaysParseAsBig: false }).parse(\n  fs.readFileSync(path.join(here, \"test-data\", \"decode-error-tests.json\"))\n);\nconst successTests = JSONbig({ useNativeBigInt: true, alwaysParseAsBig: false }).parse(\n  fs.readFileSync(path.join(here, \"test-data\", \"success-tests.json\"))\n);\n\ndescribe(\"cbor\", () => {\n  const allocByteArray = (dataOrSize: ArrayBuffer | ArrayLike<number> | number, offset?: number, length?: number) => {\n    if (typeof offset === \"number\" && typeof length === \"number\") {\n      return typeof Buffer !== \"undefined\"\n        ? Buffer.from(dataOrSize as ArrayBuffer, offset, length)\n        : new Uint8Array(dataOrSize as ArrayBuffer, offset, length);\n    }\n    return typeof Buffer !== \"undefined\" ? Buffer.from(dataOrSize as any) : new Uint8Array(dataOrSize as any);\n  };\n\n  const examples = [\n    {\n      name: \"false\",\n      data: false,\n      // special major 7 = 0b111 plus false(20) = 0b10100\n      cbor: allocByteArray([0b111_10100]),\n    },\n    {\n      name: \"true\",\n      data: true,\n      // increment from false\n      cbor: allocByteArray([0b111_10101]),\n    },\n    {\n      name: \"null\",\n      data: null,\n      // increment from true\n      cbor: allocByteArray([0b111_10110]),\n    },\n    {\n      name: \"an unsigned zero integer\",\n      data: 0,\n      // unsigned int major (0) plus 00's.\n      cbor: allocByteArray([0b000_00000]),\n    },\n    {\n      name: \"negative 1\",\n      data: -1,\n      // negative major (1) plus 00's, since -1 is the first negative number.\n      cbor: allocByteArray([0b001_00000]),\n    },\n    {\n      name: \"a tricky float\",\n      data: [7.624000072479248, 7.624],\n      cbor: allocByteArray([130, 251, 64, 30, 126, 249, 224, 0, 0, 0, 251, 64, 30, 126, 249, 219, 34, 208, 229]),\n    },\n    {\n      name: \"Number.MIN_SAFE_INTEGER\",\n      data: -9007199254740991,\n      cbor: allocByteArray([0b001_11011, 0, 31, 255, 255, 255, 255, 255, 254]),\n    },\n    {\n      name: \"Number.MAX_SAFE_INTEGER\",\n      data: 9007199254740991,\n      cbor: allocByteArray([0b000_11011, 0, 31, 255, 255, 255, 255, 255, 255]),\n    },\n    {\n      name: \"int64 min\",\n      data: BigInt(\"-18446744073709551616\"),\n      cbor: allocByteArray([0b001_11011, 255, 255, 255, 255, 255, 255, 255, 255]),\n    },\n    {\n      name: \"int64 max\",\n      data: BigInt(\"18446744073709551615\"),\n      cbor: allocByteArray([0b000_11011, 255, 255, 255, 255, 255, 255, 255, 255]),\n    },\n    {\n      name: \"negative float\",\n      data: -3015135.135135135,\n      cbor: allocByteArray([0b111_11011, 193, 71, 0, 239, 145, 76, 27, 173]),\n    },\n    {\n      name: \"positive float\",\n      data: 3015135.135135135,\n      cbor: allocByteArray([0b111_11011, 65, 71, 0, 239, 145, 76, 27, 173]),\n    },\n    {\n      name: \"various numbers\",\n      data: [\n        BigInt(\"18446744073709551615\"),\n        4294967295,\n        65535,\n        257,\n        256,\n        255,\n        254,\n        129,\n        128,\n        127,\n        65,\n        64,\n        63,\n        33,\n        32,\n        31,\n        17,\n        16,\n        15,\n        9,\n        8,\n        7,\n        5,\n        4,\n        3,\n        2,\n        1,\n        0,\n        -1,\n        -2,\n        -3,\n        -4,\n        -5,\n        -7,\n        -8,\n        -9,\n        -15,\n        -16,\n        -17,\n        -31,\n        -32,\n        -33,\n        -63,\n        -64,\n        -65,\n        -127,\n        -128,\n        -129,\n        -254,\n        -255,\n        -256,\n        -257,\n        -65535,\n        -4294967295,\n        -BigInt(\"18446744073709551616\"),\n      ],\n      cbor: allocByteArray([\n        152, 55, 27, 255, 255, 255, 255, 255, 255, 255, 255, 26, 255, 255, 255, 255, 25, 255, 255, 25, 1, 1, 25, 1, 0,\n        24, 255, 24, 254, 24, 129, 24, 128, 24, 127, 24, 65, 24, 64, 24, 63, 24, 33, 24, 32, 24, 31, 17, 16, 15, 9, 8,\n        7, 5, 4, 3, 2, 1, 0, 32, 33, 34, 35, 36, 38, 39, 40, 46, 47, 48, 56, 30, 56, 31, 56, 32, 56, 62, 56, 63, 56, 64,\n        56, 126, 56, 127, 56, 128, 56, 253, 56, 254, 56, 255, 57, 1, 0, 57, 255, 254, 58, 255, 255, 255, 254, 59, 255,\n        255, 255, 255, 255, 255, 255, 255,\n      ]),\n    },\n    {\n      name: \"an empty string\",\n      data: \"\",\n      // string major plus 00's\n      cbor: allocByteArray([0b011_00000]),\n    },\n    {\n      name: \"a short string\",\n      data: \"hello, world\",\n      cbor: allocByteArray([108, 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100]),\n    },\n    {\n      name: \"simple object\",\n      data: {\n        message: \"hello, world\",\n      },\n      cbor: allocByteArray([\n        161, 103, 109, 101, 115, 115, 97, 103, 101, 108, 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100,\n      ]),\n    },\n    {\n      name: \"date=0\",\n      data: dateToTag(new Date(0)),\n      // major tag (6 or 110), minor 1 (timestamp)\n      cbor: allocByteArray([0b11000001, 0]),\n    },\n    {\n      name: \"date=turn of the millenium\",\n      data: dateToTag(new Date(946684799999)),\n      // major tag (6 or 110), minor 1 (timestamp)\n      cbor: allocByteArray([0b11000001, 251, 65, 204, 54, 161, 191, 255, 223, 59]),\n    },\n    {\n      name: \"complex object\",\n      data: {\n        number: 135019305913059,\n        message: \"hello, world\",\n        list: [0, false, { a: \"b\" }],\n        map: {\n          a: \"a\",\n          b: \"b\",\n          items: [0, -1, true, false, null, \"\", \"test\", [\"nested item A\", \"nested item B\"]],\n        },\n      },\n      cbor: allocByteArray([\n        164, 102, 110, 117, 109, 98, 101, 114, 27, 0, 0, 122, 204, 161, 196, 74, 227, 103, 109, 101, 115, 115, 97, 103,\n        101, 108, 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 100, 108, 105, 115, 116, 131, 0, 244, 161,\n        97, 97, 97, 98, 99, 109, 97, 112, 163, 97, 97, 97, 97, 97, 98, 97, 98, 101, 105, 116, 101, 109, 115, 136, 0, 32,\n        245, 244, 246, 96, 100, 116, 101, 115, 116, 130, 109, 110, 101, 115, 116, 101, 100, 32, 105, 116, 101, 109, 32,\n        65, 109, 110, 101, 115, 116, 101, 100, 32, 105, 116, 101, 109, 32, 66,\n      ]),\n    },\n    {\n      name: \"object containing big numbers\",\n      data: {\n        map: {\n          items: [BigInt(1e80), BigInt(1e80), nv(\"0.0000000001234000000001234\"), nv(\"0.0000000001234000000001234\")],\n          bigint: BigInt(1e80),\n          bigDecimal: nv(\"0.0000000001234000000001234\"),\n        },\n      },\n      cbor: allocByteArray([\n        161, 99, 109, 97, 112, 163, 101, 105, 116, 101, 109, 115, 132, 194, 88, 34, 3, 95, 157, 234, 62, 31, 107, 224,\n        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 194, 88, 34, 3, 95, 157, 234, 62,\n        31, 107, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 196, 130, 56, 24,\n        27, 0, 4, 98, 81, 3, 167, 36, 210, 196, 130, 56, 24, 27, 0, 4, 98, 81, 3, 167, 36, 210, 102, 98, 105, 103, 105,\n        110, 116, 194, 88, 34, 3, 95, 157, 234, 62, 31, 107, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n        0, 0, 0, 0, 0, 0, 0, 0, 106, 98, 105, 103, 68, 101, 99, 105, 109, 97, 108, 196, 130, 56, 24, 27, 0, 4, 98, 81,\n        3, 167, 36, 210,\n      ]),\n    },\n  ];\n\n  const toBytes = (hex: string) => {\n    const bytes = [] as number[];\n    hex.replace(/../g, (substr: string): string => {\n      bytes.push(parseInt(substr, 16));\n      return substr;\n    });\n    return allocByteArray(bytes);\n  };\n\n  describe(\"locally curated scenarios\", () => {\n    it(\"should round-trip bigInteger to major 6 with tag 2\", () => {\n      const bigInt = BigInt(\"1267650600228229401496703205376\");\n      const serialized = cbor.serialize(bigInt);\n\n      const major = serialized[0] >> 5;\n      expect(major).toEqual(0b110); // 6\n\n      const tag = serialized[0] & 0b11111;\n      expect(tag).toEqual(0b010); // 2\n\n      const byteStringCount = serialized[1];\n      expect(byteStringCount).toEqual(0b010_01101); // major 2, 13 bytes\n\n      const byteString = serialized.slice(2);\n      expect(byteString).toEqual(allocByteArray([0b000_10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]));\n\n      const deserialized = cbor.deserialize(serialized);\n      expect(deserialized).toEqual(bigInt);\n    });\n\n    it(\"should round-trip negative bigInteger to major 6 with tag 3\", () => {\n      const bigInt = BigInt(\"-1267650600228229401496703205377\");\n      const serialized = cbor.serialize(bigInt);\n\n      const major = serialized[0] >> 5;\n      expect(major).toEqual(0b110); // 6\n\n      const tag = serialized[0] & 0b11111;\n      expect(tag).toEqual(0b011); // 3\n\n      const byteStringCount = serialized[1];\n      expect(byteStringCount).toEqual(0b010_01101); // major 2, 13 bytes\n\n      const byteString = serialized.slice(2);\n      expect(byteString).toEqual(allocByteArray([0b000_10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]));\n\n      const deserialized = cbor.deserialize(serialized);\n      expect(deserialized).toEqual(bigInt);\n    });\n\n    it(\"should round-trip NumericValue to major 6 with tag 4\", () => {\n      for (const bigDecimal of [\n        \"10000000000000000000000054.321\",\n        \"1000000000000000000000000000000000054.134134321\",\n        \"100000000000000000000000000000000000054.0000000000000001\",\n        \"100000000000000000000000000000000000054.00510351095130000\",\n        \"-10000000000000000000000054.321\",\n        \"-1000000000000000000000000000000000054.134134321\",\n        \"-100000000000000000000000000000000000054.0000000000000001\",\n        \"-100000000000000000000000000000000000054.00510351095130000\",\n      ]) {\n        const nv = new NumericValue(bigDecimal, \"bigDecimal\");\n        const serialized = cbor.serialize(nv);\n\n        const major = serialized[0] >> 5;\n        expect(major).toEqual(0b110); // 6\n\n        const tag = serialized[0] & 0b11111;\n        expect(tag).toEqual(0b0100); // 4\n\n        const deserialized = cbor.deserialize(serialized);\n        expect(deserialized).toEqual(nv);\n        expect(deserialized.string).toEqual(nv.string);\n      }\n\n      const bigDecimal = nv(\"0\");\n      expect(bigDecimal).toBeInstanceOf(NumericValue);\n      expect(printBytes(cbor.serialize(bigDecimal))).toEqual([\n        \"110_00100 (6 - tag, 4)\",\n        \"100_00010 (4 - list, 2)\",\n        \"000_00000 (0 - Uint64, 0)\",\n        \"000_00000 (0 - Uint64, 0)\",\n      ]);\n    });\n\n    it(\"should round-trip sequences of big numbers\", () => {\n      const sequence = {\n        map: {\n          items1: [\n            BigInt(1e20),\n            BigInt(2e30),\n            BigInt(3e40),\n            BigInt(4e50),\n            BigInt(5e60),\n            BigInt(6e70),\n            BigInt(7e80),\n            BigInt(8e90),\n          ],\n          items2: [\n            nv(\"111.00000000000000000001\"),\n            nv(\"0.000000000000000000002\"),\n            nv(\"333.0000000000000000000003\"),\n            nv(\"0.00000000000000000000004\"),\n            nv(\"-555.000000000000000000000005\"),\n            nv(\"-0.0000000000000000000000006\"),\n            nv(\"-777.00000000000000000000000007\"),\n            nv(\"-0.000000000000000000000000008\"),\n          ],\n          items3: [nv(\"0.0000000001234000000001234\"), nv(\"0.00000000678678001234\"), BigInt(1e20), BigInt(2e30)],\n          items4: [\n            BigInt(1e20),\n            BigInt(2e30),\n            nv(\"0.0000000001234000000001234\"),\n            nv(\"0.0000067867867801234\"),\n            BigInt(1e20),\n            BigInt(2e30),\n            nv(\"0.0000000001234000000001234\"),\n            nv(\"1.000000000123678678678234\"),\n          ],\n          items5: [\n            nv(\"0.0000000001234000000001234\"),\n            nv(\"0.00006786781234678678678\"),\n            BigInt(1e20),\n            BigInt(2e30),\n            nv(\"0.0000000001234000000001234\"),\n            nv(\"0.000000000123400000087678634\"),\n            BigInt(1e20),\n            BigInt(2e30),\n          ],\n          items6: [\n            nv(\"10469069930579305970359073950793057903597035970395069240692049609\"),\n            nv(\"99130490139501395091035901395031950.4928053468045683958609485649280534680456839586094856\"),\n            nv(\"1.000135135000103501305000000000004928053468045683958609485649280534680456839586094856\"),\n            nv(\"1.00013513500010350130500000000000\"),\n            nv(\"0.0000000001234000000001234\"),\n            nv(\"0.0000001\"),\n            nv(\"0.00001\"),\n            nv(\"0.001\"),\n            nv(\"0.000000\"),\n            nv(\"0.0000\"),\n            nv(\"0.00\"),\n            nv(\"0.0\"),\n            nv(\"0\"),\n            nv(\"-0.1\"),\n            nv(\"-0.01\"),\n            nv(\"-0.000000000123400000087678634\"),\n            nv(\"-0.0000000001234000000876786340000000000000000000000000000\"),\n            nv(\"-1.000135135000103501305000000000004928053468045683958609485649280534680456839586094856\"),\n            nv(\"-1.00013513500010350130500000000000\"),\n            nv(\"-100305096350939057390735093.0000000001234000000001234\"),\n            nv(\"-104695047960794069730590793057.0\"),\n            nv(\"-104695047960794069730590793057\"),\n          ],\n        },\n      };\n\n      const serialized = cbor.serialize(sequence);\n      const deserialized = cbor.deserialize(serialized);\n\n      expect(deserialized).toEqual(sequence);\n    });\n\n    it(\"should throw an error if serializing a tag with missing properties\", () => {\n      expect(() =>\n        cbor.serialize({\n          myTag: {\n            [tagSymbol]: true,\n            tag: 1,\n            // value: undefined\n          },\n        })\n      ).toThrowError(\"tag encountered with missing fields, need 'tag' and 'value', found: {\\\"tag\\\":1}\");\n      cbor.resizeEncodingBuffer(0);\n    });\n\n    for (const { name, data, cbor: cbor_representation } of examples) {\n      it(`should encode for ${name}`, async (context) => {\n        if (name === \"object containing big numbers\") {\n          // skip this test, as it fails in vitest 3.x\n          context.skip();\n        }\n        const serialized = cbor.serialize(data);\n        expect(allocByteArray(serialized.buffer, serialized.byteOffset, serialized.byteLength)).toEqual(\n          cbor_representation\n        );\n      });\n\n      it(`should decode for ${name}`, async () => {\n        const deserialized = cbor.deserialize(cbor_representation);\n        expect(deserialized).toEqual(data);\n      });\n    }\n  });\n\n  describe(\"externally curated scenarios\", () => {\n    for (const { description, input, error } of errorTests) {\n      it(description, () => {\n        expect(error).toBe(true);\n        const bytes = toBytes(input);\n        expect(() => {\n          cbor.deserialize(bytes);\n        }).toThrow();\n      });\n    }\n\n    function binaryToFloat32(b: number) {\n      const dv = new DataView(new ArrayBuffer(4));\n      dv.setInt32(0, Number(b));\n      return dv.getFloat32(0);\n    }\n\n    function binaryToFloat64(b: number) {\n      const binaryArray = b.toString(2).split(\"\").map(Number);\n      const pad = Array(64).fill(0);\n      const binary64 = new Uint8Array(pad.concat(binaryArray).slice(-64));\n\n      const sign = binary64[0];\n      const exponent = Number(\"0b\" + Array.from(binary64.subarray(1, 12)).join(\"\"));\n      const fraction = binary64.subarray(12);\n\n      const scalar = (-1) ** sign;\n      let sum = 1;\n      for (let i = 1; i <= 52; ++i) {\n        const position = i - 1;\n        const bit = fraction[position];\n        sum += 2 ** -i * bit;\n      }\n      const exponentScalar = Math.pow(2, exponent - 1023);\n      return scalar * sum * exponentScalar;\n    }\n\n    function translateTestData(data: any): any {\n      const [type, value] = Object.entries(data)[0] as [string, any];\n      switch (type) {\n        case \"null\":\n          return null;\n        case \"uint\":\n        case \"negint\":\n        case \"bool\":\n        case \"string\":\n          return value;\n        case \"float32\":\n          return binaryToFloat32(value);\n        case \"float64\":\n          return binaryToFloat64(value);\n        case \"bytestring\":\n          return allocByteArray(value.map(Number));\n        case \"list\":\n          return value.map(translateTestData);\n        case \"map\":\n          const output = {} as Record<string, any>;\n          for (const [k, v] of Object.entries(value)) {\n            output[k] = translateTestData(v);\n          }\n          return output;\n        case \"tag\":\n          const { id, value: tagValue } = value;\n          return {\n            tag: id,\n            value: translateTestData(tagValue),\n            [tagSymbol]: true,\n          };\n        default:\n          throw new Error(`Unrecognized test scenario <expect> type ${type}.`);\n      }\n    }\n\n    for (const { description, input, expect: _expect } of successTests) {\n      const bytes = toBytes(input);\n      const jsObject = translateTestData(_expect);\n\n      it(`serialization for ${description}`, () => {\n        const serialized = allocByteArray(cbor.serialize(jsObject));\n        const redeserialized = cbor.deserialize(serialized);\n\n        /**\n         * We cannot assert that serialized == bytes,\n         * because there are multiple serializations\n         * that deserialize to the same object.\n         */\n        expect(redeserialized).toEqual(jsObject);\n      });\n      it(`deserialization for ${description}`, () => {\n        const deserialized = cbor.deserialize(bytes);\n        expect(deserialized).toEqual(jsObject);\n      });\n    }\n  });\n});\n\ndescribe(\"bytesToFloat16\", () => {\n  it(\"should convert two bytes to float16\", () => {\n    expect(bytesToFloat16(0b0_10100_00, 0b0101_0000)).toEqual(34.5);\n\n    expect(bytesToFloat16(0b0_00000_00, 0b0000_0000)).toEqual(0.0);\n    expect(bytesToFloat16(0b0_00000_00, 0b0000_0001)).toEqual(5.960464477539063e-8);\n    expect(bytesToFloat16(0b0_00001_00, 0b0000_0000)).toEqual(0.00006103515625);\n\n    expect(bytesToFloat16(0b0_01101_01, 0b0101_0101)).toEqual(0.333251953125);\n    expect(bytesToFloat16(0b0_01110_11, 0b1111_1111)).toEqual(0.99951171875);\n    expect(bytesToFloat16(0b0_01111_00, 0b0000_0000)).toEqual(1.0);\n    expect(bytesToFloat16(0b0_01111_00, 0b0000_0001)).toEqual(1.0009765625);\n    expect(bytesToFloat16(0b0_11110_11, 0b1111_1111)).toEqual(65504.0);\n\n    expect(bytesToFloat16(0b0_11111_00, 0b0000_0000)).toEqual(Infinity);\n    // expect(bytesToFloat16(0b1_00000_00, 0b0000_0000)).toEqual(-0);\n    expect(bytesToFloat16(0b1_10000_00, 0b0000_0000)).toEqual(-2);\n    expect(bytesToFloat16(0b1_11111_00, 0b0000_0000)).toEqual(-Infinity);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/cbor.ts",
    "content": "import { decode, setPayload } from \"./cbor-decode\";\nimport { encode, resize, toUint8Array } from \"./cbor-encode\";\n\n/**\n * This implementation is synchronous and only implements the parts of CBOR\n * specification used by Smithy RPCv2 CBOR protocol.\n *\n * This cbor serde implementation is derived from AWS SDK for Go's implementation.\n * @see https://github.com/aws/smithy-go/tree/main/encoding/cbor\n *\n * The cbor-x implementation was also instructional:\n * @see https://github.com/kriszyp/cbor-x\n */\nexport const cbor = {\n  deserialize(payload: Uint8Array): any {\n    setPayload(payload);\n    return decode(0, payload.length);\n  },\n  serialize(input: any): Uint8Array {\n    try {\n      encode(input);\n      return toUint8Array();\n    } catch (e) {\n      toUint8Array(); // resets cursor.\n      throw e;\n    }\n  },\n  /**\n   * This may be used to garbage collect the CBOR\n   * shared encoding buffer space,\n   * e.g. resizeEncodingBuffer(0);\n   * This may also be used to pre-allocate more space for\n   * CBOR encoding, e.g. resizeEncodingBuffer(100_000_000);\n   *\n   * @public\n   * @param size - byte length to allocate.\n   */\n  resizeEncodingBuffer(size: number) {\n    resize(size);\n  },\n};\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/index.ts",
    "content": "export { cbor } from \"./cbor\";\nexport { tag, tagSymbol } from \"./cbor-types\";\nexport * from \"./parseCborBody\";\nexport * from \"./SmithyRpcV2CborProtocol\";\nexport * from \"./CborCodec\";\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/parseCborBody.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { buildHttpRpcRequest, loadSmithyRpcV2CborErrorCode } from \"./parseCborBody\";\n\ndescribe(\"buildHttpRpcRequest\", () => {\n  it(\"should copy the input headers\", async () => {\n    const headers = {\n      \"content-type\": \"application/cbor\",\n      \"smithy-protocol\": \"rpc-v2-cbor\",\n      accept: \"application/cbor\",\n      \"content-length\": \"0\",\n    };\n\n    const request = await buildHttpRpcRequest(\n      {\n        async endpoint() {\n          return {\n            hostname: \"https://localhost\",\n            path: \"/\",\n          };\n        },\n      } as any,\n      headers,\n      \"/\",\n      \"\",\n      \"\"\n    );\n\n    expect(request.headers).toEqual(headers);\n    expect(request.headers).not.toBe(headers);\n  });\n});\n\ndescribe(loadSmithyRpcV2CborErrorCode.name, () => {\n  it(\"should read the code field case-insensitively\", () => {\n    const code = loadSmithyRpcV2CborErrorCode(\n      { statusCode: 200, headers: {} },\n      {\n        cOdE: \"OhNoException:Sender\",\n      }\n    );\n    expect(code).toEqual(\"OhNoException\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/parseCborBody.ts",
    "content": "import { HttpRequest as __HttpRequest, collectBody } from \"@smithy/core/protocols\";\nimport { calculateBodyLength } from \"@smithy/core/serde\";\nimport type {\n  HttpResponse,\n  SerdeContext,\n  HeaderBag as __HeaderBag,\n  SerdeContext as __SerdeContext,\n} from \"@smithy/types\";\n\nimport { cbor } from \"./cbor\";\nimport { tag, type tagSymbol } from \"./cbor-types\";\n\n/**\n * @internal\n */\nexport const parseCborBody = (streamBody: any, context: SerdeContext): any => {\n  return collectBody(streamBody, context).then(async (bytes) => {\n    if (bytes.length) {\n      try {\n        return cbor.deserialize(bytes);\n      } catch (e: any) {\n        Object.defineProperty(e, \"$responseBodyText\", {\n          value: context.utf8Encoder(bytes),\n        });\n        throw e;\n      }\n    }\n    return {};\n  });\n};\n\n/**\n * @internal\n */\nexport const dateToTag = (date: Date): { tag: number | bigint; value: any; [tagSymbol]: true } => {\n  return tag({\n    tag: 1,\n    value: date.getTime() / 1000,\n  });\n};\n\n/**\n * @internal\n */\nexport const parseCborErrorBody = async (errorBody: any, context: SerdeContext) => {\n  const value = await parseCborBody(errorBody, context);\n  value.message = value.message ?? value.Message;\n  return value;\n};\n\n/**\n * @internal\n */\nexport const loadSmithyRpcV2CborErrorCode = (output: HttpResponse, data: any): string | undefined => {\n  const sanitizeErrorCode = (rawValue: string | number): string => {\n    let cleanValue = rawValue;\n    if (typeof cleanValue === \"number\") {\n      cleanValue = cleanValue.toString();\n    }\n    if (cleanValue.indexOf(\",\") >= 0) {\n      cleanValue = cleanValue.split(\",\")[0];\n    }\n    if (cleanValue.indexOf(\":\") >= 0) {\n      cleanValue = cleanValue.split(\":\")[0];\n    }\n    if (cleanValue.indexOf(\"#\") >= 0) {\n      cleanValue = cleanValue.split(\"#\")[1];\n    }\n    return cleanValue;\n  };\n\n  if (data[\"__type\"] !== undefined) {\n    return sanitizeErrorCode(data[\"__type\"]);\n  }\n\n  let codeKey: string | undefined;\n  for (const key in data) {\n    if (key.toLowerCase() === \"code\") {\n      codeKey = key;\n      break;\n    }\n  }\n  if (codeKey && data[codeKey] !== undefined) {\n    return sanitizeErrorCode(data[codeKey]);\n  }\n};\n\n/**\n * @internal\n */\nexport const checkCborResponse = (response: HttpResponse): void => {\n  if (String(response.headers[\"smithy-protocol\"]).toLowerCase() !== \"rpc-v2-cbor\") {\n    throw new Error(\"Malformed RPCv2 CBOR response, status: \" + response.statusCode);\n  }\n};\n\n/**\n * @internal\n */\nexport const buildHttpRpcRequest = async (\n  context: __SerdeContext,\n  headers: __HeaderBag,\n  path: string,\n  resolvedHostname: string | undefined,\n  body: any\n): Promise<__HttpRequest> => {\n  const endpoint = await context.endpoint();\n  const { hostname, protocol = \"https\", port, path: basePath } = endpoint;\n  const contents: any = {\n    protocol,\n    hostname,\n    port,\n    method: \"POST\",\n    path: basePath.endsWith(\"/\") ? basePath.slice(0, -1) + path : basePath + path,\n    headers: {\n      // intentional copy.\n      ...headers,\n    },\n  };\n  if (resolvedHostname !== undefined) {\n    contents.hostname = resolvedHostname;\n  }\n  if (endpoint.headers) {\n    for (const name in endpoint.headers) {\n      contents.headers[name] = endpoint.headers[name];\n    }\n  }\n  if (body !== undefined) {\n    contents.body = body;\n    try {\n      contents.headers[\"content-length\"] = String(calculateBodyLength(body));\n    } catch (e) {}\n  }\n  return new __HttpRequest(contents);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/test-data/decode-error-tests.json",
    "content": "[\n  {\n    \"description\": \"TestDecode_InvalidArgument - map/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"b900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - tag/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"d8\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - major7/float64 - incomplete float64 at end of buf\",\n    \"input\": \"fb00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - negint/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"3a000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - negint/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"3b00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - string/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"7a000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - map/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"b8\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - map/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"ba000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - tag/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"d900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - uint/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"18\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - string/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"78\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - string/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"7b00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - string/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"7900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - list/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"9900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - slice/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"58\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - slice/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"5a000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - slice/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"5b00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - negint/? - unexpected minor value 31\",\n    \"input\": \"3f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - tag/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"db00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - uint/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"1900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - uint/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"1b00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - negint/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"3900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - negint/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"38\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - list/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"9b00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - tag/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"da000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - major7/float32 - incomplete float32 at end of buf\",\n    \"input\": \"fa000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - uint/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"1a000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - slice/2 - arg len 2 greater than remaining buf len\",\n    \"input\": \"5900\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - list/4 - arg len 4 greater than remaining buf len\",\n    \"input\": \"9a000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - tag/? - unexpected minor value 31\",\n    \"input\": \"df\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - major7/? - unexpected minor value 31\",\n    \"input\": \"ff\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - uint/? - unexpected minor value 31\",\n    \"input\": \"1f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - list/1 - arg len 1 greater than remaining buf len\",\n    \"input\": \"98\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidArgument - map/8 - arg len 8 greater than remaining buf len\",\n    \"input\": \"bb00000000000000\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidList - [] / eof after head - unexpected end of payload\",\n    \"input\": \"81\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidList - [] / invalid item - arg len 1 greater than remaining buf len\",\n    \"input\": \"8118\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidList - [_ ] / no break - expected break marker\",\n    \"input\": \"9f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidList - [_ ] / invalid item - arg len 1 greater than remaining buf len\",\n    \"input\": \"9f18\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidMap - {} / invalid key - slice len 1 greater than remaining buf len\",\n    \"input\": \"a17801\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidMap - {} / invalid value - arg len 1 greater than remaining buf len\",\n    \"input\": \"a163666f6f18\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidMap - {_ } / no break - expected break marker\",\n    \"input\": \"bf\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidMap - {_ } / invalid key - slice len 1 greater than remaining buf len\",\n    \"input\": \"bf7801\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidMap - {_ } / invalid value - arg len 1 greater than remaining buf len\",\n    \"input\": \"bf63666f6f18\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidMap - {} / eof after head - unexpected end of payload\",\n    \"input\": \"a1\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - slice/1, not enough bytes - slice len 1 greater than remaining buf len\",\n    \"input\": \"5801\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - slice/?, nested indefinite - nested indefinite slice\",\n    \"input\": \"5f5f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - string/?, no break - expected break marker\",\n    \"input\": \"7f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - string/?, nested indefinite - nested indefinite slice\",\n    \"input\": \"7f7f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - string/?, invalid nested definite - decode subslice: slice len 1 greater than remaining buf len\",\n    \"input\": \"7f7801\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - slice/?, no break - expected break marker\",\n    \"input\": \"5f\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - slice/?, invalid nested major - unexpected major type 3 in indefinite slice\",\n    \"input\": \"5f60\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - slice/?, invalid nested definite - decode subslice: slice len 1 greater than remaining buf len\",\n    \"input\": \"5f5801\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - string/1, not enough bytes - slice len 1 greater than remaining buf len\",\n    \"input\": \"7801\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidSlice - string/?, invalid nested major - unexpected major type 2 in indefinite slice\",\n    \"input\": \"7f40\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidTag - invalid value - arg len 1 greater than remaining buf len\",\n    \"input\": \"c118\",\n    \"error\": true\n  },\n  {\n    \"description\": \"TestDecode_InvalidTag - eof - unexpected end of payload\",\n    \"input\": \"c1\",\n    \"error\": true\n  }\n]\n"
  },
  {
    "path": "packages/core/src/submodules/cbor/test-data/success-tests.json",
    "content": "[\n  {\n    \"description\": \"atomic - uint/0/max\",\n    \"input\": \"17\",\n    \"expect\": {\n      \"uint\": 23\n    }\n  },\n  {\n    \"description\": \"atomic - uint/2/min\",\n    \"input\": \"190000\",\n    \"expect\": {\n      \"uint\": 0\n    }\n  },\n  {\n    \"description\": \"atomic - uint/8/min\",\n    \"input\": \"1b0000000000000000\",\n    \"expect\": {\n      \"uint\": 0\n    }\n  },\n  {\n    \"description\": \"atomic - negint/1/min\",\n    \"input\": \"3800\",\n    \"expect\": {\n      \"negint\": -1\n    }\n  },\n  {\n    \"description\": \"atomic - negint/2/min\",\n    \"input\": \"390000\",\n    \"expect\": {\n      \"negint\": -1\n    }\n  },\n  {\n    \"description\": \"atomic - false\",\n    \"input\": \"f4\",\n    \"expect\": {\n      \"bool\": false\n    }\n  },\n  {\n    \"description\": \"atomic - uint/1/min\",\n    \"input\": \"1800\",\n    \"expect\": {\n      \"uint\": 0\n    }\n  },\n  {\n    \"description\": \"atomic - negint/8/min\",\n    \"input\": \"3b0000000000000000\",\n    \"expect\": {\n      \"negint\": -1\n    }\n  },\n  {\n    \"description\": \"atomic - float64/+Inf\",\n    \"input\": \"fb7ff0000000000000\",\n    \"expect\": {\n      \"float64\": 9218868437227405312\n    }\n  },\n  {\n    \"description\": \"atomic - uint/4/min\",\n    \"input\": \"1a00000000\",\n    \"expect\": {\n      \"uint\": 0\n    }\n  },\n  {\n    \"description\": \"atomic - null\",\n    \"input\": \"f6\",\n    \"expect\": {\n      \"null\": {}\n    }\n  },\n  {\n    \"description\": \"atomic - negint/2/max\",\n    \"input\": \"39ffff\",\n    \"expect\": {\n      \"negint\": -65536\n    }\n  },\n  {\n    \"description\": \"atomic - negint/8/max\",\n    \"input\": \"3bfffffffffffffffe\",\n    \"expect\": {\n      \"negint\": -18446744073709551615\n    }\n  },\n  {\n    \"description\": \"atomic - float32/1.625\",\n    \"input\": \"fa3fd00000\",\n    \"expect\": {\n      \"float32\": 1070596096\n    }\n  },\n  {\n    \"description\": \"atomic - uint/0/min\",\n    \"input\": \"00\",\n    \"expect\": {\n      \"uint\": 0\n    }\n  },\n  {\n    \"description\": \"atomic - uint/1/max\",\n    \"input\": \"18ff\",\n    \"expect\": {\n      \"uint\": 255\n    }\n  },\n  {\n    \"description\": \"atomic - uint/8/max\",\n    \"input\": \"1bffffffffffffffff\",\n    \"expect\": {\n      \"uint\": 18446744073709551615\n    }\n  },\n  {\n    \"description\": \"atomic - negint/1/max\",\n    \"input\": \"38ff\",\n    \"expect\": {\n      \"negint\": -256\n    }\n  },\n  {\n    \"description\": \"atomic - negint/4/min\",\n    \"input\": \"3a00000000\",\n    \"expect\": {\n      \"negint\": -1\n    }\n  },\n  {\n    \"description\": \"atomic - float64/1.625\",\n    \"input\": \"fb3ffa000000000000\",\n    \"expect\": {\n      \"float64\": 4609997168567123968\n    }\n  },\n  {\n    \"description\": \"atomic - uint/2/max\",\n    \"input\": \"19ffff\",\n    \"expect\": {\n      \"uint\": 65535\n    }\n  },\n  {\n    \"description\": \"atomic - negint/0/max\",\n    \"input\": \"37\",\n    \"expect\": {\n      \"negint\": -24\n    }\n  },\n  {\n    \"description\": \"atomic - negint/4/max\",\n    \"input\": \"3affffffff\",\n    \"expect\": {\n      \"negint\": -4294967296\n    }\n  },\n  {\n    \"description\": \"atomic - uint/4/max\",\n    \"input\": \"1affffffff\",\n    \"expect\": {\n      \"uint\": 4294967295\n    }\n  },\n  {\n    \"description\": \"atomic - negint/0/min\",\n    \"input\": \"20\",\n    \"expect\": {\n      \"negint\": -1\n    }\n  },\n  {\n    \"description\": \"atomic - true\",\n    \"input\": \"f5\",\n    \"expect\": {\n      \"bool\": true\n    }\n  },\n  {\n    \"description\": \"atomic - float32/+Inf\",\n    \"input\": \"fa7f800000\",\n    \"expect\": {\n      \"float32\": 2139095040\n    }\n  },\n  {\n    \"description\": \"definite slice - len = 0\",\n    \"input\": \"40\",\n    \"expect\": {\n      \"bytestring\": []\n    }\n  },\n  {\n    \"description\": \"definite slice - len \\u003e 0\",\n    \"input\": \"43666f6f\",\n    \"expect\": {\n      \"bytestring\": [102, 111, 111]\n    }\n  },\n  {\n    \"description\": \"definite string - len = 0\",\n    \"input\": \"60\",\n    \"expect\": {\n      \"string\": \"\"\n    }\n  },\n  {\n    \"description\": \"definite string - len \\u003e 0\",\n    \"input\": \"63666f6f\",\n    \"expect\": {\n      \"string\": \"foo\"\n    }\n  },\n  {\n    \"description\": \"indefinite slice - len = 0\",\n    \"input\": \"5fff\",\n    \"expect\": {\n      \"bytestring\": []\n    }\n  },\n  {\n    \"description\": \"indefinite slice - len = 0, explicit\",\n    \"input\": \"5f40ff\",\n    \"expect\": {\n      \"bytestring\": []\n    }\n  },\n  {\n    \"description\": \"indefinite slice - len = 0, len \\u003e 0\",\n    \"input\": \"5f4043666f6fff\",\n    \"expect\": {\n      \"bytestring\": [102, 111, 111]\n    }\n  },\n  {\n    \"description\": \"indefinite slice - len \\u003e 0, len = 0\",\n    \"input\": \"5f43666f6f40ff\",\n    \"expect\": {\n      \"bytestring\": [102, 111, 111]\n    }\n  },\n  {\n    \"description\": \"indefinite slice - len \\u003e 0, len \\u003e 0\",\n    \"input\": \"5f43666f6f43666f6fff\",\n    \"expect\": {\n      \"bytestring\": [102, 111, 111, 102, 111, 111]\n    }\n  },\n  {\n    \"description\": \"indefinite string - len = 0\",\n    \"input\": \"7fff\",\n    \"expect\": {\n      \"string\": \"\"\n    }\n  },\n  {\n    \"description\": \"indefinite string - len = 0, explicit\",\n    \"input\": \"7f60ff\",\n    \"expect\": {\n      \"string\": \"\"\n    }\n  },\n  {\n    \"description\": \"indefinite string - len = 0, len \\u003e 0\",\n    \"input\": \"7f6063666f6fff\",\n    \"expect\": {\n      \"string\": \"foo\"\n    }\n  },\n  {\n    \"description\": \"indefinite string - len \\u003e 0, len = 0\",\n    \"input\": \"7f63666f6f60ff\",\n    \"expect\": {\n      \"string\": \"foo\"\n    }\n  },\n  {\n    \"description\": \"indefinite string - len \\u003e 0, len \\u003e 0\",\n    \"input\": \"7f63666f6f63666f6fff\",\n    \"expect\": {\n      \"string\": \"foofoo\"\n    }\n  },\n  {\n    \"description\": \"list - [float64]\",\n    \"input\": \"81fb7ff0000000000000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"float64\": 9218868437227405312\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/4/min]\",\n    \"input\": \"9f3a00000000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/1/min]\",\n    \"input\": \"811800\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/4/min]\",\n    \"input\": \"9f1a00000000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/0/max]\",\n    \"input\": \"8117\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 23\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/1/max]\",\n    \"input\": \"8118ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 255\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/2/min]\",\n    \"input\": \"81390000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/8/min]\",\n    \"input\": \"813b0000000000000000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/2/min]\",\n    \"input\": \"9f190000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/0/min]\",\n    \"input\": \"8100\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/0/min]\",\n    \"input\": \"8120\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/0/max]\",\n    \"input\": \"8137\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -24\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/1/min]\",\n    \"input\": \"813800\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/1/max]\",\n    \"input\": \"8138ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -256\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/4/max]\",\n    \"input\": \"813affffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -4294967296\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/4/max]\",\n    \"input\": \"9f1affffffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 4294967295\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/0/max]\",\n    \"input\": \"9f37ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -24\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/2/min]\",\n    \"input\": \"81190000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ false]\",\n    \"input\": \"9ff4ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"bool\": false\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ float32]\",\n    \"input\": \"9ffa7f800000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"float32\": 2139095040\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/1/max]\",\n    \"input\": \"9f38ffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -256\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/8/max]\",\n    \"input\": \"811bffffffffffffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 18446744073709551615\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/4/min]\",\n    \"input\": \"813a00000000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/8/max]\",\n    \"input\": \"813bfffffffffffffffe\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -18446744073709551615\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/2/min]\",\n    \"input\": \"9f390000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/4/max]\",\n    \"input\": \"9f3affffffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -4294967296\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ true]\",\n    \"input\": \"9ff5ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"bool\": true\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ null]\",\n    \"input\": \"9ff6ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"null\": {}\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/8/min]\",\n    \"input\": \"811b0000000000000000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [null]\",\n    \"input\": \"81f6\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"null\": {}\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/1/min]\",\n    \"input\": \"9f1800ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/1/max]\",\n    \"input\": \"9f18ffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 255\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/2/max]\",\n    \"input\": \"9f19ffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 65535\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/8/min]\",\n    \"input\": \"9f1b0000000000000000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/8/min]\",\n    \"input\": \"9f3b0000000000000000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ float64]\",\n    \"input\": \"9ffb7ff0000000000000ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"float64\": 9218868437227405312\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/4/min]\",\n    \"input\": \"811a00000000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [true]\",\n    \"input\": \"81f5\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"bool\": true\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [float32]\",\n    \"input\": \"81fa7f800000\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"float32\": 2139095040\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/0/min]\",\n    \"input\": \"9f00ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 0\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/0/max]\",\n    \"input\": \"9f17ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 23\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ uint/8/max]\",\n    \"input\": \"9f1bffffffffffffffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 18446744073709551615\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/1/min]\",\n    \"input\": \"9f3800ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/2/max]\",\n    \"input\": \"9f39ffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -65536\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/2/max]\",\n    \"input\": \"8119ffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 65535\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [negint/2/max]\",\n    \"input\": \"8139ffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -65536\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [false]\",\n    \"input\": \"81f4\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"bool\": false\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/0/min]\",\n    \"input\": \"9f20ff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -1\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [_ negint/8/max]\",\n    \"input\": \"9f3bfffffffffffffffeff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"negint\": -18446744073709551615\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"list - [uint/4/max]\",\n    \"input\": \"811affffffff\",\n    \"expect\": {\n      \"list\": [\n        {\n          \"uint\": 4294967295\n        }\n      ]\n    }\n  },\n  {\n    \"description\": \"map - {uint/0/min}\",\n    \"input\": \"a163666f6f00\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/4/max}\",\n    \"input\": \"a163666f6f1affffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 4294967295\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/0/min}\",\n    \"input\": \"a163666f6f20\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ float32}\",\n    \"input\": \"bf63666f6ffa7f800000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"float32\": 2139095040\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {false}\",\n    \"input\": \"a163666f6ff4\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"bool\": false\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {float32}\",\n    \"input\": \"a163666f6ffa7f800000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"float32\": 2139095040\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/0/max}\",\n    \"input\": \"bf63666f6f17ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 23\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/2/min}\",\n    \"input\": \"bf63666f6f390000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ false}\",\n    \"input\": \"bf63666f6ff4ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"bool\": false\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/8/min}\",\n    \"input\": \"a163666f6f1b0000000000000000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/0/max}\",\n    \"input\": \"bf63666f6f37ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -24\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ null}\",\n    \"input\": \"bf63666f6ff6ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"null\": {}\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/1/min}\",\n    \"input\": \"a163666f6f1800\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/1/min}\",\n    \"input\": \"bf63666f6f1800ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/8/max}\",\n    \"input\": \"bf63666f6f1bffffffffffffffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 18446744073709551615\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/0/min}\",\n    \"input\": \"bf63666f6f20ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/1/min}\",\n    \"input\": \"bf63666f6f3800ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/1/max}\",\n    \"input\": \"bf63666f6f38ffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -256\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/2/max}\",\n    \"input\": \"bf63666f6f39ffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -65536\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/4/min}\",\n    \"input\": \"bf63666f6f3a00000000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ true}\",\n    \"input\": \"bf63666f6ff5ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"bool\": true\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/2/max}\",\n    \"input\": \"a163666f6f19ffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 65535\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/8/max}\",\n    \"input\": \"a163666f6f1bffffffffffffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 18446744073709551615\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/0/max}\",\n    \"input\": \"a163666f6f37\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -24\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/1/max}\",\n    \"input\": \"a163666f6f38ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -256\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/2/max}\",\n    \"input\": \"a163666f6f39ffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -65536\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/4/min}\",\n    \"input\": \"a163666f6f3a00000000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/8/max}\",\n    \"input\": \"a163666f6f3bfffffffffffffffe\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -18446744073709551615\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {float64}\",\n    \"input\": \"a163666f6ffb7ff0000000000000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"float64\": 9218868437227405312\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/0/min}\",\n    \"input\": \"bf63666f6f00ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/4/min}\",\n    \"input\": \"bf63666f6f1a00000000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/8/min}\",\n    \"input\": \"bf63666f6f1b0000000000000000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/1/max}\",\n    \"input\": \"a163666f6f18ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 255\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/2/min}\",\n    \"input\": \"a163666f6f390000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/8/min}\",\n    \"input\": \"a163666f6f3b0000000000000000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {true}\",\n    \"input\": \"a163666f6ff5\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"bool\": true\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/2/min}\",\n    \"input\": \"bf63666f6f190000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/8/min}\",\n    \"input\": \"bf63666f6f3b0000000000000000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/8/max}\",\n    \"input\": \"bf63666f6f3bfffffffffffffffeff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -18446744073709551615\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/0/max}\",\n    \"input\": \"a163666f6f17\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 23\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/4/max}\",\n    \"input\": \"a163666f6f3affffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -4294967296\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {null}\",\n    \"input\": \"a163666f6ff6\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"null\": {}\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/4/max}\",\n    \"input\": \"bf63666f6f1affffffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 4294967295\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ float64}\",\n    \"input\": \"bf63666f6ffb7ff0000000000000ff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"float64\": 9218868437227405312\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/2/min}\",\n    \"input\": \"a163666f6f190000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {uint/4/min}\",\n    \"input\": \"a163666f6f1a00000000\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 0\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {negint/1/min}\",\n    \"input\": \"a163666f6f3800\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/1/max}\",\n    \"input\": \"bf63666f6f18ffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 255\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ uint/2/max}\",\n    \"input\": \"bf63666f6f19ffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"uint\": 65535\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"map - {_ negint/4/max}\",\n    \"input\": \"bf63666f6f3affffffffff\",\n    \"expect\": {\n      \"map\": {\n        \"foo\": {\n          \"negint\": -4294967296\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 0/min\",\n    \"input\": \"c001\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 0,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 1/min\",\n    \"input\": \"d80001\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 0,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 1/max\",\n    \"input\": \"d8ff01\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 255,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 4/min\",\n    \"input\": \"da0000000001\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 0,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 8/min\",\n    \"input\": \"db000000000000000001\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 0,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 0/max\",\n    \"input\": \"d701\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 23,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 2/min\",\n    \"input\": \"d9000001\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 0,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 2/max\",\n    \"input\": \"d9ffff01\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 65535,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 4/max\",\n    \"input\": \"daffffffff01\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 4294967295,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  },\n  {\n    \"description\": \"tag - 8/max\",\n    \"input\": \"dbffffffffffffffff01\",\n    \"expect\": {\n      \"tag\": {\n        \"id\": 18446744073709551615,\n        \"value\": {\n          \"uint\": 1\n        }\n      }\n    }\n  }\n]\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/chunked-blob-reader/CHANGELOG.chunked-blob-reader-native.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.3\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-base64@4.3.2\n\n## 4.2.2\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/util-base64@4.3.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/util-base64@4.3.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/util-base64@4.2.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- Updated dependencies [64cda93]\n  - @smithy/util-base64@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-base64@4.0.0\n\n## 3.0.1\n\n### Patch Changes\n\n- c257049: replace FileReader with Blob.arrayBuffer() where possible\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [671aa704]\n  - @smithy/util-base64@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n  - @smithy/util-base64@2.3.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [8e8f3513]\n  - @smithy/util-base64@2.2.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-base64@2.2.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/util-base64@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-base64@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-base64@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-base64@2.0.0\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/util-base64@1.1.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-base64@1.0.2\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-base64@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/chunked-blob-reader-native](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/chunked-blob-reader-native/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/chunked-blob-reader/CHANGELOG.chunked-blob-reader.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 5.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 5.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 5.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 5.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n## 5.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 4.0.0\n\n### Major Changes\n\n- c257049: replace FileReader with Blob.arrayBuffer() where possible\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/chunked-blob-reader](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/chunked-blob-reader/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/chunked-blob-reader/chunked-blob-reader.native.spec.ts",
    "content": "// @vitest-environment happy-dom\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { blobReader } from \"./chunked-blob-reader.native\";\n\ndescribe(\"blobReader\", () => {\n  it(\"reads an entire blob\", async () => {\n    const longMessage: number[] = [];\n    for (let i = 0; i < 1024 * 1024 * 5; i += 4) {\n      longMessage.push(102, 111, 111, 32); // 'foo '\n    }\n    const blob = new Blob([Uint8Array.from(longMessage)]);\n\n    let totalBytes = 0;\n\n    await blobReader(blob, (chunk) => {\n      totalBytes += chunk.byteLength;\n    });\n\n    expect(totalBytes).toBe(1024 * 1024 * 5);\n  });\n\n  it(\"respects the chunk size\", async () => {\n    const message = new Uint8Array(100);\n    message.fill(0);\n\n    const blob = new Blob([message]);\n\n    const chunkSizes: number[] = [];\n\n    await blobReader(\n      blob,\n      (chunk) => {\n        chunkSizes.push(chunk.byteLength);\n      },\n      12 // chunk size in bytes\n    );\n\n    expect(chunkSizes.length).toBe(9);\n\n    for (let i = 0; i < chunkSizes.length; i++) {\n      if (i < chunkSizes.length - 1) {\n        expect(chunkSizes[i]).toBe(12);\n      } else {\n        expect(chunkSizes[i]).toBe(4);\n      }\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/chunked-blob-reader/chunked-blob-reader.native.ts",
    "content": "import { fromBase64 } from \"@smithy/core/serde\";\n\n/**\n * @internal\n */\nexport function blobReader(\n  blob: Blob,\n  onChunk: (chunk: Uint8Array) => void,\n  chunkSize: number = 1024 * 1024\n): Promise<void> {\n  return new Promise((resolve, reject) => {\n    /**\n     * TODO(react-native): https://github.com/facebook/react-native/issues/34402\n     * To drop FileReader in react-native, we need the Blob.arrayBuffer() method to work.\n     */\n    const fileReader = new FileReader();\n\n    fileReader.onerror = reject;\n    fileReader.onabort = reject;\n\n    const size = blob.size;\n    let totalBytesRead = 0;\n\n    const read = () => {\n      if (totalBytesRead >= size) {\n        resolve();\n        return;\n      }\n      fileReader.readAsDataURL(blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize)));\n    };\n\n    fileReader.onload = (event) => {\n      const result = (event.target as any).result;\n      // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n      // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n      const dataOffset = result.indexOf(\",\") + 1;\n      const data = result.substring(dataOffset);\n      const decoded = fromBase64(data);\n      onChunk(decoded);\n      totalBytesRead += decoded.byteLength;\n      // read the next block\n      read();\n    };\n\n    // kick off the read\n    read();\n  });\n}\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/chunked-blob-reader/chunked-blob-reader.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { blobReader } from \"./chunked-blob-reader\";\n\ndescribe(\"blobReader\", () => {\n  it(\"reads an entire blob\", async () => {\n    const longMessage: number[] = [];\n    for (let i = 0; i < 1024 * 1024 * 5; i += 4) {\n      longMessage.push(102, 111, 111, 32); // 'foo '\n    }\n    const blob = new Blob([Uint8Array.from(longMessage)]);\n\n    let totalBytes = 0;\n\n    await blobReader(blob, (chunk) => {\n      totalBytes += chunk.byteLength;\n    });\n\n    expect(totalBytes).toBe(1024 * 1024 * 5);\n  });\n\n  it(\"respects the chunk size\", async () => {\n    const message = new Uint8Array(100);\n    message.fill(0);\n\n    const blob = new Blob([message]);\n\n    const chunkSizes: number[] = [];\n\n    await blobReader(\n      blob,\n      (chunk) => {\n        chunkSizes.push(chunk.byteLength);\n      },\n      12 // chunk size in bytes\n    );\n\n    expect(chunkSizes.length).toBe(9);\n\n    for (let i = 0; i < chunkSizes.length; i++) {\n      if (i < chunkSizes.length - 1) {\n        expect(chunkSizes[i]).toBe(12);\n      } else {\n        expect(chunkSizes[i]).toBe(4);\n      }\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/chunked-blob-reader/chunked-blob-reader.ts",
    "content": "/**\n * Reads the blob data into the onChunk consumer.\n *\n * @internal\n */\nexport async function blobReader(\n  blob: Blob,\n  onChunk: (chunk: Uint8Array) => void,\n  chunkSize: number = 1024 * 1024\n): Promise<void> {\n  const size = blob.size;\n  let totalBytesRead = 0;\n\n  while (totalBytesRead < size) {\n    const slice: Blob = blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize));\n    onChunk(new Uint8Array(await slice.arrayBuffer()));\n    totalBytesRead += slice.size;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-blob-browser/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.15\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.12\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/chunked-blob-reader-native@4.2.3\n  - @smithy/chunked-blob-reader@5.2.2\n\n## 4.2.11\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.10\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/chunked-blob-reader@5.2.1\n  - @smithy/chunked-blob-reader-native@4.2.2\n  - @smithy/types@4.12.1\n\n## 4.2.9\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.1\n\n### Patch Changes\n\n- @smithy/chunked-blob-reader-native@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/chunked-blob-reader@5.2.0\n  - @smithy/chunked-blob-reader-native@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/chunked-blob-reader-native@4.1.0\n  - @smithy/chunked-blob-reader@5.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/chunked-blob-reader-native@4.0.0\n  - @smithy/chunked-blob-reader@5.0.0\n  - @smithy/types@4.0.0\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [c257049]\n- Updated dependencies [84bec05]\n  - @smithy/chunked-blob-reader@4.0.0\n  - @smithy/chunked-blob-reader-native@3.0.1\n  - @smithy/types@3.6.0\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.1.0\n\n### Minor Changes\n\n- 3c23a83b: update versions of @aws-crypto/\\* packages\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/chunked-blob-reader-native@3.0.0\n  - @smithy/chunked-blob-reader@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/chunked-blob-reader-native@2.2.0\n  - @smithy/chunked-blob-reader@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.5\n\n### Patch Changes\n\n- @smithy/chunked-blob-reader-native@2.1.3\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/chunked-blob-reader-native@2.1.2\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/chunked-blob-reader@2.1.1\n  - @smithy/chunked-blob-reader-native@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/chunked-blob-reader-native@2.1.0\n  - @smithy/chunked-blob-reader@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.13\n\n### Patch Changes\n\n- 5598a033: update bundler replacement directives in package.json\n  - @smithy/chunked-blob-reader-native@2.0.1\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/chunked-blob-reader@2.0.0\n  - @smithy/chunked-blob-reader-native@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/chunked-blob-reader@1.1.0\n  - @smithy/chunked-blob-reader-native@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- 99d00e98: Bump webpack to 5.76.0\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- 6eedc3ae: Added missing chunked-blob-reader-native dependency\n- Updated dependencies [6e312329]\n  - @smithy/chunked-blob-reader-native@1.0.2\n  - @smithy/chunked-blob-reader@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/chunked-blob-reader@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/hash-blob-browser](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/hash-blob-browser/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-blob-browser/blobHasher.spec.ts",
    "content": "import { toHex } from \"@smithy/core/serde\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { blobHasher } from \"./blobHasher\";\n\ndescribe(\"blobHasher\", () => {\n  const blob = new Blob([\"test-string\"]);\n\n  class Hash {\n    public value: string = \"\";\n    update(value: string) {\n      this.value = value;\n    }\n    async digest() {\n      return new TextEncoder().encode(this.value);\n    }\n  }\n\n  it(\"calls update and digest of the given Hash class on the blob\", async () => {\n    const result = await blobHasher(Hash, blob);\n\n    expect(result instanceof Uint8Array).toBe(true);\n    expect(toHex(result)).toBe(\"3131362c3130312c3131352c3131362c34352c3131352c3131362c3131342c3130352c3131302c313033\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-blob-browser/blobHasher.ts",
    "content": "import type { ChecksumConstructor, HashConstructor, StreamHasher } from \"@smithy/types\";\n\nimport { blobReader } from \"../chunked-blob-reader/chunked-blob-reader\";\n\n/**\n * @internal\n */\nexport const blobHasher: StreamHasher<Blob> = async function blobHasher(\n  hashCtor: ChecksumConstructor | HashConstructor,\n  blob: Blob\n): Promise<Uint8Array> {\n  const hash = new hashCtor();\n\n  await blobReader(blob, (chunk) => {\n    hash.update(chunk);\n  });\n\n  return hash.digest();\n};\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-utf8@4.2.2\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n  - @smithy/util-utf8@4.2.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n  - @smithy/util-utf8@4.2.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-utf8@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.1.0\n\n### Minor Changes\n\n- 3c23a83b: update versions of @aws-crypto/\\* packages\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/util-utf8@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-utf8@2.2.0\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n  - @smithy/util-utf8@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-utf8@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [f2a04b7e]\n  - @smithy/util-utf8@2.0.2\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-utf8@2.0.1\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-utf8@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n  - @smithy/util-utf8@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-utf8@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-utf8@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/hash-stream-node](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/hash-stream-node/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/HashCalculator.spec.ts",
    "content": "import { toUint8Array } from \"@smithy/core/serde\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { HashCalculator } from \"./HashCalculator\";\n\nfunction createMockHash(): {\n  updates: Uint8Array[];\n  update: (data: Uint8Array) => void;\n  digest: () => Promise<Uint8Array>;\n  reset: () => void;\n} {\n  const mockHash: any = {\n    updates: [] as Uint8Array[],\n  };\n  mockHash.update = (data: Uint8Array) => {\n    mockHash.updates.push(data);\n  };\n  mockHash.digest = async () => {\n    return Uint8Array.from([102, 111, 111]); // foo\n  };\n  mockHash.reset = () => {};\n  return mockHash;\n}\n\ndescribe(\"HashCalculator\", () => {\n  const writePromise = (\n    calculator: HashCalculator,\n    chunk: Buffer,\n    encoding: BufferEncoding = \"utf-8\"\n  ): Promise<void> => {\n    return new Promise((resolve, reject) => {\n      calculator.write(chunk, encoding, (err) => {\n        if (err) {\n          reject(err);\n        } else {\n          resolve();\n        }\n      });\n    });\n  };\n\n  const listOfBuffers: Buffer[] = [Buffer.from(\"foo\"), Buffer.from(\"bar\"), Buffer.from(\"buzz\")];\n\n  it(\"updates a hash from upstream stream\", async () => {\n    const mockHash = createMockHash();\n    const calculator = new HashCalculator(mockHash);\n\n    await writePromise(calculator, listOfBuffers[0]);\n    await writePromise(calculator, listOfBuffers[1]);\n    await writePromise(calculator, listOfBuffers[2]);\n    calculator.end();\n\n    // verify that update was called the correct number of times\n    expect(mockHash.updates.length).toBe(3);\n    expect(mockHash.updates[0]).toEqual(toUint8Array(listOfBuffers[0]));\n    expect(mockHash.updates[1]).toEqual(toUint8Array(listOfBuffers[1]));\n    expect(mockHash.updates[2]).toEqual(toUint8Array(listOfBuffers[2]));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/HashCalculator.ts",
    "content": "import { Writable, type WritableOptions } from \"node:stream\";\nimport { toUint8Array } from \"@smithy/core/serde\";\nimport type { Checksum, Hash } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport class HashCalculator extends Writable {\n  constructor(\n    public readonly hash: Checksum | Hash,\n    options?: WritableOptions\n  ) {\n    super(options);\n  }\n\n  _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void) {\n    try {\n      this.hash.update(toUint8Array(chunk));\n    } catch (err) {\n      return callback(err);\n    }\n    callback();\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/fileStreamHasher.spec.ts",
    "content": "import { createReadStream, mkdtempSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport { Sha256 } from \"@aws-crypto/sha256-js\";\nimport { toHex } from \"@smithy/core/serde\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { fileStreamHasher } from \"./fileStreamHasher\";\n\nfunction createTemporaryFile(contents: string): string {\n  const folder = mkdtempSync(join(tmpdir(), \"sha256-stream-node-\"));\n  const fileLoc = join(folder, \"test.txt\");\n  writeFileSync(fileLoc, contents);\n\n  return fileLoc;\n}\n\ndescribe(\"fileStreamHasher\", () => {\n  const temporaryFile = createTemporaryFile(\n    \"Shot through the bar, but you're too late bizzbuzz you give foo, a bad name.\"\n  );\n\n  it(\"calculates the SHA256 hash of a stream\", async () => {\n    const result = await fileStreamHasher(Sha256, createReadStream(temporaryFile));\n\n    expect(result instanceof Uint8Array).toBe(true);\n    expect(toHex(result)).toBe(\"24dabf4db3774a3224d571d4c089a9c570c3045dbe1e67ee9ee2e2677f57dbe0\");\n  });\n\n  it(\"does not exhaust the input stream\", async () => {\n    const inputStream = createReadStream(temporaryFile);\n\n    const onSpy = vi.spyOn(inputStream, \"on\");\n    const pipeSpy = vi.spyOn(inputStream, \"pipe\");\n\n    const result = await fileStreamHasher(Sha256, inputStream);\n\n    expect(result instanceof Uint8Array).toBe(true);\n    expect(toHex(result)).toBe(\"24dabf4db3774a3224d571d4c089a9c570c3045dbe1e67ee9ee2e2677f57dbe0\");\n    expect(onSpy.mock.calls.length).toBe(0);\n    expect(pipeSpy.mock.calls.length).toBe(0);\n  });\n\n  it(\"throws an error when a non-file stream is encountered\", async () => {\n    const inputStream = new Readable();\n\n    await expect(fileStreamHasher(Sha256, inputStream as any)).rejects.toHaveProperty(\"message\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/fileStreamHasher.ts",
    "content": "import { createReadStream, type ReadStream } from \"node:fs\";\nimport type { Readable } from \"node:stream\";\nimport type { HashConstructor, StreamHasher } from \"@smithy/types\";\n\nimport { HashCalculator } from \"./HashCalculator\";\n\n// ToDo: deprecate in favor of readableStreamHasher\n/**\n * @internal\n */\nexport const fileStreamHasher: StreamHasher<Readable> = (hashCtor: HashConstructor, fileStream: Readable) =>\n  new Promise((resolve, reject) => {\n    if (!isReadStream(fileStream)) {\n      reject(new Error(\"Unable to calculate hash for non-file streams.\"));\n      return;\n    }\n\n    const fileStreamTee = createReadStream(fileStream.path, {\n      start: (fileStream as any).start,\n      end: (fileStream as any).end,\n    });\n\n    const hash = new hashCtor();\n    const hashCalculator = new HashCalculator(hash);\n\n    fileStreamTee.pipe(hashCalculator);\n    fileStreamTee.on(\"error\", (err: any) => {\n      // if the source errors, the destination stream needs to manually end\n      hashCalculator.end();\n      reject(err);\n    });\n    hashCalculator.on(\"error\", reject);\n    hashCalculator.on(\"finish\", function (this: HashCalculator) {\n      hash.digest().then(resolve).catch(reject);\n    });\n  });\n\nconst isReadStream = (stream: Readable): stream is ReadStream => typeof (stream as ReadStream).path === \"string\";\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/readableStreamHasher.spec.ts",
    "content": "import { Readable, Writable } from \"node:stream\";\nimport type { Hash } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { HashCalculator } from \"./HashCalculator\";\nimport { readableStreamHasher } from \"./readableStreamHasher\";\n\nvi.mock(\"./HashCalculator\");\n\ndescribe(readableStreamHasher.name, () => {\n  const mockDigest = vi.fn();\n  const mockHashCtor = vi.fn().mockImplementation(() => ({\n    update: vi.fn(),\n    digest: mockDigest,\n  }));\n\n  const mockHashCalculatorWrite = vi.fn();\n  const mockHashCalculatorEnd = vi.fn();\n\n  const mockHash = new Uint8Array(Buffer.from(\"mockHash\"));\n\n  class MockHashCalculator extends Writable {\n    constructor(\n      public readonly hash: Hash,\n      public readonly mockWrite: any,\n      public readonly mockEnd: any\n    ) {\n      super();\n    }\n\n    _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void) {\n      this.mockWrite(chunk);\n      callback();\n    }\n\n    end() {\n      this.mockEnd();\n      return super.end();\n    }\n  }\n\n  beforeEach(() => {\n    (HashCalculator as unknown as any).mockImplementation(\n      (hash: Hash) => new MockHashCalculator(hash, mockHashCalculatorWrite, mockHashCalculatorEnd)\n    );\n    mockDigest.mockResolvedValue(mockHash);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"computes hash for a readable stream\", async () => {\n    const readableStream = new Readable({ read: () => {} });\n    const hashPromise = readableStreamHasher(mockHashCtor, readableStream);\n\n    // @ts-ignore Property '_readableState' does not exist on type 'Readable'.\n    const { pipesCount } = readableStream._readableState;\n    expect(pipesCount).toEqual(1);\n\n    const mockDataChunks = [\"Hello\", \"World\"];\n    setTimeout(() => {\n      mockDataChunks.forEach((chunk) => readableStream.emit(\"data\", chunk));\n      readableStream.emit(\"end\");\n    }, 100);\n\n    expect(await hashPromise).toEqual(mockHash);\n    expect(mockHashCalculatorWrite).toHaveBeenCalledTimes(mockDataChunks.length);\n    mockDataChunks.forEach((chunk, index) =>\n      expect(mockHashCalculatorWrite).toHaveBeenNthCalledWith(index + 1, Buffer.from(chunk))\n    );\n    expect(mockDigest).toHaveBeenCalledTimes(1);\n    expect(mockHashCalculatorEnd).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"throws if readable stream has started reading\", async () => {\n    const readableStream = new Readable({ read: () => {} });\n    // Simulate readableFlowing to true.\n    readableStream.resume();\n\n    const expectedError = new Error(\"Unable to calculate hash for flowing readable stream\");\n    try {\n      readableStreamHasher(mockHashCtor, readableStream);\n      fail(`expected ${expectedError}`);\n    } catch (error) {\n      expect(error).toStrictEqual(expectedError);\n    }\n  });\n\n  it(\"throws error if readable stream throws error\", async () => {\n    const readableStream = new Readable({\n      read: () => {},\n    });\n    const hashPromise = readableStreamHasher(mockHashCtor, readableStream);\n\n    const mockError = new Error(\"error\");\n    setTimeout(() => {\n      readableStream.emit(\"error\", mockError);\n    }, 100);\n\n    try {\n      await hashPromise;\n      fail(`should throw error ${mockError}`);\n    } catch (error) {\n      expect(error).toEqual(mockError);\n      expect(mockHashCalculatorEnd).toHaveBeenCalledTimes(1);\n    }\n  });\n\n  it(\"throws error if HashCalculator throws error\", async () => {\n    const mockHashCalculator = new MockHashCalculator(\n      mockHashCtor as any,\n      mockHashCalculatorWrite,\n      mockHashCalculatorEnd\n    );\n    (HashCalculator as unknown as any).mockImplementation(() => mockHashCalculator);\n\n    const readableStream = new Readable({\n      read: () => {},\n    });\n    const hashPromise = readableStreamHasher(mockHashCtor, readableStream);\n\n    const mockError = new Error(\"error\");\n    setTimeout(() => {\n      mockHashCalculator.emit(\"error\", mockError);\n    }, 100);\n\n    try {\n      await hashPromise;\n      fail(`should throw error ${mockError}`);\n    } catch (error) {\n      expect(error).toEqual(mockError);\n    }\n  });\n\n  it(\"throws error if hash.digest() throws error\", async () => {\n    const readableStream = new Readable({\n      read: () => {},\n    });\n    const hashPromise = readableStreamHasher(mockHashCtor, readableStream);\n\n    setTimeout(() => {\n      readableStream.emit(\"end\");\n    }, 100);\n\n    const mockError = new Error(\"error\");\n    mockDigest.mockRejectedValue(mockError);\n\n    try {\n      await hashPromise;\n      fail(`should throw error ${mockError}`);\n    } catch (error) {\n      expect(error).toEqual(mockError);\n      expect(mockHashCalculatorEnd).toHaveBeenCalledTimes(1);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/hash-stream-node/readableStreamHasher.ts",
    "content": "import type { Readable } from \"node:stream\";\nimport type { HashConstructor, StreamHasher } from \"@smithy/types\";\n\nimport { HashCalculator } from \"./HashCalculator\";\n\n/**\n * @internal\n */\nexport const readableStreamHasher: StreamHasher<Readable> = (hashCtor: HashConstructor, readableStream: Readable) => {\n  // Throw if readableStream is already flowing.\n  if (readableStream.readableFlowing !== null) {\n    throw new Error(\"Unable to calculate hash for flowing readable stream\");\n  }\n\n  const hash = new hashCtor();\n  const hashCalculator = new HashCalculator(hash);\n  readableStream.pipe(hashCalculator);\n\n  return new Promise((resolve, reject) => {\n    readableStream.on(\"error\", (err: Error) => {\n      // if the source errors, the destination stream needs to manually end\n      hashCalculator.end();\n      reject(err);\n    });\n    hashCalculator.on(\"error\", reject);\n    hashCalculator.on(\"finish\", () => {\n      hash.digest().then(resolve).catch(reject);\n    });\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/index.browser.ts",
    "content": "const no = Symbol.for(\"node-only\");\n\n// @smithy/hash-blob-browser\nexport { blobHasher } from \"./hash-blob-browser/blobHasher\";\n\n// @smithy/hash-stream-node\nexport const fileStreamHasher = no;\nexport const readableStreamHasher = no;\n\n// @smithy/md5-js\nexport { Md5 } from \"./md5-js/md5\";\n\n// @smithy/chunked-blob-reader\nexport { blobReader } from \"./chunked-blob-reader/chunked-blob-reader\";\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/index.native.ts",
    "content": "const no = Symbol.for(\"node-only\");\n\n// @smithy/hash-blob-browser\nexport { blobHasher } from \"./hash-blob-browser/blobHasher\";\n\n// @smithy/hash-stream-node\nexport const fileStreamHasher = no;\nexport const readableStreamHasher = no;\n\n// @smithy/md5-js\nexport { Md5 } from \"./md5-js/md5\";\n\n// @smithy/chunked-blob-reader-native\nexport { blobReader } from \"./chunked-blob-reader/chunked-blob-reader.native\";\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/index.ts",
    "content": "// @smithy/hash-blob-browser\nexport { blobHasher } from \"./hash-blob-browser/blobHasher\";\n\n// @smithy/hash-stream-node\nexport { fileStreamHasher } from \"./hash-stream-node/fileStreamHasher\";\nexport { readableStreamHasher } from \"./hash-stream-node/readableStreamHasher\";\n\n// @smithy/md5-js\nexport { Md5 } from \"./md5-js/md5\";\n\n// @smithy/chunked-blob-reader\nexport { blobReader } from \"./chunked-blob-reader/chunked-blob-reader\";\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/md5-js/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-utf8@4.2.2\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n  - @smithy/util-utf8@4.2.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n  - @smithy/util-utf8@4.2.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-utf8@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/util-utf8@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-utf8@2.2.0\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n  - @smithy/util-utf8@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-utf8@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [f2a04b7e]\n  - @smithy/util-utf8@2.0.2\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-utf8@2.0.1\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-utf8@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n  - @smithy/util-utf8@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-utf8@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-utf8@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/md5-js](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/md5-js/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/md5-js/constants.ts",
    "content": "/**\n * @internal\n */\nexport const BLOCK_SIZE = 64;\n\n/**\n * @internal\n */\nexport const DIGEST_LENGTH = 16;\n\n/**\n * @internal\n */\nexport const INIT = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476];\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/md5-js/md5.spec.ts",
    "content": "import { fromBase64, toHex } from \"@smithy/core/serde\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { Md5 } from \"./md5\";\n\nconst hashVectors = require(\"hash-test-vectors\");\n\ndescribe(\"Md5\", () => {\n  let idx = 0;\n  for (const { input, ...results } of hashVectors) {\n    const expected = results[\"md5\"];\n    it(`should calculate a MD5 hash of ${expected} for test vector ${++idx}`, async () => {\n      const hash = new Md5();\n      hash.update(fromBase64(input));\n      expect(toHex(await hash.digest())).toBe(expected);\n    });\n  }\n});\n"
  },
  {
    "path": "packages/core/src/submodules/checksum/md5-js/md5.ts",
    "content": "import { fromUtf8 } from \"@smithy/core/serde\";\nimport type { Checksum, SourceData } from \"@smithy/types\";\n\nimport { BLOCK_SIZE, DIGEST_LENGTH, INIT } from \"./constants\";\n\n/**\n * @internal\n */\nexport class Md5 implements Checksum {\n  private state!: Uint32Array;\n  private buffer!: DataView;\n  private bufferLength!: number;\n  private bytesHashed!: number;\n  private finished!: boolean;\n\n  constructor() {\n    this.reset();\n  }\n\n  update(sourceData: SourceData): void {\n    if (isEmptyData(sourceData)) {\n      return;\n    } else if (this.finished) {\n      throw new Error(\"Attempted to update an already finished hash.\");\n    }\n\n    const data = convertToBuffer(sourceData);\n\n    let position = 0;\n    let { byteLength } = data;\n    this.bytesHashed += byteLength;\n\n    while (byteLength > 0) {\n      this.buffer.setUint8(this.bufferLength++, data[position++]);\n      byteLength--;\n\n      if (this.bufferLength === BLOCK_SIZE) {\n        this.hashBuffer();\n        this.bufferLength = 0;\n      }\n    }\n  }\n\n  async digest(): Promise<Uint8Array> {\n    if (!this.finished) {\n      const { buffer, bufferLength: undecoratedLength, bytesHashed } = this;\n      const bitsHashed = bytesHashed * 8;\n      buffer.setUint8(this.bufferLength++, 0b10000000);\n\n      // Ensure the final block has enough room for the hashed length\n      if (undecoratedLength % BLOCK_SIZE >= BLOCK_SIZE - 8) {\n        for (let i = this.bufferLength; i < BLOCK_SIZE; i++) {\n          buffer.setUint8(i, 0);\n        }\n        this.hashBuffer();\n        this.bufferLength = 0;\n      }\n\n      for (let i = this.bufferLength; i < BLOCK_SIZE - 8; i++) {\n        buffer.setUint8(i, 0);\n      }\n      buffer.setUint32(BLOCK_SIZE - 8, bitsHashed >>> 0, true);\n      buffer.setUint32(BLOCK_SIZE - 4, Math.floor(bitsHashed / 0x100000000), true);\n\n      this.hashBuffer();\n\n      this.finished = true;\n    }\n\n    const out = new DataView(new ArrayBuffer(DIGEST_LENGTH));\n    for (let i = 0; i < 4; i++) {\n      out.setUint32(i * 4, this.state[i], true);\n    }\n\n    return new Uint8Array(out.buffer, out.byteOffset, out.byteLength);\n  }\n\n  private hashBuffer(): void {\n    const { buffer, state } = this;\n\n    let a = state[0],\n      b = state[1],\n      c = state[2],\n      d = state[3];\n\n    a = ff(a, b, c, d, buffer.getUint32(0, true), 7, 0xd76aa478);\n    d = ff(d, a, b, c, buffer.getUint32(4, true), 12, 0xe8c7b756);\n    c = ff(c, d, a, b, buffer.getUint32(8, true), 17, 0x242070db);\n    b = ff(b, c, d, a, buffer.getUint32(12, true), 22, 0xc1bdceee);\n    a = ff(a, b, c, d, buffer.getUint32(16, true), 7, 0xf57c0faf);\n    d = ff(d, a, b, c, buffer.getUint32(20, true), 12, 0x4787c62a);\n    c = ff(c, d, a, b, buffer.getUint32(24, true), 17, 0xa8304613);\n    b = ff(b, c, d, a, buffer.getUint32(28, true), 22, 0xfd469501);\n    a = ff(a, b, c, d, buffer.getUint32(32, true), 7, 0x698098d8);\n    d = ff(d, a, b, c, buffer.getUint32(36, true), 12, 0x8b44f7af);\n    c = ff(c, d, a, b, buffer.getUint32(40, true), 17, 0xffff5bb1);\n    b = ff(b, c, d, a, buffer.getUint32(44, true), 22, 0x895cd7be);\n    a = ff(a, b, c, d, buffer.getUint32(48, true), 7, 0x6b901122);\n    d = ff(d, a, b, c, buffer.getUint32(52, true), 12, 0xfd987193);\n    c = ff(c, d, a, b, buffer.getUint32(56, true), 17, 0xa679438e);\n    b = ff(b, c, d, a, buffer.getUint32(60, true), 22, 0x49b40821);\n\n    a = gg(a, b, c, d, buffer.getUint32(4, true), 5, 0xf61e2562);\n    d = gg(d, a, b, c, buffer.getUint32(24, true), 9, 0xc040b340);\n    c = gg(c, d, a, b, buffer.getUint32(44, true), 14, 0x265e5a51);\n    b = gg(b, c, d, a, buffer.getUint32(0, true), 20, 0xe9b6c7aa);\n    a = gg(a, b, c, d, buffer.getUint32(20, true), 5, 0xd62f105d);\n    d = gg(d, a, b, c, buffer.getUint32(40, true), 9, 0x02441453);\n    c = gg(c, d, a, b, buffer.getUint32(60, true), 14, 0xd8a1e681);\n    b = gg(b, c, d, a, buffer.getUint32(16, true), 20, 0xe7d3fbc8);\n    a = gg(a, b, c, d, buffer.getUint32(36, true), 5, 0x21e1cde6);\n    d = gg(d, a, b, c, buffer.getUint32(56, true), 9, 0xc33707d6);\n    c = gg(c, d, a, b, buffer.getUint32(12, true), 14, 0xf4d50d87);\n    b = gg(b, c, d, a, buffer.getUint32(32, true), 20, 0x455a14ed);\n    a = gg(a, b, c, d, buffer.getUint32(52, true), 5, 0xa9e3e905);\n    d = gg(d, a, b, c, buffer.getUint32(8, true), 9, 0xfcefa3f8);\n    c = gg(c, d, a, b, buffer.getUint32(28, true), 14, 0x676f02d9);\n    b = gg(b, c, d, a, buffer.getUint32(48, true), 20, 0x8d2a4c8a);\n\n    a = hh(a, b, c, d, buffer.getUint32(20, true), 4, 0xfffa3942);\n    d = hh(d, a, b, c, buffer.getUint32(32, true), 11, 0x8771f681);\n    c = hh(c, d, a, b, buffer.getUint32(44, true), 16, 0x6d9d6122);\n    b = hh(b, c, d, a, buffer.getUint32(56, true), 23, 0xfde5380c);\n    a = hh(a, b, c, d, buffer.getUint32(4, true), 4, 0xa4beea44);\n    d = hh(d, a, b, c, buffer.getUint32(16, true), 11, 0x4bdecfa9);\n    c = hh(c, d, a, b, buffer.getUint32(28, true), 16, 0xf6bb4b60);\n    b = hh(b, c, d, a, buffer.getUint32(40, true), 23, 0xbebfbc70);\n    a = hh(a, b, c, d, buffer.getUint32(52, true), 4, 0x289b7ec6);\n    d = hh(d, a, b, c, buffer.getUint32(0, true), 11, 0xeaa127fa);\n    c = hh(c, d, a, b, buffer.getUint32(12, true), 16, 0xd4ef3085);\n    b = hh(b, c, d, a, buffer.getUint32(24, true), 23, 0x04881d05);\n    a = hh(a, b, c, d, buffer.getUint32(36, true), 4, 0xd9d4d039);\n    d = hh(d, a, b, c, buffer.getUint32(48, true), 11, 0xe6db99e5);\n    c = hh(c, d, a, b, buffer.getUint32(60, true), 16, 0x1fa27cf8);\n    b = hh(b, c, d, a, buffer.getUint32(8, true), 23, 0xc4ac5665);\n\n    a = ii(a, b, c, d, buffer.getUint32(0, true), 6, 0xf4292244);\n    d = ii(d, a, b, c, buffer.getUint32(28, true), 10, 0x432aff97);\n    c = ii(c, d, a, b, buffer.getUint32(56, true), 15, 0xab9423a7);\n    b = ii(b, c, d, a, buffer.getUint32(20, true), 21, 0xfc93a039);\n    a = ii(a, b, c, d, buffer.getUint32(48, true), 6, 0x655b59c3);\n    d = ii(d, a, b, c, buffer.getUint32(12, true), 10, 0x8f0ccc92);\n    c = ii(c, d, a, b, buffer.getUint32(40, true), 15, 0xffeff47d);\n    b = ii(b, c, d, a, buffer.getUint32(4, true), 21, 0x85845dd1);\n    a = ii(a, b, c, d, buffer.getUint32(32, true), 6, 0x6fa87e4f);\n    d = ii(d, a, b, c, buffer.getUint32(60, true), 10, 0xfe2ce6e0);\n    c = ii(c, d, a, b, buffer.getUint32(24, true), 15, 0xa3014314);\n    b = ii(b, c, d, a, buffer.getUint32(52, true), 21, 0x4e0811a1);\n    a = ii(a, b, c, d, buffer.getUint32(16, true), 6, 0xf7537e82);\n    d = ii(d, a, b, c, buffer.getUint32(44, true), 10, 0xbd3af235);\n    c = ii(c, d, a, b, buffer.getUint32(8, true), 15, 0x2ad7d2bb);\n    b = ii(b, c, d, a, buffer.getUint32(36, true), 21, 0xeb86d391);\n\n    state[0] = (a + state[0]) & 0xffffffff;\n    state[1] = (b + state[1]) & 0xffffffff;\n    state[2] = (c + state[2]) & 0xffffffff;\n    state[3] = (d + state[3]) & 0xffffffff;\n  }\n\n  reset(): void {\n    this.state = Uint32Array.from(INIT);\n    this.buffer = new DataView(new ArrayBuffer(BLOCK_SIZE));\n    this.bufferLength = 0;\n    this.bytesHashed = 0;\n    this.finished = false;\n  }\n}\n\nfunction cmn(q: number, a: number, b: number, x: number, s: number, t: number) {\n  a = (((a + q) & 0xffffffff) + ((x + t) & 0xffffffff)) & 0xffffffff;\n  return (((a << s) | (a >>> (32 - s))) + b) & 0xffffffff;\n}\n\nfunction ff(a: number, b: number, c: number, d: number, x: number, s: number, t: number) {\n  return cmn((b & c) | (~b & d), a, b, x, s, t);\n}\n\nfunction gg(a: number, b: number, c: number, d: number, x: number, s: number, t: number) {\n  return cmn((b & d) | (c & ~d), a, b, x, s, t);\n}\n\nfunction hh(a: number, b: number, c: number, d: number, x: number, s: number, t: number) {\n  return cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction ii(a: number, b: number, c: number, d: number, x: number, s: number, t: number) {\n  return cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nfunction isEmptyData(data: SourceData): boolean {\n  if (typeof data === \"string\") {\n    return data.length === 0;\n  }\n\n  return data.byteLength === 0;\n}\n\nfunction convertToBuffer(data: SourceData): Uint8Array {\n  if (typeof data === \"string\") {\n    return fromUtf8(data);\n  }\n\n  if (ArrayBuffer.isView(data)) {\n    return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n  }\n\n  return new Uint8Array(data);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/client/index.ts",
    "content": "// @smithy/middleware-stack\nexport { constructStack } from \"./middleware-stack/MiddlewareStack\";\n\n// @smithy/util-middleware\nexport { getSmithyContext } from \"./util-middleware/getSmithyContext\";\nexport { normalizeProvider } from \"./util-middleware/normalizeProvider\";\n\n// @smithy/invalid-dependency\nexport { invalidFunction } from \"./invalid-dependency/invalidFunction\";\nexport { invalidProvider } from \"./invalid-dependency/invalidProvider\";\n\n// @smithy/util-waiter\nexport { createWaiter } from \"./util-waiter/createWaiter\";\nexport {\n  waiterServiceDefaults,\n  WaiterState,\n  checkExceptions,\n  type WaiterConfiguration,\n  type WaiterOptions,\n  type WaiterResult,\n} from \"./util-waiter/waiter\";\n\n// @smithy/smithy-client\nexport { Client, type SmithyConfiguration, type SmithyResolvedConfiguration } from \"./smithy-client/client\";\nexport { Command, type CommandImpl } from \"./smithy-client/command\";\nexport { SENSITIVE_STRING } from \"./smithy-client/constants\";\nexport { createAggregatedClient } from \"./smithy-client/create-aggregated-client\";\nexport { throwDefaultError, withBaseException } from \"./smithy-client/default-error-handler\";\nexport {\n  loadConfigsForDefaultMode,\n  type DefaultsMode,\n  type ResolvedDefaultsMode,\n  type DefaultsModeConfigs,\n} from \"./smithy-client/defaults-mode\";\nexport { emitWarningIfUnsupportedVersion } from \"./smithy-client/emitWarningIfUnsupportedVersion\";\nexport {\n  ServiceException,\n  decorateServiceException,\n  type ExceptionOptionType,\n  type ServiceExceptionOptions,\n} from \"./smithy-client/exceptions\";\nexport {\n  getDefaultExtensionConfiguration,\n  getDefaultClientConfiguration,\n  resolveDefaultRuntimeConfig,\n  type DefaultExtensionRuntimeConfigType,\n} from \"./smithy-client/extensions/defaultExtensionConfiguration\";\nexport {\n  AlgorithmId,\n  getChecksumConfiguration,\n  resolveChecksumRuntimeConfig,\n  type ChecksumAlgorithm,\n  type ChecksumConfiguration,\n  type PartialChecksumRuntimeConfigType,\n} from \"./smithy-client/extensions/checksum\";\nexport {\n  getRetryConfiguration,\n  resolveRetryRuntimeConfig,\n  type PartialRetryRuntimeConfigType,\n} from \"./smithy-client/extensions/retry\";\nexport { getArrayIfSingleItem } from \"./smithy-client/get-array-if-single-item\";\nexport { getValueFromTextNode } from \"./smithy-client/get-value-from-text-node\";\nexport { isSerializableHeaderValue } from \"./smithy-client/is-serializable-header-value\";\nexport { NoOpLogger } from \"./smithy-client/NoOpLogger\";\nexport {\n  map,\n  convertMap,\n  take,\n  type ObjectMappingInstructions,\n  type SourceMappingInstructions,\n  type ObjectMappingInstruction,\n  type UnfilteredValue,\n  type LazyValueInstruction,\n  type ConditionalLazyValueInstruction,\n  type SimpleValueInstruction,\n  type ConditionalValueInstruction,\n  type SourceMappingInstruction,\n  type FilterStatus,\n  type FilterStatusSupplier,\n  type ValueFilteringFunction,\n  type ValueSupplier,\n  type ValueMapper,\n  type Value,\n} from \"./smithy-client/object-mapping\";\nexport { schemaLogFilter } from \"./smithy-client/schemaLogFilter\";\nexport { serializeFloat, serializeDateTime } from \"./smithy-client/ser-utils\";\nexport { _json } from \"./smithy-client/serde-json\";\n"
  },
  {
    "path": "packages/core/src/submodules/client/invalid-dependency/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/client`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/invalid-dependency](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/invalid-dependency/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/client/invalid-dependency/invalidFunction.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { invalidFunction } from \"./invalidFunction\";\n\ndescribe(\"invalidFunction\", () => {\n  it(\"throws error with message\", () => {\n    const message = \"Error\";\n    expect(invalidFunction(message)).toThrowError(new Error(message));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/invalid-dependency/invalidFunction.ts",
    "content": "/**\n * @internal\n */\nexport const invalidFunction = (message: string) => () => {\n  throw new Error(message);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/invalid-dependency/invalidProvider.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { invalidProvider } from \"./invalidProvider\";\n\ndescribe(\"invalidProvider\", () => {\n  it(\"rejects with error containing message\", async () => {\n    const message = \"Error\";\n    const provider = invalidProvider(message);\n    //@ts-ignore\n    await expect(provider()).rejects.toEqual(message);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/invalid-dependency/invalidProvider.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const invalidProvider: (message: string) => Provider<any> = (message: string) => () => Promise.reject(message);\n"
  },
  {
    "path": "packages/core/src/submodules/client/middleware-stack/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/client`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.4\n\n### Patch Changes\n\n- 2f70f105: Support `aliases` for `MiddlewareStack`\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.3\n\n### Patch Changes\n\n- 20fc148d: check calls to external instances of middlewareStack\n\n## 2.0.2\n\n### Patch Changes\n\n- ea0635d6: add debug method to middlewareStack\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.1\n\n### Patch Changes\n\n- e6ea6bd5: move devDeps into deps\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/middleware-stack](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/middleware-stack/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/client/middleware-stack/MiddlewareStack.spec.ts",
    "content": "import type {\n  DeserializeHandlerArguments,\n  DeserializeMiddleware,\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  InitializeHandler,\n  Pluggable,\n} from \"@smithy/types\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { constructStack } from \"./MiddlewareStack\";\n\ntype input = Array<string>;\ntype output = object;\n\n//return tagged union to make compiler happy\nconst getConcatMiddleware =\n  (message: string) =>\n  (next: FinalizeHandler<input, output>): InitializeHandler<input, output> =>\n  (args: any) =>\n    next({\n      ...args,\n      input: args.input.concat(message),\n      request: undefined as any,\n    });\n\ndescribe(\"MiddlewareStack\", () => {\n  describe(\"add\", () => {\n    it(\"should sort middleware based on step, priority, and ording of adding\", async () => {\n      const stack = constructStack<input, output>();\n      const bMW = getConcatMiddleware(\"B\");\n      stack.add(bMW, { name: \"B\" });\n      stack.add(getConcatMiddleware(\"A\"), {\n        priority: \"high\",\n      });\n      stack.add(getConcatMiddleware(\"D\"), {\n        step: \"build\",\n        name: \"D\",\n      });\n      stack.add(getConcatMiddleware(\"C\"), {\n        step: \"build\",\n        priority: \"high\",\n      });\n      stack.add(getConcatMiddleware(\"E\"), {\n        step: \"finalizeRequest\",\n      });\n      stack.add(getConcatMiddleware(\"F\"), { step: \"finalizeRequest\" });\n      stack.add(getConcatMiddleware(\"G\") as DeserializeMiddleware<input, output>, {\n        priority: \"low\",\n        step: \"deserialize\",\n      });\n      stack.add(getConcatMiddleware(\"H\") as DeserializeMiddleware<input, output>, {\n        aliases: [\"h\"],\n        priority: \"low\",\n        step: \"deserialize\",\n      });\n      const inner = vi.fn();\n\n      const composed = stack.resolve(inner, {} as any);\n      await composed({ input: [] });\n\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({\n        input: [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\"],\n      });\n    });\n\n    it(\"should throw if duplicated name is found\", () => {\n      const stack = constructStack<input, output>();\n      const aMW = getConcatMiddleware(\"A\");\n      stack.add(aMW, { name: \"A\" });\n      expect(() => stack.add(aMW, { name: \"A\" })).toThrow(\"Duplicate middleware name 'A'\");\n    });\n\n    it(\"should throw if duplicated name via aliases of existing entry is found\", () => {\n      const stack = constructStack<input, output>();\n      const aMW = getConcatMiddleware(\"A\");\n      stack.add(aMW, { aliases: [\"ALIAS\"] });\n      expect(() => stack.add(aMW, { name: \"ALIAS\" })).toThrow(\"Duplicate middleware name 'ALIAS'\");\n    });\n\n    it(\"should throw if duplicated name via aliases of added entry is found\", () => {\n      const stack = constructStack<input, output>();\n      const aMW = getConcatMiddleware(\"ALIAS\");\n      stack.add(aMW, { name: \"ALIAS\" });\n      expect(() => stack.add(aMW, { aliases: [\"ALIAS\"] })).toThrow(\n        \"Duplicate middleware name 'anonymous (a.k.a. ALIAS)'\"\n      );\n    });\n\n    describe(\"config: override\", () => {\n      it(\"should override the middleware with same name if override config is set\", async () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.add(getConcatMiddleware(\"override\"), { name: \"A\", override: true });\n        const inner = vi.fn();\n        const composed = stack.resolve(inner, {} as any);\n        await composed({ input: [] });\n        expect(inner.mock.calls.length).toBe(1);\n        expect(inner).toBeCalledWith({\n          input: [\"override\"],\n        });\n      });\n\n      it(\"should override the middleware with matching alias of existing entry if override config is set\", async () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { aliases: [\"ALIAS\"] });\n        stack.add(getConcatMiddleware(\"override\"), { name: \"ALIAS\", override: true });\n        const inner = vi.fn();\n        const composed = stack.resolve(inner, {} as any);\n        await composed({ input: [] });\n        expect(inner.mock.calls.length).toBe(1);\n        expect(inner).toBeCalledWith({\n          input: [\"override\"],\n        });\n      });\n\n      it(\"should override the middleware with matching alias of added entry if override config is set\", async () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"ALIAS\" });\n        stack.add(getConcatMiddleware(\"override\"), { aliases: [\"ALIAS\"], override: true });\n        const inner = vi.fn();\n        const composed = stack.resolve(inner, {} as any);\n        await composed({ input: [] });\n        expect(inner.mock.calls.length).toBe(1);\n        expect(inner).toBeCalledWith({\n          input: [\"override\"],\n        });\n      });\n\n      it(\"should throw if overriding middleware with same name different position\", () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        expect(() =>\n          stack.add(getConcatMiddleware(\"override\"), { name: \"A\", step: \"serialize\", override: true })\n        ).toThrow(\n          '\"A\" middleware with normal priority in initialize step cannot be overridden by \"A\" middleware with normal priority in serialize step.'\n        );\n      });\n\n      it(\"should throw if overriding middleware with matching alias of existing entry different position\", () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { aliases: [\"ALIAS\"] });\n        expect(() =>\n          stack.add(getConcatMiddleware(\"override\"), { name: \"ALIAS\", step: \"serialize\", override: true })\n        ).toThrow(\n          '\"anonymous (a.k.a. ALIAS)\" middleware with normal priority in initialize step cannot be overridden by \"ALIAS\" middleware with normal priority in serialize step.'\n        );\n      });\n\n      it(\"should throw if overriding middleware with matching alias of added entry different position\", () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"ALIAS\" });\n        expect(() =>\n          stack.add(getConcatMiddleware(\"override\"), { aliases: [\"ALIAS\"], step: \"serialize\", override: true })\n        ).toThrow(\n          '\"ALIAS\" middleware with normal priority in initialize step cannot be overridden by \"anonymous (a.k.a. ALIAS)\" middleware with normal priority in serialize step.'\n        );\n      });\n    });\n  });\n\n  describe(\"addRelativeTo\", () => {\n    it(\"should allow adding middleware relatively based relation and order of adding\", async () => {\n      const stack = constructStack<input, output>();\n      stack.addRelativeTo(getConcatMiddleware(\"H\"), {\n        aliases: [\"AliasH\"],\n        relation: \"after\",\n        toMiddleware: \"G\",\n      });\n      stack.add(getConcatMiddleware(\"A\"), {\n        name: \"A\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"C\"), {\n        name: \"C\",\n        relation: \"after\",\n        toMiddleware: \"A\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"B\"), {\n        name: \"B\",\n        relation: \"after\",\n        toMiddleware: \"A\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"D\"), {\n        name: \"D\",\n        relation: \"after\",\n        toMiddleware: \"C\",\n      });\n      stack.add(getConcatMiddleware(\"G\"), {\n        name: \"G\",\n        priority: \"low\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"E\"), {\n        name: \"E\",\n        relation: \"before\",\n        toMiddleware: \"F\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"F\"), {\n        name: \"F\",\n        relation: \"before\",\n        toMiddleware: \"G\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"I\"), {\n        aliases: [\"AliasI\"],\n        relation: \"after\",\n        toMiddleware: \"AliasH\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"J\"), {\n        name: \"J\",\n        relation: \"after\",\n        toMiddleware: \"AliasI\",\n      });\n      const inner = vi.fn();\n      const composed = stack.resolve(inner, {} as any);\n      await composed({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\"] });\n    });\n\n    it(\"should add relative middleware within the scope of adjacent absolute middleware\", async () => {\n      const stack = constructStack<input, output>();\n      stack.addRelativeTo(getConcatMiddleware(\"B\"), {\n        name: \"B\",\n        relation: \"after\",\n        toMiddleware: \"A\",\n      });\n      stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n      stack.addRelativeTo(getConcatMiddleware(\"C\"), {\n        name: \"C\",\n        relation: \"before\",\n        toMiddleware: \"AliasD\",\n      });\n      stack.add(getConcatMiddleware(\"D\"), { aliases: [\"AliasD\"] });\n      stack.addRelativeTo(getConcatMiddleware(\"F\"), {\n        aliases: [\"AliasF\"],\n        relation: \"after\",\n        toMiddleware: \"AliasD\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"E\"), {\n        relation: \"before\",\n        toMiddleware: \"AliasF\",\n      });\n      stack.add(getConcatMiddleware(\"G\"), { name: \"G\" });\n      const inner = vi.fn();\n      const composed = stack.resolve(inner, {} as any);\n      await composed({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\"] });\n    });\n\n    it(\"should not add self-referenced relative middleware\", async () => {\n      const stack = constructStack<input, output>();\n      stack.addRelativeTo(getConcatMiddleware(\"A\"), {\n        name: \"A\",\n        relation: \"before\",\n        toMiddleware: \"B\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"B\"), {\n        name: \"B\",\n        relation: \"before\",\n        toMiddleware: \"C\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"C\"), {\n        name: \"C\",\n        relation: \"before\",\n        toMiddleware: \"AliasD\",\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"D\"), {\n        aliases: [\"AliasD\"],\n        relation: \"after\",\n        toMiddleware: \"A\",\n      });\n      const inner = vi.fn();\n      const composed = stack.resolve(inner, {} as any);\n      await composed({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [] });\n    });\n\n    it(\"should throw if add middleware relative to non-exist middleware\", async () => {\n      expect.assertions(1);\n      const stack = constructStack<input, output>();\n      stack.addRelativeTo(getConcatMiddleware(\"foo\"), {\n        name: \"foo\",\n        relation: \"before\",\n        toMiddleware: \"non_exist\",\n      });\n      const inner = vi.fn();\n      try {\n        stack.resolve(inner, {} as any);\n      } catch (e) {\n        expect(e.message).toBe(\"non_exist is not found when adding foo middleware before non_exist\");\n      }\n    });\n\n    describe(\"config: override\", () => {\n      it(\"should override the middleware with same name if override config is set\", async () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"B\"), { name: \"B\", relation: \"after\", toMiddleware: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"override\"), {\n          name: \"B\",\n          relation: \"after\",\n          toMiddleware: \"A\",\n          override: true,\n        });\n        const inner = vi.fn();\n        const composed = stack.resolve(inner, {} as any);\n        await composed({ input: [] });\n        expect(inner.mock.calls.length).toBe(1);\n        expect(inner).toBeCalledWith({\n          input: [\"A\", \"override\"],\n        });\n      });\n\n      it(\"should override the middleware with matching alias of existing entry if override config is set\", async () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"B\"), {\n          aliases: [\"ALIAS\"],\n          relation: \"after\",\n          toMiddleware: \"A\",\n        });\n        stack.addRelativeTo(getConcatMiddleware(\"override\"), {\n          name: \"ALIAS\",\n          relation: \"after\",\n          toMiddleware: \"A\",\n          override: true,\n        });\n        const inner = vi.fn();\n        const composed = stack.resolve(inner, {} as any);\n        await composed({ input: [] });\n        expect(inner.mock.calls.length).toBe(1);\n        expect(inner).toBeCalledWith({\n          input: [\"A\", \"override\"],\n        });\n      });\n\n      it(\"should override the middleware with matching alias of added entry if override config is set\", async () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"ALIAS\"), {\n          name: \"ALIAS\",\n          relation: \"after\",\n          toMiddleware: \"A\",\n        });\n        stack.addRelativeTo(getConcatMiddleware(\"override\"), {\n          aliases: [\"ALIAS\"],\n          relation: \"after\",\n          toMiddleware: \"A\",\n          override: true,\n        });\n        const inner = vi.fn();\n        const composed = stack.resolve(inner, {} as any);\n        await composed({ input: [] });\n        expect(inner.mock.calls.length).toBe(1);\n        expect(inner).toBeCalledWith({\n          input: [\"A\", \"override\"],\n        });\n      });\n\n      it(\"should throw if overriding middleware with same name different position\", () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"B\"), { name: \"B\", relation: \"after\", toMiddleware: \"A\" });\n        expect(() =>\n          stack.addRelativeTo(getConcatMiddleware(\"override\"), {\n            name: \"B\",\n            relation: \"before\",\n            toMiddleware: \"A\",\n            override: true,\n          })\n        ).toThrow('\"B\" middleware after \"A\" middleware cannot be overridden by \"B\" middleware before \"A\" middleware.');\n      });\n\n      it(\"should throw if overriding middleware with matching alias of existing entry different position\", () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"B\"), {\n          aliases: [\"ALIAS\"],\n          relation: \"after\",\n          toMiddleware: \"A\",\n        });\n        expect(() =>\n          stack.addRelativeTo(getConcatMiddleware(\"override\"), {\n            name: \"ALIAS\",\n            relation: \"before\",\n            toMiddleware: \"A\",\n            override: true,\n          })\n        ).toThrow(\n          '\"anonymous (a.k.a. ALIAS)\" middleware after \"A\" middleware cannot be overridden by \"ALIAS\" middleware before \"A\" middleware.'\n        );\n      });\n\n      it(\"should throw if overriding middleware with matching alias of added entry different position\", () => {\n        const stack = constructStack<input, output>();\n        stack.add(getConcatMiddleware(\"A\"), { name: \"A\" });\n        stack.addRelativeTo(getConcatMiddleware(\"ALIAS\"), {\n          name: \"ALIAS\",\n          relation: \"after\",\n          toMiddleware: \"A\",\n        });\n        expect(() =>\n          stack.addRelativeTo(getConcatMiddleware(\"override\"), {\n            aliases: [\"ALIAS\"],\n            relation: \"before\",\n            toMiddleware: \"A\",\n            override: true,\n          })\n        ).toThrow(\n          '\"ALIAS\" middleware after \"A\" middleware cannot be overridden by \"anonymous (a.k.a. ALIAS)\" middleware before \"A\" middleware.'\n        );\n      });\n    });\n  });\n\n  describe(\"clone\", () => {\n    it(\"should allow cloning\", async () => {\n      const stack = constructStack<input, output>();\n      const bMiddleware = getConcatMiddleware(\"B\");\n      stack.add(bMiddleware);\n      stack.add(getConcatMiddleware(\"A\"), {\n        name: \"A\",\n        priority: \"high\",\n      });\n      stack.add(getConcatMiddleware(\"C\"), {\n        aliases: [\"AliasC\"],\n      });\n      const secondStack = stack.clone();\n      const inner = vi.fn();\n      await secondStack.resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\", \"C\"] });\n      // validate adding middleware to cloned stack won't affect the original stack.\n      inner.mockClear();\n      secondStack.add(getConcatMiddleware(\"D\"));\n      secondStack.add(getConcatMiddleware(\"E\"), {\n        aliases: [\"AliasE\"],\n      });\n      await secondStack.resolve(inner, {} as any)({ input: [] });\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\", \"C\", \"D\", \"E\"] });\n      inner.mockClear();\n      await stack.resolve(inner, {} as any)({ input: [] });\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\", \"C\"] });\n    });\n  });\n\n  describe(\"concat\", () => {\n    it(\"should allow combining stacks\", async () => {\n      const stack = constructStack<input, output>();\n      stack.add(getConcatMiddleware(\"A\"));\n      stack.add(getConcatMiddleware(\"B\"), {\n        aliases: [\"AliasB\"],\n        priority: \"low\",\n      });\n\n      const secondStack = constructStack<input, output>();\n      secondStack.add(getConcatMiddleware(\"D\"), {\n        step: \"build\",\n        priority: \"low\",\n      });\n      secondStack.addRelativeTo(getConcatMiddleware(\"C\"), {\n        relation: \"after\",\n        toMiddleware: \"AliasB\",\n      });\n\n      const inner = vi.fn();\n      await stack.concat(secondStack).resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\", \"C\", \"D\"] });\n    });\n\n    it(\"should not touch the stack of the concat() caller or the parameter\", async () => {\n      const stack = constructStack<input, output>();\n      stack.add(getConcatMiddleware(\"A\"));\n      const secondStack = constructStack<input, output>();\n      secondStack.add(getConcatMiddleware(\"B\"));\n      const inner = vi.fn();\n      await stack.concat(secondStack).resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"A\", \"B\"] });\n      inner.mockClear();\n      await secondStack.resolve(inner, {} as any)({ input: [] });\n      expect(inner).toBeCalledWith({ input: [\"B\"] });\n      inner.mockClear();\n      await stack.resolve(inner, {} as any)({ input: [] });\n      expect(inner).toBeCalledWith({ input: [\"A\"] });\n    });\n  });\n\n  describe(\"remove\", () => {\n    it(\"should remove middleware by name\", async () => {\n      const stack = constructStack<input, output>();\n      stack.add(getConcatMiddleware(\"don't remove me\"), { name: \"notRemove\" });\n      stack.addRelativeTo(getConcatMiddleware(\"remove me!\"), {\n        relation: \"after\",\n        toMiddleware: \"notRemove\",\n        name: \"toRemove\",\n      });\n\n      await stack.resolve(({ input }: FinalizeHandlerArguments<Array<string>>) => {\n        expect(input.sort()).toEqual([\"don't remove me\", \"remove me!\"]);\n        return Promise.resolve({ response: {} });\n      }, {} as any)({ input: [] });\n\n      stack.remove(\"toRemove\");\n\n      const inner = vi.fn();\n      await stack.resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"don't remove me\"] });\n    });\n\n    it(\"should remove middleware by alias of existing entry\", async () => {\n      const stack = constructStack<input, output>();\n      stack.add(getConcatMiddleware(\"don't remove me\"), { name: \"notRemove\" });\n      stack.addRelativeTo(getConcatMiddleware(\"remove me!\"), {\n        relation: \"after\",\n        toMiddleware: \"notRemove\",\n        aliases: [\"toRemove\"],\n      });\n\n      await stack.resolve(({ input }: FinalizeHandlerArguments<Array<string>>) => {\n        expect(input.sort()).toEqual([\"don't remove me\", \"remove me!\"]);\n        return Promise.resolve({ response: {} });\n      }, {} as any)({ input: [] });\n\n      stack.remove(\"toRemove\");\n\n      const inner = vi.fn();\n      await stack.resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"don't remove me\"] });\n    });\n\n    it(\"should remove middleware by reference\", async () => {\n      const stack = constructStack<input, output>();\n      const mw = getConcatMiddleware(\"remove all references of me\");\n      stack.add(mw, { name: \"toRemove1\" });\n      stack.add(getConcatMiddleware(\"don't remove me!\"));\n      stack.add(mw, { aliases: [\"toRemove2\"] });\n      stack.remove(mw);\n\n      const inner = vi.fn();\n      await stack.resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n      expect(inner).toBeCalledWith({ input: [\"don't remove me!\"] });\n    });\n  });\n\n  describe(\"removeByTag\", () => {\n    it(\"should allow the removal of middleware by tag\", async () => {\n      const stack = constructStack<input, output>();\n      stack.add(getConcatMiddleware(\"not removed\"), {\n        name: \"not removed\",\n        tags: [\"foo\", \"bar\"],\n      });\n      stack.addRelativeTo(getConcatMiddleware(\"remove me!\"), {\n        aliases: [\"remove me!\"],\n        relation: \"after\",\n        toMiddleware: \"not removed\",\n        tags: [\"foo\", \"bar\", \"baz\"],\n      });\n\n      await stack.resolve(({ input }: FinalizeHandlerArguments<Array<string>>) => {\n        expect(input.sort()).toEqual([\"not removed\", \"remove me!\"]);\n        return Promise.resolve({ response: {} });\n      }, {} as any)({ input: [] });\n\n      stack.removeByTag(\"baz\");\n\n      await stack.resolve(({ input }: DeserializeHandlerArguments<Array<string>>) => {\n        expect(input).toEqual([\"not removed\"]);\n        return Promise.resolve({ response: {} });\n      }, {} as any)({ input: [] });\n    });\n  });\n\n  it(\"checks identifyOnResolve calls to external instances due to version mismatching\", () => {\n    const newStack = constructStack<input, output>();\n    const oldStack = constructStack<input, output>();\n\n    delete (oldStack as any).identifyOnResolve;\n    oldStack.clone = () => oldStack;\n    oldStack.concat = <S>() => oldStack as S;\n    oldStack.applyToStack = () => void 0;\n\n    expect(oldStack.identifyOnResolve).toBeUndefined();\n    expect(() => {\n      newStack.concat(oldStack);\n      newStack.clone();\n    }).not.toThrow();\n  });\n\n  describe(\"use\", () => {\n    it(\"should apply customizations from pluggables\", async () => {\n      const stack = constructStack<input, output>();\n      const plugin: Pluggable<input, output> = {\n        applyToStack: (stack) => {\n          stack.addRelativeTo(getConcatMiddleware(\"second\"), {\n            relation: \"after\",\n            toMiddleware: \"first\",\n          });\n          stack.add(getConcatMiddleware(\"first\"), { name: \"first\" });\n        },\n      };\n      stack.use(plugin);\n      const inner = vi.fn(({ input }: DeserializeHandlerArguments<input>) => {\n        expect(input).toEqual([\"first\", \"second\"]);\n        return Promise.resolve({ response: {} });\n      });\n      await stack.resolve(inner, {} as any)({ input: [] });\n      expect(inner.mock.calls.length).toBe(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/middleware-stack/MiddlewareStack.ts",
    "content": "import type {\n  AbsoluteLocation,\n  DeserializeHandler,\n  Handler,\n  HandlerExecutionContext,\n  HandlerOptions,\n  MiddlewareStack,\n  MiddlewareType,\n  Pluggable,\n  Priority,\n  RelativeLocation,\n  RelativeMiddlewareOptions,\n  Step,\n} from \"@smithy/types\";\n\nimport type { AbsoluteMiddlewareEntry, MiddlewareEntry, Normalized, RelativeMiddlewareEntry } from \"./types\";\n\nconst getAllAliases = (name: string | undefined, aliases: Array<string> | undefined) => {\n  const _aliases = [];\n  if (name) {\n    _aliases.push(name);\n  }\n  if (aliases) {\n    for (const alias of aliases) {\n      _aliases.push(alias);\n    }\n  }\n  return _aliases;\n};\n\nconst getMiddlewareNameWithAliases = (name: string | undefined, aliases: Array<string> | undefined): string => {\n  return `${name || \"anonymous\"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(\",\")})` : \"\"}`;\n};\n\n/**\n * @internal\n */\nexport const constructStack = <Input extends object, Output extends object>(): MiddlewareStack<Input, Output> => {\n  let absoluteEntries: AbsoluteMiddlewareEntry<Input, Output>[] = [];\n  let relativeEntries: RelativeMiddlewareEntry<Input, Output>[] = [];\n  let identifyOnResolve = false;\n  const entriesNameSet: Set<string> = new Set();\n\n  const sort = <T extends AbsoluteMiddlewareEntry<Input, Output>>(entries: T[]): T[] =>\n    entries.sort(\n      (a, b) =>\n        stepWeights[b.step] - stepWeights[a.step] ||\n        priorityWeights[b.priority || \"normal\"] - priorityWeights[a.priority || \"normal\"]\n    );\n\n  const removeByName = (toRemove: string): boolean => {\n    let isRemoved = false;\n    const filterCb = (entry: MiddlewareEntry<Input, Output>): boolean => {\n      const aliases = getAllAliases(entry.name, entry.aliases);\n      if (aliases.includes(toRemove)) {\n        isRemoved = true;\n        for (const alias of aliases) {\n          entriesNameSet.delete(alias);\n        }\n        return false;\n      }\n      return true;\n    };\n    absoluteEntries = absoluteEntries.filter(filterCb);\n    relativeEntries = relativeEntries.filter(filterCb);\n    return isRemoved;\n  };\n\n  const removeByReference = (toRemove: MiddlewareType<Input, Output>): boolean => {\n    let isRemoved = false;\n    const filterCb = (entry: MiddlewareEntry<Input, Output>): boolean => {\n      if (entry.middleware === toRemove) {\n        isRemoved = true;\n        for (const alias of getAllAliases(entry.name, entry.aliases)) {\n          entriesNameSet.delete(alias);\n        }\n        return false;\n      }\n      return true;\n    };\n    absoluteEntries = absoluteEntries.filter(filterCb);\n    relativeEntries = relativeEntries.filter(filterCb);\n    return isRemoved;\n  };\n\n  const cloneTo = <InputType extends Input, OutputType extends Output>(\n    toStack: MiddlewareStack<InputType, OutputType>\n  ): MiddlewareStack<InputType, OutputType> => {\n    absoluteEntries.forEach((entry) => {\n      //@ts-ignore\n      toStack.add(entry.middleware, { ...entry });\n    });\n    relativeEntries.forEach((entry) => {\n      //@ts-ignore\n      toStack.addRelativeTo(entry.middleware, { ...entry });\n    });\n    toStack.identifyOnResolve?.(stack.identifyOnResolve());\n    return toStack;\n  };\n\n  const expandRelativeMiddlewareList = (\n    from: Normalized<MiddlewareEntry<Input, Output>, Input, Output>\n  ): MiddlewareEntry<Input, Output>[] => {\n    const expandedMiddlewareList: MiddlewareEntry<Input, Output>[] = [];\n    from.before.forEach((entry) => {\n      if (entry.before.length === 0 && entry.after.length === 0) {\n        expandedMiddlewareList.push(entry);\n      } else {\n        expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n      }\n    });\n    expandedMiddlewareList.push(from);\n    from.after.reverse().forEach((entry) => {\n      if (entry.before.length === 0 && entry.after.length === 0) {\n        expandedMiddlewareList.push(entry);\n      } else {\n        expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n      }\n    });\n    return expandedMiddlewareList;\n  };\n\n  /**\n   * Get a final list of middleware in the order of being executed in the resolved handler.\n   * @param debug - don't throw, getting info only.\n   */\n  const getMiddlewareList = (debug = false): Array<MiddlewareEntry<Input, Output>> => {\n    const normalizedAbsoluteEntries: Normalized<AbsoluteMiddlewareEntry<Input, Output>, Input, Output>[] = [];\n    const normalizedRelativeEntries: Normalized<RelativeMiddlewareEntry<Input, Output>, Input, Output>[] = [];\n    const normalizedEntriesNameMap: Record<string, Normalized<MiddlewareEntry<Input, Output>, Input, Output>> = {};\n\n    absoluteEntries.forEach((entry) => {\n      const normalizedEntry = {\n        ...entry,\n        before: [],\n        after: [],\n      };\n      for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {\n        normalizedEntriesNameMap[alias] = normalizedEntry;\n      }\n      normalizedAbsoluteEntries.push(normalizedEntry);\n    });\n\n    relativeEntries.forEach((entry) => {\n      const normalizedEntry = {\n        ...entry,\n        before: [],\n        after: [],\n      };\n      for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {\n        normalizedEntriesNameMap[alias] = normalizedEntry;\n      }\n      normalizedRelativeEntries.push(normalizedEntry);\n    });\n\n    normalizedRelativeEntries.forEach((entry) => {\n      if (entry.toMiddleware) {\n        const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];\n        if (toMiddleware === undefined) {\n          if (debug) {\n            return;\n          }\n          throw new Error(\n            `${entry.toMiddleware} is not found when adding ` +\n              `${getMiddlewareNameWithAliases(entry.name, entry.aliases)} ` +\n              `middleware ${entry.relation} ${entry.toMiddleware}`\n          );\n        }\n        if (entry.relation === \"after\") {\n          toMiddleware.after.push(entry);\n        }\n        if (entry.relation === \"before\") {\n          toMiddleware.before.push(entry);\n        }\n      }\n    });\n\n    const mainChain = sort(normalizedAbsoluteEntries)\n      .map(expandRelativeMiddlewareList)\n      .reduce(\n        (wholeList, expandedMiddlewareList) => {\n          // TODO: Replace it with Array.flat();\n          wholeList.push(...expandedMiddlewareList);\n          return wholeList;\n        },\n        [] as MiddlewareEntry<Input, Output>[]\n      );\n    return mainChain;\n  };\n\n  const stack: MiddlewareStack<Input, Output> = {\n    add: (middleware: MiddlewareType<Input, Output>, options: HandlerOptions & AbsoluteLocation = {}) => {\n      const { name, override, aliases: _aliases } = options;\n      const entry: AbsoluteMiddlewareEntry<Input, Output> = {\n        step: \"initialize\",\n        priority: \"normal\",\n        middleware,\n        ...options,\n      };\n      const aliases = getAllAliases(name, _aliases);\n      if (aliases.length > 0) {\n        if (aliases.some((alias) => entriesNameSet.has(alias))) {\n          if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);\n          for (const alias of aliases) {\n            const toOverrideIndex = absoluteEntries.findIndex(\n              (entry) => entry.name === alias || entry.aliases?.some((a) => a === alias)\n            );\n            if (toOverrideIndex === -1) {\n              continue;\n            }\n            const toOverride = absoluteEntries[toOverrideIndex];\n            if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {\n              throw new Error(\n                `\"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}\" middleware with ` +\n                  `${toOverride.priority} priority in ${toOverride.step} step cannot ` +\n                  `be overridden by \"${getMiddlewareNameWithAliases(name, _aliases)}\" middleware with ` +\n                  `${entry.priority} priority in ${entry.step} step.`\n              );\n            }\n            absoluteEntries.splice(toOverrideIndex, 1);\n          }\n        }\n        for (const alias of aliases) {\n          entriesNameSet.add(alias);\n        }\n      }\n      absoluteEntries.push(entry);\n    },\n\n    addRelativeTo: (middleware: MiddlewareType<Input, Output>, options: HandlerOptions & RelativeLocation) => {\n      const { name, override, aliases: _aliases } = options;\n      const entry: RelativeMiddlewareEntry<Input, Output> = {\n        middleware,\n        ...options,\n      };\n      const aliases = getAllAliases(name, _aliases);\n      if (aliases.length > 0) {\n        if (aliases.some((alias) => entriesNameSet.has(alias))) {\n          if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);\n          for (const alias of aliases) {\n            const toOverrideIndex = relativeEntries.findIndex(\n              (entry) => entry.name === alias || entry.aliases?.some((a) => a === alias)\n            );\n            if (toOverrideIndex === -1) {\n              continue;\n            }\n            const toOverride = relativeEntries[toOverrideIndex];\n            if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {\n              throw new Error(\n                `\"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}\" middleware ` +\n                  `${toOverride.relation} \"${toOverride.toMiddleware}\" middleware cannot be overridden ` +\n                  `by \"${getMiddlewareNameWithAliases(name, _aliases)}\" middleware ${entry.relation} ` +\n                  `\"${entry.toMiddleware}\" middleware.`\n              );\n            }\n            relativeEntries.splice(toOverrideIndex, 1);\n          }\n        }\n        for (const alias of aliases) {\n          entriesNameSet.add(alias);\n        }\n      }\n      relativeEntries.push(entry);\n    },\n\n    clone: () => cloneTo(constructStack<Input, Output>()),\n\n    use: (plugin: Pluggable<Input, Output>) => {\n      plugin.applyToStack(stack);\n    },\n\n    remove: (toRemove: MiddlewareType<Input, Output> | string): boolean => {\n      if (typeof toRemove === \"string\") return removeByName(toRemove);\n      else return removeByReference(toRemove);\n    },\n\n    removeByTag: (toRemove: string): boolean => {\n      let isRemoved = false;\n      const filterCb = (entry: MiddlewareEntry<Input, Output>): boolean => {\n        const { tags, name, aliases: _aliases } = entry;\n        if (tags && tags.includes(toRemove)) {\n          const aliases = getAllAliases(name, _aliases);\n          for (const alias of aliases) {\n            entriesNameSet.delete(alias);\n          }\n          isRemoved = true;\n          return false;\n        }\n        return true;\n      };\n      absoluteEntries = absoluteEntries.filter(filterCb);\n      relativeEntries = relativeEntries.filter(filterCb);\n      return isRemoved;\n    },\n\n    concat: <InputType extends Input, OutputType extends Output>(\n      from: MiddlewareStack<InputType, OutputType>\n    ): MiddlewareStack<InputType, OutputType> => {\n      const cloned = cloneTo(constructStack<InputType, OutputType>());\n      cloned.use(from);\n      cloned.identifyOnResolve(\n        identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false)\n      );\n      return cloned;\n    },\n\n    applyToStack: cloneTo,\n\n    identify: (): string[] => {\n      return getMiddlewareList(true).map((mw: MiddlewareEntry<Input, Output>) => {\n        const step =\n          mw.step ??\n          (mw as unknown as RelativeMiddlewareOptions).relation +\n            \" \" +\n            (mw as unknown as RelativeMiddlewareOptions).toMiddleware;\n        return getMiddlewareNameWithAliases(mw.name, mw.aliases) + \" - \" + step;\n      });\n    },\n\n    identifyOnResolve(toggle?: boolean) {\n      if (typeof toggle === \"boolean\") identifyOnResolve = toggle;\n      return identifyOnResolve;\n    },\n\n    resolve: <InputType extends Input, OutputType extends Output>(\n      handler: DeserializeHandler<InputType, OutputType>,\n      context: HandlerExecutionContext\n    ): Handler<InputType, OutputType> => {\n      for (const middleware of getMiddlewareList()\n        .map((entry) => entry.middleware)\n        .reverse()) {\n        handler = middleware(handler as Handler<Input, OutputType>, context) as any;\n      }\n      if (identifyOnResolve) {\n        console.log(stack.identify());\n      }\n      return handler as Handler<InputType, OutputType>;\n    },\n  };\n  return stack;\n};\n\nconst stepWeights: { [key in Step]: number } = {\n  initialize: 5,\n  serialize: 4,\n  build: 3,\n  finalizeRequest: 2,\n  deserialize: 1,\n};\n\nconst priorityWeights: { [key in Priority]: number } = {\n  high: 3,\n  normal: 2,\n  low: 1,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/middleware-stack/types.ts",
    "content": "import type { AbsoluteLocation, HandlerOptions, MiddlewareType, Priority, RelativeLocation, Step } from \"@smithy/types\";\n\nexport interface MiddlewareEntry<Input extends object, Output extends object> extends HandlerOptions {\n  middleware: MiddlewareType<Input, Output>;\n}\n\nexport interface AbsoluteMiddlewareEntry<Input extends object, Output extends object>\n  extends MiddlewareEntry<Input, Output>,\n    AbsoluteLocation {\n  step: Step;\n  priority: Priority;\n}\n\nexport interface RelativeMiddlewareEntry<Input extends object, Output extends object>\n  extends MiddlewareEntry<Input, Output>,\n    RelativeLocation {}\n\nexport type Normalized<\n  T extends MiddlewareEntry<Input, Output>,\n  Input extends object = {},\n  Output extends object = {},\n> = T & {\n  after: Normalized<RelativeMiddlewareEntry<Input, Output>, Input, Output>[];\n  before: Normalized<RelativeMiddlewareEntry<Input, Output>, Input, Output>[];\n};\n\nexport interface NormalizedRelativeEntry<Input extends object, Output extends object> extends HandlerOptions {\n  step: Step;\n  middleware: MiddlewareType<Input, Output>;\n  next?: NormalizedRelativeEntry<Input, Output>;\n  prev?: NormalizedRelativeEntry<Input, Output>;\n  priority: null;\n}\n\nexport type NamedMiddlewareEntriesMap<Input extends object, Output extends object> = Record<\n  string,\n  MiddlewareEntry<Input, Output>\n>;\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/client`.\n\n## 4.12.13\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.25\n- @smithy/core@3.23.17\n- @smithy/middleware-endpoint@4.4.32\n\n## 4.12.12\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n  - @smithy/core@3.23.16\n  - @smithy/middleware-endpoint@4.4.31\n  - @smithy/util-stream@4.5.24\n\n## 4.12.11\n\n### Patch Changes\n\n- b69e3c9: fix to set requestOptions correctly\n\n## 4.12.10\n\n### Patch Changes\n\n- 131fce4: add eventStream indicator signal for NodeHttp2ConnectionManager so it does not reuse connections for event streams\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/util-stream@4.5.23\n  - @smithy/core@3.23.15\n  - @smithy/middleware-endpoint@4.4.30\n  - @smithy/middleware-stack@4.2.14\n  - @smithy/protocol-http@5.3.14\n\n## 4.12.9\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/middleware-endpoint@4.4.29\n  - @smithy/middleware-stack@4.2.13\n  - @smithy/protocol-http@5.3.13\n  - @smithy/util-stream@4.5.22\n\n## 4.12.8\n\n### Patch Changes\n\n- Updated dependencies [7198e09]\n  - @smithy/core@3.23.13\n  - @smithy/util-stream@4.5.21\n  - @smithy/middleware-endpoint@4.4.28\n\n## 4.12.7\n\n### Patch Changes\n\n- Updated dependencies [b1f0dba]\n  - @smithy/middleware-endpoint@4.4.27\n\n## 4.12.6\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.20\n- @smithy/core@3.23.12\n- @smithy/middleware-endpoint@4.4.26\n\n## 4.12.5\n\n### Patch Changes\n\n- Updated dependencies [2edd638]\n  - @smithy/core@3.23.11\n  - @smithy/util-stream@4.5.19\n  - @smithy/middleware-endpoint@4.4.25\n\n## 4.12.4\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/core@3.23.10\n  - @smithy/types@4.13.1\n  - @smithy/middleware-endpoint@4.4.24\n  - @smithy/middleware-stack@4.2.12\n  - @smithy/protocol-http@5.3.12\n  - @smithy/util-stream@4.5.18\n\n## 4.12.3\n\n### Patch Changes\n\n- Updated dependencies [6ef5430]\n- Updated dependencies [6ef5430]\n  - @smithy/core@3.23.9\n  - @smithy/middleware-endpoint@4.4.23\n\n## 4.12.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/middleware-endpoint@4.4.22\n  - @smithy/middleware-stack@4.2.11\n  - @smithy/protocol-http@5.3.11\n  - @smithy/util-stream@4.5.17\n  - @smithy/core@3.23.8\n\n## 4.12.1\n\n### Patch Changes\n\n- Updated dependencies [11569eb]\n  - @smithy/core@3.23.7\n  - @smithy/util-stream@4.5.16\n  - @smithy/middleware-endpoint@4.4.21\n\n## 4.12.0\n\n### Minor Changes\n\n- d0954cc: allow adding new checksum algorithms via extension\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/core@3.23.6\n  - @smithy/middleware-endpoint@4.4.20\n  - @smithy/middleware-stack@4.2.10\n  - @smithy/protocol-http@5.3.10\n  - @smithy/util-stream@4.5.15\n\n## 4.11.8\n\n### Patch Changes\n\n- Updated dependencies [026b177]\n- Updated dependencies [cde9f09]\n  - @smithy/core@3.23.5\n  - @smithy/middleware-endpoint@4.4.19\n\n## 4.11.7\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/core@3.23.4\n  - @smithy/middleware-endpoint@4.4.18\n  - @smithy/middleware-stack@4.2.9\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-stream@4.5.14\n\n## 4.11.6\n\n### Patch Changes\n\n- Updated dependencies [ffe1843]\n  - @smithy/util-stream@4.5.13\n  - @smithy/core@3.23.3\n  - @smithy/middleware-endpoint@4.4.17\n\n## 4.11.5\n\n### Patch Changes\n\n- Updated dependencies [c5db01c]\n  - @smithy/core@3.23.2\n  - @smithy/middleware-endpoint@4.4.16\n\n## 4.11.4\n\n### Patch Changes\n\n- Updated dependencies [6f96c01]\n  - @smithy/core@3.23.1\n  - @smithy/middleware-endpoint@4.4.15\n\n## 4.11.3\n\n### Patch Changes\n\n- Updated dependencies [4f05c6a]\n  - @smithy/core@3.23.0\n  - @smithy/util-stream@4.5.12\n  - @smithy/middleware-endpoint@4.4.14\n\n## 4.11.2\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.11\n- @smithy/core@3.22.1\n- @smithy/middleware-endpoint@4.4.13\n\n## 4.11.1\n\n### Patch Changes\n\n- Updated dependencies [472bf01]\n  - @smithy/core@3.22.0\n  - @smithy/middleware-endpoint@4.4.12\n\n## 4.11.0\n\n### Minor Changes\n\n- 75145e5: add paginators/waiters to aggregate clients\n\n## 4.10.12\n\n### Patch Changes\n\n- Updated dependencies [fa0e0c4]\n  - @smithy/core@3.21.1\n  - @smithy/middleware-endpoint@4.4.11\n\n## 4.10.11\n\n### Patch Changes\n\n- Updated dependencies [c2a6f46]\n  - @smithy/core@3.21.0\n  - @smithy/middleware-endpoint@4.4.10\n\n## 4.10.10\n\n### Patch Changes\n\n- Updated dependencies [96cc077]\n  - @smithy/core@3.20.8\n  - @smithy/middleware-endpoint@4.4.9\n\n## 4.10.9\n\n### Patch Changes\n\n- Updated dependencies [ae6ef2e]\n  - @smithy/core@3.20.7\n  - @smithy/middleware-endpoint@4.4.8\n\n## 4.10.8\n\n### Patch Changes\n\n- Updated dependencies [862c942]\n  - @smithy/core@3.20.6\n  - @smithy/middleware-endpoint@4.4.7\n\n## 4.10.7\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/core@3.20.5\n  - @smithy/middleware-endpoint@4.4.6\n  - @smithy/middleware-stack@4.2.8\n  - @smithy/protocol-http@5.3.8\n  - @smithy/util-stream@4.5.10\n\n## 4.10.6\n\n### Patch Changes\n\n- Updated dependencies [87a5f20]\n  - @smithy/util-stream@4.5.9\n  - @smithy/core@3.20.4\n  - @smithy/middleware-endpoint@4.4.5\n\n## 4.10.5\n\n### Patch Changes\n\n- Updated dependencies [681d6c4]\n  - @smithy/core@3.20.3\n  - @smithy/middleware-endpoint@4.4.4\n\n## 4.10.4\n\n### Patch Changes\n\n- Updated dependencies [dd55f1f]\n  - @smithy/core@3.20.2\n  - @smithy/middleware-endpoint@4.4.3\n\n## 4.10.3\n\n### Patch Changes\n\n- Updated dependencies [aa954bc]\n  - @smithy/core@3.20.1\n  - @smithy/middleware-endpoint@4.4.2\n\n## 4.10.2\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/core@3.20.0\n  - @smithy/middleware-endpoint@4.4.1\n  - @smithy/middleware-stack@4.2.7\n  - @smithy/protocol-http@5.3.7\n  - @smithy/util-stream@4.5.8\n\n## 4.10.1\n\n### Patch Changes\n\n- f3a51c2: set protocol to optional on resolved config type\n- Updated dependencies [76d7994]\n  - @smithy/middleware-endpoint@4.4.0\n\n## 4.10.0\n\n### Minor Changes\n\n- 5a56762: make protocol selection easier\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/core@3.19.0\n  - @smithy/middleware-endpoint@4.3.15\n  - @smithy/middleware-stack@4.2.6\n  - @smithy/protocol-http@5.3.6\n  - @smithy/util-stream@4.5.7\n\n## 4.9.10\n\n### Patch Changes\n\n- Updated dependencies [541a18f]\n  - @smithy/core@3.18.7\n  - @smithy/middleware-endpoint@4.3.14\n\n## 4.9.9\n\n### Patch Changes\n\n- Updated dependencies [1d6db03]\n  - @smithy/core@3.18.6\n  - @smithy/middleware-endpoint@4.3.13\n\n## 4.9.8\n\n### Patch Changes\n\n- Updated dependencies [77c149f]\n  - @smithy/core@3.18.5\n  - @smithy/middleware-endpoint@4.3.12\n\n## 4.9.7\n\n### Patch Changes\n\n- Updated dependencies [e659a06]\n  - @smithy/core@3.18.4\n  - @smithy/middleware-endpoint@4.3.11\n\n## 4.9.6\n\n### Patch Changes\n\n- Updated dependencies [5bcd041]\n  - @smithy/core@3.18.3\n  - @smithy/middleware-endpoint@4.3.10\n\n## 4.9.5\n\n### Patch Changes\n\n- Updated dependencies [c8b148c]\n  - @smithy/core@3.18.2\n  - @smithy/middleware-endpoint@4.3.9\n\n## 4.9.4\n\n### Patch Changes\n\n- Updated dependencies [0976f42]\n  - @smithy/core@3.18.1\n  - @smithy/middleware-endpoint@4.3.8\n\n## 4.9.3\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n- Updated dependencies [e77f705]\n  - @smithy/types@4.9.0\n  - @smithy/core@3.18.0\n  - @smithy/middleware-endpoint@4.3.7\n  - @smithy/middleware-stack@4.2.5\n  - @smithy/protocol-http@5.3.5\n  - @smithy/util-stream@4.5.6\n\n## 4.9.2\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n- Updated dependencies [df00095]\n  - @smithy/types@4.8.1\n  - @smithy/core@3.17.2\n  - @smithy/middleware-endpoint@4.3.6\n  - @smithy/middleware-stack@4.2.4\n  - @smithy/protocol-http@5.3.4\n  - @smithy/util-stream@4.5.5\n\n## 4.9.1\n\n### Patch Changes\n\n- @smithy/util-stream@4.5.4\n- @smithy/core@3.17.1\n- @smithy/middleware-endpoint@4.3.5\n\n## 4.9.0\n\n### Minor Changes\n\n- 8a2a912: remove usage of non-static schema classes\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n- Updated dependencies [7e359e2]\n  - @smithy/types@4.8.0\n  - @smithy/core@3.17.0\n  - @smithy/util-stream@4.5.3\n  - @smithy/middleware-endpoint@4.3.4\n  - @smithy/middleware-stack@4.2.3\n  - @smithy/protocol-http@5.3.3\n\n## 4.8.1\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/core@3.16.1\n  - @smithy/types@4.7.1\n  - @smithy/middleware-endpoint@4.3.3\n  - @smithy/middleware-stack@4.2.2\n  - @smithy/protocol-http@5.3.2\n  - @smithy/util-stream@4.5.2\n\n## 4.8.0\n\n### Minor Changes\n\n- 7f8af58: generation of static schema\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n- Updated dependencies [8a2873c]\n  - @smithy/types@4.7.0\n  - @smithy/core@3.16.0\n  - @smithy/util-stream@4.5.1\n  - @smithy/middleware-endpoint@4.3.2\n  - @smithy/middleware-stack@4.2.1\n  - @smithy/protocol-http@5.3.1\n\n## 4.7.1\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/util-stream@4.5.0\n  - @smithy/core@3.15.0\n  - @smithy/middleware-endpoint@4.3.1\n\n## 4.7.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/core@3.14.0\n  - @smithy/middleware-endpoint@4.3.0\n  - @smithy/middleware-stack@4.2.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-stream@4.4.0\n\n## 4.6.5\n\n### Patch Changes\n\n- Updated dependencies [59e9952]\n  - @smithy/core@3.13.0\n  - @smithy/middleware-endpoint@4.2.5\n\n## 4.6.4\n\n### Patch Changes\n\n- Updated dependencies [97fe0d8]\n- Updated dependencies [3eb73f3]\n  - @smithy/core@3.12.0\n  - @smithy/middleware-endpoint@4.2.4\n\n## 4.6.3\n\n### Patch Changes\n\n- Updated dependencies [f8793be]\n  - @smithy/util-stream@4.3.2\n  - @smithy/core@3.11.1\n  - @smithy/middleware-endpoint@4.2.3\n\n## 4.6.2\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.2.2\n\n## 4.6.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/core@3.11.0\n  - @smithy/middleware-endpoint@4.2.1\n  - @smithy/middleware-stack@4.1.1\n  - @smithy/protocol-http@5.2.1\n  - @smithy/util-stream@4.3.1\n\n## 4.6.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/middleware-endpoint@4.2.0\n  - @smithy/middleware-stack@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/util-stream@4.3.0\n  - @smithy/types@4.4.0\n  - @smithy/core@3.10.0\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [06ac1f6]\n  - @smithy/core@3.9.2\n  - @smithy/middleware-endpoint@4.1.21\n\n## 4.5.1\n\n### Patch Changes\n\n- Updated dependencies [29fad01]\n  - @smithy/core@3.9.1\n  - @smithy/middleware-endpoint@4.1.20\n\n## 4.5.0\n\n### Minor Changes\n\n- eb1ab40: default schema log filter\n\n### Patch Changes\n\n- Updated dependencies [ab4f33f]\n- Updated dependencies [d79dc91]\n  - @smithy/core@3.9.0\n  - @smithy/middleware-endpoint@4.1.19\n\n## 4.4.10\n\n### Patch Changes\n\n- Updated dependencies [fd00602]\n- Updated dependencies [64e033f]\n  - @smithy/core@3.8.0\n  - @smithy/types@4.3.2\n  - @smithy/middleware-endpoint@4.1.18\n  - @smithy/middleware-stack@4.0.5\n  - @smithy/protocol-http@5.1.3\n  - @smithy/util-stream@4.2.4\n\n## 4.4.9\n\n### Patch Changes\n\n- Updated dependencies [f4dcba0]\n  - @smithy/core@3.7.2\n  - @smithy/middleware-endpoint@4.1.17\n\n## 4.4.8\n\n### Patch Changes\n\n- Updated dependencies [312801c]\n- Updated dependencies [bb7975e]\n  - @smithy/core@3.7.1\n  - @smithy/middleware-endpoint@4.1.16\n\n## 4.4.7\n\n### Patch Changes\n\n- Updated dependencies [bccb1b9]\n  - @smithy/middleware-endpoint@4.1.15\n\n## 4.4.6\n\n### Patch Changes\n\n- Updated dependencies [d105c97]\n- Updated dependencies [3ecb1f4]\n  - @smithy/core@3.7.0\n  - @smithy/middleware-endpoint@4.1.14\n  - @smithy/util-stream@4.2.3\n\n## 4.4.5\n\n### Patch Changes\n\n- Updated dependencies [10a0534]\n  - @smithy/core@3.6.0\n  - @smithy/middleware-endpoint@4.1.13\n\n## 4.4.4\n\n### Patch Changes\n\n- Updated dependencies [22a286e]\n  - @smithy/middleware-endpoint@4.1.12\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [4a31774]\n  - @smithy/core@3.5.3\n  - @smithy/middleware-endpoint@4.1.11\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [4642e7e]\n- Updated dependencies [147ceed]\n- Updated dependencies [ae8f1f4]\n  - @smithy/core@3.5.2\n  - @smithy/middleware-endpoint@4.1.10\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/core@3.5.1\n  - @smithy/middleware-endpoint@4.1.9\n  - @smithy/middleware-stack@4.0.4\n  - @smithy/protocol-http@5.1.2\n  - @smithy/util-stream@4.2.2\n\n## 4.4.0\n\n### Minor Changes\n\n- 23812a9: add schema property to Command class\n\n### Patch Changes\n\n- Updated dependencies [ae11e3a]\n- Updated dependencies [23812a9]\n  - @smithy/core@3.5.0\n  - @smithy/middleware-endpoint@4.1.8\n\n## 4.3.0\n\n### Minor Changes\n\n- 06b0ce8: move serde functions from smithy-client to core/serde\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n- Updated dependencies [efb27ee]\n- Updated dependencies [06b0ce8]\n  - @smithy/types@4.3.0\n  - @smithy/core@3.4.0\n  - @smithy/middleware-endpoint@4.1.7\n  - @smithy/middleware-stack@4.0.3\n  - @smithy/protocol-http@5.1.1\n  - @smithy/util-stream@4.2.1\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [786dd3a]\n  - @smithy/middleware-endpoint@4.1.6\n  - @smithy/core@3.3.3\n\n## 4.2.5\n\n### Patch Changes\n\n- @smithy/core@3.3.2\n- @smithy/middleware-endpoint@4.1.5\n\n## 4.2.4\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.4\n\n## 4.2.3\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [40ffcd5]\n  - @smithy/core@3.3.1\n  - @smithy/middleware-endpoint@4.1.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [5896264]\n  - @smithy/core@3.3.0\n  - @smithy/middleware-endpoint@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [02ef79c]\n- Updated dependencies [e917e61]\n  - @smithy/core@3.2.0\n  - @smithy/middleware-endpoint@4.1.0\n  - @smithy/protocol-http@5.1.0\n  - @smithy/util-stream@4.2.0\n  - @smithy/types@4.2.0\n  - @smithy/middleware-stack@4.0.2\n\n## 4.1.6\n\n### Patch Changes\n\n- @smithy/util-stream@4.1.2\n- @smithy/core@3.1.5\n- @smithy/middleware-endpoint@4.0.6\n\n## 4.1.5\n\n### Patch Changes\n\n- Updated dependencies [efedb20]\n  - @smithy/util-stream@4.1.1\n  - @smithy/core@3.1.4\n  - @smithy/middleware-endpoint@4.0.5\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [d1d1f72]\n  - @smithy/util-stream@4.1.0\n  - @smithy/core@3.1.3\n  - @smithy/middleware-endpoint@4.0.4\n\n## 4.1.3\n\n### Patch Changes\n\n- @smithy/core@3.1.2\n- @smithy/middleware-endpoint@4.0.3\n\n## 4.1.2\n\n### Patch Changes\n\n- @smithy/util-stream@4.0.2\n- @smithy/core@3.1.1\n- @smithy/middleware-endpoint@4.0.2\n\n## 4.1.1\n\n### Patch Changes\n\n- e87f2b3: prototype chain fallback for service exception\n\n## 4.1.0\n\n### Minor Changes\n\n- 292c134: adds support for instanceof operator for ServiceException class\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/core@3.1.0\n  - @smithy/middleware-endpoint@4.0.1\n  - @smithy/middleware-stack@4.0.1\n  - @smithy/protocol-http@5.0.1\n  - @smithy/util-stream@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/middleware-endpoint@4.0.0\n  - @smithy/util-stream@4.0.0\n  - @smithy/core@3.0.0\n  - @smithy/middleware-stack@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n\n## 3.7.0\n\n### Minor Changes\n\n- a0e71d5: fix(smithy-client): remove support for instanceof operator\n\n### Patch Changes\n\n- @smithy/util-stream@3.3.4\n- @smithy/core@2.5.7\n- @smithy/middleware-endpoint@3.2.8\n\n## 3.6.0\n\n### Minor Changes\n\n- 23129d9: feat: type check helper method to to know if something is an instance of the ServiceException class\n\n## 3.5.2\n\n### Patch Changes\n\n- @smithy/util-stream@3.3.3\n- @smithy/core@2.5.6\n- @smithy/middleware-endpoint@3.2.7\n\n## 3.5.1\n\n### Patch Changes\n\n- 7f17426: fix new operator typing for LazyJsonString\n- Updated dependencies [e27d42d]\n  - @smithy/middleware-endpoint@3.2.6\n\n## 3.5.0\n\n### Minor Changes\n\n- 70275bd: remove String extension in LazyJsonString\n\n## 3.4.6\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/core@2.5.5\n  - @smithy/middleware-endpoint@3.2.5\n  - @smithy/middleware-stack@3.0.11\n  - @smithy/protocol-http@4.1.8\n  - @smithy/util-stream@3.3.2\n\n## 3.4.5\n\n### Patch Changes\n\n- Updated dependencies [9c40f7b]\n  - @smithy/core@2.5.4\n  - @smithy/middleware-endpoint@3.2.4\n\n## 3.4.4\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/core@2.5.3\n  - @smithy/middleware-endpoint@3.2.3\n  - @smithy/middleware-stack@3.0.10\n  - @smithy/protocol-http@4.1.7\n  - @smithy/util-stream@3.3.1\n\n## 3.4.3\n\n### Patch Changes\n\n- Updated dependencies [c8d257b]\n- Updated dependencies [c6ef519]\n- Updated dependencies [cd1929b]\n  - @smithy/util-stream@3.3.0\n  - @smithy/core@2.5.2\n  - @smithy/types@3.7.0\n  - @smithy/middleware-endpoint@3.2.2\n  - @smithy/middleware-stack@3.0.9\n  - @smithy/protocol-http@4.1.6\n\n## 3.4.2\n\n### Patch Changes\n\n- Updated dependencies [ccdd49f]\n  - @smithy/util-stream@3.2.1\n  - @smithy/core@2.5.1\n  - @smithy/middleware-endpoint@3.2.1\n\n## 3.4.1\n\n### Patch Changes\n\n- d07b0ab: reorganize smithy/core to be upstream of smithy/smithy-client\n- Updated dependencies [f4e0bd9]\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n- Updated dependencies [d07b0ab]\n  - @smithy/util-stream@3.2.0\n  - @smithy/types@3.6.0\n  - @smithy/core@2.5.0\n  - @smithy/middleware-endpoint@3.2.0\n  - @smithy/middleware-stack@3.0.8\n  - @smithy/protocol-http@4.1.5\n\n## 3.4.0\n\n### Minor Changes\n\n- 75e0125: add quoteHeader function\n\n## 3.3.6\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/middleware-endpoint@3.1.4\n  - @smithy/middleware-stack@3.0.7\n  - @smithy/protocol-http@4.1.4\n  - @smithy/util-stream@3.1.9\n\n## 3.3.5\n\n### Patch Changes\n\n- 64600d8: serialize empty strings and collections in headers\n\n## 3.3.4\n\n### Patch Changes\n\n- @smithy/util-stream@3.1.8\n\n## 3.3.3\n\n### Patch Changes\n\n- @smithy/util-stream@3.1.7\n\n## 3.3.2\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/middleware-endpoint@3.1.3\n  - @smithy/middleware-stack@3.0.6\n  - @smithy/protocol-http@4.1.3\n  - @smithy/util-stream@3.1.6\n\n## 3.3.1\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/util-stream@3.1.5\n  - @smithy/middleware-endpoint@3.1.2\n  - @smithy/middleware-stack@3.0.5\n  - @smithy/protocol-http@4.1.2\n\n## 3.3.0\n\n### Minor Changes\n\n- d8df7bf: add client handler caching\n\n### Patch Changes\n\n- Updated dependencies [c8c53ae]\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/middleware-endpoint@3.1.1\n  - @smithy/types@3.4.0\n  - @smithy/util-stream@3.1.4\n  - @smithy/middleware-stack@3.0.4\n  - @smithy/protocol-http@4.1.1\n\n## 3.2.0\n\n### Minor Changes\n\n- 5865b65: handle timestamp cbor tag\n\n## 3.1.12\n\n### Patch Changes\n\n- 670553a: add command instance ref to smithy context\n\n## 3.1.11\n\n### Patch Changes\n\n- @smithy/util-stream@3.1.3\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [4a40961]\n- Updated dependencies [86862ea]\n  - @smithy/middleware-endpoint@3.1.0\n  - @smithy/protocol-http@4.1.0\n  - @smithy/util-stream@3.1.2\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [1cfe243]\n  - @smithy/util-stream@3.1.1\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n- Updated dependencies [7cd258f]\n  - @smithy/protocol-http@4.0.4\n  - @smithy/util-stream@3.1.0\n\n## 3.1.7\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.0.5\n\n## 3.1.6\n\n### Patch Changes\n\n- @smithy/util-stream@3.0.6\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/util-stream@3.0.5\n  - @smithy/middleware-endpoint@3.0.4\n  - @smithy/middleware-stack@3.0.3\n  - @smithy/protocol-http@4.0.3\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/util-stream@3.0.4\n  - @smithy/middleware-endpoint@3.0.3\n  - @smithy/middleware-stack@3.0.2\n  - @smithy/protocol-http@4.0.2\n\n## 3.1.3\n\n### Patch Changes\n\n- @smithy/util-stream@3.0.3\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/middleware-endpoint@3.0.2\n  - @smithy/middleware-stack@3.0.1\n  - @smithy/protocol-http@4.0.1\n  - @smithy/util-stream@3.0.2\n\n## 3.1.1\n\n### Patch Changes\n\n- 3689c949: truncate timestamp ending in 000 milliseconds\n\n## 3.1.0\n\n### Minor Changes\n\n- 764047eb: add dateTime serializer function\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- @smithy/util-stream@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [3500f341]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-stream@3.0.0\n  - @smithy/middleware-endpoint@3.0.0\n  - @smithy/middleware-stack@3.0.0\n  - @smithy/protocol-http@4.0.0\n\n## 2.5.1\n\n### Patch Changes\n\n- Updated dependencies [cc54b8d1]\n  - @smithy/middleware-endpoint@2.5.1\n\n## 2.5.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- 661f1d60: allow command constructor argument to be omitted if no required members\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/middleware-endpoint@2.5.0\n  - @smithy/middleware-stack@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/util-stream@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.4.5\n\n### Patch Changes\n\n- @smithy/util-stream@2.1.5\n\n## 2.4.4\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.4.6\n\n## 2.4.3\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/middleware-endpoint@2.4.5\n  - @smithy/util-stream@2.1.4\n  - @smithy/middleware-stack@2.1.4\n  - @smithy/protocol-http@3.2.2\n\n## 2.4.2\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.4.4\n\n## 2.4.1\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/middleware-endpoint@2.4.3\n  - @smithy/middleware-stack@2.1.3\n  - @smithy/protocol-http@3.2.1\n  - @smithy/util-stream@2.1.3\n\n## 2.4.0\n\n### Minor Changes\n\n- 929801bc: allow constructor parameters pass-through when initializing requestHandler\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/util-stream@2.1.2\n  - @smithy/middleware-endpoint@2.4.2\n  - @smithy/middleware-stack@2.1.2\n\n## 2.3.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/middleware-endpoint@2.4.1\n  - @smithy/middleware-stack@2.1.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/types@2.9.1\n  - @smithy/util-stream@2.1.1\n\n## 2.3.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/middleware-endpoint@2.4.0\n  - @smithy/middleware-stack@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/util-stream@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.2.1\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/middleware-endpoint@2.3.0\n  - @smithy/types@2.8.0\n  - @smithy/middleware-stack@2.0.10\n  - @smithy/protocol-http@3.0.12\n  - @smithy/util-stream@2.0.24\n\n## 2.2.0\n\n### Minor Changes\n\n- 164f3bbd: add Command classBuilder\n\n### Patch Changes\n\n- 164f3bbd: add missing dependency declarations\n\n## 2.1.18\n\n### Patch Changes\n\n- @smithy/util-stream@2.0.23\n\n## 2.1.17\n\n### Patch Changes\n\n- 07ff207b: apply json default filtering when walking through arrays\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/util-stream@2.0.22\n  - @smithy/middleware-stack@2.0.9\n\n## 2.1.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/middleware-stack@2.0.8\n  - @smithy/util-stream@2.0.21\n\n## 2.1.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/middleware-stack@2.0.7\n  - @smithy/util-stream@2.0.20\n\n## 2.1.14\n\n### Patch Changes\n\n- @smithy/util-stream@2.0.19\n\n## 2.1.13\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-stream@2.0.18\n\n## 2.1.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/middleware-stack@2.0.6\n  - @smithy/util-stream@2.0.17\n\n## 2.1.11\n\n### Patch Changes\n\n- @smithy/util-stream@2.0.16\n\n## 2.1.10\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/middleware-stack@2.0.5\n  - @smithy/util-stream@2.0.15\n\n## 2.1.9\n\n### Patch Changes\n\n- @smithy/util-stream@2.0.14\n\n## 2.1.8\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/middleware-stack@2.0.4\n  - @smithy/types@2.3.4\n  - @smithy/util-stream@2.0.13\n\n## 2.1.7\n\n### Patch Changes\n\n- Updated dependencies [20fc148d]\n  - @smithy/middleware-stack@2.0.3\n\n## 2.1.6\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/middleware-stack@2.0.2\n  - @smithy/types@2.3.3\n  - @smithy/util-stream@2.0.12\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [99fc0b4c]\n- Updated dependencies [e6ea6bd5]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/util-stream@2.0.11\n  - @smithy/middleware-stack@2.0.1\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.10\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [d491b770]\n  - @smithy/util-stream@2.0.9\n\n## 2.1.2\n\n### Patch Changes\n\n- @smithy/util-stream@2.0.8\n\n## 2.1.1\n\n### Patch Changes\n\n- @smithy/util-stream@2.0.7\n\n## 2.1.0\n\n### Minor Changes\n\n- 88bcec3d: Add retry to runtime extension\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- b753dd4c: move extensions code to smithy-client\n- 6c8ffa27: Rename defaultClientConfiguration to defaultExtensionConfiguration\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n- Updated dependencies [1be3c4c9]\n  - @smithy/types@2.2.2\n  - @smithy/util-stream@2.0.5\n  - @smithy/middleware-stack@2.0.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/middleware-stack@2.0.0\n  - @smithy/util-stream@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/middleware-stack@1.1.0\n  - @smithy/types@1.2.0\n  - @smithy/util-stream@1.1.0\n\n## 1.0.5\n\n### Patch Changes\n\n- Updated dependencies [99d00e98]\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/util-stream@1.0.3\n  - @smithy/types@2.0.0\n  - @smithy/middleware-stack@1.0.2\n\n## 1.0.4\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/middleware-stack@1.0.2\n  - @smithy/util-stream@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.3\n\n### Patch Changes\n\n- @smithy/util-stream@1.0.1\n\n## 1.0.2\n\n### Patch Changes\n\n- Migrate util-stream, add collect-body-stream\n- Updated dependencies\n  - @smithy/util-stream@1.0.0\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/middleware-stack@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/smithy-client](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/NoOpLogger.ts",
    "content": "import type { Logger } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport class NoOpLogger implements Logger {\n  public trace() {}\n  public debug() {}\n  public info() {}\n  public warn() {}\n  public error() {}\n}\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/client.spec.ts",
    "content": "import { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { Client } from \"./client\";\n\ndescribe(\"SmithyClient\", () => {\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  const mockHandler = vi.fn((args: any) => Promise.resolve({ output: \"foo\" }));\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  const mockResolveMiddleware = vi.fn((args) => mockHandler);\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  const getCommandWithOutput = (output: string) => ({\n    resolveMiddleware: mockResolveMiddleware,\n  });\n  const client = new Client({ cacheMiddleware: true } as any);\n\n  beforeEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should return response promise when only command is supplied\", async () => {\n    expect.assertions(1);\n    await expect(client.send(getCommandWithOutput(\"foo\") as any)).resolves.toEqual(\"foo\");\n  });\n\n  it(\"should return response promise when command and options is supplied\", async () => {\n    expect.assertions(3);\n    const options = {\n      AbortSignal: \"bar\",\n    };\n    await expect(client.send(getCommandWithOutput(\"foo\") as any, options)).resolves.toEqual(\"foo\");\n    expect(mockResolveMiddleware.mock.calls.length).toEqual(1);\n    expect(mockResolveMiddleware.mock.calls[0][2 as any]).toEqual(options);\n  });\n\n  it(\"should apply callback when command and callback is supplied\", async () => {\n    let resolve: Function;\n    const promise = new Promise((r) => (resolve = r));\n    const callback = vi.fn((err, response) => {\n      expect(response).toEqual(\"foo\");\n      resolve();\n    });\n    client.send(getCommandWithOutput(\"foo\") as any, callback);\n    await promise;\n  });\n\n  it(\"should apply callback when command, options and callback is supplied\", async () => {\n    let resolve: Function;\n    const promise = new Promise((r) => (resolve = r));\n    const callback = vi.fn((err, response) => {\n      expect(response).toEqual(\"foo\");\n      expect(mockResolveMiddleware.mock.calls.length).toEqual(1);\n      expect(mockResolveMiddleware.mock.calls[0][2 as any]).toEqual(options);\n      resolve();\n    });\n    const options = {\n      AbortSignal: \"bar\",\n    };\n    client.send(getCommandWithOutput(\"foo\") as any, options, callback);\n    await promise;\n  });\n\n  describe(\"handler caching\", () => {\n    beforeEach(() => {\n      delete (client as any).handlers;\n    });\n\n    const privateAccess = () => (client as any).handlers;\n\n    it(\"should cache the resolved handler\", async () => {\n      await expect(client.send(getCommandWithOutput(\"foo\") as any)).resolves.toEqual(\"foo\");\n      expect(privateAccess().get({}.constructor)).toBeDefined();\n    });\n\n    it(\"should not cache the resolved handler if called with request options\", async () => {\n      await expect(client.send(getCommandWithOutput(\"foo\") as any, {})).resolves.toEqual(\"foo\");\n      expect(privateAccess()).toBeUndefined();\n    });\n\n    it(\"unsets the cache if client.destroy() is called.\", async () => {\n      await expect(client.send(getCommandWithOutput(\"foo\") as any)).resolves.toEqual(\"foo\");\n      client.destroy();\n      expect(privateAccess()).toBeUndefined();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/client.ts",
    "content": "import type {\n  $ClientProtocol,\n  $ClientProtocolCtor,\n  ClientProtocol,\n  ClientProtocolCtor,\n  Command,\n  FetchHttpHandlerOptions,\n  Handler,\n  Client as IClient,\n  MetadataBearer,\n  MiddlewareStack,\n  NodeHttpHandlerOptions,\n  RequestHandler,\n} from \"@smithy/types\";\n\nimport { constructStack } from \"../middleware-stack/MiddlewareStack\";\n\n/**\n * @public\n */\nexport interface SmithyConfiguration<HandlerOptions> {\n  /**\n   * @public\n   */\n  requestHandler:\n    | RequestHandler<any, any, HandlerOptions>\n    | NodeHttpHandlerOptions\n    | FetchHttpHandlerOptions\n    | Record<string, unknown>;\n\n  /**\n   * Default false.\n   * When true, the client will only resolve the middleware stack once per\n   * Command class. This means modifying the middlewareStack of the\n   * command or client after requests have been made will not be\n   * recognized.\n   * Calling client.destroy() also clears this cache.\n   * Enable this only if needing the additional time saved (0-1ms per request)\n   * and not needing middleware modifications between requests.\n   *\n   * @public\n   */\n  cacheMiddleware?: boolean;\n\n  /**\n   * A client request/response protocol or constructor of one.\n   * A protocol in this context is not e.g. https.\n   * It is the combined implementation of how to (de)serialize and create\n   * the messages (e.g. http requests/responses) that are being exchanged.\n   *\n   * @public\n   */\n  protocol?:\n    | ClientProtocol<any, any>\n    | $ClientProtocol<any, any>\n    | ClientProtocolCtor<any, any>\n    | $ClientProtocolCtor<any, any>;\n\n  /**\n   * These are automatically generated and will be passed to the\n   * config.protocol if given as a constructor.\n   * @internal\n   */\n  protocolSettings?: {\n    defaultNamespace?: string;\n    [setting: string]: unknown;\n  };\n\n  /**\n   * The API version set internally by the SDK, and is\n   * not planned to be used by customer code.\n   * @internal\n   */\n  readonly apiVersion: string;\n}\n\n/**\n * @internal\n */\nexport type SmithyResolvedConfiguration<HandlerOptions> = {\n  requestHandler: RequestHandler<any, any, HandlerOptions>;\n  cacheMiddleware?: boolean;\n  protocol?: ClientProtocol<any, any> | $ClientProtocol<any, any>;\n  protocolSettings?: {\n    defaultNamespace?: string;\n    [setting: string]: unknown;\n  };\n  readonly apiVersion: string;\n};\n\n/**\n * @public\n */\nexport class Client<\n  HandlerOptions,\n  ClientInput extends object,\n  ClientOutput extends MetadataBearer,\n  ResolvedClientConfiguration extends SmithyResolvedConfiguration<HandlerOptions>,\n> implements IClient<ClientInput, ClientOutput, ResolvedClientConfiguration>\n{\n  public middlewareStack: MiddlewareStack<ClientInput, ClientOutput> = constructStack<ClientInput, ClientOutput>();\n\n  /**\n   * Holds an object reference to the initial configuration object.\n   * Used to check that the config resolver stack does not create\n   * dangling instances of an intermediate form of the configuration object.\n   *\n   * @internal\n   */\n  public initConfig?: object;\n\n  /**\n   * May be used to cache the resolved handler function for a Command class.\n   */\n  private handlers?: WeakMap<Function, Handler<any, any>> | undefined;\n\n  constructor(public readonly config: ResolvedClientConfiguration) {\n    const { protocol, protocolSettings } = config;\n    if (protocolSettings) {\n      if (typeof protocol === \"function\") {\n        // assumed to be a constructor\n        config.protocol = new (protocol as any)(protocolSettings);\n      }\n    }\n  }\n\n  send<InputType extends ClientInput, OutputType extends ClientOutput>(\n    command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>,\n    options?: HandlerOptions\n  ): Promise<OutputType>;\n  send<InputType extends ClientInput, OutputType extends ClientOutput>(\n    command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>,\n    cb: (err: any, data?: OutputType) => void\n  ): void;\n  send<InputType extends ClientInput, OutputType extends ClientOutput>(\n    command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>,\n    options: HandlerOptions,\n    cb: (err: any, data?: OutputType) => void\n  ): void;\n  send<InputType extends ClientInput, OutputType extends ClientOutput>(\n    command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>,\n    optionsOrCb?: HandlerOptions | ((err: any, data?: OutputType) => void),\n    cb?: (err: any, data?: OutputType) => void\n  ): Promise<OutputType> | void {\n    const options = typeof optionsOrCb !== \"function\" ? optionsOrCb : undefined;\n    const callback = typeof optionsOrCb === \"function\" ? (optionsOrCb as (err: any, data?: OutputType) => void) : cb;\n\n    const useHandlerCache = options === undefined && this.config.cacheMiddleware === true;\n\n    let handler: Handler<any, any>;\n\n    if (useHandlerCache) {\n      if (!this.handlers) {\n        this.handlers = new WeakMap();\n      }\n      const handlers = this.handlers!;\n\n      if (handlers.has(command.constructor)) {\n        handler = handlers.get(command.constructor)!;\n      } else {\n        handler = command.resolveMiddleware(this.middlewareStack as any, this.config, options);\n        handlers.set(command.constructor, handler);\n      }\n    } else {\n      delete this.handlers;\n      handler = command.resolveMiddleware(this.middlewareStack as any, this.config, options);\n    }\n\n    if (callback) {\n      handler(command)\n        .then(\n          (result) => callback(null, result.output),\n          (err: any) => callback(err)\n        )\n        .catch(\n          // prevent any errors thrown in the callback from triggering an\n          // unhandled promise rejection\n          () => {}\n        );\n    } else {\n      return handler(command).then((result) => result.output);\n    }\n  }\n\n  destroy() {\n    this.config?.requestHandler?.destroy?.();\n    delete this.handlers;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/command.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { Command } from \"./command\";\n\ndescribe(Command.name, () => {\n  it(\"has optional argument if the input type has no required members\", async () => {\n    type OptionalInput = {\n      key?: string;\n      optional?: string;\n    };\n\n    type RequiredInput = {\n      key: string | undefined;\n      optional?: string;\n    };\n\n    class WithRequiredInputCommand extends Command.classBuilder<RequiredInput, any, any, any, any>().build() {}\n\n    class WithOptionalInputCommand extends Command.classBuilder<OptionalInput, any, any, any, any>().build() {}\n\n    new WithRequiredInputCommand({ key: \"1\" });\n\n    new WithOptionalInputCommand(); // expect no type error.\n  });\n  it(\"implements a classBuilder\", async () => {\n    class MyCommand extends Command.classBuilder<any, any, any, any, any>()\n      .ep({\n        Endpoint: { type: \"builtInParams\", name: \"Endpoint\" },\n      })\n      .m(function () {\n        return [];\n      })\n      .s(\"SmithyMyClient\", \"SmithyMyOperation\", {})\n      .n(\"MyClient\", \"MyCommand\")\n      .f()\n      .ser(async (_) => _)\n      .de(async (_) => _)\n      .build() {}\n\n    const myCommand = new MyCommand({\n      Prop: \"prop1\",\n    });\n\n    expect(myCommand).toBeInstanceOf(Command);\n    expect(myCommand).toBeInstanceOf(MyCommand);\n    expect(MyCommand.getEndpointParameterInstructions()).toEqual({\n      Endpoint: { type: \"builtInParams\", name: \"Endpoint\" },\n    });\n    expect(myCommand.input).toEqual({\n      Prop: \"prop1\",\n    });\n\n    // private method exists for compatibility\n    expect((myCommand as any).serialize).toBeDefined();\n\n    // private method exists for compatibility\n    expect((myCommand as any).deserialize).toBeDefined();\n  });\n\n  it(\"should spread requestOptions correctly for event stream commands\", async () => {\n    const handleFn = vi.fn().mockResolvedValue({ response: {} });\n\n    class MyEventStreamCommand extends Command.classBuilder<any, any, any, any, any>()\n      .m(function () {\n        return [];\n      })\n      .s(\"MyClient\", \"MyOp\", { eventStream: true })\n      .n(\"MyClient\", \"MyOp\")\n      .f()\n      .ser(async (_) => ({ ..._, headers: {}, method: \"POST\", protocol: \"https:\", hostname: \"localhost\", path: \"/\" }))\n      .de(async (_) => ({ $metadata: {} }))\n      .build() {}\n\n    const cmd = new MyEventStreamCommand({});\n    const handler = cmd.resolveMiddleware(\n      { concat: () => ({ resolve: (fn: any, ctx: any) => fn }) } as any,\n      {\n        logger: {} as any,\n        requestHandler: { handle: handleFn },\n      },\n      { requestTimeout: 5000 }\n    );\n\n    await handler({ input: {} });\n\n    expect(handleFn).toHaveBeenCalledTimes(1);\n    const passedOptions = handleFn.mock.calls[0][1];\n    expect(passedOptions).toEqual({\n      isEventStream: true,\n      requestTimeout: 5000,\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/command.ts",
    "content": "import type { HttpRequest } from \"@smithy/core/protocols\";\nimport {\n  SMITHY_CONTEXT_KEY,\n  type FinalizeHandlerArguments,\n  type Handler,\n  type HandlerExecutionContext,\n  type Command as ICommand,\n  type HttpRequest as IHttpRequest,\n  type HttpResponse as IHttpResponse,\n  type MiddlewareStack as IMiddlewareStack,\n  type Logger,\n  type MetadataBearer,\n  type Mutable,\n  type OperationSchema,\n  type OptionalParameter,\n  type Pluggable,\n  type RequestHandler,\n  type SerdeContext,\n  type StaticOperationSchema,\n} from \"@smithy/types\";\n\nimport { constructStack } from \"../middleware-stack/MiddlewareStack\";\nimport { schemaLogFilter } from \"./schemaLogFilter\";\n\n// EndpointParameterInstructions inlined to avoid circular dependency with @smithy/middleware-endpoint.\ntype EndpointParameterInstructions = Record<string, unknown>;\n\n/**\n * @public\n */\nexport abstract class Command<\n  Input extends ClientInput,\n  Output extends ClientOutput,\n  ResolvedClientConfiguration,\n  ClientInput extends object = any,\n  ClientOutput extends MetadataBearer = any,\n> implements ICommand<ClientInput, Input, ClientOutput, Output, ResolvedClientConfiguration>\n{\n  public abstract input: Input;\n  public readonly middlewareStack: IMiddlewareStack<Input, Output> = constructStack<Input, Output>();\n  public readonly schema?: OperationSchema | StaticOperationSchema;\n\n  /**\n   * Factory for Command ClassBuilder.\n   * @internal\n   */\n  public static classBuilder<\n    I extends SI,\n    O extends SO,\n    C extends { logger: Logger; requestHandler: RequestHandler<any, any, any> },\n    SI extends object = any,\n    SO extends MetadataBearer = any,\n  >() {\n    return new ClassBuilder<I, O, C, SI, SO>();\n  }\n\n  abstract resolveMiddleware(\n    stack: IMiddlewareStack<ClientInput, ClientOutput>,\n    configuration: ResolvedClientConfiguration,\n    options: any\n  ): Handler<Input, Output>;\n\n  /**\n   * @internal\n   */\n  public resolveMiddlewareWithContext(\n    clientStack: IMiddlewareStack<any, any>,\n    configuration: { logger: Logger; requestHandler: RequestHandler<any, any, any> },\n    options: any,\n    {\n      middlewareFn,\n      clientName,\n      commandName,\n      inputFilterSensitiveLog,\n      outputFilterSensitiveLog,\n      smithyContext,\n      additionalContext,\n      CommandCtor,\n    }: ResolveMiddlewareContextArgs\n  ) {\n    for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {\n      this.middlewareStack.use(mw);\n    }\n    const stack = clientStack.concat(this.middlewareStack);\n    const { logger } = configuration;\n    const handlerExecutionContext: HandlerExecutionContext = {\n      logger,\n      clientName,\n      commandName,\n      inputFilterSensitiveLog,\n      outputFilterSensitiveLog,\n      [SMITHY_CONTEXT_KEY]: {\n        commandInstance: this,\n        ...smithyContext,\n      },\n      ...additionalContext,\n    };\n    const { requestHandler } = configuration;\n    let requestOptions = options ?? {};\n    if (smithyContext.eventStream) {\n      requestOptions = {\n        isEventStream: true,\n        ...requestOptions,\n      };\n    }\n    return stack.resolve(\n      (request: FinalizeHandlerArguments<any>) => requestHandler.handle(request.request as HttpRequest, requestOptions),\n      handlerExecutionContext\n    );\n  }\n}\n\n/**\n * @internal\n */\ntype ResolveMiddlewareContextArgs = {\n  middlewareFn: (CommandCtor: any, clientStack: any, config: any, options: any) => Pluggable<any, any>[];\n  clientName: string;\n  commandName: string;\n  smithyContext: Record<string, unknown>;\n  additionalContext: HandlerExecutionContext;\n  inputFilterSensitiveLog: (_: any) => any;\n  outputFilterSensitiveLog: (_: any) => any;\n  CommandCtor: any /* Command constructor */;\n};\n\n/**\n * @internal\n */\nclass ClassBuilder<\n  I extends SI,\n  O extends SO,\n  C extends { logger: Logger; requestHandler: RequestHandler<any, any, any> },\n  SI extends object = any,\n  SO extends MetadataBearer = any,\n> {\n  private _init: (_: Command<I, O, C, SI, SO>) => void = () => {};\n  private _ep: EndpointParameterInstructions = {};\n  private _middlewareFn: (CommandCtor: any, clientStack: any, config: any, options: any) => Pluggable<any, any>[] =\n    () => [];\n  private _commandName = \"\";\n  private _clientName = \"\";\n  private _additionalContext = {} as HandlerExecutionContext;\n  private _smithyContext = {} as Record<string, unknown>;\n  private _inputFilterSensitiveLog: any = undefined;\n  private _outputFilterSensitiveLog: any = undefined;\n  private _serializer: (input: I, context: SerdeContext | any) => Promise<IHttpRequest> = null as any;\n  private _deserializer: (output: IHttpResponse, context: SerdeContext | any) => Promise<O> = null as any;\n  private _operationSchema?: OperationSchema | StaticOperationSchema;\n\n  /**\n   * Optional init callback.\n   */\n  public init(cb: (_: Command<I, O, C, SI, SO>) => void) {\n    this._init = cb;\n  }\n  /**\n   * Set the endpoint parameter instructions.\n   */\n  public ep(endpointParameterInstructions: EndpointParameterInstructions): ClassBuilder<I, O, C, SI, SO> {\n    this._ep = endpointParameterInstructions;\n    return this;\n  }\n  /**\n   * Add any number of middleware.\n   */\n  public m(\n    middlewareSupplier: (CommandCtor: any, clientStack: any, config: any, options: any) => Pluggable<any, any>[]\n  ): ClassBuilder<I, O, C, SI, SO> {\n    this._middlewareFn = middlewareSupplier;\n    return this;\n  }\n  /**\n   * Set the initial handler execution context Smithy field.\n   */\n  public s(\n    service: string,\n    operation: string,\n    smithyContext: Record<string, unknown> = {}\n  ): ClassBuilder<I, O, C, SI, SO> {\n    this._smithyContext = {\n      service,\n      operation,\n      ...smithyContext,\n    };\n    return this;\n  }\n  /**\n   * Set the initial handler execution context.\n   */\n  public c(additionalContext: HandlerExecutionContext = {}): ClassBuilder<I, O, C, SI, SO> {\n    this._additionalContext = additionalContext;\n    return this;\n  }\n  /**\n   * Set constant string identifiers for the operation.\n   */\n  public n(clientName: string, commandName: string): ClassBuilder<I, O, C, SI, SO> {\n    this._clientName = clientName;\n    this._commandName = commandName;\n    return this;\n  }\n  /**\n   * Set the input and output sensistive log filters.\n   */\n  public f(\n    inputFilter: (_: any) => any = (_) => _,\n    outputFilter: (_: any) => any = (_) => _\n  ): ClassBuilder<I, O, C, SI, SO> {\n    this._inputFilterSensitiveLog = inputFilter;\n    this._outputFilterSensitiveLog = outputFilter;\n    return this;\n  }\n  /**\n   * Sets the serializer.\n   */\n  public ser(\n    serializer: (input: I, context?: SerdeContext | any) => Promise<IHttpRequest>\n  ): ClassBuilder<I, O, C, SI, SO> {\n    this._serializer = serializer;\n    return this;\n  }\n  /**\n   * Sets the deserializer.\n   */\n  public de(\n    deserializer: (output: IHttpResponse, context?: SerdeContext | any) => Promise<O>\n  ): ClassBuilder<I, O, C, SI, SO> {\n    this._deserializer = deserializer;\n    return this;\n  }\n\n  /**\n   * Sets input/output schema for the operation.\n   */\n  public sc(operation: OperationSchema | StaticOperationSchema): ClassBuilder<I, O, C, SI, SO> {\n    this._operationSchema = operation;\n    this._smithyContext.operationSchema = operation;\n    return this;\n  }\n\n  /**\n   * @returns a Command class with the classBuilder properties.\n   */\n  public build(): {\n    new (input: I): CommandImpl<I, O, C, SI, SO>;\n    new (...[input]: OptionalParameter<I>): CommandImpl<I, O, C, SI, SO>;\n    getEndpointParameterInstructions(): EndpointParameterInstructions;\n  } {\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const closure = this;\n    let CommandRef: any;\n\n    return (CommandRef = class extends Command<I, O, C, SI, SO> {\n      public readonly input: I;\n\n      /**\n       * @public\n       */\n      public static getEndpointParameterInstructions(): EndpointParameterInstructions {\n        return closure._ep;\n      }\n\n      /**\n       * @public\n       */\n      public constructor(...[input]: OptionalParameter<I>) {\n        super();\n        this.input = input ?? ({} as unknown as I);\n        closure._init(this);\n        (this as Mutable<typeof this>).schema = closure._operationSchema;\n      }\n\n      /**\n       * @internal\n       */\n      public resolveMiddleware(stack: IMiddlewareStack<any, any>, configuration: C, options: any): Handler<any, any> {\n        const op = closure._operationSchema;\n        const input = (op as StaticOperationSchema)?.[4] ?? (op as OperationSchema)?.input;\n        const output = (op as StaticOperationSchema)?.[5] ?? (op as OperationSchema)?.output;\n\n        return this.resolveMiddlewareWithContext(stack, configuration, options, {\n          CommandCtor: CommandRef,\n          middlewareFn: closure._middlewareFn,\n          clientName: closure._clientName,\n          commandName: closure._commandName,\n          inputFilterSensitiveLog:\n            closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _),\n          outputFilterSensitiveLog:\n            closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _),\n          smithyContext: closure._smithyContext,\n          additionalContext: closure._additionalContext,\n        });\n      }\n\n      /**\n       * @internal\n       */\n      // @ts-ignore used in middlewareFn closure.\n      public serialize = closure._serializer;\n\n      /**\n       * @internal\n       */\n      // @ts-ignore used in middlewareFn closure.\n      public deserialize = closure._deserializer;\n    });\n  }\n}\n\n/**\n * A concrete implementation of ICommand with no abstract members.\n * @public\n */\nexport interface CommandImpl<\n  I extends SI,\n  O extends SO,\n  C extends { logger: Logger; requestHandler: RequestHandler<any, any, any> },\n  SI extends object = any,\n  SO extends MetadataBearer = any,\n> extends Command<I, O, C, SI, SO> {\n  readonly input: I;\n  resolveMiddleware(stack: IMiddlewareStack<SI, SO>, configuration: C, options: any): Handler<I, O>;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/constants.ts",
    "content": "/**\n * @internal\n */\nexport const SENSITIVE_STRING = \"***SensitiveInformation***\";\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/create-aggregated-client.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { createAggregatedClient } from \"./create-aggregated-client\";\n\nclass BaseClient {\n  send = vi.fn() as any;\n}\nclass AggregatedClient extends BaseClient {\n  constructor(commands: Record<string, any>) {\n    super();\n    createAggregatedClient(commands, AggregatedClient as any);\n  }\n}\nclass UserClient extends AggregatedClient {}\n\ndescribe(createAggregatedClient.name, () => {\n  it(\"extends its base client\", async () => {\n    const commands = {\n      ActionCommand: vi.fn(),\n    };\n\n    const aggregatedClient: any = new AggregatedClient(commands);\n\n    expect(aggregatedClient).toBeInstanceOf(BaseClient);\n    expect(aggregatedClient).toBeInstanceOf(AggregatedClient);\n  });\n\n  it(\"is extensible\", async () => {\n    const commands = {\n      ActionCommand: vi.fn(),\n    };\n\n    const aggregatedClient: any = new UserClient(commands);\n\n    expect(aggregatedClient).toBeInstanceOf(UserClient);\n    expect(aggregatedClient).toBeInstanceOf(AggregatedClient);\n    expect(aggregatedClient).toBeInstanceOf(BaseClient);\n  });\n\n  it(\"should dispatch using the command lookup\", async () => {\n    const commands = {\n      ActionCommand: vi.fn(),\n    };\n    const aggregatedClient: any = new AggregatedClient(commands);\n\n    expect(() => aggregatedClient.nonExistentMethod()).toThrow();\n    expect(() => aggregatedClient.action()).not.toThrow();\n\n    expect(typeof aggregatedClient.action).toBe(\"function\");\n  });\n\n  it(\"should call send with the matching command\", async () => {\n    const commands = {\n      ActionCommand: vi.fn(),\n    };\n    const aggregatedClient: any = new AggregatedClient(commands);\n\n    await aggregatedClient.action({ a: \"a\" });\n\n    expect(commands.ActionCommand).toHaveBeenCalledWith({ a: \"a\" });\n    expect(aggregatedClient.send).toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/create-aggregated-client.ts",
    "content": "import type { PaginationConfiguration, WaiterConfiguration } from \"@smithy/types\";\n\nimport type { Client } from \"./client\";\n\n/**\n * @internal\n */\ntype AggregatedClientPaginationConfiguration = Omit<PaginationConfiguration, \"client\">;\n\n/**\n * @internal\n */\ntype AggregatedClientWaiterConfiguration<C> = Omit<WaiterConfiguration<C>, \"client\">;\n\n/**\n * @internal\n *\n * @param commands - command lookup container.\n * @param Client - client instance on which to add aggregated methods.\n * @param options - paginator and waiter functions.\n *\n * @returns an aggregated client with dynamically created methods.\n */\nexport const createAggregatedClient = (\n  commands: Record<string, any>,\n  Client: { new (...args: any): Client<any, any, any, any> },\n  options?: {\n    paginators?: Record<string, any>;\n    waiters?: Record<string, any>;\n  }\n): void => {\n  type CommandInput = any;\n  for (const [command, CommandCtor] of Object.entries(commands)) {\n    const methodImpl = async function (\n      this: InstanceType<typeof Client>,\n      args: CommandInput,\n      optionsOrCb: any,\n      cb: any\n    ) {\n      const command: any = new CommandCtor(args);\n      if (typeof optionsOrCb === \"function\") {\n        this.send(command, optionsOrCb);\n      } else if (typeof cb === \"function\") {\n        if (typeof optionsOrCb !== \"object\") throw new Error(`Expected http options but got ${typeof optionsOrCb}`);\n        this.send(command, optionsOrCb || {}, cb);\n      } else {\n        return this.send(command, optionsOrCb);\n      }\n    };\n    const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, \"\");\n    Client.prototype[methodName] = methodImpl;\n  }\n  const { paginators = {}, waiters = {} } = options ?? {};\n  for (const [paginatorName, paginatorFn] of Object.entries(paginators)) {\n    if (Client.prototype[paginatorName] === void 0) {\n      Client.prototype[paginatorName] = function (\n        this: InstanceType<typeof Client>,\n        commandInput: CommandInput = {},\n        paginationConfiguration: AggregatedClientPaginationConfiguration,\n        ...rest: any[]\n      ) {\n        return paginatorFn(\n          {\n            ...paginationConfiguration,\n            client: this,\n          },\n          commandInput,\n          ...rest\n        );\n      };\n    }\n  }\n  for (const [waiterName, waiterFn] of Object.entries(waiters)) {\n    if (Client.prototype[waiterName] === void 0) {\n      Client.prototype[waiterName] = async function (\n        this: InstanceType<typeof Client>,\n        commandInput: CommandInput = {},\n        waiterConfiguration: AggregatedClientWaiterConfiguration<typeof Client> | number,\n        ...rest: any[]\n      ) {\n        let config = waiterConfiguration as AggregatedClientWaiterConfiguration<typeof Client>;\n        if (typeof waiterConfiguration === \"number\") {\n          config = {\n            maxWaitTime: waiterConfiguration,\n          };\n        }\n        return waiterFn(\n          {\n            ...config,\n            client: this,\n          },\n          commandInput,\n          ...rest\n        );\n      };\n    }\n  }\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/default-error-handler.ts",
    "content": "import type { HttpResponse, ResponseMetadata } from \"@smithy/types\";\n\nimport { decorateServiceException } from \"./exceptions\";\n\n/**\n * Always throws an error with the given `exceptionCtor` and other arguments.\n * This is only called from an error handling code path.\n *\n * @internal\n */\nexport const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }: any) => {\n  const $metadata = deserializeMetadata(output);\n  const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + \"\" : undefined;\n  const response = new exceptionCtor({\n    name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || \"UnknownError\",\n    $fault: \"client\",\n    $metadata,\n  });\n  throw decorateServiceException(response, parsedBody);\n};\n\n/**\n * Creates {@link throwDefaultError} with bound ExceptionCtor.\n *\n * @internal\n */\nexport const withBaseException = (ExceptionCtor: { new (...args: any): any }): any => {\n  return ({ output, parsedBody, errorCode }: any) => {\n    throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });\n  };\n};\n\nconst deserializeMetadata = (output: HttpResponse): ResponseMetadata => ({\n  httpStatusCode: output.statusCode,\n  requestId:\n    output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"] ?? output.headers[\"x-amz-request-id\"],\n  extendedRequestId: output.headers[\"x-amz-id-2\"],\n  cfId: output.headers[\"x-amz-cf-id\"],\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/defaults-mode.ts",
    "content": "// smithy-typescript generated code\n/**\n * @internal\n */\nexport const loadConfigsForDefaultMode = (mode: ResolvedDefaultsMode): DefaultsModeConfigs => {\n  switch (mode) {\n    case \"standard\":\n      return {\n        retryMode: \"standard\",\n        connectionTimeout: 3100,\n      };\n    case \"in-region\":\n      return {\n        retryMode: \"standard\",\n        connectionTimeout: 1100,\n      };\n    case \"cross-region\":\n      return {\n        retryMode: \"standard\",\n        connectionTimeout: 3100,\n      };\n    case \"mobile\":\n      return {\n        retryMode: \"standard\",\n        connectionTimeout: 30000,\n      };\n    default:\n      return {};\n  }\n};\n\n/**\n * Option determining how certain default configuration options are resolved in the SDK. It can be one of the value listed below:\n * * `\"standard\"`: <p>The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>\n * * `\"in-region\"`: <p>The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>\n * * `\"cross-region\"`: <p>The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>\n * * `\"mobile\"`: <p>The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>\n * * `\"auto\"`: <p>The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.</p><p>Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query <a href=\"https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html\">EC2 Instance Metadata service</a>, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application</p>\n * * `\"legacy\"`: <p>The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode</p>\n *\n * @defaultValue \"legacy\"\n */\nexport type DefaultsMode = \"standard\" | \"in-region\" | \"cross-region\" | \"mobile\" | \"auto\" | \"legacy\";\n\n/**\n * @internal\n */\nexport type ResolvedDefaultsMode = Exclude<DefaultsMode, \"auto\">;\n\n/**\n * @internal\n */\nexport interface DefaultsModeConfigs {\n  retryMode?: string;\n  connectionTimeout?: number;\n  requestTimeout?: number;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\ndescribe.skip(\"emitWarningIfUnsupportedVersion\", () => {\n  let emitWarningIfUnsupportedVersion: any;\n  const emitWarning = process.emitWarning;\n  const supportedVersion = \"16.0.0\";\n\n  beforeEach(() => {\n    const module = require(\"./emitWarningIfUnsupportedVersion\");\n    emitWarningIfUnsupportedVersion = module.emitWarningIfUnsupportedVersion;\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n    vi.resetModules();\n    process.emitWarning = emitWarning;\n  });\n\n  describe(`emits warning for Node.js <${supportedVersion}`, () => {\n    const getPreviousMajorVersion = (major: number) => (major === 0 ? 0 : major - 1);\n\n    const getPreviousMinorVersion = ([major, minor]: [number, number]) =>\n      minor === 0 ? [getPreviousMajorVersion(major), 9] : [major, minor - 1];\n\n    const getPreviousPatchVersion = ([major, minor, patch]: [number, number, number]) =>\n      patch === 0 ? [...getPreviousMinorVersion([major, minor]), 9] : [major, minor, patch - 1];\n\n    const [major, minor, patch] = supportedVersion.split(\".\").map(Number);\n    it.each(\n      [\n        getPreviousPatchVersion([major, minor, patch]),\n        [...getPreviousMinorVersion([major, minor]), 0],\n        [getPreviousMajorVersion(major), 0, 0],\n      ].map((arr) => `v${arr.join(\".\")}`)\n    )(`%s`, async (unsupportedVersion) => {\n      process.emitWarning = vi.fn();\n      emitWarningIfUnsupportedVersion(unsupportedVersion);\n\n      // Verify that the warning was emitted.\n      expect(process.emitWarning).toHaveBeenCalledTimes(1);\n      expect(process.emitWarning).toHaveBeenCalledWith(`<<TEXT>>`, `NodeDeprecationWarning`);\n\n      // Verify that the warning emits only once.\n      emitWarningIfUnsupportedVersion(unsupportedVersion);\n      expect(process.emitWarning).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe(`emits no warning for Node.js >=${supportedVersion}`, () => {\n    const [major, minor, patch] = supportedVersion.split(\".\").map(Number);\n    it.each(\n      [\n        [major, minor, patch],\n        [major, minor, patch + 1],\n        [major, minor + 1, 0],\n        [major + 1, 0, 0],\n      ].map((arr) => `v${arr.join(\".\")}`)\n    )(`%s`, async (unsupportedVersion) => {\n      process.emitWarning = vi.fn();\n      emitWarningIfUnsupportedVersion(unsupportedVersion);\n      expect(process.emitWarning).not.toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.ts",
    "content": "// Stores whether the warning was already emitted.\nlet warningEmitted = false;\n\n/**\n * Emits warning if the provided Node.js version string is pending deprecation.\n *\n * @internal\n * @param version - The Node.js version string.\n */\nexport const emitWarningIfUnsupportedVersion = (version: string) => {\n  if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf(\".\"))) < 16) {\n    warningEmitted = true;\n    // ToDo: Turn back warning for future Node.js version deprecation\n    // process.emitWarning(\n    //   `The AWS SDK for JavaScript (v3) will\\n` +\n    //     `no longer support Node.js ${version} on <<DATE>>.\\n\\n` +\n    //     `To continue receiving updates to AWS services, bug fixes, and security\\n` +\n    //     `updates please upgrade to Node.js <<VERSION.x>> or later.\\n\\n` +\n    //     `For details, please refer our blog post: <<LINK>>`,\n    //   `NodeDeprecationWarning`\n    // );\n  }\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/exceptions.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { ServiceException, decorateServiceException, type ExceptionOptionType } from \"./exceptions\";\n\nit(\"ServiceException extends from Error\", () => {\n  expect(\n    new ServiceException({\n      name: \"Error\",\n      message: \"\",\n      $fault: \"client\",\n      $metadata: {},\n    })\n  ).toBeInstanceOf(Error);\n});\n\nit(\"ExceptionOptionType allows specifying message\", () => {\n  class SomeException extends ServiceException {\n    readonly code: string;\n    constructor(opts: ExceptionOptionType<SomeException, ServiceException>) {\n      super({\n        name: \"SomeException\",\n        $fault: \"client\",\n        ...opts,\n      });\n      this.code = opts.code;\n    }\n  }\n  const exception = new SomeException({\n    message: \"message\",\n    code: \"code\",\n    $metadata: {},\n  });\n  expect(exception.message).toBe(\"message\");\n  expect(exception.code).toBe(\"code\");\n});\n\ndescribe(\"Exception Hierarchy Tests\", () => {\n  // test classes to represent the hierarchy\n  class ClientServiceException extends ServiceException {\n    constructor() {\n      super({\n        name: \"ClientServiceException\",\n        $fault: \"client\",\n        $metadata: {},\n      });\n      Object.setPrototypeOf(this, ClientServiceException.prototype);\n    }\n  }\n\n  class ModeledClientServiceException extends ClientServiceException {\n    constructor() {\n      super();\n      this.name = \"ModeledClientServiceException\";\n      Object.setPrototypeOf(this, ModeledClientServiceException.prototype);\n    }\n  }\n\n  describe(\"Empty Object Tests\", () => {\n    it(\"empty object should not be instanceof any exception\", () => {\n      expect({} instanceof Error).toBe(false);\n      expect({} instanceof ServiceException).toBe(false);\n      expect({} instanceof ClientServiceException).toBe(false);\n      expect({} instanceof ModeledClientServiceException).toBe(false);\n    });\n  });\n\n  describe(\"Error Instance Tests\", () => {\n    const error = new Error();\n    it(\"Error instance should only be instanceof Error\", () => {\n      expect(error instanceof Error).toBe(true);\n      expect(error instanceof ServiceException).toBe(false);\n      expect(error instanceof ClientServiceException).toBe(false);\n      expect(error instanceof ModeledClientServiceException).toBe(false);\n    });\n  });\n\n  describe(\"ServiceException Instance Tests\", () => {\n    const serviceException = new ServiceException({\n      name: \"ServiceException\",\n      $fault: \"client\",\n      $metadata: {},\n    });\n\n    it(\"ServiceException instance should be instanceof Error and ServiceException\", () => {\n      expect(serviceException instanceof Error).toBe(true);\n      expect(serviceException instanceof ServiceException).toBe(true);\n      expect(serviceException instanceof ClientServiceException).toBe(false);\n      expect(serviceException instanceof ModeledClientServiceException).toBe(false);\n    });\n  });\n\n  describe(\"ClientServiceException Instance Tests\", () => {\n    const clientException = new ClientServiceException();\n    it(\"ClientServiceException instance should be instanceof Error, ServiceException, and ClientServiceException\", () => {\n      expect(clientException instanceof Error).toBe(true);\n      expect(clientException instanceof ServiceException).toBe(true);\n      expect(clientException instanceof ClientServiceException).toBe(true);\n      expect(clientException instanceof ModeledClientServiceException).toBe(false);\n    });\n\n    it(\"should handle exceptions where name indicates error type\", () => {\n      const egError = new ClientServiceException();\n      egError.name = \"EgTooLarge\"; // specific error type name\n      // Should maintain instanceof chain\n      expect(egError instanceof Error).toBe(true);\n      expect(egError instanceof ServiceException).toBe(true);\n      expect(egError instanceof ClientServiceException).toBe(true);\n      // The name property can be used to identify specific error types\n      expect(egError.name).toBe(\"EgTooLarge\");\n    });\n  });\n\n  describe(\"ModeledClientServiceException Instance Tests\", () => {\n    const modeledException = new ModeledClientServiceException();\n    it(\"ModeledClientServiceException instance should be instanceof Error, ServiceException, ClientServiceException, and ModeledClientServiceException\", () => {\n      expect(modeledException instanceof Error).toBe(true);\n      expect(modeledException instanceof ServiceException).toBe(true);\n      expect(modeledException instanceof ClientServiceException).toBe(true);\n      expect(modeledException instanceof ModeledClientServiceException).toBe(true);\n    });\n  });\n\n  describe(\"Duck-Typed Object Tests\", () => {\n    it(\"object with only name should not be instanceof any exception\", () => {\n      const obj = { name: \"Error\" };\n      expect(obj instanceof Error).toBe(false);\n      expect(obj instanceof ServiceException).toBe(false);\n      expect(obj instanceof ClientServiceException).toBe(false);\n      expect(obj instanceof ModeledClientServiceException).toBe(false);\n    });\n\n    it(\"object with only $-props should be instanceof ServiceException\", () => {\n      const obj = { $fault: \"client\" as const, $metadata: {} };\n      expect(obj instanceof Error).toBe(false);\n      expect(obj instanceof ServiceException).toBe(true);\n      expect(obj instanceof ClientServiceException).toBe(false);\n      expect(obj instanceof ModeledClientServiceException).toBe(false);\n    });\n\n    it(\"object with ServiceException name and $-props should be instanceof ServiceException only\", () => {\n      const obj = { name: \"ServiceException\", $fault: \"client\" as const, $metadata: {} };\n      expect(obj instanceof Error).toBe(false);\n      expect(obj instanceof ServiceException).toBe(true);\n      expect(obj instanceof ClientServiceException).toBe(false);\n      expect(obj instanceof ModeledClientServiceException).toBe(false);\n    });\n\n    it(\"object with ClientServiceException name and $-props should be instanceof ServiceException and ClientServiceException\", () => {\n      const obj = { name: \"ClientServiceException\", $fault: \"client\" as const, $metadata: {} };\n      expect(obj instanceof Error).toBe(false);\n      expect(obj instanceof ServiceException).toBe(true);\n      expect(obj instanceof ClientServiceException).toBe(true);\n      expect(obj instanceof ModeledClientServiceException).toBe(false);\n    });\n\n    it(\"object with ModeledClientServiceException name and $-props should be instanceof ServiceException and ModeledClientServiceException\", () => {\n      const obj = { name: \"ModeledClientServiceException\", $fault: \"client\" as const, $metadata: {} };\n      expect(obj instanceof Error).toBe(false);\n      expect(obj instanceof ServiceException).toBe(true);\n      expect(obj instanceof ClientServiceException).toBe(false);\n      expect(obj instanceof ModeledClientServiceException).toBe(true);\n    });\n  });\n});\n\ndescribe(\"decorateServiceException\", () => {\n  const exception = new ServiceException({\n    name: \"Error\",\n    message: \"Error\",\n    $fault: \"client\",\n    $metadata: {},\n  });\n\n  it(\"should inject unmodeled members to the exception\", () => {\n    const decorated = decorateServiceException(exception, { foo: \"foo\" });\n    expect((decorated as any).foo).toBe(\"foo\");\n  });\n\n  it(\"should not inject unmodeled members to the undefined\", () => {\n    const decorated = decorateServiceException(exception, { message: undefined });\n    expect(decorated.message).toBe(\"Error\");\n  });\n\n  it(\"should not overwrite the parsed exceptions\", () => {\n    const decorated = decorateServiceException(exception, { message: \"Another Error\" });\n    expect(decorated.message).toBe(\"Error\");\n  });\n\n  it(\"should replace Message with message\", () => {\n    const decorated = decorateServiceException({\n      name: \"Error\",\n      Message: \"message\",\n    } as any);\n    expect(decorated.message).toBe(\"message\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/exceptions.ts",
    "content": "import type { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from \"@smithy/types\";\n\n/**\n * The type of the exception class constructor parameter. The returned type contains the properties\n * in the `ExceptionType` but not in the `BaseExceptionType`. If the `BaseExceptionType` contains\n * `$metadata` and `message` properties, it's also included in the returned type.\n * @internal\n */\nexport type ExceptionOptionType<ExceptionType extends Error, BaseExceptionType extends Error> = Omit<\n  ExceptionType,\n  Exclude<keyof BaseExceptionType, \"$metadata\" | \"message\">\n>;\n\n/**\n * @public\n */\nexport interface ServiceExceptionOptions extends SmithyException, MetadataBearer {\n  message?: string;\n}\n\n/**\n * Base exception class for the exceptions from the server-side.\n *\n * @public\n */\nexport class ServiceException extends Error implements SmithyException, MetadataBearer {\n  readonly $fault: \"client\" | \"server\";\n\n  $response?: HttpResponse;\n  $retryable?: RetryableTrait;\n  $metadata: ResponseMetadata;\n\n  constructor(options: ServiceExceptionOptions) {\n    super(options.message);\n    Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);\n    this.name = options.name;\n    this.$fault = options.$fault;\n    this.$metadata = options.$metadata;\n  }\n\n  /**\n   * Checks if a value is an instance of ServiceException (duck typed)\n   */\n  public static isInstance(value: unknown): value is ServiceException {\n    if (!value) return false;\n    const candidate = value as ServiceException;\n    return (\n      ServiceException.prototype.isPrototypeOf(candidate) ||\n      (Boolean(candidate.$fault) &&\n        Boolean(candidate.$metadata) &&\n        (candidate.$fault === \"client\" || candidate.$fault === \"server\"))\n    );\n  }\n\n  /**\n   * Custom instanceof check to support the operator for ServiceException base class\n   */\n  public static [Symbol.hasInstance](instance: unknown): boolean {\n    // Handle null/undefined\n    if (!instance) return false;\n    const candidate = instance as ServiceException;\n    // For ServiceException, check only $-props\n    if (this === ServiceException) {\n      return ServiceException.isInstance(instance);\n    }\n    // For subclasses, check both prototype chain and name match\n    // Note: instance must be ServiceException first (having $-props)\n    if (ServiceException.isInstance(instance)) {\n      // Only do name comparison if both sides have non-empty names\n      if (candidate.name && this.name) {\n        return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;\n      }\n      // Otherwise fall back to just prototype check\n      return this.prototype.isPrototypeOf(instance);\n    }\n    return false;\n  }\n}\n\n/**\n * This method inject unmodeled member to a deserialized SDK exception,\n * and load the error message from different possible keys('message',\n * 'Message').\n *\n * @internal\n */\nexport const decorateServiceException = <E extends ServiceException>(\n  exception: E,\n  additions: Record<string, any> = {}\n): E => {\n  // apply additional properties to deserialized ServiceException object\n  Object.entries(additions)\n    .filter(([, v]) => v !== undefined)\n    .forEach(([k, v]) => {\n      // @ts-ignore examine unmodeled keys\n      if (exception[k] == undefined || exception[k] === \"\") {\n        // @ts-ignore assign unmodeled keys\n        exception[k] = v;\n      }\n    });\n  // load error message from possible locations\n  // @ts-expect-error message could exist in Message key.\n  const message = exception.message || exception.Message || \"UnknownError\";\n  exception.message = message;\n  // @ts-expect-error\n  delete exception.Message;\n  return exception;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/extensions/checksum.integ.spec.ts",
    "content": "import { RpcV2Protocol } from \"@smithy/smithy-rpcv2-cbor-schema\";\nimport type { Checksum } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport type { PartialChecksumRuntimeConfigType } from \"./checksum\";\n\ndescribe(\"checksum extension\", () => {\n  it(\"should allow definition of new checksum algorithms via runtime extension\", async () => {\n    class Sha256Custom implements Checksum {\n      update() {}\n      async digest() {\n        return new Uint8Array(4);\n      }\n      reset() {}\n    }\n\n    class R1 {\n      update() {}\n      async digest() {\n        return new Uint8Array(4);\n      }\n      reset() {}\n    }\n\n    const client = new RpcV2Protocol({\n      endpoint: \"https://localhost\",\n      extensions: [\n        {\n          configure(ext) {\n            ext.addChecksumAlgorithm({\n              algorithmId() {\n                return \"r1\";\n              },\n              checksumConstructor() {\n                return R1;\n              },\n            });\n            ext.addChecksumAlgorithm({\n              algorithmId() {\n                return \"sha256\";\n              },\n              checksumConstructor() {\n                return Sha256Custom;\n              },\n            });\n          },\n        },\n      ],\n    });\n\n    const config = client.config as typeof client.config & PartialChecksumRuntimeConfigType;\n\n    expect(config.checksumAlgorithms).toEqual({\n      // the algo id is used as the key if it is not recognized.\n      r1: R1,\n\n      // Rhe uppercase form is used if it is recognized.\n      // This matches the key in the algorithm selector function.\n      SHA256: Sha256Custom,\n    });\n\n    // for known algorithms that exist on the config, they are also set by the extension.\n    expect(config.sha256).toEqual(Sha256Custom);\n    expect(config.md5).toEqual(undefined);\n    expect(config.sha1).toEqual(undefined);\n\n    // for novel algorithms, they are not set to new fields on the config.\n    expect((config as any).r1).toEqual(undefined);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/extensions/checksum.ts",
    "content": "import {\n  AlgorithmId,\n  type ChecksumAlgorithm,\n  type ChecksumConfiguration,\n  type ChecksumConstructor,\n  type HashConstructor,\n} from \"@smithy/types\";\n\nexport { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration };\n\n/**\n * @internal\n */\nconst knownAlgorithms: string[] = Object.values(AlgorithmId);\n\n/**\n * @internal\n */\nexport type PartialChecksumRuntimeConfigType = {\n  checksumAlgorithms?: Record<string, ChecksumConstructor | HashConstructor>;\n  sha256?: ChecksumConstructor | HashConstructor;\n  md5?: ChecksumConstructor | HashConstructor;\n  crc32?: ChecksumConstructor | HashConstructor;\n  crc32c?: ChecksumConstructor | HashConstructor;\n  sha1?: ChecksumConstructor | HashConstructor;\n};\n\n/**\n * @param runtimeConfig - config object of the client instance.\n * @internal\n */\nexport const getChecksumConfiguration = (runtimeConfig: PartialChecksumRuntimeConfigType) => {\n  const checksumAlgorithms: ChecksumAlgorithm[] = [];\n\n  for (const id in AlgorithmId) {\n    const algorithmId = AlgorithmId[id as keyof typeof AlgorithmId];\n    if (runtimeConfig[algorithmId] === undefined) {\n      continue;\n    }\n    checksumAlgorithms.push({\n      algorithmId: () => algorithmId,\n      checksumConstructor: () => runtimeConfig[algorithmId]!,\n    });\n  }\n  for (const [id, ChecksumCtor] of Object.entries(runtimeConfig.checksumAlgorithms ?? {})) {\n    checksumAlgorithms.push({\n      algorithmId: () => id,\n      checksumConstructor: () => ChecksumCtor,\n    });\n  }\n  return {\n    addChecksumAlgorithm(algo: ChecksumAlgorithm): void {\n      runtimeConfig.checksumAlgorithms = runtimeConfig.checksumAlgorithms ?? {};\n      const id = algo.algorithmId();\n      const ctor = algo.checksumConstructor();\n      if (knownAlgorithms.includes(id)) {\n        runtimeConfig.checksumAlgorithms[id.toUpperCase()] = ctor;\n      } else {\n        runtimeConfig.checksumAlgorithms[id] = ctor;\n      }\n      checksumAlgorithms.push(algo);\n    },\n    checksumAlgorithms(): ChecksumAlgorithm[] {\n      return checksumAlgorithms;\n    },\n  };\n};\n\n/**\n * @internal\n */\nexport const resolveChecksumRuntimeConfig = (clientConfig: ChecksumConfiguration): PartialChecksumRuntimeConfigType => {\n  const runtimeConfig: PartialChecksumRuntimeConfigType = {};\n  clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {\n    const id = checksumAlgorithm.algorithmId();\n    if (knownAlgorithms.includes(id)) {\n      runtimeConfig[id as AlgorithmId] = checksumAlgorithm.checksumConstructor();\n    }\n    // else the algorithm was attached to the checksumAlgorithms object on the client config already.\n  });\n\n  return runtimeConfig;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.ts",
    "content": "import type { DefaultExtensionConfiguration } from \"@smithy/types\";\n\nimport {\n  getChecksumConfiguration,\n  resolveChecksumRuntimeConfig,\n  type PartialChecksumRuntimeConfigType,\n} from \"./checksum\";\nimport { getRetryConfiguration, resolveRetryRuntimeConfig, type PartialRetryRuntimeConfigType } from \"./retry\";\n\n/**\n * @internal\n */\nexport type DefaultExtensionRuntimeConfigType = PartialRetryRuntimeConfigType & PartialChecksumRuntimeConfigType;\n\n/**\n * Helper function to resolve default extension configuration from runtime config\n *\n * @internal\n */\nexport const getDefaultExtensionConfiguration = (runtimeConfig: DefaultExtensionRuntimeConfigType) => {\n  return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));\n};\n\n/**\n * Helper function to resolve default extension configuration from runtime config\n *\n * @internal\n * @deprecated use getDefaultExtensionConfiguration\n */\nexport const getDefaultClientConfiguration = getDefaultExtensionConfiguration;\n\n/**\n * Helper function to resolve runtime config from default extension configuration\n *\n * @internal\n */\nexport const resolveDefaultRuntimeConfig = (\n  config: DefaultExtensionConfiguration\n): DefaultExtensionRuntimeConfigType => {\n  return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/extensions/retry.ts",
    "content": "import type { Provider, RetryStrategy, RetryStrategyConfiguration, RetryStrategyV2 } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport type PartialRetryRuntimeConfigType = Partial<{ retryStrategy: Provider<RetryStrategyV2 | RetryStrategy> }>;\n\n/**\n * @internal\n */\nexport const getRetryConfiguration = (runtimeConfig: PartialRetryRuntimeConfigType) => {\n  return {\n    setRetryStrategy(retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>): void {\n      runtimeConfig.retryStrategy = retryStrategy;\n    },\n    retryStrategy(): Provider<RetryStrategyV2 | RetryStrategy> {\n      return runtimeConfig.retryStrategy!;\n    },\n  };\n};\n\n/**\n * @internal\n */\nexport const resolveRetryRuntimeConfig = (\n  retryStrategyConfiguration: RetryStrategyConfiguration\n): PartialRetryRuntimeConfigType => {\n  const runtimeConfig: PartialRetryRuntimeConfigType = {};\n  runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();\n  return runtimeConfig;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/get-array-if-single-item.ts",
    "content": "/**\n * The XML parser will set one K:V for a member that could\n * return multiple entries but only has one.\n *\n * @internal\n */\nexport const getArrayIfSingleItem = <T>(mayBeArray: T): T | T[] =>\n  Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray];\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/get-value-from-text-node.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { getValueFromTextNode } from \"./get-value-from-text-node\";\n\ndescribe(\"getValueFromTextNode\", () => {\n  const valueInsideTextNode = \"valueInsideTextNode\";\n\n  it(\"doesn't modify object if #text is absent\", () => {\n    const input = {\n      key: \"value\",\n      keyObj: {\n        keyInsideObj: \"valueInsideObj\",\n      },\n    };\n    const output = getValueFromTextNode(input);\n    expect(output).toBe(input);\n  });\n\n  it(\"populates key with value in #text at first level\", () => {\n    const input = {\n      key: \"value\",\n      keyWithoutTextNode: {\n        key: \"value\",\n      },\n      keyWithTextNode: {\n        \"#text\": valueInsideTextNode,\n      },\n    };\n    const output = getValueFromTextNode(input);\n    expect(output.key).toBe(input.key);\n    expect(output.keyWithoutTextNode).toBe(input.keyWithoutTextNode);\n    expect(output.keyWithTextNode).toBe(valueInsideTextNode);\n  });\n\n  it(\"populates key with value in #text at second level\", () => {\n    const input = {\n      key: \"value\",\n      keyWithoutTextNodeAtAnyLevel: {\n        keyObj: {\n          key: \"value\",\n        },\n      },\n      keyWithTextNodeAtLevel2: {\n        keyWithTextNode: {\n          \"#text\": valueInsideTextNode,\n        },\n      },\n    };\n    const output = getValueFromTextNode(input);\n    expect(output.key).toBe(input.key);\n    expect(output.keyWithoutTextNodeAtAnyLevel).toBe(input.keyWithoutTextNodeAtAnyLevel);\n    expect(output.keyWithTextNodeAtLevel2.keyWithTextNode).toBe(valueInsideTextNode);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/get-value-from-text-node.ts",
    "content": "/**\n * Recursively parses object and populates value is node from\n * \"#text\" key if it's available\n *\n * @internal\n */\nexport const getValueFromTextNode = (obj: any) => {\n  const textNodeName = \"#text\";\n  for (const key in obj) {\n    if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) {\n      obj[key] = obj[key][textNodeName];\n    } else if (typeof obj[key] === \"object\" && obj[key] !== null) {\n      obj[key] = getValueFromTextNode(obj[key]);\n    }\n  }\n  return obj;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/is-serializable-header-value.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isSerializableHeaderValue } from \"./is-serializable-header-value\";\n\ndescribe(isSerializableHeaderValue.name, () => {\n  it(\"considers empty strings serializable\", () => {\n    expect(isSerializableHeaderValue(\"\")).toBe(true);\n  });\n\n  it(\"considers empty collections serializable\", () => {\n    expect(isSerializableHeaderValue(new Set())).toBe(true);\n    expect(isSerializableHeaderValue([])).toBe(true);\n  });\n\n  it(\"considers most falsy data values to be serializable\", () => {\n    expect(isSerializableHeaderValue(false)).toBe(true);\n    expect(isSerializableHeaderValue(0)).toBe(true);\n    expect(isSerializableHeaderValue(new Date(0))).toBe(true);\n  });\n\n  it(\"considered undefined and null to be unserializable\", () => {\n    expect(isSerializableHeaderValue(undefined)).toBe(false);\n    expect(isSerializableHeaderValue(null)).toBe(false);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/is-serializable-header-value.ts",
    "content": "/**\n * @internal\n * @returns whether the header value is serializable.\n */\nexport const isSerializableHeaderValue = (value: any) => {\n  return value != null;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/object-mapping.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { map, take, type ObjectMappingInstructions, type SourceMappingInstructions } from \"./object-mapping\";\n\ndescribe(\"object mapping\", () => {\n  const example: ObjectMappingInstructions = {\n    lazyValue1: [, () => 1],\n    lazyValue2: [, () => 2],\n    lazyValue3: [, () => 3],\n    lazyConditionalValue1: [() => true, () => 4],\n    lazyConditionalValue2: [() => true, () => 5],\n    lazyConditionalValue3: [true, () => 6],\n    lazyConditionalValue4: [false, () => 44],\n    lazyConditionalValue5: [() => false, () => 55],\n    lazyConditionalValue6: [\"\", () => 66],\n    simpleValue1: [, 7],\n    simpleValue2: [, 8],\n    simpleValue3: [, 9],\n    conditionalValue1: [() => true, 10],\n    conditionalValue2: [() => true, 11],\n    conditionalValue3: [{}, 12],\n    conditionalValue4: [false, 110],\n    conditionalValue5: [() => false, 121],\n    conditionalValue6: [\"\", 132],\n  };\n\n  const exampleResult: Record<string, any> = {\n    lazyValue1: 1,\n    lazyValue2: 2,\n    lazyValue3: 3,\n    lazyConditionalValue1: 4,\n    lazyConditionalValue2: 5,\n    lazyConditionalValue3: 6,\n    simpleValue1: 7,\n    simpleValue2: 8,\n    simpleValue3: 9,\n    conditionalValue1: 10,\n    conditionalValue2: 11,\n    conditionalValue3: 12,\n  };\n\n  describe(\"map function\", () => {\n    it(\"should map various values according to their instruction sets\", () => {\n      expect(map({}, example)).toEqual(exampleResult);\n    });\n\n    it(\"should allow default empty object as target\", () => {\n      expect(map(example)).toEqual(exampleResult);\n    });\n\n    it(\"should allow a uniform default filter to be specified\", () => {\n      expect(map({}, (_: number) => _ % 2 === 0, exampleResult)).toEqual({\n        lazyValue2: 2,\n        lazyConditionalValue1: 4,\n        lazyConditionalValue3: 6,\n        simpleValue2: 8,\n        conditionalValue1: 10,\n        conditionalValue3: 12,\n      });\n    });\n\n    it(\"should allow a set of passing filters\", () => {\n      expect(\n        map({\n          a: [, 0],\n          b: [, false],\n          c: [, \"\"],\n          d: [, []],\n          e: [, [void 0, void 0]],\n          f: [, {}],\n          g: [, [false, void 0]],\n          h: [true, void 0],\n          i: [1, void 0],\n          j: [\" \", void 0],\n          k: [[], void 0],\n          l: [{}, void 0],\n          m: [() => true, void 0],\n          n: [(val: any) => val === void 0, void 1],\n          o: [() => true, () => void 0],\n          p: [(val: any) => val !== 1, () => 1], // value is not provided to filter fn when value provider is lazy\n          q: 0,\n          r: false,\n          s: \"\",\n          t: undefined,\n          u: null,\n        })\n      ).toEqual({\n        a: 0,\n        b: false,\n        c: \"\",\n        d: [],\n        e: [undefined, undefined],\n        f: {},\n        g: [false, undefined],\n        h: undefined,\n        i: undefined,\n        j: undefined,\n        k: undefined,\n        l: undefined,\n        m: undefined,\n        n: undefined,\n        o: undefined,\n        p: 1,\n        q: 0,\n        r: false,\n        s: \"\",\n        t: undefined,\n        u: null,\n      });\n    });\n\n    it(\"should block a set of failing filters\", () => {\n      expect(\n        map({\n          a: [, undefined],\n          b: [, null],\n          c: [(_: any) => _ !== \"\", \"\"],\n          d: [(_: any) => _.length !== 0, []],\n          e: [0, 0],\n          f: [false, false],\n          g: [\"\", \"\"],\n          h: [undefined, undefined],\n          i: [null, null],\n          j: [() => false, void 0],\n          k: [(val: any) => val !== void 0, void 0],\n          l: [() => false, () => void 0],\n          m: [(val: any) => val === 1, () => 1], // value is not provided to filter fn when value provider is lazy\n          n: [, () => undefined],\n        })\n      ).toEqual({});\n    });\n  });\n\n  describe(\"take function\", () => {\n    it(\"will not apply instructions to missing fields\", () => {\n      const input = {\n        filteredDefault: null,\n        filteredSupplier: undefined,\n        filteredMapper: void 0,\n        filteredFilter: 43,\n        filteredMapperOnly: null,\n      } as const;\n\n      const output = {} as const;\n\n      const instructions: SourceMappingInstructions = {\n        default: [],\n        filteredDefault: [],\n        supplier: [, () => \"x\"],\n        filteredSupplier: [, () => \"x\"],\n        mapper: [, (_: any) => _ + \"x\"],\n        filteredMapper: [, (_: any) => _ + \"x\"],\n        filter: [(_: any) => _ === 42],\n        filteredFilter: [(_: any) => _ === 42],\n        sourceKey: [, , \"SOURCE_KEY\"],\n        sourceKey2: [, (_: any) => \"mapped\" + _, \"SOURCE_KEY2\"],\n        mapperOnly: (_: any) => _ + \"Only\",\n        filteredMapperOnly: (_: any) => _ + \"Only\",\n      };\n\n      expect(take(input, instructions)).toEqual(output);\n    });\n\n    it(\"should allow a filter function or value\", () => {\n      const input = {\n        a: 1,\n        b: 1,\n        c: 1,\n        d: 1,\n        e: 1,\n        f: 1,\n      } as const;\n\n      const output = {\n        a: 1,\n        b: 1,\n        e: 1,\n      } as const;\n\n      const instructions: SourceMappingInstructions = {\n        a: [true],\n        b: [1],\n        c: [false, () => 1],\n        d: [0, () => 1],\n        e: [(_: any) => _ == 1],\n        f: [(_: any) => _ == 2],\n      };\n\n      expect(take(input, instructions)).toEqual(output);\n    });\n\n    it(\"should take keys with optional filters and optional mappers\", () => {\n      const input = {\n        default: 0,\n        filteredDefault: null,\n        supplier: false,\n        filteredSupplier: undefined,\n        mapper: \"y\",\n        filteredMapper: void 0,\n        filter: 42,\n        filteredFilter: 43,\n        SOURCE_KEY: \"SOURCE_VALUE\",\n        SOURCE_KEY2: \"SOURCE_VALUE2\",\n        mapperOnly: \"mapper\",\n        filteredMapperOnly: null,\n      } as const;\n\n      const output = {\n        default: 0,\n        supplier: \"x\",\n        mapper: \"yx\",\n        filter: 42,\n        sourceKey: \"SOURCE_VALUE\",\n        sourceKey2: \"mappedSOURCE_VALUE2\",\n        mapperOnly: \"mapperOnly\",\n      } as const;\n\n      const instructions: SourceMappingInstructions = {\n        default: [],\n        filteredDefault: [],\n        supplier: [, () => \"x\"],\n        filteredSupplier: [, () => \"x\"],\n        mapper: [, (_: any) => _ + \"x\"],\n        filteredMapper: [, (_: any) => _ + \"x\"],\n        filter: [(_: any) => _ === 42],\n        filteredFilter: [(_: any) => _ === 42],\n        sourceKey: [, , \"SOURCE_KEY\"],\n        sourceKey2: [, (_: any) => \"mapped\" + _, \"SOURCE_KEY2\"],\n        mapperOnly: (_: any) => _ + \"Only\",\n        filteredMapperOnly: (_: any) => _ + \"Only\",\n      };\n\n      expect(take(input, instructions)).toEqual(output);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/object-mapping.ts",
    "content": "/**\n * A set of instructions for multiple keys.\n * The aim is to provide a concise yet readable way to map and filter values\n * onto a target object.\n *\n * @example\n * ```javascript\n * const example: ObjectMappingInstructions = {\n *   lazyValue1: [, () => 1],\n *   lazyValue2: [, () => 2],\n *   lazyValue3: [, () => 3],\n *   lazyConditionalValue1: [() => true, () => 4],\n *   lazyConditionalValue2: [() => true, () => 5],\n *   lazyConditionalValue3: [true, () => 6],\n *   lazyConditionalValue4: [false, () => 44],\n *   lazyConditionalValue5: [() => false, () => 55],\n *   lazyConditionalValue6: [\"\", () => 66],\n *   simpleValue1: [, 7],\n *   simpleValue2: [, 8],\n *   simpleValue3: [, 9],\n *   conditionalValue1: [() => true, 10],\n *   conditionalValue2: [() => true, 11],\n *   conditionalValue3: [{}, 12],\n *   conditionalValue4: [false, 110],\n *   conditionalValue5: [() => false, 121],\n *   conditionalValue6: [\"\", 132],\n * };\n *\n * const exampleResult: Record<string, any> = {\n *   lazyValue1: 1,\n *   lazyValue2: 2,\n *   lazyValue3: 3,\n *   lazyConditionalValue1: 4,\n *   lazyConditionalValue2: 5,\n *   lazyConditionalValue3: 6,\n *   simpleValue1: 7,\n *   simpleValue2: 8,\n *   simpleValue3: 9,\n *   conditionalValue1: 10,\n *   conditionalValue2: 11,\n *   conditionalValue3: 12,\n * };\n * ```\n *\n * @internal\n */\nexport type ObjectMappingInstructions = Record<string, ObjectMappingInstruction>;\n\n/**\n * A variant of the object mapping instruction for the `take` function.\n * In this case, the source value is provided to the value function, turning it\n * from a supplier into a mapper.\n *\n * @internal\n */\nexport type SourceMappingInstructions = Record<string, ValueMapper | SourceMappingInstruction>;\n\n/**\n * An instruction set for assigning a value to a target object.\n *\n * @internal\n */\nexport type ObjectMappingInstruction =\n  | LazyValueInstruction\n  | ConditionalLazyValueInstruction\n  | SimpleValueInstruction\n  | ConditionalValueInstruction\n  | UnfilteredValue;\n\n/**\n * non-array\n *\n * @internal\n */\nexport type UnfilteredValue = any;\n/**\n * @internal\n */\nexport type LazyValueInstruction = [FilterStatus, ValueSupplier];\n/**\n * @internal\n */\nexport type ConditionalLazyValueInstruction = [FilterStatusSupplier, ValueSupplier];\n/**\n * @internal\n */\nexport type SimpleValueInstruction = [FilterStatus, Value];\n/**\n * @internal\n */\nexport type ConditionalValueInstruction = [ValueFilteringFunction, Value];\n/**\n * @internal\n */\nexport type SourceMappingInstruction = [(ValueFilteringFunction | FilterStatus)?, ValueMapper?, string?];\n\n/**\n * Filter is considered passed if\n * 1. It is a boolean true.\n * 2. It is not undefined and is itself truthy.\n * 3. It is undefined and the corresponding _value_ is neither null nor undefined.\n *\n * @internal\n */\nexport type FilterStatus = boolean | unknown | void;\n\n/**\n * Supplies the filter check but not against any value as input.\n *\n * @internal\n */\nexport type FilterStatusSupplier = () => boolean;\n\n/**\n * Filter check with the given value.\n *\n * @internal\n */\nexport type ValueFilteringFunction = (value: any) => boolean;\n\n/**\n * Supplies the value for lazy evaluation.\n *\n * @internal\n */\nexport type ValueSupplier = () => any;\n\n/**\n * A function that maps the source value to the target value.\n * Defaults to pass-through with nullish check.\n *\n * @internal\n */\nexport type ValueMapper = (value: any) => any;\n\n/**\n * A non-function value.\n *\n * @internal\n */\nexport type Value = any;\n\n/**\n * Internal/Private, for codegen use only.\n *\n * Transfer a set of keys from [instructions] to [target].\n *\n * For each instruction in the record, the target key will be the instruction key.\n * The target assignment will be conditional on the instruction's filter.\n * The target assigned value will be supplied by the instructions as an evaluable function or non-function value.\n *\n * @see ObjectMappingInstructions for an example.\n *\n * @internal\n */\nexport function map(\n  target: any,\n  filter: (value: any) => boolean,\n  instructions: Record<string, ValueSupplier | Value>\n): typeof target;\n/**\n * @internal\n */\nexport function map(instructions: ObjectMappingInstructions): any;\n/**\n * @internal\n */\nexport function map(target: any, instructions: ObjectMappingInstructions): typeof target;\n/**\n * @internal\n */\nexport function map(arg0: any, arg1?: any, arg2?: any): any {\n  let target: any;\n  let filter: (value?: any) => boolean;\n  let instructions: ObjectMappingInstructions;\n\n  if (typeof arg1 === \"undefined\" && typeof arg2 === \"undefined\") {\n    target = {};\n    instructions = arg0;\n  } else {\n    target = arg0;\n    if (typeof arg1 === \"function\") {\n      filter = arg1;\n      instructions = arg2;\n      return mapWithFilter(target, filter, instructions);\n    } else {\n      instructions = arg1;\n    }\n  }\n\n  for (const key of Object.keys(instructions)) {\n    if (!Array.isArray(instructions[key])) {\n      target[key] = instructions[key]; // unchecked value.\n      continue;\n    }\n    applyInstruction(target, null, instructions, key);\n  }\n  return target;\n}\n\n/**\n * Convert a regular object `{ k: v }` to `{ k: [, v] }` mapping instruction set with default\n * filter.\n *\n * @internal\n */\nexport const convertMap = (target: any): Record<string, any> => {\n  const output: Record<string, any> = {};\n  for (const [k, v] of Object.entries(target || {})) {\n    output[k] = [, v];\n  }\n  return output;\n};\n\n/**\n * @param source - original object with data.\n * @param instructions - how to map the data.\n * @returns new object mapped from the source object.\n * @internal\n */\nexport const take = (source: any, instructions: SourceMappingInstructions): any => {\n  const out = {};\n  for (const key in instructions) {\n    applyInstruction(out, source, instructions, key);\n  }\n  return out;\n};\n\n/**\n * Private, for codegen use only.\n *\n * @param target - target object.\n * @param filter - uniform filter function to apply to all values\n * @param instructions - map of keys and values/suppliers (will be evaluated)\n *\n * @internal\n */\nconst mapWithFilter = (\n  target: any,\n  filter: (value: any) => boolean,\n  instructions: Record<string, ValueSupplier | Value | ObjectMappingInstruction>\n): typeof target => {\n  return map(\n    target,\n    Object.entries(instructions).reduce(\n      (\n        _instructions: ObjectMappingInstructions,\n        [key, value]: [string, ValueSupplier | Value | ObjectMappingInstruction]\n      ) => {\n        if (Array.isArray(value)) {\n          // is custom instruction and not a value or value supplier\n          _instructions[key] = value as ObjectMappingInstruction;\n        } else {\n          if (typeof value === \"function\") {\n            _instructions[key] = [filter, value()];\n          } else {\n            _instructions[key] = [filter, value];\n          }\n        }\n\n        return _instructions;\n      },\n      {}\n    )\n  );\n};\n\n/**\n * Applies a single instruction at the given key from source to target.\n *\n * @internal\n */\nconst applyInstruction = (\n  target: any,\n  source: null | any,\n  instructions: ObjectMappingInstructions | Record<string, SourceMappingInstruction>,\n  targetKey: string\n): void => {\n  if (source !== null) {\n    let instruction = instructions[targetKey];\n    if (typeof instruction === \"function\") {\n      instruction = [, instruction];\n    }\n    const [filter = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;\n    if ((typeof filter === \"function\" && filter(source[sourceKey])) || (typeof filter !== \"function\" && !!filter)) {\n      target[targetKey] = valueFn(source[sourceKey]);\n    }\n    return;\n  }\n\n  // eslint-disable-next-line prefer-const\n  let [filter, value]: [((_?: any) => boolean) | unknown, any] = instructions[targetKey];\n\n  if (typeof value === \"function\") {\n    let _value: any;\n    const defaultFilterPassed = filter === undefined && (_value = value()) != null;\n    const customFilterPassed =\n      (typeof filter === \"function\" && !!filter(void 0)) || (typeof filter !== \"function\" && !!filter);\n\n    if (defaultFilterPassed) {\n      target[targetKey] = _value;\n    } else if (customFilterPassed) {\n      target[targetKey] = value();\n    }\n  } else {\n    const defaultFilterPassed = filter === undefined && value != null;\n    const customFilterPassed =\n      (typeof filter === \"function\" && !!filter(value)) || (typeof filter !== \"function\" && !!filter);\n\n    if (defaultFilterPassed || customFilterPassed) {\n      target[targetKey] = value;\n    }\n  }\n};\n\n/**\n * internal\n */\nconst nonNullish = (_: any) => _ != null;\n\n/**\n * internal\n */\nconst pass = (_: any) => _;\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/schemaLogFilter.spec.ts",
    "content": "import type {\n  BooleanSchema,\n  NumericSchema,\n  StaticSimpleSchema,\n  StaticStructureSchema,\n  StringSchema,\n} from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { schemaLogFilter } from \"./schemaLogFilter\";\n\ndescribe(schemaLogFilter.name, () => {\n  it(\"should filter sensitive trait-marked fields\", () => {\n    const sensitiveString: StaticSimpleSchema = [0, \"ns\", \"SensitiveString\", { sensitive: 1 }, 0];\n\n    const schema: StaticStructureSchema = [\n      3,\n      \"ns\",\n      \"Struct\",\n      0,\n      [\"a\", \"b\", \"sensitive\", \"nestedSensitive\", \"various\"],\n      [\n        0 satisfies StringSchema,\n        0 satisfies StringSchema,\n        sensitiveString,\n        [3, \"ns\", \"NestedSensitiveStruct\", 0, [\"sensitive\"], [sensitiveString]],\n        [\n          3,\n          \"ns\",\n          \"Various\",\n          0,\n          [\"boolean\", \"number\", \"struct\", \"list-s\", \"list\", \"map-s\", \"map\"],\n          [\n            [0, \"ns\", \"Boolean\", { sensitive: 1 }, 2 satisfies BooleanSchema],\n            [0, \"ns\", \"Numeric\", { sensitive: 1 }, 1 satisfies NumericSchema],\n            [3, \"ns\", \"SensitiveStruct\", { sensitive: 1 }, [], []],\n            [1, \"ns\", \"List\", 0, sensitiveString],\n            [1, \"ns\", \"List\", 0, 0 satisfies StringSchema],\n            [2, \"ns\", \"Map\", 0, sensitiveString, 0 satisfies StringSchema],\n            [2, \"ns\", \"Map\", 0, 0 satisfies StringSchema, 0 satisfies StringSchema],\n          ],\n        ],\n      ],\n    ];\n\n    expect(\n      schemaLogFilter(schema, {\n        a: \"a\",\n        b: \"b\",\n        sensitive: \"xyz\",\n        nestedSensitive: {\n          sensitive: \"xyz\",\n        },\n        various: {\n          boolean: false,\n          number: 1,\n          struct: {\n            q: \"rf\",\n          },\n          \"list-s\": [1, 2, 3],\n          list: [4, 5, 6],\n          \"map-s\": {\n            a: \"a\",\n            b: \"b\",\n            c: \"c\",\n          },\n          map: {\n            a: \"d\",\n            b: \"e\",\n            c: \"f\",\n          },\n        },\n      })\n    ).toEqual({\n      a: \"a\",\n      b: \"b\",\n      sensitive: \"***SensitiveInformation***\",\n      nestedSensitive: {\n        sensitive: \"***SensitiveInformation***\",\n      },\n      various: {\n        boolean: \"***SensitiveInformation***\",\n        number: \"***SensitiveInformation***\",\n        struct: \"***SensitiveInformation***\",\n        \"list-s\": \"***SensitiveInformation***\",\n        list: [4, 5, 6],\n        \"map-s\": \"***SensitiveInformation***\",\n        map: {\n          a: \"d\",\n          b: \"e\",\n          c: \"f\",\n        },\n      },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/schemaLogFilter.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport type { SchemaRef } from \"@smithy/types\";\n\nconst SENSITIVE_STRING = \"***SensitiveInformation***\";\n\n/**\n * Redacts sensitive parts of any data object using its schema, for logging.\n *\n * @internal\n * @param schema - with filtering traits.\n * @param data - to be logged.\n */\nexport function schemaLogFilter(schema: SchemaRef, data: unknown): any {\n  if (data == null) {\n    return data;\n  }\n  const ns = NormalizedSchema.of(schema);\n  if (ns.getMergedTraits().sensitive) {\n    return SENSITIVE_STRING;\n  }\n\n  if (ns.isListSchema()) {\n    const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;\n    if (isSensitive) {\n      return SENSITIVE_STRING;\n    }\n  } else if (ns.isMapSchema()) {\n    const isSensitive =\n      !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;\n    if (isSensitive) {\n      return SENSITIVE_STRING;\n    }\n  } else if (ns.isStructSchema() && typeof data === \"object\") {\n    const object = data as Record<string, unknown>;\n\n    const newObject = {} as any;\n    for (const [member, memberNs] of ns.structIterator()) {\n      if (object[member] != null) {\n        newObject[member] = schemaLogFilter(memberNs, object[member]);\n      }\n    }\n    return newObject;\n  }\n\n  return data;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/ser-utils.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { serializeDateTime, serializeFloat } from \"./ser-utils\";\n\ndescribe(\"serializeFloat\", () => {\n  it(\"handles non-numerics\", () => {\n    expect(serializeFloat(NaN)).toEqual(\"NaN\");\n    expect(serializeFloat(Infinity)).toEqual(\"Infinity\");\n    expect(serializeFloat(-Infinity)).toEqual(\"-Infinity\");\n  });\n\n  it(\"handles normal numbers\", () => {\n    expect(serializeFloat(1)).toEqual(1);\n    expect(serializeFloat(1.1)).toEqual(1.1);\n  });\n});\n\ndescribe(\"serializeDateTime\", () => {\n  it(\"should truncate at the top of the second\", () => {\n    const date = new Date(1716476757761);\n    date.setMilliseconds(0);\n    expect(serializeDateTime(date)).toEqual(\"2024-05-23T15:05:57Z\");\n  });\n\n  it(\"should not truncate in general\", () => {\n    const date = new Date(1716476757761);\n    expect(serializeDateTime(date)).toEqual(\"2024-05-23T15:05:57.761Z\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/ser-utils.ts",
    "content": "/**\n * Serializes a number, turning non-numeric values into strings.\n *\n * @internal\n * @param value - The number to serialize.\n * @returns A number, or a string if the given number was non-numeric.\n */\nexport const serializeFloat = (value: number): string | number => {\n  // NaN is not equal to everything, including itself.\n  if (value !== value) {\n    return \"NaN\";\n  }\n  switch (value) {\n    case Infinity:\n      return \"Infinity\";\n    case -Infinity:\n      return \"-Infinity\";\n    default:\n      return value;\n  }\n};\n\n/**\n * @internal\n * @param date - to be serialized.\n * @returns https://smithy.io/2.0/spec/protocol-traits.html#timestampformat-trait date-time format.\n */\nexport const serializeDateTime = (date: Date): string => date.toISOString().replace(\".000Z\", \"Z\");\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/serde-json.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { _json } from \"./serde-json\";\n\ndescribe(_json.name, () => {\n  it(\"removes nullish entries\", () => {\n    expect(\n      _json({\n        g: void 0,\n        a: {\n          e: void 0,\n          b: {\n            c: {\n              f: void 0,\n            },\n            d: void 0,\n          },\n        },\n      })\n    ).toEqual({\n      a: {\n        b: {\n          c: {},\n        },\n      },\n    });\n  });\n\n  it(\"filters sparse lists\", () => {\n    expect(\n      _json({\n        a: {\n          b: 5,\n          c: [, , , 6],\n        },\n      })\n    ).toEqual({\n      a: { b: 5, c: [6] },\n    });\n  });\n\n  it(\"recursively removes nullish entries in arrays\", () => {\n    expect(\n      _json({\n        a: {\n          b: 5,\n          c: [, , { a: 5, b: 6, c: null, d: undefined }, 6],\n        },\n      })\n    ).toEqual({\n      a: { b: 5, c: [{ a: 5, b: 6 }, 6] },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/smithy-client/serde-json.ts",
    "content": "/**\n * Maps an object through the default JSON serde behavior.\n * This means removing nullish fields and un-sparsifying lists.\n * This is also used by Smithy RPCv2 CBOR as the default serde behavior.\n *\n * @internal\n * @param obj - to be checked.\n * @returns same object with default serde behavior applied.\n */\nexport const _json = (obj: any): any => {\n  if (obj == null) {\n    return {};\n  }\n  if (Array.isArray(obj)) {\n    return obj.filter((_: any) => _ != null).map(_json);\n  }\n  if (typeof obj === \"object\") {\n    const target: any = {};\n    for (const key of Object.keys(obj)) {\n      if (obj[key] == null) {\n        continue;\n      }\n      target[key] = _json(obj[key]);\n    }\n    return target;\n  }\n  return obj;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-middleware/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/client`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.1\n\n### Patch Changes\n\n- e6ea6bd5: move devDeps into deps\n- 5b6fa539: Add `getSmithyContext()` helper function\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-middleware](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-middleware/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-middleware/getSmithyContext.ts",
    "content": "import { SMITHY_CONTEXT_KEY, type HandlerExecutionContext } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const getSmithyContext = (context: HandlerExecutionContext): Record<string, unknown> =>\n  context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-middleware/normalizeProvider.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { normalizeProvider } from \"./normalizeProvider\";\n\ndescribe(normalizeProvider.name, () => {\n  const testCases = [\n    true, // boolean\n    null, // null\n    undefined, // undefined\n    1, // number\n    \"\", // string\n    {}, // object\n  ];\n\n  it.each(testCases)(\"returns Provider if value is not a function: %s\", async (value) => {\n    const output = normalizeProvider(value);\n    expect(await output()).toEqual(value);\n  });\n\n  it.each(testCases)(\"returns Provider if value if a function which returns %s\", (value) => {\n    const mockValueProvider = () => Promise.resolve(value);\n    expect(normalizeProvider(mockValueProvider)).toBe(mockValueProvider);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-middleware/normalizeProvider.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\n/**\n * @internal\n *\n * @returns a provider function for the input value if it isn't already one.\n */\nexport const normalizeProvider = <T>(input: T | Provider<T>): Provider<T> => {\n  if (typeof input === \"function\") return input as Provider<T>;\n  const promisified = Promise.resolve(input);\n  return () => promisified;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/client`.\n\n## 4.3.0\n\n### Minor Changes\n\n- c1395f1: emit warning from waiter polling when repeated 403s are encountered\n- ed851e7: add type information to WaiterResult reason\n\n## 4.2.16\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.15\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.14\n\n### Patch Changes\n\n- ce7e05f: Move `@smithy/abort-controller` to devDeps\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/abort-controller@4.2.12\n\n## 4.2.12\n\n### Patch Changes\n\n- f784187: fix(util-waiter): add optional chaining for `$response?.statusCode` in `createMessageFromResponse` to prevent TypeError when `$response` is undefined but `message` is present.\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/abort-controller@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/abort-controller@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/abort-controller@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/abort-controller@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/abort-controller@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/abort-controller@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/abort-controller@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- 75177cd: handle circular refs in debug messages\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/abort-controller@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/abort-controller@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/abort-controller@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/abort-controller@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/abort-controller@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/abort-controller@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/abort-controller@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.7\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/abort-controller@4.0.5\n\n## 4.0.6\n\n### Patch Changes\n\n- a197074: clean up waiters' abort signal listener\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/abort-controller@4.0.4\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/abort-controller@4.0.3\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/abort-controller@4.0.2\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/abort-controller@4.0.1\n\n## 4.0.1\n\n### Patch Changes\n\n- a147146: fix range validation in waiters\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/abort-controller@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.2.0\n\n### Minor Changes\n\n- 8950c05: record observed responses in waiter results\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/abort-controller@3.1.9\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/abort-controller@3.1.8\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/abort-controller@3.1.7\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/abort-controller@3.1.6\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/abort-controller@3.1.5\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/abort-controller@3.1.4\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/abort-controller@3.1.3\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/abort-controller@3.1.2\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/abort-controller@3.1.1\n\n## 3.1.1\n\n### Patch Changes\n\n- 1d11480: Return stringified result object in case of failure\n\n## 3.1.0\n\n### Minor Changes\n\n- c2a5595: use platform AbortController|AbortSignal implementations\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/abort-controller@3.1.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/abort-controller@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/abort-controller@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/abort-controller@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/abort-controller@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/abort-controller@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/abort-controller@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/abort-controller@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/abort-controller@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/abort-controller@2.0.16\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/abort-controller@2.0.15\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/abort-controller@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/abort-controller@2.0.13\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/abort-controller@2.0.12\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/abort-controller@2.0.11\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/abort-controller@2.0.10\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/abort-controller@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/abort-controller@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/abort-controller@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/abort-controller@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/abort-controller@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/abort-controller@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/abort-controller@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/abort-controller@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/abort-controller@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/abort-controller@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/abort-controller@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/abort-controller@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/abort-controller@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/abort-controller@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-waiter](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-waiter/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/circular-reference-bug.spec.ts",
    "content": "/**\n * Regression test for https://github.com/aws/aws-sdk-js-v3/issues/7459\n *\n * When a waiter receives a response/error containing circular references\n * (e.g. Node.js IncomingMessage with req/res cycle), JSON.stringify should\n * not throw \"Converting circular structure to JSON\".\n */\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { runPolling } from \"./poller\";\nimport { sleep } from \"./utils/sleep\";\nimport { WaiterState, checkExceptions, type WaiterOptions, type WaiterResult } from \"./waiter\";\n\nvi.mock(\"./utils/sleep\");\n\n/**\n * Creates a mock object that mimics the circular reference structure\n * of a Node.js IncomingMessage/ClientRequest pair, which is the exact\n * structure reported in the issue.\n */\nfunction createCircularHttpResponse() {\n  const incomingMessage: any = {\n    constructor: { name: \"IncomingMessage\" },\n    statusCode: 403,\n    headers: { \"content-type\": \"application/json\" },\n  };\n  const clientRequest: any = {\n    constructor: { name: \"ClientRequest\" },\n    method: \"POST\",\n    path: \"/\",\n  };\n  incomingMessage.req = clientRequest;\n  clientRequest.res = incomingMessage;\n  return incomingMessage;\n}\n\ndescribe(\"GitHub Issue #7459: circular structure in waiter results\", () => {\n  const config: WaiterOptions<any> = {\n    minDelay: 2,\n    maxDelay: 30,\n    maxWaitTime: 99999,\n    client: \"mockClient\",\n  };\n\n  describe(\"checkExceptions\", () => {\n    it(\"should not throw TypeError for FAILURE result with circular reason\", () => {\n      const result: WaiterResult = {\n        state: WaiterState.FAILURE,\n        reason: createCircularHttpResponse(),\n      };\n\n      expect(() => checkExceptions(result)).toThrow();\n      try {\n        checkExceptions(result);\n      } catch (e: any) {\n        expect(e).toBeInstanceOf(Error);\n        expect(e.message).not.toContain(\"Converting circular structure to JSON\");\n        expect(e.message).toContain(\"[Circular]\");\n      }\n    });\n  });\n\n  describe(\"runPolling\", () => {\n    beforeEach(() => {\n      vi.mocked(sleep).mockResolvedValue(\"\");\n    });\n\n    afterEach(() => {\n      vi.clearAllMocks();\n    });\n\n    it(\"should handle circular reason from acceptorChecks\", async () => {\n      const circularResponse = createCircularHttpResponse();\n      const mockAcceptorChecks = vi.fn().mockResolvedValueOnce({\n        state: WaiterState.FAILURE,\n        reason: circularResponse,\n      });\n\n      const result = await runPolling(config, \"input\", mockAcceptorChecks);\n      expect(result.state).toBe(WaiterState.FAILURE);\n      expect(result.reason).toBe(circularResponse);\n      const keys = Object.keys(result.observedResponses!);\n      expect(keys.length).toBe(1);\n      expect(keys[0]).not.toContain(\"Converting circular structure\");\n    });\n\n    it(\"should handle reason with $metadata and message but no $response\", async () => {\n      const mockAcceptorChecks = vi.fn().mockResolvedValueOnce({\n        state: WaiterState.FAILURE,\n        reason: {\n          message: \"User is not authorized to perform acm-pca:IssueCertificate\",\n          $metadata: { httpStatusCode: 403 },\n        },\n      });\n\n      const result = await runPolling(config, \"input\", mockAcceptorChecks);\n      expect(result.state).toBe(WaiterState.FAILURE);\n      const keys = Object.keys(result.observedResponses!);\n      expect(keys.length).toBe(1);\n      expect(keys[0]).toContain(\"403\");\n      expect(keys[0]).toContain(\"not authorized\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/circularReplacer.spec.ts",
    "content": "import { describe, expect, it } from \"vitest\";\n\nimport { getCircularReplacer } from \"./circularReplacer\";\n\ndescribe(\"getCircularReplacer\", () => {\n  it(\"should handle nested circular references\", () => {\n    const x = {\n      a: 1,\n      b: 2,\n      c: {\n        d: {\n          e: -1,\n          f: 3,\n          g: {\n            h: -1,\n          },\n        },\n      },\n    } as any;\n\n    x.c.d.e = x;\n    x.c.d.g.h = x;\n\n    expect(\n      JSON.parse(\n        JSON.stringify(\n          {\n            x,\n          },\n          getCircularReplacer()\n        )\n      )\n    ).toEqual({\n      x: {\n        a: 1,\n        b: 2,\n        c: {\n          d: {\n            e: \"[Circular]\",\n            f: 3,\n            g: {\n              h: \"[Circular]\",\n            },\n          },\n        },\n      },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/circularReplacer.ts",
    "content": "/**\n * Helper for JSON stringification debug logging.\n *\n * @internal\n */\nexport const getCircularReplacer = () => {\n  const seen = new WeakSet();\n  return (key: any, value: any) => {\n    if (typeof value === \"object\" && value !== null) {\n      if (seen.has(value)) {\n        return \"[Circular]\";\n      }\n      seen.add(value);\n    }\n    return value;\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/createWaiter.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { createWaiter } from \"./createWaiter\";\nimport { WaiterState, type WaiterOptions } from \"./waiter\";\n\nvi.mock(\"./utils/validate\", () => ({\n  validateWaiterOptions: vi.fn(),\n}));\n\ndescribe(\"createWaiter\", () => {\n  beforeEach(() => {\n    vi.useFakeTimers();\n  });\n\n  afterEach(() => {\n    vi.useRealTimers();\n  });\n\n  const minimalWaiterConfig = {\n    minDelay: 2,\n    maxDelay: 120,\n    maxWaitTime: 9999,\n    client: \"client\",\n  } as WaiterOptions<any>;\n  const input = \"input\";\n\n  const abortedState = {\n    state: WaiterState.ABORTED,\n  };\n  const failureState = {\n    state: WaiterState.FAILURE,\n  };\n  const retryState = {\n    state: WaiterState.RETRY,\n  };\n  const successState = {\n    state: WaiterState.SUCCESS,\n  };\n\n  it(\"should abort when abortController is signalled\", async () => {\n    const abortController = new AbortController();\n    const mockAcceptorChecks = vi.fn().mockResolvedValue(retryState);\n    const statusPromise = createWaiter(\n      {\n        ...minimalWaiterConfig,\n        maxWaitTime: 20,\n        abortController,\n      },\n      input,\n      mockAcceptorChecks\n    );\n    vi.advanceTimersByTime(10 * 1000);\n    abortController.abort(); // Abort before maxWaitTime(20s);\n    expect(await statusPromise).toMatchObject(abortedState);\n  });\n\n  it(\"should remove the event listener on the abort signal after the waiter resolves regardless of whether it has been invoked\", async () => {\n    const abortController = new AbortController();\n    vi.spyOn(abortController.signal, \"addEventListener\");\n    vi.spyOn(abortController.signal, \"removeEventListener\");\n\n    const mockAcceptorChecks = vi.fn().mockResolvedValue(successState);\n    const statusPromise = createWaiter(\n      {\n        ...minimalWaiterConfig,\n        abortSignal: abortController.signal,\n        maxWaitTime: 20,\n      },\n      input,\n      mockAcceptorChecks\n    );\n    expect(abortController.signal.addEventListener).toHaveBeenCalledOnce();\n    vi.advanceTimersByTime(minimalWaiterConfig.minDelay * 1000);\n    expect(await statusPromise).toMatchObject(successState);\n    expect(abortController.signal.removeEventListener).toHaveBeenCalledOnce();\n  });\n\n  it(\"should succeed when acceptor checker returns success\", async () => {\n    const mockAcceptorChecks = vi.fn().mockResolvedValue(successState);\n    const statusPromise = createWaiter(\n      {\n        ...minimalWaiterConfig,\n        maxWaitTime: 20,\n      },\n      input,\n      mockAcceptorChecks\n    );\n    vi.advanceTimersByTime(minimalWaiterConfig.minDelay * 1000);\n    expect(await statusPromise).toMatchObject(successState);\n  });\n\n  it(\"should fail when acceptor checker returns failure\", async () => {\n    const mockAcceptorChecks = vi.fn().mockResolvedValue(failureState);\n    const statusPromise = createWaiter(\n      {\n        ...minimalWaiterConfig,\n        maxWaitTime: 20,\n      },\n      input,\n      mockAcceptorChecks\n    );\n    vi.advanceTimersByTime(minimalWaiterConfig.minDelay * 1000);\n    expect(await statusPromise).toMatchObject(failureState);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/createWaiter.ts",
    "content": "import type { AbortSignal as DeprecatedAbortSignal } from \"@smithy/types\";\n\nimport { runPolling } from \"./poller\";\nimport { validateWaiterOptions } from \"./utils/validate\";\nimport { WaiterState, waiterServiceDefaults, type WaiterOptions, type WaiterResult } from \"./waiter\";\n\nconst abortTimeout = <R>(\n  abortSignal: AbortSignal | DeprecatedAbortSignal\n): {\n  clearListener: () => void;\n  aborted: Promise<WaiterResult<R>>;\n} => {\n  let onAbort: () => void;\n\n  const promise = new Promise<WaiterResult<R>>((resolve) => {\n    onAbort = () => resolve({ state: WaiterState.ABORTED });\n    if (typeof (abortSignal as AbortSignal).addEventListener === \"function\") {\n      // preferred.\n      (abortSignal as AbortSignal).addEventListener(\"abort\", onAbort);\n    } else {\n      // backwards compatibility\n      abortSignal.onabort = onAbort;\n    }\n  });\n\n  return {\n    clearListener() {\n      if (typeof (abortSignal as AbortSignal).removeEventListener === \"function\") {\n        (abortSignal as AbortSignal).removeEventListener(\"abort\", onAbort);\n      }\n    },\n    aborted: promise,\n  };\n};\n\n/**\n * Create a waiter promise that only resolves when:\n * 1. Abort controller is signaled\n * 2. Max wait time is reached\n * 3. `acceptorChecks` succeeds, or fails\n * Otherwise, it invokes `acceptorChecks` with exponential-backoff delay.\n *\n * @internal\n */\nexport const createWaiter = async <Client, Input, Reason = any>(\n  options: WaiterOptions<Client>,\n  input: Input,\n  acceptorChecks: (client: Client, input: Input) => Promise<WaiterResult<Reason>>\n): Promise<WaiterResult<Reason>> => {\n  const params = {\n    ...waiterServiceDefaults,\n    ...options,\n  };\n  validateWaiterOptions(params);\n\n  const exitConditions = [runPolling<Client, Input, Reason>(params, input, acceptorChecks)];\n\n  const finalize = [] as Array<() => void>;\n\n  if (options.abortSignal) {\n    const { aborted, clearListener } = abortTimeout<Reason>(options.abortSignal);\n    finalize.push(clearListener);\n    exitConditions.push(aborted);\n  }\n  if (options.abortController?.signal) {\n    const { aborted, clearListener } = abortTimeout<Reason>(options.abortController.signal);\n    finalize.push(clearListener);\n    exitConditions.push(aborted);\n  }\n\n  return Promise.race<WaiterResult<Reason>>(exitConditions).then((result) => {\n    for (const fn of finalize) {\n      fn();\n    }\n    return result;\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/poller.spec.ts",
    "content": "import { AbortController as AbortControllerPolyfill } from \"@smithy/abort-controller\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { runPolling } from \"./poller\";\nimport { sleep } from \"./utils/sleep\";\nimport { WaiterState, type WaiterOptions } from \"./waiter\";\n\nvi.mock(\"./utils/sleep\");\n\ndescribe(runPolling.name, () => {\n  const config = {\n    minDelay: 2,\n    maxDelay: 30,\n    maxWaitTime: 99999,\n    client: \"mockClient\",\n  } as WaiterOptions<any>;\n  const input = \"mockInput\";\n  const abortedState = {\n    state: WaiterState.ABORTED,\n    observedResponses: {\n      \"AbortController signal aborted.\": 1,\n    },\n  };\n  const failureState = {\n    state: WaiterState.FAILURE,\n    reason: {\n      mockedReason: \"some-failure-value\",\n    },\n    final: {\n      mockedReason: \"some-failure-value\",\n    },\n    observedResponses: {\n      [JSON.stringify({\n        mockedReason: \"some-failure-value\",\n      })]: 1,\n    },\n  };\n  const successState = {\n    state: WaiterState.SUCCESS,\n    reason: {\n      mockedReason: \"some-success-value\",\n    },\n    final: {\n      mockedReason: \"some-success-value\",\n    },\n    observedResponses: {\n      [JSON.stringify({\n        mockedReason: \"some-success-value\",\n      })]: 1,\n    },\n  };\n  const retryState = {\n    state: WaiterState.RETRY,\n    reason: undefined,\n    observedResponses: {},\n  };\n  const timeoutState = {\n    state: WaiterState.TIMEOUT,\n    observedResponses: {},\n  };\n\n  let mockAcceptorChecks;\n\n  beforeEach(() => {\n    vi.mocked(sleep).mockResolvedValueOnce(\"\");\n    vi.spyOn(global.Math, \"random\").mockReturnValue(0.5);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n    vi.spyOn(global.Math, \"random\").mockRestore();\n  });\n\n  it(\"should returns state and reason in case of failure\", async () => {\n    mockAcceptorChecks = vi.fn().mockResolvedValueOnce(failureState);\n    await expect(runPolling(config, input, mockAcceptorChecks)).resolves.toStrictEqual(failureState);\n\n    expect(mockAcceptorChecks).toHaveBeenCalled();\n    expect(mockAcceptorChecks).toHaveBeenCalledTimes(1);\n    expect(mockAcceptorChecks).toHaveBeenCalledWith(config.client, input);\n    expect(sleep).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"returns state and reason in case of success\", async () => {\n    mockAcceptorChecks = vi.fn().mockResolvedValueOnce(successState);\n    await expect(runPolling(config, input, mockAcceptorChecks)).resolves.toStrictEqual(successState);\n    expect(mockAcceptorChecks).toHaveBeenCalled();\n    expect(mockAcceptorChecks).toHaveBeenCalledTimes(1);\n    expect(mockAcceptorChecks).toHaveBeenCalledWith(config.client, input);\n    expect(sleep).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"sleeps as per exponentialBackoff in case of retry\", async () => {\n    mockAcceptorChecks = vi\n      .fn()\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce(successState);\n\n    await expect(runPolling(config, input, mockAcceptorChecks)).resolves.toStrictEqual(successState);\n\n    expect(sleep).toHaveBeenCalled();\n    expect(mockAcceptorChecks).toHaveBeenCalledTimes(8);\n    expect(sleep).toHaveBeenCalledTimes(7);\n    expect(sleep).toHaveBeenNthCalledWith(1, 2); // min delay\n    expect(sleep).toHaveBeenNthCalledWith(2, 3); // random(2, 4)\n    expect(sleep).toHaveBeenNthCalledWith(3, 5); // random(2, 8)\n    expect(sleep).toHaveBeenNthCalledWith(4, 9); // random(2, 16)\n    expect(sleep).toHaveBeenNthCalledWith(5, 30); // past attemptCeiling, maxDelay\n    expect(sleep).toHaveBeenNthCalledWith(6, 30); // past attemptCeiling\n    expect(sleep).toHaveBeenNthCalledWith(7, 30); // past attemptCeiling\n  });\n\n  it(\"resolves after the last attempt before reaching maxWaitTime \", async () => {\n    let now = Date.now();\n    const delay = 2;\n    const nowMock = vi\n      .spyOn(Date, \"now\")\n      .mockReturnValueOnce(now) // 1st invoke for getting the time stamp to wait until\n      .mockImplementation(() => {\n        const rtn = now;\n        now += delay * 1000;\n        return rtn;\n      });\n    const localConfig = {\n      ...config,\n      minDelay: delay,\n      maxDelay: delay,\n      maxWaitTime: 5,\n    };\n\n    mockAcceptorChecks = vi.fn().mockResolvedValue(retryState);\n    await expect(runPolling(localConfig, input, mockAcceptorChecks)).resolves.toStrictEqual(timeoutState);\n    nowMock.mockReset();\n  });\n\n  it.each([\n    { label: \"native\", AbortController },\n    { label: \"smithy\", AbortController: AbortControllerPolyfill },\n  ])(\"resolves when abortController is signalled ($label)\", async ({ AbortController }) => {\n    const abortController = new AbortController();\n    const localConfig = {\n      ...config,\n      abortController,\n    };\n\n    mockAcceptorChecks = vi.fn().mockResolvedValue(retryState);\n    abortController.abort();\n    await expect(runPolling(localConfig, input, mockAcceptorChecks)).resolves.toStrictEqual(abortedState);\n    expect(sleep).not.toHaveBeenCalled();\n  });\n\n  it(\"should populate 'final' alongside 'reason' on non-retry results\", async () => {\n    const reason = { code: \"ResourceReady\" };\n    mockAcceptorChecks = vi.fn().mockResolvedValueOnce({ state: WaiterState.SUCCESS, reason });\n    const result = await runPolling(config, input, mockAcceptorChecks);\n    expect(result.final).toStrictEqual(reason);\n    expect(result.reason).toStrictEqual(reason);\n  });\n\n  it(\"should populate 'final' after retries resolve to a terminal state\", async () => {\n    const reason = { code: \"InstanceRunning\" };\n    mockAcceptorChecks = vi\n      .fn()\n      .mockResolvedValueOnce(retryState)\n      .mockResolvedValueOnce({ state: WaiterState.SUCCESS, reason });\n    const result = await runPolling(config, input, mockAcceptorChecks);\n    expect(result.final).toStrictEqual(reason);\n    expect(result.reason).toStrictEqual(reason);\n  });\n\n  it(\"should not populate 'final' on timeout\", async () => {\n    let now = Date.now();\n    const delay = 2;\n    const nowMock = vi\n      .spyOn(Date, \"now\")\n      .mockReturnValueOnce(now)\n      .mockImplementation(() => {\n        const rtn = now;\n        now += delay * 1000;\n        return rtn;\n      });\n    const localConfig = {\n      ...config,\n      minDelay: delay,\n      maxDelay: delay,\n      maxWaitTime: 5,\n    };\n    mockAcceptorChecks = vi.fn().mockResolvedValue(retryState);\n    const result = await runPolling(localConfig, input, mockAcceptorChecks);\n    expect(result.state).toBe(WaiterState.TIMEOUT);\n    expect(result.final).toBeUndefined();\n    nowMock.mockReset();\n  });\n\n  it(\"should warn when polling exceeds 60s and 403s are observed\", async () => {\n    const warnSpy = vi.spyOn(console, \"warn\").mockImplementation(() => {});\n    const reason403 = { $metadata: { httpStatusCode: 403 }, message: \"Forbidden\" };\n    const retryWith403 = { state: WaiterState.RETRY, reason: reason403 };\n\n    // Simulate time: start at T=0, each Date.now() call advances 20s.\n    // This ensures we cross the 60s warn403Time threshold after a few polls.\n    let now = 1_000_000;\n    const nowMock = vi\n      .spyOn(Date, \"now\")\n      .mockReturnValueOnce(now) // waitUntil\n      .mockImplementation(() => {\n        const rtn = now;\n        now += 20_000;\n        return rtn;\n      });\n\n    const localConfig = {\n      ...config,\n      minDelay: 2,\n      maxDelay: 2,\n      maxWaitTime: 300,\n      client: { config: {} },\n    } as WaiterOptions<any>;\n\n    mockAcceptorChecks = vi\n      .fn()\n      .mockResolvedValueOnce(retryWith403) // initial check\n      .mockResolvedValueOnce(retryWith403) // poll 1\n      .mockResolvedValueOnce(retryWith403) // poll 2\n      .mockResolvedValueOnce(retryWith403) // poll 3\n      .mockResolvedValueOnce({ state: WaiterState.SUCCESS, reason: { $metadata: { httpStatusCode: 200 } } });\n\n    await runPolling(localConfig, input, mockAcceptorChecks);\n\n    expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining(\"403 status code encountered during waiter polling\"));\n\n    warnSpy.mockRestore();\n    nowMock.mockReset();\n  });\n\n  it(\"should not warn or throw when polling exceeds 60s without observed responses\", async () => {\n    const warnSpy = vi.spyOn(console, \"warn\").mockImplementation(() => {});\n\n    // Simulate time: start at T=0, each Date.now() call advances 20s.\n    // This ensures we cross the 60s warn403Time threshold after a few polls.\n    let now = 1_000_000;\n    const nowMock = vi\n      .spyOn(Date, \"now\")\n      .mockReturnValueOnce(now) // waitUntil\n      .mockImplementation(() => {\n        const rtn = now;\n        now += 20_000;\n        return rtn;\n      });\n\n    const localConfig = {\n      ...config,\n      minDelay: 2,\n      maxDelay: 2,\n      maxWaitTime: 300,\n      client: { config: {} },\n    } as WaiterOptions<any>;\n\n    mockAcceptorChecks = vi\n      .fn()\n      .mockResolvedValueOnce(retryState) // initial check\n      .mockResolvedValueOnce(retryState) // poll 1\n      .mockResolvedValueOnce(retryState) // poll 2\n      .mockResolvedValueOnce({ state: WaiterState.SUCCESS, reason: { $metadata: { httpStatusCode: 200 } } });\n\n    await expect(runPolling(localConfig, input, mockAcceptorChecks)).resolves.toMatchObject({\n      state: WaiterState.SUCCESS,\n    });\n    expect(warnSpy).not.toHaveBeenCalled();\n\n    warnSpy.mockRestore();\n    nowMock.mockReset();\n  });\n\n  it(\"should truncate delay to fire a last poll before timeout\", async () => {\n    // Use real-ish time: start at T=0, advance 1s per Date.now() call.\n    let now = 1_000_000;\n    const nowMock = vi\n      .spyOn(Date, \"now\")\n      .mockReturnValueOnce(now) // waitUntil = now + 10_000\n      .mockImplementation(() => {\n        const rtn = now;\n        now += 1_000;\n        return rtn;\n      });\n\n    const localConfig = {\n      ...config,\n      minDelay: 2,\n      maxDelay: 30,\n      maxWaitTime: 10,\n      client: \"mockClient\",\n    } as WaiterOptions<any>;\n\n    mockAcceptorChecks = vi\n      .fn()\n      .mockResolvedValueOnce(retryState) // initial check\n      .mockResolvedValue({ state: WaiterState.SUCCESS, reason: { ok: true } });\n\n    const result = await runPolling(localConfig, input, mockAcceptorChecks);\n\n    // The backoff function should have truncated the delay so that\n    // sleep was called with a value less than the normal backoff,\n    // allowing one more poll before timeout.\n    expect(sleep).toHaveBeenCalled();\n    const sleepArg = vi.mocked(sleep).mock.calls[0][0];\n    expect(sleepArg).toBeLessThanOrEqual(localConfig.maxDelay);\n    expect(result.state).toBe(WaiterState.SUCCESS);\n\n    nowMock.mockReset();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/poller.ts",
    "content": "import { getCircularReplacer } from \"./circularReplacer\";\nimport { sleep } from \"./utils/sleep\";\nimport { WaiterState, type WaiterOptions, type WaiterResult } from \"./waiter\";\n\n/**\n * Function that runs polling as part of waiters. This will make one inital attempt and then\n * subsequent attempts with an increasing delay.\n *\n * @param params - options passed to the waiter.\n * @param client - AWS SDK Client\n * @param input - client input\n * @param acceptorChecks - function that checks the acceptor states on each poll.\n */\nexport const runPolling = async <Client, Input, Reason = any>(\n  { minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }: WaiterOptions<Client>,\n  input: Input,\n  acceptorChecks: (client: Client, input: Input) => Promise<WaiterResult<Reason>>\n): Promise<WaiterResult<Reason>> => {\n  const observedResponses: Record<string, number> = {};\n  const [minDelayMs, maxDelayMs] = [minDelay * 1000, maxDelay * 1000];\n\n  let currentAttempt = 0;\n  const waitUntil = Date.now() + maxWaitTime * 1000;\n\n  // warn about 403s if the waiter is still running at this time.\n  const warn403Time = Date.now() + 60_000;\n  let didWarn403 = false;\n\n  while (true) {\n    if (currentAttempt > 0) {\n      const delayMs = exponentialBackoffWithJitter(minDelayMs, maxDelayMs, currentAttempt, waitUntil);\n\n      if (abortController?.signal?.aborted || abortSignal?.aborted) {\n        const message = \"AbortController signal aborted.\";\n        observedResponses[message] |= 0;\n        observedResponses[message] += 1;\n        return { state: WaiterState.ABORTED, observedResponses };\n      }\n      if (Date.now() + delayMs > waitUntil) {\n        return { state: WaiterState.TIMEOUT, observedResponses };\n      }\n\n      await sleep(delayMs / 1_000);\n    }\n\n    const { state, reason } = await acceptorChecks(client, input);\n\n    if (reason) {\n      const message = createMessageFromResponse(reason);\n      observedResponses[message] |= 0;\n      observedResponses[message] += 1;\n    }\n\n    if (state !== WaiterState.RETRY) {\n      return { state, reason, final: reason, observedResponses };\n    }\n\n    currentAttempt += 1;\n\n    if (!didWarn403 && Date.now() >= warn403Time) {\n      checkWarn403(observedResponses, client);\n      didWarn403 = true;\n    }\n  }\n};\n\n/**\n * Called after the waiter reaches at least 1 minute of wait time,\n * checking if the observed responses are predominantly 403s.\n *\n * In such a case, warn that 403 was encountered during waiter polling.\n */\nconst checkWarn403 = (observedResponses: Record<string, number> = {}, client: any): void => {\n  const orderedErrors = Object.keys(observedResponses);\n\n  let maxCount = 0;\n  let count403 = 0;\n\n  for (const response of orderedErrors) {\n    const n = observedResponses[response] | 0;\n    maxCount = Math.max(n, maxCount);\n    if (response.startsWith(\"403:\")) {\n      count403 += n;\n    }\n  }\n  const clientLogger = client?.config?.logger;\n  const warningLogger =\n    typeof clientLogger?.warn === \"function\" && !clientLogger.constructor?.name?.includes?.(\"NoOpLogger\")\n      ? clientLogger\n      : console;\n\n  if (count403 >= 3 || orderedErrors[orderedErrors.length - 1]?.startsWith(\"403:\")) {\n    warningLogger.warn(`@smithy/util-waiter WARN - 403 status code encountered during waiter polling.`);\n  }\n};\n\n/**\n * Convert the result of an SDK operation, either an error or response object, to a\n * readable string.\n *\n * @internal\n */\nconst createMessageFromResponse = (reason: any): string => {\n  const status = reason?.$response?.statusCode ?? reason?.$metadata?.httpStatusCode;\n\n  if (reason?.$responseBodyText) {\n    // is a deserialization error.\n    return `${status ? status + \": \" : \"\"}Deserialization error for body: ${reason.$responseBodyText}`;\n  }\n  if (status) {\n    // has a status code.\n    if (reason?.$response || reason?.message) {\n      // is an error object.\n      return `${status ?? \"Unknown\"}: ${reason?.message}`;\n    }\n    // is an output object.\n    return `${status}: OK`;\n  }\n  // is an unknown object.\n  return String(reason?.message ?? JSON.stringify(reason, getCircularReplacer()) ?? \"Unknown\");\n};\n\n/**\n * Reference: https://smithy.io/2.0/additional-specs/waiters.html#waiter-retries\n *\n * @internal\n */\nconst exponentialBackoffWithJitter = (minDelayMs: number, maxDelayMs: number, attempt: number, waitUntil: number) => {\n  const attemptCountCeiling = Math.log(maxDelayMs / minDelayMs) / Math.log(2) + 1;\n  if (attempt > attemptCountCeiling) {\n    return maxDelayMs;\n  }\n\n  const delay = minDelayMs * 2 ** (attempt - 1);\n  const capped = Math.min(delay, maxDelayMs);\n  const waitFor = randomInRange(minDelayMs, capped);\n\n  if (Date.now() + waitFor > waitUntil) {\n    const timeRemaining = waitUntil - Date.now();\n    // fire the last request 500ms before the waiter would time out.\n    return Math.max(0, timeRemaining - 500);\n  }\n  return waitFor;\n};\n\nconst randomInRange = (min: number, max: number) => min + Math.random() * (max - min);\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/utils/sleep.ts",
    "content": "/**\n * @internal\n */\nexport const sleep = (seconds: number) => {\n  return new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/utils/validate.spec.ts",
    "content": "import { beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport type { WaiterOptions } from \"../waiter\";\nimport { validateWaiterOptions } from \"./validate\";\n\ndescribe(validateWaiterOptions.name, () => {\n  let waiterOptions: WaiterOptions<any>;\n\n  beforeEach(() => {\n    waiterOptions = {\n      maxWaitTime: 120,\n      minDelay: 20,\n      maxDelay: 1200,\n      client: \"client\",\n    };\n  });\n\n  it(\"should not throw an error when maxDelay is proper\", () => {\n    waiterOptions.maxDelay = 300;\n    waiterOptions.minDelay = 200;\n    waiterOptions.maxWaitTime = 250;\n    try {\n      validateWaiterOptions(waiterOptions);\n    } catch (e) {\n      expect(e).toBe(\"SHOULD NOT ERROR HERE\");\n    }\n  });\n\n  it(\"should not throw an error when maxDelay is less than minDelay\", () => {\n    waiterOptions.maxDelay = 120;\n    waiterOptions.minDelay = 200;\n    waiterOptions.maxWaitTime = 250;\n    try {\n      validateWaiterOptions(waiterOptions);\n      expect(1).toBe(\"SHOULD NOT GET HERE\");\n    } catch (e) {\n      expect(e.toString()).toBe(\n        \"Error: WaiterConfiguration.maxDelay [120] must be greater than WaiterConfiguration.minDelay [200] for this waiter\"\n      );\n    }\n  });\n\n  it(\"should not throw an error when maxWaitTime is proper\", () => {\n    waiterOptions.maxWaitTime = 300;\n    waiterOptions.minDelay = 200;\n    try {\n      validateWaiterOptions(waiterOptions);\n    } catch (e) {\n      expect(e).toBe(\"SHOULD NOT ERROR HERE\");\n    }\n  });\n\n  it(\"should not throw an error with small decimal numbers\", () => {\n    waiterOptions.maxWaitTime = 0.5;\n    waiterOptions.minDelay = 0.0001;\n    waiterOptions.maxDelay = 0.4;\n    validateWaiterOptions(waiterOptions);\n  });\n\n  it(\"should throw when maxWaitTime is less than 0\", () => {\n    waiterOptions.maxWaitTime = -2;\n    waiterOptions.minDelay = -1;\n    try {\n      validateWaiterOptions(waiterOptions);\n    } catch (e) {\n      expect(e.toString()).toBe(\"Error: WaiterConfiguration.maxWaitTime must be greater than 0\");\n    }\n  });\n\n  it(\"should throw when maxWaitTime is less than minDelay\", () => {\n    waiterOptions.maxWaitTime = 150;\n    waiterOptions.minDelay = 200;\n    try {\n      validateWaiterOptions(waiterOptions);\n    } catch (e) {\n      expect(e.toString()).toBe(\n        \"Error: WaiterConfiguration.maxWaitTime [150] must be greater than WaiterConfiguration.minDelay [200] for this waiter\"\n      );\n    }\n  });\n\n  it(\"should throw when maxWaitTime is equal tominDelay\", () => {\n    waiterOptions.maxWaitTime = 200;\n    waiterOptions.minDelay = 200;\n    try {\n      validateWaiterOptions(waiterOptions);\n    } catch (e) {\n      expect(e.toString()).toBe(\n        \"Error: WaiterConfiguration.maxWaitTime [200] must be greater than WaiterConfiguration.minDelay [200] for this waiter\"\n      );\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/utils/validate.ts",
    "content": "import type { WaiterOptions } from \"../waiter\";\n\n/**\n * Validates that waiter options are passed correctly\n *\n * @internal\n * @param options - a waiter configuration object\n */\nexport const validateWaiterOptions = <Client>(options: WaiterOptions<Client>): void => {\n  if (options.maxWaitTime <= 0) {\n    throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`);\n  } else if (options.minDelay <= 0) {\n    throw new Error(`WaiterConfiguration.minDelay must be greater than 0`);\n  } else if (options.maxDelay <= 0) {\n    throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`);\n  } else if (options.maxWaitTime <= options.minDelay) {\n    throw new Error(\n      `WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`\n    );\n  } else if (options.maxDelay < options.minDelay) {\n    throw new Error(\n      `WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`\n    );\n  }\n};\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/waiter.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { WaiterState, checkExceptions } from \"./waiter\";\n\ndescribe(checkExceptions.name, () => {\n  const reason = \"generic reason\";\n\n  it(`throw AbortError if state is ${WaiterState.ABORTED}`, () => {\n    const result = { state: WaiterState.ABORTED, reason };\n    expect(() => checkExceptions(result)).toThrowError(JSON.stringify({ ...result, reason: \"Request was aborted\" }));\n  });\n\n  it(`throw TimeoutError if state is ${WaiterState.TIMEOUT}`, () => {\n    const result = { state: WaiterState.TIMEOUT, reason };\n    expect(() => checkExceptions(result)).toThrowError(JSON.stringify({ ...result, reason: \"Waiter has timed out\" }));\n  });\n\n  it(`throw generic Error if state is ${WaiterState.RETRY}`, () => {\n    const result = { state: WaiterState.RETRY, reason };\n    expect(() => checkExceptions(result)).toThrow(JSON.stringify(result));\n  });\n\n  it(`throw generic Error if state is ${WaiterState.FAILURE}`, () => {\n    const result = { state: WaiterState.FAILURE, reason };\n    expect(() => checkExceptions(result)).toThrow(JSON.stringify(result));\n  });\n\n  it(`return result if state is ${WaiterState.SUCCESS}`, () => {\n    const result = { state: WaiterState.SUCCESS };\n    expect(checkExceptions(result)).toEqual(result);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/client/util-waiter/waiter.ts",
    "content": "import type { WaiterConfiguration } from \"@smithy/types\";\n\nimport { getCircularReplacer } from \"./circularReplacer\";\n\nexport { WaiterConfiguration };\n\n/**\n * @internal\n */\nexport const waiterServiceDefaults = {\n  minDelay: 2,\n  maxDelay: 120,\n};\n\n/**\n * @internal\n */\nexport type WaiterOptions<Client> = WaiterConfiguration<Client> &\n  Required<Pick<WaiterConfiguration<Client>, \"minDelay\" | \"maxDelay\">>;\n\n/**\n * @public\n */\nexport enum WaiterState {\n  ABORTED = \"ABORTED\",\n  FAILURE = \"FAILURE\",\n  SUCCESS = \"SUCCESS\",\n  RETRY = \"RETRY\",\n  TIMEOUT = \"TIMEOUT\",\n}\n\n/**\n * @public\n */\nexport type WaiterResult<R = any> = {\n  state: WaiterState;\n\n  /**\n   * @deprecated because this was untyped as `any`, new code should use the field 'final',\n   * which is the same value, but typed.\n   */\n  reason?: any;\n\n  /**\n   * (optional) Indicates a reason for why a waiter has reached its state.\n   */\n  final?: R;\n\n  /**\n   * Responses observed by the waiter during its polling, where the value\n   * is the count.\n   */\n  observedResponses?: Record<string, number>;\n};\n\n/**\n * Handles and throws exceptions resulting from the waiterResult\n * @internal\n * @param result - WaiterResult\n */\nexport const checkExceptions = <R>(result: WaiterResult<R>): WaiterResult<R> => {\n  if (result.state === WaiterState.ABORTED) {\n    const abortError = new Error(\n      `${JSON.stringify(\n        {\n          ...result,\n          reason: \"Request was aborted\",\n        },\n        getCircularReplacer()\n      )}`\n    );\n    abortError.name = \"AbortError\";\n    throw abortError;\n  } else if (result.state === WaiterState.TIMEOUT) {\n    const timeoutError = new Error(\n      `${JSON.stringify(\n        {\n          ...result,\n          reason: \"Waiter has timed out\",\n        },\n        getCircularReplacer()\n      )}`\n    );\n    timeoutError.name = \"TimeoutError\";\n    throw timeoutError;\n  } else if (result.state !== WaiterState.SUCCESS) {\n    throw new Error(`${JSON.stringify(result, getCircularReplacer())}`);\n  }\n  return result;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.4.17\n\n### Patch Changes\n\n- Updated dependencies [449ba5a]\n  - @smithy/util-endpoints@3.4.2\n\n## 4.4.16\n\n### Patch Changes\n\n- Updated dependencies [5a18069]\n- Updated dependencies [cb76b1f]\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n- Updated dependencies [b4a8b6b]\n  - @smithy/util-endpoints@3.4.1\n  - @smithy/types@4.14.1\n  - @smithy/node-config-provider@4.3.14\n  - @smithy/util-middleware@4.2.14\n\n## 4.4.15\n\n### Patch Changes\n\n- Updated dependencies [8196133]\n- Updated dependencies [2490c8c]\n  - @smithy/util-endpoints@3.4.0\n\n## 4.4.14\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/node-config-provider@4.3.13\n  - @smithy/util-endpoints@3.3.4\n  - @smithy/util-middleware@4.2.13\n\n## 4.4.13\n\n### Patch Changes\n\n- b1f0dba: fix(middleware-endpoint): update type of useDualStackEndpoint/useFipsEndpoint input config\n  fix(config-resolver): add alternate values for NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS and NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS\n\n## 4.4.12\n\n### Patch Changes\n\n- 4b5602d: fix: update default value to undefined for dualstack/fips config\n\n## 4.4.11\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/node-config-provider@4.3.12\n  - @smithy/util-endpoints@3.3.3\n  - @smithy/util-middleware@4.2.12\n\n## 4.4.10\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/node-config-provider@4.3.11\n  - @smithy/util-config-provider@4.2.2\n  - @smithy/util-middleware@4.2.11\n  - @smithy/util-endpoints@3.3.2\n\n## 4.4.9\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/node-config-provider@4.3.10\n  - @smithy/util-endpoints@3.3.1\n  - @smithy/util-middleware@4.2.10\n\n## 4.4.8\n\n### Patch Changes\n\n- Updated dependencies [2bf677c]\n  - @smithy/util-endpoints@3.3.0\n\n## 4.4.7\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-config-provider@4.2.1\n  - @smithy/util-endpoints@3.2.9\n  - @smithy/util-middleware@4.2.9\n\n## 4.4.6\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/node-config-provider@4.3.8\n  - @smithy/util-endpoints@3.2.8\n  - @smithy/util-middleware@4.2.8\n\n## 4.4.5\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/node-config-provider@4.3.7\n  - @smithy/util-endpoints@3.2.7\n  - @smithy/util-middleware@4.2.7\n\n## 4.4.4\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/node-config-provider@4.3.6\n  - @smithy/util-endpoints@3.2.6\n  - @smithy/util-middleware@4.2.6\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/node-config-provider@4.3.5\n  - @smithy/util-endpoints@3.2.5\n  - @smithy/util-middleware@4.2.5\n\n## 4.4.2\n\n### Patch Changes\n\n- 372b46f: allow \\* region with warning\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/node-config-provider@4.3.4\n  - @smithy/util-endpoints@3.2.4\n  - @smithy/util-middleware@4.2.4\n\n## 4.4.0\n\n### Minor Changes\n\n- 13c5cd9: validate region is hostname component\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/node-config-provider@4.3.3\n  - @smithy/util-middleware@4.2.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/node-config-provider@4.3.2\n  - @smithy/util-middleware@4.2.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/node-config-provider@4.3.1\n  - @smithy/util-middleware@4.2.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-config-provider@4.2.0\n  - @smithy/util-middleware@4.2.0\n\n## 4.2.2\n\n### Patch Changes\n\n- @smithy/node-config-provider@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/node-config-provider@4.2.1\n  - @smithy/util-middleware@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/util-config-provider@4.1.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.1.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/node-config-provider@4.1.4\n  - @smithy/util-middleware@4.0.5\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/node-config-provider@4.1.3\n  - @smithy/util-middleware@4.0.4\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/node-config-provider@4.1.2\n  - @smithy/util-middleware@4.0.3\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n\n## 4.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/node-config-provider@4.0.2\n  - @smithy/util-middleware@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/node-config-provider@4.0.1\n  - @smithy/util-middleware@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/util-config-provider@4.0.0\n  - @smithy/util-middleware@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.13\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/node-config-provider@3.1.12\n  - @smithy/util-middleware@3.0.11\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/node-config-provider@3.1.11\n  - @smithy/util-middleware@3.0.10\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/node-config-provider@3.1.10\n  - @smithy/util-middleware@3.0.9\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/node-config-provider@3.1.9\n  - @smithy/util-middleware@3.0.8\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/node-config-provider@3.1.8\n  - @smithy/util-middleware@3.0.7\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/node-config-provider@3.1.7\n  - @smithy/util-middleware@3.0.6\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/node-config-provider@3.1.6\n  - @smithy/util-middleware@3.0.5\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/node-config-provider@3.1.5\n  - @smithy/util-middleware@3.0.4\n\n## 3.0.5\n\n### Patch Changes\n\n- @smithy/node-config-provider@3.1.4\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/node-config-provider@3.1.3\n  - @smithy/util-middleware@3.0.3\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/node-config-provider@3.1.2\n  - @smithy/util-middleware@3.0.2\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/node-config-provider@3.1.1\n  - @smithy/util-middleware@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n  - @smithy/node-config-provider@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/node-config-provider@3.0.0\n  - @smithy/util-config-provider@3.0.0\n  - @smithy/util-middleware@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/util-config-provider@2.3.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/node-config-provider@2.2.5\n  - @smithy/util-middleware@2.1.4\n\n## 2.1.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.2.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/node-config-provider@2.2.3\n  - @smithy/util-middleware@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/node-config-provider@2.2.2\n  - @smithy/util-middleware@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/types@2.9.1\n  - @smithy/util-config-provider@2.2.1\n  - @smithy/util-middleware@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/util-config-provider@2.2.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.23\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/node-config-provider@2.1.9\n  - @smithy/util-middleware@2.0.9\n\n## 2.0.22\n\n### Patch Changes\n\n- Updated dependencies [dd2b9c70]\n  - @smithy/util-config-provider@2.1.0\n\n## 2.0.21\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.8\n\n## 2.0.20\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/node-config-provider@2.1.7\n  - @smithy/util-middleware@2.0.8\n\n## 2.0.19\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/node-config-provider@2.1.6\n  - @smithy/util-middleware@2.0.7\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/node-config-provider@2.1.5\n  - @smithy/util-middleware@2.0.6\n\n## 2.0.17\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.4\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/node-config-provider@2.1.3\n  - @smithy/util-middleware@2.0.5\n\n## 2.0.15\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.2\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/node-config-provider@2.1.1\n  - @smithy/util-middleware@2.0.4\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [7b568c39]\n  - @smithy/node-config-provider@2.1.0\n\n## 2.0.12\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.14\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/node-config-provider@2.0.13\n  - @smithy/util-middleware@2.0.3\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/node-config-provider@2.0.12\n  - @smithy/util-middleware@2.0.2\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [e6ea6bd5]\n- Updated dependencies [c0b17a13]\n- Updated dependencies [5b6fa539]\n  - @smithy/types@2.3.2\n  - @smithy/util-middleware@2.0.1\n  - @smithy/node-config-provider@2.0.11\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/node-config-provider@2.0.10\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.7\n\n### Patch Changes\n\n- d3daa891: Move @smithy/node-config-provider to deps\n  - @smithy/node-config-provider@2.0.9\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.2\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-config-provider@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n  - @smithy/util-config-provider@1.1.0\n  - @smithy/util-middleware@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/util-middleware@1.0.2\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-config-provider@1.0.2\n  - @smithy/util-middleware@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-config-provider@1.0.1\n  - @smithy/util-middleware@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/config-resolver](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/config-resolver/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { booleanSelector } from \"../../util-config-provider/booleanSelector\";\nimport { SelectorType } from \"../../util-config-provider/types\";\nimport {\n  CONFIG_USE_DUALSTACK_ENDPOINT,\n  DEFAULT_USE_DUALSTACK_ENDPOINT,\n  ENV_USE_DUALSTACK_ENDPOINT,\n  NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,\n  nodeDualstackConfigSelectors,\n} from \"./NodeUseDualstackEndpointConfigOptions\";\n\nvi.mock(\"../../util-config-provider/booleanSelector\");\n\ndescribe(\"NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS\", () => {\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {\n    it.each([true, false, undefined])(\"returns %s\", (output) => {\n      vi.mocked(booleanSelector).mockReturnValueOnce(output);\n      expect(func(obj)).toEqual(output);\n      expect(booleanSelector).toBeCalledWith(obj, key, type);\n    });\n\n    it(\"throws error\", () => {\n      const mockError = new Error(\"error\");\n      vi.mocked(booleanSelector).mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => {\n        func(obj);\n      }).toThrow(mockError);\n    });\n  };\n\n  describe(\"calls booleanSelector for environmentVariableSelector\", () => {\n    const env: { [ENV_USE_DUALSTACK_ENDPOINT]: any } = {} as any;\n    const { environmentVariableSelector } = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS;\n    test(environmentVariableSelector, env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV);\n  });\n\n  describe(\"calls booleanSelector for configFileSelector\", () => {\n    const profileContent: { [CONFIG_USE_DUALSTACK_ENDPOINT]: any } = {} as any;\n    const { configFileSelector } = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS;\n    test(configFileSelector, profileContent, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG);\n  });\n\n  it(\"returns undefined for default\", () => {\n    const { default: defaultValue } = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS;\n    expect(defaultValue).toEqual(DEFAULT_USE_DUALSTACK_ENDPOINT);\n  });\n\n  it(\"returns undefined for default when using nodeFipsConfigSelectors\", () => {\n    const { default: defaultValue } = nodeDualstackConfigSelectors;\n    expect(defaultValue).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.ts",
    "content": "import type { LoadedConfigSelectors } from \"../../node-config-provider/configLoader\";\nimport { booleanSelector } from \"../../util-config-provider/booleanSelector\";\nimport { SelectorType } from \"../../util-config-provider/types\";\n\n/**\n * @internal\n */\nexport const ENV_USE_DUALSTACK_ENDPOINT = \"AWS_USE_DUALSTACK_ENDPOINT\";\n/**\n * @internal\n */\nexport const CONFIG_USE_DUALSTACK_ENDPOINT = \"use_dualstack_endpoint\";\n/**\n * @internal\n */\nexport const DEFAULT_USE_DUALSTACK_ENDPOINT = false;\n\n/**\n * Don't delete this, used by older clients.\n * @deprecated replaced by nodeDualstackConfigSelectors in newer clients.\n * @internal\n */\nexport const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<boolean> = {\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) =>\n    booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),\n  configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG),\n  default: false,\n};\n\n/**\n * @internal\n */\nexport const nodeDualstackConfigSelectors: LoadedConfigSelectors<boolean | undefined> = {\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) =>\n    booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),\n  configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG),\n  default: undefined,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { booleanSelector } from \"../../util-config-provider/booleanSelector\";\nimport { SelectorType } from \"../../util-config-provider/types\";\nimport {\n  CONFIG_USE_FIPS_ENDPOINT,\n  DEFAULT_USE_FIPS_ENDPOINT,\n  ENV_USE_FIPS_ENDPOINT,\n  NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,\n  nodeFipsConfigSelectors,\n} from \"./NodeUseFipsEndpointConfigOptions\";\n\nvi.mock(\"../../util-config-provider/booleanSelector\");\n\ndescribe(\"NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS\", () => {\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {\n    it.each([true, false, undefined])(\"returns %s\", (output) => {\n      vi.mocked(booleanSelector).mockReturnValueOnce(output);\n      expect(func(obj)).toEqual(output);\n      expect(booleanSelector).toBeCalledWith(obj, key, type);\n    });\n\n    it(\"throws error\", () => {\n      const mockError = new Error(\"error\");\n      vi.mocked(booleanSelector).mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => {\n        func(obj);\n      }).toThrow(mockError);\n    });\n  };\n\n  describe(\"calls booleanSelector for environmentVariableSelector\", () => {\n    const env: { [ENV_USE_FIPS_ENDPOINT]: any } = {} as any;\n    const { environmentVariableSelector } = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS;\n    test(environmentVariableSelector, env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV);\n  });\n\n  describe(\"calls booleanSelector for configFileSelector\", () => {\n    const profileContent: { [CONFIG_USE_FIPS_ENDPOINT]: any } = {} as any;\n    const { configFileSelector } = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS;\n    test(configFileSelector, profileContent, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG);\n  });\n\n  it(\"returns false for default\", () => {\n    const { default: defaultValue } = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS;\n    expect(defaultValue).toBe(false);\n  });\n\n  it(\"returns undefined for default when using nodeFipsConfigSelectors\", () => {\n    const { default: defaultValue } = nodeFipsConfigSelectors;\n    expect(defaultValue).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.ts",
    "content": "import type { LoadedConfigSelectors } from \"../../node-config-provider/configLoader\";\nimport { booleanSelector } from \"../../util-config-provider/booleanSelector\";\nimport { SelectorType } from \"../../util-config-provider/types\";\n\n/**\n * @internal\n */\nexport const ENV_USE_FIPS_ENDPOINT = \"AWS_USE_FIPS_ENDPOINT\";\n/**\n * @internal\n */\nexport const CONFIG_USE_FIPS_ENDPOINT = \"use_fips_endpoint\";\n/**\n * @internal\n */\nexport const DEFAULT_USE_FIPS_ENDPOINT = false;\n\n/**\n * Don't delete this, used by older clients.\n * @deprecated replaced by nodeFipsConfigSelectors in newer clients.\n * @internal\n */\nexport const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<boolean> = {\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) =>\n    booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),\n  configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG),\n  default: false,\n};\n\n/**\n * @internal\n */\nexport const nodeFipsConfigSelectors: LoadedConfigSelectors<boolean | undefined> = {\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) =>\n    booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),\n  configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG),\n  default: undefined,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/resolveCustomEndpointsConfig.spec.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { resolveCustomEndpointsConfig } from \"./resolveCustomEndpointsConfig\";\n\nvi.mock(\"@smithy/core/client\");\n\ndescribe(resolveCustomEndpointsConfig.name, () => {\n  const mockEndpoint = {\n    protocol: \"http:\",\n    hostname: \"localhost\",\n    path: \"/\",\n  };\n\n  const mockInput = {\n    endpoint: mockEndpoint,\n    urlParser: vi.fn(() => mockEndpoint),\n    useDualstackEndpoint: () => Promise.resolve(false),\n  } as any;\n\n  beforeEach(() => {\n    vi.mocked(normalizeProvider).mockImplementation((input) =>\n      typeof input === \"function\" ? (input as any) : () => Promise.resolve(input)\n    );\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"maintains object custody\", () => {\n    const input = { ...mockInput };\n    expect(resolveCustomEndpointsConfig(input)).toBe(input);\n  });\n\n  describe(\"tls\", () => {\n    afterEach(() => {\n      expect(normalizeProvider).toHaveBeenCalledTimes(2);\n      expect(normalizeProvider).toHaveBeenNthCalledWith(2, mockInput.useDualstackEndpoint);\n    });\n\n    it.each([true, false])(\"returns %s when the value is passed\", (tls) => {\n      expect(resolveCustomEndpointsConfig({ ...mockInput, tls }).tls).toStrictEqual(tls);\n    });\n\n    it(\"returns true if input.tls is undefined\", () => {\n      expect(resolveCustomEndpointsConfig({ ...mockInput }).tls).toStrictEqual(true);\n    });\n  });\n\n  it(\"returns true for isCustomEndpoint\", () => {\n    expect(resolveCustomEndpointsConfig({ ...mockInput }).isCustomEndpoint).toStrictEqual(true);\n  });\n\n  it(\"returns false when useDualstackEndpoint is not defined\", async () => {\n    const useDualstackEndpoint = await resolveCustomEndpointsConfig({\n      ...mockInput,\n      useDualstackEndpoint: undefined,\n    }).useDualstackEndpoint();\n    expect(useDualstackEndpoint).toStrictEqual(false);\n  });\n\n  describe(\"returns normalized endpoint\", () => {\n    it(\"calls urlParser endpoint is of type string\", async () => {\n      const mockEndpointString = \"http://localhost/\";\n      const endpoint = await resolveCustomEndpointsConfig({ ...mockInput, endpoint: mockEndpointString }).endpoint();\n      expect(endpoint).toStrictEqual(mockEndpoint);\n      expect(mockInput.urlParser).toHaveBeenCalledWith(mockEndpointString);\n\n      expect(normalizeProvider).toHaveBeenCalledTimes(2);\n      expect(normalizeProvider).toHaveBeenNthCalledWith(1, mockInput.endpoint);\n      expect(normalizeProvider).toHaveBeenNthCalledWith(2, mockInput.useDualstackEndpoint);\n    });\n\n    it(\"passes endpoint to normalize if not string\", async () => {\n      const endpoint = await resolveCustomEndpointsConfig({ ...mockInput }).endpoint();\n      expect(endpoint).toStrictEqual(mockEndpoint);\n      expect(mockInput.urlParser).not.toHaveBeenCalled();\n\n      expect(normalizeProvider).toHaveBeenCalledTimes(2);\n      expect(normalizeProvider).toHaveBeenNthCalledWith(1, mockInput.endpoint);\n      expect(normalizeProvider).toHaveBeenNthCalledWith(2, mockInput.useDualstackEndpoint);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/resolveCustomEndpointsConfig.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport type { Endpoint, Provider, UrlParser } from \"@smithy/types\";\n\nimport type { EndpointsInputConfig, EndpointsResolvedConfig } from \"./resolveEndpointsConfig\";\n\n/**\n * @public\n * @deprecated superseded by default endpointRuleSet generation.\n */\nexport interface CustomEndpointsInputConfig extends EndpointsInputConfig {\n  /**\n   * The fully qualified endpoint of the webservice.\n   */\n  endpoint: string | Endpoint | Provider<Endpoint>;\n}\n\n/**\n * @internal\n * @deprecated superseded by default endpointRuleSet generation.\n */\ninterface PreviouslyResolved {\n  urlParser: UrlParser;\n}\n\n/**\n * @internal\n * @deprecated superseded by default endpointRuleSet generation.\n */\nexport interface CustomEndpointsResolvedConfig extends EndpointsResolvedConfig {\n  /**\n   * Whether the endpoint is specified by caller.\n   * @internal\n   */\n  isCustomEndpoint: true;\n}\n\n/**\n * @internal\n *\n * @deprecated superseded by default endpointRuleSet generation.\n */\nexport const resolveCustomEndpointsConfig = <T>(\n  input: T & CustomEndpointsInputConfig & PreviouslyResolved\n): T & CustomEndpointsResolvedConfig => {\n  const { tls, endpoint, urlParser, useDualstackEndpoint } = input;\n  return Object.assign(input, {\n    tls: tls ?? true,\n    endpoint: normalizeProvider(typeof endpoint === \"string\" ? urlParser(endpoint) : endpoint),\n    isCustomEndpoint: true,\n    useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),\n  } as CustomEndpointsResolvedConfig);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/resolveEndpointsConfig.spec.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { normalizeProvider } from \"@smithy/core/client\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { resolveEndpointsConfig } from \"./resolveEndpointsConfig\";\nimport { getEndpointFromRegion } from \"./utils/getEndpointFromRegion\";\n\nvi.mock(\"@smithy/core/client\");\nvi.mock(\"./utils/getEndpointFromRegion\");\n\ndescribe(resolveEndpointsConfig.name, () => {\n  const mockEndpoint = {\n    protocol: \"http:\",\n    hostname: \"localhost\",\n    path: \"/\",\n  };\n\n  const mockInput = {\n    endpoint: mockEndpoint,\n    urlParser: vi.fn(() => mockEndpoint),\n    useDualstackEndpoint: () => Promise.resolve(false),\n    useFipsEndpoint: () => Promise.resolve(false),\n  } as any;\n\n  beforeEach(() => {\n    vi.mocked(getEndpointFromRegion).mockResolvedValueOnce(mockEndpoint);\n    vi.mocked(normalizeProvider).mockImplementation((input) =>\n      typeof input === \"function\" ? (input as any) : () => Promise.resolve(input)\n    );\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"maintains object custody\", () => {\n    const input = { ...mockInput };\n    expect(resolveEndpointsConfig(input)).toBe(input);\n  });\n\n  describe(\"tls\", () => {\n    afterEach(() => {\n      expect(normalizeProvider).toHaveBeenNthCalledWith(1, mockInput.useDualstackEndpoint);\n    });\n\n    it.each([true, false])(\"returns %s when it's %s\", (tls) => {\n      expect(resolveEndpointsConfig({ ...mockInput, tls }).tls).toStrictEqual(tls);\n    });\n\n    it(\"returns true is input.tls is undefined\", () => {\n      expect(resolveEndpointsConfig({ ...mockInput }).tls).toStrictEqual(true);\n    });\n  });\n\n  describe(\"isCustomEndpoint\", () => {\n    afterEach(() => {\n      expect(normalizeProvider).toHaveBeenNthCalledWith(1, mockInput.useDualstackEndpoint);\n    });\n\n    it(\"returns true when endpoint is defined\", () => {\n      expect(resolveEndpointsConfig({ ...mockInput }).isCustomEndpoint).toStrictEqual(true);\n    });\n\n    it(\"returns false when endpoint is not defined\", () => {\n      const { endpoint, ...mockInputWithoutEndpoint } = mockInput;\n      expect(resolveEndpointsConfig(mockInputWithoutEndpoint).isCustomEndpoint).toStrictEqual(false);\n    });\n  });\n\n  it(\"returns false when useDualstackEndpoint is not defined\", async () => {\n    const useDualstackEndpoint = await resolveEndpointsConfig({\n      ...mockInput,\n      useDualstackEndpoint: undefined,\n    }).useDualstackEndpoint();\n    expect(useDualstackEndpoint).toStrictEqual(false);\n  });\n\n  describe(\"endpoint\", () => {\n    afterEach(() => {\n      expect(normalizeProvider).toHaveBeenNthCalledWith(1, mockInput.useDualstackEndpoint);\n    });\n\n    describe(\"returns from normalizeProvider when endpoint is defined\", () => {\n      afterEach(() => {\n        expect(normalizeProvider).toHaveBeenCalledTimes(2);\n        expect(normalizeProvider).toHaveBeenNthCalledWith(2, mockInput.endpoint);\n        expect(getEndpointFromRegion).not.toHaveBeenCalled();\n      });\n\n      it(\"calls urlParser endpoint is of type string\", async () => {\n        const mockEndpointString = \"http://localhost/\";\n        const endpoint = await resolveEndpointsConfig({ ...mockInput, endpoint: mockEndpointString }).endpoint();\n        expect(endpoint).toStrictEqual(mockEndpoint);\n        expect(mockInput.urlParser).toHaveBeenCalledWith(mockEndpointString);\n      });\n\n      it(\"passes endpoint to normalize if not string\", async () => {\n        const endpoint = await resolveEndpointsConfig({ ...mockInput }).endpoint();\n        expect(endpoint).toStrictEqual(mockEndpoint);\n        expect(mockInput.urlParser).not.toHaveBeenCalled();\n      });\n    });\n\n    it(\"returns from getEndpointFromRegion when endpoint is not defined\", async () => {\n      const { endpoint, ...mockInputWithoutEndpoint } = mockInput;\n      const returnedEndpoint = await resolveEndpointsConfig(mockInputWithoutEndpoint).endpoint();\n      expect(returnedEndpoint).toStrictEqual(mockEndpoint);\n      expect(normalizeProvider).toHaveBeenCalledTimes(1);\n      expect(getEndpointFromRegion).toHaveBeenCalledTimes(1);\n      expect(getEndpointFromRegion).toHaveBeenCalledWith(mockInputWithoutEndpoint);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/resolveEndpointsConfig.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport type { Endpoint, Provider, RegionInfoProvider, UrlParser } from \"@smithy/types\";\n\nimport { getEndpointFromRegion } from \"./utils/getEndpointFromRegion\";\n\n/**\n * @public\n * @deprecated see \\@smithy/middleware-endpoint resolveEndpointConfig.\n */\nexport interface EndpointsInputConfig {\n  /**\n   * The fully qualified endpoint of the webservice. This is only required when using\n   * a custom endpoint (for example, when using a local version of S3).\n   */\n  endpoint?: string | Endpoint | Provider<Endpoint>;\n\n  /**\n   * Whether TLS is enabled for requests.\n   */\n  tls?: boolean;\n\n  /**\n   * Enables IPv6/IPv4 dualstack endpoint.\n   */\n  useDualstackEndpoint?: boolean | Provider<boolean>;\n}\n\n/**\n * @internal\n * @deprecated see \\@smithy/middleware-endpoint resolveEndpointConfig.\n */\ninterface PreviouslyResolved {\n  regionInfoProvider: RegionInfoProvider;\n  urlParser: UrlParser;\n  region: Provider<string>;\n  useFipsEndpoint: Provider<boolean>;\n}\n\n/**\n * @internal\n * @deprecated see \\@smithy/middleware-endpoint resolveEndpointConfig.\n */\nexport interface EndpointsResolvedConfig extends Required<EndpointsInputConfig> {\n  /**\n   * Resolved value for input {@link EndpointsInputConfig.endpoint}\n   */\n  endpoint: Provider<Endpoint>;\n\n  /**\n   * Whether the endpoint is specified by caller.\n   * @internal\n   */\n  isCustomEndpoint?: boolean;\n\n  /**\n   * Resolved value for input {@link EndpointsInputConfig.useDualstackEndpoint}\n   */\n  useDualstackEndpoint: Provider<boolean>;\n}\n\n/**\n * All generated clients should migrate to Endpoints 2.0 endpointRuleSet traits.\n *\n * @internal\n * @deprecated endpoints rulesets use \\@smithy/middleware-endpoint resolveEndpointConfig.\n */\nexport const resolveEndpointsConfig = <T>(\n  input: T & EndpointsInputConfig & PreviouslyResolved\n): T & EndpointsResolvedConfig => {\n  const useDualstackEndpoint = normalizeProvider(input.useDualstackEndpoint ?? false);\n  const { endpoint, useFipsEndpoint, urlParser, tls } = input;\n  return Object.assign(input, {\n    tls: tls ?? true,\n    endpoint: endpoint\n      ? normalizeProvider(typeof endpoint === \"string\" ? urlParser(endpoint) : endpoint)\n      : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }),\n    isCustomEndpoint: !!endpoint,\n    useDualstackEndpoint,\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/utils/getEndpointFromRegion.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getEndpointFromRegion } from \"./getEndpointFromRegion\";\n\ndescribe(getEndpointFromRegion.name, () => {\n  const mockRegion = vi.fn();\n  const mockUrlParser = vi.fn();\n  const mockRegionInfoProvider = vi.fn();\n  const mockUseFipsEndpoint = vi.fn();\n  const mockUseDualstackEndpoint = vi.fn();\n\n  const mockInput = {\n    region: mockRegion,\n    urlParser: mockUrlParser,\n    regionInfoProvider: mockRegionInfoProvider,\n    useDualstackEndpoint: mockUseDualstackEndpoint,\n    useFipsEndpoint: mockUseFipsEndpoint,\n  };\n\n  const mockRegionValue = \"mockRegion\";\n  const mockEndpoint = {\n    protocol: \"http:\",\n    hostname: \"localhost\",\n    path: \"/\",\n  };\n  const mockRegionInfo = { hostname: \"mockHostname\" };\n\n  beforeEach(() => {\n    mockRegion.mockResolvedValue(mockRegionValue);\n    mockUrlParser.mockResolvedValue(mockEndpoint);\n    mockRegionInfoProvider.mockResolvedValue(mockRegionInfo);\n    mockUseFipsEndpoint.mockResolvedValue(false);\n    mockUseDualstackEndpoint.mockResolvedValue(false);\n  });\n\n  afterEach(() => {\n    expect(mockRegion).toHaveBeenCalledTimes(1);\n    vi.clearAllMocks();\n  });\n\n  describe(\"tls\", () => {\n    afterEach(() => {\n      expect(mockRegionInfoProvider).toHaveBeenCalledWith(mockRegionValue, {\n        useDualstackEndpoint: false,\n        useFipsEndpoint: false,\n      });\n    });\n\n    it(\"uses protocol https when not defined\", async () => {\n      await getEndpointFromRegion(mockInput);\n      expect(mockUrlParser).toHaveBeenCalledTimes(1);\n      expect(mockUrlParser).toHaveBeenCalledWith(`https://${mockRegionInfo.hostname}`);\n    });\n\n    it.each([\n      [\"http:\", false],\n      [\"https:\", true],\n    ])(\"uses protocol %s when set to %s\", async (protocol, tls) => {\n      await getEndpointFromRegion({ ...mockInput, tls });\n      expect(mockUrlParser).toHaveBeenCalledTimes(1);\n      expect(mockUrlParser).toHaveBeenCalledWith(`${protocol}//${mockRegionInfo.hostname}`);\n    });\n  });\n\n  describe(\"throws if region is invalid\", () => {\n    const errorMsg = \"Invalid region in client config\";\n    it.each([\n      \"\",\n      \"has_underscore\",\n      \"-starts-with-dash\",\n      \"ends-with-dash-\",\n      \"-starts-and-ends-with-dash-\",\n      \"-\",\n      \"a-\",\n      \"c0nt@in$-$ymb01$\",\n      \"a\".repeat(64),\n    ])(\"region: %s\", async (region) => {\n      mockRegion.mockResolvedValue(region);\n      try {\n        await getEndpointFromRegion(mockInput);\n        fail(`expected Error: ${errorMsg}`);\n      } catch (error) {\n        expect(error.message).toEqual(errorMsg);\n      }\n      expect(mockRegionInfoProvider).not.toHaveBeenCalled();\n      expect(mockUrlParser).not.toHaveBeenCalled();\n    });\n  });\n\n  it(\"throws if hostname is not returned by regionInfoProvider\", async () => {\n    mockRegionInfoProvider.mockResolvedValue({});\n    const errorMsg = \"Cannot resolve hostname from client config\";\n    try {\n      await getEndpointFromRegion(mockInput);\n      fail(`expected Error: ${errorMsg}`);\n    } catch (error) {\n      expect(error.message).toEqual(errorMsg);\n    }\n    expect(mockRegionInfoProvider).toHaveBeenCalledWith(mockRegionValue, {\n      useDualstackEndpoint: false,\n      useFipsEndpoint: false,\n    });\n    expect(mockUrlParser).not.toHaveBeenCalled();\n  });\n\n  it(\"returns parsed endpoint\", async () => {\n    const endpoint = await getEndpointFromRegion(mockInput);\n    expect(endpoint).toEqual(mockEndpoint);\n    expect(mockRegionInfoProvider).toHaveBeenCalledWith(mockRegionValue, {\n      useDualstackEndpoint: false,\n      useFipsEndpoint: false,\n    });\n    expect(mockUrlParser).toHaveBeenCalledWith(`https://${mockRegionInfo.hostname}`);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/endpointsConfig/utils/getEndpointFromRegion.ts",
    "content": "import type { Provider, RegionInfoProvider, UrlParser } from \"@smithy/types\";\n\ninterface GetEndpointFromRegionOptions {\n  region: Provider<string>;\n  tls?: boolean;\n  regionInfoProvider: RegionInfoProvider;\n  urlParser: UrlParser;\n  useDualstackEndpoint: Provider<boolean>;\n  useFipsEndpoint: Provider<boolean>;\n}\n\nexport const getEndpointFromRegion = async (input: GetEndpointFromRegionOptions) => {\n  const { tls = true } = input;\n  const region = await input.region();\n\n  const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n  if (!dnsHostRegex.test(region)) {\n    throw new Error(\"Invalid region in client config\");\n  }\n\n  const useDualstackEndpoint = await input.useDualstackEndpoint();\n  const useFipsEndpoint = await input.useFipsEndpoint();\n  const { hostname } = (await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint })) ?? {};\n  if (!hostname) {\n    throw new Error(\"Cannot resolve hostname from client config\");\n  }\n\n  return input.urlParser(`${tls ? \"https:\" : \"http:\"}//${hostname}`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/checkRegion.spec.ts",
    "content": "import { isValidHostLabel } from \"@smithy/util-endpoints\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { checkRegion } from \"./checkRegion\";\n\ndescribe(\"checkRegion\", () => {\n  const acceptedRegionExamples = [\n    \"us-east-1\",\n    \"ap-east-1\",\n    \"ap-southeast-4\",\n    \"ap-northeast-3\",\n    \"ap-northeast-1\",\n    \"eu-west-2\",\n    \"il-central-1\",\n    \"mx-central-1\",\n    \"eu-isoe-santaclaus-125\",\n    \"us-iso-reindeer-3000\",\n    \"eusc-de-gingerbread-8000\",\n    \"abcd\",\n    \"12345\",\n  ];\n\n  it(\"does not throw when the region is a valid host label\", () => {\n    for (const region of acceptedRegionExamples) {\n      expect(() => checkRegion(region)).not.toThrow();\n    }\n  });\n\n  it(\"throws when the region is not a valid host label\", () => {\n    for (const region of [\n      \"us-east-1-\",\n      \"a\".repeat(64),\n      \"-us-east-1\",\n      \"\",\n      \"!\",\n      \"@\",\n      \"#\",\n      \"$\",\n      \"%\",\n      \"^\",\n      \"&\",\n      \"**\",\n      \"(\",\n      \")\",\n      \".\",\n      \"[\",\n      \"]\",\n      \";\",\n      `'`,\n      \"?\",\n      \"/\",\n      \"\\\\\",\n      \"|\",\n      \"+-*/\",\n    ]) {\n      expect(() => checkRegion(region)).toThrow(\n        `Region not accepted: region=\"${region}\" is not a valid hostname component.`\n      );\n    }\n  });\n\n  it(\"emits a warning when asterisk region is used\", () => {\n    vi.spyOn(console, \"warn\");\n    checkRegion(\"*\");\n    expect(console.warn).toHaveBeenCalledWith(expect.stringContaining(\"@smithy/config-resolver WARN\"));\n  });\n\n  it(\"caches accepted regions\", () => {\n    vi.spyOn(console, \"warn\");\n    const di = {\n      isValidHostLabel,\n    };\n    for (const region of acceptedRegionExamples) {\n      expect(() => checkRegion(region, di.isValidHostLabel)).not.toThrow();\n    }\n    vi.spyOn(di, \"isValidHostLabel\").mockImplementation(isValidHostLabel);\n    for (const region of acceptedRegionExamples) {\n      expect(() => checkRegion(region, di.isValidHostLabel)).not.toThrow();\n    }\n    expect(di.isValidHostLabel).toHaveBeenCalledTimes(0);\n    expect(() => checkRegion(\"oh-canada\", di.isValidHostLabel)).not.toThrow();\n    expect(di.isValidHostLabel).toHaveBeenCalledTimes(1);\n    expect(console.warn).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/checkRegion.ts",
    "content": "import { isValidHostLabel } from \"@smithy/core/endpoints\";\n\n/**\n * @internal\n */\nconst validRegions = new Set<string>();\n\n/**\n * Checks whether region can be a host component.\n *\n * @param region - to check.\n * @param check - checking function.\n *\n * @internal\n */\nexport const checkRegion = (region: string, check = isValidHostLabel) => {\n  if (!validRegions.has(region) && !check(region)) {\n    if (region === \"*\") {\n      console.warn(\n        `@smithy/config-resolver WARN - Please use the caller region instead of \"*\". See \"sigv4a\" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`\n      );\n    } else {\n      throw new Error(`Region not accepted: region=\"${region}\" is not a valid hostname component.`);\n    }\n  } else {\n    validRegions.add(region);\n  }\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/config.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport {\n  NODE_REGION_CONFIG_FILE_OPTIONS,\n  NODE_REGION_CONFIG_OPTIONS,\n  REGION_ENV_NAME,\n  REGION_INI_NAME,\n} from \"./config\";\n\ndescribe(\"config\", () => {\n  describe(\"NODE_REGION_CONFIG_OPTIONS\", () => {\n    describe(\"environmentVariableSelector\", () => {\n      const { environmentVariableSelector } = NODE_REGION_CONFIG_OPTIONS;\n      it.each([undefined, \"mockRegion\"])(`when env[${REGION_ENV_NAME}]: %s`, (mockEndpoint) => {\n        expect(environmentVariableSelector({ [REGION_ENV_NAME]: mockEndpoint })).toBe(mockEndpoint);\n      });\n    });\n\n    describe(\"configFileSelector\", () => {\n      const { configFileSelector } = NODE_REGION_CONFIG_OPTIONS;\n      it.each([undefined, \"mockRegion\"])(`when env[${REGION_INI_NAME}]: %s`, (mockEndpoint) => {\n        expect(configFileSelector({ [REGION_INI_NAME]: mockEndpoint })).toBe(mockEndpoint);\n      });\n    });\n\n    it(\"default throws error\", () => {\n      const { default: defaultKey } = NODE_REGION_CONFIG_OPTIONS;\n      expect(() => {\n        (defaultKey as any)();\n      }).toThrowError(new Error(\"Region is missing\"));\n    });\n  });\n\n  describe(\"NODE_REGION_CONFIG_FILE_OPTIONS\", () => {\n    it(\"preferredFile contains credentials\", () => {\n      const { preferredFile } = NODE_REGION_CONFIG_FILE_OPTIONS;\n      expect(preferredFile).toBe(\"credentials\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/config.ts",
    "content": "import type { LoadedConfigSelectors, LocalConfigOptions } from \"../../node-config-provider/configLoader\";\n\n/**\n * @internal\n */\nexport const REGION_ENV_NAME = \"AWS_REGION\";\n/**\n * @internal\n */\nexport const REGION_INI_NAME = \"region\";\n\n/**\n * @internal\n */\nexport const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors<string> = {\n  environmentVariableSelector: (env) => env[REGION_ENV_NAME],\n  configFileSelector: (profile) => profile[REGION_INI_NAME],\n  default: () => {\n    throw new Error(\"Region is missing\");\n  },\n};\n\n/**\n * @internal\n */\nexport const NODE_REGION_CONFIG_FILE_OPTIONS: LocalConfigOptions = {\n  preferredFile: \"credentials\",\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/getRealRegion.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getRealRegion } from \"./getRealRegion\";\nimport { isFipsRegion } from \"./isFipsRegion\";\n\nvi.mock(\"./isFipsRegion\");\n\ndescribe(getRealRegion.name, () => {\n  beforeEach(() => {\n    vi.mocked(isFipsRegion).mockReturnValue(true);\n  });\n\n  afterEach(() => {\n    expect(isFipsRegion).toHaveBeenCalledTimes(1);\n    vi.clearAllMocks();\n  });\n\n  it(\"returns provided region if it's not FIPS\", () => {\n    const mockRegion = \"mockRegion\";\n    vi.mocked(isFipsRegion).mockReturnValue(false);\n    expect(getRealRegion(mockRegion)).toStrictEqual(mockRegion);\n  });\n\n  describe(\"FIPS regions\", () => {\n    it.each([\"fips-aws-global\", \"aws-fips\"])(`returns \"us-east-1\" for \"%s\"`, (input) => {\n      expect(getRealRegion(input)).toStrictEqual(\"us-east-1\");\n    });\n\n    it.each([\n      [\"us-west-1\", \"us-west-1-fips\"],\n      [\"us-west-1\", \"fips-us-west-1\"],\n      [\"us-west-1\", \"fips-dkr-us-west-1\"],\n      [\"us-west-1\", \"fips-prod-us-west-1\"],\n    ])(`returns \"%s\" for \"%s\"`, (output, input) => {\n      expect(getRealRegion(input)).toStrictEqual(output);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/getRealRegion.ts",
    "content": "import { isFipsRegion } from \"./isFipsRegion\";\n\n/**\n * @internal\n */\nexport const getRealRegion = (region: string) =>\n  isFipsRegion(region)\n    ? [\"fips-aws-global\", \"aws-fips\"].includes(region)\n      ? \"us-east-1\"\n      : region.replace(/fips-(dkr-|prod-)?|-fips/, \"\")\n    : region;\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/isFipsRegion.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isFipsRegion } from \"./isFipsRegion\";\n\ndescribe(isFipsRegion.name, () => {\n  it.each([\n    [true, \"fips-us-east-1\"],\n    [true, \"us-east-1-fips\"],\n    [false, \"us-east-1\"],\n  ])(`returns %s for region \"%s\"`, (output, input) => {\n    expect(isFipsRegion(input)).toEqual(output);\n  });\n\n  it.each([undefined, null])(\"returns false for %s\", (input) => {\n    expect(isFipsRegion(input as any)).toEqual(false);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/isFipsRegion.ts",
    "content": "/**\n * @internal\n */\nexport const isFipsRegion = (region: string) =>\n  typeof region === \"string\" && (region.startsWith(\"fips-\") || region.endsWith(\"-fips\"));\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/resolveRegionConfig.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getRealRegion } from \"./getRealRegion\";\nimport { isFipsRegion } from \"./isFipsRegion\";\nimport { resolveRegionConfig } from \"./resolveRegionConfig\";\n\nvi.mock(\"./getRealRegion\");\nvi.mock(\"./isFipsRegion\");\n\ndescribe(\"RegionConfig\", () => {\n  const mockRegion = \"mockRegion\";\n  const mockRealRegion = \"mockRealRegion\";\n  const mockUseFipsEndpoint = () => Promise.resolve(false);\n\n  beforeEach(() => {\n    vi.mocked(getRealRegion).mockReturnValue(mockRealRegion);\n    vi.mocked(isFipsRegion).mockReturnValue(false);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"maintains object custody\", () => {\n    const input = {\n      region: \"us-east-1\",\n    };\n    expect(resolveRegionConfig(input)).toBe(input);\n  });\n\n  describe(\"region\", () => {\n    it(\"return normalized value with real region if passed as a string\", async () => {\n      const resolvedRegionConfig = resolveRegionConfig({ region: mockRegion, useFipsEndpoint: mockUseFipsEndpoint });\n      const resolvedRegion = await resolvedRegionConfig.region();\n      expect(resolvedRegion).toBe(mockRealRegion);\n      expect(getRealRegion).toHaveBeenCalledTimes(1);\n      expect(getRealRegion).toHaveBeenCalledWith(mockRegion);\n    });\n\n    it(\"return provider with real region if passed as a Provider\", async () => {\n      const resolvedRegionConfig = resolveRegionConfig({\n        region: () => Promise.resolve(mockRegion),\n        useFipsEndpoint: mockUseFipsEndpoint,\n      });\n      const resolvedRegion = await resolvedRegionConfig.region();\n      expect(resolvedRegion).toBe(mockRealRegion);\n      expect(getRealRegion).toHaveBeenCalledTimes(1);\n      expect(getRealRegion).toHaveBeenCalledWith(mockRegion);\n    });\n\n    it(\"throw if region is not supplied\", () => {\n      expect(() => resolveRegionConfig({ useFipsEndpoint: mockUseFipsEndpoint })).toThrow();\n    });\n  });\n\n  describe(\"useFipsEndpoint\", () => {\n    let mockRegionProvider: () => Promise<string>;\n    let mockUseFipsEndpoint: () => Promise<boolean>;\n\n    beforeEach(() => {\n      mockRegionProvider = vi.fn().mockResolvedValueOnce(Promise.resolve(mockRegion));\n      mockUseFipsEndpoint = vi.fn().mockResolvedValueOnce(Promise.resolve(false));\n    });\n\n    afterEach(() => {\n      expect(isFipsRegion).toHaveBeenCalledTimes(1);\n      expect(isFipsRegion).toHaveBeenCalledWith(mockRegion);\n      expect(mockRegionProvider).toHaveBeenCalledTimes(1);\n    });\n\n    it(\"can be undefined\", async () => {\n      const resolvedRegionConfig = resolveRegionConfig({\n        region: mockRegionProvider,\n      });\n\n      expect(await resolvedRegionConfig.useFipsEndpoint()).toBe(false);\n    });\n\n    it(\"returns Provider which returns true for FIPS endpoints\", async () => {\n      vi.mocked(isFipsRegion).mockReturnValue(true);\n      const resolvedRegionConfig = resolveRegionConfig({\n        region: mockRegionProvider,\n        useFipsEndpoint: mockUseFipsEndpoint,\n      });\n\n      const useFipsEndpoint = await resolvedRegionConfig.useFipsEndpoint();\n      expect(useFipsEndpoint).toStrictEqual(true);\n      expect(mockUseFipsEndpoint).not.toHaveBeenCalled();\n    });\n\n    it(\"returns passed Provider if endpoint is not FIPS\", async () => {\n      const resolvedRegionConfig = resolveRegionConfig({\n        region: mockRegionProvider,\n        useFipsEndpoint: mockUseFipsEndpoint,\n      });\n\n      const useFipsEndpoint = await resolvedRegionConfig.useFipsEndpoint();\n      expect(useFipsEndpoint).toStrictEqual(false);\n      expect(mockUseFipsEndpoint).toHaveBeenCalledTimes(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionConfig/resolveRegionConfig.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\nimport { checkRegion } from \"./checkRegion\";\nimport { getRealRegion } from \"./getRealRegion\";\nimport { isFipsRegion } from \"./isFipsRegion\";\n\n/**\n * @public\n */\nexport interface RegionInputConfig {\n  /**\n   * The AWS region to which this client will send requests\n   */\n  region?: string | Provider<string>;\n\n  /**\n   * Enables FIPS compatible endpoints.\n   */\n  useFipsEndpoint?: boolean | Provider<boolean>;\n}\n\ninterface PreviouslyResolved {}\n\n/**\n * @internal\n */\nexport interface RegionResolvedConfig {\n  /**\n   * Resolved value for input config {@link RegionInputConfig.region}\n   */\n  region: Provider<string>;\n\n  /**\n   * Resolved value for input {@link RegionInputConfig.useFipsEndpoint}\n   */\n  useFipsEndpoint: Provider<boolean>;\n}\n\n/**\n * @internal\n */\nexport const resolveRegionConfig = <T>(input: T & RegionInputConfig & PreviouslyResolved): T & RegionResolvedConfig => {\n  const { region, useFipsEndpoint } = input;\n\n  if (!region) {\n    throw new Error(\"Region is missing\");\n  }\n\n  return Object.assign(input, {\n    region: async () => {\n      const providedRegion = typeof region === \"function\" ? await region() : region;\n      const realRegion = getRealRegion(providedRegion);\n      checkRegion(realRegion);\n      return realRegion;\n    },\n    useFipsEndpoint: async () => {\n      const providedRegion = typeof region === \"string\" ? region : await region();\n      if (isFipsRegion(providedRegion)) {\n        return true;\n      }\n      return typeof useFipsEndpoint !== \"function\" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();\n    },\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/EndpointVariant.ts",
    "content": "import type { EndpointVariantTag } from \"./EndpointVariantTag\";\n\n/**\n * Provides hostname information for specific host label.\n *\n * @internal\n * @deprecated unused as of endpointsRuleSets.\n */\nexport type EndpointVariant = {\n  hostname: string;\n  tags: EndpointVariantTag[];\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/EndpointVariantTag.ts",
    "content": "/**\n *\n *\n * The tag which mentions which area variant is providing information for.\n * Can be either \"fips\" or \"dualstack\".\n *\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport type EndpointVariantTag = \"fips\" | \"dualstack\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/PartitionHash.ts",
    "content": "import type { EndpointVariant } from \"./EndpointVariant\";\n\n/**\n * The hash of partition with the information specific to that partition.\n * The information includes the list of regions belonging to that partition,\n * and the hostname to be used for the partition.\n *\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport type PartitionHash = Record<\n  string,\n  {\n    regions: string[];\n    regionRegex: string;\n    variants: EndpointVariant[];\n    endpoint?: string;\n  }\n>;\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/RegionHash.ts",
    "content": "import type { EndpointVariant } from \"./EndpointVariant\";\n\n/**\n * The hash of region with the information specific to that region.\n * The information can include hostname, signingService and signingRegion.\n *\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport type RegionHash = Record<\n  string,\n  {\n    variants: EndpointVariant[];\n    signingService?: string;\n    signingRegion?: string;\n  }\n>;\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getHostnameFromVariants.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport type { EndpointVariant } from \"./EndpointVariant\";\nimport { getHostnameFromVariants, type GetHostnameFromVariantsOptions } from \"./getHostnameFromVariants\";\n\ndescribe(getHostnameFromVariants.name, () => {\n  const getMockHostname = (options: GetHostnameFromVariantsOptions) => JSON.stringify(options);\n  const getMockTags = ({ useFipsEndpoint, useDualstackEndpoint }: GetHostnameFromVariantsOptions) => [\n    ...(useFipsEndpoint ? [\"fips\"] : []),\n    ...(useDualstackEndpoint ? [\"dualstack\"] : []),\n  ];\n  const getMockVariants = () =>\n    [\n      { useFipsEndpoint: false, useDualstackEndpoint: false },\n      { useFipsEndpoint: false, useDualstackEndpoint: true },\n      { useFipsEndpoint: true, useDualstackEndpoint: false },\n      { useFipsEndpoint: true, useDualstackEndpoint: true },\n    ].map((options) => ({\n      hostname: getMockHostname(options),\n      tags: getMockTags(options),\n    }));\n\n  const testCases = [\n    [false, false],\n    [false, true],\n    [true, false],\n    [true, true],\n  ];\n\n  describe(\"returns hostname if present in variants\", () => {\n    it.each(testCases)(\"useFipsEndpoint: %s, useDualstackEndpoint: %s\", (useFipsEndpoint, useDualstackEndpoint) => {\n      const options = { useFipsEndpoint, useDualstackEndpoint };\n      const variants = getMockVariants() as EndpointVariant[];\n      expect(getHostnameFromVariants(variants, options)).toEqual(getMockHostname(options));\n    });\n  });\n\n  describe(\"returns undefined if not present in variants\", () => {\n    it.each(testCases)(\"useFipsEndpoint: %s, useDualstackEndpoint: %s\", (useFipsEndpoint, useDualstackEndpoint) => {\n      const options = { useFipsEndpoint, useDualstackEndpoint };\n      const variants = getMockVariants() as EndpointVariant[];\n      expect(\n        getHostnameFromVariants(\n          variants.filter(({ tags }) => JSON.stringify(tags) !== JSON.stringify(getMockTags(options))),\n          options\n        )\n      ).toBeUndefined();\n    });\n  });\n\n  describe(\"returns undefined if variants in undefined\", () => {\n    it.each(testCases)(\"useFipsEndpoint: %s, useDualstackEndpoint: %s\", (useFipsEndpoint, useDualstackEndpoint) => {\n      const options = { useFipsEndpoint, useDualstackEndpoint };\n      expect(getHostnameFromVariants(undefined, options)).toBeUndefined();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getHostnameFromVariants.ts",
    "content": "import type { EndpointVariant } from \"./EndpointVariant\";\n\n/**\n * @internal\n * @deprecated unused as of endpointsRuleSets.\n */\nexport interface GetHostnameFromVariantsOptions {\n  useFipsEndpoint: boolean;\n  useDualstackEndpoint: boolean;\n}\n\n/**\n * @internal\n * @deprecated unused as of endpointsRuleSets.\n */\nexport const getHostnameFromVariants = (\n  variants: EndpointVariant[] = [],\n  { useFipsEndpoint, useDualstackEndpoint }: GetHostnameFromVariantsOptions\n) =>\n  variants.find(\n    ({ tags }) => useFipsEndpoint === tags.includes(\"fips\") && useDualstackEndpoint === tags.includes(\"dualstack\")\n  )?.hostname;\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getRegionInfo.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport type { PartitionHash } from \"./PartitionHash\";\nimport type { RegionHash } from \"./RegionHash\";\nimport { getHostnameFromVariants } from \"./getHostnameFromVariants\";\nimport { getRegionInfo } from \"./getRegionInfo\";\nimport { getResolvedHostname } from \"./getResolvedHostname\";\nimport { getResolvedPartition } from \"./getResolvedPartition\";\nimport { getResolvedSigningRegion } from \"./getResolvedSigningRegion\";\n\nvi.mock(\"./getHostnameFromVariants\");\nvi.mock(\"./getResolvedHostname\");\nvi.mock(\"./getResolvedPartition\");\nvi.mock(\"./getResolvedSigningRegion\");\n\ndescribe(getRegionInfo.name, () => {\n  const mockPartition = \"mockPartition\";\n  const mockSigningService = \"mockSigningService\";\n\n  const mockRegion = \"mockRegion\";\n  const mockRegionRegex = \"mockRegionRegex\";\n  const mockHostname = \"{region}.mockHostname.com\";\n  const mockEndpointRegion = \"mockEndpointRegion\";\n  const mockEndpointHostname = \"{region}.mockEndpointHostname.com\";\n\n  enum RegionCase {\n    REGION = \"Region\",\n    ENDPOINT = \"Endpoint\",\n    REGION_AND_ENDPOINT = \"Region and Endpoint\",\n  }\n\n  const getMockRegionHash = (regionCase: RegionCase): RegionHash => ({\n    ...((regionCase === RegionCase.REGION || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n      [mockRegion]: {\n        variants: [{ hostname: mockHostname, tags: [] }],\n      },\n    }),\n    ...((regionCase === RegionCase.ENDPOINT || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n      [mockEndpointRegion]: {\n        variants: [{ hostname: mockEndpointHostname, tags: [] }],\n      },\n    }),\n  });\n\n  const getMockPartitionHash = (regionCase: RegionCase): PartitionHash => ({\n    [mockPartition]: {\n      regions: [mockRegion, `${mockRegion}2`, `${mockRegion}3`],\n      regionRegex: mockRegionRegex,\n      variants: [{ hostname: mockHostname, tags: [] }],\n      ...((regionCase === RegionCase.ENDPOINT || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n        endpoint: mockEndpointRegion,\n      }),\n    },\n  });\n\n  const getMockResolvedRegion = (regionCase: RegionCase): string =>\n    regionCase !== RegionCase.ENDPOINT ? mockRegion : mockEndpointRegion;\n\n  const getMockResolvedPartitionOptions = (partitionHash: PartitionHash) => ({ partitionHash });\n\n  const getMockRegionInfoOptions = (regionHash: RegionHash, getResolvedPartitionOptions: any) => ({\n    ...getResolvedPartitionOptions,\n    signingService: mockSigningService,\n    regionHash,\n  });\n\n  beforeEach(() => {\n    vi.mocked(getHostnameFromVariants).mockReturnValue(mockHostname);\n    vi.mocked(getResolvedHostname).mockReturnValue(mockHostname);\n    vi.mocked(getResolvedPartition).mockReturnValue(mockPartition);\n    vi.mocked(getResolvedSigningRegion).mockReturnValue(undefined);\n  });\n\n  afterEach(() => {\n    expect(getHostnameFromVariants).toHaveBeenCalledTimes(2);\n    expect(getResolvedHostname).toHaveBeenCalledTimes(1);\n    expect(getResolvedPartition).toHaveBeenCalledTimes(1);\n    vi.clearAllMocks();\n  });\n\n  describe(\"returns data based on options passed\", () => {\n    it.each(Object.values(RegionCase))(\"%s\", (regionCase) => {\n      const mockRegionHash = getMockRegionHash(regionCase);\n      const mockPartitionHash = getMockPartitionHash(regionCase);\n\n      const mockGetResolvedPartitionOptions = getMockResolvedPartitionOptions(mockPartitionHash);\n      const mockGetRegionInfoOptions = getMockRegionInfoOptions(mockRegionHash, mockGetResolvedPartitionOptions);\n\n      const mockResolvedRegion = getMockResolvedRegion(regionCase);\n      const mockRegionHostname = mockGetRegionInfoOptions.regionHash[mockResolvedRegion]?.hostname;\n      const mockPartitionHostname = mockGetRegionInfoOptions.partitionHash[mockPartition]?.hostname;\n\n      vi.mocked(getHostnameFromVariants).mockReturnValueOnce(mockRegionHostname);\n      vi.mocked(getHostnameFromVariants).mockReturnValueOnce(mockPartitionHostname);\n\n      expect(getRegionInfo(mockRegion, mockGetRegionInfoOptions)).toEqual({\n        signingService: mockSigningService,\n        hostname: mockHostname,\n        partition: mockPartition,\n      });\n\n      expect(getResolvedHostname).toHaveBeenCalledWith(mockResolvedRegion, {\n        regionHostname: mockRegionHostname,\n        partitionHostname: mockPartitionHostname,\n      });\n      expect(getResolvedPartition).toHaveBeenCalledWith(mockRegion, mockGetResolvedPartitionOptions);\n      expect(getResolvedSigningRegion).toHaveBeenCalledWith(mockHostname, {\n        regionRegex: mockRegionRegex,\n        useFipsEndpoint: false,\n      });\n    });\n  });\n\n  describe(\"returns signingRegion if resolved by getResolvedSigningRegion\", () => {\n    const getMockRegionHashWithSigningRegion = (\n      regionCase: RegionCase,\n      mockRegionHash: RegionHash,\n      mockSigningRegion: string\n    ): RegionHash => ({\n      ...mockRegionHash,\n      ...((regionCase === RegionCase.REGION || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n        [mockRegion]: {\n          ...mockRegionHash[mockRegion],\n          signingRegion: mockSigningRegion,\n        },\n      }),\n      ...((regionCase === RegionCase.ENDPOINT || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n        [mockEndpointRegion]: {\n          ...mockRegionHash[mockEndpointRegion],\n          signingRegion: mockSigningRegion,\n        },\n      }),\n    });\n\n    it.each(Object.values(RegionCase))(\"%s\", (regionCase) => {\n      const mockSigningRegion = \"mockSigningRegion\";\n      vi.mocked(getResolvedSigningRegion).mockReturnValueOnce(mockSigningRegion);\n      const mockRegionHash = getMockRegionHash(regionCase);\n      const mockPartitionHash = getMockPartitionHash(regionCase);\n\n      const mockGetResolvedPartitionOptions = getMockResolvedPartitionOptions(mockPartitionHash);\n      const mockGetRegionInfoOptions = getMockRegionInfoOptions(mockRegionHash, mockGetResolvedPartitionOptions);\n\n      const mockResolvedRegion = getMockResolvedRegion(regionCase);\n      const mockRegionHostname = mockGetRegionInfoOptions.regionHash[mockResolvedRegion]?.hostname;\n      const mockPartitionHostname = mockGetRegionInfoOptions.partitionHash[mockPartition]?.hostname;\n\n      vi.mocked(getHostnameFromVariants).mockReturnValueOnce(mockRegionHostname);\n      vi.mocked(getHostnameFromVariants).mockReturnValueOnce(mockPartitionHostname);\n\n      const mockRegionHashWithSigningRegion = getMockRegionHashWithSigningRegion(\n        regionCase,\n        mockRegionHash,\n        mockSigningRegion\n      );\n\n      expect(\n        getRegionInfo(mockRegion, { ...mockGetRegionInfoOptions, regionHash: mockRegionHashWithSigningRegion })\n      ).toEqual({\n        signingService: mockSigningService,\n        hostname: mockHostname,\n        partition: mockPartition,\n        signingRegion: mockSigningRegion,\n      });\n\n      expect(getResolvedHostname).toHaveBeenCalledWith(mockResolvedRegion, {\n        regionHostname: mockRegionHostname,\n        partitionHostname: mockPartitionHostname,\n      });\n      expect(getResolvedPartition).toHaveBeenCalledWith(mockRegion, mockGetResolvedPartitionOptions);\n      expect(getResolvedSigningRegion).toHaveBeenCalledWith(mockHostname, {\n        signingRegion: mockSigningRegion,\n        regionRegex: mockRegionRegex,\n        useFipsEndpoint: false,\n      });\n    });\n  });\n\n  describe(\"returns signingService if present in regionHash\", () => {\n    const getMockRegionHashWithSigningService = (\n      regionCase: RegionCase,\n      mockRegionHash: RegionHash,\n      mockSigningService: string\n    ): RegionHash => ({\n      ...mockRegionHash,\n      ...((regionCase === RegionCase.REGION || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n        [mockRegion]: {\n          ...mockRegionHash[mockRegion],\n          signingService: mockSigningService,\n        },\n      }),\n      ...((regionCase === RegionCase.ENDPOINT || regionCase === RegionCase.REGION_AND_ENDPOINT) && {\n        [mockEndpointRegion]: {\n          ...mockRegionHash[mockEndpointRegion],\n          signingService: mockSigningService,\n        },\n      }),\n    });\n\n    it.each(Object.values(RegionCase))(\"%s\", (regionCase) => {\n      const mockSigningServiceInRegionHash = \"mockSigningServiceInRegionHash\";\n      const mockRegionHash = getMockRegionHash(regionCase);\n      const mockPartitionHash = getMockPartitionHash(regionCase);\n\n      const mockGetResolvedPartitionOptions = getMockResolvedPartitionOptions(mockPartitionHash);\n      const mockGetRegionInfoOptions = getMockRegionInfoOptions(mockRegionHash, mockGetResolvedPartitionOptions);\n\n      const mockResolvedRegion = getMockResolvedRegion(regionCase);\n      const mockRegionHostname = mockGetRegionInfoOptions.regionHash[mockResolvedRegion]?.hostname;\n      const mockPartitionHostname = mockGetRegionInfoOptions.partitionHash[mockPartition]?.hostname;\n\n      vi.mocked(getHostnameFromVariants).mockReturnValueOnce(mockRegionHostname);\n      vi.mocked(getHostnameFromVariants).mockReturnValueOnce(mockPartitionHostname);\n\n      const mockRegionHashWithSigningRegion = getMockRegionHashWithSigningService(\n        regionCase,\n        mockRegionHash,\n        mockSigningServiceInRegionHash\n      );\n\n      expect(\n        getRegionInfo(mockRegion, { ...mockGetRegionInfoOptions, regionHash: mockRegionHashWithSigningRegion })\n      ).toEqual({\n        signingService: mockSigningServiceInRegionHash,\n        hostname: mockHostname,\n        partition: mockPartition,\n      });\n\n      expect(getResolvedHostname).toHaveBeenCalledWith(mockResolvedRegion, {\n        regionHostname: mockRegionHostname,\n        partitionHostname: mockPartitionHostname,\n      });\n      expect(getResolvedPartition).toHaveBeenCalledWith(mockRegion, mockGetResolvedPartitionOptions);\n      expect(getResolvedSigningRegion).toHaveBeenCalledWith(mockHostname, {\n        regionRegex: mockRegionRegex,\n        useFipsEndpoint: false,\n      });\n    });\n  });\n\n  it(\"throws error if hostname is not defined\", () => {\n    vi.mocked(getResolvedHostname).mockReturnValueOnce(undefined);\n    const mockRegionHash = getMockRegionHash(RegionCase.REGION);\n    const mockPartitionHash = getMockPartitionHash(RegionCase.REGION);\n    expect(() => {\n      getRegionInfo(mockRegion, {\n        signingService: mockSigningService,\n        regionHash: mockRegionHash,\n        partitionHash: mockPartitionHash,\n      });\n    }).toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getRegionInfo.ts",
    "content": "import type { RegionInfo } from \"@smithy/types\";\n\nimport type { PartitionHash } from \"./PartitionHash\";\nimport type { RegionHash } from \"./RegionHash\";\nimport { getHostnameFromVariants } from \"./getHostnameFromVariants\";\nimport { getResolvedHostname } from \"./getResolvedHostname\";\nimport { getResolvedPartition } from \"./getResolvedPartition\";\nimport { getResolvedSigningRegion } from \"./getResolvedSigningRegion\";\n\n/**\n * @internal\n * @deprecated unused as of endpointsRuleSets.\n */\nexport interface GetRegionInfoOptions {\n  useFipsEndpoint?: boolean;\n  useDualstackEndpoint?: boolean;\n  signingService: string;\n  regionHash: RegionHash;\n  partitionHash: PartitionHash;\n}\n\n/**\n * @internal\n * @deprecated unused as of endpointsRuleSets.\n */\nexport const getRegionInfo = (\n  region: string,\n  {\n    useFipsEndpoint = false,\n    useDualstackEndpoint = false,\n    signingService,\n    regionHash,\n    partitionHash,\n  }: GetRegionInfoOptions\n): RegionInfo => {\n  const partition = getResolvedPartition(region, { partitionHash });\n  const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region;\n\n  const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint };\n  const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions);\n  const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions);\n  const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname });\n\n  if (hostname === undefined) {\n    throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`);\n  }\n\n  const signingRegion = getResolvedSigningRegion(hostname, {\n    signingRegion: regionHash[resolvedRegion]?.signingRegion,\n    regionRegex: partitionHash[partition].regionRegex,\n    useFipsEndpoint,\n  });\n\n  return {\n    partition,\n    signingService,\n    hostname,\n    ...(signingRegion && { signingRegion }),\n    ...(regionHash[resolvedRegion]?.signingService && {\n      signingService: regionHash[resolvedRegion].signingService,\n    }),\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getResolvedHostname.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getResolvedHostname } from \"./getResolvedHostname\";\n\ndescribe(getResolvedHostname.name, () => {\n  const mockRegion = \"mockRegion\";\n  const mockHostname = \"{region}.mockHostname.com\";\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"returns hostname if available in regionHostname\", () => {\n    expect(\n      getResolvedHostname(mockRegion, {\n        regionHostname: mockHostname,\n      })\n    ).toBe(mockHostname);\n  });\n\n  it(\"returns hostname from partitionHostname when not available in partitionHostname\", () => {\n    expect(\n      getResolvedHostname(mockRegion, {\n        partitionHostname: mockHostname,\n      })\n    ).toBe(mockHostname.replace(\"{region}\", mockRegion));\n  });\n\n  it(\"returns undefined not available in either regionHostname or partitionHostname\", () => {\n    expect(getResolvedHostname(mockRegion, {})).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getResolvedHostname.ts",
    "content": "/**\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport interface GetResolvedHostnameOptions {\n  regionHostname?: string;\n  partitionHostname?: string;\n}\n\n/**\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport const getResolvedHostname = (\n  resolvedRegion: string,\n  { regionHostname, partitionHostname }: GetResolvedHostnameOptions\n): string | undefined =>\n  regionHostname\n    ? regionHostname\n    : partitionHostname\n      ? partitionHostname.replace(\"{region}\", resolvedRegion)\n      : undefined;\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getResolvedPartition.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport type { PartitionHash } from \"./PartitionHash\";\nimport { getResolvedPartition } from \"./getResolvedPartition\";\n\ndescribe(getResolvedPartition.name, () => {\n  const mockRegion = \"mockRegion\";\n  const mockPartition = \"mockPartition\";\n  const mockHostname = \"mockHostname\";\n  const mockRegionRegex = \"mockRegionRegex\";\n\n  it(\"returns the partition if region is present in partitionHash\", () => {\n    const mockPartitionHash: PartitionHash = {\n      [mockPartition]: {\n        regions: [mockRegion, `${mockRegion}2`, `${mockRegion}3`],\n        regionRegex: mockRegionRegex,\n        variants: [{ hostname: mockHostname, tags: [] }],\n      },\n    };\n    expect(getResolvedPartition(mockRegion, { partitionHash: mockPartitionHash })).toBe(mockPartition);\n  });\n\n  it(\"returns aws if region is not present in any partition\", () => {\n    const mockPartitionHash: PartitionHash = {\n      [`${mockPartition}2`]: {\n        regions: [`${mockRegion}2`, `${mockRegion}3`],\n        regionRegex: mockRegionRegex,\n        variants: [{ hostname: mockHostname, tags: [] }],\n      },\n    };\n    expect(getResolvedPartition(mockRegion, { partitionHash: mockPartitionHash })).toBe(\"aws\");\n  });\n\n  it(\"returns aws if partitionHash is empty\", () => {\n    expect(getResolvedPartition(mockRegion, { partitionHash: undefined as any })).toBe(\"aws\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getResolvedPartition.ts",
    "content": "import type { PartitionHash } from \"./PartitionHash\";\n\n/**\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport interface GetResolvedPartitionOptions {\n  partitionHash: PartitionHash;\n}\n\n/**\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport const getResolvedPartition = (region: string, { partitionHash }: GetResolvedPartitionOptions) =>\n  Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? \"aws\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getResolvedSigningRegion.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { getResolvedSigningRegion } from \"./getResolvedSigningRegion\";\n\ndescribe(getResolvedSigningRegion.name, () => {\n  const mockSigningRegion = \"mockSigningRegion\";\n  const mockHostname = \"mockHostname\";\n  const mockRegionRegex = \"mockRegionRegex\";\n\n  const mockOptions = {\n    regionRegex: mockRegionRegex,\n    useFipsEndpoint: false,\n  };\n\n  it(\"returns signingRegion if passed in options\", () => {\n    expect(getResolvedSigningRegion(mockHostname, { ...mockOptions, signingRegion: mockSigningRegion })).toEqual(\n      mockSigningRegion\n    );\n  });\n\n  describe(\"returns undefined if signingRegion is not present and\", () => {\n    it(\"region is not FIPS\", () => {\n      expect(getResolvedSigningRegion(mockHostname, mockOptions)).not.toBeDefined();\n    });\n\n    it(\"regionRegex does not return a match in hostname\", () => {\n      const matchSpy = vi.spyOn(String.prototype, \"match\").mockReturnValueOnce(null);\n\n      expect(getResolvedSigningRegion(mockHostname, { ...mockOptions, useFipsEndpoint: true })).not.toBeDefined();\n      expect(matchSpy).toHaveBeenCalledTimes(1);\n      expect(matchSpy).toHaveBeenCalledWith(mockRegionRegex);\n    });\n\n    it(\"region is not present between dots in a hostname\", () => {\n      const regionInHostname = \"us-east-1\";\n\n      expect(\n        getResolvedSigningRegion(`test-${regionInHostname}.amazonaws.com`, {\n          ...mockOptions,\n          regionRegex: \"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$\",\n        })\n      ).not.toBeDefined();\n    });\n  });\n\n  it(\"returns region from hostname if signingRegion is not present\", () => {\n    const regionInHostname = \"us-east-1\";\n\n    expect(\n      getResolvedSigningRegion(`test.${regionInHostname}.amazonaws.com`, {\n        ...mockOptions,\n        regionRegex: \"^(us|eu|ap|sa|ca|me|af)\\\\-\\\\w+\\\\-\\\\d+$\",\n        useFipsEndpoint: true,\n      })\n    ).toEqual(regionInHostname);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/config-resolver/regionInfo/getResolvedSigningRegion.ts",
    "content": "/**\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport interface GetResolvedSigningRegionOptions {\n  regionRegex: string;\n  signingRegion?: string;\n  useFipsEndpoint: boolean;\n}\n\n/**\n * @internal\n * @deprecated unused for endpointRuleSets.\n */\nexport const getResolvedSigningRegion = (\n  hostname: string,\n  { signingRegion, regionRegex, useFipsEndpoint }: GetResolvedSigningRegionOptions\n) => {\n  if (signingRegion) {\n    return signingRegion;\n  } else if (useFipsEndpoint) {\n    const regionRegexJs = regionRegex.replace(\"\\\\\\\\\", \"\\\\\").replace(/^\\^/g, \"\\\\.\").replace(/\\$$/g, \"\\\\.\");\n    const regionRegexmatchArray = hostname.match(regionRegexJs);\n    if (regionRegexmatchArray) {\n      return regionRegexmatchArray[0].slice(1, -1);\n    }\n  }\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/CHANGELOG.browser.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.3.49\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.13\n\n## 4.3.48\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.12\n\n## 4.3.47\n\n### Patch Changes\n\n- Updated dependencies [b69e3c9]\n  - @smithy/smithy-client@4.12.11\n\n## 4.3.46\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/smithy-client@4.12.10\n  - @smithy/types@4.14.1\n  - @smithy/property-provider@4.2.14\n\n## 4.3.45\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/property-provider@4.2.13\n  - @smithy/smithy-client@4.12.9\n\n## 4.3.44\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.8\n\n## 4.3.43\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.7\n\n## 4.3.42\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.6\n\n## 4.3.41\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.5\n\n## 4.3.40\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/smithy-client@4.12.4\n  - @smithy/property-provider@4.2.12\n\n## 4.3.39\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.3\n\n## 4.3.38\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/property-provider@4.2.11\n  - @smithy/smithy-client@4.12.2\n\n## 4.3.37\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.1\n\n## 4.3.36\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/smithy-client@4.12.0\n  - @smithy/types@4.13.0\n  - @smithy/property-provider@4.2.10\n\n## 4.3.35\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.8\n\n## 4.3.34\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/property-provider@4.2.9\n  - @smithy/smithy-client@4.11.7\n  - @smithy/types@4.12.1\n\n## 4.3.33\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.6\n\n## 4.3.32\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.5\n\n## 4.3.31\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.4\n\n## 4.3.30\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.3\n\n## 4.3.29\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.2\n\n## 4.3.28\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.1\n\n## 4.3.27\n\n### Patch Changes\n\n- Updated dependencies [75145e5]\n  - @smithy/smithy-client@4.11.0\n\n## 4.3.26\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.12\n\n## 4.3.25\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.11\n\n## 4.3.24\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.10\n\n## 4.3.23\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.9\n\n## 4.3.22\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.8\n\n## 4.3.21\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/property-provider@4.2.8\n  - @smithy/smithy-client@4.10.7\n\n## 4.3.20\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.6\n\n## 4.3.19\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.5\n\n## 4.3.18\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.4\n\n## 4.3.17\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.3\n\n## 4.3.16\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/property-provider@4.2.7\n  - @smithy/smithy-client@4.10.2\n\n## 4.3.15\n\n### Patch Changes\n\n- Updated dependencies [f3a51c2]\n  - @smithy/smithy-client@4.10.1\n\n## 4.3.14\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/smithy-client@4.10.0\n  - @smithy/types@4.10.0\n  - @smithy/property-provider@4.2.6\n\n## 4.3.13\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.10\n\n## 4.3.12\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.9\n\n## 4.3.11\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.8\n\n## 4.3.10\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.7\n\n## 4.3.9\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.6\n\n## 4.3.8\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.5\n\n## 4.3.7\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.4\n\n## 4.3.6\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/property-provider@4.2.5\n  - @smithy/smithy-client@4.9.3\n\n## 4.3.5\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/property-provider@4.2.4\n  - @smithy/smithy-client@4.9.2\n\n## 4.3.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.1\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/smithy-client@4.9.0\n  - @smithy/types@4.8.0\n  - @smithy/property-provider@4.2.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/smithy-client@4.8.1\n  - @smithy/property-provider@4.2.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/smithy-client@4.8.0\n  - @smithy/property-provider@4.2.1\n\n## 4.3.0\n\n### Minor Changes\n\n- c1544be: remove bower from mobile device detection\n\n### Patch Changes\n\n- @smithy/smithy-client@4.7.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/property-provider@4.2.0\n  - @smithy/smithy-client@4.7.0\n  - @smithy/types@4.6.0\n\n## 4.1.5\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.5\n\n## 4.1.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.4\n\n## 4.1.3\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.3\n\n## 4.1.2\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.2\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/property-provider@4.1.1\n  - @smithy/smithy-client@4.6.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/property-provider@4.1.0\n  - @smithy/smithy-client@4.6.0\n  - @smithy/types@4.4.0\n\n## 4.0.29\n\n### Patch Changes\n\n- @smithy/smithy-client@4.5.2\n\n## 4.0.28\n\n### Patch Changes\n\n- @smithy/smithy-client@4.5.1\n\n## 4.0.27\n\n### Patch Changes\n\n- Updated dependencies [eb1ab40]\n  - @smithy/smithy-client@4.5.0\n\n## 4.0.26\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/smithy-client@4.4.10\n  - @smithy/property-provider@4.0.5\n\n## 4.0.25\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.9\n\n## 4.0.24\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.8\n\n## 4.0.23\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.7\n\n## 4.0.22\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.6\n\n## 4.0.21\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.5\n\n## 4.0.20\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.4\n\n## 4.0.19\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.3\n\n## 4.0.18\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.2\n\n## 4.0.17\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/property-provider@4.0.4\n  - @smithy/smithy-client@4.4.1\n\n## 4.0.16\n\n### Patch Changes\n\n- Updated dependencies [23812a9]\n  - @smithy/smithy-client@4.4.0\n\n## 4.0.15\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n- Updated dependencies [06b0ce8]\n  - @smithy/types@4.3.0\n  - @smithy/smithy-client@4.3.0\n  - @smithy/property-provider@4.0.3\n\n## 4.0.14\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.6\n\n## 4.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.5\n\n## 4.0.12\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.4\n\n## 4.0.11\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.3\n\n## 4.0.10\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.2\n\n## 4.0.9\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.1\n\n## 4.0.8\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/smithy-client@4.2.0\n  - @smithy/types@4.2.0\n  - @smithy/property-provider@4.0.2\n\n## 4.0.7\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.6\n\n## 4.0.6\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.5\n\n## 4.0.5\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.4\n\n## 4.0.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.3\n\n## 4.0.3\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.2\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e87f2b3]\n  - @smithy/smithy-client@4.1.1\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n- Updated dependencies [292c134]\n  - @smithy/types@4.1.0\n  - @smithy/smithy-client@4.1.0\n  - @smithy/property-provider@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/smithy-client@4.0.0\n  - @smithy/property-provider@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.34\n\n### Patch Changes\n\n- Updated dependencies [a0e71d5]\n  - @smithy/smithy-client@3.7.0\n\n## 3.0.33\n\n### Patch Changes\n\n- Updated dependencies [23129d9]\n  - @smithy/smithy-client@3.6.0\n\n## 3.0.32\n\n### Patch Changes\n\n- @smithy/smithy-client@3.5.2\n\n## 3.0.31\n\n### Patch Changes\n\n- Updated dependencies [7f17426]\n  - @smithy/smithy-client@3.5.1\n\n## 3.0.30\n\n### Patch Changes\n\n- Updated dependencies [70275bd]\n  - @smithy/smithy-client@3.5.0\n\n## 3.0.29\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/property-provider@3.1.11\n  - @smithy/smithy-client@3.4.6\n\n## 3.0.28\n\n### Patch Changes\n\n- @smithy/smithy-client@3.4.5\n\n## 3.0.27\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/property-provider@3.1.10\n  - @smithy/smithy-client@3.4.4\n\n## 3.0.26\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/smithy-client@3.4.3\n  - @smithy/property-provider@3.1.9\n\n## 3.0.25\n\n### Patch Changes\n\n- @smithy/smithy-client@3.4.2\n\n## 3.0.24\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n  - @smithy/types@3.6.0\n  - @smithy/smithy-client@3.4.1\n  - @smithy/property-provider@3.1.8\n\n## 3.0.23\n\n### Patch Changes\n\n- Updated dependencies [75e0125]\n  - @smithy/smithy-client@3.4.0\n\n## 3.0.22\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/property-provider@3.1.7\n  - @smithy/smithy-client@3.3.6\n\n## 3.0.21\n\n### Patch Changes\n\n- Updated dependencies [64600d8]\n  - @smithy/smithy-client@3.3.5\n\n## 3.0.20\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.4\n\n## 3.0.19\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.3\n\n## 3.0.18\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/property-provider@3.1.6\n  - @smithy/smithy-client@3.3.2\n\n## 3.0.17\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/property-provider@3.1.5\n  - @smithy/smithy-client@3.3.1\n\n## 3.0.16\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [d8df7bf]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/smithy-client@3.3.0\n  - @smithy/property-provider@3.1.4\n\n## 3.0.15\n\n### Patch Changes\n\n- Updated dependencies [5865b65]\n  - @smithy/smithy-client@3.2.0\n\n## 3.0.14\n\n### Patch Changes\n\n- Updated dependencies [670553a]\n  - @smithy/smithy-client@3.1.12\n\n## 3.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.11\n\n## 3.0.12\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.10\n\n## 3.0.11\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.9\n\n## 3.0.10\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.8\n\n## 3.0.9\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.7\n\n## 3.0.8\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.6\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/property-provider@3.1.3\n  - @smithy/smithy-client@3.1.5\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/property-provider@3.1.2\n  - @smithy/smithy-client@3.1.4\n\n## 3.0.5\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.3\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/property-provider@3.1.1\n  - @smithy/smithy-client@3.1.2\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [3689c949]\n  - @smithy/smithy-client@3.1.1\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n- Updated dependencies [764047eb]\n  - @smithy/property-provider@3.1.0\n  - @smithy/smithy-client@3.1.0\n\n## 3.0.1\n\n### Patch Changes\n\n- @smithy/smithy-client@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/property-provider@3.0.0\n  - @smithy/smithy-client@3.0.0\n\n## 2.2.1\n\n### Patch Changes\n\n- @smithy/smithy-client@2.5.1\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/property-provider@2.2.0\n  - @smithy/smithy-client@2.5.0\n  - @smithy/types@2.12.0\n\n## 2.1.7\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.5\n\n## 2.1.6\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.4\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/property-provider@2.1.4\n  - @smithy/smithy-client@2.4.3\n\n## 2.1.4\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.2\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/property-provider@2.1.3\n  - @smithy/smithy-client@2.4.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/smithy-client@2.4.0\n  - @smithy/property-provider@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/property-provider@2.1.1\n  - @smithy/smithy-client@2.3.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/property-provider@2.1.0\n  - @smithy/smithy-client@2.3.0\n  - @smithy/types@2.9.0\n\n## 2.0.24\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/smithy-client@2.2.1\n  - @smithy/property-provider@2.0.17\n\n## 2.0.23\n\n### Patch Changes\n\n- Updated dependencies [164f3bbd]\n- Updated dependencies [164f3bbd]\n  - @smithy/smithy-client@2.2.0\n\n## 2.0.22\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.18\n\n## 2.0.21\n\n### Patch Changes\n\n- Updated dependencies [07ff207b]\n- Updated dependencies [340634a5]\n  - @smithy/smithy-client@2.1.17\n  - @smithy/types@2.7.0\n  - @smithy/property-provider@2.0.16\n\n## 2.0.20\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/property-provider@2.0.15\n  - @smithy/smithy-client@2.1.16\n\n## 2.0.19\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/property-provider@2.0.14\n  - @smithy/smithy-client@2.1.15\n\n## 2.0.18\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.14\n\n## 2.0.17\n\n### Patch Changes\n\n- 5598a033: update bundler replacement directives in package.json\n  - @smithy/smithy-client@2.1.13\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/property-provider@2.0.13\n  - @smithy/smithy-client@2.1.12\n\n## 2.0.15\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.11\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/property-provider@2.0.12\n  - @smithy/smithy-client@2.1.10\n\n## 2.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.9\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/smithy-client@2.1.8\n  - @smithy/property-provider@2.0.11\n\n## 2.0.11\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.7\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/smithy-client@2.1.6\n  - @smithy/property-provider@2.0.10\n\n## 2.0.9\n\n### Patch Changes\n\n- e6ea6bd5: move devDeps into deps\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/property-provider@2.0.9\n  - @smithy/smithy-client@2.1.5\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/property-provider@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/property-provider@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [a7598a5d]\n  - @smithy/property-provider@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/property-provider@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/property-provider@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/property-provider@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/property-provider@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/property-provider@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/property-provider@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/property-provider@1.2.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [4ad43c6a]\n- Updated dependencies [d90a45b5]\n- Updated dependencies [5f7bcc79]\n  - @smithy/types@2.0.0\n  - @smithy/property-provider@1.1.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/property-provider@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/property-provider@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-defaults-mode-browser](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-defaults-mode-browser/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/CHANGELOG.node.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.2.54\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.13\n\n## 4.2.53\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.12\n- @smithy/config-resolver@4.4.17\n\n## 4.2.52\n\n### Patch Changes\n\n- Updated dependencies [b69e3c9]\n  - @smithy/smithy-client@4.12.11\n\n## 4.2.51\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/smithy-client@4.12.10\n  - @smithy/types@4.14.1\n  - @smithy/config-resolver@4.4.16\n  - @smithy/credential-provider-imds@4.2.14\n  - @smithy/node-config-provider@4.3.14\n  - @smithy/property-provider@4.2.14\n\n## 4.2.50\n\n### Patch Changes\n\n- @smithy/config-resolver@4.4.15\n\n## 4.2.49\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/config-resolver@4.4.14\n  - @smithy/credential-provider-imds@4.2.13\n  - @smithy/node-config-provider@4.3.13\n  - @smithy/property-provider@4.2.13\n  - @smithy/smithy-client@4.12.9\n\n## 4.2.48\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.8\n\n## 4.2.47\n\n### Patch Changes\n\n- Updated dependencies [b1f0dba]\n  - @smithy/config-resolver@4.4.13\n  - @smithy/smithy-client@4.12.7\n\n## 4.2.46\n\n### Patch Changes\n\n- Updated dependencies [4b5602d]\n  - @smithy/config-resolver@4.4.12\n\n## 4.2.45\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.6\n\n## 4.2.44\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.5\n\n## 4.2.43\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/smithy-client@4.12.4\n  - @smithy/config-resolver@4.4.11\n  - @smithy/credential-provider-imds@4.2.12\n  - @smithy/node-config-provider@4.3.12\n  - @smithy/property-provider@4.2.12\n\n## 4.2.42\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.3\n\n## 4.2.41\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/credential-provider-imds@4.2.11\n  - @smithy/node-config-provider@4.3.11\n  - @smithy/property-provider@4.2.11\n  - @smithy/config-resolver@4.4.10\n  - @smithy/smithy-client@4.12.2\n\n## 4.2.40\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.1\n\n## 4.2.39\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/smithy-client@4.12.0\n  - @smithy/types@4.13.0\n  - @smithy/config-resolver@4.4.9\n  - @smithy/credential-provider-imds@4.2.10\n  - @smithy/node-config-provider@4.3.10\n  - @smithy/property-provider@4.2.10\n\n## 4.2.38\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.8\n- @smithy/config-resolver@4.4.8\n\n## 4.2.37\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/config-resolver@4.4.7\n  - @smithy/credential-provider-imds@4.2.9\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/property-provider@4.2.9\n  - @smithy/smithy-client@4.11.7\n  - @smithy/types@4.12.1\n\n## 4.2.36\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.6\n\n## 4.2.35\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.5\n\n## 4.2.34\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.4\n\n## 4.2.33\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.3\n\n## 4.2.32\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.2\n\n## 4.2.31\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.1\n\n## 4.2.30\n\n### Patch Changes\n\n- Updated dependencies [75145e5]\n  - @smithy/smithy-client@4.11.0\n\n## 4.2.29\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.12\n\n## 4.2.28\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.11\n\n## 4.2.27\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.10\n\n## 4.2.26\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.9\n\n## 4.2.25\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.8\n\n## 4.2.24\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/config-resolver@4.4.6\n  - @smithy/credential-provider-imds@4.2.8\n  - @smithy/node-config-provider@4.3.8\n  - @smithy/property-provider@4.2.8\n  - @smithy/smithy-client@4.10.7\n\n## 4.2.23\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.6\n\n## 4.2.22\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.5\n\n## 4.2.21\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.4\n\n## 4.2.20\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.3\n\n## 4.2.19\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/config-resolver@4.4.5\n  - @smithy/credential-provider-imds@4.2.7\n  - @smithy/node-config-provider@4.3.7\n  - @smithy/property-provider@4.2.7\n  - @smithy/smithy-client@4.10.2\n\n## 4.2.18\n\n### Patch Changes\n\n- Updated dependencies [f3a51c2]\n  - @smithy/smithy-client@4.10.1\n\n## 4.2.17\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/smithy-client@4.10.0\n  - @smithy/types@4.10.0\n  - @smithy/config-resolver@4.4.4\n  - @smithy/credential-provider-imds@4.2.6\n  - @smithy/node-config-provider@4.3.6\n  - @smithy/property-provider@4.2.6\n\n## 4.2.16\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.10\n\n## 4.2.15\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.9\n\n## 4.2.14\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.8\n\n## 4.2.13\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.7\n\n## 4.2.12\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.6\n\n## 4.2.11\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.5\n\n## 4.2.10\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.4\n\n## 4.2.9\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/config-resolver@4.4.3\n  - @smithy/credential-provider-imds@4.2.5\n  - @smithy/node-config-provider@4.3.5\n  - @smithy/property-provider@4.2.5\n  - @smithy/smithy-client@4.9.3\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [372b46f]\n  - @smithy/config-resolver@4.4.2\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/config-resolver@4.4.1\n  - @smithy/credential-provider-imds@4.2.4\n  - @smithy/node-config-provider@4.3.4\n  - @smithy/property-provider@4.2.4\n  - @smithy/smithy-client@4.9.2\n\n## 4.2.6\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.1\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [13c5cd9]\n  - @smithy/config-resolver@4.4.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/smithy-client@4.9.0\n  - @smithy/types@4.8.0\n  - @smithy/config-resolver@4.3.3\n  - @smithy/credential-provider-imds@4.2.3\n  - @smithy/node-config-provider@4.3.3\n  - @smithy/property-provider@4.2.3\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/smithy-client@4.8.1\n  - @smithy/config-resolver@4.3.2\n  - @smithy/credential-provider-imds@4.2.2\n  - @smithy/node-config-provider@4.3.2\n  - @smithy/property-provider@4.2.2\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/smithy-client@4.8.0\n  - @smithy/config-resolver@4.3.1\n  - @smithy/credential-provider-imds@4.2.1\n  - @smithy/node-config-provider@4.3.1\n  - @smithy/property-provider@4.2.1\n\n## 4.2.1\n\n### Patch Changes\n\n- @smithy/smithy-client@4.7.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/config-resolver@4.3.0\n  - @smithy/credential-provider-imds@4.2.0\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/property-provider@4.2.0\n  - @smithy/smithy-client@4.7.0\n  - @smithy/types@4.6.0\n\n## 4.1.5\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.5\n\n## 4.1.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.4\n\n## 4.1.3\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.3\n\n## 4.1.2\n\n### Patch Changes\n\n- @smithy/node-config-provider@4.2.2\n- @smithy/smithy-client@4.6.2\n- @smithy/config-resolver@4.2.2\n- @smithy/credential-provider-imds@4.1.2\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/config-resolver@4.2.1\n  - @smithy/credential-provider-imds@4.1.1\n  - @smithy/node-config-provider@4.2.1\n  - @smithy/property-provider@4.1.1\n  - @smithy/smithy-client@4.6.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/credential-provider-imds@4.1.0\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/property-provider@4.1.0\n  - @smithy/config-resolver@4.2.0\n  - @smithy/smithy-client@4.6.0\n  - @smithy/types@4.4.0\n\n## 4.0.29\n\n### Patch Changes\n\n- @smithy/smithy-client@4.5.2\n\n## 4.0.28\n\n### Patch Changes\n\n- @smithy/smithy-client@4.5.1\n\n## 4.0.27\n\n### Patch Changes\n\n- Updated dependencies [eb1ab40]\n  - @smithy/smithy-client@4.5.0\n\n## 4.0.26\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/smithy-client@4.4.10\n  - @smithy/config-resolver@4.1.5\n  - @smithy/credential-provider-imds@4.0.7\n  - @smithy/node-config-provider@4.1.4\n  - @smithy/property-provider@4.0.5\n\n## 4.0.25\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.9\n\n## 4.0.24\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.8\n\n## 4.0.23\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.7\n\n## 4.0.22\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.6\n\n## 4.0.21\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.5\n\n## 4.0.20\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.4\n\n## 4.0.19\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.3\n\n## 4.0.18\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.2\n\n## 4.0.17\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/config-resolver@4.1.4\n  - @smithy/credential-provider-imds@4.0.6\n  - @smithy/node-config-provider@4.1.3\n  - @smithy/property-provider@4.0.4\n  - @smithy/smithy-client@4.4.1\n\n## 4.0.16\n\n### Patch Changes\n\n- Updated dependencies [23812a9]\n  - @smithy/smithy-client@4.4.0\n\n## 4.0.15\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n- Updated dependencies [06b0ce8]\n  - @smithy/types@4.3.0\n  - @smithy/smithy-client@4.3.0\n  - @smithy/config-resolver@4.1.3\n  - @smithy/credential-provider-imds@4.0.5\n  - @smithy/node-config-provider@4.1.2\n  - @smithy/property-provider@4.0.3\n\n## 4.0.14\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.6\n\n## 4.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.5\n\n## 4.0.12\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n  - @smithy/config-resolver@4.1.2\n  - @smithy/credential-provider-imds@4.0.4\n  - @smithy/smithy-client@4.2.4\n\n## 4.0.11\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n  - @smithy/config-resolver@4.1.1\n  - @smithy/credential-provider-imds@4.0.3\n  - @smithy/smithy-client@4.2.3\n\n## 4.0.10\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.2\n\n## 4.0.9\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.1\n\n## 4.0.8\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/config-resolver@4.1.0\n  - @smithy/smithy-client@4.2.0\n  - @smithy/types@4.2.0\n  - @smithy/credential-provider-imds@4.0.2\n  - @smithy/node-config-provider@4.0.2\n  - @smithy/property-provider@4.0.2\n\n## 4.0.7\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.6\n\n## 4.0.6\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.5\n\n## 4.0.5\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.4\n\n## 4.0.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.3\n\n## 4.0.3\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.2\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e87f2b3]\n  - @smithy/smithy-client@4.1.1\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n- Updated dependencies [292c134]\n  - @smithy/types@4.1.0\n  - @smithy/smithy-client@4.1.0\n  - @smithy/config-resolver@4.0.1\n  - @smithy/credential-provider-imds@4.0.1\n  - @smithy/node-config-provider@4.0.1\n  - @smithy/property-provider@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/credential-provider-imds@4.0.0\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/config-resolver@4.0.0\n  - @smithy/smithy-client@4.0.0\n  - @smithy/property-provider@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.34\n\n### Patch Changes\n\n- Updated dependencies [a0e71d5]\n  - @smithy/smithy-client@3.7.0\n\n## 3.0.33\n\n### Patch Changes\n\n- Updated dependencies [23129d9]\n  - @smithy/smithy-client@3.6.0\n\n## 3.0.32\n\n### Patch Changes\n\n- @smithy/smithy-client@3.5.2\n\n## 3.0.31\n\n### Patch Changes\n\n- Updated dependencies [7f17426]\n  - @smithy/smithy-client@3.5.1\n\n## 3.0.30\n\n### Patch Changes\n\n- Updated dependencies [70275bd]\n  - @smithy/smithy-client@3.5.0\n\n## 3.0.29\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/config-resolver@3.0.13\n  - @smithy/credential-provider-imds@3.2.8\n  - @smithy/node-config-provider@3.1.12\n  - @smithy/property-provider@3.1.11\n  - @smithy/smithy-client@3.4.6\n\n## 3.0.28\n\n### Patch Changes\n\n- @smithy/smithy-client@3.4.5\n\n## 3.0.27\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/config-resolver@3.0.12\n  - @smithy/credential-provider-imds@3.2.7\n  - @smithy/node-config-provider@3.1.11\n  - @smithy/property-provider@3.1.10\n  - @smithy/smithy-client@3.4.4\n\n## 3.0.26\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/smithy-client@3.4.3\n  - @smithy/config-resolver@3.0.11\n  - @smithy/credential-provider-imds@3.2.6\n  - @smithy/node-config-provider@3.1.10\n  - @smithy/property-provider@3.1.9\n\n## 3.0.25\n\n### Patch Changes\n\n- @smithy/smithy-client@3.4.2\n\n## 3.0.24\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n  - @smithy/types@3.6.0\n  - @smithy/smithy-client@3.4.1\n  - @smithy/config-resolver@3.0.10\n  - @smithy/credential-provider-imds@3.2.5\n  - @smithy/node-config-provider@3.1.9\n  - @smithy/property-provider@3.1.8\n\n## 3.0.23\n\n### Patch Changes\n\n- Updated dependencies [75e0125]\n  - @smithy/smithy-client@3.4.0\n\n## 3.0.22\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/config-resolver@3.0.9\n  - @smithy/credential-provider-imds@3.2.4\n  - @smithy/node-config-provider@3.1.8\n  - @smithy/property-provider@3.1.7\n  - @smithy/smithy-client@3.3.6\n\n## 3.0.21\n\n### Patch Changes\n\n- Updated dependencies [64600d8]\n  - @smithy/smithy-client@3.3.5\n\n## 3.0.20\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.4\n\n## 3.0.19\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.3\n\n## 3.0.18\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/config-resolver@3.0.8\n  - @smithy/credential-provider-imds@3.2.3\n  - @smithy/node-config-provider@3.1.7\n  - @smithy/property-provider@3.1.6\n  - @smithy/smithy-client@3.3.2\n\n## 3.0.17\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/config-resolver@3.0.7\n  - @smithy/credential-provider-imds@3.2.2\n  - @smithy/node-config-provider@3.1.6\n  - @smithy/property-provider@3.1.5\n  - @smithy/smithy-client@3.3.1\n\n## 3.0.16\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [d8df7bf]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/smithy-client@3.3.0\n  - @smithy/config-resolver@3.0.6\n  - @smithy/credential-provider-imds@3.2.1\n  - @smithy/node-config-provider@3.1.5\n  - @smithy/property-provider@3.1.4\n\n## 3.0.15\n\n### Patch Changes\n\n- Updated dependencies [5865b65]\n  - @smithy/smithy-client@3.2.0\n\n## 3.0.14\n\n### Patch Changes\n\n- Updated dependencies [670553a]\n  - @smithy/smithy-client@3.1.12\n\n## 3.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.11\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [3d72b04]\n  - @smithy/credential-provider-imds@3.2.0\n  - @smithy/smithy-client@3.1.10\n\n## 3.0.11\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.9\n\n## 3.0.10\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.8\n\n## 3.0.9\n\n### Patch Changes\n\n- @smithy/node-config-provider@3.1.4\n- @smithy/smithy-client@3.1.7\n- @smithy/config-resolver@3.0.5\n- @smithy/credential-provider-imds@3.1.4\n\n## 3.0.8\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.6\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/config-resolver@3.0.4\n  - @smithy/credential-provider-imds@3.1.3\n  - @smithy/node-config-provider@3.1.3\n  - @smithy/property-provider@3.1.3\n  - @smithy/smithy-client@3.1.5\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/config-resolver@3.0.3\n  - @smithy/credential-provider-imds@3.1.2\n  - @smithy/node-config-provider@3.1.2\n  - @smithy/property-provider@3.1.2\n  - @smithy/smithy-client@3.1.4\n\n## 3.0.5\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.3\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/config-resolver@3.0.2\n  - @smithy/credential-provider-imds@3.1.1\n  - @smithy/node-config-provider@3.1.1\n  - @smithy/property-provider@3.1.1\n  - @smithy/smithy-client@3.1.2\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [3689c949]\n  - @smithy/smithy-client@3.1.1\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n- Updated dependencies [764047eb]\n  - @smithy/credential-provider-imds@3.1.0\n  - @smithy/node-config-provider@3.1.0\n  - @smithy/property-provider@3.1.0\n  - @smithy/smithy-client@3.1.0\n  - @smithy/config-resolver@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- @smithy/smithy-client@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/credential-provider-imds@3.0.0\n  - @smithy/node-config-provider@3.0.0\n  - @smithy/property-provider@3.0.0\n  - @smithy/config-resolver@3.0.0\n  - @smithy/smithy-client@3.0.0\n\n## 2.3.1\n\n### Patch Changes\n\n- @smithy/smithy-client@2.5.1\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/credential-provider-imds@2.3.0\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/property-provider@2.2.0\n  - @smithy/config-resolver@2.2.0\n  - @smithy/smithy-client@2.5.0\n  - @smithy/types@2.12.0\n\n## 2.2.7\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.5\n\n## 2.2.6\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.4\n\n## 2.2.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/config-resolver@2.1.5\n  - @smithy/credential-provider-imds@2.2.6\n  - @smithy/node-config-provider@2.2.5\n  - @smithy/property-provider@2.1.4\n  - @smithy/smithy-client@2.4.3\n\n## 2.2.4\n\n### Patch Changes\n\n- Updated dependencies [eea7af7d]\n- Updated dependencies [e136eb93]\n  - @smithy/credential-provider-imds@2.2.5\n\n## 2.2.3\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.2.4\n- @smithy/smithy-client@2.4.2\n- @smithy/config-resolver@2.1.4\n- @smithy/credential-provider-imds@2.2.4\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/config-resolver@2.1.3\n  - @smithy/credential-provider-imds@2.2.3\n  - @smithy/node-config-provider@2.2.3\n  - @smithy/property-provider@2.1.3\n  - @smithy/smithy-client@2.4.1\n\n## 2.2.1\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/smithy-client@2.4.0\n  - @smithy/config-resolver@2.1.2\n  - @smithy/credential-provider-imds@2.2.2\n  - @smithy/node-config-provider@2.2.2\n  - @smithy/property-provider@2.1.2\n\n## 2.2.0\n\n### Minor Changes\n\n- 280ef3a9: defer loading of credential-provider-imds in util-defaults-mode-node\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/config-resolver@2.1.1\n  - @smithy/credential-provider-imds@2.2.1\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/property-provider@2.1.1\n  - @smithy/smithy-client@2.3.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/credential-provider-imds@2.2.0\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/property-provider@2.1.0\n  - @smithy/config-resolver@2.1.0\n  - @smithy/smithy-client@2.3.0\n  - @smithy/types@2.9.0\n\n## 2.0.32\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/smithy-client@2.2.1\n  - @smithy/config-resolver@2.0.23\n  - @smithy/credential-provider-imds@2.1.5\n  - @smithy/node-config-provider@2.1.9\n  - @smithy/property-provider@2.0.17\n\n## 2.0.31\n\n### Patch Changes\n\n- @smithy/config-resolver@2.0.22\n\n## 2.0.30\n\n### Patch Changes\n\n- Updated dependencies [164f3bbd]\n- Updated dependencies [164f3bbd]\n  - @smithy/smithy-client@2.2.0\n\n## 2.0.29\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.8\n- @smithy/config-resolver@2.0.21\n- @smithy/credential-provider-imds@2.1.4\n\n## 2.0.28\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.18\n\n## 2.0.27\n\n### Patch Changes\n\n- Updated dependencies [07ff207b]\n- Updated dependencies [340634a5]\n  - @smithy/smithy-client@2.1.17\n  - @smithy/types@2.7.0\n  - @smithy/config-resolver@2.0.20\n  - @smithy/credential-provider-imds@2.1.3\n  - @smithy/node-config-provider@2.1.7\n  - @smithy/property-provider@2.0.16\n\n## 2.0.26\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/config-resolver@2.0.19\n  - @smithy/credential-provider-imds@2.1.2\n  - @smithy/node-config-provider@2.1.6\n  - @smithy/property-provider@2.0.15\n  - @smithy/smithy-client@2.1.16\n\n## 2.0.25\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/config-resolver@2.0.18\n  - @smithy/credential-provider-imds@2.1.1\n  - @smithy/node-config-provider@2.1.5\n  - @smithy/property-provider@2.0.14\n  - @smithy/smithy-client@2.1.15\n\n## 2.0.24\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.14\n\n## 2.0.23\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.13\n\n## 2.0.22\n\n### Patch Changes\n\n- Updated dependencies [4693031d]\n  - @smithy/credential-provider-imds@2.1.0\n  - @smithy/node-config-provider@2.1.4\n  - @smithy/config-resolver@2.0.17\n\n## 2.0.21\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/config-resolver@2.0.16\n  - @smithy/credential-provider-imds@2.0.18\n  - @smithy/node-config-provider@2.1.3\n  - @smithy/property-provider@2.0.13\n  - @smithy/smithy-client@2.1.12\n\n## 2.0.20\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.2\n- @smithy/config-resolver@2.0.15\n- @smithy/credential-provider-imds@2.0.17\n\n## 2.0.19\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.11\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/config-resolver@2.0.14\n  - @smithy/credential-provider-imds@2.0.16\n  - @smithy/node-config-provider@2.1.1\n  - @smithy/property-provider@2.0.12\n  - @smithy/smithy-client@2.1.10\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [7b568c39]\n  - @smithy/node-config-provider@2.1.0\n  - @smithy/config-resolver@2.0.13\n  - @smithy/credential-provider-imds@2.0.15\n\n## 2.0.16\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.14\n- @smithy/config-resolver@2.0.12\n- @smithy/credential-provider-imds@2.0.14\n\n## 2.0.15\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.9\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/smithy-client@2.1.8\n  - @smithy/config-resolver@2.0.11\n  - @smithy/credential-provider-imds@2.0.13\n  - @smithy/node-config-provider@2.0.13\n  - @smithy/property-provider@2.0.11\n\n## 2.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.7\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/smithy-client@2.1.6\n  - @smithy/config-resolver@2.0.10\n  - @smithy/credential-provider-imds@2.0.12\n  - @smithy/node-config-provider@2.0.12\n  - @smithy/property-provider@2.0.10\n\n## 2.0.11\n\n### Patch Changes\n\n- e6ea6bd5: move devDeps into deps\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/config-resolver@2.0.9\n  - @smithy/credential-provider-imds@2.0.11\n  - @smithy/node-config-provider@2.0.11\n  - @smithy/property-provider@2.0.9\n  - @smithy/smithy-client@2.1.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/config-resolver@2.0.8\n  - @smithy/credential-provider-imds@2.0.10\n  - @smithy/node-config-provider@2.0.10\n  - @smithy/property-provider@2.0.8\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [d3daa891]\n  - @smithy/config-resolver@2.0.7\n  - @smithy/node-config-provider@2.0.9\n  - @smithy/credential-provider-imds@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/config-resolver@2.0.6\n  - @smithy/credential-provider-imds@2.0.8\n  - @smithy/node-config-provider@2.0.8\n  - @smithy/property-provider@2.0.7\n\n## 2.0.7\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.7\n- @smithy/config-resolver@2.0.5\n- @smithy/credential-provider-imds@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [a7598a5d]\n  - @smithy/property-provider@2.0.6\n  - @smithy/credential-provider-imds@2.0.6\n  - @smithy/node-config-provider@2.0.6\n  - @smithy/config-resolver@2.0.5\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/config-resolver@2.0.5\n  - @smithy/credential-provider-imds@2.0.5\n  - @smithy/node-config-provider@2.0.5\n  - @smithy/property-provider@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/config-resolver@2.0.4\n  - @smithy/credential-provider-imds@2.0.4\n  - @smithy/node-config-provider@2.0.4\n  - @smithy/property-provider@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/config-resolver@2.0.3\n  - @smithy/credential-provider-imds@2.0.3\n  - @smithy/node-config-provider@2.0.3\n  - @smithy/property-provider@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/config-resolver@2.0.2\n  - @smithy/credential-provider-imds@2.0.2\n  - @smithy/node-config-provider@2.0.2\n  - @smithy/property-provider@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/config-resolver@2.0.1\n  - @smithy/credential-provider-imds@2.0.1\n  - @smithy/node-config-provider@2.0.1\n  - @smithy/property-provider@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/config-resolver@2.0.0\n  - @smithy/credential-provider-imds@2.0.0\n  - @smithy/node-config-provider@2.0.0\n  - @smithy/property-provider@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/config-resolver@1.1.0\n  - @smithy/credential-provider-imds@1.1.0\n  - @smithy/node-config-provider@1.1.0\n  - @smithy/property-provider@1.2.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [4ad43c6a]\n- Updated dependencies [d90a45b5]\n- Updated dependencies [5f7bcc79]\n  - @smithy/types@2.0.0\n  - @smithy/property-provider@1.1.0\n  - @smithy/config-resolver@1.0.3\n  - @smithy/credential-provider-imds@1.0.3\n  - @smithy/node-config-provider@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/credential-provider-imds@1.0.2\n  - @smithy/node-config-provider@1.0.2\n  - @smithy/property-provider@1.0.2\n  - @smithy/config-resolver@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/credential-provider-imds@1.0.1\n  - @smithy/node-config-provider@1.0.1\n  - @smithy/property-provider@1.0.1\n  - @smithy/config-resolver@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-defaults-mode-node](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-defaults-mode-node/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/constants.ts",
    "content": "/**\n * @internal\n */\nexport const AWS_EXECUTION_ENV = \"AWS_EXECUTION_ENV\";\n/**\n * @internal\n */\nexport const AWS_REGION_ENV = \"AWS_REGION\";\n/**\n * @internal\n */\nexport const AWS_DEFAULT_REGION_ENV = \"AWS_DEFAULT_REGION\";\n/**\n * @internal\n */\nexport const ENV_IMDS_DISABLED = \"AWS_EC2_METADATA_DISABLED\";\n/**\n * @internal\n */\nexport const DEFAULTS_MODE_OPTIONS = [\"in-region\", \"cross-region\", \"mobile\", \"standard\", \"legacy\"];\n/**\n * @internal\n */\nexport const IMDS_REGION_PATH = \"/latest/meta-data/placement/region\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/defaultsModeConfig.ts",
    "content": "import type { DefaultsMode } from \"@smithy/core/client\";\n\nimport type { LoadedConfigSelectors } from \"../node-config-provider/configLoader\";\n\nconst AWS_DEFAULTS_MODE_ENV = \"AWS_DEFAULTS_MODE\";\nconst AWS_DEFAULTS_MODE_CONFIG = \"defaults_mode\";\n\n/**\n * @internal\n */\nexport const NODE_DEFAULTS_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<DefaultsMode> = {\n  environmentVariableSelector: (env) => {\n    return env[AWS_DEFAULTS_MODE_ENV] as DefaultsMode;\n  },\n  configFileSelector: (profile) => {\n    return profile[AWS_DEFAULTS_MODE_CONFIG] as DefaultsMode;\n  },\n  default: \"legacy\",\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/resolveDefaultsModeConfig.browser.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { DEFAULTS_MODE_OPTIONS } from \"./constants\";\nimport { resolveDefaultsModeConfig } from \"./resolveDefaultsModeConfig.browser\";\n\n/**\n * @internal\n */\ntype NavigatorTestAugment = Navigator & {\n  userAgentData?: {\n    mobile?: boolean;\n  };\n  connection?: {\n    effectiveType?: \"4g\" | string;\n    rtt?: number;\n    downlink?: number;\n  };\n};\n\ndescribe(\"resolveDefaultsModeConfig\", () => {\n  const uaSpy = vi.spyOn(window.navigator, \"userAgent\", \"get\").mockReturnValue(\"some UA\");\n\n  beforeEach(() => {\n    const navigator = window.navigator as NavigatorTestAugment;\n    if (!navigator.userAgentData || !navigator.connection) {\n      navigator.userAgentData = {};\n      navigator.connection = {};\n    }\n  });\n\n  afterEach(() => {\n    const navigator = window.navigator as NavigatorTestAugment;\n    delete navigator.userAgentData;\n    delete navigator.connection;\n    uaSpy.mockClear();\n  });\n\n  it(\"should default to legacy\", async () => {\n    expect(await resolveDefaultsModeConfig({})()).toBe(\"legacy\");\n    expect(await resolveDefaultsModeConfig()()).toBe(\"legacy\");\n  });\n\n  it.each(DEFAULTS_MODE_OPTIONS)(\"should resolve %s mode\", async (mode) => {\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(mode as any) })()).toBe(mode);\n  });\n\n  it(\"should resolve auto mode to mobile if platform is mobile\", async () => {\n    vi.spyOn(window.navigator as NavigatorTestAugment, \"userAgentData\", \"get\").mockReturnValue({\n      mobile: true,\n    });\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(\"auto\") })()).toBe(\"mobile\");\n  });\n\n  it(\"should resolve auto mode to mobile if connection is not 4g (5g is not possible in this enum)\", async () => {\n    vi.spyOn(window.navigator as NavigatorTestAugment, \"connection\", \"get\").mockReturnValue({\n      effectiveType: \"3g\",\n    });\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(\"auto\") })()).toBe(\"mobile\");\n  });\n\n  it(\"should resolve auto mode to standard if platform not mobile or tablet\", async () => {\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(\"auto\") })()).toBe(\"standard\");\n  });\n\n  it(\"should memoize the response\", async () => {\n    const defaultsMode = resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(\"auto\") });\n    await defaultsMode();\n    const spyInvokeCount = uaSpy.mock.calls.length;\n    await defaultsMode();\n    expect(uaSpy).toBeCalledTimes(spyInvokeCount);\n  });\n\n  it.each([\"invalid\", \"abc\"])(\"should throw for invalid value %s\", async (mode) => {\n    try {\n      await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(mode as any) })();\n      fail(\"should throw for invalid modes\");\n    } catch (e) {\n      expect(e.message).toContain(\"Invalid parameter\");\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/resolveDefaultsModeConfig.browser.ts",
    "content": "import type { DefaultsMode, ResolvedDefaultsMode } from \"@smithy/core/client\";\nimport type { Provider } from \"@smithy/types\";\n\nimport { memoize } from \"../property-provider/memoize\";\nimport { DEFAULTS_MODE_OPTIONS } from \"./constants\";\n\n/**\n * @internal\n */\nexport interface ResolveDefaultsModeConfigOptions {\n  defaultsMode?: DefaultsMode | Provider<DefaultsMode>;\n}\n\n/**\n * Validate the defaultsMode configuration. If the value is set to \"auto\", it\n * resolves the value to \"mobile\" if the app is running in a mobile browser,\n * otherwise it resolves to \"standard\".\n *\n * @default \"legacy\"\n * @internal\n */\nexport const resolveDefaultsModeConfig = ({\n  defaultsMode,\n}: ResolveDefaultsModeConfigOptions = {}): Provider<ResolvedDefaultsMode> =>\n  memoize(async () => {\n    const mode = typeof defaultsMode === \"function\" ? await defaultsMode() : defaultsMode;\n    switch (mode?.toLowerCase()) {\n      case \"auto\":\n        return Promise.resolve(useMobileConfiguration() ? \"mobile\" : \"standard\");\n      case \"mobile\":\n      case \"in-region\":\n      case \"cross-region\":\n      case \"standard\":\n      case \"legacy\":\n        return Promise.resolve(mode?.toLocaleLowerCase() as ResolvedDefaultsMode);\n      case undefined:\n        return Promise.resolve(\"legacy\");\n      default:\n        throw new Error(\n          `Invalid parameter for \"defaultsMode\", expect ${DEFAULTS_MODE_OPTIONS.join(\", \")}, got ${mode}`\n        );\n    }\n  });\n\n/**\n * @internal\n */\ntype NavigatorAugment = {\n  userAgentData?: {\n    mobile?: boolean;\n  };\n  connection?: {\n    effectiveType?: \"4g\" | string;\n    rtt?: number;\n    downlink?: number;\n  };\n};\n\n/**\n * The aim of the mobile detection function is not really to know whether the device is a mobile device.\n * This is emphasized in the modern guidance on browser detection that feature detection is correct\n * whereas UA \"sniffing\" is usually a mistake.\n *\n * So then, the underlying reason we are trying to detect a mobile device is not for any particular device feature,\n * but rather the implied network speed available to the program (we use it to set a default request timeout value).\n *\n * Therefore, it is better to use network speed related feature detection when available. This also saves\n * 20kb (minified) from the bowser dependency we were using.\n *\n * @internal\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Browser_detection_using_the_user_agent\n */\nconst useMobileConfiguration = (): boolean => {\n  const navigator = window?.navigator as (typeof window.navigator & NavigatorAugment) | undefined;\n  if (navigator?.connection) {\n    // https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType\n    // The maximum will report as 4g, regardless of 5g or further developments.\n    const { effectiveType, rtt, downlink } = navigator?.connection;\n    const slow =\n      (typeof effectiveType === \"string\" && effectiveType !== \"4g\") || Number(rtt) > 100 || Number(downlink) < 10;\n    if (slow) {\n      return true;\n    }\n  }\n\n  // without the networkInformation object, we use the userAgentData or touch feature detection as a proxy.\n  return (\n    navigator?.userAgentData?.mobile || (typeof navigator?.maxTouchPoints === \"number\" && navigator?.maxTouchPoints > 1)\n  );\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/resolveDefaultsModeConfig.native.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { DEFAULTS_MODE_OPTIONS } from \"./constants\";\nimport { resolveDefaultsModeConfig } from \"./resolveDefaultsModeConfig.native\";\n\ndescribe(\"resolveDefaultsModeConfig\", () => {\n  it(\"should default to legacy\", async () => {\n    expect(await resolveDefaultsModeConfig({})()).toBe(\"legacy\");\n    expect(await resolveDefaultsModeConfig()()).toBe(\"legacy\");\n  });\n\n  it(\"should resolve auto to mobile\", async () => {\n    expect(await resolveDefaultsModeConfig({ defaultsMode: \"auto\" })()).toBe(\"mobile\");\n  });\n\n  it.each(DEFAULTS_MODE_OPTIONS)(\"should resolve %s mode\", async (mode) => {\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(mode as any) })()).toBe(mode);\n  });\n\n  it.each([\"invalid\", \"abc\"])(\"should throw for invalid value %s\", async (mode) => {\n    try {\n      await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(mode as any) })();\n      fail(\"should throw for invalid modes\");\n    } catch (e) {\n      expect(e.message).toContain(\"Invalid parameter\");\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/resolveDefaultsModeConfig.native.ts",
    "content": "import type { DefaultsMode, ResolvedDefaultsMode } from \"@smithy/core/client\";\nimport type { Provider } from \"@smithy/types\";\n\nimport { memoize } from \"../property-provider/memoize\";\nimport { DEFAULTS_MODE_OPTIONS } from \"./constants\";\n\n/**\n * @internal\n */\nexport interface ResolveDefaultsModeConfigOptions {\n  defaultsMode?: DefaultsMode | Provider<DefaultsMode>;\n}\n\n/**\n * Validate the defaultsMode configuration. If the value is set to \"auto\", it\n * resolves the value to \"mobile\".\n *\n * @default \"legacy\"\n * @internal\n */\nexport const resolveDefaultsModeConfig = ({\n  defaultsMode,\n}: ResolveDefaultsModeConfigOptions = {}): Provider<ResolvedDefaultsMode> =>\n  memoize(async () => {\n    const mode = typeof defaultsMode === \"function\" ? await defaultsMode() : defaultsMode;\n    switch (mode?.toLowerCase()) {\n      case \"auto\":\n        // Because this function is only exists in React Native, so it only resolves to \"mobile\"\n        // when defaultsMode set to \"auto\".\n        return Promise.resolve(\"mobile\");\n      case \"mobile\":\n      case \"in-region\":\n      case \"cross-region\":\n      case \"standard\":\n      case \"legacy\":\n        return Promise.resolve(mode?.toLocaleLowerCase() as ResolvedDefaultsMode);\n      case undefined:\n        return Promise.resolve(\"legacy\");\n      default:\n        throw new Error(\n          `Invalid parameter for \"defaultsMode\", expect ${DEFAULTS_MODE_OPTIONS.join(\", \")}, got ${mode}`\n        );\n    }\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/resolveDefaultsModeConfig.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { NODE_REGION_CONFIG_OPTIONS } from \"../config-resolver/regionConfig/config\";\nimport * as NodeConfigProvider from \"../node-config-provider/configLoader\";\nimport {\n  AWS_DEFAULT_REGION_ENV,\n  AWS_EXECUTION_ENV,\n  AWS_REGION_ENV,\n  DEFAULTS_MODE_OPTIONS,\n  ENV_IMDS_DISABLED,\n  IMDS_REGION_PATH,\n} from \"./constants\";\nimport { NODE_DEFAULTS_MODE_CONFIG_OPTIONS } from \"./defaultsModeConfig\";\nimport { resolveDefaultsModeConfig } from \"./resolveDefaultsModeConfig\";\n\nvi.mock(\"../node-config-provider/configLoader\");\n\ndescribe(\"resolveDefaultsModeConfig\", () => {\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should default to legacy\", async () => {\n    expect(await resolveDefaultsModeConfig({})()).toBe(\"legacy\");\n    expect(await resolveDefaultsModeConfig()()).toBe(\"legacy\");\n  });\n\n  it.each(DEFAULTS_MODE_OPTIONS)(\"should resolve %s mode\", async (mode) => {\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(mode as any) })()).toBe(mode);\n  });\n\n  it.each([\"invalid\", \"abc\"])(\"should throw for invalid value %s\", async (mode) => {\n    try {\n      await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(mode as any) })();\n      fail(\"should throw for invalid modes\");\n    } catch (e) {\n      expect(e.message).toContain(\"Invalid parameter\");\n    }\n  });\n\n  it(\"should memoize the response\", async () => {\n    const providerMock = vi.fn().mockResolvedValue(\"legacy\");\n    const defaultsMode = resolveDefaultsModeConfig({ defaultsMode: providerMock });\n    await defaultsMode();\n    const mockInvokeCount = providerMock.mock.calls.length;\n    await defaultsMode();\n    expect(providerMock).toBeCalledTimes(mockInvokeCount);\n  });\n\n  it(\"should resolve client region from Node config provider chain\", async () => {\n    const loadConfigMock = NodeConfigProvider.loadConfig as any;\n    loadConfigMock.mockReturnValueOnce(undefined);\n    expect(await resolveDefaultsModeConfig({ defaultsMode: () => Promise.resolve(\"mobile\") })()).toBe(\"mobile\");\n    expect(loadConfigMock.mock.calls[0][0]).toBe(NODE_REGION_CONFIG_OPTIONS);\n  });\n\n  it(\"should resolve defaults mode from Node config provider chain\", async () => {\n    const loadConfigMock = NodeConfigProvider.loadConfig as any;\n    loadConfigMock.mockReturnValueOnce(\"us-west-2\").mockReturnValueOnce(\"mobile\");\n    expect(await resolveDefaultsModeConfig({})()).toBe(\"mobile\");\n    expect(loadConfigMock.mock.calls[1][0]).toBe(NODE_DEFAULTS_MODE_CONFIG_OPTIONS);\n  });\n\n  describe(\"auto mode inference\", () => {\n    const originalEnv = process.env;\n    beforeEach(() => {\n      process.env = {};\n    });\n\n    afterEach(() => {\n      process.env = originalEnv;\n    });\n\n    it(\"should use the AWS_REGION env when in an AWS service environment\", async () => {\n      process.env[AWS_EXECUTION_ENV] = \"aws-lambda\";\n      process.env[AWS_REGION_ENV] = \"us-west-2\";\n      expect(await resolveDefaultsModeConfig({ region: \"us-west-1\", defaultsMode: \"auto\" })()).toBe(\"cross-region\");\n      process.env[AWS_REGION_ENV] = \"us-west-1\";\n      expect(await resolveDefaultsModeConfig({ region: \"us-west-1\", defaultsMode: \"auto\" })()).toBe(\"in-region\");\n    });\n\n    it(\"should use the AWS_DEFAULT_REGION env when in an AWS service environment\", async () => {\n      process.env[AWS_EXECUTION_ENV] = \"aws-lambda\";\n      process.env[AWS_DEFAULT_REGION_ENV] = \"us-west-2\";\n      expect(await resolveDefaultsModeConfig({ region: \"us-west-1\", defaultsMode: \"auto\" })()).toBe(\"cross-region\");\n      process.env[AWS_DEFAULT_REGION_ENV] = \"us-west-1\";\n      expect(await resolveDefaultsModeConfig({ region: \"us-west-1\", defaultsMode: \"auto\" })()).toBe(\"in-region\");\n    });\n\n    it(`should skip calling IMDS if ${ENV_IMDS_DISABLED} is set`, async () => {\n      process.env[ENV_IMDS_DISABLED] = \"true\";\n      expect(await resolveDefaultsModeConfig({ region: \"us-west-1\", defaultsMode: \"auto\" })()).toBe(\"standard\");\n    });\n\n    it(\"should return standard when IMDS is unreachable\", async () => {\n      // No env vars set, IMDS will fail (no server running), should fall back to standard\n      expect(await resolveDefaultsModeConfig({ region: \"us-west-1\", defaultsMode: \"auto\" })()).toBe(\"standard\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/defaults-mode/resolveDefaultsModeConfig.ts",
    "content": "import type { IncomingMessage } from \"node:http\";\nimport type { DefaultsMode, ResolvedDefaultsMode } from \"@smithy/core/client\";\nimport type { Provider } from \"@smithy/types\";\n\nimport { NODE_REGION_CONFIG_OPTIONS } from \"../config-resolver/regionConfig/config\";\nimport { loadConfig } from \"../node-config-provider/configLoader\";\nimport { memoize } from \"../property-provider/memoize\";\nimport {\n  AWS_DEFAULT_REGION_ENV,\n  AWS_EXECUTION_ENV,\n  AWS_REGION_ENV,\n  DEFAULTS_MODE_OPTIONS,\n  ENV_IMDS_DISABLED,\n  IMDS_REGION_PATH,\n} from \"./constants\";\nimport { NODE_DEFAULTS_MODE_CONFIG_OPTIONS } from \"./defaultsModeConfig\";\n\n/**\n * @internal\n */\nexport interface ResolveDefaultsModeConfigOptions {\n  defaultsMode?: DefaultsMode | Provider<DefaultsMode>;\n  region?: string | Provider<string>;\n}\n\n/**\n * Validate the defaultsMode configuration. If the value is set to \"auto\", it\n * resolves the value to \"in-region\", \"cross-region\", or \"standard\".\n *\n * @default \"legacy\"\n * @internal\n */\nexport const resolveDefaultsModeConfig = ({\n  region = loadConfig(NODE_REGION_CONFIG_OPTIONS),\n  defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS),\n}: ResolveDefaultsModeConfigOptions = {}): Provider<ResolvedDefaultsMode> =>\n  memoize(async () => {\n    const mode = typeof defaultsMode === \"function\" ? await defaultsMode() : defaultsMode;\n    switch (mode?.toLowerCase()) {\n      case \"auto\":\n        return resolveNodeDefaultsModeAuto(region);\n      case \"in-region\":\n      case \"cross-region\":\n      case \"mobile\":\n      case \"standard\":\n      case \"legacy\":\n        return Promise.resolve(mode?.toLocaleLowerCase() as ResolvedDefaultsMode);\n      case undefined:\n        return Promise.resolve(\"legacy\");\n      default:\n        throw new Error(\n          `Invalid parameter for \"defaultsMode\", expect ${DEFAULTS_MODE_OPTIONS.join(\", \")}, got ${mode}`\n        );\n    }\n  });\n\nconst resolveNodeDefaultsModeAuto = async (clientRegion?: string | Provider<string>): Promise<ResolvedDefaultsMode> => {\n  if (clientRegion) {\n    const resolvedRegion = typeof clientRegion === \"function\" ? await clientRegion() : clientRegion;\n    const inferredRegion = await inferPhysicalRegion();\n    if (!inferredRegion) {\n      return \"standard\";\n    }\n    if (resolvedRegion === inferredRegion) {\n      return \"in-region\";\n    } else {\n      return \"cross-region\";\n    }\n  }\n  return \"standard\";\n};\n\n/**\n * Infer the hosting app's physical region.\n */\nconst inferPhysicalRegion = async (): Promise<string | undefined> => {\n  if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {\n    // We're running in an AWS service environment, so we can trust the region environment variables to be the current\n    // region, if they're set\n    return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];\n  }\n  if (!process.env[ENV_IMDS_DISABLED]) {\n    // We couldn't figure out the region from environment variables. Check IMDSv2\n    try {\n      const endpoint = await getImdsEndpoint();\n      return (await imdsHttpGet({ hostname: endpoint.hostname, path: IMDS_REGION_PATH })).toString();\n    } catch (e) {\n      // Swallow the error.\n    }\n  }\n};\n\n/**\n * Inlined from @smithy/credential-provider-imds to avoid circular dependency.\n */\nconst getImdsEndpoint = async (): Promise<{ hostname: string; path: string }> => {\n  const envEndpoint = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;\n  if (envEndpoint) {\n    const url = new URL(envEndpoint);\n    return { hostname: url.hostname, path: url.pathname };\n  }\n  const envMode = process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE;\n  if (envMode === \"IPv6\") {\n    return { hostname: \"fd00:ec2::254\", path: \"/\" };\n  }\n  return { hostname: \"169.254.169.254\", path: \"/\" };\n};\n\nconst imdsHttpGet = async ({ hostname, path }: { hostname: string; path: string }): Promise<Buffer> => {\n  const { request } = await import(\"node:http\");\n  return new Promise((resolve, reject) => {\n    const req = request({\n      method: \"GET\",\n      hostname: hostname.replace(/^\\[(.+)]$/, \"$1\"),\n      path,\n      timeout: 1000,\n      signal: AbortSignal.timeout(1000),\n    });\n    req.on(\"error\", (err: Error) => {\n      reject(err);\n      req.destroy();\n    });\n    req.on(\"timeout\", () => {\n      reject(new Error(\"TimeoutError from instance metadata service\"));\n      req.destroy();\n    });\n    req.on(\"response\", (res: IncomingMessage) => {\n      const { statusCode = 400 } = res;\n      if (statusCode < 200 || 300 <= statusCode) {\n        reject(Object.assign(new Error(\"Error response received from instance metadata service\"), { statusCode }));\n        req.destroy();\n        return;\n      }\n      const chunks: Buffer[] = [];\n      res.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n      res.on(\"end\", () => {\n        resolve(Buffer.concat(chunks));\n        req.destroy();\n      });\n    });\n    req.end();\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/index.browser.ts",
    "content": "const no = Symbol.for(\"node-only\");\n\n// @smithy/property-provider\nexport { ProviderError, type ProviderErrorOptionsType } from \"./property-provider/ProviderError\";\nexport { CredentialsProviderError } from \"./property-provider/CredentialsProviderError\";\nexport { TokenProviderError } from \"./property-provider/TokenProviderError\";\nexport { chain } from \"./property-provider/chain\";\nexport { fromValue } from \"./property-provider/fromValue\";\nexport { memoize } from \"./property-provider/memoize\";\n\n// @smithy/util-config-provider\nexport { booleanSelector } from \"./util-config-provider/booleanSelector\";\nexport { numberSelector } from \"./util-config-provider/numberSelector\";\nexport { SelectorType } from \"./util-config-provider/types\";\n\n// @smithy/shared-ini-file-loader\nexport const getHomeDir = no;\nexport const ENV_PROFILE = no;\nexport const DEFAULT_PROFILE = \"default\";\nexport const getProfileName = no;\nexport const getSSOTokenFilepath = no;\nexport const getSSOTokenFromFile = no;\nexport const CONFIG_PREFIX_SEPARATOR = no;\nexport const loadSharedConfigFiles = no;\nexport const loadSsoSessionData = no;\nexport const parseKnownFiles = no;\nexport const externalDataInterceptor = no;\nexport const readFile = no;\nexport type { SSOToken } from \"./shared-ini-file-loader/getSSOTokenFromFile\";\nexport type { SharedConfigInit } from \"./shared-ini-file-loader/loadSharedConfigFiles\";\nexport type { SsoSessionInit } from \"./shared-ini-file-loader/loadSsoSessionData\";\nexport type { SourceProfileInit } from \"./shared-ini-file-loader/parseKnownFiles\";\nexport type { Profile, ParsedIniData, SharedConfigFiles } from \"./shared-ini-file-loader/types\";\nexport type { ReadFileOptions } from \"./shared-ini-file-loader/readFile\";\n\n// @smithy/node-config-provider\nexport const loadConfig = no;\nexport const fromStatic = no;\nexport type { LocalConfigOptions, LoadedConfigSelectors } from \"./node-config-provider/configLoader\";\nexport type { EnvOptions, GetterFromEnv } from \"./node-config-provider/fromEnv\";\nexport type { NodeSharedConfigInit, GetterFromConfig } from \"./node-config-provider/fromSharedConfigFiles\";\n\n// @smithy/config-resolver\nexport const ENV_USE_DUALSTACK_ENDPOINT = no;\nexport const CONFIG_USE_DUALSTACK_ENDPOINT = no;\nexport const DEFAULT_USE_DUALSTACK_ENDPOINT = false;\nexport const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = no;\nexport const nodeDualstackConfigSelectors = no;\nexport const ENV_USE_FIPS_ENDPOINT = no;\nexport const CONFIG_USE_FIPS_ENDPOINT = no;\nexport const DEFAULT_USE_FIPS_ENDPOINT = false;\nexport const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = no;\nexport const nodeFipsConfigSelectors = no;\nexport {\n  resolveCustomEndpointsConfig,\n  type CustomEndpointsInputConfig,\n  type CustomEndpointsResolvedConfig,\n} from \"./config-resolver/endpointsConfig/resolveCustomEndpointsConfig\";\nexport {\n  resolveEndpointsConfig,\n  type EndpointsInputConfig,\n  type EndpointsResolvedConfig,\n} from \"./config-resolver/endpointsConfig/resolveEndpointsConfig\";\n\n// @smithy/config-resolver\nexport const REGION_ENV_NAME = no;\nexport const REGION_INI_NAME = no;\nexport const NODE_REGION_CONFIG_OPTIONS = no;\nexport const NODE_REGION_CONFIG_FILE_OPTIONS = no;\nexport {\n  resolveRegionConfig,\n  type RegionInputConfig,\n  type RegionResolvedConfig,\n} from \"./config-resolver/regionConfig/resolveRegionConfig\";\n\n// @smithy/config-resolver\nexport { type PartitionHash } from \"./config-resolver/regionInfo/PartitionHash\";\nexport { type RegionHash } from \"./config-resolver/regionInfo/RegionHash\";\nexport { type EndpointVariant } from \"./config-resolver/regionInfo/EndpointVariant\";\nexport { type EndpointVariantTag } from \"./config-resolver/regionInfo/EndpointVariantTag\";\nexport { getRegionInfo, type GetRegionInfoOptions } from \"./config-resolver/regionInfo/getRegionInfo\";\n\n// @smithy/util-defaults-mode-browser\nexport {\n  resolveDefaultsModeConfig,\n  type ResolveDefaultsModeConfigOptions,\n} from \"./defaults-mode/resolveDefaultsModeConfig.browser\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/index.native.ts",
    "content": "const no = Symbol.for(\"node-only\");\n\n// @smithy/property-provider\nexport { ProviderError, type ProviderErrorOptionsType } from \"./property-provider/ProviderError\";\nexport { CredentialsProviderError } from \"./property-provider/CredentialsProviderError\";\nexport { TokenProviderError } from \"./property-provider/TokenProviderError\";\nexport { chain } from \"./property-provider/chain\";\nexport { fromValue } from \"./property-provider/fromValue\";\nexport { memoize } from \"./property-provider/memoize\";\n\n// @smithy/util-config-provider\nexport { booleanSelector } from \"./util-config-provider/booleanSelector\";\nexport { numberSelector } from \"./util-config-provider/numberSelector\";\nexport { SelectorType } from \"./util-config-provider/types\";\n\n// @smithy/shared-ini-file-loader\nexport const getHomeDir = no;\nexport const ENV_PROFILE = no;\nexport const DEFAULT_PROFILE = \"default\";\nexport const getProfileName = no;\nexport const getSSOTokenFilepath = no;\nexport const getSSOTokenFromFile = no;\nexport const CONFIG_PREFIX_SEPARATOR = no;\nexport const loadSharedConfigFiles = no;\nexport const loadSsoSessionData = no;\nexport const parseKnownFiles = no;\nexport const externalDataInterceptor = no;\nexport const readFile = no;\nexport type { SSOToken } from \"./shared-ini-file-loader/getSSOTokenFromFile\";\nexport type { SharedConfigInit } from \"./shared-ini-file-loader/loadSharedConfigFiles\";\nexport type { SsoSessionInit } from \"./shared-ini-file-loader/loadSsoSessionData\";\nexport type { SourceProfileInit } from \"./shared-ini-file-loader/parseKnownFiles\";\nexport type { Profile, ParsedIniData, SharedConfigFiles } from \"./shared-ini-file-loader/types\";\nexport type { ReadFileOptions } from \"./shared-ini-file-loader/readFile\";\n\n// @smithy/node-config-provider\nexport const loadConfig = no;\nexport const fromStatic = no;\nexport type { LocalConfigOptions, LoadedConfigSelectors } from \"./node-config-provider/configLoader\";\nexport type { EnvOptions, GetterFromEnv } from \"./node-config-provider/fromEnv\";\nexport type { NodeSharedConfigInit, GetterFromConfig } from \"./node-config-provider/fromSharedConfigFiles\";\n\n// @smithy/config-resolver\nexport const ENV_USE_DUALSTACK_ENDPOINT = no;\nexport const CONFIG_USE_DUALSTACK_ENDPOINT = no;\nexport const DEFAULT_USE_DUALSTACK_ENDPOINT = false;\nexport const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = no;\nexport const nodeDualstackConfigSelectors = no;\nexport const ENV_USE_FIPS_ENDPOINT = no;\nexport const CONFIG_USE_FIPS_ENDPOINT = no;\nexport const DEFAULT_USE_FIPS_ENDPOINT = false;\nexport const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = no;\nexport const nodeFipsConfigSelectors = no;\nexport {\n  resolveCustomEndpointsConfig,\n  type CustomEndpointsInputConfig,\n  type CustomEndpointsResolvedConfig,\n} from \"./config-resolver/endpointsConfig/resolveCustomEndpointsConfig\";\nexport {\n  resolveEndpointsConfig,\n  type EndpointsInputConfig,\n  type EndpointsResolvedConfig,\n} from \"./config-resolver/endpointsConfig/resolveEndpointsConfig\";\n\n// @smithy/config-resolver\nexport const REGION_ENV_NAME = no;\nexport const REGION_INI_NAME = no;\nexport const NODE_REGION_CONFIG_OPTIONS = no;\nexport const NODE_REGION_CONFIG_FILE_OPTIONS = no;\nexport {\n  resolveRegionConfig,\n  type RegionInputConfig,\n  type RegionResolvedConfig,\n} from \"./config-resolver/regionConfig/resolveRegionConfig\";\n\n// @smithy/config-resolver\nexport { type PartitionHash } from \"./config-resolver/regionInfo/PartitionHash\";\nexport { type RegionHash } from \"./config-resolver/regionInfo/RegionHash\";\nexport { type EndpointVariant } from \"./config-resolver/regionInfo/EndpointVariant\";\nexport { type EndpointVariantTag } from \"./config-resolver/regionInfo/EndpointVariantTag\";\nexport { getRegionInfo, type GetRegionInfoOptions } from \"./config-resolver/regionInfo/getRegionInfo\";\n\n// @smithy/util-defaults-mode-node\nexport {\n  resolveDefaultsModeConfig,\n  type ResolveDefaultsModeConfigOptions,\n} from \"./defaults-mode/resolveDefaultsModeConfig.native\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/index.ts",
    "content": "// @smithy/property-provider\nexport { ProviderError, type ProviderErrorOptionsType } from \"./property-provider/ProviderError\";\nexport { CredentialsProviderError } from \"./property-provider/CredentialsProviderError\";\nexport { TokenProviderError } from \"./property-provider/TokenProviderError\";\nexport { chain } from \"./property-provider/chain\";\nexport { fromValue } from \"./property-provider/fromValue\";\nexport { memoize } from \"./property-provider/memoize\";\n\n// @smithy/util-config-provider\nexport { booleanSelector } from \"./util-config-provider/booleanSelector\";\nexport { numberSelector } from \"./util-config-provider/numberSelector\";\nexport { SelectorType } from \"./util-config-provider/types\";\n\n// @smithy/shared-ini-file-loader\nexport { getHomeDir } from \"./shared-ini-file-loader/getHomeDir\";\nexport { ENV_PROFILE, DEFAULT_PROFILE, getProfileName } from \"./shared-ini-file-loader/getProfileName\";\nexport { getSSOTokenFilepath } from \"./shared-ini-file-loader/getSSOTokenFilepath\";\nexport { getSSOTokenFromFile, type SSOToken } from \"./shared-ini-file-loader/getSSOTokenFromFile\";\nexport { CONFIG_PREFIX_SEPARATOR } from \"./shared-ini-file-loader/constants\";\nexport { loadSharedConfigFiles, type SharedConfigInit } from \"./shared-ini-file-loader/loadSharedConfigFiles\";\nexport { loadSsoSessionData, type SsoSessionInit } from \"./shared-ini-file-loader/loadSsoSessionData\";\nexport { parseKnownFiles, type SourceProfileInit } from \"./shared-ini-file-loader/parseKnownFiles\";\nexport { externalDataInterceptor } from \"./shared-ini-file-loader/externalDataInterceptor\";\nexport { type Profile, type ParsedIniData, type SharedConfigFiles } from \"./shared-ini-file-loader/types\";\nexport { readFile, type ReadFileOptions } from \"./shared-ini-file-loader/readFile\";\n\n// @smithy/node-config-provider\nexport { loadConfig, type LocalConfigOptions, type LoadedConfigSelectors } from \"./node-config-provider/configLoader\";\nexport { type EnvOptions, type GetterFromEnv } from \"./node-config-provider/fromEnv\";\nexport { fromStatic } from \"./node-config-provider/fromStatic\";\nexport { type NodeSharedConfigInit, type GetterFromConfig } from \"./node-config-provider/fromSharedConfigFiles\";\n\n// @smithy/config-resolver\nexport {\n  ENV_USE_DUALSTACK_ENDPOINT,\n  CONFIG_USE_DUALSTACK_ENDPOINT,\n  DEFAULT_USE_DUALSTACK_ENDPOINT,\n  NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,\n  nodeDualstackConfigSelectors,\n} from \"./config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions\";\nexport {\n  ENV_USE_FIPS_ENDPOINT,\n  CONFIG_USE_FIPS_ENDPOINT,\n  DEFAULT_USE_FIPS_ENDPOINT,\n  NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,\n  nodeFipsConfigSelectors,\n} from \"./config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions\";\nexport {\n  resolveCustomEndpointsConfig,\n  type CustomEndpointsInputConfig,\n  type CustomEndpointsResolvedConfig,\n} from \"./config-resolver/endpointsConfig/resolveCustomEndpointsConfig\";\nexport {\n  resolveEndpointsConfig,\n  type EndpointsInputConfig,\n  type EndpointsResolvedConfig,\n} from \"./config-resolver/endpointsConfig/resolveEndpointsConfig\";\n\n// @smithy/config-resolver\nexport {\n  REGION_ENV_NAME,\n  REGION_INI_NAME,\n  NODE_REGION_CONFIG_OPTIONS,\n  NODE_REGION_CONFIG_FILE_OPTIONS,\n} from \"./config-resolver/regionConfig/config\";\nexport {\n  resolveRegionConfig,\n  type RegionInputConfig,\n  type RegionResolvedConfig,\n} from \"./config-resolver/regionConfig/resolveRegionConfig\";\n\n// @smithy/config-resolver\nexport { type PartitionHash } from \"./config-resolver/regionInfo/PartitionHash\";\nexport { type RegionHash } from \"./config-resolver/regionInfo/RegionHash\";\nexport { type EndpointVariant } from \"./config-resolver/regionInfo/EndpointVariant\";\nexport { type EndpointVariantTag } from \"./config-resolver/regionInfo/EndpointVariantTag\";\nexport { getRegionInfo, type GetRegionInfoOptions } from \"./config-resolver/regionInfo/getRegionInfo\";\n\n// @smithy/util-defaults-mode-node\nexport {\n  resolveDefaultsModeConfig,\n  type ResolveDefaultsModeConfigOptions,\n} from \"./defaults-mode/resolveDefaultsModeConfig\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.3.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/property-provider@4.2.14\n  - @smithy/shared-ini-file-loader@4.4.9\n\n## 4.3.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/property-provider@4.2.13\n  - @smithy/shared-ini-file-loader@4.4.8\n\n## 4.3.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/property-provider@4.2.12\n  - @smithy/shared-ini-file-loader@4.4.7\n\n## 4.3.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/shared-ini-file-loader@4.4.6\n  - @smithy/property-provider@4.2.11\n\n## 4.3.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/property-provider@4.2.10\n  - @smithy/shared-ini-file-loader@4.4.5\n\n## 4.3.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/property-provider@4.2.9\n  - @smithy/shared-ini-file-loader@4.4.4\n  - @smithy/types@4.12.1\n\n## 4.3.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/property-provider@4.2.8\n  - @smithy/shared-ini-file-loader@4.4.3\n\n## 4.3.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/property-provider@4.2.7\n  - @smithy/shared-ini-file-loader@4.4.2\n\n## 4.3.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/property-provider@4.2.6\n  - @smithy/shared-ini-file-loader@4.4.1\n\n## 4.3.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n- Updated dependencies [d90999a]\n  - @smithy/types@4.9.0\n  - @smithy/shared-ini-file-loader@4.4.0\n  - @smithy/property-provider@4.2.5\n\n## 4.3.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/property-provider@4.2.4\n  - @smithy/shared-ini-file-loader@4.3.4\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n- Updated dependencies [7e359e2]\n  - @smithy/types@4.8.0\n  - @smithy/shared-ini-file-loader@4.3.3\n  - @smithy/property-provider@4.2.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/property-provider@4.2.2\n  - @smithy/shared-ini-file-loader@4.3.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/property-provider@4.2.1\n  - @smithy/shared-ini-file-loader@4.3.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/property-provider@4.2.0\n  - @smithy/shared-ini-file-loader@4.3.0\n  - @smithy/types@4.6.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [60f393e]\n  - @smithy/shared-ini-file-loader@4.2.0\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/property-provider@4.1.1\n  - @smithy/shared-ini-file-loader@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/shared-ini-file-loader@4.1.0\n  - @smithy/property-provider@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/property-provider@4.0.5\n  - @smithy/shared-ini-file-loader@4.0.5\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/property-provider@4.0.4\n  - @smithy/shared-ini-file-loader@4.0.4\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/property-provider@4.0.3\n  - @smithy/shared-ini-file-loader@4.0.3\n\n## 4.1.1\n\n### Patch Changes\n\n- 9f8d075: Export Getters and their configs\n\n## 4.1.0\n\n### Minor Changes\n\n- 9ff783b: Pass options with signing name to environment variable selector\n\n### Patch Changes\n\n- acefcf5: Pass logger to environment variable selector\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/property-provider@4.0.2\n  - @smithy/shared-ini-file-loader@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/property-provider@4.0.1\n  - @smithy/shared-ini-file-loader@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/shared-ini-file-loader@4.0.0\n  - @smithy/property-provider@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.1.12\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/property-provider@3.1.11\n  - @smithy/shared-ini-file-loader@3.1.12\n\n## 3.1.11\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/property-provider@3.1.10\n  - @smithy/shared-ini-file-loader@3.1.11\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/property-provider@3.1.9\n  - @smithy/shared-ini-file-loader@3.1.10\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/property-provider@3.1.8\n  - @smithy/shared-ini-file-loader@3.1.9\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/property-provider@3.1.7\n  - @smithy/shared-ini-file-loader@3.1.8\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/property-provider@3.1.6\n  - @smithy/shared-ini-file-loader@3.1.7\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/property-provider@3.1.5\n  - @smithy/shared-ini-file-loader@3.1.6\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/property-provider@3.1.4\n  - @smithy/shared-ini-file-loader@3.1.5\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [d88521e]\n  - @smithy/shared-ini-file-loader@3.1.4\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/property-provider@3.1.3\n  - @smithy/shared-ini-file-loader@3.1.3\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/property-provider@3.1.2\n  - @smithy/shared-ini-file-loader@3.1.2\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/property-provider@3.1.1\n  - @smithy/shared-ini-file-loader@3.1.1\n\n## 3.1.0\n\n### Minor Changes\n\n- 1cdd3be0: new logging-compatible signature for CredentialsProviderError\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n  - @smithy/shared-ini-file-loader@3.1.0\n  - @smithy/property-provider@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/shared-ini-file-loader@3.0.0\n  - @smithy/property-provider@3.0.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/shared-ini-file-loader@2.4.0\n  - @smithy/property-provider@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.2.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/property-provider@2.1.4\n  - @smithy/shared-ini-file-loader@2.3.5\n\n## 2.2.4\n\n### Patch Changes\n\n- Updated dependencies [8fd51967]\n  - @smithy/shared-ini-file-loader@2.3.4\n\n## 2.2.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/property-provider@2.1.3\n  - @smithy/shared-ini-file-loader@2.3.3\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/property-provider@2.1.2\n  - @smithy/shared-ini-file-loader@2.3.2\n\n## 2.2.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/property-provider@2.1.1\n  - @smithy/shared-ini-file-loader@2.3.1\n  - @smithy/types@2.9.1\n\n## 2.2.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/shared-ini-file-loader@2.3.0\n  - @smithy/property-provider@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.1.9\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/property-provider@2.0.17\n  - @smithy/shared-ini-file-loader@2.2.8\n\n## 2.1.8\n\n### Patch Changes\n\n- Updated dependencies [68849108]\n  - @smithy/shared-ini-file-loader@2.2.7\n\n## 2.1.7\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/property-provider@2.0.16\n  - @smithy/shared-ini-file-loader@2.2.6\n\n## 2.1.6\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/property-provider@2.0.15\n  - @smithy/shared-ini-file-loader@2.2.5\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/property-provider@2.0.14\n  - @smithy/shared-ini-file-loader@2.2.4\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [c27879f2]\n  - @smithy/shared-ini-file-loader@2.2.3\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [901cb6c9]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/shared-ini-file-loader@2.2.2\n  - @smithy/property-provider@2.0.13\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [5bd46820]\n- Updated dependencies [6ae95278]\n  - @smithy/shared-ini-file-loader@2.2.1\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n- Updated dependencies [719777c7]\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/shared-ini-file-loader@2.2.0\n  - @smithy/property-provider@2.0.12\n\n## 2.1.0\n\n### Minor Changes\n\n- 7b568c39: Pass configuration file as second parameter to configSelector\n\n### Patch Changes\n\n- Updated dependencies [aa86b3fe]\n  - @smithy/shared-ini-file-loader@2.1.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [60e88afe]\n  - @smithy/shared-ini-file-loader@2.0.13\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/property-provider@2.0.11\n  - @smithy/shared-ini-file-loader@2.0.12\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/property-provider@2.0.10\n  - @smithy/shared-ini-file-loader@2.0.11\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/property-provider@2.0.9\n  - @smithy/shared-ini-file-loader@2.0.10\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/property-provider@2.0.8\n  - @smithy/shared-ini-file-loader@2.0.9\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [c4e16cfd]\n  - @smithy/shared-ini-file-loader@2.0.8\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/property-provider@2.0.7\n  - @smithy/shared-ini-file-loader@2.0.7\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [c07cde00]\n  - @smithy/shared-ini-file-loader@2.0.6\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [a7598a5d]\n  - @smithy/property-provider@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/property-provider@2.0.5\n  - @smithy/shared-ini-file-loader@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/property-provider@2.0.4\n  - @smithy/shared-ini-file-loader@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/property-provider@2.0.3\n  - @smithy/shared-ini-file-loader@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/property-provider@2.0.2\n  - @smithy/shared-ini-file-loader@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/property-provider@2.0.1\n  - @smithy/shared-ini-file-loader@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/property-provider@2.0.0\n  - @smithy/shared-ini-file-loader@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/property-provider@1.2.0\n  - @smithy/shared-ini-file-loader@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [4ad43c6a]\n- Updated dependencies [d90a45b5]\n- Updated dependencies [5f7bcc79]\n  - @smithy/types@2.0.0\n  - @smithy/property-provider@1.1.0\n  - @smithy/shared-ini-file-loader@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/shared-ini-file-loader@1.0.2\n  - @smithy/property-provider@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/shared-ini-file-loader@1.0.1\n  - @smithy/property-provider@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/node-config-provider](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/node-config-provider/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/configLoader.spec.ts",
    "content": "import type { Profile } from \"@smithy/types\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { chain } from \"../property-provider/chain\";\nimport { memoize } from \"../property-provider/memoize\";\nimport { loadConfig } from \"./configLoader\";\nimport { fromEnv } from \"./fromEnv\";\nimport { fromSharedConfigFiles, type NodeSharedConfigInit } from \"./fromSharedConfigFiles\";\nimport { fromStatic } from \"./fromStatic\";\n\nvi.mock(\"./fromEnv\");\nvi.mock(\"./fromSharedConfigFiles\");\nvi.mock(\"./fromStatic\");\nvi.mock(\"../property-provider/chain\");\nvi.mock(\"../property-provider/memoize\");\n\ndescribe(\"loadConfig\", () => {\n  const configuration: NodeSharedConfigInit = {\n    profile: \"profile\",\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"passes fromEnv(), fromSharedConfigFiles() and fromStatic() to chain\", () => {\n    const mockFromEnvReturn = \"mockFromEnvReturn\" as any;\n    vi.mocked(fromEnv).mockReturnValueOnce(mockFromEnvReturn);\n    const mockFromSharedConfigFilesReturn = \"mockFromSharedConfigFilesReturn\" as any;\n    vi.mocked(fromSharedConfigFiles).mockReturnValueOnce(mockFromSharedConfigFilesReturn);\n    const mockFromStatic = \"mockFromStatic\" as any;\n    vi.mocked(fromStatic).mockReturnValueOnce(mockFromStatic);\n    const envVarSelector = (env: Record<string, string | undefined>) => env[\"AWS_CONFIG_FOO\"];\n    const configKey = (profile: Profile) => profile[\"aws_config_foo\"];\n    const defaultValue = \"foo-value\";\n    loadConfig(\n      {\n        environmentVariableSelector: envVarSelector,\n        configFileSelector: configKey,\n        default: defaultValue,\n      },\n      configuration\n    );\n    expect(fromEnv).toHaveBeenCalledTimes(1);\n    expect(fromEnv).toHaveBeenCalledWith(envVarSelector, {});\n    expect(fromSharedConfigFiles).toHaveBeenCalledTimes(1);\n    expect(fromSharedConfigFiles).toHaveBeenCalledWith(configKey, configuration);\n    expect(fromStatic).toHaveBeenCalledTimes(1);\n    expect(fromStatic).toHaveBeenCalledWith(defaultValue);\n    expect(chain).toHaveBeenCalledTimes(1);\n    expect(chain).toHaveBeenCalledWith(mockFromEnvReturn, mockFromSharedConfigFilesReturn, mockFromStatic);\n  });\n\n  it(\"passes output of chain to memoize\", () => {\n    const mockChainReturn = \"mockChainReturn\" as any;\n    vi.mocked(chain).mockReturnValueOnce(mockChainReturn);\n    loadConfig({} as any);\n    expect(chain).toHaveBeenCalledTimes(1);\n    expect(memoize).toHaveBeenCalledTimes(1);\n    expect(memoize).toHaveBeenCalledWith(mockChainReturn);\n  });\n\n  it(\"returns output memoize\", () => {\n    const mockMemoizeReturn = \"mockMemoizeReturn\" as any;\n    vi.mocked(memoize).mockReturnValueOnce(mockMemoizeReturn);\n    expect(loadConfig({} as any)).toEqual(mockMemoizeReturn);\n  });\n\n  it(\"passes signingName in options object of fromEnv()\", () => {\n    const configWithSigningName = {\n      ...configuration,\n      signingName: \"signingName\",\n    };\n    const envVarSelector = (env: Record<string, string | undefined>) => env[\"AWS_CONFIG_FOO\"];\n    const configKey = (profile: Profile) => profile[\"aws_config_foo\"];\n    const defaultValue = \"foo-value\";\n\n    loadConfig(\n      {\n        environmentVariableSelector: envVarSelector,\n        configFileSelector: configKey,\n        default: defaultValue,\n      },\n      configWithSigningName\n    );\n\n    expect(fromEnv).toHaveBeenCalledTimes(1);\n    expect(fromEnv).toHaveBeenCalledWith(envVarSelector, { signingName: configWithSigningName.signingName });\n  });\n\n  it(\"passes logger in options object of fromEnv()\", () => {\n    const configWithSigningName = {\n      ...configuration,\n      logger: console,\n    };\n    const envVarSelector = (env: Record<string, string | undefined>) => env[\"AWS_CONFIG_FOO\"];\n    const configKey = (profile: Profile) => profile[\"aws_config_foo\"];\n    const defaultValue = \"foo-value\";\n\n    loadConfig(\n      {\n        environmentVariableSelector: envVarSelector,\n        configFileSelector: configKey,\n        default: defaultValue,\n      },\n      configWithSigningName\n    );\n\n    expect(fromEnv).toHaveBeenCalledTimes(1);\n    expect(fromEnv).toHaveBeenCalledWith(envVarSelector, { logger: configWithSigningName.logger });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/configLoader.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\nimport { chain } from \"../property-provider/chain\";\nimport { memoize } from \"../property-provider/memoize\";\nimport { fromEnv, type EnvOptions, type GetterFromEnv } from \"./fromEnv\";\nimport { fromSharedConfigFiles, type GetterFromConfig, type NodeSharedConfigInit } from \"./fromSharedConfigFiles\";\nimport { fromStatic, type FromStaticConfig } from \"./fromStatic\";\n\n/**\n * @internal\n */\nexport type LocalConfigOptions = NodeSharedConfigInit & EnvOptions;\n\n/**\n * @internal\n */\nexport interface LoadedConfigSelectors<T> {\n  /**\n   * A getter function getting the config values from all the environment\n   * variables.\n   */\n  environmentVariableSelector: GetterFromEnv<T>;\n  /**\n   * A getter function getting config values associated with the inferred\n   * profile from shared INI files\n   */\n  configFileSelector: GetterFromConfig<T>;\n  /**\n   * Default value or getter\n   */\n  default: FromStaticConfig<T>;\n}\n\n/**\n * @internal\n */\nexport const loadConfig = <T = string>(\n  { environmentVariableSelector, configFileSelector, default: defaultValue }: LoadedConfigSelectors<T>,\n  configuration: LocalConfigOptions = {}\n): Provider<T> => {\n  const { signingName, logger } = configuration;\n  const envOptions: EnvOptions = { signingName, logger };\n\n  return memoize(\n    chain(\n      fromEnv(environmentVariableSelector, envOptions),\n      fromSharedConfigFiles(configFileSelector, configuration),\n      fromStatic(defaultValue)\n    )\n  );\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/fromEnv.spec.ts",
    "content": "import { afterAll, afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { CredentialsProviderError } from \"../property-provider/CredentialsProviderError\";\nimport { fromEnv } from \"./fromEnv\";\n\ndescribe(\"fromEnv\", () => {\n  describe(\"with env var getter\", () => {\n    const ENV_VAR_NAME = \"ENV_VAR_NAME\";\n\n    const envVarGetter = vi.fn();\n    const envVarValue = process.env[ENV_VAR_NAME];\n    const mockEnvVarValue = \"mockEnvVarValue\";\n\n    beforeEach(() => {\n      envVarGetter.mockImplementation((env: Record<string, string>) => {\n        if (env[ENV_VAR_NAME]) return env[ENV_VAR_NAME];\n        throw new CredentialsProviderError(`Not found in ENV: ${ENV_VAR_NAME}`);\n      });\n      delete process.env[ENV_VAR_NAME];\n    });\n\n    afterEach(() => {\n      vi.clearAllMocks();\n    });\n\n    afterAll(() => {\n      process.env[ENV_VAR_NAME] = envVarValue;\n    });\n\n    describe(\"CredentialsProviderError\", () => {\n      it(\"is behaving as expected cross-package in vitest\", () => {\n        expect(new CredentialsProviderError(\"msg\", {}).message).toEqual(\"msg\");\n        expect(new CredentialsProviderError(\"msg\", {}).name).toEqual(\"CredentialsProviderError\");\n      });\n    });\n\n    it(`returns string value in '${ENV_VAR_NAME}' env var when set`, async () => {\n      process.env[ENV_VAR_NAME] = mockEnvVarValue;\n      await expect(fromEnv(envVarGetter)()).resolves.toBe(mockEnvVarValue);\n      expect(envVarGetter).toHaveBeenCalledWith(process.env, undefined);\n    });\n\n    it(`passes options to envVarSelector if it's set`, async () => {\n      process.env[ENV_VAR_NAME] = mockEnvVarValue;\n      const options = { signingName: \"signingName\" };\n      await expect(fromEnv(envVarGetter, options)()).resolves.toBe(mockEnvVarValue);\n      expect(envVarGetter).toHaveBeenCalledWith(process.env, options);\n    });\n\n    it(\"return complex value from the getter\", () => {\n      type Value = { Foo: string };\n      const value: Value = { Foo: \"bar\" };\n      const getter: (env: any) => Value = vi.fn().mockReturnValue(value);\n      // Validate the generic type works\n      return expect(fromEnv(getter)()).resolves.toEqual(value);\n    });\n\n    it(`throws when '${ENV_VAR_NAME}' env var is not set`, async () => {\n      expect.assertions(1);\n      const error = await fromEnv(envVarGetter)().catch((_) => _);\n      return expect(error).toEqual(new CredentialsProviderError(`Not found in ENV: ENV_VAR_NAME`, {}));\n    });\n\n    it(\"throws when the getter function throws\", () => {\n      const exception = new Error(\"Exception when getting the config\");\n      const getter: (env: any) => any = vi.fn().mockRejectedValue(exception);\n      return expect(fromEnv(getter)()).rejects.toEqual(exception);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/fromEnv.ts",
    "content": "import type { Logger, Provider } from \"@smithy/types\";\n\nimport { CredentialsProviderError } from \"../property-provider/CredentialsProviderError\";\nimport { getSelectorName } from \"./getSelectorName\";\n\n/**\n * @internal\n */\nexport interface EnvOptions {\n  /**\n   * The SigV4 service signing name.\n   */\n  signingName?: string;\n\n  /**\n   * For credential resolution trace logging.\n   */\n  logger?: Logger;\n}\n\n// Using Record<string, string | undefined> instead of NodeJS.ProcessEnv, in order to not get type errors in non node environments\nexport type GetterFromEnv<T> = (env: Record<string, string | undefined>, options?: EnvOptions) => T | undefined;\n\n/**\n * Get config value given the environment variable name or getter from\n * environment variable.\n */\nexport const fromEnv =\n  <T = string>(envVarSelector: GetterFromEnv<T>, options?: EnvOptions): Provider<T> =>\n  async () => {\n    try {\n      const config = envVarSelector(process.env, options);\n      if (config === undefined) {\n        throw new Error();\n      }\n      return config as T;\n    } catch (e) {\n      throw new CredentialsProviderError(\n        e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`,\n        { logger: options?.logger }\n      );\n    }\n  };\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/fromSharedConfigFiles.spec.ts",
    "content": "import type { ParsedIniData, Profile } from \"@smithy/types\";\nimport { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { CredentialsProviderError } from \"../property-provider/CredentialsProviderError\";\nimport { getProfileName } from \"../shared-ini-file-loader/getProfileName\";\nimport { loadSharedConfigFiles } from \"../shared-ini-file-loader/loadSharedConfigFiles\";\nimport { fromSharedConfigFiles, type GetterFromConfig, type NodeSharedConfigInit } from \"./fromSharedConfigFiles\";\n\nvi.mock(\"../shared-ini-file-loader/getProfileName\");\nvi.mock(\"../shared-ini-file-loader/loadSharedConfigFiles\");\n\ndescribe(\"fromSharedConfigFiles\", () => {\n  const CONFIG_KEY = \"config_key\";\n  const configGetter: GetterFromConfig<string> = (profile: Profile) => profile[CONFIG_KEY];\n\n  const getCredentialsProviderError = (profile: string) =>\n    new CredentialsProviderError(`Not found in config files w/ profile [${profile}]: CONFIG_KEY`, {});\n\n  describe(\"loadedConfig\", () => {\n    const mockConfigAnswer = \"mockConfigAnswer\";\n    const mockConfigNotAnswer = \"mockConfigNotAnswer\";\n    const mockCredentialsAnswer = \"mockCredentialsAnswer\";\n    const mockCredentialsNotAnswer = \"mockCredentialsNotAnswer\";\n\n    type LoadedConfigTestData = {\n      message: string;\n      iniDataInConfig: ParsedIniData;\n      iniDataInCredentials: ParsedIniData;\n    } & NodeSharedConfigInit;\n\n    const loadedConfigResolves: (LoadedConfigTestData & {\n      configValueToVerify: string;\n    })[] = [\n      {\n        message: \"returns configValue from default profile\",\n        iniDataInConfig: {\n          default: { [CONFIG_KEY]: mockConfigAnswer },\n        },\n        iniDataInCredentials: {\n          default: { [CONFIG_KEY]: mockCredentialsNotAnswer },\n        },\n        configValueToVerify: mockConfigAnswer,\n      },\n      {\n        message: \"returns configValue from designated profile\",\n        iniDataInConfig: {\n          default: { [CONFIG_KEY]: mockConfigNotAnswer },\n          foo: { [CONFIG_KEY]: mockConfigAnswer },\n        },\n        iniDataInCredentials: {\n          foo: { [CONFIG_KEY]: mockCredentialsNotAnswer },\n        },\n        profile: \"foo\",\n        configValueToVerify: mockConfigAnswer,\n      },\n      {\n        message: \"returns configValue from credentials file if preferred\",\n        iniDataInConfig: {\n          default: { [CONFIG_KEY]: mockConfigNotAnswer },\n          foo: { [CONFIG_KEY]: mockConfigNotAnswer },\n        },\n        iniDataInCredentials: {\n          foo: { [CONFIG_KEY]: mockCredentialsAnswer },\n        },\n        profile: \"foo\",\n        preferredFile: \"credentials\",\n        configValueToVerify: mockCredentialsAnswer,\n      },\n      {\n        message: \"returns configValue from config file if preferred credentials file doesn't contain config\",\n        iniDataInConfig: {\n          foo: { [CONFIG_KEY]: mockConfigAnswer },\n        },\n        iniDataInCredentials: {},\n        configValueToVerify: mockConfigAnswer,\n        preferredFile: \"credentials\",\n        profile: \"foo\",\n      },\n      {\n        message: \"returns configValue from credential file if preferred config file doesn't contain config\",\n        iniDataInConfig: {},\n        iniDataInCredentials: {\n          foo: { [CONFIG_KEY]: mockCredentialsAnswer },\n        },\n        configValueToVerify: mockCredentialsAnswer,\n        profile: \"foo\",\n      },\n    ];\n\n    const loadedConfigRejects: LoadedConfigTestData[] = [\n      {\n        message: \"rejects if default profile is not present and profile value is not passed\",\n        iniDataInConfig: {\n          foo: { [CONFIG_KEY]: mockConfigNotAnswer },\n        },\n        iniDataInCredentials: {},\n      },\n      {\n        message: \"rejects if designated profile is not present\",\n        iniDataInConfig: {\n          default: { [CONFIG_KEY]: mockConfigNotAnswer },\n        },\n        iniDataInCredentials: {},\n        profile: \"foo\",\n      },\n    ];\n\n    loadedConfigResolves.forEach(\n      ({ message, iniDataInConfig, iniDataInCredentials, configValueToVerify, profile, preferredFile }) => {\n        it(message, () => {\n          vi.mocked(loadSharedConfigFiles).mockResolvedValueOnce({\n            configFile: iniDataInConfig,\n            credentialsFile: iniDataInCredentials,\n          });\n          vi.mocked(getProfileName).mockReturnValueOnce(profile ?? \"default\");\n          return expect(fromSharedConfigFiles(configGetter, { profile, preferredFile })()).resolves.toBe(\n            configValueToVerify\n          );\n        });\n      }\n    );\n\n    loadedConfigRejects.forEach(({ message, iniDataInConfig, iniDataInCredentials, profile, preferredFile }) => {\n      it(message, () => {\n        vi.mocked(loadSharedConfigFiles).mockResolvedValueOnce({\n          configFile: iniDataInConfig,\n          credentialsFile: iniDataInCredentials,\n        });\n        vi.mocked(getProfileName).mockReturnValueOnce(profile ?? \"default\");\n        return expect(fromSharedConfigFiles(configGetter, { profile, preferredFile })()).rejects.toEqual(\n          getCredentialsProviderError(profile ?? \"default\")\n        );\n      });\n    });\n\n    it(\"rejects if getter throws\", () => {\n      const message = \"Cannot load config\";\n      const failGetter = () => {\n        throw new Error(message);\n      };\n      vi.mocked(loadSharedConfigFiles).mockResolvedValueOnce({\n        configFile: {},\n        credentialsFile: {},\n      });\n      return expect(fromSharedConfigFiles(failGetter)()).rejects.toEqual(new CredentialsProviderError(message));\n    });\n  });\n\n  describe(\"profile\", () => {\n    const loadedConfigData = {\n      configFile: {\n        default: { [CONFIG_KEY]: \"configFileDefault\" },\n        foo: { [CONFIG_KEY]: \"configFileFoo\" },\n      },\n      credentialsFile: {\n        default: { [CONFIG_KEY]: \"credentialsFileDefault\" },\n      },\n    };\n\n    beforeEach(() => {\n      vi.mocked(loadSharedConfigFiles).mockResolvedValueOnce(loadedConfigData);\n    });\n\n    it.each([\"foo\", \"default\"])(\"returns config value from %s profile\", (profile) => {\n      vi.mocked(getProfileName).mockReturnValueOnce(profile);\n      return expect(fromSharedConfigFiles(configGetter)()).resolves.toBe(\n        (loadedConfigData.configFile as Record<string, { config_key: string }>)[profile][CONFIG_KEY]\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/fromSharedConfigFiles.ts",
    "content": "import type { ParsedIniData, Profile, Provider } from \"@smithy/types\";\n\nimport { CredentialsProviderError } from \"../property-provider/CredentialsProviderError\";\nimport { getProfileName } from \"../shared-ini-file-loader/getProfileName\";\nimport { loadSharedConfigFiles } from \"../shared-ini-file-loader/loadSharedConfigFiles\";\nimport type { SourceProfileInit } from \"../shared-ini-file-loader/parseKnownFiles\";\nimport { getSelectorName } from \"./getSelectorName\";\n\n/**\n * @internal\n */\nexport interface NodeSharedConfigInit extends SourceProfileInit {\n  /**\n   * The preferred shared ini file to load the config. \"config\" option refers to\n   * the shared config file(defaults to `~/.aws/config`). \"credentials\" option\n   * refers to the shared credentials file(defaults to `~/.aws/credentials`)\n   */\n  preferredFile?: \"config\" | \"credentials\";\n}\n\n/**\n * @internal\n */\nexport type GetterFromConfig<T> = (profile: Profile, configFile?: ParsedIniData) => T | undefined;\n\n/**\n * Get config value from the shared config files with inferred profile name.\n * @internal\n */\nexport const fromSharedConfigFiles =\n  <T = string>(\n    configSelector: GetterFromConfig<T>,\n    { preferredFile = \"config\", ...init }: NodeSharedConfigInit = {}\n  ): Provider<T> =>\n  async () => {\n    const profile = getProfileName(init);\n    const { configFile, credentialsFile } = await loadSharedConfigFiles(init);\n\n    const profileFromCredentials = credentialsFile[profile] || {};\n    const profileFromConfig = configFile[profile] || {};\n    const mergedProfile =\n      preferredFile === \"config\"\n        ? { ...profileFromCredentials, ...profileFromConfig }\n        : { ...profileFromConfig, ...profileFromCredentials };\n\n    try {\n      const cfgFile = preferredFile === \"config\" ? configFile : credentialsFile;\n      const configValue = configSelector(mergedProfile, cfgFile);\n      if (configValue === undefined) {\n        throw new Error();\n      }\n      return configValue;\n    } catch (e) {\n      throw new CredentialsProviderError(\n        e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`,\n        { logger: init.logger }\n      );\n    }\n  };\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/fromStatic.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { fromValue as convertToProvider } from \"../property-provider/fromValue\";\nimport { fromStatic } from \"./fromStatic\";\n\nvi.mock(\"../property-provider/fromValue\", () => ({\n  fromValue: vi.fn(),\n}));\n\ndescribe(\"fromStatic\", () => {\n  const value = \"default\" as any;\n  it(\"should convert static values to provider\", async () => {\n    vi.mocked(convertToProvider).mockReturnValue(value);\n    fromStatic(value);\n    expect(vi.mocked(convertToProvider)).toHaveBeenCalledWith(value);\n  });\n\n  it(\"should call the getter function\", async () => {\n    const getter = vi.fn().mockReturnValue(value);\n    const config = fromStatic(getter);\n    expect(await config()).toBe(value);\n    expect(getter).toHaveBeenCalled();\n  });\n\n  it(\"should call the async provider function\", async () => {\n    const getter = vi.fn().mockResolvedValue(value);\n    const config = fromStatic(getter);\n    expect(await config()).toBe(value);\n    expect(getter).toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/fromStatic.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\nimport { fromValue } from \"../property-provider/fromValue\";\n\n/**\n * @internal\n */\nexport type FromStaticConfig<T> = T | (() => T) | Provider<T>;\n\n/**\n * @internal\n */\ntype Getter<T> = (() => T) | Provider<T>;\n\n/**\n * @internal\n */\nconst isFunction = <T>(func: FromStaticConfig<T>): func is Getter<T> => typeof func === \"function\";\n\n/**\n * @internal\n */\nexport const fromStatic = <T>(defaultValue: FromStaticConfig<T>): Provider<T> =>\n  isFunction(defaultValue) ? async () => await defaultValue() : fromValue(defaultValue);\n"
  },
  {
    "path": "packages/core/src/submodules/config/node-config-provider/getSelectorName.ts",
    "content": "/**\n * Attempts to extract the name of the variable that the functional selector is looking for.\n * Improves readability over the raw Function.toString() value.\n * @internal\n * @param functionString - function's string representation.\n *\n * @returns constant value used within the function.\n */\nexport function getSelectorName(functionString: string): string {\n  try {\n    const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));\n    constants.delete(\"CONFIG\");\n    constants.delete(\"CONFIG_PREFIX_SEPARATOR\");\n    constants.delete(\"ENV\");\n    return [...constants].join(\", \");\n  } catch (e) {\n    return functionString;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.1.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.1.0\n\n### Minor Changes\n\n- 1cdd3be0: new logging-compatible signature for CredentialsProviderError\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.6\n\n### Patch Changes\n\n- a7598a5d: Fix generating default rejected promise when chaining\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.2.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.1.0\n\n### Minor Changes\n\n- 4ad43c6a: adding @public annotation to errors\n\n### Patch Changes\n\n- 5f7bcc79: Expose provider Errors to be officially available for error handling.\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/property-provider](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/property-provider/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/CredentialsProviderError.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { CredentialsProviderError } from \"./CredentialsProviderError\";\nimport { ProviderError } from \"./ProviderError\";\n\ndescribe(CredentialsProviderError.name, () => {\n  it(\"should be named CredentialsProviderError\", () => {\n    expect(new CredentialsProviderError(\"PANIC\").name).toBe(\"CredentialsProviderError\");\n  });\n\n  it(\"should have a non-enumerable message like the base Error class\", () => {\n    expect(new CredentialsProviderError(\"PANIC\", {}).message).toBe(\"PANIC\");\n\n    expect(\n      {\n        ...new CredentialsProviderError(\"PANIC\", {}),\n      }.message\n    ).toBe(undefined);\n  });\n\n  it(\"should have an enumerable tryNextLink and logger like the base Error class\", () => {\n    expect(new CredentialsProviderError(\"PANIC\", {}).tryNextLink).toBe(true);\n\n    expect(\n      {\n        ...new CredentialsProviderError(\"PANIC\", { tryNextLink: false }),\n      }.tryNextLink\n    ).toBe(false);\n  });\n\n  it(\"should use logger.debug if provided\", () => {\n    const logger = {\n      info: vi.fn(),\n      warn: vi.fn(),\n      error: vi.fn(),\n      debug: vi.fn(),\n      trace: vi.fn(),\n    };\n    new CredentialsProviderError(\"PANIC\", { logger });\n\n    expect(logger.debug).toHaveBeenCalled();\n    expect(logger.trace).not.toHaveBeenCalled();\n  });\n\n  describe.each([Error, ProviderError, CredentialsProviderError])(\"should be instanceof %p\", (classConstructor) => {\n    it(\"when created using constructor\", () => {\n      expect(new CredentialsProviderError(\"PANIC\")).toBeInstanceOf(classConstructor);\n    });\n\n    it(\"when created using from()\", () => {\n      expect(CredentialsProviderError.from(new Error(\"PANIC\"))).toBeInstanceOf(classConstructor);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/CredentialsProviderError.ts",
    "content": "import { ProviderError, type ProviderErrorOptionsType } from \"./ProviderError\";\n\n/**\n * An error representing a failure of an individual credential provider.\n * This error class has special meaning to the {@link chain} method. If a\n * provider in the chain is rejected with an error, the chain will only proceed\n * to the next provider if the value of the `tryNextLink` property on the error\n * is truthy. This allows individual providers to halt the chain and also\n * ensures the chain will stop if an entirely unexpected error is encountered.\n *\n * @public\n */\nexport class CredentialsProviderError extends ProviderError {\n  name = \"CredentialsProviderError\";\n\n  /**\n   * @override\n   * @deprecated constructor should be given a logger.\n   */\n  public constructor(message: string);\n  /**\n   * @override\n   * @deprecated constructor should be given a logger.\n   */\n  public constructor(message: string, tryNextLink: boolean | undefined);\n  /**\n   * @override\n   * This signature is preferred for logging capability.\n   */\n  public constructor(message: string, options: ProviderErrorOptionsType);\n  /**\n   * @override\n   */\n  public constructor(message: string, options: boolean | ProviderErrorOptionsType = true) {\n    super(message, options as ProviderErrorOptionsType);\n    Object.setPrototypeOf(this, CredentialsProviderError.prototype);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/ProviderError.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { ProviderError } from \"./ProviderError\";\n\ndescribe(ProviderError.name, () => {\n  it(\"should be named as ProviderError\", () => {\n    expect(new ProviderError(\"PANIC\").name).toBe(\"ProviderError\");\n  });\n\n  it(\"should direct the chain to proceed to the next link by default\", () => {\n    expect(new ProviderError(\"PANIC\").tryNextLink).toBe(true);\n  });\n\n  it(\"should allow errors to halt the chain\", () => {\n    expect(new ProviderError(\"PANIC\", false).tryNextLink).toBe(false);\n  });\n\n  describe.each([Error, ProviderError])(\"should be instanceof %p\", (classConstructor) => {\n    it(\"when created using constructor\", () => {\n      expect(new ProviderError(\"PANIC\")).toBeInstanceOf(classConstructor);\n    });\n\n    it(\"when created using from()\", () => {\n      expect(ProviderError.from(new Error(\"PANIC\"))).toBeInstanceOf(classConstructor);\n    });\n  });\n\n  it(\"should create ProviderError from existing error\", () => {\n    const error = new Error(\"PANIC\");\n    // @ts-expect-error Property 'someValue' does not exist on type 'Error'.\n    error.someValue = \"foo\";\n    const providerError = ProviderError.from(error);\n    // @ts-expect-error Property 'someValue' does not exist on type 'ProviderError'.\n    expect(providerError.someValue).toBe(\"foo\");\n    expect(providerError.tryNextLink).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/ProviderError.ts",
    "content": "import type { Logger } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport type ProviderErrorOptionsType = {\n  tryNextLink?: boolean | undefined;\n  logger?: Logger;\n};\n\n/**\n * An error representing a failure of an individual provider.\n * This error class has special meaning to the {@link chain} method. If a\n * provider in the chain is rejected with an error, the chain will only proceed\n * to the next provider if the value of the `tryNextLink` property on the error\n * is truthy. This allows individual providers to halt the chain and also\n * ensures the chain will stop if an entirely unexpected error is encountered.\n *\n * @public\n */\nexport class ProviderError extends Error {\n  name = \"ProviderError\";\n  public readonly tryNextLink: boolean;\n\n  /**\n   * @deprecated constructor should be given a logger.\n   */\n  public constructor(message: string);\n  /**\n   * @deprecated constructor should be given a logger.\n   */\n  public constructor(message: string, tryNextLink: boolean | undefined);\n  /**\n   * This signature is preferred for logging capability.\n   */\n  public constructor(message: string, options: ProviderErrorOptionsType);\n  public constructor(message: string, options: boolean | ProviderErrorOptionsType = true) {\n    let logger: Logger | undefined;\n    let tryNextLink: boolean = true;\n\n    if (typeof options === \"boolean\") {\n      logger = undefined;\n      tryNextLink = options;\n    } else if (options != null && typeof options === \"object\") {\n      logger = options.logger;\n      tryNextLink = options.tryNextLink ?? true;\n    }\n    super(message);\n    this.tryNextLink = tryNextLink;\n    Object.setPrototypeOf(this, ProviderError.prototype);\n    logger?.debug?.(`@smithy/property-provider ${tryNextLink ? \"->\" : \"(!)\"} ${message}`);\n  }\n\n  /**\n   * @deprecated use new operator.\n   */\n  static from(error: Error, options: boolean | ProviderErrorOptionsType = true): ProviderError {\n    return Object.assign(new this(error.message, options as ProviderErrorOptionsType), error);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/TokenProviderError.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { ProviderError } from \"./ProviderError\";\nimport { TokenProviderError } from \"./TokenProviderError\";\n\ndescribe(TokenProviderError.name, () => {\n  it(\"should be named as TokenProviderError\", () => {\n    expect(new TokenProviderError(\"PANIC\").name).toBe(\"TokenProviderError\");\n  });\n\n  describe.each([Error, ProviderError, TokenProviderError])(\"should be instanceof %p\", (classConstructor) => {\n    it(\"when created using constructor\", () => {\n      expect(new TokenProviderError(\"PANIC\")).toBeInstanceOf(classConstructor);\n    });\n\n    it(\"when created using from()\", () => {\n      expect(TokenProviderError.from(new Error(\"PANIC\"))).toBeInstanceOf(classConstructor);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/TokenProviderError.ts",
    "content": "import { ProviderError, type ProviderErrorOptionsType } from \"./ProviderError\";\n\n/**\n * An error representing a failure of an individual token provider.\n * This error class has special meaning to the {@link chain} method. If a\n * provider in the chain is rejected with an error, the chain will only proceed\n * to the next provider if the value of the `tryNextLink` property on the error\n * is truthy. This allows individual providers to halt the chain and also\n * ensures the chain will stop if an entirely unexpected error is encountered.\n *\n * @public\n */\nexport class TokenProviderError extends ProviderError {\n  name = \"TokenProviderError\";\n\n  /**\n   * @override\n   * @deprecated constructor should be given a logger.\n   */\n  public constructor(message: string);\n  /**\n   * @override\n   * @deprecated constructor should be given a logger.\n   */\n  public constructor(message: string, tryNextLink: boolean | undefined);\n  /**\n   * @override\n   * This signature is preferred for logging capability.\n   */\n  public constructor(message: string, options: ProviderErrorOptionsType);\n  /**\n   * @override\n   */\n  public constructor(message: string, options: boolean | ProviderErrorOptionsType = true) {\n    super(message, options as ProviderErrorOptionsType);\n    Object.setPrototypeOf(this, TokenProviderError.prototype);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/chain.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { ProviderError } from \"./ProviderError\";\nimport { chain } from \"./chain\";\n\nconst resolveStatic = (staticValue: unknown) => vi.fn().mockResolvedValue(staticValue);\nconst rejectWithError = (errorMsg: string) => vi.fn().mockRejectedValue(new Error(errorMsg));\nconst rejectWithProviderError = (errorMsg: string) => vi.fn().mockRejectedValue(new ProviderError(errorMsg));\n\ndescribe(\"chain\", () => {\n  it(\"should distill many credential providers into one\", async () => {\n    const provider = chain(resolveStatic(\"foo\"), resolveStatic(\"bar\"));\n    expect(typeof (await provider())).toBe(\"string\");\n  });\n\n  it(\"should return the resolved value of the first successful promise\", async () => {\n    const expectedOutput = \"foo\";\n    const providers = [\n      rejectWithProviderError(\"Move along\"),\n      rejectWithProviderError(\"Nothing to see here\"),\n      resolveStatic(expectedOutput),\n    ];\n\n    try {\n      const result = await chain(...providers)();\n      expect(result).toBe(expectedOutput);\n    } catch (error) {\n      throw error;\n    }\n\n    expect(providers[0]).toHaveBeenCalledTimes(1);\n    expect(providers[1]).toHaveBeenCalledTimes(1);\n    expect(providers[2]).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"should not invoke subsequent providers once one resolves\", async () => {\n    const expectedOutput = \"foo\";\n    const providers = [\n      rejectWithProviderError(\"Move along\"),\n      resolveStatic(expectedOutput),\n      rejectWithProviderError(\"This provider should not be invoked\"),\n    ];\n\n    try {\n      const result = await chain(...providers)();\n      expect(result).toBe(expectedOutput);\n    } catch (error) {\n      throw error;\n    }\n\n    expect(providers[0]).toHaveBeenCalledTimes(1);\n    expect(providers[1]).toHaveBeenCalledTimes(1);\n    expect(providers[2]).not.toHaveBeenCalled();\n  });\n\n  describe(\"should throw if no provider resolves\", () => {\n    const expectedErrorMsg = \"Last provider failed\";\n\n    it.each([\n      [ProviderError, rejectWithProviderError(expectedErrorMsg)],\n      [Error, rejectWithError(expectedErrorMsg)],\n    ])(\"case %p\", async (errorType, errorProviderMockFn) => {\n      const firstProviderWhichRejects = rejectWithProviderError(\"Move along\");\n      try {\n        await chain(firstProviderWhichRejects, errorProviderMockFn)();\n        throw new Error(\"Should not get here\");\n      } catch (error) {\n        expect(error).toEqual(new errorType(expectedErrorMsg));\n      }\n      expect(firstProviderWhichRejects).toHaveBeenCalledTimes(1);\n      expect(errorProviderMockFn).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  it(\"should halt if an unrecognized error is encountered\", async () => {\n    const expectedErrorMsg = \"Unrelated failure\";\n    const providers = [rejectWithProviderError(\"Move along\"), rejectWithError(expectedErrorMsg), resolveStatic(\"foo\")];\n\n    try {\n      await chain(...providers)();\n      throw new Error(\"Should not get here\");\n    } catch (error) {\n      expect(error).toEqual(new Error(expectedErrorMsg));\n    }\n\n    expect(providers[0]).toHaveBeenCalledTimes(1);\n    expect(providers[1]).toHaveBeenCalledTimes(1);\n    expect(providers[2]).not.toHaveBeenCalled();\n  });\n\n  it(\"should halt if ProviderError explicitly requests it\", async () => {\n    const expectedError = new ProviderError(\"ProviderError with tryNextLink set to false\", false);\n    const providers = [\n      rejectWithProviderError(\"Move along\"),\n      vi.fn().mockRejectedValue(expectedError),\n      resolveStatic(\"foo\"),\n    ];\n\n    try {\n      await chain(...providers)();\n      throw new Error(\"Should not get here\");\n    } catch (error) {\n      expect(error).toEqual(expectedError);\n    }\n\n    expect(providers[0]).toHaveBeenCalledTimes(1);\n    expect(providers[1]).toHaveBeenCalledTimes(1);\n    expect(providers[2]).not.toHaveBeenCalled();\n  });\n\n  it(\"should reject chains with no links\", async () => {\n    try {\n      await chain()();\n      throw new Error(\"Should not get here\");\n    } catch (error) {\n      expect(error).toEqual(new ProviderError(\"No providers in chain\"));\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/chain.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\nimport { ProviderError } from \"./ProviderError\";\n\n/**\n * Compose a single credential provider function from multiple credential\n * providers. The first provider in the argument list will always be invoked;\n * subsequent providers in the list will be invoked in the order in which the\n * were received if the preceding provider did not successfully resolve.\n * If no providers were received or no provider resolves successfully, the\n * returned promise will be rejected.\n *\n * @internal\n */\nexport const chain =\n  <T>(...providers: Array<Provider<T>>): Provider<T> =>\n  async () => {\n    if (providers.length === 0) {\n      throw new ProviderError(\"No providers in chain\");\n    }\n\n    let lastProviderError: Error | undefined;\n    for (const provider of providers) {\n      try {\n        const credentials = await provider();\n        return credentials;\n      } catch (err) {\n        lastProviderError = err;\n        if (err?.tryNextLink) {\n          continue;\n        }\n        throw err;\n      }\n    }\n    throw lastProviderError;\n  };\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/fromValue.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { fromValue } from \"./fromValue\";\n\ndescribe(\"fromStatic\", () => {\n  it(\"should convert a static value into a provider\", async () => {\n    const staticValue = \"staticValue\";\n    const provider = fromValue(staticValue);\n    return expect(provider()).resolves.toStrictEqual(staticValue);\n  });\n\n  it(\"should always return the same promise\", () => {\n    const provider = fromValue(\"string\");\n    const result = provider();\n\n    Array.from({ length: 5 }).forEach(() => {\n      expect(provider()).toStrictEqual(result);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/fromValue.ts",
    "content": "import type { Provider } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const fromValue =\n  <T>(staticValue: T): Provider<T> =>\n  () =>\n    Promise.resolve(staticValue);\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/memoize.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi, type Mock } from \"vitest\";\n\nimport { memoize } from \"./memoize\";\n\ndescribe(\"memoize\", () => {\n  let provider: Mock;\n  const mockReturn = \"foo\";\n  const repeatTimes = 10;\n\n  beforeEach(() => {\n    provider = vi.fn().mockResolvedValue(mockReturn);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"static memoization\", () => {\n    it(\"should cache the resolved provider\", async () => {\n      expect.assertions(repeatTimes * 2 + 1);\n\n      const memoized = memoize(provider);\n      expect(provider).toHaveBeenCalledTimes(0);\n      for (let i = 0; i < repeatTimes; i++) {\n        expect(await memoized()).toStrictEqual(mockReturn);\n        expect(provider).toHaveBeenCalledTimes(1);\n      }\n    });\n\n    it(\"should not make extra request for concurrent calls\", async () => {\n      const memoized = memoize(provider);\n      const results = await Promise.all([...Array(repeatTimes).keys()].map(() => memoized()));\n      expect(provider).toHaveBeenCalledTimes(1);\n      for (const res of results) {\n        expect(res).toStrictEqual(mockReturn);\n      }\n    });\n\n    it(\"should retry provider if previous provider is failed\", async () => {\n      provider\n        .mockReset()\n        .mockRejectedValueOnce(\"Error\")\n        .mockResolvedValueOnce(\"Retry\")\n        .mockRejectedValueOnce(\"Should not call 3rd time\");\n      const memoized = memoize(provider);\n      try {\n        await memoized();\n        fail();\n      } catch (e) {\n        expect(e).toBe(\"Error\");\n      }\n      expect(await memoized()).toBe(\"Retry\");\n      expect(await memoized()).toBe(\"Retry\");\n      expect(provider).toBeCalledTimes(2);\n    });\n\n    it(\"should retry provider if forceRefresh parameter is used\", async () => {\n      provider\n        .mockReset()\n        .mockResolvedValueOnce(\"1st\")\n        .mockResolvedValueOnce(\"2nd\")\n        .mockRejectedValueOnce(\"Should not call 3rd time\");\n      const memoized = memoize(provider);\n      expect(await memoized()).toBe(\"1st\");\n      expect(await memoized()).toBe(\"1st\");\n      expect(await memoized({ forceRefresh: true })).toBe(\"2nd\");\n      expect(await memoized()).toBe(\"2nd\");\n      expect(provider).toBeCalledTimes(2);\n    });\n  });\n\n  describe(\"refreshing memoization\", () => {\n    let isExpired: Mock;\n    let requiresRefresh: Mock;\n\n    beforeEach(() => {\n      isExpired = vi.fn().mockReturnValue(true);\n      requiresRefresh = vi.fn().mockReturnValue(false);\n    });\n\n    describe(\"should not reinvoke the underlying provider while isExpired returns `false`\", () => {\n      const isExpiredFalseTest = async (requiresRefresh?: any) => {\n        isExpired.mockReturnValue(false);\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        expect(provider).toHaveBeenCalledTimes(0);\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        for (const index in [...Array(repeatTimes).keys()]) {\n          expect(await memoized()).toEqual(mockReturn);\n        }\n\n        expect(isExpired).toHaveBeenCalledTimes(repeatTimes);\n        if (requiresRefresh) {\n          expect(requiresRefresh).toHaveBeenCalledTimes(repeatTimes);\n        }\n        expect(provider).toHaveBeenCalledTimes(1);\n      };\n\n      it(\"when requiresRefresh is not passed\", async () => {\n        return isExpiredFalseTest();\n      });\n\n      it(\"when requiresRefresh returns true\", () => {\n        requiresRefresh.mockReturnValue(true);\n        return isExpiredFalseTest(requiresRefresh);\n      });\n    });\n\n    describe(\"should reinvoke the underlying provider when isExpired returns `true`\", () => {\n      const isExpiredTrueTest = async (requiresRefresh?: any) => {\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        for (const index in [...Array(repeatTimes).keys()]) {\n          expect(await memoized()).toEqual(mockReturn);\n        }\n\n        expect(isExpired).toHaveBeenCalledTimes(repeatTimes);\n        if (requiresRefresh) {\n          expect(requiresRefresh).toHaveBeenCalledTimes(repeatTimes);\n        }\n        expect(provider).toHaveBeenCalledTimes(repeatTimes + 1);\n      };\n\n      it(\"when requiresRefresh is not passed\", () => {\n        return isExpiredTrueTest();\n      });\n\n      it(\"when requiresRefresh returns true\", () => {\n        requiresRefresh.mockReturnValue(true);\n        return isExpiredTrueTest(requiresRefresh);\n      });\n    });\n\n    describe(\"when called with forceRefresh set to `true`\", () => {\n      it(\"should reinvoke the underlying provider even if isExpired returns false\", async () => {\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        isExpired.mockReturnValue(false);\n        for (let i = 0; i < repeatTimes; i++) {\n          expect(await memoized({ forceRefresh: true })).toEqual(mockReturn);\n        }\n        expect(provider).toHaveBeenCalledTimes(repeatTimes);\n      });\n\n      it(\"should reinvoke the underlying provider even if requiresRefresh returns false\", async () => {\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        requiresRefresh.mockReturnValue(false);\n        for (let i = 0; i < repeatTimes; i++) {\n          expect(await memoized({ forceRefresh: true })).toEqual(mockReturn);\n        }\n        expect(provider).toHaveBeenCalledTimes(repeatTimes);\n      });\n    });\n\n    describe(\"when `requiresRefresh` returns `false`\", () => {\n      const requiresRefreshFalseTest = async () => {\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        const result = memoized();\n        expect(await result).toBe(mockReturn);\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        for (const index in [...Array(repeatTimes).keys()]) {\n          expect(memoized()).toStrictEqual(result);\n          expect(provider).toHaveBeenCalledTimes(1);\n        }\n\n        expect(requiresRefresh).toHaveBeenCalledTimes(1);\n        expect(isExpired).not.toHaveBeenCalled();\n      };\n\n      it(\"should return the same promise for invocations 2-infinity if isExpired returns true\", () => {\n        return requiresRefreshFalseTest();\n      });\n\n      it(\"should return the same promise for invocations 2-infinity if isExpired returns false\", () => {\n        isExpired.mockReturnValue(false);\n        return requiresRefreshFalseTest();\n      });\n\n      it(\"should re-evaluate `requiresRefresh` after force refresh\", async () => {\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        for (let i = 0; i < repeatTimes; i++) {\n          expect(await memoized({ forceRefresh: true })).toStrictEqual(mockReturn);\n        }\n        expect(requiresRefresh).toBeCalledTimes(repeatTimes);\n      });\n    });\n\n    describe(\"should not make extra request for concurrent calls\", () => {\n      const requiresRefreshFalseTest = async () => {\n        const memoized = memoize(provider, isExpired, requiresRefresh);\n        const results = await Promise.all([...Array(repeatTimes).keys()].map(() => memoized()));\n        expect(provider).toHaveBeenCalledTimes(1);\n        for (const res of results) {\n          expect(res).toStrictEqual(mockReturn);\n        }\n      };\n\n      it(\"when isExpired returns true\", () => {\n        return requiresRefreshFalseTest();\n      });\n\n      it(\"when isExpired returns false\", () => {\n        isExpired.mockReturnValue(false);\n        return requiresRefreshFalseTest();\n      });\n    });\n\n    it(\"should retry provider if previous provider is failed\", async () => {\n      provider\n        .mockReset()\n        .mockRejectedValueOnce(\"Error\")\n        .mockResolvedValueOnce(\"Retry\")\n        .mockRejectedValueOnce(\"Should not call 3rd time\");\n      isExpired.mockReset().mockReturnValue(false);\n      const memoized = memoize(provider, isExpired);\n      try {\n        await memoized();\n        fail();\n      } catch (e) {\n        expect(e).toBe(\"Error\");\n      }\n      expect(await memoized()).toBe(\"Retry\");\n      expect(await memoized()).toBe(\"Retry\");\n      expect(provider).toBeCalledTimes(2);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/property-provider/memoize.ts",
    "content": "import type { MemoizedProvider, Provider } from \"@smithy/types\";\n\ninterface MemoizeOverload {\n  /**\n   *\n   * Decorates a provider function with either static memoization.\n   *\n   * To create a statically memoized provider, supply a provider as the only\n   * argument to this function. The provider will be invoked once, and all\n   * invocations of the provider returned by `memoize` will return the same\n   * promise object.\n   *\n   * @param provider The provider whose result should be cached indefinitely.\n   */\n  <T>(provider: Provider<T>): MemoizedProvider<T>;\n\n  /**\n   * Decorates a provider function with refreshing memoization.\n   *\n   * @param provider          The provider whose result should be cached.\n   * @param isExpired         A function that will evaluate the resolved value and\n   *                          determine if it is expired. For example, when\n   *                          memoizing AWS credential providers, this function\n   *                          should return `true` when the credential's\n   *                          expiration is in the past (or very near future) and\n   *                          `false` otherwise.\n   * @param requiresRefresh   A function that will evaluate the resolved value and\n   *                          determine if it represents static value or one that\n   *                          will eventually need to be refreshed. For example,\n   *                          AWS credentials that have no defined expiration will\n   *                          never need to be refreshed, so this function would\n   *                          return `true` if the credentials resolved by the\n   *                          underlying provider had an expiration and `false`\n   *                          otherwise.\n   */\n  <T>(\n    provider: Provider<T>,\n    isExpired: (resolved: T) => boolean,\n    requiresRefresh?: (resolved: T) => boolean\n  ): MemoizedProvider<T>;\n}\n\n/**\n * @internal\n */\nexport const memoize: MemoizeOverload = <T>(\n  provider: Provider<T>,\n  isExpired?: (resolved: T) => boolean,\n  requiresRefresh?: (resolved: T) => boolean\n): MemoizedProvider<T> => {\n  let resolved: T;\n  let pending: Promise<T> | undefined;\n  let hasResult: boolean;\n  let isConstant = false;\n  // Wrapper over supplied provider with side effect to handle concurrent invocation.\n  const coalesceProvider: Provider<T> = async () => {\n    if (!pending) {\n      pending = provider();\n    }\n    try {\n      resolved = await pending;\n      hasResult = true;\n      isConstant = false;\n    } finally {\n      pending = undefined;\n    }\n    return resolved;\n  };\n\n  if (isExpired === undefined) {\n    // This is a static memoization; no need to incorporate refreshing unless using forceRefresh;\n    return async (options) => {\n      if (!hasResult || options?.forceRefresh) {\n        resolved = await coalesceProvider();\n      }\n      return resolved;\n    };\n  }\n\n  return async (options) => {\n    if (!hasResult || options?.forceRefresh) {\n      resolved = await coalesceProvider();\n    }\n    if (isConstant) {\n      return resolved;\n    }\n\n    if (requiresRefresh && !requiresRefresh(resolved)) {\n      isConstant = true;\n      return resolved;\n    }\n    if (isExpired(resolved)) {\n      await coalesceProvider();\n      return resolved;\n    }\n    return resolved;\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.4.9\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.4.8\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.4.7\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.4.6\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.4.5\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.4.4\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.4.0\n\n### Minor Changes\n\n- d90999a: export readFile from shared-ini-file-loader\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.3.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.3.3\n\n### Patch Changes\n\n- 7e359e2: remove and ban circular imports\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 60f393e: add mock controls to file loader\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.1.12\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.1.11\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.1.4\n\n### Patch Changes\n\n- d88521e: read config files from paths relative to homedir\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.1.0\n\n### Minor Changes\n\n- 1cdd3be0: new logging-compatible signature for CredentialsProviderError\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.4.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.3.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.3.4\n\n### Patch Changes\n\n- 8fd51967: Process sso-session names with config prefix separator\n\n## 2.3.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.3.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.3.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.3.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.2.8\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.2.7\n\n### Patch Changes\n\n- 68849108: Process config files for profile names containing prefix separator\n\n## 2.2.6\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.2.5\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.2.4\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.2.3\n\n### Patch Changes\n\n- c27879f2: Allow dot, solidus, percent and colon characters in profile names\n\n## 2.2.2\n\n### Patch Changes\n\n- 901cb6c9: Parse profile name with invalid '+' character\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.2.1\n\n### Patch Changes\n\n- 5bd46820: Treat absence of prefix whitespace as section keys when reading ini files\n- 6ae95278: Parse profile name with invalid '@' character\n\n## 2.2.0\n\n### Minor Changes\n\n- d6b4c090: Populate sso-session and services sections when loading config files\n\n### Patch Changes\n\n- 719777c7: Export CONFIG_PREFIX_SEPARATOR from loadSharedConfigFiles\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.1.0\n\n### Minor Changes\n\n- aa86b3fe: Populate subsection using dot separator in section key when parsing INI files\n\n## 2.0.13\n\n### Patch Changes\n\n- 60e88afe: Read values from main settings when parsing INI files\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.8\n\n### Patch Changes\n\n- c4e16cfd: Explicitly check for process.geteuid from global scope\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.6\n\n### Patch Changes\n\n- c07cde00: Cache value returned by os.homedir()\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/shared-ini-file-loader](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/shared-ini-file-loader/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/constants.ts",
    "content": "/**\n * @internal\n */\nexport const CONFIG_PREFIX_SEPARATOR = \".\";\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/externalDataInterceptor.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { externalDataInterceptor } from \"./externalDataInterceptor\";\nimport { getSSOTokenFromFile } from \"./getSSOTokenFromFile\";\nimport { readFile } from \"./readFile\";\n\ndescribe(\"fileMockController\", () => {\n  it(\"intercepts readFile\", async () => {\n    externalDataInterceptor.interceptFile(\"abcd\", \"contents\");\n\n    expect(await readFile(\"abcd\")).toEqual(\"contents\");\n    expect(externalDataInterceptor.getFileRecord()).toEqual({\n      abcd: Promise.resolve(\"contents\"),\n    });\n    expect(await externalDataInterceptor.getFileRecord().abcd).toEqual(\"contents\");\n  });\n\n  it(\"intercepts getSSOTokenFromFile\", async () => {\n    externalDataInterceptor.interceptToken(\"TOKEN\", \"token-contents\");\n\n    expect(await getSSOTokenFromFile(\"TOKEN\")).toEqual(\"token-contents\");\n\n    expect(externalDataInterceptor.getTokenRecord()).toEqual({\n      TOKEN: \"token-contents\",\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/externalDataInterceptor.ts",
    "content": "import { tokenIntercept } from \"./getSSOTokenFromFile\";\nimport { fileIntercept } from \"./readFile\";\n\n/**\n * @internal\n */\nexport const externalDataInterceptor = {\n  getFileRecord() {\n    return fileIntercept;\n  },\n  interceptFile(path: string, contents: string) {\n    fileIntercept[path] = Promise.resolve(contents);\n  },\n  getTokenRecord() {\n    return tokenIntercept;\n  },\n  interceptToken(id: string, contents: any) {\n    tokenIntercept[id] = contents;\n  },\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getConfigData.spec.ts",
    "content": "import { IniSectionType } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { getConfigData } from \"./getConfigData\";\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\n\ndescribe(getConfigData.name, () => {\n  it(\"returns empty for no data\", () => {\n    expect(getConfigData({})).toStrictEqual({});\n  });\n\n  it(\"returns default profile if present\", () => {\n    const mockInput = { default: { key: \"value\" } };\n    expect(getConfigData(mockInput)).toStrictEqual(mockInput);\n  });\n\n  it(\"skips profiles without prefix profile\", () => {\n    const mockInput = { test: { key: \"value\" } };\n    expect(getConfigData(mockInput)).toStrictEqual({});\n  });\n\n  it.each([IniSectionType.SSO_SESSION, IniSectionType.SERVICES])(\"includes sections with '%s' prefix\", (prefix) => {\n    const mockInput = { [[prefix, \"test\"].join(CONFIG_PREFIX_SEPARATOR)]: { key: \"value\" } };\n    expect(getConfigData(mockInput)).toStrictEqual(mockInput);\n\n    // Profile name containing CONFIG_PREFIX_SEPARATOR\n    const profileName = [\"foo\", \"bar\"].join(CONFIG_PREFIX_SEPARATOR);\n    const mockInput2 = { [[prefix, profileName].join(CONFIG_PREFIX_SEPARATOR)]: { key: \"value\" } };\n    expect(getConfigData(mockInput2)).toStrictEqual(mockInput2);\n  });\n\n  describe(\"normalizes profile names\", () => {\n    const getMockProfileData = (profileName: string) =>\n      [1, 2, 3]\n        .map((num) => [`key_${profileName}_${num}`, `value_${profileName}_${num}`])\n        .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});\n\n    const getMockOutput = (profileNames: string[]) =>\n      profileNames.reduce((acc, profileName) => ({ ...acc, [profileName]: getMockProfileData(profileName) }), {});\n\n    const getMockInput = (mockOutput: Record<string, Record<string, string>>) =>\n      Object.entries(mockOutput).reduce(\n        (acc, [key, value]) => ({ ...acc, [[IniSectionType.PROFILE, key].join(CONFIG_PREFIX_SEPARATOR)]: value }),\n        {}\n      );\n\n    it(\"profile containing CONFIG_PREFIX_SEPARATOR\", () => {\n      const profileName = [\"foo\", \"bar\"].join(CONFIG_PREFIX_SEPARATOR);\n      const mockOutput = getMockOutput([profileName]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getConfigData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"single profile\", () => {\n      const mockOutput = getMockOutput([\"one\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getConfigData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"two profiles\", () => {\n      const mockOutput = getMockOutput([\"one\", \"two\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getConfigData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"three profiles\", () => {\n      const mockOutput = getMockOutput([\"one\", \"two\", \"three\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getConfigData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"with default\", () => {\n      const defaultInput = { default: { key: \"value\" } };\n      const mockOutput = getMockOutput([\"one\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getConfigData({ ...defaultInput, ...mockInput })).toStrictEqual({ ...defaultInput, ...mockOutput });\n    });\n\n    it(\"with profileName without prefix\", () => {\n      const profileWithPrefix = { test: { key: \"value\" } };\n      const mockOutput = getMockOutput([\"one\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getConfigData({ ...profileWithPrefix, ...mockInput })).toStrictEqual(mockOutput);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getConfigData.ts",
    "content": "import { IniSectionType, type ParsedIniData } from \"@smithy/types\";\n\nimport { CONFIG_PREFIX_SEPARATOR } from \"./constants\";\n\n/**\n * Returns the config data from parsed ini data.\n * * Returns data for `default`\n * * Returns profile name without prefix.\n * * Returns non-profiles as is.\n */\nexport const getConfigData = (data: ParsedIniData): ParsedIniData =>\n  Object.entries(data)\n    .filter(([key]) => {\n      const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n      if (indexOfSeparator === -1) {\n        // filter out keys which do not contain CONFIG_PREFIX_SEPARATOR.\n        return false;\n      }\n      // Check if prefix is a valid IniSectionType.\n      return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator) as IniSectionType);\n    })\n    // remove profile prefix, if present.\n    .reduce(\n      (acc, [key, value]) => {\n        const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n        const updatedKey =\n          key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;\n        acc[updatedKey] = value;\n        return acc;\n      },\n      {\n        // Populate default profile, if present.\n        ...(data.default && { default: data.default }),\n      } as ParsedIniData\n    );\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getConfigFilepath.spec.ts",
    "content": "import { join } from \"node:path\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { ENV_CONFIG_PATH, getConfigFilepath } from \"./getConfigFilepath\";\nimport { getHomeDir } from \"./getHomeDir\";\n\nvi.mock(\"path\");\nvi.mock(\"./getHomeDir\");\n\ndescribe(getConfigFilepath.name, () => {\n  const mockSeparator = \"/\";\n  const mockHomeDir = \"/mock/home/dir\";\n\n  const mockConfigFilepath = \"/mock/file/path/config\";\n  const defaultConfigFilepath = `${mockHomeDir}/.aws/config`;\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"returns configFilePath from default locations\", () => {\n    vi.mocked(join).mockImplementation((...args) => args.join(mockSeparator));\n    vi.mocked(getHomeDir).mockReturnValue(mockHomeDir);\n    expect(getConfigFilepath()).toStrictEqual(defaultConfigFilepath);\n    expect(getHomeDir).toHaveBeenCalledWith();\n    expect(join).toHaveBeenCalledWith(mockHomeDir, \".aws\", \"config\");\n  });\n\n  it(\"returns configFile from location defined in environment\", () => {\n    const OLD_ENV = process.env;\n    process.env = {\n      ...OLD_ENV,\n      [ENV_CONFIG_PATH]: mockConfigFilepath,\n    };\n    expect(getConfigFilepath()).toStrictEqual(mockConfigFilepath);\n    expect(getHomeDir).not.toHaveBeenCalled();\n    expect(join).not.toHaveBeenCalled();\n    process.env = OLD_ENV;\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getConfigFilepath.ts",
    "content": "import { join } from \"node:path\";\n\nimport { getHomeDir } from \"./getHomeDir\";\n\nexport const ENV_CONFIG_PATH = \"AWS_CONFIG_FILE\";\n\nexport const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), \".aws\", \"config\");\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getCredentialsFilepath.spec.ts",
    "content": "import { join } from \"node:path\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { ENV_CREDENTIALS_PATH, getCredentialsFilepath } from \"./getCredentialsFilepath\";\nimport { getHomeDir } from \"./getHomeDir\";\n\nvi.mock(\"path\");\nvi.mock(\"./getHomeDir\");\n\ndescribe(getCredentialsFilepath.name, () => {\n  const mockSeparator = \"/\";\n  const mockHomeDir = \"/mock/home/dir\";\n\n  const mockConfigFilepath = \"/mock/file/path/credentials\";\n  const defaultConfigFilepath = `${mockHomeDir}/.aws/credentials`;\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"returns configFilePath from default locations\", () => {\n    vi.mocked(join).mockImplementation((...args) => args.join(mockSeparator));\n    vi.mocked(getHomeDir).mockReturnValue(mockHomeDir);\n    expect(getCredentialsFilepath()).toStrictEqual(defaultConfigFilepath);\n    expect(getHomeDir).toHaveBeenCalledWith();\n    expect(join).toHaveBeenCalledWith(mockHomeDir, \".aws\", \"credentials\");\n  });\n\n  it(\"returns configFile from location defined in environment\", () => {\n    const OLD_ENV = process.env;\n    process.env = {\n      ...OLD_ENV,\n      [ENV_CREDENTIALS_PATH]: mockConfigFilepath,\n    };\n    expect(getCredentialsFilepath()).toStrictEqual(mockConfigFilepath);\n    expect(getHomeDir).not.toHaveBeenCalled();\n    expect(join).not.toHaveBeenCalled();\n    process.env = OLD_ENV;\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getCredentialsFilepath.ts",
    "content": "import { join } from \"node:path\";\n\nimport { getHomeDir } from \"./getHomeDir\";\n\nexport const ENV_CREDENTIALS_PATH = \"AWS_SHARED_CREDENTIALS_FILE\";\n\nexport const getCredentialsFilepath = () =>\n  process.env[ENV_CREDENTIALS_PATH] || join(getHomeDir(), \".aws\", \"credentials\");\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getHomeDir.spec.ts",
    "content": "import { homedir } from \"node:os\";\nimport { sep } from \"node:path\";\nimport { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test as it, vi, type Mock } from \"vitest\";\n\nimport { getHomeDir } from \"./getHomeDir\";\n\nvi.mock(\"os\");\n\ndescribe(getHomeDir.name, () => {\n  const mockUid = 1;\n  const mockHOME = \"mockHOME\";\n  const mockUSERPROFILE = \"mockUSERPROFILE\";\n  const mockHOMEPATH = \"mockHOMEPATH\";\n  const mockHOMEDRIVE = \"mockHOMEDRIVE\";\n  const mockHomeDir = \"mockHomeDir\";\n\n  const OLD_ENV = process.env;\n\n  beforeEach(() => {\n    vi.mocked(homedir).mockReturnValue(mockHomeDir);\n    process.env = {\n      ...OLD_ENV,\n      HOME: mockHOME,\n      USERPROFILE: mockUSERPROFILE,\n      HOMEPATH: mockHOMEPATH,\n      HOMEDRIVE: mockHOMEDRIVE,\n    };\n  });\n\n  afterEach(() => {\n    process.env = OLD_ENV;\n    vi.clearAllMocks();\n    vi.resetModules();\n  });\n\n  it(\"returns value in process.env.HOME first\", () => {\n    expect(getHomeDir()).toEqual(mockHOME);\n    expect(homedir).not.toHaveBeenCalled();\n  });\n\n  it(\"returns value in process.env.USERPROFILE second\", () => {\n    process.env = { ...process.env, HOME: undefined };\n    expect(getHomeDir()).toEqual(mockUSERPROFILE);\n    expect(homedir).not.toHaveBeenCalled();\n  });\n\n  describe(\"returns value in HOMEPATH third\", () => {\n    beforeEach(() => {\n      process.env = { ...process.env, HOME: undefined, USERPROFILE: undefined };\n    });\n\n    afterEach(() => {\n      expect(homedir).not.toHaveBeenCalled();\n    });\n\n    it(\"uses value in process.env.HOMEDRIVE if it's set\", () => {\n      expect(getHomeDir()).toEqual(`${mockHOMEDRIVE}${mockHOMEPATH}`);\n    });\n\n    it(\"uses default if process.env.HOMEDRIVE is not set\", () => {\n      process.env = { ...process.env, HOMEDRIVE: undefined };\n      expect(getHomeDir()).toEqual(`C:${sep}${mockHOMEPATH}`);\n    });\n  });\n\n  it(\"returns value from homedir fourth\", () => {\n    const processGeteuidSpy = (vi.spyOn(process, \"geteuid\") as Mock).mockReturnValue(mockUid);\n    process.env = { ...process.env, HOME: undefined, USERPROFILE: undefined, HOMEPATH: undefined };\n    expect(getHomeDir()).toEqual(mockHomeDir);\n    expect(homedir).toHaveBeenCalledTimes(1);\n    expect(processGeteuidSpy).toHaveBeenCalledTimes(1);\n  });\n\n  describe(\"makes one homedir call irrespective of getHomeDir calls\", async () => {\n    const testSingleHomeDirCall = async (num: number) => {\n      const { getHomeDir } = await import(\"./getHomeDir\");\n      process.env = { ...process.env, HOME: undefined, USERPROFILE: undefined, HOMEPATH: undefined };\n\n      expect(homedir).not.toHaveBeenCalled();\n      const homeDirArr = Array(num)\n        .fill(num)\n        .map(() => getHomeDir());\n      expect(homeDirArr).toStrictEqual(Array(num).fill(mockHomeDir));\n\n      // There is one homedir call even through getHomeDir is called num times.\n      expect(homedir).toHaveBeenCalledTimes(1);\n    };\n\n    describe(\"when geteuid is available\", () => {\n      it.each([10, 100, 1000, 10000])(\"calls: %d \", async (num: number) => {\n        const processGeteuidSpy = (vi.spyOn(process, \"geteuid\") as Mock).mockReturnValue(mockUid);\n        expect(processGeteuidSpy).not.toHaveBeenCalled();\n        await testSingleHomeDirCall(num);\n        expect(processGeteuidSpy).toHaveBeenCalledTimes(num);\n      });\n    });\n\n    describe(\"when geteuid is not available\", () => {\n      const OLD_GETEUID = process.geteuid;\n\n      beforeAll(() => {\n        // @ts-ignore Type 'undefined' is not assignable to type '() => number'.\n        process.geteuid = undefined;\n      });\n\n      afterAll(() => {\n        process.geteuid = OLD_GETEUID;\n      });\n\n      it.each([10, 100, 1000, 10000])(\"calls: %d \", testSingleHomeDirCall);\n    });\n  });\n\n  describe(\"makes multiple homedir calls with based on UIDs\", async () => {\n    it.each([2, 10, 100])(\"calls: %d \", async (num: number) => {\n      const { getHomeDir } = await import(\"./getHomeDir\");\n      const processGeteuidSpy = vi.spyOn(process, \"geteuid\") as Mock;\n      processGeteuidSpy.mockReturnValue(mockUid);\n      for (let i = 0; i < num; i++) {\n        processGeteuidSpy.mockReturnValueOnce(mockUid + i);\n      }\n      process.env = { ...process.env, HOME: undefined, USERPROFILE: undefined, HOMEPATH: undefined };\n\n      expect(homedir).not.toHaveBeenCalled();\n      expect(processGeteuidSpy).not.toHaveBeenCalled();\n      const homeDirArr = Array(num)\n        .fill(num)\n        .map(() => getHomeDir());\n      expect(homeDirArr).toStrictEqual(Array(num).fill(mockHomeDir));\n\n      // There is num homedir calls as each call returns different UID\n      expect(homedir).toHaveBeenCalledTimes(num);\n      expect(processGeteuidSpy).toHaveBeenCalledTimes(num);\n\n      const homeDir = getHomeDir();\n      expect(homeDir).toStrictEqual(mockHomeDir);\n\n      // No extra calls made to homedir, as mockUid is same as the first call.\n      expect(homedir).toHaveBeenCalledTimes(num);\n      // Extra call was made to geteuid to get the same UID as the first call.\n      expect(processGeteuidSpy).toHaveBeenCalledTimes(num + 1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getHomeDir.ts",
    "content": "import { homedir } from \"node:os\";\nimport { sep } from \"node:path\";\n\nconst homeDirCache: Record<string, string> = {};\n\nconst getHomeDirCacheKey = (): string => {\n  // geteuid is only available on POSIX platforms (i.e. not Windows or Android).\n  if (process && process.geteuid) {\n    return `${process.geteuid()}`;\n  }\n  return \"DEFAULT\";\n};\n\n/**\n * Get the HOME directory for the current runtime.\n *\n * @internal\n */\nexport const getHomeDir = (): string => {\n  const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env;\n\n  if (HOME) return HOME;\n  if (USERPROFILE) return USERPROFILE;\n  if (HOMEPATH) return `${HOMEDRIVE}${HOMEPATH}`;\n\n  const homeDirCacheKey = getHomeDirCacheKey();\n  if (!homeDirCache[homeDirCacheKey]) homeDirCache[homeDirCacheKey] = homedir();\n\n  return homeDirCache[homeDirCacheKey];\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getProfileName.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport { DEFAULT_PROFILE, ENV_PROFILE, getProfileName } from \"./getProfileName\";\n\ndescribe(getProfileName.name, () => {\n  const OLD_ENV = process.env;\n  const mockProfileNameFromEnv = \"mockProfileNameFromEnv\";\n\n  beforeEach(() => {\n    process.env = {\n      ...OLD_ENV,\n      [ENV_PROFILE]: mockProfileNameFromEnv,\n    };\n  });\n\n  afterEach(() => {\n    process.env = OLD_ENV;\n  });\n\n  it(\"returns profile if present in param\", () => {\n    const profile = \"mockProfile\";\n    expect(getProfileName({ profile })).toBe(profile);\n  });\n\n  it(`returns profile from env var '${ENV_PROFILE}' if present`, () => {\n    expect(getProfileName({})).toBe(mockProfileNameFromEnv);\n  });\n\n  it(`returns profile '${DEFAULT_PROFILE}' as default`, () => {\n    process.env[ENV_PROFILE] = undefined;\n    expect(getProfileName({})).toBe(DEFAULT_PROFILE);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getProfileName.ts",
    "content": "/**\n * @internal\n */\nexport const ENV_PROFILE = \"AWS_PROFILE\";\n\n/**\n * @internal\n */\nexport const DEFAULT_PROFILE = \"default\";\n\n/**\n * Returns profile with priority order code - ENV - default.\n * @internal\n */\nexport const getProfileName = (init: { profile?: string }): string =>\n  init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.spec.ts",
    "content": "import { createHash } from \"node:crypto\";\nimport { join } from \"node:path\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getHomeDir } from \"./getHomeDir\";\nimport { getSSOTokenFilepath } from \"./getSSOTokenFilepath\";\n\nvi.mock(\"crypto\");\nvi.mock(\"./getHomeDir\");\n\ndescribe(getSSOTokenFilepath.name, () => {\n  const mockCacheName = \"mockCacheName\";\n  const mockDigest = vi.fn().mockReturnValue(mockCacheName);\n  const mockUpdate = vi.fn().mockReturnValue({ digest: mockDigest });\n  const mockHomeDir = \"/home/dir\";\n  const mockSsoStartUrl = \"mock_sso_start_url\";\n\n  beforeEach(() => {\n    vi.mocked(createHash).mockReturnValue({ update: mockUpdate } as any);\n    vi.mocked(getHomeDir).mockReturnValue(mockHomeDir);\n  });\n\n  afterEach(() => {\n    expect(createHash).toHaveBeenCalledWith(\"sha1\");\n    vi.clearAllMocks();\n  });\n\n  describe(\"re-throws error\", () => {\n    const mockError = new Error(\"error\");\n\n    it(\"when createHash throws error\", () => {\n      vi.mocked(createHash).mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => getSSOTokenFilepath(mockSsoStartUrl)).toThrow(mockError);\n      expect(mockUpdate).not.toHaveBeenCalled();\n      expect(mockDigest).not.toHaveBeenCalled();\n      expect(getHomeDir).not.toHaveBeenCalled();\n    });\n\n    it(\"when hash.update() throws error\", () => {\n      mockUpdate.mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => getSSOTokenFilepath(mockSsoStartUrl)).toThrow(mockError);\n      expect(mockUpdate).toHaveBeenCalledWith(mockSsoStartUrl);\n      expect(mockDigest).not.toHaveBeenCalled();\n      expect(getHomeDir).not.toHaveBeenCalled();\n    });\n\n    it(\"when hash.digest() throws error\", () => {\n      mockDigest.mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => getSSOTokenFilepath(mockSsoStartUrl)).toThrow(mockError);\n      expect(mockUpdate).toHaveBeenCalledWith(mockSsoStartUrl);\n      expect(mockDigest).toHaveBeenCalledWith(\"hex\");\n      expect(getHomeDir).not.toHaveBeenCalled();\n    });\n\n    it(\"when getHomeDir() throws error\", () => {\n      vi.mocked(getHomeDir).mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => getSSOTokenFilepath(mockSsoStartUrl)).toThrow(mockError);\n      expect(mockUpdate).toHaveBeenCalledWith(mockSsoStartUrl);\n      expect(mockDigest).toHaveBeenCalledWith(\"hex\");\n      expect(getHomeDir).toHaveBeenCalled();\n    });\n  });\n\n  it(\"returns token filepath\", () => {\n    const ssoTokenFilepath = getSSOTokenFilepath(mockSsoStartUrl);\n    expect(ssoTokenFilepath).toStrictEqual(join(mockHomeDir, \".aws\", \"sso\", \"cache\", `${mockCacheName}.json`));\n    expect(mockUpdate).toHaveBeenCalledWith(mockSsoStartUrl);\n    expect(mockDigest).toHaveBeenCalledWith(\"hex\");\n    expect(getHomeDir).toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.ts",
    "content": "import { createHash } from \"node:crypto\";\nimport { join } from \"node:path\";\n\nimport { getHomeDir } from \"./getHomeDir\";\n\n/**\n * Returns the filepath of the file where SSO token is stored.\n * @internal\n */\nexport const getSSOTokenFilepath = (id: string) => {\n  const hasher = createHash(\"sha1\");\n  const cacheName = hasher.update(id).digest(\"hex\");\n  return join(getHomeDir(), \".aws\", \"sso\", \"cache\", `${cacheName}.json`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.spec.ts",
    "content": "import * as promises from \"node:fs/promises\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getSSOTokenFilepath } from \"./getSSOTokenFilepath\";\nimport { getSSOTokenFromFile } from \"./getSSOTokenFromFile\";\n\nvi.mock(\"node:fs/promises\", () => ({ readFile: vi.fn() }));\nvi.mock(\"./getSSOTokenFilepath\");\n\ndescribe(getSSOTokenFromFile.name, () => {\n  const mockSsoStartUrl = \"mock_sso_start_url\";\n  const mockSsoTokenFilepath = \"/home/dir/.aws/sso/cache/mockCacheName.json\";\n\n  const mockToken = {\n    accessToken: \"mockAccessToken\",\n    expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),\n  };\n\n  beforeEach(() => {\n    vi.mocked(getSSOTokenFilepath).mockReturnValue(mockSsoTokenFilepath);\n    (promises.readFile as any).mockResolvedValue(JSON.stringify(mockToken));\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"re-throws if getting SSO Token filepath fails\", async () => {\n    const expectedError = new Error(\"error\");\n    vi.mocked(getSSOTokenFilepath).mockImplementationOnce(() => {\n      throw expectedError;\n    });\n\n    try {\n      await getSSOTokenFromFile(mockSsoStartUrl);\n      fail(`expected ${expectedError}`);\n    } catch (error) {\n      expect(error).toStrictEqual(expectedError);\n    }\n    expect(promises.readFile).not.toHaveBeenCalled();\n  });\n\n  it(\"re-throws if readFile fails\", async () => {\n    const expectedError = new Error(\"error\");\n    (promises.readFile as any).mockRejectedValue(expectedError);\n\n    try {\n      await getSSOTokenFromFile(mockSsoStartUrl);\n      fail(`expected ${expectedError}`);\n    } catch (error) {\n      expect(error).toStrictEqual(expectedError);\n    }\n    expect(promises.readFile).toHaveBeenCalledWith(mockSsoTokenFilepath, \"utf8\");\n  });\n\n  it(\"re-throws if token is not a valid JSON\", async () => {\n    const errMsg = \"Unexpected token\";\n    (promises.readFile as any).mockReturnValue(\"invalid JSON\");\n\n    try {\n      await getSSOTokenFromFile(mockSsoStartUrl);\n      fail(`expected '${errMsg}'`);\n    } catch (error) {\n      expect(error.message).toContain(errMsg);\n    }\n    expect(promises.readFile).toHaveBeenCalledWith(mockSsoTokenFilepath, \"utf8\");\n  });\n\n  it(\"returns token when it's valid\", async () => {\n    const token = await getSSOTokenFromFile(mockSsoStartUrl);\n    expect(token).toStrictEqual(mockToken);\n    expect(promises.readFile).toHaveBeenCalledWith(mockSsoTokenFilepath, \"utf8\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.ts",
    "content": "import { readFile } from \"node:fs/promises\";\n\nimport { getSSOTokenFilepath } from \"./getSSOTokenFilepath\";\n\n/**\n * Cached SSO token retrieved from SSO login flow.\n * @public\n */\nexport interface SSOToken {\n  /**\n   * A base64 encoded string returned by the sso-oidc service.\n   */\n  accessToken: string;\n\n  /**\n   * The expiration time of the accessToken as an RFC 3339 formatted timestamp.\n   */\n  expiresAt: string;\n\n  /**\n   * The token used to obtain an access token in the event that the accessToken is invalid or expired.\n   */\n  refreshToken?: string;\n\n  /**\n   * The unique identifier string for each client. The client ID generated when performing the registration\n   * portion of the OIDC authorization flow. This is used to refresh the accessToken.\n   */\n  clientId?: string;\n\n  /**\n   * A secret string generated when performing the registration portion of the OIDC authorization flow.\n   * This is used to refresh the accessToken.\n   */\n  clientSecret?: string;\n\n  /**\n   * The expiration time of the client registration (clientId and clientSecret) as an RFC 3339 formatted timestamp.\n   */\n  registrationExpiresAt?: string;\n\n  /**\n   * The configured sso_region for the profile that credentials are being resolved for.\n   */\n  region?: string;\n\n  /**\n   * The configured sso_start_url for the profile that credentials are being resolved for.\n   */\n  startUrl?: string;\n}\n\n/**\n * For testing only.\n * @internal\n * @deprecated minimize use in application code.\n */\nexport const tokenIntercept = {} as Record<string, any>;\n\n/**\n * Returns the SSO token from the file system.\n *\n * @internal\n * @param id - can be either a start URL or the SSO session name.\n */\nexport const getSSOTokenFromFile = async (id: string) => {\n  if (tokenIntercept[id]) {\n    return tokenIntercept[id];\n  }\n  const ssoTokenFilepath = getSSOTokenFilepath(id);\n  const ssoTokenText = await readFile(ssoTokenFilepath, \"utf8\");\n  return JSON.parse(ssoTokenText) as SSOToken;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getSsoSessionData.spec.ts",
    "content": "import { IniSectionType } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { getSsoSessionData } from \"./getSsoSessionData\";\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\n\ndescribe(getSsoSessionData.name, () => {\n  it(\"returns empty for no data\", () => {\n    expect(getSsoSessionData({})).toStrictEqual({});\n  });\n\n  it(\"skips sections without prefix sso-session\", () => {\n    const mockInput = { test: { key: \"value\" } };\n    expect(getSsoSessionData(mockInput)).toStrictEqual({});\n  });\n\n  it(\"skips sections with different prefix\", () => {\n    const mockInput = { \"not-sso-session test\": { key: \"value\" } };\n    expect(getSsoSessionData(mockInput)).toStrictEqual({});\n  });\n\n  describe(\"normalizes sso-session names\", () => {\n    const getMockSsoSessionData = (ssoSessionName: string) =>\n      [1, 2, 3]\n        .map((num) => [`key_${ssoSessionName}_${num}`, `value_${ssoSessionName}_${num}`])\n        .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});\n\n    const getMockOutput = (ssoSessionNames: string[]) =>\n      ssoSessionNames.reduce((acc, profileName) => ({ ...acc, [profileName]: getMockSsoSessionData(profileName) }), {});\n\n    const getMockInput = (mockOutput: { [key: string]: { [key: string]: string } }) =>\n      Object.entries(mockOutput).reduce(\n        (acc, [key, value]) => ({ ...acc, [[IniSectionType.SSO_SESSION, key].join(CONFIG_PREFIX_SEPARATOR)]: value }),\n        {}\n      );\n\n    it(`sso-session section with prefix separator ${CONFIG_PREFIX_SEPARATOR}`, () => {\n      const mockOutput = getMockOutput([[\"prefix\", \"suffix\"].join(CONFIG_PREFIX_SEPARATOR)]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getSsoSessionData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"single sso-session section\", () => {\n      const mockOutput = getMockOutput([\"one\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getSsoSessionData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"two sso-session sections\", () => {\n      const mockOutput = getMockOutput([\"one\", \"two\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getSsoSessionData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"three sso-session sections\", () => {\n      const mockOutput = getMockOutput([\"one\", \"two\", \"three\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getSsoSessionData(mockInput)).toStrictEqual(mockOutput);\n    });\n\n    it(\"with section without prefix\", () => {\n      const sectionWithoutPrefix = { test: { key: \"value\" } };\n      const mockOutput = getMockOutput([\"one\"]);\n      const mockInput = getMockInput(mockOutput);\n      expect(getSsoSessionData({ ...sectionWithoutPrefix, ...mockInput })).toStrictEqual(mockOutput);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/getSsoSessionData.ts",
    "content": "import { IniSectionType, type ParsedIniData } from \"@smithy/types\";\n\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\n\n/**\n * Returns the sso-session data from parsed ini data by reading\n * ssoSessionName after sso-session prefix including/excluding quotes\n */\nexport const getSsoSessionData = (data: ParsedIniData): ParsedIniData =>\n  Object.entries(data)\n    // filter out non sso-session keys\n    .filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))\n    // replace sso-session key with sso-session name\n    .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getConfigData } from \"./getConfigData\";\nimport { getConfigFilepath } from \"./getConfigFilepath\";\nimport { getCredentialsFilepath } from \"./getCredentialsFilepath\";\nimport { getHomeDir } from \"./getHomeDir\";\nimport { loadSharedConfigFiles } from \"./loadSharedConfigFiles\";\nimport { parseIni } from \"./parseIni\";\nimport { readFile } from \"./readFile\";\n\nvi.mock(\"./getConfigData\");\nvi.mock(\"./getConfigFilepath\");\nvi.mock(\"./getCredentialsFilepath\");\nvi.mock(\"./parseIni\");\nvi.mock(\"./readFile\");\nvi.mock(\"./getHomeDir\");\n\ndescribe(\"loadSharedConfigFiles\", () => {\n  const mockConfigFilepath = \"/mock/file/path/config\";\n  const mockCredsFilepath = \"/mock/file/path/credentials\";\n  const mockSharedConfigFiles = {\n    configFile: mockConfigFilepath,\n    credentialsFile: mockCredsFilepath,\n  };\n  const mockHomeDir = \"/users/alias\";\n\n  beforeEach(() => {\n    vi.mocked(getConfigFilepath).mockReturnValue(mockConfigFilepath);\n    vi.mocked(getCredentialsFilepath).mockReturnValue(mockCredsFilepath);\n    vi.mocked(parseIni).mockImplementation((args: any) => args);\n    vi.mocked(getConfigData).mockImplementation((args) => args);\n    vi.mocked(readFile).mockImplementation((path) => Promise.resolve(path));\n    vi.mocked(getHomeDir).mockReturnValue(mockHomeDir);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n    vi.resetModules();\n  });\n\n  it(\"returns configFile and credentialsFile from default locations\", async () => {\n    const sharedConfigFiles = await loadSharedConfigFiles();\n    expect(sharedConfigFiles).toStrictEqual(mockSharedConfigFiles);\n    expect(getConfigFilepath).toHaveBeenCalledWith();\n    expect(getCredentialsFilepath).toHaveBeenCalledWith();\n  });\n\n  it(\"returns configFile and credentialsFile from init if defined\", async () => {\n    const sharedConfigFiles = await loadSharedConfigFiles({\n      filepath: mockCredsFilepath,\n      configFilepath: mockConfigFilepath,\n    });\n    expect(sharedConfigFiles).toStrictEqual(mockSharedConfigFiles);\n    expect(getConfigFilepath).not.toHaveBeenCalled();\n    expect(getCredentialsFilepath).not.toHaveBeenCalled();\n  });\n\n  it(\"expands homedir in configFile and credentialsFile from init if defined\", async () => {\n    const sharedConfigFiles = await loadSharedConfigFiles({\n      filepath: \"~/path/credentials\",\n      configFilepath: \"~/path/config\",\n    });\n    expect(sharedConfigFiles).toStrictEqual({\n      configFile: \"/users/alias/path/config\",\n      credentialsFile: \"/users/alias/path/credentials\",\n    });\n    expect(getHomeDir).toHaveBeenCalled();\n    expect(getConfigFilepath).not.toHaveBeenCalled();\n    expect(getCredentialsFilepath).not.toHaveBeenCalled();\n  });\n\n  describe(\"swallows error and returns empty configuration\", () => {\n    it(\"when readFile throws error\", async () => {\n      vi.mocked(readFile).mockRejectedValue(\"error\");\n      const sharedConfigFiles = await loadSharedConfigFiles();\n      expect(sharedConfigFiles).toStrictEqual({ configFile: {}, credentialsFile: {} });\n    });\n\n    it(\"when parseIni throws error\", async () => {\n      vi.mocked(parseIni).mockRejectedValue(\"error\");\n      const sharedConfigFiles = await loadSharedConfigFiles();\n      expect(sharedConfigFiles).toStrictEqual({ configFile: {}, credentialsFile: {} });\n    });\n\n    it(\"when normalizeConfigFile throws error\", async () => {\n      vi.mocked(getConfigData).mockRejectedValue(\"error\");\n      const sharedConfigFiles = await loadSharedConfigFiles();\n      expect(sharedConfigFiles).toStrictEqual({\n        configFile: {},\n        credentialsFile: mockCredsFilepath,\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.ts",
    "content": "import { join } from \"node:path\";\nimport type { Logger, SharedConfigFiles } from \"@smithy/types\";\n\nimport { getConfigData } from \"./getConfigData\";\nimport { getConfigFilepath } from \"./getConfigFilepath\";\nimport { getCredentialsFilepath } from \"./getCredentialsFilepath\";\nimport { getHomeDir } from \"./getHomeDir\";\nimport { parseIni } from \"./parseIni\";\nimport { readFile } from \"./readFile\";\n\n/**\n * @public\n */\nexport interface SharedConfigInit {\n  /**\n   * The path at which to locate the ini credentials file. Defaults to the\n   * value of the `AWS_SHARED_CREDENTIALS_FILE` environment variable (if\n   * defined) or `~/.aws/credentials` otherwise.\n   */\n  filepath?: string;\n\n  /**\n   * The path at which to locate the ini config file. Defaults to the value of\n   * the `AWS_CONFIG_FILE` environment variable (if defined) or\n   * `~/.aws/config` otherwise.\n   */\n  configFilepath?: string;\n\n  /**\n   * Configuration files are normally cached after the first time they are loaded. When this\n   * property is set, the provider will always reload any configuration files loaded before.\n   */\n  ignoreCache?: boolean;\n\n  /**\n   * For credential resolution trace logging.\n   */\n  logger?: Logger;\n}\n\nconst swallowError = () => ({});\n\nexport { CONFIG_PREFIX_SEPARATOR } from \"./constants\";\n\n/**\n * Loads the config and credentials files.\n * @internal\n */\nexport const loadSharedConfigFiles = async (init: SharedConfigInit = {}): Promise<SharedConfigFiles> => {\n  const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;\n  const homeDir = getHomeDir();\n  const relativeHomeDirPrefix = \"~/\";\n\n  let resolvedFilepath = filepath;\n  if (filepath.startsWith(relativeHomeDirPrefix)) {\n    resolvedFilepath = join(homeDir, filepath.slice(2));\n  }\n\n  let resolvedConfigFilepath = configFilepath;\n  if (configFilepath.startsWith(relativeHomeDirPrefix)) {\n    resolvedConfigFilepath = join(homeDir, configFilepath.slice(2));\n  }\n\n  const parsedFiles = await Promise.all([\n    readFile(resolvedConfigFilepath, {\n      ignoreCache: init.ignoreCache,\n    })\n      .then(parseIni)\n      .then(getConfigData)\n      .catch(swallowError),\n    readFile(resolvedFilepath, {\n      ignoreCache: init.ignoreCache,\n    })\n      .then(parseIni)\n      .catch(swallowError),\n  ]);\n\n  return {\n    configFile: parsedFiles[0],\n    credentialsFile: parsedFiles[1],\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/loadSsoSessionData.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getConfigFilepath } from \"./getConfigFilepath\";\nimport { getSsoSessionData } from \"./getSsoSessionData\";\nimport { loadSsoSessionData } from \"./loadSsoSessionData\";\nimport { parseIni } from \"./parseIni\";\nimport { readFile } from \"./readFile\";\n\nvi.mock(\"./getConfigFilepath\");\nvi.mock(\"./getSsoSessionData\");\nvi.mock(\"./parseIni\");\nvi.mock(\"./readFile\");\n\ndescribe(loadSsoSessionData.name, () => {\n  const mockConfigFilepath = \"/mock/file/path/config\";\n  const mockSsoSessionData = { test: { key: \"value\" } };\n\n  beforeEach(() => {\n    vi.mocked(getConfigFilepath).mockReturnValue(mockConfigFilepath);\n    vi.mocked(parseIni).mockImplementation((args: any) => args);\n    vi.mocked(getSsoSessionData).mockReturnValue(mockSsoSessionData);\n    vi.mocked(readFile).mockImplementation((path) => Promise.resolve(path));\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"returns configFile from default locations\", async () => {\n    const ssoSessionData = await loadSsoSessionData();\n    expect(ssoSessionData).toStrictEqual(mockSsoSessionData);\n    expect(getConfigFilepath).toHaveBeenCalledWith();\n  });\n\n  it(\"returns configFile from init if defined\", async () => {\n    const ssoSessionData = await loadSsoSessionData({\n      configFilepath: mockConfigFilepath,\n    });\n    expect(ssoSessionData).toStrictEqual(mockSsoSessionData);\n    expect(getConfigFilepath).not.toHaveBeenCalled();\n  });\n\n  describe(\"swallows error and returns empty configuration\", () => {\n    it(\"when readFile throws error\", async () => {\n      vi.mocked(readFile).mockRejectedValue(\"error\");\n      const ssoSessionData = await loadSsoSessionData();\n      expect(ssoSessionData).toStrictEqual({});\n    });\n\n    it(\"when parseIni throws error\", async () => {\n      vi.mocked(parseIni).mockRejectedValue(\"error\");\n      const ssoSessionData = await loadSsoSessionData();\n      expect(ssoSessionData).toStrictEqual({});\n    });\n\n    it(\"when normalizeConfigFile throws error\", async () => {\n      vi.mocked(getSsoSessionData).mockRejectedValue(\"error\");\n      const ssoSessionData = await loadSsoSessionData();\n      expect(ssoSessionData).toStrictEqual({});\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/loadSsoSessionData.ts",
    "content": "import type { ParsedIniData } from \"@smithy/types\";\n\nimport { getConfigFilepath } from \"./getConfigFilepath\";\nimport { getSsoSessionData } from \"./getSsoSessionData\";\nimport { parseIni } from \"./parseIni\";\nimport { readFile } from \"./readFile\";\n\n/**\n * Subset of {@link SharedConfigInit}.\n * @internal\n */\nexport interface SsoSessionInit {\n  /**\n   * The path at which to locate the ini config file. Defaults to the value of\n   * the `AWS_CONFIG_FILE` environment variable (if defined) or\n   * `~/.aws/config` otherwise.\n   */\n  configFilepath?: string;\n}\n\nconst swallowError = () => ({});\n\n/**\n * @internal\n */\nexport const loadSsoSessionData = async (init: SsoSessionInit = {}): Promise<ParsedIniData> =>\n  readFile(init.configFilepath ?? getConfigFilepath())\n    .then(parseIni)\n    .then(getSsoSessionData)\n    .catch(swallowError);\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/mergeConfigFiles.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { mergeConfigFiles } from \"./mergeConfigFiles\";\n\ndescribe(mergeConfigFiles.name, () => {\n  it(\"merges profiles that are in multiple files\", () => {\n    const mockConfigFile = {\n      profileName1: { configKey: \"configValue1\" },\n    };\n    const mockCredentialsFile = {\n      profileName1: { credsKey: \"configValue1\" },\n      profileName2: { credsKey: \"credsValue1\" },\n    };\n\n    expect(mergeConfigFiles(mockConfigFile, mockCredentialsFile)).toMatchInlineSnapshot(`\n      {\n        \"profileName1\": {\n          \"configKey\": \"configValue1\",\n          \"credsKey\": \"configValue1\",\n        },\n        \"profileName2\": {\n          \"credsKey\": \"credsValue1\",\n        },\n      }\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/mergeConfigFiles.ts",
    "content": "import type { ParsedIniData } from \"@smithy/types\";\n\n/**\n * Merge multiple profile config files such that settings each file are kept together\n *\n * @internal\n */\nexport const mergeConfigFiles = (...files: ParsedIniData[]): ParsedIniData => {\n  const merged: ParsedIniData = {};\n  for (const file of files) {\n    for (const [key, values] of Object.entries(file)) {\n      if (merged[key] !== undefined) {\n        Object.assign(merged[key], values);\n      } else {\n        merged[key] = values;\n      }\n    }\n  }\n  return merged;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/parseIni.spec.ts",
    "content": "import { IniSectionType } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\nimport { parseIni } from \"./parseIni\";\n\ndescribe(parseIni.name, () => {\n  it.each([\"__proto__\", \"profile __proto__\"])(\"throws error if profile name is '%s'\", (deniedProfileName) => {\n    const initData = `[${deniedProfileName}]\\nfoo = not_exist`;\n    expect(() => {\n      parseIni(initData);\n    }).toThrowError(`Found invalid profile name \"${deniedProfileName}\"`);\n  });\n\n  describe(\"parses config for other keys\", () => {\n    const mockProfileName = \"mock_profile_name\";\n    const mockProfileData = { key: \"value\" };\n\n    const getMockProfileDataEntries = (profileData: Record<string, string | Record<string, string>>) =>\n      Object.entries(profileData).map(([key, value]) => {\n        let result = `${key}=`;\n        if (typeof value === \"string\") {\n          result += `${value}`;\n        } else {\n          result += `\\n    ${getMockProfileDataEntries(value).join(\"\\n    \")}`;\n        }\n        return result;\n      });\n\n    const getMockProfileContent = (profileName: string, profileData: Record<string, string | Record<string, string>>) =>\n      `[${profileName}]\\n${getMockProfileDataEntries(profileData).join(\"\\n\")}\\n`;\n\n    it(\"trims data from key/value\", () => {\n      const mockInput = `[${mockProfileName}]\\n  ${Object.entries(mockProfileData)\n        .map(([key, value]) => ` ${key} = ${value} `)\n        .join(\"\\n\")}`;\n      expect(parseIni(mockInput)).toStrictEqual({\n        [mockProfileName]: mockProfileData,\n      });\n    });\n\n    it(\"returns value with equals sign\", () => {\n      const mockProfileDataWithEqualsSign = { key: \"value=value\" };\n      const mockInput = getMockProfileContent(mockProfileName, mockProfileDataWithEqualsSign);\n      expect(parseIni(mockInput)).toStrictEqual({\n        [mockProfileName]: mockProfileDataWithEqualsSign,\n      });\n    });\n\n    it.each(Object.values(IniSectionType))(\n      \"returns data for section '%s' with separator\",\n      (sectionType: IniSectionType) => {\n        const mockSectionName = \"mock_section_name\";\n        const mockSectionFullName = [sectionType, mockSectionName].join(\" \");\n        const mockInput = getMockProfileContent(mockSectionFullName, mockProfileData);\n        expect(parseIni(mockInput)).toStrictEqual({\n          [[sectionType, mockSectionName].join(CONFIG_PREFIX_SEPARATOR)]: mockProfileData,\n        });\n      }\n    );\n\n    // Some characters are not allowed in profile name, but we parse them as customers use them.\n    // `@` https://github.com/smithy-lang/smithy-typescript/issues/1026\n    // `+` https://github.com/aws/aws-sdk-js-v3/issues/5373\n    // `.` https://github.com/aws/aws-sdk-js-v3/issues/5449\n    // `/` https://github.com/smithy-lang/smithy-typescript/issues/1053\n    // `%` https://github.com/aws/aws-sdk-java-v2/pull/1538\n    // `:` https://github.com/aws/aws-sdk-java-v2/pull/1898\n    it.each([\"-\", \"_\", \"@\", \"+\", \".\", \"/\", \"%\", \":\"])(\n      \"returns data for character '%s' in profile name\",\n      (specialChar: string) => {\n        const mockProfileName = [\"profile\", \"stage\"].join(specialChar);\n        const mockSectionFullName = [\"profile\", mockProfileName].join(\" \");\n        const mockInput = getMockProfileContent(mockSectionFullName, mockProfileData);\n        expect(parseIni(mockInput)).toStrictEqual({\n          [[\"profile\", mockProfileName].join(CONFIG_PREFIX_SEPARATOR)]: mockProfileData,\n        });\n      }\n    );\n\n    it(\"returns data for two profiles\", () => {\n      const mockProfile1 = getMockProfileContent(mockProfileName, mockProfileData);\n\n      const mockProfileName2 = \"mock_profile_name_2\";\n      const mockProfileData2 = { key2: \"value2\" };\n      const mockProfile2 = getMockProfileContent(mockProfileName2, mockProfileData2);\n\n      expect(parseIni(`${mockProfile1}${mockProfile2}`)).toStrictEqual({\n        [mockProfileName]: mockProfileData,\n        [mockProfileName2]: mockProfileData2,\n      });\n    });\n\n    it(\"skip section if data is not present\", () => {\n      const mockProfileNameWithoutData = \"mock_profile_name_without_data\";\n      const mockInput = getMockProfileContent(mockProfileName, mockProfileData);\n      expect(parseIni(`${mockInput}[${mockProfileNameWithoutData}]`)).toStrictEqual({\n        [mockProfileName]: mockProfileData,\n      });\n      expect(parseIni(`[${mockProfileNameWithoutData}]\\n${mockInput}`)).toStrictEqual({\n        [mockProfileName]: mockProfileData,\n      });\n    });\n\n    it(\"returns data for profile containing multiple entries\", () => {\n      const mockProfileDataMultipleEntries = { key1: \"value1\", key2: \"value2\", key3: \"value3\" };\n      const mockInput = getMockProfileContent(mockProfileName, mockProfileDataMultipleEntries);\n      expect(parseIni(mockInput)).toStrictEqual({\n        [mockProfileName]: mockProfileDataMultipleEntries,\n      });\n    });\n\n    describe(\"returns data from main section, and not subsection\", () => {\n      it(\"if subsection comes after section\", () => {\n        const mockProfileDataWithSubSettings = {\n          key: \"keyValue\",\n          subSection: {\n            key: \"keyValueInSubSection\",\n            subKey: \"subKeyValue\",\n          },\n        };\n        const mockInput = getMockProfileContent(mockProfileName, mockProfileDataWithSubSettings);\n        expect(parseIni(mockInput)).toStrictEqual({\n          [mockProfileName]: {\n            key: \"keyValue\",\n            [[\"subSection\", \"key\"].join(CONFIG_PREFIX_SEPARATOR)]: \"keyValueInSubSection\",\n            [[\"subSection\", \"subKey\"].join(CONFIG_PREFIX_SEPARATOR)]: \"subKeyValue\",\n          },\n        });\n\n        const mockProfileName2 = \"mock_profile_name_2\";\n        const mockProfileDataWithSubSettings2 = {\n          key: \"keyValue2\",\n          subSection: {\n            key: \"keyValue2InSubSection\",\n            subKey: \"subKeyValue2\",\n          },\n        };\n        const mockInput2 = getMockProfileContent(mockProfileName2, mockProfileDataWithSubSettings2);\n        expect(parseIni(`${mockInput}${mockInput2}`)).toStrictEqual({\n          [mockProfileName]: {\n            key: \"keyValue\",\n            [[\"subSection\", \"key\"].join(CONFIG_PREFIX_SEPARATOR)]: \"keyValueInSubSection\",\n            [[\"subSection\", \"subKey\"].join(CONFIG_PREFIX_SEPARATOR)]: \"subKeyValue\",\n          },\n          [mockProfileName2]: {\n            key: \"keyValue2\",\n            [[\"subSection\", \"key\"].join(CONFIG_PREFIX_SEPARATOR)]: \"keyValue2InSubSection\",\n            [[\"subSection\", \"subKey\"].join(CONFIG_PREFIX_SEPARATOR)]: \"subKeyValue2\",\n          },\n        });\n      });\n\n      it(\"if subsection comes before section\", () => {\n        const mockProfileDataWithSubSettings = {\n          subSection: {\n            key: \"keyValueInSubSection\",\n            subKey: \"subKeyValue\",\n          },\n          key: \"keyValue\",\n        };\n        const mockInput = getMockProfileContent(mockProfileName, mockProfileDataWithSubSettings);\n        expect(parseIni(mockInput)).toStrictEqual({\n          [mockProfileName]: {\n            [[\"subSection\", \"key\"].join(CONFIG_PREFIX_SEPARATOR)]: \"keyValueInSubSection\",\n            [[\"subSection\", \"subKey\"].join(CONFIG_PREFIX_SEPARATOR)]: \"subKeyValue\",\n            key: \"keyValue\",\n          },\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/parseIni.ts",
    "content": "import { IniSectionType, type ParsedIniData } from \"@smithy/types\";\n\nimport { CONFIG_PREFIX_SEPARATOR } from \"./constants\";\n\nconst prefixKeyRegex = /^([\\w-]+)\\s([\"'])?([\\w-@\\+\\.%:/]+)\\2$/;\nconst profileNameBlockList = [\"__proto__\", \"profile __proto__\"];\n\nexport const parseIni = (iniData: string): ParsedIniData => {\n  const map: ParsedIniData = {};\n\n  let currentSection: string | undefined;\n  let currentSubSection: string | undefined;\n\n  for (const iniLine of iniData.split(/\\r?\\n/)) {\n    const trimmedLine = iniLine.split(/(^|\\s)[;#]/)[0].trim(); // remove comments and trim\n    const isSection: boolean = trimmedLine[0] === \"[\" && trimmedLine[trimmedLine.length - 1] === \"]\";\n    if (isSection) {\n      // New section found. Reset currentSection and currentSubSection.\n      currentSection = undefined;\n      currentSubSection = undefined;\n\n      const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);\n      const matches = prefixKeyRegex.exec(sectionName);\n      if (matches) {\n        const [, prefix, , name] = matches;\n        // Add prefix, if the section name starts with `profile`, `sso-session` or `services`.\n        if (Object.values(IniSectionType).includes(prefix as IniSectionType)) {\n          currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);\n        }\n      } else {\n        // If the section name does not match the regex, use the section name as is.\n        currentSection = sectionName;\n      }\n\n      if (profileNameBlockList.includes(sectionName)) {\n        throw new Error(`Found invalid profile name \"${sectionName}\"`);\n      }\n    } else if (currentSection) {\n      const indexOfEqualsSign = trimmedLine.indexOf(\"=\");\n      if (![0, -1].includes(indexOfEqualsSign)) {\n        const [name, value]: [string, string] = [\n          trimmedLine.substring(0, indexOfEqualsSign).trim(),\n          trimmedLine.substring(indexOfEqualsSign + 1).trim(),\n        ];\n        if (value === \"\") {\n          currentSubSection = name;\n        } else {\n          if (currentSubSection && iniLine.trimStart() === iniLine) {\n            // Reset currentSubSection if there is no whitespace\n            currentSubSection = undefined;\n          }\n          map[currentSection] = map[currentSection] || {};\n          const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;\n          map[currentSection][key] = value;\n        }\n      }\n    }\n  }\n\n  return map;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/parseKnownFiles.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { loadSharedConfigFiles } from \"./loadSharedConfigFiles\";\nimport { parseKnownFiles } from \"./parseKnownFiles\";\n\nvi.mock(\"./loadSharedConfigFiles\");\n\ndescribe(parseKnownFiles.name, () => {\n  const mockConfigFile = {\n    profileName1: { configKey1: \"configValue1\" },\n    profileName2: { configKey2: \"configValue2\" },\n  };\n  const mockCredentialsFile = {\n    profileName1: { credsKey1: \"credsValue1\" },\n    profileName2: { credsKey2: \"credsValue2\" },\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"gets parsedFiles from loadSharedConfigFiles\", async () => {\n    vi.mocked(loadSharedConfigFiles).mockReturnValue(\n      Promise.resolve({\n        configFile: mockConfigFile,\n        credentialsFile: mockCredentialsFile,\n      })\n    );\n    const mockInit = { profile: \"mockProfile\" };\n    const parsedFiles = await parseKnownFiles(mockInit);\n\n    expect(loadSharedConfigFiles).toHaveBeenCalledWith(mockInit);\n    expect(parsedFiles).toMatchInlineSnapshot(`\n      {\n        \"profileName1\": {\n          \"configKey1\": \"configValue1\",\n          \"credsKey1\": \"credsValue1\",\n        },\n        \"profileName2\": {\n          \"configKey2\": \"configValue2\",\n          \"credsKey2\": \"credsValue2\",\n        },\n      }\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/parseKnownFiles.ts",
    "content": "import type { ParsedIniData } from \"@smithy/types\";\n\nimport { loadSharedConfigFiles, type SharedConfigInit } from \"./loadSharedConfigFiles\";\nimport { mergeConfigFiles } from \"./mergeConfigFiles\";\n\n/**\n * @public\n */\nexport interface SourceProfileInit extends SharedConfigInit {\n  /**\n   * The configuration profile to use.\n   */\n  profile?: string;\n}\n\n/**\n * Load profiles from credentials and config INI files and normalize them into a\n * single profile list.\n *\n * @internal\n */\nexport const parseKnownFiles = async (init: SourceProfileInit): Promise<ParsedIniData> => {\n  const parsedFiles = await loadSharedConfigFiles(init);\n  return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/readFile.spec.ts",
    "content": "import * as promises from \"node:fs/promises\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nvi.mock(\"node:fs/promises\", () => ({ readFile: vi.fn() }));\n\ndescribe(\"readFile\", () => {\n  const UTF8 = \"utf8\";\n  const getMockFileContents = (path: string, options = UTF8) => JSON.stringify({ path, options });\n\n  beforeEach(() => {\n    (promises.readFile as any).mockImplementation(async (path: any, options: any) => {\n      await new Promise((resolve) => setTimeout(resolve, 100));\n      return getMockFileContents(path, options);\n    });\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n    vi.resetModules();\n  });\n\n  describe(\"makes one fs.readFile call for a filepath irrespective of smithy.readFile calls\", () => {\n    it.each([10, 100, 1000, 10000])(\"parallel calls: %d \", async (num: number) => {\n      const { readFile } = await import(\"./readFile\");\n      const mockPath = \"/mock/path\";\n      const mockPathContent = getMockFileContents(mockPath);\n\n      expect(promises.readFile).not.toHaveBeenCalled();\n      const fileContentArr = await Promise.all(Array(num).fill(readFile(mockPath)));\n      expect(fileContentArr).toStrictEqual(Array(num).fill(mockPathContent));\n\n      // There is one fs.readFile call even through smithy.readFile is called in parallel num times.\n      expect(promises.readFile).toHaveBeenCalledTimes(1);\n      expect(promises.readFile).toHaveBeenCalledWith(mockPath, UTF8);\n    });\n\n    it(\"two parallel calls and one sequential call\", async () => {\n      const { readFile } = await import(\"./readFile\");\n      const mockPath = \"/mock/path\";\n      const mockPathContent = getMockFileContents(mockPath);\n\n      expect(promises.readFile).not.toHaveBeenCalled();\n      const fileContentArr = await Promise.all([readFile(mockPath), readFile(mockPath)]);\n      expect(fileContentArr).toStrictEqual([mockPathContent, mockPathContent]);\n\n      // There is one fs.readFile call even though smithy.readFile is called in parallel twice.\n      expect(promises.readFile).toHaveBeenCalledTimes(1);\n      expect(promises.readFile).toHaveBeenCalledWith(mockPath, UTF8);\n\n      const fileContent = await readFile(mockPath);\n      expect(fileContent).toStrictEqual(mockPathContent);\n\n      // There is one fs.readFile call even though smithy.readFile is called for the third time.\n      expect(promises.readFile).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  it(\"makes multiple readFile calls with based on filepaths\", async () => {\n    const { readFile } = await import(\"./readFile\");\n\n    const mockPath1 = \"/mock/path/1\";\n    const mockPathContent1 = getMockFileContents(mockPath1);\n\n    const mockPath2 = \"/mock/path/2\";\n    const mockPathContent2 = getMockFileContents(mockPath2);\n\n    expect(promises.readFile).not.toHaveBeenCalled();\n    const fileContentArr = await Promise.all([readFile(mockPath1), readFile(mockPath2)]);\n    expect(fileContentArr).toStrictEqual([mockPathContent1, mockPathContent2]);\n\n    // There are two fs.readFile calls as smithy.readFile is called in parallel with different file paths.\n    expect(promises.readFile).toHaveBeenCalledTimes(2);\n    expect(promises.readFile).toHaveBeenNthCalledWith(1, mockPath1, UTF8);\n    expect(promises.readFile).toHaveBeenNthCalledWith(2, mockPath2, UTF8);\n\n    const fileContent1 = await readFile(mockPath1);\n    expect(fileContent1).toStrictEqual(mockPathContent1);\n    const fileContent2 = await readFile(mockPath2);\n    expect(fileContent2).toStrictEqual(mockPathContent2);\n\n    // There is one fs.readFile call even though smithy.readFile is called for the third time.\n    expect(promises.readFile).toHaveBeenCalledTimes(2);\n  });\n\n  it(\"makes multiple readFile calls when called with ignoreCache option\", async () => {\n    const { readFile } = await import(\"./readFile\");\n\n    const mockPath1 = \"/mock/path/1\";\n    const mockPathContent1 = getMockFileContents(mockPath1);\n\n    expect(promises.readFile).not.toHaveBeenCalled();\n    const fileContentArr = await Promise.all([\n      readFile(mockPath1, { ignoreCache: true }),\n      readFile(mockPath1, { ignoreCache: true }),\n    ]);\n    expect(fileContentArr).toStrictEqual([mockPathContent1, mockPathContent1]);\n\n    // There are two fs.readFile calls as smithy.readFile is called in parallel with the same filepath.\n    expect(promises.readFile).toHaveBeenCalledTimes(2);\n    expect(promises.readFile).toHaveBeenNthCalledWith(1, mockPath1, UTF8);\n    expect(promises.readFile).toHaveBeenNthCalledWith(2, mockPath1, UTF8);\n\n    const fileContent1 = await readFile(mockPath1);\n    expect(fileContent1).toStrictEqual(mockPathContent1);\n\n    // There is no fs.readFile call since smithy.readFile is now called without refresh.\n    expect(promises.readFile).toHaveBeenCalledTimes(2);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/readFile.ts",
    "content": "import { readFile as fsReadFile } from \"node:fs/promises\";\n\n/**\n * Runtime file cache.\n * @internal\n */\nexport const filePromises: Record<string, Promise<string>> = {};\n\n/**\n * For testing only.\n * @internal\n * @deprecated minimize use in application code.\n */\nexport const fileIntercept: Record<string, Promise<string>> = {};\n\n/**\n * @internal\n */\nexport interface ReadFileOptions {\n  ignoreCache?: boolean;\n}\n\n/**\n * @internal\n */\nexport const readFile = (path: string, options?: ReadFileOptions) => {\n  if (fileIntercept[path] !== undefined) {\n    return fileIntercept[path];\n  }\n  if (!filePromises[path] || options?.ignoreCache) {\n    filePromises[path] = fsReadFile(path, \"utf8\");\n  }\n  return filePromises[path];\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/shared-ini-file-loader/types.ts",
    "content": "import type {\n  ParsedIniData as __ParsedIniData,\n  Profile as __Profile,\n  SharedConfigFiles as __SharedConfigFiles,\n} from \"@smithy/types\";\n\n/**\n * @internal\n * @deprecated Use Profile from \"\\@smithy/types\" instead\n */\nexport type Profile = __Profile;\n\n/**\n * @internal\n * @deprecated Use ParsedIniData from \"\\@smithy/types\" instead\n */\nexport type ParsedIniData = __ParsedIniData;\n\n/**\n * @internal\n * @deprecated Use SharedConfigFiles from \"\\@smithy/types\" instead\n */\nexport type SharedConfigFiles = __SharedConfigFiles;\n"
  },
  {
    "path": "packages/core/src/submodules/config/util-config-provider/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/config`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.2.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.2.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.1.0\n\n### Minor Changes\n\n- dd2b9c70: Add numberSelector utility\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-config-provider](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-config-provider/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/config/util-config-provider/booleanSelector.spec.ts",
    "content": "import { beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport { booleanSelector } from \"./booleanSelector\";\nimport { SelectorType } from \"./types\";\n\ndescribe(booleanSelector.name, () => {\n  const key = \"key\";\n  const obj: { [key]: any } = {} as any;\n\n  describe.each(Object.entries(SelectorType))(`Selector %s`, (selectorKey, selectorValue) => {\n    beforeEach(() => {\n      delete obj[key];\n    });\n\n    it(`should return undefined if ${key} is not defined`, () => {\n      expect(booleanSelector(obj, key, SelectorType[selectorKey as keyof typeof SelectorType])).toBeUndefined();\n    });\n\n    it.each([\n      [true, \"true\"],\n      [false, \"false\"],\n    ])(`should return boolean %s if ${key}=\"%s\"`, (output, input) => {\n      obj[key] = input;\n      expect(booleanSelector(obj, key, SelectorType[selectorKey as keyof typeof SelectorType])).toBe(output);\n    });\n\n    it.each([\"0\", \"1\", \"yes\", \"no\", undefined, null, void 0, \"\"])(`should throw if ${key}=%s`, (input) => {\n      obj[key] = input;\n      expect(() => booleanSelector(obj, key, SelectorType[selectorKey as keyof typeof SelectorType])).toThrow(\n        `Cannot load ${selectorValue} \"${key}\". Expected \"true\" or \"false\", got ${obj[key]}.`\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/util-config-provider/booleanSelector.ts",
    "content": "import type { SelectorType } from \"./types\";\n\n/**\n * Returns boolean value true/false for string value \"true\"/\"false\",\n * if the string is defined in obj[key]\n * Returns undefined, if obj[key] is not defined.\n * Throws error for all other cases.\n *\n * @internal\n */\nexport const booleanSelector = (obj: Record<string, string | undefined>, key: string, type: SelectorType) => {\n  if (!(key in obj)) return undefined;\n  if (obj[key] === \"true\") return true;\n  if (obj[key] === \"false\") return false;\n  throw new Error(`Cannot load ${type} \"${key}\". Expected \"true\" or \"false\", got ${obj[key]}.`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/util-config-provider/numberSelector.spec.ts",
    "content": "import { beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport { numberSelector } from \"./numberSelector\";\nimport { SelectorType } from \"./types\";\n\ndescribe(numberSelector.name, () => {\n  const key = \"key\";\n  const obj: { [key]: any } = {} as any;\n\n  describe.each(Object.entries(SelectorType))(`Selector %s`, (selectorKey, selectorValue) => {\n    beforeEach(() => {\n      delete obj[key];\n    });\n\n    it(`should return undefined if ${key} is not defined`, () => {\n      expect(numberSelector(obj, key, SelectorType[selectorKey as keyof typeof SelectorType])).toBeUndefined();\n    });\n\n    it.each([\n      [0, \"0\"],\n      [1, \"1\"],\n    ])(`should return number %s if ${key}=\"%s\"`, (output, input) => {\n      obj[key] = input;\n      expect(numberSelector(obj, key, SelectorType[selectorKey as keyof typeof SelectorType])).toBe(output);\n    });\n\n    it.each([\"yes\", \"no\", undefined, null, void 0, \"\"])(`should throw if ${key}=%s`, (input) => {\n      obj[key] = input;\n      expect(() => numberSelector(obj, key, SelectorType[selectorKey as keyof typeof SelectorType])).toThrow(\n        new TypeError(`Cannot load ${selectorValue} '${key}'. Expected number, got '${obj[key]}'.`)\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/config/util-config-provider/numberSelector.ts",
    "content": "import type { SelectorType } from \"./types\";\n\n/**\n * Returns number value for string value, if the string is defined in obj[key].\n * Returns undefined, if obj[key] is not defined.\n * Throws error for all other cases.\n *\n * @internal\n */\nexport const numberSelector = (obj: Record<string, string | undefined>, key: string, type: SelectorType) => {\n  if (!(key in obj)) return undefined;\n\n  const numberValue = parseInt(obj[key] as string, 10);\n  if (Number.isNaN(numberValue)) {\n    throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`);\n  }\n\n  return numberValue;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/config/util-config-provider/types.ts",
    "content": "export enum SelectorType {\n  ENV = \"env\",\n  CONFIG = \"shared config entry\",\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/index.browser.ts",
    "content": "import { getEndpointFromConfig } from \"./middleware-endpoint/adaptors/getEndpointFromConfig.browser\";\nimport { bindGetEndpointFromInstructions } from \"./middleware-endpoint/adaptors/getEndpointFromInstructions\";\nimport { bindEndpointMiddleware } from \"./middleware-endpoint/endpointMiddleware\";\nimport { bindGetEndpointPlugin } from \"./middleware-endpoint/getEndpointPlugin\";\nimport { bindResolveEndpointConfig } from \"./middleware-endpoint/resolveEndpointConfig\";\n\nexport * from \"./toEndpointV1\";\n\n// @smithy/util-endpoints\nexport { BinaryDecisionDiagram } from \"./util-endpoints/bdd/BinaryDecisionDiagram\";\nexport { EndpointCache } from \"./util-endpoints/cache/EndpointCache\";\nexport { decideEndpoint } from \"./util-endpoints/decideEndpoint\";\nexport { isIpAddress } from \"./util-endpoints/lib/isIpAddress\";\nexport { isValidHostLabel } from \"./util-endpoints/lib/isValidHostLabel\";\nexport { customEndpointFunctions } from \"./util-endpoints/utils/customEndpointFunctions\";\nexport { resolveEndpoint } from \"./util-endpoints/resolveEndpoint\";\nexport * from \"./util-endpoints/types\";\n\n// @smithy/middleware-endpoint\nexport const getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig);\nexport const resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);\nexport const endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);\nexport const getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig);\n\nexport {\n  resolveParams,\n  type EndpointParameterInstructionsSupplier,\n} from \"./middleware-endpoint/adaptors/getEndpointFromInstructions\";\nexport { toEndpointV1 as middlewareEndpointToEndpointV1 } from \"./middleware-endpoint/adaptors/toEndpointV1\";\nexport { endpointMiddlewareOptions } from \"./middleware-endpoint/getEndpointPlugin\";\nexport type { EndpointInputConfig, EndpointResolvedConfig } from \"./middleware-endpoint/resolveEndpointConfig\";\nexport { resolveEndpointRequiredConfig } from \"./middleware-endpoint/resolveEndpointRequiredConfig\";\nexport type {\n  EndpointRequiredInputConfig,\n  EndpointRequiredResolvedConfig,\n} from \"./middleware-endpoint/resolveEndpointRequiredConfig\";\nexport type { EndpointParameterInstructions } from \"./middleware-endpoint/types\";\nexport type {\n  BuiltInParamInstruction,\n  ClientContextParamInstruction,\n  ContextParamInstruction,\n  OperationContextParamInstruction,\n  StaticContextParamInstruction,\n} from \"./middleware-endpoint/types\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/index.ts",
    "content": "import { getEndpointFromConfig } from \"./middleware-endpoint/adaptors/getEndpointFromConfig\";\nimport { bindGetEndpointFromInstructions } from \"./middleware-endpoint/adaptors/getEndpointFromInstructions\";\nimport { bindEndpointMiddleware } from \"./middleware-endpoint/endpointMiddleware\";\nimport { bindGetEndpointPlugin } from \"./middleware-endpoint/getEndpointPlugin\";\nimport { bindResolveEndpointConfig } from \"./middleware-endpoint/resolveEndpointConfig\";\n\nexport * from \"./toEndpointV1\";\n\n// @smithy/util-endpoints\nexport { BinaryDecisionDiagram } from \"./util-endpoints/bdd/BinaryDecisionDiagram\";\nexport { EndpointCache } from \"./util-endpoints/cache/EndpointCache\";\nexport { decideEndpoint } from \"./util-endpoints/decideEndpoint\";\nexport { isIpAddress } from \"./util-endpoints/lib/isIpAddress\";\nexport { isValidHostLabel } from \"./util-endpoints/lib/isValidHostLabel\";\nexport { customEndpointFunctions } from \"./util-endpoints/utils/customEndpointFunctions\";\nexport { resolveEndpoint } from \"./util-endpoints/resolveEndpoint\";\nexport * from \"./util-endpoints/types\";\n\n// @smithy/middleware-endpoint\nexport const getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig);\nexport const resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);\nexport const endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);\nexport const getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig);\n\nexport {\n  resolveParams,\n  type EndpointParameterInstructionsSupplier,\n} from \"./middleware-endpoint/adaptors/getEndpointFromInstructions\";\nexport { toEndpointV1 as middlewareEndpointToEndpointV1 } from \"./middleware-endpoint/adaptors/toEndpointV1\";\nexport { endpointMiddlewareOptions } from \"./middleware-endpoint/getEndpointPlugin\";\nexport type { EndpointInputConfig, EndpointResolvedConfig } from \"./middleware-endpoint/resolveEndpointConfig\";\nexport { resolveEndpointRequiredConfig } from \"./middleware-endpoint/resolveEndpointRequiredConfig\";\nexport type {\n  EndpointRequiredInputConfig,\n  EndpointRequiredResolvedConfig,\n} from \"./middleware-endpoint/resolveEndpointRequiredConfig\";\nexport type { EndpointParameterInstructions } from \"./middleware-endpoint/types\";\nexport type {\n  BuiltInParamInstruction,\n  ClientContextParamInstruction,\n  ContextParamInstruction,\n  OperationContextParamInstruction,\n  StaticContextParamInstruction,\n} from \"./middleware-endpoint/types\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/endpoints`.\n\n## 4.4.32\n\n### Patch Changes\n\n- @smithy/core@3.23.17\n- @smithy/middleware-serde@4.2.20\n\n## 4.4.31\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n  - @smithy/core@3.23.16\n  - @smithy/middleware-serde@4.2.19\n\n## 4.4.30\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/core@3.23.15\n  - @smithy/middleware-serde@4.2.18\n  - @smithy/node-config-provider@4.3.14\n  - @smithy/shared-ini-file-loader@4.4.9\n  - @smithy/url-parser@4.2.14\n  - @smithy/util-middleware@4.2.14\n\n## 4.4.29\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/middleware-serde@4.2.17\n  - @smithy/node-config-provider@4.3.13\n  - @smithy/shared-ini-file-loader@4.4.8\n  - @smithy/url-parser@4.2.13\n  - @smithy/util-middleware@4.2.13\n\n## 4.4.28\n\n### Patch Changes\n\n- Updated dependencies [7198e09]\n  - @smithy/core@3.23.13\n  - @smithy/middleware-serde@4.2.16\n\n## 4.4.27\n\n### Patch Changes\n\n- b1f0dba: fix(middleware-endpoint): update type of useDualStackEndpoint/useFipsEndpoint input config\n  fix(config-resolver): add alternate values for NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS and NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS\n\n## 4.4.26\n\n### Patch Changes\n\n- @smithy/core@3.23.12\n- @smithy/middleware-serde@4.2.15\n\n## 4.4.25\n\n### Patch Changes\n\n- Updated dependencies [2edd638]\n  - @smithy/core@3.23.11\n  - @smithy/middleware-serde@4.2.14\n\n## 4.4.24\n\n### Patch Changes\n\n- 5340b11: apply resolved endpoint headers to final request\n- Updated dependencies [5340b11]\n  - @smithy/core@3.23.10\n  - @smithy/types@4.13.1\n  - @smithy/middleware-serde@4.2.13\n  - @smithy/node-config-provider@4.3.12\n  - @smithy/shared-ini-file-loader@4.4.7\n  - @smithy/url-parser@4.2.12\n  - @smithy/util-middleware@4.2.12\n\n## 4.4.23\n\n### Patch Changes\n\n- Updated dependencies [6ef5430]\n- Updated dependencies [6ef5430]\n  - @smithy/core@3.23.9\n\n## 4.4.22\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/shared-ini-file-loader@4.4.6\n  - @smithy/node-config-provider@4.3.11\n  - @smithy/middleware-serde@4.2.12\n  - @smithy/util-middleware@4.2.11\n  - @smithy/url-parser@4.2.11\n  - @smithy/core@3.23.8\n\n## 4.4.21\n\n### Patch Changes\n\n- Updated dependencies [11569eb]\n  - @smithy/core@3.23.7\n\n## 4.4.20\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/core@3.23.6\n  - @smithy/middleware-serde@4.2.11\n  - @smithy/node-config-provider@4.3.10\n  - @smithy/shared-ini-file-loader@4.4.5\n  - @smithy/url-parser@4.2.10\n  - @smithy/util-middleware@4.2.10\n\n## 4.4.19\n\n### Patch Changes\n\n- Updated dependencies [026b177]\n- Updated dependencies [cde9f09]\n  - @smithy/core@3.23.5\n\n## 4.4.18\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/core@3.23.4\n  - @smithy/middleware-serde@4.2.10\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/shared-ini-file-loader@4.4.4\n  - @smithy/types@4.12.1\n  - @smithy/url-parser@4.2.9\n  - @smithy/util-middleware@4.2.9\n\n## 4.4.17\n\n### Patch Changes\n\n- @smithy/core@3.23.3\n\n## 4.4.16\n\n### Patch Changes\n\n- Updated dependencies [c5db01c]\n  - @smithy/core@3.23.2\n\n## 4.4.15\n\n### Patch Changes\n\n- Updated dependencies [6f96c01]\n  - @smithy/core@3.23.1\n\n## 4.4.14\n\n### Patch Changes\n\n- Updated dependencies [4f05c6a]\n  - @smithy/core@3.23.0\n\n## 4.4.13\n\n### Patch Changes\n\n- @smithy/core@3.22.1\n\n## 4.4.12\n\n### Patch Changes\n\n- Updated dependencies [472bf01]\n  - @smithy/core@3.22.0\n\n## 4.4.11\n\n### Patch Changes\n\n- Updated dependencies [fa0e0c4]\n  - @smithy/core@3.21.1\n\n## 4.4.10\n\n### Patch Changes\n\n- Updated dependencies [c2a6f46]\n  - @smithy/core@3.21.0\n\n## 4.4.9\n\n### Patch Changes\n\n- Updated dependencies [96cc077]\n  - @smithy/core@3.20.8\n\n## 4.4.8\n\n### Patch Changes\n\n- Updated dependencies [ae6ef2e]\n  - @smithy/core@3.20.7\n\n## 4.4.7\n\n### Patch Changes\n\n- Updated dependencies [862c942]\n  - @smithy/core@3.20.6\n\n## 4.4.6\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/core@3.20.5\n  - @smithy/middleware-serde@4.2.9\n  - @smithy/node-config-provider@4.3.8\n  - @smithy/shared-ini-file-loader@4.4.3\n  - @smithy/url-parser@4.2.8\n  - @smithy/util-middleware@4.2.8\n\n## 4.4.5\n\n### Patch Changes\n\n- @smithy/core@3.20.4\n\n## 4.4.4\n\n### Patch Changes\n\n- Updated dependencies [681d6c4]\n  - @smithy/core@3.20.3\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [dd55f1f]\n  - @smithy/core@3.20.2\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [aa954bc]\n  - @smithy/core@3.20.1\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/core@3.20.0\n  - @smithy/middleware-serde@4.2.8\n  - @smithy/node-config-provider@4.3.7\n  - @smithy/shared-ini-file-loader@4.4.2\n  - @smithy/url-parser@4.2.7\n  - @smithy/util-middleware@4.2.7\n\n## 4.4.0\n\n### Minor Changes\n\n- 76d7994: handle clientContextParam collisions with builtin config keys\n\n## 4.3.15\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/core@3.19.0\n  - @smithy/middleware-serde@4.2.7\n  - @smithy/node-config-provider@4.3.6\n  - @smithy/shared-ini-file-loader@4.4.1\n  - @smithy/url-parser@4.2.6\n  - @smithy/util-middleware@4.2.6\n\n## 4.3.14\n\n### Patch Changes\n\n- Updated dependencies [541a18f]\n  - @smithy/core@3.18.7\n\n## 4.3.13\n\n### Patch Changes\n\n- Updated dependencies [1d6db03]\n  - @smithy/core@3.18.6\n\n## 4.3.12\n\n### Patch Changes\n\n- Updated dependencies [77c149f]\n  - @smithy/core@3.18.5\n\n## 4.3.11\n\n### Patch Changes\n\n- Updated dependencies [e659a06]\n- Updated dependencies [e659a06]\n  - @smithy/core@3.18.4\n  - @smithy/middleware-serde@4.2.6\n\n## 4.3.10\n\n### Patch Changes\n\n- Updated dependencies [5bcd041]\n  - @smithy/core@3.18.3\n\n## 4.3.9\n\n### Patch Changes\n\n- Updated dependencies [c8b148c]\n  - @smithy/core@3.18.2\n\n## 4.3.8\n\n### Patch Changes\n\n- Updated dependencies [0976f42]\n  - @smithy/core@3.18.1\n\n## 4.3.7\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n- Updated dependencies [e77f705]\n- Updated dependencies [d90999a]\n  - @smithy/types@4.9.0\n  - @smithy/core@3.18.0\n  - @smithy/shared-ini-file-loader@4.4.0\n  - @smithy/middleware-serde@4.2.5\n  - @smithy/node-config-provider@4.3.5\n  - @smithy/url-parser@4.2.5\n  - @smithy/util-middleware@4.2.5\n\n## 4.3.6\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n- Updated dependencies [df00095]\n  - @smithy/types@4.8.1\n  - @smithy/core@3.17.2\n  - @smithy/middleware-serde@4.2.4\n  - @smithy/node-config-provider@4.3.4\n  - @smithy/shared-ini-file-loader@4.3.4\n  - @smithy/url-parser@4.2.4\n  - @smithy/util-middleware@4.2.4\n\n## 4.3.5\n\n### Patch Changes\n\n- @smithy/core@3.17.1\n\n## 4.3.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n- Updated dependencies [7e359e2]\n  - @smithy/types@4.8.0\n  - @smithy/core@3.17.0\n  - @smithy/shared-ini-file-loader@4.3.3\n  - @smithy/middleware-serde@4.2.3\n  - @smithy/node-config-provider@4.3.3\n  - @smithy/url-parser@4.2.3\n  - @smithy/util-middleware@4.2.3\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/core@3.16.1\n  - @smithy/types@4.7.1\n  - @smithy/middleware-serde@4.2.2\n  - @smithy/node-config-provider@4.3.2\n  - @smithy/shared-ini-file-loader@4.3.2\n  - @smithy/url-parser@4.2.2\n  - @smithy/util-middleware@4.2.2\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n- Updated dependencies [8a2873c]\n  - @smithy/types@4.7.0\n  - @smithy/core@3.16.0\n  - @smithy/middleware-serde@4.2.1\n  - @smithy/node-config-provider@4.3.1\n  - @smithy/shared-ini-file-loader@4.3.1\n  - @smithy/url-parser@4.2.1\n  - @smithy/util-middleware@4.2.1\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/core@3.15.0\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/core@3.14.0\n  - @smithy/middleware-serde@4.2.0\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/shared-ini-file-loader@4.3.0\n  - @smithy/types@4.6.0\n  - @smithy/url-parser@4.2.0\n  - @smithy/util-middleware@4.2.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [59e9952]\n  - @smithy/core@3.13.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [97fe0d8]\n- Updated dependencies [3eb73f3]\n  - @smithy/core@3.12.0\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [f8793be]\n  - @smithy/core@3.11.1\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [60f393e]\n  - @smithy/shared-ini-file-loader@4.2.0\n  - @smithy/node-config-provider@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/core@3.11.0\n  - @smithy/middleware-serde@4.1.1\n  - @smithy/node-config-provider@4.2.1\n  - @smithy/shared-ini-file-loader@4.1.1\n  - @smithy/url-parser@4.1.1\n  - @smithy/util-middleware@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/shared-ini-file-loader@4.1.0\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/middleware-serde@4.1.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/url-parser@4.1.0\n  - @smithy/types@4.4.0\n  - @smithy/core@3.10.0\n\n## 4.1.21\n\n### Patch Changes\n\n- Updated dependencies [06ac1f6]\n  - @smithy/core@3.9.2\n\n## 4.1.20\n\n### Patch Changes\n\n- Updated dependencies [29fad01]\n  - @smithy/core@3.9.1\n\n## 4.1.19\n\n### Patch Changes\n\n- Updated dependencies [ab4f33f]\n- Updated dependencies [d79dc91]\n  - @smithy/core@3.9.0\n\n## 4.1.18\n\n### Patch Changes\n\n- Updated dependencies [fd00602]\n- Updated dependencies [64e033f]\n  - @smithy/core@3.8.0\n  - @smithy/types@4.3.2\n  - @smithy/middleware-serde@4.0.9\n  - @smithy/node-config-provider@4.1.4\n  - @smithy/shared-ini-file-loader@4.0.5\n  - @smithy/url-parser@4.0.5\n  - @smithy/util-middleware@4.0.5\n\n## 4.1.17\n\n### Patch Changes\n\n- Updated dependencies [f4dcba0]\n  - @smithy/core@3.7.2\n\n## 4.1.16\n\n### Patch Changes\n\n- Updated dependencies [312801c]\n- Updated dependencies [bb7975e]\n  - @smithy/core@3.7.1\n\n## 4.1.15\n\n### Patch Changes\n\n- bccb1b9: fix resolving file/env configured endpoint\n\n## 4.1.14\n\n### Patch Changes\n\n- 3ecb1f4: return undefined for endpointParam \"endpoint\" if isCustomEndpoint is false\n- Updated dependencies [d105c97]\n  - @smithy/core@3.7.0\n\n## 4.1.13\n\n### Patch Changes\n\n- Updated dependencies [10a0534]\n  - @smithy/core@3.6.0\n\n## 4.1.12\n\n### Patch Changes\n\n- 22a286e: add resolveEndpointRequiredConfig resolver\n\n## 4.1.11\n\n### Patch Changes\n\n- Updated dependencies [4a31774]\n  - @smithy/core@3.5.3\n\n## 4.1.10\n\n### Patch Changes\n\n- Updated dependencies [4642e7e]\n- Updated dependencies [147ceed]\n- Updated dependencies [ae8f1f4]\n  - @smithy/core@3.5.2\n\n## 4.1.9\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/core@3.5.1\n  - @smithy/middleware-serde@4.0.8\n  - @smithy/node-config-provider@4.1.3\n  - @smithy/shared-ini-file-loader@4.0.4\n  - @smithy/url-parser@4.0.4\n  - @smithy/util-middleware@4.0.4\n\n## 4.1.8\n\n### Patch Changes\n\n- Updated dependencies [ae11e3a]\n- Updated dependencies [23812a9]\n  - @smithy/core@3.5.0\n  - @smithy/middleware-serde@4.0.7\n\n## 4.1.7\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n- Updated dependencies [efb27ee]\n- Updated dependencies [06b0ce8]\n  - @smithy/types@4.3.0\n  - @smithy/core@3.4.0\n  - @smithy/middleware-serde@4.0.6\n  - @smithy/node-config-provider@4.1.2\n  - @smithy/shared-ini-file-loader@4.0.3\n  - @smithy/url-parser@4.0.3\n  - @smithy/util-middleware@4.0.3\n\n## 4.1.6\n\n### Patch Changes\n\n- 786dd3a: reduce usage of endpoints2.0 type adapter in public interfaces\n- Updated dependencies [786dd3a]\n  - @smithy/middleware-serde@4.0.5\n  - @smithy/core@3.3.3\n\n## 4.1.5\n\n### Patch Changes\n\n- Updated dependencies [103535a]\n  - @smithy/middleware-serde@4.0.4\n  - @smithy/core@3.3.2\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [40ffcd5]\n  - @smithy/core@3.3.1\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [5896264]\n  - @smithy/core@3.3.0\n\n## 4.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [02ef79c]\n- Updated dependencies [e917e61]\n  - @smithy/core@3.2.0\n  - @smithy/types@4.2.0\n  - @smithy/middleware-serde@4.0.3\n  - @smithy/node-config-provider@4.0.2\n  - @smithy/shared-ini-file-loader@4.0.2\n  - @smithy/url-parser@4.0.2\n  - @smithy/util-middleware@4.0.2\n\n## 4.0.6\n\n### Patch Changes\n\n- @smithy/core@3.1.5\n\n## 4.0.5\n\n### Patch Changes\n\n- @smithy/core@3.1.4\n\n## 4.0.4\n\n### Patch Changes\n\n- @smithy/core@3.1.3\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [f5d0bac]\n  - @smithy/middleware-serde@4.0.2\n  - @smithy/core@3.1.2\n\n## 4.0.2\n\n### Patch Changes\n\n- @smithy/core@3.1.1\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/core@3.1.0\n  - @smithy/middleware-serde@4.0.1\n  - @smithy/node-config-provider@4.0.1\n  - @smithy/shared-ini-file-loader@4.0.1\n  - @smithy/url-parser@4.0.1\n  - @smithy/util-middleware@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/shared-ini-file-loader@4.0.0\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/util-middleware@4.0.0\n  - @smithy/core@3.0.0\n  - @smithy/middleware-serde@4.0.0\n  - @smithy/types@4.0.0\n  - @smithy/url-parser@4.0.0\n\n## 3.2.8\n\n### Patch Changes\n\n- @smithy/core@2.5.7\n\n## 3.2.7\n\n### Patch Changes\n\n- @smithy/core@2.5.6\n\n## 3.2.6\n\n### Patch Changes\n\n- e27d42d: fix for operation context params\n\n## 3.2.5\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/core@2.5.5\n  - @smithy/middleware-serde@3.0.11\n  - @smithy/node-config-provider@3.1.12\n  - @smithy/shared-ini-file-loader@3.1.12\n  - @smithy/url-parser@3.0.11\n  - @smithy/util-middleware@3.0.11\n\n## 3.2.4\n\n### Patch Changes\n\n- Updated dependencies [9c40f7b]\n  - @smithy/core@2.5.4\n\n## 3.2.3\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/core@2.5.3\n  - @smithy/middleware-serde@3.0.10\n  - @smithy/node-config-provider@3.1.11\n  - @smithy/shared-ini-file-loader@3.1.11\n  - @smithy/url-parser@3.0.10\n  - @smithy/util-middleware@3.0.10\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [c6ef519]\n- Updated dependencies [cd1929b]\n  - @smithy/core@2.5.2\n  - @smithy/types@3.7.0\n  - @smithy/middleware-serde@3.0.9\n  - @smithy/node-config-provider@3.1.10\n  - @smithy/shared-ini-file-loader@3.1.10\n  - @smithy/url-parser@3.0.9\n  - @smithy/util-middleware@3.0.9\n\n## 3.2.1\n\n### Patch Changes\n\n- @smithy/core@2.5.1\n\n## 3.2.0\n\n### Minor Changes\n\n- d07b0ab: feature detection for custom endpoint and gzip\n\n### Patch Changes\n\n- d07b0ab: reorganize smithy/core to be upstream of smithy/smithy-client\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n- Updated dependencies [d07b0ab]\n  - @smithy/types@3.6.0\n  - @smithy/core@2.5.0\n  - @smithy/middleware-serde@3.0.8\n  - @smithy/node-config-provider@3.1.9\n  - @smithy/shared-ini-file-loader@3.1.9\n  - @smithy/url-parser@3.0.8\n  - @smithy/util-middleware@3.0.8\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/middleware-serde@3.0.7\n  - @smithy/node-config-provider@3.1.8\n  - @smithy/shared-ini-file-loader@3.1.8\n  - @smithy/url-parser@3.0.7\n  - @smithy/util-middleware@3.0.7\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/middleware-serde@3.0.6\n  - @smithy/node-config-provider@3.1.7\n  - @smithy/shared-ini-file-loader@3.1.7\n  - @smithy/url-parser@3.0.6\n  - @smithy/util-middleware@3.0.6\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/middleware-serde@3.0.5\n  - @smithy/node-config-provider@3.1.6\n  - @smithy/shared-ini-file-loader@3.1.6\n  - @smithy/url-parser@3.0.5\n  - @smithy/util-middleware@3.0.5\n\n## 3.1.1\n\n### Patch Changes\n\n- c8c53ae: resolve service-specific endpoint once per client\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/middleware-serde@3.0.4\n  - @smithy/node-config-provider@3.1.5\n  - @smithy/shared-ini-file-loader@3.1.5\n  - @smithy/url-parser@3.0.4\n  - @smithy/util-middleware@3.0.4\n\n## 3.1.0\n\n### Minor Changes\n\n- 4a40961: add support for accountId in configValueProvider\n\n### Patch Changes\n\n- @smithy/middleware-serde@3.0.3\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [d88521e]\n  - @smithy/shared-ini-file-loader@3.1.4\n  - @smithy/node-config-provider@3.1.4\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/middleware-serde@3.0.3\n  - @smithy/node-config-provider@3.1.3\n  - @smithy/shared-ini-file-loader@3.1.3\n  - @smithy/url-parser@3.0.3\n  - @smithy/util-middleware@3.0.3\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/middleware-serde@3.0.2\n  - @smithy/node-config-provider@3.1.2\n  - @smithy/shared-ini-file-loader@3.1.2\n  - @smithy/url-parser@3.0.2\n  - @smithy/util-middleware@3.0.2\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/middleware-serde@3.0.1\n  - @smithy/node-config-provider@3.1.1\n  - @smithy/shared-ini-file-loader@3.1.1\n  - @smithy/url-parser@3.0.1\n  - @smithy/util-middleware@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n  - @smithy/shared-ini-file-loader@3.1.0\n  - @smithy/node-config-provider@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/shared-ini-file-loader@3.0.0\n  - @smithy/node-config-provider@3.0.0\n  - @smithy/middleware-serde@3.0.0\n  - @smithy/util-middleware@3.0.0\n  - @smithy/url-parser@3.0.0\n\n## 2.5.1\n\n### Patch Changes\n\n- cc54b8d1: Do not require account in checking whether a string is an S3 bucket ARN.\n\n## 2.5.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/shared-ini-file-loader@2.4.0\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/middleware-serde@2.3.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/url-parser@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.4.6\n\n### Patch Changes\n\n- Updated dependencies [32e3f6ff]\n  - @smithy/middleware-serde@2.2.1\n\n## 2.4.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n- Updated dependencies [49640d6c]\n  - @smithy/middleware-serde@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/node-config-provider@2.2.5\n  - @smithy/shared-ini-file-loader@2.3.5\n  - @smithy/url-parser@2.1.4\n  - @smithy/util-middleware@2.1.4\n\n## 2.4.4\n\n### Patch Changes\n\n- Updated dependencies [8fd51967]\n  - @smithy/shared-ini-file-loader@2.3.4\n  - @smithy/node-config-provider@2.2.4\n\n## 2.4.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/middleware-serde@2.1.3\n  - @smithy/node-config-provider@2.2.3\n  - @smithy/shared-ini-file-loader@2.3.3\n  - @smithy/url-parser@2.1.3\n  - @smithy/util-middleware@2.1.3\n\n## 2.4.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/middleware-serde@2.1.2\n  - @smithy/node-config-provider@2.2.2\n  - @smithy/shared-ini-file-loader@2.3.2\n  - @smithy/url-parser@2.1.2\n  - @smithy/util-middleware@2.1.2\n\n## 2.4.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/middleware-serde@2.1.1\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/shared-ini-file-loader@2.3.1\n  - @smithy/types@2.9.1\n  - @smithy/url-parser@2.1.1\n  - @smithy/util-middleware@2.1.1\n\n## 2.4.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/shared-ini-file-loader@2.3.0\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/middleware-serde@2.1.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/url-parser@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 590af6b7: support credential scope\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/middleware-serde@2.0.16\n  - @smithy/node-config-provider@2.1.9\n  - @smithy/shared-ini-file-loader@2.2.8\n  - @smithy/url-parser@2.0.16\n  - @smithy/util-middleware@2.0.9\n\n## 2.2.3\n\n### Patch Changes\n\n- Updated dependencies [68849108]\n  - @smithy/shared-ini-file-loader@2.2.7\n  - @smithy/node-config-provider@2.1.8\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/middleware-serde@2.0.15\n  - @smithy/node-config-provider@2.1.7\n  - @smithy/shared-ini-file-loader@2.2.6\n  - @smithy/url-parser@2.0.15\n  - @smithy/util-middleware@2.0.8\n\n## 2.2.1\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/middleware-serde@2.0.14\n  - @smithy/node-config-provider@2.1.6\n  - @smithy/shared-ini-file-loader@2.2.5\n  - @smithy/url-parser@2.0.14\n  - @smithy/util-middleware@2.0.7\n\n## 2.2.0\n\n### Minor Changes\n\n- 8044a814: feat(experimentalIdentityAndAuth): move `experimentalIdentityAndAuth` types and interfaces to `@smithy/types` and `@smithy/core`\n\n### Patch Changes\n\n- 9e0a5a74: Add `@endpointRuleSet` signing properties to `selectedHttpAuthScheme`\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/middleware-serde@2.0.13\n  - @smithy/node-config-provider@2.1.5\n  - @smithy/shared-ini-file-loader@2.2.4\n  - @smithy/url-parser@2.0.13\n  - @smithy/util-middleware@2.0.6\n\n## 2.1.5\n\n### Patch Changes\n\n- 5598a033: update bundler replacement directives in package.json\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [c27879f2]\n  - @smithy/shared-ini-file-loader@2.2.3\n  - @smithy/node-config-provider@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [901cb6c9]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/shared-ini-file-loader@2.2.2\n  - @smithy/middleware-serde@2.0.12\n  - @smithy/node-config-provider@2.1.3\n  - @smithy/url-parser@2.0.12\n  - @smithy/util-middleware@2.0.5\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [5bd46820]\n- Updated dependencies [6ae95278]\n  - @smithy/shared-ini-file-loader@2.2.1\n  - @smithy/node-config-provider@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- afaa68af: Add missing dependency @smithy/shared-ini-file-loader\n\n## 2.1.0\n\n### Minor Changes\n\n- f64c4c2d: Read service specific endpoints from env/config\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/middleware-serde@2.0.11\n  - @smithy/url-parser@2.0.11\n  - @smithy/util-middleware@2.0.4\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/middleware-serde@2.0.10\n  - @smithy/url-parser@2.0.10\n  - @smithy/util-middleware@2.0.3\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/middleware-serde@2.0.9\n  - @smithy/url-parser@2.0.9\n  - @smithy/util-middleware@2.0.2\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [e6ea6bd5]\n- Updated dependencies [c0b17a13]\n- Updated dependencies [5b6fa539]\n  - @smithy/types@2.3.2\n  - @smithy/util-middleware@2.0.1\n  - @smithy/middleware-serde@2.0.8\n  - @smithy/url-parser@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/middleware-serde@2.0.7\n  - @smithy/url-parser@2.0.7\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/middleware-serde@2.0.6\n  - @smithy/url-parser@2.0.6\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n- Updated dependencies [1be3c4c9]\n  - @smithy/types@2.2.2\n  - @smithy/middleware-serde@2.0.5\n  - @smithy/url-parser@2.0.5\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/middleware-serde@2.0.4\n  - @smithy/url-parser@2.0.4\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/middleware-serde@2.0.3\n  - @smithy/url-parser@2.0.3\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.2\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/middleware-serde@2.0.2\n  - @smithy/url-parser@2.0.2\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/middleware-serde@2.0.1\n  - @smithy/url-parser@2.0.1\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/middleware-serde@2.0.0\n  - @smithy/url-parser@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/middleware-serde@1.1.0\n  - @smithy/types@1.2.0\n  - @smithy/url-parser@1.1.0\n  - @smithy/util-middleware@1.1.0\n\n## 1.0.4\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/middleware-serde@1.0.3\n  - @smithy/url-parser@1.0.3\n  - @smithy/util-middleware@1.0.2\n\n## 1.0.3\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/middleware-serde@1.0.2\n  - @smithy/util-middleware@1.0.2\n  - @smithy/url-parser@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.2\n\n### Patch Changes\n\n- 170ac764: remove unused file\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/middleware-serde@1.0.1\n  - @smithy/util-middleware@1.0.1\n  - @smithy/url-parser@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/middleware-endpoint](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/middleware-endpoint/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.spec.ts",
    "content": "import type { Endpoint } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { createConfigValueProvider } from \"./createConfigValueProvider\";\n\ndescribe(createConfigValueProvider.name, () => {\n  it(\"should create a normalized provider for any config value\", async () => {\n    const config = {\n      a: 1,\n      b: 2,\n    };\n    expect(await createConfigValueProvider(\"a\", \"a\", config)()).toEqual(1);\n  });\n\n  it(\"should look up both the canonical Endpoint ruleset param name and any localized override\", async () => {\n    const config = {\n      a: 1,\n      b: 2,\n    };\n    expect(await createConfigValueProvider(\"a\", \"x\", config)()).toEqual(1);\n    expect(await createConfigValueProvider(\"x\", \"a\", config)()).toEqual(1);\n  });\n\n  it(\"uses a special lookup for CredentialScope\", async () => {\n    const config = {\n      credentials: async () => {\n        return {\n          credentialScope: \"cred-scope\",\n        };\n      },\n    };\n    expect(await createConfigValueProvider(\"credentialScope\", \"CredentialScope\", config)()).toEqual(\"cred-scope\");\n  });\n\n  it(\"uses a special lookup for accountId\", async () => {\n    const config = {\n      credentials: async () => {\n        return {\n          accountId: \"123456789012\",\n        };\n      },\n    };\n    expect(await createConfigValueProvider(\"accountId\", \"AccountId\", config)()).toEqual(\"123456789012\");\n  });\n\n  it(\"should normalize endpoint objects into URLs\", async () => {\n    const sampleUrl = \"https://aws.amazon.com/\";\n    const config = {\n      str: sampleUrl,\n      v1: {\n        protocol: \"https:\",\n        hostname: new URL(sampleUrl).hostname,\n        path: \"/\",\n      } as Endpoint,\n      v2: { url: new URL(sampleUrl) },\n    };\n    expect(await createConfigValueProvider(\"str\", \"endpoint\", config)()).toEqual(sampleUrl);\n    expect(await createConfigValueProvider(\"v1\", \"endpoint\", config)()).toEqual(sampleUrl);\n    expect(await createConfigValueProvider(\"v2\", \"endpoint\", config)()).toEqual(sampleUrl);\n  });\n\n  it(\"should prioritize clientContextParams over direct properties\", async () => {\n    const config = {\n      stage: \"prod\",\n      clientContextParams: {\n        stage: \"beta\",\n      },\n    };\n    expect(await createConfigValueProvider(\"stage\", \"stage\", config, true)()).toEqual(\"beta\");\n  });\n\n  it(\"should fall back to direct property when clientContextParams is not provided\", async () => {\n    const config = {\n      customParam: \"direct-value\",\n    };\n    expect(await createConfigValueProvider(\"customParam\", \"customParam\", config)()).toEqual(\"direct-value\");\n  });\n\n  it(\"should fall back to direct property when clientContextParams exists but param is not in it\", async () => {\n    const config = {\n      customParam: \"direct-value\",\n      clientContextParams: {\n        otherParam: \"other-value\",\n      },\n    };\n    expect(await createConfigValueProvider(\"customParam\", \"customParam\", config)()).toEqual(\"direct-value\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.ts",
    "content": "import type { Endpoint, EndpointV2 } from \"@smithy/types\";\n\n/**\n * Normalize some key of the client config to an async provider.\n * @internal\n *\n * @param configKey - the key to look up in config.\n * @param canonicalEndpointParamKey - this is the name the EndpointRuleSet uses.\n *                                    it will most likely not contain the config\n *                                    value, but we use it as a fallback.\n * @param config - container of the config values.\n * @param isClientContextParam - whether this is a client context parameter.\n *\n * @returns async function that will resolve with the value.\n */\nexport const createConfigValueProvider = <Config extends Record<string, unknown>>(\n  configKey: string,\n  canonicalEndpointParamKey: string,\n  config: Config,\n  isClientContextParam = false\n) => {\n  const configProvider = async () => {\n    let configValue: unknown;\n\n    if (isClientContextParam) {\n      // For client context parameters, check clientContextParams first\n      const clientContextParams = config.clientContextParams as Record<string, unknown> | undefined;\n      const nestedValue: unknown = clientContextParams?.[configKey];\n      configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey];\n    } else {\n      // For built-in parameters and other config properties\n      configValue = config[configKey] ?? config[canonicalEndpointParamKey];\n    }\n\n    if (typeof configValue === \"function\") {\n      return configValue();\n    }\n    return configValue;\n  };\n  if (configKey === \"credentialScope\" || canonicalEndpointParamKey === \"CredentialScope\") {\n    return async () => {\n      const credentials = typeof config.credentials === \"function\" ? await config.credentials() : config.credentials;\n      const configValue: string = credentials?.credentialScope ?? credentials?.CredentialScope;\n      return configValue;\n    };\n  }\n\n  if (configKey === \"accountId\" || canonicalEndpointParamKey === \"AccountId\") {\n    return async () => {\n      const credentials = typeof config.credentials === \"function\" ? await config.credentials() : config.credentials;\n      const configValue: string = credentials?.accountId ?? credentials?.AccountId;\n      return configValue;\n    };\n  }\n\n  if (configKey === \"endpoint\" || canonicalEndpointParamKey === \"endpoint\") {\n    return async () => {\n      if (config.isCustomEndpoint === false) {\n        return undefined;\n      }\n      const endpoint = await configProvider();\n      if (endpoint && typeof endpoint === \"object\") {\n        if (\"url\" in endpoint) {\n          return (endpoint as EndpointV2).url.href;\n        }\n        if (\"hostname\" in endpoint) {\n          const { protocol, hostname, port, path } = endpoint as Endpoint;\n          // query params are ignored in setting endpoint.\n          return `${protocol}//${hostname}${port ? \":\" + port : \"\"}${path}`;\n        }\n      }\n      return endpoint;\n    };\n  }\n  return configProvider;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.browser.ts",
    "content": "// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getEndpointFromConfig = async (serviceId?: string): Promise<string | undefined> => undefined;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.ts",
    "content": "import { loadConfig } from \"@smithy/core/config\";\n\nimport { getEndpointUrlConfig } from \"./getEndpointUrlConfig\";\n\n/**\n * @internal\n */\nexport const getEndpointFromConfig = async (serviceId?: string) => loadConfig(getEndpointUrlConfig(serviceId ?? \"\"))();\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.spec.ts",
    "content": "import { afterAll, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getEndpointFromInstructions } from \"../../index\";\n\ndescribe(getEndpointFromInstructions.name, () => {\n  afterAll(async () => {\n    delete process.env.AWS_ENDPOINT_URL;\n  });\n\n  it(\"should set the isCustomEndpoint flag after resolving an externally configured endpoint\", async () => {\n    process.env.AWS_ENDPOINT_URL = \"https://localhost\";\n\n    const config = {\n      serviceId: \"service id\",\n      isCustomEndpoint: false,\n      endpointProvider: vi.fn(),\n    };\n\n    await getEndpointFromInstructions(\n      {},\n      {\n        getEndpointParameterInstructions() {\n          return {};\n        },\n      },\n      config\n    );\n\n    expect(config.isCustomEndpoint).toBe(true);\n  });\n\n  it(\"should not use externally configured endpoint if code-level endpoint was set\", async () => {\n    process.env.AWS_ENDPOINT_URL = \"https://localhost\";\n\n    const config = {\n      serviceId: \"service id\",\n      isCustomEndpoint: true,\n      endpointProvider: vi.fn().mockReturnValue(Symbol.for(\"endpoint\")),\n    };\n\n    const endpoint = await getEndpointFromInstructions(\n      {},\n      {\n        getEndpointParameterInstructions() {\n          return {};\n        },\n      },\n      config\n    );\n\n    expect(config.isCustomEndpoint).toBe(true);\n    expect(endpoint).toBe(Symbol.for(\"endpoint\"));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.ts",
    "content": "import type { EndpointParameters, EndpointV2, HandlerExecutionContext } from \"@smithy/types\";\n\nimport type { EndpointResolvedConfig } from \"../resolveEndpointConfig\";\nimport { resolveParamsForS3 } from \"../service-customizations\";\nimport type { EndpointParameterInstructions } from \"../types\";\nimport { createConfigValueProvider } from \"./createConfigValueProvider\";\nimport { toEndpointV1 } from \"./toEndpointV1\";\n\n/**\n * @internal\n */\nexport type EndpointParameterInstructionsSupplier = Partial<{\n  getEndpointParameterInstructions(): EndpointParameterInstructions;\n}>;\n\n/**\n * @internal\n */\nexport type GetEndpointFromConfig = (serviceId?: string) => Promise<string | undefined>;\n\n/**\n * @internal\n */\nexport function bindGetEndpointFromInstructions(getEndpointFromConfig: GetEndpointFromConfig) {\n  /**\n   * This step in the endpoint resolution process is exposed as a function\n   * to allow packages such as signers, lib-upload, etc. to get\n   * the V2 Endpoint associated to an instance of some api operation command\n   * without needing to send it or resolve its middleware stack.\n   *\n   * @internal\n   * @param commandInput         - the input of the Command in question.\n   * @param instructionsSupplier - this is typically a Command constructor. A static function supplying the\n   *                               endpoint parameter instructions will exist for commands in services\n   *                               having an endpoints ruleset trait.\n   * @param clientConfig         - config of the service client.\n   * @param context              - optional context.\n   */\n  return async <\n    T extends EndpointParameters,\n    CommandInput extends Record<string, unknown>,\n    Config extends Record<string, unknown>,\n  >(\n    commandInput: CommandInput,\n    instructionsSupplier: EndpointParameterInstructionsSupplier,\n    clientConfig: Partial<EndpointResolvedConfig<T>> & Config,\n    context?: HandlerExecutionContext\n  ): Promise<EndpointV2> => {\n    if (!clientConfig.isCustomEndpoint) {\n      let endpointFromConfig: string | undefined;\n\n      // This field is guaranteed by the type indicated by the config resolver, but is new\n      // and some existing standalone calls to this function may not provide the function, so\n      // this check should remain here.\n      if (clientConfig.serviceConfiguredEndpoint) {\n        endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();\n      } else {\n        endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);\n      }\n\n      if (endpointFromConfig) {\n        clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig!));\n        clientConfig.isCustomEndpoint = true;\n      }\n    }\n\n    const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);\n\n    if (typeof clientConfig.endpointProvider !== \"function\") {\n      throw new Error(\"config.endpointProvider is not set.\");\n    }\n    const endpoint: EndpointV2 = clientConfig.endpointProvider!(endpointParams as T, context);\n\n    // Merge headers from custom endpoint if present\n    if (clientConfig.isCustomEndpoint && clientConfig.endpoint) {\n      const customEndpoint = await clientConfig.endpoint();\n      if (customEndpoint?.headers) {\n        endpoint.headers ??= {};\n        for (const [name, value] of Object.entries(customEndpoint.headers)) {\n          endpoint.headers[name] = Array.isArray(value) ? value : [value];\n        }\n      }\n    }\n\n    return endpoint;\n  };\n}\n\n/**\n * @internal\n */\nexport const resolveParams = async <\n  T extends EndpointParameters,\n  CommandInput extends Record<string, unknown>,\n  Config extends Record<string, unknown>,\n>(\n  commandInput: CommandInput,\n  instructionsSupplier: EndpointParameterInstructionsSupplier,\n  clientConfig: Partial<EndpointResolvedConfig<T>> & Config\n) => {\n  const endpointParams: EndpointParameters = {};\n  const instructions: EndpointParameterInstructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};\n\n  for (const [name, instruction] of Object.entries(instructions)) {\n    switch (instruction.type) {\n      case \"staticContextParams\":\n        endpointParams[name] = instruction.value;\n        break;\n      case \"contextParams\":\n        endpointParams[name] = commandInput[instruction.name] as string | boolean;\n        break;\n      case \"clientContextParams\":\n      case \"builtInParams\":\n        endpointParams[name] = await createConfigValueProvider<Config>(\n          instruction.name,\n          name,\n          clientConfig,\n          instruction.type !== \"builtInParams\"\n        )();\n        break;\n      case \"operationContextParams\":\n        endpointParams[name] = instruction.get(commandInput);\n        break;\n      default:\n        throw new Error(\"Unrecognized endpoint parameter instruction: \" + JSON.stringify(instruction));\n    }\n  }\n\n  if (Object.keys(instructions).length === 0) {\n    Object.assign(endpointParams, clientConfig);\n  }\n\n  if (String(clientConfig.serviceId).toLowerCase() === \"s3\") {\n    await resolveParamsForS3(endpointParams);\n  }\n\n  return endpointParams;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.spec.ts",
    "content": "import { CONFIG_PREFIX_SEPARATOR } from \"@smithy/core/config\";\nimport { afterEach, beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport { getEndpointUrlConfig } from \"./getEndpointUrlConfig\";\n\nconst ENV_ENDPOINT_URL = \"AWS_ENDPOINT_URL\";\nconst CONFIG_ENDPOINT_URL = \"endpoint_url\";\n\ndescribe(getEndpointUrlConfig.name, () => {\n  const serviceId = \"foo\";\n  const endpointUrlConfig = getEndpointUrlConfig(serviceId);\n\n  const mockEndpoint = \"https://mock-endpoint.com\";\n  const ORIGINAL_ENV = process.env;\n\n  beforeEach(() => {\n    process.env = {};\n  });\n\n  afterEach(() => {\n    process.env = ORIGINAL_ENV;\n  });\n\n  describe(\"environmentVariableSelector\", () => {\n    beforeEach(() => {\n      process.env[ENV_ENDPOINT_URL] = mockEndpoint;\n    });\n\n    it.each([\n      [\"foo\", `${ENV_ENDPOINT_URL}_FOO`],\n      [\"foobar\", `${ENV_ENDPOINT_URL}_FOOBAR`],\n      [\"foo bar\", `${ENV_ENDPOINT_URL}_FOO_BAR`],\n    ])(\"returns endpoint for '%s' from environment variable %s\", (serviceId, envKey) => {\n      const serviceMockEndpoint = `${mockEndpoint}/${envKey}`;\n      process.env[envKey] = serviceMockEndpoint;\n\n      const endpointUrlConfig = getEndpointUrlConfig(serviceId);\n      expect(endpointUrlConfig.environmentVariableSelector(process.env)).toEqual(serviceMockEndpoint);\n    });\n\n    it(`returns endpoint from environment variable ${ENV_ENDPOINT_URL}`, () => {\n      expect(endpointUrlConfig.environmentVariableSelector(process.env)).toEqual(mockEndpoint);\n    });\n\n    it(\"returns undefined, if endpoint not available in environment variables\", () => {\n      process.env[ENV_ENDPOINT_URL] = undefined;\n      expect(endpointUrlConfig.environmentVariableSelector(process.env)).toBeUndefined();\n    });\n  });\n\n  describe(\"configFileSelector\", () => {\n    it.each([\n      [\"foo\", \"foo\"],\n      [\"foobar\", \"foobar\"],\n      [\"foo bar\", \"foo_bar\"],\n    ])(\"returns endpoint for '%s' from config file '%s'\", (serviceId, serviceConfigId) => {\n      const servicesSectionPrefix = \"services\";\n      const servicesSectionName = \"config-services\";\n      const serviceMockEndpoint = `${mockEndpoint}/${serviceConfigId}`;\n\n      const profile = {\n        [servicesSectionPrefix]: servicesSectionName,\n        [CONFIG_ENDPOINT_URL]: mockEndpoint,\n      };\n\n      const config = {\n        [serviceId]: profile,\n        [[servicesSectionPrefix, servicesSectionName].join(CONFIG_PREFIX_SEPARATOR)]: {\n          [[serviceConfigId, CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)]: serviceMockEndpoint,\n        },\n      };\n\n      const endpointUrlConfig = getEndpointUrlConfig(serviceId);\n      expect(endpointUrlConfig.configFileSelector(profile, config)).toEqual(serviceMockEndpoint);\n    });\n\n    it(`returns endpoint from config ${CONFIG_ENDPOINT_URL}`, () => {\n      const profile = { [CONFIG_ENDPOINT_URL]: mockEndpoint };\n      expect(endpointUrlConfig.configFileSelector(profile)).toEqual(mockEndpoint);\n    });\n\n    it(\"returns undefined, if endpoint not available in config\", () => {\n      expect(endpointUrlConfig.environmentVariableSelector({})).toBeUndefined();\n    });\n  });\n\n  it(\"returns undefined by default\", () => {\n    expect(endpointUrlConfig.default).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.ts",
    "content": "import { CONFIG_PREFIX_SEPARATOR, type LoadedConfigSelectors } from \"@smithy/core/config\";\n\nconst ENV_ENDPOINT_URL = \"AWS_ENDPOINT_URL\";\nconst CONFIG_ENDPOINT_URL = \"endpoint_url\";\n\nexport const getEndpointUrlConfig = (serviceId: string): LoadedConfigSelectors<string | undefined> => ({\n  environmentVariableSelector: (env) => {\n    // The value provided by a service-specific environment variable.\n    const serviceSuffixParts = serviceId.split(\" \").map((w) => w.toUpperCase());\n    const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join(\"_\")];\n    if (serviceEndpointUrl) return serviceEndpointUrl;\n\n    // The value provided by the global endpoint environment variable.\n    const endpointUrl = env[ENV_ENDPOINT_URL];\n    if (endpointUrl) return endpointUrl;\n\n    return undefined;\n  },\n\n  configFileSelector: (profile, config) => {\n    // The value provided by a service-specific parameter from a services definition section\n    if (config && profile.services) {\n      const servicesSection = config[[\"services\", profile.services].join(CONFIG_PREFIX_SEPARATOR)];\n      if (servicesSection) {\n        const servicePrefixParts = serviceId.split(\" \").map((w) => w.toLowerCase());\n        const endpointUrl =\n          servicesSection[[servicePrefixParts.join(\"_\"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];\n        if (endpointUrl) return endpointUrl;\n      }\n    }\n\n    // The value provided by the global parameter from a profile in the shared configuration file.\n    const endpointUrl = profile[CONFIG_ENDPOINT_URL];\n    if (endpointUrl) return endpointUrl;\n\n    return undefined;\n  },\n\n  default: undefined,\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.ts",
    "content": "/**\n * @deprecated Use `toEndpointV1` from `@smithy/core/endpoints` instead.\n * @internal\n */\nexport { toEndpointV1 } from \"../../toEndpointV1\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/endpointMiddleware.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport type {\n  AuthScheme,\n  EndpointParameters,\n  EndpointV2,\n  HandlerExecutionContext,\n  MetadataBearer,\n  SelectedHttpAuthScheme,\n  SerializeHandler,\n  SerializeHandlerArguments,\n  SerializeHandlerOutput,\n  SerializeMiddleware,\n  SmithyFeatures,\n} from \"@smithy/types\";\n\nimport { bindGetEndpointFromInstructions, type GetEndpointFromConfig } from \"./adaptors/getEndpointFromInstructions\";\nimport type { EndpointResolvedConfig } from \"./resolveEndpointConfig\";\nimport type { EndpointParameterInstructions } from \"./types\";\n\nfunction setFeature<F extends keyof SmithyFeatures>(\n  context: HandlerExecutionContext,\n  feature: F,\n  value: SmithyFeatures[F]\n) {\n  if (!context.__smithy_context) {\n    context.__smithy_context = { features: {} };\n  } else if (!context.__smithy_context.features) {\n    context.__smithy_context.features = {};\n  }\n  context.__smithy_context.features![feature] = value;\n}\n\n/**\n * @internal\n */\ninterface EndpointMiddlewareSmithyContext extends Record<string, unknown> {\n  selectedHttpAuthScheme?: SelectedHttpAuthScheme;\n}\n\n/**\n * @internal\n */\nexport function bindEndpointMiddleware(getEndpointFromConfig: GetEndpointFromConfig) {\n  const getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig);\n\n  return <T extends EndpointParameters>({\n    config,\n    instructions,\n  }: {\n    config: EndpointResolvedConfig<T>;\n    instructions: EndpointParameterInstructions;\n  }): SerializeMiddleware<any, any> => {\n    return <Output extends MetadataBearer>(\n        next: SerializeHandler<any, Output>,\n        context: HandlerExecutionContext\n      ): SerializeHandler<any, Output> =>\n      async (args: SerializeHandlerArguments<any>): Promise<SerializeHandlerOutput<Output>> => {\n        if (config.isCustomEndpoint) {\n          setFeature(context, \"ENDPOINT_OVERRIDE\", \"N\");\n        }\n\n        const endpoint: EndpointV2 = await getEndpointFromInstructions(\n          args.input,\n          {\n            getEndpointParameterInstructions() {\n              return instructions;\n            },\n          },\n          { ...config },\n          context\n        );\n\n        context.endpointV2 = endpoint;\n        context.authSchemes = endpoint.properties?.authSchemes;\n\n        const authScheme: AuthScheme | undefined = context.authSchemes?.[0];\n        if (authScheme) {\n          context[\"signing_region\"] = authScheme.signingRegion;\n          context[\"signing_service\"] = authScheme.signingName;\n          const smithyContext: EndpointMiddlewareSmithyContext = getSmithyContext(context);\n          const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;\n          if (httpAuthOption) {\n            httpAuthOption.signingProperties = Object.assign(\n              httpAuthOption.signingProperties || {},\n              {\n                signing_region: authScheme.signingRegion,\n                signingRegion: authScheme.signingRegion,\n                signing_service: authScheme.signingName,\n                signingName: authScheme.signingName,\n                signingRegionSet: authScheme.signingRegionSet,\n              },\n              authScheme.properties\n            );\n          }\n        }\n\n        return next({\n          ...args,\n        });\n      };\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/getEndpointPlugin.ts",
    "content": "import type { EndpointParameters, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from \"@smithy/types\";\n\nimport type { GetEndpointFromConfig } from \"./adaptors/getEndpointFromInstructions\";\nimport { bindEndpointMiddleware } from \"./endpointMiddleware\";\nimport type { EndpointResolvedConfig } from \"./resolveEndpointConfig\";\nimport type { EndpointParameterInstructions } from \"./types\";\n\n/**\n * Inlined from @smithy/core/serde to avoid cross-submodule CJS resolution issue.\n */\nconst serializerMiddlewareOption: SerializeHandlerOptions = {\n  name: \"serializerMiddleware\",\n  step: \"serialize\",\n  tags: [\"SERIALIZER\"],\n  override: true,\n};\n\n/**\n * @internal\n */\nexport const endpointMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"serialize\",\n  tags: [\"ENDPOINT_PARAMETERS\", \"ENDPOINT_V2\", \"ENDPOINT\"],\n  name: \"endpointV2Middleware\",\n  override: true,\n  relation: \"before\",\n  toMiddleware: serializerMiddlewareOption.name!,\n};\n\n/**\n * @internal\n */\nexport function bindGetEndpointPlugin(getEndpointFromConfig: GetEndpointFromConfig) {\n  const endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);\n\n  return <T extends EndpointParameters>(\n    config: EndpointResolvedConfig<T>,\n    instructions: EndpointParameterInstructions\n  ): Pluggable<any, any> => ({\n    applyToStack: (clientStack) => {\n      clientStack.addRelativeTo(\n        endpointMiddleware<T>({\n          config,\n          instructions,\n        }),\n        endpointMiddlewareOptions\n      );\n    },\n  });\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { resolveEndpointConfig } from \"../index\";\n\ndescribe(resolveEndpointConfig.name, () => {\n  it(\"maintains object custody\", () => {\n    const input = {\n      tls: true,\n      useFipsEndpoint: true,\n      useDualstackEndpoint: true,\n      endpointProvider: vi.fn(),\n      urlParser: vi.fn(),\n      region: async () => \"us-east-1\",\n    };\n    expect(resolveEndpointConfig(input)).toBe(input);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport type { Endpoint, EndpointParameters, EndpointV2, Logger, Provider, UrlParser } from \"@smithy/types\";\n\nimport type { GetEndpointFromConfig } from \"./adaptors/getEndpointFromInstructions\";\nimport { toEndpointV1 } from \"./adaptors/toEndpointV1\";\n\n/**\n * Endpoint config interfaces and resolver for Endpoint v2. They live in separate package to allow per-service onboarding.\n * When all services onboard Endpoint v2, the resolver in config-resolver package can be removed.\n * This interface includes all the endpoint parameters with built-in bindings of \"AWS::*\" and \"SDK::*\"\n *\n * @public\n */\nexport interface EndpointInputConfig<T extends EndpointParameters = EndpointParameters> {\n  /**\n   * The fully qualified endpoint of the webservice. This is only for using\n   * a custom endpoint (for example, when using a local version of S3).\n   *\n   * Endpoint transformations such as S3 applying a bucket to the hostname are\n   * still applicable to this custom endpoint.\n   */\n  endpoint?: string | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n\n  /**\n   * Providing a custom endpointProvider will override\n   * built-in transformations of the endpoint such as S3 adding the bucket\n   * name to the hostname, since they are part of the default endpointProvider.\n   */\n  endpointProvider?: (params: T, context?: { logger?: Logger }) => EndpointV2;\n\n  /**\n   * Whether TLS is enabled for requests.\n   * @deprecated\n   */\n  tls?: boolean;\n\n  /**\n   * Enables IPv6/IPv4 dualstack endpoint.\n   */\n  useDualstackEndpoint?: boolean | Provider<boolean | undefined>;\n\n  /**\n   * Enables FIPS compatible endpoints.\n   */\n  useFipsEndpoint?: boolean | Provider<boolean | undefined>;\n\n  /**\n   * This field is used internally so you should not fill any value to this field.\n   *\n   * @internal\n   */\n  serviceConfiguredEndpoint?: never;\n}\n\n/**\n * @internal\n */\nexport interface PreviouslyResolved<T extends EndpointParameters = EndpointParameters> {\n  urlParser: UrlParser;\n  endpointProvider: (params: T, context?: { logger?: Logger }) => EndpointV2;\n  logger?: Logger;\n  serviceId?: string;\n}\n\n/**\n * This supersedes the similarly named EndpointsResolvedConfig (no parametric types)\n * from resolveEndpointsConfig.ts in \\@smithy/config-resolver.\n *\n * @internal\n */\nexport interface EndpointResolvedConfig<T extends EndpointParameters = EndpointParameters> {\n  /**\n   * Custom endpoint provided by the user.\n   * This is normalized to a single interface from the various acceptable types.\n   * This field will be undefined if a custom endpoint is not provided.\n   */\n  endpoint?: Provider<Endpoint>;\n\n  endpointProvider: (params: T, context?: { logger?: Logger }) => EndpointV2;\n\n  /**\n   * Whether TLS is enabled for requests.\n   * @deprecated\n   */\n  tls: boolean;\n\n  /**\n   * Whether the endpoint is specified by caller.\n   * This should be used over checking the existence of `endpoint`, since\n   * that may have been set by other means, such as the default regional\n   * endpoint provider function.\n   *\n   * @internal\n   */\n  isCustomEndpoint?: boolean;\n\n  /**\n   * Resolved value for input {@link EndpointsInputConfig.useDualstackEndpoint}\n   */\n  useDualstackEndpoint: Provider<boolean>;\n\n  /**\n   * Resolved value for input {@link EndpointsInputConfig.useFipsEndpoint}\n   */\n  useFipsEndpoint: Provider<boolean>;\n\n  /**\n   * Unique service identifier.\n   * @internal\n   */\n  serviceId?: string;\n\n  /**\n   * A configured endpoint global or specific to the service from ENV or AWS SDK configuration files.\n   * @internal\n   */\n  serviceConfiguredEndpoint?: Provider<string | undefined>;\n}\n\n/**\n * @internal\n */\nexport function bindResolveEndpointConfig(getEndpointFromConfig: GetEndpointFromConfig) {\n  return <T, P extends EndpointParameters = EndpointParameters>(\n    input: T & EndpointInputConfig<P> & PreviouslyResolved<P>\n  ): T & EndpointResolvedConfig<P> => {\n    const tls = input.tls ?? true;\n    const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;\n\n    const customEndpointProvider =\n      endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : undefined;\n\n    const isCustomEndpoint = !!endpoint;\n\n    const resolvedConfig = Object.assign(input, {\n      endpoint: customEndpointProvider,\n      tls,\n      isCustomEndpoint,\n      useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),\n      useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),\n    }) as T & EndpointResolvedConfig<P>;\n\n    let configuredEndpointPromise: undefined | Promise<string | undefined> = undefined;\n    resolvedConfig.serviceConfiguredEndpoint = async () => {\n      if (input.serviceId && !configuredEndpointPromise) {\n        configuredEndpointPromise = getEndpointFromConfig(input.serviceId);\n      }\n      return configuredEndpointPromise;\n    };\n\n    return resolvedConfig;\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/resolveEndpointRequiredConfig.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { resolveEndpointRequiredConfig } from \"./resolveEndpointRequiredConfig\";\n\ndescribe(resolveEndpointRequiredConfig.name, () => {\n  it(\"creates a default endpoint resolver function\", async () => {\n    const config = resolveEndpointRequiredConfig({\n      endpoint: undefined as any,\n    });\n\n    expect(() => config.endpoint()).rejects.toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/resolveEndpointRequiredConfig.ts",
    "content": "import type { Endpoint, EndpointV2, Provider } from \"@smithy/types\";\n\n/**\n * This is an additional config resolver layer for clients using the default\n * endpoints ruleset. It modifies the input and output config types to make\n * the endpoint configuration property required.\n *\n * It must be placed after the `resolveEndpointConfig`\n * resolver. This replaces the \"CustomEndpoints\" config resolver, which was used\n * prior to default endpoint rulesets.\n *\n * @public\n */\nexport interface EndpointRequiredInputConfig {\n  endpoint: string | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n}\n\n/**\n * @internal\n */\ninterface PreviouslyResolved {\n  endpoint?: Provider<Endpoint>;\n}\n\n/**\n * @internal\n */\nexport interface EndpointRequiredResolvedConfig {\n  endpoint: Provider<Endpoint>;\n}\n\n/**\n * @internal\n */\nexport const resolveEndpointRequiredConfig = <T>(\n  input: T & EndpointRequiredInputConfig & PreviouslyResolved\n): T & EndpointRequiredResolvedConfig => {\n  const { endpoint } = input;\n  if (endpoint === undefined) {\n    input.endpoint = async () => {\n      throw new Error(\n        \"@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.\"\n      );\n    };\n  }\n  return input as T & EndpointRequiredResolvedConfig;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/service-customizations/index.ts",
    "content": "/**\n * @internal\n */\nexport * from \"./s3\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/service-customizations/s3.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isArnBucketName } from \"./s3\";\n\ndescribe(\"S3 customizations for endpoint resolution\", () => {\n  describe(isArnBucketName.name, () => {\n    it(\"should require the partition, service, and a resource id\", () => {\n      expect(isArnBucketName(\"arn:aws:s3:us-east-1:1234567890:bucket_name\")).toBe(true);\n\n      expect(() => isArnBucketName(\"arn::s3:us-east-1:1234567890:bucket_name\")).toThrow();\n      expect(() => isArnBucketName(\"arn:aws::us-east-1:1234567890:bucket_name\")).toThrow();\n      expect(() => isArnBucketName(\"arn:aws:s3:us-east-1:1234567890:\")).toThrow();\n    });\n    it(\"should not require the account id\", () => {\n      expect(isArnBucketName(\"arn:aws:s3:::bucket_name\")).toBe(true);\n      expect(isArnBucketName(\"arn:aws:s3::123456789:bucket_name\")).toBe(true);\n\n      expect(() => isArnBucketName(\"arn:aws:s3:::\")).toThrow();\n      expect(() => isArnBucketName(\"arn:aws:s3::123456789:\")).toThrow();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/service-customizations/s3.ts",
    "content": "import type { EndpointParameters } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const resolveParamsForS3 = async (endpointParams: EndpointParameters) => {\n  const bucket = (endpointParams?.Bucket as string) || \"\";\n\n  if (typeof endpointParams.Bucket === \"string\") {\n    endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent(\"#\")).replace(/\\?/g, encodeURIComponent(\"?\"));\n  }\n\n  if (isArnBucketName(bucket)) {\n    if (endpointParams.ForcePathStyle === true) {\n      throw new Error(\"Path-style addressing cannot be used with ARN buckets\");\n    }\n  } else if (\n    !isDnsCompatibleBucketName(bucket) ||\n    (bucket.indexOf(\".\") !== -1 && !String(endpointParams.Endpoint).startsWith(\"http:\")) ||\n    bucket.toLowerCase() !== bucket ||\n    bucket.length < 3\n  ) {\n    endpointParams.ForcePathStyle = true;\n  }\n\n  if (endpointParams.DisableMultiRegionAccessPoints) {\n    // inconsistent naming\n    endpointParams.disableMultiRegionAccessPoints = true;\n    endpointParams.DisableMRAP = true;\n  }\n\n  return endpointParams;\n};\n\nconst DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$/;\nconst IP_ADDRESS_PATTERN = /(\\d+\\.){3}\\d+/;\nconst DOTS_PATTERN = /\\.\\./;\n/**\n * @internal\n */\nexport const DOT_PATTERN = /\\./;\n/**\n * @internal\n */\nexport const S3_HOSTNAME_PATTERN = /^(.+\\.)?s3(-fips)?(\\.dualstack)?[.-]([a-z0-9-]+)\\./;\n\n/**\n * Determines whether a given string is DNS compliant per the rules outlined by\n * S3. Length, capitaization, and leading dot restrictions are enforced by the\n * DOMAIN_PATTERN regular expression.\n * @internal\n *\n * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html\n */\nexport const isDnsCompatibleBucketName = (bucketName: string): boolean =>\n  DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);\n\n/**\n * @internal\n */\nexport const isArnBucketName = (bucketName: string): boolean => {\n  // region and account are unused between service and bucket.\n  const [arn, partition, service, , , bucket] = bucketName.split(\":\");\n\n  const isArn = arn === \"arn\" && bucketName.split(\":\").length >= 6;\n  const isValidArn = Boolean(isArn && partition && service && bucket);\n\n  if (isArn && !isValidArn) {\n    throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);\n  }\n\n  return isValidArn;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/middleware-endpoint/types.ts",
    "content": "/**\n * @internal\n */\nexport interface EndpointParameterInstructions {\n  [name: string]:\n    | BuiltInParamInstruction\n    | ClientContextParamInstruction\n    | StaticContextParamInstruction\n    | ContextParamInstruction\n    | OperationContextParamInstruction;\n}\n\n/**\n * @internal\n */\nexport interface BuiltInParamInstruction {\n  type: \"builtInParams\";\n  name: string;\n}\n\n/**\n * @internal\n */\nexport interface ClientContextParamInstruction {\n  type: \"clientContextParams\";\n  name: string; // The client resolved config name that has clientContextParams trait\n}\n\n/**\n * @internal\n */\nexport interface StaticContextParamInstruction {\n  type: \"staticContextParams\";\n  value: string | boolean;\n}\n\n/**\n * @internal\n */\nexport interface ContextParamInstruction {\n  type: \"contextParams\";\n  name: string; // The input structure's member name that has contextParams trait\n}\n\n/**\n * @internal\n */\nexport interface OperationContextParamInstruction {\n  type: \"operationContextParams\";\n  get(input: any): any;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/toEndpointV1.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { toEndpointV1 } from \"./toEndpointV1\";\n\ndescribe(toEndpointV1.name, () => {\n  it(\"converts string endpoint\", () => {\n    const result = toEndpointV1(\"https://example.com/path\");\n\n    expect(result).toEqual({\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/path\",\n    });\n  });\n\n  it(\"converts EndpointV2 to EndpointV1 with url\", () => {\n    const result = toEndpointV1({\n      url: new URL(\"https://example.com/path\"),\n    });\n\n    expect(result).toEqual({\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/path\",\n    });\n  });\n\n  it(\"converts EndpointV2 headers to EndpointV1 format\", () => {\n    const result = toEndpointV1({\n      url: new URL(\"https://example.com/path\"),\n      headers: {\n        \"x-api-key\": [\"key-value\"],\n        \"x-custom-header\": [\"value1\", \"value2\"],\n      },\n    });\n\n    expect(result).toEqual({\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/path\",\n      headers: {\n        \"x-api-key\": \"key-value\",\n        \"x-custom-header\": \"value1, value2\",\n      },\n    });\n  });\n\n  it(\"passes through EndpointV1\", () => {\n    const v1Endpoint = {\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/path\",\n    };\n\n    const result = toEndpointV1(v1Endpoint);\n\n    expect(result).toBe(v1Endpoint);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/toEndpointV1.ts",
    "content": "import { parseUrl } from \"@smithy/core/protocols\";\nimport type { Endpoint, EndpointV2 } from \"@smithy/types\";\n\n/**\n * Converts an endpoint to EndpointV1 format.\n * @internal\n */\nexport const toEndpointV1 = (endpoint: string | Endpoint | EndpointV2): Endpoint => {\n  if (typeof endpoint === \"object\") {\n    if (\"url\" in endpoint) {\n      // v2\n      const v1Endpoint = parseUrl(endpoint.url);\n      if (endpoint.headers) {\n        v1Endpoint.headers = {};\n        for (const name in endpoint.headers) {\n          v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(\", \");\n        }\n      }\n      return v1Endpoint;\n    }\n    // v1\n    return endpoint;\n  }\n  return parseUrl(endpoint);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/endpoints`.\n\n## 3.4.2\n\n### Patch Changes\n\n- 449ba5a: Reduce temporary object allocations\n\n## 3.4.1\n\n### Patch Changes\n\n- 5a18069: fix getAttr function when using negative index\n- cb76b1f: handle nullish input for getEndpointHeaders function\n- b4a8b6b: Resolve defaults and required params in one pass\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/node-config-provider@4.3.14\n\n## 3.4.0\n\n### Minor Changes\n\n- 8196133: add endpoint binary decision diagrams feature\n- 2490c8c: performance improvements for endpoint resolver functions\n\n## 3.3.4\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/node-config-provider@4.3.13\n\n## 3.3.3\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/node-config-provider@4.3.12\n\n## 3.3.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/node-config-provider@4.3.11\n\n## 3.3.1\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/node-config-provider@4.3.10\n\n## 3.3.0\n\n### Minor Changes\n\n- 2bf677c: return empty when given non-ASCII input in substring\n\n## 3.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/types@4.12.1\n\n## 3.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/node-config-provider@4.3.8\n\n## 3.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/node-config-provider@4.3.7\n\n## 3.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/node-config-provider@4.3.6\n\n## 3.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/node-config-provider@4.3.5\n\n## 3.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/node-config-provider@4.3.4\n\n## 3.2.3\n\n### Patch Changes\n\n- 7e359e2: remove and ban circular imports\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/node-config-provider@4.3.3\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/node-config-provider@4.3.2\n\n## 3.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/node-config-provider@4.3.1\n\n## 3.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/types@4.6.0\n\n## 3.1.2\n\n### Patch Changes\n\n- @smithy/node-config-provider@4.2.2\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/node-config-provider@4.2.1\n\n## 3.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/types@4.4.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/node-config-provider@4.1.4\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/node-config-provider@4.1.3\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/node-config-provider@4.1.2\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/node-config-provider@4.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/node-config-provider@4.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/types@4.0.0\n\n## 2.1.7\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/node-config-provider@3.1.12\n\n## 2.1.6\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/node-config-provider@3.1.11\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/node-config-provider@3.1.10\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/node-config-provider@3.1.9\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/node-config-provider@3.1.8\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/node-config-provider@3.1.7\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/node-config-provider@3.1.6\n\n## 2.1.0\n\n### Minor Changes\n\n- 1ff575c: add endpoint ruleset cache\n\n### Patch Changes\n\n- 77db9e7: Do not take protocol and port from custom Endpoint\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/node-config-provider@3.1.5\n\n## 2.0.5\n\n### Patch Changes\n\n- @smithy/node-config-provider@3.1.4\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/node-config-provider@3.1.3\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/node-config-provider@3.1.2\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/node-config-provider@3.1.1\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n  - @smithy/node-config-provider@3.1.0\n\n## 2.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- c1105634: improves the debug message in util-endpoints\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/node-config-provider@3.0.0\n\n## 1.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/types@2.12.0\n\n## 1.1.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/node-config-provider@2.2.5\n\n## 1.1.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.2.4\n\n## 1.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/node-config-provider@2.2.3\n\n## 1.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/node-config-provider@2.2.2\n\n## 1.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/types@2.9.1\n\n## 1.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/types@2.9.0\n\n## 1.0.8\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/node-config-provider@2.1.9\n\n## 1.0.7\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.8\n\n## 1.0.6\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/node-config-provider@2.1.7\n\n## 1.0.5\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/node-config-provider@2.1.6\n\n## 1.0.4\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/node-config-provider@2.1.5\n\n## 1.0.3\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.4\n\n## 1.0.2\n\n### Patch Changes\n\n- d84019ef: Re-export existing types\n\n## 1.0.1\n\n### Patch Changes\n\n- 926ba651: Migrate util-endpoints package\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/aws-region.json",
    "content": "{\n  \"testCases\": [\n    {\n      \"documentation\": \"basic region templating\",\n      \"params\": {\n        \"Region\": \"us-east-1\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://us-east-1.amazonaws.com\",\n          \"properties\": {\n            \"authSchemes\": [\n              {\n                \"name\": \"sigv4\",\n                \"signingRegion\": \"us-east-1\",\n                \"signingName\": \"serviceName\"\n              }\n            ]\n          }\n        }\n      }\n    },\n    {\n      \"documentation\": \"test case where region is unset\",\n      \"params\": {},\n      \"expect\": {\n        \"error\": \"Region must be set to resolve a valid endpoint\"\n      }\n    }\n  ],\n  \"version\": \"1.4\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/default-values.json",
    "content": "{\n  \"testCases\": [\n    {\n      \"documentation\": \"default endpoint\",\n      \"params\": {},\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://fips.us-west-5.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"test case where FIPS is disabled\",\n      \"params\": {\n        \"UseFips\": false\n      },\n      \"expect\": {\n        \"error\": \"UseFips = false\"\n      }\n    },\n    {\n      \"documentation\": \"test case where FIPS is enabled explicitly\",\n      \"params\": {\n        \"UseFips\": true\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://fips.us-west-5.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"defaults can be overridden\",\n      \"params\": {\n        \"Region\": \"us-east-1\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://fips.us-east-1.amazonaws.com\"\n        }\n      }\n    }\n  ],\n  \"version\": \"1.4\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/headers.json",
    "content": "{\n  \"version\": \"1.4\",\n  \"testCases\": [\n    {\n      \"documentation\": \"header set to region\",\n      \"params\": {\n        \"Region\": \"us-east-1\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://us-east-1.amazonaws.com\",\n          \"headers\": {\n            \"x-amz-region\": [\"us-east-1\"],\n            \"x-amz-multi\": [\"*\", \"us-east-1\"]\n          }\n        }\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/local-region-override.json",
    "content": "{\n  \"testCases\": [\n    {\n      \"documentation\": \"local region override\",\n      \"params\": {\n        \"Region\": \"local\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"http://localhost:8080\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"standard region templated\",\n      \"params\": {\n        \"Region\": \"us-east-2\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://us-east-2.someservice.amazonaws.com\"\n        }\n      }\n    }\n  ],\n  \"version\": \"1.4\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/parse-url.json",
    "content": "{\n  \"version\": \"1.4\",\n  \"testCases\": [\n    {\n      \"documentation\": \"simple URL parsing\",\n      \"params\": {\n        \"Endpoint\": \"https://authority.com/custom-path\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://https-authority.com.example.com/path-is/custom-path\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"empty path no slash\",\n      \"params\": {\n        \"Endpoint\": \"https://authority.com\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://https-authority.com-nopath.example.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"empty path with slash\",\n      \"params\": {\n        \"Endpoint\": \"https://authority.com/\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://https-authority.com-nopath.example.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"authority with port\",\n      \"params\": {\n        \"Endpoint\": \"https://authority.com:8000/port\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://authority.com:8000/uri-with-port\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"http schemes\",\n      \"params\": {\n        \"Endpoint\": \"http://authority.com:8000/port\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"http://authority.com:8000/uri-with-port\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"arbitrary schemes are not supported\",\n      \"params\": {\n        \"Endpoint\": \"acbd://example.com\"\n      },\n      \"expect\": {\n        \"error\": \"endpoint was invalid\"\n      }\n    },\n    {\n      \"documentation\": \"host labels are not validated\",\n      \"params\": {\n        \"Endpoint\": \"http://99_ab.com\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://http-99_ab.com-nopath.example.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"host labels are not validated\",\n      \"params\": {\n        \"Endpoint\": \"http://99_ab-.com\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://http-99_ab-.com-nopath.example.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"invalid URL\",\n      \"params\": {\n        \"Endpoint\": \"http://abc.com:a/foo\"\n      },\n      \"expect\": {\n        \"error\": \"endpoint was invalid\"\n      },\n      \"skip\": true\n    },\n    {\n      \"documentation\": \"IP Address\",\n      \"params\": {\n        \"Endpoint\": \"http://192.168.1.1/foo/\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"http://192.168.1.1/foo/is-ip-addr\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"IP Address with port\",\n      \"params\": {\n        \"Endpoint\": \"http://192.168.1.1:1234/foo/\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"http://192.168.1.1:1234/foo/is-ip-addr\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"IPv6 Address\",\n      \"params\": {\n        \"Endpoint\": \"https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443/is-ip-addr\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"weird DNS name\",\n      \"params\": {\n        \"Endpoint\": \"https://999.999.abc.blah\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://https-999.999.abc.blah-nopath.example.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"query in resolved endpoint is not supported\",\n      \"params\": {\n        \"Endpoint\": \"https://example.com/path?query1=foo\"\n      },\n      \"expect\": {\n        \"error\": \"endpoint was invalid\"\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/substring.json",
    "content": "{\n  \"testCases\": [\n    {\n      \"documentation\": \"substring when string is long enough\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"abcdefg\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `abcd`\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is exactly the right length\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"abcd\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `abcd`\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is too short\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"abc\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is too short\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring on wide characters (ensure that unicode code points are properly counted)\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"\\ufdfd\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is long enough\",\n      \"params\": {\n        \"TestCaseId\": \"2\",\n        \"Input\": \"abcdefg\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `defg`\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is exactly the right length\",\n      \"params\": {\n        \"TestCaseId\": \"2\",\n        \"Input\": \"defg\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `defg`\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is too short\",\n      \"params\": {\n        \"TestCaseId\": \"2\",\n        \"Input\": \"abc\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is too short\",\n      \"params\": {\n        \"TestCaseId\": \"2\",\n        \"Input\": \"\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring on wide characters (ensure that unicode code points are properly counted)\",\n      \"params\": {\n        \"TestCaseId\": \"2\",\n        \"Input\": \"\\ufdfd\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is longer\",\n      \"params\": {\n        \"TestCaseId\": \"3\",\n        \"Input\": \"defg\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `ef`\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is exact length\",\n      \"params\": {\n        \"TestCaseId\": \"3\",\n        \"Input\": \"def\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `ef`\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is too short\",\n      \"params\": {\n        \"TestCaseId\": \"3\",\n        \"Input\": \"ab\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring when string is too short\",\n      \"params\": {\n        \"TestCaseId\": \"3\",\n        \"Input\": \"\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    },\n    {\n      \"documentation\": \"substring on wide characters (ensure that unicode code points are properly counted)\",\n      \"params\": {\n        \"TestCaseId\": \"3\",\n        \"Input\": \"\\ufdfd\"\n      },\n      \"expect\": {\n        \"error\": \"No tests matched\"\n      }\n    }\n  ],\n  \"version\": \"1.4\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/uri-encode.json",
    "content": "{\n  \"testCases\": [\n    {\n      \"documentation\": \"uriEncode when the string has nothing to encode returns the input\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"abcdefg\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `abcdefg`\"\n      }\n    },\n    {\n      \"documentation\": \"uriEncode with single character to encode encodes only that character\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"abc:defg\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `abc%3Adefg`\"\n      }\n    },\n    {\n      \"documentation\": \"uriEncode with all ASCII characters to encode encodes all characters\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"/:,?#[]{}|@! $&'()*+;=%<>\\\"^`\\\\\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `%2F%3A%2C%3F%23%5B%5D%7B%7D%7C%40%21%20%24%26%27%28%29%2A%2B%3B%3D%25%3C%3E%22%5E%60%5C`\"\n      }\n    },\n    {\n      \"documentation\": \"uriEncode with ASCII characters that should not be encoded returns the input\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"0123456789.underscore_dash-Tilda~\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `0123456789.underscore_dash-Tilda~`\"\n      }\n    },\n    {\n      \"documentation\": \"uriEncode encodes unicode characters\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"\\ud83d\\ude39\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `%F0%9F%98%B9`\"\n      }\n    },\n    {\n      \"documentation\": \"uriEncode on all printable ASCII characters\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \" !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: `%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~`\"\n      }\n    },\n    {\n      \"documentation\": \"uriEncode on an empty string\",\n      \"params\": {\n        \"TestCaseId\": \"1\",\n        \"Input\": \"\"\n      },\n      \"expect\": {\n        \"error\": \"The value is: ``\"\n      }\n    }\n  ],\n  \"version\": \"1.4\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/test-cases/valid-hostlabel.json",
    "content": "{\n  \"testCases\": [\n    {\n      \"documentation\": \"standard region is a valid hostlabel\",\n      \"params\": {\n        \"Region\": \"us-east-1\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://us-east-1.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"starting with a number is a valid hostlabel\",\n      \"params\": {\n        \"Region\": \"3aws4\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://3aws4.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"when there are dots, only match if subdomains are allowed\",\n      \"params\": {\n        \"Region\": \"part1.part2\"\n      },\n      \"expect\": {\n        \"endpoint\": {\n          \"url\": \"https://part1.part2-subdomains.amazonaws.com\"\n        }\n      }\n    },\n    {\n      \"documentation\": \"a space is never a valid hostlabel\",\n      \"params\": {\n        \"Region\": \"part1 part2\"\n      },\n      \"expect\": {\n        \"error\": \"Invalid hostlabel\"\n      }\n    }\n  ],\n  \"version\": \"1.4\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/aws-region.json",
    "content": "{\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"string\",\n      \"builtIn\": \"AWS::Region\",\n      \"documentation\": \"The region to dispatch this request, eg. `us-east-1`.\"\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"Template the region into the URI when region is set\",\n      \"conditions\": [\n        {\n          \"fn\": \"isSet\",\n          \"argv\": [\n            {\n              \"ref\": \"Region\"\n            }\n          ]\n        }\n      ],\n      \"endpoint\": {\n        \"url\": \"https://{Region}.amazonaws.com\",\n        \"properties\": {\n          \"authSchemes\": [\n            {\n              \"name\": \"sigv4\",\n              \"signingName\": \"serviceName\",\n              \"signingRegion\": \"{Region}\"\n            }\n          ]\n        }\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"fallback when region is unset\",\n      \"conditions\": [],\n      \"error\": \"Region must be set to resolve a valid endpoint\",\n      \"type\": \"error\"\n    }\n  ],\n  \"version\": \"1.3\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/default-values.json",
    "content": "{\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"string\",\n      \"builtIn\": \"AWS::Region\",\n      \"documentation\": \"The region to dispatch this request, eg. `us-east-1`.\",\n      \"default\": \"us-west-5\",\n      \"required\": true\n    },\n    \"UseFips\": {\n      \"type\": \"boolean\",\n      \"builtIn\": \"AWS::UseFIPS\",\n      \"default\": true,\n      \"required\": true\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"Template the region into the URI when FIPS is enabled\",\n      \"conditions\": [\n        {\n          \"fn\": \"booleanEquals\",\n          \"argv\": [\n            {\n              \"ref\": \"UseFips\"\n            },\n            true\n          ]\n        }\n      ],\n      \"endpoint\": {\n        \"url\": \"https://fips.{Region}.amazonaws.com\"\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"error when fips is disabled\",\n      \"conditions\": [],\n      \"error\": \"UseFips = false\",\n      \"type\": \"error\"\n    }\n  ],\n  \"version\": \"1.3\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/headers.json",
    "content": "{\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"string\",\n      \"builtIn\": \"AWS::Region\",\n      \"documentation\": \"The region to dispatch this request, eg. `us-east-1`.\"\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"Template the region into the URI when region is set\",\n      \"conditions\": [\n        {\n          \"fn\": \"isSet\",\n          \"argv\": [\n            {\n              \"ref\": \"Region\"\n            }\n          ]\n        }\n      ],\n      \"endpoint\": {\n        \"url\": \"https://{Region}.amazonaws.com\",\n        \"headers\": {\n          \"x-amz-region\": [\"{Region}\"],\n          \"x-amz-multi\": [\"*\", \"{Region}\"]\n        }\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"fallback when region is unset\",\n      \"conditions\": [],\n      \"error\": \"Region must be set to resolve a valid endpoint\",\n      \"type\": \"error\"\n    }\n  ],\n  \"version\": \"1.3\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/local-region-override.json",
    "content": "{\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"string\",\n      \"builtIn\": \"AWS::Region\",\n      \"required\": true\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"override rule for the local pseduo region\",\n      \"conditions\": [\n        {\n          \"fn\": \"stringEquals\",\n          \"argv\": [\"local\", \"{Region}\"]\n        }\n      ],\n      \"endpoint\": {\n        \"url\": \"http://localhost:8080\"\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"base rule\",\n      \"conditions\": [],\n      \"endpoint\": {\n        \"url\": \"https://{Region}.someservice.amazonaws.com\"\n      },\n      \"type\": \"endpoint\"\n    }\n  ],\n  \"version\": \"1.3\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/parse-url.json",
    "content": "{\n  \"version\": \"1.3\",\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"string\",\n      \"builtIn\": \"AWS::Region\"\n    },\n    \"Endpoint\": {\n      \"type\": \"string\"\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"endpoint is set and is a valid URL\",\n      \"conditions\": [\n        {\n          \"fn\": \"isSet\",\n          \"argv\": [\n            {\n              \"ref\": \"Endpoint\"\n            }\n          ]\n        },\n        {\n          \"fn\": \"parseURL\",\n          \"argv\": [\"{Endpoint}\"],\n          \"assign\": \"url\"\n        }\n      ],\n      \"rules\": [\n        {\n          \"conditions\": [\n            {\n              \"fn\": \"booleanEquals\",\n              \"argv\": [\n                {\n                  \"fn\": \"getAttr\",\n                  \"argv\": [\n                    {\n                      \"ref\": \"url\"\n                    },\n                    \"isIp\"\n                  ]\n                },\n                true\n              ]\n            }\n          ],\n          \"endpoint\": {\n            \"url\": \"{url#scheme}://{url#authority}{url#normalizedPath}is-ip-addr\"\n          },\n          \"type\": \"endpoint\"\n        },\n        {\n          \"conditions\": [\n            {\n              \"fn\": \"stringEquals\",\n              \"argv\": [\"{url#path}\", \"/port\"]\n            }\n          ],\n          \"endpoint\": {\n            \"url\": \"{url#scheme}://{url#authority}/uri-with-port\"\n          },\n          \"type\": \"endpoint\"\n        },\n        {\n          \"conditions\": [\n            {\n              \"fn\": \"stringEquals\",\n              \"argv\": [\"{url#normalizedPath}\", \"/\"]\n            }\n          ],\n          \"endpoint\": {\n            \"url\": \"https://{url#scheme}-{url#authority}-nopath.example.com\"\n          },\n          \"type\": \"endpoint\"\n        },\n        {\n          \"conditions\": [],\n          \"endpoint\": {\n            \"url\": \"https://{url#scheme}-{url#authority}.example.com/path-is{url#path}\"\n          },\n          \"type\": \"endpoint\"\n        }\n      ],\n      \"type\": \"tree\"\n    },\n    {\n      \"error\": \"endpoint was invalid\",\n      \"conditions\": [],\n      \"type\": \"error\"\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/substring.json",
    "content": "{\n  \"parameters\": {\n    \"TestCaseId\": {\n      \"type\": \"string\",\n      \"required\": true,\n      \"documentation\": \"Test case id used to select the test case to use\"\n    },\n    \"Input\": {\n      \"type\": \"string\",\n      \"required\": true,\n      \"documentation\": \"the input used to test substring\"\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"Substring from beginning of input\",\n      \"conditions\": [\n        {\n          \"fn\": \"stringEquals\",\n          \"argv\": [\"{TestCaseId}\", \"1\"]\n        },\n        {\n          \"fn\": \"substring\",\n          \"argv\": [\"{Input}\", 0, 4, false],\n          \"assign\": \"output\"\n        }\n      ],\n      \"error\": \"The value is: `{output}`\",\n      \"type\": \"error\"\n    },\n    {\n      \"documentation\": \"Substring from end of input\",\n      \"conditions\": [\n        {\n          \"fn\": \"stringEquals\",\n          \"argv\": [\"{TestCaseId}\", \"2\"]\n        },\n        {\n          \"fn\": \"substring\",\n          \"argv\": [\"{Input}\", 0, 4, true],\n          \"assign\": \"output\"\n        }\n      ],\n      \"error\": \"The value is: `{output}`\",\n      \"type\": \"error\"\n    },\n    {\n      \"documentation\": \"Substring the middle of the string\",\n      \"conditions\": [\n        {\n          \"fn\": \"stringEquals\",\n          \"argv\": [\"{TestCaseId}\", \"3\"]\n        },\n        {\n          \"fn\": \"substring\",\n          \"argv\": [\"{Input}\", 1, 3, false],\n          \"assign\": \"output\"\n        }\n      ],\n      \"error\": \"The value is: `{output}`\",\n      \"type\": \"error\"\n    },\n    {\n      \"documentation\": \"fallback when no tests match\",\n      \"conditions\": [],\n      \"error\": \"No tests matched\",\n      \"type\": \"error\"\n    }\n  ],\n  \"version\": \"1.3\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/uri-encode.json",
    "content": "{\n  \"version\": \"1.3\",\n  \"parameters\": {\n    \"TestCaseId\": {\n      \"type\": \"string\",\n      \"required\": true,\n      \"documentation\": \"Test case id used to select the test case to use\"\n    },\n    \"Input\": {\n      \"type\": \"string\",\n      \"required\": true,\n      \"documentation\": \"the input used to test uriEncode\"\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"uriEncode on input\",\n      \"conditions\": [\n        {\n          \"fn\": \"stringEquals\",\n          \"argv\": [\"{TestCaseId}\", \"1\"]\n        },\n        {\n          \"fn\": \"uriEncode\",\n          \"argv\": [\"{Input}\"],\n          \"assign\": \"output\"\n        }\n      ],\n      \"error\": \"The value is: `{output}`\",\n      \"type\": \"error\"\n    },\n    {\n      \"documentation\": \"fallback when no tests match\",\n      \"conditions\": [],\n      \"error\": \"No tests matched\",\n      \"type\": \"error\"\n    }\n  ]\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/__mocks__/valid-rules/valid-hostlabel.json",
    "content": "{\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"string\",\n      \"builtIn\": \"AWS::Region\",\n      \"required\": true,\n      \"documentation\": \"The region to dispatch this request, eg. `us-east-1`.\"\n    }\n  },\n  \"rules\": [\n    {\n      \"documentation\": \"Template the region into the URI when region is set\",\n      \"conditions\": [\n        {\n          \"fn\": \"isValidHostLabel\",\n          \"argv\": [\n            {\n              \"ref\": \"Region\"\n            },\n            false\n          ]\n        }\n      ],\n      \"endpoint\": {\n        \"url\": \"https://{Region}.amazonaws.com\"\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"Template the region into the URI when region is set\",\n      \"conditions\": [\n        {\n          \"fn\": \"isValidHostLabel\",\n          \"argv\": [\n            {\n              \"ref\": \"Region\"\n            },\n            true\n          ]\n        }\n      ],\n      \"endpoint\": {\n        \"url\": \"https://{Region}-subdomains.amazonaws.com\"\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"Region was not a valid host label\",\n      \"conditions\": [],\n      \"error\": \"Invalid hostlabel\",\n      \"type\": \"error\"\n    }\n  ],\n  \"version\": \"1.3\"\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.ts",
    "content": "import type { EndpointObjectHeaders, ParameterObject } from \"@smithy/types\";\n\nimport type { Expression, FunctionArgv } from \"../types/shared\";\n\n/**\n * @internal\n */\ntype BddCondition = [string, FunctionArgv] | [string, FunctionArgv, string];\n\n/**\n * @internal\n */\ntype BddResult =\n  | [-1]\n  | [-1, Expression]\n  | [string, Record<string, ParameterObject>, EndpointObjectHeaders]\n  | [string, Record<string, ParameterObject>];\n\n/**\n * @internal\n */\nexport class BinaryDecisionDiagram {\n  public nodes: Int32Array;\n  public root: number;\n  public conditions: BddCondition[];\n  public results: BddResult[];\n\n  private constructor(bdd: Int32Array, root: number, conditions: BddCondition[] | any[], results: BddResult[] | any[]) {\n    this.nodes = bdd;\n    this.root = root;\n    this.conditions = conditions;\n    this.results = results;\n  }\n\n  public static from(bdd: Int32Array, root: number, conditions: BddCondition[] | any[], results: BddResult[] | any[]) {\n    return new BinaryDecisionDiagram(bdd, root, conditions, results);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/cache/EndpointCache.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { EndpointCache } from \"./EndpointCache\";\n\ndescribe(EndpointCache.name, () => {\n  const endpoint1: any = {};\n  const endpoint2: any = {};\n\n  it(\"should store and retrieve items\", () => {\n    const cache = new EndpointCache({\n      size: 50,\n      params: [\"A\", \"B\", \"C\"],\n    });\n\n    expect(cache.get({ A: \"b\", B: \"b\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.get({ A: \"b\", B: \"b\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.get({ A: \"b\", B: \"b\", C: \"c\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.get({ A: \"b\", B: \"b\", C: \"c\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.get({ A: \"b\", B: \"b\", C: \"cc\" }, () => endpoint2)).toBe(endpoint2);\n    expect(cache.get({ A: \"b\", B: \"b\", C: \"cc\" }, () => endpoint2)).toBe(endpoint2);\n\n    expect(cache.size()).toEqual(3);\n  });\n\n  it(\"should accept a custom parameter list\", () => {\n    const cache = new EndpointCache({\n      size: 50,\n      params: [\"A\", \"B\"],\n    });\n\n    expect(cache.get({ A: \"b\", B: \"b\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.get({ A: \"b\", B: \"b\", C: \"c\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.get({ A: \"b\", B: \"b\", C: \"cc\" }, () => endpoint2)).toBe(endpoint1);\n\n    expect(cache.size()).toEqual(1);\n  });\n\n  it(\"bypasses caching if param values include the cache key delimiter\", () => {\n    const cache = new EndpointCache({\n      size: 50,\n      params: [\"A\", \"B\"],\n    });\n\n    expect(cache.get({ A: \"b\", B: \"aaa|;aaa\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.size()).toEqual(0);\n  });\n\n  it(\"bypasses caching if param list is empty\", () => {\n    const cache = new EndpointCache({\n      size: 50,\n      params: [],\n    });\n\n    expect(cache.get({ A: \"b\", B: \"b\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.size()).toEqual(0);\n  });\n\n  it(\"bypasses caching if no param list is supplied\", () => {\n    const cache = new EndpointCache({\n      size: 50,\n    });\n\n    expect(cache.get({ A: \"b\", B: \"b\" }, () => endpoint1)).toBe(endpoint1);\n    expect(cache.size()).toEqual(0);\n  });\n\n  it(\"should be an LRU cache\", () => {\n    const cache = new EndpointCache({\n      size: 5,\n      params: [\"A\", \"B\"],\n    });\n\n    for (let i = 0; i < 50; ++i) {\n      cache.get({ A: \"b\", B: \"b\" + i }, () => endpoint1);\n    }\n\n    const size = cache.size();\n    expect(size).toBeLessThan(16);\n    expect(cache.get({ A: \"b\", B: \"b49\" }, () => endpoint2)).toBe(endpoint1);\n    expect(cache.size()).toEqual(size);\n\n    expect(cache.get({ A: \"b\", B: \"b1\" }, () => endpoint2)).toBe(endpoint2);\n    expect(cache.size()).toEqual(size + 1);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/cache/EndpointCache.ts",
    "content": "import type { EndpointParams, EndpointV2 } from \"@smithy/types\";\n\n/**\n * Cache for endpoint ruleSet resolution.\n *\n * @internal\n */\nexport class EndpointCache {\n  private capacity: number;\n  private data = new Map<string, EndpointV2>();\n  private parameters: string[] = [];\n\n  /**\n   * @param [size] - desired average maximum capacity. A buffer of 10 additional keys will be allowed\n   *                 before keys are dropped.\n   * @param [params] - list of params to consider as part of the cache key.\n   *\n   * If the params list is not populated, no caching will happen.\n   * This may be out of order depending on how the object is created and arrives to this class.\n   */\n  public constructor({ size, params }: { size?: number; params?: string[] }) {\n    this.capacity = size ?? 50;\n    if (params) {\n      this.parameters = params;\n    }\n  }\n\n  /**\n   * @param endpointParams - query for endpoint.\n   * @param resolver - provider of the value if not present.\n   * @returns endpoint corresponding to the query.\n   */\n  public get(endpointParams: EndpointParams, resolver: () => EndpointV2): EndpointV2 {\n    const key = this.hash(endpointParams);\n    if (key === false) {\n      return resolver();\n    }\n\n    if (!this.data.has(key)) {\n      if (this.data.size > this.capacity + 10) {\n        const keys = this.data.keys();\n        let i = 0;\n        while (true) {\n          const { value, done } = keys.next();\n          this.data.delete(value as string);\n          if (done || ++i > 10) {\n            break;\n          }\n        }\n      }\n      this.data.set(key, resolver());\n    }\n    return this.data.get(key)!;\n  }\n\n  public size() {\n    return this.data.size;\n  }\n\n  /**\n   * @returns cache key or false if not cachable.\n   */\n  private hash(endpointParams: EndpointParams): string | false {\n    let buffer = \"\";\n    const { parameters } = this;\n    if (parameters.length === 0) {\n      return false;\n    }\n    for (const param of parameters) {\n      const val = String(endpointParams[param] ?? \"\");\n      if (val.includes(\"|;\")) {\n        return false;\n      }\n      buffer += val + \"|;\";\n    }\n    return buffer;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/debug/debugId.ts",
    "content": "export const debugId = \"endpoints\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/debug/index.ts",
    "content": "export * from \"./debugId\";\nexport * from \"./toDebugString\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/debug/toDebugString.ts",
    "content": "import type { EndpointParameters, EndpointV2 } from \"@smithy/types\";\n\nimport type { GetAttrValue } from \"../lib\";\nimport type { EndpointObject, FunctionObject, FunctionReturn } from \"../types\";\n\nexport function toDebugString(input: EndpointParameters): string;\nexport function toDebugString(input: EndpointV2): string;\nexport function toDebugString(input: GetAttrValue): string;\nexport function toDebugString(input: FunctionObject): string;\nexport function toDebugString(input: FunctionReturn): string;\nexport function toDebugString(input: EndpointObject): string;\nexport function toDebugString(input: any): string {\n  if (typeof input !== \"object\" || input == null) {\n    return input;\n  }\n\n  if (\"ref\" in input) {\n    return `$${toDebugString(input.ref)}`;\n  }\n\n  if (\"fn\" in input) {\n    return `${input.fn}(${(input.argv || []).map(toDebugString).join(\", \")})`;\n  }\n\n  return JSON.stringify(input, null, 2);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/decideEndpoint.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { BinaryDecisionDiagram } from \"./bdd/BinaryDecisionDiagram\";\nimport { decideEndpoint } from \"./decideEndpoint\";\n\ndescribe(decideEndpoint.name, () => {\n  it(\"resolves an endpoint\", () => {\n    const d = \"x-api-key\";\n    const a = \"isSet\",\n      b = \"{endpoint}\",\n      c = [\"{ApiKey}\"];\n    const _data = {\n      conditions: [\n        [a, [{ ref: \"ApiKey\" }]],\n        [a, [{ ref: \"CustomHeaderValue\" }]],\n      ],\n      results: [\n        [-1],\n        [b, {}, { [d]: c, \"x-custom-header\": [\"{CustomHeaderValue}\"] }],\n        [b, {}, { [d]: c }],\n        [b, {}, {}],\n      ],\n    };\n\n    const root = 2;\n    const r = 100_000_000;\n    const bdd = new Int32Array([-1, 1, -1, 0, 3, r + 3, 1, r + 1, r + 2]);\n\n    const data = BinaryDecisionDiagram.from(bdd, root, _data.conditions, _data.results);\n    const endpoint = decideEndpoint(data, {\n      endpointParams: { endpoint: \"https://localhost/\" },\n    });\n    expect(endpoint).toEqual({\n      url: new URL(\"https://localhost\"),\n      properties: {},\n      headers: {},\n    });\n  });\n\n  it(\"evaluates templates in error messages\", () => {\n    const r = 100_000_000;\n    const bdd = new Int32Array([0, 0, 0, 0, r + 0, -1]);\n    const data = BinaryDecisionDiagram.from(\n      bdd,\n      2,\n      [[\"isSet\", [{ ref: \"Region\" }]]],\n      [[-1, \"Invalid region: {Region}\"]]\n    );\n    expect(() =>\n      decideEndpoint(data, {\n        endpointParams: { Region: \"us-west-2\" },\n      })\n    ).toThrow(\"Invalid region: us-west-2\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/decideEndpoint.ts",
    "content": "import type { EndpointV2 } from \"@smithy/types\";\n\nimport type { BinaryDecisionDiagram } from \"./bdd/BinaryDecisionDiagram\";\nimport { EndpointError, type EndpointResolverOptions } from \"./types\";\nimport { evaluateCondition } from \"./utils/evaluateCondition\";\nimport { evaluateExpression } from \"./utils/evaluateExpression\";\nimport { getEndpointHeaders } from \"./utils/getEndpointHeaders\";\nimport { getEndpointProperties } from \"./utils/getEndpointProperties\";\nimport { getEndpointUrl } from \"./utils/getEndpointUrl\";\n\nconst RESULT = 100_000_000;\n\n/**\n * Resolves an endpoint URL by processing the endpoints bdd and options.\n */\nexport const decideEndpoint = (bdd: BinaryDecisionDiagram, options: EndpointResolverOptions): EndpointV2 => {\n  const { nodes, root, results, conditions } = bdd;\n\n  let ref = root;\n  const referenceRecord = {} as Record<string, any>;\n  const closure = {\n    referenceRecord,\n    endpointParams: options.endpointParams,\n    logger: options.logger,\n  };\n\n  while (ref !== 1 && ref !== -1 && ref < RESULT) {\n    const node_i = 3 * (Math.abs(ref) - 1);\n    const [condition_i, highRef, lowRef] = [nodes[node_i], nodes[node_i + 1], nodes[node_i + 2]];\n    const [fn, argv, assign] = conditions[condition_i];\n    const evaluation = evaluateCondition({ fn, assign, argv }, closure);\n    if (evaluation.toAssign) {\n      const { name, value } = evaluation.toAssign;\n      referenceRecord[name] = value;\n    }\n\n    ref = ref >= 0 === evaluation.result ? highRef : lowRef;\n  }\n\n  if (ref >= RESULT) {\n    const result = results[ref - RESULT];\n    if (result[0] === -1) {\n      const [, errorExpression] = result;\n      throw new EndpointError(evaluateExpression(errorExpression!, \"Error\", closure) as string);\n    }\n    const [url, properties, headers] = result;\n\n    return {\n      url: getEndpointUrl(url, closure),\n      properties: getEndpointProperties(properties, closure),\n      headers: getEndpointHeaders(headers ?? {}, closure),\n    };\n  }\n\n  // ref is 1 or -1.\n  throw new EndpointError(`No matching endpoint.`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/getEndpointUrlConfig.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it } from \"vitest\";\n\nimport { getEndpointUrlConfig } from \"./getEndpointUrlConfig\";\n\nconst ENV_ENDPOINT_URL = \"AWS_ENDPOINT_URL\";\nconst CONFIG_ENDPOINT_URL = \"endpoint_url\";\n\ndescribe(getEndpointUrlConfig.name, () => {\n  const serviceId = \"mockServiceId\";\n  const endpointUrlConfig = getEndpointUrlConfig(serviceId);\n\n  const mockEndpoint = \"https://mock-endpoint.com\";\n  const ORIGINAL_ENV = process.env;\n\n  beforeEach(() => {\n    process.env = {};\n  });\n\n  afterEach(() => {\n    process.env = ORIGINAL_ENV;\n  });\n\n  describe(\"environmentVariableSelector\", () => {\n    beforeEach(() => {\n      process.env[ENV_ENDPOINT_URL] = mockEndpoint;\n    });\n\n    it.each([\n      [\"foo\", `${ENV_ENDPOINT_URL}_FOO`],\n      [\"foobar\", `${ENV_ENDPOINT_URL}_FOOBAR`],\n      [\"foo bar\", `${ENV_ENDPOINT_URL}_FOO_BAR`],\n    ])(\"returns endpoint for '%s' from environment variable %s\", (serviceId, envKey) => {\n      const serviceMockEndpoint = `${mockEndpoint}/${envKey}`;\n      process.env[envKey] = serviceMockEndpoint;\n\n      const endpointUrlConfig = getEndpointUrlConfig(serviceId);\n      expect(endpointUrlConfig.environmentVariableSelector(process.env)).toEqual(serviceMockEndpoint);\n    });\n\n    it(`returns endpoint from environment variable ${ENV_ENDPOINT_URL}`, () => {\n      expect(endpointUrlConfig.environmentVariableSelector(process.env)).toEqual(mockEndpoint);\n    });\n\n    it(\"returns undefined, if endpoint not available in environment variables\", () => {\n      process.env[ENV_ENDPOINT_URL] = undefined;\n      expect(endpointUrlConfig.environmentVariableSelector(process.env)).toBeUndefined();\n    });\n  });\n\n  describe(\"configFileSelector\", () => {\n    const profile = { [CONFIG_ENDPOINT_URL]: mockEndpoint };\n\n    // ToDo: Enable once support for services section is added.\n    it.skip.each([\n      [\"foo\", \"foo\"],\n      [\"foobar\", \"foobar\"],\n      [\"foo bar\", \"foo_bar\"],\n    ])(\"returns endpoint for '%s' from config file '%s'\", (serviceId, serviceConfigId) => {\n      const serviceMockEndpoint = `${mockEndpoint}/${serviceConfigId}`;\n      const serviceSectionName = `services ${serviceConfigId}_dev`;\n\n      const profileWithServices = {\n        ...profile,\n        services: serviceSectionName,\n      };\n      const parsedIni = {\n        profileName: profileWithServices,\n        [serviceSectionName]: {\n          [serviceConfigId]: {\n            [CONFIG_ENDPOINT_URL]: serviceMockEndpoint,\n          },\n        },\n      };\n\n      // @ts-ignore\n      expect(endpointUrlConfig.environmentVariableSelector(profileWithServices, parsedIni)).toEqual(\n        serviceMockEndpoint\n      );\n    });\n\n    it(\"returns endpoint from config file, if available\", () => {\n      expect(endpointUrlConfig.configFileSelector(profile)).toEqual(mockEndpoint);\n    });\n\n    it(\"returns undefined, if endpoint not available in config\", () => {\n      expect(endpointUrlConfig.environmentVariableSelector({})).toBeUndefined();\n    });\n  });\n\n  it(\"returns undefined by default\", () => {\n    expect(endpointUrlConfig.default).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/getEndpointUrlConfig.ts",
    "content": "import type { IniSection } from \"@smithy/types\";\n\n/**\n * Inlined from @smithy/core/config to avoid circular dependency.\n *\n * @internal\n */\ntype LoadedConfigSelectors<T> = {\n  environmentVariableSelector: (env: Record<string, string | undefined>) => T | undefined;\n  configFileSelector: (\n    profile: Record<string, string | undefined>,\n    configFile?: Record<string, Record<string, string | undefined>>\n  ) => T | undefined;\n  default: T | (() => T);\n};\n\nconst ENV_ENDPOINT_URL = \"AWS_ENDPOINT_URL\";\nconst CONFIG_ENDPOINT_URL = \"endpoint_url\";\n\nexport const getEndpointUrlConfig = (serviceId: string): LoadedConfigSelectors<string | undefined> => ({\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) => {\n    // The value provided by a service-specific environment variable.\n    const serviceEndpointUrlSections = [ENV_ENDPOINT_URL, ...serviceId.split(\" \").map((w) => w.toUpperCase())];\n    const serviceEndpointUrl = env[serviceEndpointUrlSections.join(\"_\")];\n    if (serviceEndpointUrl) return serviceEndpointUrl;\n\n    // The value provided by the global endpoint environment variable.\n    const endpointUrl = env[ENV_ENDPOINT_URL];\n    if (endpointUrl) return endpointUrl;\n\n    return undefined;\n  },\n\n  configFileSelector: (profile: IniSection) => {\n    // The value provided by a service-specific parameter from a services definition section\n    // referenced in a profile in the shared configuration file.\n\n    // ToDo: profile is selected one. It does not have access to other 'services' section.\n    // The configFileSelector interface needs to be modified to pass ParsedIniData as optional second parameter.\n\n    // The value provided by the global parameter from a profile in the shared configuration file.\n    const endpointUrl = profile[CONFIG_ENDPOINT_URL];\n    if (endpointUrl) return endpointUrl;\n\n    return undefined;\n  },\n\n  default: undefined,\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/booleanEquals.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { booleanEquals } from \"./booleanEquals\";\n\ndescribe(booleanEquals.name, () => {\n  it(\"returns true if values are equal\", () => {\n    expect(booleanEquals(true, true)).toBe(true);\n    expect(booleanEquals(false, false)).toBe(true);\n  });\n\n  it(\"returns false if values are not equal\", () => {\n    expect(booleanEquals(true, false)).toBe(false);\n    expect(booleanEquals(false, true)).toBe(false);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/booleanEquals.ts",
    "content": "/**\n * Evaluates two boolean values value1 and value2 for equality and returns\n * true if both values match.\n */\nexport const booleanEquals = (value1: boolean, value2: boolean): boolean => value1 === value2;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/coalesce.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { coalesce } from \"./coalesce\";\n\ndescribe(coalesce.name, () => {\n  it(\"returns first non-empty value\", () => {\n    expect(coalesce(\"a\", \"b\")).toBe(\"a\");\n  });\n\n  it(\"skips undefined and returns first non-empty value\", () => {\n    expect(coalesce(undefined, \"b\")).toBe(\"b\");\n  });\n\n  it(\"returns last arg when all preceding are undefined\", () => {\n    expect(coalesce(undefined, undefined, \"c\")).toBe(\"c\");\n  });\n\n  it(\"returns undefined when all args are undefined\", () => {\n    expect(coalesce(undefined, undefined)).toBeUndefined();\n  });\n\n  it(\"returns false as non-empty\", () => {\n    expect(coalesce(false, true)).toBe(false);\n  });\n\n  it(\"returns 0 as non-empty\", () => {\n    expect(coalesce(0, 1)).toBe(0);\n  });\n\n  it(\"returns empty string as non-empty\", () => {\n    expect(coalesce(\"\", \"fallback\")).toBe(\"\");\n  });\n\n  it(\"works with more than two arguments\", () => {\n    expect(coalesce(undefined, undefined, undefined, \"d\")).toBe(\"d\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/coalesce.ts",
    "content": "/**\n * Evaluates arguments in order and returns the first non-empty result,\n * otherwise returns the result of the last argument.\n *\n * @internal\n */\nexport function coalesce<T>(...args: (T | undefined)[]): T | undefined {\n  for (const arg of args) {\n    if (arg != null) {\n      return arg;\n    }\n  }\n  return undefined;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/getAttr.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { EndpointError } from \"../types\";\nimport { getAttr } from \"./getAttr\";\nimport { getAttrPathList } from \"./getAttrPathList\";\n\nvi.mock(\"./getAttrPathList\");\n\ndescribe(getAttr.name, () => {\n  const testSuccess = (value: any, input: string, output: unknown, pathList: string[]) => {\n    vi.mocked(getAttrPathList).mockReturnValueOnce(pathList);\n    expect(getAttr(value, input)).toEqual(output);\n    expect(getAttrPathList).toHaveBeenCalledWith(input);\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"object\", () => {\n    const mockObj = { Thing1: \"foo\", Thing2: [\"index0\", \"index1\"], Thing3: { SubThing: 42 } };\n\n    it.each([\n      [\"foo\", \"Thing1\", [\"Thing1\"]],\n      [\"index0\", \"Thing2[0]\", [\"Thing2\", \"0\"]],\n      [\"index1\", \"Thing2[1]\", [\"Thing2\", \"1\"]],\n      [42, \"Thing3.SubThing\", [\"Thing3\", \"SubThing\"]],\n    ])(\"returns '%s' for '%s'\", (output, input, pathList) => {\n      testSuccess(mockObj, input, output, pathList);\n    });\n  });\n\n  describe(\"array\", () => {\n    const mockArr = [\"index0\", \"index1\"];\n\n    it.each([\n      [mockArr[0], \"[0]\", [\"0\"]],\n      [mockArr[1], \"[1]\", [\"1\"]],\n      [mockArr[1], \"[-1]\", [\"-1\"]],\n      [mockArr[0], \"[-2]\", [\"-2\"]],\n    ])(\"returns '%s' for '%s'\", (output, input, pathList) => {\n      testSuccess(mockArr, input, output, pathList);\n    });\n  });\n\n  it(\"rethrows error from getAttrPathList\", () => {\n    const mockPath = \"mockPath\";\n    const mockError = new Error(\"test\");\n    vi.mocked(getAttrPathList).mockImplementationOnce(() => {\n      throw mockError;\n    });\n    expect(() => getAttr({}, mockPath)).toThrow(mockError);\n    expect(getAttrPathList).toHaveBeenCalledWith(mockPath);\n  });\n\n  it(\"throws error if attribute parent is not defined\", () => {\n    const mockPath = \"foo.bar\";\n    const mockObj = { foo: \"bar\" };\n    vi.mocked(getAttrPathList).mockReturnValueOnce(mockPath.split(\".\"));\n    expect(() => getAttr(mockObj, mockPath)).toThrow(\n      new EndpointError(`Index 'bar' in '${mockPath}' not found in '${JSON.stringify(mockObj)}'`)\n    );\n    expect(getAttrPathList).toHaveBeenCalledWith(mockPath);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/getAttr.ts",
    "content": "import { EndpointError } from \"../types\";\nimport { getAttrPathList } from \"./getAttrPathList\";\n\nexport type GetAttrValue = string | boolean | { [key: string]: GetAttrValue } | Array<GetAttrValue>;\n\n/**\n * Returns value corresponding to pathing string for an array or object.\n */\nexport const getAttr = (value: GetAttrValue, path: string): GetAttrValue =>\n  getAttrPathList(path).reduce((acc, index) => {\n    if (typeof acc !== \"object\") {\n      throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);\n    } else if (Array.isArray(acc)) {\n      const i = parseInt(index);\n      return acc[i < 0 ? acc.length + i : i];\n    }\n    return acc[index];\n  }, value);\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/getAttrPathList.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { EndpointError } from \"../types\";\nimport { getAttrPathList } from \"./getAttrPathList\";\n\ndescribe(getAttrPathList.name, () => {\n  const testSuccess = (input: string, output: Array<string>) => {\n    expect(getAttrPathList(input)).toEqual(output);\n  };\n\n  const testFail = (input: string, errorMsg: string) => {\n    expect(() => {\n      getAttrPathList(input);\n    }).toThrow(new EndpointError(errorMsg));\n  };\n\n  it(\"returns top level key\", () => {\n    testSuccess(\"foo\", [\"foo\"]);\n  });\n\n  it(\"returns array with index\", () => {\n    testSuccess(\"foo[0]\", [\"foo\", \"0\"]);\n  });\n\n  it(\"returns index\", () => {\n    testSuccess(\"[0]\", [\"0\"]);\n  });\n\n  it(\"returns object key\", () => {\n    testSuccess(\"foo.bar\", [\"foo\", \"bar\"]);\n  });\n\n  it(\"throws error if array brackets don't end\", () => {\n    const incompletePath = \"foo[0\";\n    testFail(incompletePath, `Path: '${incompletePath}' does not end with ']'`);\n  });\n\n  it(\"throws error if array index is not integer\", () => {\n    const invalidIndex = \"bar\";\n    const invalidPath = `foo[${invalidIndex}]`;\n    testFail(invalidPath, `Invalid array index: '${invalidIndex}' in path: '${invalidPath}'`);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/getAttrPathList.ts",
    "content": "import { EndpointError } from \"../types\";\n\n/**\n * Parses path as a getAttr expression, returning a list of strings.\n */\nexport const getAttrPathList = (path: string): Array<string> => {\n  const parts = path.split(\".\");\n  const pathList = [];\n\n  for (const part of parts) {\n    const squareBracketIndex = part.indexOf(\"[\");\n    if (squareBracketIndex !== -1) {\n      if (part.indexOf(\"]\") !== part.length - 1) {\n        throw new EndpointError(`Path: '${path}' does not end with ']'`);\n      }\n\n      // Take the entire slice except for the last character (which is `]`)\n      const arrayIndex = part.slice(squareBracketIndex + 1, -1);\n      if (Number.isNaN(parseInt(arrayIndex))) {\n        throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);\n      }\n\n      if (squareBracketIndex !== 0) {\n        pathList.push(part.slice(0, squareBracketIndex));\n      }\n      pathList.push(arrayIndex);\n    } else {\n      pathList.push(part);\n    }\n  }\n\n  return pathList;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/index.ts",
    "content": "export * from \"./booleanEquals\";\nexport * from \"./coalesce\";\nexport * from \"./getAttr\";\nexport * from \"./isSet\";\nexport * from \"./isValidHostLabel\";\nexport * from \"./ite\";\nexport * from \"./not\";\nexport * from \"./parseURL\";\nexport * from \"./split\";\nexport * from \"./stringEquals\";\nexport * from \"./substring\";\nexport * from \"./uriEncode\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/isIpAddress.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isIpAddress } from \"./isIpAddress\";\n\ndescribe(isIpAddress.name, () => {\n  it.each([\n    [false, \"example.com\"],\n    [true, \"127.0.0.1\"],\n    [true, \"[fe80::1]\"],\n  ])(\"returns %s for '%s'\", (output, input) => {\n    expect(isIpAddress(input)).toEqual(output);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/isIpAddress.ts",
    "content": "const IP_V4_REGEX = new RegExp(\n  `^(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}$`\n);\n\n/**\n * Validates if the provided value is an IP address.\n */\nexport const isIpAddress = (value: string): boolean =>\n  IP_V4_REGEX.test(value) || (value.startsWith(\"[\") && value.endsWith(\"]\"));\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/isSet.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isSet } from \"./isSet\";\n\ndescribe(isSet.name, () => {\n  it.each([null, undefined])(\"returns false for %s\", (notSet) => {\n    expect(isSet(notSet)).toBe(false);\n  });\n\n  it.each([false, 0, -0, \"\", NaN])(\"returns true for falsy value %s\", (falsyVal) => {\n    expect(isSet(falsyVal)).toBe(true);\n  });\n\n  it.each([true, 1, -1, \"true\", [], {}])(\"returns true for truthy value %s\", (falsyVal) => {\n    expect(isSet(falsyVal)).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/isSet.ts",
    "content": "/**\n * Evaluates whether a value is set (aka not null or undefined).\n * Returns true if the value is set, otherwise returns false.\n */\nexport const isSet = (value: unknown) => value != null;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/isValidHostLabel.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isValidHostLabel } from \"./isValidHostLabel\";\n\ndescribe(isValidHostLabel.name, () => {\n  const testCases: Array<[boolean, string]> = [\n    [true, \"01010\"],\n    [true, \"abc\"],\n    [true, \"A0c\"],\n    [false, \"A0c-\"],\n    [false, \"-A0c\"],\n    [true, \"A-0c\"],\n    [false, \"a\".repeat(64)],\n    [true, \"a\".repeat(63)],\n    [false, \"\"],\n    [true, \"a\"],\n    [true, \"0--0\"],\n  ];\n\n  describe(\"test without allowSubDomains\", () => {\n    it.each(testCases)(\"returns %s for host label '%s'\", (output: boolean, input: string) => {\n      expect(isValidHostLabel(input)).toBe(output);\n    });\n  });\n\n  describe(\"test with allowSubDomains\", () => {\n    it.each([true, false])(\"tests for output: %s\", (output: boolean) => {\n      const hostLabelToTest = testCases\n        .filter(([outputEntry]) => outputEntry === output)\n        .map(([, value]) => value)\n        .join(\".\");\n      expect(isValidHostLabel(hostLabelToTest, true)).toBe(output);\n    });\n\n    describe(\"returns false if any subdomain is invalid\", () => {\n      const validHostLabel = testCases\n        .filter(([outputEntry]) => outputEntry === true)\n        .map(([, value]) => value)\n        .join(\".\");\n\n      it.each(testCases.filter(([outputEntry]) => outputEntry === false).map(([, value]) => value))(\n        \"subdomain: %s\",\n        (invalidSubDomain: string) => {\n          expect(isValidHostLabel([validHostLabel, invalidSubDomain].join(\".\"), true)).toBe(false);\n        }\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/isValidHostLabel.ts",
    "content": "const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);\n\n/**\n * Evaluates whether one or more string values are valid host labels per RFC 1123.\n *\n * If allowSubDomains is true, then the provided value may be zero or more dotted\n * subdomains which are each validated per RFC 1123.\n */\nexport const isValidHostLabel = (value: string, allowSubDomains = false) => {\n  if (!allowSubDomains) {\n    return VALID_HOST_LABEL_REGEX.test(value);\n  }\n\n  const labels = value.split(\".\");\n  for (const label of labels) {\n    if (!isValidHostLabel(label)) {\n      return false;\n    }\n  }\n  return true;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/ite.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { ite } from \"./ite\";\n\ndescribe(ite.name, () => {\n  it.each([\n    [true, \"-fips\", \"\", \"-fips\"],\n    [false, \"-fips\", \"\", \"\"],\n    [true, \"sigv4\", \"sigv4-s3express\", \"sigv4\"],\n    [false, \"sigv4\", \"sigv4-s3express\", \"sigv4-s3express\"],\n  ])(\"ite(%s, %j, %j) returns %j\", (condition, trueValue, falseValue, expected) => {\n    expect(ite(condition, trueValue, falseValue)).toBe(expected);\n  });\n\n  it(\"returns undefined trueValue when condition is true\", () => {\n    expect(ite(true, undefined, \"fallback\")).toBeUndefined();\n  });\n\n  it(\"returns undefined falseValue when condition is false\", () => {\n    expect(ite(false, \"value\", undefined)).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/ite.ts",
    "content": "/**\n * An if-then-else function that returns one of two values based on a boolean condition.\n *\n * @internal\n */\nexport function ite<T>(condition: boolean, trueValue: T | undefined, falseValue: T | undefined): T | undefined {\n  return condition ? trueValue : falseValue;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/not.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { not } from \"./not\";\n\ndescribe(not.name, () => {\n  it.each([\n    [false, true],\n    [true, false],\n  ])(\"returns %s of boolean %s\", (output, input) => {\n    expect(not(input)).toBe(output);\n  });\n\n  it.each([\n    [true, null],\n    [true, undefined],\n    [true, 0],\n    [true, -0],\n    [true, NaN],\n    [false, 1],\n    [true, \"\"],\n    [false, \"string\"],\n    [false, []],\n    [false, {}],\n  ])(\"returns %s of non boolean %s\", (output, input) => {\n    // @ts-expect-error: Argument of type is not assignable\n    expect(not(input)).toBe(output);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/not.ts",
    "content": "/**\n * Performs logical negation on the provided boolean value,\n * returning the negated value.\n */\nexport const not = (value: boolean) => !value;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/parseURL.spec.ts",
    "content": "import { EndpointURLScheme, type Endpoint, type EndpointURL } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { parseURL } from \"./parseURL\";\n\ndescribe(parseURL.name, () => {\n  const testCases: [string, EndpointURL][] = [\n    [\n      \"https://example.com\",\n      { scheme: EndpointURLScheme.HTTPS, authority: \"example.com\", path: \"/\", normalizedPath: \"/\", isIp: false },\n    ],\n    [\n      \"http://example.com:80/foo/bar\",\n      {\n        scheme: EndpointURLScheme.HTTP,\n        authority: \"example.com:80\",\n        path: \"/foo/bar\",\n        normalizedPath: \"/foo/bar/\",\n        isIp: false,\n      },\n    ],\n    [\n      \"https://127.0.0.1\",\n      { scheme: EndpointURLScheme.HTTPS, authority: \"127.0.0.1\", path: \"/\", normalizedPath: \"/\", isIp: true },\n    ],\n    [\n      \"https://127.0.0.1:8443\",\n      { scheme: EndpointURLScheme.HTTPS, authority: \"127.0.0.1:8443\", path: \"/\", normalizedPath: \"/\", isIp: true },\n    ],\n    [\n      \"https://[fe80::1]\",\n      { scheme: EndpointURLScheme.HTTPS, authority: \"[fe80::1]\", path: \"/\", normalizedPath: \"/\", isIp: true },\n    ],\n    [\n      \"https://[fe80::1]:8443\",\n      { scheme: EndpointURLScheme.HTTPS, authority: \"[fe80::1]:8443\", path: \"/\", normalizedPath: \"/\", isIp: true },\n    ],\n  ];\n\n  it.each(testCases)(\"test '%s'\", (input: string, output: EndpointURL) => {\n    expect(parseURL(input)).toEqual(output);\n  });\n\n  it(\"returns null for invalid scheme\", () => {\n    expect(parseURL(\"ws://example.com\")).toBeNull();\n  });\n\n  it(\"returns null for URL with search params\", () => {\n    expect(parseURL(\"https://example.com:8443?foo=bar\")).toBeNull();\n  });\n\n  it(\"returns null for invalid URL\", () => {\n    expect(parseURL(\"invalid\")).toBeNull();\n  });\n\n  it.each(testCases)(\"test as URL '%s'\", (input: string, output: EndpointURL) => {\n    const url = new URL(input);\n    expect(parseURL(url)).toEqual({\n      ...output,\n      authority: url.hostname + (url.port ? `:${url.port}` : \"\"),\n    });\n  });\n\n  it.each(testCases)(\"test as EndpointV1 '%s'\", (input: string, output: EndpointURL) => {\n    const url = new URL(input);\n    const endpointV1: Endpoint = {\n      protocol: url.protocol,\n      hostname: url.hostname,\n      port: url.port ? Number(url.port) : undefined,\n      path: url.pathname,\n    };\n\n    expect(parseURL(endpointV1)).toEqual({\n      ...output,\n      authority: url.hostname + (url.port ? `:${url.port}` : \"\"),\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/parseURL.ts",
    "content": "import { EndpointURLScheme, type Endpoint, type EndpointURL } from \"@smithy/types\";\n\nimport { isIpAddress } from \"./isIpAddress\";\n\nconst DEFAULT_PORTS: Record<EndpointURLScheme, number> = {\n  [EndpointURLScheme.HTTP]: 80,\n  [EndpointURLScheme.HTTPS]: 443,\n};\n\n/**\n * Parses a string, URL, or Endpoint into it’s Endpoint URL components.\n */\nexport const parseURL = (value: string | URL | Endpoint): EndpointURL | null => {\n  const whatwgURL = (() => {\n    try {\n      if (value instanceof URL) {\n        return value;\n      }\n      if (typeof value === \"object\" && \"hostname\" in value) {\n        const { hostname, port, protocol = \"\", path = \"\", query = {} } = value as Endpoint;\n        const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : \"\"}${path}`);\n        url.search = Object.entries(query)\n          .map(([k, v]) => `${k}=${v}`)\n          .join(\"&\");\n        return url;\n      }\n      return new URL(value);\n    } catch (error) {\n      return null;\n    }\n  })();\n\n  if (!whatwgURL) {\n    console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);\n    return null;\n  }\n\n  const urlString = whatwgURL.href;\n\n  const { host, hostname, pathname, protocol, search } = whatwgURL;\n\n  if (search) {\n    return null;\n  }\n\n  const scheme = protocol.slice(0, -1) as EndpointURLScheme;\n  if (!Object.values(EndpointURLScheme).includes(scheme)) {\n    return null;\n  }\n\n  const isIp = isIpAddress(hostname);\n\n  const inputContainsDefaultPort =\n    urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) ||\n    (typeof value === \"string\" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`));\n\n  const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;\n\n  return {\n    scheme,\n    authority,\n    path: pathname,\n    normalizedPath: pathname.endsWith(\"/\") ? pathname : `${pathname}/`,\n    isIp,\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/split.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { split } from \"./split\";\n\ndescribe(split.name, () => {\n  it.each<[string, string, number, string[]]>([\n    [\"a--b--c\", \"--\", 0, [\"a\", \"b\", \"c\"]],\n    [\"a--b--c\", \"--\", 2, [\"a\", \"b--c\"]],\n    [\"a--b--c\", \"--\", 1, [\"a--b--c\"]],\n    [\"\", \"--\", 0, [\"\"]],\n    [\"--\", \"--\", 0, [\"\", \"\"]],\n    [\"----\", \"--\", 0, [\"\", \"\", \"\"]],\n    [\"--b--\", \"--\", 0, [\"\", \"b\", \"\"]],\n    [\"--x-s3--azid--suffix\", \"--\", 0, [\"\", \"x-s3\", \"azid\", \"suffix\"]],\n    [\"--x-s3--azid--suffix\", \"--\", 2, [\"\", \"x-s3--azid--suffix\"]],\n    [\"abc\", \"x\", 0, [\"abc\"]],\n    [\"mybucket\", \"--\", 1, [\"mybucket\"]],\n  ])(\"split(%j, %j, %d) returns %j\", (value, delimiter, limit, expected) => {\n    expect(split(value, delimiter, limit)).toEqual(expected);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/split.ts",
    "content": "/**\n * The split function divides a string into an array of substrings based on a non-empty delimiter.\n * The behavior is controlled by the limit parameter:\n *\n * limit = 0: Split all occurrences (unlimited).\n * limit = 1: No split performed (returns original string as single element array).\n * limit > 1: Split into at most 'limit' parts (performs limit-1 splits).\n *\n * @internal\n */\nexport function split(value: string, delimiter: string, limit: number): string[] {\n  if (limit === 1) {\n    return [value];\n  }\n  if (value === \"\") {\n    return [\"\"];\n  }\n  const parts = value.split(delimiter);\n  if (limit === 0) {\n    return parts;\n  }\n  return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter));\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/stringEquals.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { stringEquals } from \"./stringEquals\";\n\ndescribe(stringEquals.name, () => {\n  it(\"returns true if values are equal\", () => {\n    expect(stringEquals(\"foo\", \"foo\")).toBe(true);\n  });\n\n  it(\"returns false if values are not equal\", () => {\n    expect(stringEquals(\"foo\", \"bar\")).toBe(false);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/stringEquals.ts",
    "content": "/**\n * Evaluates two string values value1 and value2 for equality and returns\n * true if both values match.\n */\nexport const stringEquals = (value1: string, value2: string): boolean => value1 === value2;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/substring.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { substring } from \"./substring\";\n\ndescribe(substring.name, () => {\n  describe(\"returns null\", () => {\n    it(\"when input is falsy\", () => {\n      expect(substring(\"\", 0, 1, false)).toBeNull();\n      expect(substring(\"\", 0, 0, false)).toBeNull();\n      expect(substring(null as any, 0, 1, false)).toBeNull();\n      expect(substring(undefined as any, 0, 1, false)).toBeNull();\n    });\n\n    it(\"when start >= stop\", () => {\n      expect(substring(\"abc\", 0, 0, false)).toBeNull();\n      expect(substring(\"abc\", 1, 0, false)).toBeNull();\n    });\n\n    it(\"when input.length < stop\", () => {\n      expect(substring(\"ab\", 0, 5, false)).toBeNull();\n    });\n\n    it(\"when input contains non-ASCII characters\", () => {\n      expect(substring(\"abc\\u0080\", 0, 3, false)).toBeNull();\n      expect(substring(\"abcé\", 0, 3, false)).toBeNull();\n      expect(substring(\"ab日c\", 0, 3, false)).toBeNull();\n    });\n  });\n\n  it(\"returns substring\", () => {\n    expect(substring(\"abcde\", 0, 3, false)).toBe(\"abc\");\n  });\n\n  it(\"returns substring with reverse=true\", () => {\n    expect(substring(\"abcde\", 0, 3, true)).toBe(\"cde\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/substring.ts",
    "content": "/**\n * Computes the substring of a given string, conditionally indexing from the end of the string.\n * When the string is long enough to fully include the substring, return the substring.\n * Otherwise, return None. The start index is inclusive and the stop index is exclusive.\n * The length of the returned string will always be stop-start.\n */\nexport const substring = (input: string, start: number, stop: number, reverse: boolean): string | null => {\n  if (input == null || start >= stop || input.length < stop || /[^\\u0000-\\u007f]/.test(input)) {\n    return null;\n  }\n  if (!reverse) {\n    return input.substring(start, stop);\n  }\n  return input.substring(input.length - stop, input.length - start);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/uriEncode.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { uriEncode } from \"./uriEncode\";\n\ndescribe(uriEncode.name, () => {\n  it.each([\n    [`;,/?:@&=+$#`, `%3B%2C%2F%3F%3A%40%26%3D%2B%24%23`], // Reserved characters\n    [`!*'()`, `%21%2A%27%28%29`], // Specially escaped characters\n    [` `, `%20`], // Space\n  ])(\"encodes '%s' as '%s'\", (input, output) => {\n    expect(uriEncode(input)).toStrictEqual(output);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/lib/uriEncode.ts",
    "content": "/**\n * Performs percent-encoding per RFC3986 section 2.1\n */\nexport const uriEncode = (value: string) =>\n  encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/resolveEndpoint.integ.spec.ts",
    "content": "import { existsSync, readdirSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { BinaryDecisionDiagram } from \"./bdd/BinaryDecisionDiagram\";\nimport { decideEndpoint } from \"./decideEndpoint\";\nimport { resolveEndpoint } from \"./resolveEndpoint\";\nimport { EndpointError } from \"./types\";\n\ndescribe(resolveEndpoint.name, () => {\n  const mocksDir = resolve(__dirname, \"__mocks__\");\n  const rulesDir = resolve(mocksDir, \"valid-rules\");\n  const testCasesDir = resolve(mocksDir, \"test-cases\");\n\n  const validRules = readdirSync(rulesDir)\n    .filter((fileName) => fileName.endsWith(\".json\"))\n    .map((fileName) => fileName.replace(\".json\", \"\"));\n\n  describe.each(validRules)(\"%s\", (ruleName) => {\n    const rulesFile = resolve(rulesDir, `${ruleName}.json`);\n    const testCasesFile = resolve(testCasesDir, `${ruleName}.json`);\n\n    if (existsSync(testCasesFile)) {\n      const ruleSetObject = require(rulesFile);\n      const { testCases } = require(testCasesFile);\n\n      for (const testCase of testCases) {\n        const { documentation, params } = testCase;\n        (testCase.skip ? it.skip : it)(documentation, () => {\n          const _expect = testCase.expect;\n\n          const { endpoint, error } = _expect;\n\n          if (endpoint) {\n            expect(resolveEndpoint(ruleSetObject, { endpointParams: params })).toStrictEqual({\n              ...endpoint,\n              url: new URL(endpoint.url),\n            });\n          }\n\n          if (error) {\n            expect(() => resolveEndpoint(ruleSetObject, { endpointParams: params })).toThrowError(\n              new EndpointError(error)\n            );\n          }\n        });\n      }\n    }\n  });\n});\n\ndescribe(decideEndpoint.name, () => {\n  describe(\"split, ite, and getAttr with negative index\", () => {\n    const r = 100_000_000;\n\n    const conditions = [\n      [\"split\", [{ ref: \"Splittable\" }, \".\", 0], \"parts\"],\n      [\"getAttr\", [{ ref: \"parts\" }, \"[-2]\"], \"tld\"],\n      [\"stringEquals\", [{ ref: \"tld\" }, \"com\"], \"isCom\"],\n    ];\n\n    const results = [[{ fn: \"ite\", argv: [{ ref: \"isCom\" }, \"https://api.___.com\", \"https://api.___.net\"] }, {}, {}]];\n\n    const nodes = new Int32Array([\n      0,\n      0,\n      0,\n      // (2, start) - split Splittable by \".\" with unlimited parts and proceed to node 3.\n      0,\n      3,\n      -1,\n      // (3) - getAttr [-2] and assign to tld, proceed to node 4.\n      1,\n      4,\n      -1,\n      // (4) - compare tld to \"com\" as isCom and proceed to terminal 0.\n      2,\n      r + 0,\n      r + 0,\n    ]);\n\n    const bdd = BinaryDecisionDiagram.from(nodes, 2, conditions, results);\n\n    it(\"should resolve endpoint using split + getAttr[-1] + ite\", () => {\n      const endpoint = decideEndpoint(bdd, {\n        endpointParams: { Splittable: \"___.com.___\" },\n      });\n      expect(endpoint).toEqual({\n        url: new URL(\"https://api.___.com\"),\n        properties: {},\n        headers: {},\n      });\n    });\n\n    it(\"should pick alternate URL when getAttr[-1] yields non-com TLD\", () => {\n      const endpoint = decideEndpoint(bdd, {\n        endpointParams: { Splittable: \"___.org.___\" },\n      });\n      expect(endpoint).toEqual({\n        url: new URL(\"https://api.___.net\"),\n        properties: {},\n        headers: {},\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/resolveEndpoint.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { resolveEndpoint } from \"./resolveEndpoint\";\nimport { EndpointError, type EndpointParams, type ParameterObject, type RuleSetObject } from \"./types\";\nimport { evaluateRules } from \"./utils\";\n\nvi.mock(\"./utils\");\n\ndescribe(resolveEndpoint.name, () => {\n  const boolParamKey = \"boolParamKey\";\n  const stringParamKey = \"stringParamKey\";\n  const requiredParamKey = \"requiredParamKey\";\n  const paramWithDefaultKey = \"paramWithDefaultKey\";\n\n  const mockEndpointParams: EndpointParams = {\n    [boolParamKey]: true,\n    [stringParamKey]: \"stringParamValue\",\n    [requiredParamKey]: \"requiredParamValue\",\n    [paramWithDefaultKey]: \"defaultParamValue\",\n  };\n\n  const mockRules: any[] = [];\n  const mockRuleSetParameters: Record<string, ParameterObject> = {\n    [boolParamKey]: {\n      type: \"Boolean\",\n    },\n    [stringParamKey]: {\n      type: \"String\",\n    },\n    [requiredParamKey]: {\n      type: \"String\",\n      required: true,\n    },\n    [paramWithDefaultKey]: {\n      type: \"String\",\n      default: \"paramWithDefaultValue\",\n    },\n  };\n\n  const mockRuleSetObject: RuleSetObject = {\n    version: \"1.0\",\n    serviceId: \"serviceId\",\n    parameters: mockRuleSetParameters,\n    rules: mockRules,\n  };\n\n  const mockResolvedEndpoint = { url: new URL(\"http://example.com\") };\n\n  beforeEach(() => {\n    vi.mocked(evaluateRules).mockReturnValue(mockResolvedEndpoint);\n  });\n\n  afterEach(() => {\n    vi.resetAllMocks();\n  });\n\n  it(\"should use the default value if a parameter is not set\", () => {\n    const { paramWithDefaultKey: ignored, ...endpointParamsWithoutDefault } = mockEndpointParams;\n\n    const resolvedEndpoint = resolveEndpoint(mockRuleSetObject, { endpointParams: endpointParamsWithoutDefault });\n    expect(resolvedEndpoint).toEqual(mockResolvedEndpoint);\n\n    expect(evaluateRules).toHaveBeenCalledWith(mockRules, {\n      endpointParams: {\n        ...mockEndpointParams,\n        [paramWithDefaultKey]: mockRuleSetParameters[paramWithDefaultKey].default,\n      },\n      referenceRecord: {},\n    });\n  });\n\n  it(\"should throw an error if a required parameter is missing\", () => {\n    const { requiredParamKey: ignored, ...endpointParamsWithoutRequired } = mockEndpointParams;\n    expect(() => resolveEndpoint(mockRuleSetObject, { endpointParams: endpointParamsWithoutRequired })).toThrow(\n      new EndpointError(`Missing required parameter: '${requiredParamKey}'`)\n    );\n    expect(evaluateRules).not.toHaveBeenCalled();\n  });\n\n  it(\"should not throw an error if a default value is available for required parameter\", () => {\n    const { requiredParamKey: ignored, ...endpointParamsWithoutRequired } = mockEndpointParams;\n    const requiredParamDefaultValue = \"requiredParamDefaultValue\";\n\n    const resolvedEndpoint = resolveEndpoint(\n      {\n        ...mockRuleSetObject,\n        parameters: {\n          ...mockRuleSetParameters,\n          [requiredParamKey]: {\n            ...mockRuleSetParameters[requiredParamKey],\n            default: requiredParamDefaultValue,\n          },\n        },\n      },\n      { endpointParams: endpointParamsWithoutRequired }\n    );\n    expect(resolvedEndpoint).toEqual(mockResolvedEndpoint);\n\n    expect(evaluateRules).toHaveBeenCalledWith(mockRules, {\n      endpointParams: {\n        ...mockEndpointParams,\n        [requiredParamKey]: requiredParamDefaultValue,\n      },\n      referenceRecord: {},\n    });\n  });\n\n  it(\"should call evaluateRules\", () => {\n    const resolvedEndpoint = resolveEndpoint(mockRuleSetObject, { endpointParams: mockEndpointParams });\n    expect(resolvedEndpoint).toEqual(mockResolvedEndpoint);\n    expect(evaluateRules).toHaveBeenCalledWith(mockRules, {\n      endpointParams: mockEndpointParams,\n      referenceRecord: {},\n    });\n  });\n\n  it(\"should debug proper infos\", () => {\n    const { paramWithDefaultKey: ignored, ...endpointParamsWithoutDefault } = mockEndpointParams;\n    const mockLogger = {\n      debug: vi.fn(),\n      info: vi.fn(),\n      warn: vi.fn(),\n      error: vi.fn(),\n    };\n\n    const resolvedEndpoint = resolveEndpoint(mockRuleSetObject, {\n      endpointParams: endpointParamsWithoutDefault,\n      logger: mockLogger,\n    });\n    expect(resolvedEndpoint).toEqual(mockResolvedEndpoint);\n\n    expect(evaluateRules).toHaveBeenCalledWith(mockRules, {\n      endpointParams: {\n        ...mockEndpointParams,\n        [paramWithDefaultKey]: mockRuleSetParameters[paramWithDefaultKey].default,\n      },\n      logger: mockLogger,\n      referenceRecord: {},\n    });\n\n    expect(mockLogger.debug).nthCalledWith(\n      1,\n      \"endpoints \" +\n        \"Initial EndpointParams: \" +\n        \"{\\n\" +\n        '  \"boolParamKey\": true,\\n' +\n        '  \"stringParamKey\": \"stringParamValue\",\\n' +\n        '  \"requiredParamKey\": \"requiredParamValue\"\\n' +\n        \"}\"\n    );\n    expect(mockLogger.debug).nthCalledWith(2, `endpoints Resolved endpoint: {\\n  \"url\": \"http://example.com/\"\\n}`);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/resolveEndpoint.ts",
    "content": "import type { EndpointV2 } from \"@smithy/types\";\n\nimport { debugId, toDebugString } from \"./debug\";\nimport { EndpointError, type EndpointResolverOptions, type RuleSetObject } from \"./types\";\nimport { evaluateRules } from \"./utils\";\n\n/**\n * Resolves an endpoint URL by processing the endpoints ruleset and options.\n */\nexport const resolveEndpoint = (ruleSetObject: RuleSetObject, options: EndpointResolverOptions): EndpointV2 => {\n  const { endpointParams, logger } = options;\n  const { parameters, rules } = ruleSetObject;\n\n  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);\n\n  for (const paramKey in parameters) {\n    const parameter = parameters[paramKey];\n    const endpointParam = endpointParams[paramKey];\n\n    if (endpointParam == null && parameter.default != null) {\n      endpointParams[paramKey] = parameter.default;\n      continue;\n    }\n\n    if (parameter.required && endpointParam == null) {\n      throw new EndpointError(`Missing required parameter: '${paramKey}'`);\n    }\n  }\n\n  const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });\n\n  options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);\n\n  return endpoint;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/EndpointError.ts",
    "content": "export class EndpointError extends Error {\n  constructor(message: string) {\n    super(message);\n    this.name = \"EndpointError\";\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/EndpointFunctions.ts",
    "content": "import type { FunctionReturn } from \"./shared\";\n\nexport type EndpointFunctions = Record<string, (...args: any[]) => FunctionReturn>;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/EndpointRuleObject.ts",
    "content": "import type {\n  EndpointObject as __EndpointObject,\n  EndpointObjectHeaders as __EndpointObjectHeaders,\n  EndpointObjectProperties as __EndpointObjectProperties,\n  EndpointRuleObject as __EndpointRuleObject,\n} from \"@smithy/types\";\n\nexport type EndpointObjectProperties = __EndpointObjectProperties;\n\nexport type EndpointObjectHeaders = __EndpointObjectHeaders;\nexport type EndpointObject = __EndpointObject;\n\nexport type EndpointRuleObject = __EndpointRuleObject;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/ErrorRuleObject.ts",
    "content": "import type { ErrorRuleObject as __ErrorRuleObject } from \"@smithy/types\";\n\nexport type ErrorRuleObject = __ErrorRuleObject;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/RuleSetObject.ts",
    "content": "import type {\n  DeprecatedObject as __DeprecatedObject,\n  ParameterObject as __ParameterObject,\n  RuleSetObject as __RuleSetObject,\n} from \"@smithy/types\";\n\nexport type DeprecatedObject = __DeprecatedObject;\n\nexport type ParameterObject = __ParameterObject;\n\nexport type RuleSetObject = __RuleSetObject;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/TreeRuleObject.ts",
    "content": "import type { RuleSetRules as __RuleSetRules, TreeRuleObject as __TreeRuleObject } from \"@smithy/types\";\n\nexport type RuleSetRules = __RuleSetRules;\n\nexport type TreeRuleObject = __TreeRuleObject;\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/index.ts",
    "content": "export * from \"./EndpointError\";\nexport * from \"./EndpointFunctions\";\nexport * from \"./EndpointRuleObject\";\nexport * from \"./ErrorRuleObject\";\nexport * from \"./RuleSetObject\";\nexport * from \"./TreeRuleObject\";\nexport * from \"./shared\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/types/shared.ts",
    "content": "import type { EndpointARN, EndpointPartition, EndpointURL, Logger } from \"@smithy/types\";\n\nexport type ReferenceObject = { ref: string };\n\nexport type FunctionObject = { fn: string; argv: FunctionArgv };\nexport type FunctionArgv = Array<Expression | boolean | number>;\nexport type FunctionReturn =\n  | string\n  | boolean\n  | number\n  | EndpointARN\n  | EndpointPartition\n  | EndpointURL\n  | { [key: string]: FunctionReturn }\n  | Array<FunctionReturn>\n  | null;\n\nexport type ConditionObject = FunctionObject & { assign?: string };\n\nexport type Expression = string | ReferenceObject | FunctionObject;\n\nexport type EndpointParams = Record<string, string | boolean>;\nexport type EndpointResolverOptions = {\n  endpointParams: EndpointParams;\n  logger?: Logger;\n};\n\nexport type ReferenceRecord = Record<string, FunctionReturn>;\nexport type EvaluateOptions = EndpointResolverOptions & {\n  referenceRecord: ReferenceRecord;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/callFunction.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { customEndpointFunctions } from \"./customEndpointFunctions\";\nimport { endpointFunctions } from \"./endpointFunctions\";\nimport { callFunction, group } from \"./evaluateExpression\";\n\ndescribe(callFunction.name, () => {\n  vi.spyOn(group, \"evaluateExpression\").mockImplementation(vi.fn());\n  const { evaluateExpression } = group;\n\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n  const mockReturn = \"mockReturn\";\n  const mockArgReturn = \"mockArgReturn\";\n\n  beforeEach(() => {\n    vi.mocked(evaluateExpression).mockReturnValue(mockArgReturn);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it.each([\n    \"booleanEquals\",\n    \"getAttr\",\n    \"isSet\",\n    \"isValidHostLabel\",\n    \"not\",\n    \"parseURL\",\n    \"stringEquals\",\n    \"subsgtring\",\n    \"urlEncode\",\n  ] as Array<keyof typeof endpointFunctions>)(\"calls built-in endpoint function %s\", (builtIn) => {\n    endpointFunctions[builtIn] = vi.fn().mockReturnValue(mockReturn) as any;\n    const mockArg = \"mockArg\";\n    const mockFn = { fn: builtIn, argv: [mockArg] };\n\n    const result = callFunction(mockFn, mockOptions);\n    expect(result).toBe(mockReturn);\n    expect(endpointFunctions[builtIn]).toHaveBeenCalledWith(mockArgReturn);\n  });\n\n  it.each([\n    [\"boolean\", true],\n    [\"boolean\", false],\n    [\"number\", 1],\n    [\"number\", 0],\n  ])(\"skips evaluateExpression for %s arg: %s\", (argType, mockNotExpressionArg) => {\n    const mockFn = { fn: \"booleanEquals\", argv: [mockNotExpressionArg] };\n    const result = callFunction(mockFn, mockOptions);\n    expect(result).toBe(mockReturn);\n    expect(evaluateExpression).not.toHaveBeenCalled();\n    expect(endpointFunctions.booleanEquals).toHaveBeenCalledWith(mockNotExpressionArg);\n  });\n\n  it.each([\"string\", { ref: \"ref\" }, { fn: \"fn\", argv: [] }])(\n    \"calls evaluateExpression for expression arg: %s\",\n    (arg) => {\n      const mockFn = { fn: \"booleanEquals\", argv: [arg] };\n\n      const result = callFunction(mockFn, mockOptions);\n      expect(result).toBe(mockReturn);\n      expect(evaluateExpression).toHaveBeenCalledWith(arg, \"arg\", mockOptions);\n      expect(endpointFunctions.booleanEquals).toHaveBeenCalledWith(mockArgReturn);\n    }\n  );\n\n  it(\"calls custom endpoint functions\", () => {\n    const mockCustomFunction = vi.fn().mockReturnValue(mockReturn);\n    customEndpointFunctions[\"ns\"] = {\n      mockCustomFunction,\n    };\n    const mockArg = \"mockArg\";\n    const mockFn = { fn: `ns.mockCustomFunction`, argv: [mockArg] };\n\n    const result = callFunction(mockFn, mockOptions);\n    expect(result).toBe(mockReturn);\n    expect(evaluateExpression).toHaveBeenCalledWith(mockArg, \"arg\", mockOptions);\n    expect(mockCustomFunction).toHaveBeenCalledWith(mockArgReturn);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/callFunction.ts",
    "content": "// breaks circular import\nexport { callFunction } from \"./evaluateExpression\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.ts",
    "content": "import type { EndpointFunctions } from \"../types/EndpointFunctions\";\n\nexport const customEndpointFunctions: { [key: string]: EndpointFunctions } = {};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/endpointFunctions.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { endpointFunctions } from \"./endpointFunctions\";\n\ndescribe(\"endpointFunctions\", () => {\n  it.each([\n    \"booleanEquals\",\n    \"coalesce\",\n    \"getAttr\",\n    \"isSet\",\n    \"isValidHostLabel\",\n    \"ite\",\n    \"not\",\n    \"parseURL\",\n    \"split\",\n    \"stringEquals\",\n    \"substring\",\n    \"uriEncode\",\n  ])(\"exports %s as a function\", (fnName) => {\n    expect(typeof (endpointFunctions as Record<string, unknown>)[fnName]).toBe(\"function\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/endpointFunctions.ts",
    "content": "import {\n  booleanEquals,\n  coalesce,\n  getAttr,\n  isSet,\n  isValidHostLabel,\n  ite,\n  not,\n  parseURL,\n  split,\n  stringEquals,\n  substring,\n  uriEncode,\n} from \"../lib\";\nimport type { EndpointFunctions } from \"../types\";\n\nexport const endpointFunctions: EndpointFunctions = {\n  booleanEquals,\n  coalesce,\n  getAttr,\n  isSet,\n  isValidHostLabel,\n  ite,\n  not,\n  parseURL,\n  split,\n  stringEquals,\n  substring,\n  uriEncode,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateCondition.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { debugId, toDebugString } from \"../debug\";\nimport { EndpointError, type EvaluateOptions } from \"../types\";\nimport { callFunction } from \"./callFunction\";\nimport { evaluateCondition } from \"./evaluateCondition\";\n\nvi.mock(\"./callFunction\");\n\ndescribe(evaluateCondition.name, () => {\n  const mockOptions: EvaluateOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n  const mockAssign = \"mockAssign\";\n  const mockFnArgs = { fn: \"fn\", argv: [\"arg\"] };\n\n  it(\"throws error if assign is already defined in Reference Record\", () => {\n    const mockOptionsWithAssign = {\n      ...mockOptions,\n      referenceRecord: {\n        [mockAssign]: true,\n      },\n    };\n    expect(() => evaluateCondition({ assign: mockAssign, ...mockFnArgs }, mockOptionsWithAssign)).toThrow(\n      new EndpointError(`'${mockAssign}' is already defined in Reference Record.`)\n    );\n    expect(callFunction).not.toHaveBeenCalled();\n  });\n\n  describe(\"evaluates function\", () => {\n    describe.each([\n      [true, [true, 1, -1, \"true\", \"false\", \"\"]],\n      [false, [false, 0, -0, null, undefined, NaN]],\n    ])(\"returns %s for\", (result, testCases) => {\n      it.each(testCases)(`value: '%s'`, (mockReturn: any) => {\n        const mockLogger = {\n          debug: vi.fn(),\n          info: vi.fn(),\n          warn: vi.fn(),\n          error: vi.fn(),\n        };\n        vi.mocked(callFunction).mockReturnValue(mockReturn);\n        const { result, toAssign } = evaluateCondition(mockFnArgs, { ...mockOptions, logger: mockLogger });\n        expect(result).toBe(result);\n        expect(toAssign).toBeUndefined();\n        expect(mockLogger.debug).nthCalledWith(\n          1,\n          `${debugId} evaluateCondition: ${toDebugString(mockFnArgs)} = ${mockReturn}`\n        );\n      });\n    });\n  });\n\n  it(\"returns assigned value if defined\", () => {\n    const mockAssignedValue = \"mockAssignedValue\";\n    const mockLogger = {\n      debug: vi.fn(),\n      info: vi.fn(),\n      warn: vi.fn(),\n      error: vi.fn(),\n    };\n    vi.mocked(callFunction).mockReturnValue(mockAssignedValue);\n    const { result, toAssign } = evaluateCondition(\n      { assign: mockAssign, ...mockFnArgs },\n      { ...mockOptions, logger: mockLogger }\n    );\n    expect(result).toBe(true);\n    expect(toAssign).toEqual({ name: mockAssign, value: mockAssignedValue });\n    expect(mockLogger.debug).nthCalledWith(\n      1,\n      `${debugId} evaluateCondition: ${toDebugString(mockFnArgs)} = ${mockAssignedValue}`\n    );\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateCondition.ts",
    "content": "import { debugId, toDebugString } from \"../debug\";\nimport { EndpointError, type ConditionObject, type EvaluateOptions } from \"../types\";\nimport { callFunction } from \"./callFunction\";\n\nexport const evaluateCondition = (condition: ConditionObject, options: EvaluateOptions) => {\n  const { assign } = condition;\n\n  if (assign && assign in options.referenceRecord) {\n    throw new EndpointError(`'${assign}' is already defined in Reference Record.`);\n  }\n  const value = callFunction(condition, options);\n\n  options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(condition)} = ${toDebugString(value)}`);\n\n  const result = value === \"\" ? true : !!value;\n\n  if (assign != null) {\n    return { result, toAssign: { name: assign, value } };\n  }\n  return { result };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateConditions.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { debugId, toDebugString } from \"../debug\";\nimport type { ConditionObject, EvaluateOptions } from \"../types\";\nimport { evaluateCondition } from \"./evaluateCondition\";\nimport { evaluateConditions } from \"./evaluateConditions\";\n\nvi.mock(\"./evaluateCondition\");\n\ndescribe(evaluateConditions.name, () => {\n  const mockLogger = {\n    debug: vi.fn(),\n    info: vi.fn(),\n    warn: vi.fn(),\n    error: vi.fn(),\n  };\n  const mockOptions: EvaluateOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n    logger: mockLogger,\n  };\n  const mockCn1: ConditionObject = { fn: \"fn1\", argv: [\"arg1\"], assign: \"assign1\" };\n  const mockCn2: ConditionObject = { fn: \"fn2\", argv: [\"arg2\"], assign: \"assign2\" };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"returns false as soon as one condition is false\", () => {\n    it(\"first condition is false\", () => {\n      vi.mocked(evaluateCondition).mockReturnValueOnce({ result: false });\n      const { result, referenceRecord } = evaluateConditions([mockCn1, mockCn2], mockOptions);\n      expect(result).toBe(false);\n      expect(referenceRecord).toBeUndefined();\n      expect(evaluateCondition).toHaveBeenCalledWith(mockCn1, mockOptions);\n    });\n\n    it(\"second condition is false\", () => {\n      vi.mocked(evaluateCondition).mockReturnValueOnce({ result: true });\n      vi.mocked(evaluateCondition).mockReturnValueOnce({ result: false });\n      const { result, referenceRecord } = evaluateConditions([mockCn1, mockCn2], mockOptions);\n      expect(result).toBe(false);\n      expect(referenceRecord).toBeUndefined();\n      expect(evaluateCondition).toHaveBeenNthCalledWith(1, mockCn1, mockOptions);\n      expect(evaluateCondition).toHaveBeenNthCalledWith(2, mockCn2, mockOptions);\n    });\n  });\n\n  it(\"returns true if all conditions are true with referenceRecord\", () => {\n    const value1 = \"value1\";\n    const value2 = \"value2\";\n\n    const capturedReferenceRecords: Record<string, unknown>[] = [];\n\n    vi.mocked(evaluateCondition)\n      .mockImplementationOnce((_condition, options) => {\n        capturedReferenceRecords.push({ ...options.referenceRecord });\n        return { result: true, toAssign: { name: mockCn1.assign!, value: value1 } };\n      })\n      .mockImplementationOnce((_condition, options) => {\n        capturedReferenceRecords.push({ ...options.referenceRecord });\n        return { result: true, toAssign: { name: mockCn2.assign!, value: value2 } };\n      });\n\n    const { result, referenceRecord } = evaluateConditions([mockCn1, mockCn2], { ...mockOptions });\n    expect(result).toBe(true);\n    expect(referenceRecord).toEqual({\n      [mockCn1.assign!]: value1,\n      [mockCn2.assign!]: value2,\n    });\n    expect(capturedReferenceRecords[0]).toEqual({});\n    expect(capturedReferenceRecords[1]).toEqual({ [mockCn1.assign!]: value1 });\n    expect(mockLogger.debug).nthCalledWith(1, `${debugId} assign: ${mockCn1.assign} := ${toDebugString(value1)}`);\n    expect(mockLogger.debug).nthCalledWith(2, `${debugId} assign: ${mockCn2.assign} := ${toDebugString(value2)}`);\n  });\n\n  it(\"returns true without a referenceRecord if no conditions assign values\", () => {\n    vi.mocked(evaluateCondition).mockReturnValueOnce({ result: true }).mockReturnValueOnce({ result: true });\n\n    const result = evaluateConditions([mockCn1, mockCn2], mockOptions);\n\n    expect(result).toEqual({ result: true });\n    expect(evaluateCondition).toHaveBeenNthCalledWith(1, mockCn1, mockOptions);\n    expect(evaluateCondition).toHaveBeenNthCalledWith(2, mockCn2, mockOptions);\n    expect(mockLogger.debug).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateConditions.ts",
    "content": "import { debugId, toDebugString } from \"../debug\";\nimport type { ConditionObject, EvaluateOptions, FunctionReturn } from \"../types\";\nimport { evaluateCondition } from \"./evaluateCondition\";\n\nexport const evaluateConditions = (conditions: ConditionObject[] = [], options: EvaluateOptions) => {\n  const conditionsReferenceRecord: Record<string, FunctionReturn> = {};\n  const conditionOptions: EvaluateOptions = {\n    ...options,\n    referenceRecord: { ...options.referenceRecord },\n  };\n  let didAssign = false;\n\n  for (const condition of conditions) {\n    const { result, toAssign } = evaluateCondition(condition, conditionOptions);\n\n    if (!result) {\n      return { result };\n    }\n\n    if (toAssign) {\n      didAssign = true;\n      conditionsReferenceRecord[toAssign.name] = toAssign.value;\n      conditionOptions.referenceRecord[toAssign.name] = toAssign.value;\n      options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);\n    }\n  }\n\n  if (didAssign) {\n    return { result: true, referenceRecord: conditionsReferenceRecord };\n  }\n\n  return { result: true };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateEndpointRule.spec.ts",
    "content": "import type { EvaluateOptions } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { debugId, toDebugString } from \"../debug\";\nimport type { ConditionObject, EndpointRuleObject } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { evaluateEndpointRule } from \"./evaluateEndpointRule\";\nimport { getEndpointHeaders } from \"./getEndpointHeaders\";\nimport { getEndpointProperties } from \"./getEndpointProperties\";\nimport { getEndpointUrl } from \"./getEndpointUrl\";\n\nvi.mock(\"./evaluateConditions\");\nvi.mock(\"./getEndpointUrl\");\nvi.mock(\"./getEndpointHeaders\");\nvi.mock(\"./getEndpointProperties\");\n\ndescribe(evaluateEndpointRule.name, () => {\n  const mockLogger = {\n    debug: vi.fn(),\n    info: vi.fn(),\n    warn: vi.fn(),\n    error: vi.fn(),\n  };\n  const mockOptions: EvaluateOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n    logger: mockLogger,\n  };\n  const mockConditions: ConditionObject[] = [\n    { fn: \"fn1\", argv: [\"arg1\"] },\n    { fn: \"fn2\", argv: [\"arg2\"] },\n  ];\n  const mockEndpoint = { url: \"http://example.com\" };\n  const mockEndpointRule: EndpointRuleObject = {\n    type: \"endpoint\",\n    conditions: mockConditions,\n    endpoint: mockEndpoint,\n  };\n\n  it(\"returns undefined if conditions are false\", () => {\n    vi.mocked(evaluateConditions).mockReturnValue({ result: false });\n    const result = evaluateEndpointRule(mockEndpointRule, mockOptions);\n    expect(result).toBeUndefined();\n    expect(evaluateConditions).toHaveBeenCalledWith(mockConditions, mockOptions);\n    expect(getEndpointUrl).not.toHaveBeenCalled();\n    expect(getEndpointHeaders).not.toHaveBeenCalled();\n    expect(getEndpointProperties).not.toHaveBeenCalled();\n  });\n\n  it(\"reuses the original options when conditions assign no references\", () => {\n    vi.mocked(evaluateConditions).mockReturnValue({ result: true });\n    vi.mocked(getEndpointUrl).mockReturnValue(new URL(mockEndpoint.url));\n\n    evaluateEndpointRule(mockEndpointRule, mockOptions);\n\n    expect(getEndpointUrl).toHaveBeenCalledWith(mockEndpoint.url, mockOptions);\n  });\n\n  describe(\"returns endpoint if conditions are true\", () => {\n    const mockReferenceRecord = { key: \"value\" };\n    const mockEndpointUrl = new URL(mockEndpoint.url);\n    const mockUpdatedOptions = {\n      ...mockOptions,\n      referenceRecord: { ...mockOptions.referenceRecord, ...mockReferenceRecord },\n    };\n\n    beforeEach(() => {\n      vi.mocked(evaluateConditions).mockReturnValue({\n        result: true,\n        referenceRecord: mockReferenceRecord,\n      });\n      vi.mocked(getEndpointUrl).mockReturnValue(mockEndpointUrl);\n    });\n\n    afterEach(() => {\n      expect(evaluateConditions).toHaveBeenCalledWith(mockConditions, mockOptions);\n      expect(getEndpointUrl).toHaveBeenCalledWith(mockEndpoint.url, mockUpdatedOptions);\n      vi.clearAllMocks();\n    });\n\n    it(\"without headers and properties\", () => {\n      const result = evaluateEndpointRule(mockEndpointRule, mockOptions);\n      expect(result).toEqual({\n        url: mockEndpointUrl,\n      });\n      expect(getEndpointHeaders).not.toHaveBeenCalled();\n      expect(getEndpointProperties).not.toHaveBeenCalled();\n      expect(mockLogger.debug).nthCalledWith(\n        1,\n        `${debugId} Resolving endpoint from template: ${toDebugString(mockEndpointRule.endpoint)}`\n      );\n    });\n\n    it(\"with headers and properties\", () => {\n      const mockInputHeaders = { headerKey: [\"headerInputValue\"] };\n      const mockInputProperties = { propertyKey: \"propertyInputValue\" };\n\n      const mockOutputHeaders = { headerKey: [\"headerOutputValue\"] };\n      const mockOutputProperties = { propertyKey: \"propertyOutputValue\" };\n\n      vi.mocked(getEndpointHeaders).mockReturnValue(mockOutputHeaders);\n      vi.mocked(getEndpointProperties).mockReturnValue(mockOutputProperties);\n      const headerEndpoint = {\n        ...mockEndpoint,\n        headers: mockInputHeaders,\n        properties: mockInputProperties,\n      };\n      const result = evaluateEndpointRule(\n        {\n          ...mockEndpointRule,\n          endpoint: headerEndpoint,\n        },\n        mockOptions\n      );\n\n      expect(result).toEqual({\n        url: mockEndpointUrl,\n        headers: mockOutputHeaders,\n        properties: mockOutputProperties,\n      });\n      expect(getEndpointHeaders).toHaveBeenCalledWith(mockInputHeaders, mockUpdatedOptions);\n      expect(getEndpointProperties).toHaveBeenCalledWith(mockInputProperties, mockUpdatedOptions);\n      expect(mockLogger.debug).nthCalledWith(\n        1,\n        `${debugId} Resolving endpoint from template: ${toDebugString(headerEndpoint)}`\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateEndpointRule.ts",
    "content": "import type { EndpointV2 } from \"@smithy/types\";\n\nimport { debugId, toDebugString } from \"../debug\";\nimport type { EndpointRuleObject, EvaluateOptions } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { getEndpointHeaders } from \"./getEndpointHeaders\";\nimport { getEndpointProperties } from \"./getEndpointProperties\";\nimport { getEndpointUrl } from \"./getEndpointUrl\";\n\nexport const evaluateEndpointRule = (\n  endpointRule: EndpointRuleObject,\n  options: EvaluateOptions\n): EndpointV2 | undefined => {\n  const { conditions, endpoint } = endpointRule;\n\n  const { result, referenceRecord } = evaluateConditions(conditions, options);\n  if (!result) {\n    return;\n  }\n\n  const endpointRuleOptions = referenceRecord\n    ? {\n        ...options,\n        referenceRecord: { ...options.referenceRecord, ...referenceRecord },\n      }\n    : options;\n\n  const { url, properties, headers } = endpoint;\n\n  options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);\n\n  const endpointToReturn: EndpointV2 = { url: getEndpointUrl(url, endpointRuleOptions) };\n  if (headers != null) {\n    endpointToReturn.headers = getEndpointHeaders(headers, endpointRuleOptions);\n  }\n  if (properties != null) {\n    endpointToReturn.properties = getEndpointProperties(properties, endpointRuleOptions);\n  }\n\n  return endpointToReturn;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateErrorRule.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { EndpointError, type ErrorRuleObject } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { evaluateErrorRule } from \"./evaluateErrorRule\";\nimport { evaluateExpression } from \"./evaluateExpression\";\n\nvi.mock(\"./evaluateConditions\");\nvi.mock(\"./evaluateExpression\");\n\ndescribe(evaluateErrorRule.name, () => {\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n  const mockConditions = [\n    { fn: \"fn1\", argv: [\"arg1\"] },\n    { fn: \"fn2\", argv: [\"arg2\"] },\n  ];\n  const mockError = \"mockError\";\n  const mockErrorRule: ErrorRuleObject = {\n    type: \"error\",\n    conditions: mockConditions,\n    error: mockError,\n  };\n\n  it(\"returns undefined if conditions evaluate to false\", () => {\n    vi.mocked(evaluateConditions).mockReturnValue({ result: false });\n    const result = evaluateErrorRule(mockErrorRule, mockOptions);\n    expect(result).toBeUndefined();\n    expect(evaluateConditions).toHaveBeenCalledWith(mockConditions, mockOptions);\n    expect(evaluateExpression).not.toHaveBeenCalled();\n  });\n\n  it(\"reuses the original options if conditions assign no references\", () => {\n    const mockErrorMsg = \"mockErrorMsg\";\n\n    vi.mocked(evaluateConditions).mockReturnValue({ result: true });\n    vi.mocked(evaluateExpression).mockReturnValue(mockErrorMsg);\n\n    expect(() => evaluateErrorRule(mockErrorRule, mockOptions)).toThrowError(new EndpointError(`mockErrorMsg`));\n    expect(evaluateExpression).toHaveBeenCalledWith(mockError, \"Error\", mockOptions);\n  });\n\n  it(\"throws error if conditions evaluate to true\", () => {\n    const mockErrorMsg = \"mockErrorMsg\";\n    const mockReferenceRecord = { key: \"value\" };\n\n    vi.mocked(evaluateConditions).mockReturnValue({ result: true, referenceRecord: mockReferenceRecord });\n    vi.mocked(evaluateExpression).mockReturnValue(mockErrorMsg);\n\n    expect(() => evaluateErrorRule(mockErrorRule, mockOptions)).toThrowError(new EndpointError(`mockErrorMsg`));\n    expect(evaluateConditions).toHaveBeenCalledWith(mockConditions, mockOptions);\n    expect(evaluateExpression).toHaveBeenCalledWith(mockError, \"Error\", {\n      ...mockOptions,\n      referenceRecord: { ...mockOptions.referenceRecord, ...mockReferenceRecord },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateErrorRule.ts",
    "content": "import { EndpointError, type ErrorRuleObject, type EvaluateOptions } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { evaluateExpression } from \"./evaluateExpression\";\n\nexport const evaluateErrorRule = (errorRule: ErrorRuleObject, options: EvaluateOptions) => {\n  const { conditions, error } = errorRule;\n\n  const { result, referenceRecord } = evaluateConditions(conditions, options);\n  if (!result) {\n    return;\n  }\n\n  const errorRuleOptions = referenceRecord\n    ? {\n        ...options,\n        referenceRecord: { ...options.referenceRecord, ...referenceRecord },\n      }\n    : options;\n\n  throw new EndpointError(evaluateExpression(error, \"Error\", errorRuleOptions) as string);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateExpression.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { EndpointError } from \"../types\";\nimport { callFunction, evaluateExpression, group } from \"./evaluateExpression\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\nimport { getReferenceValue } from \"./getReferenceValue\";\n\nvi.mock(\"./getReferenceValue\");\nvi.mock(\"./evaluateTemplate\");\n\ndescribe(evaluateExpression.name, () => {\n  vi.spyOn(group, \"callFunction\").mockImplementation(vi.fn());\n  const { callFunction } = group;\n\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n  const mockKeyName = \"mockKeyName\";\n  const mockResult = \"mockResult\";\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"calls evaluateTemplate if input is string\", () => {\n    const mockInput = \"mockInput\";\n    vi.mocked(evaluateTemplate).mockReturnValue(mockResult);\n    const result = evaluateExpression(mockInput, mockKeyName, mockOptions);\n    expect(result).toBe(mockResult);\n    expect(evaluateTemplate).toHaveBeenCalledWith(mockInput, mockOptions);\n    expect(callFunction).not.toHaveBeenCalled();\n    expect(getReferenceValue).not.toHaveBeenCalled();\n  });\n\n  it(\"calls callFunction if input constains 'fn' key\", () => {\n    const mockInput = { fn: \"fn\", argv: [\"arg1\"] };\n    vi.mocked(callFunction).mockReturnValue(mockResult);\n    const result = evaluateExpression(mockInput, mockKeyName, mockOptions);\n    expect(result).toBe(mockResult);\n    expect(evaluateTemplate).not.toHaveBeenCalled();\n    expect(callFunction).toHaveBeenCalledWith(mockInput, mockOptions);\n    expect(getReferenceValue).not.toHaveBeenCalled();\n  });\n\n  it(\"calls getReferenceValue if input constains 'ref' key\", () => {\n    const mockInput = { ref: \"ref\" };\n    vi.mocked(getReferenceValue).mockReturnValue(mockResult);\n    const result = evaluateExpression(mockInput, mockKeyName, mockOptions);\n    expect(result).toBe(mockResult);\n    expect(evaluateTemplate).not.toHaveBeenCalled();\n    expect(callFunction).not.toHaveBeenCalled();\n    expect(getReferenceValue).toHaveBeenCalledWith(mockInput, mockOptions);\n  });\n\n  it(\"throws error if input is neither string, function or reference\", () => {\n    const mockInput = {};\n    // @ts-ignore: Argument is not assignable\n    expect(() => evaluateExpression(mockInput, mockKeyName, mockOptions)).toThrowError(\n      new EndpointError(`'${mockKeyName}': ${String(mockInput)} is not a string, function or reference.`)\n    );\n    expect(evaluateTemplate).not.toHaveBeenCalled();\n    expect(callFunction).not.toHaveBeenCalled();\n    expect(getReferenceValue).not.toHaveBeenCalled();\n  });\n});\n\ndescribe(callFunction.name, () => {\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  it(\"throws error for unknown function\", () => {\n    expect(() => callFunction({ fn: \"unknownFn\", argv: [] }, mockOptions)).toThrowError(\n      \"function unknownFn not loaded in endpointFunctions.\"\n    );\n  });\n\n  it(\"calls a known endpoint function\", () => {\n    const result = callFunction({ fn: \"booleanEquals\", argv: [true, true] }, mockOptions);\n    expect(result).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateExpression.ts",
    "content": "import {\n  EndpointError,\n  type EvaluateOptions,\n  type Expression,\n  type FunctionObject,\n  type FunctionReturn,\n  type ReferenceObject,\n} from \"../types\";\nimport { customEndpointFunctions } from \"./customEndpointFunctions\";\nimport { endpointFunctions } from \"./endpointFunctions\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\nimport { getReferenceValue } from \"./getReferenceValue\";\n\nexport const evaluateExpression = (obj: Expression, keyName: string, options: EvaluateOptions) => {\n  if (typeof obj === \"string\") {\n    return evaluateTemplate(obj, options);\n  } else if ((obj as FunctionObject)[\"fn\"]) {\n    return group.callFunction(obj as FunctionObject, options);\n  } else if ((obj as ReferenceObject)[\"ref\"]) {\n    return getReferenceValue(obj as ReferenceObject, options);\n  }\n  throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);\n};\n\nexport const callFunction = ({ fn, argv }: FunctionObject, options: EvaluateOptions): FunctionReturn => {\n  const evaluatedArgs = Array(argv.length);\n\n  // manual mapping - hot code path.\n  for (let i = 0; i < evaluatedArgs.length; ++i) {\n    const arg = argv[i];\n    if (typeof arg === \"boolean\" || typeof arg === \"number\") {\n      evaluatedArgs[i] = arg;\n    } else {\n      evaluatedArgs[i] = group.evaluateExpression(arg, \"arg\", options);\n    }\n  }\n\n  const namespaceSeparatorIndex = fn.indexOf(\".\");\n  if (namespaceSeparatorIndex !== -1) {\n    const namespaceFunctions = customEndpointFunctions[fn.slice(0, namespaceSeparatorIndex)];\n    const customFunction = namespaceFunctions?.[fn.slice(namespaceSeparatorIndex + 1)];\n    if (typeof customFunction === \"function\") {\n      return customFunction(...evaluatedArgs);\n    }\n  }\n\n  const callable = endpointFunctions[fn as keyof typeof endpointFunctions];\n  if (typeof callable === \"function\") {\n    return callable(...evaluatedArgs);\n  }\n\n  throw new Error(`function ${fn} not loaded in endpointFunctions.`);\n};\n\nexport const group = {\n  evaluateExpression,\n  callFunction,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateRules.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { EndpointError, type EndpointRuleObject, type ErrorRuleObject, type TreeRuleObject } from \"../types\";\nimport { evaluateEndpointRule } from \"./evaluateEndpointRule\";\nimport { evaluateErrorRule } from \"./evaluateErrorRule\";\nimport { evaluateRules, group } from \"./evaluateRules\";\n\nvi.mock(\"./evaluateEndpointRule\");\nvi.mock(\"./evaluateErrorRule\");\nvi.mock(\"./evaluateTreeRule\");\n\ndescribe(evaluateRules.name, () => {\n  vi.spyOn(group, \"evaluateTreeRule\").mockImplementation(vi.fn());\n  const { evaluateTreeRule } = group;\n\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  const mockConditions = [\n    { fn: \"fn1\", argv: [\"arg1\"] },\n    { fn: \"fn2\", argv: [\"arg2\"] },\n  ];\n\n  const mockEndpoint = { url: \"http://example.com\" };\n  const mockEndpointRule: EndpointRuleObject = {\n    type: \"endpoint\",\n    conditions: mockConditions,\n    endpoint: mockEndpoint,\n  };\n\n  const mockError = \"mockError\";\n  const mockErrorRule: ErrorRuleObject = {\n    type: \"error\",\n    conditions: mockConditions,\n    error: mockError,\n  };\n\n  const mockTreeRule: TreeRuleObject = {\n    type: \"tree\",\n    conditions: mockConditions,\n    rules: [],\n  };\n\n  const mockEndpointResult = { url: new URL(mockEndpoint.url) };\n  const mockRules = [mockEndpointRule, mockErrorRule, mockTreeRule];\n\n  beforeEach(() => {\n    vi.mocked(evaluateEndpointRule).mockReturnValue(undefined);\n    vi.mocked(evaluateErrorRule).mockReturnValue(undefined);\n    vi.mocked(evaluateTreeRule).mockReturnValue(undefined);\n  });\n\n  afterEach(() => {\n    vi.resetAllMocks();\n  });\n\n  describe(\"returns endpoint if defined\", () => {\n    it(\"from EndPoint Rule\", () => {\n      vi.mocked(evaluateEndpointRule).mockReturnValue(mockEndpointResult);\n      const result = evaluateRules(mockRules, mockOptions);\n      expect(result).toEqual(mockEndpointResult);\n      expect(evaluateEndpointRule).toHaveBeenCalledWith(mockEndpointRule, mockOptions);\n      expect(evaluateErrorRule).not.toHaveBeenCalled();\n      expect(evaluateTreeRule).not.toHaveBeenCalled();\n    });\n\n    it(\"from Tree Rule\", () => {\n      vi.mocked(evaluateTreeRule).mockReturnValue(mockEndpointResult);\n      const result = evaluateRules(mockRules, mockOptions);\n      expect(result).toEqual(mockEndpointResult);\n      expect(evaluateEndpointRule).toHaveBeenCalledWith(mockEndpointRule, mockOptions);\n      expect(evaluateErrorRule).toHaveBeenCalledWith(mockErrorRule, mockOptions);\n      expect(evaluateTreeRule).toHaveBeenCalledWith(mockTreeRule, mockOptions);\n    });\n  });\n\n  it(\"re-throws error from Error Rule, if it occurs before endpoint evaluation\", () => {\n    const mockError = new Error(\"mockError\");\n    vi.mocked(evaluateErrorRule).mockImplementation(() => {\n      throw mockError;\n    });\n    expect(() => evaluateRules(mockRules, mockOptions)).toThrow(mockError);\n    expect(evaluateEndpointRule).toHaveBeenCalledWith(mockEndpointRule, mockOptions);\n    expect(evaluateErrorRule).toHaveBeenCalledWith(mockErrorRule, mockOptions);\n    expect(evaluateTreeRule).not.toHaveBeenCalled();\n  });\n\n  it(\"throws error for unknown endpoint rule\", () => {\n    const mockUnknownRule = {\n      type: \"unknown\",\n      conditions: mockConditions,\n      endpoint: mockEndpoint,\n    };\n    // @ts-ignore: Argument not assignable\n    expect(() => evaluateRules([mockUnknownRule], mockOptions)).toThrow(\n      new EndpointError(`Unknown endpoint rule: ${mockUnknownRule}`)\n    );\n    expect(evaluateEndpointRule).not.toHaveBeenCalled();\n    expect(evaluateErrorRule).not.toHaveBeenCalled();\n    expect(evaluateTreeRule).not.toHaveBeenCalled();\n  });\n\n  it(\"throws error if rules evaluation fails\", () => {\n    expect(() => evaluateRules(mockRules, mockOptions)).toThrow(new EndpointError(`Rules evaluation failed`));\n    expect(evaluateEndpointRule).toHaveBeenCalledWith(mockEndpointRule, mockOptions);\n    expect(evaluateErrorRule).toHaveBeenCalledWith(mockErrorRule, mockOptions);\n    expect(evaluateTreeRule).toHaveBeenCalledWith(mockTreeRule, mockOptions);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateRules.ts",
    "content": "import type { EndpointV2 } from \"@smithy/types\";\n\nimport { EndpointError, type EvaluateOptions, type RuleSetRules, type TreeRuleObject } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { evaluateEndpointRule } from \"./evaluateEndpointRule\";\nimport { evaluateErrorRule } from \"./evaluateErrorRule\";\n\nexport const evaluateRules = (rules: RuleSetRules, options: EvaluateOptions): EndpointV2 => {\n  for (const rule of rules) {\n    if (rule.type === \"endpoint\") {\n      const endpointOrUndefined = evaluateEndpointRule(rule, options);\n      if (endpointOrUndefined) {\n        return endpointOrUndefined;\n      }\n    } else if (rule.type === \"error\") {\n      evaluateErrorRule(rule, options);\n    } else if (rule.type === \"tree\") {\n      const endpointOrUndefined = group.evaluateTreeRule(rule, options);\n      if (endpointOrUndefined) {\n        return endpointOrUndefined;\n      }\n    } else {\n      throw new EndpointError(`Unknown endpoint rule: ${rule}`);\n    }\n  }\n  throw new EndpointError(`Rules evaluation failed`);\n};\n\nexport const evaluateTreeRule = (treeRule: TreeRuleObject, options: EvaluateOptions): EndpointV2 | undefined => {\n  const { conditions, rules } = treeRule;\n\n  const { result, referenceRecord } = evaluateConditions(conditions, options);\n  if (!result) {\n    return;\n  }\n\n  const treeRuleOptions = referenceRecord\n    ? { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } }\n    : options;\n\n  return group.evaluateRules(rules, treeRuleOptions);\n};\n\nexport const group = {\n  evaluateRules,\n  evaluateTreeRule,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateTemplate.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getAttr } from \"../lib\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\n\nvi.mock(\"../lib\");\n\ndescribe(evaluateTemplate.name, () => {\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should not escape template without braces\", () => {\n    const templateWithoutBraces = \"foo bar baz\";\n    expect(evaluateTemplate(templateWithoutBraces, mockOptions)).toEqual(templateWithoutBraces);\n  });\n\n  describe(\"should replace `{parameterName}` with value\", () => {\n    const parameterName = \"bar\";\n    const template = \"foo {parameterName} baz\";\n\n    afterEach(() => {\n      expect(getAttr).not.toHaveBeenCalled();\n    });\n\n    it.each([\"endpointParams\", \"referenceRecord\"])(\"from %s\", (key: string) => {\n      expect(evaluateTemplate(template, { ...mockOptions, [key]: { parameterName } })).toBe(`foo ${parameterName} baz`);\n    });\n  });\n\n  it(\"should escape values within double braces like {{value}}\", () => {\n    const value = \"bar\";\n    expect(evaluateTemplate(\"foo {{value1}} bar {{value2}} baz\", { ...mockOptions, endpointParams: { value } })).toBe(\n      \"foo {value1} bar {value2} baz\"\n    );\n    expect(getAttr).not.toHaveBeenCalled();\n  });\n\n  it(\"should call getAttr for short-hand getAttr function\", () => {\n    const ref1 = { key1: \"value1\" };\n    const ref2 = { key2: \"value2\" };\n\n    vi.mocked(getAttr).mockReturnValueOnce(ref1[\"key1\"]);\n    vi.mocked(getAttr).mockReturnValueOnce(ref2[\"key2\"]);\n\n    expect(\n      evaluateTemplate(\"foo {ref1#key1} bar {ref2#key2} baz\", { ...mockOptions, referenceRecord: { ref1, ref2 } })\n    ).toBe(`foo ${ref1[\"key1\"]} bar ${ref2[\"key2\"]} baz`);\n\n    expect(getAttr).toHaveBeenCalledTimes(2);\n    expect(getAttr).toHaveBeenNthCalledWith(1, ref1, \"key1\");\n    expect(getAttr).toHaveBeenNthCalledWith(2, ref2, \"key2\");\n  });\n\n  describe(\"should not change template with incomplete braces\", () => {\n    it.each([\n      \"incomplete opening bracket '{' in template\",\n      \"incomplete closing bracket '}' in template\",\n      \"incomplete opening escape '{{' in template\",\n      \"incomplete closing escape '}}' in template\",\n    ])(\"%s\", (template) => {\n      expect(evaluateTemplate(template, mockOptions)).toEqual(template);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateTemplate.ts",
    "content": "import { getAttr } from \"../lib\";\nimport type { EvaluateOptions } from \"../types\";\n\nexport const evaluateTemplate = (template: string, options: EvaluateOptions) => {\n  const evaluatedTemplateArr: string[] = [];\n\n  const { referenceRecord, endpointParams } = options;\n\n  let currentIndex = 0;\n  while (currentIndex < template.length) {\n    const openingBraceIndex = template.indexOf(\"{\", currentIndex);\n\n    if (openingBraceIndex === -1) {\n      // No more opening braces, add the rest of the template and break.\n      evaluatedTemplateArr.push(template.slice(currentIndex));\n      break;\n    }\n\n    evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));\n    const closingBraceIndex = template.indexOf(\"}\", openingBraceIndex);\n\n    if (closingBraceIndex === -1) {\n      // No more closing braces, add the rest of the template and break.\n      evaluatedTemplateArr.push(template.slice(openingBraceIndex));\n      break;\n    }\n\n    if (template[openingBraceIndex + 1] === \"{\" && template[closingBraceIndex + 1] === \"}\") {\n      // Escaped expression. Do not evaluate.\n      evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));\n      currentIndex = closingBraceIndex + 2;\n    }\n\n    const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);\n\n    if (parameterName.includes(\"#\")) {\n      const [refName, attrName] = parameterName.split(\"#\");\n      evaluatedTemplateArr.push(\n        getAttr((referenceRecord[refName] ?? endpointParams[refName]) as string, attrName) as string\n      );\n    } else {\n      evaluatedTemplateArr.push((referenceRecord[parameterName] ?? endpointParams[parameterName]) as string);\n    }\n\n    currentIndex = closingBraceIndex + 1;\n  }\n\n  return evaluatedTemplateArr.join(\"\");\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateTreeRule.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport type { TreeRuleObject } from \"../types\";\nimport { evaluateConditions } from \"./evaluateConditions\";\nimport { group } from \"./evaluateRules\";\nimport { evaluateTreeRule } from \"./evaluateTreeRule\";\n\nvi.mock(\"./evaluateConditions\");\n\ndescribe(evaluateTreeRule.name, () => {\n  vi.spyOn(group, \"evaluateRules\").mockImplementation(() => ({}) as any);\n  const { evaluateRules } = group;\n\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n  const mockConditions = [\n    { fn: \"fn1\", argv: [\"arg1\"] },\n    { fn: \"fn2\", argv: [\"arg2\"] },\n  ];\n  const mockTreeRule: TreeRuleObject = {\n    type: \"tree\",\n    conditions: mockConditions,\n    rules: [],\n  };\n\n  it(\"returns undefined if conditions evaluate to false\", () => {\n    vi.mocked(evaluateConditions).mockReturnValue({ result: false });\n    const result = evaluateTreeRule(mockTreeRule, mockOptions);\n    expect(result).toBeUndefined();\n    expect(evaluateConditions).toHaveBeenCalledWith(mockConditions, mockOptions);\n    expect(evaluateRules).not.toHaveBeenCalled();\n  });\n\n  it(\"returns evaluateRules if conditions evaluate to true\", () => {\n    const mockReferenceRecord = { key: \"value\" };\n    const mockEndpointUrl = new URL(\"http://example.com\");\n\n    vi.mocked(evaluateConditions).mockReturnValue({ result: true, referenceRecord: mockReferenceRecord });\n    vi.mocked(evaluateRules).mockReturnValue(mockEndpointUrl as any);\n\n    const result = evaluateTreeRule(mockTreeRule, mockOptions);\n    expect(result).toBe(mockEndpointUrl);\n    expect(evaluateConditions).toHaveBeenCalledWith(mockConditions, mockOptions);\n    expect(evaluateRules).toHaveBeenCalledWith(mockTreeRule.rules, {\n      ...mockOptions,\n      referenceRecord: {\n        ...mockOptions.referenceRecord,\n        ...mockReferenceRecord,\n      },\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/evaluateTreeRule.ts",
    "content": "// breaks circular import\nexport { evaluateTreeRule } from \"./evaluateRules\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { evaluateExpression } from \"./evaluateExpression\";\nimport { getEndpointHeaders } from \"./getEndpointHeaders\";\n\nvi.mock(\"./evaluateExpression\");\n\ndescribe(getEndpointHeaders.name, () => {\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should return an empty object if empty headers are provided\", () => {\n    expect(getEndpointHeaders(null as any, mockOptions)).toEqual({});\n    expect(getEndpointHeaders({}, mockOptions)).toEqual({});\n    expect(evaluateExpression).not.toHaveBeenCalled();\n  });\n\n  it(\"should return processed header\", () => {\n    const inputHeaderValue = \"inputHeaderValue\";\n    const outputHeaderValue = \"outputHeaderValue\";\n    const mockHeaders = { key: [inputHeaderValue] };\n\n    vi.mocked(evaluateExpression).mockReturnValue(outputHeaderValue);\n    expect(getEndpointHeaders(mockHeaders, mockOptions)).toEqual({ key: [outputHeaderValue] });\n    expect(evaluateExpression).toHaveBeenCalledWith(\"inputHeaderValue\", \"Header value entry\", mockOptions);\n  });\n\n  it.each([null, undefined, true, 1])(\n    \"should throw error if evaluated expression is not string: %s\",\n    (notStringValue: any) => {\n      const inputHeaderKey = \"inputHeaderKey\";\n      const inputHeaderValue = \"inputHeaderValue\";\n      const mockHeaders = { [inputHeaderKey]: [inputHeaderValue] };\n\n      vi.mocked(evaluateExpression).mockReturnValue(notStringValue);\n      expect(() => getEndpointHeaders(mockHeaders, mockOptions)).toThrowError(\n        `Header '${inputHeaderKey}' value '${notStringValue}' is not a string`\n      );\n      expect(evaluateExpression).toHaveBeenCalledWith(\"inputHeaderValue\", \"Header value entry\", mockOptions);\n    }\n  );\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.ts",
    "content": "import { EndpointError, type EndpointObjectHeaders, type EvaluateOptions } from \"../types\";\nimport { evaluateExpression } from \"./evaluateExpression\";\n\nexport const getEndpointHeaders = (headers: EndpointObjectHeaders, options: EvaluateOptions) =>\n  Object.entries(headers ?? {}).reduce(\n    (acc, [headerKey, headerVal]) => {\n      acc[headerKey] = headerVal.map((headerValEntry) => {\n        const processedExpr = evaluateExpression(headerValEntry, \"Header value entry\", options);\n        if (typeof processedExpr !== \"string\") {\n          throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);\n        }\n        return processedExpr;\n      });\n      return acc;\n    },\n    {} as Record<string, string[]>\n  );\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointProperties.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getEndpointProperties, group } from \"./getEndpointProperties\";\n\ndescribe(getEndpointProperties.name, () => {\n  vi.spyOn(group, \"getEndpointProperty\");\n  const { getEndpointProperty } = group;\n\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should return an empty object if empty properties are provided\", () => {\n    expect(getEndpointProperties({}, mockOptions)).toEqual({});\n  });\n\n  it(\"return processed endpoint properties\", () => {\n    const inputPropertyValue = \"inputPropertyValue\";\n    const outputPropertyValue = \"outputPropertyValue\";\n    const mockProperties = { key: inputPropertyValue };\n\n    vi.mocked(getEndpointProperty).mockReturnValue(outputPropertyValue);\n    expect(getEndpointProperties(mockProperties, mockOptions)).toEqual({ key: outputPropertyValue });\n    expect(getEndpointProperty).toHaveBeenCalledWith(inputPropertyValue, mockOptions);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointProperties.ts",
    "content": "import type { EndpointObjectProperty } from \"@smithy/types\";\n\nimport { EndpointError, type EndpointObjectProperties, type EvaluateOptions } from \"../types\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\n\nexport const getEndpointProperties = (properties: EndpointObjectProperties, options: EvaluateOptions) =>\n  Object.entries(properties).reduce(\n    (acc, [propertyKey, propertyVal]) => {\n      acc[propertyKey] = group.getEndpointProperty(propertyVal, options);\n      return acc;\n    },\n    {} as Record<string, EndpointObjectProperty>\n  );\n\nexport const getEndpointProperty = (\n  property: EndpointObjectProperty,\n  options: EvaluateOptions\n): EndpointObjectProperty => {\n  if (Array.isArray(property)) {\n    return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));\n  }\n  switch (typeof property) {\n    case \"string\":\n      return evaluateTemplate(property, options);\n    case \"object\":\n      if (property === null) {\n        throw new EndpointError(`Unexpected endpoint property: ${property}`);\n      }\n      return group.getEndpointProperties(property, options);\n    case \"boolean\":\n      return property;\n    default:\n      throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);\n  }\n};\n\nexport const group = {\n  getEndpointProperty,\n  getEndpointProperties,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointProperty.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { EndpointError } from \"../types\";\nimport { evaluateTemplate } from \"./evaluateTemplate\";\nimport { getEndpointProperty, group } from \"./getEndpointProperties\";\n\nvi.mock(\"./evaluateTemplate\");\n\ndescribe(getEndpointProperty.name, () => {\n  vi.spyOn(group, \"getEndpointProperties\").mockImplementation(vi.fn());\n  const { getEndpointProperties } = group;\n\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  const mockInputString = \"mockInputString\";\n  const mockOutputString = \"mockOutputString\";\n  const mockInputObject = { key: mockInputString };\n  const mockOutputObject = { key: mockOutputString };\n  const mockBoolean = false;\n\n  beforeEach(() => {\n    vi.mocked(evaluateTemplate).mockReturnValue(mockOutputString);\n    vi.mocked(getEndpointProperties).mockReturnValue(mockOutputObject);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"processes each property in an array\", () => {\n    const arrayLength = 3;\n\n    it.each([\n      [\"string array\", [Array(arrayLength).fill(mockInputString)], [Array(arrayLength).fill(mockOutputString)]],\n      [\"object array\", [Array(arrayLength).fill(mockInputObject)], [Array(arrayLength).fill(mockOutputObject)]],\n      [\"boolean array\", [Array(arrayLength).fill(mockBoolean)], [Array(arrayLength).fill(mockBoolean)]],\n    ])(\"%s\", (desc, inputArray, outputArray) => {\n      expect(getEndpointProperty(inputArray, mockOptions)).toEqual(outputArray);\n    });\n  });\n\n  it(\"returns the evaluated template\", () => {\n    expect(getEndpointProperty(mockInputString, mockOptions)).toEqual(mockOutputString);\n    expect(evaluateTemplate).toHaveBeenCalledWith(mockInputString, mockOptions);\n    expect(getEndpointProperties).not.toHaveBeenCalled();\n  });\n\n  it(\"returns the processed object\", () => {\n    expect(getEndpointProperty(mockInputObject, mockOptions)).toEqual(mockOutputObject);\n    expect(evaluateTemplate).not.toHaveBeenCalled();\n    expect(getEndpointProperties).toHaveBeenCalledWith(mockInputObject, mockOptions);\n  });\n\n  it(\"returns the boolean without processing\", () => {\n    expect(getEndpointProperty(mockBoolean, mockOptions)).toEqual(mockBoolean);\n    expect(evaluateTemplate).not.toHaveBeenCalled();\n    expect(getEndpointProperties).not.toHaveBeenCalled();\n  });\n\n  describe(\"throws error for unexpected property\", () => {\n    it.each([undefined, 0])(\"%s\", (input) => {\n      // @ts-ignore Argument is not assignable\n      expect(() => getEndpointProperty(input, mockOptions)).toThrow(\n        new EndpointError(`Unexpected endpoint property type: ${typeof input}`)\n      );\n    });\n\n    it(\"null\", () => {\n      // @ts-ignore Argument is not assignable\n      expect(() => getEndpointProperty(null, mockOptions)).toThrow(\n        new EndpointError(`Unexpected endpoint property: null`)\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointProperty.ts",
    "content": "// breaks circular import\nexport { getEndpointProperty } from \"./getEndpointProperties\";\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointUrl.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { EndpointError } from \"../types\";\nimport { evaluateExpression } from \"./evaluateExpression\";\nimport { getEndpointUrl } from \"./getEndpointUrl\";\n\nvi.mock(\"./evaluateExpression\");\n\ndescribe(getEndpointUrl.name, () => {\n  const mockEndpointUrlInput = \"http://input.example.com\";\n  const mockEndpointUrlOutput = \"http://output.example.com\";\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n\n  it(\"returns URL is expression evaluates to string\", () => {\n    vi.mocked(evaluateExpression).mockReturnValue(mockEndpointUrlOutput);\n    const result = getEndpointUrl(mockEndpointUrlInput, mockOptions);\n    expect(result).toEqual(new URL(mockEndpointUrlOutput));\n    expect(evaluateExpression).toHaveBeenCalledWith(mockEndpointUrlInput, \"Endpoint URL\", mockOptions);\n  });\n\n  it(\"throws error if expression evaluates to non-string\", () => {\n    const mockNotStringOutput = 42;\n    vi.mocked(evaluateExpression).mockReturnValue(mockNotStringOutput);\n    expect(() => getEndpointUrl(mockEndpointUrlInput, mockOptions)).toThrowError(\n      new EndpointError(`Endpoint URL must be a string, got ${typeof mockNotStringOutput}`)\n    );\n    expect(evaluateExpression).toHaveBeenCalledWith(mockEndpointUrlInput, \"Endpoint URL\", mockOptions);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getEndpointUrl.ts",
    "content": "import { EndpointError, type EvaluateOptions, type Expression } from \"../types\";\nimport { evaluateExpression } from \"./evaluateExpression\";\n\nexport const getEndpointUrl = (endpointUrl: Expression, options: EvaluateOptions): URL => {\n  const expression = evaluateExpression(endpointUrl, \"Endpoint URL\", options);\n  if (typeof expression === \"string\") {\n    try {\n      return new URL(expression);\n    } catch (error) {\n      console.error(`Failed to construct URL with ${expression}`, error);\n      throw error;\n    }\n  }\n  throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getReferenceValue.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getReferenceValue } from \"./getReferenceValue\";\n\ndescribe(getReferenceValue.name, () => {\n  const mockOptions = {\n    endpointParams: {},\n    referenceRecord: {},\n  };\n  const mockRefName = \"mockRefName\";\n  const mockRefValue = \"mockRefValue\";\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"returns reference value if reference exists\", () => {\n    it.each([\"endpointParams\", \"referenceRecord\"])(\"in %s\", (key) => {\n      const mockInput = { ref: mockRefName };\n      const mockOptionsWithVal = { ...mockOptions, [key]: { [mockRefName]: mockRefValue } };\n      const result = getReferenceValue(mockInput, mockOptionsWithVal);\n      expect(result).toBe(mockRefValue);\n    });\n  });\n\n  it(\"returns undefined if reference does not exist\", () => {\n    expect(getReferenceValue({ ref: mockRefName }, mockOptions)).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/getReferenceValue.ts",
    "content": "import type { EvaluateOptions, ReferenceObject } from \"../types\";\n\nexport const getReferenceValue = ({ ref }: ReferenceObject, options: EvaluateOptions) => {\n  return options.referenceRecord[ref] ?? options.endpointParams[ref];\n};\n"
  },
  {
    "path": "packages/core/src/submodules/endpoints/util-endpoints/utils/index.ts",
    "content": "export * from \"./customEndpointFunctions\";\nexport * from \"./evaluateRules\";\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/EventStreamSerde.spec.ts",
    "content": "import { CborCodec, cbor, dateToTag } from \"@smithy/core/cbor\";\nimport { HttpResponse } from \"@smithy/core/protocols\";\nimport { NormalizedSchema } from \"@smithy/core/schema\";\nimport { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nimport type {\n  BlobSchema,\n  BooleanSchema,\n  Message as EventMessage,\n  NumericSchema,\n  StaticSimpleSchema,\n  StaticStructureSchema,\n  StringSchema,\n  TimestampEpochSecondsSchema,\n} from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { EventStreamSerde } from \"./EventStreamSerde\";\nimport { EventStreamMarshaller } from \"./eventstream-serde/EventStreamMarshaller\";\n\ndescribe(EventStreamSerde.name, () => {\n  describe(\"event stream serde\", () => {\n    const cborCodec = new CborCodec();\n\n    // this represents elements injected by the HttpProtocol caller.\n    // we use the real event stream marshaller (universal) here to get an accurate integration test.\n    const impl = {\n      serializer: cborCodec.createSerializer(),\n      deserializer: cborCodec.createDeserializer(),\n      getEventStreamMarshaller() {\n        return this.serdeContext.eventStreamMarshaller;\n      },\n      serdeContext: {\n        eventStreamMarshaller: new EventStreamMarshaller({\n          utf8Encoder: toUtf8,\n          utf8Decoder: fromUtf8,\n        }),\n      },\n      getDefaultContentType() {\n        return \"application/cbor\";\n      },\n    };\n\n    const eventStreamSerde = new EventStreamSerde({\n      marshaller: impl.getEventStreamMarshaller(),\n      serializer: impl.serializer,\n      deserializer: impl.deserializer,\n      defaultContentType: impl.getDefaultContentType(),\n    });\n\n    const eventStreamUnionSchema = [\n      3,\n      \"ns\",\n      \"EventStreamStructure\",\n      { streaming: 1 },\n      [\"A\", \"B\", \"C\", \"Payload\", \"TextPayload\", \"CustomHeaders\", \"NoOp\"],\n      // D is omitted to represent an unknown event.\n      [\n        [3, \"ns\", \"A\", 0, [\"name\"], [0]] satisfies StaticStructureSchema,\n        [3, \"ns\", \"B\", 0, [\"name\"], [0]] satisfies StaticStructureSchema,\n        [3, \"ns\", \"C\", 0, [\"name\"], [0]] satisfies StaticStructureSchema,\n        [\n          3,\n          \"ns\",\n          \"Payload\",\n          0,\n          [\"payload\"],\n          [[0, \"ns\", \"BlobPayload\", { eventPayload: 1 }, 21 satisfies BlobSchema] satisfies StaticSimpleSchema],\n        ],\n        [\n          3,\n          \"ns\",\n          \"TextPayload\",\n          0,\n          [\"payload\"],\n          [[0, \"ns\", \"TextPayload\", { eventPayload: 1 }, 0 satisfies StringSchema] satisfies StaticSimpleSchema],\n        ],\n        [\n          3,\n          \"ns\",\n          \"CustomHeaders\",\n          0,\n          [\"payload\", \"header1\", \"header2\", \"header-date\", \"header-number\", \"header-boolean\", \"header-blob\"],\n          [\n            [0, \"ns\", \"BlobPayload\", { eventPayload: 1 }, 21 satisfies BlobSchema] satisfies StaticSimpleSchema,\n            [0, \"ns\", \"EventHeader\", { eventHeader: 1 }, 0 satisfies StringSchema] satisfies StaticSimpleSchema,\n            [0, \"ns\", \"EventHeader\", { eventHeader: 1 }, 0 satisfies StringSchema] satisfies StaticSimpleSchema,\n\n            [\n              0,\n              \"ns\",\n              \"EventHeader\",\n              { eventHeader: 1 },\n              7 satisfies TimestampEpochSecondsSchema,\n            ] satisfies StaticSimpleSchema,\n            [0, \"ns\", \"EventHeader\", { eventHeader: 1 }, 1 satisfies NumericSchema] satisfies StaticSimpleSchema,\n            [0, \"ns\", \"EventHeader\", { eventHeader: 1 }, 2 satisfies BooleanSchema] satisfies StaticSimpleSchema,\n            [0, \"ns\", \"EventHeader\", { eventHeader: 1 }, 21 satisfies BlobSchema] satisfies StaticSimpleSchema,\n          ],\n        ],\n        [3, \"ns\", \"NoOp\", 0, [], []] satisfies StaticStructureSchema,\n      ],\n    ] satisfies StaticStructureSchema;\n\n    const eventStreamContainerSchema = [\n      3,\n      \"ns\",\n      \"EventStreamContainer\",\n      0,\n      // here the non-eventstream members form an initial-request\n      // or initial-response when present.\n      [\"eventStreamMember\", \"dateMember\", \"blobMember\"],\n      [eventStreamUnionSchema, 7 satisfies TimestampEpochSecondsSchema, 21 satisfies BlobSchema],\n    ] satisfies StaticStructureSchema;\n\n    describe(\"serialization\", () => {\n      async function messageDeserializer(event: Record<string, EventMessage>): Promise<any> {\n        return event;\n      }\n\n      const eventStreamCallerInput = {\n        async *[Symbol.asyncIterator]() {\n          yield { A: { name: \"a\" } };\n          yield { B: { name: \"b\" } };\n          yield { C: { name: \"c\" } };\n          yield { $unknown: [\"D\", { name: \"d\" }] };\n          yield { Payload: { payload: new Uint8Array([0, 1, 2, 3, 4, 5, 6]) } };\n          yield { TextPayload: { payload: \"beep boop\" } };\n          yield {\n            CustomHeaders: {\n              payload: new Uint8Array([0, 1, 2, 3]),\n              header1: \"h1\",\n              header2: \"h2\",\n              \"header-date\": new Date(0),\n              \"header-number\": -2,\n              \"header-boolean\": false,\n              \"header-blob\": new Uint8Array([0, 1, 2, 3]),\n            },\n          };\n        },\n      };\n\n      const canonicalEvents = [\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"A\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"application/cbor\" },\n          },\n          body: { name: \"a\" },\n        },\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"B\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"application/cbor\" },\n          },\n          body: { name: \"b\" },\n        },\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"C\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"application/cbor\" },\n          },\n          body: { name: \"c\" },\n        },\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"D\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"application/cbor\" },\n          },\n          body: { name: \"d\" },\n        },\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"Payload\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"application/octet-stream\" },\n          },\n          body: new Uint8Array([0, 1, 2, 3, 4, 5, 6]),\n        },\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"TextPayload\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"text/plain\" },\n          },\n          body: \"beep boop\",\n        },\n        {\n          headers: {\n            \":event-type\": { type: \"string\", value: \"CustomHeaders\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: \"application/octet-stream\" },\n            header1: { type: \"string\", value: \"h1\" },\n            header2: { type: \"string\", value: \"h2\" },\n            \"header-boolean\": {\n              type: \"boolean\",\n              value: false,\n            },\n            \"header-date\": {\n              type: \"timestamp\",\n              value: new Date(0),\n            },\n            \"header-number\": {\n              type: \"integer\",\n              value: -2,\n            },\n            \"header-blob\": {\n              type: \"binary\",\n              value: new Uint8Array([0, 1, 2, 3]),\n            },\n          },\n          body: new Uint8Array([0, 1, 2, 3]),\n        },\n      ];\n\n      /**\n       * Takes an outgoing request requestBody of event streams,\n       * collects it, and maps to the canonical object form.\n       */\n      async function collectTranslate(requestBody: any) {\n        const reparsed = impl.getEventStreamMarshaller().deserialize(requestBody, messageDeserializer);\n\n        const collect = [];\n        for await (const chunk of reparsed) {\n          collect.push(chunk);\n        }\n\n        return collect.map((item) => {\n          const object = Object.values(item)[0] as any;\n          return {\n            headers: object.headers,\n            body: cbor.deserialize(object.body),\n          };\n        });\n      }\n\n      it(\"serializes event streams\", async () => {\n        const requestBody = await eventStreamSerde.serializeEventStream({\n          eventStream: eventStreamCallerInput,\n          requestSchema: NormalizedSchema.of(eventStreamContainerSchema),\n        });\n\n        expect(await collectTranslate(requestBody)).toEqual(canonicalEvents);\n      });\n\n      it(\"serializes event streams containing an initial-request\", async () => {\n        const requestBody = await eventStreamSerde.serializeEventStream({\n          eventStream: eventStreamCallerInput,\n          requestSchema: NormalizedSchema.of(eventStreamContainerSchema),\n          initialRequest: {\n            dateMember: new Date(0),\n            blobMember: new Uint8Array([0, 1, 2, 3]),\n          },\n        });\n\n        expect(await collectTranslate(requestBody)).toEqual([\n          {\n            headers: {\n              \":event-type\": { type: \"string\", value: \"initial-request\" },\n              \":message-type\": { type: \"string\", value: \"event\" },\n              \":content-type\": { type: \"string\", value: \"application/cbor\" },\n            },\n            body: {\n              blobMember: new Uint8Array([0, 1, 2, 3]),\n              dateMember: dateToTag(new Date(0)),\n            },\n          },\n          ...canonicalEvents,\n        ]);\n      });\n    });\n\n    describe(\"deserialization\", () => {\n      /**\n       * Converts a canonical event to a JS object representation\n       * of an event stream event.\n       */\n      function messageSerializer(event: any): EventMessage {\n        const eventType = Object.keys(event)[0];\n        const data = event[eventType];\n\n        const headerKeys = Object.keys(data).filter((k) => k.startsWith(\"header\"));\n        const headers = {\n          \":message-type\": { type: \"string\", value: \"event\" },\n          \":event-type\": { type: \"string\", value: eventType },\n          \":content-type\": { type: \"string\", value: \"application/cbor\" },\n        } as any;\n\n        for (const key of headerKeys) {\n          const v = data[key];\n          if (v instanceof Date) {\n            headers[key] = {\n              type: \"timestamp\",\n              value: data[key],\n            };\n          } else if (typeof v === \"boolean\") {\n            headers[key] = {\n              type: \"boolean\",\n              value: data[key],\n            };\n          } else if (typeof v === \"string\") {\n            headers[key] = {\n              type: \"string\",\n              value: data[key],\n            };\n          } else if (typeof v === \"number\") {\n            headers[key] = {\n              type: \"integer\",\n              value: v,\n            };\n          } else if (v instanceof Uint8Array) {\n            headers[key] = {\n              type: \"binary\",\n              value: v,\n            };\n          } else {\n            throw new Error(\"unhandled type\");\n          }\n\n          delete data[key];\n        }\n\n        const payload = data.payload;\n        if (payload) {\n          return {\n            headers,\n            body: typeof payload === \"string\" ? fromUtf8(payload) : payload,\n          };\n        }\n\n        if (eventType === \"NoOp\") {\n          return {\n            headers,\n            // simulate omitted structure body.\n            // not technically correct for the content-type, but pre-existing\n            // edge case.\n            body: new Uint8Array(),\n          };\n        }\n\n        return {\n          headers,\n          body: cbor.serialize(data),\n        };\n      }\n\n      const eventStreamMarshaller = impl.getEventStreamMarshaller();\n\n      const canonicalEvents = {\n        async *[Symbol.asyncIterator]() {\n          yield { A: { name: \"a\" } };\n          yield { B: { name: \"b\" } };\n          yield { C: { name: \"c\" } };\n          yield { D: { name: \"d\" } };\n          yield { Payload: { payload: new Uint8Array([0, 1, 2, 3, 4, 5, 6]) } };\n          yield { TextPayload: { payload: \"boop beep\" } };\n          yield {\n            CustomHeaders: {\n              payload: new Uint8Array([0, 1, 2, 3]),\n              header1: \"h1\",\n              header2: \"h2\",\n              \"header-date\": new Date(0),\n              \"header-number\": -2,\n              \"header-boolean\": false,\n              \"header-blob\": new Uint8Array([0, 1, 2, 3]),\n            },\n          };\n          yield {\n            NoOp: {},\n          };\n        },\n      };\n\n      const $unknownEvent = {\n        $unknown: {\n          D: {\n            headers: {\n              \":message-type\": { type: \"string\", value: \"event\" },\n              \":event-type\": { type: \"string\", value: \"D\" },\n              \":content-type\": { type: \"string\", value: \"application/cbor\" },\n            },\n            body: Uint8Array.from(cbor.serialize({ name: \"d\" })),\n          },\n        },\n      };\n      void $unknownEvent;\n\n      async function collect(asyncIterable: AsyncIterable<any>): Promise<any[]> {\n        const collect = [];\n        for await (const event of asyncIterable) {\n          collect.push(event);\n        }\n        return collect;\n      }\n\n      it(\"deserializes event streams\", async () => {\n        const response = new HttpResponse({\n          statusCode: 200,\n          body: eventStreamMarshaller.serialize(canonicalEvents, messageSerializer),\n        });\n\n        const asyncIterable = await eventStreamSerde.deserializeEventStream({\n          response,\n          responseSchema: NormalizedSchema.of(eventStreamContainerSchema),\n        });\n\n        expect(await collect(asyncIterable)).toEqual([\n          { A: { name: `a` } },\n          { B: { name: `b` } },\n          { C: { name: `c` } },\n          // todo(schema) getMessageUnmarshaller.ts must be patched to return unknown events.\n          // $unknownEvent,\n          { Payload: { payload: new Uint8Array([0, 1, 2, 3, 4, 5, 6]) } },\n          { TextPayload: { payload: \"boop beep\" } },\n          {\n            CustomHeaders: {\n              payload: new Uint8Array([0, 1, 2, 3]),\n              header1: \"h1\",\n              header2: \"h2\",\n              \"header-boolean\": false,\n              \"header-date\": new Date(0),\n              \"header-number\": -2,\n              \"header-blob\": new Uint8Array([0, 1, 2, 3]),\n            },\n          },\n          {\n            NoOp: {},\n          },\n        ]);\n      });\n\n      it(\"deserializes event streams containing an initial-response\", async () => {\n        const response = new HttpResponse({\n          statusCode: 200,\n          body: eventStreamMarshaller.serialize(\n            {\n              async *[Symbol.asyncIterator]() {\n                yield {\n                  \"initial-response\": { dateMember: 0, blobMember: \"AAECAw==\" },\n                };\n                for await (const it of canonicalEvents) {\n                  yield it;\n                }\n              },\n            },\n            messageSerializer\n          ),\n        });\n\n        const initialResponseContainer = {} as any;\n\n        const asyncIterable = await eventStreamSerde.deserializeEventStream({\n          response,\n          responseSchema: NormalizedSchema.of(eventStreamContainerSchema),\n          initialResponseContainer,\n        });\n\n        expect(await collect(asyncIterable)).toEqual([\n          { A: { name: `a` } },\n          { B: { name: `b` } },\n          { C: { name: `c` } },\n          // todo(schema) getMessageUnmarshaller.ts must be patched to return unknown events.\n          // $unknownEvent,\n          { Payload: { payload: new Uint8Array([0, 1, 2, 3, 4, 5, 6]) } },\n          { TextPayload: { payload: \"boop beep\" } },\n          {\n            CustomHeaders: {\n              payload: new Uint8Array([0, 1, 2, 3]),\n              header1: \"h1\",\n              header2: \"h2\",\n              \"header-boolean\": false,\n              \"header-date\": new Date(0),\n              \"header-number\": -2,\n              \"header-blob\": new Uint8Array([0, 1, 2, 3]),\n            },\n          },\n          {\n            NoOp: {},\n          },\n        ]);\n\n        expect(initialResponseContainer).toEqual({\n          dateMember: new Date(0),\n          blobMember: new Uint8Array([0, 1, 2, 3]),\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/EventStreamSerde.ts",
    "content": "import type { NormalizedSchema } from \"@smithy/core/schema\";\nimport { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nimport type {\n  DocumentSchema,\n  EventStreamMarshaller,\n  Message as EventStreamMessage,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  Int64,\n  MessageHeaderValue,\n  MessageHeaders,\n  SerdeFunctions,\n  ShapeDeserializer,\n  ShapeSerializer,\n  StaticStructureSchema,\n} from \"@smithy/types\";\n\n/**\n * Separated module for async mixin of EventStream serde capability.\n * This is used by the HttpProtocol base class from \\@smithy/core/protocols.\n *\n * @public\n */\nexport class EventStreamSerde {\n  private readonly marshaller: EventStreamMarshaller;\n  private readonly serializer: ShapeSerializer<string | Uint8Array>;\n  private readonly deserializer: ShapeDeserializer<string | Uint8Array>;\n  private readonly serdeContext?: SerdeFunctions;\n  private readonly defaultContentType: string;\n\n  /**\n   * Properties are injected by the HttpProtocol.\n   */\n  public constructor({\n    marshaller,\n    serializer,\n    deserializer,\n    serdeContext,\n    defaultContentType,\n  }: {\n    marshaller: EventStreamMarshaller;\n    serializer: ShapeSerializer<string | Uint8Array>;\n    deserializer: ShapeDeserializer<string | Uint8Array>;\n    serdeContext?: SerdeFunctions;\n    defaultContentType: string;\n  }) {\n    this.marshaller = marshaller;\n    this.serializer = serializer;\n    this.deserializer = deserializer;\n    this.serdeContext = serdeContext;\n    this.defaultContentType = defaultContentType;\n  }\n\n  /**\n   * @param eventStream - the iterable provided by the caller.\n   * @param requestSchema - the schema of the event stream container (struct).\n   * @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).\n   *\n   * @returns a stream suitable for the HTTP body of a request.\n   */\n  public async serializeEventStream({\n    eventStream,\n    requestSchema,\n    initialRequest,\n  }: {\n    eventStream: AsyncIterable<any>;\n    requestSchema: NormalizedSchema;\n    initialRequest?: any;\n  }): Promise<IHttpRequest[\"body\"] | Uint8Array> {\n    const marshaller = this.marshaller;\n    const eventStreamMember = requestSchema.getEventStreamMember();\n    const unionSchema = requestSchema.getMemberSchema(eventStreamMember);\n\n    const serializer = this.serializer;\n    const defaultContentType = this.defaultContentType;\n\n    const initialRequestMarker = Symbol(\"initialRequestMarker\");\n\n    const eventStreamIterable: AsyncIterable<any> = {\n      async *[Symbol.asyncIterator]() {\n        if (initialRequest) {\n          const headers: MessageHeaders = {\n            \":event-type\": { type: \"string\", value: \"initial-request\" },\n            \":message-type\": { type: \"string\", value: \"event\" },\n            \":content-type\": { type: \"string\", value: defaultContentType },\n          };\n          serializer.write(requestSchema, initialRequest);\n          const body = serializer.flush();\n          yield {\n            [initialRequestMarker]: true,\n            headers,\n            body,\n          };\n        }\n\n        for await (const page of eventStream) {\n          yield page;\n        }\n      },\n    };\n\n    return marshaller.serialize(eventStreamIterable, (event: any): EventStreamMessage => {\n      if (event[initialRequestMarker]) {\n        return {\n          headers: event.headers,\n          body: event.body,\n        };\n      }\n\n      let unionMember = \"\";\n      for (const key in event) {\n        if (key !== \"__type\") {\n          unionMember = key;\n          break;\n        }\n      }\n      const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(\n        unionMember,\n        unionSchema,\n        event\n      );\n\n      const headers: MessageHeaders = {\n        \":event-type\": { type: \"string\", value: eventType },\n        \":message-type\": { type: \"string\", value: \"event\" },\n        \":content-type\": { type: \"string\", value: explicitPayloadContentType ?? defaultContentType },\n        ...additionalHeaders,\n      };\n\n      return {\n        headers,\n        body,\n      };\n    });\n  }\n\n  /**\n   * @param response - http response from which to read the event stream.\n   * @param unionSchema - schema of the event stream container (struct).\n   * @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).\n   *\n   * @returns the asyncIterable of the event stream for the end-user.\n   */\n  public async deserializeEventStream({\n    response,\n    responseSchema,\n    initialResponseContainer,\n  }: {\n    response: IHttpResponse;\n    responseSchema: NormalizedSchema;\n    initialResponseContainer?: any;\n  }): Promise<AsyncIterable<{ [key: string]: any; $unknown?: unknown }>> {\n    const marshaller = this.marshaller;\n    const eventStreamMember = responseSchema.getEventStreamMember();\n    const unionSchema = responseSchema.getMemberSchema(eventStreamMember);\n    const memberSchemas = unionSchema.getMemberSchemas();\n\n    const initialResponseMarker = Symbol(\"initialResponseMarker\");\n\n    const asyncIterable = marshaller.deserialize(response.body, async (event) => {\n      let unionMember = \"\";\n      for (const key in event) {\n        if (key !== \"__type\") {\n          unionMember = key;\n          break;\n        }\n      }\n\n      const body = event[unionMember].body;\n\n      if (unionMember === \"initial-response\") {\n        const dataObject = await this.deserializer.read(responseSchema, body);\n        delete dataObject[eventStreamMember];\n        return {\n          [initialResponseMarker]: true,\n          ...dataObject,\n        };\n      } else if (unionMember in memberSchemas) {\n        const eventStreamSchema = memberSchemas[unionMember];\n\n        if (eventStreamSchema.isStructSchema()) {\n          // check for event stream bindings\n          const out = {} as any;\n          let hasBindings = false;\n\n          for (const [name, member] of eventStreamSchema.structIterator()) {\n            const { eventHeader, eventPayload } = member.getMergedTraits();\n            hasBindings = hasBindings || Boolean(eventHeader || eventPayload);\n            if (eventPayload) {\n              // https://smithy.io/2.0/spec/streaming.html#eventpayload-trait\n              // structure > :test(member > :test(blob, string, structure, union))\n              if (member.isBlobSchema()) {\n                out[name] = body;\n              } else if (member.isStringSchema()) {\n                out[name] = (this.serdeContext?.utf8Encoder ?? toUtf8)(body);\n              } else if (member.isStructSchema()) {\n                out[name] = await this.deserializer.read(member, body);\n              }\n            } else if (eventHeader) {\n              const value = event[unionMember].headers[name]?.value;\n              if (value != null) {\n                if (member.isNumericSchema()) {\n                  if (value && typeof value === \"object\" && \"bytes\" in (value as Int64)) {\n                    out[name] = BigInt(value.toString());\n                  } else {\n                    out[name] = Number(value);\n                  }\n                } else {\n                  out[name] = value;\n                }\n              }\n            }\n          }\n\n          if (hasBindings) {\n            return {\n              [unionMember]: out,\n            };\n          }\n          if (body.byteLength === 0) {\n            // This isn't correct w.r.t. the content-type,\n            // since 0-length data is neither valid JSON nor CBOR,\n            // but handles an existing compatibility issue in server-side implementations.\n            return {\n              [unionMember]: {},\n            };\n          }\n        }\n\n        return {\n          [unionMember]: await this.deserializer.read(eventStreamSchema, body),\n        };\n      } else {\n        // todo(schema): This union convention is ignored by the event stream marshaller.\n        // todo(schema): This should be returned to the user instead.\n        // see \"if (deserialized.$unknown) return;\" in getUnmarshalledStream.ts\n        return {\n          $unknown: event,\n        };\n      }\n    });\n\n    const asyncIterator = asyncIterable[Symbol.asyncIterator]();\n    const firstEvent = await asyncIterator.next();\n\n    if (firstEvent.done) {\n      return asyncIterable;\n    }\n\n    if (firstEvent.value?.[initialResponseMarker]) {\n      // if the initial response is part of the event stream, we assume\n      // that the response schema was provided because RpcProtocols are the only ones\n      // that act in this way.\n      if (!responseSchema) {\n        throw new Error(\n          \"@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.\"\n        );\n      }\n\n      for (const key in firstEvent.value) {\n        initialResponseContainer[key] = firstEvent.value[key];\n      }\n    }\n\n    return {\n      async *[Symbol.asyncIterator]() {\n        if (!firstEvent?.value?.[initialResponseMarker]) {\n          yield firstEvent.value;\n        }\n        while (true) {\n          const { done, value } = await asyncIterator.next();\n          if (done) {\n            break;\n          }\n          yield value;\n        }\n      },\n    };\n  }\n\n  /**\n   * @param unionMember - member name within the structure that contains an event stream union.\n   * @param unionSchema - schema of the union.\n   * @param event\n   *\n   * @returns the event body (bytes) and event type (string).\n   */\n  private writeEventBody(unionMember: string, unionSchema: NormalizedSchema, event: any) {\n    const serializer = this.serializer;\n    let eventType = unionMember;\n    let explicitPayloadMember = null as null | string;\n    let explicitPayloadContentType: undefined | string;\n\n    const isKnownSchema = (() => {\n      const struct = unionSchema.getSchema() as StaticStructureSchema;\n      return struct[4].includes(unionMember);\n    })();\n    const additionalHeaders: MessageHeaders = {};\n\n    if (!isKnownSchema) {\n      // $unknown member\n      const [type, value] = event[unionMember];\n      eventType = type;\n      serializer.write(15 satisfies DocumentSchema, value);\n    } else {\n      const eventSchema = unionSchema.getMemberSchema(unionMember);\n\n      if (eventSchema.isStructSchema()) {\n        for (const [memberName, memberSchema] of eventSchema.structIterator()) {\n          const { eventHeader, eventPayload } = memberSchema.getMergedTraits();\n\n          if (eventPayload) {\n            explicitPayloadMember = memberName;\n          } else if (eventHeader) {\n            const value = event[unionMember][memberName];\n            let type = \"binary\" as MessageHeaderValue[\"type\"];\n            if (memberSchema.isNumericSchema()) {\n              if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) {\n                type = \"integer\";\n              } else {\n                type = \"long\";\n              }\n            } else if (memberSchema.isTimestampSchema()) {\n              type = \"timestamp\";\n            } else if (memberSchema.isStringSchema()) {\n              type = \"string\";\n            } else if (memberSchema.isBooleanSchema()) {\n              type = \"boolean\";\n            }\n\n            if (value != null) {\n              additionalHeaders[memberName] = {\n                type,\n                value,\n              };\n              delete event[unionMember][memberName];\n            }\n          }\n        }\n\n        if (explicitPayloadMember !== null) {\n          const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember);\n          if (payloadSchema.isBlobSchema()) {\n            explicitPayloadContentType = \"application/octet-stream\";\n          } else if (payloadSchema.isStringSchema()) {\n            explicitPayloadContentType = \"text/plain\";\n          }\n          serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]);\n        } else {\n          serializer.write(eventSchema, event[unionMember]);\n        }\n      } else if (eventSchema.isUnitSchema()) {\n        serializer.write(eventSchema, {});\n      } else {\n        throw new Error(\"@smithy/core/event-streams - non-struct member not supported in event stream union.\");\n      }\n    }\n\n    const messageSerialization: string | Uint8Array = serializer.flush() ?? new Uint8Array();\n\n    const body =\n      typeof messageSerialization === \"string\"\n        ? (this.serdeContext?.utf8Decoder ?? fromUtf8)(messageSerialization)\n        : messageSerialization;\n\n    return {\n      body,\n      eventType,\n      explicitPayloadContentType,\n      additionalHeaders,\n    };\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/event-streams`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-hex-encoding@4.2.2\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n  - @smithy/util-hex-encoding@4.2.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n  - @smithy/util-hex-encoding@4.2.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-hex-encoding@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n  - @smithy/util-hex-encoding@4.0.0\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.1.0\n\n### Minor Changes\n\n- 3c23a83b: update versions of @aws-crypto/\\* packages\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-hex-encoding@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/util-hex-encoding@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n  - @smithy/util-hex-encoding@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-hex-encoding@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-hex-encoding@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n  - @smithy/util-hex-encoding@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-hex-encoding@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-hex-encoding@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/eventstream-codec](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/eventstream-codec/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/EventStreamCodec.spec.ts",
    "content": "import { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { EventStreamCodec } from \"./EventStreamCodec\";\nimport { vectors } from \"./TestVectors.fixture\";\n\ndescribe(\"eventstream parsing\", () => {\n  const eventStreamCodec = new EventStreamCodec(toUtf8, fromUtf8);\n\n  for (const vectorName of Object.keys(vectors)) {\n    const vector = vectors[vectorName];\n    it(`should handle the ${vectorName} test case`, () => {\n      if (vector.expectation === \"failure\") {\n        expect(() => eventStreamCodec.decode(vector.encoded)).toThrow();\n      } else {\n        expect(eventStreamCodec.encode(vector.decoded)).toEqual(vector.encoded);\n        expect(eventStreamCodec.decode(vector.encoded)).toEqual(vector.decoded);\n      }\n    });\n  }\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/EventStreamCodec.ts",
    "content": "import { Crc32 } from \"@aws-crypto/crc32\";\nimport type {\n  AvailableMessage,\n  AvailableMessages,\n  Decoder,\n  Encoder,\n  Message,\n  MessageDecoder,\n  MessageEncoder,\n  MessageHeaders,\n} from \"@smithy/types\";\n\nimport { HeaderMarshaller } from \"./HeaderMarshaller\";\nimport { splitMessage } from \"./splitMessage\";\n\n/**\n * A Codec that can convert binary-packed event stream messages into\n * JavaScript objects and back again into their binary format.\n */\nexport class EventStreamCodec implements MessageEncoder, MessageDecoder {\n  private readonly headerMarshaller: HeaderMarshaller;\n  private messageBuffer: Message[];\n\n  private isEndOfStream: boolean;\n\n  constructor(toUtf8: Encoder, fromUtf8: Decoder) {\n    this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);\n    this.messageBuffer = [];\n    this.isEndOfStream = false;\n  }\n\n  feed(message: ArrayBufferView): void {\n    this.messageBuffer.push(this.decode(message));\n  }\n\n  endOfStream(): void {\n    this.isEndOfStream = true;\n  }\n\n  getMessage(): AvailableMessage {\n    const message = this.messageBuffer.pop();\n    const isEndOfStream = this.isEndOfStream;\n\n    return {\n      getMessage(): Message | undefined {\n        return message;\n      },\n      isEndOfStream(): boolean {\n        return isEndOfStream;\n      },\n    };\n  }\n\n  getAvailableMessages(): AvailableMessages {\n    const messages = this.messageBuffer;\n    this.messageBuffer = [];\n    const isEndOfStream = this.isEndOfStream;\n\n    return {\n      getMessages(): Message[] {\n        return messages;\n      },\n      isEndOfStream(): boolean {\n        return isEndOfStream;\n      },\n    };\n  }\n\n  /**\n   * Convert a structured JavaScript object with tagged headers into a binary\n   * event stream message.\n   */\n  encode({ headers: rawHeaders, body }: Message): Uint8Array {\n    const headers = this.headerMarshaller.format(rawHeaders);\n    const length = headers.byteLength + body.byteLength + 16;\n\n    const out = new Uint8Array(length);\n    const view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n    const checksum = new Crc32();\n\n    // Format message\n    view.setUint32(0, length, false);\n    view.setUint32(4, headers.byteLength, false);\n    view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);\n    out.set(headers, 12);\n    out.set(body, headers.byteLength + 12);\n\n    // Write trailing message checksum\n    view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);\n\n    return out;\n  }\n\n  /**\n   * Convert a binary event stream message into a JavaScript object with an\n   * opaque, binary body and tagged, parsed headers.\n   */\n  decode(message: ArrayBufferView): Message {\n    const { headers, body } = splitMessage(message);\n\n    return { headers: this.headerMarshaller.parse(headers), body };\n  }\n\n  /**\n   * Convert a structured JavaScript object with tagged headers into a binary\n   * event stream message header.\n   */\n  formatHeaders(rawHeaders: MessageHeaders): Uint8Array {\n    return this.headerMarshaller.format(rawHeaders);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/HeaderMarshaller.spec.ts",
    "content": "import { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nimport type { MessageHeaders } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { HeaderMarshaller } from \"./HeaderMarshaller\";\nimport { Int64 } from \"./Int64\";\n\ndescribe(\"HeaderMarshaller\", () => {\n  const marshaller = new HeaderMarshaller(toUtf8, fromUtf8);\n  const name = Uint8Array.from([0x04, 0xf0, 0x9f, 0xa6, 0x84]);\n\n  const testCases: Array<[string, Uint8Array, MessageHeaders]> = [\n    [\n      \"boolean true headers\",\n      Uint8Array.from([...name, 0]),\n      {\n        \"🦄\": {\n          type: \"boolean\",\n          value: true,\n        },\n      },\n    ],\n    [\n      \"boolean false headers\",\n      Uint8Array.from([...name, 1]),\n      {\n        \"🦄\": {\n          type: \"boolean\",\n          value: false,\n        },\n      },\n    ],\n    [\n      \"byte headers\",\n      Uint8Array.from([...name, 2, 0x7f]),\n      {\n        \"🦄\": {\n          type: \"byte\",\n          value: 127,\n        },\n      },\n    ],\n    [\n      \"short headers\",\n      Uint8Array.from([...name, 3, 0x7f, 0xff]),\n      {\n        \"🦄\": {\n          type: \"short\",\n          value: 32767,\n        },\n      },\n    ],\n    [\n      \"integer headers\",\n      Uint8Array.from([...name, 4, 0x7f, 0xff, 0xff, 0xff]),\n      {\n        \"🦄\": {\n          type: \"integer\",\n          value: 2147483647,\n        },\n      },\n    ],\n    [\n      \"long headers\",\n      Uint8Array.from([...name, 5, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),\n      {\n        \"🦄\": {\n          type: \"long\",\n          value: new Int64(Uint8Array.from([0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])),\n        },\n      },\n    ],\n    [\n      \"binary headers\",\n      Uint8Array.from([...name, 6, 0x00, 0x08, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe]),\n      {\n        \"🦄\": {\n          type: \"binary\",\n          value: Uint8Array.from([0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe]),\n        },\n      },\n    ],\n    [\n      \"string headers\",\n      Uint8Array.from([\n        ...name,\n        7,\n        0x00,\n        0x2e,\n        0xd8,\n        0xaf,\n        0xd8,\n        0xb3,\n        0xd8,\n        0xaa,\n        0xe2,\n        0x80,\n        0x8c,\n        0xd9,\n        0x86,\n        0xd9,\n        0x88,\n        0xd8,\n        0xb4,\n        0xd8,\n        0xaa,\n        0xd9,\n        0x87,\n        0xe2,\n        0x80,\n        0x8c,\n        0xd9,\n        0x87,\n        0xd8,\n        0xa7,\n        0x20,\n        0xd9,\n        0x86,\n        0xd9,\n        0x85,\n        0xdb,\n        0x8c,\n        0xe2,\n        0x80,\n        0x8c,\n        0xd8,\n        0xb3,\n        0xd9,\n        0x88,\n        0xd8,\n        0xb2,\n        0xd9,\n        0x86,\n        0xd8,\n        0xaf,\n      ]),\n      {\n        \"🦄\": {\n          type: \"string\",\n          value: \"دست‌نوشته‌ها نمی‌سوزند\",\n        },\n      },\n    ],\n    [\n      \"timestamp headers\",\n      Uint8Array.from([...name, 8, 0x00, 0x00, 0x01, 0x61, 0x97, 0x16, 0xac, 0xc2]),\n      {\n        \"🦄\": {\n          type: \"timestamp\",\n          value: new Date(1518658301122),\n        },\n      },\n    ],\n    [\n      \"UUID headers\",\n      Uint8Array.from([\n        ...name,\n        9,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n      ]),\n      {\n        \"🦄\": {\n          type: \"uuid\",\n          value: \"ffffffff-ffff-ffff-ffff-ffffffffffff\",\n        },\n      },\n    ],\n    [\n      \"a sequence of headers\",\n      Uint8Array.from([\n        0x04, 0xf0, 0x9f, 0xa6, 0x84, 0x06, 0x00, 0x04, 0xde, 0xad, 0xbe, 0xef, 0x04, 0xf0, 0x9f, 0x8f, 0x87, 0x00,\n        0x04, 0xf0, 0x9f, 0x90, 0x8e, 0x07, 0x00, 0x07, 0xe2, 0x98, 0x83, 0xf0, 0x9f, 0x92, 0xa9, 0x04, 0xf0, 0x9f,\n        0x90, 0xb4, 0x01,\n      ]),\n      {\n        \"🦄\": {\n          type: \"binary\",\n          value: Uint8Array.from([0xde, 0xad, 0xbe, 0xef]),\n        },\n        \"🏇\": {\n          type: \"boolean\",\n          value: true,\n        },\n        \"🐎\": {\n          type: \"string\",\n          value: \"☃💩\",\n        },\n        \"🐴\": {\n          type: \"boolean\",\n          value: false,\n        },\n      },\n    ],\n  ];\n\n  describe(\"#format\", () => {\n    for (const [description, encoded, decoded] of testCases) {\n      it(`should format ${description}`, () => {\n        expect(marshaller.format(decoded)).toEqual(encoded);\n      });\n    }\n\n    it(\"should throw if it receives an invalid UUID\", () => {\n      expect(() =>\n        marshaller.format({\n          uuid: {\n            type: \"uuid\",\n            value: \"foo\",\n          },\n        })\n      ).toThrowError(\"Invalid UUID received\");\n    });\n  });\n\n  describe(\"#parse\", () => {\n    for (const [description, encoded, decoded] of testCases) {\n      it(`should parse ${description}`, () => {\n        expect(marshaller.parse(new DataView(encoded.buffer))).toEqual(decoded);\n      });\n    }\n\n    it(\"should throw when unrecognized header types are encountered\", () => {\n      const header = Uint8Array.from([...name, 10]);\n\n      expect(() => marshaller.parse(new DataView(header.buffer))).toThrowError(\"Unrecognized header type tag\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/HeaderMarshaller.ts",
    "content": "import { fromHex, toHex } from \"@smithy/core/serde\";\nimport type { Decoder, Encoder, MessageHeaderValue, MessageHeaders } from \"@smithy/types\";\n\nimport { Int64 } from \"./Int64\";\n\n/**\n * @internal\n */\nexport class HeaderMarshaller {\n  constructor(\n    private readonly toUtf8: Encoder,\n    private readonly fromUtf8: Decoder\n  ) {}\n\n  format(headers: MessageHeaders): Uint8Array {\n    const chunks: Array<Uint8Array> = [];\n\n    for (const headerName of Object.keys(headers)) {\n      const bytes = this.fromUtf8(headerName);\n      chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n    }\n\n    const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n    let position = 0;\n    for (const chunk of chunks) {\n      out.set(chunk, position);\n      position += chunk.byteLength;\n    }\n\n    return out;\n  }\n\n  private formatHeaderValue(header: MessageHeaderValue): Uint8Array {\n    switch (header.type) {\n      case \"boolean\":\n        return Uint8Array.from([header.value ? HEADER_VALUE_TYPE.boolTrue : HEADER_VALUE_TYPE.boolFalse]);\n      case \"byte\":\n        return Uint8Array.from([HEADER_VALUE_TYPE.byte, header.value]);\n      case \"short\":\n        const shortView = new DataView(new ArrayBuffer(3));\n        shortView.setUint8(0, HEADER_VALUE_TYPE.short);\n        shortView.setInt16(1, header.value, false);\n        return new Uint8Array(shortView.buffer);\n      case \"integer\":\n        const intView = new DataView(new ArrayBuffer(5));\n        intView.setUint8(0, HEADER_VALUE_TYPE.integer);\n        intView.setInt32(1, header.value, false);\n        return new Uint8Array(intView.buffer);\n      case \"long\":\n        const longBytes = new Uint8Array(9);\n        longBytes[0] = HEADER_VALUE_TYPE.long;\n        longBytes.set(header.value.bytes, 1);\n        return longBytes;\n      case \"binary\":\n        const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n        binView.setUint8(0, HEADER_VALUE_TYPE.byteArray);\n        binView.setUint16(1, header.value.byteLength, false);\n        const binBytes = new Uint8Array(binView.buffer);\n        binBytes.set(header.value, 3);\n        return binBytes;\n      case \"string\":\n        const utf8Bytes = this.fromUtf8(header.value);\n        const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n        strView.setUint8(0, HEADER_VALUE_TYPE.string);\n        strView.setUint16(1, utf8Bytes.byteLength, false);\n        const strBytes = new Uint8Array(strView.buffer);\n        strBytes.set(utf8Bytes, 3);\n        return strBytes;\n      case \"timestamp\":\n        const tsBytes = new Uint8Array(9);\n        tsBytes[0] = HEADER_VALUE_TYPE.timestamp;\n        tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n        return tsBytes;\n      case \"uuid\":\n        if (!UUID_PATTERN.test(header.value)) {\n          throw new Error(`Invalid UUID received: ${header.value}`);\n        }\n\n        const uuidBytes = new Uint8Array(17);\n        uuidBytes[0] = HEADER_VALUE_TYPE.uuid;\n        uuidBytes.set(fromHex(header.value.replace(/\\-/g, \"\")), 1);\n        return uuidBytes;\n    }\n  }\n\n  parse(headers: DataView): MessageHeaders {\n    const out: MessageHeaders = {};\n    let position = 0;\n\n    while (position < headers.byteLength) {\n      const nameLength = headers.getUint8(position++);\n      const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));\n      position += nameLength;\n\n      switch (headers.getUint8(position++)) {\n        case HEADER_VALUE_TYPE.boolTrue:\n          out[name] = {\n            type: BOOLEAN_TAG,\n            value: true,\n          };\n          break;\n        case HEADER_VALUE_TYPE.boolFalse:\n          out[name] = {\n            type: BOOLEAN_TAG,\n            value: false,\n          };\n          break;\n        case HEADER_VALUE_TYPE.byte:\n          out[name] = {\n            type: BYTE_TAG,\n            value: headers.getInt8(position++),\n          };\n          break;\n        case HEADER_VALUE_TYPE.short:\n          out[name] = {\n            type: SHORT_TAG,\n            value: headers.getInt16(position, false),\n          };\n          position += 2;\n          break;\n        case HEADER_VALUE_TYPE.integer:\n          out[name] = {\n            type: INT_TAG,\n            value: headers.getInt32(position, false),\n          };\n          position += 4;\n          break;\n        case HEADER_VALUE_TYPE.long:\n          out[name] = {\n            type: LONG_TAG,\n            value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),\n          };\n          position += 8;\n          break;\n        case HEADER_VALUE_TYPE.byteArray:\n          const binaryLength = headers.getUint16(position, false);\n          position += 2;\n          out[name] = {\n            type: BINARY_TAG,\n            value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength),\n          };\n          position += binaryLength;\n          break;\n        case HEADER_VALUE_TYPE.string:\n          const stringLength = headers.getUint16(position, false);\n          position += 2;\n          out[name] = {\n            type: STRING_TAG,\n            value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)),\n          };\n          position += stringLength;\n          break;\n        case HEADER_VALUE_TYPE.timestamp:\n          out[name] = {\n            type: TIMESTAMP_TAG,\n            value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),\n          };\n          position += 8;\n          break;\n        case HEADER_VALUE_TYPE.uuid:\n          const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);\n          position += 16;\n          out[name] = {\n            type: UUID_TAG,\n            value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(\n              uuidBytes.subarray(6, 8)\n            )}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,\n          };\n          break;\n        default:\n          throw new Error(`Unrecognized header type tag`);\n      }\n    }\n\n    return out;\n  }\n}\n\nconst enum HEADER_VALUE_TYPE {\n  boolTrue = 0,\n  boolFalse,\n  byte,\n  short,\n  integer,\n  long,\n  byteArray,\n  string,\n  timestamp,\n  uuid,\n}\n\nconst BOOLEAN_TAG = \"boolean\";\nconst BYTE_TAG = \"byte\";\nconst SHORT_TAG = \"short\";\nconst INT_TAG = \"integer\";\nconst LONG_TAG = \"long\";\nconst BINARY_TAG = \"binary\";\nconst STRING_TAG = \"string\";\nconst TIMESTAMP_TAG = \"timestamp\";\nconst UUID_TAG = \"uuid\";\n\nconst UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/Int64.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { Int64 } from \"./Int64\";\n\ndescribe(\"Int64\", () => {\n  it(\"should hold integers greater than Number.MAX_SAFE_INTEGER without losing precision\", () => {\n    const bytes = Uint8Array.from([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]);\n\n    expect(new Int64(bytes).bytes).toEqual(bytes);\n  });\n\n  it(\"should allow the use of Int64s in arithmetic expressions\", () => {\n    const bytes = Uint8Array.from([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10]);\n\n    expect((new Int64(bytes) as any) + 4).toBe(20);\n  });\n\n  it(\"should allow the use of negative Int64s in arithmetic expressions\", () => {\n    const bytes = Uint8Array.from([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);\n\n    expect((new Int64(bytes) as any) + 2 ** 52).toBe(0);\n  });\n\n  it(\"should stringify negative Int64s in base 10\", () => {\n    const bytes = Uint8Array.from([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe2]);\n\n    expect(String(new Int64(bytes))).toBe(\"-30\");\n  });\n\n  it(\"should throw when given a buffer of the wrong byte length\", () => {\n    expect(() => new Int64(new Uint8Array(0))).toThrow();\n  });\n\n  it(\"should convert numbers into Int64 values\", () => {\n    expect(Int64.fromNumber(2147483647).bytes).toEqual(\n      Uint8Array.from([0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff])\n    );\n  });\n\n  it(\"should convert negative numbers into Int64 values\", () => {\n    expect(Int64.fromNumber(-2147483647).bytes).toEqual(\n      Uint8Array.from([0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x01])\n    );\n  });\n\n  it(\"should throw when a number larger than 2^63 -1 is provided\", () => {\n    // eslint-disable-next-line @typescript-eslint/no-loss-of-precision\n    expect(() => Int64.fromNumber(9_323_372_036_854_775_807)).toThrow();\n  });\n\n  it(\"should throw when a number smaller than -1 * 2^63 is provided\", () => {\n    // eslint-disable-next-line @typescript-eslint/no-loss-of-precision\n    expect(() => Int64.fromNumber(-9_323_372_036_854_775_807)).toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/Int64.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport { toHex } from \"@smithy/core/serde\";\nimport type { Int64 as IInt64 } from \"@smithy/types\";\n\nexport interface Int64 extends IInt64 {}\n\n/**\n * A lossless representation of a signed, 64-bit integer. Instances of this\n * class may be used in arithmetic expressions as if they were numeric\n * primitives, but the binary representation will be preserved unchanged as the\n * `bytes` property of the object. The bytes should be encoded as big-endian,\n * two's complement integers.\n */\nexport class Int64 {\n  constructor(readonly bytes: Uint8Array) {\n    if (bytes.byteLength !== 8) {\n      throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n    }\n  }\n\n  static fromNumber(number: number): Int64 {\n    // eslint-disable-next-line @typescript-eslint/no-loss-of-precision\n    if (number > 9_223_372_036_854_775_807 || number < -9_223_372_036_854_775_808) {\n      throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n    }\n\n    const bytes = new Uint8Array(8);\n    for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n      bytes[i] = remaining;\n    }\n\n    if (number < 0) {\n      negate(bytes);\n    }\n\n    return new Int64(bytes);\n  }\n\n  /**\n   * Called implicitly by infix arithmetic operators.\n   */\n  valueOf(): number {\n    const bytes = this.bytes.slice(0);\n    const negative = bytes[0] & 0b10000000;\n    if (negative) {\n      negate(bytes);\n    }\n\n    return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);\n  }\n\n  toString() {\n    return String(this.valueOf());\n  }\n}\n\nfunction negate(bytes: Uint8Array): void {\n  for (let i = 0; i < 8; i++) {\n    bytes[i] ^= 0xff;\n  }\n\n  for (let i = 7; i > -1; i--) {\n    bytes[i]++;\n    if (bytes[i] !== 0) break;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/Message.ts",
    "content": "import type { Int64 } from \"./Int64\";\n\n/**\n * An event stream message. The headers and body properties will always be\n * defined, with empty headers represented as an object with no keys and an\n * empty body represented as a zero-length Uint8Array.\n */\nexport interface Message {\n  headers: MessageHeaders;\n  body: Uint8Array;\n}\n\nexport type MessageHeaders = Record<string, MessageHeaderValue>;\n\ntype HeaderValue<K extends string, V> = { type: K; value: V };\n\nexport type BooleanHeaderValue = HeaderValue<\"boolean\", boolean>;\nexport type ByteHeaderValue = HeaderValue<\"byte\", number>;\nexport type ShortHeaderValue = HeaderValue<\"short\", number>;\nexport type IntegerHeaderValue = HeaderValue<\"integer\", number>;\nexport type LongHeaderValue = HeaderValue<\"long\", Int64>;\nexport type BinaryHeaderValue = HeaderValue<\"binary\", Uint8Array>;\nexport type StringHeaderValue = HeaderValue<\"string\", string>;\nexport type TimestampHeaderValue = HeaderValue<\"timestamp\", Date>;\nexport type UuidHeaderValue = HeaderValue<\"uuid\", string>;\n\nexport type MessageHeaderValue =\n  | BooleanHeaderValue\n  | ByteHeaderValue\n  | ShortHeaderValue\n  | IntegerHeaderValue\n  | LongHeaderValue\n  | BinaryHeaderValue\n  | StringHeaderValue\n  | TimestampHeaderValue\n  | UuidHeaderValue;\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/MessageDecoderStream.spec.ts",
    "content": "import type { Message } from \"@smithy/types\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { MessageDecoderStream } from \"./MessageDecoderStream\";\n\ndescribe(\"MessageDecoderStream\", () => {\n  it(\"returns decoded messages\", async () => {\n    const message1 = {\n      headers: {},\n      body: new Uint8Array(1),\n    };\n\n    const message2 = {\n      headers: {},\n      body: new Uint8Array(2),\n    };\n\n    const messageDecoderMock = {\n      decode: vi.fn().mockReturnValueOnce(message1).mockReturnValueOnce(message2),\n      feed: vi.fn(),\n      endOfStream: vi.fn(),\n      getMessage: vi.fn(),\n      getAvailableMessages: vi.fn(),\n    };\n\n    const inputStream = async function* () {\n      yield new Uint8Array(0);\n      yield new Uint8Array(1);\n    };\n\n    const messageDecoderStream = new MessageDecoderStream({\n      decoder: messageDecoderMock,\n      inputStream: inputStream(),\n    });\n\n    const messages: Array<Message> = [];\n    for await (const message of messageDecoderStream) {\n      messages.push(message);\n    }\n    expect(messages.length).toEqual(2);\n    expect(messages[0]).toEqual(message1);\n    expect(messages[1]).toEqual(message2);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/MessageDecoderStream.ts",
    "content": "import type { Message, MessageDecoder } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface MessageDecoderStreamOptions {\n  inputStream: AsyncIterable<Uint8Array>;\n  decoder: MessageDecoder;\n}\n\n/**\n * @internal\n */\nexport class MessageDecoderStream implements AsyncIterable<Message> {\n  constructor(private readonly options: MessageDecoderStreamOptions) {}\n\n  [Symbol.asyncIterator](): AsyncIterator<Message> {\n    return this.asyncIterator();\n  }\n\n  private async *asyncIterator() {\n    for await (const bytes of this.options.inputStream) {\n      const decoded = this.options.decoder.decode(bytes);\n      yield decoded;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/MessageEncoderStream.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { MessageEncoderStream } from \"./MessageEncoderStream\";\n\ndescribe(\"MessageEncoderStream\", () => {\n  it(\"returns encoded stream with end frame\", async () => {\n    const message1 = {\n      headers: {},\n      body: new Uint8Array(1),\n    };\n\n    const message2 = {\n      headers: {},\n      body: new Uint8Array(2),\n    };\n\n    const messageEncoderMock = {\n      encode: vi.fn().mockReturnValueOnce(new Uint8Array(1)).mockReturnValueOnce(new Uint8Array(2)),\n    };\n\n    const inputStream = async function* () {\n      yield message1;\n      yield message2;\n    };\n\n    const messageEncoderStream = new MessageEncoderStream({\n      encoder: messageEncoderMock,\n      messageStream: inputStream(),\n      includeEndFrame: true,\n    });\n\n    const messages: Array<Uint8Array> = [];\n    for await (const encoded of messageEncoderStream) {\n      messages.push(encoded);\n    }\n    expect(messages.length).toEqual(3);\n    expect(messages[0]).toEqual(new Uint8Array(1));\n    expect(messages[1]).toEqual(new Uint8Array(2));\n    expect(messages[2]).toEqual(new Uint8Array(0));\n  });\n\n  it(\"returns encoded stream without end frame\", async () => {\n    const message1 = {\n      headers: {},\n      body: new Uint8Array(1),\n    };\n\n    const message2 = {\n      headers: {},\n      body: new Uint8Array(2),\n    };\n\n    const messageEncoderMock = {\n      encode: vi.fn().mockReturnValueOnce(new Uint8Array(1)).mockReturnValueOnce(new Uint8Array(2)),\n    };\n\n    const inputStream = async function* () {\n      yield message1;\n      yield message2;\n    };\n\n    const messageEncoderStream = new MessageEncoderStream({\n      encoder: messageEncoderMock,\n      messageStream: inputStream(),\n    });\n\n    const messages: Array<Uint8Array> = [];\n    for await (const encoded of messageEncoderStream) {\n      messages.push(encoded);\n    }\n    expect(messages.length).toEqual(2);\n    expect(messages[0]).toEqual(new Uint8Array(1));\n    expect(messages[1]).toEqual(new Uint8Array(2));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/MessageEncoderStream.ts",
    "content": "import type { Message, MessageEncoder } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface MessageEncoderStreamOptions {\n  messageStream: AsyncIterable<Message>;\n  encoder: MessageEncoder;\n  includeEndFrame?: boolean;\n}\n\n/**\n * @internal\n */\nexport class MessageEncoderStream implements AsyncIterable<Uint8Array> {\n  constructor(private readonly options: MessageEncoderStreamOptions) {}\n\n  [Symbol.asyncIterator](): AsyncIterator<Uint8Array> {\n    return this.asyncIterator();\n  }\n\n  private async *asyncIterator() {\n    for await (const msg of this.options.messageStream) {\n      const encoded = this.options.encoder.encode(msg);\n      yield encoded;\n    }\n    if (this.options.includeEndFrame) {\n      yield new Uint8Array(0);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { SmithyMessageDecoderStream } from \"./SmithyMessageDecoderStream\";\n\ndescribe(\"SmithyMessageDecoderStream\", () => {\n  it(\"returns decoded stream\", async () => {\n    const message1 = {\n      headers: {},\n      body: new Uint8Array(1),\n    };\n\n    const message2 = {\n      headers: {},\n      body: new Uint8Array(2),\n    };\n\n    const deserializer = vi\n      .fn()\n      .mockReturnValueOnce(Promise.resolve(\"first\"))\n      .mockReturnValueOnce(Promise.resolve(\"second\"));\n\n    const inputStream = async function* () {\n      yield message1;\n      yield message2;\n    };\n\n    const stream = new SmithyMessageDecoderStream<string>({\n      messageStream: inputStream(),\n      deserializer: deserializer,\n    });\n\n    const messages: Array<string> = [];\n    for await (const str of stream) {\n      messages.push(str);\n    }\n    expect(messages.length).toEqual(2);\n    expect(messages[0]).toEqual(\"first\");\n    expect(messages[1]).toEqual(\"second\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.ts",
    "content": "import type { Message } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface SmithyMessageDecoderStreamOptions<T> {\n  readonly messageStream: AsyncIterable<Message>;\n  readonly deserializer: (input: Message) => Promise<T | undefined>;\n}\n\n/**\n * @internal\n */\nexport class SmithyMessageDecoderStream<T> implements AsyncIterable<T> {\n  constructor(private readonly options: SmithyMessageDecoderStreamOptions<T>) {}\n\n  [Symbol.asyncIterator](): AsyncIterator<T> {\n    return this.asyncIterator();\n  }\n\n  private async *asyncIterator() {\n    for await (const message of this.options.messageStream) {\n      const deserialized = await this.options.deserializer(message);\n      if (deserialized === undefined) continue;\n      yield deserialized;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.spec.ts",
    "content": "import type { Message } from \"@smithy/types\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { SmithyMessageEncoderStream } from \"./SmithyMessageEncoderStream\";\n\ndescribe(\"SmithyMessageEncoderStream\", () => {\n  it(\"returns encoded stream\", async () => {\n    const message1 = {\n      headers: {},\n      body: new Uint8Array(1),\n    };\n\n    const message2 = {\n      headers: {},\n      body: new Uint8Array(2),\n    };\n\n    const serializer = vi.fn().mockReturnValueOnce(message1).mockReturnValueOnce(message2);\n\n    const inputStream = async function* () {\n      yield \"first\";\n      yield \"second\";\n    };\n\n    const stream = new SmithyMessageEncoderStream<string>({\n      inputStream: inputStream(),\n      serializer: serializer,\n    });\n\n    const messages: Array<Message> = [];\n    for await (const str of stream) {\n      messages.push(str);\n    }\n    expect(messages.length).toEqual(2);\n    expect(messages[0]).toEqual(message1);\n    expect(messages[1]).toEqual(message2);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.ts",
    "content": "import type { Message } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface SmithyMessageEncoderStreamOptions<T> {\n  inputStream: AsyncIterable<T>;\n  serializer: (event: T) => Message;\n}\n\n/**\n * @internal\n */\nexport class SmithyMessageEncoderStream<T> implements AsyncIterable<Message> {\n  constructor(private readonly options: SmithyMessageEncoderStreamOptions<T>) {}\n\n  [Symbol.asyncIterator](): AsyncIterator<Message> {\n    return this.asyncIterator();\n  }\n\n  private async *asyncIterator() {\n    for await (const chunk of this.options.inputStream) {\n      const payloadBuf = this.options.serializer(chunk);\n      yield payloadBuf;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/TestVectors.fixture.ts",
    "content": "import { Int64 } from \"./Int64\";\nimport type { TestVectors } from \"./vectorTypes.fixture\";\n\nexport const vectors: TestVectors = {\n  all_headers: {\n    expectation: \"success\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 204, 0, 0, 0, 175, 15, 174, 100, 202, 10, 101, 118, 101, 110, 116, 45, 116, 121, 112, 101, 4, 0, 0, 160,\n      12, 12, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0, 16, 97, 112, 112, 108, 105, 99, 97, 116,\n      105, 111, 110, 47, 106, 115, 111, 110, 10, 98, 111, 111, 108, 32, 102, 97, 108, 115, 101, 1, 9, 98, 111, 111, 108,\n      32, 116, 114, 117, 101, 0, 4, 98, 121, 116, 101, 2, 207, 8, 98, 121, 116, 101, 32, 98, 117, 102, 6, 0, 20, 73, 39,\n      109, 32, 97, 32, 108, 105, 116, 116, 108, 101, 32, 116, 101, 97, 112, 111, 116, 33, 9, 116, 105, 109, 101, 115,\n      116, 97, 109, 112, 8, 0, 0, 0, 0, 0, 132, 95, 237, 5, 105, 110, 116, 49, 54, 3, 0, 42, 5, 105, 110, 116, 54, 52,\n      5, 0, 0, 0, 0, 2, 135, 87, 178, 4, 117, 117, 105, 100, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,\n      123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125, 171, 165, 241, 12,\n    ]),\n    decoded: {\n      headers: {\n        \"event-type\": {\n          type: \"integer\",\n          value: 40972,\n        },\n        \"content-type\": {\n          type: \"string\",\n          value: \"application/json\",\n        },\n        \"bool false\": {\n          type: \"boolean\",\n          value: false,\n        },\n        \"bool true\": {\n          type: \"boolean\",\n          value: true,\n        },\n        byte: {\n          type: \"byte\",\n          value: -49,\n        },\n        \"byte buf\": {\n          type: \"binary\",\n          value: Uint8Array.from([\n            73, 39, 109, 32, 97, 32, 108, 105, 116, 116, 108, 101, 32, 116, 101, 97, 112, 111, 116, 33,\n          ]),\n        },\n        timestamp: {\n          type: \"timestamp\",\n          value: new Date(8675309),\n        },\n        int16: {\n          type: \"short\",\n          value: 42,\n        },\n        int64: {\n          type: \"long\",\n          value: Int64.fromNumber(42424242),\n        },\n        uuid: {\n          type: \"uuid\",\n          value: \"01020304-0506-0708-090a-0b0c0d0e0f10\",\n        },\n      },\n      body: Uint8Array.from([123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125]),\n    },\n  },\n  empty_message: {\n    expectation: \"success\",\n    encoded: Uint8Array.from([0, 0, 0, 16, 0, 0, 0, 0, 5, 194, 72, 235, 125, 152, 200, 255]),\n    decoded: {\n      headers: {},\n      body: Uint8Array.from([]),\n    },\n  },\n  int32_header: {\n    expectation: \"success\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 45, 0, 0, 0, 16, 65, 196, 36, 184, 10, 101, 118, 101, 110, 116, 45, 116, 121, 112, 101, 4, 0, 0, 160, 12,\n      123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125, 54, 244, 128, 160,\n    ]),\n    decoded: {\n      headers: {\n        \"event-type\": {\n          type: \"integer\",\n          value: 40972,\n        },\n      },\n      body: Uint8Array.from([123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125]),\n    },\n  },\n  payload_no_headers: {\n    expectation: \"success\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 29, 0, 0, 0, 0, 253, 82, 140, 90, 123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125, 195, 101, 57,\n      54,\n    ]),\n    decoded: {\n      headers: {},\n      body: Uint8Array.from([123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125]),\n    },\n  },\n  payload_one_str_header: {\n    expectation: \"success\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 61, 0, 0, 0, 32, 7, 253, 131, 150, 12, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0,\n      16, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 123, 39, 102, 111, 111, 39, 58,\n      39, 98, 97, 114, 39, 125, 141, 156, 8, 177,\n    ]),\n    decoded: {\n      headers: {\n        \"content-type\": {\n          type: \"string\",\n          value: \"application/json\",\n        },\n      },\n      body: Uint8Array.from([123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125]),\n    },\n  },\n  corrupted_headers: {\n    expectation: \"failure\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 61, 0, 0, 0, 32, 7, 253, 131, 150, 12, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0,\n      16, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 123, 97, 102, 111, 111, 39, 58,\n      39, 98, 97, 114, 39, 125, 141, 156, 8, 177,\n    ]),\n  },\n  corrupted_header_len: {\n    expectation: \"failure\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 61, 0, 0, 0, 33, 7, 253, 131, 150, 12, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0,\n      16, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 123, 39, 102, 111, 111, 39, 58,\n      39, 98, 97, 114, 39, 125, 141, 156, 8, 177,\n    ]),\n  },\n  corrupted_length: {\n    expectation: \"failure\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 62, 0, 0, 0, 32, 7, 253, 131, 150, 12, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0,\n      16, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 123, 39, 102, 111, 111, 39, 58,\n      39, 98, 97, 114, 39, 125, 141, 156, 8, 177,\n    ]),\n  },\n  corrupted_payload: {\n    expectation: \"failure\",\n    encoded: Uint8Array.from([\n      0, 0, 0, 29, 0, 0, 0, 0, 253, 82, 140, 90, 91, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125, 195, 101, 57,\n      54,\n    ]),\n  },\n};\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/splitMessage.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { splitMessage } from \"./splitMessage\";\n\ndescribe(\"splitMessage\", () => {\n  it(\"should throw when given a message under 16 bytes\", () => {\n    for (let i = 0; i < 16; i++) {\n      const emptyMessage = new Uint8Array(i);\n      expect(() => splitMessage(emptyMessage)).toThrowError(\"too short\");\n    }\n  });\n\n  it(\"should throw if the specified length does not match the length of the received message\", () => {\n    const message = new DataView(new ArrayBuffer(17));\n    message.setUint32(0, 16, false);\n\n    expect(() => splitMessage(message)).toThrowError(\"length does not match\");\n  });\n\n  it(\"should throw if the prelude checksum does not match the calculated prelude checksum\", () => {\n    const message = new DataView(new ArrayBuffer(16));\n    message.setUint32(0, 16, false);\n    message.setUint32(8, 0x05c248ec, false);\n\n    expect(() => splitMessage(message)).toThrowError(\"prelude checksum\");\n  });\n\n  it(\"should throw if the message checksum does not match the calculated message checksum\", () => {\n    const message = new DataView(new ArrayBuffer(16));\n    message.setUint32(0, 16, false);\n    message.setUint32(8, 0x05c248eb, false);\n    message.setUint32(12, 0x7d98c8fe, false);\n\n    expect(() => splitMessage(message)).toThrowError(\"message checksum\");\n  });\n\n  it(\"should return header and body buffers for messages with well-formed metadata\", () => {\n    const message = new DataView(new ArrayBuffer(16));\n    message.setUint32(0, 16, false);\n    message.setUint32(8, 0x05c248eb, false);\n    message.setUint32(12, 0x7d98c8ff, false);\n\n    expect(splitMessage(message)).toEqual({\n      headers: new DataView(new ArrayBuffer(0)),\n      body: new Uint8Array(0),\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/splitMessage.ts",
    "content": "import { Crc32 } from \"@aws-crypto/crc32\";\n\n// All prelude components are unsigned, 32-bit integers\nconst PRELUDE_MEMBER_LENGTH = 4;\n// The prelude consists of two components\nconst PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\n// Checksums are always CRC32 hashes.\nconst CHECKSUM_LENGTH = 4;\n// Messages must include a full prelude, a prelude checksum, and a message checksum\nconst MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\n\n/**\n * @internal\n */\nexport interface MessageParts {\n  headers: DataView;\n  body: Uint8Array;\n}\n\n/**\n * @internal\n */\nexport function splitMessage({ byteLength, byteOffset, buffer }: ArrayBufferView): MessageParts {\n  if (byteLength < MINIMUM_MESSAGE_LENGTH) {\n    throw new Error(\"Provided message too short to accommodate event stream message overhead\");\n  }\n\n  const view = new DataView(buffer, byteOffset, byteLength);\n\n  const messageLength = view.getUint32(0, false);\n\n  if (byteLength !== messageLength) {\n    throw new Error(\"Reported message length does not match received message length\");\n  }\n\n  const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);\n  const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);\n  const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);\n\n  const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));\n  if (expectedPreludeChecksum !== checksummer.digest()) {\n    throw new Error(\n      `The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`\n    );\n  }\n\n  checksummer.update(\n    new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))\n  );\n  if (expectedMessageChecksum !== checksummer.digest()) {\n    throw new Error(\n      `The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`\n    );\n  }\n\n  return {\n    headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),\n    body: new Uint8Array(\n      buffer,\n      byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength,\n      messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)\n    ),\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-codec/vectorTypes.fixture.ts",
    "content": "import type { Message } from \"./Message\";\n\nexport interface NegativeTestVector {\n  expectation: \"failure\";\n  encoded: Uint8Array;\n}\n\nexport interface PositiveTestVector {\n  expectation: \"success\";\n  encoded: Uint8Array;\n  decoded: Message;\n}\n\nexport type TestVector = NegativeTestVector | PositiveTestVector;\n\nexport type TestVectors = Record<string, TestVector>;\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde/CHANGELOG.eventstream-serde-browser.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/event-streams`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/eventstream-serde-universal@4.2.14\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/eventstream-serde-universal@4.2.13\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/eventstream-serde-universal@4.2.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/eventstream-serde-universal@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/eventstream-serde-universal@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/eventstream-serde-universal@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/eventstream-serde-universal@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/eventstream-serde-universal@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/eventstream-serde-universal@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/eventstream-serde-universal@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/eventstream-serde-universal@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/eventstream-serde-universal@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/eventstream-serde-universal@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/eventstream-serde-universal@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/eventstream-serde-universal@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/eventstream-serde-universal@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/eventstream-serde-universal@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/eventstream-serde-universal@4.0.5\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/eventstream-serde-universal@4.0.4\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/eventstream-serde-universal@4.0.3\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/eventstream-serde-universal@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/eventstream-serde-universal@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/eventstream-serde-universal@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.14\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/eventstream-serde-universal@3.0.13\n\n## 3.0.13\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/eventstream-serde-universal@3.0.12\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/eventstream-serde-universal@3.0.11\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/eventstream-serde-universal@3.0.10\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/eventstream-serde-universal@3.0.9\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/eventstream-serde-universal@3.0.8\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/eventstream-serde-universal@3.0.7\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/eventstream-serde-universal@3.0.6\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [b352cc1]\n  - @smithy/eventstream-serde-universal@3.0.5\n\n## 3.0.5\n\n### Patch Changes\n\n- 1cfe243: avoid compilation of global ReadableStream with type parameter\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/eventstream-serde-universal@3.0.4\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/eventstream-serde-universal@3.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- @smithy/eventstream-serde-universal@3.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/eventstream-serde-universal@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/eventstream-serde-universal@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/eventstream-serde-universal@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/eventstream-serde-universal@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/eventstream-serde-universal@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/eventstream-serde-universal@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/eventstream-serde-universal@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/eventstream-serde-universal@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/eventstream-serde-universal@2.0.16\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/eventstream-serde-universal@2.0.15\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/eventstream-serde-universal@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/eventstream-serde-universal@2.0.13\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/eventstream-serde-universal@2.0.12\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/eventstream-serde-universal@2.0.11\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/eventstream-serde-universal@2.0.10\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/eventstream-serde-universal@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/eventstream-serde-universal@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/eventstream-serde-universal@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/eventstream-serde-universal@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/eventstream-serde-universal@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/eventstream-serde-universal@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/eventstream-serde-universal@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/eventstream-serde-universal@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/eventstream-serde-universal@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/eventstream-serde-universal@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/eventstream-serde-universal@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/eventstream-serde-universal@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/eventstream-serde-universal@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/eventstream-serde-universal@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/eventstream-serde-browser](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/eventstream-serde-browser/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde/CHANGELOG.eventstream-serde-node.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/event-streams`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/eventstream-serde-universal@4.2.14\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/eventstream-serde-universal@4.2.13\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/eventstream-serde-universal@4.2.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/eventstream-serde-universal@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/eventstream-serde-universal@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/eventstream-serde-universal@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/eventstream-serde-universal@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/eventstream-serde-universal@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/eventstream-serde-universal@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/eventstream-serde-universal@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/eventstream-serde-universal@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/eventstream-serde-universal@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/eventstream-serde-universal@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/eventstream-serde-universal@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/eventstream-serde-universal@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/eventstream-serde-universal@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/eventstream-serde-universal@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/eventstream-serde-universal@4.0.5\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/eventstream-serde-universal@4.0.4\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/eventstream-serde-universal@4.0.3\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/eventstream-serde-universal@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/eventstream-serde-universal@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/eventstream-serde-universal@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.13\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/eventstream-serde-universal@3.0.13\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/eventstream-serde-universal@3.0.12\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/eventstream-serde-universal@3.0.11\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/eventstream-serde-universal@3.0.10\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/eventstream-serde-universal@3.0.9\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/eventstream-serde-universal@3.0.8\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/eventstream-serde-universal@3.0.7\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/eventstream-serde-universal@3.0.6\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [b352cc1]\n  - @smithy/eventstream-serde-universal@3.0.5\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/eventstream-serde-universal@3.0.4\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/eventstream-serde-universal@3.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- @smithy/eventstream-serde-universal@3.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/eventstream-serde-universal@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/eventstream-serde-universal@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/eventstream-serde-universal@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/eventstream-serde-universal@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/eventstream-serde-universal@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/eventstream-serde-universal@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/eventstream-serde-universal@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/eventstream-serde-universal@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/eventstream-serde-universal@2.0.16\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/eventstream-serde-universal@2.0.15\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/eventstream-serde-universal@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/eventstream-serde-universal@2.0.13\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/eventstream-serde-universal@2.0.12\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/eventstream-serde-universal@2.0.11\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/eventstream-serde-universal@2.0.10\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/eventstream-serde-universal@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/eventstream-serde-universal@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/eventstream-serde-universal@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/eventstream-serde-universal@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/eventstream-serde-universal@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/eventstream-serde-universal@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/eventstream-serde-universal@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/eventstream-serde-universal@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/eventstream-serde-universal@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/eventstream-serde-universal@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/eventstream-serde-universal@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/eventstream-serde-universal@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/eventstream-serde-universal@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/eventstream-serde-universal@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/eventstream-serde-node](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/eventstream-serde-node/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde/EventStreamMarshaller.browser.ts",
    "content": "import type {\n  Decoder,\n  Encoder,\n  EventSigner,\n  EventStreamSerdeProvider,\n  EventStreamMarshaller as IEventStreamMarshaller,\n  Message,\n  Provider,\n} from \"@smithy/types\";\n\nimport { EventStreamMarshaller as UniversalEventStreamMarshaller } from \"../eventstream-serde-universal/EventStreamMarshaller\";\nimport { iterableToReadableStream, readableStreamToIterable } from \"./utils\";\n\n/**\n * @internal\n */\nexport interface EventStreamMarshallerOptions {\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n}\n\n/**\n * Utility class used to serialize and deserialize event streams in\n * browsers and ReactNative.\n *\n * In browsers where ReadableStream API is available:\n * * deserialize from ReadableStream to an async iterable of output structure\n * * serialize from async iterable of input structure to ReadableStream\n * In ReactNative where only async iterable API is available:\n * * deserialize from async iterable of binaries to async iterable of output structure\n * * serialize from async iterable of input structure to async iterable of binaries\n *\n * We use ReadableStream API in browsers because of the consistency with other\n * streaming operations, where ReadableStream API is used to denote streaming data.\n * Whereas in ReactNative, ReadableStream API is not available, we use async iterable\n * for streaming data, although it has lower throughput.\n *\n * @internal\n */\nexport class EventStreamMarshaller implements IEventStreamMarshaller {\n  private readonly universalMarshaller: UniversalEventStreamMarshaller;\n  constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions) {\n    this.universalMarshaller = new UniversalEventStreamMarshaller({\n      utf8Decoder,\n      utf8Encoder,\n    });\n  }\n\n  deserialize<T>(\n    body: ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>,\n    deserializer: (input: Record<string, Message>) => Promise<T>\n  ): AsyncIterable<T> {\n    const bodyIterable = isReadableStream(body) ? readableStreamToIterable(body) : body;\n    return this.universalMarshaller.deserialize(bodyIterable, deserializer);\n  }\n\n  /**\n   * Generate a stream that serialize events into stream of binary chunks;\n   *\n   * Caveat is that streaming request payload doesn't work on browser with native\n   * xhr or fetch handler currently because they don't support upload streaming.\n   * reference:\n   * * https://bugs.chromium.org/p/chromium/issues/detail?id=688906\n   * * https://bugzilla.mozilla.org/show_bug.cgi?id=1387483\n   *\n   */\n  serialize<T>(input: AsyncIterable<T>, serializer: (event: T) => Message): ReadableStream | AsyncIterable<Uint8Array> {\n    const serializedIterable = this.universalMarshaller.serialize(input, serializer);\n    return typeof ReadableStream === \"function\" ? iterableToReadableStream(serializedIterable) : serializedIterable;\n  }\n}\n\n/**\n * Warning: do not export this without aliasing the reference to\n * global ReadableStream.\n * @internal\n * @see https://github.com/smithy-lang/smithy-typescript/issues/1341.\n */\nconst isReadableStream = (body: any): body is ReadableStream =>\n  typeof ReadableStream === \"function\" && body instanceof ReadableStream;\n\n/**\n * @internal\n */\nexport const eventStreamSerdeProvider: EventStreamSerdeProvider = (options: {\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n  eventSigner: EventSigner | Provider<EventSigner>;\n}) => new EventStreamMarshaller(options);\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde/EventStreamMarshaller.ts",
    "content": "import { Readable } from \"node:stream\";\nimport type {\n  Decoder,\n  Encoder,\n  EventSigner,\n  EventStreamSerdeProvider,\n  EventStreamMarshaller as IEventStreamMarshaller,\n  Message,\n  Provider,\n} from \"@smithy/types\";\n\nimport { EventStreamMarshaller as UniversalEventStreamMarshaller } from \"../eventstream-serde-universal/EventStreamMarshaller\";\n\n/**\n * @internal\n */\nexport interface EventStreamMarshallerOptions {\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n}\n\n/**\n * @internal\n */\nexport class EventStreamMarshaller implements IEventStreamMarshaller {\n  private readonly universalMarshaller: UniversalEventStreamMarshaller;\n  constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions) {\n    this.universalMarshaller = new UniversalEventStreamMarshaller({\n      utf8Decoder,\n      utf8Encoder,\n    });\n  }\n\n  deserialize<T>(body: Readable, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T> {\n    //should use stream[Symbol.asyncIterable] when the api is stable\n    //reference: https://nodejs.org/docs/latest-v11.x/api/stream.html#stream_readable_symbol_asynciterator\n    const bodyIterable: AsyncIterable<Uint8Array> =\n      typeof body[Symbol.asyncIterator] === \"function\" ? body : readableToIterable(body);\n    return this.universalMarshaller.deserialize(bodyIterable, deserializer);\n  }\n\n  serialize<T>(input: AsyncIterable<T>, serializer: (event: T) => Message): Readable {\n    return Readable.from(this.universalMarshaller.serialize(input, serializer));\n  }\n}\n\n/**\n * @internal\n */\nexport const eventStreamSerdeProvider: EventStreamSerdeProvider = (options: {\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n  eventSigner: EventSigner | Provider<EventSigner>;\n}) => new EventStreamMarshaller(options);\n\n/**\n * Convert object stream piped in into an async iterable. This\n * adaptor should be deprecated when Node stream iterator is stable.\n * Caveat: this adaptor won't have backpressure to inwards stream\n *\n * Reference: https://nodejs.org/docs/latest-v11.x/api/stream.html#stream_readable_symbol_asynciterator\n * @internal\n */\nexport async function* readableToIterable<T>(readStream: Readable): AsyncIterable<T> {\n  let streamEnded = false;\n  let generationEnded = false;\n  const records = new Array<T>();\n\n  readStream.on(\"error\", (err) => {\n    if (!streamEnded) {\n      streamEnded = true;\n    }\n    if (err) {\n      throw err;\n    }\n  });\n\n  readStream.on(\"data\", (data) => {\n    records.push(data);\n  });\n\n  readStream.on(\"end\", () => {\n    streamEnded = true;\n  });\n\n  while (!generationEnded) {\n    // @ts-ignore TS2345: Argument of type 'T | undefined' is not assignable to type 'T | PromiseLike<T>'.\n    const value = await new Promise<T>((resolve) => setTimeout(() => resolve(records.shift()), 0));\n    if (value) {\n      yield value;\n    }\n    generationEnded = streamEnded && records.length === 0;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde/utils.ts",
    "content": "/**\n * A util function converting ReadableStream into an async iterable.\n * Reference: https://jakearchibald.com/2017/async-iterators-and-generators/#making-streams-iterate\n * @internal\n */\nexport const readableStreamToIterable = <T>(readableStream: ReadableStream<T>): AsyncIterable<T> => ({\n  [Symbol.asyncIterator]: async function* () {\n    const reader = readableStream.getReader();\n    try {\n      while (true) {\n        const { done, value } = await reader.read();\n        if (done) return;\n        yield value as T;\n      }\n    } finally {\n      reader.releaseLock();\n    }\n  },\n});\n\n/**\n * A util function converting async iterable to a ReadableStream.\n * @internal\n */\nexport const iterableToReadableStream = <T>(asyncIterable: AsyncIterable<T>): ReadableStream<T> => {\n  const iterator = asyncIterable[Symbol.asyncIterator]();\n  return new ReadableStream({\n    async pull(controller) {\n      const { done, value } = await iterator.next();\n      if (done) {\n        return controller.close();\n      }\n      controller.enqueue(value);\n    },\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-config-resolver/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/event-streams`.\n\n## 4.3.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.3.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.3.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.3.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.3.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.3.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.3.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.3.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.3.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.3.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.3.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/eventstream-serde-config-resolver](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/eventstream-serde-config-resolver/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-config-resolver/EventStreamSerdeConfig.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { resolveEventStreamSerdeConfig } from \"./EventStreamSerdeConfig\";\n\ndescribe(\"resolveEventStreamSerdeConfig\", () => {\n  const eventStreamSerdeProvider = vi.fn();\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"maintains object custody\", () => {\n    const input = {\n      eventStreamSerdeProvider: vi.fn(),\n    };\n    expect(resolveEventStreamSerdeConfig(input)).toBe(input);\n  });\n\n  it(\"sets value returned by eventStreamSerdeProvider\", () => {\n    const mockReturn = \"mockReturn\";\n    eventStreamSerdeProvider.mockReturnValueOnce(mockReturn);\n\n    const input = { eventStreamSerdeProvider };\n    expect(resolveEventStreamSerdeConfig(input).eventStreamMarshaller).toStrictEqual(mockReturn);\n    expect(eventStreamSerdeProvider).toHaveBeenCalledTimes(1);\n    expect(eventStreamSerdeProvider).toHaveBeenCalledWith(input);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-config-resolver/EventStreamSerdeConfig.ts",
    "content": "import type { EventStreamMarshaller, EventStreamSerdeProvider } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface EventStreamSerdeInputConfig {}\n\n/**\n * @internal\n */\nexport interface EventStreamSerdeResolvedConfig {\n  eventStreamMarshaller: EventStreamMarshaller;\n}\n\n/**\n * @internal\n */\ninterface PreviouslyResolved {\n  /**\n   * Provide the event stream marshaller for the given runtime\n   * @internal\n   */\n  eventStreamSerdeProvider: EventStreamSerdeProvider;\n}\n\n/**\n * @internal\n */\nexport const resolveEventStreamSerdeConfig = <T>(\n  input: T & PreviouslyResolved & EventStreamSerdeInputConfig\n): T & EventStreamSerdeResolvedConfig =>\n  Object.assign(input, {\n    eventStreamMarshaller: input.eventStreamSerdeProvider(input),\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/event-streams`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/eventstream-codec@4.2.14\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/eventstream-codec@4.2.13\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/eventstream-codec@4.2.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/eventstream-codec@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/eventstream-codec@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/eventstream-codec@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/eventstream-codec@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/eventstream-codec@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/eventstream-codec@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/eventstream-codec@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/eventstream-codec@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/eventstream-codec@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/eventstream-codec@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/eventstream-codec@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/eventstream-codec@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/eventstream-codec@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/eventstream-codec@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/eventstream-codec@4.0.5\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/eventstream-codec@4.0.4\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/eventstream-codec@4.0.3\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/eventstream-codec@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/eventstream-codec@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/eventstream-codec@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.13\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/eventstream-codec@3.1.10\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/eventstream-codec@3.1.9\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/eventstream-codec@3.1.8\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/eventstream-codec@3.1.7\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/eventstream-codec@3.1.6\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/eventstream-codec@3.1.5\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/eventstream-codec@3.1.4\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/eventstream-codec@3.1.3\n\n## 3.0.5\n\n### Patch Changes\n\n- b352cc1: exclude test code from artifact\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/eventstream-codec@3.1.2\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/eventstream-codec@3.1.1\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [3c23a83b]\n  - @smithy/eventstream-codec@3.1.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/eventstream-codec@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/eventstream-codec@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/eventstream-codec@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/eventstream-codec@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/eventstream-codec@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/eventstream-codec@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/eventstream-codec@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/eventstream-codec@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/eventstream-codec@2.0.16\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/eventstream-codec@2.0.15\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/eventstream-codec@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/eventstream-codec@2.0.13\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/eventstream-codec@2.0.12\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/eventstream-codec@2.0.11\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/eventstream-codec@2.0.10\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/eventstream-codec@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/eventstream-codec@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/eventstream-codec@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/eventstream-codec@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/eventstream-codec@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/eventstream-codec@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/eventstream-codec@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/eventstream-codec@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/eventstream-codec@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/eventstream-codec@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/eventstream-codec@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/eventstream-codec@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/eventstream-codec@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/eventstream-codec@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/eventstream-serde-universal](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/eventstream-serde-universal/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.ts",
    "content": "import type {\n  Decoder,\n  Encoder,\n  EventSigner,\n  EventStreamSerdeProvider,\n  EventStreamMarshaller as IEventStreamMarshaller,\n  Message,\n  Provider,\n} from \"@smithy/types\";\n\nimport { EventStreamCodec } from \"../eventstream-codec/EventStreamCodec\";\nimport { MessageDecoderStream } from \"../eventstream-codec/MessageDecoderStream\";\nimport { MessageEncoderStream } from \"../eventstream-codec/MessageEncoderStream\";\nimport { SmithyMessageDecoderStream } from \"../eventstream-codec/SmithyMessageDecoderStream\";\nimport { SmithyMessageEncoderStream } from \"../eventstream-codec/SmithyMessageEncoderStream\";\nimport { getChunkedStream } from \"./getChunkedStream\";\nimport { getMessageUnmarshaller } from \"./getUnmarshalledStream\";\n\n/**\n * @internal\n */\nexport interface EventStreamMarshallerOptions {\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n}\n\n/**\n * @internal\n */\nexport class EventStreamMarshaller implements IEventStreamMarshaller {\n  private readonly eventStreamCodec: EventStreamCodec;\n  private readonly utfEncoder: Encoder;\n\n  constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions) {\n    this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder);\n    this.utfEncoder = utf8Encoder;\n  }\n\n  deserialize<T>(\n    body: AsyncIterable<Uint8Array>,\n    deserializer: (input: Record<string, Message>) => Promise<T>\n  ): AsyncIterable<T> {\n    const inputStream = getChunkedStream(body);\n    return new SmithyMessageDecoderStream<T>({\n      messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }),\n      deserializer: getMessageUnmarshaller<any>(deserializer, this.utfEncoder),\n    });\n  }\n\n  serialize<T>(inputStream: AsyncIterable<T>, serializer: (event: T) => Message): AsyncIterable<Uint8Array> {\n    return new MessageEncoderStream({\n      messageStream: new SmithyMessageEncoderStream<T>({ inputStream, serializer }),\n      encoder: this.eventStreamCodec,\n      includeEndFrame: true,\n    });\n  }\n}\n\n/**\n * @internal\n */\nexport const eventStreamSerdeProvider: EventStreamSerdeProvider = (options: {\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n  eventSigner: EventSigner | Provider<EventSigner>;\n}) => new EventStreamMarshaller(options);\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/clientContextParams-precedence.integ.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\nimport { XYZService } from \"xyz\";\n\ndescribe(\"client context parameters precedence integration test\", () => {\n  it(\"should handle conflicting vs non-conflicting parameter precedence correctly\", async () => {\n    // For non-conflicting params\n    const clientWithNonConflicting = new XYZService({\n      endpoint: \"https://localhost\",\n      apiKey: async () => ({ apiKey: \"test-key\" }),\n      customParam: \"user-custom-value\",\n      clientContextParams: {\n        apiKey: \"test-key\",\n        customParam: \"nested-custom-value\",\n      },\n    });\n\n    // Verify that endpoint resolution uses the nested value over root value\n    const resolvedConfig = clientWithNonConflicting.config;\n    const effectiveCustomParam = resolvedConfig.clientContextParams?.customParam ?? resolvedConfig.customParam;\n    expect(effectiveCustomParam).toBe(\"nested-custom-value\");\n\n    // For conflicting parameters\n    const clientWithConflicting = new XYZService({\n      endpoint: \"https://localhost\",\n      apiKey: async () => ({ apiKey: \"auth-key\" }),\n      clientContextParams: {\n        apiKey: \"endpoint-key\",\n      },\n    });\n\n    // Verify that both auth and endpoint contexts can coexist\n    const resolvedConfigConflicting = clientWithConflicting.config;\n\n    // Verify endpoint context has the nested value\n    expect(resolvedConfigConflicting.clientContextParams?.apiKey).toBe(\"endpoint-key\");\n\n    // Verify auth context has the auth provider\n    const authIdentity = await resolvedConfigConflicting.apiKey?.();\n    expect(authIdentity?.apiKey).toBe(\"auth-key\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/eventstream-cbor.integ.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { cbor, dateToTag } from \"@smithy/core/cbor\";\nimport { HttpResponse } from \"@smithy/core/protocols\";\nimport { requireRequestsFrom } from \"@smithy/util-test/src\";\nimport { describe, expect, test as it } from \"vitest\";\nimport { XYZService } from \"xyz\";\n\ndescribe(\"local model integration test for cbor eventstreams\", () => {\n  it(\"should read and write cbor event streams\", async () => {\n    const client = new XYZService({\n      endpoint: \"https://localhost\",\n      apiKey: async () => ({ apiKey: \"test-api-key\" }),\n      clientContextParams: {\n        apiKey: \"test-api-key\",\n      },\n    });\n\n    const body = cbor.serialize({\n      id: \"alpha\",\n      timestamp: dateToTag(new Date(0)),\n    });\n\n    function toInt32(n: number): number[] {\n      const uint32 = new Uint8Array(4);\n      const dv = new DataView(uint32.buffer, 0, 4);\n      dv.setUint32(0, n);\n      return [...uint32];\n    }\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n        async body(body) {\n          const outgoing = [];\n          for await (const chunk of body) {\n            outgoing.push(chunk);\n          }\n          expect(outgoing).toEqual([\n            new Uint8Array([\n              0, 0, 0, 101, 0, 0, 0, 75, 213, 254, 191, 76, 11, 58, 101, 118, 101, 110, 116, 45, 116, 121, 112, 101, 7,\n              0, 5, 97, 108, 112, 104, 97, 13, 58, 109, 101, 115, 115, 97, 103, 101, 45, 116, 121, 112, 101, 7, 0, 5,\n              101, 118, 101, 110, 116, 13, 58, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0, 16, 97,\n              112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 99, 98, 111, 114, 161, 98, 105, 100, 101, 97, 108,\n              112, 104, 97, 32, 93, 69, 236,\n            ]),\n            new Uint8Array([\n              0, 0, 0, 91, 0, 0, 0, 74, 188, 232, 137, 61, 11, 58, 101, 118, 101, 110, 116, 45, 116, 121, 112, 101, 7,\n              0, 4, 98, 101, 116, 97, 13, 58, 109, 101, 115, 115, 97, 103, 101, 45, 116, 121, 112, 101, 7, 0, 5, 101,\n              118, 101, 110, 116, 13, 58, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0, 16, 97, 112,\n              112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 99, 98, 111, 114, 160, 195, 209, 62, 47,\n            ]),\n            new Uint8Array([\n              0, 0, 0, 91, 0, 0, 0, 74, 188, 232, 137, 61, 11, 58, 101, 118, 101, 110, 116, 45, 116, 121, 112, 101, 7,\n              0, 4, 98, 101, 116, 97, 13, 58, 109, 101, 115, 115, 97, 103, 101, 45, 116, 121, 112, 101, 7, 0, 5, 101,\n              118, 101, 110, 116, 13, 58, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0, 16, 97, 112,\n              112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 99, 98, 111, 114, 160, 195, 209, 62, 47,\n            ]),\n            new Uint8Array(),\n          ]);\n        },\n      })\n      .respondWith(\n        new HttpResponse({\n          statusCode: 200,\n          headers: {\n            \"smithy-protocol\": \"rpc-v2-cbor\",\n          },\n          body: Readable.from({\n            async *[Symbol.asyncIterator]() {\n              yield new Uint8Array([\n                /* message size */ ...toInt32(91 + body.byteLength),\n                /* header size */ ...toInt32(75),\n                /* prelude crc */ ...toInt32(1084132878),\n                /* headers */\n                /* :event-type */\n                11,\n                ...[58, 101, 118, 101, 110, 116, 45, 116, 121, 112, 101],\n                7,\n                /* alpha */\n                0,\n                5,\n                ...[97, 108, 112, 104, 97],\n                /* :content-type */\n                13,\n                ...[58, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101],\n                7,\n                /* application/cbor */\n                0,\n                16,\n                ...[97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 99, 98, 111, 114],\n                /* :message-type */\n                13,\n                ...[58, 109, 101, 115, 115, 97, 103, 101, 45, 116, 121, 112, 101],\n                7,\n                /* event */\n                0,\n                5,\n                ...[101, 118, 101, 110, 116],\n\n                /* body */\n                ...body,\n\n                /* message crc */\n                ...toInt32(1938836882),\n              ]);\n            },\n          }),\n        })\n      );\n\n    const response = await client.tradeEventStream({\n      eventStream: {\n        async *[Symbol.asyncIterator]() {\n          yield {\n            alpha: {\n              id: \"alpha\",\n            },\n          };\n          yield {\n            beta: {},\n          };\n          yield {\n            gamma: {},\n          };\n        },\n      },\n    });\n\n    const responses = [] as any[];\n    for await (const event of response.eventStream ?? []) {\n      responses.push(event);\n    }\n\n    expect(responses).toEqual([\n      {\n        alpha: {\n          id: \"alpha\",\n          timestamp: new Date(0),\n        },\n      },\n    ]);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/getChunkedStream.spec.ts",
    "content": "import { Readable, type ReadableOptions } from \"node:stream\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { getChunkedStream } from \"./getChunkedStream\";\n\nexport const recordEventMessage = Buffer.from(\n  \"AAAA0AAAAFX31gVLDTptZXNzYWdlLXR5cGUHAAVldmVudAs6ZXZlbnQtdHlwZQcAB1JlY29yZHMNOmNvbnRlbnQtdHlwZQcAGGFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTEsRm9vLFdoZW4gbGlmZSBnaXZlcyB5b3UgZm9vLi4uCjIsQmFyLG1ha2UgQmFyIQozLEZpenosU29tZXRpbWVzIHBhaXJlZCB3aXRoLi4uCjQsQnV6eix0aGUgaW5mYW1vdXMgQnV6eiEKzxKeSw==\",\n  \"base64\"\n);\n\nexport const statsEventMessage = Buffer.from(\n  \"AAAA0QAAAEM+YpmqDTptZXNzYWdlLXR5cGUHAAVldmVudAs6ZXZlbnQtdHlwZQcABVN0YXRzDTpjb250ZW50LXR5cGUHAAh0ZXh0L3htbDxTdGF0cyB4bWxucz0iIj48Qnl0ZXNTY2FubmVkPjEyNjwvQnl0ZXNTY2FubmVkPjxCeXRlc1Byb2Nlc3NlZD4xMjY8L0J5dGVzUHJvY2Vzc2VkPjxCeXRlc1JldHVybmVkPjEwNzwvQnl0ZXNSZXR1cm5lZD48L1N0YXRzPiJ0pLk=\",\n  \"base64\"\n);\n\nexport const endEventMessage = Buffer.from(\n  \"AAAAOAAAACjBxoTUDTptZXNzYWdlLXR5cGUHAAVldmVudAs6ZXZlbnQtdHlwZQcAA0VuZM+X05I=\",\n  \"base64\"\n);\n\nexport const exception = Buffer.from(\n  \"AAAAtgAAAF8BcW64DTpjb250ZW50LXR5cGUHABhhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NOm1lc3NhZ2UtdHlwZQcACWV4Y2VwdGlvbg86ZXhjZXB0aW9uLXR5cGUHAAlFeGNlcHRpb25UaGlzIGlzIGEgbW9kZWxlZCBleGNlcHRpb24gZXZlbnQgdGhhdCB3b3VsZCBiZSB0aHJvd24gaW4gZGVzZXJpYWxpemVyLj6Gc60=\",\n  \"base64\"\n);\n\nexport interface MockEventMessageSourceOptions extends ReadableOptions {\n  messages: Array<Buffer>;\n  emitSize: number;\n  throwError?: Error;\n}\n\nexport class MockEventMessageSource extends Readable {\n  private readonly data: Buffer;\n  private readonly emitSize: number;\n  private readonly throwError?: Error;\n  private readCount = 0;\n  constructor(options: MockEventMessageSourceOptions) {\n    super(options);\n    this.data = Buffer.concat(options.messages);\n    this.emitSize = options.emitSize;\n    this.throwError = options.throwError;\n  }\n\n  _read() {\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const self = this;\n    if (this.readCount === this.data.length) {\n      if (this.throwError) {\n        process.nextTick(function () {\n          self.emit(\"error\", new Error(\"Throwing an error!\"));\n        });\n        return;\n      } else {\n        this.push(null);\n        return;\n      }\n    }\n\n    const bytesLeft = this.data.length - this.readCount;\n    const numBytesToSend = Math.min(bytesLeft, this.emitSize);\n\n    const chunk = this.data.slice(this.readCount, this.readCount + numBytesToSend);\n    this.readCount += numBytesToSend;\n    this.push(chunk);\n  }\n}\n\ndescribe(\"getChunkedStream\", () => {\n  it(\"splits payloads into individual messages\", async () => {\n    const messages = [];\n    const mockMessages = [recordEventMessage, statsEventMessage, endEventMessage];\n    const mockStream = new MockEventMessageSource({\n      messages: mockMessages,\n      emitSize: 100,\n    });\n    const chunkerStream = getChunkedStream(mockStream);\n    for await (const msg of chunkerStream) {\n      messages.push(msg);\n    }\n    expect(messages.length).toBe(3);\n  });\n\n  it(\"splits payloads in correct order\", async () => {\n    const messages: Array<any> = [];\n    const mockMessages = [recordEventMessage, statsEventMessage, recordEventMessage, endEventMessage];\n    const mockStream = new MockEventMessageSource({\n      messages: mockMessages,\n      emitSize: 100,\n    });\n    const chunkerStream = getChunkedStream(mockStream);\n    for await (const msg of chunkerStream) {\n      messages.push(msg);\n    }\n    expect(messages.length).toBe(4);\n    for (let i = 0; i < mockMessages.length; i++) {\n      expect(Buffer.from(messages[i]).toString(\"base64\")).toEqual(mockMessages[i].toString(\"base64\"));\n    }\n  });\n\n  it(\"splits payloads when received all at once\", async () => {\n    const messages = [];\n    const mockMessages = [recordEventMessage, statsEventMessage, endEventMessage];\n    const mockStream = new MockEventMessageSource({\n      messages: mockMessages,\n      emitSize: mockMessages.reduce((prev, cur) => {\n        return prev + cur.length;\n      }, 0),\n    });\n    const chunkerStream = getChunkedStream(mockStream);\n    for await (const msg of chunkerStream) {\n      messages.push(msg);\n    }\n    expect(messages.length).toBe(3);\n  });\n\n  it(\"splits payloads when total event message length spans multiple chunks\", async () => {\n    const messages = [];\n    const mockMessages = [recordEventMessage, statsEventMessage, endEventMessage];\n    const mockStream = new MockEventMessageSource({\n      messages: mockMessages,\n      emitSize: 1,\n    });\n    const chunkerStream = getChunkedStream(mockStream);\n    for await (const msg of chunkerStream) {\n      messages.push(msg);\n    }\n    expect(messages.length).toBe(3);\n  });\n\n  it(\"splits payloads when total event message length spans 2 chunks\", async () => {\n    const messages = [];\n    const mockMessages = [recordEventMessage, statsEventMessage, endEventMessage];\n    const mockStream = new MockEventMessageSource({\n      messages: mockMessages,\n      emitSize: recordEventMessage.length + 2,\n    });\n    const chunkerStream = getChunkedStream(mockStream);\n    for await (const msg of chunkerStream) {\n      messages.push(msg);\n    }\n    expect(messages.length).toBe(3);\n  });\n\n  it(\"sends an error if an event message is truncated\", async () => {\n    const responseMessage = Buffer.concat([recordEventMessage, statsEventMessage, endEventMessage]);\n    const mockStream = new MockEventMessageSource({\n      messages: [responseMessage.slice(0, responseMessage.length - 4)],\n      emitSize: 10,\n    });\n\n    const chunkerStream = getChunkedStream(mockStream);\n    let error: Error | undefined = undefined;\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      for await (const msg of chunkerStream) {\n        //Pass\n      }\n    } catch (err) {\n      error = err;\n    }\n    expect(error!.message).toEqual(\"Truncated event message received.\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/getChunkedStream.ts",
    "content": "/**\n * @internal\n */\nexport function getChunkedStream(source: AsyncIterable<Uint8Array>): AsyncIterable<Uint8Array> {\n  let currentMessageTotalLength = 0;\n  let currentMessagePendingLength = 0;\n  let currentMessage: Uint8Array | null = null;\n  let messageLengthBuffer: Uint8Array | null = null;\n  const allocateMessage = (size: number) => {\n    if (typeof size !== \"number\") {\n      throw new Error(\"Attempted to allocate an event message where size was not a number: \" + size);\n    }\n    currentMessageTotalLength = size;\n    currentMessagePendingLength = 4;\n    currentMessage = new Uint8Array(size);\n    const currentMessageView = new DataView(currentMessage.buffer);\n    currentMessageView.setUint32(0, size, false); //set big-endian Uint32 to 0~3 bytes\n  };\n\n  const iterator = async function* () {\n    const sourceIterator = source[Symbol.asyncIterator]();\n    while (true) {\n      const { value, done } = await sourceIterator.next();\n      if (done) {\n        if (!currentMessageTotalLength) {\n          return;\n        } else if (currentMessageTotalLength === currentMessagePendingLength) {\n          yield currentMessage as Uint8Array;\n        } else {\n          throw new Error(\"Truncated event message received.\");\n        }\n        return;\n      }\n\n      const chunkLength = value.length;\n      let currentOffset = 0;\n\n      while (currentOffset < chunkLength) {\n        // create new message if necessary\n        if (!currentMessage) {\n          // working on a new message, determine total length\n          const bytesRemaining = chunkLength - currentOffset;\n          // prevent edge case where total length spans 2 chunks\n          if (!messageLengthBuffer) {\n            messageLengthBuffer = new Uint8Array(4);\n          }\n          const numBytesForTotal = Math.min(\n            4 - currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer\n            bytesRemaining // bytes left in chunk\n          );\n\n          messageLengthBuffer.set(\n            // @ts-ignore error TS2532: Object is possibly 'undefined' for value\n            value.slice(currentOffset, currentOffset + numBytesForTotal),\n            currentMessagePendingLength\n          );\n\n          currentMessagePendingLength += numBytesForTotal;\n          currentOffset += numBytesForTotal;\n\n          if (currentMessagePendingLength < 4) {\n            // not enough information to create the current message\n            break;\n          }\n          allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false));\n          messageLengthBuffer = null;\n        }\n\n        // write data into current message\n        const numBytesToWrite = Math.min(\n          currentMessageTotalLength - currentMessagePendingLength, // number of bytes left to complete message\n          chunkLength - currentOffset // number of bytes left in the original chunk\n        );\n        currentMessage!.set(\n          // @ts-ignore error TS2532: Object is possibly 'undefined' for value\n          value.slice(currentOffset, currentOffset + numBytesToWrite),\n          currentMessagePendingLength\n        );\n        currentMessagePendingLength += numBytesToWrite;\n        currentOffset += numBytesToWrite;\n\n        // check if a message is ready to be pushed\n        if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) {\n          // push out the message\n          yield currentMessage as Uint8Array;\n          // cleanup\n          currentMessage = null;\n          currentMessageTotalLength = 0;\n          currentMessagePendingLength = 0;\n        }\n      }\n    }\n  };\n\n  return {\n    [Symbol.asyncIterator]: iterator,\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.spec.ts",
    "content": "import { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nimport type { Message } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { EventStreamCodec } from \"../eventstream-codec/EventStreamCodec\";\nimport { endEventMessage, exception, recordEventMessage, statsEventMessage } from \"./getChunkedStream.spec\";\nimport { getUnmarshalledStream } from \"./getUnmarshalledStream\";\n\ndescribe(\"getUnmarshalledStream\", () => {\n  it(\"emits parsed payload on data\", async () => {\n    const expectedMessages: Array<Message> = [\n      {\n        headers: {\n          \":content-type\": {\n            type: \"string\",\n            value: \"application/octet-stream\",\n          },\n          \":event-type\": { type: \"string\", value: \"Records\" },\n          \":message-type\": { type: \"string\", value: \"event\" },\n        },\n        body: new Uint8Array(\n          Buffer.from(\n            `1,Foo,When life gives you foo...\\n2,Bar,make Bar!\\n3,Fizz,Sometimes paired with...\\n4,Buzz,the infamous Buzz!\\n`\n          )\n        ),\n      },\n      {\n        headers: {\n          \":content-type\": {\n            type: \"string\",\n            value: \"text/xml\",\n          },\n          \":event-type\": { type: \"string\", value: \"Stats\" },\n          \":message-type\": { type: \"string\", value: \"event\" },\n        },\n        body: new Uint8Array(\n          Buffer.from(\n            '<Stats xmlns=\"\"><BytesScanned>126</BytesScanned><BytesProcessed>126</BytesProcessed><BytesReturned>107</BytesReturned></Stats>'\n          )\n        ),\n      },\n      {\n        headers: {\n          \":event-type\": { type: \"string\", value: \"End\" },\n          \":message-type\": { type: \"string\", value: \"event\" },\n        },\n        body: new Uint8Array(),\n      },\n    ];\n\n    const source = async function* () {\n      yield recordEventMessage;\n      yield statsEventMessage;\n      yield endEventMessage;\n    };\n    const unmarshallerStream = getUnmarshalledStream(source(), {\n      eventStreamCodec: new EventStreamCodec(toUtf8, fromUtf8),\n      deserializer: (message) => Promise.resolve(message),\n      toUtf8,\n    });\n    const messages: Array<Message> = [];\n    for await (const message of unmarshallerStream) {\n      messages.push(message[Object.keys(message)[0]]);\n    }\n    for (let i = 1; i < messages.length; i++) {\n      expect(messages[i]).toEqual(expectedMessages[i]);\n    }\n  });\n\n  it(\"throws when deserializer throws an error\", async () => {\n    const source = {\n      [Symbol.asyncIterator]: async function* () {\n        yield exception;\n      },\n    };\n    const deserStream = getUnmarshalledStream(source, {\n      eventStreamCodec: new EventStreamCodec(toUtf8, fromUtf8),\n      deserializer: () => {\n        throw new Error(\"error event\");\n      },\n      toUtf8,\n    });\n    let error: Error | undefined = undefined;\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      for await (const event of deserStream) {\n        //pass.\n      }\n    } catch (e) {\n      error = e;\n    }\n    expect(error).toBeDefined();\n    expect(error!.message).toEqual(\"error event\");\n  });\n\n  it(\"throws on exception event if deserializer doesn't throw\", async () => {\n    //This could happened if client-side SDK is not up-to-date\n    const source = {\n      [Symbol.asyncIterator]: async function* () {\n        yield exception;\n      },\n    };\n    const deserStream = getUnmarshalledStream(source, {\n      eventStreamCodec: new EventStreamCodec(toUtf8, fromUtf8),\n      deserializer: (message) =>\n        Promise.resolve({\n          $unknown: message,\n        }),\n      toUtf8,\n    });\n    let error: Error | undefined = undefined;\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      for await (const event of deserStream) {\n        //pass.\n      }\n    } catch (e) {\n      error = e;\n    }\n    expect(error).toBeDefined();\n    expect(error?.name).toEqual(\"Exception\");\n    expect(error?.message).toEqual(\"This is a modeled exception event that would be thrown in deserializer.\");\n  });\n\n  it(\"omit the unknown event type\", async () => {\n    const source = async function* () {\n      yield recordEventMessage;\n    };\n    const unmarshallerStream = getUnmarshalledStream(source(), {\n      eventStreamCodec: new EventStreamCodec(toUtf8, fromUtf8),\n      deserializer: (message) =>\n        Promise.resolve({\n          $unknown: message,\n        } as any), //deserializer that parse anything into unknown event\n      toUtf8,\n    });\n    const messages: Array<Message> = [];\n    for await (const message of unmarshallerStream) {\n      messages.push(message[Object.keys(message)[0]]);\n    }\n    expect(messages.length).toEqual(0);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.ts",
    "content": "import type { Encoder, Message } from \"@smithy/types\";\n\nimport type { EventStreamCodec } from \"../eventstream-codec/EventStreamCodec\";\n\n/**\n * @internal\n */\nexport type UnmarshalledStreamOptions<T> = {\n  eventStreamCodec: EventStreamCodec;\n  deserializer: (input: Record<string, Message>) => Promise<T>;\n  toUtf8: Encoder;\n};\n\n/**\n * @internal\n */\nexport function getUnmarshalledStream<T extends Record<string, any>>(\n  source: AsyncIterable<Uint8Array>,\n  options: UnmarshalledStreamOptions<T>\n): AsyncIterable<T> {\n  const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8);\n  return {\n    [Symbol.asyncIterator]: async function* () {\n      for await (const chunk of source) {\n        const message = options.eventStreamCodec.decode(chunk);\n        const type = await messageUnmarshaller(message);\n        if (type === undefined) continue;\n        yield type;\n      }\n    },\n  };\n}\n\n/**\n * @internal\n */\nexport function getMessageUnmarshaller<T extends Record<string, any>>(\n  deserializer: (input: Record<string, Message>) => Promise<T>,\n  toUtf8: Encoder\n): (input: Message) => Promise<T | undefined> {\n  return async function (message: Message): Promise<T | undefined> {\n    const { value: messageType } = message.headers[\":message-type\"];\n    if (messageType === \"error\") {\n      // Unmodeled exception in event\n      const unmodeledError = new Error((message.headers[\":error-message\"].value as string) || \"UnknownError\");\n      unmodeledError.name = message.headers[\":error-code\"].value as string;\n      throw unmodeledError;\n    } else if (messageType === \"exception\") {\n      // For modeled exception, push it to deserializer and throw after deserializing\n      const code = message.headers[\":exception-type\"].value as string;\n      const exception = { [code]: message };\n      // Get parsed exception event in key(error code) value(structured error) pair.\n      const deserializedException = await deserializer(exception);\n      if (deserializedException.$unknown) {\n        //this is an unmodeled exception then try parsing it with best effort\n        const error = new Error(toUtf8(message.body));\n        error.name = code;\n        throw error;\n      }\n      throw deserializedException[code];\n    } else if (messageType === \"event\") {\n      const event = {\n        [message.headers[\":event-type\"].value as string]: message,\n      };\n      const deserialized = await deserializer(event);\n      if (deserialized.$unknown) return;\n      return deserialized;\n    } else {\n      throw Error(`Unrecognizable event type: ${message.headers[\":event-type\"].value}`);\n    }\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/index.browser.ts",
    "content": "// @smithy/eventstream-codec\nexport { EventStreamCodec } from \"./eventstream-codec/EventStreamCodec\";\nexport { HeaderMarshaller } from \"./eventstream-codec/HeaderMarshaller\";\nexport { Int64 } from \"./eventstream-codec/Int64\";\nexport type {\n  Message,\n  MessageHeaders,\n  MessageHeaderValue,\n  BooleanHeaderValue,\n  ByteHeaderValue,\n  ShortHeaderValue,\n  IntegerHeaderValue,\n  LongHeaderValue,\n  BinaryHeaderValue,\n  StringHeaderValue,\n  TimestampHeaderValue,\n  UuidHeaderValue,\n} from \"./eventstream-codec/Message\";\nexport { MessageDecoderStream } from \"./eventstream-codec/MessageDecoderStream\";\nexport type { MessageDecoderStreamOptions } from \"./eventstream-codec/MessageDecoderStream\";\nexport { MessageEncoderStream } from \"./eventstream-codec/MessageEncoderStream\";\nexport type { MessageEncoderStreamOptions } from \"./eventstream-codec/MessageEncoderStream\";\nexport { SmithyMessageDecoderStream } from \"./eventstream-codec/SmithyMessageDecoderStream\";\nexport type { SmithyMessageDecoderStreamOptions } from \"./eventstream-codec/SmithyMessageDecoderStream\";\nexport { SmithyMessageEncoderStream } from \"./eventstream-codec/SmithyMessageEncoderStream\";\nexport type { SmithyMessageEncoderStreamOptions } from \"./eventstream-codec/SmithyMessageEncoderStream\";\n\n// @smithy/eventstream-serde-browser\nexport { EventStreamMarshaller, eventStreamSerdeProvider } from \"./eventstream-serde/EventStreamMarshaller.browser\";\nexport type { EventStreamMarshallerOptions } from \"./eventstream-serde/EventStreamMarshaller.browser\";\nexport { readableStreamToIterable, iterableToReadableStream } from \"./eventstream-serde/utils\";\n\n// @smithy/eventstream-serde-universal\nexport {\n  EventStreamMarshaller as UniversalEventStreamMarshaller,\n  eventStreamSerdeProvider as universalEventStreamSerdeProvider,\n} from \"./eventstream-serde-universal/EventStreamMarshaller\";\nexport type { EventStreamMarshallerOptions as UniversalEventStreamMarshallerOptions } from \"./eventstream-serde-universal/EventStreamMarshaller\";\nexport { getChunkedStream } from \"./eventstream-serde-universal/getChunkedStream\";\nexport { getUnmarshalledStream, getMessageUnmarshaller } from \"./eventstream-serde-universal/getUnmarshalledStream\";\nexport type { UnmarshalledStreamOptions } from \"./eventstream-serde-universal/getUnmarshalledStream\";\n\n// @smithy/eventstream-serde-config-resolver\nexport { resolveEventStreamSerdeConfig } from \"./eventstream-serde-config-resolver/EventStreamSerdeConfig\";\nexport type {\n  EventStreamSerdeInputConfig,\n  EventStreamSerdeResolvedConfig,\n} from \"./eventstream-serde-config-resolver/EventStreamSerdeConfig\";\n\n// EventStreamSerde\nexport { EventStreamSerde } from \"./EventStreamSerde\";\n"
  },
  {
    "path": "packages/core/src/submodules/event-streams/index.ts",
    "content": "// @smithy/eventstream-codec\nexport { EventStreamCodec } from \"./eventstream-codec/EventStreamCodec\";\nexport { HeaderMarshaller } from \"./eventstream-codec/HeaderMarshaller\";\nexport { Int64 } from \"./eventstream-codec/Int64\";\nexport type {\n  Message,\n  MessageHeaders,\n  MessageHeaderValue,\n  BooleanHeaderValue,\n  ByteHeaderValue,\n  ShortHeaderValue,\n  IntegerHeaderValue,\n  LongHeaderValue,\n  BinaryHeaderValue,\n  StringHeaderValue,\n  TimestampHeaderValue,\n  UuidHeaderValue,\n} from \"./eventstream-codec/Message\";\nexport { MessageDecoderStream } from \"./eventstream-codec/MessageDecoderStream\";\nexport type { MessageDecoderStreamOptions } from \"./eventstream-codec/MessageDecoderStream\";\nexport { MessageEncoderStream } from \"./eventstream-codec/MessageEncoderStream\";\nexport type { MessageEncoderStreamOptions } from \"./eventstream-codec/MessageEncoderStream\";\nexport { SmithyMessageDecoderStream } from \"./eventstream-codec/SmithyMessageDecoderStream\";\nexport type { SmithyMessageDecoderStreamOptions } from \"./eventstream-codec/SmithyMessageDecoderStream\";\nexport { SmithyMessageEncoderStream } from \"./eventstream-codec/SmithyMessageEncoderStream\";\nexport type { SmithyMessageEncoderStreamOptions } from \"./eventstream-codec/SmithyMessageEncoderStream\";\n\n// @smithy/eventstream-serde-node\nexport { EventStreamMarshaller, eventStreamSerdeProvider } from \"./eventstream-serde/EventStreamMarshaller\";\nexport type { EventStreamMarshallerOptions } from \"./eventstream-serde/EventStreamMarshaller\";\nexport { readableStreamToIterable, iterableToReadableStream } from \"./eventstream-serde/utils\";\n\n// @smithy/eventstream-serde-universal\nexport {\n  EventStreamMarshaller as UniversalEventStreamMarshaller,\n  eventStreamSerdeProvider as universalEventStreamSerdeProvider,\n} from \"./eventstream-serde-universal/EventStreamMarshaller\";\nexport type { EventStreamMarshallerOptions as UniversalEventStreamMarshallerOptions } from \"./eventstream-serde-universal/EventStreamMarshaller\";\nexport { getChunkedStream } from \"./eventstream-serde-universal/getChunkedStream\";\nexport { getUnmarshalledStream, getMessageUnmarshaller } from \"./eventstream-serde-universal/getUnmarshalledStream\";\nexport type { UnmarshalledStreamOptions } from \"./eventstream-serde-universal/getUnmarshalledStream\";\n\n// @smithy/eventstream-serde-config-resolver\nexport { resolveEventStreamSerdeConfig } from \"./eventstream-serde-config-resolver/EventStreamSerdeConfig\";\nexport type {\n  EventStreamSerdeInputConfig,\n  EventStreamSerdeResolvedConfig,\n} from \"./eventstream-serde-config-resolver/EventStreamSerdeConfig\";\n\n// EventStreamSerde\nexport { EventStreamSerde } from \"./EventStreamSerde\";\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/HttpBindingProtocol.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { NormalizedSchema, op, type TypeRegistry } from \"@smithy/core/schema\";\nimport { LazyJsonString, dateToUtcString, generateIdempotencyToken, quoteHeader, toBase64 } from \"@smithy/core/serde\";\nimport { streamCollector } from \"@smithy/node-http-handler\";\nimport { HttpResponse } from \"@smithy/protocol-http\";\nimport type {\n  $Schema,\n  $ShapeSerializer,\n  Codec,\n  CodecSettings,\n  HandlerExecutionContext,\n  HttpResponse as IHttpResponse,\n  ListSchemaModifier,\n  MapSchemaModifier,\n  MetadataBearer,\n  NumericSchema,\n  OperationSchema,\n  ResponseMetadata,\n  SerdeFunctions,\n  ShapeDeserializer,\n  ShapeSerializer,\n  StaticStructureSchema,\n  StringSchema,\n  TimestampDateTimeSchema,\n  TimestampDefaultSchema,\n  TimestampEpochSecondsSchema,\n  TimestampHttpDateSchema,\n} from \"@smithy/types\";\nimport { parseUrl } from \"@smithy/url-parser\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { HttpBindingProtocol } from \"./HttpBindingProtocol\";\nimport { SerdeContext } from \"./SerdeContext\";\nimport { FromStringShapeDeserializer } from \"./serde/FromStringShapeDeserializer\";\nimport { determineTimestampFormat } from \"./serde/determineTimestampFormat\";\n\ndescribe(HttpBindingProtocol.name, () => {\n  class ToStringTestShapeSerializer extends SerdeContext implements $ShapeSerializer<string> {\n    private stringBuffer = \"\";\n\n    public constructor(private settings: CodecSettings) {\n      super();\n    }\n\n    public write(schema: $Schema, value: unknown): void {\n      const ns = NormalizedSchema.of(schema);\n      switch (typeof value) {\n        case \"object\":\n          if (value === null) {\n            this.stringBuffer = \"null\";\n            return;\n          }\n          if (ns.isTimestampSchema()) {\n            if (!(value instanceof Date)) {\n              throw new Error(\n                `@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(\n                  true\n                )}`\n              );\n            }\n            const format = determineTimestampFormat(ns, this.settings);\n            switch (format) {\n              case 5 satisfies TimestampDateTimeSchema:\n                this.stringBuffer = value.toISOString().replace(\".000Z\", \"Z\");\n                break;\n              case 6 satisfies TimestampHttpDateSchema:\n                this.stringBuffer = dateToUtcString(value);\n                break;\n              case 7 satisfies TimestampEpochSecondsSchema:\n                this.stringBuffer = String(value.getTime() / 1000);\n                break;\n              default:\n                console.warn(\"Missing timestamp format, using epoch seconds\", value);\n                this.stringBuffer = String(value.getTime() / 1000);\n            }\n            return;\n          }\n          if (ns.isBlobSchema() && \"byteLength\" in (value as Uint8Array)) {\n            this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value as Uint8Array);\n            return;\n          }\n          if (ns.isListSchema() && Array.isArray(value)) {\n            let buffer = \"\";\n            for (const item of value) {\n              this.write([ns.getValueSchema(), ns.getMergedTraits()], item);\n              const headerItem = this.flush();\n              const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem);\n              if (buffer !== \"\") {\n                buffer += \", \";\n              }\n              buffer += serialized;\n            }\n            this.stringBuffer = buffer;\n            return;\n          }\n          let b = \"\";\n          b += \"{\";\n          const keyValues = [];\n          for (const [k, $] of ns.structIterator()) {\n            let row = \"\";\n            const v = (value as any)[k];\n            if (v != null || $.isIdempotencyToken()) {\n              row += `\"${k}\":\"`;\n              this.write($, v);\n              row += this.stringBuffer;\n              this.stringBuffer = \"\";\n              row += `\"`;\n              keyValues.push(row);\n            }\n          }\n          b += keyValues.join(\",\");\n          b += \"}\";\n          this.stringBuffer = b;\n          break;\n        case \"string\":\n          const mediaType = ns.getMergedTraits().mediaType;\n          let intermediateValue: string | LazyJsonString = value;\n          if (mediaType) {\n            const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n            if (isJson) {\n              intermediateValue = LazyJsonString.from(intermediateValue);\n            }\n            if (ns.getMergedTraits().httpHeader) {\n              this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString());\n              return;\n            }\n          }\n          this.stringBuffer = value;\n          break;\n        default:\n          if (ns.isIdempotencyToken()) {\n            this.stringBuffer = generateIdempotencyToken();\n          } else {\n            this.stringBuffer = String(value);\n          }\n      }\n    }\n\n    public flush(): string {\n      const buffer = this.stringBuffer;\n      this.stringBuffer = \"\";\n      return buffer;\n    }\n  }\n\n  class StringRestProtocol extends HttpBindingProtocol {\n    protected serializer: ShapeSerializer<string | Uint8Array>;\n    protected deserializer: ShapeDeserializer<string | Uint8Array>;\n\n    public constructor(\n      {\n        defaultNamespace = \"\",\n        errorTypeRegistries = [],\n      }: {\n        defaultNamespace: string;\n        errorTypeRegistries?: TypeRegistry[];\n      } = {\n        defaultNamespace: \"\",\n        errorTypeRegistries: [],\n      }\n    ) {\n      super({\n        defaultNamespace,\n        errorTypeRegistries,\n      });\n      const settings: CodecSettings = {\n        timestampFormat: {\n          useTrait: true,\n          default: 7 satisfies TimestampEpochSecondsSchema,\n        },\n        httpBindings: true,\n      };\n      this.serializer = new ToStringTestShapeSerializer(settings);\n      this.deserializer = new FromStringShapeDeserializer(settings);\n    }\n\n    public getShapeId(): string {\n      throw new Error(\"Method not implemented.\");\n    }\n\n    public getPayloadCodec(): Codec<any, any> {\n      throw new Error(\"Method not implemented.\");\n    }\n\n    protected handleError(\n      operationSchema: OperationSchema,\n      context: HandlerExecutionContext,\n      response: IHttpResponse,\n      dataObject: any,\n      metadata: ResponseMetadata\n    ): Promise<never> {\n      void [operationSchema, context, response, dataObject, metadata];\n      throw new Error(\"Method not implemented.\");\n    }\n  }\n\n  it(\"should deserialize timestamp list with unescaped commas\", async () => {\n    const response = new HttpResponse({\n      statusCode: 200,\n      headers: {\n        \"x-timestamplist\": \"Mon, 16 Nov 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT\",\n      },\n    });\n\n    const protocol = new StringRestProtocol();\n    const output = (await protocol.deserializeResponse(\n      op(\"\", \"\", 0, \"unit\", [\n        3,\n        \"\",\n        \"\",\n        0,\n        [\"timestampList\"],\n        [\n          [\n            (64 satisfies ListSchemaModifier) | (4 satisfies TimestampDefaultSchema),\n            {\n              httpHeader: \"x-timestamplist\",\n            },\n          ],\n        ],\n      ]),\n      {} as any,\n      response\n    )) as Partial<MetadataBearer>;\n    delete output.$metadata;\n    expect(output).toEqual({\n      timestampList: [new Date(\"2019-11-16T23:48:18.000Z\"), new Date(\"2019-12-16T23:48:18.000Z\")],\n    });\n  });\n\n  it(\"should deserialize all headers when httpPrefixHeaders value is empty string\", async () => {\n    const response = new HttpResponse({\n      statusCode: 200,\n      headers: {\n        \"x-tents\": \"tents\",\n        hello: \"Hello\",\n      },\n    });\n\n    const protocol = new StringRestProtocol();\n    const output = (await protocol.deserializeResponse(\n      op(\"\", \"\", 0, \"unit\", [\n        3,\n        \"\",\n        \"\",\n        0,\n        [\"httpPrefixHeaders\"],\n        [\n          [\n            (128 satisfies MapSchemaModifier) | (0 satisfies StringSchema),\n            {\n              httpPrefixHeaders: \"\",\n            },\n          ],\n        ],\n      ]),\n      {} as any,\n      response\n    )) as Partial<MetadataBearer>;\n    delete output.$metadata;\n    expect(output).toEqual({\n      httpPrefixHeaders: {\n        \"x-tents\": \"tents\",\n        hello: \"Hello\",\n      },\n    });\n  });\n\n  it(\"should serialize custom paths in context-provided endpoint\", async () => {\n    const protocol = new StringRestProtocol();\n    const request = await protocol.serializeRequest(\n      op(\n        \"\",\n        \"\",\n        {\n          http: [\"GET\", \"/Operation\", 200],\n        },\n        \"unit\",\n        \"unit\"\n      ),\n      {},\n      {\n        endpoint: async () => parseUrl(\"https://localhost/custom\"),\n      } as any\n    );\n    expect(request.path).toEqual(\"/custom/Operation\");\n  });\n\n  it(\"can deserialize a prefix header binding and header binding from the same header\", async () => {\n    type TestSignature = (\n      schema: $Schema,\n      context: HandlerExecutionContext & SerdeFunctions,\n      response: IHttpResponse,\n      dataObject: any\n    ) => Promise<string[]>;\n    const deserializeHttpMessage = ((StringRestProtocol.prototype as any).deserializeHttpMessage as TestSignature).bind(\n      {\n        deserializer: new FromStringShapeDeserializer({\n          httpBindings: true,\n          timestampFormat: {\n            useTrait: true,\n            default: 7 satisfies TimestampEpochSecondsSchema,\n          },\n        }),\n      }\n    );\n    const httpResponse: IHttpResponse = {\n      statusCode: 200,\n      headers: {\n        \"my-header\": \"header-value\",\n      },\n    };\n    const dataObject = {};\n    await deserializeHttpMessage(\n      [\n        3,\n        \"\",\n        \"Struct\",\n        0,\n        [\"prefixHeaders\", \"header\"],\n        [\n          [[2, \"\", \"Map\", 0, 0, 0], { httpPrefixHeaders: \"my-\" }],\n          [0, { httpHeader: \"my-header\" }],\n        ],\n      ],\n      {} as any,\n      httpResponse,\n      dataObject\n    );\n    expect(dataObject).toEqual({\n      prefixHeaders: {\n        header: \"header-value\",\n      },\n      header: \"header-value\",\n    });\n  });\n\n  it(\"should fill in undefined idempotency tokens\", async () => {\n    const protocol = new StringRestProtocol();\n    const request = await protocol.serializeRequest(\n      op(\n        \"\",\n        \"\",\n        {\n          http: [\"GET\", \"/{labelToken}/Operation\", 200],\n        },\n        [\n          3,\n          \"ns\",\n          \"Struct\",\n          0,\n          [\"name\", \"queryToken\", \"labelToken\", \"headerToken\"],\n          [\n            0,\n            [0, { idempotencyToken: 1, httpQuery: \"token\" }],\n            [0, { idempotencyToken: 1, httpLabel: 1 }],\n            [0, { idempotencyToken: 1, httpHeader: \"header-token\" }],\n          ],\n        ] satisfies StaticStructureSchema,\n        \"unit\"\n      ),\n      {\n        Name: \"my-name\",\n      },\n      {\n        endpoint: async () => parseUrl(\"https://localhost/custom\"),\n      } as any\n    );\n\n    expect(request.query?.token).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);\n    expect(request.path).toMatch(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/);\n    expect(request.headers?.[\"header-token\"]).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);\n  });\n\n  it(\"should not serialize http-location-bound idempotency tokens into the body\", async () => {\n    const protocol = new StringRestProtocol();\n    const request = await protocol.serializeRequest(\n      op(\n        \"\",\n        \"\",\n        {\n          http: [\"GET\", \"/Operation\", 200],\n        },\n        [\n          3,\n          \"ns\",\n          \"Struct\",\n          0,\n          [\"headerToken\", \"queryToken\", \"body1\", \"body2\", \"bodyToken\"],\n          [\n            [0, { idempotencyToken: 1, httpQuery: \"query-token\" }],\n            [0, { idempotencyToken: 1, httpHeader: \"header-token\" }],\n            0,\n            0,\n            [0, 0b0000_0100],\n          ],\n        ] satisfies StaticStructureSchema,\n        \"unit\"\n      ),\n      {\n        headerToken: undefined,\n        body1: \"text\",\n        body2: \"more text\",\n        bodyToken: undefined,\n      },\n      {\n        endpoint: async () => parseUrl(\"https://localhost/custom\"),\n      } as any\n    );\n\n    expect(request.headers[\"header-token\"]).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);\n    expect(request.query?.[\"query-token\"]).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);\n    const body = JSON.parse(request.body);\n    expect(body).toMatchObject({\n      body1: \"text\",\n      body2: \"more text\",\n      bodyToken: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,\n    });\n    expect(body.headerToken).toBeUndefined();\n  });\n\n  it(\"should discard response bodies for Unit operation outputs, making no attempt to parse them\", async () => {\n    const protocol = new StringRestProtocol();\n    let streamProgress = 0;\n    const response = await protocol.deserializeResponse(\n      op(\"\", \"\", {}, \"unit\", \"unit\"),\n      {\n        streamCollector: streamCollector,\n      } as any,\n      new HttpResponse({\n        statusCode: 200,\n        headers: {},\n        body: Readable.from({\n          async *[Symbol.asyncIterator]() {\n            yield \"@\";\n            streamProgress = 25;\n            yield \"#\";\n            streamProgress = 50;\n            yield \"$\";\n            streamProgress = 75;\n            yield \"%\";\n            streamProgress = 100;\n          },\n        }),\n      })\n    );\n\n    expect(response).toEqual({\n      $metadata: {\n        cfId: undefined,\n        extendedRequestId: undefined,\n        httpStatusCode: 200,\n        requestId: undefined,\n      },\n    });\n\n    expect(streamProgress).toBe(100);\n  });\n\n  it(\"should not create undefined fields when deserializing non-http-binding members of an output shape\", async () => {\n    const protocol = new StringRestProtocol();\n    const response = new HttpResponse({\n      statusCode: 200,\n      headers: {},\n      body: Readable.from(JSON.stringify({})),\n    });\n\n    const output = (await protocol.deserializeResponse(\n      op(\"\", \"\", 0, \"unit\", [3, \"\", \"\", 0, [\"prop\", \"num\"], [0 satisfies StringSchema, 1 satisfies NumericSchema]]),\n      {\n        streamCollector: streamCollector,\n      } as any,\n      response\n    )) as Partial<MetadataBearer>;\n\n    // Fields not present in response should not exist in output\n    expect(\"prop\" in output).toBe(false);\n    expect(\"num\" in output).toBe(false);\n\n    // Only $metadata should be present\n    const keys = Object.keys(output);\n    expect(keys).toEqual([\"$metadata\"]);\n  });\n\n  describe(\"input not mutated by serializeRequest\", () => {\n    it(\"considers non-object inputs to be equivalent to empty objects\", async () => {\n      const protocol = new StringRestProtocol();\n\n      for (const input of [null, undefined, 5, false, \"hello\", \"{}\"]) {\n        const request = await protocol.serializeRequest(\n          op(\n            \"\",\n            \"\",\n            {\n              http: [\"PUT\", \"/resource\", 200],\n            },\n            [3, \"ns\", \"Struct\", 0, [\"a\", \"b\", \"c\"], [0, 0, 0]] satisfies StaticStructureSchema,\n            \"unit\"\n          ),\n          input as any,\n          {\n            endpoint: async () => parseUrl(\"https://localhost\"),\n          } as any\n        );\n\n        expect(request.path).toEqual(\"/resource\");\n        expect(request.body).toEqual(undefined);\n      }\n    });\n\n    it(\"should not mutate the caller's input object\", async () => {\n      const protocol = new StringRestProtocol();\n      const input = Object.freeze({\n        labelField: \"my-id\",\n        headerField: \"header-val\",\n        queryField: \"q\",\n        bodyField: \"body-val\",\n      });\n\n      const request = await protocol.serializeRequest(\n        op(\n          \"\",\n          \"\",\n          {\n            http: [\"PUT\", \"/{labelField}/resource\", 200],\n          },\n          [\n            3,\n            \"ns\",\n            \"Struct\",\n            0,\n            [\"labelField\", \"headerField\", \"queryField\", \"bodyField\"],\n            [[0, { httpLabel: 1 }], [0, { httpHeader: \"x-header\" }], [0, { httpQuery: \"q\" }], 0],\n          ] satisfies StaticStructureSchema,\n          \"unit\"\n        ),\n        input,\n        {\n          endpoint: async () => parseUrl(\"https://localhost\"),\n        } as any\n      );\n\n      // HTTP bindings are correctly placed\n      expect(request.path).toContain(\"my-id\");\n      expect(request.headers[\"x-header\"]).toBe(\"header-val\");\n      expect(request.query?.q).toBe(\"q\");\n\n      // Body contains only the non-HTTP-bound member\n      const body = JSON.parse(request.body);\n      expect(body).toEqual({ bodyField: \"body-val\" });\n      expect(body.labelField).toBeUndefined();\n      expect(body.headerField).toBeUndefined();\n      expect(body.queryField).toBeUndefined();\n\n      // Original input is untouched (frozen object didn't throw)\n      expect(input.labelField).toBe(\"my-id\");\n      expect(input.headerField).toBe(\"header-val\");\n      expect(input.queryField).toBe(\"q\");\n      expect(input.bodyField).toBe(\"body-val\");\n    });\n\n    it(\"should not leak httpPayload member into body when there are also body members\", async () => {\n      const protocol = new StringRestProtocol();\n      const input = Object.freeze({\n        payloadField: \"payload-data\",\n        headerField: \"hdr\",\n      });\n\n      const request = await protocol.serializeRequest(\n        op(\n          \"\",\n          \"\",\n          {\n            http: [\"POST\", \"/resource\", 200],\n          },\n          [\n            3,\n            \"ns\",\n            \"Struct\",\n            0,\n            [\"payloadField\", \"headerField\"],\n            [\n              [0, { httpPayload: 1 }],\n              [0, { httpHeader: \"x-hdr\" }],\n            ],\n          ] satisfies StaticStructureSchema,\n          \"unit\"\n        ),\n        input,\n        {\n          endpoint: async () => parseUrl(\"https://localhost\"),\n        } as any\n      );\n\n      expect(request.headers[\"x-hdr\"]).toBe(\"hdr\");\n      // payload is the httpPayload member directly, not a JSON body\n      expect(request.body).toBe(\"payload-data\");\n    });\n\n    it(\"should not leak httpPrefixHeaders members into body\", async () => {\n      const protocol = new StringRestProtocol();\n      const input = Object.freeze({\n        prefixHeaders: { suffix1: \"val1\", suffix2: \"val2\" },\n        bodyField: \"body-data\",\n      });\n\n      const request = await protocol.serializeRequest(\n        op(\n          \"\",\n          \"\",\n          {\n            http: [\"POST\", \"/resource\", 200],\n          },\n          [\n            3,\n            \"ns\",\n            \"Struct\",\n            0,\n            [\"prefixHeaders\", \"bodyField\"],\n            [[[2, \"\", \"Map\", 0, 0, 0], { httpPrefixHeaders: \"x-prefix-\" }], 0],\n          ] satisfies StaticStructureSchema,\n          \"unit\"\n        ),\n        input,\n        {\n          endpoint: async () => parseUrl(\"https://localhost\"),\n        } as any\n      );\n\n      expect(request.headers[\"x-prefix-suffix1\"]).toBe(\"val1\");\n      expect(request.headers[\"x-prefix-suffix2\"]).toBe(\"val2\");\n      const body = JSON.parse(request.body);\n      expect(body).toEqual({ bodyField: \"body-data\" });\n      expect(body.prefixHeaders).toBeUndefined();\n    });\n\n    it(\"should not leak httpQueryParams members into body\", async () => {\n      const protocol = new StringRestProtocol();\n      const input = Object.freeze({\n        queryParams: \"qval\",\n        bodyField: \"body-data\",\n      });\n\n      const request = await protocol.serializeRequest(\n        op(\n          \"\",\n          \"\",\n          {\n            http: [\"POST\", \"/resource\", 200],\n          },\n          [\n            3,\n            \"ns\",\n            \"Struct\",\n            0,\n            [\"queryParams\", \"bodyField\"],\n            [[0, { httpQueryParams: 1 }], 0],\n          ] satisfies StaticStructureSchema,\n          \"unit\"\n        ),\n        input,\n        {\n          endpoint: async () => parseUrl(\"https://localhost\"),\n        } as any\n      );\n\n      const body = JSON.parse(request.body);\n      expect(body).toEqual({ bodyField: \"body-data\" });\n      expect(body.queryParams).toBeUndefined();\n    });\n  });\n\n  describe(\"httpLabel\", () => {\n    it(\"should throw an error if an httpLabel is missing\", async () => {\n      const protocol = new StringRestProtocol();\n      await expect(\n        protocol.serializeRequest(\n          op(\n            \"ns\",\n            \"operation\",\n            {\n              http: [\"GET\", \"/path/{labelGoesHere}/operation?arg=1\", 200],\n            },\n            [3, \"ns\", \"Struct\", 0, [\"labelGoesHere\"], [[0, { httpLabel: 1 }]]] satisfies StaticStructureSchema,\n            \"unit\"\n          ),\n          {},\n          {\n            endpoint: async () => parseUrl(\"https://localhost\"),\n          } as any\n        )\n      ).rejects.toThrow(\"No value provided for input HTTP label: labelGoesHere.\");\n    });\n\n    it(\"should not throw if the request path does not contain the missing httpLabel (edge case)\", async () => {\n      const protocol = new StringRestProtocol();\n      await protocol.serializeRequest(\n        op(\n          \"ns\",\n          \"operation\",\n          {\n            http: [\"GET\", \"/path/operation?arg=1\", 200],\n          },\n          [3, \"ns\", \"Struct\", 0, [\"labelGoesHere\"], [[0, { httpLabel: 1 }]]] satisfies StaticStructureSchema,\n          \"unit\"\n        ),\n        {},\n        {\n          endpoint: async () => parseUrl(\"https://localhost\"),\n        } as any\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/HttpBindingProtocol.ts",
    "content": "import { NormalizedSchema, translateTraits, type TypeRegistry } from \"@smithy/core/schema\";\nimport { sdkStreamMixin, splitEvery, splitHeader } from \"@smithy/core/serde\";\nimport type {\n  DocumentSchema,\n  Endpoint,\n  EndpointBearer,\n  HandlerExecutionContext,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  MetadataBearer,\n  OperationSchema,\n  Schema,\n  SerdeFunctions,\n  StaticStructureSchema,\n  TimestampDefaultSchema,\n} from \"@smithy/types\";\n\nimport { HttpProtocol } from \"./HttpProtocol\";\nimport { collectBody } from \"./collect-stream-body\";\nimport { extendedEncodeURIComponent } from \"./extended-encode-uri-component\";\nimport { HttpRequest } from \"./protocol-http/httpRequest\";\n\n/**\n * Base for HTTP-binding protocols. Downstream examples\n * include AWS REST JSON and AWS REST XML.\n *\n * @public\n */\nexport abstract class HttpBindingProtocol extends HttpProtocol {\n  /**\n   * @override\n   */\n  protected declare compositeErrorRegistry: TypeRegistry;\n\n  public async serializeRequest<Input extends object>(\n    operationSchema: OperationSchema,\n    _input: Input,\n    context: HandlerExecutionContext & SerdeFunctions & EndpointBearer\n  ): Promise<IHttpRequest> {\n    const input: any = _input && typeof _input === \"object\" ? _input : {};\n    const serializer = this.serializer;\n    const query = {} as Record<string, string | string[]>;\n    const headers = {} as Record<string, string>;\n    const endpoint: Endpoint = await context.endpoint();\n\n    const ns = NormalizedSchema.of(operationSchema?.input);\n    const payloadMemberNames: StaticStructureSchema[4] = [];\n    const payloadMemberSchemas: StaticStructureSchema[5] = [];\n\n    let hasNonHttpBindingMember = false;\n    let payload: any;\n\n    const request = new HttpRequest({\n      protocol: \"\",\n      hostname: \"\",\n      port: undefined,\n      path: \"\",\n      fragment: undefined,\n      query: query,\n      headers: headers,\n      body: undefined,\n    });\n\n    if (endpoint) {\n      this.updateServiceEndpoint(request, endpoint);\n      this.setHostPrefix(request, operationSchema, input);\n      const opTraits = translateTraits(operationSchema.traits);\n      if (opTraits.http) {\n        request.method = opTraits.http[0];\n        const [path, search] = opTraits.http[1].split(\"?\");\n        if (request.path == \"/\") {\n          request.path = path;\n        } else {\n          request.path += path;\n        }\n        const traitSearchParams = new URLSearchParams(search ?? \"\");\n        for (const [key, value] of traitSearchParams) {\n          query[key] = value;\n        }\n      }\n    }\n\n    for (const [memberName, memberNs] of ns.structIterator()) {\n      const memberTraits = memberNs.getMergedTraits() ?? {};\n      const inputMemberValue = input[memberName];\n\n      if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {\n        if (memberTraits.httpLabel) {\n          // at this point, we have a modeled httpLabel which has no input value.\n          // We only throw if the request URI has a corresponding unfulfilled label.\n          // It would be unusual for the request path not to contain the label, perhaps a modeling\n          // error, but best to be conservative about throwing.\n          if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) {\n            throw new Error(`No value provided for input HTTP label: ${memberName}.`);\n          }\n        }\n        continue;\n      }\n\n      if (memberTraits.httpPayload) {\n        const isStreaming = memberNs.isStreaming();\n        if (isStreaming) {\n          const isEventStream = memberNs.isStructSchema();\n          if (isEventStream) {\n            // event stream (union)\n            // initial-request is handled by other HTTP bindings.\n            // no additional handling is needed here.\n            if (input[memberName]) {\n              payload = await this.serializeEventStream({\n                eventStream: input[memberName],\n                requestSchema: ns,\n              });\n            }\n          } else {\n            // data stream (blob)\n            payload = inputMemberValue;\n          }\n        } else {\n          // structural/document body\n          serializer.write(memberNs, inputMemberValue);\n          payload = serializer.flush();\n        }\n      } else if (memberTraits.httpLabel) {\n        serializer.write(memberNs, inputMemberValue);\n        const replacement = serializer.flush() as string;\n        if (request.path.includes(`{${memberName}+}`)) {\n          request.path = request.path.replace(\n            `{${memberName}+}`,\n            replacement.split(\"/\").map(extendedEncodeURIComponent).join(\"/\")\n          );\n        } else if (request.path.includes(`{${memberName}}`)) {\n          request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));\n        }\n      } else if (memberTraits.httpHeader) {\n        serializer.write(memberNs, inputMemberValue);\n        headers[memberTraits.httpHeader.toLowerCase() as string] = String(serializer.flush());\n      } else if (typeof memberTraits.httpPrefixHeaders === \"string\") {\n        for (const key in inputMemberValue) {\n          const val = inputMemberValue[key];\n          const amalgam = memberTraits.httpPrefixHeaders + key;\n          serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);\n          headers[amalgam.toLowerCase()] = serializer.flush() as string;\n        }\n      } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {\n        this.serializeQuery(memberNs, inputMemberValue, query);\n      } else {\n        hasNonHttpBindingMember = true;\n        payloadMemberNames.push(memberName);\n        payloadMemberSchemas.push(memberNs);\n      }\n    }\n\n    if (hasNonHttpBindingMember && input) {\n      const [namespace, name] = (ns.getName(true) ?? \"#Unknown\").split(\"#\");\n      const requiredMembers = (ns.getSchema() as StaticStructureSchema)[6];\n      const payloadSchema = [\n        3,\n        namespace,\n        name,\n        ns.getMergedTraits(),\n        payloadMemberNames,\n        payloadMemberSchemas,\n        undefined as number | undefined,\n      ] satisfies StaticStructureSchema;\n      if (requiredMembers) {\n        payloadSchema[6] = requiredMembers;\n      } else {\n        payloadSchema.pop();\n      }\n\n      serializer.write(payloadSchema, input);\n      payload = serializer.flush() as Uint8Array;\n\n      // Due to Smithy validation, we can assume that the members with no HTTP\n      // bindings DO NOT contain an event stream.\n    }\n\n    request.headers = headers;\n    request.query = query;\n    request.body = payload;\n\n    return request;\n  }\n\n  protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest[\"query\"]) {\n    const serializer = this.serializer;\n    const traits = ns.getMergedTraits();\n\n    if (traits.httpQueryParams) {\n      for (const key in data) {\n        if (!(key in query)) {\n          const val = data[key];\n          const valueSchema = ns.getValueSchema();\n          Object.assign(valueSchema.getMergedTraits(), {\n            // We pass on the traits to the sub-schema\n            // because we are still in the process of serializing the map itself.\n            ...traits,\n            httpQuery: key,\n            httpQueryParams: undefined,\n          });\n          this.serializeQuery(valueSchema, val, query);\n        }\n      }\n      return;\n    }\n\n    if (ns.isListSchema()) {\n      const sparse = !!ns.getMergedTraits().sparse;\n      const buffer = [];\n      for (const item of data) {\n        // We pass on the traits to the sub-schema\n        // because we are still in the process of serializing the list itself.\n        serializer.write([ns.getValueSchema(), traits], item);\n        const serializable = serializer.flush() as string;\n        if (sparse || serializable !== undefined) {\n          buffer.push(serializable);\n        }\n      }\n      query[traits.httpQuery as string] = buffer;\n    } else {\n      serializer.write([ns, traits], data);\n      query[traits.httpQuery as string] = serializer.flush() as string;\n    }\n  }\n\n  public async deserializeResponse<Output extends MetadataBearer>(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse\n  ): Promise<Output> {\n    const deserializer = this.deserializer;\n    const ns = NormalizedSchema.of(operationSchema.output);\n\n    const dataObject: any = {};\n\n    if (response.statusCode >= 300) {\n      const bytes: Uint8Array = await collectBody(response.body, context);\n      if (bytes.byteLength > 0) {\n        Object.assign(dataObject, await deserializer.read(15 satisfies DocumentSchema, bytes));\n      }\n      await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));\n      throw new Error(\"@smithy/core/protocols - HTTP Protocol error handler failed to throw.\");\n    }\n\n    for (const header in response.headers) {\n      const value = response.headers[header];\n      delete response.headers[header];\n      response.headers[header.toLowerCase()] = value;\n    }\n\n    const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);\n\n    if (nonHttpBindingMembers.length) {\n      const bytes: Uint8Array = await collectBody(response.body, context);\n      if (bytes.byteLength > 0) {\n        const dataFromBody = await deserializer.read(ns, bytes);\n        for (const member of nonHttpBindingMembers) {\n          if (dataFromBody[member] != null) {\n            dataObject[member] = dataFromBody[member];\n          }\n        }\n      }\n      // Due to Smithy validation, we can assume that the members with no HTTP\n      // bindings DO NOT contain an event stream.\n    } else if (nonHttpBindingMembers.discardResponseBody) {\n      await collectBody(response.body, context);\n    }\n\n    dataObject.$metadata = this.deserializeMetadata(response);\n    return dataObject;\n  }\n\n  /**\n   * The base method ignores HTTP bindings.\n   *\n   * @deprecated (only this signature) use signature without headerBindings.\n   * @override\n   */\n  protected async deserializeHttpMessage(\n    schema: Schema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    headerBindings: Set<string>,\n    dataObject: any\n  ): Promise<string[] & { discardResponseBody?: boolean }>;\n  protected async deserializeHttpMessage(\n    schema: Schema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    dataObject: any\n  ): Promise<string[] & { discardResponseBody?: boolean }>;\n  protected async deserializeHttpMessage(\n    schema: Schema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    arg4: unknown,\n    arg5?: unknown\n  ): Promise<string[] & { discardResponseBody?: boolean }> {\n    let dataObject: any;\n    if (arg4 instanceof Set) {\n      dataObject = arg5;\n    } else {\n      dataObject = arg4;\n    }\n\n    let discardResponseBody = true;\n    const deserializer = this.deserializer;\n    const ns = NormalizedSchema.of(schema);\n    const nonHttpBindingMembers = [] as string[] & { discardResponseBody?: boolean };\n\n    for (const [memberName, memberSchema] of ns.structIterator()) {\n      const memberTraits = memberSchema.getMemberTraits();\n\n      if (memberTraits.httpPayload) {\n        discardResponseBody = false;\n        const isStreaming = memberSchema.isStreaming();\n        if (isStreaming) {\n          const isEventStream = memberSchema.isStructSchema();\n          if (isEventStream) {\n            // event stream (union)\n            // initial-response is handled by other HTTP bindings.\n            dataObject[memberName] = await this.deserializeEventStream({\n              response,\n              responseSchema: ns,\n            });\n          } else {\n            // data stream (blob)\n            dataObject[memberName] = sdkStreamMixin(response.body);\n          }\n        } else if (response.body) {\n          const bytes: Uint8Array = await collectBody(response.body, context as SerdeFunctions);\n          if (bytes.byteLength > 0) {\n            dataObject[memberName] = await deserializer.read(memberSchema, bytes);\n          }\n        }\n      } else if (memberTraits.httpHeader) {\n        const key = String(memberTraits.httpHeader).toLowerCase();\n        const value = response.headers[key];\n        if (null != value) {\n          if (memberSchema.isListSchema()) {\n            const headerListValueSchema = memberSchema.getValueSchema();\n            headerListValueSchema.getMergedTraits().httpHeader = key;\n            let sections: string[];\n            if (\n              headerListValueSchema.isTimestampSchema() &&\n              headerListValueSchema.getSchema() === (4 satisfies TimestampDefaultSchema)\n            ) {\n              sections = splitEvery(value, \",\", 2);\n            } else {\n              sections = splitHeader(value);\n            }\n            const list = [];\n            for (const section of sections) {\n              list.push(await deserializer.read(headerListValueSchema, section.trim()));\n            }\n            dataObject[memberName] = list;\n          } else {\n            dataObject[memberName] = await deserializer.read(memberSchema, value);\n          }\n        }\n      } else if (memberTraits.httpPrefixHeaders !== undefined) {\n        dataObject[memberName] = {};\n        for (const header in response.headers) {\n          if (header.startsWith(memberTraits.httpPrefixHeaders)) {\n            const value = response.headers[header];\n            const valueSchema = memberSchema.getValueSchema();\n            valueSchema.getMergedTraits().httpHeader = header;\n            dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(\n              valueSchema,\n              value\n            );\n          }\n        }\n      } else if (memberTraits.httpResponseCode) {\n        dataObject[memberName] = response.statusCode;\n      } else {\n        nonHttpBindingMembers.push(memberName);\n      }\n    }\n    nonHttpBindingMembers.discardResponseBody = discardResponseBody;\n    return nonHttpBindingMembers;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/HttpProtocol.spec.ts",
    "content": "import { map, struct } from \"@smithy/core/schema\";\nimport { HttpRequest } from \"@smithy/protocol-http\";\nimport type {\n  EndpointV2,\n  HandlerExecutionContext,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  Schema,\n  SerdeFunctions,\n  TimestampEpochSecondsSchema,\n} from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { HttpProtocol } from \"./HttpProtocol\";\nimport { FromStringShapeDeserializer } from \"./serde/FromStringShapeDeserializer\";\n\ndescribe(HttpProtocol.name, () => {\n  describe(\"updateServiceEndpoint\", () => {\n    it(\"applies endpoint-resolved headers to the request\", () => {\n      const request = new HttpRequest({ headers: { \"content-type\": \"application/json\" } });\n      const endpoint: EndpointV2 = {\n        url: new URL(\"https://api.example.com/\"),\n        headers: {\n          \"x-api-key\": [\"my-api-key\"],\n          \"x-custom-header\": [\"value1\", \"value2\"],\n        },\n      };\n\n      HttpProtocol.prototype.updateServiceEndpoint(request, endpoint);\n\n      expect(request.headers).toEqual({\n        \"content-type\": \"application/json\",\n        \"x-api-key\": \"my-api-key\",\n        \"x-custom-header\": \"value1, value2\",\n      });\n    });\n\n    it(\"handles endpoint with no headers\", () => {\n      const request = new HttpRequest({ headers: { \"content-type\": \"application/json\" } });\n      const endpoint: EndpointV2 = {\n        url: new URL(\"https://api.example.com/\"),\n      };\n\n      HttpProtocol.prototype.updateServiceEndpoint(request, endpoint);\n\n      expect(request.headers).toEqual({ \"content-type\": \"application/json\" });\n    });\n  });\n\n  it(\"ignores http bindings (only HttpBindingProtocol uses them)\", async () => {\n    type TestSignature = (\n      schema: Schema,\n      context: HandlerExecutionContext & SerdeFunctions,\n      response: IHttpResponse,\n      dataObject: any\n    ) => Promise<string[]>;\n    const deserializeHttpMessage = ((HttpProtocol.prototype as any).deserializeHttpMessage as TestSignature).bind({\n      deserializer: new FromStringShapeDeserializer({\n        httpBindings: true,\n        timestampFormat: {\n          useTrait: true,\n          default: 7 satisfies TimestampEpochSecondsSchema,\n        },\n      }),\n    });\n    const httpResponse: IHttpResponse = {\n      statusCode: 200,\n      headers: {\n        \"my-header\": \"header-value\",\n      },\n    };\n\n    const dataObject = {};\n    await deserializeHttpMessage(\n      struct(\n        \"\",\n        \"Struct\",\n        0,\n        [\"prefixHeaders\", \"header\"],\n        [\n          [map(\"\", \"Map\", 0, 0, 0), { httpPrefixHeaders: \"my-\" }],\n          [0, { httpHeader: \"my-header\" }],\n        ]\n      ),\n      {} as any,\n      httpResponse,\n      dataObject\n    );\n    expect(dataObject).toEqual({\n      // headers were ignored\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/HttpProtocol.ts",
    "content": "import type { EventStreamSerde } from \"@smithy/core/event-streams\";\nimport { NormalizedSchema, TypeRegistry, translateTraits } from \"@smithy/core/schema\";\nimport type {\n  ClientProtocol,\n  Codec,\n  Endpoint,\n  EndpointBearer,\n  EndpointV2,\n  EventStreamMarshaller,\n  EventStreamSerdeContext,\n  HandlerExecutionContext,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  MetadataBearer,\n  OperationSchema,\n  ResponseMetadata,\n  Schema,\n  SerdeFunctions,\n  ShapeDeserializer,\n  ShapeSerializer,\n} from \"@smithy/types\";\n\nimport { SerdeContext } from \"./SerdeContext\";\nimport { HttpRequest } from \"./protocol-http/httpRequest\";\nimport { HttpResponse } from \"./protocol-http/httpResponse\";\n\n/**\n * Abstract base for HTTP-based client protocols.\n *\n * @public\n */\nexport abstract class HttpProtocol extends SerdeContext implements ClientProtocol<IHttpRequest, IHttpResponse> {\n  /**\n   * An error registry having the namespace of the modeled service,\n   * but combining all error schemas found within the service closure.\n   *\n   * Used to look up error schema during deserialization.\n   */\n  protected compositeErrorRegistry: TypeRegistry;\n  protected abstract serializer: ShapeSerializer<string | Uint8Array>;\n  protected abstract deserializer: ShapeDeserializer<string | Uint8Array>;\n\n  /**\n   * @param options.defaultNamespace - used by various implementing classes.\n   * @param options.errorTypeRegistries - registry instances that contribute to error deserialization.\n   */\n  protected constructor(\n    public readonly options: {\n      defaultNamespace: string;\n      errorTypeRegistries?: TypeRegistry[];\n    }\n  ) {\n    super();\n    this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace);\n    for (const etr of options.errorTypeRegistries ?? []) {\n      this.compositeErrorRegistry.copyFrom(etr);\n    }\n  }\n\n  public abstract getShapeId(): string;\n\n  public abstract getPayloadCodec(): Codec<any, any>;\n\n  public getRequestType(): new (...args: any[]) => IHttpRequest {\n    return HttpRequest;\n  }\n\n  public getResponseType(): new (...args: any[]) => IHttpResponse {\n    return HttpResponse;\n  }\n\n  /**\n   * @override\n   */\n  public setSerdeContext(serdeContext: SerdeFunctions): void {\n    this.serdeContext = serdeContext;\n    this.serializer.setSerdeContext(serdeContext);\n    this.deserializer.setSerdeContext(serdeContext);\n    if (this.getPayloadCodec()) {\n      this.getPayloadCodec().setSerdeContext(serdeContext);\n    }\n  }\n\n  public abstract serializeRequest<Input extends object>(\n    operationSchema: OperationSchema,\n    input: Input,\n    context: HandlerExecutionContext & SerdeFunctions & EndpointBearer\n  ): Promise<IHttpRequest>;\n\n  public updateServiceEndpoint(request: IHttpRequest, endpoint: EndpointV2 | Endpoint) {\n    if (\"url\" in endpoint) {\n      request.protocol = endpoint.url.protocol;\n      request.hostname = endpoint.url.hostname;\n      request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined;\n      request.path = endpoint.url.pathname;\n      request.fragment = endpoint.url.hash || void 0;\n      request.username = endpoint.url.username || void 0;\n      request.password = endpoint.url.password || void 0;\n      if (!request.query) {\n        request.query = {};\n      }\n      for (const [k, v] of endpoint.url.searchParams.entries()) {\n        request.query[k] = v;\n      }\n      // Apply resolved endpoint headers per Endpoints 2.0 spec.\n      if (endpoint.headers) {\n        for (const name in endpoint.headers) {\n          request.headers[name] = endpoint.headers[name].join(\", \");\n        }\n      }\n      return request;\n    } else {\n      request.protocol = endpoint.protocol;\n      request.hostname = endpoint.hostname;\n      request.port = endpoint.port ? Number(endpoint.port) : undefined;\n      request.path = endpoint.path;\n      request.query = {\n        ...endpoint.query,\n      };\n      // Apply endpoint headers for deprecated Endpoint type if present\n      if (endpoint.headers) {\n        for (const name in endpoint.headers) {\n          request.headers[name] = endpoint.headers[name];\n        }\n      }\n      return request;\n    }\n  }\n\n  public abstract deserializeResponse<Output extends MetadataBearer>(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse\n  ): Promise<Output>;\n\n  protected setHostPrefix<Input extends object>(\n    request: IHttpRequest,\n    operationSchema: OperationSchema,\n    input: Input\n  ): void {\n    if (this.serdeContext?.disableHostPrefix) {\n      return;\n    }\n    const inputNs = NormalizedSchema.of(operationSchema.input);\n    const opTraits = translateTraits(operationSchema.traits ?? {});\n\n    if (opTraits.endpoint) {\n      let hostPrefix = opTraits.endpoint?.[0];\n      if (typeof hostPrefix === \"string\") {\n        for (const [name, member] of inputNs.structIterator()) {\n          if (!member.getMergedTraits().hostLabel) {\n            continue;\n          }\n          const replacement = input[name as keyof typeof input];\n          if (typeof replacement !== \"string\") {\n            throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);\n          }\n          hostPrefix = hostPrefix.replace(`{${name}}`, replacement);\n        }\n        request.hostname = hostPrefix + request.hostname;\n      }\n    }\n  }\n\n  protected abstract handleError(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    dataObject: any,\n    metadata: ResponseMetadata\n  ): Promise<never>;\n\n  protected deserializeMetadata(output: IHttpResponse): ResponseMetadata {\n    return {\n      httpStatusCode: output.statusCode,\n      requestId:\n        output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"] ?? output.headers[\"x-amz-request-id\"],\n      extendedRequestId: output.headers[\"x-amz-id-2\"],\n      cfId: output.headers[\"x-amz-cf-id\"],\n    };\n  }\n\n  /**\n   * @param eventStream - the iterable provided by the caller.\n   * @param requestSchema - the schema of the event stream container (struct).\n   * @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).\n   *\n   * @returns a stream suitable for the HTTP body of a request.\n   */\n  protected async serializeEventStream({\n    eventStream,\n    requestSchema,\n    initialRequest,\n  }: {\n    eventStream: AsyncIterable<any>;\n    requestSchema: NormalizedSchema;\n    initialRequest?: any;\n  }): Promise<IHttpRequest[\"body\"]> {\n    const eventStreamSerde = await this.loadEventStreamCapability();\n    return eventStreamSerde.serializeEventStream({\n      eventStream,\n      requestSchema,\n      initialRequest,\n    });\n  }\n\n  /**\n   * @param response - http response from which to read the event stream.\n   * @param unionSchema - schema of the event stream container (struct).\n   * @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).\n   *\n   * @returns the asyncIterable of the event stream.\n   */\n  protected async deserializeEventStream({\n    response,\n    responseSchema,\n    initialResponseContainer,\n  }: {\n    response: IHttpResponse;\n    responseSchema: NormalizedSchema;\n    initialResponseContainer?: any;\n  }): Promise<AsyncIterable<{ [key: string]: any; $unknown?: unknown }>> {\n    const eventStreamSerde = await this.loadEventStreamCapability();\n    return eventStreamSerde.deserializeEventStream({\n      response,\n      responseSchema,\n      initialResponseContainer,\n    });\n  }\n\n  /**\n   * Loads eventStream capability async (for chunking).\n   */\n  protected async loadEventStreamCapability(): Promise<EventStreamSerde> {\n    const { EventStreamSerde } = await import(\"@smithy/core/event-streams\");\n    return new EventStreamSerde({\n      marshaller: this.getEventStreamMarshaller(),\n      serializer: this.serializer,\n      deserializer: this.deserializer,\n      serdeContext: this.serdeContext,\n      defaultContentType: this.getDefaultContentType(),\n    });\n  }\n\n  /**\n   * @returns content-type default header value for event stream events and other documents.\n   */\n  protected getDefaultContentType(): string {\n    throw new Error(\n      `@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`\n    );\n  }\n\n  /**\n   * For HTTP binding protocols, this method is overridden in {@link HttpBindingProtocol}.\n   *\n   * @deprecated only use this for HTTP binding protocols.\n   */\n  protected async deserializeHttpMessage(\n    schema: Schema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    headerBindings: Set<string>,\n    dataObject: any\n  ): Promise<string[]>;\n  protected async deserializeHttpMessage(\n    schema: Schema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    dataObject: any\n  ): Promise<string[]>;\n  protected async deserializeHttpMessage(\n    schema: Schema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse,\n    arg4: unknown,\n    arg5?: unknown\n  ): Promise<string[]> {\n    void schema;\n    void context;\n    void response;\n    void arg4;\n    void arg5;\n    // This method is preserved for backwards compatibility.\n    // It should remain unused.\n    return [];\n  }\n\n  protected getEventStreamMarshaller(): EventStreamMarshaller {\n    const context = this.serdeContext as unknown as EventStreamSerdeContext;\n    if (!context.eventStreamMarshaller) {\n      throw new Error(\"@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.\");\n    }\n    return context.eventStreamMarshaller;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/RpcProtocol.spec.ts",
    "content": "import { NormalizedSchema, op } from \"@smithy/core/schema\";\nimport type {\n  $Schema,\n  $ShapeSerializer,\n  Codec,\n  CodecSettings,\n  HandlerExecutionContext,\n  HttpResponse as IHttpResponse,\n  OperationSchema,\n  ResponseMetadata,\n  ShapeDeserializer,\n  ShapeSerializer,\n  StaticStructureSchema,\n} from \"@smithy/types\";\nimport { parseUrl } from \"@smithy/url-parser\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { RpcProtocol } from \"./RpcProtocol\";\nimport { SerdeContext } from \"./SerdeContext\";\nimport { FromStringShapeDeserializer } from \"./serde/FromStringShapeDeserializer\";\n\ndescribe(RpcProtocol.name, () => {\n  /**\n   * Minimal serializer that records what schema+value pairs were written,\n   * and produces a JSON string on flush.\n   */\n  class SpyShapeSerializer extends SerdeContext implements $ShapeSerializer<string> {\n    public writeCalls: Array<{ schema: $Schema; value: unknown }> = [];\n    private buffer = \"\";\n\n    public constructor(private settings: CodecSettings) {\n      super();\n    }\n\n    public write(schema: $Schema, value: unknown): void {\n      this.writeCalls.push({ schema, value });\n      const ns = NormalizedSchema.of(schema);\n      if (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n        const entries: string[] = [];\n        for (const [k, memberSchema] of ns.structIterator()) {\n          const v = (value as any)[k];\n          if (v != null) {\n            entries.push(`\"${k}\":\"${v}\"`);\n          }\n        }\n        this.buffer = `{${entries.join(\",\")}}`;\n      } else {\n        this.buffer = JSON.stringify(value);\n      }\n    }\n\n    public flush(): string {\n      const result = this.buffer;\n      this.buffer = \"\";\n      return result;\n    }\n  }\n\n  class TestRpcProtocol extends RpcProtocol {\n    protected serializer: ShapeSerializer<string | Uint8Array>;\n    protected deserializer: ShapeDeserializer<string | Uint8Array>;\n    public spySerializer: SpyShapeSerializer;\n\n    public constructor() {\n      super({\n        defaultNamespace: \"\",\n        errorTypeRegistries: [],\n      });\n      const settings: CodecSettings = {\n        timestampFormat: { useTrait: true, default: 7 },\n        httpBindings: false,\n      };\n      this.spySerializer = new SpyShapeSerializer(settings);\n      this.serializer = this.spySerializer;\n      this.deserializer = new FromStringShapeDeserializer(settings);\n    }\n\n    public getShapeId(): string {\n      throw new Error(\"Method not implemented.\");\n    }\n\n    public getPayloadCodec(): Codec<any, any> {\n      throw new Error(\"Method not implemented.\");\n    }\n\n    protected handleError(\n      operationSchema: OperationSchema,\n      context: HandlerExecutionContext,\n      response: IHttpResponse,\n      dataObject: any,\n      metadata: ResponseMetadata\n    ): Promise<never> {\n      void [operationSchema, context, response, dataObject, metadata];\n      throw new Error(\"Method not implemented.\");\n    }\n  }\n\n  it(\"should not mutate the caller's input object\", async () => {\n    const protocol = new TestRpcProtocol();\n    const input = Object.freeze({\n      fieldA: \"hello\",\n      fieldB: \"world\",\n    });\n\n    const request = await protocol.serializeRequest(\n      op(\"\", \"\", 0, [3, \"ns\", \"Struct\", 0, [\"fieldA\", \"fieldB\"], [0, 0]] satisfies StaticStructureSchema, \"unit\"),\n      input,\n      {\n        endpoint: async () => parseUrl(\"https://localhost\"),\n      } as any\n    );\n\n    // The serializer received the full input\n    const body = JSON.parse(request.body);\n    expect(body).toEqual({ fieldA: \"hello\", fieldB: \"world\" });\n\n    // Original input is untouched\n    expect(input.fieldA).toBe(\"hello\");\n    expect(input.fieldB).toBe(\"world\");\n  });\n\n  it(\"should pass the original input reference to serializer.write (no spread copy)\", async () => {\n    const protocol = new TestRpcProtocol();\n    const input = { fieldA: \"value\" };\n\n    await protocol.serializeRequest(\n      op(\"\", \"\", 0, [3, \"ns\", \"Struct\", 0, [\"fieldA\"], [0]] satisfies StaticStructureSchema, \"unit\"),\n      input,\n      {\n        endpoint: async () => parseUrl(\"https://localhost\"),\n      } as any\n    );\n\n    // The serializer should have received the exact same object reference\n    expect(protocol.spySerializer.writeCalls).toHaveLength(1);\n    expect(protocol.spySerializer.writeCalls[0].value).toBe(input);\n  });\n\n  it(\"should handle null/undefined input without throwing\", async () => {\n    const protocol = new TestRpcProtocol();\n\n    const request = await protocol.serializeRequest(\n      op(\"\", \"\", 0, \"unit\", \"unit\"),\n      null as any,\n      {\n        endpoint: async () => parseUrl(\"https://localhost\"),\n      } as any\n    );\n\n    expect(request.body).toEqual(\"{}\");\n    expect(request.method).toBe(\"POST\");\n  });\n\n  it(\"considers non-object inputs to be equivalent to empty objects\", async () => {\n    const protocol = new TestRpcProtocol();\n\n    for (const input of [null, undefined, 5, false, \"hello\", \"{}\"]) {\n      const request = await protocol.serializeRequest(\n        op(\"\", \"\", {}, [3, \"ns\", \"Struct\", 0, [\"a\", \"b\", \"c\"], [0, 0, 0]] satisfies StaticStructureSchema, \"unit\"),\n        input as any,\n        {\n          endpoint: async () => parseUrl(\"https://localhost\"),\n        } as any\n      );\n\n      expect(request.path).toEqual(\"/\");\n      expect(request.body).toEqual(\"{}\");\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/RpcProtocol.ts",
    "content": "import { NormalizedSchema, type TypeRegistry } from \"@smithy/core/schema\";\nimport type {\n  DocumentSchema,\n  Endpoint,\n  EndpointBearer,\n  HandlerExecutionContext,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  MetadataBearer,\n  OperationSchema,\n  SerdeFunctions,\n} from \"@smithy/types\";\n\nimport { HttpProtocol } from \"./HttpProtocol\";\nimport { collectBody } from \"./collect-stream-body\";\nimport { HttpRequest } from \"./protocol-http/httpRequest\";\n\n/**\n * Abstract base for RPC-over-HTTP protocols.\n *\n * @public\n */\nexport abstract class RpcProtocol extends HttpProtocol {\n  /**\n   * @override\n   */\n  protected declare compositeErrorRegistry: TypeRegistry;\n\n  public async serializeRequest<Input extends object>(\n    operationSchema: OperationSchema,\n    _input: Input,\n    context: HandlerExecutionContext & SerdeFunctions & EndpointBearer\n  ): Promise<IHttpRequest> {\n    const serializer = this.serializer;\n    const query = {} as Record<string, string>;\n    const headers = {} as Record<string, string>;\n    const endpoint: Endpoint = await context.endpoint();\n\n    const ns = NormalizedSchema.of(operationSchema?.input);\n    const schema = ns.getSchema();\n\n    let payload: any;\n    const input: any = _input && typeof _input === \"object\" ? _input : {};\n\n    const request = new HttpRequest({\n      protocol: \"\",\n      hostname: \"\",\n      port: undefined,\n      path: \"/\",\n      fragment: undefined,\n      query: query,\n      headers: headers,\n      body: undefined,\n    });\n\n    if (endpoint) {\n      this.updateServiceEndpoint(request, endpoint);\n      this.setHostPrefix(request, operationSchema, input);\n    }\n\n    if (input) {\n      const eventStreamMember = ns.getEventStreamMember();\n\n      if (eventStreamMember) {\n        if (input[eventStreamMember]) {\n          const initialRequest = {} as any;\n          for (const [memberName, memberSchema] of ns.structIterator()) {\n            if (memberName !== eventStreamMember && input[memberName]) {\n              serializer.write(memberSchema, input[memberName]);\n              initialRequest[memberName] = serializer.flush();\n            }\n          }\n\n          payload = await this.serializeEventStream({\n            eventStream: input[eventStreamMember],\n            requestSchema: ns,\n            initialRequest,\n          });\n        }\n      } else {\n        serializer.write(schema, input);\n        payload = serializer.flush() as Uint8Array;\n      }\n    }\n\n    request.headers = Object.assign(request.headers, headers);\n    request.query = query;\n    request.body = payload;\n    request.method = \"POST\";\n\n    return request;\n  }\n\n  public async deserializeResponse<Output extends MetadataBearer>(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: IHttpResponse\n  ): Promise<Output> {\n    const deserializer = this.deserializer;\n    const ns = NormalizedSchema.of(operationSchema.output);\n\n    const dataObject: any = {};\n\n    if (response.statusCode >= 300) {\n      const bytes: Uint8Array = await collectBody(response.body, context as SerdeFunctions);\n      if (bytes.byteLength > 0) {\n        Object.assign(dataObject, await deserializer.read(15 satisfies DocumentSchema, bytes));\n      }\n      await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));\n      throw new Error(\"@smithy/core/protocols - RPC Protocol error handler failed to throw.\");\n    }\n\n    for (const header in response.headers) {\n      const value = response.headers[header];\n      delete response.headers[header];\n      response.headers[header.toLowerCase()] = value;\n    }\n\n    const eventStreamMember = ns.getEventStreamMember();\n    if (eventStreamMember) {\n      dataObject[eventStreamMember] = await this.deserializeEventStream({\n        response,\n        responseSchema: ns,\n        initialResponseContainer: dataObject,\n      });\n    } else {\n      const bytes: Uint8Array = await collectBody(response.body, context as SerdeFunctions);\n      if (bytes.byteLength > 0) {\n        Object.assign(dataObject, await deserializer.read(ns, bytes));\n      }\n    }\n\n    dataObject.$metadata = this.deserializeMetadata(response);\n    return dataObject;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/SerdeContext.ts",
    "content": "import type { ConfigurableSerdeContext, SerdeFunctions } from \"@smithy/types\";\n\n/**\n * This in practice should be the client config object.\n * @internal\n */\ntype SerdeContextType = SerdeFunctions & {\n  disableHostPrefix?: boolean;\n};\n\n/**\n * @internal\n */\nexport abstract class SerdeContext implements ConfigurableSerdeContext {\n  protected serdeContext?: SerdeContextType;\n\n  public setSerdeContext(serdeContext: SerdeContextType): void {\n    this.serdeContext = serdeContext;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/collect-stream-body.spec.ts",
    "content": "import { Uint8ArrayBlobAdapter } from \"@smithy/core/serde\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { collectBody } from \"./collect-stream-body\";\n\ndescribe(collectBody.name, () => {\n  it(\"passes through Uint8Array\", async () => {\n    const body = new Uint8Array();\n    const arr = await collectBody(body, {\n      async streamCollector(stream: any) {\n        return new Uint8Array(stream);\n      },\n    });\n\n    expect(arr).toBe(body);\n  });\n\n  it(\"uses the contextual streamCollector\", async () => {\n    const body = \"x\";\n    const arr = await collectBody(body, {\n      async streamCollector(stream: any) {\n        return Uint8ArrayBlobAdapter.fromString(stream);\n      },\n    });\n\n    expect(arr.transformToString()).toEqual(\"x\");\n  });\n\n  it(\"uses the contextual streamCollector for empty string\", async () => {\n    const body = \"\";\n    const arr = await collectBody(body, {\n      async streamCollector(stream: any) {\n        return Uint8ArrayBlobAdapter.fromString(stream);\n      },\n    });\n\n    expect(arr.transformToString()).toEqual(\"\");\n  });\n\n  it(\"defaults to an empty Uint8Array\", async () => {\n    const body = null;\n    const arr = await collectBody(body, {\n      async streamCollector(stream: any) {\n        return Uint8ArrayBlobAdapter.fromString(stream);\n      },\n    });\n\n    expect(arr.transformToString()).toEqual(\"\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/collect-stream-body.ts",
    "content": "import { Uint8ArrayBlobAdapter } from \"@smithy/core/serde\";\nimport type { SerdeContext } from \"@smithy/types\";\n\n/**\n * Collect low-level response body stream to Uint8Array.\n *\n * @internal\n */\nexport const collectBody = async (\n  streamBody: any = new Uint8Array(),\n  context: {\n    streamCollector: SerdeContext[\"streamCollector\"];\n  }\n): Promise<Uint8ArrayBlobAdapter> => {\n  if (streamBody instanceof Uint8Array) {\n    return Uint8ArrayBlobAdapter.mutate(streamBody);\n  }\n\n  if (!streamBody) {\n    return Uint8ArrayBlobAdapter.mutate(new Uint8Array());\n  }\n\n  const fromContext = context.streamCollector(streamBody);\n\n  return Uint8ArrayBlobAdapter.mutate(await fromContext);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/extended-encode-uri-component.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { extendedEncodeURIComponent } from \"./extended-encode-uri-component\";\n\ndescribe(extendedEncodeURIComponent.name, () => {\n  const encodedValues: [string, string][] = [\n    [\"!\", \"%21\"],\n    [\"'\", \"%27\"],\n    [\"(\", \"%28\"],\n    [\")\", \"%29\"],\n    [\"*\", \"%2A\"],\n  ];\n\n  const verify = (table: [string, string][]) => {\n    it.each(table)(`encodes %s as %s`, (input, output) => {\n      expect(extendedEncodeURIComponent(input)).toStrictEqual(output);\n    });\n  };\n\n  verify(encodedValues);\n  verify([encodedValues.reduce((acc, [input, output]) => [acc[0].concat(input), acc[1].concat(output)], [\"\", \"\"])]);\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/extended-encode-uri-component.ts",
    "content": "/**\n * Function that wraps encodeURIComponent to encode additional characters\n * to fully adhere to RFC 3986.\n *\n * @internal\n */\nexport function extendedEncodeURIComponent(str: string): string {\n  return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n    return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n  });\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/index.ts",
    "content": "export * from \"./collect-stream-body\";\nexport * from \"./extended-encode-uri-component\";\nexport * from \"./HttpBindingProtocol\";\nexport * from \"./HttpProtocol\";\nexport * from \"./RpcProtocol\";\nexport * from \"./requestBuilder\";\nexport * from \"./resolve-path\";\nexport * from \"./serde/FromStringShapeDeserializer\";\nexport * from \"./serde/HttpInterceptingShapeDeserializer\";\nexport * from \"./serde/HttpInterceptingShapeSerializer\";\nexport * from \"./serde/ToStringShapeSerializer\";\nexport * from \"./serde/determineTimestampFormat\";\nexport * from \"./SerdeContext\";\n\n// @smithy/protocol-http\nexport { Field } from \"./protocol-http/Field\";\nexport { Fields, type FieldsOptions } from \"./protocol-http/Fields\";\nexport { type HttpHandler, type HttpHandlerUserInput } from \"./protocol-http/httpHandler\";\nexport { HttpRequest, type IHttpRequest } from \"./protocol-http/httpRequest\";\nexport { HttpResponse } from \"./protocol-http/httpResponse\";\nexport { isValidHostname } from \"./protocol-http/isValidHostname\";\nexport {\n  getHttpHandlerExtensionConfiguration,\n  resolveHttpHandlerRuntimeConfig,\n  type HttpHandlerExtensionConfiguration,\n  type HttpHandlerExtensionConfigType,\n} from \"./protocol-http/extensions/httpExtensionConfiguration\";\nexport {\n  type FieldOptions,\n  type FieldPosition,\n  type HeaderBag,\n  type HttpMessage,\n  type HttpHandlerOptions,\n} from \"./protocol-http/types\";\n\n// @smithy/middleware-content-length\nexport {\n  contentLengthMiddleware,\n  contentLengthMiddlewareOptions,\n  getContentLengthPlugin,\n} from \"./middleware-content-length/contentLengthMiddleware\";\n\n// @smithy/util-uri-escape\nexport { escapeUri } from \"./util-uri-escape/escape-uri\";\nexport { escapeUriPath } from \"./util-uri-escape/escape-uri-path\";\n\n// @smithy/querystring-builder\nexport { buildQueryString } from \"./querystring-builder/buildQueryString\";\n\n// @smithy/querystring-parser\nexport { parseQueryString } from \"./querystring-parser/parseQueryString\";\n\n// @smithy/url-parser\nexport { parseUrl } from \"./url-parser/parseUrl\";\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/middleware-content-length/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/protocols`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/protocol-http@5.3.14\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/protocol-http@5.3.13\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/protocol-http@5.3.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/protocol-http@5.3.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/protocol-http@5.3.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/protocol-http@5.3.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/protocol-http@5.3.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/protocol-http@5.3.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/protocol-http@5.3.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/protocol-http@5.3.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/protocol-http@5.3.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/protocol-http@5.3.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/protocol-http@5.3.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/protocol-http@5.2.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/protocol-http@5.2.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/protocol-http@5.1.3\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/protocol-http@5.1.2\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/protocol-http@5.1.1\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/protocol-http@5.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.13\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/protocol-http@4.1.8\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/protocol-http@4.1.7\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/protocol-http@4.1.6\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/protocol-http@4.1.5\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/protocol-http@4.1.4\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/protocol-http@4.1.3\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/protocol-http@4.1.2\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/protocol-http@4.1.1\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/protocol-http@4.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/protocol-http@4.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/protocol-http@4.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/protocol-http@4.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/protocol-http@3.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/protocol-http@3.2.2\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/protocol-http@3.2.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/protocol-http@3.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/protocol-http@3.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/protocol-http@3.0.12\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/protocol-http@3.0.11\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/protocol-http@3.0.10\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/protocol-http@3.0.9\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/protocol-http@3.0.8\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/protocol-http@3.0.7\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/protocol-http@3.0.6\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/protocol-http@3.0.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/protocol-http@3.0.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/protocol-http@3.0.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n\n## 2.0.5\n\n### Patch Changes\n\n- 1be3c4c9: Add integration tests\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/protocol-http@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/protocol-http@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/protocol-http@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/protocol-http@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/protocol-http@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/protocol-http@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/protocol-http@1.2.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/protocol-http@1.1.2\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/protocol-http@1.1.1\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/middleware-content-length](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/middleware-content-length/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/middleware-content-length/contentLengthMiddleware.ts",
    "content": "import type {\n  BodyLengthCalculator,\n  BuildHandler,\n  BuildHandlerArguments,\n  BuildHandlerOptions,\n  BuildHandlerOutput,\n  BuildMiddleware,\n  MetadataBearer,\n  Pluggable,\n} from \"@smithy/types\";\n\nimport { HttpRequest } from \"../protocol-http/httpRequest\";\n\nconst CONTENT_LENGTH_HEADER = \"content-length\";\n\nexport function contentLengthMiddleware(bodyLengthChecker: BodyLengthCalculator): BuildMiddleware<any, any> {\n  return <Output extends MetadataBearer>(next: BuildHandler<any, Output>): BuildHandler<any, Output> =>\n    async (args: BuildHandlerArguments<any>): Promise<BuildHandlerOutput<Output>> => {\n      const request = args.request;\n      if (HttpRequest.isInstance(request)) {\n        const { body, headers } = request;\n        if (\n          body &&\n          Object.keys(headers)\n            .map((str) => str.toLowerCase())\n            .indexOf(CONTENT_LENGTH_HEADER) === -1\n        ) {\n          try {\n            const length = bodyLengthChecker(body);\n            request.headers = {\n              ...request.headers,\n              [CONTENT_LENGTH_HEADER]: String(length),\n            };\n          } catch (error) {\n            // ToDo: Add 'transfer-encoding' as chunked only for HTTP/1.1 request\n            // Refs: https://github.com/aws/aws-sdk-js-v3/pull/3403\n          }\n        }\n      }\n\n      return next({\n        ...args,\n        request,\n      });\n    };\n}\n\nexport const contentLengthMiddlewareOptions: BuildHandlerOptions = {\n  step: \"build\",\n  tags: [\"SET_CONTENT_LENGTH\", \"CONTENT_LENGTH\"],\n  name: \"contentLengthMiddleware\",\n  override: true,\n};\n\nexport const getContentLengthPlugin = (options: { bodyLengthChecker: BodyLengthCalculator }): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);\n  },\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/protocols`.\n\n## 5.3.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 5.3.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 5.3.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 5.3.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 5.3.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 5.3.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 5.3.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 5.3.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 5.3.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 5.3.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 5.3.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 5.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 5.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 5.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 5.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 5.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 5.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 5.1.3\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 5.1.2\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 5.1.1\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 5.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 5.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 5.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 4.1.8\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 4.1.7\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 4.1.6\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 4.1.5\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 86862ea: switch to static HttpRequest clone method\n\n## 4.0.4\n\n### Patch Changes\n\n- 796567d: add guidance for HttpRequest cloning\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 3.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 3.2.1\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 3.2.0\n\n### Minor Changes\n\n- 929801bc: allow constructor parameters pass-through when initializing requestHandler\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 3.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 3.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 3.0.2\n\n### Patch Changes\n\n- 5b3fec37: Fix default HttpHandlerConfig type for HttpHandler\n\n## 3.0.1\n\n### Patch Changes\n\n- 5db648a6: Add default generic type to HttpHandler\n\n## 3.0.0\n\n### Major Changes\n\n- a03026e3: Add http client component to runtime extension\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.2.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.1.2\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.1.1\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.1.0\n\n### Minor Changes\n\n- adedc001c: Move types to @smithy/types\n\n### Patch Changes\n\n- Updated dependencies [adedc001c]\n  - @smithy/types@1.1.0\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/protocol-http](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/protocol-http/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/Field.ts",
    "content": "import { FieldPosition, type FieldOptions } from \"@smithy/types\";\n\n/**\n * A name-value pair representing a single field\n * transmitted in an HTTP Request or Response.\n *\n * The kind will dictate metadata placement within\n * an HTTP message.\n *\n * All field names are case insensitive and\n * case-variance must be treated as equivalent.\n * Names MAY be normalized but SHOULD be preserved\n * for accuracy during transmission.\n */\nexport class Field {\n  public readonly name: string;\n  public readonly kind: FieldPosition;\n\n  public values: string[];\n\n  constructor({ name, kind = FieldPosition.HEADER, values = [] }: FieldOptions) {\n    this.name = name;\n    this.kind = kind;\n    this.values = values;\n  }\n\n  /**\n   * Appends a value to the field.\n   *\n   * @param value The value to append.\n   */\n  public add(value: string): void {\n    this.values.push(value);\n  }\n\n  /**\n   * Overwrite existing field values.\n   *\n   * @param values The new field values.\n   */\n  public set(values: string[]): void {\n    this.values = values;\n  }\n\n  /**\n   * Remove all matching entries from list.\n   *\n   * @param value Value to remove.\n   */\n  public remove(value: string): void {\n    this.values = this.values.filter((v) => v !== value);\n  }\n\n  /**\n   * Get comma-delimited string.\n   *\n   * @returns String representation of {@link Field}.\n   */\n  public toString(): string {\n    // Values with spaces or commas MUST be double-quoted\n    return this.values.map((v) => (v.includes(\",\") || v.includes(\" \") ? `\"${v}\"` : v)).join(\", \");\n  }\n\n  /**\n   * Get string values as a list\n   *\n   * @returns Values in {@link Field} as a list.\n   */\n  public get(): string[] {\n    return this.values;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/Fields.ts",
    "content": "import type { FieldPosition } from \"@smithy/types\";\n\nimport type { Field } from \"./Field\";\n\nexport type FieldsOptions = { fields?: Field[]; encoding?: string };\n\n/**\n * Collection of Field entries mapped by name.\n */\nexport class Fields {\n  private readonly entries: Record<string, Field> = {};\n  private readonly encoding: string;\n\n  constructor({ fields = [], encoding = \"utf-8\" }: FieldsOptions) {\n    fields.forEach(this.setField.bind(this));\n    this.encoding = encoding;\n  }\n\n  /**\n   * Set entry for a {@link Field} name. The `name`\n   * attribute will be used to key the collection.\n   *\n   * @param field The {@link Field} to set.\n   */\n  public setField(field: Field): void {\n    this.entries[field.name.toLowerCase()] = field;\n  }\n\n  /**\n   *  Retrieve {@link Field} entry by name.\n   *\n   * @param name The name of the {@link Field} entry\n   *  to retrieve\n   * @returns The {@link Field} if it exists.\n   */\n  public getField(name: string): Field | undefined {\n    return this.entries[name.toLowerCase()];\n  }\n\n  /**\n   * Delete entry from collection.\n   *\n   * @param name Name of the entry to delete.\n   */\n  public removeField(name: string): void {\n    delete this.entries[name.toLowerCase()];\n  }\n\n  /**\n   * Helper function for retrieving specific types of fields.\n   * Used to grab all headers or all trailers.\n   *\n   * @param kind {@link FieldPosition} of entries to retrieve.\n   * @returns The {@link Field} entries with the specified\n   *  {@link FieldPosition}.\n   */\n  public getByType(kind: FieldPosition): Field[] {\n    return Object.values(this.entries).filter((field) => field.kind === kind);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.ts",
    "content": "import type { HttpHandler } from \"../httpHandler\";\n\n/**\n * @internal\n */\nexport interface HttpHandlerExtensionConfiguration<HandlerConfig extends object = {}> {\n  setHttpHandler(handler: HttpHandler<HandlerConfig>): void;\n  httpHandler(): HttpHandler<HandlerConfig>;\n  updateHttpClientConfig(key: keyof HandlerConfig, value: HandlerConfig[typeof key]): void;\n  httpHandlerConfigs(): HandlerConfig;\n}\n\n/**\n * @internal\n */\nexport type HttpHandlerExtensionConfigType<HandlerConfig extends object = {}> = Partial<{\n  httpHandler: HttpHandler<HandlerConfig>;\n}>;\n\n/**\n * Helper function to resolve default extension configuration from runtime config\n *\n * @internal\n */\nexport const getHttpHandlerExtensionConfiguration = <HandlerConfig extends object = {}>(\n  runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig>\n) => {\n  return {\n    setHttpHandler(handler: HttpHandler<HandlerConfig>): void {\n      runtimeConfig.httpHandler = handler;\n    },\n    httpHandler(): HttpHandler<HandlerConfig> {\n      return runtimeConfig.httpHandler!;\n    },\n    updateHttpClientConfig(key: keyof HandlerConfig, value: HandlerConfig[typeof key]): void {\n      runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);\n    },\n    httpHandlerConfigs(): HandlerConfig {\n      return runtimeConfig.httpHandler!.httpHandlerConfigs();\n    },\n  };\n};\n\n/**\n * Helper function to resolve runtime config from default extension configuration\n *\n * @internal\n */\nexport const resolveHttpHandlerRuntimeConfig = <HandlerConfig extends object = {}>(\n  httpHandlerExtensionConfiguration: HttpHandlerExtensionConfiguration<HandlerConfig>\n): HttpHandlerExtensionConfigType<HandlerConfig> => {\n  return {\n    httpHandler: httpHandlerExtensionConfiguration.httpHandler(),\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/httpHandler.ts",
    "content": "import type {\n  FetchHttpHandlerOptions,\n  HttpHandlerOptions,\n  NodeHttpHandlerOptions,\n  RequestHandler,\n} from \"@smithy/types\";\n\nimport type { HttpRequest } from \"./httpRequest\";\nimport type { HttpResponse } from \"./httpResponse\";\n\n/**\n * @internal\n */\nexport type HttpHandler<HttpHandlerConfig extends object = {}> = RequestHandler<\n  HttpRequest,\n  HttpResponse,\n  HttpHandlerOptions\n> & {\n  /**\n   * @internal\n   */\n  updateHttpClientConfig(key: keyof HttpHandlerConfig, value: HttpHandlerConfig[typeof key]): void;\n\n  /**\n   * @internal\n   */\n  httpHandlerConfigs(): HttpHandlerConfig;\n};\n\n/**\n * A type representing the accepted user inputs for the `requestHandler` field\n * of a client's constructor object.\n * You may provide an instance of an HttpHandler, or alternatively\n * provide the constructor arguments as an object which will be passed\n * to the constructor of the default request handler.\n * The default class constructor to which your arguments will be passed\n * varies. The Node.js default is the NodeHttpHandler and the browser/react-native\n * default is the FetchHttpHandler. In rarer cases specific clients may be\n * configured to use other default implementations such as Websocket or HTTP2.\n * The fallback type Record<string, unknown> is part of the union to allow\n * passing constructor params to an unknown requestHandler type.\n *\n * @public\n */\nexport type HttpHandlerUserInput =\n  | HttpHandler\n  | NodeHttpHandlerOptions\n  | FetchHttpHandlerOptions\n  | Record<string, unknown>;\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/httpRequest.spec.ts",
    "content": "import type { QueryParameterBag } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { HttpRequest, type IHttpRequest } from \"./httpRequest\";\n\ndescribe(\"HttpRequest\", () => {\n  const httpRequest: IHttpRequest = {\n    headers: {\n      hKey: \"header-value\",\n    },\n    query: {\n      qKey: \"query-value\",\n    },\n    method: \"GET\",\n    protocol: \"https\",\n    hostname: \"localhost\",\n    path: \"/\",\n    body: [],\n  };\n\n  it(\"should statically clone with deep-cloned headers/query but shallow cloned body\", () => {\n    const httpRequest: IHttpRequest = {\n      headers: {\n        hKey: \"header-value\",\n      },\n      query: {\n        qKey: \"query-value\",\n      },\n      method: \"GET\",\n      protocol: \"https\",\n      hostname: \"localhost\",\n      path: \"/\",\n      body: [],\n    };\n\n    const clone1 = HttpRequest.clone(httpRequest);\n    const clone2 = HttpRequest.clone(httpRequest);\n\n    expect(new HttpRequest(httpRequest)).toEqual(clone1);\n    expect(clone1).toEqual(clone2);\n\n    expect(clone1.query).not.toBe(clone2.query);\n    expect(clone1.headers).not.toBe(clone2.headers);\n    expect(clone1.body).toBe(clone2.body);\n  });\n\n  it(\"should maintain a deprecated instance clone method\", () => {\n    const httpRequestInstance = new HttpRequest(httpRequest);\n\n    const clone1 = HttpRequest.clone(httpRequestInstance);\n    const clone2 = HttpRequest.clone(httpRequestInstance);\n\n    expect(httpRequestInstance).toEqual(clone1);\n    expect(clone1).toEqual(clone2);\n\n    expect(clone1.query).not.toBe(clone2.query);\n    expect(clone1.headers).not.toBe(clone2.headers);\n    expect(clone1.body).toBe(clone2.body);\n  });\n});\n\nconst cloneRequest = HttpRequest.clone;\n\ndescribe(\"cloneRequest\", () => {\n  const request: IHttpRequest = Object.freeze({\n    method: \"GET\",\n    protocol: \"https:\",\n    hostname: \"foo.us-west-2.amazonaws.com\",\n    path: \"/\",\n    headers: Object.freeze({\n      foo: \"bar\",\n      compound: \"value 1, value 2\",\n    }),\n    query: Object.freeze({\n      fizz: \"buzz\",\n      snap: [\"crackle\", \"pop\"],\n    }),\n  });\n\n  it(\"should return an object matching the provided request\", () => {\n    expect(cloneRequest(request)).toEqual(request);\n  });\n\n  it(\"should return an object that with a different identity\", () => {\n    expect(cloneRequest(request)).not.toBe(request);\n  });\n\n  it(\"should should deep-copy the headers\", () => {\n    const clone = cloneRequest(request);\n\n    delete clone.headers.compound;\n    expect(Object.keys(request.headers)).toEqual([\"foo\", \"compound\"]);\n    expect(Object.keys(clone.headers)).toEqual([\"foo\"]);\n  });\n\n  it(\"should should deep-copy the query\", () => {\n    const clone = cloneRequest(request);\n\n    const { snap } = clone.query as QueryParameterBag;\n    (snap as Array<string>).shift();\n\n    expect((request.query as QueryParameterBag).snap).toEqual([\"crackle\", \"pop\"]);\n    expect((clone.query as QueryParameterBag).snap).toEqual([\"pop\"]);\n  });\n\n  it(\"should not copy the body\", () => {\n    const body = new Uint8Array(16);\n    const req = { ...request, body };\n    const clone = cloneRequest(req);\n\n    expect(clone.body).toBe(req.body);\n  });\n\n  it(\"should handle requests without defined query objects\", () => {\n    expect(cloneRequest({ ...request, query: void 0 }).query).toEqual({});\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/httpRequest.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport {\n  HttpRequest as IHttpRequest,\n  type HeaderBag,\n  type HttpMessage,\n  type QueryParameterBag,\n  type URI,\n} from \"@smithy/types\";\n\ntype HttpRequestOptions = Partial<HttpMessage> & Partial<URI> & { method?: string };\n\n/**\n * Use the distinct IHttpRequest interface from \\@smithy/types instead.\n * This should not be used due to\n * overlapping with the concrete class' name.\n *\n * This is not marked deprecated since that would mark the concrete class\n * deprecated as well.\n *\n * @internal\n */\nexport interface HttpRequest extends IHttpRequest {}\n\n/**\n * @public\n */\nexport { IHttpRequest };\n\n/**\n * @public\n */\nexport class HttpRequest implements HttpMessage, URI {\n  public method: string;\n  public protocol: string;\n  public hostname: string;\n  public port?: number;\n  public path: string;\n  public query: QueryParameterBag;\n  public headers: HeaderBag;\n  public username?: string;\n  public password?: string;\n  public fragment?: string;\n  public body?: any;\n\n  public constructor(options: HttpRequestOptions) {\n    this.method = options.method || \"GET\";\n    this.hostname = options.hostname || \"localhost\";\n    this.port = options.port;\n    this.query = options.query || {};\n    this.headers = options.headers || {};\n    this.body = options.body;\n    this.protocol = options.protocol\n      ? options.protocol.slice(-1) !== \":\"\n        ? `${options.protocol}:`\n        : options.protocol\n      : \"https:\";\n    this.path = options.path ? (options.path.charAt(0) !== \"/\" ? `/${options.path}` : options.path) : \"/\";\n    this.username = options.username;\n    this.password = options.password;\n    this.fragment = options.fragment;\n  }\n\n  /**\n   * Note: this does not deep-clone the body.\n   */\n  public static clone(request: IHttpRequest) {\n    const cloned = new HttpRequest({\n      ...request,\n      headers: { ...request.headers },\n    });\n    if (cloned.query) {\n      cloned.query = cloneQuery(cloned.query);\n    }\n    return cloned;\n  }\n\n  /**\n   * This method only actually asserts that request is the interface {@link IHttpRequest},\n   * and not necessarily this concrete class. Left in place for API stability.\n   *\n   * Do not call instance methods on the input of this function, and\n   * do not assume it has the HttpRequest prototype.\n   */\n  public static isInstance(request: unknown): request is HttpRequest {\n    if (!request) {\n      return false;\n    }\n    const req: any = request;\n    return (\n      \"method\" in req &&\n      \"protocol\" in req &&\n      \"hostname\" in req &&\n      \"path\" in req &&\n      typeof req[\"query\"] === \"object\" &&\n      typeof req[\"headers\"] === \"object\"\n    );\n  }\n\n  /**\n   * @deprecated use static HttpRequest.clone(request) instead. It's not safe to call\n   * this method because {@link HttpRequest.isInstance} incorrectly\n   * asserts that IHttpRequest (interface) objects are of type HttpRequest (class).\n   */\n  public clone(): HttpRequest {\n    return HttpRequest.clone(this);\n  }\n}\n\nfunction cloneQuery(query: QueryParameterBag): QueryParameterBag {\n  return Object.keys(query).reduce((carry: QueryParameterBag, paramName: string) => {\n    const param = query[paramName];\n    return {\n      ...carry,\n      [paramName]: Array.isArray(param) ? [...param] : param,\n    };\n  }, {});\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/httpResponse.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type { HeaderBag, HttpMessage, HttpResponse as IHttpResponse } from \"@smithy/types\";\n\ntype HttpResponseOptions = Partial<HttpMessage> & {\n  statusCode: number;\n  reason?: string;\n};\n\n/**\n * Use the distinct IHttpResponse interface from \\@smithy/types instead.\n * This should not be used due to\n * overlapping with the concrete class' name.\n *\n * This is not marked deprecated since that would mark the concrete class\n * deprecated as well.\n *\n * @internal\n */\nexport interface HttpResponse extends IHttpResponse {}\n\n/**\n * @public\n */\nexport class HttpResponse {\n  public statusCode: number;\n  public reason?: string;\n  public headers: HeaderBag;\n  public body?: any;\n\n  constructor(options: HttpResponseOptions) {\n    this.statusCode = options.statusCode;\n    this.reason = options.reason;\n    this.headers = options.headers || {};\n    this.body = options.body;\n  }\n\n  static isInstance(response: unknown): response is HttpResponse {\n    //determine if response is a valid HttpResponse\n    if (!response) return false;\n    const resp = response as any;\n    return typeof resp.statusCode === \"number\" && typeof resp.headers === \"object\";\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/isValidHostname.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { isValidHostname } from \"./isValidHostname\";\n\ndescribe(\"implementation selection\", () => {\n  it(\"should return true for valid hostnames\", () => {\n    const validHostnames = [\"foo\", \"foo.bar\", \"1foo.bar\", \"foo.bar1\"];\n    for (const hostname of validHostnames) {\n      expect(isValidHostname(hostname)).toBe(true);\n    }\n  });\n\n  it(\"should return false for invalid hostnames\", () => {\n    const invalidHostnames = [\"foo.com/?bar\", \".foo\"];\n    for (const hostname of invalidHostnames) {\n      expect(isValidHostname(hostname)).toBe(false);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/isValidHostname.ts",
    "content": "export function isValidHostname(hostname: string): boolean {\n  const hostPattern = /^[a-z0-9][a-z0-9\\.\\-]*[a-z0-9]$/;\n  return hostPattern.test(hostname);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/protocol-http/types.ts",
    "content": "import type {\n  FieldOptions as __FieldOptions,\n  FieldPosition as __FieldPosition,\n  HeaderBag as __HeaderBag,\n  HttpHandlerOptions as __HttpHandlerOptions,\n  HttpMessage as __HttpMessage,\n} from \"@smithy/types\";\n\n/**\n * @deprecated Use FieldOptions from `@smithy/types` instead\n */\nexport type FieldOptions = __FieldOptions;\n\n/**\n * @deprecated Use FieldPosition from `@smithy/types` instead\n */\nexport type FieldPosition = __FieldPosition;\n\n/**\n * @deprecated Use HeaderBag from `@smithy/types` instead\n */\nexport type HeaderBag = __HeaderBag;\n\n/**\n * @deprecated Use HttpMessage from `@smithy/types` instead\n */\nexport type HttpMessage = __HttpMessage;\n\n/**\n * @deprecated Use HttpHandlerOptions from `@smithy/types` instead\n */\nexport type HttpHandlerOptions = __HttpHandlerOptions;\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/querystring-builder/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/protocols`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-uri-escape@4.2.2\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n  - @smithy/util-uri-escape@4.2.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n  - @smithy/util-uri-escape@4.2.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-uri-escape@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n  - @smithy/util-uri-escape@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-uri-escape@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/util-uri-escape@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n  - @smithy/util-uri-escape@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-uri-escape@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-uri-escape@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n  - @smithy/util-uri-escape@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-uri-escape@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-uri-escape@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/querystring-builder](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/querystring-builder/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/querystring-builder/buildQueryString.ts",
    "content": "import type { QueryParameterBag } from \"@smithy/types\";\n\nimport { escapeUri } from \"../util-uri-escape/escape-uri\";\n\n/**\n * @internal\n */\nexport function buildQueryString(query: QueryParameterBag): string {\n  const parts: string[] = [];\n  for (let key of Object.keys(query).sort()) {\n    const value = query[key];\n    key = escapeUri(key);\n    if (Array.isArray(value)) {\n      for (let i = 0, iLen = value.length; i < iLen; i++) {\n        parts.push(`${key}=${escapeUri(value[i])}`);\n      }\n    } else {\n      let qsEntry = key;\n      if (value || typeof value === \"string\") {\n        qsEntry += `=${escapeUri(value)}`;\n      }\n      parts.push(qsEntry);\n    }\n  }\n\n  return parts.join(\"&\");\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/querystring-parser/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/protocols`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/querystring-parser](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/querystring-parser/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/querystring-parser/parseQueryString.spec.ts",
    "content": "import type { QueryParameterBag } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { parseQueryString } from \"./parseQueryString\";\n\ndescribe(\"parseQueryString\", () => {\n  const testCases = new Map<string, QueryParameterBag>([\n    [\n      \"?snap=cr%C3%A4ckle&snap=p%C3%B4p&fizz=buzz&quux\",\n      {\n        snap: [\"cräckle\", \"pôp\"],\n        fizz: \"buzz\",\n        quux: null,\n      },\n    ],\n    [\"?\", {}],\n    [\"?foo=\", { foo: \"\" }],\n    [\"foo=bar&foo=baz&foo=quux\", { foo: [\"bar\", \"baz\", \"quux\"] }],\n  ]);\n\n  for (const [querystring, parsed] of testCases) {\n    it(`should correctly parse ${querystring}`, () => {\n      expect(parseQueryString(querystring)).toEqual(parsed);\n    });\n  }\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/querystring-parser/parseQueryString.ts",
    "content": "import type { QueryParameterBag } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport function parseQueryString(querystring: string): QueryParameterBag {\n  const query: QueryParameterBag = {};\n  querystring = querystring.replace(/^\\?/, \"\");\n\n  if (querystring) {\n    for (const pair of querystring.split(\"&\")) {\n      let [key, value = null] = pair.split(\"=\");\n      key = decodeURIComponent(key);\n      if (value) {\n        value = decodeURIComponent(value);\n      }\n      if (!(key in query)) {\n        query[key] = value;\n      } else if (Array.isArray(query[key])) {\n        (query[key] as Array<string>).push(value as string);\n      } else {\n        query[key] = [query[key] as string, value as string];\n      }\n    }\n  }\n\n  return query;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/requestBuilder.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/protocol-http\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { requestBuilder } from \"./requestBuilder\";\n\ndescribe(requestBuilder.name, () => {\n  it(\"can build requests\", async () => {\n    expect(\n      await requestBuilder(\n        {\n          Key: \"MyKey\",\n          Bucket: \"MyBucket\",\n        },\n        {\n          endpoint: async () => {\n            return {\n              hostname: \"localhost\",\n              protocol: \"https\",\n              port: 8080,\n              path: \"/a\",\n            };\n          },\n        } as any\n      )\n        .bp(\"/{Key+}\")\n        .p(\"Bucket\", () => \"MyBucket\", \"{Bucket}\", false)\n        .p(\"Key\", () => \"MyKey\", \"{Key+}\", false)\n        .m(\"PUT\")\n        .h({\n          \"my-header\": \"my-header-value\",\n        })\n        .q({\n          \"my-query\": \"my-query-value\",\n        })\n        .b(\"test-body\")\n        .build()\n    ).toEqual(\n      new HttpRequest({\n        protocol: \"https\",\n        hostname: \"localhost\",\n        port: 8080,\n        method: \"PUT\",\n        path: \"/a/MyKey\",\n        query: {\n          \"my-query\": \"my-query-value\",\n        },\n        headers: {\n          \"my-header\": \"my-header-value\",\n        },\n        body: \"test-body\",\n      })\n    );\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/requestBuilder.ts",
    "content": "import type { SerdeContext } from \"@smithy/types\";\n\nimport { HttpRequest } from \"./protocol-http/httpRequest\";\nimport { resolvedPath } from \"./resolve-path\";\n\n/**\n * used in code-generated serde.\n *\n * @internal\n */\nexport function requestBuilder(input: any, context: SerdeContext): RequestBuilder {\n  return new RequestBuilder(input, context);\n}\n\n/**\n * @internal\n */\nexport class RequestBuilder {\n  private query: Record<string, string> = {};\n  private method = \"\";\n  private headers: Record<string, string> = {};\n  private path = \"\";\n  private body: any = null;\n  private hostname = \"\";\n\n  private resolvePathStack: Array<(path: string) => void> = [];\n\n  public constructor(\n    private input: any,\n    private context: SerdeContext\n  ) {}\n\n  public async build() {\n    const { hostname, protocol = \"https\", port, path: basePath } = await this.context.endpoint();\n    this.path = basePath;\n    for (const resolvePath of this.resolvePathStack) {\n      resolvePath(this.path);\n    }\n    return new HttpRequest({\n      protocol,\n      hostname: this.hostname || hostname,\n      port,\n      method: this.method,\n      path: this.path,\n      query: this.query,\n      body: this.body,\n      headers: this.headers,\n    });\n  }\n\n  /**\n   * Brevity setter for \"hostname\".\n   */\n  public hn(hostname: string) {\n    this.hostname = hostname;\n    return this;\n  }\n\n  /**\n   * Brevity initial builder for \"basepath\".\n   */\n  public bp(uriLabel: string) {\n    this.resolvePathStack.push((basePath: string) => {\n      this.path = `${basePath?.endsWith(\"/\") ? basePath.slice(0, -1) : basePath || \"\"}` + uriLabel;\n    });\n    return this;\n  }\n\n  /**\n   * Brevity incremental builder for \"path\".\n   */\n  public p(memberName: string, labelValueProvider: () => string | undefined, uriLabel: string, isGreedyLabel: boolean) {\n    this.resolvePathStack.push((path: string) => {\n      this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);\n    });\n    return this;\n  }\n\n  /**\n   * Brevity setter for \"headers\".\n   */\n  public h(headers: Record<string, string>) {\n    this.headers = headers;\n    return this;\n  }\n\n  /**\n   * Brevity setter for \"query\".\n   */\n  public q(query: Record<string, string>) {\n    this.query = query;\n    return this;\n  }\n\n  /**\n   * Brevity setter for \"body\".\n   */\n  public b(body: any) {\n    this.body = body;\n    return this;\n  }\n\n  /**\n   * Brevity setter for \"method\".\n   */\n  public m(method: string) {\n    this.method = method;\n    return this;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/resolve-path.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { resolvedPath } from \"./resolve-path\";\n\ndescribe(\"resolvedPath\", () => {\n  const basePath = \"/items/{itemId}\";\n  const uriLabel = \"{itemId}\";\n\n  it(\"replaces the label with the encoded value\", () => {\n    const result = resolvedPath(basePath, { itemId: \"abc\" }, \"itemId\", () => \"abc\", uriLabel, false);\n    expect(result).toBe(\"/items/abc\");\n  });\n\n  it(\"encodes greedy labels segment by segment\", () => {\n    const result = resolvedPath(basePath, { itemId: \"a/b/c\" }, \"itemId\", () => \"a/b/c\", uriLabel, true);\n    expect(result).toBe(\"/items/a/b/c\");\n  });\n\n  it(\"throws when labelValueProvider returns undefined\", () => {\n    expect(() => resolvedPath(basePath, { itemId: \"x\" }, \"itemId\", () => undefined, uriLabel, false)).toThrow(\n      \"Empty value provided for input HTTP label: itemId.\"\n    );\n  });\n\n  it(\"throws when labelValueProvider returns null\", () => {\n    expect(() =>\n      resolvedPath(basePath, { itemId: \"x\" }, \"itemId\", () => null as unknown as string, uriLabel, false)\n    ).toThrow(\"Empty value provided for input HTTP label: itemId.\");\n  });\n\n  it(\"throws when labelValueProvider returns an empty string\", () => {\n    expect(() => resolvedPath(basePath, { itemId: \"x\" }, \"itemId\", () => \"\", uriLabel, false)).toThrow(\n      \"Empty value provided for input HTTP label: itemId.\"\n    );\n  });\n\n  it(\"throws when the member is not present in input\", () => {\n    expect(() => resolvedPath(basePath, {}, \"itemId\", () => \"abc\", uriLabel, false)).toThrow(\n      \"No value provided for input HTTP label: itemId.\"\n    );\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/resolve-path.ts",
    "content": "import { extendedEncodeURIComponent } from \"./extended-encode-uri-component\";\n\n/**\n * @internal\n */\nexport const resolvedPath = (\n  resolvedPath: string,\n  input: unknown,\n  memberName: string,\n  labelValueProvider: () => string | undefined,\n  uriLabel: string,\n  isGreedyLabel: boolean\n): string => {\n  if (input != null && (input as Record<string, unknown>)[memberName] !== undefined) {\n    const labelValue = labelValueProvider();\n    if (labelValue == null || labelValue.length <= 0) {\n      throw new Error(\"Empty value provided for input HTTP label: \" + memberName + \".\");\n    }\n    resolvedPath = resolvedPath.replace(\n      uriLabel,\n      isGreedyLabel\n        ? labelValue\n            .split(\"/\")\n            .map((segment) => extendedEncodeURIComponent(segment))\n            .join(\"/\")\n        : extendedEncodeURIComponent(labelValue)\n    );\n  } else {\n    throw new Error(\"No value provided for input HTTP label: \" + memberName + \".\");\n  }\n  return resolvedPath;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/serde/FromStringShapeDeserializer.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport {\n  LazyJsonString,\n  NumericValue,\n  _parseEpochTimestamp,\n  _parseRfc3339DateTimeWithOffset,\n  _parseRfc7231DateTime,\n  fromBase64,\n  splitHeader,\n  toUtf8,\n} from \"@smithy/core/serde\";\nimport type {\n  CodecSettings,\n  Schema,\n  ShapeDeserializer,\n  TimestampDateTimeSchema,\n  TimestampEpochSecondsSchema,\n  TimestampHttpDateSchema,\n} from \"@smithy/types\";\n\nimport { SerdeContext } from \"../SerdeContext\";\nimport { determineTimestampFormat } from \"./determineTimestampFormat\";\n\n/**\n * This deserializer reads strings.\n *\n * @public\n */\nexport class FromStringShapeDeserializer extends SerdeContext implements ShapeDeserializer<string> {\n  public constructor(private settings: CodecSettings) {\n    super();\n  }\n\n  public read(_schema: Schema, data: string): any {\n    const ns = NormalizedSchema.of(_schema);\n\n    if (ns.isListSchema()) {\n      return splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));\n    }\n\n    if (ns.isBlobSchema()) {\n      return (this.serdeContext?.base64Decoder ?? fromBase64)(data);\n    }\n\n    if (ns.isTimestampSchema()) {\n      const format = determineTimestampFormat(ns, this.settings);\n\n      switch (format) {\n        case 5 satisfies TimestampDateTimeSchema:\n          return _parseRfc3339DateTimeWithOffset(data);\n        case 6 satisfies TimestampHttpDateSchema:\n          return _parseRfc7231DateTime(data);\n        case 7 satisfies TimestampEpochSecondsSchema:\n          return _parseEpochTimestamp(data);\n        default:\n          console.warn(\"Missing timestamp format, parsing value with Date constructor:\", data);\n          return new Date(data as string | number);\n      }\n    }\n\n    if (ns.isStringSchema()) {\n      const mediaType = ns.getMergedTraits().mediaType;\n      let intermediateValue: string | LazyJsonString = data;\n      if (mediaType) {\n        if (ns.getMergedTraits().httpHeader) {\n          intermediateValue = this.base64ToUtf8(intermediateValue);\n        }\n        const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n        if (isJson) {\n          intermediateValue = LazyJsonString.from(intermediateValue);\n        }\n        return intermediateValue;\n      }\n    }\n\n    if (ns.isNumericSchema()) {\n      return Number(data);\n    }\n    if (ns.isBigIntegerSchema()) {\n      return BigInt(data);\n    }\n    if (ns.isBigDecimalSchema()) {\n      return new NumericValue(data, \"bigDecimal\");\n    }\n    if (ns.isBooleanSchema()) {\n      return String(data).toLowerCase() === \"true\";\n    }\n    return data;\n  }\n\n  private base64ToUtf8(base64String: string): any {\n    return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String));\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/serde/HttpInterceptingShapeDeserializer.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport { fromUtf8, toUtf8 } from \"@smithy/core/serde\";\nimport type { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from \"@smithy/types\";\n\nimport { SerdeContext } from \"../SerdeContext\";\nimport { FromStringShapeDeserializer } from \"./FromStringShapeDeserializer\";\n\n/**\n * This deserializer is a dispatcher that decides whether to use a string deserializer\n * or a codec deserializer based on HTTP traits.\n *\n * For example, in a JSON HTTP message, the deserialization of a field will differ depending on whether\n * it is bound to the HTTP header (string) or body (JSON).\n *\n * @public\n */\nexport class HttpInterceptingShapeDeserializer<CodecShapeDeserializer extends ShapeDeserializer<any>>\n  extends SerdeContext\n  implements ShapeDeserializer<string | Uint8Array>\n{\n  private stringDeserializer: FromStringShapeDeserializer;\n\n  public constructor(\n    private codecDeserializer: CodecShapeDeserializer,\n    codecSettings: CodecSettings\n  ) {\n    super();\n    this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);\n  }\n\n  /**\n   * @override\n   */\n  public setSerdeContext(serdeContext: SerdeFunctions): void {\n    this.stringDeserializer.setSerdeContext(serdeContext);\n    this.codecDeserializer.setSerdeContext(serdeContext);\n    this.serdeContext = serdeContext;\n  }\n\n  public read(schema: Schema, data: string | Uint8Array): any | Promise<any> {\n    const ns = NormalizedSchema.of(schema);\n    const traits = ns.getMergedTraits();\n    const toString = this.serdeContext?.utf8Encoder ?? toUtf8;\n\n    if (traits.httpHeader || traits.httpResponseCode) {\n      return this.stringDeserializer.read(ns, toString(data));\n    }\n    if (traits.httpPayload) {\n      if (ns.isBlobSchema()) {\n        const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8;\n        if (typeof data === \"string\") {\n          return toBytes(data);\n        }\n        return data;\n      } else if (ns.isStringSchema()) {\n        if (\"byteLength\" in (data as Uint8Array)) {\n          return toString(data);\n        }\n        return data;\n      }\n    }\n    return this.codecDeserializer.read(ns, data);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/serde/HttpInterceptingShapeSerializer.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport type {\n  CodecSettings,\n  ConfigurableSerdeContext,\n  Schema as ISchema,\n  SerdeFunctions,\n  ShapeSerializer,\n} from \"@smithy/types\";\n\nimport { ToStringShapeSerializer } from \"./ToStringShapeSerializer\";\n\n/**\n * This serializer decides whether to dispatch to a string serializer or a codec serializer\n * depending on HTTP binding traits within the given schema.\n *\n * For example, a JavaScript array is serialized differently when being written\n * to a REST JSON HTTP header (comma-delimited string) and a REST JSON HTTP body (JSON array).\n *\n * @public\n */\nexport class HttpInterceptingShapeSerializer<CodecShapeSerializer extends ShapeSerializer<string | Uint8Array>>\n  implements ShapeSerializer<string | Uint8Array>, ConfigurableSerdeContext\n{\n  private buffer: string | undefined;\n\n  public constructor(\n    private codecSerializer: CodecShapeSerializer,\n    codecSettings: CodecSettings,\n    private stringSerializer = new ToStringShapeSerializer(codecSettings)\n  ) {}\n\n  /**\n   * @override\n   */\n  public setSerdeContext(serdeContext: SerdeFunctions): void {\n    this.codecSerializer.setSerdeContext(serdeContext);\n    this.stringSerializer.setSerdeContext(serdeContext);\n  }\n\n  public write(schema: ISchema, value: unknown): void {\n    const ns = NormalizedSchema.of(schema);\n    const traits = ns.getMergedTraits();\n    if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {\n      this.stringSerializer.write(ns, value);\n      this.buffer = this.stringSerializer.flush();\n      return;\n    }\n    return this.codecSerializer.write(ns, value);\n  }\n\n  public flush(): string | Uint8Array {\n    if (this.buffer !== undefined) {\n      const buffer = this.buffer;\n      this.buffer = undefined;\n      return buffer;\n    }\n    return this.codecSerializer.flush();\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/serde/ToStringShapeSerializer.spec.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport type { StaticStructureSchema, TimestampEpochSecondsSchema } from \"@smithy/types\";\nimport { describe, expect, it } from \"vitest\";\n\nimport { ToStringShapeSerializer } from \"./ToStringShapeSerializer\";\n\ndescribe(ToStringShapeSerializer.name, () => {\n  it(\"should serialize idempotency tokens automatically\", () => {\n    const structureWithIdempotencyToken = [\n      3,\n      \"ns\",\n      \"Struct\",\n      0,\n      [\"name\", \"token\"],\n      [\n        0,\n        [\n          0,\n          {\n            idempotencyToken: 1,\n            httpQuery: \"token\",\n          },\n        ],\n      ],\n    ] satisfies StaticStructureSchema;\n\n    const serializer = new ToStringShapeSerializer({\n      httpBindings: true,\n      timestampFormat: {\n        default: 7 satisfies TimestampEpochSecondsSchema,\n        useTrait: true,\n      },\n    });\n\n    const ns = NormalizedSchema.of(structureWithIdempotencyToken);\n\n    serializer.write(ns.getMemberSchema(\"token\"), undefined);\n    {\n      const serialization = serializer.flush();\n      expect(serialization).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/serde/ToStringShapeSerializer.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport { LazyJsonString, dateToUtcString, generateIdempotencyToken, quoteHeader, toBase64 } from \"@smithy/core/serde\";\nimport type {\n  CodecSettings,\n  Schema,\n  ShapeSerializer,\n  TimestampDateTimeSchema,\n  TimestampEpochSecondsSchema,\n  TimestampHttpDateSchema,\n} from \"@smithy/types\";\n\nimport { SerdeContext } from \"../SerdeContext\";\nimport { determineTimestampFormat } from \"./determineTimestampFormat\";\n\n/**\n * Serializes a shape to string.\n *\n * @public\n */\nexport class ToStringShapeSerializer extends SerdeContext implements ShapeSerializer<string> {\n  private stringBuffer = \"\";\n\n  public constructor(private settings: CodecSettings) {\n    super();\n  }\n\n  public write(schema: Schema, value: unknown): void {\n    const ns = NormalizedSchema.of(schema);\n    switch (typeof value) {\n      case \"object\":\n        if (value === null) {\n          this.stringBuffer = \"null\";\n          return;\n        }\n        if (ns.isTimestampSchema()) {\n          if (!(value instanceof Date)) {\n            throw new Error(\n              `@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(\n                true\n              )}`\n            );\n          }\n          const format = determineTimestampFormat(ns, this.settings);\n          switch (format) {\n            case 5 satisfies TimestampDateTimeSchema:\n              this.stringBuffer = value.toISOString().replace(\".000Z\", \"Z\");\n              break;\n            case 6 satisfies TimestampHttpDateSchema:\n              this.stringBuffer = dateToUtcString(value);\n              break;\n            case 7 satisfies TimestampEpochSecondsSchema:\n              this.stringBuffer = String(value.getTime() / 1000);\n              break;\n            default:\n              console.warn(\"Missing timestamp format, using epoch seconds\", value);\n              this.stringBuffer = String(value.getTime() / 1000);\n          }\n          return;\n        }\n        if (ns.isBlobSchema() && \"byteLength\" in (value as Uint8Array)) {\n          this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value as Uint8Array);\n          return;\n        }\n        if (ns.isListSchema() && Array.isArray(value)) {\n          let buffer = \"\";\n          for (const item of value) {\n            this.write([ns.getValueSchema(), ns.getMergedTraits()], item);\n            const headerItem = this.flush();\n            const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem);\n            if (buffer !== \"\") {\n              buffer += \", \";\n            }\n            buffer += serialized;\n          }\n          this.stringBuffer = buffer;\n          return;\n        }\n        this.stringBuffer = JSON.stringify(value, null, 2);\n        break;\n      case \"string\":\n        const mediaType = ns.getMergedTraits().mediaType;\n        let intermediateValue: string | LazyJsonString = value;\n        if (mediaType) {\n          const isJson = mediaType === \"application/json\" || mediaType.endsWith(\"+json\");\n          if (isJson) {\n            intermediateValue = LazyJsonString.from(intermediateValue);\n          }\n          if (ns.getMergedTraits().httpHeader) {\n            this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString());\n            return;\n          }\n        }\n        this.stringBuffer = value;\n        break;\n      default:\n        if (ns.isIdempotencyToken()) {\n          this.stringBuffer = generateIdempotencyToken();\n        } else {\n          this.stringBuffer = String(value);\n        }\n    }\n  }\n\n  public flush(): string {\n    const buffer = this.stringBuffer;\n    this.stringBuffer = \"\";\n    return buffer;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/serde/determineTimestampFormat.ts",
    "content": "import type { NormalizedSchema } from \"@smithy/core/schema\";\nimport type {\n  CodecSettings,\n  TimestampDateTimeSchema,\n  TimestampEpochSecondsSchema,\n  TimestampHttpDateSchema,\n} from \"@smithy/types\";\n\n/**\n * Assuming the schema is a timestamp type, the function resolves the format using\n * either the timestamp's own traits, or the default timestamp format from the CodecSettings.\n *\n * @internal\n */\nexport function determineTimestampFormat(\n  ns: NormalizedSchema,\n  settings: CodecSettings\n): TimestampDateTimeSchema | TimestampHttpDateSchema | TimestampEpochSecondsSchema {\n  if (settings.timestampFormat.useTrait) {\n    if (\n      ns.isTimestampSchema() &&\n      (ns.getSchema() === (5 satisfies TimestampDateTimeSchema) ||\n        ns.getSchema() === (6 satisfies TimestampHttpDateSchema) ||\n        ns.getSchema() === (7 satisfies TimestampEpochSecondsSchema))\n    ) {\n      return ns.getSchema() as TimestampDateTimeSchema | TimestampHttpDateSchema | TimestampEpochSecondsSchema;\n    }\n  }\n\n  const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();\n\n  const bindingFormat = settings.httpBindings\n    ? typeof httpPrefixHeaders === \"string\" || Boolean(httpHeader)\n      ? (6 satisfies TimestampHttpDateSchema)\n      : Boolean(httpQuery) || Boolean(httpLabel)\n        ? (5 satisfies TimestampDateTimeSchema)\n        : undefined\n    : undefined;\n\n  return bindingFormat ?? settings.timestampFormat.default;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/url-parser/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/protocols`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/querystring-parser@4.2.14\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/querystring-parser@4.2.13\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/querystring-parser@4.2.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/querystring-parser@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/querystring-parser@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/querystring-parser@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/querystring-parser@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/querystring-parser@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/querystring-parser@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/querystring-parser@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/querystring-parser@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/querystring-parser@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/querystring-parser@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/querystring-parser@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/querystring-parser@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/querystring-parser@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/querystring-parser@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/querystring-parser@4.0.5\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/querystring-parser@4.0.4\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/querystring-parser@4.0.3\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/querystring-parser@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/querystring-parser@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/querystring-parser@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/querystring-parser@3.0.11\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/querystring-parser@3.0.10\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/querystring-parser@3.0.9\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/querystring-parser@3.0.8\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/querystring-parser@3.0.7\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/querystring-parser@3.0.6\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/querystring-parser@3.0.5\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/querystring-parser@3.0.4\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/querystring-parser@3.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/querystring-parser@3.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/querystring-parser@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/querystring-parser@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/querystring-parser@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/querystring-parser@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/querystring-parser@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/querystring-parser@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/querystring-parser@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/querystring-parser@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/querystring-parser@2.0.16\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/querystring-parser@2.0.15\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/querystring-parser@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/querystring-parser@2.0.13\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/querystring-parser@2.0.12\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/querystring-parser@2.0.11\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/querystring-parser@2.0.10\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/querystring-parser@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/querystring-parser@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/querystring-parser@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/querystring-parser@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/querystring-parser@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/querystring-parser@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/querystring-parser@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/querystring-parser@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/querystring-parser@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/querystring-parser@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/querystring-parser@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/querystring-parser@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/querystring-parser@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/querystring-parser@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/url-parser](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/url-parser/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/url-parser/parseUrl.spec.ts",
    "content": "import type { Endpoint } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { parseUrl } from \"./parseUrl\";\n\ndescribe(\"parseUrl\", () => {\n  const testCases = new Map<string, Endpoint>([\n    [\n      \"https://www.example.com/path/to%20the/file.ext?snap=cr%C3%A4ckle&snap=p%C3%B4p&fizz=buzz&quux\",\n      {\n        protocol: \"https:\",\n        hostname: \"www.example.com\",\n        path: \"/path/to%20the/file.ext\",\n        query: {\n          snap: [\"cräckle\", \"pôp\"],\n          fizz: \"buzz\",\n          quux: null,\n        },\n      },\n    ],\n    [\n      \"http://example.com:54321\",\n      {\n        protocol: \"http:\",\n        hostname: \"example.com\",\n        port: 54321,\n        path: \"/\",\n      },\n    ],\n    [\n      \"https://example.com?foo=bar\",\n      {\n        protocol: \"https:\",\n        hostname: \"example.com\",\n        path: \"/\",\n        query: { foo: \"bar\" },\n      },\n    ],\n  ]);\n\n  const testFunc = typeof URL !== \"undefined\" ? it : it.skip;\n\n  for (const [url, parsed] of testCases) {\n    testFunc(`should correctly parse ${url}`, () => {\n      expect(parseUrl(url)).toEqual(parsed);\n    });\n  }\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/url-parser/parseUrl.ts",
    "content": "import type { Endpoint, QueryParameterBag, UrlParser } from \"@smithy/types\";\n\nimport { parseQueryString } from \"../querystring-parser/parseQueryString\";\n\n/**\n * @internal\n */\nexport const parseUrl: UrlParser = (url: string | URL): Endpoint => {\n  if (typeof url === \"string\") {\n    return parseUrl(new URL(url));\n  }\n  const { hostname, pathname, port, protocol, search } = url as URL;\n\n  let query: QueryParameterBag | undefined;\n  if (search) {\n    query = parseQueryString(search);\n  }\n\n  return {\n    hostname,\n    port: port ? parseInt(port) : undefined,\n    protocol,\n    path: pathname,\n    query,\n  };\n};\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/util-uri-escape/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/protocols`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-uri-escape](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-uri-escape/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/util-uri-escape/escape-uri-path.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { escapeUriPath } from \"./escape-uri-path\";\n\ndescribe(\"escapeUriPath\", () => {\n  it(`does not escape '/'`, () => {\n    expect(escapeUriPath(\"/a/path/to/nowhere\")).toBe(\"/a/path/to/nowhere\");\n  });\n\n  it(\"does escape non-forward slash characters\", () => {\n    expect(escapeUriPath(\"/once/more !\")).toBe(\"/once/more%20%21\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/util-uri-escape/escape-uri-path.ts",
    "content": "import { escapeUri } from \"./escape-uri\";\n\n/**\n * @internal\n */\nexport const escapeUriPath = (uri: string): string => uri.split(\"/\").map(escapeUri).join(\"/\");\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/util-uri-escape/escape-uri.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { escapeUri } from \"./escape-uri\";\n\ndescribe(\"escapeUri\", () => {\n  it(\"should convert most special characters\", () => {\n    expect(escapeUri(\"!@#$%^&*();':\\\"{}[],/?`\")).toBe(\n      \"%21%40%23%24%25%5E%26%2A%28%29%3B%27%3A%22%7B%7D%5B%5D%2C%2F%3F%60\"\n    );\n  });\n\n  it(\"should not convert tildas or periods\", () => {\n    expect(escapeUri(\"~.\")).toBe(\"~.\");\n  });\n\n  it(\"should encode spaces as %20\", () => {\n    expect(escapeUri(\" \")).toBe(\"%20\");\n  });\n\n  it(\"should convert reserved characters\", () => {\n    expect(escapeUri(`!'()*`)).toBe(\"%21%27%28%29%2A\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/protocols/util-uri-escape/escape-uri.ts",
    "content": "/**\n * @internal\n */\nexport const escapeUri = (uri: string): string =>\n  // AWS percent-encodes some extra non-standard characters in a URI\n  encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);\n\nconst hexEncode = (c: string) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;\n"
  },
  {
    "path": "packages/core/src/submodules/retry/index.browser.ts",
    "content": "import { isStreamingPayload } from \"./middleware-retry/isStreamingPayload/isStreamingPayload.browser\";\nimport { bindGetRetryPlugin, bindRetryMiddleware } from \"./middleware-retry/retryMiddleware\";\n\nconst no = Symbol.for(\"node-only\");\n\n// @smithy/service-error-classification\nexport {\n  isRetryableByTrait,\n  isClockSkewError,\n  isClockSkewCorrectedError,\n  isBrowserNetworkError,\n  isThrottlingError,\n  isTransientError,\n  isServerError,\n  isNodeJsHttp2TransientError,\n} from \"./service-error-classification/service-error-classification\";\n\n// @smithy/util-retry\nexport { AdaptiveRetryStrategy, type AdaptiveRetryStrategyOptions } from \"./util-retry/AdaptiveRetryStrategy\";\nexport { ConfiguredRetryStrategy } from \"./util-retry/ConfiguredRetryStrategy\";\nexport { DefaultRateLimiter, type DefaultRateLimiterOptions } from \"./util-retry/DefaultRateLimiter\";\nexport { StandardRetryStrategy, type StandardRetryStrategyOptions } from \"./util-retry/StandardRetryStrategy\";\nexport { RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from \"./util-retry/config\";\nexport {\n  DEFAULT_RETRY_DELAY_BASE,\n  MAXIMUM_RETRY_DELAY,\n  THROTTLING_RETRY_DELAY_BASE,\n  INITIAL_RETRY_TOKENS,\n  RETRY_COST,\n  TIMEOUT_RETRY_COST,\n  NO_RETRY_INCREMENT,\n  INVOCATION_ID_HEADER,\n  REQUEST_HEADER,\n} from \"./util-retry/constants\";\nexport type { RateLimiter } from \"./util-retry/types\";\nexport { Retry } from \"./util-retry/retries-2026-config\";\n\n// @smithy/middleware-retry\nexport {\n  AdaptiveRetryStrategy as DeprecatedAdaptiveRetryStrategy,\n  type AdaptiveRetryStrategyOptions as DeprecatedAdaptiveRetryStrategyOptions,\n} from \"./middleware-retry/retry-pre-sra-deprecated/AdaptiveRetryStrategy\";\nexport {\n  StandardRetryStrategy as DeprecatedStandardRetryStrategy,\n  type StandardRetryStrategyOptions as DeprecatedStandardRetryStrategyOptions,\n} from \"./middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy\";\nexport { defaultDelayDecider } from \"./middleware-retry/retry-pre-sra-deprecated/delayDecider\";\nexport { defaultRetryDecider } from \"./middleware-retry/retry-pre-sra-deprecated/retryDecider\";\nexport const ENV_MAX_ATTEMPTS = no;\nexport const CONFIG_MAX_ATTEMPTS = no;\nexport const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = no;\nexport const ENV_RETRY_MODE = no;\nexport const CONFIG_RETRY_MODE = no;\nexport const NODE_RETRY_MODE_CONFIG_OPTIONS = no;\nexport { resolveRetryConfig } from \"./middleware-retry/configurations\";\nexport type { RetryInputConfig, RetryResolvedConfig, PreviouslyResolved } from \"./middleware-retry/configurations\";\nexport {\n  omitRetryHeadersMiddleware,\n  omitRetryHeadersMiddlewareOptions,\n  getOmitRetryHeadersPlugin,\n} from \"./middleware-retry/omitRetryHeadersMiddleware\";\nexport { retryMiddlewareOptions } from \"./middleware-retry/retryMiddleware\";\nexport { getRetryAfterHint } from \"./middleware-retry/parseRetryAfterHeader\";\n\nexport const retryMiddleware = bindRetryMiddleware(isStreamingPayload);\nexport const getRetryPlugin = bindGetRetryPlugin(isStreamingPayload);\n"
  },
  {
    "path": "packages/core/src/submodules/retry/index.ts",
    "content": "import { isStreamingPayload } from \"./middleware-retry/isStreamingPayload/isStreamingPayload\";\nimport { bindGetRetryPlugin, bindRetryMiddleware } from \"./middleware-retry/retryMiddleware\";\n\n// @smithy/service-error-classification\nexport {\n  isRetryableByTrait,\n  isClockSkewError,\n  isClockSkewCorrectedError,\n  isBrowserNetworkError,\n  isThrottlingError,\n  isTransientError,\n  isServerError,\n  isNodeJsHttp2TransientError,\n} from \"./service-error-classification/service-error-classification\";\n\n// @smithy/util-retry\nexport { AdaptiveRetryStrategy, type AdaptiveRetryStrategyOptions } from \"./util-retry/AdaptiveRetryStrategy\";\nexport { ConfiguredRetryStrategy } from \"./util-retry/ConfiguredRetryStrategy\";\nexport { DefaultRateLimiter, type DefaultRateLimiterOptions } from \"./util-retry/DefaultRateLimiter\";\nexport { StandardRetryStrategy, type StandardRetryStrategyOptions } from \"./util-retry/StandardRetryStrategy\";\nexport { RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from \"./util-retry/config\";\nexport {\n  DEFAULT_RETRY_DELAY_BASE,\n  MAXIMUM_RETRY_DELAY,\n  THROTTLING_RETRY_DELAY_BASE,\n  INITIAL_RETRY_TOKENS,\n  RETRY_COST,\n  TIMEOUT_RETRY_COST,\n  NO_RETRY_INCREMENT,\n  INVOCATION_ID_HEADER,\n  REQUEST_HEADER,\n} from \"./util-retry/constants\";\nexport type { RateLimiter } from \"./util-retry/types\";\nexport { Retry } from \"./util-retry/retries-2026-config\";\n\n// @smithy/middleware-retry\nexport {\n  AdaptiveRetryStrategy as DeprecatedAdaptiveRetryStrategy,\n  type AdaptiveRetryStrategyOptions as DeprecatedAdaptiveRetryStrategyOptions,\n} from \"./middleware-retry/retry-pre-sra-deprecated/AdaptiveRetryStrategy\";\nexport {\n  StandardRetryStrategy as DeprecatedStandardRetryStrategy,\n  type StandardRetryStrategyOptions as DeprecatedStandardRetryStrategyOptions,\n} from \"./middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy\";\nexport { defaultDelayDecider } from \"./middleware-retry/retry-pre-sra-deprecated/delayDecider\";\nexport { defaultRetryDecider } from \"./middleware-retry/retry-pre-sra-deprecated/retryDecider\";\nexport {\n  ENV_MAX_ATTEMPTS,\n  CONFIG_MAX_ATTEMPTS,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  ENV_RETRY_MODE,\n  CONFIG_RETRY_MODE,\n  NODE_RETRY_MODE_CONFIG_OPTIONS,\n  resolveRetryConfig,\n} from \"./middleware-retry/configurations\";\nexport type { RetryInputConfig, RetryResolvedConfig, PreviouslyResolved } from \"./middleware-retry/configurations\";\nexport {\n  omitRetryHeadersMiddleware,\n  omitRetryHeadersMiddlewareOptions,\n  getOmitRetryHeadersPlugin,\n} from \"./middleware-retry/omitRetryHeadersMiddleware\";\nexport { retryMiddlewareOptions } from \"./middleware-retry/retryMiddleware\";\nexport { getRetryAfterHint } from \"./middleware-retry/parseRetryAfterHeader\";\n\nexport const retryMiddleware = bindRetryMiddleware(isStreamingPayload);\nexport const getRetryPlugin = bindGetRetryPlugin(isStreamingPayload);\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/retry`.\n\n## 4.5.7\n\n### Patch Changes\n\n- Updated dependencies [2e5142c]\n- Updated dependencies [9c88c10]\n  - @smithy/util-retry@4.3.6\n\n## 4.5.6\n\n### Patch Changes\n\n- Updated dependencies [15f9e53]\n  - @smithy/service-error-classification@4.3.1\n  - @smithy/util-retry@4.3.5\n\n## 4.5.5\n\n### Patch Changes\n\n- Updated dependencies [b877fc2]\n  - @smithy/util-retry@4.3.4\n  - @smithy/core@3.23.17\n  - @smithy/smithy-client@4.12.13\n\n## 4.5.4\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n- Updated dependencies [60d13c8]\n  - @smithy/core@3.23.16\n  - @smithy/service-error-classification@4.3.0\n  - @smithy/smithy-client@4.12.12\n  - @smithy/util-retry@4.3.3\n\n## 4.5.3\n\n### Patch Changes\n\n- Updated dependencies [b69e3c9]\n  - @smithy/smithy-client@4.12.11\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/smithy-client@4.12.10\n  - @smithy/types@4.14.1\n  - @smithy/core@3.23.15\n  - @smithy/node-config-provider@4.3.14\n  - @smithy/protocol-http@5.3.14\n  - @smithy/service-error-classification@4.2.14\n  - @smithy/util-middleware@4.2.14\n  - @smithy/util-retry@4.3.2\n\n## 4.5.1\n\n### Patch Changes\n\n- Updated dependencies [a45aaf5]\n  - @smithy/util-retry@4.3.1\n\n## 4.5.0\n\n### Minor Changes\n\n- cffd868: Introduce default retry behavior modifications slated for 2026. They are:\n  less time between server error retries, but slightly more time between throttling errors. Lower retry capacity consumption for throttling, and improved parsing of the retry-after and x-amz-retry-after headers.\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/util-retry@4.3.0\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/node-config-provider@4.3.13\n  - @smithy/protocol-http@5.3.13\n  - @smithy/service-error-classification@4.2.13\n  - @smithy/smithy-client@4.12.9\n  - @smithy/util-middleware@4.2.13\n\n## 4.4.46\n\n### Patch Changes\n\n- Updated dependencies [3c21a57]\n  - @smithy/util-retry@4.2.13\n\n## 4.4.45\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.8\n\n## 4.4.44\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.7\n\n## 4.4.43\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.6\n\n## 4.4.42\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.5\n\n## 4.4.41\n\n### Patch Changes\n\n- dfc743d: fix(middleware-retry): memoize default retry strategy in `resolveRetryConfig` so that `StandardRetryStrategy` capacity and `AdaptiveRetryStrategy` rate limiter state persist across requests instead of being reconstructed per-call.\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/smithy-client@4.12.4\n  - @smithy/node-config-provider@4.3.12\n  - @smithy/protocol-http@5.3.12\n  - @smithy/service-error-classification@4.2.12\n  - @smithy/util-middleware@4.2.12\n  - @smithy/util-retry@4.2.12\n\n## 4.4.40\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.3\n\n## 4.4.39\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/service-error-classification@4.2.11\n  - @smithy/node-config-provider@4.3.11\n  - @smithy/util-middleware@4.2.11\n  - @smithy/protocol-http@5.3.11\n  - @smithy/smithy-client@4.12.2\n  - @smithy/util-retry@4.2.11\n  - @smithy/uuid@1.1.2\n\n## 4.4.38\n\n### Patch Changes\n\n- @smithy/smithy-client@4.12.1\n\n## 4.4.37\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/smithy-client@4.12.0\n  - @smithy/types@4.13.0\n  - @smithy/node-config-provider@4.3.10\n  - @smithy/protocol-http@5.3.10\n  - @smithy/service-error-classification@4.2.10\n  - @smithy/util-middleware@4.2.10\n  - @smithy/util-retry@4.2.10\n\n## 4.4.36\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.8\n\n## 4.4.35\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/protocol-http@5.3.9\n  - @smithy/service-error-classification@4.2.9\n  - @smithy/smithy-client@4.11.7\n  - @smithy/types@4.12.1\n  - @smithy/util-middleware@4.2.9\n  - @smithy/util-retry@4.2.9\n  - @smithy/uuid@1.1.1\n\n## 4.4.34\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.6\n\n## 4.4.33\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.5\n\n## 4.4.32\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.4\n\n## 4.4.31\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.3\n\n## 4.4.30\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.2\n\n## 4.4.29\n\n### Patch Changes\n\n- @smithy/smithy-client@4.11.1\n\n## 4.4.28\n\n### Patch Changes\n\n- Updated dependencies [75145e5]\n  - @smithy/smithy-client@4.11.0\n\n## 4.4.27\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.12\n\n## 4.4.26\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.11\n\n## 4.4.25\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.10\n\n## 4.4.24\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.9\n\n## 4.4.23\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.8\n\n## 4.4.22\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/node-config-provider@4.3.8\n  - @smithy/protocol-http@5.3.8\n  - @smithy/service-error-classification@4.2.8\n  - @smithy/smithy-client@4.10.7\n  - @smithy/util-middleware@4.2.8\n  - @smithy/util-retry@4.2.8\n\n## 4.4.21\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.6\n\n## 4.4.20\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.5\n\n## 4.4.19\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.4\n\n## 4.4.18\n\n### Patch Changes\n\n- @smithy/smithy-client@4.10.3\n\n## 4.4.17\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/node-config-provider@4.3.7\n  - @smithy/protocol-http@5.3.7\n  - @smithy/service-error-classification@4.2.7\n  - @smithy/smithy-client@4.10.2\n  - @smithy/util-middleware@4.2.7\n  - @smithy/util-retry@4.2.7\n\n## 4.4.16\n\n### Patch Changes\n\n- Updated dependencies [f3a51c2]\n  - @smithy/smithy-client@4.10.1\n\n## 4.4.15\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/smithy-client@4.10.0\n  - @smithy/types@4.10.0\n  - @smithy/node-config-provider@4.3.6\n  - @smithy/protocol-http@5.3.6\n  - @smithy/service-error-classification@4.2.6\n  - @smithy/util-middleware@4.2.6\n  - @smithy/util-retry@4.2.6\n\n## 4.4.14\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.10\n\n## 4.4.13\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.9\n\n## 4.4.12\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.8\n\n## 4.4.11\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.7\n\n## 4.4.10\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.6\n\n## 4.4.9\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.5\n\n## 4.4.8\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.4\n\n## 4.4.7\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/node-config-provider@4.3.5\n  - @smithy/protocol-http@5.3.5\n  - @smithy/service-error-classification@4.2.5\n  - @smithy/smithy-client@4.9.3\n  - @smithy/util-middleware@4.2.5\n  - @smithy/util-retry@4.2.5\n\n## 4.4.6\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/node-config-provider@4.3.4\n  - @smithy/protocol-http@5.3.4\n  - @smithy/service-error-classification@4.2.4\n  - @smithy/smithy-client@4.9.2\n  - @smithy/util-middleware@4.2.4\n  - @smithy/util-retry@4.2.4\n\n## 4.4.5\n\n### Patch Changes\n\n- @smithy/smithy-client@4.9.1\n\n## 4.4.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/smithy-client@4.9.0\n  - @smithy/types@4.8.0\n  - @smithy/node-config-provider@4.3.3\n  - @smithy/protocol-http@5.3.3\n  - @smithy/service-error-classification@4.2.3\n  - @smithy/util-middleware@4.2.3\n  - @smithy/util-retry@4.2.3\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/smithy-client@4.8.1\n  - @smithy/node-config-provider@4.3.2\n  - @smithy/protocol-http@5.3.2\n  - @smithy/service-error-classification@4.2.2\n  - @smithy/util-middleware@4.2.2\n  - @smithy/util-retry@4.2.2\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/smithy-client@4.8.0\n  - @smithy/node-config-provider@4.3.1\n  - @smithy/protocol-http@5.3.1\n  - @smithy/service-error-classification@4.2.1\n  - @smithy/util-middleware@4.2.1\n  - @smithy/util-retry@4.2.1\n\n## 4.4.1\n\n### Patch Changes\n\n- @smithy/smithy-client@4.7.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/service-error-classification@4.2.0\n  - @smithy/smithy-client@4.7.0\n  - @smithy/types@4.6.0\n  - @smithy/util-middleware@4.2.0\n  - @smithy/util-retry@4.2.0\n  - @smithy/uuid@1.1.0\n\n## 4.3.1\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.5\n\n## 4.3.0\n\n### Minor Changes\n\n- 97fe0d8: Replace 'uuid' with '@smithy/uuid'\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.4\n\n## 4.2.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.6.3\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [937ac5a]\n  - @smithy/service-error-classification@4.1.2\n  - @smithy/util-retry@4.1.2\n\n## 4.2.2\n\n### Patch Changes\n\n- @smithy/node-config-provider@4.2.2\n- @smithy/smithy-client@4.6.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/node-config-provider@4.2.1\n  - @smithy/protocol-http@5.2.1\n  - @smithy/service-error-classification@4.1.1\n  - @smithy/smithy-client@4.6.1\n  - @smithy/util-middleware@4.1.1\n  - @smithy/util-retry@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/service-error-classification@4.1.0\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/smithy-client@4.6.0\n  - @smithy/util-retry@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.1.22\n\n### Patch Changes\n\n- @smithy/smithy-client@4.5.2\n\n## 4.1.21\n\n### Patch Changes\n\n- @smithy/smithy-client@4.5.1\n\n## 4.1.20\n\n### Patch Changes\n\n- Updated dependencies [eb1ab40]\n  - @smithy/smithy-client@4.5.0\n\n## 4.1.19\n\n### Patch Changes\n\n- fd00602: update uuid types version\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/smithy-client@4.4.10\n  - @smithy/node-config-provider@4.1.4\n  - @smithy/protocol-http@5.1.3\n  - @smithy/service-error-classification@4.0.7\n  - @smithy/util-middleware@4.0.5\n  - @smithy/util-retry@4.0.7\n\n## 4.1.18\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.9\n\n## 4.1.17\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.8\n\n## 4.1.16\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.7\n\n## 4.1.15\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.6\n\n## 4.1.14\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.5\n\n## 4.1.13\n\n### Patch Changes\n\n- Updated dependencies [c8d5bb2]\n  - @smithy/service-error-classification@4.0.6\n  - @smithy/util-retry@4.0.6\n  - @smithy/smithy-client@4.4.4\n\n## 4.1.12\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.3\n\n## 4.1.11\n\n### Patch Changes\n\n- @smithy/smithy-client@4.4.2\n\n## 4.1.10\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/node-config-provider@4.1.3\n  - @smithy/protocol-http@5.1.2\n  - @smithy/service-error-classification@4.0.5\n  - @smithy/smithy-client@4.4.1\n  - @smithy/util-middleware@4.0.4\n  - @smithy/util-retry@4.0.5\n\n## 4.1.9\n\n### Patch Changes\n\n- Updated dependencies [23812a9]\n  - @smithy/smithy-client@4.4.0\n\n## 4.1.8\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n- Updated dependencies [06b0ce8]\n  - @smithy/types@4.3.0\n  - @smithy/smithy-client@4.3.0\n  - @smithy/node-config-provider@4.1.2\n  - @smithy/protocol-http@5.1.1\n  - @smithy/service-error-classification@4.0.4\n  - @smithy/util-middleware@4.0.3\n  - @smithy/util-retry@4.0.4\n\n## 4.1.7\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.6\n\n## 4.1.6\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.5\n\n## 4.1.5\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n  - @smithy/smithy-client@4.2.4\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n  - @smithy/smithy-client@4.2.3\n\n## 4.1.3\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.2\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [89bde09]\n  - @smithy/service-error-classification@4.0.3\n  - @smithy/util-retry@4.0.3\n\n## 4.1.1\n\n### Patch Changes\n\n- @smithy/smithy-client@4.2.1\n\n## 4.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/smithy-client@4.2.0\n  - @smithy/types@4.2.0\n  - @smithy/node-config-provider@4.0.2\n  - @smithy/service-error-classification@4.0.2\n  - @smithy/util-middleware@4.0.2\n  - @smithy/util-retry@4.0.2\n\n## 4.0.7\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.6\n\n## 4.0.6\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.5\n\n## 4.0.5\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.4\n\n## 4.0.4\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.3\n\n## 4.0.3\n\n### Patch Changes\n\n- @smithy/smithy-client@4.1.2\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e87f2b3]\n  - @smithy/smithy-client@4.1.1\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n- Updated dependencies [292c134]\n  - @smithy/types@4.1.0\n  - @smithy/smithy-client@4.1.0\n  - @smithy/node-config-provider@4.0.1\n  - @smithy/protocol-http@5.0.1\n  - @smithy/service-error-classification@4.0.1\n  - @smithy/util-middleware@4.0.1\n  - @smithy/util-retry@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/util-middleware@4.0.0\n  - @smithy/smithy-client@4.0.0\n  - @smithy/util-retry@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/service-error-classification@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.34\n\n### Patch Changes\n\n- Updated dependencies [a0e71d5]\n  - @smithy/smithy-client@3.7.0\n\n## 3.0.33\n\n### Patch Changes\n\n- Updated dependencies [23129d9]\n  - @smithy/smithy-client@3.6.0\n\n## 3.0.32\n\n### Patch Changes\n\n- @smithy/smithy-client@3.5.2\n\n## 3.0.31\n\n### Patch Changes\n\n- Updated dependencies [7f17426]\n  - @smithy/smithy-client@3.5.1\n\n## 3.0.30\n\n### Patch Changes\n\n- Updated dependencies [70275bd]\n  - @smithy/smithy-client@3.5.0\n\n## 3.0.29\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/service-error-classification@3.0.11\n  - @smithy/types@3.7.2\n  - @smithy/util-retry@3.0.11\n  - @smithy/node-config-provider@3.1.12\n  - @smithy/protocol-http@4.1.8\n  - @smithy/smithy-client@3.4.6\n  - @smithy/util-middleware@3.0.11\n\n## 3.0.28\n\n### Patch Changes\n\n- @smithy/smithy-client@3.4.5\n\n## 3.0.27\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/node-config-provider@3.1.11\n  - @smithy/protocol-http@4.1.7\n  - @smithy/service-error-classification@3.0.10\n  - @smithy/smithy-client@3.4.4\n  - @smithy/util-middleware@3.0.10\n  - @smithy/util-retry@3.0.10\n\n## 3.0.26\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/smithy-client@3.4.3\n  - @smithy/node-config-provider@3.1.10\n  - @smithy/protocol-http@4.1.6\n  - @smithy/service-error-classification@3.0.9\n  - @smithy/util-middleware@3.0.9\n  - @smithy/util-retry@3.0.9\n\n## 3.0.25\n\n### Patch Changes\n\n- @smithy/smithy-client@3.4.2\n\n## 3.0.24\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n  - @smithy/types@3.6.0\n  - @smithy/smithy-client@3.4.1\n  - @smithy/node-config-provider@3.1.9\n  - @smithy/protocol-http@4.1.5\n  - @smithy/service-error-classification@3.0.8\n  - @smithy/util-middleware@3.0.8\n  - @smithy/util-retry@3.0.8\n\n## 3.0.23\n\n### Patch Changes\n\n- Updated dependencies [75e0125]\n  - @smithy/smithy-client@3.4.0\n\n## 3.0.22\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/node-config-provider@3.1.8\n  - @smithy/protocol-http@4.1.4\n  - @smithy/service-error-classification@3.0.7\n  - @smithy/smithy-client@3.3.6\n  - @smithy/util-middleware@3.0.7\n  - @smithy/util-retry@3.0.7\n\n## 3.0.21\n\n### Patch Changes\n\n- Updated dependencies [64600d8]\n  - @smithy/smithy-client@3.3.5\n\n## 3.0.20\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.4\n\n## 3.0.19\n\n### Patch Changes\n\n- @smithy/smithy-client@3.3.3\n\n## 3.0.18\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/node-config-provider@3.1.7\n  - @smithy/protocol-http@4.1.3\n  - @smithy/service-error-classification@3.0.6\n  - @smithy/smithy-client@3.3.2\n  - @smithy/util-middleware@3.0.6\n  - @smithy/util-retry@3.0.6\n\n## 3.0.17\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/node-config-provider@3.1.6\n  - @smithy/protocol-http@4.1.2\n  - @smithy/service-error-classification@3.0.5\n  - @smithy/smithy-client@3.3.1\n  - @smithy/util-middleware@3.0.5\n  - @smithy/util-retry@3.0.5\n\n## 3.0.16\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [d8df7bf]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/smithy-client@3.3.0\n  - @smithy/node-config-provider@3.1.5\n  - @smithy/protocol-http@4.1.1\n  - @smithy/service-error-classification@3.0.4\n  - @smithy/util-middleware@3.0.4\n  - @smithy/util-retry@3.0.4\n\n## 3.0.15\n\n### Patch Changes\n\n- Updated dependencies [5865b65]\n  - @smithy/smithy-client@3.2.0\n\n## 3.0.14\n\n### Patch Changes\n\n- Updated dependencies [670553a]\n  - @smithy/smithy-client@3.1.12\n\n## 3.0.13\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.11\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n  - @smithy/smithy-client@3.1.10\n\n## 3.0.11\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.9\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n  - @smithy/smithy-client@3.1.8\n\n## 3.0.9\n\n### Patch Changes\n\n- @smithy/node-config-provider@3.1.4\n- @smithy/smithy-client@3.1.7\n\n## 3.0.8\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.6\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/node-config-provider@3.1.3\n  - @smithy/protocol-http@4.0.3\n  - @smithy/service-error-classification@3.0.3\n  - @smithy/smithy-client@3.1.5\n  - @smithy/util-middleware@3.0.3\n  - @smithy/util-retry@3.0.3\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/node-config-provider@3.1.2\n  - @smithy/protocol-http@4.0.2\n  - @smithy/service-error-classification@3.0.2\n  - @smithy/smithy-client@3.1.4\n  - @smithy/util-middleware@3.0.2\n  - @smithy/util-retry@3.0.2\n\n## 3.0.5\n\n### Patch Changes\n\n- @smithy/smithy-client@3.1.3\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/node-config-provider@3.1.1\n  - @smithy/protocol-http@4.0.1\n  - @smithy/service-error-classification@3.0.1\n  - @smithy/smithy-client@3.1.2\n  - @smithy/util-middleware@3.0.1\n  - @smithy/util-retry@3.0.1\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [3689c949]\n  - @smithy/smithy-client@3.1.1\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n- Updated dependencies [764047eb]\n  - @smithy/node-config-provider@3.1.0\n  - @smithy/smithy-client@3.1.0\n\n## 3.0.1\n\n### Patch Changes\n\n- @smithy/smithy-client@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/service-error-classification@3.0.0\n  - @smithy/node-config-provider@3.0.0\n  - @smithy/util-middleware@3.0.0\n  - @smithy/protocol-http@4.0.0\n  - @smithy/smithy-client@3.0.0\n  - @smithy/util-retry@3.0.0\n\n## 2.3.1\n\n### Patch Changes\n\n- @smithy/smithy-client@2.5.1\n\n## 2.3.0\n\n### Minor Changes\n\n- e03a10ac: Set uuid to ^9.0.1\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/smithy-client@2.5.0\n  - @smithy/util-retry@2.2.0\n  - @smithy/types@2.12.0\n  - @smithy/service-error-classification@2.1.5\n\n## 2.1.7\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.5\n\n## 2.1.6\n\n### Patch Changes\n\n- @smithy/smithy-client@2.4.4\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/node-config-provider@2.2.5\n  - @smithy/protocol-http@3.2.2\n  - @smithy/service-error-classification@2.1.4\n  - @smithy/smithy-client@2.4.3\n  - @smithy/util-middleware@2.1.4\n  - @smithy/util-retry@2.1.4\n\n## 2.1.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.2.4\n- @smithy/smithy-client@2.4.2\n\n## 2.1.3\n\n### Patch Changes\n\n- dd0d9b4b: make clock skew correcting errors transient\n- Updated dependencies [dd0d9b4b]\n  - @smithy/service-error-classification@2.1.3\n  - @smithy/types@2.10.1\n  - @smithy/util-retry@2.1.3\n  - @smithy/node-config-provider@2.2.3\n  - @smithy/protocol-http@3.2.1\n  - @smithy/smithy-client@2.4.1\n  - @smithy/util-middleware@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/smithy-client@2.4.0\n  - @smithy/node-config-provider@2.2.2\n  - @smithy/service-error-classification@2.1.2\n  - @smithy/util-middleware@2.1.2\n  - @smithy/util-retry@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/service-error-classification@2.1.1\n  - @smithy/smithy-client@2.3.1\n  - @smithy/types@2.9.1\n  - @smithy/util-middleware@2.1.1\n  - @smithy/util-retry@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/service-error-classification@2.1.0\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/smithy-client@2.3.0\n  - @smithy/util-retry@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.26\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/smithy-client@2.2.1\n  - @smithy/node-config-provider@2.1.9\n  - @smithy/protocol-http@3.0.12\n  - @smithy/service-error-classification@2.0.9\n  - @smithy/util-middleware@2.0.9\n  - @smithy/util-retry@2.0.9\n\n## 2.0.25\n\n### Patch Changes\n\n- Updated dependencies [164f3bbd]\n- Updated dependencies [164f3bbd]\n  - @smithy/smithy-client@2.2.0\n\n## 2.0.24\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.8\n\n## 2.0.23\n\n### Patch Changes\n\n- @smithy/smithy-client@2.1.18\n\n## 2.0.22\n\n### Patch Changes\n\n- 44f78bd9: prevent retries of streaming requests\n- Updated dependencies [07ff207b]\n- Updated dependencies [340634a5]\n  - @smithy/smithy-client@2.1.17\n  - @smithy/types@2.7.0\n  - @smithy/node-config-provider@2.1.7\n  - @smithy/protocol-http@3.0.11\n  - @smithy/service-error-classification@2.0.8\n  - @smithy/util-middleware@2.0.8\n  - @smithy/util-retry@2.0.8\n\n## 2.0.21\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/node-config-provider@2.1.6\n  - @smithy/protocol-http@3.0.10\n  - @smithy/service-error-classification@2.0.7\n  - @smithy/util-middleware@2.0.7\n  - @smithy/util-retry@2.0.7\n\n## 2.0.20\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/node-config-provider@2.1.5\n  - @smithy/protocol-http@3.0.9\n  - @smithy/service-error-classification@2.0.6\n  - @smithy/util-middleware@2.0.6\n  - @smithy/util-retry@2.0.6\n\n## 2.0.19\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.4\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/node-config-provider@2.1.3\n  - @smithy/protocol-http@3.0.8\n  - @smithy/service-error-classification@2.0.5\n  - @smithy/util-middleware@2.0.5\n  - @smithy/util-retry@2.0.5\n\n## 2.0.17\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.2\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/node-config-provider@2.1.1\n  - @smithy/protocol-http@3.0.7\n  - @smithy/service-error-classification@2.0.4\n  - @smithy/util-middleware@2.0.4\n  - @smithy/util-retry@2.0.4\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [7b568c39]\n  - @smithy/node-config-provider@2.1.0\n\n## 2.0.14\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/node-config-provider@2.0.13\n  - @smithy/protocol-http@3.0.6\n  - @smithy/service-error-classification@2.0.3\n  - @smithy/util-middleware@2.0.3\n  - @smithy/util-retry@2.0.3\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/node-config-provider@2.0.12\n  - @smithy/protocol-http@3.0.5\n  - @smithy/service-error-classification@2.0.2\n  - @smithy/util-middleware@2.0.2\n  - @smithy/util-retry@2.0.2\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [e6ea6bd5]\n- Updated dependencies [c0b17a13]\n- Updated dependencies [5b6fa539]\n  - @smithy/types@2.3.2\n  - @smithy/service-error-classification@2.0.1\n  - @smithy/util-middleware@2.0.1\n  - @smithy/util-retry@2.0.1\n  - @smithy/node-config-provider@2.0.11\n  - @smithy/protocol-http@3.0.4\n\n## 2.0.10\n\n### Patch Changes\n\n- 2d9473cf: Link to util-retry documentation\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/node-config-provider@2.0.10\n  - @smithy/protocol-http@3.0.3\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n\n## 2.0.8\n\n### Patch Changes\n\n- d3daa891: Move @smithy/node-config-provider to deps\n  - @smithy/node-config-provider@2.0.9\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.5\n\n### Patch Changes\n\n- 1be3c4c9: Add integration tests\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/protocol-http@2.0.5\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/protocol-http@2.0.4\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/protocol-http@2.0.3\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.2\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/protocol-http@2.0.2\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/protocol-http@2.0.1\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/protocol-http@2.0.0\n  - @smithy/service-error-classification@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-retry@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/protocol-http@1.2.0\n  - @smithy/service-error-classification@1.1.0\n  - @smithy/types@1.2.0\n  - @smithy/util-middleware@1.1.0\n  - @smithy/util-retry@1.1.0\n\n## 1.0.5\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/protocol-http@1.1.2\n  - @smithy/service-error-classification@1.0.3\n  - @smithy/util-middleware@1.0.2\n  - @smithy/util-retry@1.0.4\n\n## 1.0.4\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/service-error-classification@1.0.3\n  - @smithy/util-middleware@1.0.2\n  - @smithy/protocol-http@1.1.1\n  - @smithy/util-retry@1.0.4\n  - @smithy/types@1.1.1\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [c03ce2aa]\n- Updated dependencies [170ac764]\n  - @smithy/service-error-classification@1.0.2\n  - @smithy/util-retry@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- Updated dependencies [d4dbe242]\n  - @smithy/util-retry@1.0.2\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/service-error-classification@1.0.1\n  - @smithy/util-middleware@1.0.1\n  - @smithy/util-retry@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/middleware-retry](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/middleware-retry/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/configurations.spec.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport type { Provider } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { AdaptiveRetryStrategy } from \"../util-retry/AdaptiveRetryStrategy\";\nimport { StandardRetryStrategy } from \"../util-retry/StandardRetryStrategy\";\nimport { DEFAULT_MAX_ATTEMPTS } from \"../util-retry/config\";\nimport {\n  CONFIG_MAX_ATTEMPTS,\n  ENV_MAX_ATTEMPTS,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  resolveRetryConfig,\n} from \"./configurations\";\n\nvi.mock(\"@smithy/core/client\");\nvi.mock(\"../util-retry/AdaptiveRetryStrategy\");\nvi.mock(\"../util-retry/StandardRetryStrategy\");\n\ndescribe(resolveRetryConfig.name, () => {\n  const retryMode = vi.fn() as any;\n\n  beforeEach(() => {\n    vi.mocked(normalizeProvider).mockImplementation((input) =>\n      typeof input === \"function\" ? (input as Provider<unknown>) : () => Promise.resolve(input)\n    );\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"maintains object custody\", () => {\n    const input = {\n      retryMode: \"STANDARD\",\n    };\n    expect(resolveRetryConfig(input)).toBe(input);\n  });\n\n  describe(\"maxAttempts\", () => {\n    it.each([1, 2, 3])(\"assigns provided value %s\", async (maxAttempts) => {\n      const output = await resolveRetryConfig({ maxAttempts, retryMode }).maxAttempts();\n      expect(output).toStrictEqual(maxAttempts);\n    });\n\n    it(`assigns default ${DEFAULT_MAX_ATTEMPTS} is value not provided`, async () => {\n      const output = await resolveRetryConfig({ retryMode }).maxAttempts();\n      expect(output).toStrictEqual(DEFAULT_MAX_ATTEMPTS);\n    });\n  });\n\n  describe(\"retryStrategy\", () => {\n    it(\"passes retryStrategy if present\", async () => {\n      const mockRetryStrategy = {\n        retry: vi.fn(),\n      };\n      const { retryStrategy } = resolveRetryConfig({\n        retryMode,\n        retryStrategy: mockRetryStrategy,\n      });\n      expect(await retryStrategy()).toEqual(mockRetryStrategy);\n    });\n\n    describe(\"creates RetryStrategy if retryStrategy not present\", () => {\n      describe(\"StandardRetryStrategy\", () => {\n        describe(\"when retryMode=standard\", () => {\n          describe(\"passes maxAttempts if present\", () => {\n            const retryMode = \"standard\";\n            for (const maxAttempts of [1, 2, 3]) {\n              it(`when maxAttempts=${maxAttempts}`, async () => {\n                const { retryStrategy } = resolveRetryConfig({ maxAttempts, retryMode });\n                await retryStrategy();\n                expect(vi.mocked(StandardRetryStrategy)).toHaveBeenCalledTimes(1);\n                expect(vi.mocked(AdaptiveRetryStrategy)).not.toHaveBeenCalled();\n                const output = await vi.mocked(StandardRetryStrategy as any).mock.calls[0][0]();\n                expect(output).toStrictEqual(maxAttempts);\n              });\n            }\n          });\n        });\n\n        describe(\"when retryMode returns 'standard'\", () => {\n          describe(\"passes maxAttempts if present\", () => {\n            beforeEach(() => {\n              retryMode.mockResolvedValueOnce(\"standard\");\n            });\n            for (const maxAttempts of [1, 2, 3]) {\n              it(`when maxAttempts=${maxAttempts}`, async () => {\n                const { retryStrategy } = resolveRetryConfig({ maxAttempts, retryMode });\n                await retryStrategy();\n                expect(retryMode).toHaveBeenCalledTimes(1);\n                expect(vi.mocked(StandardRetryStrategy)).toHaveBeenCalledTimes(1);\n                expect(vi.mocked(AdaptiveRetryStrategy)).not.toHaveBeenCalled();\n                const output = await vi.mocked(StandardRetryStrategy as any).mock.calls[0][0]();\n                expect(output).toStrictEqual(maxAttempts);\n              });\n            }\n          });\n        });\n      });\n\n      describe(\"AdaptiveRetryStrategy\", () => {\n        describe(\"when retryMode=adaptive\", () => {\n          describe(\"passes maxAttempts if present\", () => {\n            const retryMode = \"adaptive\";\n            for (const maxAttempts of [1, 2, 3]) {\n              it(`when maxAttempts=${maxAttempts}`, async () => {\n                const { retryStrategy } = resolveRetryConfig({ maxAttempts, retryMode });\n                await retryStrategy();\n                expect(vi.mocked(StandardRetryStrategy)).not.toHaveBeenCalled();\n                expect(vi.mocked(AdaptiveRetryStrategy)).toHaveBeenCalledTimes(1);\n                const output = await vi.mocked(AdaptiveRetryStrategy as any).mock.calls[0][0]();\n                expect(output).toStrictEqual(maxAttempts);\n              });\n            }\n          });\n        });\n\n        describe(\"when retryMode returns 'adaptive'\", () => {\n          describe(\"passes maxAttempts if present\", () => {\n            beforeEach(() => {\n              retryMode.mockResolvedValueOnce(\"adaptive\");\n            });\n            for (const maxAttempts of [1, 2, 3]) {\n              it(`when maxAttempts=${maxAttempts}`, async () => {\n                const { retryStrategy } = resolveRetryConfig({ maxAttempts, retryMode });\n                await retryStrategy();\n                expect(retryMode).toHaveBeenCalledTimes(1);\n                expect(vi.mocked(StandardRetryStrategy)).not.toHaveBeenCalled();\n                expect(vi.mocked(AdaptiveRetryStrategy)).toHaveBeenCalledTimes(1);\n                const output = await vi.mocked(AdaptiveRetryStrategy as any).mock.calls[0][0]();\n                expect(output).toStrictEqual(maxAttempts);\n              });\n            }\n          });\n        });\n      });\n    });\n\n    describe(\"memoizes default strategy across calls\", () => {\n      it(\"should return the same promise for concurrent calls (no race condition)\", async () => {\n        const retryMode = \"standard\";\n        const { retryStrategy } = resolveRetryConfig({ maxAttempts: 3, retryMode });\n        const [a, b] = await Promise.all([retryStrategy(), retryStrategy()]);\n        expect(a).toBe(b);\n        expect(vi.mocked(StandardRetryStrategy)).toHaveBeenCalledTimes(1);\n      });\n\n      it(\"should return the same instance on sequential calls\", async () => {\n        const retryMode = \"standard\";\n        const { retryStrategy } = resolveRetryConfig({ maxAttempts: 3, retryMode });\n        const first = await retryStrategy();\n        const second = await retryStrategy();\n        expect(first).toBe(second);\n        expect(vi.mocked(StandardRetryStrategy)).toHaveBeenCalledTimes(1);\n      });\n\n      it(\"should memoize adaptive strategy the same way\", async () => {\n        const retryMode = \"adaptive\";\n        const { retryStrategy } = resolveRetryConfig({ maxAttempts: 3, retryMode });\n        const [a, b] = await Promise.all([retryStrategy(), retryStrategy()]);\n        expect(a).toBe(b);\n        expect(vi.mocked(AdaptiveRetryStrategy)).toHaveBeenCalledTimes(1);\n      });\n    });\n  });\n\n  describe(\"node maxAttempts config options\", () => {\n    describe(\"environmentVariableSelector\", () => {\n      it(`should return value of env ${ENV_MAX_ATTEMPTS} is number`, () => {\n        const value = \"3\";\n        const env = { [ENV_MAX_ATTEMPTS]: value };\n        expect(NODE_MAX_ATTEMPT_CONFIG_OPTIONS.environmentVariableSelector(env)).toBe(parseInt(value));\n      });\n\n      it(`should return undefined if env ${ENV_MAX_ATTEMPTS} is not set`, () => {\n        expect(NODE_MAX_ATTEMPT_CONFIG_OPTIONS.environmentVariableSelector({})).toBe(undefined);\n      });\n\n      it(`should throw if if value of env ${ENV_MAX_ATTEMPTS} is not a number`, () => {\n        const value = \"not a number\";\n        const env = { [ENV_MAX_ATTEMPTS]: value };\n        expect(() => NODE_MAX_ATTEMPT_CONFIG_OPTIONS.environmentVariableSelector(env)).toThrow();\n      });\n    });\n\n    describe(\"configFileSelector\", () => {\n      it(`should return value of shared INI files entry ${CONFIG_MAX_ATTEMPTS} is number`, () => {\n        const value = \"3\";\n        const profile = { [CONFIG_MAX_ATTEMPTS]: value };\n        expect(NODE_MAX_ATTEMPT_CONFIG_OPTIONS.configFileSelector(profile)).toBe(parseInt(value));\n      });\n\n      it(`should return undefined if shared INI files entry ${CONFIG_MAX_ATTEMPTS} is not set`, () => {\n        expect(NODE_MAX_ATTEMPT_CONFIG_OPTIONS.configFileSelector({})).toBe(undefined);\n      });\n\n      it(`should throw if shared INI files entry ${CONFIG_MAX_ATTEMPTS} is not a number`, () => {\n        const value = \"not a number\";\n        const profile = { [CONFIG_MAX_ATTEMPTS]: value };\n        expect(() => NODE_MAX_ATTEMPT_CONFIG_OPTIONS.configFileSelector(profile)).toThrow();\n      });\n    });\n\n    describe(\"default\", () => {\n      it(`should equal to ${DEFAULT_MAX_ATTEMPTS}`, () => {\n        expect(NODE_MAX_ATTEMPT_CONFIG_OPTIONS.default).toBe(DEFAULT_MAX_ATTEMPTS);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/configurations.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport type { LoadedConfigSelectors } from \"@smithy/core/config\";\nimport type { Logger, Provider, RetryStrategy, RetryStrategyV2 } from \"@smithy/types\";\n\nimport { AdaptiveRetryStrategy } from \"../util-retry/AdaptiveRetryStrategy\";\nimport { StandardRetryStrategy } from \"../util-retry/StandardRetryStrategy\";\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, RETRY_MODES } from \"../util-retry/config\";\n\n/**\n * @internal\n */\nexport const ENV_MAX_ATTEMPTS = \"AWS_MAX_ATTEMPTS\";\n/**\n * @internal\n */\nexport const CONFIG_MAX_ATTEMPTS = \"max_attempts\";\n\n/**\n * @internal\n */\nexport const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors<number> = {\n  environmentVariableSelector: (env) => {\n    const value = env[ENV_MAX_ATTEMPTS];\n    if (!value) return undefined;\n    const maxAttempt = parseInt(value);\n    if (Number.isNaN(maxAttempt)) {\n      throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got \"${value}\"`);\n    }\n    return maxAttempt;\n  },\n  configFileSelector: (profile) => {\n    const value = profile[CONFIG_MAX_ATTEMPTS];\n    if (!value) return undefined;\n    const maxAttempt = parseInt(value);\n    if (Number.isNaN(maxAttempt)) {\n      throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got \"${value}\"`);\n    }\n    return maxAttempt;\n  },\n  default: DEFAULT_MAX_ATTEMPTS,\n};\n\n/**\n * @public\n */\nexport interface RetryInputConfig {\n  /**\n   * The maximum number of times requests that encounter retryable failures should be attempted.\n   */\n  maxAttempts?: number | Provider<number>;\n  /**\n   * The strategy to retry the request. Using built-in exponential backoff strategy by default.\n   */\n  retryStrategy?: RetryStrategy | RetryStrategyV2;\n}\n\n/**\n * @internal\n */\nexport interface PreviouslyResolved {\n  /**\n   * Specifies provider for retry algorithm to use.\n   * @internal\n   */\n  retryMode: string | Provider<string>;\n\n  logger?: Logger;\n}\n\n/**\n * @internal\n */\nexport interface RetryResolvedConfig {\n  /**\n   * Resolved value for input config {@link RetryInputConfig.maxAttempts}\n   */\n  maxAttempts: Provider<number>;\n  /**\n   * Resolved value for input config {@link RetryInputConfig.retryStrategy}\n   */\n  retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>;\n\n  logger?: Logger;\n}\n\n/**\n * @internal\n */\nexport const resolveRetryConfig = <T>(input: T & PreviouslyResolved & RetryInputConfig): T & RetryResolvedConfig => {\n  const { retryStrategy, retryMode } = input;\n  const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS);\n\n  let controller: Promise<RetryStrategy | RetryStrategyV2> | undefined = retryStrategy\n    ? Promise.resolve(retryStrategy)\n    : undefined;\n\n  const getDefault = async () =>\n    (await normalizeProvider(retryMode)()) === RETRY_MODES.ADAPTIVE\n      ? new AdaptiveRetryStrategy(maxAttempts)\n      : new StandardRetryStrategy(maxAttempts);\n\n  return Object.assign(input, {\n    maxAttempts,\n    retryStrategy: () => (controller ??= getDefault()),\n  });\n};\n\n/**\n * @internal\n */\nexport const ENV_RETRY_MODE = \"AWS_RETRY_MODE\";\n\n/**\n * @internal\n */\nexport const CONFIG_RETRY_MODE = \"retry_mode\";\n\n/**\n * @internal\n */\nexport const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<string> = {\n  environmentVariableSelector: (env) => env[ENV_RETRY_MODE],\n  configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],\n  default: DEFAULT_RETRY_MODE,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.browser.ts",
    "content": "import type { HttpRequest } from \"@smithy/core/protocols\";\n\n/**\n * @internal\n */\nexport const isStreamingPayload = (request: HttpRequest): boolean => request?.body instanceof ReadableStream;\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.ts",
    "content": "import { Readable } from \"node:stream\";\nimport type { HttpRequest } from \"@smithy/core/protocols\";\n\n/**\n * @internal\n */\nexport const isStreamingPayload = (request: HttpRequest): boolean =>\n  request?.body instanceof Readable ||\n  (typeof ReadableStream !== \"undefined\" && request?.body instanceof ReadableStream);\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/longPollMiddleware.spec.ts",
    "content": "import type { HandlerExecutionContext } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { longPollMiddleware } from \"./longPollMiddleware\";\n\ndescribe(\"long poll middleware\", () => {\n  it(\"sets long poll mode on request context\", async () => {\n    const context = {} as HandlerExecutionContext;\n\n    const handler = longPollMiddleware();\n    const next = (async () => {}) as any;\n    const mwFunction = handler(next, context);\n    await mwFunction({} as any);\n    expect(context.__retryLongPoll).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/longPollMiddleware.ts",
    "content": "import type {\n  HandlerExecutionContext,\n  InitializeHandler,\n  InitializeHandlerArguments,\n  InitializeHandlerOptions,\n  InitializeHandlerOutput,\n  MetadataBearer,\n  Pluggable,\n} from \"@smithy/types\";\n\nimport type { RetryResolvedConfig } from \"./configurations\";\n\n/**\n * This middleware is attached to operations designated as long-polling.\n * @internal\n */\nexport const longPollMiddleware =\n  () =>\n  <Output extends MetadataBearer = MetadataBearer>(\n    next: InitializeHandler<any, Output>,\n    context: HandlerExecutionContext\n  ): InitializeHandler<any, Output> =>\n  async (args: InitializeHandlerArguments<any>): Promise<InitializeHandlerOutput<Output>> => {\n    context.__retryLongPoll = true;\n    return next(args);\n  };\n\n/**\n * @internal\n */\nexport const longPollMiddlewareOptions: InitializeHandlerOptions = {\n  name: \"longPollMiddleware\",\n  tags: [\"RETRY\"],\n  step: \"initialize\",\n  override: true,\n};\n\n/**\n * @internal\n */\nexport const getLongPollPlugin = (options: RetryResolvedConfig): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.add(longPollMiddleware(), longPollMiddlewareOptions);\n  },\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/omitRetryHeadersMiddleware.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type { FinalizeHandlerArguments, MiddlewareStack } from \"@smithy/types\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { INVOCATION_ID_HEADER, REQUEST_HEADER } from \"../util-retry/constants\";\nimport {\n  getOmitRetryHeadersPlugin,\n  omitRetryHeadersMiddleware,\n  omitRetryHeadersMiddlewareOptions,\n} from \"./omitRetryHeadersMiddleware\";\n\ndescribe(\"getOmitRetryHeadersPlugin\", () => {\n  const mockClientStack = {\n    add: vi.fn(),\n    addRelativeTo: vi.fn(),\n  };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(`adds omitRetryHeadersMiddleware`, () => {\n    getOmitRetryHeadersPlugin({}).applyToStack(mockClientStack as unknown as MiddlewareStack<any, any>);\n    expect(mockClientStack.addRelativeTo).toHaveBeenCalledTimes(1);\n    expect(mockClientStack.addRelativeTo.mock.calls[0][1]).toEqual(omitRetryHeadersMiddlewareOptions);\n  });\n});\n\ndescribe(\"omitRetryHeadersMiddleware\", () => {\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"remove retry headers\", async () => {\n    const next = vi.fn();\n    const args = {\n      request: new HttpRequest({\n        headers: {\n          [INVOCATION_ID_HEADER]: \"12345\",\n          [REQUEST_HEADER]: \"maxAttempts=30\",\n        },\n      }),\n    };\n\n    await omitRetryHeadersMiddleware()(next)(args as FinalizeHandlerArguments<any>);\n    expect(next).toHaveBeenCalledTimes(1);\n    expect(next.mock.calls[0][0].request.headers[INVOCATION_ID_HEADER]).toBeUndefined();\n    expect(next.mock.calls[0][0].request.headers[REQUEST_HEADER]).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/omitRetryHeadersMiddleware.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type {\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  FinalizeHandlerOutput,\n  MetadataBearer,\n  Pluggable,\n  RelativeMiddlewareOptions,\n} from \"@smithy/types\";\n\nimport { INVOCATION_ID_HEADER, REQUEST_HEADER } from \"../util-retry/constants\";\n\n/**\n * This is still in use.\n * See AddOmitRetryHeadersDependency.java.\n * @internal\n */\nexport const omitRetryHeadersMiddleware =\n  () =>\n  <Output extends MetadataBearer = MetadataBearer>(next: FinalizeHandler<any, Output>): FinalizeHandler<any, Output> =>\n  async (args: FinalizeHandlerArguments<any>): Promise<FinalizeHandlerOutput<Output>> => {\n    const { request } = args;\n    if (HttpRequest.isInstance(request)) {\n      delete request.headers[INVOCATION_ID_HEADER];\n      delete request.headers[REQUEST_HEADER];\n    }\n    return next(args);\n  };\n\n/**\n * @internal\n */\nexport const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions = {\n  name: \"omitRetryHeadersMiddleware\",\n  tags: [\"RETRY\", \"HEADERS\", \"OMIT_RETRY_HEADERS\"],\n  relation: \"before\",\n  toMiddleware: \"awsAuthMiddleware\",\n  override: true,\n};\n\n/**\n * @internal\n */\nexport const getOmitRetryHeadersPlugin = (\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  options: unknown\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);\n  },\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/parseRetryAfterHeader.spec.ts",
    "content": "import { HttpResponse } from \"@smithy/core/protocols\";\nimport { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\n\nimport { parseRetryAfterHeader } from \"./parseRetryAfterHeader\";\n\ndescribe(parseRetryAfterHeader.name, () => {\n  const NOW = 1_773_769_074_339;\n\n  beforeEach(() => {\n    vi.useFakeTimers({ now: NOW });\n  });\n\n  afterEach(() => {\n    vi.useRealTimers();\n  });\n\n  it(\"returns undefined for non-HttpResponse input\", () => {\n    expect(parseRetryAfterHeader(\"not a response\")).toBeUndefined();\n    expect(parseRetryAfterHeader(null)).toBeUndefined();\n    expect(parseRetryAfterHeader(undefined)).toBeUndefined();\n  });\n\n  it(\"returns undefined when no retry headers are present\", () => {\n    const response = new HttpResponse({ statusCode: 503, headers: { \"content-type\": \"application/json\" } });\n    expect(parseRetryAfterHeader(response)).toBeUndefined();\n  });\n\n  describe(\"retry-after header\", () => {\n    it(\"parses plain numeric seconds\", () => {\n      const response = new HttpResponse({ statusCode: 503, headers: { \"retry-after\": \"120\" } });\n      const result = parseRetryAfterHeader(response);\n      expect(result).toEqual(new Date(NOW + 120_000));\n    });\n\n    it(\"parses RFC 7231 date string ending in GMT\", () => {\n      const futureDate = new Date(NOW + 60_000);\n      const rfc7231 = futureDate.toUTCString(); // \"Tue, 14 Nov 2023 22:14:20 GMT\"\n      const response = new HttpResponse({ statusCode: 503, headers: { \"retry-after\": rfc7231 } });\n      const result = parseRetryAfterHeader(response);\n      expect(result).toBeInstanceOf(Date);\n      expect(result!.getTime()).toBeGreaterThanOrEqual(NOW + 59_000);\n      expect(result!.getTime()).toBeLessThanOrEqual(NOW + 61_000);\n    });\n\n    it(\"parses 'GMT, <seconds>' suffix format\", () => {\n      const futureDate = new Date(NOW + 30_000);\n      const rfc7231 = futureDate.toUTCString();\n      const headerValue = `${rfc7231}, 45`;\n      const response = new HttpResponse({ statusCode: 503, headers: { \"retry-after\": headerValue } });\n      const result = parseRetryAfterHeader(response);\n      expect(result).toEqual(new Date(NOW + 45_000));\n    });\n\n    it(\"returns undefined for non-numeric, non-date string\", () => {\n      const response = new HttpResponse({ statusCode: 503, headers: { \"retry-after\": \"not-a-number\" } });\n      expect(parseRetryAfterHeader(response)).toBeUndefined();\n    });\n\n    it(\"returns undefined when RFC 7231 parsing fails\", () => {\n      const response = new HttpResponse({ statusCode: 503, headers: { \"retry-after\": \"Invalid Date GMT\" } });\n      const logger = { trace: vi.fn() } as any;\n      const result = parseRetryAfterHeader(response, logger);\n      expect(result).toBeUndefined();\n    });\n\n    it(\"as a last resort (backwards compatibility), ISO format headers are also parsed\", () => {\n      const futureDate = new Date(NOW + 30_000);\n      const isoDate = futureDate.toISOString();\n      const response = new HttpResponse({ statusCode: 503, headers: { \"retry-after\": isoDate } });\n      const result = parseRetryAfterHeader(response);\n\n      expect(result).toBeInstanceOf(Date);\n      expect(result!.getTime()).toBeGreaterThanOrEqual(NOW + 29_000);\n      expect(result!.getTime()).toBeLessThanOrEqual(NOW + 31_000);\n    });\n  });\n\n  describe(\"x-amz-retry-after header\", () => {\n    it(\"parses milliseconds value\", () => {\n      const response = new HttpResponse({ statusCode: 503, headers: { \"x-amz-retry-after\": \"5000\" } });\n      const result = parseRetryAfterHeader(response);\n      expect(result).toEqual(new Date(NOW + 5000));\n    });\n\n    it(\"returns undefined for non-numeric value\", () => {\n      const logger = { trace: vi.fn() } as any;\n      const response = new HttpResponse({ statusCode: 503, headers: { \"x-amz-retry-after\": \"abc\" } });\n      expect(parseRetryAfterHeader(response, logger)).toBeUndefined();\n      expect(logger.trace).toHaveBeenCalled();\n    });\n  });\n\n  it(\"prefers retry-after over x-amz-retry-after when retry-after comes first\", () => {\n    const response = new HttpResponse({\n      statusCode: 503,\n      headers: { \"retry-after\": \"10\", \"x-amz-retry-after\": \"9999\" },\n    });\n    const result = parseRetryAfterHeader(response);\n    expect(result).toEqual(new Date(NOW + 10_000));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/parseRetryAfterHeader.ts",
    "content": "import { HttpResponse } from \"@smithy/core/protocols\";\nimport { parseRfc7231DateTime } from \"@smithy/core/serde\";\nimport type { Logger } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport function parseRetryAfterHeader(response: unknown, logger?: Logger): Date | undefined {\n  if (!HttpResponse.isInstance(response)) {\n    return;\n  }\n\n  for (const header of Object.keys(response.headers)) {\n    const h = header.toLowerCase();\n    if (h === \"retry-after\") {\n      const retryAfter = response.headers[header];\n\n      let retryAfterSeconds: number = NaN;\n\n      if (retryAfter.endsWith(\"GMT\")) {\n        try {\n          const date = parseRfc7231DateTime(retryAfter);\n          retryAfterSeconds = (date!.getTime() - Date.now()) / 1000;\n        } catch (e) {\n          // ignored\n          logger?.trace?.(\"Failed to parse retry-after header\");\n          logger?.trace?.(e);\n        }\n      } else if (retryAfter.match(/ GMT, ((\\d+)|(\\d+\\.\\d+))$/)) {\n        retryAfterSeconds = Number(retryAfter.match(/ GMT, ([\\d.]+)$/)?.[1]);\n      } else if (retryAfter.match(/^((\\d+)|(\\d+\\.\\d+))$/)) {\n        retryAfterSeconds = Number(retryAfter);\n      } else if (Date.parse(retryAfter) >= Date.now()) {\n        // non-standard header value, attempt to parse as date.\n        retryAfterSeconds = (Date.parse(retryAfter) - Date.now()) / 1000;\n      }\n\n      if (isNaN(retryAfterSeconds)) {\n        return;\n      }\n\n      return new Date(Date.now() + retryAfterSeconds * 1000);\n    } else if (h === \"x-amz-retry-after\") {\n      const v = response.headers[header];\n      const backoffMilliseconds = Number(v);\n      if (isNaN(backoffMilliseconds)) {\n        logger?.trace?.(`Failed to parse x-amz-retry-after=${v}`);\n        return;\n      }\n      return new Date(Date.now() + backoffMilliseconds);\n    }\n  }\n}\n\n/**\n * Backwards-compatibility alias.\n * @internal\n */\nexport function getRetryAfterHint(response: unknown, logger?: Logger): Date | undefined {\n  return parseRetryAfterHeader(response, logger);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/AdaptiveRetryStrategy.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { DefaultRateLimiter } from \"../../util-retry/DefaultRateLimiter\";\nimport { RETRY_MODES } from \"../../util-retry/config\";\nimport type { RateLimiter } from \"../../util-retry/types\";\nimport { AdaptiveRetryStrategy } from \"./AdaptiveRetryStrategy\";\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nimport type { RetryQuota } from \"./types\";\n\nvi.mock(\"./StandardRetryStrategy\");\nvi.mock(\"../../util-retry/DefaultRateLimiter\");\n\ndescribe(AdaptiveRetryStrategy.name, () => {\n  const maxAttemptsProvider = vi.fn();\n  const mockDefaultRateLimiter = {\n    getSendToken: vi.fn(),\n    updateClientSendingRate: vi.fn(),\n  } as any;\n\n  beforeEach(() => {\n    vi.mocked(DefaultRateLimiter).mockReturnValue(mockDefaultRateLimiter);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"constructor\", () => {\n    it(\"calls super constructor\", () => {\n      const retryDecider = vi.fn();\n      const delayDecider = vi.fn();\n      const retryQuota = {} as RetryQuota;\n      const rateLimiter = {} as RateLimiter;\n\n      new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        retryDecider,\n        delayDecider,\n        retryQuota,\n        rateLimiter,\n      });\n      expect(StandardRetryStrategy).toHaveBeenCalledWith(maxAttemptsProvider, {\n        retryDecider,\n        delayDecider,\n        retryQuota,\n      });\n    });\n\n    it(`sets mode=${RETRY_MODES.ADAPTIVE}`, () => {\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider);\n      expect(retryStrategy.mode).toStrictEqual(RETRY_MODES.ADAPTIVE);\n    });\n\n    describe(\"rateLimiter init\", () => {\n      it(\"sets getDefaultrateLimiter if options is undefined\", () => {\n        const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider);\n        expect(retryStrategy[\"rateLimiter\"]).toBe(mockDefaultRateLimiter);\n      });\n\n      it(\"sets getDefaultrateLimiter if options.delayDecider undefined\", () => {\n        const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {});\n        expect(retryStrategy[\"rateLimiter\"]).toBe(mockDefaultRateLimiter);\n      });\n\n      it(\"sets options.rateLimiter if defined\", () => {\n        const rateLimiter = {} as RateLimiter;\n        const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n          rateLimiter,\n        });\n        expect(retryStrategy[\"rateLimiter\"]).toBe(rateLimiter);\n      });\n    });\n  });\n\n  describe(\"retry\", () => {\n    const mockedSuperRetry = vi.spyOn(StandardRetryStrategy.prototype, \"retry\");\n\n    beforeEach(async () => {\n      const next = vi.fn();\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider);\n      await retryStrategy.retry(next, { request: { headers: {} } } as any);\n      expect(mockedSuperRetry).toHaveBeenCalledTimes(1);\n    });\n\n    afterEach(() => {\n      vi.clearAllMocks();\n    });\n\n    it(\"calls rateLimiter.getSendToken in beforeRequest\", async () => {\n      expect(mockDefaultRateLimiter.getSendToken).toHaveBeenCalledTimes(0);\n      await mockedSuperRetry.mock.calls[0][2]!.beforeRequest();\n      expect(mockDefaultRateLimiter.getSendToken).toHaveBeenCalledTimes(1);\n    });\n\n    it(\"calls rateLimiter.updateClientSendingRate in afterRequest\", async () => {\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledTimes(0);\n      await mockedSuperRetry.mock.calls[0][2]!.afterRequest();\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledTimes(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/AdaptiveRetryStrategy.ts",
    "content": "import type { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider } from \"@smithy/types\";\n\nimport { DefaultRateLimiter } from \"../../util-retry/DefaultRateLimiter\";\nimport { RETRY_MODES } from \"../../util-retry/config\";\nimport type { RateLimiter } from \"../../util-retry/types\";\nimport { StandardRetryStrategy, type StandardRetryStrategyOptions } from \"./StandardRetryStrategy\";\n\n/**\n * Strategy options to be passed to AdaptiveRetryStrategy\n * @public\n * @deprecated replaced by \\@smithy/util-retry (SRA).\n */\nexport interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptions {\n  rateLimiter?: RateLimiter;\n}\n\n/**\n * @public\n * @deprecated use AdaptiveRetryStrategy from @smithy/util-retry\n */\nexport class AdaptiveRetryStrategy extends StandardRetryStrategy {\n  private rateLimiter: RateLimiter;\n\n  constructor(maxAttemptsProvider: Provider<number>, options?: AdaptiveRetryStrategyOptions) {\n    const { rateLimiter, ...superOptions } = options ?? {};\n    super(maxAttemptsProvider, superOptions);\n    this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();\n    this.mode = RETRY_MODES.ADAPTIVE;\n  }\n\n  async retry<Input extends object, Ouput extends MetadataBearer>(\n    next: FinalizeHandler<Input, Ouput>,\n    args: FinalizeHandlerArguments<Input>\n  ) {\n    return super.retry(next, args, {\n      beforeRequest: async () => {\n        return this.rateLimiter.getSendToken();\n      },\n      afterRequest: (response: any) => {\n        this.rateLimiter.updateClientSendingRate(response);\n      },\n    });\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.spec.ts",
    "content": "import { HttpRequest, HttpResponse } from \"@smithy/core/protocols\";\nimport { v4 } from \"@smithy/core/serde\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { isThrottlingError } from \"../../service-error-classification/service-error-classification\";\nimport { DEFAULT_MAX_ATTEMPTS, RETRY_MODES } from \"../../util-retry/config\";\nimport {\n  DEFAULT_RETRY_DELAY_BASE,\n  INITIAL_RETRY_TOKENS,\n  THROTTLING_RETRY_DELAY_BASE,\n} from \"../../util-retry/constants\";\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nimport { getDefaultRetryQuota } from \"./defaultRetryQuota\";\nimport { defaultDelayDecider } from \"./delayDecider\";\nimport { defaultRetryDecider } from \"./retryDecider\";\nimport type { RetryQuota } from \"./types\";\n\nvi.mock(\"@smithy/core/protocols\");\nvi.mock(\"../../service-error-classification/service-error-classification\");\nvi.mock(\"./delayDecider\");\nvi.mock(\"./retryDecider\");\nvi.mock(\"./defaultRetryQuota\");\nvi.mock(\"@smithy/core/protocols\");\nvi.mock(\"@smithy/core/serde\");\n\ndescribe(\"defaultStrategy\", () => {\n  let next: any; // variable for next mock function in utility methods\n  const maxAttempts = 3;\n\n  const mockDefaultRetryQuota = {\n    hasRetryTokens: vi.fn().mockReturnValue(true),\n    retrieveRetryTokens: vi.fn().mockReturnValue(1),\n    releaseRetryTokens: vi.fn(),\n  };\n\n  const mockSuccessfulOperation = (maxAttempts: number, options?: { mockResponse?: string }) => {\n    next = vi.fn().mockResolvedValueOnce({\n      response: options?.mockResponse,\n      output: { $metadata: {} },\n    });\n\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    return retryStrategy.retry(next, { request: { headers: {} } } as any);\n  };\n\n  const mockFailedOperation = async (maxAttempts: number, options?: { mockError?: Error }) => {\n    const mockError = options?.mockError ?? new Error(\"mockError\");\n    next = vi.fn().mockRejectedValue(mockError);\n\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    try {\n      await retryStrategy.retry(next, { request: { headers: {} } } as any);\n    } catch (error) {\n      expect(error).toStrictEqual(mockError);\n      return error;\n    }\n  };\n\n  const mockSuccessAfterOneFail = (maxAttempts: number, options?: { mockError?: Error; mockResponse?: string }) => {\n    const mockError = options?.mockError ?? new Error(\"mockError\");\n    const mockResponse = {\n      response: options?.mockResponse,\n      output: { $metadata: {} },\n    };\n\n    next = vi.fn().mockRejectedValueOnce(mockError).mockResolvedValueOnce(mockResponse);\n\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    return retryStrategy.retry(next, { request: { headers: {} } } as any);\n  };\n\n  const mockSuccessAfterTwoFails = (maxAttempts: number, options?: { mockError?: Error; mockResponse?: string }) => {\n    const mockError = options?.mockError ?? new Error(\"mockError\");\n    const mockResponse = {\n      response: options?.mockResponse,\n      output: { $metadata: {} },\n    };\n\n    next = vi\n      .fn()\n      .mockRejectedValueOnce(mockError)\n      .mockRejectedValueOnce(mockError)\n      .mockResolvedValueOnce(mockResponse);\n\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    return retryStrategy.retry(next, { request: { headers: {} } } as any);\n  };\n\n  beforeEach(() => {\n    vi.mocked(isThrottlingError).mockReturnValue(true);\n    vi.mocked(defaultDelayDecider).mockReturnValue(0);\n    vi.mocked(defaultRetryDecider).mockReturnValue(true);\n    vi.mocked(getDefaultRetryQuota).mockReturnValue(mockDefaultRetryQuota);\n    (HttpRequest as unknown as any).mockReturnValue({\n      isInstance: vi.fn().mockReturnValue(false),\n    });\n    (HttpResponse as unknown as any).mockReturnValue({\n      isInstance: vi.fn().mockReturnValue(false),\n    });\n    vi.mocked(v4).mockReturnValue(\"42\");\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"sets maxAttemptsProvider as class member variable\", async () => {\n    await Promise.all(\n      [1, 2, 3].map(async (maxAttempts) => {\n        const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n        expect(await retryStrategy[\"maxAttemptsProvider\"]()).toBe(maxAttempts);\n      })\n    );\n  });\n\n  it(`sets mode=${RETRY_MODES.STANDARD}`, () => {\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    expect(retryStrategy.mode).toStrictEqual(RETRY_MODES.STANDARD);\n  });\n\n  it(\"handles non-standard errors\", async () => {\n    const nonStandardErrors = [undefined, \"foo\", { foo: \"bar\" }, 123, false, null];\n    const maxAttempts = 1;\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    for (const error of nonStandardErrors) {\n      next = vi.fn().mockRejectedValue(error);\n      expect(await retryStrategy.retry(next, { request: { headers: {} } } as any).catch((_) => _)).toBeInstanceOf(\n        Error\n      );\n    }\n  });\n\n  describe(\"retryDecider init\", () => {\n    it(\"sets defaultRetryDecider if options is undefined\", () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      expect(retryStrategy[\"retryDecider\"]).toBe(defaultRetryDecider);\n    });\n\n    it(\"sets defaultRetryDecider if options.retryDecider is undefined\", () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts), {});\n      expect(retryStrategy[\"retryDecider\"]).toBe(defaultRetryDecider);\n    });\n\n    it(\"sets options.retryDecider if defined\", () => {\n      const retryDecider = vi.fn();\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts), {\n        retryDecider,\n      });\n      expect(retryStrategy[\"retryDecider\"]).toBe(retryDecider);\n    });\n  });\n\n  describe(\"delayDecider init\", () => {\n    it(\"sets defaultDelayDecider if options is undefined\", () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      expect(retryStrategy[\"delayDecider\"]).toBe(defaultDelayDecider);\n    });\n\n    it(\"sets defaultDelayDecider if options.delayDecider undefined\", () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts), {});\n      expect(retryStrategy[\"delayDecider\"]).toBe(defaultDelayDecider);\n    });\n\n    it(\"sets options.delayDecider if defined\", () => {\n      const delayDecider = vi.fn();\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts), {\n        delayDecider,\n      });\n      expect(retryStrategy[\"delayDecider\"]).toBe(delayDecider);\n    });\n  });\n\n  describe(\"retryQuota init\", () => {\n    it(\"sets getDefaultRetryQuota if options is undefined\", () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      expect(retryStrategy[\"retryQuota\"]).toBe(getDefaultRetryQuota(INITIAL_RETRY_TOKENS));\n    });\n\n    it(\"sets getDefaultRetryQuota if options.delayDecider undefined\", () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts), {});\n      expect(retryStrategy[\"retryQuota\"]).toBe(getDefaultRetryQuota(INITIAL_RETRY_TOKENS));\n    });\n\n    it(\"sets options.retryQuota if defined\", () => {\n      const retryQuota = {} as RetryQuota;\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts), {\n        retryQuota,\n      });\n      expect(retryStrategy[\"retryQuota\"]).toBe(retryQuota);\n    });\n  });\n\n  describe(\"delayDecider\", () => {\n    describe(\"delayBase value passed\", () => {\n      const testDelayBasePassed = async (delayBaseToTest: number, mockThrottlingError: boolean) => {\n        vi.mocked(isThrottlingError).mockReturnValueOnce(mockThrottlingError);\n\n        const mockError = new Error();\n        await mockSuccessAfterOneFail(maxAttempts, { mockError });\n\n        expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(1);\n        expect(vi.mocked(isThrottlingError)).toHaveBeenCalledWith(mockError);\n        expect(vi.mocked(defaultDelayDecider)).toHaveBeenCalledTimes(1);\n        expect(vi.mocked(defaultDelayDecider).mock.calls[0][0]).toBe(delayBaseToTest);\n      };\n\n      it(\"should be equal to THROTTLING_RETRY_DELAY_BASE if error is throttling error\", async () => {\n        return testDelayBasePassed(THROTTLING_RETRY_DELAY_BASE, true);\n      });\n\n      it(\"should be equal to DEFAULT_RETRY_DELAY_BASE in error is not a throttling error\", async () => {\n        return testDelayBasePassed(DEFAULT_RETRY_DELAY_BASE, false);\n      });\n    });\n\n    describe(\"attempts value passed\", () => {\n      it(\"on successful operation\", async () => {\n        await mockSuccessfulOperation(maxAttempts);\n        expect(vi.mocked(defaultDelayDecider)).not.toHaveBeenCalled();\n      });\n\n      it(\"in case of single failure\", async () => {\n        await mockSuccessAfterOneFail(maxAttempts);\n        expect(vi.mocked(defaultDelayDecider)).toHaveBeenCalledTimes(1);\n        expect(vi.mocked(defaultDelayDecider).mock.calls[0][1]).toBe(1);\n      });\n\n      it(\"on all fails\", async () => {\n        await mockFailedOperation(maxAttempts);\n        expect(vi.mocked(defaultDelayDecider)).toHaveBeenCalledTimes(2);\n        expect(vi.mocked(defaultDelayDecider).mock.calls[0][1]).toBe(1);\n        expect(vi.mocked(defaultDelayDecider).mock.calls[1][1]).toBe(2);\n      });\n    });\n\n    describe(\"totalRetryDelay\", () => {\n      describe(\"when retry-after is not set\", () => {\n        it(\"should be equal to sum of values computed by delayDecider\", async () => {\n          vi.spyOn(global, \"setTimeout\");\n\n          const FIRST_DELAY = 100;\n          const SECOND_DELAY = 200;\n\n          vi.mocked(defaultDelayDecider).mockReturnValueOnce(FIRST_DELAY).mockReturnValueOnce(SECOND_DELAY);\n\n          const maxAttempts = 3;\n          const error = await mockFailedOperation(maxAttempts);\n          expect(error.$metadata.totalRetryDelay).toEqual(FIRST_DELAY + SECOND_DELAY);\n\n          expect(vi.mocked(defaultDelayDecider)).toHaveBeenCalledTimes(maxAttempts - 1);\n          expect(setTimeout).toHaveBeenCalledTimes(maxAttempts - 1);\n          expect((setTimeout as unknown as any).mock.calls[0][1]).toBe(FIRST_DELAY);\n          expect((setTimeout as unknown as any).mock.calls[1][1]).toBe(SECOND_DELAY);\n        });\n      });\n\n      describe(\"when retry-after is set\", () => {\n        const getErrorWithValues = async (\n          delayDeciderInMs: number,\n          retryAfter: number | string,\n          retryAfterHeaderName?: string\n        ) => {\n          vi.mocked(defaultDelayDecider).mockReturnValueOnce(delayDeciderInMs);\n\n          const maxAttempts = 2;\n          const mockError = new Error();\n          Object.defineProperty(mockError, \"$response\", {\n            value: {\n              headers: { [retryAfterHeaderName ? retryAfterHeaderName : \"retry-after\"]: String(retryAfter) },\n            },\n          });\n          const error = await mockFailedOperation(maxAttempts, { mockError });\n          expect(vi.mocked(defaultDelayDecider)).toHaveBeenCalledTimes(maxAttempts - 1);\n          expect(setTimeout).toHaveBeenCalledTimes(maxAttempts - 1);\n\n          return error;\n        };\n\n        beforeEach(() => {\n          vi.spyOn(global, \"setTimeout\");\n        });\n\n        describe(\"uses retry-after value if it's greater than that from delayDecider\", () => {\n          beforeEach(() => {\n            const { isInstance } = HttpResponse;\n            (isInstance as unknown as any).mockReturnValueOnce(true);\n          });\n\n          describe(\"when value is in seconds\", () => {\n            const testWithHeaderName = async (retryAfterHeaderName: string) => {\n              const delayDeciderInMs = 2000;\n              const retryAfterInSeconds = 3;\n\n              const error = await getErrorWithValues(delayDeciderInMs, retryAfterInSeconds, retryAfterHeaderName);\n              expect(error.$metadata.totalRetryDelay).toEqual(retryAfterInSeconds * 1000);\n              expect((setTimeout as unknown as any).mock.calls[0][1]).toBe(retryAfterInSeconds * 1000);\n            };\n\n            it(\"with header in small case\", async () => {\n              testWithHeaderName(\"retry-after\");\n            });\n\n            it(\"with header with first letter capital\", async () => {\n              testWithHeaderName(\"Retry-After\");\n            });\n          });\n\n          it(\"when value is a Date\", async () => {\n            const mockDateNow = Date.now();\n            vi.spyOn(Date, \"now\").mockReturnValue(mockDateNow);\n\n            const delayDeciderInMs = 2000;\n            const retryAfterInSeconds = 3;\n            const retryAfterDate = new Date(mockDateNow + retryAfterInSeconds * 1000);\n\n            const error = await getErrorWithValues(delayDeciderInMs, retryAfterDate.toISOString());\n            expect(error.$metadata.totalRetryDelay).toEqual(retryAfterInSeconds * 1000);\n            expect((setTimeout as unknown as any).mock.calls[0][1]).toBe(retryAfterInSeconds * 1000);\n          });\n        });\n\n        it(\"ignores retry-after value if it's smaller than that from delayDecider\", async () => {\n          const delayDeciderInMs = 3000;\n          const retryAfterInSeconds = 2;\n\n          const error = await getErrorWithValues(delayDeciderInMs, retryAfterInSeconds);\n          expect(error.$metadata.totalRetryDelay).toEqual(delayDeciderInMs);\n          expect((setTimeout as unknown as any).mock.calls[0][1]).toBe(delayDeciderInMs);\n        });\n      });\n    });\n  });\n\n  describe(\"retryQuota\", () => {\n    describe(\"hasRetryTokens\", () => {\n      it(\"not called on successful operation\", async () => {\n        const { hasRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockSuccessfulOperation(maxAttempts);\n        expect(hasRetryTokens).not.toHaveBeenCalled();\n      });\n\n      it(\"called once in case of single failure\", async () => {\n        const { hasRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockSuccessAfterOneFail(maxAttempts);\n        expect(hasRetryTokens).toHaveBeenCalledTimes(1);\n      });\n\n      it(\"called once on each retry request\", async () => {\n        const { hasRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockFailedOperation(maxAttempts);\n        expect(hasRetryTokens).toHaveBeenCalledTimes(maxAttempts - 1);\n      });\n    });\n\n    describe(\"releaseRetryTokens\", () => {\n      it(\"called once without param on successful operation\", async () => {\n        const { releaseRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockSuccessfulOperation(maxAttempts);\n        expect(releaseRetryTokens).toHaveBeenCalledTimes(1);\n        expect(releaseRetryTokens).toHaveBeenCalledWith(undefined);\n      });\n\n      it(\"called once with retryTokenAmount in case of single failure\", async () => {\n        const retryTokens = 15;\n        const { releaseRetryTokens, retrieveRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        vi.mocked(retrieveRetryTokens).mockReturnValueOnce(retryTokens);\n\n        await mockSuccessAfterOneFail(maxAttempts);\n        expect(releaseRetryTokens).toHaveBeenCalledTimes(1);\n        expect(releaseRetryTokens).toHaveBeenCalledWith(retryTokens);\n      });\n\n      it(\"called once with second retryTokenAmount in case of two failures\", async () => {\n        const retryTokensFirst = 15;\n        const retryTokensSecond = 30;\n\n        const { releaseRetryTokens, retrieveRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n\n        vi.mocked(retrieveRetryTokens).mockReturnValueOnce(retryTokensFirst).mockReturnValueOnce(retryTokensSecond);\n\n        await mockSuccessAfterTwoFails(maxAttempts);\n        expect(releaseRetryTokens).toHaveBeenCalledTimes(1);\n        expect(releaseRetryTokens).toHaveBeenCalledWith(retryTokensSecond);\n      });\n\n      it(\"not called on unsuccessful operation\", async () => {\n        const { releaseRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockFailedOperation(maxAttempts);\n        expect(releaseRetryTokens).not.toHaveBeenCalled();\n      });\n    });\n\n    describe(\"retrieveRetryTokens\", () => {\n      it(\"not called on successful operation\", async () => {\n        const { retrieveRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockSuccessfulOperation(maxAttempts);\n        expect(retrieveRetryTokens).not.toHaveBeenCalled();\n      });\n\n      it(\"called once in case of single failure\", async () => {\n        const { retrieveRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockSuccessAfterOneFail(maxAttempts);\n        expect(retrieveRetryTokens).toHaveBeenCalledTimes(1);\n      });\n\n      it(\"called once on each retry request\", async () => {\n        const { retrieveRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        await mockFailedOperation(maxAttempts);\n        expect(retrieveRetryTokens).toHaveBeenCalledTimes(maxAttempts - 1);\n      });\n    });\n  });\n\n  describe(\"should not retry\", () => {\n    it(\"when the handler completes successfully\", async () => {\n      const mockResponse = \"mockResponse\";\n      const { response, output } = await mockSuccessfulOperation(maxAttempts, {\n        mockResponse,\n      });\n\n      expect(response).toStrictEqual(mockResponse);\n      expect(output.$metadata.attempts).toBe(1);\n      expect(output.$metadata.totalRetryDelay).toBe(0);\n      expect(vi.mocked(defaultRetryDecider)).not.toHaveBeenCalled();\n      expect(vi.mocked(defaultDelayDecider)).not.toHaveBeenCalled();\n    });\n\n    it(\"when retryDecider returns false\", async () => {\n      vi.mocked(defaultRetryDecider).mockReturnValueOnce(false);\n      const mockError = new Error();\n      await mockFailedOperation(maxAttempts, { mockError });\n      expect(vi.mocked(defaultRetryDecider)).toHaveBeenCalledTimes(1);\n      expect(vi.mocked(defaultRetryDecider)).toHaveBeenCalledWith(mockError);\n    });\n\n    it(\"when the maximum number of attempts is reached\", async () => {\n      await mockFailedOperation(maxAttempts);\n      expect(vi.mocked(defaultRetryDecider)).toHaveBeenCalledTimes(maxAttempts - 1);\n    });\n\n    describe(\"when retryQuota.hasRetryTokens returns false\", () => {\n      it(\"in the first request\", async () => {\n        const { hasRetryTokens, retrieveRetryTokens, releaseRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        vi.mocked(hasRetryTokens).mockReturnValueOnce(false);\n\n        const mockError = new Error();\n        await mockFailedOperation(maxAttempts, { mockError });\n\n        expect(hasRetryTokens).toHaveBeenCalledTimes(1);\n        expect(hasRetryTokens).toHaveBeenCalledWith(mockError);\n        expect(retrieveRetryTokens).not.toHaveBeenCalled();\n        expect(releaseRetryTokens).not.toHaveBeenCalled();\n      });\n\n      it(\"after the first retry\", async () => {\n        const { hasRetryTokens, retrieveRetryTokens, releaseRetryTokens } = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n        vi.mocked(hasRetryTokens).mockReturnValueOnce(true).mockReturnValueOnce(false);\n\n        const mockError = new Error();\n        await mockFailedOperation(maxAttempts, { mockError });\n\n        expect(hasRetryTokens).toHaveBeenCalledTimes(2);\n        [1, 2].forEach((n) => {\n          expect(hasRetryTokens).toHaveBeenNthCalledWith(n, mockError);\n        });\n        expect(retrieveRetryTokens).toHaveBeenCalledTimes(1);\n        expect(retrieveRetryTokens).toHaveBeenCalledWith(mockError);\n        expect(releaseRetryTokens).not.toHaveBeenCalled();\n      });\n    });\n  });\n\n  describe(\"retry informational header: amz-sdk-invocation-id\", () => {\n    describe(\"not added if HttpRequest.isInstance returns false\", () => {\n      it(\"on successful operation\", async () => {\n        await mockSuccessfulOperation(maxAttempts);\n        expect(next).toHaveBeenCalledTimes(1);\n        expect(next.mock.calls[0][0].request.headers[\"amz-sdk-invocation-id\"]).not.toBeDefined();\n      });\n\n      it(\"in case of single failure\", async () => {\n        await mockSuccessAfterOneFail(maxAttempts);\n        expect(next).toHaveBeenCalledTimes(2);\n        [0, 1].forEach((index) => {\n          expect(next.mock.calls[index][0].request.headers[\"amz-sdk-invocation-id\"]).not.toBeDefined();\n        });\n      });\n\n      it(\"in case of all failures\", async () => {\n        await mockFailedOperation(maxAttempts);\n        expect(next).toHaveBeenCalledTimes(maxAttempts);\n        [...Array(maxAttempts).keys()].forEach((index) => {\n          expect(next.mock.calls[index][0].request.headers[\"amz-sdk-invocation-id\"]).not.toBeDefined();\n        });\n      });\n    });\n\n    it(\"uses a unique header for every SDK operation invocation\", async () => {\n      const { isInstance } = HttpRequest;\n      (isInstance as unknown as any).mockReturnValue(true);\n\n      const uuidForInvocationOne = \"uuid-invocation-1\";\n      const uuidForInvocationTwo = \"uuid-invocation-2\";\n      vi.mocked(v4).mockReturnValueOnce(uuidForInvocationOne).mockReturnValueOnce(uuidForInvocationTwo);\n\n      const next = vi.fn().mockResolvedValue({\n        response: \"mockResponse\",\n        output: { $metadata: {} },\n      });\n\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      await retryStrategy.retry(next, { request: { headers: {} } } as any);\n      await retryStrategy.retry(next, { request: { headers: {} } } as any);\n\n      expect(next).toHaveBeenCalledTimes(2);\n      expect(next.mock.calls[0][0].request.headers[\"amz-sdk-invocation-id\"]).toBe(uuidForInvocationOne);\n      expect(next.mock.calls[1][0].request.headers[\"amz-sdk-invocation-id\"]).toBe(uuidForInvocationTwo);\n\n      (isInstance as unknown as any).mockReturnValue(false);\n    });\n\n    it(\"uses same value for additional HTTP requests associated with an SDK operation\", async () => {\n      const { isInstance } = HttpRequest;\n      (isInstance as unknown as any).mockReturnValueOnce(true);\n\n      const uuidForInvocation = \"uuid-invocation-1\";\n      vi.mocked(v4).mockReturnValueOnce(uuidForInvocation);\n\n      await mockSuccessAfterOneFail(maxAttempts);\n\n      expect(next).toHaveBeenCalledTimes(2);\n      expect(next.mock.calls[0][0].request.headers[\"amz-sdk-invocation-id\"]).toBe(uuidForInvocation);\n      expect(next.mock.calls[1][0].request.headers[\"amz-sdk-invocation-id\"]).toBe(uuidForInvocation);\n\n      (isInstance as unknown as any).mockReturnValue(false);\n    });\n  });\n\n  describe(\"retry informational header: amz-sdk-request\", () => {\n    describe(\"not added if HttpRequest.isInstance returns false\", () => {\n      it(\"on successful operation\", async () => {\n        await mockSuccessfulOperation(maxAttempts);\n        expect(next).toHaveBeenCalledTimes(1);\n        expect(next.mock.calls[0][0].request.headers[\"amz-sdk-request\"]).not.toBeDefined();\n      });\n\n      it(\"in case of single failure\", async () => {\n        await mockSuccessAfterOneFail(maxAttempts);\n        expect(next).toHaveBeenCalledTimes(2);\n        [0, 1].forEach((index) => {\n          expect(next.mock.calls[index][0].request.headers[\"amz-sdk-request\"]).not.toBeDefined();\n        });\n      });\n\n      it(\"in case of all failures\", async () => {\n        await mockFailedOperation(maxAttempts);\n        expect(next).toHaveBeenCalledTimes(maxAttempts);\n        [...Array(maxAttempts).keys()].forEach((index) => {\n          expect(next.mock.calls[index][0].request.headers[\"amz-sdk-request\"]).not.toBeDefined();\n        });\n      });\n    });\n\n    it(\"adds header for each attempt\", async () => {\n      const { isInstance } = HttpRequest;\n      (isInstance as unknown as any).mockReturnValue(true);\n\n      const mockError = new Error(\"mockError\");\n      next = vi.fn((args) => {\n        // the header needs to be verified inside vi.Mock as arguments in\n        // vi.mocks.calls has the value passed in final call\n        const index = next.mock.calls.length - 1;\n        expect(args.request.headers[\"amz-sdk-request\"]).toBe(`attempt=${index + 1}; max=${maxAttempts}`);\n        throw mockError;\n      });\n\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      try {\n        await retryStrategy.retry(next, { request: { headers: {} } } as any);\n      } catch (error) {\n        expect(error).toStrictEqual(mockError);\n        return error;\n      }\n\n      expect(next).toHaveBeenCalledTimes(maxAttempts);\n      (isInstance as unknown as any).mockReturnValue(false);\n    });\n  });\n\n  describe(\"defaults maxAttempts to DEFAULT_MAX_ATTEMPTS\", () => {\n    it(\"when maxAttemptsProvider throws error\", async () => {\n      const { isInstance } = HttpRequest;\n      (isInstance as unknown as any).mockReturnValue(true);\n\n      next = vi.fn((args) => {\n        expect(args.request.headers[\"amz-sdk-request\"]).toBe(`attempt=1; max=${DEFAULT_MAX_ATTEMPTS}`);\n        return Promise.resolve({\n          response: \"mockResponse\",\n          output: { $metadata: {} },\n        });\n      });\n\n      const retryStrategy = new StandardRetryStrategy(() => Promise.reject(\"ERROR\"));\n      await retryStrategy.retry(next, { request: { headers: {} } } as any);\n\n      expect(next).toHaveBeenCalledTimes(1);\n      (isInstance as unknown as any).mockReturnValue(false);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.ts",
    "content": "import { HttpRequest, HttpResponse } from \"@smithy/core/protocols\";\nimport { v4 } from \"@smithy/core/serde\";\nimport type {\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  MetadataBearer,\n  Provider,\n  RetryStrategy,\n  SdkError,\n} from \"@smithy/types\";\n\nimport { isThrottlingError } from \"../../service-error-classification/service-error-classification\";\nimport { DEFAULT_MAX_ATTEMPTS, RETRY_MODES } from \"../../util-retry/config\";\nimport {\n  DEFAULT_RETRY_DELAY_BASE,\n  INITIAL_RETRY_TOKENS,\n  INVOCATION_ID_HEADER,\n  REQUEST_HEADER,\n  THROTTLING_RETRY_DELAY_BASE,\n} from \"../../util-retry/constants\";\nimport { asSdkError } from \"../util\";\nimport { getDefaultRetryQuota } from \"./defaultRetryQuota\";\nimport { defaultDelayDecider } from \"./delayDecider\";\nimport { defaultRetryDecider } from \"./retryDecider\";\nimport type { DelayDecider, RetryDecider, RetryQuota } from \"./types\";\n\n/**\n * Strategy options to be passed to StandardRetryStrategy\n * @public\n * @deprecated use StandardRetryStrategy from @smithy/util-retry\n */\nexport interface StandardRetryStrategyOptions {\n  retryDecider?: RetryDecider;\n  delayDecider?: DelayDecider;\n  retryQuota?: RetryQuota;\n}\n\n/**\n * @public\n * @deprecated use StandardRetryStrategy from @smithy/util-retry\n */\nexport class StandardRetryStrategy implements RetryStrategy {\n  private retryDecider: RetryDecider;\n  private delayDecider: DelayDecider;\n  private retryQuota: RetryQuota;\n  public mode: string = RETRY_MODES.STANDARD;\n\n  constructor(\n    private readonly maxAttemptsProvider: Provider<number>,\n    options?: StandardRetryStrategyOptions\n  ) {\n    this.retryDecider = options?.retryDecider ?? defaultRetryDecider;\n    this.delayDecider = options?.delayDecider ?? defaultDelayDecider;\n    this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n  }\n\n  private shouldRetry(error: SdkError, attempts: number, maxAttempts: number) {\n    return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);\n  }\n\n  private async getMaxAttempts() {\n    let maxAttempts: number;\n    try {\n      maxAttempts = await this.maxAttemptsProvider();\n    } catch (error) {\n      maxAttempts = DEFAULT_MAX_ATTEMPTS;\n    }\n    return maxAttempts;\n  }\n\n  async retry<Input extends object, Ouput extends MetadataBearer>(\n    next: FinalizeHandler<Input, Ouput>,\n    args: FinalizeHandlerArguments<Input>,\n    options?: {\n      beforeRequest: Function;\n      afterRequest: Function;\n    }\n  ) {\n    let retryTokenAmount;\n    let attempts = 0;\n    let totalDelay = 0;\n\n    const maxAttempts = await this.getMaxAttempts();\n\n    const { request } = args;\n    if (HttpRequest.isInstance(request)) {\n      request.headers[INVOCATION_ID_HEADER] = v4();\n    }\n\n    while (true) {\n      try {\n        if (HttpRequest.isInstance(request)) {\n          request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;\n        }\n\n        if (options?.beforeRequest) {\n          await options.beforeRequest();\n        }\n        const { response, output } = await next(args);\n        if (options?.afterRequest) {\n          options.afterRequest(response);\n        }\n\n        this.retryQuota.releaseRetryTokens(retryTokenAmount);\n        output.$metadata.attempts = attempts + 1;\n        output.$metadata.totalRetryDelay = totalDelay;\n\n        return { response, output };\n      } catch (e) {\n        const err = asSdkError(e);\n        attempts++;\n        if (this.shouldRetry(err as SdkError, attempts, maxAttempts)) {\n          retryTokenAmount = this.retryQuota.retrieveRetryTokens(err);\n          const delayFromDecider = this.delayDecider(\n            isThrottlingError(err) ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE,\n            attempts\n          );\n\n          const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);\n          const delay = Math.max(delayFromResponse || 0, delayFromDecider);\n\n          totalDelay += delay;\n\n          await new Promise((resolve) => setTimeout(resolve, delay));\n          continue;\n        }\n\n        if (!err.$metadata) {\n          err.$metadata = {};\n        }\n\n        err.$metadata.attempts = attempts;\n        err.$metadata.totalRetryDelay = totalDelay;\n        throw err;\n      }\n    }\n  }\n}\n\n/**\n * Returns number of milliseconds to wait based on \"Retry-After\" header value.\n * @internal\n * @deprecated\n */\nconst getDelayFromRetryAfterHeader = (response: unknown): number | undefined => {\n  if (!HttpResponse.isInstance(response)) return;\n\n  const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === \"retry-after\");\n  if (!retryAfterHeaderName) return;\n  const retryAfter = response.headers[retryAfterHeaderName];\n\n  const retryAfterSeconds = Number(retryAfter);\n  if (!Number.isNaN(retryAfterSeconds)) return retryAfterSeconds * 1000;\n\n  const retryAfterDate = new Date(retryAfter);\n  return retryAfterDate.getTime() - Date.now();\n};\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/defaultRetryQuota.spec.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { INITIAL_RETRY_TOKENS, NO_RETRY_INCREMENT, RETRY_COST, TIMEOUT_RETRY_COST } from \"../../util-retry/constants\";\nimport { getDefaultRetryQuota } from \"./defaultRetryQuota\";\n\ndescribe(\"defaultRetryQuota\", () => {\n  const getMockError = () => new Error() as SdkError;\n  const getMockTimeoutError = () =>\n    Object.assign(new Error(), {\n      name: \"TimeoutError\",\n    }) as SdkError;\n\n  const getDrainedRetryQuota = (\n    targetCapacity: number,\n    error: SdkError,\n    initialRetryTokens: number = INITIAL_RETRY_TOKENS\n  ) => {\n    const retryQuota = getDefaultRetryQuota(initialRetryTokens);\n    let availableCapacity = initialRetryTokens;\n    while (availableCapacity >= targetCapacity) {\n      retryQuota.retrieveRetryTokens(error);\n      availableCapacity -= targetCapacity;\n    }\n    return retryQuota;\n  };\n\n  describe(\"custom initial retry tokens\", () => {\n    it(\"hasRetryTokens returns false if capacity is not available\", () => {\n      const customRetryTokens = 100;\n      const error = getMockError();\n      const retryQuota = getDrainedRetryQuota(RETRY_COST, error, customRetryTokens);\n      expect(retryQuota.hasRetryTokens(error)).toBe(false);\n    });\n\n    it(\"retrieveRetryToken throws error if retry tokens not available\", () => {\n      const customRetryTokens = 100;\n      const error = getMockError();\n      const retryQuota = getDrainedRetryQuota(RETRY_COST, error, customRetryTokens);\n      expect(() => {\n        retryQuota.retrieveRetryTokens(error);\n      }).toThrowError(new Error(\"No retry token available\"));\n    });\n  });\n\n  describe(\"hasRetryTokens\", () => {\n    describe(\"returns true if capacity is available\", () => {\n      it(\"when it's TimeoutError\", () => {\n        const timeoutError = getMockTimeoutError();\n        expect(getDefaultRetryQuota(INITIAL_RETRY_TOKENS).hasRetryTokens(timeoutError)).toBe(true);\n      });\n\n      it(\"when it's not TimeoutError\", () => {\n        expect(getDefaultRetryQuota(INITIAL_RETRY_TOKENS).hasRetryTokens(getMockError())).toBe(true);\n      });\n    });\n\n    describe(\"returns false if capacity is not available\", () => {\n      it(\"when it's TimeoutError\", () => {\n        const timeoutError = getMockTimeoutError();\n        const retryQuota = getDrainedRetryQuota(TIMEOUT_RETRY_COST, timeoutError);\n        expect(retryQuota.hasRetryTokens(timeoutError)).toBe(false);\n      });\n\n      it(\"when it's not TimeoutError\", () => {\n        const error = getMockError();\n        const retryQuota = getDrainedRetryQuota(RETRY_COST, error);\n        expect(retryQuota.hasRetryTokens(error)).toBe(false);\n      });\n    });\n  });\n\n  describe(\"retrieveRetryToken\", () => {\n    describe(\"returns retry tokens amount if available\", () => {\n      it(\"when it's TimeoutError\", () => {\n        const timeoutError = getMockTimeoutError();\n        expect(getDefaultRetryQuota(INITIAL_RETRY_TOKENS).retrieveRetryTokens(timeoutError)).toBe(TIMEOUT_RETRY_COST);\n      });\n\n      it(\"when it's not TimeoutError\", () => {\n        expect(getDefaultRetryQuota(INITIAL_RETRY_TOKENS).retrieveRetryTokens(getMockError())).toBe(RETRY_COST);\n      });\n    });\n\n    describe(\"throws error if retry tokens not available\", () => {\n      it(\"when it's TimeoutError\", () => {\n        const timeoutError = getMockTimeoutError();\n        const retryQuota = getDrainedRetryQuota(TIMEOUT_RETRY_COST, timeoutError);\n        expect(() => {\n          retryQuota.retrieveRetryTokens(timeoutError);\n        }).toThrowError(new Error(\"No retry token available\"));\n      });\n\n      it(\"when it's not TimeoutError\", () => {\n        const error = getMockError();\n        const retryQuota = getDrainedRetryQuota(RETRY_COST, error);\n        expect(() => {\n          retryQuota.retrieveRetryTokens(error);\n        }).toThrowError(new Error(\"No retry token available\"));\n      });\n    });\n  });\n\n  describe(\"releaseRetryToken\", () => {\n    it(\"adds capacityReleaseAmount if passed\", () => {\n      const error = getMockError();\n      const retryQuota = getDrainedRetryQuota(RETRY_COST, error);\n\n      // Ensure that retry tokens are not available.\n      expect(retryQuota.hasRetryTokens(error)).toBe(false);\n\n      // Release RETRY_COST tokens.\n      retryQuota.releaseRetryTokens(RETRY_COST);\n      expect(retryQuota.hasRetryTokens(error)).toBe(true);\n      expect(retryQuota.retrieveRetryTokens(error)).toBe(RETRY_COST);\n      expect(retryQuota.hasRetryTokens(error)).toBe(false);\n    });\n\n    it(\"adds NO_RETRY_INCREMENT if capacityReleaseAmount not passed\", () => {\n      const error = getMockError();\n      const retryQuota = getDrainedRetryQuota(RETRY_COST, error);\n\n      // retry tokens will not be available till NO_RETRY_INCREMENT is added\n      // till it's equal to RETRY_COST - (INITIAL_RETRY_TOKENS % RETRY_COST)\n      let tokensReleased = 0;\n      const tokensToBeReleased = RETRY_COST - (INITIAL_RETRY_TOKENS % RETRY_COST);\n      while (tokensReleased < tokensToBeReleased) {\n        expect(retryQuota.hasRetryTokens(error)).toBe(false);\n        retryQuota.releaseRetryTokens();\n        tokensReleased += NO_RETRY_INCREMENT;\n      }\n      expect(retryQuota.hasRetryTokens(error)).toBe(true);\n    });\n\n    it(\"ensures availableCapacity is maxed at INITIAL_RETRY_TOKENS\", () => {\n      const error = getMockError();\n      const retryQuota = getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n\n      // release 100 tokens.\n      [...Array(100).keys()].forEach(() => {\n        retryQuota.releaseRetryTokens();\n      });\n\n      // availableCapacity is still maxed at INITIAL_RETRY_TOKENS\n      // hasRetryTokens would be true only till INITIAL_RETRY_TOKENS/RETRY_COST times\n      [...Array(Math.floor(INITIAL_RETRY_TOKENS / RETRY_COST)).keys()].forEach(() => {\n        expect(retryQuota.hasRetryTokens(error)).toBe(true);\n        retryQuota.retrieveRetryTokens(error);\n      });\n      expect(retryQuota.hasRetryTokens(error)).toBe(false);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/defaultRetryQuota.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\n\nimport { NO_RETRY_INCREMENT, RETRY_COST, TIMEOUT_RETRY_COST } from \"../../util-retry/constants\";\nimport type { RetryQuota } from \"./types\";\n\n/**\n * @internal\n * @deprecated replaced by \\@smithy/util-retry (SRA).\n */\nexport interface DefaultRetryQuotaOptions {\n  /**\n   * The total amount of retry token to be incremented from retry token balance\n   * if an SDK operation invocation succeeds without requiring a retry request.\n   */\n  noRetryIncrement?: number;\n\n  /**\n   * The total amount of retry tokens to be decremented from retry token balance.\n   */\n  retryCost?: number;\n\n  /**\n   * The total amount of retry tokens to be decremented from retry token balance\n   * when a throttling error is encountered.\n   */\n  timeoutRetryCost?: number;\n}\n\n/**\n * @internal\n * @deprecated replaced by \\@smithy/util-retry (SRA).\n */\nexport const getDefaultRetryQuota = (initialRetryTokens: number, options?: DefaultRetryQuotaOptions): RetryQuota => {\n  const MAX_CAPACITY = initialRetryTokens;\n  const noRetryIncrement = options?.noRetryIncrement ?? NO_RETRY_INCREMENT;\n  const retryCost = options?.retryCost ?? RETRY_COST;\n  const timeoutRetryCost = options?.timeoutRetryCost ?? TIMEOUT_RETRY_COST;\n\n  let availableCapacity = initialRetryTokens;\n\n  const getCapacityAmount = (error: SdkError) => (error.name === \"TimeoutError\" ? timeoutRetryCost : retryCost);\n\n  const hasRetryTokens = (error: SdkError) => getCapacityAmount(error) <= availableCapacity;\n\n  const retrieveRetryTokens = (error: SdkError) => {\n    if (!hasRetryTokens(error)) {\n      // retryStrategy should stop retrying, and return last error\n      throw new Error(\"No retry token available\");\n    }\n    const capacityAmount = getCapacityAmount(error);\n    availableCapacity -= capacityAmount;\n    return capacityAmount;\n  };\n\n  const releaseRetryTokens = (capacityReleaseAmount?: number) => {\n    availableCapacity += capacityReleaseAmount ?? noRetryIncrement;\n    availableCapacity = Math.min(availableCapacity, MAX_CAPACITY);\n  };\n\n  return Object.freeze({\n    hasRetryTokens,\n    retrieveRetryTokens,\n    releaseRetryTokens,\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/delayDecider.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { MAXIMUM_RETRY_DELAY } from \"../../util-retry/constants\";\nimport { defaultDelayDecider } from \"./delayDecider\";\n\ndescribe(\"defaultDelayDecider\", () => {\n  const mathDotRandom = Math.random;\n\n  beforeEach(() => {\n    Math.random = vi.fn().mockReturnValue(1);\n  });\n\n  afterEach(() => {\n    Math.random = mathDotRandom;\n  });\n\n  describe(`retry delay increases exponentially with attempt number`, () => {\n    [0, 1, 2, 3].forEach((attempts) => {\n      const mockDelayBase = 100;\n      const expectedDelay = Math.floor(2 ** attempts * mockDelayBase);\n      it(`(${mockDelayBase}, ${attempts}) returns ${expectedDelay}`, () => {\n        expect(defaultDelayDecider(mockDelayBase, attempts)).toBe(expectedDelay);\n      });\n    });\n  });\n\n  describe(`caps retry delay at ${MAXIMUM_RETRY_DELAY / 1000} seconds`, () => {\n    it(\"when value exceeded because of high delayBase\", () => {\n      expect(defaultDelayDecider(MAXIMUM_RETRY_DELAY + 1, 0)).toBe(MAXIMUM_RETRY_DELAY);\n      expect(defaultDelayDecider(MAXIMUM_RETRY_DELAY + 2, 0)).toBe(MAXIMUM_RETRY_DELAY);\n    });\n\n    it(\"when value exceeded because of high attempts number\", () => {\n      const largeAttemptsNumber = Math.ceil(Math.log2(MAXIMUM_RETRY_DELAY));\n      expect(defaultDelayDecider(1, largeAttemptsNumber)).toBe(MAXIMUM_RETRY_DELAY);\n      expect(defaultDelayDecider(1, largeAttemptsNumber + 1)).toBe(MAXIMUM_RETRY_DELAY);\n    });\n  });\n\n  describe(\"randomizes the retry delay value\", () => {\n    Array.from({ length: 3 }, () => Math.random()).forEach((mockRandomValue) => {\n      const attempts = 0;\n      const delayBase = 100;\n      const expectedDelay = Math.floor(mockRandomValue * 2 ** attempts * delayBase);\n      it(`(${delayBase}, ${attempts}) with mock Math.random=${mockRandomValue} returns ${expectedDelay}`, () => {\n        Math.random = vi.fn().mockReturnValue(mockRandomValue);\n        expect(defaultDelayDecider(delayBase, attempts)).toBe(expectedDelay);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/delayDecider.ts",
    "content": "import { MAXIMUM_RETRY_DELAY } from \"../../util-retry/constants\";\n\n/**\n * Calculate a capped, fully-jittered exponential backoff time.\n * @internal\n * @deprecated replaced by \\@smithy/util-retry (SRA).\n */\nexport const defaultDelayDecider = (delayBase: number, attempts: number) =>\n  Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/retryDecider.spec.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  isClockSkewError,\n  isRetryableByTrait,\n  isThrottlingError,\n  isTransientError,\n} from \"../../service-error-classification/service-error-classification\";\nimport { defaultRetryDecider } from \"./retryDecider\";\n\nvi.mock(\"../../service-error-classification/service-error-classification\");\n\ndescribe(\"defaultRetryDecider\", () => {\n  const createMockError = () => Object.assign(new Error(), { $metadata: {} }) as SdkError;\n\n  beforeEach(() => {\n    vi.mocked(isRetryableByTrait).mockReturnValue(false);\n    vi.mocked(isClockSkewError).mockReturnValue(false);\n    vi.mocked(isThrottlingError).mockReturnValue(false);\n    vi.mocked(isTransientError).mockReturnValue(false);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should return false when the provided error is falsy\", () => {\n    expect(defaultRetryDecider(null as any)).toBe(false);\n    expect(vi.mocked(isRetryableByTrait)).toHaveBeenCalledTimes(0);\n    expect(vi.mocked(isClockSkewError)).toHaveBeenCalledTimes(0);\n    expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(0);\n    expect(vi.mocked(isTransientError)).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"should return true for RetryableByTrait error\", () => {\n    vi.mocked(isRetryableByTrait).mockReturnValueOnce(true);\n    expect(defaultRetryDecider(createMockError())).toBe(true);\n    expect(vi.mocked(isRetryableByTrait)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isClockSkewError)).toHaveBeenCalledTimes(0);\n    expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(0);\n    expect(vi.mocked(isTransientError)).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"should return true for ClockSkewError\", () => {\n    vi.mocked(isClockSkewError).mockReturnValueOnce(true);\n    expect(defaultRetryDecider(createMockError())).toBe(true);\n    expect(vi.mocked(isRetryableByTrait)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isClockSkewError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(0);\n    expect(vi.mocked(isTransientError)).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"should return true for ThrottlingError\", () => {\n    vi.mocked(isThrottlingError).mockReturnValueOnce(true);\n    expect(defaultRetryDecider(createMockError())).toBe(true);\n    expect(vi.mocked(isRetryableByTrait)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isClockSkewError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isTransientError)).toHaveBeenCalledTimes(0);\n  });\n\n  it(\"should return true for TransientError\", () => {\n    vi.mocked(isTransientError).mockReturnValueOnce(true);\n    expect(defaultRetryDecider(createMockError())).toBe(true);\n    expect(vi.mocked(isRetryableByTrait)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isClockSkewError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isTransientError)).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"should return false for other errors\", () => {\n    expect(defaultRetryDecider(createMockError())).toBe(false);\n    expect(vi.mocked(isRetryableByTrait)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isClockSkewError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isThrottlingError)).toHaveBeenCalledTimes(1);\n    expect(vi.mocked(isTransientError)).toHaveBeenCalledTimes(1);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/retryDecider.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\n\nimport {\n  isClockSkewError,\n  isRetryableByTrait,\n  isThrottlingError,\n  isTransientError,\n} from \"../../service-error-classification/service-error-classification\";\n\n/**\n * @internal\n * @deprecated this is only used in the deprecated StandardRetryStrategy. Do not use in new code.\n */\nexport const defaultRetryDecider = (error: SdkError) => {\n  if (!error) {\n    return false;\n  }\n\n  return isRetryableByTrait(error) || isClockSkewError(error) || isThrottlingError(error) || isTransientError(error);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retry-pre-sra-deprecated/types.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\n\n/**\n * Determines whether an error is retryable based on the number of retries\n * already attempted, the HTTP status code, and the error received (if any).\n *\n * @param error - The error encountered.\n *\n * @deprecated\n * @internal\n */\nexport interface RetryDecider {\n  (error: SdkError): boolean;\n}\n\n/**\n * Determines the number of milliseconds to wait before retrying an action.\n *\n * @param delayBase - The base delay (in milliseconds).\n * @param attempts - The number of times the action has already been tried.\n *\n * @deprecated\n * @internal\n */\nexport interface DelayDecider {\n  (delayBase: number, attempts: number): number;\n}\n\n/**\n * Interface that specifies the retry quota behavior.\n * @deprecated\n * @internal\n */\nexport interface RetryQuota {\n  /**\n   * returns true if retry tokens are available from the retry quota bucket.\n   */\n  hasRetryTokens: (error: SdkError) => boolean;\n\n  /**\n   * returns token amount from the retry quota bucket.\n   * throws error is retry tokens are not available.\n   */\n  retrieveRetryTokens: (error: SdkError) => number;\n\n  /**\n   * releases tokens back to the retry quota.\n   */\n  releaseRetryTokens: (releaseCapacityAmount?: number) => void;\n}\n\n/**\n * @deprecated\n * @internal\n */\nexport interface RateLimiter {\n  /**\n   * If there is sufficient capacity (tokens) available, it immediately returns.\n   * If there is not sufficient capacity, it will either sleep a certain amount\n   * of time until the rate limiter can retrieve a token from its token bucket\n   * or raise an exception indicating there is insufficient capacity.\n   */\n  getSendToken: () => Promise<void>;\n\n  /**\n   * Updates the client sending rate based on response.\n   * If the response was successful, the capacity and fill rate are increased.\n   * If the response was a throttling response, the capacity and fill rate are\n   * decreased. Transient errors do not affect the rate limiter.\n   */\n  updateClientSendingRate: (response: any) => void;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retryMiddleware.spec.ts",
    "content": "import { HttpResponse } from \"@smithy/core/protocols\";\nimport { v4 } from \"@smithy/core/serde\";\nimport type { FinalizeHandlerArguments, HandlerExecutionContext, MiddlewareStack } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getRetryPlugin, retryMiddleware, retryMiddlewareOptions } from \"../index\";\nimport {\n  isServerError,\n  isThrottlingError,\n  isTransientError,\n} from \"../service-error-classification/service-error-classification\";\nimport { INVOCATION_ID_HEADER, REQUEST_HEADER } from \"../util-retry/constants\";\n\nvi.mock(\"../service-error-classification/service-error-classification\");\nvi.mock(\"@smithy/core/serde\");\n\ndescribe(getRetryPlugin.name, () => {\n  const mockClientStack = {\n    add: vi.fn(),\n  };\n\n  const mockRetryStrategy = {\n    mode: \"mock\",\n    retry: vi.fn(),\n  };\n\n  beforeEach(() => {\n    vi.mocked(isThrottlingError).mockReturnValue(false);\n    vi.mocked(isTransientError).mockReturnValue(false);\n    vi.mocked(isServerError).mockReturnValue(false);\n    vi.mocked(v4).mockReturnValue(\"42\");\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"adds retryMiddleware\", () => {\n    [1, 2, 3].forEach((maxAttempts) => {\n      it(`when maxAttempts=${maxAttempts}`, () => {\n        getRetryPlugin({\n          maxAttempts: () => Promise.resolve(maxAttempts),\n          retryStrategy: vi.fn().mockResolvedValue(mockRetryStrategy),\n        }).applyToStack(mockClientStack as unknown as MiddlewareStack<any, any>);\n        expect(mockClientStack.add).toHaveBeenCalledTimes(1);\n        expect(mockClientStack.add.mock.calls[0][1]).toEqual(retryMiddlewareOptions);\n      });\n    });\n  });\n});\n\ndescribe(retryMiddleware.name, () => {\n  const maxAttempts = 2;\n\n  const args = {\n    request: {\n      method: \"POST\",\n      protocol: \"https\",\n      hostname: \"localhost\",\n      path: \"/\",\n      headers: {},\n      query: {},\n    },\n  };\n  beforeEach(() => {\n    args.request = {\n      method: \"POST\",\n      protocol: \"https\",\n      hostname: \"localhost\",\n      path: \"/\",\n      headers: {},\n      query: {},\n    };\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"RetryStrategy\", () => {\n    const mockRetryStrategy = {\n      mode: \"mock\",\n      retry: vi.fn(),\n    };\n\n    it(\"calls retryStrategy.retry with next and args\", async () => {\n      const next = vi.fn();\n      const context: HandlerExecutionContext = {};\n\n      await retryMiddleware({\n        maxAttempts: () => Promise.resolve(maxAttempts),\n        retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n      })(\n        next,\n        context\n      )(args as FinalizeHandlerArguments<any>);\n      expect(mockRetryStrategy.retry).toHaveBeenCalledTimes(1);\n      expect(mockRetryStrategy.retry).toHaveBeenCalledWith(next, args);\n      expect(context.userAgent).toContainEqual([\"cfg/retry-mode\", mockRetryStrategy.mode]);\n    });\n  });\n\n  describe(\"RetryStrategyV2\", () => {\n    const partitionId = \"test_partition_id\";\n    const context: HandlerExecutionContext = {\n      partition_id: partitionId,\n    };\n    const mockRetryToken = {\n      getRetryToken: () => 1,\n      getRetryDelay: () => 1,\n      getRetryCount: () => 1,\n    };\n    const mockRetryStrategy = {\n      mode: \"mock\",\n      acquireInitialRetryToken: vi.fn().mockResolvedValue(mockRetryToken),\n      refreshRetryTokenForRetry: vi.fn().mockResolvedValue(mockRetryToken),\n      recordSuccess: vi.fn(),\n    };\n    const mockSuccess = {\n      response: new HttpResponse({\n        headers: {},\n        statusCode: 200,\n      }),\n      output: {\n        $metadata: {},\n      },\n    };\n    const getErrorWithValues = (retryAfter: number | string, retryAfterHeaderName = \"retry-after\") => {\n      const error = new Error(\"mockError\");\n      Object.defineProperty(error, \"$response\", {\n        value: {\n          statusCode: 503,\n          headers: { [retryAfterHeaderName]: String(retryAfter) },\n        },\n      });\n      return error;\n    };\n\n    it(\"calls acquireInitialRetryToken and records success when next succeeds\", async () => {\n      const next = vi.fn().mockResolvedValueOnce(mockSuccess);\n      const { output } = await retryMiddleware({\n        maxAttempts: () => Promise.resolve(maxAttempts),\n        retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n      })(\n        next,\n        context\n      )(args as FinalizeHandlerArguments<any>);\n      expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n      expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n      expect(mockRetryStrategy.recordSuccess).toHaveBeenCalledTimes(1);\n      expect(mockRetryStrategy.recordSuccess).toHaveBeenCalledWith(mockRetryToken);\n      expect(output.$metadata.attempts).toBe(1);\n    });\n\n    describe(\"throws when token cannot be refreshed\", () => {\n      it(\"throw last request error\", async () => {\n        const requestError = new Error(\"mockRequestError\");\n        vi.mocked(isThrottlingError).mockReturnValue(true);\n        const next = vi.fn().mockRejectedValue(requestError);\n        const errorInfo = {\n          error: requestError,\n          errorType: \"THROTTLING\",\n        };\n        const mockRetryStrategy = {\n          mode: \"mock\",\n          acquireInitialRetryToken: vi.fn().mockResolvedValue(mockRetryToken),\n          refreshRetryTokenForRetry: vi.fn().mockRejectedValue(new Error(\"Cannot refresh token\")),\n          recordSuccess: vi.fn(),\n        };\n        try {\n          await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n        } catch (error) {\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n          expect(error).toStrictEqual(requestError);\n          expect(error.$metadata.attempts).toBe(1);\n          expect(error.$metadata.totalRetryDelay).toBeDefined();\n        }\n      });\n    });\n\n    describe(\"calls acquireInitialRetryToken and refreshes retry token\", () => {\n      const mockError = new Error(\"mockError\");\n      it(\"sets throttling error type\", async () => {\n        vi.mocked(isThrottlingError).mockReturnValue(true);\n        const next = vi.fn().mockRejectedValueOnce(mockError).mockResolvedValueOnce(mockSuccess);\n        const errorInfo = {\n          error: mockError,\n          errorType: \"THROTTLING\",\n        };\n        const { output } = await retryMiddleware({\n          maxAttempts: () => Promise.resolve(maxAttempts),\n          retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n        })(\n          next,\n          context\n        )(args as FinalizeHandlerArguments<any>);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n        expect(output.$metadata.attempts).toBe(2);\n        expect(output.$metadata.totalRetryDelay).toBeDefined();\n      });\n\n      it(\"sets transient error type\", async () => {\n        vi.mocked(isTransientError).mockReturnValue(true);\n        vi.mocked(isThrottlingError).mockReturnValue(false);\n        const next = vi.fn().mockRejectedValueOnce(mockError).mockResolvedValueOnce(mockSuccess);\n        const errorInfo = {\n          error: mockError,\n          errorType: \"TRANSIENT\",\n        };\n        const { output } = await retryMiddleware({\n          maxAttempts: () => Promise.resolve(maxAttempts),\n          retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n        })(\n          next,\n          context\n        )(args as FinalizeHandlerArguments<any>);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n        expect(output.$metadata.attempts).toBe(2);\n        expect(output.$metadata.totalRetryDelay).toBeDefined();\n      });\n\n      it(\"sets server error type\", async () => {\n        vi.mocked(isServerError).mockReturnValue(true);\n        vi.mocked(isTransientError).mockReturnValue(false);\n        vi.mocked(isThrottlingError).mockReturnValue(false);\n        const next = vi.fn().mockRejectedValueOnce(mockError).mockResolvedValueOnce(mockSuccess);\n        const errorInfo = {\n          error: mockError,\n          errorType: \"SERVER_ERROR\",\n        };\n        const { output } = await retryMiddleware({\n          maxAttempts: () => Promise.resolve(maxAttempts),\n          retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n        })(\n          next,\n          context\n        )(args as FinalizeHandlerArguments<any>);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n        expect(output.$metadata.attempts).toBe(2);\n        expect(output.$metadata.totalRetryDelay).toBeDefined();\n      });\n      it(\"sets client error type\", async () => {\n        vi.mocked(isServerError).mockReturnValue(false);\n        vi.mocked(isTransientError).mockReturnValue(false);\n        vi.mocked(isThrottlingError).mockReturnValue(false);\n        const next = vi.fn().mockRejectedValueOnce(mockError).mockResolvedValueOnce(mockSuccess);\n        const errorInfo = {\n          error: mockError,\n          errorType: \"CLIENT_ERROR\",\n        };\n        const { output } = await retryMiddleware({\n          maxAttempts: () => Promise.resolve(maxAttempts),\n          retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n        })(\n          next,\n          context\n        )(args as FinalizeHandlerArguments<any>);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n        expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n        expect(output.$metadata.attempts).toBe(2);\n        expect(output.$metadata.totalRetryDelay).toBeDefined();\n      });\n\n      describe(\"when retry-after is not set\", () => {\n        it(\"should not set retryAfter in errorInfo\", async () => {\n          Object.defineProperty(mockError, \"$response\", {\n            value: {\n              headers: { [\"other-header\"]: \"foo\" },\n            },\n          });\n          const next = vi.fn().mockRejectedValueOnce(mockError).mockResolvedValueOnce(mockSuccess);\n          const errorInfo = {\n            error: mockError,\n            errorType: \"CLIENT_ERROR\",\n          };\n          const { output } = await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n          expect(output.$metadata.attempts).toBe(2);\n          expect(output.$metadata.totalRetryDelay).toBeDefined();\n        });\n      });\n\n      describe(\"when retry-after is set\", () => {\n        const now = Date.now();\n        const retryAfterDate = new Date(now + 3000);\n\n        const errorInfo = {\n          error: mockError,\n          errorType: \"CLIENT_ERROR\",\n          retryAfterHint: retryAfterDate,\n        };\n\n        it(\"parses retry-after from date string\", async () => {\n          const error = getErrorWithValues(retryAfterDate.toISOString());\n          const next = vi.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);\n          const { output } = await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n          expect(output.$metadata.attempts).toBe(2);\n          expect(output.$metadata.totalRetryDelay).toBeDefined();\n        });\n\n        it(\"parses retry-after from seconds\", async () => {\n          const error = getErrorWithValues(3);\n          const next = vi.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);\n          const { output } = await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n\n          const call = mockRetryStrategy.refreshRetryTokenForRetry.mock.calls[0];\n          expect(call[0]).toEqual(mockRetryToken);\n          expect(call[1].error).toEqual(errorInfo.error);\n          expect(call[1].errorType).toEqual(errorInfo.errorType);\n          expect(call[1].retryAfterHint).toBeInstanceOf(Date);\n          expect(call[1].retryAfterHint.getTime()).toBeGreaterThanOrEqual(errorInfo.retryAfterHint.getTime() - 1_000);\n          expect(call[1].retryAfterHint.getTime()).toBeLessThanOrEqual(errorInfo.retryAfterHint.getTime() + 1_000);\n\n          expect(output.$metadata.attempts).toBe(2);\n          expect(output.$metadata.totalRetryDelay).toBeDefined();\n        });\n\n        it(\"parses retry-after from Retry-After header name\", async () => {\n          const error = getErrorWithValues(retryAfterDate.toISOString(), \"Retry-After\");\n          const next = vi.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);\n          const { output } = await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n          expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n          expect(output.$metadata.attempts).toBe(2);\n          expect(output.$metadata.totalRetryDelay).toBeDefined();\n        });\n      });\n\n      describe(\"when x-amz-retry-after is set\", () => {\n        const now = Date.now();\n        const retryAfterDate = new Date(now + 3000);\n\n        const errorInfo = {\n          error: mockError,\n          errorType: \"CLIENT_ERROR\",\n          retryAfterHint: retryAfterDate,\n        };\n\n        for (const h of [\"x-amz-retry-after\", \"X-Amz-Retry-After\"]) {\n          it(\"parses x-amz-retry-after as milliseconds delay\", async () => {\n            const error = getErrorWithValues(3000, h);\n            const next = vi.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);\n            const { output } = await retryMiddleware({\n              maxAttempts: () => Promise.resolve(maxAttempts),\n              retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n            })(\n              next,\n              context\n            )(args as FinalizeHandlerArguments<any>);\n            expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledTimes(1);\n            expect(mockRetryStrategy.acquireInitialRetryToken).toHaveBeenCalledWith(partitionId);\n            expect(mockRetryStrategy.refreshRetryTokenForRetry).toHaveBeenCalledTimes(1);\n\n            const call = mockRetryStrategy.refreshRetryTokenForRetry.mock.calls[0];\n            expect(call[0]).toEqual(mockRetryToken);\n            expect(call[1].error).toEqual(errorInfo.error);\n            expect(call[1].errorType).toEqual(errorInfo.errorType);\n            expect(call[1].retryAfterHint).toBeInstanceOf(Date);\n            expect(call[1].retryAfterHint.getTime()).toBeGreaterThanOrEqual(errorInfo.retryAfterHint.getTime() - 1_000);\n            expect(call[1].retryAfterHint.getTime()).toBeLessThanOrEqual(errorInfo.retryAfterHint.getTime() + 1_000);\n\n            expect(output.$metadata.attempts).toBe(2);\n            expect(output.$metadata.totalRetryDelay).toBeDefined();\n          });\n        }\n      });\n    });\n\n    describe(\"retry headers\", () => {\n      describe(\"not added if HttpRequest.isInstance returns false\", () => {\n        beforeEach(() => {\n          args.request = {\n            headers: {},\n          } as any;\n        });\n\n        it(`retry informational header: ${INVOCATION_ID_HEADER}`, async () => {\n          const next = vi.fn().mockResolvedValueOnce(mockSuccess);\n          await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(next).toHaveBeenCalledTimes(1);\n          expect(next.mock.calls[0][0].request.headers[INVOCATION_ID_HEADER]).not.toBeDefined();\n        });\n\n        it(`header for each attempt as ${REQUEST_HEADER}`, async () => {\n          const next = vi.fn().mockResolvedValueOnce(mockSuccess);\n          await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(next).toHaveBeenCalledTimes(1);\n          expect(next.mock.calls[0][0].request.headers[REQUEST_HEADER]).not.toBeDefined();\n        });\n      });\n\n      describe(\"added if HttpRequest.isInstance returns true\", () => {\n        it(`retry informational header: ${INVOCATION_ID_HEADER}`, async () => {\n          const retryAfterDate = new Date(Date.now() + 3000);\n          const error = getErrorWithValues(retryAfterDate.toISOString());\n          vi.mocked(isThrottlingError).mockReturnValue(true);\n          const next = vi.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);\n          await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(next).toHaveBeenCalledTimes(2);\n          expect(next.mock.calls[0][0].request.headers[INVOCATION_ID_HEADER]).toBeDefined();\n          expect(next.mock.calls[1][0].request.headers[INVOCATION_ID_HEADER]).toBeDefined();\n        });\n\n        it(`header for each attempt as ${REQUEST_HEADER}`, async () => {\n          const retryAfterDate = new Date(Date.now() + 3000);\n          const error = getErrorWithValues(retryAfterDate.toISOString());\n          vi.mocked(isThrottlingError).mockReturnValue(true);\n          const next = vi.fn().mockRejectedValueOnce(error).mockResolvedValueOnce(mockSuccess);\n\n          await retryMiddleware({\n            maxAttempts: () => Promise.resolve(maxAttempts),\n            retryStrategy: vi.fn().mockResolvedValue({ ...mockRetryStrategy, maxAttempts }),\n          })(\n            next,\n            context\n          )(args as FinalizeHandlerArguments<any>);\n          expect(next).toHaveBeenCalledTimes(2);\n          expect(next.mock.calls[0][0].request.headers[REQUEST_HEADER]).toBeDefined();\n          expect(next.mock.calls[1][0].request.headers[REQUEST_HEADER]).toBeDefined();\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/retryMiddleware.ts",
    "content": "import { NoOpLogger } from \"@smithy/core/client\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport { v4 } from \"@smithy/core/serde\";\nimport type {\n  AbsoluteLocation,\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  FinalizeHandlerOutput,\n  FinalizeRequestHandlerOptions,\n  HandlerExecutionContext,\n  Logger,\n  MetadataBearer,\n  Pluggable,\n  RetryErrorInfo,\n  RetryErrorType,\n  RetryStrategy,\n  RetryStrategyV2,\n  RetryToken,\n  SdkError,\n} from \"@smithy/types\";\n\nimport {\n  isServerError,\n  isThrottlingError,\n  isTransientError,\n} from \"../service-error-classification/service-error-classification\";\nimport { INVOCATION_ID_HEADER, REQUEST_HEADER } from \"../util-retry/constants\";\nimport type { RetryResolvedConfig } from \"./configurations\";\nimport { parseRetryAfterHeader } from \"./parseRetryAfterHeader\";\nimport { asSdkError } from \"./util\";\n\n/**\n * @internal\n */\nexport type IsStreamingPayload = (request: HttpRequest) => boolean;\n\n/**\n * @internal\n */\nexport function bindRetryMiddleware(isStreamingPayload: IsStreamingPayload) {\n  return (options: RetryResolvedConfig) =>\n    <Output extends MetadataBearer = MetadataBearer>(\n      next: FinalizeHandler<any, Output>,\n      context: HandlerExecutionContext\n    ): FinalizeHandler<any, Output> =>\n    async (args: FinalizeHandlerArguments<any>): Promise<FinalizeHandlerOutput<Output>> => {\n      let retryStrategy = await options.retryStrategy();\n      const maxAttempts = await options.maxAttempts();\n\n      if (isRetryStrategyV2(retryStrategy)) {\n        retryStrategy = retryStrategy as RetryStrategyV2;\n        let retryToken: RetryToken = await retryStrategy.acquireInitialRetryToken(\n          (context[\"partition_id\"] ?? \"\") + (context.__retryLongPoll ? \":longpoll\" : \"\")\n        );\n        let lastError: SdkError = new Error();\n        let attempts = 0;\n        let totalRetryDelay = 0;\n        const { request } = args;\n        const isRequest = HttpRequest.isInstance(request);\n\n        if (isRequest) {\n          request.headers[INVOCATION_ID_HEADER] = v4();\n        }\n        while (true) {\n          try {\n            if (isRequest) {\n              request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;\n            }\n            const { response, output } = await next(args);\n            retryStrategy.recordSuccess(retryToken);\n            output.$metadata.attempts = attempts + 1;\n            output.$metadata.totalRetryDelay = totalRetryDelay;\n            return { response, output };\n          } catch (e: any) {\n            const retryErrorInfo = getRetryErrorInfo(e, options.logger);\n            lastError = asSdkError(e);\n\n            if (isRequest && isStreamingPayload(request)) {\n              (context.logger instanceof NoOpLogger ? console : context.logger)?.warn(\n                \"An error was encountered in a non-retryable streaming request.\"\n              );\n              throw lastError;\n            }\n\n            try {\n              retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);\n            } catch (refreshError) {\n              if (typeof refreshError.$backoff === \"number\") {\n                await cooldown(refreshError.$backoff);\n              }\n              if (!lastError.$metadata) {\n                lastError.$metadata = {};\n              }\n              lastError.$metadata.attempts = attempts + 1;\n              lastError.$metadata.totalRetryDelay = totalRetryDelay;\n              throw lastError;\n            }\n            attempts = retryToken.getRetryCount();\n            const delay = retryToken.getRetryDelay();\n            totalRetryDelay += delay;\n            await cooldown(delay);\n          }\n        }\n      } else {\n        retryStrategy = retryStrategy as RetryStrategy;\n        if (retryStrategy?.mode) {\n          context.userAgent = [...(context.userAgent || []), [\"cfg/retry-mode\", retryStrategy.mode]];\n        }\n\n        return retryStrategy.retry(next, args);\n      }\n    };\n}\n\nconst cooldown = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nconst isRetryStrategyV2 = (retryStrategy: RetryStrategy | RetryStrategyV2) =>\n  typeof (retryStrategy as RetryStrategyV2).acquireInitialRetryToken !== \"undefined\" &&\n  typeof (retryStrategy as RetryStrategyV2).refreshRetryTokenForRetry !== \"undefined\" &&\n  typeof (retryStrategy as RetryStrategyV2).recordSuccess !== \"undefined\";\n\nconst getRetryErrorInfo = (error: SdkError, logger?: Logger): RetryErrorInfo => {\n  const errorInfo: RetryErrorInfo = {\n    error,\n    errorType: getRetryErrorType(error),\n  };\n  const retryAfterHint = parseRetryAfterHeader(error.$response, logger);\n  if (retryAfterHint) {\n    errorInfo.retryAfterHint = retryAfterHint;\n  }\n  return errorInfo;\n};\n\nconst getRetryErrorType = (error: SdkError): RetryErrorType => {\n  if (isThrottlingError(error)) return \"THROTTLING\";\n  if (isTransientError(error)) return \"TRANSIENT\";\n  if (isServerError(error)) return \"SERVER_ERROR\";\n  return \"CLIENT_ERROR\";\n};\n\n/**\n * @internal\n */\nexport const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation = {\n  name: \"retryMiddleware\",\n  tags: [\"RETRY\"],\n  step: \"finalizeRequest\",\n  priority: \"high\",\n  override: true,\n};\n\n/**\n * @internal\n */\nexport function bindGetRetryPlugin(isStreamingPayload: IsStreamingPayload) {\n  const retryMiddleware = bindRetryMiddleware(isStreamingPayload);\n\n  return (options: RetryResolvedConfig): Pluggable<any, any> => ({\n    applyToStack: (clientStack) => {\n      clientStack.add(retryMiddleware(options), retryMiddlewareOptions);\n    },\n  });\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/middleware-retry/util.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\n\nexport const asSdkError = (error: unknown): SdkError => {\n  if (error instanceof Error) return error;\n  if (error instanceof Object) return Object.assign(new Error(), error);\n  if (typeof error === \"string\") return new Error(error);\n  return new Error(`AWS SDK error wrapper for ${error}`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/retry/retry-rate-target.integ.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { cbor } from \"@smithy/core/cbor\";\nimport { HttpResponse, type HttpHandler } from \"@smithy/core/protocols\";\nimport { describe, expect, test as it } from \"vitest\";\nimport { GetNumbersCommand, XYZService } from \"xyz-schema\";\n\nimport { Retry } from \"./util-retry/retries-2026-config\";\n\nRetry.v2026 = true;\n\nclass ThrottlingHandler implements HttpHandler {\n  public readonly metadata = { handlerProtocol: \"http/1.1\" };\n  public timestamps: number[] = [];\n\n  private static okBody = cbor.serialize({});\n  private static throttleBody = cbor.serialize({ __type: \"ThrottlingException\", message: \"Rate exceeded\" });\n\n  private ratePerSecond: number;\n  private tokens: number;\n  private lastRefillMs: number;\n\n  public constructor(ratePerSecond: number) {\n    this.ratePerSecond = ratePerSecond;\n    this.tokens = ratePerSecond;\n    this.lastRefillMs = performance.now();\n  }\n\n  public updateHttpClientConfig(key: never, value: never): void {\n    throw new Error(\"Method not implemented.\");\n  }\n\n  public httpHandlerConfigs(): {} {\n    throw new Error(\"Method not implemented.\");\n  }\n\n  public setRate(rps: number) {\n    this.refill();\n    this.ratePerSecond = rps;\n    this.tokens = Math.min(this.tokens, rps);\n  }\n\n  public async handle() {\n    this.refill();\n    this.timestamps.push(performance.now());\n\n    if (this.tokens >= 1) {\n      this.tokens -= 1;\n      return {\n        response: new HttpResponse({\n          statusCode: 200,\n          headers: { \"smithy-protocol\": \"rpc-v2-cbor\" },\n          body: Readable.from(ThrottlingHandler.okBody),\n        }),\n      };\n    }\n\n    return {\n      response: new HttpResponse({\n        statusCode: 429,\n        headers: { \"smithy-protocol\": \"rpc-v2-cbor\" },\n        body: Readable.from(ThrottlingHandler.throttleBody),\n      }),\n    };\n  }\n\n  public rpsInInterval(startMs: number, endMs: number): number {\n    const count = this.timestamps.filter((t) => t >= startMs && t < endMs).length;\n    const durationSeconds = (endMs - startMs) / 1000;\n    return durationSeconds > 0 ? count / durationSeconds : 0;\n  }\n\n  private refill() {\n    const now = performance.now();\n    const elapsedSeconds = (now - this.lastRefillMs) / 1000;\n    this.tokens = Math.min(this.ratePerSecond, this.tokens + elapsedSeconds * this.ratePerSecond);\n    this.lastRefillMs = now;\n  }\n}\n\nfunction createClient(handler: ThrottlingHandler) {\n  return new XYZService({\n    endpoint: \"https://localhost\",\n    apiKey: { apiKey: \"test\" },\n    retryMode: \"adaptive\",\n    maxAttempts: 4,\n    requestHandler: handler,\n  });\n}\n\nasync function continuousInvoke(\n  client: XYZService,\n  maxDurationMs: number,\n  workers: number,\n  signal: AbortSignal\n): Promise<void> {\n  const deadline = performance.now() + maxDurationMs;\n  const worker = async () => {\n    while (performance.now() < deadline && !signal.aborted) {\n      try {\n        await client.send(new GetNumbersCommand({}));\n      } catch {\n        // throttling errors expected\n      }\n    }\n  };\n  await Promise.all(Array.from({ length: workers }, () => worker()));\n}\n\n/**\n * Polls the handler's RPS every 500ms. Resolves once the measured RPS\n * over the last `windowMs` falls within [lower, upper], or when\n * `maxWaitMs` elapses.\n */\nasync function waitForRpsInRange(\n  handler: ThrottlingHandler,\n  lower: number,\n  upper: number,\n  maxWaitMs: number,\n  windowMs = 2000\n): Promise<void> {\n  const deadline = performance.now() + maxWaitMs;\n  while (performance.now() < deadline) {\n    await new Promise((r) => setTimeout(r, 500));\n    const now = performance.now();\n    const rps = handler.rpsInInterval(now - windowMs, now);\n    if (rps >= lower && rps <= upper) return;\n  }\n}\n\ndescribe(\"adaptive retry rate targeting\", () => {\n  const THROTTLE_RPS = 20;\n\n  it(\"converges send rate to match server throttle (20 RPS)\", async () => {\n    const handler = new ThrottlingHandler(THROTTLE_RPS);\n    const client = createClient(handler);\n    const abort = new AbortController();\n\n    const lower = THROTTLE_RPS * 0.5;\n    const upper = THROTTLE_RPS * 1.5;\n\n    const invoke = continuousInvoke(client, 30_000, 10, abort.signal);\n    await waitForRpsInRange(handler, lower, upper, 15_000);\n\n    const now = performance.now();\n    const measuredRps = handler.rpsInInterval(now - 2000, now);\n\n    abort.abort();\n    await invoke;\n\n    expect(measuredRps).toBeGreaterThanOrEqual(lower);\n    expect(measuredRps).toBeLessThanOrEqual(upper);\n  }, 30_000);\n\n  it(\"reduces send rate when server throttle drops (10k -> 10 RPS)\", async () => {\n    const REDUCED_RPS = 10;\n    const lower = REDUCED_RPS * 0.3;\n    const upper = REDUCED_RPS * 2;\n\n    const handler = new ThrottlingHandler(10_000);\n    const client = createClient(handler);\n    const abort = new AbortController();\n\n    setTimeout(() => handler.setRate(REDUCED_RPS), 3000);\n\n    const invoke = continuousInvoke(client, 30_000, 10, abort.signal);\n    await new Promise((r) => setTimeout(r, 3500));\n    await waitForRpsInRange(handler, lower, upper, 12_000);\n\n    const now = performance.now();\n    const measuredRps = handler.rpsInInterval(now - 2000, now);\n\n    abort.abort();\n    await invoke;\n\n    expect(measuredRps).toBeGreaterThanOrEqual(lower);\n    expect(measuredRps).toBeLessThanOrEqual(upper);\n  }, 30_000);\n\n  it(\"recovers send rate after temporary throttle blip (10k -> 20 -> 10k RPS)\", async () => {\n    const handler = new ThrottlingHandler(10_000);\n    const client = createClient(handler);\n    const abort = new AbortController();\n\n    setTimeout(() => handler.setRate(20), 2000);\n    setTimeout(() => handler.setRate(10_000), 4000);\n\n    const invoke = continuousInvoke(client, 15_000, 5, abort.signal);\n    await invoke;\n\n    const now = performance.now();\n    const recoveryRps = handler.rpsInInterval(now - 3000, now);\n    expect(recoveryRps).toBeGreaterThan(20);\n  }, 25_000);\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/service-error-classification/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/retry`.\n\n## 4.3.1\n\n### Patch Changes\n\n- 15f9e53: retry clock skew errors for freeze/thaw/drift situations\n\n## 4.3.0\n\n### Minor Changes\n\n- 60d13c8: include http refused stream as transient error for Node.js\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n\n## 4.1.2\n\n### Patch Changes\n\n- 937ac5a: make $retryable-trait errors considered transient in StandardRetryStrategyV2\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/types@4.4.0\n\n## 4.0.7\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.6\n\n### Patch Changes\n\n- c8d5bb2: Treat Node.js network errors as transient\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.3\n\n### Patch Changes\n\n- 89bde09: add browser connection issues as transient errors to retry on\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- b52b4e8: add support for error cause in transient error checks\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- dd0d9b4b: make clock skew correcting errors transient\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.1\n\n### Patch Changes\n\n- e6ea6bd5: move devDeps into deps\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.3\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.2\n\n### Patch Changes\n\n- c03ce2aa: Remove AbortError from the list of transient error codes\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/service-error-classification](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/service-error-classification/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/retry/service-error-classification/constants.ts",
    "content": "/**\n * Errors encountered when the client clock and server clock cannot agree on the\n * current time.\n *\n * These errors are retryable, assuming the SDK has enabled clock skew\n * correction.\n */\nexport const CLOCK_SKEW_ERROR_CODES = [\n  \"AuthFailure\",\n  \"InvalidSignatureException\",\n  \"RequestExpired\",\n  \"RequestInTheFuture\",\n  \"RequestTimeTooSkewed\",\n  \"SignatureDoesNotMatch\",\n];\n\n/**\n * Errors that indicate the SDK is being throttled.\n *\n * These errors are always retryable.\n */\nexport const THROTTLING_ERROR_CODES = [\n  \"BandwidthLimitExceeded\",\n  \"EC2ThrottledException\",\n  \"LimitExceededException\",\n  \"PriorRequestNotComplete\",\n  \"ProvisionedThroughputExceededException\",\n  \"RequestLimitExceeded\",\n  \"RequestThrottled\",\n  \"RequestThrottledException\",\n  \"SlowDown\",\n  \"ThrottledException\",\n  \"Throttling\",\n  \"ThrottlingException\",\n  \"TooManyRequestsException\",\n  \"TransactionInProgressException\", // DynamoDB\n];\n\n/**\n * Error codes that indicate transient issues\n */\nexport const TRANSIENT_ERROR_CODES = [\"TimeoutError\", \"RequestTimeout\", \"RequestTimeoutException\"];\n\n/**\n * Error codes that indicate transient issues\n */\nexport const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];\n\n/**\n * Node.js system error codes that indicate timeout.\n */\nexport const NODEJS_TIMEOUT_ERROR_CODES = [\"ECONNRESET\", \"ECONNREFUSED\", \"EPIPE\", \"ETIMEDOUT\"];\n\n/**\n * Node.js system error codes that indicate network error.\n */\nexport const NODEJS_NETWORK_ERROR_CODES = [\"EHOSTUNREACH\", \"ENETUNREACH\", \"ENOTFOUND\"];\n"
  },
  {
    "path": "packages/core/src/submodules/retry/service-error-classification/service-error-classification.spec.ts",
    "content": "import type { RetryableTrait, SdkError } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport {\n  CLOCK_SKEW_ERROR_CODES,\n  NODEJS_NETWORK_ERROR_CODES,\n  NODEJS_TIMEOUT_ERROR_CODES,\n  THROTTLING_ERROR_CODES,\n  TRANSIENT_ERROR_CODES,\n  TRANSIENT_ERROR_STATUS_CODES,\n} from \"./constants\";\nimport {\n  isClockSkewError,\n  isNodeJsHttp2TransientError,\n  isRetryableByTrait,\n  isServerError,\n  isThrottlingError,\n  isTransientError,\n} from \"./service-error-classification\";\n\nconst checkForErrorType = (\n  isErrorTypeFunc: (error: SdkError) => boolean,\n  options: {\n    name?: string;\n    httpStatusCode?: number;\n    $retryable?: RetryableTrait;\n    cause?: Partial<Error>;\n    code?: string;\n  },\n  errorTypeResult: boolean\n) => {\n  const { name, httpStatusCode, $retryable, cause, code } = options;\n  const error = Object.assign(new Error(), {\n    name,\n    $metadata: { httpStatusCode },\n    $retryable,\n    cause,\n    code,\n  });\n  expect(isErrorTypeFunc(error as SdkError)).toBe(errorTypeResult);\n};\n\ndescribe(\"isRetryableByTrait\", () => {\n  it(\"should declare error with $retryable set to be a Retryable by trait\", () => {\n    const $retryable = {};\n    checkForErrorType(isRetryableByTrait, { $retryable }, true);\n  });\n\n  it(\"should not declare error with $retryable not set to be a Retryable by trait\", () => {\n    checkForErrorType(isRetryableByTrait, {}, false);\n  });\n});\n\ndescribe(\"isClockSkewError\", () => {\n  CLOCK_SKEW_ERROR_CODES.forEach((name) => {\n    it(`should declare error with the name \"${name}\" to be a ClockSkew error`, () => {\n      checkForErrorType(isClockSkewError, { name }, true);\n    });\n  });\n\n  while (true) {\n    const name = Math.random().toString(36).substring(2);\n    if (!CLOCK_SKEW_ERROR_CODES.includes(name)) {\n      it(`should not declare error with the name \"${name}\" to be a ClockSkew error`, () => {\n        checkForErrorType(isClockSkewError, { name }, false);\n      });\n      break;\n    }\n  }\n});\n\ndescribe(\"isThrottlingError\", () => {\n  [429].forEach((httpStatusCode) => {\n    it(`should declare error with the HTTP Status Code \"${httpStatusCode}\" to be a Throttling error`, () => {\n      checkForErrorType(isTransientError, { httpStatusCode }, false);\n    });\n  });\n\n  THROTTLING_ERROR_CODES.forEach((name) => {\n    it(`should declare error with the name \"${name}\" to be a Throttling error`, () => {\n      checkForErrorType(isThrottlingError, { name }, true);\n    });\n  });\n\n  while (true) {\n    const name = Math.random().toString(36).substring(2);\n    if (!THROTTLING_ERROR_CODES.includes(name)) {\n      it(`should not declare error with the name \"${name}\" to be a Throttling error`, () => {\n        checkForErrorType(isThrottlingError, { name }, false);\n      });\n      break;\n    }\n  }\n\n  it(\"should declare error with $retryable.throttling set to true to be a Throttling error\", () => {\n    const $retryable = { throttling: true };\n    checkForErrorType(isThrottlingError, { $retryable }, true);\n  });\n\n  it(\"should not declare error with $retryable.throttling set to false to be a Throttling error\", () => {\n    const $retryable = { throttling: false };\n    checkForErrorType(isThrottlingError, { $retryable }, false);\n  });\n\n  it(\"should not declare error with $retryable.throttling not set to be a Throttling error\", () => {\n    const $retryable = {};\n    checkForErrorType(isThrottlingError, { $retryable }, false);\n  });\n});\n\ndescribe(\"isTransientError\", () => {\n  TRANSIENT_ERROR_CODES.forEach((name) => {\n    it(`should declare error with the name \"${name}\" to be a Transient error`, () => {\n      checkForErrorType(isTransientError, { name }, true);\n    });\n  });\n\n  TRANSIENT_ERROR_STATUS_CODES.forEach((httpStatusCode) => {\n    it(`should declare error with the HTTP Status Code \"${httpStatusCode}\" to be a Transient error`, () => {\n      checkForErrorType(isTransientError, { httpStatusCode }, true);\n    });\n  });\n\n  while (true) {\n    const name = Math.random().toString(36).substring(2);\n    if (!TRANSIENT_ERROR_CODES.includes(name)) {\n      it(`should not declare error with the name \"${name}\" to be a Transient error`, () => {\n        checkForErrorType(isTransientError, { name }, false);\n      });\n      break;\n    }\n  }\n\n  while (true) {\n    const httpStatusCode = Math.ceil(Math.random() * 10 ** 3);\n    if (!TRANSIENT_ERROR_STATUS_CODES.includes(httpStatusCode)) {\n      it(`should declare error with the HTTP Status Code \"${httpStatusCode}\" to be a Transient error`, () => {\n        checkForErrorType(isTransientError, { httpStatusCode }, false);\n      });\n      break;\n    }\n  }\n\n  TRANSIENT_ERROR_CODES.forEach((name) => {\n    it(`should declare error with cause with the name \"${name}\" to be a Transient error`, () => {\n      checkForErrorType(isTransientError, { cause: { name } }, true);\n    });\n  });\n\n  it(\"should limit recursion to 10 depth\", () => {\n    const error = { cause: null } as unknown as SdkError;\n    error.cause = error;\n    checkForErrorType(isTransientError, { cause: error }, false);\n  });\n\n  NODEJS_TIMEOUT_ERROR_CODES.forEach((code) => {\n    it(`should declare error with cause with the code \"${code}\" to be a Transient error`, () => {\n      checkForErrorType(isTransientError, { code }, true);\n    });\n  });\n\n  NODEJS_NETWORK_ERROR_CODES.forEach((code) => {\n    it(`should declare error with cause with the code \"${code}\" to be a Transient error`, () => {\n      checkForErrorType(isTransientError, { code }, true);\n    });\n  });\n});\n\ndescribe(\"isServerError\", () => {\n  [501, 505, 511].forEach((httpStatusCode) => {\n    it(`should declare error with the HTTP Status Code \"${httpStatusCode}\" to be a Server error`, () => {\n      checkForErrorType(isServerError, { httpStatusCode }, true);\n    });\n  });\n  TRANSIENT_ERROR_STATUS_CODES.forEach((httpStatusCode) => {\n    it(`should declare error with the HTTP Status Code \"${httpStatusCode}\" to not be be a Server error`, () => {\n      checkForErrorType(isServerError, { httpStatusCode }, false);\n    });\n  });\n});\n\ndescribe(\"isNodeJsHttp2TransientError\", () => {\n  it(\"should return true for ERR_HTTP2_STREAM_ERROR with NGHTTP2_REFUSED_STREAM\", () => {\n    const error = Object.assign(new Error(\"Stream closed with error code NGHTTP2_REFUSED_STREAM\"), {\n      code: \"ERR_HTTP2_STREAM_ERROR\",\n    });\n    expect(isNodeJsHttp2TransientError(error)).toBe(true);\n  });\n\n  it(\"should return false for unrelated errors\", () => {\n    const error = Object.assign(new Error(\"something else\"), { code: \"ECONNRESET\" });\n    expect(isNodeJsHttp2TransientError(error)).toBe(false);\n  });\n\n  it(\"should classify ERR_HTTP2_STREAM_ERROR with NGHTTP2_REFUSED_STREAM as transient via isTransientError\", () => {\n    const error = Object.assign(new Error(\"Stream closed with error code NGHTTP2_REFUSED_STREAM\"), {\n      code: \"ERR_HTTP2_STREAM_ERROR\",\n      $metadata: {},\n    });\n    expect(isTransientError(error as SdkError)).toBe(true);\n  });\n\n  it(\"should classify ERR_HTTP2_STREAM_ERROR with NGHTTP2_REFUSED_STREAM in cause as transient\", () => {\n    const cause = Object.assign(new Error(\"Stream closed with error code NGHTTP2_REFUSED_STREAM\"), {\n      code: \"ERR_HTTP2_STREAM_ERROR\",\n      $metadata: {},\n    });\n    const error = Object.assign(new Error(\"request failed\"), {\n      $metadata: {},\n      cause,\n    });\n    expect(isTransientError(error as SdkError)).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/service-error-classification/service-error-classification.ts",
    "content": "import type { SdkError } from \"@smithy/types\";\n\nimport {\n  CLOCK_SKEW_ERROR_CODES,\n  NODEJS_NETWORK_ERROR_CODES,\n  NODEJS_TIMEOUT_ERROR_CODES,\n  THROTTLING_ERROR_CODES,\n  TRANSIENT_ERROR_CODES,\n  TRANSIENT_ERROR_STATUS_CODES,\n} from \"./constants\";\n\nexport const isRetryableByTrait = (error: SdkError) => error?.$retryable !== undefined;\n\n/**\n * @deprecated use isClockSkewCorrectedError. This is only used in deprecated code.\n */\nexport const isClockSkewError = (error: SdkError) => CLOCK_SKEW_ERROR_CODES.includes(error.name);\n\n/**\n * @returns whether the error resulted in a systemClockOffset aka clock skew correction.\n */\nexport const isClockSkewCorrectedError = (error: SdkError) => error.$metadata?.clockSkewCorrected;\n\n/**\n *\n * @internal\n */\nexport const isBrowserNetworkError = (error: SdkError) => {\n  const errorMessages = new Set([\n    \"Failed to fetch\", // Chrome\n    \"NetworkError when attempting to fetch resource\", // Firefox\n    \"The Internet connection appears to be offline\", // Safari 16\n    \"Load failed\", // Safari 17+\n    \"Network request failed\", // `cross-fetch`\n  ]);\n\n  const isValid = error && error instanceof TypeError;\n\n  if (!isValid) {\n    return false;\n  }\n\n  return errorMessages.has(error.message);\n};\n\nexport const isThrottlingError = (error: SdkError) =>\n  error.$metadata?.httpStatusCode === 429 ||\n  THROTTLING_ERROR_CODES.includes(error.name) ||\n  error.$retryable?.throttling == true;\n\n/**\n * Though NODEJS_TIMEOUT_ERROR_CODES are platform specific, they are\n * included here because there is an error scenario with unknown root\n * cause where the NodeHttpHandler does not decorate the Error with\n * the name \"TimeoutError\" to be checked by the TRANSIENT_ERROR_CODES condition.\n */\nexport const isTransientError = (error: SdkError, depth = 0): boolean =>\n  isRetryableByTrait(error) ||\n  isClockSkewCorrectedError(error) ||\n  (error.name === \"InvalidSignatureException\" && error.message?.includes(\"Signature expired\")) ||\n  TRANSIENT_ERROR_CODES.includes(error.name) ||\n  NODEJS_TIMEOUT_ERROR_CODES.includes((error as { code?: string })?.code || \"\") ||\n  NODEJS_NETWORK_ERROR_CODES.includes((error as { code?: string })?.code || \"\") ||\n  TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) ||\n  isBrowserNetworkError(error) ||\n  isNodeJsHttp2TransientError(error) ||\n  (error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1));\n\nexport const isServerError = (error: SdkError) => {\n  if (error.$metadata?.httpStatusCode !== undefined) {\n    const statusCode = error.$metadata.httpStatusCode;\n    if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {\n      return true;\n    }\n    return false;\n  }\n  return false;\n};\n\n/**\n * @internal\n */\nexport function isNodeJsHttp2TransientError(error: Error & { code?: string }): boolean {\n  return error.code === \"ERR_HTTP2_STREAM_ERROR\" && error.message.includes(\"NGHTTP2_REFUSED_STREAM\");\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/AdaptiveRetryStrategy.spec.ts",
    "content": "import type { RetryErrorInfo, StandardRetryToken } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { AdaptiveRetryStrategy } from \"./AdaptiveRetryStrategy\";\nimport { DefaultRateLimiter } from \"./DefaultRateLimiter\";\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nimport { RETRY_MODES } from \"./config\";\nimport type { RateLimiter } from \"./types\";\n\nvi.mock(\"./StandardRetryStrategy\");\nvi.mock(\"./DefaultRateLimiter\");\n\ndescribe(AdaptiveRetryStrategy.name, () => {\n  const maxAttemptsProvider = vi.fn();\n  const retryTokenScope = \"scope\";\n  const mockDefaultRateLimiter = {\n    getSendToken: vi.fn(),\n    updateClientSendingRate: vi.fn(),\n  } as any;\n  const mockRetryToken: StandardRetryToken = {\n    getRetryCost: () => 1,\n    getRetryCount: () => 1,\n    getRetryDelay: () => 1,\n  };\n  const errorInfo = {\n    errorType: \"TRANSIENT\",\n  } as RetryErrorInfo;\n\n  beforeEach(() => {\n    vi.mocked(DefaultRateLimiter).mockReturnValue(mockDefaultRateLimiter);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(`sets mode=${RETRY_MODES.ADAPTIVE}`, () => {\n    const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider);\n    expect(retryStrategy.mode).toStrictEqual(RETRY_MODES.ADAPTIVE);\n  });\n\n  describe(\"rateLimiter init\", () => {\n    it(\"sets getDefaultrateLimiter if options is undefined\", () => {\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider);\n      expect(retryStrategy[\"rateLimiter\"]).toBe(mockDefaultRateLimiter);\n    });\n\n    it(\"sets DefaultRateLimiter if options.rateLimiter undefined\", () => {\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {});\n      expect(retryStrategy[\"rateLimiter\"]).toBe(mockDefaultRateLimiter);\n    });\n\n    it(\"sets options.rateLimiter if defined\", () => {\n      const rateLimiter = {} as RateLimiter;\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter,\n      });\n      expect(retryStrategy[\"rateLimiter\"]).toBe(rateLimiter);\n    });\n  });\n\n  describe(\"acquireInitialRetryToken\", () => {\n    it(\"calls rateLimiter.getSendToken and returns initial retry token \", async () => {\n      const mockedStandardRetryStrategy = vi.spyOn(StandardRetryStrategy.prototype, \"acquireInitialRetryToken\");\n      mockedStandardRetryStrategy.mockResolvedValue(mockRetryToken);\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      expect(mockDefaultRateLimiter.getSendToken).toHaveBeenCalledTimes(1);\n      expect(mockedStandardRetryStrategy).toHaveBeenCalledTimes(1);\n      expect(token).toStrictEqual(mockRetryToken);\n    });\n\n    it(\"resolves the token before calling getSendToken\", async () => {\n      const mockedStandardRetryStrategy = vi.spyOn(StandardRetryStrategy.prototype, \"acquireInitialRetryToken\");\n      let tokenResolved = false;\n      mockedStandardRetryStrategy.mockImplementation(\n        () =>\n          new Promise((resolve) =>\n            setTimeout(() => {\n              tokenResolved = true;\n              resolve(mockRetryToken);\n            }, 10)\n          )\n      );\n      mockDefaultRateLimiter.getSendToken.mockImplementation(() => {\n        expect(tokenResolved).toBe(true);\n        return Promise.resolve();\n      });\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      expect(token).toStrictEqual(mockRetryToken);\n    });\n  });\n\n  describe(\"refreshRetryTokenForRetry\", () => {\n    it(\"calls getSendToken, updateClientSendingRate, and refreshes retry token\", async () => {\n      const mockedStandardRetryStrategy = vi.spyOn(StandardRetryStrategy.prototype, \"refreshRetryTokenForRetry\");\n      mockedStandardRetryStrategy.mockResolvedValue(mockRetryToken);\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n      const token = await retryStrategy.refreshRetryTokenForRetry(mockRetryToken, errorInfo);\n      expect(mockDefaultRateLimiter.getSendToken).toHaveBeenCalledTimes(1);\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledTimes(1);\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledWith(errorInfo);\n      expect(mockedStandardRetryStrategy).toHaveBeenCalledTimes(1);\n      expect(mockedStandardRetryStrategy).toHaveBeenCalledWith(mockRetryToken, errorInfo);\n      expect(token).toStrictEqual(mockRetryToken);\n    });\n\n    it(\"resolves the token before calling getSendToken\", async () => {\n      let tokenResolved = false;\n      vi.spyOn(StandardRetryStrategy.prototype, \"refreshRetryTokenForRetry\").mockImplementation(\n        () =>\n          new Promise((resolve) =>\n            setTimeout(() => {\n              tokenResolved = true;\n              resolve(mockRetryToken);\n            }, 10)\n          )\n      );\n      mockDefaultRateLimiter.getSendToken.mockImplementation(() => {\n        expect(tokenResolved).toBe(true);\n        return Promise.resolve();\n      });\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n      const token = await retryStrategy.refreshRetryTokenForRetry(mockRetryToken, errorInfo);\n      expect(token).toStrictEqual(mockRetryToken);\n    });\n\n    it(\"calls updateClientSendingRate before getSendToken\", async () => {\n      const callOrder: string[] = [];\n      mockDefaultRateLimiter.getSendToken.mockImplementation(() => {\n        callOrder.push(\"getSendToken\");\n        return Promise.resolve();\n      });\n      mockDefaultRateLimiter.updateClientSendingRate.mockImplementation(() => {\n        callOrder.push(\"updateClientSendingRate\");\n      });\n      vi.spyOn(StandardRetryStrategy.prototype, \"refreshRetryTokenForRetry\").mockResolvedValue(mockRetryToken);\n\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n      await retryStrategy.refreshRetryTokenForRetry(mockRetryToken, errorInfo);\n      expect(callOrder).toEqual([\"updateClientSendingRate\", \"getSendToken\"]);\n    });\n\n    it(\"calls getSendToken for each retry in a multi-retry sequence\", async () => {\n      vi.spyOn(StandardRetryStrategy.prototype, \"refreshRetryTokenForRetry\").mockResolvedValue(mockRetryToken);\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n\n      await retryStrategy.refreshRetryTokenForRetry(mockRetryToken, errorInfo);\n      await retryStrategy.refreshRetryTokenForRetry(mockRetryToken, errorInfo);\n      await retryStrategy.refreshRetryTokenForRetry(mockRetryToken, errorInfo);\n\n      expect(mockDefaultRateLimiter.getSendToken).toHaveBeenCalledTimes(3);\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledTimes(3);\n    });\n  });\n\n  describe(\"recordSuccess\", () => {\n    it(\"rateLimiter.updateCientSendingRate and records success on token\", async () => {\n      const mockedStandardRetryStrategy = vi.spyOn(StandardRetryStrategy.prototype, \"recordSuccess\");\n      const retryStrategy = new AdaptiveRetryStrategy(maxAttemptsProvider, {\n        rateLimiter: mockDefaultRateLimiter,\n      });\n      retryStrategy.recordSuccess(mockRetryToken);\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledTimes(1);\n      expect(mockDefaultRateLimiter.updateClientSendingRate).toHaveBeenCalledWith({});\n      expect(mockedStandardRetryStrategy).toHaveBeenCalledTimes(1);\n      expect(mockedStandardRetryStrategy).toHaveBeenCalledWith(mockRetryToken);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/AdaptiveRetryStrategy.ts",
    "content": "import type { Provider, RetryErrorInfo, RetryStrategyV2, RetryToken, StandardRetryToken } from \"@smithy/types\";\n\nimport { DefaultRateLimiter } from \"./DefaultRateLimiter\";\nimport { StandardRetryStrategy, type StandardRetryStrategyOptions } from \"./StandardRetryStrategy\";\nimport { RETRY_MODES } from \"./config\";\nimport type { RateLimiter } from \"./types\";\n\n/**\n * Strategy options to be passed to AdaptiveRetryStrategy\n *\n * @public\n */\nexport interface AdaptiveRetryStrategyOptions extends Partial<StandardRetryStrategyOptions> {\n  rateLimiter?: RateLimiter;\n}\n\n/**\n * The AdaptiveRetryStrategy is a retry strategy for executing against a very\n * resource constrained set of resources. Care should be taken when using this\n * retry strategy. By default, it uses a dynamic backoff delay based on load\n * currently perceived against the downstream resource and performs circuit\n * breaking to disable retries in the event of high downstream failures using\n * the DefaultRateLimiter.\n *\n * @public\n *\n * @see {@link StandardRetryStrategy}\n * @see {@link DefaultRateLimiter }\n */\nexport class AdaptiveRetryStrategy implements RetryStrategyV2 {\n  public readonly mode: string = RETRY_MODES.ADAPTIVE;\n  private rateLimiter: RateLimiter;\n  private standardRetryStrategy: StandardRetryStrategy;\n\n  constructor(maxAttemptsProvider: number | Provider<number>, options?: AdaptiveRetryStrategyOptions) {\n    const { rateLimiter } = options ?? {};\n    this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();\n\n    this.standardRetryStrategy = options\n      ? new StandardRetryStrategy({\n          maxAttempts: typeof maxAttemptsProvider === \"number\" ? maxAttemptsProvider : 3,\n          ...options,\n        })\n      : new StandardRetryStrategy(maxAttemptsProvider as Provider<number>);\n  }\n\n  public async acquireInitialRetryToken(retryTokenScope: string): Promise<RetryToken> {\n    const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);\n    await this.rateLimiter.getSendToken();\n    return token;\n  }\n\n  public async refreshRetryTokenForRetry(\n    tokenToRenew: StandardRetryToken,\n    errorInfo: RetryErrorInfo\n  ): Promise<RetryToken> {\n    this.rateLimiter.updateClientSendingRate(errorInfo);\n    const token = await this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);\n    // called prior to return in case the token refresh throws (no need to wait in that case).\n    await this.rateLimiter.getSendToken();\n    return token;\n  }\n\n  public recordSuccess(token: StandardRetryToken): void {\n    this.rateLimiter.updateClientSendingRate({});\n    this.standardRetryStrategy.recordSuccess(token);\n  }\n\n  /**\n   * There is an existing integration which accesses this field.\n   * @deprecated\n   */\n  public async maxAttemptsProvider(): Promise<number> {\n    return this.standardRetryStrategy.maxAttempts();\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/retry`.\n\n## 4.3.7\n\n### Patch Changes\n\n- add missing await to token acquisition in AdaptiveRetryStrategy\n\n## 4.3.6\n\n### Patch Changes\n\n- 2e5142c: add a missing call to getSendToken in Adaptive mode retries\n- 9c88c10: adaptive retry fixes for checking capacity during the rate limiter waiting step\n\n## 4.3.5\n\n### Patch Changes\n\n- Updated dependencies [15f9e53]\n  - @smithy/service-error-classification@4.3.1\n\n## 4.3.4\n\n### Patch Changes\n\n- b877fc2: refine conditions for long poll backoff in v2026 retry behavior\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [60d13c8]\n  - @smithy/service-error-classification@4.3.0\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/service-error-classification@4.2.14\n\n## 4.3.1\n\n### Patch Changes\n\n- a45aaf5: add maxAttempts and maxAttemptsProvider public methods to StandardRetryStrategy/AdaptiveRetryStrategy\n\n## 4.3.0\n\n### Minor Changes\n\n- cffd868: Introduce default retry behavior modifications slated for 2026. They are:\n  less time between server error retries, but slightly more time between throttling errors. Lower retry capacity consumption for throttling, and improved parsing of the retry-after and x-amz-retry-after headers.\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/service-error-classification@4.2.13\n\n## 4.2.13\n\n### Patch Changes\n\n- 3c21a57: fix AdaptiveRetryStrategy throttling detection\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/service-error-classification@4.2.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/service-error-classification@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/service-error-classification@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/service-error-classification@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/service-error-classification@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/service-error-classification@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/service-error-classification@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/service-error-classification@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/service-error-classification@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/service-error-classification@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/service-error-classification@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/service-error-classification@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/service-error-classification@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.1.2\n\n### Patch Changes\n\n- 937ac5a: make $retryable-trait errors considered transient in StandardRetryStrategyV2\n- Updated dependencies [937ac5a]\n  - @smithy/service-error-classification@4.1.2\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/service-error-classification@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/service-error-classification@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.7\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/service-error-classification@4.0.7\n\n## 4.0.6\n\n### Patch Changes\n\n- Updated dependencies [c8d5bb2]\n  - @smithy/service-error-classification@4.0.6\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/service-error-classification@4.0.5\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/service-error-classification@4.0.4\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [89bde09]\n  - @smithy/service-error-classification@4.0.3\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/service-error-classification@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/service-error-classification@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/service-error-classification@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/service-error-classification@3.0.11\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/service-error-classification@3.0.10\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/service-error-classification@3.0.9\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/service-error-classification@3.0.8\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/service-error-classification@3.0.7\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/service-error-classification@3.0.6\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/service-error-classification@3.0.5\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/service-error-classification@3.0.4\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/service-error-classification@3.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/service-error-classification@3.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/service-error-classification@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/service-error-classification@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n  - @smithy/service-error-classification@2.1.5\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/service-error-classification@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/service-error-classification@2.1.3\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/service-error-classification@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/service-error-classification@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/service-error-classification@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/service-error-classification@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/service-error-classification@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/service-error-classification@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/service-error-classification@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/service-error-classification@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/service-error-classification@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/service-error-classification@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/service-error-classification@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- e6ea6bd5: move devDeps into deps\n- Updated dependencies [fbfeebee]\n- Updated dependencies [e6ea6bd5]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/service-error-classification@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/service-error-classification@2.0.0\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/service-error-classification@1.1.0\n\n## 1.0.4\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/service-error-classification@1.0.3\n\n## 1.0.3\n\n### Patch Changes\n\n- 170ac764: fix error in documentation\n- Updated dependencies [c03ce2aa]\n  - @smithy/service-error-classification@1.0.2\n\n## 1.0.2\n\n### Patch Changes\n\n- d4dbe242: Fix attempts count on StandardRetryStrategy\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/service-error-classification@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-retry](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-retry/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/ConfiguredRetryStrategy.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { ConfiguredRetryStrategy } from \"./ConfiguredRetryStrategy\";\n\ndescribe(ConfiguredRetryStrategy.name, () => {\n  it(\"allows setting a custom backoff function\", async () => {\n    const strategy = new ConfiguredRetryStrategy(5, (attempt) => attempt * 1000);\n\n    const token = await strategy.acquireInitialRetryToken(\"\");\n    token.getRetryCount = () => 3;\n\n    const retryToken = await strategy.refreshRetryTokenForRetry(token, {\n      errorType: \"TRANSIENT\",\n    });\n\n    expect(retryToken.getRetryCount()).toBe(4);\n    expect(retryToken.getRetryDelay()).toBe(4000);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/ConfiguredRetryStrategy.ts",
    "content": "import type {\n  Provider,\n  RetryBackoffStrategy,\n  RetryErrorInfo,\n  RetryStrategyV2,\n  StandardRetryToken,\n} from \"@smithy/types\";\n\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nimport { Retry } from \"./retries-2026-config\";\n\n/**\n * This extension of the StandardRetryStrategy allows customizing the\n * backoff computation.\n *\n * @public\n */\nexport class ConfiguredRetryStrategy extends StandardRetryStrategy implements RetryStrategyV2 {\n  private readonly computeNextBackoffDelay: (attempt: number) => number;\n\n  /**\n   * @param maxAttempts - the maximum number of retry attempts allowed.\n   *                      e.g., if set to 3, then 4 total requests are possible.\n   * @param computeNextBackoffDelay - a millisecond delay for each retry or a function that takes the retry attempt\n   *                                  and returns the delay.\n   *\n   * @example exponential backoff.\n   * ```js\n   * new Client({\n   *   retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2)\n   * });\n   * ```\n   * @example constant delay.\n   * ```js\n   * new Client({\n   *   retryStrategy: new ConfiguredRetryStrategy(3, 2000)\n   * });\n   * ```\n   */\n  public constructor(\n    maxAttempts: number | Provider<number>,\n    computeNextBackoffDelay: number | RetryBackoffStrategy[\"computeNextBackoffDelay\"] = Retry.delay()\n  ) {\n    super(typeof maxAttempts === \"function\" ? maxAttempts : async () => maxAttempts);\n    if (typeof computeNextBackoffDelay === \"number\") {\n      this.computeNextBackoffDelay = () => computeNextBackoffDelay;\n    } else {\n      this.computeNextBackoffDelay = computeNextBackoffDelay;\n    }\n  }\n\n  public async refreshRetryTokenForRetry(\n    tokenToRenew: StandardRetryToken,\n    errorInfo: RetryErrorInfo\n  ): Promise<StandardRetryToken> {\n    const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo);\n    token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount());\n    return token;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/DefaultRateLimiter.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { isThrottlingError } from \"../service-error-classification/service-error-classification\";\nimport { DefaultRateLimiter } from \"./DefaultRateLimiter\";\n\nvi.mock(\"../service-error-classification/service-error-classification\");\n\ndescribe(DefaultRateLimiter.name, () => {\n  beforeEach(() => {\n    vi.mocked(isThrottlingError).mockReturnValue(false);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"getSendToken\", () => {\n    beforeEach(() => {\n      vi.useFakeTimers();\n    });\n\n    afterEach(() => {\n      vi.useRealTimers();\n    });\n\n    it.each([\n      [0.5, 892.8571428571428],\n      [1, 1785.7142857142856],\n      [2, 2000],\n    ])(\"timestamp: %d, delay: %d\", async (timestamp, delay) => {\n      const spy = vi.spyOn(DefaultRateLimiter as any, \"setTimeoutFn\");\n      vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n      const rateLimiter = new DefaultRateLimiter();\n\n      vi.mocked(isThrottlingError).mockReturnValueOnce(true);\n      vi.spyOn(Date, \"now\").mockImplementation(() => timestamp * 1000);\n      rateLimiter.updateClientSendingRate({});\n\n      rateLimiter.getSendToken();\n      vi.runAllTimers();\n      expect(spy).toHaveBeenLastCalledWith(expect.any(Function), delay);\n    });\n  });\n\n  describe(\"cubicSuccess\", () => {\n    it.each([\n      [5, 7],\n      [6, 9.64893601],\n      [7, 10.00003085],\n      [8, 10.45328452],\n      [9, 13.40869703],\n      [10, 21.26626836],\n      [11, 36.42599853],\n    ])(\"timestamp: %d, calculatedRate: %d\", (timestamp, calculatedRate) => {\n      vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n      const rateLimiter = new DefaultRateLimiter();\n      rateLimiter[\"lastMaxRate\"] = 10;\n      rateLimiter[\"lastThrottleTime\"] = 5;\n\n      vi.spyOn(Date, \"now\").mockImplementation(() => timestamp * 1000);\n\n      const cubicSuccessSpy = vi.spyOn(DefaultRateLimiter.prototype as any, \"cubicSuccess\");\n      rateLimiter.updateClientSendingRate({});\n      expect(cubicSuccessSpy).toHaveLastReturnedWith(calculatedRate);\n    });\n  });\n\n  describe(\"cubicThrottle\", () => {\n    it.each([\n      [5, 0.112],\n      [6, 0.09333333],\n      [7, 0.08],\n      [8, 0.07],\n      [9, 0.06222222],\n    ])(\"timestamp: %d, calculatedRate: %d\", (timestamp, calculatedRate) => {\n      vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n      const rateLimiter = new DefaultRateLimiter();\n      rateLimiter[\"lastMaxRate\"] = 10;\n      rateLimiter[\"lastThrottleTime\"] = 5;\n\n      vi.mocked(isThrottlingError).mockReturnValueOnce(true);\n      vi.spyOn(Date, \"now\").mockImplementation(() => timestamp * 1000);\n      const cubicThrottleSpy = vi.spyOn(DefaultRateLimiter.prototype as any, \"cubicThrottle\");\n      rateLimiter.updateClientSendingRate({});\n      expect(cubicThrottleSpy).toHaveLastReturnedWith(calculatedRate);\n    });\n  });\n\n  it(\"detects throttling from an error with status code 429 or $retryable.throttling\", async () => {\n    const { isThrottlingError: realIsThrottlingError } = await vi.importActual<any>(\n      \"@smithy/service-error-classification\"\n    );\n\n    vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n\n    for (const error of [\n      { name: \"ThrottlingStatusCodeException\", $metadata: { httpStatusCode: 429 } },\n      { name: \"ThrottlingModelMetadataException\", $retryable: { throttling: true } },\n    ]) {\n      const rateLimiter = new DefaultRateLimiter();\n      vi.mocked(isThrottlingError).mockImplementation(realIsThrottlingError);\n      vi.spyOn(Date, \"now\").mockImplementation(() => 1000);\n      rateLimiter.updateClientSendingRate({ errorType: \"TRANSIENT\", error } as any);\n      expect(rateLimiter[\"enabled\"]).toBe(true);\n    }\n  });\n\n  it(\"treats a RetryErrorInfo with errorType THROTTLING as a throttling error\", () => {\n    vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n    const rateLimiter = new DefaultRateLimiter();\n\n    vi.spyOn(Date, \"now\").mockImplementation(() => 1000);\n    rateLimiter.updateClientSendingRate({ errorType: \"THROTTLING\" });\n\n    expect(rateLimiter[\"enabled\"]).toBe(true);\n    expect(isThrottlingError).not.toHaveBeenCalled();\n  });\n\n  describe(\"acquireTokenBucket re-checks after sleep\", () => {\n    it(\"availableTokens is never negative after acquire\", async () => {\n      vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n      const rateLimiter = new DefaultRateLimiter();\n\n      // Enable the rate limiter with a throttle.\n      vi.mocked(isThrottlingError).mockReturnValueOnce(true);\n      vi.spyOn(Date, \"now\").mockImplementation(() => 1000);\n      rateLimiter.updateClientSendingRate({});\n\n      // Drain tokens to force a sleep path.\n      rateLimiter[\"availableTokens\"] = 0.1;\n      rateLimiter[\"fillRate\"] = 10;\n      rateLimiter[\"lastTimestamp\"] = 1;\n\n      // Time advances during the sleep so refill provides tokens.\n      let now = 1000;\n      vi.spyOn(Date, \"now\").mockImplementation(() => now);\n      const spy = vi.spyOn(DefaultRateLimiter as any, \"setTimeoutFn\");\n      spy.mockImplementation((resolve: any) => {\n        now += 200; // 200ms passes during sleep\n        resolve();\n      });\n\n      await rateLimiter.getSendToken();\n      expect(rateLimiter[\"availableTokens\"]).toBeGreaterThanOrEqual(0);\n    });\n\n    it(\"loops when fill rate decreases during sleep\", async () => {\n      vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n      const rateLimiter = new DefaultRateLimiter();\n\n      // Enable the rate limiter.\n      vi.mocked(isThrottlingError).mockReturnValueOnce(true);\n      vi.spyOn(Date, \"now\").mockImplementation(() => 1000);\n      rateLimiter.updateClientSendingRate({});\n\n      rateLimiter[\"availableTokens\"] = 0;\n      rateLimiter[\"fillRate\"] = 10;\n      rateLimiter[\"maxCapacity\"] = 10;\n      rateLimiter[\"lastTimestamp\"] = 1;\n\n      let now = 1000;\n      vi.spyOn(Date, \"now\").mockImplementation(() => now);\n\n      let callCount = 0;\n      const spy = vi.spyOn(DefaultRateLimiter as any, \"setTimeoutFn\");\n      spy.mockImplementation((resolve: any) => {\n        callCount++;\n        now += 50; // 50ms passes\n        if (callCount === 1) {\n          // Simulate rate dropping mid-sleep (e.g. concurrent throttle response).\n          rateLimiter[\"fillRate\"] = 0.5;\n          rateLimiter[\"maxCapacity\"] = 1;\n        }\n        resolve();\n      });\n\n      await rateLimiter.getSendToken();\n\n      // Should have looped more than once because the first sleep\n      // didn't provide enough tokens after the rate drop.\n      expect(callCount).toBeGreaterThan(1);\n      expect(rateLimiter[\"availableTokens\"]).toBeGreaterThanOrEqual(0);\n    });\n\n    it(\"refills token bucket after each sleep iteration\", async () => {\n      vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n      const rateLimiter = new DefaultRateLimiter();\n\n      // Enable the rate limiter.\n      vi.mocked(isThrottlingError).mockReturnValueOnce(true);\n      vi.spyOn(Date, \"now\").mockImplementation(() => 1000);\n      rateLimiter.updateClientSendingRate({});\n\n      rateLimiter[\"availableTokens\"] = 0;\n      rateLimiter[\"fillRate\"] = 2;\n      rateLimiter[\"maxCapacity\"] = 2;\n      rateLimiter[\"lastTimestamp\"] = 1;\n\n      let now = 1000;\n      vi.spyOn(Date, \"now\").mockImplementation(() => now);\n\n      const refillSpy = vi.spyOn(rateLimiter as any, \"refillTokenBucket\");\n      const spy = vi.spyOn(DefaultRateLimiter as any, \"setTimeoutFn\");\n      spy.mockImplementation((resolve: any) => {\n        now += 600; // enough time for refill to provide tokens\n        resolve();\n      });\n\n      await rateLimiter.getSendToken();\n\n      // refillTokenBucket called: once before the loop + once inside the loop\n      expect(refillSpy).toHaveBeenCalledTimes(2);\n    });\n  });\n\n  it(\"updateClientSendingRate\", () => {\n    vi.spyOn(Date, \"now\").mockImplementation(() => 0);\n    const rateLimiter = new DefaultRateLimiter();\n\n    const testCases: [boolean, number, number, number][] = [\n      [false, 0.2, 0, 0.5],\n      [false, 0.4, 0, 0.5],\n      [false, 0.6, 4.8, 0.5],\n      [false, 0.8, 4.8, 0.5],\n      [false, 1, 4.16, 0.5],\n      [false, 1.2, 4.16, 0.6912],\n      [false, 1.4, 4.16, 1.0976],\n      [false, 1.6, 5.632, 1.6384],\n      [false, 1.8, 5.632, 2.3328],\n      [true, 2, 4.3264, 3.02848],\n      [false, 2.2, 4.3264, 3.486639],\n      [false, 2.4, 4.3264, 3.821874],\n      [false, 2.6, 5.66528, 4.053386],\n      [false, 2.8, 5.66528, 4.200373],\n      [false, 3.0, 4.333056, 4.282037],\n      [true, 3.2, 4.333056, 2.997426],\n      [false, 3.4, 4.333056, 3.452226],\n    ];\n\n    testCases.forEach(([isThrottlingErrorReturn, timestamp, measuredTxRate, fillRate]) => {\n      vi.mocked(isThrottlingError).mockReturnValue(isThrottlingErrorReturn);\n      vi.spyOn(Date, \"now\").mockImplementation(() => timestamp * 1000);\n\n      rateLimiter.updateClientSendingRate({});\n      expect(rateLimiter[\"measuredTxRate\"]).toEqual(measuredTxRate);\n      expect(parseFloat(rateLimiter[\"fillRate\"].toFixed(6))).toEqual(fillRate);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/DefaultRateLimiter.ts",
    "content": "import type { RetryErrorInfo } from \"@smithy/types\";\n\nimport { isThrottlingError } from \"../service-error-classification/service-error-classification\";\nimport type { RateLimiter } from \"./types\";\n\n/**\n * @public\n */\nexport interface DefaultRateLimiterOptions {\n  /**\n   * Coefficient for controlling how aggressively the rate decreases on throttle.\n   * @defaultValue 0.7\n   */\n  beta?: number;\n  /**\n   * Minimum token bucket capacity in adaptive-tokens.\n   * @defaultValue 1\n   */\n  minCapacity?: number;\n  /**\n   * Minimum fill rate in adaptive-tokens per second.\n   * @defaultValue 0.5\n   */\n  minFillRate?: number;\n  /**\n   * Scale constant used in the cubic rate calculation.\n   * @defaultValue 0.4\n   */\n  scaleConstant?: number;\n  /**\n   * Smoothing factor for the exponential moving average of the measured send rate.\n   * @defaultValue 0.8\n   */\n  smooth?: number;\n}\n\n/**\n * @public\n */\nexport class DefaultRateLimiter implements RateLimiter {\n  /**\n   * Only used in testing.\n   */\n  private static setTimeoutFn = setTimeout;\n\n  // User configurable constants\n  private readonly beta: number;\n  private readonly minCapacity: number;\n  private readonly minFillRate: number;\n  private readonly scaleConstant: number;\n  private readonly smooth: number;\n\n  /**\n   * Whether adaptive retry rate limiting is active.\n   * Remains `false` until a throttling error is detected.\n   */\n  private enabled = false;\n  /**\n   * Current number of available adaptive-tokens. When exhausted, requests wait based on fill rate.\n   */\n  private availableTokens = 0;\n  /**\n   * The most recent maximum fill rate in adaptive-tokens per second, recorded at the last throttle event.\n   */\n  private lastMaxRate = 0;\n  /**\n   * Smoothed measured send rate in requests per second.\n   */\n  private measuredTxRate = 0;\n  /**\n   * Number of requests observed in the current measurement time bucket.\n   */\n  private requestCount = 0;\n\n  /**\n   * Current token bucket fill rate in adaptive-tokens per second. Defaults to {@link minFillRate}.\n   */\n  private fillRate: number;\n  /**\n   * Timestamp in seconds of the most recent throttle event.\n   */\n  private lastThrottleTime: number;\n  /**\n   * Timestamp in seconds of the last token bucket refill.\n   */\n  private lastTimestamp = 0;\n  /**\n   * The time bucket (in seconds) used for measuring the send rate.\n   */\n  private lastTxRateBucket: number;\n  /**\n   * Maximum token bucket capacity in adaptive-tokens. Defaults to {@link minCapacity}.\n   * Updated in {@link updateTokenBucketRate} to match the new fill rate, floored by {@link minCapacity}.\n   */\n  private maxCapacity: number;\n  /**\n   * Calculated time window in seconds used in the cubic rate recovery function.\n   */\n  private timeWindow = 0;\n\n  public constructor(options?: DefaultRateLimiterOptions) {\n    this.beta = options?.beta ?? 0.7;\n    this.minCapacity = options?.minCapacity ?? 1;\n    this.minFillRate = options?.minFillRate ?? 0.5;\n    this.scaleConstant = options?.scaleConstant ?? 0.4;\n    this.smooth = options?.smooth ?? 0.8;\n\n    this.lastThrottleTime = this.getCurrentTimeInSeconds();\n    this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());\n\n    this.fillRate = this.minFillRate;\n    this.maxCapacity = this.minCapacity;\n  }\n\n  public async getSendToken() {\n    return this.acquireTokenBucket(1);\n  }\n\n  public updateClientSendingRate(response: any) {\n    /**\n     * New fill rate in adaptive-tokens per second, derived from\n     * {@link cubicThrottle} on throttle or {@link cubicSuccess} otherwise.\n     */\n    let calculatedRate: number;\n    this.updateMeasuredRate();\n\n    const retryErrorInfo = response as RetryErrorInfo;\n    const isThrottling =\n      retryErrorInfo?.errorType === \"THROTTLING\" || isThrottlingError(retryErrorInfo?.error ?? response);\n\n    if (isThrottling) {\n      const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);\n      this.lastMaxRate = rateToUse;\n      this.calculateTimeWindow();\n      this.lastThrottleTime = this.getCurrentTimeInSeconds();\n      calculatedRate = this.cubicThrottle(rateToUse);\n      this.enableTokenBucket();\n    } else {\n      this.calculateTimeWindow();\n      calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());\n    }\n\n    const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);\n    this.updateTokenBucketRate(newRate);\n  }\n\n  private getCurrentTimeInSeconds() {\n    return Date.now() / 1000;\n  }\n\n  private async acquireTokenBucket(amount: number) {\n    // Client side throttling is not enabled until we see a throttling error.\n    if (!this.enabled) {\n      return;\n    }\n\n    this.refillTokenBucket();\n\n    while (amount > this.availableTokens) {\n      const delay = ((amount - this.availableTokens) / this.fillRate) * 1000;\n      await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));\n      this.refillTokenBucket();\n    }\n    this.availableTokens = this.availableTokens - amount;\n  }\n\n  private refillTokenBucket() {\n    const timestamp = this.getCurrentTimeInSeconds();\n    if (!this.lastTimestamp) {\n      this.lastTimestamp = timestamp;\n      return;\n    }\n\n    const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;\n    this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount);\n    this.lastTimestamp = timestamp;\n  }\n\n  private calculateTimeWindow() {\n    this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3));\n  }\n\n  /**\n   * Returns a new fill rate in adaptive-tokens per second by reducing\n   * the given rate by a factor of {@link beta}.\n   */\n  private cubicThrottle(rateToUse: number) {\n    return this.getPrecise(rateToUse * this.beta);\n  }\n\n  /**\n   * Returns a new fill rate in adaptive-tokens per second using a CUBIC\n   * congestion control curve. The rate recovers toward {@link lastMaxRate},\n   * then continues growing beyond it. The caller caps the result at\n   * `2 * measuredTxRate`.\n   */\n  private cubicSuccess(timestamp: number) {\n    return this.getPrecise(\n      this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate\n    );\n  }\n\n  private enableTokenBucket() {\n    this.enabled = true;\n  }\n\n  /**\n   * Set a new fill rate for adaptive-tokens.\n   * The max capacity is updated to allow for one second of time to approximately\n   * refill the adaptive-token capacity.\n   */\n  private updateTokenBucketRate(newRate: number) {\n    // Refill based on our current rate before we update to the new fill rate.\n    this.refillTokenBucket();\n\n    this.fillRate = Math.max(newRate, this.minFillRate);\n    this.maxCapacity = Math.max(newRate, this.minCapacity);\n\n    // When we scale down we can't have a current capacity that exceeds our maxCapacity.\n    this.availableTokens = Math.min(this.availableTokens, this.maxCapacity);\n  }\n\n  private updateMeasuredRate() {\n    const t = this.getCurrentTimeInSeconds();\n    const timeBucket = Math.floor(t * 2) / 2;\n    this.requestCount++;\n\n    if (timeBucket > this.lastTxRateBucket) {\n      const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);\n      this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));\n      this.requestCount = 0;\n      this.lastTxRateBucket = timeBucket;\n    }\n  }\n\n  private getPrecise(num: number) {\n    return parseFloat(num.toFixed(8));\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/DefaultRetryBackoffStrategy.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { DefaultRetryBackoffStrategy } from \"./DefaultRetryBackoffStrategy\";\nimport { MAXIMUM_RETRY_DELAY } from \"./constants\";\nimport { Retry } from \"./retries-2026-config\";\n\ndescribe(\"defaultRetryBackoffStrategy\", () => {\n  const mathDotRandom = Math.random;\n\n  beforeEach(() => {\n    Math.random = vi.fn().mockReturnValue(1);\n  });\n\n  afterEach(() => {\n    Math.random = mathDotRandom;\n  });\n\n  describe(`uses ${Retry.delay()} by default`, () => {\n    [0, 1, 2, 3].forEach((attempts) => {\n      const expectedDelay = Math.floor(2 ** attempts * Retry.delay());\n      const retryBackoffStrategy = new DefaultRetryBackoffStrategy();\n      it(`(${attempts}) returns ${expectedDelay}`, () => {\n        expect(retryBackoffStrategy.computeNextBackoffDelay(attempts)).toBe(expectedDelay);\n      });\n    });\n  });\n\n  describe(\"retry delay increases exponentially with attempt number\", () => {\n    [0, 1, 2, 3].forEach((attempts) => {\n      const mockDelayBase = 50;\n      const expectedDelay = Math.floor(2 ** attempts * mockDelayBase);\n      const retryBackoffStrategy = new DefaultRetryBackoffStrategy();\n      retryBackoffStrategy.setDelayBase(mockDelayBase);\n      it(`(${attempts}) returns ${expectedDelay}`, () => {\n        expect(retryBackoffStrategy.computeNextBackoffDelay(attempts)).toBe(expectedDelay);\n      });\n    });\n  });\n\n  describe(`caps retry delay at ${MAXIMUM_RETRY_DELAY / 1000} seconds`, () => {\n    const retryBackoffStrategy = new DefaultRetryBackoffStrategy();\n    it(\"when value exceeded because of high delayBase\", () => {\n      retryBackoffStrategy.setDelayBase(MAXIMUM_RETRY_DELAY + 1);\n      expect(retryBackoffStrategy.computeNextBackoffDelay(0)).toBe(MAXIMUM_RETRY_DELAY);\n      retryBackoffStrategy.setDelayBase(MAXIMUM_RETRY_DELAY + 2);\n      expect(retryBackoffStrategy.computeNextBackoffDelay(0)).toBe(MAXIMUM_RETRY_DELAY);\n    });\n\n    it(\"when value exceeded because of high attempts number\", () => {\n      const largeAttemptsNumber = Math.ceil(Math.log2(MAXIMUM_RETRY_DELAY));\n      retryBackoffStrategy.setDelayBase(1);\n      expect(retryBackoffStrategy.computeNextBackoffDelay(largeAttemptsNumber)).toBe(MAXIMUM_RETRY_DELAY);\n      expect(retryBackoffStrategy.computeNextBackoffDelay(largeAttemptsNumber + 1)).toBe(MAXIMUM_RETRY_DELAY);\n    });\n  });\n\n  describe(\"randomizes the retry delay value\", () => {\n    const retryBackoffStrategy = new DefaultRetryBackoffStrategy();\n    Array.from({ length: 3 }, () => Math.random()).forEach((mockRandomValue) => {\n      const attempts = 0;\n      const delayBase = 100;\n      const expectedDelay = Math.floor(mockRandomValue * 2 ** attempts * delayBase);\n      retryBackoffStrategy.setDelayBase(delayBase);\n      it(`(${delayBase}, ${attempts}) with mock Math.random=${mockRandomValue} returns ${expectedDelay}`, () => {\n        Math.random = vi.fn().mockReturnValue(mockRandomValue);\n        expect(retryBackoffStrategy.computeNextBackoffDelay(attempts)).toBe(expectedDelay);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/DefaultRetryBackoffStrategy.ts",
    "content": "import type { StandardRetryBackoffStrategy } from \"@smithy/types\";\n\nimport { MAXIMUM_RETRY_DELAY } from \"./constants\";\nimport { Retry } from \"./retries-2026-config\";\n\n/**\n * @internal\n */\nexport class DefaultRetryBackoffStrategy implements StandardRetryBackoffStrategy {\n  protected x: number = Retry.delay();\n\n  /**\n   * @param i - attempt count starting from zero.\n   */\n  public computeNextBackoffDelay(i: number): number {\n    // These values are named after the variables present in the spec\n    // for easier cross-checking.\n    const b = Math.random();\n    const r = 2;\n    const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY);\n    return Math.floor(t_i);\n  }\n\n  public setDelayBase(delay: number): void {\n    this.x = delay;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/DefaultRetryToken.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { DefaultRetryToken } from \"./DefaultRetryToken\";\nimport { MAXIMUM_RETRY_DELAY } from \"./constants\";\nimport { Retry } from \"./retries-2026-config\";\n\nvi.mock(\"./defaultRetryBackoffStrategy\");\n\ndescribe(\"defaultRetryToken\", () => {\n  describe(\"getRetryCost\", () => {\n    it(\"is undefined before an error is encountered\", () => {\n      const retryToken = new DefaultRetryToken(Retry.delay(), 0, undefined, false);\n      expect(retryToken.getRetryCost()).toBeUndefined();\n    });\n\n    it(\"returns set value\", () => {\n      const retryToken = new DefaultRetryToken(Retry.delay(), 0, 25, false);\n      expect(retryToken.getRetryCost()).toBe(25);\n    });\n  });\n\n  describe(\"getRetryCount\", () => {\n    it(\"returns amount set when token is created\", () => {\n      const retryCount = 3;\n      const retryToken = new DefaultRetryToken(Retry.delay(), retryCount, 0, false);\n      expect(retryToken.getRetryCount()).toBe(retryCount);\n    });\n  });\n\n  describe(\"getRetryDelay\", () => {\n    it(\"returns initial delay\", () => {\n      const retryToken = new DefaultRetryToken(Retry.delay(), 0, 0, false);\n      expect(retryToken.getRetryDelay()).toBe(Retry.delay());\n    });\n\n    describe(`caps retry delay at ${MAXIMUM_RETRY_DELAY / 1000} seconds`, () => {\n      it(\"when value exceeded because of high delayBase\", () => {\n        const retryToken = new DefaultRetryToken(Retry.delay() * 1000, 0, 0, false);\n        expect(retryToken.getRetryDelay()).toBe(MAXIMUM_RETRY_DELAY);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/DefaultRetryToken.ts",
    "content": "import type { StandardRetryToken } from \"@smithy/types\";\n\nimport { MAXIMUM_RETRY_DELAY } from \"./constants\";\n\n/**\n * @internal\n */\nexport class DefaultRetryToken implements StandardRetryToken {\n  public constructor(\n    private readonly delay: number,\n    private readonly count: number,\n    private readonly cost: number | undefined,\n    private readonly longPoll: boolean\n  ) {}\n\n  public getRetryCount(): number {\n    return this.count;\n  }\n\n  public getRetryDelay(): number {\n    return Math.min(MAXIMUM_RETRY_DELAY, this.delay);\n  }\n\n  public getRetryCost(): number | undefined {\n    return this.cost;\n  }\n\n  public isLongPoll(): boolean {\n    return this.longPoll;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/StandardRetryStrategy.spec.ts",
    "content": "import type { RetryErrorInfo } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { DefaultRetryBackoffStrategy } from \"./DefaultRetryBackoffStrategy\";\nimport { DefaultRetryToken } from \"./DefaultRetryToken\";\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nimport { RETRY_MODES } from \"./config\";\nimport { MAXIMUM_RETRY_DELAY } from \"./constants\";\nimport { Retry } from \"./retries-2026-config\";\n\nclass DeterministicRetryBackoffStrategy extends DefaultRetryBackoffStrategy {\n  public computeNextBackoffDelay(i: number): number {\n    const b = 1; // maximum instead of Math.random()\n    const r = 2;\n    const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY);\n    return Math.floor(t_i);\n  }\n}\n\nvi.mock(\"./DefaultRetryToken\");\n\ndescribe(StandardRetryStrategy.name, () => {\n  const maxAttempts = 3;\n  const retryTokenScope = \"scope\";\n  const noRetryTokenAvailableError = new Error(\"No retry token available\");\n  const errorInfo = { errorType: \"TRANSIENT\" } as RetryErrorInfo;\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"sets maxAttemptsProvider as a class member variable\", async () => {\n    for (const maxAttempts of [1, 2, 3]) {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      await expect(retryStrategy[\"maxAttemptsProvider\"]()).resolves.toBe(maxAttempts);\n    }\n  });\n\n  it(`sets mode=${RETRY_MODES.STANDARD}`, () => {\n    const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n    expect(retryStrategy.mode).toStrictEqual(RETRY_MODES.STANDARD);\n  });\n\n  describe(\"acquireInitialRetryToken\", () => {\n    it(\"returns default retryToken\", async () => {\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      const retryToken = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      const defaultToken = new DefaultRetryToken(Retry.delay(), 0, 0, false);\n      expect([retryToken.getRetryCost(), retryToken.getRetryCount(), retryToken.getRetryDelay()]).toEqual([\n        defaultToken.getRetryCost(),\n        defaultToken.getRetryCount(),\n        defaultToken.getRetryDelay(),\n      ]);\n    });\n  });\n\n  describe(\"refreshRetryTokenForRetry\", () => {\n    it(\"refreshes the token\", async () => {\n      const getRetryCount = vi.fn().mockReturnValue(0);\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n      expect(getRetryCount).toHaveBeenCalledTimes(3);\n    });\n\n    it(\"disables any retries when maxAttempts is 1\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 0,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(1);\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      try {\n        await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n        fail(`expected ${noRetryTokenAvailableError}`);\n      } catch (error) {\n        expect(error).toStrictEqual(noRetryTokenAvailableError);\n      }\n    });\n\n    it(\"throws when attempts exceeds maxAttempts\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 2,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(1));\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      try {\n        await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n        fail(`expected ${noRetryTokenAvailableError}`);\n      } catch (error) {\n        expect(error).toStrictEqual(noRetryTokenAvailableError);\n      }\n    });\n\n    it(\"throws when attempts exceeds default max attempts (3)\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 5,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(5));\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      try {\n        await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n        fail(`expected ${noRetryTokenAvailableError}`);\n      } catch (error) {\n        expect(error).toStrictEqual(noRetryTokenAvailableError);\n      }\n    });\n\n    it(\"throws when error is non-retryable\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 0,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(() => Promise.resolve(maxAttempts));\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      const errorInfo = {\n        errorType: \"CLIENT_ERROR\",\n      } as RetryErrorInfo;\n      try {\n        await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n        fail(`expected ${noRetryTokenAvailableError}`);\n      } catch (error) {\n        expect(error).toStrictEqual(noRetryTokenAvailableError);\n      }\n    });\n  });\n\n  describe(\"retryCode\", () => {\n    it(\"returns code 1 (non-retryable) with highest priority over other reasons\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 5,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(1);\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      // non-retryable + attempts exhausted: should get code 1 (non-retryable wins)\n      const result = retryStrategy[\"retryCode\"](token, { errorType: \"CLIENT_ERROR\" } as RetryErrorInfo, 1);\n      expect(result).toBe(1);\n    });\n\n    it(\"returns code 2 (attempts exhausted) when retryable but no attempts left\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 2,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(maxAttempts);\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      const result = retryStrategy[\"retryCode\"](token, errorInfo, maxAttempts);\n      expect(result).toBe(2);\n    });\n\n    it(\"returns code 3 (no capacity) when retryable with attempts left but no tokens\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 0,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(maxAttempts);\n      retryStrategy[\"capacity\"] = 0;\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      const result = retryStrategy[\"retryCode\"](token, errorInfo, maxAttempts);\n      expect(result).toBe(3);\n    });\n\n    it(\"returns code 0 (OK to retry) when all conditions are met\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 0,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(maxAttempts);\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      const result = retryStrategy[\"retryCode\"](token, errorInfo, maxAttempts);\n      expect(result).toBe(0);\n    });\n  });\n\n  describe(\"long-poll token behavior\", () => {\n    it(\"throws with $backoff when long-poll token has no capacity (code 3)\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 0,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n            isLongPoll: () => true,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(maxAttempts);\n      retryStrategy[\"capacity\"] = 0;\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      try {\n        await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n        fail(\"expected error\");\n      } catch (error: any) {\n        expect(error.message).toBe(\"No retry token available\");\n        // $backoff is 0 when Retry.v2026 is false, non-zero when true\n        expect(error.$backoff).toBe(0);\n      }\n    });\n\n    it(\"throws with $backoff=0 when long-poll token fails for non-capacity reason (code 1)\", async () => {\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount: () => 0,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n            isLongPoll: () => true,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(maxAttempts);\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      try {\n        await retryStrategy.refreshRetryTokenForRetry(token, { errorType: \"CLIENT_ERROR\" } as RetryErrorInfo);\n        fail(\"expected error\");\n      } catch (error: any) {\n        expect(error.message).toBe(\"No retry token available\");\n        expect(error.$backoff).toBe(0);\n      }\n    });\n\n    it(\"retries long-poll token even when retryCode is non-zero, if capacity exists\", async () => {\n      const getRetryCount = vi.fn().mockReturnValue(0);\n      vi.mocked(DefaultRetryToken).mockImplementation(\n        () =>\n          ({\n            getRetryCount,\n            getRetryCost: () => 0,\n            getRetryDelay: () => 0,\n            isLongPoll: () => true,\n          }) as any\n      );\n      const retryStrategy = new StandardRetryStrategy(maxAttempts);\n      const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n      const refreshed = await retryStrategy.refreshRetryTokenForRetry(token, errorInfo);\n      expect(refreshed).toBeDefined();\n    });\n\n    describe(\"with Retry.v2026 enabled\", () => {\n      let originalV2026: boolean;\n\n      beforeEach(() => {\n        originalV2026 = Retry.v2026;\n        Retry.v2026 = true;\n      });\n\n      afterEach(() => {\n        Retry.v2026 = originalV2026;\n      });\n\n      it(\"throws with non-zero $backoff for code 3\", async () => {\n        vi.mocked(DefaultRetryToken).mockImplementation(\n          () =>\n            ({\n              getRetryCount: () => 0,\n              getRetryCost: () => 0,\n              getRetryDelay: () => 0,\n              isLongPoll: () => true,\n            }) as any\n        );\n        const retryStrategy = new StandardRetryStrategy({\n          maxAttempts,\n          backoff: new DeterministicRetryBackoffStrategy(),\n        });\n        retryStrategy[\"capacity\"] = 0;\n        const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n        await expect(retryStrategy.refreshRetryTokenForRetry(token, errorInfo)).rejects.toMatchObject({\n          message: \"No retry token available\",\n          $backoff: 50, // b=1 * min(50 * 2^0, 20000) = 50\n        });\n      });\n\n      it(\"throws with $backoff=0 for non-capacity code\", async () => {\n        vi.mocked(DefaultRetryToken).mockImplementation(\n          () =>\n            ({\n              getRetryCount: () => 0,\n              getRetryCost: () => 0,\n              getRetryDelay: () => 0,\n              isLongPoll: () => true,\n            }) as any\n        );\n        const retryStrategy = new StandardRetryStrategy(maxAttempts);\n        const token = await retryStrategy.acquireInitialRetryToken(retryTokenScope);\n        await expect(\n          retryStrategy.refreshRetryTokenForRetry(token, { errorType: \"CLIENT_ERROR\" } as RetryErrorInfo)\n        ).rejects.toMatchObject({\n          message: \"No retry token available\",\n          $backoff: 0,\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/StandardRetryStrategy.ts",
    "content": "import type {\n  Provider,\n  RetryErrorInfo,\n  RetryErrorType,\n  RetryStrategyV2,\n  StandardRetryBackoffStrategy,\n  StandardRetryToken,\n} from \"@smithy/types\";\n\nimport { DefaultRetryBackoffStrategy } from \"./DefaultRetryBackoffStrategy\";\nimport { DefaultRetryToken } from \"./DefaultRetryToken\";\nimport { DEFAULT_MAX_ATTEMPTS, RETRY_MODES } from \"./config\";\nimport { INITIAL_RETRY_TOKENS, NO_RETRY_INCREMENT } from \"./constants\";\nimport { Retry } from \"./retries-2026-config\";\n\n/**\n * @public\n */\nexport type StandardRetryStrategyOptions = {\n  /**\n   * Maximum number of attempts. If set to 1, no retries will be made.\n   */\n  maxAttempts: number;\n  /**\n   * When present, overrides the base delay for non-throttling retries.\n   */\n  baseDelay?: number;\n  /**\n   * Backoff calculator.\n   */\n  backoff?: StandardRetryBackoffStrategy;\n};\n\n/**\n * Reason for refusing to retry.\n * @internal\n */\nconst refusal = {\n  /**\n   * Error is not retryable via classification.\n   */\n  incompatible: 1,\n  /**\n   * attempt count exhausted.\n   */\n  attempts: 2,\n  /**\n   * capacity exhausted.\n   */\n  capacity: 3,\n} as const;\n\n/**\n * @public\n */\nexport class StandardRetryStrategy implements RetryStrategyV2 {\n  public readonly mode: string = RETRY_MODES.STANDARD;\n\n  private capacity: number = INITIAL_RETRY_TOKENS;\n  private readonly retryBackoffStrategy: StandardRetryBackoffStrategy;\n  private readonly maxAttemptsProvider: Provider<number>;\n  private readonly baseDelay: number;\n\n  public constructor(maxAttempts: number);\n  public constructor(maxAttemptsProvider: Provider<number>);\n  public constructor(options: StandardRetryStrategyOptions);\n  public constructor(arg1: number | Provider<number> | StandardRetryStrategyOptions) {\n    if (typeof arg1 === \"number\") {\n      this.maxAttemptsProvider = async () => arg1;\n    } else if (typeof arg1 === \"function\") {\n      this.maxAttemptsProvider = arg1;\n    } else if (arg1 && typeof arg1 === \"object\") {\n      this.maxAttemptsProvider = async () => arg1.maxAttempts;\n      this.baseDelay = arg1.baseDelay!;\n      this.retryBackoffStrategy = arg1.backoff!;\n    }\n    this.maxAttemptsProvider ??= async () => DEFAULT_MAX_ATTEMPTS;\n    this.baseDelay ??= Retry.delay();\n    this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();\n  }\n\n  public async acquireInitialRetryToken(retryTokenScope: string): Promise<StandardRetryToken> {\n    return new DefaultRetryToken(Retry.delay(), 0, undefined, Retry.v2026 && retryTokenScope.includes(\":longpoll\"));\n  }\n\n  public async refreshRetryTokenForRetry(\n    token: StandardRetryToken,\n    errorInfo: RetryErrorInfo\n  ): Promise<StandardRetryToken> {\n    const maxAttempts = await this.getMaxAttempts();\n\n    const retryCode = this.retryCode(token, errorInfo, maxAttempts);\n    const shouldRetry = retryCode === 0;\n    const isLongPoll = token.isLongPoll?.();\n\n    if (shouldRetry || isLongPoll) {\n      const errorType = errorInfo.errorType;\n      this.retryBackoffStrategy.setDelayBase(errorType === \"THROTTLING\" ? Retry.throttlingDelay() : this.baseDelay);\n\n      const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());\n\n      let retryDelay = delayFromErrorType;\n      if (errorInfo.retryAfterHint instanceof Date) {\n        retryDelay = Math.max(\n          delayFromErrorType /* lower bound */,\n          Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000 /* upper bound */)\n        );\n      }\n\n      if (!shouldRetry) {\n        /**\n         * We only apply additional backoff if `isLongPoll` and the retryCode=3 indicates\n         * that capacity is exhausted. Running out of attempts or having a\n         * non-retryable error does *not* apply backoff.\n         */\n        throw Object.assign(new Error(\"No retry token available\"), {\n          $backoff: Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0,\n        });\n      } else {\n        const capacityCost = this.getCapacityCost(errorType);\n        this.capacity -= capacityCost;\n\n        return new DefaultRetryToken(\n          retryDelay,\n          token.getRetryCount() + 1,\n          capacityCost,\n          token.isLongPoll?.() ?? false\n        );\n      }\n    }\n\n    throw new Error(\"No retry token available\");\n  }\n\n  public recordSuccess(token: StandardRetryToken): void {\n    this.capacity = Math.min(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));\n  }\n\n  /**\n   * This number decreases when retries are executed and refills when requests or retries succeed.\n   * @returns the current available retry capacity.\n   */\n  public getCapacity(): number {\n    return this.capacity;\n  }\n\n  /**\n   * There is an existing integration which accesses this field.\n   * @deprecated\n   */\n  public async maxAttempts(): Promise<number> {\n    return this.maxAttemptsProvider();\n  }\n\n  private async getMaxAttempts() {\n    try {\n      return await this.maxAttemptsProvider();\n    } catch (error) {\n      console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);\n      return DEFAULT_MAX_ATTEMPTS;\n    }\n  }\n\n  /**\n   * 0 - OK to retry.\n   * 1 - error is not classified as retryable.\n   * 2 - attempt count exhausted.\n   * 3 - no capacity left (retry tokens exhausted).\n   *\n   * @returns 0 or the number of the highest priority (lowest integer) reason why retry is not possible.\n   */\n  private retryCode(\n    tokenToRenew: StandardRetryToken,\n    errorInfo: RetryErrorInfo,\n    maxAttempts: number\n  ): 0 | (typeof refusal)[keyof typeof refusal] {\n    const attempts = tokenToRenew.getRetryCount() + 1;\n\n    const retryableStatus = this.isRetryableError(errorInfo.errorType) ? 0 : refusal.incompatible;\n    const attemptStatus = attempts < maxAttempts ? 0 : refusal.attempts;\n    const capacityStatus = this.capacity >= this.getCapacityCost(errorInfo.errorType) ? 0 : refusal.capacity;\n\n    return retryableStatus || attemptStatus || capacityStatus;\n  }\n\n  private getCapacityCost(errorType: RetryErrorType) {\n    return errorType === Retry.modifiedCostType() ? Retry.throttlingCost() : Retry.cost();\n  }\n\n  private isRetryableError(errorType: RetryErrorType): boolean {\n    return errorType === \"THROTTLING\" || errorType === \"TRANSIENT\";\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/config.ts",
    "content": "/**\n * @public\n */\nexport enum RETRY_MODES {\n  STANDARD = \"standard\",\n  ADAPTIVE = \"adaptive\",\n}\n\n/**\n * The default value for how many HTTP requests an SDK should make for a\n * single SDK operation invocation before giving up\n *\n * @public\n */\nexport const DEFAULT_MAX_ATTEMPTS = 3;\n\n/**\n * The default retry algorithm to use.\n *\n * @public\n */\nexport const DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/constants.ts",
    "content": "/**\n * The base number of milliseconds to use in calculating a suitable cool-down\n * time when a retryable error is encountered.\n *\n * @public\n */\nexport const DEFAULT_RETRY_DELAY_BASE = 100;\n\n/**\n * The maximum amount of time (in milliseconds) that will be used as a delay\n * between retry attempts.\n *\n * @public\n */\nexport const MAXIMUM_RETRY_DELAY = 20 * 1000;\n\n/**\n * The retry delay base (in milliseconds) to use when a throttling error is\n * encountered.\n *\n * @public\n */\nexport const THROTTLING_RETRY_DELAY_BASE = 500;\n\n/**\n * Initial number of retry tokens in Retry Quota\n *\n * @public\n */\nexport const INITIAL_RETRY_TOKENS = 500;\n\n/**\n * The total amount of retry tokens to be decremented from retry token balance.\n *\n * @public\n */\nexport const RETRY_COST = 5;\n\n/**\n * The total amount of retry tokens to be decremented from retry token balance\n * when a throttling error is encountered.\n *\n * @public\n */\nexport const TIMEOUT_RETRY_COST = 10;\n\n/**\n * The total amount of retry token to be incremented from retry token balance\n * if an SDK operation invocation succeeds without requiring a retry request.\n *\n * @public\n *\n */\nexport const NO_RETRY_INCREMENT = 1;\n\n/**\n * Header name for SDK invocation ID\n *\n * @public\n */\nexport const INVOCATION_ID_HEADER = \"amz-sdk-invocation-id\";\n\n/**\n * Header name for request retry information.\n *\n * @public\n */\nexport const REQUEST_HEADER = \"amz-sdk-request\";\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/retries-2026-config.ts",
    "content": "import type {\n  DEFAULT_RETRY_DELAY_BASE,\n  RETRY_COST,\n  THROTTLING_RETRY_DELAY_BASE,\n  TIMEOUT_RETRY_COST,\n} from \"./constants\";\n\n/**\n * @internal\n */\nexport abstract class Retry {\n  public static v2026 = typeof process !== \"undefined\" && process.env?.SMITHY_NEW_RETRIES_2026 === \"true\";\n\n  public static delay() {\n    return Retry.v2026 ? 50 : (100 satisfies typeof DEFAULT_RETRY_DELAY_BASE);\n  }\n\n  public static throttlingDelay() {\n    return Retry.v2026 ? 1_000 : (500 satisfies typeof THROTTLING_RETRY_DELAY_BASE);\n  }\n\n  public static cost() {\n    return Retry.v2026 ? 14 : (5 satisfies typeof RETRY_COST);\n  }\n\n  public static throttlingCost() {\n    return Retry.v2026 ? 5 : (10 satisfies typeof TIMEOUT_RETRY_COST);\n  }\n\n  public static modifiedCostType() {\n    return Retry.v2026 ? \"THROTTLING\" : \"TRANSIENT\";\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/retries.integ.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { cbor } from \"@smithy/core/cbor\";\nimport { HttpResponse } from \"@smithy/protocol-http\";\nimport type { RetryErrorType, StandardRetryToken } from \"@smithy/types\";\nimport { requireRequestsFrom } from \"@smithy/util-test/src\";\nimport { afterAll, beforeAll, describe, expect, test as it } from \"vitest\";\nimport { XYZService } from \"xyz\";\n\nimport { DefaultRetryBackoffStrategy } from \"./DefaultRetryBackoffStrategy\";\nimport { StandardRetryStrategy } from \"./StandardRetryStrategy\";\nimport { MAXIMUM_RETRY_DELAY } from \"./constants\";\nimport { Retry } from \"./retries-2026-config\";\n\nclass DeterministicRetryBackoffStrategy extends DefaultRetryBackoffStrategy {\n  public computeNextBackoffDelay(i: number): number {\n    const b = 1; // maximum instead of Math.random()\n    const r = 2;\n    const t_i = b * Math.min(this.x * r ** i, MAXIMUM_RETRY_DELAY);\n    return Math.floor(t_i);\n  }\n}\n\ndescribe(\"retries\", () => {\n  function createCborResponse(body: any, status = 200) {\n    const bytes = cbor.serialize(body);\n    return new HttpResponse({\n      headers: {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      },\n      body: Readable.from(bytes),\n      statusCode: status,\n    });\n  }\n\n  it(\"should retry throttling and transient-error status codes\", async () => {\n    const client = new XYZService({\n      endpoint: \"https://localhost/nowhere\",\n      apiKey: { apiKey: \"test-api-key\" },\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        createCborResponse(\n          {\n            __type: \"HaltError\",\n          },\n          429\n        ),\n        createCborResponse(\n          {\n            __type: \"HaltError\",\n          },\n          500\n        ),\n        createCborResponse(\"\", 200)\n      );\n\n    const response = await client.getNumbers().catch((e) => e);\n\n    expect(response.$metadata.attempts).toEqual(3);\n  });\n\n  it(\"should retry when a retryable trait is modeled\", async () => {\n    const client = new XYZService({\n      endpoint: \"https://localhost/nowhere\",\n      apiKey: { apiKey: \"test-api-key\" },\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        createCborResponse(\n          {\n            __type: \"RetryableError\",\n          },\n          400 // not retryable status code\n        ),\n        createCborResponse(\n          {\n            __type: \"RetryableError\",\n          },\n          400 // not retryable status code\n        ),\n        createCborResponse(\"\", 200)\n      );\n\n    const response = await client.getNumbers().catch((e) => e);\n\n    expect(response.$metadata.attempts).toEqual(3);\n  });\n\n  it(\"should retry retryable trait with throttling\", async () => {\n    const client = new XYZService({\n      endpoint: \"https://localhost/nowhere\",\n      apiKey: { apiKey: \"test-api-key\" },\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        createCborResponse(\n          {\n            __type: \"CodedThrottlingError\",\n          },\n          429\n        ),\n        createCborResponse(\n          {\n            __type: \"MysteryThrottlingError\",\n          },\n          400 // not a retryable status code, but error is modeled as retryable.\n        ),\n        createCborResponse(\"\", 200)\n      );\n\n    const response = await client.getNumbers().catch((e) => e);\n\n    expect(response.$metadata.attempts).toEqual(3);\n  });\n\n  it(\"should not retry if the error is not modeled with retryable trait and is not otherwise retryable\", async () => {\n    const client = new XYZService({\n      endpoint: \"https://localhost/nowhere\",\n      apiKey: { apiKey: \"test-api-key\" },\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        createCborResponse(\n          {\n            __type: \"HaltError\",\n          },\n          429 // not modeled as retryable, but this is a retryable status code.\n        ),\n        createCborResponse(\n          {\n            __type: \"HaltError\",\n          },\n          400\n        ),\n        createCborResponse(\"\", 200)\n      );\n\n    const response = await client.getNumbers().catch((e) => e);\n\n    // stopped at the second error.\n    expect(response.$metadata.attempts).toEqual(2);\n  });\n});\n\ndescribe(StandardRetryStrategy.name, () => {\n  const inline = (token: StandardRetryToken) => {\n    return [token.getRetryCount(), token.getRetryCost(), token.getRetryDelay(), token.isLongPoll?.()];\n  };\n\n  describe(\"retry timings\", () => {\n    const testCases: Array<{\n      name: string;\n      timings: [RetryErrorType, number, number | undefined, number, boolean][];\n      scope?: string;\n      v2026?: boolean;\n    }> = [\n      {\n        name: \"3x - transient\",\n        timings: [\n          [\"TRANSIENT\", 0, undefined, 100, false],\n          [\"TRANSIENT\", 1, 10, 100, false],\n          [\"TRANSIENT\", 2, 10, 200, false],\n        ],\n      },\n      {\n        name: \"3x - throttling\",\n        timings: [\n          [\"THROTTLING\", 0, undefined, 100, false],\n          [\"THROTTLING\", 1, 5, 500, false],\n          [\"THROTTLING\", 2, 5, 1000, false],\n        ],\n      },\n      {\n        name: \"3x - throttling mixed\",\n        timings: [\n          [\"THROTTLING\", 0, undefined, 100, false],\n          [\"TRANSIENT\", 1, 10, 100, false],\n          [\"THROTTLING\", 2, 5, 1000, false],\n        ],\n      },\n      {\n        name: \"3x - transient mixed\",\n        timings: [\n          [\"TRANSIENT\", 0, undefined, 100, false],\n          [\"THROTTLING\", 1, 5, 500, false],\n          [\"TRANSIENT\", 2, 10, 200, false],\n        ],\n      },\n      {\n        name: \"8x - transient\",\n        timings: [\n          [\"TRANSIENT\", 0, undefined, 100, false],\n          [\"TRANSIENT\", 1, 10, 100, false],\n          [\"TRANSIENT\", 2, 10, 200, false],\n          [\"TRANSIENT\", 3, 10, 400, false],\n          [\"TRANSIENT\", 4, 10, 800, false],\n          [\"TRANSIENT\", 5, 10, 1600, false],\n          [\"TRANSIENT\", 6, 10, 3200, false],\n          [\"TRANSIENT\", 7, 10, 6400, false],\n        ],\n      },\n      {\n        name: \"8x - throttling\",\n        timings: [\n          [\"THROTTLING\", 0, undefined, 100, false],\n          [\"THROTTLING\", 1, 5, 500, false],\n          [\"THROTTLING\", 2, 5, 1000, false],\n          [\"THROTTLING\", 3, 5, 2000, false],\n          [\"THROTTLING\", 4, 5, 4000, false],\n          [\"THROTTLING\", 5, 5, 8000, false],\n          [\"THROTTLING\", 6, 5, 16000, false],\n          [\"THROTTLING\", 7, 5, 20000, false],\n        ],\n      },\n      {\n        name: \"8x - transient mixed\",\n        timings: [\n          [\"TRANSIENT\", 0, undefined, 100, false],\n          [\"THROTTLING\", 1, 5, 500, false],\n          [\"THROTTLING\", 2, 5, 1000, false],\n          [\"TRANSIENT\", 3, 10, 400, false],\n          [\"TRANSIENT\", 4, 10, 800, false],\n          [\"TRANSIENT\", 5, 10, 1600, false],\n          [\"TRANSIENT\", 6, 10, 3200, false],\n          [\"THROTTLING\", 7, 5, 20000, false],\n        ],\n      },\n      {\n        name: \"8x - throttling mixed\",\n        timings: [\n          [\"TRANSIENT\", 0, undefined, 100, false],\n          [\"TRANSIENT\", 1, 10, 100, false],\n          [\"THROTTLING\", 2, 5, 1000, false],\n          [\"THROTTLING\", 3, 5, 2000, false],\n          [\"THROTTLING\", 4, 5, 4000, false],\n          [\"THROTTLING\", 5, 5, 8000, false],\n          [\"TRANSIENT\", 6, 10, 3200, false],\n          [\"THROTTLING\", 7, 5, 20000, false],\n        ],\n      },\n      {\n        name: \"12x - throttling mixed longpoll\",\n        scope: \":longpoll\",\n        timings: [\n          [\"TRANSIENT\", 0, undefined, 100, false],\n          [\"TRANSIENT\", 1, 10, 100, false],\n          [\"THROTTLING\", 2, 5, 1000, false],\n          [\"THROTTLING\", 3, 5, 2000, false],\n          [\"THROTTLING\", 4, 5, 4000, false],\n          [\"THROTTLING\", 5, 5, 8000, false],\n          [\"TRANSIENT\", 6, 10, 3200, false],\n          [\"THROTTLING\", 7, 5, 20000, false],\n          [\"THROTTLING\", 8, 5, 20000, false],\n          [\"THROTTLING\", 9, 5, 20000, false],\n          [\"THROTTLING\", 10, 5, 20000, false],\n          [\"THROTTLING\", 11, 5, 20000, false],\n        ],\n      },\n    ];\n\n    testCases.push(\n      ...(\n        [\n          {\n            name: \"8x - transient mixed\",\n            timings: [\n              [\"TRANSIENT\", 0, undefined, 50, false],\n              [\"THROTTLING\", 1, 5, 1000, false],\n              [\"THROTTLING\", 2, 5, 2000, false],\n              [\"TRANSIENT\", 3, 14, 200, false],\n              [\"TRANSIENT\", 4, 14, 400, false],\n              [\"TRANSIENT\", 5, 14, 800, false],\n              [\"TRANSIENT\", 6, 14, 1600, false],\n              [\"THROTTLING\", 7, 5, 20000, false],\n            ],\n          },\n          {\n            name: \"8x - throttling mixed\",\n            timings: [\n              [\"TRANSIENT\", 0, undefined, 50, false],\n              [\"TRANSIENT\", 1, 14, 50, false],\n              [\"THROTTLING\", 2, 5, 2000, false],\n              [\"THROTTLING\", 3, 5, 4000, false],\n              [\"THROTTLING\", 4, 5, 8000, false],\n              [\"THROTTLING\", 5, 5, 16000, false],\n              [\"TRANSIENT\", 6, 14, 1600, false],\n              [\"THROTTLING\", 7, 5, 20000, false],\n            ],\n          },\n          {\n            name: \"12x - throttling mixed longpoll\",\n            scope: \":longpoll\",\n            timings: [\n              [\"TRANSIENT\", 0, undefined, 50, true],\n              [\"TRANSIENT\", 1, 14, 50, true],\n              [\"THROTTLING\", 2, 5, 2000, true],\n              [\"THROTTLING\", 3, 5, 4000, true],\n              [\"THROTTLING\", 4, 5, 8000, true],\n              [\"THROTTLING\", 5, 5, 16000, true],\n              [\"TRANSIENT\", 6, 14, 1600, true],\n              [\"THROTTLING\", 7, 5, 20000, true],\n              [\"THROTTLING\", 8, 5, 20000, true],\n              [\"THROTTLING\", 9, 5, 20000, true],\n              [\"THROTTLING\", 10, 5, 20000, true],\n              [\"THROTTLING\", 11, 5, 20000, true],\n            ],\n          },\n        ] as typeof testCases\n      ).map((c) => {\n        c.v2026 = true;\n        return c;\n      })\n    );\n\n    for (const { name, timings, scope, v2026 } of testCases) {\n      describe(name + (v2026 ? \" (2026)\" : \"\"), async () => {\n        let retryStrategy!: StandardRetryStrategy;\n\n        beforeAll(() => {\n          if (v2026) {\n            process.env.SMITHY_NEW_RETRIES_2026 = \"true\";\n            Retry.v2026 = true;\n          } else {\n            delete process.env.SMITHY_NEW_RETRIES_2026;\n            Retry.v2026 = false;\n          }\n          retryStrategy = new StandardRetryStrategy({\n            maxAttempts: timings.length,\n            backoff: new DeterministicRetryBackoffStrategy(),\n          });\n        });\n\n        const tokens: StandardRetryToken[] = [];\n\n        for (let i = 0; i < timings.length; ++i) {\n          it(String(i), async () => {\n            if (i === 0) {\n              const token = await retryStrategy.acquireInitialRetryToken(scope ?? \"none\");\n              tokens.push(token);\n            } else {\n              const token = await retryStrategy.refreshRetryTokenForRetry(tokens[i - 1], {\n                errorType: timings[i][0],\n              });\n              tokens.push(token);\n            }\n\n            expect(inline(tokens[i])).toEqual(timings[i].slice(1));\n\n            if (i === timings.length - 1) {\n              const expectedCapacityRemaining = 500 - timings.reduce((acc, [, , cost]) => acc + (cost ?? 0), 0);\n              expect(retryStrategy.getCapacity()).toEqual(expectedCapacityRemaining);\n            }\n          });\n        }\n      });\n    }\n  });\n});\n\ndescribe(\"specification tests\", () => {\n  type Outcome = \"success\" | \"retry_request\" | \"max_attempts_exceeded\" | \"retry_quota_exceeded\";\n\n  interface ResponseStep {\n    response: { status_code: number; error_code?: string; headers?: Record<string, string> };\n    expected: { outcome: Outcome; retry_quota: number; delay?: number };\n  }\n\n  interface SpecTestCase {\n    name: string;\n    given: {\n      max_attempts?: number;\n      initial_retry_tokens?: number;\n      exponential_base?: number;\n      max_backoff_time?: number;\n      service?: string;\n      operation?: string;\n    };\n    responses: ResponseStep[];\n  }\n\n  function errorTypeForResponse(r: ResponseStep[\"response\"]): RetryErrorType {\n    if (\n      r.status_code === 429 ||\n      r.error_code === \"Throttling\" ||\n      r.error_code === \"ThrottlingException\" ||\n      r.error_code === \"ProvisionedThroughputExceededException\"\n    ) {\n      return \"THROTTLING\";\n    }\n    if ([500, 502, 503, 504].includes(r.status_code)) {\n      return \"TRANSIENT\";\n    }\n    return \"CLIENT_ERROR\";\n  }\n\n  const specTestCases: SpecTestCase[] = [\n    {\n      name: \"Retry eventually succeeds\",\n      given: { exponential_base: 1 },\n      responses: [\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 486, delay: 0.05 } },\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 472, delay: 0.1 } },\n        { response: { status_code: 200 }, expected: { outcome: \"success\", retry_quota: 486 } },\n      ],\n    },\n    {\n      name: \"Fail due to max attempts reached\",\n      given: { exponential_base: 1 },\n      responses: [\n        { response: { status_code: 502 }, expected: { outcome: \"retry_request\", retry_quota: 486, delay: 0.05 } },\n        { response: { status_code: 502 }, expected: { outcome: \"retry_request\", retry_quota: 472, delay: 0.1 } },\n        { response: { status_code: 502 }, expected: { outcome: \"max_attempts_exceeded\", retry_quota: 472 } },\n      ],\n    },\n    {\n      name: \"Retry Quota reached after a single retry\",\n      given: { initial_retry_tokens: 14, exponential_base: 1 },\n      responses: [\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 0, delay: 0.05 } },\n        { response: { status_code: 500 }, expected: { outcome: \"retry_quota_exceeded\", retry_quota: 0 } },\n      ],\n    },\n    {\n      name: \"No retries at all if retry quota is 0\",\n      given: { initial_retry_tokens: 0, exponential_base: 1 },\n      responses: [{ response: { status_code: 500 }, expected: { outcome: \"retry_quota_exceeded\", retry_quota: 0 } }],\n    },\n    {\n      name: \"Verifying exponential backoff timing\",\n      given: { max_attempts: 5, exponential_base: 1 },\n      responses: [\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 486, delay: 0.05 } },\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 472, delay: 0.1 } },\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 458, delay: 0.2 } },\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 444, delay: 0.4 } },\n        { response: { status_code: 500 }, expected: { outcome: \"max_attempts_exceeded\", retry_quota: 444 } },\n      ],\n    },\n    {\n      name: \"Retry Stops After Retry Quota Exhaustion\",\n      given: { max_attempts: 5, initial_retry_tokens: 20, exponential_base: 1 },\n      responses: [\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 6, delay: 0.05 } },\n        { response: { status_code: 502 }, expected: { outcome: \"retry_quota_exceeded\", retry_quota: 6 } },\n      ],\n    },\n    {\n      name: \"Retry quota Recovery After Successful Responses\",\n      given: { max_attempts: 5, initial_retry_tokens: 30, exponential_base: 1 },\n      responses: [\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 16, delay: 0.05 } },\n        { response: { status_code: 502 }, expected: { outcome: \"retry_request\", retry_quota: 2, delay: 0.1 } },\n        { response: { status_code: 200 }, expected: { outcome: \"success\", retry_quota: 16 } },\n        { response: { status_code: 500 }, expected: { outcome: \"retry_request\", retry_quota: 2, delay: 0.05 } },\n        { response: { status_code: 200 }, expected: { outcome: \"success\", retry_quota: 16 } },\n      ],\n    },\n    {\n      name: \"Throttling Error Token Bucket Drain (5 tokens) and Backoff Duration (1000ms)\",\n      given: { exponential_base: 1 },\n      responses: [\n        {\n          response: { status_code: 400, error_code: \"Throttling\" },\n          expected: { outcome: \"retry_request\", retry_quota: 495, delay: 1 },\n        },\n        { response: { status_code: 200 }, expected: { outcome: \"success\", retry_quota: 500 } },\n      ],\n    },\n  ];\n\n  let defaultRetryV2026Flag: boolean;\n\n  beforeAll(() => {\n    defaultRetryV2026Flag = Retry.v2026;\n    Retry.v2026 = true;\n    process.env.SMITHY_NEW_RETRIES_2026 = \"true\";\n  });\n\n  afterAll(() => {\n    Retry.v2026 = defaultRetryV2026Flag;\n    if (!defaultRetryV2026Flag) {\n      delete process.env.SMITHY_NEW_RETRIES_2026;\n    }\n  });\n\n  describe(\"StandardRetryStrategy unit tests\", () => {\n    for (const tc of specTestCases) {\n      describe(tc.name, () => {\n        let strategy: StandardRetryStrategy;\n        let currentToken: StandardRetryToken;\n\n        beforeAll(() => {\n          strategy = new StandardRetryStrategy({\n            maxAttempts: tc.given.max_attempts ?? 3,\n            backoff: new DeterministicRetryBackoffStrategy(),\n          });\n          if (tc.given.initial_retry_tokens !== undefined) {\n            (strategy as any).capacity = tc.given.initial_retry_tokens;\n          }\n        });\n\n        for (let i = 0; i < tc.responses.length; i++) {\n          const step = tc.responses[i];\n          const { outcome, retry_quota, delay } = step.expected;\n          const isNewSequence = i === 0 || tc.responses[i - 1].expected.outcome === \"success\";\n\n          it(`step ${i}: ${outcome} (status=${step.response.status_code})`, async () => {\n            if (isNewSequence) {\n              currentToken = await strategy.acquireInitialRetryToken(\"none\");\n            }\n\n            if (outcome === \"success\") {\n              strategy.recordSuccess(currentToken);\n              expect(strategy.getCapacity()).toEqual(retry_quota);\n              return;\n            }\n\n            if (outcome === \"retry_request\") {\n              const errorType = errorTypeForResponse(step.response);\n              currentToken = await strategy.refreshRetryTokenForRetry(currentToken, { errorType });\n              expect(strategy.getCapacity()).toEqual(retry_quota);\n              expect(currentToken.getRetryDelay()).toEqual(delay! * 1000);\n              return;\n            }\n\n            // max_attempts_exceeded or retry_quota_exceeded\n            const errorType = errorTypeForResponse(step.response);\n            await expect(strategy.refreshRetryTokenForRetry(currentToken, { errorType })).rejects.toThrow();\n            expect(strategy.getCapacity()).toEqual(retry_quota);\n          });\n        }\n      });\n    }\n  });\n\n  describe(\"end-to-end with requireRequestsFrom\", () => {\n    function createCborResponse(body: any, status = 200, headers: Record<string, string> = {}) {\n      const bytes = cbor.serialize(body);\n      return new HttpResponse({\n        headers: { \"smithy-protocol\": \"rpc-v2-cbor\", ...headers },\n        body: Readable.from(bytes),\n        statusCode: status,\n      });\n    }\n\n    /**\n     * Asserts that the actual value is within ±10% of the expected value.\n     */\n    const expectApprox = (actual: number, expected: number) => {\n      expect(actual).toBeGreaterThanOrEqual(expected * 0.9);\n      expect(actual).toBeLessThanOrEqual(expected * 1.1);\n    };\n\n    it(\"Retry eventually succeeds (3 attempts)\", async () => {\n      const client = new XYZService({\n        endpoint: \"https://localhost/nowhere\",\n        apiKey: { apiKey: \"test-api-key\" },\n        retryStrategy: new StandardRetryStrategy({\n          maxAttempts: 3,\n          backoff: new DeterministicRetryBackoffStrategy(),\n        }),\n      });\n\n      requireRequestsFrom(client)\n        .toMatch({ hostname: /localhost/ })\n        .respondWith(\n          createCborResponse({ __type: \"RetryableError\" }, 500),\n          createCborResponse({ __type: \"RetryableError\" }, 500),\n          createCborResponse(\"\", 200)\n        );\n\n      const response = await client.getNumbers().catch((e) => e);\n      expect(response.$metadata.attempts).toEqual(3);\n      // 2 transient retries: 50ms + 100ms = 150ms\n      expectApprox(response.$metadata.totalRetryDelay, 150);\n    });\n\n    it(\"Fail due to max attempts reached (3 attempts, all 502)\", async () => {\n      const client = new XYZService({\n        endpoint: \"https://localhost/nowhere\",\n        apiKey: { apiKey: \"test-api-key\" },\n        retryStrategy: new StandardRetryStrategy({\n          maxAttempts: 3,\n          backoff: new DeterministicRetryBackoffStrategy(),\n        }),\n      });\n\n      requireRequestsFrom(client)\n        .toMatch({ hostname: /localhost/ })\n        .respondWith(\n          createCborResponse({ __type: \"RetryableError\" }, 502),\n          createCborResponse({ __type: \"RetryableError\" }, 502),\n          createCborResponse({ __type: \"RetryableError\" }, 502)\n        );\n\n      const response = await client.getNumbers().catch((e) => e);\n      expect(response.$metadata.attempts).toEqual(3);\n      expect(response.name).toEqual(\"RetryableError\");\n      // 2 transient retries: 50ms + 100ms = 150ms\n      expectApprox(response.$metadata.totalRetryDelay, 150);\n    });\n\n    it(\"Throttling error retries and succeeds\", async () => {\n      const client = new XYZService({\n        endpoint: \"https://localhost/nowhere\",\n        apiKey: { apiKey: \"test-api-key\" },\n        retryStrategy: new StandardRetryStrategy({\n          maxAttempts: 3,\n          backoff: new DeterministicRetryBackoffStrategy(),\n        }),\n      });\n\n      requireRequestsFrom(client)\n        .toMatch({ hostname: /localhost/ })\n        .respondWith(createCborResponse({ __type: \"CodedThrottlingError\" }, 429), createCborResponse(\"\", 200));\n\n      const response = await client.getNumbers().catch((e) => e);\n      expect(response.$metadata.attempts).toEqual(2);\n      // 1 throttling retry: 1000ms\n      expectApprox(response.$metadata.totalRetryDelay, 1000);\n    });\n\n    it(\"x-amz-retry-after header is honored\", async () => {\n      const client = new XYZService({\n        endpoint: \"https://localhost/nowhere\",\n        apiKey: { apiKey: \"test-api-key\" },\n        retryStrategy: new StandardRetryStrategy({\n          maxAttempts: 3,\n          backoff: new DeterministicRetryBackoffStrategy(),\n        }),\n      });\n\n      requireRequestsFrom(client)\n        .toMatch({ hostname: /localhost/ })\n        .respondWith(\n          createCborResponse({ __type: \"RetryableError\" }, 500, { \"x-amz-retry-after\": \"1500\" }),\n          createCborResponse(\"\", 200)\n        );\n\n      const response = await client.getNumbers().catch((e) => e);\n      expect(response.$metadata.attempts).toEqual(2);\n      // x-amz-retry-after=1500ms, clamped to max(50, min(1500, 50+5000)) = 1500ms\n      expectApprox(response.$metadata.totalRetryDelay, 1500);\n    });\n\n    it(\"Invalid x-amz-retry-after falls back to exponential backoff\", async () => {\n      const client = new XYZService({\n        endpoint: \"https://localhost/nowhere\",\n        apiKey: { apiKey: \"test-api-key\" },\n        retryStrategy: new StandardRetryStrategy({\n          maxAttempts: 3,\n          backoff: new DeterministicRetryBackoffStrategy(),\n        }),\n      });\n\n      requireRequestsFrom(client)\n        .toMatch({ hostname: /localhost/ })\n        .respondWith(\n          createCborResponse({ __type: \"RetryableError\" }, 500, { \"x-amz-retry-after\": \"invalid\" }),\n          createCborResponse(\"\", 200)\n        );\n\n      const response = await client.getNumbers().catch((e) => e);\n      expect(response.$metadata.attempts).toEqual(2);\n      // Invalid header ignored, falls back to transient backoff: 50ms\n      expectApprox(response.$metadata.totalRetryDelay, 50);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/retry/util-retry/types.ts",
    "content": "/**\n * @public\n */\nexport interface RateLimiter {\n  /**\n   * If there is sufficient capacity (tokens) available, it immediately returns.\n   * If there is not sufficient capacity, it will either sleep a certain amount\n   * of time until the rate limiter can retrieve a token from its token bucket\n   * or raise an exception indicating there is insufficient capacity.\n   */\n  getSendToken: () => Promise<void>;\n\n  /**\n   * Updates the client sending rate based on response.\n   * If the response was successful, the capacity and fill rate are increased.\n   * If the response was a throttling response, the capacity and fill rate are\n   * decreased. Transient errors do not affect the rate limiter.\n   */\n  updateClientSendingRate: (response: any) => void;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/schema/TypeRegistry.spec.ts",
    "content": "import type { StaticErrorSchema, StaticListSchema, StaticMapSchema, StaticStructureSchema } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { TypeRegistry } from \"./TypeRegistry\";\n\ndescribe(TypeRegistry.name, () => {\n  const [List, Map, Struct]: [StaticListSchema, StaticMapSchema, () => StaticStructureSchema] = [\n    [1, \"NAMESPACE\", \"List\", { sparse: 1 }, 0],\n    [2, \"NAMESPACE\", \"Map\", 0, 0, 1],\n    () => schema,\n  ];\n  const schema: StaticStructureSchema = [\n    3,\n    \"NAMESPACE\",\n    \"Structure\",\n    {},\n    [\"list\", \"map\", \"struct\"],\n    [List, Map, Struct],\n  ];\n\n  it(\"stores and retrieves schema objects\", () => {\n    const tr = TypeRegistry.for(\"NAMESPACE\");\n\n    tr.register(`${List[1]}#${List[2]}`, List);\n    expect(tr.getSchema(\"List\")).toBe(List);\n\n    tr.register(`${Map[1]}#${Map[2]}`, Map);\n    expect(tr.getSchema(\"Map\")).toBe(Map);\n\n    tr.register(`${Struct()[1]}#${Struct()[2]}`, Struct());\n    expect(tr.getSchema(\"Structure\")).toBe(schema);\n  });\n\n  it(\"has a helper method to retrieve a synthetic base exception\", () => {\n    // the service namespace is appended to the synthetic prefix.\n    const err = [\n      -3,\n      \"smithy.ts.sdk.synthetic.NAMESPACE\",\n      \"UhOhServiceException\",\n      0,\n      [],\n      [],\n    ] satisfies StaticErrorSchema;\n    const tr = TypeRegistry.for(err[1]);\n    tr.registerError(err, Error);\n    expect(tr.getBaseException()).toBe(err);\n  });\n\n  describe(\"unqualified shapeId lookup\", () => {\n    it(\"resolves an unqualified name when there is exactly one matching schema\", () => {\n      const tr = TypeRegistry.for(\"com.unrelated\");\n      tr.register(\"com.example#MyShape\", List);\n      expect(tr.getSchema(\"MyShape\")).toBe(List);\n    });\n\n    it(\"throws when an unqualified name matches multiple schemas\", () => {\n      const tr = TypeRegistry.for(\"com.unrelated\");\n      tr.register(\"com.example#Ambiguous\", List);\n      tr.register(\"com.other#Ambiguous\", Map);\n      expect(() => tr.getSchema(\"Ambiguous\")).toThrow(\"schema not found\");\n    });\n\n    it(\"throws when an unqualified name matches no schemas\", () => {\n      const tr = TypeRegistry.for(\"com.unrelated\");\n      tr.register(\"com.example#Exists\", List);\n      expect(() => tr.getSchema(\"DoesNotExist\")).toThrow(\"schema not found\");\n    });\n  });\n\n  describe(\"composition\", () => {\n    it(\"can be composed\", () => {\n      const tr1 = TypeRegistry.for(\"namespace\");\n      const tr2 = TypeRegistry.for(\"other\");\n\n      tr1.register(\"namespace#List\", List);\n      tr2.register(\"other#List\", List);\n\n      tr1.copyFrom(tr2);\n      tr2.copyFrom(tr1);\n\n      expect(tr1.getSchema(\"other#List\")).toBe(List);\n      expect(tr2.getSchema(\"namespace#List\")).toBe(List);\n\n      expect(() => tr1.getSchema(\"List\")).not.toThrow();\n      expect(() => tr2.getSchema(\"List\")).not.toThrow();\n    });\n\n    it(\"does not overwrite during composition\", () => {\n      const nsRegistry = TypeRegistry.for(\"namespace\");\n      const otherRegistry = TypeRegistry.for(\"other\");\n\n      // non-canonical\n      otherRegistry.register(\"namespace#Value\", 1);\n      // canonical\n      nsRegistry.register(\"namespace#Value\", 0);\n\n      // non-canonical\n      nsRegistry.register(\"other#Value\", 1);\n      // canonical\n      otherRegistry.register(\"other#Value\", 0);\n\n      nsRegistry.copyFrom(otherRegistry);\n      otherRegistry.copyFrom(nsRegistry);\n\n      expect(nsRegistry.getSchema(\"namespace#Value\")).toBe(0);\n      expect(nsRegistry.getSchema(\"other#Value\")).toBe(1);\n\n      expect(otherRegistry.getSchema(\"namespace#Value\")).toBe(1);\n      expect(otherRegistry.getSchema(\"other#Value\")).toBe(0);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/TypeRegistry.ts",
    "content": "import type { Schema as ISchema, StaticErrorSchema } from \"@smithy/types\";\n\nimport type { ErrorSchema } from \"./schemas/ErrorSchema\";\n\n/**\n * A way to look up schema by their ShapeId values.\n *\n * @public\n */\nexport class TypeRegistry {\n  public static readonly registries = new Map<string, TypeRegistry>();\n\n  private constructor(\n    public readonly namespace: string,\n    private schemas: Map<string, ISchema> = new Map(),\n    private exceptions: Map<StaticErrorSchema, any> = new Map()\n  ) {}\n\n  /**\n   * @param namespace - specifier.\n   * @returns the schema for that namespace, creating it if necessary.\n   */\n  public static for(namespace: string): TypeRegistry {\n    if (!TypeRegistry.registries.has(namespace)) {\n      TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));\n    }\n    return TypeRegistry.registries.get(namespace)!;\n  }\n\n  /**\n   * Copies entries from another instance without changing the namespace of self.\n   * The composition is additive but non-destructive and will not overwrite existing entries.\n   *\n   * @param other - another TypeRegistry.\n   */\n  public copyFrom(other: TypeRegistry) {\n    const { schemas, exceptions } = this;\n    for (const [k, v] of other.schemas) {\n      if (!schemas.has(k)) {\n        schemas.set(k, v);\n      }\n    }\n    for (const [k, v] of other.exceptions) {\n      if (!exceptions.has(k)) {\n        exceptions.set(k, v);\n      }\n    }\n  }\n\n  /**\n   * Adds the given schema to a type registry with the same namespace, and this registry.\n   *\n   * @param shapeId - to be registered.\n   * @param schema - to be registered.\n   */\n  public register(shapeId: string, schema: ISchema) {\n    const qualifiedName = this.normalizeShapeId(shapeId);\n    for (const r of [this, TypeRegistry.for(qualifiedName.split(\"#\")[0])]) {\n      r.schemas.set(qualifiedName, schema);\n    }\n  }\n\n  /**\n   * @param shapeId - query.\n   * @returns the schema.\n   */\n  public getSchema(shapeId: string): ISchema {\n    const id = this.normalizeShapeId(shapeId);\n    if (!this.schemas.has(id)) {\n      if (!shapeId.includes(\"#\")) {\n        const suffix = \"#\" + shapeId;\n        const candidates: ISchema[] = [];\n        for (const [shapeId, schema] of this.schemas.entries()) {\n          if (shapeId.endsWith(suffix)) {\n            candidates.push(schema);\n          }\n        }\n        if (candidates.length === 1) {\n          return candidates[0];\n        }\n      }\n      throw new Error(`@smithy/core/schema - schema not found for ${id}`);\n    }\n    return this.schemas.get(id)!;\n  }\n\n  /**\n   * Associates an error schema with its constructor.\n   */\n  public registerError(es: ErrorSchema | StaticErrorSchema, ctor: any) {\n    const $error = es as StaticErrorSchema;\n    const ns = $error[1];\n    for (const r of [this, TypeRegistry.for(ns)]) {\n      r.schemas.set(ns + \"#\" + $error[2], $error);\n      r.exceptions.set($error, ctor);\n    }\n  }\n\n  /**\n   * @param es - query.\n   * @returns Error constructor that extends the service's base exception.\n   */\n  public getErrorCtor(es: ErrorSchema | StaticErrorSchema): any {\n    const $error = es as StaticErrorSchema;\n    if (this.exceptions.has($error)) {\n      return this.exceptions.get($error);\n    }\n    const registry = TypeRegistry.for($error[1]);\n    return registry.exceptions.get($error);\n  }\n\n  /**\n   * The smithy-typescript code generator generates a synthetic (i.e. unmodeled) base exception,\n   * because generated SDKs before the introduction of schemas have the notion of a ServiceBaseException, which\n   * is unique per service/model.\n   *\n   * This is generated under a unique prefix that is combined with the service namespace, and this\n   * method is used to retrieve it.\n   *\n   * The base exception synthetic schema is used when an error is returned by a service, but we cannot\n   * determine what existing schema to use to deserialize it.\n   *\n   * @returns the synthetic base exception of the service namespace associated with this registry instance.\n   */\n  public getBaseException(): StaticErrorSchema | undefined {\n    for (const exceptionKey of this.exceptions.keys()) {\n      if (Array.isArray(exceptionKey)) {\n        const [, ns, name] = exceptionKey;\n        const id = ns + \"#\" + name;\n        if (id.startsWith(\"smithy.ts.sdk.synthetic.\") && id.endsWith(\"ServiceException\")) {\n          return exceptionKey;\n        }\n      }\n    }\n    return undefined;\n  }\n\n  /**\n   * @param predicate - criterion.\n   * @returns a schema in this registry matching the predicate.\n   */\n  public find(predicate: (schema: ISchema) => boolean) {\n    for (const schema of this.schemas.values()) {\n      if (predicate(schema)) {\n        return schema;\n      }\n    }\n    return undefined;\n  }\n\n  /**\n   * Unloads the current TypeRegistry.\n   */\n  public clear() {\n    this.schemas.clear();\n    this.exceptions.clear();\n  }\n\n  private normalizeShapeId(shapeId: string) {\n    if (shapeId.includes(\"#\")) {\n      return shapeId;\n    }\n    return this.namespace + \"#\" + shapeId;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/schema/deref.ts",
    "content": "import type { Schema, SchemaRef } from \"@smithy/types\";\n\n/**\n * Dereferences a SchemaRef if needed.\n * @internal\n */\nexport const deref = (schemaRef: SchemaRef): Schema => {\n  if (typeof schemaRef === \"function\") {\n    return schemaRef();\n  }\n  return schemaRef;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/schema/index.ts",
    "content": "export * from \"./deref\";\nexport * from \"./middleware/getSchemaSerdePlugin\";\nexport * from \"./schemas/ListSchema\";\nexport * from \"./schemas/MapSchema\";\nexport * from \"./schemas/OperationSchema\";\nexport * from \"./schemas/operation\";\nexport * from \"./schemas/ErrorSchema\";\nexport * from \"./schemas/NormalizedSchema\";\nexport * from \"./schemas/Schema\";\nexport * from \"./schemas/SimpleSchema\";\nexport * from \"./schemas/StructureSchema\";\nexport * from \"./schemas/sentinels\";\nexport * from \"./schemas/translateTraits\";\nexport * from \"./TypeRegistry\";\n"
  },
  {
    "path": "packages/core/src/submodules/schema/middleware/getSchemaSerdePlugin.ts",
    "content": "import type {\n  DeserializeHandlerOptions,\n  MetadataBearer,\n  MiddlewareStack,\n  Pluggable,\n  SerdeFunctions,\n  SerializeHandlerOptions,\n} from \"@smithy/types\";\n\nimport type { PreviouslyResolved } from \"./schema-middleware-types\";\nimport { schemaDeserializationMiddleware } from \"./schemaDeserializationMiddleware\";\nimport { schemaSerializationMiddleware } from \"./schemaSerializationMiddleware\";\n\n/**\n * @internal\n */\nexport const deserializerMiddlewareOption: DeserializeHandlerOptions = {\n  name: \"deserializerMiddleware\",\n  step: \"deserialize\",\n  tags: [\"DESERIALIZER\"],\n  override: true,\n};\n\n/**\n * @internal\n */\nexport const serializerMiddlewareOption: SerializeHandlerOptions = {\n  name: \"serializerMiddleware\",\n  step: \"serialize\",\n  tags: [\"SERIALIZER\"],\n  override: true,\n};\n\n/**\n * @internal\n */\nexport function getSchemaSerdePlugin<InputType extends object = any, OutputType extends MetadataBearer = any>(\n  config: PreviouslyResolved\n): Pluggable<InputType, OutputType> {\n  return {\n    applyToStack: (commandStack: MiddlewareStack<InputType, OutputType>) => {\n      commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);\n      commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);\n      // `config` is fully resolved at the point of applying plugins.\n      // As such, config qualifies as SerdeContext.\n      config.protocol.setSerdeContext(config as SerdeFunctions);\n    },\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/schema/middleware/schema-middleware-types.ts",
    "content": "import type { ClientProtocol, SerdeContext, UrlParser } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport type PreviouslyResolved = Omit<\n  SerdeContext & {\n    urlParser: UrlParser;\n    protocol: ClientProtocol<any, any>;\n  },\n  \"endpoint\"\n>;\n"
  },
  {
    "path": "packages/core/src/submodules/schema/middleware/schemaDeserializationMiddleware.spec.ts",
    "content": "import { HttpResponse } from \"@smithy/protocol-http\";\nimport type { SchemaRef } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { schemaDeserializationMiddleware } from \"./schemaDeserializationMiddleware\";\n\ndescribe(schemaDeserializationMiddleware.name, () => {\n  const mockNext = vi.fn();\n  const mockDeserializer = vi.fn();\n\n  const mockProtocol = {\n    deserializeResponse: mockDeserializer,\n  };\n\n  const mockOptions = {\n    endpoint: () =>\n      Promise.resolve({\n        protocol: \"protocol\",\n        hostname: \"hostname\",\n        path: \"path\",\n      }),\n    protocol: mockProtocol,\n  } as any;\n\n  const mockOptionsDeserializationError = {\n    ...mockOptions,\n    protocol: {\n      async deserializeResponse() {\n        JSON.parse(`this isn't JSON`);\n      },\n    } as any,\n  } as any;\n\n  const mockArgs = {\n    input: {\n      inputKey: \"inputValue\",\n    },\n    request: {\n      method: \"GET\",\n      headers: {},\n    },\n  };\n\n  const mockOutput = {\n    $metadata: {\n      statusCode: 200,\n      requestId: \"requestId\",\n    },\n    outputKey: \"outputValue\",\n  };\n\n  const mockNextResponse = {\n    response: {\n      statusCode: 200,\n      headers: {},\n    },\n    $metadata: {\n      httpStatusCode: 200,\n      requestId: undefined,\n      extendedRequestId: undefined,\n      cfId: undefined,\n    },\n  };\n\n  const mockResponse = {\n    response: mockNextResponse.response,\n    output: mockOutput,\n  };\n\n  beforeEach(() => {\n    mockNext.mockResolvedValueOnce(mockNextResponse);\n    mockDeserializer.mockResolvedValueOnce(mockOutput);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"calls deserializer and populates response object\", async () => {\n    await expect(schemaDeserializationMiddleware(mockOptions)(mockNext, {})(mockArgs)).resolves.toStrictEqual(\n      mockResponse\n    );\n\n    expect(mockNext).toHaveBeenCalledTimes(1);\n    expect(mockNext).toHaveBeenCalledWith(mockArgs);\n    expect(mockDeserializer).toHaveBeenCalledTimes(1);\n    expect(mockDeserializer).toHaveBeenCalledWith(\n      {},\n      {\n        ...mockOptions,\n        __smithy_context: {},\n      },\n      mockNextResponse.response\n    );\n  });\n\n  it(\"injects non-enumerable $response reference to deserializing exceptions\", async () => {\n    const exception = Object.assign(new Error(\"MockException\"), mockNextResponse.response);\n    mockDeserializer.mockReset();\n    mockDeserializer.mockRejectedValueOnce(exception);\n    try {\n      await schemaDeserializationMiddleware(mockOptions)(mockNext, {})(mockArgs);\n      fail(\"DeserializerMiddleware should throw\");\n    } catch (e) {\n      expect(e).toMatchObject(exception);\n      expect(e.$response).toEqual(mockNextResponse.response);\n      expect(Object.keys(e)).not.toContain(\"$response\");\n    }\n  });\n\n  it(\"adds a hint about $response to the message of the thrown error\", async () => {\n    const exception = Object.assign(new Error(\"MockException\"), mockNextResponse.response, {\n      $response: {\n        body: \"\",\n      },\n      $responseBodyText: \"oh no\",\n    });\n    mockDeserializer.mockReset();\n    mockDeserializer.mockRejectedValueOnce(exception);\n    try {\n      await schemaDeserializationMiddleware(mockOptions)(mockNext, {})(mockArgs);\n      fail(\"DeserializerMiddleware should throw\");\n    } catch (e) {\n      expect(e.message).toContain(\n        \"to see the raw response, inspect the hidden field {error}.$response on this object.\"\n      );\n      expect(e.$response.body).toEqual(\"oh no\");\n    }\n  });\n\n  it(\"handles unwritable error.message\", async () => {\n    const exception = Object.assign({}, mockNextResponse.response, {\n      $response: {\n        body: \"\",\n      },\n      $responseBodyText: \"oh no\",\n    });\n\n    Object.defineProperty(exception, \"message\", {\n      set() {\n        throw new Error(\"may not call setter\");\n      },\n      get() {\n        return \"MockException\";\n      },\n    });\n\n    const sink = vi.fn();\n\n    mockDeserializer.mockReset();\n    mockDeserializer.mockRejectedValueOnce(exception);\n    try {\n      await schemaDeserializationMiddleware(mockOptions)(mockNext, {\n        logger: {\n          debug: sink,\n          info: sink,\n          warn: sink,\n          error: sink,\n        },\n      })(mockArgs);\n      fail(\"DeserializerMiddleware should throw\");\n    } catch (e) {\n      expect(sink).toHaveBeenCalledWith(\n        `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`\n      );\n      expect(e.message).toEqual(\"MockException\");\n      expect(e.$response.body).toEqual(\"oh no\");\n    }\n  });\n\n  describe(\"metadata\", () => {\n    it(\"assigns metadata from the response in the event of a deserializer failure\", async () => {\n      const midware = schemaDeserializationMiddleware(mockOptionsDeserializationError);\n      const handler = midware(\n        async () => ({\n          response: new HttpResponse({\n            headers: {\n              \"x-namespace-requestid\": \"requestid\",\n              \"x-namespace-id-2\": \"id2\",\n              \"x-namespace-cf-id\": \"cf\",\n            },\n            statusCode: 503,\n          }),\n        }),\n        {\n          __smithy_context: {\n            operationSchema: [9, \"\", \"\", 0, \"unit\", \"unit\"],\n          },\n        }\n      );\n      try {\n        await handler(mockArgs);\n        fail(\"DeserializerMiddleware should throw\");\n      } catch (e) {\n        expect(e.$metadata).toEqual({\n          httpStatusCode: 503,\n          requestId: \"requestid\",\n          extendedRequestId: \"id2\",\n          cfId: \"cf\",\n        });\n      }\n      expect.assertions(1);\n    });\n\n    it(\"assigns any available metadata from the response in the event of a deserializer failure\", async () => {\n      const midware = schemaDeserializationMiddleware(mockOptionsDeserializationError);\n      const handler = midware(\n        async () => ({\n          response: new HttpResponse({\n            statusCode: 301,\n            headers: {\n              \"x-namespace-requestid\": \"requestid\",\n            },\n          }),\n        }),\n        {\n          __smithy_context: {\n            operationSchema: [9, \"\", \"\", 0, \"unit\", \"unit\"],\n          },\n        }\n      );\n      try {\n        await handler(mockArgs);\n        fail(\"DeserializerMiddleware should throw\");\n      } catch (e) {\n        expect(e.$metadata).toEqual({\n          httpStatusCode: 301,\n          requestId: \"requestid\",\n          extendedRequestId: undefined,\n          cfId: undefined,\n        });\n      }\n      expect.assertions(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/middleware/schemaDeserializationMiddleware.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport { HttpResponse } from \"@smithy/core/protocols\";\nimport type {\n  DeserializeHandler,\n  DeserializeHandlerArguments,\n  HandlerExecutionContext,\n  MetadataBearer,\n  StaticOperationSchema,\n} from \"@smithy/types\";\n\nimport { operation } from \"../schemas/operation\";\nimport type { PreviouslyResolved } from \"./schema-middleware-types\";\n\n/**\n * @internal\n */\nexport const schemaDeserializationMiddleware =\n  <O>(config: PreviouslyResolved) =>\n  (next: DeserializeHandler<any, any>, context: HandlerExecutionContext) =>\n  async (args: DeserializeHandlerArguments<any>) => {\n    const { response } = await next(args);\n    const { operationSchema } = getSmithyContext(context) as {\n      operationSchema: StaticOperationSchema;\n    };\n    const [, ns, n, t, i, o] = operationSchema ?? [];\n\n    try {\n      const parsed = await config.protocol.deserializeResponse(\n        operation(ns, n, t, i, o),\n        {\n          ...config,\n          ...context,\n        },\n        response\n      );\n      return {\n        response,\n        output: parsed as O,\n      };\n    } catch (error) {\n      // For security reasons, the error response is not completely visible by default.\n      Object.defineProperty(error, \"$response\", {\n        value: response,\n        // we need to define these properties explicitly because\n        // the service exception class may have set the value to undefined, but populated the key.\n        enumerable: false,\n        writable: false,\n        configurable: false,\n      });\n\n      if (!(\"$metadata\" in error)) {\n        // only apply this to non-ServiceException.\n        const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;\n        try {\n          error.message += \"\\n  \" + hint;\n        } catch (e) {\n          // Error with an unwritable message (strict mode getter with no setter).\n          if (!context.logger || context.logger?.constructor?.name === \"NoOpLogger\") {\n            console.warn(hint);\n          } else {\n            context.logger?.warn?.(hint);\n          }\n        }\n\n        if (typeof error.$responseBodyText !== \"undefined\") {\n          // if $responseBodyText was collected by the error parser, assign it to\n          // replace the response body, because it was consumed and is now empty.\n          if (error.$response) {\n            error.$response.body = error.$responseBodyText;\n          }\n        }\n\n        try {\n          // if the deserializer failed, then $metadata may still be set\n          // by taking information from the response.\n          if (HttpResponse.isInstance(response)) {\n            const { headers = {} } = response;\n            const headerEntries = Object.entries(headers);\n            (error as MetadataBearer).$metadata = {\n              httpStatusCode: response.statusCode,\n              requestId: findHeader(/^x-[\\w-]+-request-?id$/, headerEntries),\n              extendedRequestId: findHeader(/^x-[\\w-]+-id-2$/, headerEntries),\n              cfId: findHeader(/^x-[\\w-]+-cf-id$/, headerEntries),\n            };\n          }\n        } catch (e) {\n          // ignored, error object was not writable.\n        }\n      }\n\n      throw error;\n    }\n  };\n\n/**\n * @internal\n * @returns header value where key matches regex.\n */\nconst findHeader = (pattern: RegExp, headers: [string, string][]): string | undefined => {\n  return (headers.find(([k]) => {\n    return k.match(pattern);\n  }) || [void 0, void 1])[1];\n};\n"
  },
  {
    "path": "packages/core/src/submodules/schema/middleware/schemaSerializationMiddleware.spec.ts",
    "content": "import type { SchemaRef } from \"@smithy/types\";\nimport { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { schemaSerializationMiddleware } from \"./schemaSerializationMiddleware\";\n\ndescribe(schemaSerializationMiddleware.name, () => {\n  const mockNext = vi.fn();\n  const mockSerializer = vi.fn();\n\n  const mockProtocol = {\n    serializeRequest: mockSerializer,\n  };\n\n  const mockOptions = {\n    endpoint: () =>\n      Promise.resolve({\n        protocol: \"protocol\",\n        hostname: \"hostname\",\n        path: \"path\",\n      }),\n    protocol: mockProtocol,\n  } as any;\n\n  const mockRequest = {\n    method: \"GET\",\n    headers: {},\n  };\n\n  const mockResponse = {\n    statusCode: 200,\n    headers: {},\n  };\n\n  const mockOutput = {\n    $metadata: {\n      statusCode: 200,\n      requestId: \"requestId\",\n    },\n    outputKey: \"outputValue\",\n  };\n\n  const mockReturn = {\n    response: mockResponse,\n    output: mockOutput,\n  };\n\n  const mockArgs = {\n    input: {\n      inputKey: \"inputValue\",\n    },\n  };\n\n  beforeEach(() => {\n    mockNext.mockResolvedValueOnce(mockReturn);\n    mockSerializer.mockResolvedValueOnce(mockRequest);\n  });\n\n  it(\"calls serializer and populates request object\", async () => {\n    await expect(schemaSerializationMiddleware(mockOptions)(mockNext, {})(mockArgs)).resolves.toStrictEqual(mockReturn);\n\n    expect(mockSerializer).toHaveBeenCalledTimes(1);\n    expect(mockSerializer).toHaveBeenCalledWith({}, mockArgs.input, {\n      ...mockOptions,\n      __smithy_context: {},\n    });\n    expect(mockNext).toHaveBeenCalledTimes(1);\n    expect(mockNext).toHaveBeenCalledWith({ ...mockArgs, request: mockRequest });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/middleware/schemaSerializationMiddleware.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport { toEndpointV1 } from \"@smithy/core/endpoints\";\nimport type {\n  EndpointBearer,\n  HandlerExecutionContext,\n  SerializeHandler,\n  SerializeHandlerArguments,\n  StaticOperationSchema,\n} from \"@smithy/types\";\n\nimport { operation } from \"../schemas/operation\";\nimport type { PreviouslyResolved } from \"./schema-middleware-types\";\n\n/**\n * @internal\n */\nexport const schemaSerializationMiddleware =\n  (config: PreviouslyResolved) =>\n  (next: SerializeHandler<any, any>, context: HandlerExecutionContext) =>\n  async (args: SerializeHandlerArguments<any>) => {\n    const { operationSchema } = getSmithyContext(context) as {\n      operationSchema: StaticOperationSchema;\n    };\n    const [, ns, n, t, i, o] = operationSchema ?? [];\n\n    const endpoint = context.endpointV2\n      ? async () => toEndpointV1(context.endpointV2!)\n      : (config as unknown as EndpointBearer).endpoint!;\n\n    const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, {\n      ...config,\n      ...context,\n      endpoint,\n    });\n    return next({\n      ...args,\n      request,\n    });\n  };\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/ErrorSchema.ts",
    "content": "import type { SchemaRef, SchemaTraits } from \"@smithy/types\";\n\nimport { Schema } from \"./Schema\";\nimport { StructureSchema } from \"./StructureSchema\";\n\n/**\n * A schema for a structure shape having the error trait. These represent enumerated operation errors.\n * Because Smithy-TS SDKs use classes for exceptions, whereas plain objects are used for all other data,\n * and have an existing notion of a XYZServiceBaseException, the ErrorSchema differs from a StructureSchema\n * by additionally holding the class reference for the corresponding ServiceException class.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport class ErrorSchema extends StructureSchema {\n  public static readonly symbol = Symbol.for(\"@smithy/err\");\n  /**\n   * @deprecated - field unused.\n   */\n  public ctor!: any;\n  protected readonly symbol = ErrorSchema.symbol;\n}\n\n/**\n * Factory for ErrorSchema, to reduce codegen output and register the schema.\n *\n * @internal\n * @deprecated use StaticSchema\n *\n * @param namespace - shapeId namespace.\n * @param name - shapeId name.\n * @param traits - shape level serde traits.\n * @param memberNames - list of member names.\n * @param memberList - list of schemaRef corresponding to each\n * @param ctor - class reference for the existing Error extending class.\n */\nexport const error = (\n  namespace: string,\n  name: string,\n  traits: SchemaTraits,\n  memberNames: string[],\n  memberList: SchemaRef[],\n  /**\n   * @deprecated - field unused.\n   */\n  ctor?: any\n): ErrorSchema =>\n  Schema.assign(new ErrorSchema(), {\n    name,\n    namespace,\n    traits,\n    memberNames,\n    memberList,\n    ctor: null,\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/ListSchema.ts",
    "content": "import type { ListSchema as IListSchema, SchemaRef, SchemaTraits } from \"@smithy/types\";\n\nimport { Schema } from \"./Schema\";\n\n/**\n * A schema with a single member schema.\n * The deprecated Set type may be represented as a list.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport class ListSchema extends Schema implements IListSchema {\n  public static readonly symbol = Symbol.for(\"@smithy/lis\");\n  public name!: string;\n  public traits!: SchemaTraits;\n  public valueSchema!: SchemaRef;\n  protected readonly symbol = ListSchema.symbol;\n}\n\n/**\n * Factory for ListSchema.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport const list = (namespace: string, name: string, traits: SchemaTraits, valueSchema: SchemaRef): ListSchema =>\n  Schema.assign(new ListSchema(), {\n    name,\n    namespace,\n    traits,\n    valueSchema,\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/MapSchema.ts",
    "content": "import type { MapSchema as IMapSchema, SchemaRef, SchemaTraits } from \"@smithy/types\";\n\nimport { Schema } from \"./Schema\";\n\n/**\n * A schema with a key schema and value schema.\n * @internal\n * @deprecated use StaticSchema\n */\nexport class MapSchema extends Schema implements IMapSchema {\n  public static readonly symbol = Symbol.for(\"@smithy/map\");\n  public name!: string;\n  public traits!: SchemaTraits;\n  /**\n   * This is expected to be StringSchema, but may have traits.\n   */\n  public keySchema!: SchemaRef;\n  public valueSchema!: SchemaRef;\n  protected readonly symbol = MapSchema.symbol;\n}\n\n/**\n * Factory for MapSchema.\n * @internal\n * @deprecated use StaticSchema\n */\nexport const map = (\n  namespace: string,\n  name: string,\n  traits: SchemaTraits,\n  keySchema: SchemaRef,\n  valueSchema: SchemaRef\n): MapSchema =>\n  Schema.assign(new MapSchema(), {\n    name,\n    namespace,\n    traits,\n    keySchema,\n    valueSchema,\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/NormalizedSchema.spec.ts",
    "content": "import type {\n  $MemberSchema,\n  BigDecimalSchema,\n  BigIntegerSchema,\n  BlobSchema,\n  BooleanSchema,\n  DocumentSchema,\n  ListSchemaModifier,\n  MapSchemaModifier,\n  NumericSchema,\n  StaticListSchema,\n  StaticMapSchema,\n  StaticSimpleSchema,\n  StaticStructureSchema,\n  StaticUnionSchema,\n  StreamingBlobSchema,\n  StringSchema,\n  TimestampDefaultSchema,\n} from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { NormalizedSchema } from \"./NormalizedSchema\";\nimport { translateTraits } from \"./translateTraits\";\n\ndescribe(NormalizedSchema.name, () => {\n  const [List, Map, Struct, Union]: [\n    StaticListSchema,\n    StaticMapSchema,\n    () => StaticStructureSchema,\n    StaticUnionSchema,\n  ] = [\n    [1, \"ack\", \"List\", { sparse: 1 }, 0] satisfies StaticListSchema,\n    [2, \"ack\", \"Map\", 0, 0, 1] satisfies StaticMapSchema,\n    () => schema,\n    [4, \"ack\", \"Union\", 0, [\"a\", \"b\", \"c\"], [\"unit\", 0, 128]],\n  ];\n  const schema: StaticStructureSchema = [\n    3,\n    \"ack\",\n    \"Structure\",\n    {},\n    [\"list\", \"map\", \"struct\", \"union\"],\n    [List, Map, Struct, Union],\n  ];\n\n  const ns = NormalizedSchema.of(schema);\n  const nsFromIndirect = NormalizedSchema.of(() => ns);\n\n  it(\"has a static constructor\", () => {\n    expect(NormalizedSchema.of(ns)).toBeInstanceOf(NormalizedSchema);\n  });\n\n  it(\"has a name\", () => {\n    expect(ns.getName()).toEqual(\"Structure\");\n    expect(ns.getName(true)).toEqual(\"ack#Structure\");\n  });\n\n  describe(\"inner schema\", () => {\n    it(\"has an inner schema\", () => {\n      // intentional reference equality comparison.\n      expect(ns.getSchema()).toBe(schema);\n    });\n    it(\"peels NormalizedSchema from its input schemaRef\", () => {\n      const layered = NormalizedSchema.of(\n        NormalizedSchema.of(NormalizedSchema.of(NormalizedSchema.of(NormalizedSchema.of(nsFromIndirect))))\n      );\n      // intentional reference equality comparison.\n      expect(layered.getSchema()).toBe(schema);\n    });\n  });\n\n  it(\"translates a bitvector of traits to a traits object\", () => {\n    expect(translateTraits(0b0000_0000)).toEqual({});\n    expect(translateTraits(0b0000_0001)).toEqual({\n      httpLabel: 1,\n    });\n    expect(translateTraits(0b0000_0011)).toEqual({\n      httpLabel: 1,\n      idempotent: 1,\n    });\n    expect(translateTraits(0b0000_0110)).toEqual({\n      idempotent: 1,\n      idempotencyToken: 1,\n    });\n    expect(translateTraits(0b0000_1100)).toEqual({\n      idempotencyToken: 1,\n      sensitive: 1,\n    });\n    expect(translateTraits(0b0001_1000)).toEqual({\n      sensitive: 1,\n      httpPayload: 1,\n    });\n    expect(translateTraits(0b0011_0000)).toEqual({\n      httpPayload: 1,\n      httpResponseCode: 1,\n    });\n    expect(translateTraits(0b0110_0000)).toEqual({\n      httpResponseCode: 1,\n      httpQueryParams: 1,\n    });\n  });\n\n  describe(\"member schema\", () => {\n    const member = ns.getMemberSchema(\"list\");\n\n    it(\"can represent a member schema\", () => {\n      expect(member).toBeInstanceOf(NormalizedSchema);\n      expect(member.isMemberSchema()).toBe(true);\n      expect(member.isListSchema()).toBe(true);\n      expect(member.getSchema()).toBe(List);\n      expect(member.getMemberName()).toBe(\"list\");\n    });\n  });\n\n  describe(\"traversal and type identifiers\", () => {\n    it(\"type identifiers\", () => {\n      expect(NormalizedSchema.of(\"unit\").isUnitSchema()).toBe(true);\n      expect(NormalizedSchema.of((64 satisfies ListSchemaModifier) | (1 satisfies NumericSchema)).isListSchema()).toBe(\n        true\n      );\n      expect(NormalizedSchema.of((128 satisfies MapSchemaModifier) | (1 satisfies NumericSchema)).isMapSchema()).toBe(\n        true\n      );\n\n      expect(NormalizedSchema.of(15 satisfies DocumentSchema).isDocumentSchema()).toBe(true);\n\n      expect(NormalizedSchema.of(ns.getMemberSchema(\"struct\")).isStructSchema()).toBe(true);\n      expect(NormalizedSchema.of(21 satisfies BlobSchema).isBlobSchema()).toBe(true);\n      expect(NormalizedSchema.of(4 satisfies TimestampDefaultSchema).isTimestampSchema()).toBe(true);\n\n      expect(NormalizedSchema.of(0 satisfies StringSchema).isStringSchema()).toBe(true);\n      expect(NormalizedSchema.of(2 satisfies BooleanSchema).isBooleanSchema()).toBe(true);\n      expect(NormalizedSchema.of(1 satisfies NumericSchema).isNumericSchema()).toBe(true);\n      expect(NormalizedSchema.of(17 satisfies BigIntegerSchema).isBigIntegerSchema()).toBe(true);\n      expect(NormalizedSchema.of(19 satisfies BigDecimalSchema).isBigDecimalSchema()).toBe(true);\n      expect(NormalizedSchema.of(42 satisfies StreamingBlobSchema).isStreaming()).toBe(true);\n\n      const structWithStreamingMember = [\n        3,\n        \"ack\",\n        \"StructWithStreamingMember\",\n        0,\n        [\"m\"],\n        [[0, \"ns\", \"blob\", { streaming: 1 }, 21 as BlobSchema] satisfies StaticSimpleSchema],\n      ] satisfies StaticStructureSchema;\n      expect(NormalizedSchema.of(structWithStreamingMember).getMemberSchema(\"m\").isStreaming()).toBe(true);\n    });\n\n    describe(\"list member\", () => {\n      it(\"list itself\", () => {\n        const member = ns.getMemberSchema(\"list\");\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isListSchema()).toBe(true);\n        expect(member.getSchema()).toBe(List);\n        expect(member.getMemberName()).toBe(\"list\");\n      });\n      it(\"list value member\", () => {\n        const member = ns.getMemberSchema(\"list\").getValueSchema();\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isListSchema()).toBe(false);\n        expect(member.isStringSchema()).toBe(true);\n        expect(member.getSchema()).toBe(0);\n        expect(member.getMemberName()).toBe(\"member\");\n      });\n    });\n    describe(\"map member\", () => {\n      it(\"map itself\", () => {\n        const member = ns.getMemberSchema(\"map\");\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isMapSchema()).toBe(true);\n        expect(member.getSchema()).toBe(Map);\n        expect(member.getMemberName()).toBe(\"map\");\n      });\n      it(\"map key member\", () => {\n        const member = ns.getMemberSchema(\"map\").getKeySchema();\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isNumericSchema()).toBe(false);\n        expect(member.isStringSchema()).toBe(true);\n        expect(member.getSchema()).toBe(0);\n        expect(member.getMemberName()).toBe(\"key\");\n      });\n      it(\"should return a defined key schema even if the map was defined by a numeric sentinel value\", () => {\n        const map = NormalizedSchema.of((128 satisfies MapSchemaModifier) | (1 satisfies NumericSchema));\n        expect(map.getKeySchema().isStringSchema()).toBe(true);\n        expect(map.getValueSchema().isNumericSchema()).toBe(true);\n      });\n      it(\"map value member\", () => {\n        const member = ns.getMemberSchema(\"map\").getValueSchema();\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isNumericSchema()).toBe(true);\n        expect(member.isStringSchema()).toBe(false);\n        expect(member.getSchema()).toBe(1);\n        expect(member.getMemberName()).toBe(\"value\");\n      });\n    });\n    describe(\"struct member\", () => {\n      it(\"struct member\", () => {\n        const member = ns.getMemberSchema(\"struct\");\n        expect(member.getName(true)).toBe(\"ack#Structure\");\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isListSchema()).toBe(false);\n        expect(member.isMapSchema()).toBe(false);\n        expect(member.isStructSchema()).toBe(true);\n        expect(member.getMemberName()).toBe(\"struct\");\n      });\n      it(\"nested recursion\", () => {\n        expect(ns.getMemberSchema(\"struct\").isStructSchema()).toBe(true);\n        expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"list\").isListSchema()).toBe(true);\n        expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"map\").isMapSchema()).toBe(true);\n        expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"struct\").isStructSchema()).toBe(true);\n\n        expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"struct\").getMemberSchema(\"list\").getName(true)).toBe(\n          ns.getMemberSchema(\"list\").getName(true)\n        );\n      });\n    });\n    describe(\"union member\", () => {\n      it(\"is a union and a struct\", () => {\n        const member = ns.getMemberSchema(\"union\");\n        expect(member.getName(true)).toBe(\"ack#Union\");\n        expect(member.isMemberSchema()).toBe(true);\n        expect(member.isListSchema()).toBe(false);\n        expect(member.isMapSchema()).toBe(false);\n        expect(member.isStructSchema()).toBe(true);\n        expect(member.isUnionSchema()).toBe(true);\n        expect(member.getMemberName()).toBe(\"union\");\n\n        expect(member.getMemberSchema(\"a\").isUnitSchema()).toBe(true);\n        expect(member.getMemberSchema(\"b\").isStringSchema()).toBe(true);\n        expect(member.getMemberSchema(\"c\").isMapSchema()).toBe(true);\n      });\n    });\n  });\n\n  describe(\"iteration\", () => {\n    it(\"iterates over member schemas\", () => {\n      const iteration = Array.from(ns.structIterator()) as [string, NormalizedSchema][];\n      const entries = Object.entries(ns.getMemberSchemas()) as [string, NormalizedSchema][];\n      for (let i = 0; i < iteration.length; i++) {\n        const [name, schema] = iteration[i];\n        const [entryName, entrySchema] = entries[i];\n        expect(name).toBe(entryName);\n        expect(schema.getMemberName()).toEqual(entrySchema.getMemberName());\n        expect(schema.getMergedTraits()).toEqual(entrySchema.getMergedTraits());\n      }\n    });\n\n    it(\"can acquire structIterator on the unit schema type and its iteration is empty\", () => {\n      const iteration = Array.from(NormalizedSchema.of(\"unit\").structIterator());\n      expect(iteration.length).toBe(0);\n    });\n  });\n\n  describe(\"traits\", () => {\n    const member: $MemberSchema = [\n      [0, \"ack\", \"SimpleString\", { idempotencyToken: 1 }, 0] satisfies StaticSimpleSchema,\n      0b0000_0001,\n    ];\n    const container: StaticStructureSchema = [3, \"ack\", \"Container\", 0, [\"member_name\"], [member, 0]];\n\n    const ns = NormalizedSchema.of(container).getMemberSchema(\"member_name\");\n\n    it(\"has merged traits\", () => {\n      expect(ns.getMergedTraits()).toEqual({\n        idempotencyToken: 1,\n        httpLabel: 1,\n      });\n    });\n    it(\"has member traits if it is a member\", () => {\n      expect(ns.isMemberSchema()).toBe(true);\n      expect(ns.getMemberTraits()).toEqual({\n        httpLabel: 1,\n      });\n    });\n    it(\"has own traits\", () => {\n      expect(ns.getOwnTraits()).toEqual({\n        idempotencyToken: 1,\n      });\n    });\n  });\n\n  describe(\"idempotency token detection\", () => {\n    const idempotencyTokenSchemas = [\n      NormalizedSchema.of([0, \"\", \"StringWithTraits\", 0b0100, 0] satisfies StaticSimpleSchema),\n      NormalizedSchema.of([0, \"\", \"StringWithTraits\", { idempotencyToken: 1 }, 0] satisfies StaticSimpleSchema),\n    ];\n\n    const plainSchemas = [\n      NormalizedSchema.of(0),\n      NormalizedSchema.of([0, \"\", \"StringWithTraits\", 0, 0] satisfies StaticSimpleSchema),\n      NormalizedSchema.of([0, \"\", \"StringWithTraits\", {}, 0] satisfies StaticSimpleSchema),\n    ];\n\n    it(\"has a consistent shortcut method for idempotencyToken detection\", () => {\n      for (const schema of idempotencyTokenSchemas) {\n        expect(schema.isIdempotencyToken()).toBe(true);\n        expect(schema.getMergedTraits().idempotencyToken).toBe(1);\n      }\n\n      for (const schema of plainSchemas) {\n        expect(schema.isIdempotencyToken()).toBe(false);\n        expect(schema.getMergedTraits().idempotencyToken).toBe(undefined);\n      }\n    });\n\n    it(\"can understand members with the idempotencyToken trait\", () => {\n      for (const schema of plainSchemas) {\n        expect(schema.isIdempotencyToken()).toBe(false);\n        expect(schema.getMergedTraits().idempotencyToken).toBe(undefined);\n\n        const structure = [\n          3,\n          \"\",\n          \"StructureWithIdempotencyTokenMember\",\n          0,\n          [\"token\"],\n          [[() => schema, 0b0100]],\n        ] satisfies StaticStructureSchema;\n        const ns = NormalizedSchema.of(structure).getMemberSchema(\"token\");\n\n        expect(ns.isIdempotencyToken()).toBe(true);\n      }\n    });\n  });\n\n  describe(\"event stream detection\", () => {\n    it(\"should retrieve the event stream member\", () => {\n      const schema: StaticStructureSchema = [\n        3,\n        \"ns\",\n        \"StructureWithEventStream\",\n        0,\n        [\"A\", \"B\", \"C\", \"D\", \"EventStream\"],\n        [0, 0, 0, 0, [3, \"ns\", \"Union\", { streaming: 1 }, [], []] satisfies StaticStructureSchema],\n      ];\n      const ns = NormalizedSchema.of(schema);\n\n      expect(ns.getEventStreamMember()).toEqual(\"EventStream\");\n    });\n\n    it(\"should return empty string if no event stream member is present\", () => {\n      const schema: StaticStructureSchema = [\n        3,\n        \"ns\",\n        \"StructureWithEventStream\",\n        0,\n        [\"A\", \"B\", \"C\", \"D\", \"EventStream\"],\n        [0, 0, 0, 0, [3, \"ns\", \"Union\", 0, [], []] satisfies StaticStructureSchema],\n      ];\n      const ns = NormalizedSchema.of(schema);\n\n      expect(ns.getEventStreamMember()).toEqual(\"\");\n    });\n\n    it(\"should not throw an exception if the NormalizedSchema is not a structure\", () => {\n      const schema = 0;\n      const ns = NormalizedSchema.of(schema);\n\n      expect(ns.getEventStreamMember()).toEqual(\"\");\n    });\n  });\n\n  describe(\"static schema\", () => {\n    it(\"can normalize static schema indifferently to schema class objects\", () => {\n      const [List, Map, Struct]: [StaticListSchema, StaticMapSchema, () => StaticStructureSchema] = [\n        [1, \"ack\", \"List\", { sparse: 1 }, 0],\n        [2, \"ack\", \"Map\", 0, 0, 1],\n        () => schema,\n      ];\n      const schema: StaticStructureSchema = [3, \"ack\", \"Structure\", {}, [\"list\", \"map\", \"struct\"], [List, Map, Struct]];\n\n      const ns = NormalizedSchema.of(schema);\n\n      expect(ns.isStructSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"list\").isListSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"list\").getMergedTraits().sparse).toBe(1);\n\n      expect(ns.getMemberSchema(\"map\").isMapSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"map\").getKeySchema().isStringSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"map\").getValueSchema().isNumericSchema()).toBe(true);\n\n      expect(ns.getMemberSchema(\"struct\").isStructSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"list\").isListSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"list\").getMergedTraits().sparse).toBe(1);\n      expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"map\").isMapSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"map\").getKeySchema().isStringSchema()).toBe(true);\n      expect(ns.getMemberSchema(\"struct\").getMemberSchema(\"map\").getValueSchema().isNumericSchema()).toBe(true);\n    });\n  });\n\n  describe(\"simple schema wrapper\", () => {\n    it(\"should still be able to detect the inner schema type\", () => {\n      const schema: StaticSimpleSchema = [0, \"ack\", \"String\", { unknownTrait: 1 }, 0];\n\n      const ns = NormalizedSchema.of(schema);\n      expect(ns.isStringSchema()).toBe(true);\n    });\n  });\n});\n\ndescribe(\"schema initialization performance\", () => {\n  it(\"throughput - object\", () => {\n    const schema: StaticStructureSchema = [3, \"ns\", \"CachedStruct\", 0, [\"a\"], [0]];\n\n    const start = performance.now();\n    for (let i = 0; i < 1_000_000; ++i) {\n      NormalizedSchema.of(schema);\n    }\n    const end = performance.now();\n\n    // it's 8ms on kuhe's computer.\n    expect(end - start).toBeLessThanOrEqual(200);\n  });\n\n  it(\"throughput - string sentinel\", () => {\n    const schema = \"unit\" as const;\n\n    const start = performance.now();\n    for (let i = 0; i < 1_000_000; ++i) {\n      NormalizedSchema.of(schema);\n    }\n    const end = performance.now();\n\n    // it's 8ms on kuhe's computer.\n    expect(end - start).toBeLessThanOrEqual(200);\n  });\n\n  it(\"throughput - numeric sentinel\", () => {\n    const schema: StringSchema = 0;\n\n    const start = performance.now();\n    for (let i = 0; i < 1_000_000; ++i) {\n      NormalizedSchema.of(schema);\n    }\n    const end = performance.now();\n\n    // it's 8ms on kuhe's computer.\n    expect(end - start).toBeLessThanOrEqual(200);\n  });\n});\n\ndescribe(\"NormalizedSchema.of() caching\", () => {\n  it(\"returns the same instance for repeated calls with the same object-type schema\", () => {\n    const schema: StaticStructureSchema = [3, \"ns\", \"CachedStruct\", 0, [\"a\"], [0]];\n    const first = NormalizedSchema.of(schema);\n    const second = NormalizedSchema.of(schema);\n    expect(second).toBe(first);\n  });\n\n  it(\"returns the same NormalizedSchema instance when passed to of()\", () => {\n    const schema: StaticStructureSchema = [3, \"ns\", \"PassThrough\", 0, [\"a\"], [0]];\n    const ns = NormalizedSchema.of(schema);\n    const result = NormalizedSchema.of(ns);\n    expect(result).toBe(ns);\n  });\n\n  it(\"cached instances produce correct getSchema(), getName(), and getMergedTraits()\", () => {\n    const schema: StaticStructureSchema = [3, \"ns\", \"Equiv\", { sensitive: 1 }, [\"x\"], [0]];\n    const first = NormalizedSchema.of(schema);\n    const second = NormalizedSchema.of(schema);\n\n    // same cached instance\n    expect(second).toBe(first);\n\n    // correct results from cached instance\n    expect(first.getSchema()).toBe(schema);\n    expect(first.getName()).toBe(\"Equiv\");\n    expect(first.getName(true)).toBe(\"ns#Equiv\");\n    expect(first.getMergedTraits()).toEqual({ sensitive: 1 });\n\n    expect(second.getSchema()).toBe(schema);\n    expect(second.getName()).toBe(\"Equiv\");\n    expect(second.getName(true)).toBe(\"ns#Equiv\");\n    expect(second.getMergedTraits()).toEqual({ sensitive: 1 });\n  });\n\n  it(\"primitive schemas return the same cached instance across calls\", () => {\n    const a = NormalizedSchema.of(0);\n    const b = NormalizedSchema.of(0);\n    expect(b).toBe(a);\n  });\n\n  describe(\"member schema branch\", () => {\n    it(\"throws for unwrapped member schemas\", () => {\n      const unwrappedMember = [[0, \"ns\", \"Simple\", 0, 0] satisfies StaticSimpleSchema, 0b0000_0001] as any;\n      expect(() => NormalizedSchema.of(unwrappedMember)).toThrow(\n        \"@smithy/core/schema - may not init unwrapped member schema=\"\n      );\n    });\n\n    it(\"mutates traits for NormalizedSchema-wrapped members\", () => {\n      const innerSchema: StaticSimpleSchema = [0, \"ns\", \"Inner\", 0, 0];\n      const container: StaticStructureSchema = [3, \"ns\", \"Container\", 0, [\"m\"], [[innerSchema, 0b0000_0001]]];\n      const memberNs = NormalizedSchema.of(container).getMemberSchema(\"m\");\n\n      // The member should have httpLabel trait from the bitmask 0b0000_0001\n      expect(memberNs.getMemberTraits()).toEqual({ httpLabel: 1 });\n\n      // Now pass the NormalizedSchema-wrapped member as a member schema to of()\n      // This should mutate its merged traits with the additional traits\n      const result = NormalizedSchema.of([memberNs, 0b0000_1000] as any);\n      expect(result).toBe(memberNs);\n      expect(result.getMergedTraits().sensitive).toBe(1);\n    });\n  });\n\n  /**\n   * Structurally identical but referentially distinct schemas must produce independent cache entries.\n   */\n  it(\"distinct schema arrays with same shape are cached independently\", () => {\n    const a: StaticStructureSchema = [3, \"ns\", \"Foo\", 0, [\"x\"], [0]];\n    const b: StaticStructureSchema = [3, \"ns\", \"Foo\", 0, [\"x\"], [0]];\n    expect(NormalizedSchema.of(a)).not.toBe(NormalizedSchema.of(b));\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/NormalizedSchema.ts",
    "content": "import type {\n  $MemberSchema,\n  $Schema,\n  $SchemaRef,\n  BigDecimalSchema,\n  BigIntegerSchema,\n  BlobSchema,\n  BooleanSchema,\n  DocumentSchema,\n  NormalizedSchema as INormalizedSchema,\n  ListSchemaModifier,\n  MapSchemaModifier,\n  NumericSchema,\n  SchemaRef,\n  SchemaTraits,\n  SchemaTraitsObject,\n  SimpleSchema,\n  StaticListSchema,\n  StaticMapSchema,\n  StaticSchema,\n  StaticSchemaIdError,\n  StaticSchemaIdList,\n  StaticSchemaIdMap,\n  StaticSchemaIdStruct,\n  StaticSchemaIdUnion,\n  StaticSimpleSchema,\n  StaticStructureSchema,\n  StreamingBlobSchema,\n  StringSchema,\n  TimestampDefaultSchema,\n  TimestampEpochSecondsSchema,\n  UnitSchema,\n} from \"@smithy/types\";\n\nimport { deref } from \"../deref\";\nimport { translateTraits } from \"./translateTraits\";\n\n/**\n * Annotations for cacheable schema-derived data.\n * @internal\n */\nconst anno = {\n  // reference to structure's member iterator.\n  it: Symbol.for(\"@smithy/nor-struct-it\"),\n\n  /**\n   * Key for a cached NormalizedSchema on a $SchemaRef object.\n   * For non-object refs, we use `simpleSchemaCache(N|S)`.\n   */\n  ns: Symbol.for(\"@smithy/ns\"),\n};\n\n/**\n * Cache for numeric schemaRef. Having separate cache objects for number/string improves\n * lookup performance.\n * @internal\n */\nexport const simpleSchemaCacheN: Array<NormalizedSchema | undefined> = [];\n\n/**\n * Cache for string schemaRef.\n * @internal\n */\nexport const simpleSchemaCacheS: Record<string, NormalizedSchema> = {};\n\n/**\n * Wraps both class instances, numeric sentinel values, and member schema pairs.\n * Presents a consistent interface for interacting with polymorphic schema representations.\n *\n * @public\n */\nexport class NormalizedSchema implements INormalizedSchema {\n  // ========================\n  //\n  // This class implementation may be a little bit code-golfed to save space.\n  // This class is core to all clients in schema-serde mode.\n  // For readability, add comments rather than code.\n  //\n  // ========================\n  public static readonly symbol = Symbol.for(\"@smithy/nor\");\n  protected readonly symbol = NormalizedSchema.symbol;\n\n  private readonly name!: string;\n  private readonly schema!: Exclude<$Schema, $MemberSchema | INormalizedSchema>;\n  private readonly _isMemberSchema: boolean;\n\n  private readonly traits!: SchemaTraits;\n  private readonly memberTraits: SchemaTraits;\n  private normalizedTraits?: SchemaTraitsObject;\n\n  /**\n   * @param ref - a polymorphic SchemaRef to be dereferenced/normalized.\n   * @param memberName - optional memberName if this NormalizedSchema should be considered a member schema.\n   */\n  private constructor(\n    readonly ref: $SchemaRef,\n    private readonly memberName?: string\n  ) {\n    const traitStack = [] as SchemaTraits[];\n    let _ref = ref;\n    let schema = ref;\n    this._isMemberSchema = false;\n\n    while (isMemberSchema(_ref)) {\n      traitStack.push(_ref[1]);\n      _ref = _ref[0] as $SchemaRef;\n      schema = deref(_ref) as $Schema;\n      this._isMemberSchema = true;\n    }\n\n    if (traitStack.length > 0) {\n      this.memberTraits = {};\n      for (let i = traitStack.length - 1; i >= 0; --i) {\n        const traitSet = traitStack[i];\n        Object.assign(this.memberTraits, translateTraits(traitSet));\n      }\n    } else {\n      this.memberTraits = 0;\n    }\n\n    if (schema instanceof NormalizedSchema) {\n      const computedMemberTraits = this.memberTraits;\n      Object.assign(this, schema);\n      this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());\n      this.normalizedTraits = void 0;\n      this.memberName = memberName ?? schema.memberName;\n      return;\n    }\n\n    this.schema = deref(schema) as Exclude<$Schema, $MemberSchema | INormalizedSchema>;\n\n    if (isStaticSchema(this.schema)) {\n      this.name = `${this.schema[1]}#${this.schema[2]}`;\n      this.traits = this.schema[3];\n    } else {\n      this.name = this.memberName ?? String(schema);\n      this.traits = 0;\n    }\n\n    if (this._isMemberSchema && !memberName) {\n      throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);\n    }\n  }\n\n  public static [Symbol.hasInstance](lhs: unknown): lhs is NormalizedSchema {\n    const isPrototype = this.prototype.isPrototypeOf(lhs as any);\n    if (!isPrototype && typeof lhs === \"object\" && lhs !== null) {\n      const ns = lhs as any;\n      return ns.symbol === (this as any).symbol;\n    }\n    return isPrototype;\n  }\n\n  /**\n   * Static constructor that attempts to avoid wrapping a NormalizedSchema within another.\n   */\n  public static of(ref: SchemaRef | $SchemaRef): NormalizedSchema {\n    const keyAble = typeof ref === \"function\" || (typeof ref === \"object\" && ref !== null);\n\n    if (typeof ref === \"number\") {\n      if (simpleSchemaCacheN[ref]) {\n        return simpleSchemaCacheN[ref];\n      }\n    } else if (typeof ref === \"string\") {\n      if (simpleSchemaCacheS[ref]) {\n        return simpleSchemaCacheS[ref];\n      }\n    } else if (keyAble) {\n      if ((ref as any)[anno.ns]) {\n        return (ref as any)[anno.ns];\n      }\n    }\n\n    const sc = deref(ref);\n    if (sc instanceof NormalizedSchema) {\n      return sc;\n    }\n    if (isMemberSchema(sc)) {\n      const [ns, traits] = sc;\n      if (ns instanceof NormalizedSchema) {\n        Object.assign(ns.getMergedTraits(), translateTraits(traits));\n        return ns;\n      }\n      // An aggregate schema must be initialized with members and the member retrieved through the aggregate\n      // container.\n      throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);\n    }\n\n    const ns = new NormalizedSchema(sc as $SchemaRef);\n\n    if (keyAble) {\n      // we check ref type here because the inner schema may be a simple value, but any\n      // object or function ref can be assigned a symbol key.\n      return ((ref as any)[anno.ns] = ns);\n    }\n\n    if (typeof sc === \"string\") {\n      return (simpleSchemaCacheS[sc] = ns);\n    }\n\n    if (typeof sc === \"number\") {\n      return (simpleSchemaCacheN[sc] = ns);\n    }\n\n    return ns;\n  }\n\n  /**\n   * @returns the underlying non-normalized schema.\n   */\n  public getSchema(): Exclude<$Schema, $MemberSchema | INormalizedSchema> {\n    const sc = this.schema;\n    // array check is to prevent autoboxing or something like that.\n    if (Array.isArray(sc) && (sc as StaticSimpleSchema)[0] === 0) {\n      return (sc as StaticSimpleSchema)[4] as SimpleSchema;\n    }\n    return sc as Exclude<$Schema, $MemberSchema | INormalizedSchema>;\n  }\n\n  /**\n   * @param withNamespace - qualifies the name.\n   * @returns e.g. `MyShape` or `com.namespace#MyShape`.\n   */\n  public getName(withNamespace = false): string | undefined {\n    const { name } = this;\n    const short = !withNamespace && name && name.includes(\"#\");\n    // empty name should return as undefined\n    return short ? name.split(\"#\")[1] : name || undefined;\n  }\n\n  /**\n   * @returns the member name if the schema is a member schema.\n   */\n  public getMemberName(): string {\n    return this.memberName!;\n  }\n\n  public isMemberSchema(): boolean {\n    return this._isMemberSchema;\n  }\n\n  /**\n   * boolean methods on this class help control flow in shape serialization and deserialization.\n   */\n  public isListSchema(): boolean {\n    const sc = this.getSchema();\n    return typeof sc === \"number\"\n      ? sc >= (64 satisfies ListSchemaModifier) && sc < (128 satisfies MapSchemaModifier)\n      : (sc as StaticSchema)[0] === (1 satisfies StaticSchemaIdList);\n  }\n\n  public isMapSchema(): boolean {\n    const sc = this.getSchema();\n    return typeof sc === \"number\"\n      ? sc >= (128 satisfies MapSchemaModifier) && sc <= 0b1111_1111\n      : (sc as StaticSchema)[0] === (2 satisfies StaticSchemaIdMap);\n  }\n\n  /**\n   * To simplify serialization logic, static union schemas are considered a specialization\n   * of structs in the TypeScript typings and JS runtime, as well as static error schemas\n   * which have a different identifier.\n   */\n  public isStructSchema(): boolean {\n    const sc = this.getSchema();\n    if (typeof sc !== \"object\") {\n      return false;\n    }\n    const id = (sc satisfies StaticSchema)[0];\n    return (\n      id === (3 satisfies StaticSchemaIdStruct) ||\n      id === (-3 satisfies StaticSchemaIdError) ||\n      id === (4 satisfies StaticSchemaIdUnion)\n    );\n  }\n\n  public isUnionSchema(): boolean {\n    const sc = this.getSchema();\n    if (typeof sc !== \"object\") {\n      return false;\n    }\n    return (sc satisfies StaticSchema)[0] === (4 satisfies StaticSchemaIdUnion);\n  }\n\n  public isBlobSchema(): boolean {\n    const sc = this.getSchema();\n    return sc === (21 satisfies BlobSchema) || sc === (42 satisfies StreamingBlobSchema);\n  }\n\n  public isTimestampSchema(): boolean {\n    const sc = this.getSchema();\n    return (\n      typeof sc === \"number\" &&\n      sc >= (4 satisfies TimestampDefaultSchema) &&\n      sc <= (7 satisfies TimestampEpochSecondsSchema)\n    );\n  }\n\n  public isUnitSchema(): boolean {\n    return this.getSchema() === (\"unit\" satisfies UnitSchema);\n  }\n\n  public isDocumentSchema(): boolean {\n    return this.getSchema() === (15 satisfies DocumentSchema);\n  }\n\n  public isStringSchema(): boolean {\n    return this.getSchema() === (0 satisfies StringSchema);\n  }\n\n  public isBooleanSchema(): boolean {\n    return this.getSchema() === (2 satisfies BooleanSchema);\n  }\n\n  public isNumericSchema(): boolean {\n    return this.getSchema() === (1 satisfies NumericSchema);\n  }\n\n  public isBigIntegerSchema(): boolean {\n    return this.getSchema() === (17 satisfies BigIntegerSchema);\n  }\n\n  public isBigDecimalSchema(): boolean {\n    return this.getSchema() === (19 satisfies BigDecimalSchema);\n  }\n\n  public isStreaming(): boolean {\n    const { streaming } = this.getMergedTraits();\n    return !!streaming || this.getSchema() === (42 satisfies StreamingBlobSchema);\n  }\n\n  /**\n   * @returns whether the schema has the idempotencyToken trait.\n   */\n  public isIdempotencyToken(): boolean {\n    /*\n    It's faster to create the normalized trait object than to\n    attempt to match against multiple value types.\n     */\n    return !!this.getMergedTraits().idempotencyToken;\n  }\n\n  /**\n   * @returns own traits merged with member traits, where member traits of the same trait key take priority.\n   * This method is cached.\n   */\n  public getMergedTraits(): SchemaTraitsObject {\n    return (\n      this.normalizedTraits ??\n      (this.normalizedTraits = {\n        ...this.getOwnTraits(),\n        ...this.getMemberTraits(),\n      })\n    );\n  }\n\n  /**\n   * @returns only the member traits. If the schema is not a member, this returns empty.\n   */\n  public getMemberTraits(): SchemaTraitsObject {\n    return translateTraits(this.memberTraits);\n  }\n\n  /**\n   * @returns only the traits inherent to the shape or member target shape if this schema is a member.\n   * If there are any member traits they are excluded.\n   */\n  public getOwnTraits(): SchemaTraitsObject {\n    return translateTraits(this.traits);\n  }\n\n  /**\n   * @returns the map's key's schema. Returns a dummy Document schema if this schema is a Document.\n   *\n   * @throws Error if the schema is not a Map or Document.\n   */\n  public getKeySchema(): NormalizedSchema {\n    const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];\n    if (!isDoc && !isMap) {\n      throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);\n    }\n    const schema = this.getSchema();\n    const memberSchema = isDoc\n      ? (15 satisfies DocumentSchema)\n      : (schema as StaticMapSchema)[4] ?? (0 satisfies StringSchema);\n    return member([memberSchema, 0], \"key\");\n  }\n\n  /**\n   * @returns the schema of the map's value or list's member.\n   * Returns a dummy Document schema if this schema is a Document.\n   *\n   * @throws Error if the schema is not a Map, List, nor Document.\n   */\n  public getValueSchema(): NormalizedSchema {\n    const sc = this.getSchema();\n    const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()];\n    const memberSchema =\n      typeof sc === \"number\"\n        ? 0b0011_1111 & sc\n        : sc && typeof sc === \"object\" && (isMap || isList)\n          ? ((sc as StaticMapSchema | StaticListSchema)[3 + (sc as StaticSchema)[0]] as typeof sc)\n          : isDoc\n            ? (15 satisfies DocumentSchema)\n            : void 0;\n    if (memberSchema != null) {\n      return member([memberSchema, 0], isMap ? \"value\" : \"member\");\n    }\n    throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);\n  }\n\n  /**\n   * @returns the NormalizedSchema for the given member name. The returned instance will return true for `isMemberSchema()`\n   * and will have the member name given.\n   * @param memberName - which member to retrieve and wrap.\n   *\n   * @throws Error if member does not exist or the schema is neither a document nor structure.\n   * Note that errors are assumed to be structures and unions are considered structures for these purposes.\n   */\n  public getMemberSchema(memberName: string): NormalizedSchema {\n    const struct = this.getSchema() as StaticStructureSchema;\n    if (this.isStructSchema() && struct[4].includes(memberName)) {\n      const i = struct[4].indexOf(memberName);\n      const memberSchema = struct[5][i];\n      return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);\n    }\n    if (this.isDocumentSchema()) {\n      return member([15 satisfies DocumentSchema, 0], memberName);\n    }\n    throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`);\n  }\n\n  /**\n   * This can be used for checking the members as a hashmap.\n   * Prefer the structIterator method for iteration.\n   *\n   * This does NOT return list and map members, it is only for structures.\n   *\n   * @deprecated use (checked) structIterator instead.\n   *\n   * @returns a map of member names to member schemas (normalized).\n   */\n  public getMemberSchemas(): Record<string, NormalizedSchema> {\n    const buffer = {} as any;\n    try {\n      for (const [k, v] of this.structIterator()) {\n        buffer[k] = v;\n      }\n    } catch (ignored) {}\n    return buffer;\n  }\n\n  /**\n   * @returns member name of event stream or empty string indicating none exists or this\n   * isn't a structure schema.\n   */\n  public getEventStreamMember(): string {\n    if (this.isStructSchema()) {\n      for (const [memberName, memberSchema] of this.structIterator()) {\n        if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {\n          return memberName;\n        }\n      }\n    }\n    return \"\";\n  }\n\n  /**\n   * Allows iteration over members of a structure schema.\n   * Each yield is a pair of the member name and member schema.\n   *\n   * This avoids the overhead of calling Object.entries(ns.getMemberSchemas()).\n   */\n  public *structIterator(): Generator<[string, NormalizedSchema], undefined, undefined> {\n    if (this.isUnitSchema()) {\n      return;\n    }\n    if (!this.isStructSchema()) {\n      throw new Error(\"@smithy/core/schema - cannot iterate non-struct schema.\");\n    }\n    const struct = this.getSchema() as StaticStructureSchema & {\n      // the static structure may have a cached iterator list of\n      // its members.\n      [anno.it]?: Array<[string, NormalizedSchema]>;\n    };\n\n    const z = struct[4].length;\n    let it = struct[anno.it];\n\n    // to yield the cached iterator, it must exist and be\n    // the same length as the current member list.\n    if (it && z === it.length) {\n      yield* it;\n      return;\n    }\n\n    it = Array(z);\n    for (let i = 0; i < z; ++i) {\n      const k = struct[4][i];\n      const v = member([struct[5][i], 0], k);\n      yield (it[i] = [k, v]);\n    }\n\n    // cache the iterator only if all uncached items were iterated successfully.\n    struct[anno.it] = it;\n  }\n}\n\n/**\n * Creates a normalized member schema from the given schema and member name.\n *\n * @internal\n */\nfunction member(memberSchema: NormalizedSchema | [SchemaRef, SchemaTraits], memberName: string): NormalizedSchema {\n  if (memberSchema instanceof NormalizedSchema) {\n    return Object.assign(memberSchema, {\n      memberName,\n      _isMemberSchema: true,\n    });\n  }\n  const internalCtorAccess = NormalizedSchema as any;\n  return new internalCtorAccess(memberSchema, memberName);\n}\n\n/**\n * @internal\n */\nconst isMemberSchema = (sc: SchemaRef): sc is $MemberSchema => Array.isArray(sc) && sc.length === 2;\n\n/**\n * @internal\n */\nexport const isStaticSchema = (sc: SchemaRef): sc is StaticSchema => Array.isArray(sc) && sc.length >= 5;\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/OperationSchema.ts",
    "content": "import type { OperationSchema as IOperationSchema, SchemaRef, SchemaTraits } from \"@smithy/types\";\n\nimport { Schema } from \"./Schema\";\n\n/**\n * This is used as a reference container for the input/output pair of schema, and for trait\n * detection on the operation that may affect client protocol logic.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport class OperationSchema extends Schema implements IOperationSchema {\n  public static readonly symbol = Symbol.for(\"@smithy/ope\");\n  public name!: string;\n  public traits!: SchemaTraits;\n  public input!: SchemaRef;\n  public output!: SchemaRef;\n  protected readonly symbol = OperationSchema.symbol;\n}\n\n/**\n * Factory for OperationSchema.\n * @internal\n * @deprecated use StaticSchema\n */\nexport const op = (\n  namespace: string,\n  name: string,\n  traits: SchemaTraits,\n  input: SchemaRef,\n  output: SchemaRef\n): OperationSchema =>\n  Schema.assign(new OperationSchema(), {\n    name,\n    namespace,\n    traits,\n    input,\n    output,\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/Schema.ts",
    "content": "import type { SchemaTraits, TraitsSchema } from \"@smithy/types\";\n\nimport { TypeRegistry } from \"../TypeRegistry\";\n\n/**\n * Abstract base for class-based Schema except NormalizedSchema.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport abstract class Schema implements TraitsSchema {\n  public name!: string;\n  public namespace!: string;\n  public traits!: SchemaTraits;\n  protected abstract readonly symbol: symbol;\n\n  public static assign<T extends Schema>(instance: T, values: Omit<T, \"getName\" | \"symbol\">): T {\n    const schema = Object.assign(instance, values);\n    // TypeRegistry.for(schema.namespace).register(schema.name, schema);\n    return schema;\n  }\n\n  public static [Symbol.hasInstance](lhs: unknown) {\n    const isPrototype = this.prototype.isPrototypeOf(lhs as any);\n    if (!isPrototype && typeof lhs === \"object\" && lhs !== null) {\n      const list = lhs as any;\n      return list.symbol === (this as any).symbol;\n    }\n    return isPrototype;\n  }\n\n  public getName(): string {\n    return this.namespace + \"#\" + this.name;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/SimpleSchema.ts",
    "content": "import type { SchemaRef, SchemaTraits, TraitsSchema } from \"@smithy/types\";\n\nimport { TypeRegistry } from \"../TypeRegistry\";\nimport { Schema } from \"./Schema\";\n\n/**\n * Although numeric values exist for most simple schema, this class is used for cases where traits are\n * attached to those schema, since a single number cannot easily represent both a schema and its traits.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport class SimpleSchema extends Schema implements TraitsSchema {\n  public static readonly symbol = Symbol.for(\"@smithy/sim\");\n  public name!: string;\n  public schemaRef!: SchemaRef;\n  public traits!: SchemaTraits;\n  protected readonly symbol = SimpleSchema.symbol;\n}\n\n/**\n * Factory for simple schema class objects.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport const sim = (namespace: string, name: string, schemaRef: SchemaRef, traits: SchemaTraits) =>\n  Schema.assign(new SimpleSchema(), {\n    name,\n    namespace,\n    traits,\n    schemaRef,\n  });\n\n/**\n * @internal\n * @deprecated\n */\nexport const simAdapter = (namespace: string, name: string, traits: SchemaTraits, schemaRef: SchemaRef) =>\n  Schema.assign(new SimpleSchema(), {\n    name,\n    namespace,\n    traits,\n    schemaRef,\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/StructureSchema.ts",
    "content": "import type { StructureSchema as IStructureSchema, MemberSchema, SchemaRef, SchemaTraits } from \"@smithy/types\";\n\nimport { TypeRegistry } from \"../TypeRegistry\";\nimport { Schema } from \"./Schema\";\n\n/**\n * A structure schema has a known list of members. This is also used for unions.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport class StructureSchema extends Schema implements IStructureSchema {\n  public static symbol = Symbol.for(\"@smithy/str\");\n  public name!: string;\n  public traits!: SchemaTraits;\n  public memberNames!: string[];\n  public memberList!: SchemaRef[];\n  protected readonly symbol = StructureSchema.symbol;\n}\n\n/**\n * Factory for StructureSchema.\n *\n * @internal\n * @deprecated use StaticSchema\n */\nexport const struct = (\n  namespace: string,\n  name: string,\n  traits: SchemaTraits,\n  memberNames: string[],\n  memberList: SchemaRef[]\n): StructureSchema =>\n  Schema.assign(new StructureSchema(), {\n    name,\n    namespace,\n    traits,\n    memberNames,\n    memberList,\n  });\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/operation.ts",
    "content": "import type { OperationSchema, SchemaRef, SchemaTraits } from \"@smithy/types\";\n\n/**\n * Converts the static schema array into an object-form to adapt\n * to the signature of ClientProtocol classes.\n * @internal\n */\nexport const operation = (\n  namespace: string,\n  name: string,\n  traits: SchemaTraits,\n  input: SchemaRef,\n  output: SchemaRef\n): OperationSchema => ({\n  name,\n  namespace,\n  traits,\n  input,\n  output,\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/schemas.spec.ts",
    "content": "import type { SchemaRef, SchemaTraits } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { ErrorSchema, error } from \"./ErrorSchema\";\nimport { ListSchema, list } from \"./ListSchema\";\nimport { MapSchema, map } from \"./MapSchema\";\nimport { OperationSchema, op } from \"./OperationSchema\";\nimport { Schema } from \"./Schema\";\nimport { SimpleSchema, sim } from \"./SimpleSchema\";\nimport { StructureSchema, struct } from \"./StructureSchema\";\n\ndescribe(\"schemas\", () => {\n  describe(ErrorSchema.name, () => {\n    const schema = error(\"ack\", \"Error\", 0, [], []);\n\n    it(\"is a StructureSchema\", () => {\n      expect(schema).toBeInstanceOf(StructureSchema);\n      expect(schema).toBeInstanceOf(ErrorSchema);\n    });\n\n    it(\"deprecated reference to the error constructor\", () => {\n      expect(schema.ctor).toBe(null);\n    });\n\n    it(\"has a factory\", () => {\n      expect(error(\"ack\", \"Error\", 0, [], [])).toEqual(schema);\n    });\n\n    it(\"has an instanceOf operator\", () => {\n      const object = { ...schema };\n      expect(ErrorSchema.prototype.isPrototypeOf(object)).toBe(false);\n      expect(object).toBeInstanceOf(ErrorSchema);\n    });\n  });\n\n  describe(ListSchema.name, () => {\n    const schema = list(\"ack\", \"List\", 0, 0);\n    it(\"is a Schema\", () => {\n      expect(schema).toBeInstanceOf(Schema);\n      expect(schema).toBeInstanceOf(ListSchema);\n    });\n    it(\"has a value schema\", () => {\n      expect(schema.valueSchema).toBe(0 as SchemaRef);\n    });\n    it(\"has a factory\", () => {\n      expect(list(\"ack\", \"List\", 0, 0)).toEqual(schema);\n    });\n    it(\"has an instanceOf operator\", () => {\n      const object = { ...schema };\n      expect(ListSchema.prototype.isPrototypeOf(object)).toBe(false);\n      expect(object).toBeInstanceOf(ListSchema);\n    });\n  });\n\n  describe(MapSchema.name, () => {\n    const schema = map(\"ack\", \"Map\", 0, 0, 1);\n    it(\"is a Schema\", () => {\n      expect(schema).toBeInstanceOf(Schema);\n      expect(schema).toBeInstanceOf(MapSchema);\n    });\n    it(\"has a key and value schema\", () => {\n      expect(schema.keySchema).toBe(0 as SchemaRef);\n      expect(schema.valueSchema).toBe(1 as SchemaRef);\n    });\n    it(\"has a factory\", () => {\n      expect(map(\"ack\", \"Map\", 0, 0, 1)).toEqual(schema);\n    });\n    it(\"has an instanceOf operator\", () => {\n      const object = { ...schema };\n      expect(MapSchema.prototype.isPrototypeOf(object)).toBe(false);\n      expect(object).toBeInstanceOf(MapSchema);\n    });\n  });\n\n  describe(OperationSchema.name, () => {\n    const schema = op(\"ack\", \"Operation\", 0, \"unit\", \"unit\");\n    it(\"is a Schema\", () => {\n      expect(schema).toBeInstanceOf(Schema);\n      expect(schema).toBeInstanceOf(OperationSchema);\n    });\n    it(\"has an input and output schema\", () => {\n      expect(schema.input).toEqual(\"unit\");\n      expect(schema.output).toEqual(\"unit\");\n    });\n    it(\"has a factory\", () => {\n      expect(op(\"ack\", \"Operation\", 0, \"unit\", \"unit\")).toEqual(schema);\n    });\n  });\n\n  describe(Schema.name, () => {\n    const schema = new (class extends Schema {\n      protected symbol = Symbol();\n      public constructor(name: string, traits: SchemaTraits) {\n        super();\n        this.name = name;\n        this.traits = traits;\n      }\n    })(\"ack#Abstract\", {\n      a: 0,\n      b: 1,\n    });\n    it(\"has a name\", () => {\n      expect(schema.name).toBe(\"ack#Abstract\");\n    });\n    it(\"has traits\", () => {\n      expect(schema.traits).toEqual({\n        a: 0,\n        b: 1,\n      });\n    });\n  });\n\n  describe(SimpleSchema.name, () => {\n    const schema = sim(\"ack\", \"Simple\", 0, 0);\n    it(\"is a Schema\", () => {\n      expect(schema).toBeInstanceOf(Schema);\n      expect(schema).toBeInstanceOf(SimpleSchema);\n    });\n    it(\"has a factory\", () => {\n      expect(sim(\"ack\", \"Simple\", 0, 0)).toEqual(schema);\n    });\n    it(\"has an instanceOf operator\", () => {\n      const object = { ...schema };\n      expect(SimpleSchema.prototype.isPrototypeOf(object)).toBe(false);\n      expect(object).toBeInstanceOf(SimpleSchema);\n    });\n  });\n\n  describe(StructureSchema.name, () => {\n    const schema = struct(\"ack\", \"Structure\", 0, [\"a\", \"b\", \"c\"], [0, 1, 2]);\n    it(\"is a Schema\", () => {\n      expect(schema).toBeInstanceOf(Schema);\n      expect(schema).toBeInstanceOf(StructureSchema);\n      expect(schema).not.toBeInstanceOf(ErrorSchema);\n    });\n    it(\"has member schemas\", () => {\n      expect(schema.memberNames).toEqual([\"a\", \"b\", \"c\"]);\n      expect(schema.memberList).toEqual([0, 1, 2]);\n    });\n    it(\"has a factory\", () => {\n      expect(struct(\"ack\", \"Structure\", 0, [\"a\", \"b\", \"c\"], [0, 1, 2])).toEqual(schema);\n    });\n    it(\"has an instanceOf operator\", () => {\n      const object = { ...schema };\n      expect(StructureSchema.prototype.isPrototypeOf(object)).toBe(false);\n      expect(object).toBeInstanceOf(StructureSchema);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/sentinels.ts",
    "content": "import type {\n  BigDecimalSchema,\n  BigIntegerSchema,\n  BlobSchema,\n  BooleanSchema,\n  DocumentSchema,\n  ListSchemaModifier,\n  MapSchemaModifier,\n  NumericSchema,\n  StreamingBlobSchema,\n  StringSchema,\n  TimestampDateTimeSchema,\n  TimestampDefaultSchema,\n  TimestampEpochSecondsSchema,\n  TimestampHttpDateSchema,\n} from \"@smithy/types\";\n\n/**\n * Schema sentinel runtime values.\n * @internal\n *\n * @deprecated use inline numbers with type annotation to save space.\n */\nexport const SCHEMA: {\n  BLOB: BlobSchema;\n  STREAMING_BLOB: StreamingBlobSchema;\n  BOOLEAN: BooleanSchema;\n  STRING: StringSchema;\n  NUMERIC: NumericSchema;\n  BIG_INTEGER: BigIntegerSchema;\n  BIG_DECIMAL: BigDecimalSchema;\n  DOCUMENT: DocumentSchema;\n  TIMESTAMP_DEFAULT: TimestampDefaultSchema;\n  TIMESTAMP_DATE_TIME: TimestampDateTimeSchema;\n  TIMESTAMP_HTTP_DATE: TimestampHttpDateSchema;\n  TIMESTAMP_EPOCH_SECONDS: TimestampEpochSecondsSchema;\n  LIST_MODIFIER: ListSchemaModifier;\n  MAP_MODIFIER: MapSchemaModifier;\n} = {\n  BLOB: 0b0001_0101, // 21\n  STREAMING_BLOB: 0b0010_1010, // 42\n  BOOLEAN: 0b0000_0010, // 2\n  STRING: 0b0000_0000, // 0\n  NUMERIC: 0b0000_0001, // 1\n  BIG_INTEGER: 0b0001_0001, // 17\n  BIG_DECIMAL: 0b0001_0011, // 19\n  DOCUMENT: 0b0000_1111, // 15\n  TIMESTAMP_DEFAULT: 0b0000_0100, // 4\n  TIMESTAMP_DATE_TIME: 0b0000_0101, // 5\n  TIMESTAMP_HTTP_DATE: 0b0000_0110, // 6\n  TIMESTAMP_EPOCH_SECONDS: 0b0000_0111, // 7\n  LIST_MODIFIER: 0b0100_0000, // 64\n  MAP_MODIFIER: 0b1000_0000, // 128\n};\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/translateTraits.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { translateTraits } from \"./translateTraits\";\n\ndescribe(\"translateTraits() caching\", () => {\n  it(\"returns the same reference for repeated calls with the same numeric bitmask\", () => {\n    const first = translateTraits(0b0000_0001);\n    const second = translateTraits(0b0000_0001);\n    expect(second).toBe(first);\n\n    const a = translateTraits(0b0000_0101);\n    const b = translateTraits(0b0000_0101);\n    expect(b).toBe(a);\n  });\n\n  it(\"returns object-type indicators as-is (reference equality) without caching\", () => {\n    const obj = { sensitive: 1 } as const;\n    const result = translateTraits(obj);\n    expect(result).toBe(obj);\n  });\n\n  /**\n   * Validates bitmask decoding correctness.\n   */\n  describe(\"bitmask decoding produces correct trait keys\", () => {\n    it(\"0b0000_0001 → { httpLabel: 1 }\", () => {\n      expect(translateTraits(0b0000_0001)).toEqual({ httpLabel: 1 });\n    });\n\n    it(\"0b0000_0101 → { httpLabel: 1, idempotencyToken: 1 }\", () => {\n      expect(translateTraits(0b0000_0101)).toEqual({ httpLabel: 1, idempotencyToken: 1 });\n    });\n\n    it(\"0b0000_0010 → { idempotent: 1 }\", () => {\n      expect(translateTraits(0b0000_0010)).toEqual({ idempotent: 1 });\n    });\n\n    it(\"0b0000_1000 → { sensitive: 1 }\", () => {\n      expect(translateTraits(0b0000_1000)).toEqual({ sensitive: 1 });\n    });\n\n    it(\"0b0001_0000 → { httpPayload: 1 }\", () => {\n      expect(translateTraits(0b0001_0000)).toEqual({ httpPayload: 1 });\n    });\n\n    it(\"0b0100_0000 → { httpQueryParams: 1 }\", () => {\n      expect(translateTraits(0b0100_0000)).toEqual({ httpQueryParams: 1 });\n    });\n\n    it(\"0b0111_1111 → all traits set\", () => {\n      expect(translateTraits(0b0111_1111)).toEqual({\n        httpLabel: 1,\n        idempotent: 1,\n        idempotencyToken: 1,\n        sensitive: 1,\n        httpPayload: 1,\n        httpResponseCode: 1,\n        httpQueryParams: 1,\n      });\n    });\n\n    it(\"0b0000_0000 → empty object\", () => {\n      expect(translateTraits(0b0000_0000)).toEqual({});\n    });\n  });\n});\n\ndescribe(\"performance\", () => {\n  it(\"translates traits\", () => {\n    const start = performance.now();\n    for (let i = 0; i < 1_000_000; i++) {\n      const n = i % 128;\n      translateTraits(n);\n    }\n    const end = performance.now();\n\n    // 9ms on kuhe's computer.\n    expect(end - start).toBeLessThanOrEqual(200);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/schema/schemas/translateTraits.ts",
    "content": "import type { SchemaTraits, SchemaTraitsObject } from \"@smithy/types\";\n\n/**\n * Module-level cache for translateTraits() numeric bitmask inputs.\n *\n * @internal\n */\nexport const traitsCache: SchemaTraitsObject[] = [];\n\n/**\n * @internal\n * @param indicator - numeric indicator for preset trait combination.\n * @returns equivalent trait object.\n */\nexport function translateTraits(indicator: SchemaTraits): SchemaTraitsObject {\n  if (typeof indicator === \"object\") {\n    return indicator;\n  }\n  indicator = indicator | 0;\n\n  if (traitsCache[indicator]) {\n    return traitsCache[indicator];\n  }\n\n  const traits = {} as SchemaTraitsObject;\n  let i = 0;\n  for (const trait of [\n    \"httpLabel\",\n    \"idempotent\",\n    \"idempotencyToken\",\n    \"sensitive\",\n    \"httpPayload\",\n    \"httpResponseCode\",\n    \"httpQueryParams\",\n  ] as Array<keyof SchemaTraitsObject>) {\n    if (((indicator >> i++) & 1) === 1) {\n      traits[trait] = 1;\n    }\n  }\n\n  return (traitsCache[indicator] = traits);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/copyDocumentWithTransform.ts",
    "content": "import type { SchemaRef } from \"@smithy/types\";\n\n/**\n * @internal\n * @deprecated the former functionality has been internalized to the CborCodec.\n */\nexport const copyDocumentWithTransform = (\n  source: any,\n  schemaRef: SchemaRef,\n  transform: (_: any, schemaRef: SchemaRef) => any = (_) => _\n): any => source;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/date-utils.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport {\n  parseEpochTimestamp,\n  parseRfc3339DateTime,\n  parseRfc3339DateTimeWithOffset,\n  parseRfc7231DateTime,\n} from \"./date-utils\";\n\nconst invalidRfc3339DateTimes = [\n  \"85-04-12T23:20:50.52Z\",\n  \"985-04-12T23:20:50.52Z\",\n  \"1985-13-12T23:20:50.52Z\",\n  \"1985-00-12T23:20:50.52Z\",\n  \"1985-4-12T23:20:50.52Z\",\n  \"1985-04-32T23:20:50.52Z\",\n  \"1985-04-00T23:20:50.52Z\",\n  \"1985-04-05T24:20:50.52Z\",\n  \"1985-04-05T23:61:50.52Z\",\n  \"1985-04-05T23:20:61.52Z\",\n  \"1985-04-31T23:20:50.52Z\",\n  \"2005-02-29T15:59:59Z\",\n  \"1996-12-19T16:39:57\",\n  \"Mon, 31 Dec 1990 15:59:60 GMT\",\n  \"Monday, 31-Dec-90 15:59:60 GMT\",\n  \"Mon Dec 31 15:59:60 1990\",\n  \"1985-04-12T23:20:50.52Z1985-04-12T23:20:50.52Z\",\n  \"1985-04-12T23:20:50.52ZA\",\n  \"A1985-04-12T23:20:50.52Z\",\n];\n\ndescribe(\"parseRfc3339DateTime\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(parseRfc3339DateTime(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    it(\"with fractional seconds\", () => {\n      expect(parseRfc3339DateTime(\"1985-04-12T23:20:50.52Z\")).toEqual(new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 520)));\n    });\n    it(\"without fractional seconds\", () => {\n      expect(parseRfc3339DateTime(\"1985-04-12T23:20:50Z\")).toEqual(new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 0)));\n    });\n    it(\"with leap seconds\", () => {\n      expect(parseRfc3339DateTime(\"1990-12-31T15:59:60Z\")).toEqual(new Date(Date.UTC(1990, 11, 31, 15, 59, 60, 0)));\n    });\n    it(\"with leap days\", () => {\n      expect(parseRfc3339DateTime(\"2004-02-29T15:59:59Z\")).toEqual(new Date(Date.UTC(2004, 1, 29, 15, 59, 59, 0)));\n    });\n    it(\"with leading zeroes\", () => {\n      expect(parseRfc3339DateTime(\"0004-02-09T05:09:09.09Z\")).toEqual(new Date(Date.UTC(4, 1, 9, 5, 9, 9, 90)));\n      expect(parseRfc3339DateTime(\"0004-02-09T00:00:00.00Z\")).toEqual(new Date(Date.UTC(4, 1, 9, 0, 0, 0, 0)));\n    });\n  });\n\n  it.each(invalidRfc3339DateTimes)(\"rejects %s\", (value) => {\n    expect(() => parseRfc3339DateTime(value)).toThrowError();\n  });\n\n  // parseRfc3339DateTime throws on offsets. parseRfc3339DateTimeWithOffset can handle these.\n  it.each([\"2019-12-16T22:48:18+02:04\", \"2019-12-16T22:48:18-01:02\"])(\"rejects %s\", (value) => {\n    expect(() => parseRfc3339DateTime(value)).toThrowError();\n  });\n});\n\ndescribe(\"parseRfc3339DateTimeWithOffset\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(parseRfc3339DateTime(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    it(\"with fractional seconds\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"1985-04-12T23:20:50.52Z\")).toEqual(\n        new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 520))\n      );\n    });\n    it(\"without fractional seconds\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"1985-04-12T23:20:50Z\")).toEqual(\n        new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 0))\n      );\n    });\n    it(\"with leap seconds\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"1990-12-31T15:59:60Z\")).toEqual(\n        new Date(Date.UTC(1990, 11, 31, 15, 59, 60, 0))\n      );\n    });\n    it(\"with leap days\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"2004-02-29T15:59:59Z\")).toEqual(\n        new Date(Date.UTC(2004, 1, 29, 15, 59, 59, 0))\n      );\n    });\n    it(\"with leading zeroes\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"0004-02-09T05:09:09.09Z\")).toEqual(\n        new Date(Date.UTC(4, 1, 9, 5, 9, 9, 90))\n      );\n      expect(parseRfc3339DateTimeWithOffset(\"0004-02-09T00:00:00.00Z\")).toEqual(\n        new Date(Date.UTC(4, 1, 9, 0, 0, 0, 0))\n      );\n    });\n    it(\"with negative offset\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"2019-12-16T22:48:18-01:02\")).toEqual(\n        new Date(Date.UTC(2019, 11, 16, 23, 50, 18, 0))\n      );\n    });\n    it(\"with positive offset\", () => {\n      expect(parseRfc3339DateTimeWithOffset(\"2019-12-16T22:48:18+02:04\")).toEqual(\n        new Date(Date.UTC(2019, 11, 16, 20, 44, 18, 0))\n      );\n    });\n  });\n\n  it.each(invalidRfc3339DateTimes)(\"rejects %s\", (value) => {\n    expect(() => parseRfc3339DateTimeWithOffset(value)).toThrowError();\n  });\n});\n\ndescribe(\"parseRfc7231DateTime\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(parseRfc7231DateTime(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    describe(\"with fractional seconds\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 08:49:37.52 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 08:49:37.52 GMT\"],\n        [\"asctime\", \"Sun Nov  6 08:49:37.52 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 520)));\n      });\n    });\n    describe(\"with fractional seconds - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 8:49:37.52 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 8:49:37.52 GMT\"],\n        [\"asctime\", \"Sun Nov  6 8:49:37.52 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 520)));\n      });\n    });\n    describe(\"without fractional seconds\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 08:49:37 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 08:49:37 GMT\"],\n        [\"asctime\", \"Sun Nov  6 08:49:37 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 0)));\n      });\n    });\n    describe(\"without fractional seconds - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 8:49:37 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 8:49:37 GMT\"],\n        [\"asctime\", \"Sun Nov  6 8:49:37 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 0)));\n      });\n    });\n    describe(\"with leap seconds\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Mon, 31 Dec 1990 15:59:60 GMT\"],\n        [\"rfc-850\", \"Monday, 31-Dec-90 15:59:60 GMT\"],\n        [\"asctime\", \"Mon Dec 31 15:59:60 1990\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1990, 11, 31, 15, 59, 60, 0)));\n      });\n    });\n    describe(\"with leap seconds - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Mon, 31 Dec 1990 8:59:60 GMT\"],\n        [\"rfc-850\", \"Monday, 31-Dec-90 8:59:60 GMT\"],\n        [\"asctime\", \"Mon Dec 31 8:59:60 1990\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1990, 11, 31, 8, 59, 60, 0)));\n      });\n    });\n    describe(\"with leap days\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 29 Feb 2004 15:59:59 GMT\"],\n        [\"rfc-850\", \"Sunday, 29-Feb-04 15:59:59 GMT\"],\n        [\"asctime\", \"Sun Feb 29 15:59:59 2004\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(2004, 1, 29, 15, 59, 59, 0)));\n      });\n    });\n    describe(\"with leap days - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 29 Feb 2004 8:59:59 GMT\"],\n        [\"rfc-850\", \"Sunday, 29-Feb-04 8:59:59 GMT\"],\n        [\"asctime\", \"Sun Feb 29 8:59:59 2004\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(2004, 1, 29, 8, 59, 59, 0)));\n      });\n    });\n    describe(\"with leading zeroes\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 0004 08:09:07.02 GMT\", 4],\n        [\"rfc-850\", \"Sunday, 06-Nov-04 08:09:07.02 GMT\", 2004],\n        [\"asctime\", \"Sun Nov  6 08:09:07.02 0004\", 4],\n      ])(\"in format %s\", (_, value, year) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(year, 10, 6, 8, 9, 7, 20)));\n      });\n    });\n    describe(\"with all-zero components\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 0004 00:00:00.00 GMT\", 4],\n        [\"rfc-850\", \"Sunday, 06-Nov-04 00:00:00.00 GMT\", 2004],\n        [\"asctime\", \"Sun Nov  6 00:00:00.00 0004\", 4],\n      ])(\"in format %s\", (_, value, year) => {\n        expect(parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(year, 10, 6, 0, 0, 0, 0)));\n      });\n    });\n  });\n\n  describe(\"when parsing rfc-850 dates\", () => {\n    it(\"properly adjusts 2-digit years\", () => {\n      // These tests will fail in a couple of decades. Good luck future developers.\n      expect(parseRfc7231DateTime(\"Friday, 31-Dec-99 12:34:56.789 GMT\")).toEqual(\n        new Date(Date.UTC(1999, 11, 31, 12, 34, 56, 789))\n      );\n      expect(parseRfc7231DateTime(\"Thursday, 31-Dec-65 12:34:56.789 GMT\")).toEqual(\n        new Date(Date.UTC(2065, 11, 31, 12, 34, 56, 789))\n      );\n    });\n  });\n\n  it.each([\n    \"1985-04-12T23:20:50.52Z\",\n    \"1985-04-12T23:20:50Z\",\n\n    \"Sun, 06 Nov 0004 08:09:07.02 GMTSun, 06 Nov 0004 08:09:07.02 GMT\",\n    \"Sun, 06 Nov 0004 08:09:07.02 GMTA\",\n    \"ASun, 06 Nov 0004 08:09:07.02 GMT\",\n    \"Sun, 06 Nov 94 08:49:37 GMT\",\n    \"Sun, 06 Dov 1994 08:49:37 GMT\",\n    \"Mun, 06 Nov 1994 08:49:37 GMT\",\n    \"Sunday, 06 Nov 1994 08:49:37 GMT\",\n    \"Sun, 06 November 1994 08:49:37 GMT\",\n    \"Sun, 06 Nov 1994 24:49:37 GMT\",\n    \"Sun, 06 Nov 1994 08:69:37 GMT\",\n    \"Sun, 06 Nov 1994 08:49:67 GMT\",\n    \"Sun, 06-11-1994 08:49:37 GMT\",\n    \"Sun, 06 11 1994 08:49:37 GMT\",\n    \"Sun, 31 Nov 1994 08:49:37 GMT\",\n    \"Sun, 29 Feb 2005 15:59:59 GMT\",\n\n    \"Sunday, 06-Nov-04 08:09:07.02 GMTSunday, 06-Nov-04 08:09:07.02 GMT\",\n    \"ASunday, 06-Nov-04 08:09:07.02 GMT\",\n    \"Sunday, 06-Nov-04 08:09:07.02 GMTA\",\n    \"Sunday, 06-Nov-1994 08:49:37 GMT\",\n    \"Sunday, 06-Dov-94 08:49:37 GMT\",\n    \"Sundae, 06-Nov-94 08:49:37 GMT\",\n    \"Sun, 06-Nov-94 08:49:37 GMT\",\n    \"Sunday, 06-November-94 08:49:37 GMT\",\n    \"Sunday, 06-Nov-94 24:49:37 GMT\",\n    \"Sunday, 06-Nov-94 08:69:37 GMT\",\n    \"Sunday, 06-Nov-94 08:49:67 GMT\",\n    \"Sunday, 06 11 94 08:49:37 GMT\",\n    \"Sunday, 06-11-1994 08:49:37 GMT\",\n    \"Sunday, 31-Nov-94 08:49:37 GMT\",\n    \"Sunday, 29-Feb-05 15:59:59 GMT\",\n\n    \"Sun Nov  6 08:09:07.02 0004Sun Nov  6 08:09:07.02 0004\",\n    \"ASun Nov  6 08:09:07.02 0004\",\n    \"Sun Nov  6 08:09:07.02 0004A\",\n    \"Sun Nov  6 08:49:37 94\",\n    \"Sun Dov  6 08:49:37 1994\",\n    \"Mun Nov  6 08:49:37 1994\",\n    \"Sunday Nov  6 08:49:37 1994\",\n    \"Sun November  6 08:49:37 1994\",\n    \"Sun Nov  6 24:49:37 1994\",\n    \"Sun Nov  6 08:69:37 1994\",\n    \"Sun Nov  6 08:49:67 1994\",\n    \"Sun 06-11 08:49:37 1994\",\n    \"Sun 06 11 08:49:37 1994\",\n    \"Sun 11  6 08:49:37 1994\",\n    \"Sun Nov 31 08:49:37 1994\",\n    \"Sun Feb 29 15:59:59 2005\",\n    \"Sun Nov 6 08:49:37 1994\",\n  ])(\"rejects %s\", (value) => {\n    expect(() => parseRfc7231DateTime(value)).toThrowError();\n  });\n});\n\ndescribe(\"parseEpochTimestamp\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(parseEpochTimestamp(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    describe(\"with fractional seconds\", () => {\n      it.each([\"482196050.52\", 482196050.52])(\"parses %s\", (value) => {\n        expect(parseEpochTimestamp(value)).toEqual(new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 520)));\n      });\n    });\n    describe(\"without fractional seconds\", () => {\n      it.each([\"482196050\", 482196050, 482196050.0])(\"parses %s\", (value) => {\n        expect(parseEpochTimestamp(value)).toEqual(new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 0)));\n      });\n    });\n  });\n  it.each([\n    \"1985-04-12T23:20:50.52Z\",\n    \"1985-04-12T23:20:50Z\",\n    \"Mon, 31 Dec 1990 15:59:60 GMT\",\n    \"Monday, 31-Dec-90 15:59:60 GMT\",\n    \"Mon Dec 31 15:59:60 1990\",\n    \"NaN\",\n    NaN,\n    \"Infinity\",\n    Infinity,\n    \"0x42\",\n  ])(\"rejects %s\", (value) => {\n    expect(() => parseEpochTimestamp(value)).toThrowError();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/date-utils.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { strictParseByte, strictParseDouble, strictParseFloat32, strictParseShort } from \"./parse-utils\";\n\n// Build indexes outside so we allocate them once.\nconst DAYS: Array<string> = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\n// These must be kept in order\n// prettier-ignore\nconst MONTHS: Array<string> = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\n/**\n * Builds a proper UTC HttpDate timestamp from a Date object\n * since not all environments will have this as the expected\n * format.\n * - Prior to ECMAScript 2018, the format of the return value\n * - varied according to the platform. The most common return\n * - value was an RFC-1123 formatted date stamp, which is a\n * - slightly updated version of RFC-822 date stamps.\n *\n * @internal\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString}\n */\nexport function dateToUtcString(date: Date): string {\n  const year = date.getUTCFullYear();\n  const month = date.getUTCMonth();\n  const dayOfWeek = date.getUTCDay();\n  const dayOfMonthInt = date.getUTCDate();\n  const hoursInt = date.getUTCHours();\n  const minutesInt = date.getUTCMinutes();\n  const secondsInt = date.getUTCSeconds();\n\n  // Build 0 prefixed strings for contents that need to be\n  // two digits and where we get an integer back.\n  const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;\n  const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;\n  const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;\n  const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;\n\n  return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;\n}\n\nconst RFC3339 = new RegExp(/^(\\d{4})-(\\d{2})-(\\d{2})[tT](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?[zZ]$/);\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a string that can be parsed\n * as an RFC 3339 date.\n * Input strings must conform to RFC3339 section 5.6, and cannot have a UTC\n * offset. Fractional precision is supported.\n *\n * @internal\n * @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}\n * @param value - the value to parse\n * @returns a Date or undefined\n */\nexport const parseRfc3339DateTime = (value: unknown): Date | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value !== \"string\") {\n    throw new TypeError(\"RFC-3339 date-times must be expressed as strings\");\n  }\n  const match = RFC3339.exec(value);\n  if (!match) {\n    throw new TypeError(\"Invalid RFC-3339 date-time value\");\n  }\n\n  const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n\n  const year = strictParseShort(stripLeadingZeroes(yearStr))!;\n  const month = parseDateValue(monthStr, \"month\", 1, 12);\n  const day = parseDateValue(dayStr, \"day\", 1, 31);\n\n  return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });\n};\n\nconst RFC3339_WITH_OFFSET = new RegExp(\n  /^(\\d{4})-(\\d{2})-(\\d{2})[tT](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?(([-+]\\d{2}\\:\\d{2})|[zZ])$/\n);\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a string that can be parsed\n * as an RFC 3339 date.\n * Input strings must conform to RFC3339 section 5.6, and can have a UTC\n * offset. Fractional precision is supported.\n *\n * @internal\n * @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}\n * @param value - the value to parse\n * @returns a Date or undefined\n */\nexport const parseRfc3339DateTimeWithOffset = (value: unknown): Date | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value !== \"string\") {\n    throw new TypeError(\"RFC-3339 date-times must be expressed as strings\");\n  }\n  const match = RFC3339_WITH_OFFSET.exec(value);\n  if (!match) {\n    throw new TypeError(\"Invalid RFC-3339 date-time value\");\n  }\n\n  const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;\n\n  const year = strictParseShort(stripLeadingZeroes(yearStr))!;\n  const month = parseDateValue(monthStr, \"month\", 1, 12);\n  const day = parseDateValue(dayStr, \"day\", 1, 31);\n  const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });\n\n  // The final regex capture group is either an offset, or \"z\". If it is not a \"z\",\n  // attempt to parse the offset and adjust the date.\n  if (offsetStr.toUpperCase() != \"Z\") {\n    date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));\n  }\n  return date;\n};\n\nconst IMF_FIXDATE = new RegExp(\n  /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d{1,2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))? GMT$/\n);\nconst RFC_850_DATE = new RegExp(\n  /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d{2}) (\\d{1,2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))? GMT$/\n);\nconst ASC_TIME = new RegExp(\n  /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\\d{2}) (\\d{1,2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))? (\\d{4})$/\n);\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a string that can be parsed\n * as an RFC 7231 IMF-fixdate or obs-date.\n * Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.\n *\n * @internal\n * @see {@link https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}\n * @param value - the value to parse\n * @returns a Date or undefined\n */\nexport const parseRfc7231DateTime = (value: unknown): Date | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value !== \"string\") {\n    throw new TypeError(\"RFC-7231 date-times must be expressed as strings\");\n  }\n\n  let match = IMF_FIXDATE.exec(value);\n  if (match) {\n    const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n    return buildDate(\n      strictParseShort(stripLeadingZeroes(yearStr))!,\n      parseMonthByShortName(monthStr),\n      parseDateValue(dayStr, \"day\", 1, 31),\n      { hours, minutes, seconds, fractionalMilliseconds }\n    );\n  }\n\n  match = RFC_850_DATE.exec(value);\n  if (match) {\n    const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;\n    // RFC 850 dates use 2-digit years. So we parse the year specifically,\n    // and then once we've constructed the entire date, we adjust it if the resultant date\n    // is too far in the future.\n    return adjustRfc850Year(\n      buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, \"day\", 1, 31), {\n        hours,\n        minutes,\n        seconds,\n        fractionalMilliseconds,\n      })\n    );\n  }\n\n  match = ASC_TIME.exec(value);\n  if (match) {\n    const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;\n    return buildDate(\n      strictParseShort(stripLeadingZeroes(yearStr))!,\n      parseMonthByShortName(monthStr),\n      parseDateValue(dayStr.trimLeft(), \"day\", 1, 31),\n      { hours, minutes, seconds, fractionalMilliseconds }\n    );\n  }\n\n  throw new TypeError(\"Invalid RFC-7231 date-time value\");\n};\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a number or a parseable string.\n * Input strings must be an integer or floating point number. Fractional seconds are supported.\n *\n * @internal\n * @param value - the value to parse\n * @returns a Date or undefined\n */\nexport const parseEpochTimestamp = (value: unknown): Date | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n\n  let valueAsDouble: number;\n  if (typeof value === \"number\") {\n    valueAsDouble = value;\n  } else if (typeof value === \"string\") {\n    valueAsDouble = strictParseDouble(value)!;\n  } else if (typeof value === \"object\" && (value as { tag: number; value: number }).tag === 1) {\n    // timestamp is a CBOR tag type.\n    valueAsDouble = (value as { tag: number; value: number }).value;\n  } else {\n    throw new TypeError(\"Epoch timestamps must be expressed as floating point numbers or their string representation\");\n  }\n\n  if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {\n    throw new TypeError(\"Epoch timestamps must be valid, non-Infinite, non-NaN numerics\");\n  }\n  return new Date(Math.round(valueAsDouble * 1000));\n};\n\ninterface RawTime {\n  hours: string;\n  minutes: string;\n  seconds: string;\n  fractionalMilliseconds: string | undefined;\n}\n\n/**\n * Build a date from a numeric year, month, date, and an match with named groups\n * \"H\", \"m\", s\", and \"frac\", representing hours, minutes, seconds, and optional fractional seconds.\n * @param year - numeric year\n * @param month - numeric month, 1-indexed\n * @param day - numeric year\n * @param match - match with groups \"H\", \"m\", s\", and \"frac\"\n */\nconst buildDate = (year: number, month: number, day: number, time: RawTime): Date => {\n  const adjustedMonth = month - 1; // JavaScript, and our internal data structures, expect 0-indexed months\n  validateDayOfMonth(year, adjustedMonth, day);\n  // Adjust month down by 1\n  return new Date(\n    Date.UTC(\n      year,\n      adjustedMonth,\n      day,\n      parseDateValue(time.hours, \"hour\", 0, 23),\n      parseDateValue(time.minutes, \"minute\", 0, 59),\n      // seconds can go up to 60 for leap seconds\n      parseDateValue(time.seconds, \"seconds\", 0, 60),\n      parseMilliseconds(time.fractionalMilliseconds)\n    )\n  );\n};\n\n/**\n * RFC 850 dates use a 2-digit year; start with the assumption that if it doesn't\n * match the current year, then it's a date in the future, then let adjustRfc850Year adjust\n * the final date back to the past if it's too far in the future.\n *\n * Example: in 2021, start with the assumption that '11' is '2111', and that '22' is '2022'.\n * adjustRfc850Year will adjust '11' to 2011, (as 2111 is more than 50 years in the future),\n * but keep '22' as 2022. in 2099, '11' will represent '2111', but '98' should be '2098'.\n * There's no description of an RFC 850 date being considered too far in the past in RFC-7231,\n * so it's entirely possible that 2011 is a valid interpretation of '11' in 2099.\n * @param value - the 2 digit year to parse\n * @returns number a year that is equal to or greater than the current UTC year\n */\nconst parseTwoDigitYear = (value: string): number => {\n  const thisYear = new Date().getUTCFullYear();\n  const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value))!;\n  if (valueInThisCentury < thisYear) {\n    // This may end up returning a year that adjustRfc850Year turns back by 100.\n    // That's fine! We don't know the other components of the date yet, so there are\n    // boundary conditions that only adjustRfc850Year can handle.\n    return valueInThisCentury + 100;\n  }\n  return valueInThisCentury;\n};\n\nconst FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000;\n\n/**\n * Adjusts the year value found in RFC 850 dates according to the rules\n * expressed in RFC7231, which state:\n *\n * <blockquote>Recipients of a timestamp value in rfc850-date format, which uses a\n * two-digit year, MUST interpret a timestamp that appears to be more\n * than 50 years in the future as representing the most recent year in\n * the past that had the same last two digits.</blockquote>\n *\n * @param input - a Date that assumes the two-digit year was in the future\n * @returns a Date that is in the past if input is \\> 50 years in the future\n */\nconst adjustRfc850Year = (input: Date): Date => {\n  if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) {\n    return new Date(\n      Date.UTC(\n        input.getUTCFullYear() - 100,\n        input.getUTCMonth(),\n        input.getUTCDate(),\n        input.getUTCHours(),\n        input.getUTCMinutes(),\n        input.getUTCSeconds(),\n        input.getUTCMilliseconds()\n      )\n    );\n  }\n  return input;\n};\n\nconst parseMonthByShortName = (value: string): number => {\n  const monthIdx = MONTHS.indexOf(value);\n  if (monthIdx < 0) {\n    throw new TypeError(`Invalid month: ${value}`);\n  }\n  return monthIdx + 1;\n};\n\nconst DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n/**\n * Validate the day is valid for the given month.\n * @param year - the year\n * @param month - the month (0-indexed)\n * @param day - the day of the month\n */\nconst validateDayOfMonth = (year: number, month: number, day: number) => {\n  let maxDays = DAYS_IN_MONTH[month];\n  if (month === 1 && isLeapYear(year)) {\n    maxDays = 29;\n  }\n\n  if (day > maxDays) {\n    throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);\n  }\n};\n\nconst isLeapYear = (year: number): boolean => {\n  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n};\n\nconst parseDateValue = (value: string, type: string, lower: number, upper: number): number => {\n  const dateVal = strictParseByte(stripLeadingZeroes(value))!;\n  if (dateVal < lower || dateVal > upper) {\n    throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);\n  }\n  return dateVal;\n};\n\nconst parseMilliseconds = (value: string | undefined): number => {\n  if (value === null || value === undefined) {\n    return 0;\n  }\n\n  return strictParseFloat32(\"0.\" + value)! * 1000;\n};\n\n// Parses offset string and returns offset in milliseconds.\nconst parseOffsetToMilliseconds = (value: string): number => {\n  const directionStr = value[0];\n  let direction = 1;\n  if (directionStr == \"+\") {\n    direction = 1;\n  } else if (directionStr == \"-\") {\n    direction = -1;\n  } else {\n    throw new TypeError(`Offset direction, ${directionStr}, must be \"+\" or \"-\"`);\n  }\n\n  const hour = Number(value.substring(1, 3));\n  const minute = Number(value.substring(4, 6));\n  return direction * (hour * 60 + minute) * 60 * 1000;\n};\n\nconst stripLeadingZeroes = (value: string): string => {\n  let idx = 0;\n  while (idx < value.length - 1 && value.charAt(idx) === \"0\") {\n    idx++;\n  }\n  if (idx === 0) {\n    return value;\n  }\n  return value.slice(idx);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/generateIdempotencyToken.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { generateIdempotencyToken } from \"./index\";\n\ndescribe(\"generateIdempotencyToken\", () => {\n  // This test is not meaningful when using uuid v4 as an external package, but\n  // will become useful if replacing the uuid implementation in the future.\n  const tokens = {} as Record<string, boolean>;\n\n  it(\"should repeatedly generate uuid v4 strings\", () => {\n    for (let i = 0; i < 1000; ++i) {\n      const token = generateIdempotencyToken();\n      tokens[token] = true;\n      expect(generateIdempotencyToken()).toMatch(\n        /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i\n      );\n    }\n\n    expect(Object.keys(tokens)).toHaveLength(1000);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/hash-node/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-buffer-from@4.2.2\n  - @smithy/util-utf8@4.2.2\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/types@4.12.1\n  - @smithy/util-buffer-from@4.2.1\n  - @smithy/util-utf8@4.2.1\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/types@4.6.0\n  - @smithy/util-buffer-from@4.2.0\n  - @smithy/util-utf8@4.2.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-buffer-from@4.1.0\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-buffer-from@4.0.0\n  - @smithy/util-utf8@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-buffer-from@3.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/util-buffer-from@2.2.0\n  - @smithy/util-utf8@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-utf8@2.2.0\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n  - @smithy/util-buffer-from@2.1.1\n  - @smithy/util-utf8@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-buffer-from@2.1.0\n  - @smithy/util-utf8@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [f2a04b7e]\n  - @smithy/util-utf8@2.0.2\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-utf8@2.0.1\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-buffer-from@2.0.0\n  - @smithy/util-utf8@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n  - @smithy/util-buffer-from@1.1.0\n  - @smithy/util-utf8@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-buffer-from@1.0.2\n  - @smithy/util-utf8@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-buffer-from@1.0.1\n  - @smithy/util-utf8@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/hash-node](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/hash-node/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/hash-node/hash-node.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { fromArrayBuffer, fromString } from \"../util-buffer-from/buffer-from\";\nimport { Hash } from \"./hash-node\";\n\nconst hashVectors = require(\"hash-test-vectors\");\nconst hmacVectors = require(\"hash-test-vectors/hmac\");\n\ndescribe(\"Hash\", () => {\n  for (const supportedHash of [\"md5\", \"sha256\"]) {\n    describe(`${supportedHash} test vectors`, () => {\n      for (const { input, ...results } of hashVectors) {\n        const expected = results[supportedHash];\n        it(`should calculate a ${supportedHash} hash of ${expected} for an input of ${input}`, async () => {\n          const hash = new Hash(supportedHash);\n          hash.update(fromString(input, \"base64\"));\n          const { buffer } = await hash.digest();\n          expect(fromArrayBuffer(buffer).toString(\"hex\")).toBe(expected);\n        });\n      }\n\n      for (const { key, data, ...results } of hmacVectors) {\n        const expected = results[supportedHash];\n        it(`should calculate a ${supportedHash} hmac of ${expected} for an input of ${data} and a key of ${key}`, async () => {\n          const hash = new Hash(supportedHash, fromString(key, \"hex\"));\n          hash.update(fromString(data, \"hex\"));\n          const { buffer } = await hash.digest();\n          expect(fromArrayBuffer(buffer).toString(\"hex\")).toMatch(expected);\n        });\n      }\n    });\n  }\n\n  it(\"should accept string data\", async () => {\n    const hash = new Hash(\"md5\");\n    hash.update(\"\");\n    const { buffer } = await hash.digest();\n    expect(fromArrayBuffer(buffer).toString(\"hex\")).toBe(\"d41d8cd98f00b204e9800998ecf8427e\");\n  });\n\n  it(\"should accept ArrayBuffer data\", async () => {\n    const hash = new Hash(\"md5\");\n    hash.update(new ArrayBuffer(0));\n    const { buffer } = await hash.digest();\n    expect(fromArrayBuffer(buffer).toString(\"hex\")).toBe(\"d41d8cd98f00b204e9800998ecf8427e\");\n  });\n\n  it(\"should accept ArrayBufferView data\", async () => {\n    const hash = new Hash(\"md5\");\n    hash.update(new Uint8Array(0));\n    const { buffer } = await hash.digest();\n    expect(fromArrayBuffer(buffer).toString(\"hex\")).toBe(\"d41d8cd98f00b204e9800998ecf8427e\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/hash-node/hash-node.ts",
    "content": "import { createHash, createHmac, type Hmac, type Hash as NodeHash } from \"node:crypto\";\nimport type { Checksum, SourceData } from \"@smithy/types\";\n\nimport { fromArrayBuffer, fromString, type StringEncoding } from \"../util-buffer-from/buffer-from\";\nimport { toUint8Array } from \"../util-utf8/toUint8Array\";\n\n/**\n * @internal\n */\nexport class Hash implements Checksum {\n  private readonly algorithmIdentifier: string;\n  private readonly secret?: SourceData;\n  private hash!: NodeHash | Hmac;\n\n  constructor(algorithmIdentifier: string, secret?: SourceData) {\n    this.algorithmIdentifier = algorithmIdentifier;\n    this.secret = secret;\n    this.reset();\n  }\n\n  update(toHash: SourceData, encoding?: \"utf8\" | \"ascii\" | \"latin1\"): void {\n    this.hash.update(toUint8Array(castSourceData(toHash, encoding)));\n  }\n\n  digest(): Promise<Uint8Array> {\n    return Promise.resolve(this.hash.digest());\n  }\n\n  reset(): void {\n    this.hash = this.secret\n      ? createHmac(this.algorithmIdentifier, castSourceData(this.secret))\n      : createHash(this.algorithmIdentifier);\n  }\n}\n\nfunction castSourceData(toCast: SourceData, encoding?: StringEncoding): Buffer {\n  if (Buffer.isBuffer(toCast)) {\n    return toCast;\n  }\n\n  if (typeof toCast === \"string\") {\n    return fromString(toCast, encoding);\n  }\n\n  if (ArrayBuffer.isView(toCast)) {\n    return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);\n  }\n\n  return fromArrayBuffer(toCast);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/index.browser.ts",
    "content": "import { fromBase64 } from \"./util-base64/fromBase64.browser\";\nimport { toBase64 } from \"./util-base64/toBase64.browser\";\nimport { bindUint8ArrayBlobAdapter } from \"./util-stream/blob/Uint8ArrayBlobAdapter\";\nimport { fromUtf8 } from \"./util-utf8/fromUtf8.browser\";\nimport { toUtf8 } from \"./util-utf8/toUtf8.browser\";\nimport { bindV4 } from \"./uuid/v4\";\n\nconst no = Symbol.for(\"node-only\");\n\nexport { copyDocumentWithTransform } from \"./copyDocumentWithTransform\";\nexport {\n  dateToUtcString,\n  parseRfc3339DateTime,\n  parseRfc3339DateTimeWithOffset,\n  parseRfc7231DateTime,\n  parseEpochTimestamp,\n} from \"./date-utils\";\nexport { LazyJsonString, type AutomaticJsonStringConversion } from \"./lazy-json\";\nexport {\n  logger,\n  parseBoolean,\n  expectBoolean,\n  expectNumber,\n  expectFloat32,\n  expectInt,\n  expectInt32,\n  expectShort,\n  expectByte,\n  expectNonNull,\n  expectObject,\n  expectString,\n  expectUnion,\n  expectLong,\n  strictParseDouble,\n  strictParseFloat,\n  strictParseFloat32,\n  strictParseLong,\n  strictParseInt,\n  strictParseInt32,\n  strictParseShort,\n  strictParseByte,\n  limitedParseDouble,\n  handleFloat,\n  limitedParseFloat,\n  limitedParseFloat32,\n} from \"./parse-utils\";\nexport { quoteHeader } from \"./quote-header\";\nexport {\n  _parseEpochTimestamp,\n  _parseRfc3339DateTimeWithOffset,\n  _parseRfc7231DateTime,\n} from \"./schema-serde-lib/schema-date-utils\";\nexport { splitEvery } from \"./split-every\";\nexport { splitHeader } from \"./split-header\";\nexport { NumericValue, nv, type NumericType } from \"./value/NumericValue\";\n\n// @smithy/util-hex-encoding\nexport { fromHex, toHex } from \"./util-hex-encoding/hex-encoding\";\n\n// @smithy/util-base64\nexport { toBase64, fromBase64 };\n\n// @smithy/util-body-length-browser\nexport { calculateBodyLength } from \"./util-body-length/calculateBodyLength.browser\";\n\n// @smithy/util-utf8\nexport { toUint8Array } from \"./util-utf8/toUint8Array.browser\";\nexport { toUtf8, fromUtf8 };\n\n// @smithy/util-buffer-from\nexport { type StringEncoding } from \"./util-buffer-from/buffer-from\";\nexport const fromArrayBuffer = no;\nexport const fromString = no;\n\n// @smithy/is-array-buffer\nexport { isArrayBuffer } from \"./is-array-buffer/is-array-buffer\";\n\n// @smithy/middleware-serde\nexport { deserializerMiddleware } from \"./middleware-serde/deserializerMiddleware\";\nexport {\n  deserializerMiddlewareOption,\n  serializerMiddlewareOption,\n  getSerdePlugin,\n  type V1OrV2Endpoint,\n} from \"./middleware-serde/serdePlugin\";\nexport { serializerMiddleware } from \"./middleware-serde/serializerMiddleware\";\n\n// @smithy/hash-node\nexport const Hash = no;\n\n// @smithy/util-stream\nexport class Uint8ArrayBlobAdapter extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {}\nexport { ChecksumStream, type ChecksumStreamInit } from \"./util-stream/checksum/ChecksumStream.browser\";\nexport { createChecksumStream } from \"./util-stream/checksum/createChecksumStream.browser\";\nexport { createBufferedReadable } from \"./util-stream/createBufferedReadable.browser\";\nexport { getAwsChunkedEncodingStream } from \"./util-stream/getAwsChunkedEncodingStream.browser\";\nexport { headStream } from \"./util-stream/headStream.browser\";\nexport { sdkStreamMixin } from \"./util-stream/sdk-stream-mixin.browser\";\nexport { splitStream } from \"./util-stream/splitStream.browser\";\nexport { isReadableStream, isBlob } from \"./util-stream/stream-type-check\";\n\n// @smithy/uuid\nconst _getRandomValues = (array: Uint8Array) => crypto.getRandomValues(array);\nexport const v4 = bindV4(_getRandomValues);\nexport const generateIdempotencyToken = v4;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/index.native.ts",
    "content": "import { fromBase64 } from \"./util-base64/fromBase64.browser\";\nimport { toBase64 } from \"./util-base64/toBase64.browser\";\nimport { bindUint8ArrayBlobAdapter } from \"./util-stream/blob/Uint8ArrayBlobAdapter\";\nimport { fromUtf8 } from \"./util-utf8/fromUtf8.browser\";\nimport { toUtf8 } from \"./util-utf8/toUtf8.browser\";\nimport { bindV4 } from \"./uuid/v4\";\n\nconst no = Symbol.for(\"node-only\");\n\nexport { copyDocumentWithTransform } from \"./copyDocumentWithTransform\";\nexport {\n  dateToUtcString,\n  parseRfc3339DateTime,\n  parseRfc3339DateTimeWithOffset,\n  parseRfc7231DateTime,\n  parseEpochTimestamp,\n} from \"./date-utils\";\nexport { LazyJsonString, type AutomaticJsonStringConversion } from \"./lazy-json\";\nexport {\n  logger,\n  parseBoolean,\n  expectBoolean,\n  expectNumber,\n  expectFloat32,\n  expectInt,\n  expectInt32,\n  expectShort,\n  expectByte,\n  expectNonNull,\n  expectObject,\n  expectString,\n  expectUnion,\n  expectLong,\n  strictParseDouble,\n  strictParseFloat,\n  strictParseFloat32,\n  strictParseLong,\n  strictParseInt,\n  strictParseInt32,\n  strictParseShort,\n  strictParseByte,\n  limitedParseDouble,\n  handleFloat,\n  limitedParseFloat,\n  limitedParseFloat32,\n} from \"./parse-utils\";\nexport { quoteHeader } from \"./quote-header\";\nexport {\n  _parseEpochTimestamp,\n  _parseRfc3339DateTimeWithOffset,\n  _parseRfc7231DateTime,\n} from \"./schema-serde-lib/schema-date-utils\";\nexport { splitEvery } from \"./split-every\";\nexport { splitHeader } from \"./split-header\";\nexport { NumericValue, nv, type NumericType } from \"./value/NumericValue\";\n\n// @smithy/util-hex-encoding\nexport { fromHex, toHex } from \"./util-hex-encoding/hex-encoding\";\n\n// @smithy/util-base64\nexport { fromBase64 } from \"./util-base64/fromBase64.browser\";\nexport { toBase64 } from \"./util-base64/toBase64.browser\";\n\n// @smithy/util-body-length-browser\nexport { calculateBodyLength } from \"./util-body-length/calculateBodyLength.browser\";\n\n// @smithy/util-utf8\nexport { fromUtf8 } from \"./util-utf8/fromUtf8.browser\";\nexport { toUint8Array } from \"./util-utf8/toUint8Array.browser\";\nexport { toUtf8 } from \"./util-utf8/toUtf8.browser\";\n\n// @smithy/util-buffer-from\nexport { type StringEncoding } from \"./util-buffer-from/buffer-from\";\nexport const fromArrayBuffer = no;\nexport const fromString = no;\n\n// @smithy/is-array-buffer\nexport { isArrayBuffer } from \"./is-array-buffer/is-array-buffer\";\n\n// @smithy/middleware-serde\nexport { deserializerMiddleware } from \"./middleware-serde/deserializerMiddleware\";\nexport {\n  deserializerMiddlewareOption,\n  serializerMiddlewareOption,\n  getSerdePlugin,\n  type V1OrV2Endpoint,\n} from \"./middleware-serde/serdePlugin\";\nexport { serializerMiddleware } from \"./middleware-serde/serializerMiddleware\";\n\n// @smithy/hash-node\nexport const Hash = no;\n\n// @smithy/util-stream\nexport class Uint8ArrayBlobAdapter extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {}\nexport { ChecksumStream, type ChecksumStreamInit } from \"./util-stream/checksum/ChecksumStream.browser\";\nexport { createChecksumStream } from \"./util-stream/checksum/createChecksumStream.browser\";\nexport { createBufferedReadable } from \"./util-stream/createBufferedReadable.browser\";\nexport { getAwsChunkedEncodingStream } from \"./util-stream/getAwsChunkedEncodingStream.browser\";\nexport { headStream } from \"./util-stream/headStream.browser\";\nexport { sdkStreamMixin } from \"./util-stream/sdk-stream-mixin.browser\";\nexport { splitStream } from \"./util-stream/splitStream.browser\";\nexport { isReadableStream, isBlob } from \"./util-stream/stream-type-check\";\n\n// @smithy/uuid\nconst _getRandomValues = (array: Uint8Array) => crypto.getRandomValues(array);\nexport const v4 = bindV4(_getRandomValues);\nexport const generateIdempotencyToken = v4;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/index.ts",
    "content": "import { getRandomValues } from \"node:crypto\";\n\nimport { fromBase64 } from \"./util-base64/fromBase64\";\nimport { toBase64 } from \"./util-base64/toBase64\";\nimport { bindUint8ArrayBlobAdapter } from \"./util-stream/blob/Uint8ArrayBlobAdapter\";\nimport { fromUtf8 } from \"./util-utf8/fromUtf8\";\nimport { toUtf8 } from \"./util-utf8/toUtf8\";\nimport { bindV4 } from \"./uuid/v4\";\n\nexport { copyDocumentWithTransform } from \"./copyDocumentWithTransform\";\nexport {\n  dateToUtcString,\n  parseRfc3339DateTime,\n  parseRfc3339DateTimeWithOffset,\n  parseRfc7231DateTime,\n  parseEpochTimestamp,\n} from \"./date-utils\";\nexport { LazyJsonString, type AutomaticJsonStringConversion } from \"./lazy-json\";\nexport {\n  logger,\n  parseBoolean,\n  expectBoolean,\n  expectNumber,\n  expectFloat32,\n  expectInt,\n  expectInt32,\n  expectShort,\n  expectByte,\n  expectNonNull,\n  expectObject,\n  expectString,\n  expectUnion,\n  expectLong,\n  strictParseDouble,\n  strictParseFloat,\n  strictParseFloat32,\n  strictParseLong,\n  strictParseInt,\n  strictParseInt32,\n  strictParseShort,\n  strictParseByte,\n  limitedParseDouble,\n  handleFloat,\n  limitedParseFloat,\n  limitedParseFloat32,\n} from \"./parse-utils\";\nexport { quoteHeader } from \"./quote-header\";\nexport {\n  _parseEpochTimestamp,\n  _parseRfc3339DateTimeWithOffset,\n  _parseRfc7231DateTime,\n} from \"./schema-serde-lib/schema-date-utils\";\nexport { splitEvery } from \"./split-every\";\nexport { splitHeader } from \"./split-header\";\nexport { NumericValue, nv, type NumericType } from \"./value/NumericValue\";\n\n// @smithy/util-hex-encoding\nexport { fromHex, toHex } from \"./util-hex-encoding/hex-encoding\";\n\n// @smithy/util-base64\nexport { toBase64, fromBase64 };\n\n// @smithy/util-body-length-browser and @smithy/util-body-length-node\nexport { calculateBodyLength } from \"./util-body-length/calculateBodyLength\";\n\n// @smithy/util-utf8\nexport { toUint8Array } from \"./util-utf8/toUint8Array\";\nexport { toUtf8, fromUtf8 };\n\n// @smithy/util-buffer-from\nexport { fromArrayBuffer, fromString, type StringEncoding } from \"./util-buffer-from/buffer-from\";\n\n// @smithy/is-array-buffer\nexport { isArrayBuffer } from \"./is-array-buffer/is-array-buffer\";\n\n// @smithy/middleware-serde\nexport { deserializerMiddleware } from \"./middleware-serde/deserializerMiddleware\";\nexport {\n  deserializerMiddlewareOption,\n  serializerMiddlewareOption,\n  getSerdePlugin,\n  type V1OrV2Endpoint,\n} from \"./middleware-serde/serdePlugin\";\nexport { serializerMiddleware } from \"./middleware-serde/serializerMiddleware\";\n\n// @smithy/hash-node\nexport { Hash } from \"./hash-node/hash-node\";\n\n// @smithy/util-stream\nexport class Uint8ArrayBlobAdapter extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {}\nexport { ChecksumStream, type ChecksumStreamInit } from \"./util-stream/checksum/ChecksumStream\";\nexport { createChecksumStream } from \"./util-stream/checksum/createChecksumStream\";\nexport { createBufferedReadable } from \"./util-stream/createBufferedReadable\";\nexport { getAwsChunkedEncodingStream } from \"./util-stream/getAwsChunkedEncodingStream\";\nexport { headStream } from \"./util-stream/headStream\";\nexport { sdkStreamMixin } from \"./util-stream/sdk-stream-mixin\";\nexport { splitStream } from \"./util-stream/splitStream\";\nexport { isReadableStream, isBlob } from \"./util-stream/stream-type-check\";\n\n// @smithy/uuid\nconst _getRandomValues = getRandomValues as (array: Uint8Array) => Uint8Array;\nexport const v4 = bindV4(_getRandomValues);\nexport const generateIdempotencyToken = v4;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/is-array-buffer/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/is-array-buffer](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/is-array-buffer/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/is-array-buffer/is-array-buffer.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { isArrayBuffer } from \"./is-array-buffer\";\n\ndescribe(\"isArrayBuffer\", () => {\n  const arrayBufferConstructor = ArrayBuffer;\n\n  afterEach(() => {\n    (ArrayBuffer as any) = arrayBufferConstructor;\n  });\n\n  it(\"should return true for ArrayBuffer objects\", () => {\n    expect(isArrayBuffer(new ArrayBuffer(0))).toBe(true);\n  });\n\n  it(\"should return false for ArrayBufferView objects\", () => {\n    const view = new Uint8Array(0);\n\n    expect(isArrayBuffer(view)).toBe(false);\n    expect(isArrayBuffer(view.buffer)).toBe(true);\n  });\n\n  it(\"should return false for scalar values\", () => {\n    for (const scalar of [\"string\", 123.234, true, null, void 0]) {\n      expect(isArrayBuffer(scalar)).toBe(false);\n    }\n  });\n\n  it(\"should return true for ArrayBuffers created with a different instance of the ArrayBuffer constructor\", () => {\n    const buffer = new ArrayBuffer(0);\n    (ArrayBuffer as any) = vi.fn(() => buffer);\n\n    expect(buffer).not.toBeInstanceOf(ArrayBuffer);\n    expect(isArrayBuffer(buffer)).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/is-array-buffer/is-array-buffer.ts",
    "content": "/**\n * @internal\n */\nexport const isArrayBuffer = (arg: any): arg is ArrayBuffer =>\n  (typeof ArrayBuffer === \"function\" && arg instanceof ArrayBuffer) ||\n  Object.prototype.toString.call(arg) === \"[object ArrayBuffer]\";\n"
  },
  {
    "path": "packages/core/src/submodules/serde/lazy-json.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { LazyJsonString } from \"./lazy-json\";\n\ndescribe(\"LazyJsonString\", () => {\n  it(\"should have string methods\", () => {\n    const jsonValue = new LazyJsonString('\"foo\"');\n    expect(jsonValue.length).toBe(5);\n    expect(jsonValue.toString()).toBe('\"foo\"');\n  });\n\n  it(\"should deserialize json properly\", () => {\n    const jsonValue = new LazyJsonString('\"foo\"');\n    expect(jsonValue.deserializeJSON()).toBe(\"foo\");\n    const wrongJsonValue = new LazyJsonString(\"foo\");\n    expect(() => wrongJsonValue.deserializeJSON()).toThrow();\n  });\n\n  it(\"should get JSON string properly\", () => {\n    const jsonValue = new LazyJsonString('{\"foo\", \"bar\"}');\n    expect(jsonValue.toJSON()).toBe('{\"foo\", \"bar\"}');\n  });\n\n  it(\"can instantiate from LazyJsonString class\", () => {\n    const original = new LazyJsonString('\"foo\"');\n    const newOne = LazyJsonString.from(original);\n    expect(newOne.toString()).toBe('\"foo\"');\n  });\n\n  it(\"can instantiate from String class\", () => {\n    const jsonValue = LazyJsonString.from(new String('\"foo\"'));\n    expect(jsonValue.toString()).toBe('\"foo\"');\n  });\n\n  it(\"can instantiate from object\", () => {\n    const jsonValue = LazyJsonString.from({ foo: \"bar\" });\n    expect(jsonValue.toString()).toBe('{\"foo\":\"bar\"}');\n  });\n\n  it(\"passes instanceof String check\", () => {\n    const jsonValue = LazyJsonString.from({ foo: \"bar\" });\n    expect(jsonValue).toBeInstanceOf(String);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/lazy-json.ts",
    "content": "/* eslint-disable @typescript-eslint/no-wrapper-object-types */\n/**\n * A model field with this type means that you may provide a JavaScript\n * object in lieu of a JSON string, and it will be serialized to JSON\n * automatically before being sent in a request.\n * For responses, you will receive a \"LazyJsonString\", which is a boxed String object\n * with additional mixin methods.\n * To get the string value, call `.toString()`, or to get the JSON object value,\n * call `.deserializeJSON()` or parse it yourself.\n *\n * @public\n */\nexport type AutomaticJsonStringConversion = Parameters<typeof JSON.stringify>[0] | LazyJsonString;\n\n/**\n * @internal\n */\nexport interface LazyJsonString extends String {\n  /**\n   * @returns the JSON parsing of the string value.\n   */\n  deserializeJSON(): any;\n\n  /**\n   * @returns the original string value rather than a JSON.stringified value.\n   */\n  toJSON(): string;\n}\n\n/**\n * Extension of the native String class in the previous implementation\n * has negative global performance impact on method dispatch for strings,\n * and is generally discouraged.\n * This current implementation may look strange, but is necessary to preserve the interface and\n * behavior of extending the String class.\n *\n * @internal\n */\nexport const LazyJsonString = function LazyJsonString(val: string): void {\n  const str = Object.assign(new String(val), {\n    deserializeJSON() {\n      return JSON.parse(String(val));\n    },\n\n    toString() {\n      return String(val);\n    },\n\n    toJSON() {\n      return String(val);\n    },\n  });\n\n  return str as never;\n} as any as {\n  new (s: string): LazyJsonString;\n  (s: string): LazyJsonString;\n  from(s: any): LazyJsonString;\n  /**\n   * @deprecated use #from.\n   */\n  fromObject(s: any): LazyJsonString;\n};\n\nLazyJsonString.from = (object: any): LazyJsonString => {\n  if (object && typeof object === \"object\" && (object instanceof LazyJsonString || \"deserializeJSON\" in object)) {\n    return object as any;\n  } else if (typeof object === \"string\" || Object.getPrototypeOf(object) === String.prototype) {\n    return LazyJsonString(String(object) as string) as any;\n  }\n  return LazyJsonString(JSON.stringify(object)) as any;\n};\n\n/**\n * @deprecated use #from.\n */\nLazyJsonString.fromObject = LazyJsonString.from;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.20\n\n### Patch Changes\n\n- @smithy/core@3.23.17\n\n## 4.2.19\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n  - @smithy/core@3.23.16\n\n## 4.2.18\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/core@3.23.15\n  - @smithy/protocol-http@5.3.14\n\n## 4.2.17\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/protocol-http@5.3.13\n\n## 4.2.16\n\n### Patch Changes\n\n- Updated dependencies [7198e09]\n  - @smithy/core@3.23.13\n\n## 4.2.15\n\n### Patch Changes\n\n- @smithy/core@3.23.12\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [2edd638]\n  - @smithy/core@3.23.11\n\n## 4.2.13\n\n### Patch Changes\n\n- 5340b11: apply resolved endpoint headers to final request\n- Updated dependencies [5340b11]\n  - @smithy/core@3.23.10\n  - @smithy/types@4.13.1\n  - @smithy/protocol-http@5.3.12\n\n## 4.2.12\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/protocol-http@5.3.11\n\n## 4.2.11\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/protocol-http@5.3.10\n\n## 4.2.10\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n\n## 4.2.9\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/protocol-http@5.3.8\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/protocol-http@5.3.7\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/protocol-http@5.3.6\n\n## 4.2.6\n\n### Patch Changes\n\n- e659a06: explicit non-enumerability for error.$response\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/protocol-http@5.3.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/protocol-http@5.3.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/protocol-http@5.3.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/protocol-http@5.3.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/protocol-http@5.3.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/protocol-http@5.2.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/protocol-http@5.2.0\n  - @smithy/types@4.4.0\n\n## 4.0.9\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/protocol-http@5.1.3\n\n## 4.0.8\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/protocol-http@5.1.2\n\n## 4.0.7\n\n### Patch Changes\n\n- ae11e3a: add schema classes\n\n## 4.0.6\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/protocol-http@5.1.1\n\n## 4.0.5\n\n### Patch Changes\n\n- 786dd3a: reduce usage of endpoints2.0 type adapter in public interfaces\n\n## 4.0.4\n\n### Patch Changes\n\n- 103535a: add response metadata to deserializer errors\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n\n## 4.0.2\n\n### Patch Changes\n\n- f5d0bac: handle unwritable error.message field\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/types@4.0.0\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/types@2.12.0\n\n## 2.2.1\n\n### Patch Changes\n\n- 32e3f6ff: use SerdeFunctions as input type and SerdeContext as resolved type for serde plugin\n\n## 2.2.0\n\n### Minor Changes\n\n- 43f3e1e2: encoders allow string inputs\n\n### Patch Changes\n\n- 49640d6c: allow deserializers to populate error response body\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/types@2.9.0\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n\n## 2.0.5\n\n### Patch Changes\n\n- 1be3c4c9: Add integration tests\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/middleware-serde](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/middleware-serde/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/deserializerMiddleware.spec.ts",
    "content": "import { HttpResponse } from \"@smithy/protocol-http\";\nimport type { EndpointBearer, SerdeFunctions } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { deserializerMiddleware } from \"./deserializerMiddleware\";\n\ndescribe(\"deserializerMiddleware\", () => {\n  const mockNext = vi.fn();\n  const mockDeserializer = vi.fn();\n\n  const mockOptions = {\n    endpoint: () =>\n      Promise.resolve({\n        protocol: \"protocol\",\n        hostname: \"hostname\",\n        path: \"path\",\n      }),\n  } as EndpointBearer & SerdeFunctions;\n\n  const mockArgs = {\n    input: {\n      inputKey: \"inputValue\",\n    },\n    request: {\n      method: \"GET\",\n      headers: {},\n    },\n  };\n\n  const mockOutput = {\n    $metadata: {\n      statusCode: 200,\n      requestId: \"requestId\",\n    },\n    outputKey: \"outputValue\",\n  };\n\n  const mockNextResponse = {\n    response: {\n      statusCode: 200,\n      headers: {},\n    },\n    $metadata: {\n      httpStatusCode: 200,\n      requestId: undefined,\n      extendedRequestId: undefined,\n      cfId: undefined,\n    },\n  };\n\n  const mockResponse = {\n    response: mockNextResponse.response,\n    output: mockOutput,\n  };\n\n  beforeEach(() => {\n    mockNext.mockResolvedValueOnce(mockNextResponse);\n    mockDeserializer.mockResolvedValueOnce(mockOutput);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"calls deserializer and populates response object\", async () => {\n    await expect(deserializerMiddleware(mockOptions, mockDeserializer)(mockNext, {})(mockArgs)).resolves.toStrictEqual(\n      mockResponse\n    );\n\n    expect(mockNext).toHaveBeenCalledTimes(1);\n    expect(mockNext).toHaveBeenCalledWith(mockArgs);\n    expect(mockDeserializer).toHaveBeenCalledTimes(1);\n    expect(mockDeserializer).toHaveBeenCalledWith(mockNextResponse.response, mockOptions);\n  });\n\n  it(\"injects non-enumerable $response reference to deserializing exceptions\", async () => {\n    const exception = Object.assign(new Error(\"MockException\"), mockNextResponse.response);\n    mockDeserializer.mockReset();\n    mockDeserializer.mockRejectedValueOnce(exception);\n    try {\n      await deserializerMiddleware(mockOptions, mockDeserializer)(mockNext, {})(mockArgs);\n      fail(\"DeserializerMiddleware should throw\");\n    } catch (e) {\n      expect(e).toMatchObject(exception);\n      expect(e.$response).toEqual(mockNextResponse.response);\n      expect(Object.keys(e)).not.toContain(\"$response\");\n    }\n  });\n\n  it(\"adds a hint about $response to the message of the thrown error\", async () => {\n    const exception = Object.assign(new Error(\"MockException\"), mockNextResponse.response, {\n      $response: {\n        body: \"\",\n      },\n      $responseBodyText: \"oh no\",\n    });\n    mockDeserializer.mockReset();\n    mockDeserializer.mockRejectedValueOnce(exception);\n    try {\n      await deserializerMiddleware(mockOptions, mockDeserializer)(mockNext, {})(mockArgs);\n      fail(\"DeserializerMiddleware should throw\");\n    } catch (e) {\n      expect(e.message).toContain(\n        \"to see the raw response, inspect the hidden field {error}.$response on this object.\"\n      );\n      expect(e.$response.body).toEqual(\"oh no\");\n    }\n  });\n\n  it(\"handles unwritable error.message\", async () => {\n    const exception = Object.assign({}, mockNextResponse.response, {\n      $response: {\n        body: \"\",\n      },\n      $responseBodyText: \"oh no\",\n    });\n\n    Object.defineProperty(exception, \"message\", {\n      set() {\n        throw new Error(\"may not call setter\");\n      },\n      get() {\n        return \"MockException\";\n      },\n    });\n\n    const sink = vi.fn();\n\n    mockDeserializer.mockReset();\n    mockDeserializer.mockRejectedValueOnce(exception);\n    try {\n      await deserializerMiddleware(mockOptions, mockDeserializer)(mockNext, {\n        logger: {\n          debug: sink,\n          info: sink,\n          warn: sink,\n          error: sink,\n        },\n      })(mockArgs);\n      fail(\"DeserializerMiddleware should throw\");\n    } catch (e) {\n      expect(sink).toHaveBeenCalledWith(\n        `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`\n      );\n      expect(e.message).toEqual(\"MockException\");\n      expect(e.$response.body).toEqual(\"oh no\");\n    }\n  });\n\n  describe(\"metadata\", () => {\n    it(\"assigns metadata from the response in the event of a deserializer failure\", async () => {\n      const midware = deserializerMiddleware(mockOptions, async () => {\n        JSON.parse(`this isn't JSON`);\n      });\n      const handler = midware(\n        async () => ({\n          response: new HttpResponse({\n            headers: {\n              \"x-namespace-requestid\": \"requestid\",\n              \"x-namespace-id-2\": \"id2\",\n              \"x-namespace-cf-id\": \"cf\",\n            },\n            statusCode: 503,\n          }),\n        }),\n        {}\n      );\n      try {\n        await handler(mockArgs);\n        fail(\"DeserializerMiddleware should throw\");\n      } catch (e) {\n        expect(e.$metadata).toEqual({\n          httpStatusCode: 503,\n          requestId: \"requestid\",\n          extendedRequestId: \"id2\",\n          cfId: \"cf\",\n        });\n      }\n      expect.assertions(1);\n    });\n\n    it(\"assigns any available metadata from the response in the event of a deserializer failure\", async () => {\n      const midware = deserializerMiddleware(mockOptions, async () => {\n        JSON.parse(`this isn't JSON`);\n      });\n      const handler = midware(\n        async () => ({\n          response: new HttpResponse({\n            statusCode: 301,\n            headers: {\n              \"x-namespace-requestid\": \"requestid\",\n            },\n          }),\n        }),\n        {}\n      );\n      try {\n        await handler(mockArgs);\n        fail(\"DeserializerMiddleware should throw\");\n      } catch (e) {\n        expect(e.$metadata).toEqual({\n          httpStatusCode: 301,\n          requestId: \"requestid\",\n          extendedRequestId: undefined,\n          cfId: undefined,\n        });\n      }\n      expect.assertions(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/deserializerMiddleware.ts",
    "content": "import { HttpResponse } from \"@smithy/core/protocols\";\nimport type {\n  DeserializeHandler,\n  DeserializeHandlerArguments,\n  DeserializeHandlerOutput,\n  DeserializeMiddleware,\n  HandlerExecutionContext,\n  MetadataBearer,\n  ResponseDeserializer,\n  SerdeContext,\n  SerdeFunctions,\n} from \"@smithy/types\";\n\n/**\n * @internal\n * @deprecated will be replaced by schemaSerdePlugin from core/schema.\n */\nexport const deserializerMiddleware =\n  <Input extends object = any, Output extends object = any, CommandSerdeContext extends SerdeContext = any>(\n    options: SerdeFunctions,\n    deserializer: ResponseDeserializer<any, any, CommandSerdeContext>\n  ): DeserializeMiddleware<Input, Output> =>\n  (next: DeserializeHandler<Input, Output>, context: HandlerExecutionContext): DeserializeHandler<Input, Output> =>\n  async (args: DeserializeHandlerArguments<Input>): Promise<DeserializeHandlerOutput<Output>> => {\n    const { response } = await next(args);\n    try {\n      /**\n       * [options] is upgraded from SerdeFunctions to CommandSerdeContext,\n       * since the generated deserializer expects CommandSerdeContext.\n       *\n       * This is okay because options is from the same client's resolved config,\n       * and the deserializer doesn't need the `endpoint` field.\n       */\n      const parsed = await deserializer(response, options as CommandSerdeContext);\n      return {\n        response,\n        output: parsed as Output,\n      };\n    } catch (error) {\n      // For security reasons, the error response is not completely visible by default.\n      Object.defineProperty(error, \"$response\", {\n        value: response,\n        // we need to define these properties explicitly because\n        // the service exception class may have set the value to undefined, but populated the key.\n        enumerable: false,\n        writable: false,\n        configurable: false,\n      });\n\n      if (!(\"$metadata\" in error)) {\n        // only apply this to non-ServiceException.\n        const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;\n        try {\n          error.message += \"\\n  \" + hint;\n        } catch (e) {\n          // Error with an unwritable message (strict mode getter with no setter).\n          if (!context.logger || context.logger?.constructor?.name === \"NoOpLogger\") {\n            console.warn(hint);\n          } else {\n            context.logger?.warn?.(hint);\n          }\n        }\n\n        if (typeof error.$responseBodyText !== \"undefined\") {\n          // if $responseBodyText was collected by the error parser, assign it to\n          // replace the response body, because it was consumed and is now empty.\n          if (error.$response) {\n            error.$response.body = error.$responseBodyText;\n          }\n        }\n\n        try {\n          // if the deserializer failed, then $metadata may still be set\n          // by taking information from the response.\n          if (HttpResponse.isInstance(response)) {\n            const { headers = {} } = response;\n            const headerEntries = Object.entries(headers);\n            (error as MetadataBearer).$metadata = {\n              httpStatusCode: response.statusCode,\n              requestId: findHeader(/^x-[\\w-]+-request-?id$/, headerEntries),\n              extendedRequestId: findHeader(/^x-[\\w-]+-id-2$/, headerEntries),\n              cfId: findHeader(/^x-[\\w-]+-cf-id$/, headerEntries),\n            };\n          }\n        } catch (e) {\n          // ignored, error object was not writable.\n        }\n      }\n\n      throw error;\n    }\n  };\n\n/**\n * @internal\n * @returns header value where key matches regex.\n */\nconst findHeader = (pattern: RegExp, headers: [string, string][]): string | undefined => {\n  return (headers.find(([k]) => {\n    return k.match(pattern);\n  }) || [void 0, void 1])[1];\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/middleware-serde.integ.spec.ts",
    "content": "import { requireRequestsFrom } from \"@smithy/util-test/src\";\nimport { describe, test as it } from \"vitest\";\nimport { Weather } from \"weather\";\n\ndescribe(\"middleware-serde\", () => {\n  describe(Weather.name, () => {\n    it(\"should serialize TestProtocol\", async () => {\n      const client = new Weather({\n        endpoint: \"https://foo.bar\",\n        region: \"us-west-2\",\n        credentials: {\n          accessKeyId: \"INTEG\",\n          secretAccessKey: \"INTEG\",\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        method: \"PUT\",\n        hostname: \"foo.bar\",\n        body: \"{}\",\n        protocol: \"https:\",\n        path: \"/city\",\n      });\n      await client.createCity({\n        name: \"MyCity\",\n        coordinates: {\n          latitude: 0,\n          longitude: 0,\n        },\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/serdePlugin.ts",
    "content": "import type {\n  DeserializeHandlerOptions,\n  Endpoint,\n  MetadataBearer,\n  MiddlewareStack,\n  Pluggable,\n  Provider,\n  RequestSerializer,\n  ResponseDeserializer,\n  SerdeContext,\n  SerdeFunctions,\n  SerializeHandlerOptions,\n  UrlParser,\n} from \"@smithy/types\";\n\nimport { deserializerMiddleware } from \"./deserializerMiddleware\";\nimport { serializerMiddleware } from \"./serializerMiddleware\";\n\n/**\n * @deprecated will be replaced by schemaSerdePlugin from core/schema.\n */\nexport const deserializerMiddlewareOption: DeserializeHandlerOptions = {\n  name: \"deserializerMiddleware\",\n  step: \"deserialize\",\n  tags: [\"DESERIALIZER\"],\n  override: true,\n};\n\n/**\n * @deprecated will be replaced by schemaSerdePlugin from core/schema.\n */\nexport const serializerMiddlewareOption: SerializeHandlerOptions = {\n  name: \"serializerMiddleware\",\n  step: \"serialize\",\n  tags: [\"SERIALIZER\"],\n  override: true,\n};\n\n/**\n * Modifies the EndpointBearer to make it compatible with Endpoints 2.0 change.\n *\n * @internal\n * @deprecated\n */\nexport type V1OrV2Endpoint = {\n  // for v2\n  urlParser?: UrlParser;\n\n  // for v1\n  endpoint?: Provider<Endpoint>;\n};\n\n/**\n * @internal\n * @deprecated will be replaced by schemaSerdePlugin from core/schema.\n */\nexport function getSerdePlugin<\n  InputType extends object = any,\n  CommandSerdeContext extends SerdeContext = any,\n  OutputType extends MetadataBearer = any,\n>(\n  config: SerdeFunctions,\n  serializer: RequestSerializer<any, CommandSerdeContext>,\n  deserializer: ResponseDeserializer<OutputType, any, CommandSerdeContext>\n): Pluggable<InputType, OutputType> {\n  return {\n    applyToStack: (commandStack: MiddlewareStack<InputType, OutputType>) => {\n      commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);\n      commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);\n    },\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/serializerMiddleware.spec.ts",
    "content": "import type { EndpointBearer, SerdeFunctions } from \"@smithy/types\";\nimport { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { serializerMiddleware } from \"./serializerMiddleware\";\n\ndescribe(\"serializerMiddleware\", () => {\n  const mockNext = vi.fn();\n  const mockSerializer = vi.fn();\n\n  const mockOptions = {\n    endpoint: () =>\n      Promise.resolve({\n        protocol: \"protocol\",\n        hostname: \"hostname\",\n        path: \"path\",\n      }),\n  } as EndpointBearer & SerdeFunctions;\n\n  const mockRequest = {\n    method: \"GET\",\n    headers: {},\n  };\n\n  const mockResponse = {\n    statusCode: 200,\n    headers: {},\n  };\n\n  const mockOutput = {\n    $metadata: {\n      statusCode: 200,\n      requestId: \"requestId\",\n    },\n    outputKey: \"outputValue\",\n  };\n\n  const mockReturn = {\n    response: mockResponse,\n    output: mockOutput,\n  };\n\n  const mockArgs = {\n    input: {\n      inputKey: \"inputValue\",\n    },\n  };\n\n  beforeEach(() => {\n    mockNext.mockResolvedValueOnce(mockReturn);\n    mockSerializer.mockResolvedValueOnce(mockRequest);\n  });\n\n  it(\"calls serializer and populates request object\", async () => {\n    await expect(serializerMiddleware(mockOptions, mockSerializer)(mockNext, {})(mockArgs)).resolves.toStrictEqual(\n      mockReturn\n    );\n\n    expect(mockSerializer).toHaveBeenCalledTimes(1);\n    expect(mockSerializer).toHaveBeenCalledWith(mockArgs.input, mockOptions);\n    expect(mockNext).toHaveBeenCalledTimes(1);\n    expect(mockNext).toHaveBeenCalledWith({ ...mockArgs, request: mockRequest });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/middleware-serde/serializerMiddleware.ts",
    "content": "import { toEndpointV1 } from \"@smithy/core/endpoints\";\nimport type {\n  Endpoint,\n  HandlerExecutionContext,\n  Provider,\n  RequestSerializer,\n  SerdeContext,\n  SerdeFunctions,\n  SerializeHandler,\n  SerializeHandlerArguments,\n  SerializeHandlerOutput,\n  SerializeMiddleware,\n} from \"@smithy/types\";\n\nimport type { V1OrV2Endpoint } from \"./serdePlugin\";\n\n/**\n * @internal\n * @deprecated will be replaced by schemaSerdePlugin from core/schema.\n */\nexport const serializerMiddleware =\n  <Input extends object = any, Output extends object = any, CommandSerdeContext extends SerdeContext = any>(\n    options: SerdeFunctions,\n    serializer: RequestSerializer<any, CommandSerdeContext>\n  ): SerializeMiddleware<Input, Output> =>\n  (next: SerializeHandler<Input, Output>, context: HandlerExecutionContext): SerializeHandler<Input, Output> =>\n  async (args: SerializeHandlerArguments<Input>): Promise<SerializeHandlerOutput<Output>> => {\n    const endpointConfig = options as V1OrV2Endpoint;\n\n    const endpoint: Provider<Endpoint> = context.endpointV2\n      ? async () => toEndpointV1(context.endpointV2!)\n      : endpointConfig.endpoint!;\n\n    if (!endpoint) {\n      throw new Error(\"No valid endpoint provider available.\");\n    }\n\n    /**\n     * [options] is upgraded from SerdeFunctions to CommandSerdeContext,\n     * since the generated serializer expects CommandSerdeContext.\n     *\n     * This is okay because options is from the same client's resolved config,\n     * and `endpoint` has been provided here by checking two sources.\n     */\n    const request = await serializer(args.input, { ...options, endpoint } as CommandSerdeContext);\n\n    return next({\n      ...args,\n      request,\n    });\n  };\n"
  },
  {
    "path": "packages/core/src/submodules/serde/parse-utils.spec.ts",
    "content": "import { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  expectBoolean,\n  expectByte,\n  expectFloat32,\n  expectInt32,\n  expectLong,\n  expectNonNull,\n  expectNumber,\n  expectObject,\n  expectShort,\n  expectString,\n  expectUnion,\n  limitedParseDouble,\n  limitedParseFloat32,\n  logger,\n  parseBoolean,\n  strictParseByte,\n  strictParseDouble,\n  strictParseFloat32,\n  strictParseInt32,\n  strictParseLong,\n  strictParseShort,\n} from \"./parse-utils\";\n\nlogger.warn = () => {};\n\ndescribe(\"parseBoolean\", () => {\n  it('Returns true for \"true\"', () => {\n    expect(parseBoolean(\"true\")).toEqual(true);\n  });\n\n  it('Returns false for \"false\"', () => {\n    expect(parseBoolean(\"false\")).toEqual(false);\n  });\n\n  describe(\"Throws an error on invalid input\", () => {\n    it.each([\n      // These are valid booleans in YAML\n      \"y\",\n      \"Y\",\n      \"yes\",\n      \"Yes\",\n      \"YES\",\n      \"n\",\n      \"N\",\n      \"no\",\n      \"No\",\n      \"NO\",\n      \"True\",\n      \"TRUE\",\n      \"False\",\n      \"FALSE\",\n      \"on\",\n      \"On\",\n      \"ON\",\n      \"off\",\n      \"Off\",\n      \"OFF\",\n      // These would be resolve to false using Boolean\n      0,\n      null,\n      \"\",\n      false,\n      // These would resolve to true using Boolean\n      true,\n      \"Su Lin\",\n      [],\n      {},\n    ])(\"rejects %s\", (value) => {\n      expect(() => parseBoolean(value as any)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectBoolean\", () => {\n  it.each([true, false])(\"accepts %s\", (value) => {\n    expect(expectBoolean(value)).toEqual(value);\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectBoolean(value)).toEqual(undefined);\n  });\n\n  describe(\"reluctantly\", () => {\n    let consoleMock: any;\n    beforeEach(() => {\n      consoleMock = vi.spyOn(logger, \"warn\");\n    });\n\n    afterEach(() => {\n      consoleMock.mockRestore();\n    });\n\n    it.each([1, \"true\", \"True\"])(\"accepts %s\", (value) => {\n      expect(expectBoolean(value)).toEqual(true);\n      expect(logger.warn).toHaveBeenCalled();\n    });\n\n    it.each([0, \"false\", \"False\"])(\"accepts %s\", (value) => {\n      expect(expectBoolean(value)).toEqual(false);\n      expect(logger.warn).toHaveBeenCalled();\n    });\n  });\n\n  describe(\"rejects non-booleans\", () => {\n    it.each([1.1, Infinity, -Infinity, NaN, {}, []])(\"rejects %s\", (value) => {\n      expect(() => expectBoolean(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectNumber\", () => {\n  describe(\"accepts numbers\", () => {\n    it.each([1, 1.1, Infinity, -Infinity])(\"accepts %s\", (value) => {\n      expect(expectNumber(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectNumber(value)).toEqual(undefined);\n  });\n\n  describe(\"reluctantly\", () => {\n    let consoleMock: any;\n    beforeEach(() => {\n      consoleMock = vi.spyOn(logger, \"warn\");\n    });\n\n    afterEach(() => {\n      consoleMock.mockRestore();\n    });\n\n    it.each([\"-0\", \"-1.15\", \"-1e-5\", \"1\", \"1.1\", \"Infinity\", \"-Infinity\"])(\"accepts string: %s\", (value) => {\n      expect(expectNumber(value)).toEqual(parseFloat(value));\n    });\n\n    it.each([\"-0abcd\", \"-1.15abcd\", \"-1e-5abcd\", \"1abcd\", \"1.1abcd\", \"Infinityabcd\", \"-Infinityabcd\"])(\n      \"accepts string: %s\",\n      (value) => {\n        expect(expectNumber(value)).toEqual(parseFloat(value));\n        expect(logger.warn).toHaveBeenCalled();\n      }\n    );\n  });\n\n  describe(\"rejects non-numbers\", () => {\n    it.each([\"NaN\", true, false, [], {}])(\"rejects %s\", (value) => {\n      expect(() => expectNumber(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectFloat32\", () => {\n  describe(\"accepts numbers\", () => {\n    it.each([\n      1,\n      1.1,\n      Infinity,\n      -Infinity,\n      // Smallest positive subnormal number\n      2 ** -149,\n      // Largest subnormal number\n      2 ** -126 * (1 - 2 ** -23),\n      // Smallest positive normal number\n      2 ** -126,\n      // Largest normal number\n      2 ** 127 * (2 - 2 ** -23),\n      // Largest number less than one\n      1 - 2 ** -24,\n      // Smallest number larger than one\n      1 + 2 ** -23,\n    ])(\"accepts %s\", (value) => {\n      expect(expectNumber(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectNumber(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-numbers\", () => {\n    it.each([true, false, [], {}])(\"rejects %s\", (value) => {\n      expect(() => expectNumber(value)).toThrowError();\n    });\n  });\n\n  describe(\"rejects doubles\", () => {\n    it.each([2 ** 128, -(2 ** 128)])(\"rejects %s\", (value) => {\n      expect(() => expectFloat32(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectLong\", () => {\n  describe(\"accepts 64-bit integers\", () => {\n    it.each([\n      1,\n      Number.MAX_SAFE_INTEGER,\n      Number.MIN_SAFE_INTEGER,\n      2 ** 31 - 1,\n      -(2 ** 31),\n      2 ** 15 - 1,\n      -(2 ** 15),\n      127,\n      -128,\n    ])(\"accepts %s\", (value) => {\n      expect(expectLong(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectLong(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([1.1, \"1\", \"1.1\", NaN, true, [], {}])(\"rejects %s\", (value) => {\n      expect(() => expectLong(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectInt32\", () => {\n  describe(\"accepts 32-bit integers\", () => {\n    it.each([1, 2 ** 31 - 1, -(2 ** 31), 2 ** 15 - 1, -(2 ** 15), 127, -128])(\"accepts %s\", (value) => {\n      expect(expectInt32(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectInt32(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1\",\n      \"1.1\",\n      NaN,\n      true,\n      [],\n      {},\n      Number.MAX_SAFE_INTEGER,\n      Number.MIN_SAFE_INTEGER,\n      2 ** 31,\n      -(2 ** 31 + 1),\n    ])(\"rejects %s\", (value) => {\n      expect(() => expectInt32(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectShort\", () => {\n  describe(\"accepts 16-bit integers\", () => {\n    it.each([1, 2 ** 15 - 1, -(2 ** 15), 127, -128])(\"accepts %s\", (value) => {\n      expect(expectShort(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectShort(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1\",\n      \"1.1\",\n      NaN,\n      true,\n      [],\n      {},\n      2 ** 63 - 1,\n      -(2 ** 63 + 1),\n      2 ** 31 - 1,\n      -(2 ** 31 + 1),\n      2 ** 15,\n      -(2 ** 15 + 1),\n    ])(\"rejects %s\", (value) => {\n      expect(() => expectShort(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectByte\", () => {\n  describe(\"accepts 8-bit integers\", () => {\n    it.each([1, 127, -128])(\"accepts %s\", (value) => {\n      expect(expectByte(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectByte(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1\",\n      \"1.1\",\n      NaN,\n      true,\n      [],\n      {},\n      Number.MAX_SAFE_INTEGER,\n      Number.MIN_SAFE_INTEGER,\n      2 ** 31 - 1,\n      -(2 ** 31 + 1),\n      2 ** 15 - 1,\n      -(2 ** 15 + 1),\n      128,\n      -129,\n    ])(\"rejects %s\", (value) => {\n      expect(() => expectByte(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectNonNull\", () => {\n  it.each([1, 1.1, \"1\", NaN, true, [], [\"a\", 123], { a: 123 }, [{ a: 123 }], \"{ a : 123 }\", '{\"a\":123}'])(\n    \"accepts %s\",\n    (value) => {\n      expect(expectNonNull(value)).toEqual(value);\n    }\n  );\n\n  it.each([null, undefined])(\"rejects %s\", (value) => {\n    expect(() => expectNonNull(value)).toThrowError();\n  });\n});\n\ndescribe(\"expectObject\", () => {\n  it(\"accepts objects\", () => {\n    expect(expectObject({ a: 123 })).toEqual({ a: 123 });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectObject(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-objects\", () => {\n    it.each([1, 1.1, \"1\", NaN, true, [], [\"a\", 123], [{ a: 123 }], \"{ a : 123 }\", '{\"a\":123}'])(\n      \"rejects %s\",\n      (value) => {\n        expect(() => expectObject(value)).toThrowError();\n      }\n    );\n  });\n});\n\ndescribe(\"expectString\", () => {\n  it(\"accepts strings\", () => {\n    expect(expectString(\"foo\")).toEqual(\"foo\");\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectString(value)).toEqual(undefined);\n  });\n\n  describe(\"reluctantly\", () => {\n    let consoleMock: any;\n    beforeEach(() => {\n      consoleMock = vi.spyOn(logger, \"warn\");\n    });\n\n    afterEach(() => {\n      consoleMock.mockRestore();\n    });\n\n    it.each([1, NaN, Infinity, -Infinity, true, false])(\"accepts numbers or booleans: %s\", (value) => {\n      expect(expectString(value)).toEqual(String(value));\n      expect(logger.warn).toHaveBeenCalled();\n    });\n  });\n\n  describe(\"rejects non-strings\", () => {\n    it.each([[], {}])(\"rejects %s\", (value) => {\n      expect(() => expectString(value)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"expectUnion\", () => {\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(expectUnion(value)).toEqual(undefined);\n  });\n  describe(\"rejects non-objects\", () => {\n    it.each([1, NaN, Infinity, -Infinity, true, false, [], \"abc\"])(\"%s\", (value) => {\n      expect(() => expectUnion(value)).toThrowError();\n    });\n  });\n  describe(\"rejects malformed unions\", () => {\n    it.each([{}, { a: null }, { a: undefined }, { a: 1, b: 2 }])(\"%s\", (value) => {\n      expect(() => expectUnion(value)).toThrowError();\n    });\n  });\n  describe(\"accepts unions\", () => {\n    it.each([{ a: 1 }, { a: 1, b: null }])(\"%s\", (value) => {\n      expect(expectUnion(value)).toEqual(value);\n    });\n  });\n});\n\ndescribe(\"strictParseDouble\", () => {\n  it(\"accepts non-numeric floats as strings\", () => {\n    expect(strictParseDouble(\"Infinity\")).toEqual(Infinity);\n    expect(strictParseDouble(\"-Infinity\")).toEqual(-Infinity);\n    expect(strictParseDouble(\"NaN\")).toEqual(NaN);\n  });\n\n  describe(\"rejects implicit NaN\", () => {\n    it.each([\n      \"foo\",\n      \"123ABC\",\n      \"ABC123\",\n      \"12AB3C\",\n      \"1.A\",\n      \"1.1A\",\n      \"1.1A1\",\n      \"0xFF\",\n      \"0XFF\",\n      \"0b1111\",\n      \"0B1111\",\n      \"0777\",\n      \"0o777\",\n      \"0O777\",\n      \"1n\",\n      \"1N\",\n      \"1_000\",\n      \"e\",\n      \"e1\",\n      \".1\",\n    ])(\"rejects %s\", (value) => {\n      expect(() => strictParseDouble(value)).toThrowError();\n    });\n  });\n\n  it(\"accepts numeric strings\", () => {\n    expect(strictParseDouble(\"1\")).toEqual(1);\n    expect(strictParseDouble(\"-1\")).toEqual(-1);\n    expect(strictParseDouble(\"1.1\")).toEqual(1.1);\n    expect(strictParseDouble(\"1e1\")).toEqual(10);\n    expect(strictParseDouble(\"-1e1\")).toEqual(-10);\n    expect(strictParseDouble(\"1e+1\")).toEqual(10);\n    expect(strictParseDouble(\"1e-1\")).toEqual(0.1);\n    expect(strictParseDouble(\"1E1\")).toEqual(10);\n    expect(strictParseDouble(\"1E+1\")).toEqual(10);\n    expect(strictParseDouble(\"1E-1\")).toEqual(0.1);\n  });\n\n  describe(\"accepts numbers\", () => {\n    it.each([1, 1.1, Infinity, -Infinity, NaN])(\"accepts %s\", (value) => {\n      expect(strictParseDouble(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(strictParseDouble(value as any)).toEqual(undefined);\n  });\n});\n\ndescribe(\"strictParseFloat32\", () => {\n  it(\"accepts non-numeric floats as strings\", () => {\n    expect(strictParseFloat32(\"Infinity\")).toEqual(Infinity);\n    expect(strictParseFloat32(\"-Infinity\")).toEqual(-Infinity);\n    expect(strictParseFloat32(\"NaN\")).toEqual(NaN);\n  });\n\n  describe(\"rejects implicit NaN\", () => {\n    it.each([\n      \"foo\",\n      \"123ABC\",\n      \"ABC123\",\n      \"12AB3C\",\n      \"1.A\",\n      \"1.1A\",\n      \"1.1A1\",\n      \"0xFF\",\n      \"0XFF\",\n      \"0b1111\",\n      \"0B1111\",\n      \"0777\",\n      \"0o777\",\n      \"0O777\",\n      \"1n\",\n      \"1N\",\n      \"1_000\",\n      \"e\",\n      \"e1\",\n      \".1\",\n    ])(\"rejects %s\", (value) => {\n      expect(() => strictParseFloat32(value)).toThrowError();\n    });\n  });\n\n  describe(\"rejects doubles\", () => {\n    it.each([2 ** 128, -(2 ** 128)])(\"rejects %s\", (value) => {\n      expect(() => strictParseFloat32(value)).toThrowError();\n    });\n  });\n\n  it(\"accepts numeric strings\", () => {\n    expect(strictParseFloat32(\"1\")).toEqual(1);\n    expect(strictParseFloat32(\"-1\")).toEqual(-1);\n    expect(strictParseFloat32(\"1.1\")).toEqual(1.1);\n    expect(strictParseFloat32(\"1e1\")).toEqual(10);\n    expect(strictParseFloat32(\"-1e1\")).toEqual(-10);\n    expect(strictParseFloat32(\"1e+1\")).toEqual(10);\n    expect(strictParseFloat32(\"1e-1\")).toEqual(0.1);\n    expect(strictParseFloat32(\"1E1\")).toEqual(10);\n    expect(strictParseFloat32(\"1E+1\")).toEqual(10);\n    expect(strictParseFloat32(\"1E-1\")).toEqual(0.1);\n  });\n\n  describe(\"accepts numbers\", () => {\n    it.each([1, 1.1, Infinity, -Infinity, NaN])(\"accepts %s\", (value) => {\n      expect(strictParseFloat32(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value) => {\n    expect(strictParseFloat32(value as any)).toEqual(undefined);\n  });\n});\n\ndescribe(\"limitedParseDouble\", () => {\n  it(\"accepts non-numeric floats as strings\", () => {\n    expect(limitedParseDouble(\"Infinity\")).toEqual(Infinity);\n    expect(limitedParseDouble(\"-Infinity\")).toEqual(-Infinity);\n    expect(limitedParseDouble(\"NaN\")).toEqual(NaN);\n  });\n\n  it(\"rejects implicit NaN\", () => {\n    expect(() => limitedParseDouble(\"foo\")).toThrowError();\n  });\n\n  describe(\"rejects numeric strings\", () => {\n    it.each([\"1\", \"1.1\"])(\"rejects %s\", (value) => {\n      expect(() => limitedParseDouble(value)).toThrowError();\n    });\n  });\n\n  describe(\"accepts numbers\", () => {\n    it.each([\n      1,\n      1.1,\n      Infinity,\n      -Infinity,\n      NaN,\n      // Smallest positive subnormal number\n      2 ** -1074,\n      // Largest subnormal number\n      2 ** -1022 * (1 - 2 ** -52),\n      // Smallest positive normal number\n      2 ** -1022,\n      // Largest number\n      2 ** 1023 * (1 + (1 - 2 ** -52)),\n      // Largest number less than one\n      1 - 2 ** -53,\n      // Smallest number larger than one\n      1 + 2 ** -52,\n    ])(\"accepts %s\", (value) => {\n      expect(limitedParseDouble(value)).toEqual(value);\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value: any) => {\n    expect(limitedParseDouble(value)).toEqual(undefined);\n  });\n});\n\ndescribe(\"limitedParseFloat32\", () => {\n  it(\"accepts non-numeric floats as strings\", () => {\n    expect(limitedParseFloat32(\"Infinity\")).toEqual(Infinity);\n    expect(limitedParseFloat32(\"-Infinity\")).toEqual(-Infinity);\n    expect(limitedParseFloat32(\"NaN\")).toEqual(NaN);\n  });\n\n  it(\"rejects implicit NaN\", () => {\n    expect(() => limitedParseFloat32(\"foo\")).toThrowError();\n  });\n\n  describe(\"rejects numeric strings\", () => {\n    it.each([\"1\", \"1.1\"])(\"rejects %s\", (value) => {\n      expect(() => limitedParseFloat32(value)).toThrowError();\n    });\n  });\n\n  describe(\"accepts numbers\", () => {\n    it.each([\n      1,\n      1.1,\n      Infinity,\n      -Infinity,\n      NaN,\n      // Smallest positive subnormal number\n      2 ** -149,\n      // Largest subnormal number\n      2 ** -126 * (1 - 2 ** -23),\n      // Smallest positive normal number\n      2 ** -126,\n      // Largest normal number\n      2 ** 127 * (2 - 2 ** -23),\n      // Largest number less than one\n      1 - 2 ** -24,\n      // Smallest number larger than one\n      1 + 2 ** -23,\n    ])(\"accepts %s\", (value) => {\n      expect(limitedParseFloat32(value)).toEqual(value);\n    });\n  });\n\n  describe(\"rejects doubles\", () => {\n    it.each([2 ** 128, -(2 ** 128)])(\"rejects %s\", (value) => {\n      expect(() => limitedParseFloat32(value)).toThrowError();\n    });\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value: any) => {\n    expect(limitedParseFloat32(value)).toEqual(undefined);\n  });\n});\n\ndescribe(\"strictParseLong\", () => {\n  describe(\"accepts integers\", () => {\n    describe(\"accepts 64-bit integers\", () => {\n      it.each([1, 2 ** 63 - 1, -(2 ** 63), 2 ** 31 - 1, -(2 ** 31), 2 ** 15 - 1, -(2 ** 15), 127, -128])(\n        \"accepts %s\",\n        (value) => {\n          expect(strictParseLong(value)).toEqual(value);\n        }\n      );\n    });\n    expect(strictParseLong(\"1\")).toEqual(1);\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value: any) => {\n    expect(strictParseLong(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1.1\",\n      \"NaN\",\n      \"Infinity\",\n      \"-Infinity\",\n      NaN,\n      Infinity,\n      -Infinity,\n      true,\n      false,\n      [],\n      {},\n      \"foo\",\n      \"123ABC\",\n      \"ABC123\",\n      \"12AB3C\",\n    ])(\"rejects %s\", (value) => {\n      expect(() => strictParseLong(value as any)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"strictParseInt32\", () => {\n  describe(\"accepts integers\", () => {\n    describe(\"accepts 32-bit integers\", () => {\n      it.each([1, 2 ** 31 - 1, -(2 ** 31), 2 ** 15 - 1, -(2 ** 15), 127, -128])(\"accepts %s\", (value) => {\n        expect(strictParseInt32(value)).toEqual(value);\n      });\n    });\n    expect(strictParseInt32(\"1\")).toEqual(1);\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value: any) => {\n    expect(strictParseInt32(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1.1\",\n      \"NaN\",\n      \"Infinity\",\n      \"-Infinity\",\n      NaN,\n      Infinity,\n      -Infinity,\n      true,\n      false,\n      [],\n      {},\n      2 ** 63 - 1,\n      -(2 ** 63 + 1),\n      2 ** 31,\n      -(2 ** 31 + 1),\n      \"foo\",\n      \"123ABC\",\n      \"ABC123\",\n      \"12AB3C\",\n    ])(\"rejects %s\", (value) => {\n      expect(() => strictParseInt32(value as any)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"strictParseShort\", () => {\n  describe(\"accepts integers\", () => {\n    describe(\"accepts 16-bit integers\", () => {\n      it.each([1, 2 ** 15 - 1, -(2 ** 15), 127, -128])(\"accepts %s\", (value) => {\n        expect(strictParseShort(value)).toEqual(value);\n      });\n    });\n    expect(strictParseShort(\"1\")).toEqual(1);\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value: any) => {\n    expect(strictParseShort(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1.1\",\n      \"NaN\",\n      \"Infinity\",\n      \"-Infinity\",\n      NaN,\n      Infinity,\n      -Infinity,\n      true,\n      false,\n      [],\n      {},\n      2 ** 63 - 1,\n      -(2 ** 63 + 1),\n      2 ** 31 - 1,\n      -(2 ** 31 + 1),\n      2 ** 15,\n      -(2 ** 15 + 1),\n      \"foo\",\n      \"123ABC\",\n      \"ABC123\",\n      \"12AB3C\",\n    ])(\"rejects %s\", (value) => {\n      expect(() => strictParseShort(value as any)).toThrowError();\n    });\n  });\n});\n\ndescribe(\"strictParseByte\", () => {\n  describe(\"accepts integers\", () => {\n    describe(\"accepts 8-bit integers\", () => {\n      it.each([1, 127, -128])(\"accepts %s\", (value) => {\n        expect(strictParseByte(value)).toEqual(value);\n      });\n    });\n    expect(strictParseByte(\"1\")).toEqual(1);\n  });\n\n  it.each([null, undefined])(\"accepts %s\", (value: any) => {\n    expect(strictParseByte(value)).toEqual(undefined);\n  });\n\n  describe(\"rejects non-integers\", () => {\n    it.each([\n      1.1,\n      \"1.1\",\n      \"NaN\",\n      \"Infinity\",\n      \"-Infinity\",\n      NaN,\n      Infinity,\n      -Infinity,\n      true,\n      false,\n      [],\n      {},\n      2 ** 63 - 1,\n      -(2 ** 63 + 1),\n      2 ** 31 - 1,\n      -(2 ** 31 + 1),\n      2 ** 15,\n      -(2 ** 15 + 1),\n      128,\n      -129,\n      \"foo\",\n      \"123ABC\",\n      \"ABC123\",\n      \"12AB3C\",\n    ])(\"rejects %s\", (value) => {\n      expect(() => strictParseByte(value as any)).toThrowError();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/parse-utils.ts",
    "content": "/**\n * Give an input string, strictly parses a boolean value.\n *\n * @internal\n * @param value - The boolean string to parse.\n * @returns true for \"true\", false for \"false\", otherwise an error is thrown.\n */\nexport const parseBoolean = (value: string): boolean => {\n  switch (value) {\n    case \"true\":\n      return true;\n    case \"false\":\n      return false;\n    default:\n      throw new Error(`Unable to parse boolean value \"${value}\"`);\n  }\n};\n\n/**\n * Asserts a value is a boolean and returns it.\n * Casts strings and numbers with a warning if there is evidence that they were\n * intended to be booleans.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be a boolean.\n * @returns The value if it's a boolean, undefined if it's null/undefined,\n */\nexport const expectBoolean = (value: any): boolean | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value === \"number\") {\n    if (value === 0 || value === 1) {\n      logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));\n    }\n    if (value === 0) {\n      return false;\n    }\n    if (value === 1) {\n      return true;\n    }\n  }\n  if (typeof value === \"string\") {\n    const lower = value.toLowerCase();\n    if (lower === \"false\" || lower === \"true\") {\n      logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));\n    }\n    if (lower === \"false\") {\n      return false;\n    }\n    if (lower === \"true\") {\n      return true;\n    }\n  }\n  if (typeof value === \"boolean\") {\n    return value;\n  }\n  throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);\n};\n\n/**\n * Asserts a value is a number and returns it.\n * Casts strings with a warning if the string is a parseable number.\n * This is to unblock slight API definition/implementation inconsistencies.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be a number.\n * @returns The value if it's a number, undefined if it's null/undefined,\n */\nexport const expectNumber = (value: any): number | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value === \"string\") {\n    const parsed = parseFloat(value);\n    if (!Number.isNaN(parsed)) {\n      if (String(parsed) !== String(value)) {\n        logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));\n      }\n      return parsed;\n    }\n  }\n  if (typeof value === \"number\") {\n    return value;\n  }\n  throw new TypeError(`Expected number, got ${typeof value}: ${value}`);\n};\n\nconst MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));\n\n/**\n * Asserts a value is a 32-bit float and returns it.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be a 32-bit float.\n * @returns The value if it's a float, undefined if it's null/undefined,\n */\nexport const expectFloat32 = (value: any): number | undefined => {\n  const expected = expectNumber(value);\n  if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {\n    // IEEE-754 is an imperfect representation for floats. Consider the simple\n    // value `0.1`. The representation in a 32-bit float would look like:\n    //\n    // 0 01111011 10011001100110011001101\n    // Actual value: 0.100000001490116119384765625\n    //\n    // Note the repeating pattern of `1001` in the fraction part. The 64-bit\n    // representation is similar:\n    //\n    // 0 01111111011 1001100110011001100110011001100110011001100110011010\n    // Actual value: 0.100000000000000005551115123126\n    //\n    // So even for what we consider simple numbers, the representation differs\n    // between the two formats. And it's non-obvious how one might look at the\n    // 64-bit value (which is how JS represents numbers) and determine if it\n    // can be represented reasonably in the 32-bit form. Primarily because you\n    // can't know whether the intent was to represent `0.1` or the actual\n    // value in memory. But even if you have both the decimal value and the\n    // double value, that still doesn't communicate the intended precision.\n    //\n    // So rather than attempting to divine the intent of the caller, we instead\n    // do some simple bounds checking to make sure the value is passingly\n    // representable in a 32-bit float. It's not perfect, but it's good enough.\n    // Perfect, even if possible to achieve, would likely be too costly to\n    // be worth it.\n    //\n    // The maximum value of a 32-bit float. Since the 64-bit representation\n    // could be more or less, we just round it up to the nearest whole number.\n    // This further reduces our ability to be certain of the value, but it's\n    // an acceptable tradeoff.\n    //\n    // Compare against the absolute value to simplify things.\n    if (Math.abs(expected) > MAX_FLOAT) {\n      throw new TypeError(`Expected 32-bit float, got ${value}`);\n    }\n  }\n  return expected;\n};\n\n/**\n * Asserts a value is an integer and returns it.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be an integer.\n * @returns The value if it's an integer, undefined if it's null/undefined,\n */\nexport const expectLong = (value: any): number | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (Number.isInteger(value) && !Number.isNaN(value)) {\n    return value;\n  }\n  throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);\n};\n\n/**\n * @internal\n *\n * @deprecated Use expectLong\n */\nexport const expectInt = expectLong;\n\n/**\n * Asserts a value is a 32-bit integer and returns it.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be an integer.\n * @returns The value if it's an integer, undefined if it's null/undefined,\n */\nexport const expectInt32 = (value: any): number | undefined => expectSizedInt(value, 32);\n\n/**\n * Asserts a value is a 16-bit integer and returns it.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be an integer.\n * @returns The value if it's an integer, undefined if it's null/undefined,\n */\nexport const expectShort = (value: any): number | undefined => expectSizedInt(value, 16);\n\n/**\n * Asserts a value is an 8-bit integer and returns it.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be an integer.\n * @returns The value if it's an integer, undefined if it's null/undefined,\n */\nexport const expectByte = (value: any): number | undefined => expectSizedInt(value, 8);\n\ntype IntSize = 32 | 16 | 8;\n\nconst expectSizedInt = (value: any, size: IntSize): number | undefined => {\n  const expected = expectLong(value);\n  if (expected !== undefined && castInt(expected, size) !== expected) {\n    throw new TypeError(`Expected ${size}-bit integer, got ${value}`);\n  }\n  return expected;\n};\n\nconst castInt = (value: number, size: IntSize) => {\n  switch (size) {\n    case 32:\n      return Int32Array.of(value)[0];\n    case 16:\n      return Int16Array.of(value)[0];\n    case 8:\n      return Int8Array.of(value)[0];\n  }\n};\n\n/**\n * Asserts a value is not null or undefined and returns it, or throws an error.\n *\n * @internal\n * @param value - A value that is expected to be defined\n * @param location - The location where we're expecting to find a defined object (optional)\n * @returns The value if it's not undefined, otherwise throws an error\n */\nexport const expectNonNull = <T>(value: T | null | undefined, location?: string): T => {\n  if (value === null || value === undefined) {\n    if (location) {\n      throw new TypeError(`Expected a non-null value for ${location}`);\n    }\n    throw new TypeError(\"Expected a non-null value\");\n  }\n  return value;\n};\n\n/**\n * Asserts a value is an JSON-like object and returns it. This is expected to be used\n * with values parsed from JSON (arrays, objects, numbers, strings, booleans).\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be an object\n * @returns The value if it's an object, undefined if it's null/undefined,\n */\nexport const expectObject = (value: any): Record<string, any> | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value === \"object\" && !Array.isArray(value)) {\n    return value;\n  }\n  const receivedType = Array.isArray(value) ? \"array\" : typeof value;\n  throw new TypeError(`Expected object, got ${receivedType}: ${value}`);\n};\n\n/**\n * Asserts a value is a string and returns it.\n * Numbers and boolean will be cast to strings with a warning.\n * otherwise an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be a string.\n * @returns The value if it's a string, undefined if it's null/undefined,\n */\nexport const expectString = (value: any): string | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  if (typeof value === \"string\") {\n    return value;\n  }\n  if ([\"boolean\", \"number\", \"bigint\"].includes(typeof value)) {\n    logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));\n    return String(value);\n  }\n  throw new TypeError(`Expected string, got ${typeof value}: ${value}`);\n};\n\n/**\n * Asserts a value is a JSON-like object with only one non-null/non-undefined key and\n * returns it.\n * non-undefined key.\n * an error is thrown.\n *\n * @internal\n * @param value - A value that is expected to be an object with exactly one non-null,\n * @returns the value if it's a union, undefined if it's null/undefined, otherwise\n */\nexport const expectUnion = (value: unknown): Record<string, any> | undefined => {\n  if (value === null || value === undefined) {\n    return undefined;\n  }\n  const asObject = expectObject(value)!;\n\n  const setKeys = [];\n  for (const k in asObject) {\n    if (asObject[k] != null) {\n      setKeys.push(k);\n    }\n  }\n\n  if (setKeys.length === 0) {\n    throw new TypeError(`Unions must have exactly one non-null member. None were found.`);\n  }\n\n  if (setKeys.length > 1) {\n    throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);\n  }\n\n  return asObject;\n};\n\n/**\n * Parses a value into a double. If the value is null or undefined, undefined\n * will be returned. If the value is a string, it will be parsed by the standard\n * parseFloat with one exception: NaN may only be explicitly set as the string\n * \"NaN\", any implicit Nan values will result in an error being thrown. If any\n * other type is provided, an exception will be thrown.\n *\n * @internal\n * @param value - A number or string representation of a double.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const strictParseDouble = (value: string | number): number | undefined => {\n  if (typeof value == \"string\") {\n    return expectNumber(parseNumber(value));\n  }\n  return expectNumber(value);\n};\n\n/**\n * @internal\n *\n * @deprecated Use strictParseDouble\n */\nexport const strictParseFloat = strictParseDouble;\n\n/**\n * Parses a value into a float. If the value is null or undefined, undefined\n * will be returned. If the value is a string, it will be parsed by the standard\n * parseFloat with one exception: NaN may only be explicitly set as the string\n * \"NaN\", any implicit Nan values will result in an error being thrown. If any\n * other type is provided, an exception will be thrown.\n *\n * @internal\n * @param value - A number or string representation of a float.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const strictParseFloat32 = (value: string | number): number | undefined => {\n  if (typeof value == \"string\") {\n    return expectFloat32(parseNumber(value));\n  }\n  return expectFloat32(value);\n};\n\n// This regex matches JSON-style numbers. In short:\n// * The integral may start with a negative sign, but not a positive one\n// * No leading 0 on the integral unless it's immediately followed by a '.'\n// * Exponent indicated by a case-insensitive 'E' optionally followed by a\n//   positive/negative sign and some number of digits.\n// It also matches both positive and negative infinity as well and explicit NaN.\nconst NUMBER_REGEX = /(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|(-?Infinity)|(NaN)/g;\n\nconst parseNumber = (value: string): number => {\n  const matches = value.match(NUMBER_REGEX);\n  if (matches === null || matches[0].length !== value.length) {\n    throw new TypeError(`Expected real number, got implicit NaN`);\n  }\n  return parseFloat(value);\n};\n\n/**\n * Asserts a value is a number and returns it. If the value is a string\n * representation of a non-numeric number type (NaN, Infinity, -Infinity),\n * the value will be parsed. Any other string value will result in an exception\n * being thrown. Null or undefined will be returned as undefined. Any other\n * type will result in an exception being thrown.\n *\n * @internal\n * @param value - A number or string representation of a non-numeric float.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const limitedParseDouble = (value: string | number): number | undefined => {\n  if (typeof value == \"string\") {\n    return parseFloatString(value);\n  }\n  return expectNumber(value);\n};\n\n/**\n * @internal\n *\n * @deprecated Use limitedParseDouble\n */\nexport const handleFloat = limitedParseDouble;\n\n/**\n * @internal\n *\n * @deprecated Use limitedParseDouble\n */\nexport const limitedParseFloat = limitedParseDouble;\n\n/**\n * Asserts a value is a 32-bit float and returns it. If the value is a string\n * representation of a non-numeric number type (NaN, Infinity, -Infinity),\n * the value will be parsed. Any other string value will result in an exception\n * being thrown. Null or undefined will be returned as undefined. Any other\n * type will result in an exception being thrown.\n *\n * @internal\n * @param value - A number or string representation of a non-numeric float.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const limitedParseFloat32 = (value: string | number): number | undefined => {\n  if (typeof value == \"string\") {\n    return parseFloatString(value);\n  }\n  return expectFloat32(value);\n};\n\nconst parseFloatString = (value: string): number => {\n  switch (value) {\n    case \"NaN\":\n      return NaN;\n    case \"Infinity\":\n      return Infinity;\n    case \"-Infinity\":\n      return -Infinity;\n    default:\n      throw new Error(`Unable to parse float value: ${value}`);\n  }\n};\n\n/**\n * Parses a value into an integer. If the value is null or undefined, undefined\n * will be returned. If the value is a string, it will be parsed by parseFloat\n * and the result will be asserted to be an integer. If the parsed value is not\n * an integer, or the raw value is any type other than a string or number, an\n * exception will be thrown.\n *\n * @internal\n * @param value - A number or string representation of an integer.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const strictParseLong = (value: string | number): number | undefined => {\n  if (typeof value === \"string\") {\n    // parseInt can't be used here, because it will silently discard any\n    // existing decimals. We want to instead throw an error if there are any.\n    return expectLong(parseNumber(value));\n  }\n  return expectLong(value);\n};\n\n/**\n * @internal\n *\n * @deprecated Use strictParseLong\n */\nexport const strictParseInt = strictParseLong;\n\n/**\n * Parses a value into a 32-bit integer. If the value is null or undefined, undefined\n * will be returned. If the value is a string, it will be parsed by parseFloat\n * and the result will be asserted to be an integer. If the parsed value is not\n * an integer, or the raw value is any type other than a string or number, an\n * exception will be thrown.\n *\n * @internal\n * @param value - A number or string representation of a 32-bit integer.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const strictParseInt32 = (value: string | number): number | undefined => {\n  if (typeof value === \"string\") {\n    // parseInt can't be used here, because it will silently discard any\n    // existing decimals. We want to instead throw an error if there are any.\n    return expectInt32(parseNumber(value));\n  }\n  return expectInt32(value);\n};\n\n/**\n * Parses a value into a 16-bit integer. If the value is null or undefined, undefined\n * will be returned. If the value is a string, it will be parsed by parseFloat\n * and the result will be asserted to be an integer. If the parsed value is not\n * an integer, or the raw value is any type other than a string or number, an\n * exception will be thrown.\n *\n * @internal\n * @param value - A number or string representation of a 16-bit integer.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const strictParseShort = (value: string | number): number | undefined => {\n  if (typeof value === \"string\") {\n    // parseInt can't be used here, because it will silently discard any\n    // existing decimals. We want to instead throw an error if there are any.\n    return expectShort(parseNumber(value));\n  }\n  return expectShort(value);\n};\n\n/**\n * Parses a value into an 8-bit integer. If the value is null or undefined, undefined\n * will be returned. If the value is a string, it will be parsed by parseFloat\n * and the result will be asserted to be an integer. If the parsed value is not\n * an integer, or the raw value is any type other than a string or number, an\n * exception will be thrown.\n *\n * @internal\n * @param value - A number or string representation of an 8-bit integer.\n * @returns The value as a number, or undefined if it's null/undefined.\n */\nexport const strictParseByte = (value: string | number): number | undefined => {\n  if (typeof value === \"string\") {\n    // parseInt can't be used here, because it will silently discard any\n    // existing decimals. We want to instead throw an error if there are any.\n    return expectByte(parseNumber(value));\n  }\n  return expectByte(value);\n};\n\n/**\n * @internal\n * @param message - error message.\n * @returns truncated stack trace omitting this function.\n */\nconst stackTraceWarning = (message: string): string => {\n  return String(new TypeError(message).stack || message)\n    .split(\"\\n\")\n    .slice(0, 5)\n    .filter((s) => !s.includes(\"stackTraceWarning\"))\n    .join(\"\\n\");\n};\n\n/**\n * @internal\n */\nexport const logger = {\n  warn: console.warn,\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/quote-header.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { quoteHeader } from \"./quote-header\";\n\ndescribe(quoteHeader.name, () => {\n  it(\"should not wrap header elements that don't include the delimiter or double quotes\", () => {\n    expect(quoteHeader(\"bc\")).toBe(\"bc\");\n  });\n\n  it(\"should wrap header elements that include the delimiter\", () => {\n    expect(quoteHeader(\"b,c\")).toBe('\"b,c\"');\n  });\n\n  it(\"should wrap header elements that include double quotes\", () => {\n    expect(quoteHeader(`\"bc\"`)).toBe('\"\\\\\"bc\\\\\"\"');\n  });\n\n  it(\"should wrap header elements that include the delimiter and double quotes\", () => {\n    expect(quoteHeader(`\"b,c\"`)).toBe('\"\\\\\"b,c\\\\\"\"');\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/quote-header.ts",
    "content": "/**\n * @public\n * @param part - header list element\n * @returns quoted string if part contains delimiter.\n */\nexport function quoteHeader(part: string) {\n  if (part.includes(\",\") || part.includes('\"')) {\n    part = `\"${part.replace(/\"/g, '\\\\\"')}\"`;\n  }\n  return part;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/schema-serde-lib/schema-date-utils.spec.ts",
    "content": "import { describe, expect, it } from \"vitest\";\n\nimport { _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime } from \"./schema-date-utils\";\n\nconst millisecond = 1;\nconst second = 1000 * millisecond;\nconst minute = 60 * second;\nconst hour = 60 * minute;\nconst day = 24 * hour;\nconst year = 365 * day;\n\ndescribe(\"_parseEpochTimestamp\", () => {\n  it(\"should parse numeric timestamps\", () => {\n    expect(_parseEpochTimestamp(1234567890)).toEqual(new Date(1234567890000));\n    expect(_parseEpochTimestamp(1234567890.123)).toEqual(new Date(1234567890123));\n    expect(_parseEpochTimestamp(1234567890.123456)).toEqual(new Date(1234567890123));\n  });\n\n  it(\"should parse string timestamps\", () => {\n    expect(_parseEpochTimestamp(\"1234567890\")).toEqual(new Date(1234567890000));\n    expect(_parseEpochTimestamp(\"1234567890.123\")).toEqual(new Date(1234567890123));\n    expect(_parseEpochTimestamp(\"1234567890.123456\")).toEqual(new Date(1234567890123));\n  });\n\n  it(\"should parse CBOR tag timestamps\", () => {\n    expect(_parseEpochTimestamp({ tag: 1, value: 1234567890 })).toEqual(new Date(1234567890000));\n    expect(_parseEpochTimestamp({ tag: 1, value: 1234567890.123 })).toEqual(new Date(1234567890123));\n    expect(_parseEpochTimestamp({ tag: 1, value: 1234567890.123456 })).toEqual(new Date(1234567890123));\n  });\n\n  it(\"should return undefined for null/undefined\", () => {\n    expect(_parseEpochTimestamp(null)).toBeUndefined();\n    expect(_parseEpochTimestamp(undefined)).toBeUndefined();\n  });\n\n  it(\"should throw for invalid numbers\", () => {\n    expect(() => _parseEpochTimestamp(\"abc\")).toThrow();\n    expect(() => _parseEpochTimestamp(Infinity)).toThrow();\n    expect(() => _parseEpochTimestamp(NaN)).toThrow();\n  });\n});\n\ndescribe(\"_parseRfc3339DateTimeWithOffset\", () => {\n  it(\"should parse UTC timestamps\", () => {\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T00:00:00Z\")).toEqual(new Date(3407616000_000));\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T12:12:12.01Z\")).toEqual(\n      new Date(3407616000_000 + 12 * hour + 12 * minute + 12 * second + 10 * millisecond)\n    );\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T23:59:59.999Z\")).toEqual(\n      new Date(3407616000_000 + 23 * hour + 59 * minute + 59 * second + 999 * millisecond)\n    );\n  });\n\n  it(\"should parse timestamps with positive offset\", () => {\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T00:00:00-04:30\")).toEqual(new Date(3407616000_000 + 4.5 * hour));\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T12:12:12.01-04:30\")).toEqual(\n      new Date(3407616000_000 + 12 * hour + 12 * minute + 12 * second + 10 * millisecond + 4.5 * hour)\n    );\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T23:59:59.999-04:30\")).toEqual(\n      new Date(3407616000_000 + 23 * hour + 59 * minute + 59 * second + 999 * millisecond + 4.5 * hour)\n    );\n  });\n\n  it(\"should parse timestamps with negative offset\", () => {\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T00:00:00+05:00\")).toEqual(new Date(3407616000_000 - 5 * hour));\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T12:12:12.01+05:00\")).toEqual(\n      new Date(3407616000_000 + 12 * hour + 12 * minute + 12 * second + 10 * millisecond - 5 * hour)\n    );\n    expect(_parseRfc3339DateTimeWithOffset(\"2077-12-25T23:59:59.999+05:00\")).toEqual(\n      new Date(3407616000_000 + 23 * hour + 59 * minute + 59 * second + 999 * millisecond - 5 * hour)\n    );\n  });\n\n  it(\"should parse timestamps with fractional seconds\", () => {\n    expect(_parseRfc3339DateTimeWithOffset(\"2023-12-25T12:00:00.123Z\")).toEqual(new Date(\"2023-12-25T12:00:00.123Z\"));\n  });\n\n  it(\"should return undefined for null/undefined\", () => {\n    expect(_parseRfc3339DateTimeWithOffset(null)).toBeUndefined();\n    expect(_parseRfc3339DateTimeWithOffset(undefined)).toBeUndefined();\n  });\n\n  it(\"should throw for invalid formats\", () => {\n    expect(() => _parseRfc3339DateTimeWithOffset(\"2023-12-25\")).toThrow();\n    expect(() => _parseRfc3339DateTimeWithOffset(123)).toThrow();\n  });\n});\n\ndescribe(\"_parseRfc7231DateTime\", () => {\n  it(\"should parse RFC7231 timestamps\", () => {\n    expect(_parseRfc7231DateTime(\"Mon, 31 Dec 2077 23:59:30 GMT\")).toEqual(new Date(3408220800000 - 30 * second));\n  });\n\n  it(\"should parse timestamps with fractional seconds\", () => {\n    expect(_parseRfc7231DateTime(\"Mon, 31 Dec 2077 23:59:30.123 GMT\")).toEqual(\n      new Date(3408220800000 - 29 * second - 877 * millisecond)\n    );\n  });\n\n  it(\"should parse RFC850 timestamps\", () => {\n    expect(_parseRfc7231DateTime(\"Monday, 31-Dec-77 23:59:30 GMT\")).toEqual(\n      new Date(3408220800000 - 100 * year - 25 * day - 30 * second)\n    );\n  });\n\n  it(\"should parse asctime timestamps\", () => {\n    expect(_parseRfc7231DateTime(\"Mon Dec 31 23:59:30 2077\")).toEqual(new Date(3408220800000 - 30 * second));\n  });\n\n  it(\"should return undefined for null/undefined\", () => {\n    expect(_parseRfc7231DateTime(null)).toBeUndefined();\n    expect(_parseRfc7231DateTime(undefined)).toBeUndefined();\n  });\n\n  it(\"should throw for invalid formats\", () => {\n    expect(() => _parseRfc7231DateTime(\"2077-12-25T08:49:37Z\")).toThrow();\n    expect(() => _parseRfc7231DateTime(123)).toThrow();\n    expect(() => _parseRfc7231DateTime(\"Invalid, 25 Dec 2077 08:49:37 GMT\")).toThrow();\n  });\n});\n\n// some invalid values are not validated client side\n// because of excessive code requirements.\nconst invalidRfc3339DateTimes = [\n  \"85-04-12T23:20:50.52Z\", // Year must be 4 digits\n  \"985-04-12T23:20:50.52Z\", // Year must be 4 digits\n  \"1985-13-12T23:20:50.52Z\", // Month cannot be greater than 12\n  \"1985-00-12T23:20:50.52Z\", // Month cannot be 0\n  \"1985-4-12T23:20:50.52Z\", // Month must be 2 digits with leading zero\n  \"1985-04-32T23:20:50.52Z\", // Day cannot be greater than 31\n  \"1985-04-00T23:20:50.52Z\", // Day cannot be 0\n  \"1985-04-05T24:20:50.52Z\", // Hours cannot be greater than 23\n  \"1985-04-05T23:61:50.52Z\", // Minutes cannot be greater than 59\n  \"1985-04-05T23:20:61.52Z\", // Seconds cannot be greater than 59 (except leap second)\n  // \"1985-04-31T23:20:50.52Z\", // April only has 30 days\n  // \"2005-02-29T15:59:59Z\", // 2005 was not a leap year, so February only had 28 days\n  \"1996-12-19T16:39:57\", // Missing timezone offset\n  \"Mon, 31 Dec 1990 15:59:60 GMT\", // RFC 7231 format, not RFC 3339\n  \"Monday, 31-Dec-90 15:59:60 GMT\", // RFC 7231 format, not RFC 3339\n  \"Mon Dec 31 15:59:60 1990\", // RFC 7231 format, not RFC 3339\n  \"1985-04-12T23:20:50.52Z1985-04-12T23:20:50.52Z\", // Contains multiple timestamps\n  \"1985-04-12T23:20:50.52ZA\", // Contains invalid characters after timezone\n  \"A1985-04-12T23:20:50.52Z\", // Contains invalid characters before timestamp\n];\n\ndescribe(\"parseRfc3339DateTime\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(_parseRfc3339DateTimeWithOffset(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    it(\"with fractional seconds\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"1985-04-12T23:20:50.52Z\")).toEqual(\n        new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 520))\n      );\n    });\n    it(\"without fractional seconds\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"1985-04-12T23:20:50Z\")).toEqual(\n        new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 0))\n      );\n    });\n    it(\"with leap seconds\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"1990-12-31T15:59:60Z\")).toEqual(\n        new Date(Date.UTC(1990, 11, 31, 15, 59, 60, 0))\n      );\n    });\n    it(\"with leap days\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"2004-02-29T15:59:59Z\")).toEqual(\n        new Date(Date.UTC(2004, 1, 29, 15, 59, 59, 0))\n      );\n    });\n    it(\"with leading zeroes\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"0004-02-09T05:09:09.09Z\")).toEqual(new Date(-62037600650910));\n      expect(_parseRfc3339DateTimeWithOffset(\"0004-02-09T00:00:00.00Z\")).toEqual(new Date(-62037619200000));\n    });\n  });\n\n  it.each(invalidRfc3339DateTimes)(\"rejects %s\", (value) => {\n    expect(() => _parseRfc3339DateTimeWithOffset(value)).toThrowError();\n  });\n});\n\ndescribe(\"parseRfc3339DateTimeWithOffset\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(_parseRfc3339DateTimeWithOffset(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    it(\"with fractional seconds\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"1985-04-12T23:20:50.52Z\")).toEqual(\n        new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 520))\n      );\n    });\n    it(\"without fractional seconds\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"1985-04-12T23:20:50Z\")).toEqual(\n        new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 0))\n      );\n    });\n    it(\"with leap seconds\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"1990-12-31T15:59:60Z\")).toEqual(\n        new Date(Date.UTC(1990, 11, 31, 15, 59, 60, 0))\n      );\n    });\n    it(\"with leap days\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"2004-02-29T15:59:59Z\")).toEqual(\n        new Date(Date.UTC(2004, 1, 29, 15, 59, 59, 0))\n      );\n    });\n    it(\"with leading zeroes\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"0104-02-09T05:09:09.09Z\")).toEqual(\n        new Date(Date.UTC(104, 1, 9, 5, 9, 9, 90))\n      );\n      expect(_parseRfc3339DateTimeWithOffset(\"0104-02-09T00:00:00.00Z\")).toEqual(\n        new Date(Date.UTC(104, 1, 9, 0, 0, 0, 0))\n      );\n    });\n    it(\"with negative offset\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"2019-12-16T22:48:18-01:02\")).toEqual(\n        new Date(Date.UTC(2019, 11, 16, 23, 50, 18, 0))\n      );\n    });\n    it(\"with positive offset\", () => {\n      expect(_parseRfc3339DateTimeWithOffset(\"2019-12-16T22:48:18+02:04\")).toEqual(\n        new Date(Date.UTC(2019, 11, 16, 20, 44, 18, 0))\n      );\n    });\n  });\n\n  it.each(invalidRfc3339DateTimes)(\"rejects %s\", (value) => {\n    expect(() => _parseRfc3339DateTimeWithOffset(value)).toThrowError();\n  });\n});\n\ndescribe(\"_parseRfc7231DateTime\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(_parseRfc7231DateTime(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    describe(\"with fractional seconds\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 08:49:37.52 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 08:49:37.52 GMT\"],\n        [\"asctime\", \"Sun Nov  6 08:49:37.52 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 520)));\n      });\n    });\n    describe(\"with fractional seconds - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 8:49:37.52 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 8:49:37.52 GMT\"],\n        [\"asctime\", \"Sun Nov  6 8:49:37.52 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 520)));\n      });\n    });\n    describe(\"without fractional seconds\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 08:49:37 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 08:49:37 GMT\"],\n        [\"asctime\", \"Sun Nov  6 08:49:37 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 0)));\n      });\n    });\n    describe(\"without fractional seconds - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 1994 8:49:37 GMT\"],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 8:49:37 GMT\"],\n        [\"asctime\", \"Sun Nov  6 8:49:37 1994\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1994, 10, 6, 8, 49, 37, 0)));\n      });\n    });\n    describe(\"with leap seconds\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Mon, 31 Dec 1990 15:59:60 GMT\"],\n        [\"rfc-850\", \"Monday, 31-Dec-90 15:59:60 GMT\"],\n        [\"asctime\", \"Mon Dec 31 15:59:60 1990\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1990, 11, 31, 15, 59, 60, 0)));\n      });\n    });\n    describe(\"with leap seconds - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Mon, 31 Dec 1990 8:59:60 GMT\"],\n        [\"rfc-850\", \"Monday, 31-Dec-90 8:59:60 GMT\"],\n        [\"asctime\", \"Mon Dec 31 8:59:60 1990\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(1990, 11, 31, 8, 59, 60, 0)));\n      });\n    });\n    describe(\"with leap days\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 29 Feb 2004 15:59:59 GMT\"],\n        [\"asctime\", \"Sun Feb 29 15:59:59 2004\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(2004, 1, 29, 15, 59, 59, 0)));\n      });\n    });\n    describe(\"with leap days - single digit hour\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 29 Feb 2004 8:59:59 GMT\"],\n        [\"asctime\", \"Sun Feb 29 8:59:59 2004\"],\n      ])(\"in format %s\", (_, value) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(2004, 1, 29, 8, 59, 59, 0)));\n      });\n    });\n    describe(\"with leading zeroes\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 0104 08:09:07.02 GMT\", 104],\n        [\"rfc-850\", \"Sunday, 06-Nov-04 08:09:07.02 GMT\", 1904],\n        [\"asctime\", \"Sun Nov  6 08:09:07.02 0104\", 104],\n      ])(\"in format %s\", (_, value, year) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(year, 10, 6, 8, 9, 7, 20)));\n      });\n    });\n    describe(\"with all-zero components\", () => {\n      it.each([\n        [\"imf-fixdate\", \"Sun, 06 Nov 0104 00:00:00.00 GMT\", 104],\n        [\"rfc-850\", \"Sunday, 06-Nov-94 00:00:00.00 GMT\", 1994],\n        [\"asctime\", \"Sun Nov  6 00:00:00.00 0104\", 104],\n      ])(\"in format %s\", (_, value, year) => {\n        expect(_parseRfc7231DateTime(value)).toEqual(new Date(Date.UTC(year, 10, 6, 0, 0, 0, 0)));\n      });\n    });\n  });\n\n  // note: some edge cases are not handled because the amount of code needed to enforce\n  // them client-side is excessive. We trust our services' response values.\n  it.each([\n    \"1985-04-12T23:20:50.52Z\", // RFC 3339 format, not RFC 7231\n    \"1985-04-12T23:20:50Z\", // RFC 3339 format, not RFC 7231\n\n    \"Sun, 06 Nov 0004 08:09:07.02 GMTSun, 06 Nov 0004 08:09:07.02 GMT\", // Contains multiple timestamps\n    \"Sun, 06 Nov 0004 08:09:07.02 GMTA\", // Contains invalid characters after GMT\n    \"ASun, 06 Nov 0004 08:09:07.02 GMT\", // Contains invalid characters before timestamp\n    \"Sun, 06 Nov 94 08:49:37 GMT\", // Year must be 4 digits\n    \"Sun, 06 Dov 1994 08:49:37 GMT\", // Invalid month name\n    \"Mun, 06 Nov 1994 08:49:37 GMT\", // Invalid day name\n    // \"Sunday, 06 Nov 1994 08:49:37 GMT\", // Wrong format - uses full day name in IMF-fixdate format\n    \"Sun, 06 November 1994 08:49:37 GMT\", // Wrong format - uses full month name\n    \"Sun, 06 Nov 1994 24:49:37 GMT\", // Hours cannot be 24\n    \"Sun, 06 Nov 1994 08:69:37 GMT\", // Minutes cannot be > 59\n    \"Sun, 06 Nov 1994 08:49:67 GMT\", // Seconds cannot be > 60 (60 only allowed for leap second)\n    \"Sun, 06-11-1994 08:49:37 GMT\", // Wrong date format - uses dashes instead of spaces\n    \"Sun, 06 11 1994 08:49:37 GMT\", // Wrong format - uses numeric month instead of abbreviated name\n    // \"Sun, 31 Nov 1994 08:49:37 GMT\", // Invalid date - November has 30 days\n    // \"Sun, 29 Feb 2005 15:59:59 GMT\", // Invalid date - 2005 was not a leap year\n\n    \"Sunday, 06-Nov-04 08:09:07.02 GMTSunday, 06-Nov-04 08:09:07.02 GMT\", // Contains multiple timestamps\n    \"ASunday, 06-Nov-04 08:09:07.02 GMT\", // Contains invalid characters before timestamp\n    \"Sunday, 06-Nov-04 08:09:07.02 GMTA\", // Contains invalid characters after GMT\n    \"Sunday, 06-Nov-1994 08:49:37 GMT\", // Wrong format - uses 4 digit year in RFC 850 format\n    \"Sunday, 06-Dov-94 08:49:37 GMT\", // Invalid month name\n    \"Sundae, 06-Nov-94 08:49:37 GMT\", // Invalid day name\n    // \"Sun, 06-Nov-94 08:49:37 GMT\", // Wrong format - uses abbreviated day name in RFC 850 format\n    \"Sunday, 06-November-94 08:49:37 GMT\", // Wrong format - uses full month name\n    \"Sunday, 06-Nov-94 24:49:37 GMT\", // Hours cannot be 24\n    \"Sunday, 06-Nov-94 08:69:37 GMT\", // Minutes cannot be > 59\n    \"Sunday, 06-Nov-94 08:49:67 GMT\", // Seconds cannot be > 60 (60 only allowed for leap second)\n    \"Sunday, 06 11 94 08:49:37 GMT\", // Wrong format - uses spaces instead of dashes\n    \"Sunday, 06-11-1994 08:49:37 GMT\", // Wrong format - uses numeric month and 4 digit year\n    // \"Sunday, 31-Nov-94 08:49:37 GMT\", // Invalid date - November has 30 days\n    // \"Sunday, 29-Feb-05 15:59:59 GMT\", // Invalid date - 2005 was not a leap year\n\n    \"Sun Nov  6 08:09:07.02 0004Sun Nov  6 08:09:07.02 0004\", // Contains multiple timestamps\n    \"ASun Nov  6 08:09:07.02 0004\", // Contains invalid characters before timestamp\n    \"Sun Nov  6 08:09:07.02 0004A\", // Contains invalid characters after timestamp\n    \"Sun Nov  6 08:49:37 94\", // Year must be 4 digits in asctime format\n    \"Sun Dov  6 08:49:37 1994\", // Invalid month name\n    \"Mun Nov  6 08:49:37 1994\", // Invalid day name\n    // \"Sunday Nov  6 08:49:37 1994\", // Wrong format - uses full day name\n    \"Sun November  6 08:49:37 1994\", // Wrong format - uses full month name\n    \"Sun Nov  6 24:49:37 1994\", // Hours cannot be 24\n    \"Sun Nov  6 08:69:37 1994\", // Minutes cannot be > 59\n    \"Sun Nov  6 08:49:67 1994\", // Seconds cannot be > 60 (60 only allowed for leap second)\n    \"Sun 06-11 08:49:37 1994\", // Wrong format - uses dashes in date\n    \"Sun 06 11 08:49:37 1994\", // Wrong format - uses numeric month\n    \"Sun 11  6 08:49:37 1994\", // Wrong format - month and day in wrong order\n    // \"Sun Nov 31 08:49:37 1994\", // Invalid date - November has 30 days\n    // \"Sun Feb 29 15:59:59 2005\", // Invalid date - 2005 was not a leap year\n    \"Sun Nov 6 08:49:37 1994\", // Wrong format - missing space after single digit day\n  ])(\"rejects %s\", (value) => {\n    expect(() => _parseRfc7231DateTime(value)).toThrowError();\n  });\n});\n\ndescribe(\"_parseEpochTimestamp\", () => {\n  it.each([null, undefined])(\"returns undefined for %s\", (value) => {\n    expect(_parseEpochTimestamp(value)).toBeUndefined();\n  });\n\n  describe(\"parses properly formatted dates\", () => {\n    describe(\"with fractional seconds\", () => {\n      it.each([\"482196050.52\", 482196050.52])(\"parses %s\", (value) => {\n        expect(_parseEpochTimestamp(value)).toEqual(new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 520)));\n      });\n    });\n    describe(\"without fractional seconds\", () => {\n      it.each([\"482196050\", 482196050, 482196050.0])(\"parses %s\", (value) => {\n        expect(_parseEpochTimestamp(value)).toEqual(new Date(Date.UTC(1985, 3, 12, 23, 20, 50, 0)));\n      });\n    });\n  });\n  it.each([\n    \"1985-04-12T23:20:50.52Z\",\n    \"1985-04-12T23:20:50Z\",\n    \"Mon, 31 Dec 1990 15:59:60 GMT\",\n    \"Monday, 31-Dec-90 15:59:60 GMT\",\n    \"Mon Dec 31 15:59:60 1990\",\n    \"NaN\",\n    NaN,\n    \"Infinity\",\n    Infinity,\n    \"0x42\",\n  ])(\"rejects %s\", (value) => {\n    expect(() => _parseEpochTimestamp(value)).toThrowError();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/schema-serde-lib/schema-date-utils.ts",
    "content": "const ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;\nconst mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;\nconst time = `(\\\\d?\\\\d):(\\\\d{2}):(\\\\d{2})(?:\\\\.(\\\\d+))?`;\nconst date = `(\\\\d?\\\\d)`;\nconst year = `(\\\\d{4})`;\n\nconst RFC3339_WITH_OFFSET = new RegExp(\n  /^(\\d{4})-(\\d\\d)-(\\d\\d)[tT](\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d+))?(([-+]\\d\\d:\\d\\d)|[zZ])$/\n);\nconst IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);\nconst RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\\\d\\\\d) ${time} GMT$`);\nconst ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\\\d\\\\d) ${time} ${year}$`);\n\nconst months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a number or a parseable string.\n * Input strings must be an integer or floating point number. Fractional seconds are supported.\n *\n * @internal\n * @param value - the value to parse\n * @returns a Date or undefined\n */\nexport const _parseEpochTimestamp = (value: unknown): Date | undefined => {\n  if (value == null) {\n    return void 0;\n  }\n  let num: number = NaN;\n  if (typeof value === \"number\") {\n    num = value;\n  } else if (typeof value === \"string\") {\n    if (!/^-?\\d*\\.?\\d+$/.test(value)) {\n      throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);\n    }\n    num = Number.parseFloat(value);\n  } else if (typeof value === \"object\" && (value as { tag: number; value: number }).tag === 1) {\n    // timestamp is a CBOR tag type.\n    num = (value as { tag: number; value: number }).value;\n  }\n  if (isNaN(num) || Math.abs(num) === Infinity) {\n    throw new TypeError(\"Epoch timestamps must be valid finite numbers.\");\n  }\n  return new Date(Math.round(num * 1000));\n};\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a string that can be parsed\n * as an RFC 3339 date.\n * Input strings must conform to RFC3339 section 5.6, and can have a UTC\n * offset. Fractional precision is supported.\n *\n * @internal\n * @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}\n * @param value - the value to parse\n * @returns a Date or undefined\n */\nexport const _parseRfc3339DateTimeWithOffset = (value: unknown): Date | undefined => {\n  if (value == null) {\n    return void 0;\n  }\n  if (typeof value !== \"string\") {\n    throw new TypeError(\"RFC3339 timestamps must be strings\");\n  }\n\n  const matches = RFC3339_WITH_OFFSET.exec(value);\n\n  if (!matches) {\n    throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);\n  }\n\n  const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;\n\n  range(monthStr, 1, 12);\n  range(dayStr, 1, 31);\n  range(hours, 0, 23);\n  range(minutes, 0, 59);\n  range(seconds, 0, 60); // leap second\n\n  const date = new Date(\n    Date.UTC(\n      Number(yearStr),\n      Number(monthStr) - 1,\n      Number(dayStr),\n      Number(hours),\n      Number(minutes),\n      Number(seconds),\n      Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0\n    )\n  );\n  date.setUTCFullYear(Number(yearStr));\n\n  if (offsetStr.toUpperCase() != \"Z\") {\n    const [, sign, offsetH, offsetM] = /([+-])(\\d\\d):(\\d\\d)/.exec(offsetStr) || [void 0, \"+\", 0, 0];\n    const scalar = sign === \"-\" ? 1 : -1;\n    date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000));\n  }\n\n  return date;\n};\n\n/**\n * Parses a value into a Date. Returns undefined if the input is null or\n * undefined, throws an error if the input is not a string that can be parsed\n * as an RFC 7231 date.\n * Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.\n * RFC 850 and unix asctime formats are also accepted.\n * todo: practically speaking, are RFC 850 and asctime even used anymore?\n * todo: can we remove those parts?\n *\n * @internal\n * @see {@link https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}\n * @param value - the value to parse.\n * @returns a Date or undefined.\n */\nexport const _parseRfc7231DateTime = (value: unknown): Date | undefined => {\n  if (value == null) {\n    return void 0;\n  }\n  if (typeof value !== \"string\") {\n    throw new TypeError(\"RFC7231 timestamps must be strings.\");\n  }\n\n  let day!: string;\n  let month!: string;\n  let year!: string;\n  let hour!: string;\n  let minute!: string;\n  let second!: string;\n  let fraction!: string;\n\n  let matches: string[] | null;\n  if ((matches = IMF_FIXDATE.exec(value))) {\n    // \"Mon, 25 Dec 2077 23:59:59 GMT\"\n    [, day, month, year, hour, minute, second, fraction] = matches;\n  } else if ((matches = RFC_850_DATE.exec(value))) {\n    // \"Monday, 25-Dec-77 23:59:59 GMT\"\n    [, day, month, year, hour, minute, second, fraction] = matches;\n    year = (Number(year) + 1900).toString();\n  } else if ((matches = ASC_TIME.exec(value))) {\n    // \"Mon Dec 25 23:59:59 2077\"\n    [, month, day, hour, minute, second, fraction, year] = matches;\n  }\n\n  if (year && second) {\n    const timestamp = Date.UTC(\n      Number(year),\n      months.indexOf(month),\n      Number(day),\n      Number(hour),\n      Number(minute),\n      Number(second),\n      fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0\n    );\n    range(day, 1, 31);\n    range(hour, 0, 23);\n    range(minute, 0, 59);\n    range(second, 0, 60); // leap second\n    const date = new Date(timestamp);\n    date.setUTCFullYear(Number(year));\n    return date;\n  }\n\n  throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);\n};\n\n/**\n * @internal\n */\nfunction range(v: number | string, min: number, max: number): void {\n  const _v = Number(v);\n  if (_v < min || _v > max) {\n    throw new Error(`Value ${_v} out of range [${min}, ${max}]`);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/split-every.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { splitEvery } from \"./split-every\";\n\ndescribe(\"splitEvery\", () => {\n  const m1 = \"foo\";\n  const m2 = \"foo, bar\";\n  const m3 = \"foo, bar, baz\";\n  const m4 = \"foo, bar, baz, qux\";\n  const m5 = \"foo, bar, baz, qux, coo\";\n  const m6 = \"foo, bar, baz, qux, coo, tan\";\n  const delim = \", \";\n\n  it(\"Errors on <= 0\", () => {\n    expect(() => {\n      splitEvery(m2, delim, -1);\n    }).toThrow(\"Invalid number of delimiters\");\n\n    expect(() => {\n      splitEvery(m2, delim, 0);\n    }).toThrow(\"Invalid number of delimiters\");\n  });\n\n  it(\"Errors on non-integer\", () => {\n    expect(() => {\n      splitEvery(m2, delim, 1.3);\n    }).toThrow(\"Invalid number of delimiters\");\n\n    expect(() => {\n      splitEvery(m2, delim, 4.9);\n    }).toThrow(\"Invalid number of delimiters\");\n  });\n\n  it(\"Handles splitting on 1\", () => {\n    const count = 1;\n    expect(splitEvery(m1, delim, count)).toMatchObject(m1.split(delim));\n    expect(splitEvery(m2, delim, count)).toMatchObject(m2.split(delim));\n    expect(splitEvery(m3, delim, count)).toMatchObject(m3.split(delim));\n    expect(splitEvery(m4, delim, count)).toMatchObject(m4.split(delim));\n    expect(splitEvery(m5, delim, count)).toMatchObject(m5.split(delim));\n    expect(splitEvery(m6, delim, count)).toMatchObject(m6.split(delim));\n  });\n\n  it(\"Handles splitting on 2\", () => {\n    const count = 2;\n    expect(splitEvery(m1, delim, count)).toMatchObject([\"foo\"]);\n    expect(splitEvery(m2, delim, count)).toMatchObject([\"foo, bar\"]);\n    expect(splitEvery(m3, delim, count)).toMatchObject([\"foo, bar\", \"baz\"]);\n    expect(splitEvery(m4, delim, count)).toMatchObject([\"foo, bar\", \"baz, qux\"]);\n    expect(splitEvery(m5, delim, count)).toMatchObject([\"foo, bar\", \"baz, qux\", \"coo\"]);\n    expect(splitEvery(m6, delim, count)).toMatchObject([\"foo, bar\", \"baz, qux\", \"coo, tan\"]);\n  });\n\n  it(\"Handles splitting on 3\", () => {\n    const count = 3;\n    expect(splitEvery(m1, delim, count)).toMatchObject([\"foo\"]);\n    expect(splitEvery(m2, delim, count)).toMatchObject([\"foo, bar\"]);\n    expect(splitEvery(m3, delim, count)).toMatchObject([\"foo, bar, baz\"]);\n    expect(splitEvery(m4, delim, count)).toMatchObject([\"foo, bar, baz\", \"qux\"]);\n    expect(splitEvery(m5, delim, count)).toMatchObject([\"foo, bar, baz\", \"qux, coo\"]);\n    expect(splitEvery(m6, delim, count)).toMatchObject([\"foo, bar, baz\", \"qux, coo, tan\"]);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/split-every.ts",
    "content": "/**\n * Given an input string, splits based on the delimiter after a given\n * number of delimiters has been encountered.\n *\n * @internal\n * @param value - The input string to split.\n * @param delimiter - The delimiter to split on.\n * @param numDelimiters - The number of delimiters to have encountered to split.\n */\nexport function splitEvery(value: string, delimiter: string, numDelimiters: number): Array<string> {\n  // Fail if we don't have a clear number to split on.\n  if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n    throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n  }\n\n  const segments = value.split(delimiter);\n  // Short circuit extra logic for the simple case.\n  if (numDelimiters === 1) {\n    return segments;\n  }\n\n  const compoundSegments: Array<string> = [];\n  let currentSegment = \"\";\n  for (let i = 0; i < segments.length; i++) {\n    if (currentSegment === \"\") {\n      // Start a new segment.\n      currentSegment = segments[i];\n    } else {\n      // Compound the current segment with the delimiter.\n      currentSegment += delimiter + segments[i];\n    }\n\n    if ((i + 1) % numDelimiters === 0) {\n      // We encountered the right number of delimiters, so add the entry.\n      compoundSegments.push(currentSegment);\n      // And reset the current segment.\n      currentSegment = \"\";\n    }\n  }\n\n  // Handle any leftover segment portion.\n  if (currentSegment !== \"\") {\n    compoundSegments.push(currentSegment);\n  }\n\n  return compoundSegments;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/split-header.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { splitHeader } from \"./split-header\";\n\ndescribe(splitHeader.name, () => {\n  it(\"should split a string by commas and trim only the comma delimited outer values\", () => {\n    expect(splitHeader(\"abc\")).toEqual([\"abc\"]);\n    expect(splitHeader(\"a,b,c\")).toEqual([\"a\", \"b\", \"c\"]);\n    expect(splitHeader(\"a, b, c\")).toEqual([\"a\", \"b\", \"c\"]);\n    expect(splitHeader(\"a , b , c\")).toEqual([\"a\", \"b\", \"c\"]);\n    expect(splitHeader(`a , b , \"  c  \"`)).toEqual([\"a\", \"b\", \"  c  \"]);\n    expect(splitHeader(`  a  ,     , b`)).toEqual([\"a\", \"\", \"b\"]);\n    expect(splitHeader(`,,`)).toEqual([\"\", \"\", \"\"]);\n    expect(splitHeader(`    ,    ,    `)).toEqual([\"\", \"\", \"\"]);\n  });\n  it(\"should split a string by commas that are not in quotes, and remove outer quotes\", () => {\n    expect(splitHeader('\"b,c\", \"\\\\\"def\\\\\"\", a')).toEqual([\"b,c\", '\"def\"', \"a\"]);\n    expect(splitHeader('\"a,b,c\", \"\"def\"\", \"a,b ,c\"')).toEqual([\"a,b,c\", '\"def\"', \"a,b ,c\"]);\n    expect(splitHeader(`\"\"`)).toEqual([``]);\n    expect(splitHeader(``)).toEqual([``]);\n    expect(splitHeader(`\\\\\"`)).toEqual([`\"`]);\n    expect(splitHeader(`\"`)).toEqual([`\"`]);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/split-header.ts",
    "content": "/**\n * @param value - header string value.\n * @returns value split by commas that aren't in quotes.\n */\nexport const splitHeader = (value: string): string[] => {\n  const z = value.length;\n  const values = [];\n\n  let withinQuotes = false;\n  let prevChar = undefined;\n  let anchor = 0;\n\n  for (let i = 0; i < z; ++i) {\n    const char = value[i];\n    switch (char) {\n      case `\"`:\n        if (prevChar !== \"\\\\\") {\n          withinQuotes = !withinQuotes;\n        }\n        break;\n      case \",\":\n        if (!withinQuotes) {\n          values.push(value.slice(anchor, i));\n          anchor = i + 1;\n        }\n        break;\n      default:\n    }\n    prevChar = char;\n  }\n\n  values.push(value.slice(anchor));\n\n  return values.map((v) => {\n    v = v.trim();\n    const z = v.length;\n    if (z < 2) {\n      return v;\n    }\n    if (v[0] === `\"` && v[z - 1] === `\"`) {\n      v = v.slice(1, z - 1);\n    }\n    return v.replace(/\\\\\"/g, '\"');\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.3.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-buffer-from@4.2.2\n  - @smithy/util-utf8@4.2.2\n\n## 4.3.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/util-buffer-from@4.2.1\n  - @smithy/util-utf8@4.2.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 813c9a5: refactoring to reduce code size\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/util-buffer-from@4.2.0\n  - @smithy/util-utf8@4.2.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- Updated dependencies [64cda93]\n  - @smithy/util-buffer-from@4.1.0\n  - @smithy/util-utf8@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-buffer-from@4.0.0\n  - @smithy/util-utf8@4.0.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [671aa704]\n  - @smithy/util-buffer-from@3.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n  - @smithy/util-buffer-from@2.2.0\n  - @smithy/util-utf8@2.3.0\n\n## 2.2.1\n\n### Patch Changes\n\n- 8e8f3513: allow arrays to stand in for Uint8Array in toBase64\n\n## 2.2.0\n\n### Minor Changes\n\n- 43f3e1e2: encoders allow string inputs\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-utf8@2.2.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/util-buffer-from@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-buffer-from@2.1.0\n\n## 2.0.1\n\n### Patch Changes\n\n- 5598a033: update bundler replacement directives in package.json\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-buffer-from@2.0.0\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/util-buffer-from@1.1.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-buffer-from@1.0.2\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-buffer-from@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-base64](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-base64/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/__mocks__/testCases.json",
    "content": "[\n  [\"double padded\", \"3q2+7w==\", [222, 173, 190, 239]],\n  [\"single padded\", \"3q2+7/o=\", [222, 173, 190, 239, 250]],\n  [\"unpadded\", \"3q2+7/rO\", [222, 173, 190, 239, 250, 206]],\n  [\"AAAA\", \"AAAA\", [0, 0, 0]],\n  [\"AAAB\", \"AAAB\", [0, 0, 1]],\n  [\"AAH/\", \"AAH/\", [0, 1, -1]],\n  [\"AQEB\", \"AQEB\", [1, 1, 1]],\n  [\"ALcX\", \"ALcX\", [0, -73, 23]]\n]\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/constants-for-browser.ts",
    "content": "const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;\n\nexport const alphabetByEncoding: Record<string, number> = Object.entries(chars).reduce(\n  (acc, [i, c]) => {\n    acc[c] = Number(i);\n    return acc;\n  },\n  {} as Record<string, number>\n);\nexport const alphabetByValue: Array<string> = chars.split(\"\");\n\nexport const bitsPerLetter = 6;\nexport const bitsPerByte = 8;\nexport const maxLetterValue = 0b111111;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/fromBase64.browser.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport testCases from \"./__mocks__/testCases.json\";\nimport { fromBase64 } from \"./fromBase64.browser\";\n\ndescribe(fromBase64.name, () => {\n  it.each(testCases as Array<[string, string, number[]]>)(\"%s\", (desc, encoded, decoded) => {\n    expect(fromBase64(encoded)).toEqual(new Uint8Array(decoded));\n  });\n\n  it(\"should throw when given a number\", () => {\n    expect(() => fromBase64(0xdeadbeefface as any)).toThrow();\n  });\n\n  describe(\"should reject invalid base64 strings\", () => {\n    it.each([\"Rg\", \"Rg=\", \"[][]\", \"-_==\"])(\"rejects '%s'\", (value) => {\n      expect(() => fromBase64(value)).toThrowError();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/fromBase64.browser.ts",
    "content": "import { alphabetByEncoding, bitsPerByte, bitsPerLetter } from \"./constants-for-browser\";\n\n/**\n * Converts a base-64 encoded string to a Uint8Array of bytes.\n *\n * @param input The base-64 encoded string\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport const fromBase64 = (input: string): Uint8Array => {\n  let totalByteLength = (input.length / 4) * 3;\n  if (input.slice(-2) === \"==\") {\n    totalByteLength -= 2;\n  } else if (input.slice(-1) === \"=\") {\n    totalByteLength--;\n  }\n  const out = new ArrayBuffer(totalByteLength);\n  const dataView = new DataView(out);\n  for (let i = 0; i < input.length; i += 4) {\n    let bits = 0;\n    let bitLength = 0;\n    for (let j = i, limit = i + 3; j <= limit; j++) {\n      if (input[j] !== \"=\") {\n        // If we don't check for this, we'll end up using undefined in a bitwise\n        // operation, in which it will be treated as 0.\n        if (!(input[j] in alphabetByEncoding)) {\n          throw new TypeError(`Invalid character ${input[j]} in base64 string.`);\n        }\n        bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n        bitLength += bitsPerLetter;\n      } else {\n        bits >>= bitsPerLetter;\n      }\n    }\n\n    const chunkOffset = (i / 4) * 3;\n    bits >>= bitLength % bitsPerByte;\n    const byteLength = Math.floor(bitLength / bitsPerByte);\n    for (let k = 0; k < byteLength; k++) {\n      const offset = (byteLength - k - 1) * bitsPerByte;\n      dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n    }\n  }\n\n  return new Uint8Array(out);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/fromBase64.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport testCases from \"./__mocks__/testCases.json\";\nimport { fromBase64 } from \"./fromBase64\";\n\ndescribe(fromBase64.name, () => {\n  it.each(testCases as Array<[string, string, number[]]>)(\"%s\", (desc, encoded, decoded) => {\n    expect(fromBase64(encoded)).toEqual(new Uint8Array(decoded));\n  });\n\n  it(\"should throw when given a number\", () => {\n    expect(() => fromBase64(0xdeadbeefface as any)).toThrow();\n  });\n\n  describe(\"should reject invalid base64 strings\", () => {\n    it.each([\"Rg\", \"Rg=\", \"[][]\", \"-_==\"])(\"rejects '%s'\", (value) => {\n      expect(() => fromBase64(value)).toThrowError();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/fromBase64.ts",
    "content": "import { fromString } from \"../util-buffer-from/buffer-from\";\n\nconst BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;\n\n/**\n * Converts a base-64 encoded string to a Uint8Array of bytes using Node.JS's\n * `buffer` module.\n *\n * @param input The base-64 encoded string\n */\nexport const fromBase64 = (input: string): Uint8Array => {\n  // Node's buffer module allows padding to be omitted, but we want to enforce\n  // it. So here we ensure that the input represents a number of bits divisible\n  // by 8. Each character represents 6 bits, so after reducing the fraction we\n  // end up mulitplying by 3/4 and checking for a remainder.\n  if ((input.length * 3) % 4 !== 0) {\n    throw new TypeError(`Incorrect padding on base64 string.`);\n  }\n\n  // Node will just ignore invalid characters, so we need to make sure they're\n  // properly rejected.\n  if (!BASE64_REGEX.exec(input)) {\n    throw new TypeError(`Invalid base64 string.`);\n  }\n\n  const buffer = fromString(input, \"base64\");\n\n  return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/toBase64.browser.spec.ts",
    "content": "import type { Encoder } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport testCases from \"./__mocks__/testCases.json\";\nimport { fromBase64 } from \"./fromBase64.browser\";\nimport { toBase64 } from \"./toBase64.browser\";\n\ndescribe(toBase64.name, () => {\n  it.each(testCases as Array<[string, string, number[]]>)(\"%s\", (desc, encoded, decoded) => {\n    expect(toBase64(new Uint8Array(decoded))).toEqual(encoded);\n  });\n\n  it(\"also converts strings\", () => {\n    expect(toBase64(\"hello\")).toEqual(\"aGVsbG8=\");\n  });\n\n  it(\"throws on non-string non-Uint8Array\", () => {\n    expect(() => (toBase64 as Encoder)(new Date())).toThrow();\n    expect(() => (toBase64 as Encoder)({})).toThrow();\n  });\n\n  it(\"allows array to stand in for Uint8Array\", () => {\n    expect(() => (toBase64 as Encoder)([])).not.toThrow();\n\n    const helloUtf8Array = fromBase64(\"aGVsbG8=\");\n    expect(toBase64([...helloUtf8Array] as unknown as Uint8Array)).toEqual(\"aGVsbG8=\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/toBase64.browser.ts",
    "content": "import { fromUtf8 } from \"../util-utf8/fromUtf8.browser\";\nimport { alphabetByValue, bitsPerByte, bitsPerLetter, maxLetterValue } from \"./constants-for-browser\";\n\n/**\n * Converts a Uint8Array of binary data or a utf-8 string to a base-64 encoded string.\n *\n * @param _input - the binary data or string to encode.\n * @returns base64 string.\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function toBase64(_input: Uint8Array | string): string {\n  let input: Uint8Array;\n  if (typeof _input === \"string\") {\n    input = fromUtf8(_input);\n  } else {\n    input = _input as Uint8Array;\n  }\n\n  const isArrayLike = typeof input === \"object\" && typeof input.length === \"number\";\n  const isUint8Array =\n    typeof input === \"object\" &&\n    typeof (input as Uint8Array).byteOffset === \"number\" &&\n    typeof (input as Uint8Array).byteLength === \"number\";\n\n  if (!isArrayLike && !isUint8Array) {\n    throw new Error(\"@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.\");\n  }\n\n  let str = \"\";\n  for (let i = 0; i < input.length; i += 3) {\n    let bits = 0;\n    let bitLength = 0;\n    for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {\n      bits |= input[j] << ((limit - j - 1) * bitsPerByte);\n      bitLength += bitsPerByte;\n    }\n\n    const bitClusterCount = Math.ceil(bitLength / bitsPerLetter);\n    bits <<= bitClusterCount * bitsPerLetter - bitLength;\n    for (let k = 1; k <= bitClusterCount; k++) {\n      const offset = (bitClusterCount - k) * bitsPerLetter;\n      str += alphabetByValue[(bits & (maxLetterValue << offset)) >> offset];\n    }\n\n    str += \"==\".slice(0, 4 - bitClusterCount);\n  }\n\n  return str;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/toBase64.spec.ts",
    "content": "import type { Encoder } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport testCases from \"./__mocks__/testCases.json\";\nimport { toBase64 } from \"./toBase64\";\n\ndescribe(toBase64.name, () => {\n  it.each(testCases as Array<[string, string, number[]]>)(\"%s\", (desc, encoded, decoded) => {\n    expect(toBase64(new Uint8Array(decoded))).toEqual(encoded);\n  });\n\n  it(\"should throw when given a number\", () => {\n    expect(() => toBase64(0xdeadbeefface as any)).toThrow();\n  });\n\n  it(\"also converts strings\", () => {\n    expect(toBase64(\"hello\")).toEqual(\"aGVsbG8=\");\n  });\n\n  it(\"throws on non-string non-Uint8Array\", () => {\n    expect(() => (toBase64 as Encoder)(new Date())).toThrow();\n    expect(() => (toBase64 as Encoder)({})).toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-base64/toBase64.ts",
    "content": "import { fromArrayBuffer } from \"../util-buffer-from/buffer-from\";\nimport { fromUtf8 } from \"../util-utf8/fromUtf8\";\n\n/**\n * Converts a Uint8Array of binary data or a utf-8 string to a base-64 encoded string using\n * Node.JS's `buffer` module.\n *\n * @param _input - the binary data or string to encode.\n * @returns base64 string.\n */\nexport const toBase64 = (_input: Uint8Array | string): string => {\n  let input: Uint8Array;\n  if (typeof _input === \"string\") {\n    input = fromUtf8(_input);\n  } else {\n    input = _input as Uint8Array;\n  }\n  if (typeof input !== \"object\" || typeof input.byteOffset !== \"number\" || typeof input.byteLength !== \"number\") {\n    throw new Error(\"@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.\");\n  }\n  return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString(\"base64\");\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-body-length/CHANGELOG.util-body-length-browser.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.0.1\n\n### Patch Changes\n\n- 599e95a8: Use TextEncoder to calculate body length on browsers (where available)\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-body-length-browser](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-body-length-browser/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-body-length/CHANGELOG.util-body-length-node.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.3\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.2\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.1\n\n### Patch Changes\n\n- 300177f: restrict fs calls to fs.ReadStream instances\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.2.2\n\n### Patch Changes\n\n- 511206e5: reduce buffer copies\n\n## 2.2.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.2.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.1.0\n\n### Minor Changes\n\n- 4571d59c: calculateBodyLength for Readable stream with range\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-body-length-node](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-body-length-node/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-body-length/calculateBodyLength.browser.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { calculateBodyLength } from \"./calculateBodyLength.browser\";\n\ndescribe(calculateBodyLength.name, () => {\n  describe(\"should handle string input\", () => {\n    it.each([\n      { desc: \"basic\", input: \"foo\", output: 3 },\n      { desc: \"emoji\", input: \"foo 🥺\", output: 8 },\n      { desc: \"multi-byte characters\", input: \"2。\", output: 4 },\n    ])(\"%s\", ({ input, output }) => {\n      expect(calculateBodyLength(input)).toEqual(output);\n    });\n  });\n\n  describe(\"should handle input with byteLength\", () => {\n    const sizes = [1, 256, 65536];\n\n    describe(\"ArrayBuffer\", () => {\n      it.each(sizes)(\"size: %s\", (size) => {\n        expect(calculateBodyLength(new ArrayBuffer(size))).toEqual(size);\n      });\n    });\n\n    describe(\"TypedArray\", () => {\n      it.each(sizes)(\"size: %s\", (size) => {\n        expect(calculateBodyLength(new Uint8Array(size))).toEqual(size);\n      });\n    });\n  });\n\n  it(\"should handle File object\", () => {\n    // Mock File Object https://developer.mozilla.org/en-US/docs/Web/API/File/File#example\n    const lastModifiedDate = new Date();\n    const mockFileObject = {\n      lastModified: lastModifiedDate.getTime(),\n      lastModifiedDate,\n      name: \"foo.txt\",\n      size: 3,\n      type: \"text/plain\",\n      webkitRelativePath: \"\",\n    };\n    expect(calculateBodyLength(mockFileObject)).toEqual(mockFileObject.size);\n  });\n\n  describe(\"throws error if Body Length computation fails\", () => {\n    it.each([true, 1, {}, []])(\"%s\", (body) => {\n      expect(() => {\n        expect(calculateBodyLength(body));\n      }).toThrowError(`Body Length computation failed for ${body}`);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-body-length/calculateBodyLength.browser.ts",
    "content": "const TEXT_ENCODER = typeof TextEncoder == \"function\" ? new TextEncoder() : null;\n\n/**\n * @internal\n */\nexport const calculateBodyLength = (body: any): number | undefined => {\n  if (typeof body === \"string\") {\n    if (TEXT_ENCODER) {\n      return TEXT_ENCODER.encode(body).byteLength;\n    }\n\n    let len = body.length;\n\n    for (let i = len - 1; i >= 0; i--) {\n      const code = body.charCodeAt(i);\n      if (code > 0x7f && code <= 0x7ff) len++;\n      else if (code > 0x7ff && code <= 0xffff) len += 2;\n      if (code >= 0xdc00 && code <= 0xdfff) i--; //trail surrogate\n    }\n\n    return len;\n  } else if (typeof body.byteLength === \"number\") {\n    // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n    return body.byteLength;\n  } else if (typeof body.size === \"number\") {\n    // handles browser File object\n    return body.size;\n  }\n  throw new Error(`Body Length computation failed for ${body}`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-body-length/calculateBodyLength.spec.ts",
    "content": "import * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { calculateBodyLength } from \"./calculateBodyLength\";\n\ndescribe(calculateBodyLength.name, () => {\n  const arrayBuffer = new ArrayBuffer(1);\n  const typedArray = new Uint8Array(1);\n  const view = new DataView(arrayBuffer);\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it.each([\n    [0, null],\n    [0, undefined],\n  ])(\"should return %s for %s\", (output, input) => {\n    expect(calculateBodyLength(input)).toEqual(output);\n  });\n\n  it(\"should handle string inputs\", () => {\n    expect(calculateBodyLength(\"foo\")).toEqual(3);\n  });\n\n  it(\"should handle string inputs with multi-byte characters\", () => {\n    expect(calculateBodyLength(\"2。\")).toEqual(4);\n  });\n\n  it(\"should handle inputs with byteLengths\", () => {\n    expect(calculateBodyLength(arrayBuffer)).toEqual(1);\n  });\n\n  it(\"should handle TypedArray inputs\", () => {\n    expect(calculateBodyLength(typedArray)).toEqual(1);\n  });\n\n  it(\"should handle DataView inputs\", () => {\n    expect(calculateBodyLength(view)).toEqual(1);\n  });\n\n  it(\"should handle a Readable from a file\", async () => {\n    const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), \"test1-\"));\n    const filePath = path.join(tmpDir, \"foo\");\n    fs.writeFileSync(filePath, \"foo\");\n    const handle = fs.openSync(filePath, \"r\");\n    const readStream = fs.createReadStream(filePath, { fd: handle });\n    expect(calculateBodyLength(readStream)).toEqual(3);\n    readStream.destroy();\n    fs.unlinkSync(filePath);\n    fs.rmdirSync(tmpDir);\n  });\n\n  it(\"should handle Readable with start end from a file\", async () => {\n    const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), \"test2-\"));\n    const filePath = path.join(tmpDir, \"foo\");\n    fs.writeFileSync(filePath, \"foo\");\n    const handle = fs.openSync(filePath, \"r\");\n    const readStream = fs.createReadStream(filePath, { fd: handle, start: 1, end: 1 });\n    expect(calculateBodyLength(readStream)).toEqual(1);\n    readStream.destroy();\n    fs.unlinkSync(filePath);\n    fs.rmdirSync(tmpDir);\n  });\n\n  describe(\"fs.ReadStream\", () => {\n    const fileSize = fs.lstatSync(__filename).size;\n\n    describe(\"should handle stream created using fs.createReadStream\", () => {\n      it(\"when path is a string\", () => {\n        const fsReadStream = fs.createReadStream(__filename);\n        expect(calculateBodyLength(fsReadStream)).toEqual(fileSize);\n        fsReadStream.close();\n      });\n\n      it(\"when path is a Buffer\", () => {\n        const fsReadStream = fs.createReadStream(Buffer.from(__filename));\n        expect(calculateBodyLength(fsReadStream)).toEqual(fileSize);\n        fsReadStream.close();\n      });\n    });\n\n    it(\"should handle stream created using fd.createReadStream\", async () => {\n      const fd = await fs.promises.open(__filename, \"r\");\n      const fdReadStream = fd.createReadStream();\n      expect(calculateBodyLength(fdReadStream)).toEqual(fileSize);\n      fdReadStream.close();\n    });\n  });\n\n  it.each([true, 1, {}, []])(\"throws error if Body Length computation fails for: %s\", (body) => {\n    expect(() => {\n      expect(calculateBodyLength(body));\n    }).toThrowError(`Body Length computation failed for ${body}`);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-body-length/calculateBodyLength.ts",
    "content": "import { ReadStream, fstatSync, lstatSync } from \"node:fs\";\n\n/**\n * @internal\n */\ntype HasFileDescriptor = {\n  fd: number;\n};\n\n/**\n * @internal\n */\nexport const calculateBodyLength = (body: any): number | undefined => {\n  if (!body) {\n    return 0;\n  }\n  if (typeof body === \"string\") {\n    return Buffer.byteLength(body);\n  } else if (typeof body.byteLength === \"number\") {\n    // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n    return body.byteLength;\n  } else if (typeof body.size === \"number\") {\n    return body.size;\n  } else if (typeof body.start === \"number\" && typeof body.end === \"number\") {\n    return body.end + 1 - body.start;\n  } else if (body instanceof ReadStream) {\n    // the previous use case where start and end are numbers is also potentially a ReadStream.\n    if (body.path != null) {\n      return lstatSync(body.path).size;\n    } else if (typeof (body as ReadStream & HasFileDescriptor).fd === \"number\") {\n      return fstatSync((body as ReadStream & HasFileDescriptor).fd).size;\n    }\n  }\n  throw new Error(`Body Length computation failed for ${body}`);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-buffer-from/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/is-array-buffer@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/is-array-buffer@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/is-array-buffer@4.2.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- Updated dependencies [64cda93]\n  - @smithy/is-array-buffer@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/is-array-buffer@4.0.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [671aa704]\n  - @smithy/is-array-buffer@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n  - @smithy/is-array-buffer@2.2.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/is-array-buffer@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/is-array-buffer@2.1.0\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/is-array-buffer@2.0.0\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/is-array-buffer@1.1.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/is-array-buffer@1.0.2\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/is-array-buffer@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-buffer-from](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-buffer-from/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-buffer-from/buffer-from.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { fromArrayBuffer, fromString } from \"./buffer-from\";\n\ndescribe(\"fromArrayBuffer\", () => {\n  it(\"throws if argument is not an ArrayBuffer\", () => {\n    const input = 255;\n    // @ts-expect-error is not assignable to parameter of type 'ArrayBuffer'\n    expect(() => fromArrayBuffer(input)).toThrow(\n      new TypeError(`The \"input\" argument must be ArrayBuffer. Received type ${typeof input} (${input})`)\n    );\n  });\n\n  it(\"returns a Buffer from ArrayBuffer with one arg\", () => {\n    const buffer = new ArrayBuffer(16);\n    const result = fromArrayBuffer(buffer);\n    expect(result).toBeInstanceOf(Buffer);\n    expect(result.byteLength).toBe(16);\n  });\n\n  it(\"returns a Buffer from ArrayBuffer with offset\", () => {\n    const buffer = new ArrayBuffer(16);\n    const offset = 4;\n    const result = fromArrayBuffer(buffer, offset);\n    expect(result).toBeInstanceOf(Buffer);\n    expect(result.byteLength).toBe(12);\n  });\n\n  it(\"returns a Buffer from ArrayBuffer with offset and length\", () => {\n    const buffer = new ArrayBuffer(16);\n    const result = fromArrayBuffer(buffer, 4, 8);\n    expect(result).toBeInstanceOf(Buffer);\n    expect(result.byteLength).toBe(8);\n  });\n\n  it(\"shares memory with the source ArrayBuffer\", () => {\n    const buffer = new ArrayBuffer(4);\n    const view = new Uint8Array(buffer);\n    view[0] = 42;\n    const result = fromArrayBuffer(buffer);\n    expect(result[0]).toBe(42);\n  });\n});\n\ndescribe(\"fromString\", () => {\n  it(\"throws if argument is not a string\", () => {\n    const input = 255;\n    // @ts-expect-error is not assignable to parameter of type 'string'\n    expect(() => fromString(input)).toThrow(\n      new TypeError(`The \"input\" argument must be of type string. Received type ${typeof input} (${input})`)\n    );\n  });\n\n  it(\"returns a Buffer from string without encoding\", () => {\n    const result = fromString(\"hello\");\n    expect(result).toBeInstanceOf(Buffer);\n    expect(result.toString(\"utf8\")).toBe(\"hello\");\n  });\n\n  it(\"returns a Buffer from string with encoding\", () => {\n    const result = fromString(\"68656c6c6f\", \"hex\");\n    expect(result).toBeInstanceOf(Buffer);\n    expect(result.toString(\"utf8\")).toBe(\"hello\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-buffer-from/buffer-from.ts",
    "content": "import { isArrayBuffer } from \"../is-array-buffer/is-array-buffer\";\n\n/**\n * @internal\n */\nexport const fromArrayBuffer = (input: ArrayBuffer, offset = 0, length: number = input.byteLength - offset): Buffer => {\n  if (!isArrayBuffer(input)) {\n    throw new TypeError(`The \"input\" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);\n  }\n\n  return Buffer.from(input, offset, length);\n};\n\n/**\n * @internal\n */\nexport type StringEncoding = \"ascii\" | \"utf8\" | \"utf16le\" | \"ucs2\" | \"base64\" | \"latin1\" | \"binary\" | \"hex\";\n\n/**\n * @internal\n */\nexport const fromString = (input: string, encoding?: StringEncoding): Buffer => {\n  if (typeof input !== \"string\") {\n    throw new TypeError(`The \"input\" argument must be of type string. Received type ${typeof input} (${input})`);\n  }\n\n  return encoding ? Buffer.from(input, encoding) : Buffer.from(input);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-hex-encoding/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-hex-encoding](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-hex-encoding/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-hex-encoding/hex-encoding.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { fromHex, toHex } from \"./hex-encoding\";\n\nconst encoded = \"dead\" + \"beef\" + \"cafe\" + \"babe\" + \"face\";\nconst bytes = new Uint8Array([0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce]);\n\ndescribe(\"fromHex\", () => {\n  it(\"should decode hexadecimal strings to binary\", () => {\n    expect(fromHex(encoded)).toEqual(bytes);\n  });\n\n  it(\"should throw if the string is not an even number of code units\", () => {\n    expect(() => fromHex(encoded + \"a\")).toThrow();\n  });\n\n  it(\"should throw if an unexpected sequence is encountered\", () => {\n    expect(() => fromHex(\"xy\")).toThrow();\n  });\n\n  it(\"should decode hexadecimal strings regardless of casing\", () => {\n    expect(fromHex(encoded.toLowerCase())).toEqual(bytes);\n    expect(fromHex(encoded.toUpperCase())).toEqual(bytes);\n  });\n});\n\ndescribe(\"toHex\", () => {\n  it(\"should encode bytes as hexadecimal\", () => {\n    expect(toHex(bytes)).toBe(encoded);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-hex-encoding/hex-encoding.ts",
    "content": "const SHORT_TO_HEX: { [key: number]: string } = {};\nconst HEX_TO_SHORT: Record<string, number> = {};\n\nfor (let i = 0; i < 256; i++) {\n  let encodedByte = i.toString(16).toLowerCase();\n  if (encodedByte.length === 1) {\n    encodedByte = `0${encodedByte}`;\n  }\n\n  SHORT_TO_HEX[i] = encodedByte;\n  HEX_TO_SHORT[encodedByte] = i;\n}\n\n/**\n * Converts a hexadecimal encoded string to a Uint8Array of bytes.\n *\n * @param encoded The hexadecimal encoded string\n */\nexport function fromHex(encoded: string): Uint8Array {\n  if (encoded.length % 2 !== 0) {\n    throw new Error(\"Hex encoded strings must have an even number length\");\n  }\n\n  const out = new Uint8Array(encoded.length / 2);\n  for (let i = 0; i < encoded.length; i += 2) {\n    const encodedByte = encoded.slice(i, i + 2).toLowerCase();\n    if (encodedByte in HEX_TO_SHORT) {\n      out[i / 2] = HEX_TO_SHORT[encodedByte];\n    } else {\n      throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);\n    }\n  }\n\n  return out;\n}\n\n/**\n * Converts a Uint8Array of binary data to a hexadecimal encoded string.\n *\n * @param bytes The binary data to encode\n */\nexport function toHex(bytes: Uint8Array): string {\n  let out = \"\";\n  for (let i = 0; i < bytes.byteLength; i++) {\n    out += SHORT_TO_HEX[bytes[i]];\n  }\n\n  return out;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/ByteArrayCollector.ts",
    "content": "/**\n * Aggregates byteArrays on demand.\n * @internal\n */\nexport class ByteArrayCollector {\n  public byteLength = 0;\n  private byteArrays = [] as Uint8Array[];\n\n  public constructor(public readonly allocByteArray: (size: number) => Uint8Array) {}\n\n  public push(byteArray: Uint8Array) {\n    this.byteArrays.push(byteArray);\n    this.byteLength += byteArray.byteLength;\n  }\n\n  public flush(): Uint8Array {\n    if (this.byteArrays.length === 1) {\n      const bytes = this.byteArrays[0];\n      this.reset();\n      return bytes;\n    }\n    const aggregation = this.allocByteArray(this.byteLength);\n    let cursor = 0;\n    for (let i = 0; i < this.byteArrays.length; ++i) {\n      const bytes = this.byteArrays[i];\n      aggregation.set(bytes, cursor);\n      cursor += bytes.byteLength;\n    }\n    this.reset();\n    return aggregation;\n  }\n\n  private reset() {\n    this.byteArrays = [];\n    this.byteLength = 0;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.5.25\n\n### Patch Changes\n\n- Updated dependencies [769ed47]\n  - @smithy/node-http-handler@4.6.1\n\n## 4.5.24\n\n### Patch Changes\n\n- Updated dependencies [60d13c8]\n  - @smithy/node-http-handler@4.6.0\n\n## 4.5.23\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/node-http-handler@4.5.3\n  - @smithy/types@4.14.1\n  - @smithy/fetch-http-handler@5.3.17\n\n## 4.5.22\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/fetch-http-handler@5.3.16\n  - @smithy/node-http-handler@4.5.2\n\n## 4.5.21\n\n### Patch Changes\n\n- Updated dependencies [fac1a34]\n  - @smithy/node-http-handler@4.5.1\n\n## 4.5.20\n\n### Patch Changes\n\n- Updated dependencies [4e7fa38]\n  - @smithy/node-http-handler@4.5.0\n\n## 4.5.19\n\n### Patch Changes\n\n- Updated dependencies [dab22f1]\n  - @smithy/node-http-handler@4.4.16\n  - @smithy/fetch-http-handler@5.3.15\n\n## 4.5.18\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/fetch-http-handler@5.3.14\n  - @smithy/node-http-handler@4.4.15\n\n## 4.5.17\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/fetch-http-handler@5.3.13\n  - @smithy/node-http-handler@4.4.14\n  - @smithy/util-hex-encoding@4.2.2\n  - @smithy/util-buffer-from@4.2.2\n  - @smithy/util-base64@4.3.2\n  - @smithy/util-utf8@4.2.2\n\n## 4.5.16\n\n### Patch Changes\n\n- Updated dependencies [9bf9ae2]\n  - @smithy/node-http-handler@4.4.13\n  - @smithy/fetch-http-handler@5.3.12\n\n## 4.5.15\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/fetch-http-handler@5.3.11\n  - @smithy/node-http-handler@4.4.12\n\n## 4.5.14\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/fetch-http-handler@5.3.10\n  - @smithy/node-http-handler@4.4.11\n  - @smithy/types@4.12.1\n  - @smithy/util-base64@4.3.1\n  - @smithy/util-buffer-from@4.2.1\n  - @smithy/util-hex-encoding@4.2.1\n  - @smithy/util-utf8@4.2.1\n\n## 4.5.13\n\n### Patch Changes\n\n- ffe1843: Handle backpressure in ChecksumStream by deferring write callbacks when downstream buffer is full, resuming when \\_read is called.\n\n## 4.5.12\n\n### Patch Changes\n\n- Updated dependencies [f6f0de9]\n  - @smithy/node-http-handler@4.4.10\n\n## 4.5.11\n\n### Patch Changes\n\n- Updated dependencies [3ee4e66]\n  - @smithy/node-http-handler@4.4.9\n\n## 4.5.10\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/fetch-http-handler@5.3.9\n  - @smithy/node-http-handler@4.4.8\n\n## 4.5.9\n\n### Patch Changes\n\n- 87a5f20: correct chunked encoding output for 0-length streams\n\n## 4.5.8\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/fetch-http-handler@5.3.8\n  - @smithy/node-http-handler@4.4.7\n\n## 4.5.7\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/fetch-http-handler@5.3.7\n  - @smithy/node-http-handler@4.4.6\n\n## 4.5.6\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/fetch-http-handler@5.3.6\n  - @smithy/node-http-handler@4.4.5\n\n## 4.5.5\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n- Updated dependencies [df00095]\n  - @smithy/types@4.8.1\n  - @smithy/node-http-handler@4.4.4\n  - @smithy/fetch-http-handler@5.3.5\n\n## 4.5.4\n\n### Patch Changes\n\n- Updated dependencies [344d06a]\n  - @smithy/node-http-handler@4.4.3\n\n## 4.5.3\n\n### Patch Changes\n\n- 7e359e2: remove and ban circular imports\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/fetch-http-handler@5.3.4\n  - @smithy/node-http-handler@4.4.2\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/fetch-http-handler@5.3.3\n  - @smithy/node-http-handler@4.4.1\n\n## 4.5.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/node-http-handler@4.4.0\n  - @smithy/types@4.7.0\n  - @smithy/fetch-http-handler@5.3.2\n\n## 4.5.0\n\n### Minor Changes\n\n- 813c9a5: refactoring to reduce code size\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/util-base64@4.3.0\n  - @smithy/fetch-http-handler@5.3.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/fetch-http-handler@5.3.0\n  - @smithy/node-http-handler@4.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-base64@4.2.0\n  - @smithy/util-buffer-from@4.2.0\n  - @smithy/util-hex-encoding@4.2.0\n  - @smithy/util-utf8@4.2.0\n\n## 4.3.2\n\n### Patch Changes\n\n- f8793be: prevent compilation from inserting Uint8Array type parameter\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/fetch-http-handler@5.2.1\n  - @smithy/node-http-handler@4.2.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/fetch-http-handler@5.2.0\n  - @smithy/node-http-handler@4.2.0\n  - @smithy/util-hex-encoding@4.1.0\n  - @smithy/util-buffer-from@4.1.0\n  - @smithy/util-base64@4.1.0\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/fetch-http-handler@5.1.1\n  - @smithy/node-http-handler@4.1.1\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [c4e923a]\n  - @smithy/fetch-http-handler@5.1.0\n  - @smithy/node-http-handler@4.1.0\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/fetch-http-handler@5.0.4\n  - @smithy/node-http-handler@4.0.6\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/fetch-http-handler@5.0.3\n  - @smithy/node-http-handler@4.0.5\n\n## 4.2.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/fetch-http-handler@5.0.2\n  - @smithy/node-http-handler@4.0.4\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [54d2416]\n- Updated dependencies [fba050c]\n  - @smithy/node-http-handler@4.0.3\n\n## 4.1.1\n\n### Patch Changes\n\n- efedb20: handle case of empty upstream\n\n## 4.1.0\n\n### Minor Changes\n\n- d1d1f72: utility for buffering stream chunks\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [fbd06eb]\n  - @smithy/node-http-handler@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/fetch-http-handler@5.0.1\n  - @smithy/node-http-handler@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/fetch-http-handler@5.0.0\n  - @smithy/node-http-handler@4.0.0\n  - @smithy/util-buffer-from@4.0.0\n  - @smithy/util-base64@4.0.0\n  - @smithy/util-utf8@4.0.0\n  - @smithy/types@4.0.0\n  - @smithy/util-hex-encoding@4.0.0\n\n## 3.3.4\n\n### Patch Changes\n\n- Updated dependencies [1dd6ace]\n  - @smithy/fetch-http-handler@4.1.3\n\n## 3.3.3\n\n### Patch Changes\n\n- Updated dependencies [5e73108]\n  - @smithy/node-http-handler@3.3.3\n\n## 3.3.2\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n- Updated dependencies [f4e1a45]\n- Updated dependencies [a257792]\n  - @smithy/types@3.7.2\n  - @smithy/node-http-handler@3.3.2\n  - @smithy/fetch-http-handler@4.1.2\n\n## 3.3.1\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/fetch-http-handler@4.1.1\n  - @smithy/node-http-handler@3.3.1\n\n## 3.3.0\n\n### Minor Changes\n\n- cd1929b: vitest compatibility\n\n### Patch Changes\n\n- c8d257b: allow Blob in node.js splitStream\n- Updated dependencies [cd1929b]\n  - @smithy/fetch-http-handler@4.1.0\n  - @smithy/node-http-handler@3.3.0\n  - @smithy/types@3.7.0\n\n## 3.2.1\n\n### Patch Changes\n\n- ccdd49f: add bundler metadata for ChecksumStream file\n\n## 3.2.0\n\n### Minor Changes\n\n- f4e0bd9: create checksum stream adapter\n\n### Patch Changes\n\n- Updated dependencies [c257049]\n- Updated dependencies [84bec05]\n  - @smithy/fetch-http-handler@4.0.0\n  - @smithy/types@3.6.0\n  - @smithy/node-http-handler@3.2.5\n\n## 3.1.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/fetch-http-handler@3.2.9\n  - @smithy/node-http-handler@3.2.4\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [0d5ab1d]\n  - @smithy/fetch-http-handler@3.2.8\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [08fbedf]\n  - @smithy/node-http-handler@3.2.3\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/fetch-http-handler@3.2.7\n  - @smithy/node-http-handler@3.2.2\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/fetch-http-handler@3.2.6\n  - @smithy/types@3.4.1\n  - @smithy/node-http-handler@3.2.1\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [c86a02c]\n- Updated dependencies [5510e83]\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/node-http-handler@3.2.0\n  - @smithy/types@3.4.0\n  - @smithy/fetch-http-handler@3.2.5\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [3ea4789]\n  - @smithy/fetch-http-handler@3.2.4\n\n## 3.1.2\n\n### Patch Changes\n\n- @smithy/fetch-http-handler@3.2.3\n- @smithy/node-http-handler@3.1.4\n\n## 3.1.1\n\n### Patch Changes\n\n- 1cfe243: avoid compilation of global ReadableStream with type parameter\n\n## 3.1.0\n\n### Minor Changes\n\n- 7cd258f: add splitStream and headStream utilities\n\n### Patch Changes\n\n- @smithy/fetch-http-handler@3.2.2\n- @smithy/node-http-handler@3.1.3\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [f31cc5f]\n  - @smithy/fetch-http-handler@3.2.1\n  - @smithy/node-http-handler@3.1.2\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/fetch-http-handler@3.2.0\n  - @smithy/types@3.3.0\n  - @smithy/node-http-handler@3.1.1\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/node-http-handler@3.1.0\n  - @smithy/types@3.2.0\n  - @smithy/fetch-http-handler@3.1.0\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [fedce37]\n  - @smithy/fetch-http-handler@3.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/fetch-http-handler@3.0.2\n  - @smithy/node-http-handler@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [cc9fa00e]\n  - @smithy/fetch-http-handler@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Minor Changes\n\n- 3500f341: handle web streams in streamCollector and sdkStreamMixin\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [e76e736b]\n- Updated dependencies [3500f341]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/fetch-http-handler@3.0.0\n  - @smithy/node-http-handler@3.0.0\n  - @smithy/util-hex-encoding@3.0.0\n  - @smithy/util-buffer-from@3.0.0\n  - @smithy/util-base64@3.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/fetch-http-handler@2.5.0\n  - @smithy/node-http-handler@2.5.0\n  - @smithy/util-hex-encoding@2.2.0\n  - @smithy/util-buffer-from@2.2.0\n  - @smithy/util-base64@2.3.0\n  - @smithy/util-utf8@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [8e8f3513]\n- Updated dependencies [511206e5]\n  - @smithy/util-base64@2.2.1\n  - @smithy/node-http-handler@2.4.3\n  - @smithy/fetch-http-handler@2.4.5\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-base64@2.2.0\n  - @smithy/util-utf8@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/fetch-http-handler@2.4.4\n  - @smithy/node-http-handler@2.4.2\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/fetch-http-handler@2.4.3\n  - @smithy/node-http-handler@2.4.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/node-http-handler@2.4.0\n  - @smithy/types@2.10.0\n  - @smithy/fetch-http-handler@2.4.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/fetch-http-handler@2.4.1\n  - @smithy/node-http-handler@2.3.1\n  - @smithy/types@2.9.1\n  - @smithy/util-base64@2.1.1\n  - @smithy/util-buffer-from@2.1.1\n  - @smithy/util-hex-encoding@2.1.1\n  - @smithy/util-utf8@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/fetch-http-handler@2.4.0\n  - @smithy/node-http-handler@2.3.0\n  - @smithy/util-hex-encoding@2.1.0\n  - @smithy/util-buffer-from@2.1.0\n  - @smithy/util-base64@2.1.0\n  - @smithy/util-utf8@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.24\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/fetch-http-handler@2.3.2\n  - @smithy/node-http-handler@2.2.2\n\n## 2.0.23\n\n### Patch Changes\n\n- Updated dependencies [e2e3f7d5]\n  - @smithy/fetch-http-handler@2.3.1\n  - @smithy/node-http-handler@2.2.1\n\n## 2.0.22\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/fetch-http-handler@2.3.0\n  - @smithy/node-http-handler@2.2.0\n  - @smithy/types@2.7.0\n\n## 2.0.21\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/fetch-http-handler@2.2.7\n  - @smithy/node-http-handler@2.1.10\n\n## 2.0.20\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/fetch-http-handler@2.2.6\n  - @smithy/node-http-handler@2.1.9\n\n## 2.0.19\n\n### Patch Changes\n\n- Updated dependencies [f2a04b7e]\n  - @smithy/util-utf8@2.0.2\n\n## 2.0.18\n\n### Patch Changes\n\n- 5598a033: update bundler replacement directives in package.json\n- Updated dependencies [5598a033]\n  - @smithy/util-base64@2.0.1\n  - @smithy/util-utf8@2.0.1\n  - @smithy/fetch-http-handler@2.2.5\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/fetch-http-handler@2.2.4\n  - @smithy/node-http-handler@2.1.8\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [34b7f7b6]\n  - @smithy/fetch-http-handler@2.2.3\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/fetch-http-handler@2.2.2\n  - @smithy/node-http-handler@2.1.7\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [b411ffd1]\n  - @smithy/fetch-http-handler@2.2.1\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [4528c37d]\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/fetch-http-handler@2.2.0\n  - @smithy/types@2.3.4\n  - @smithy/node-http-handler@2.1.6\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/fetch-http-handler@2.1.5\n  - @smithy/node-http-handler@2.1.5\n\n## 2.0.11\n\n### Patch Changes\n\n- 99fc0b4c: util-stream api extraction added\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/fetch-http-handler@2.1.4\n  - @smithy/node-http-handler@2.1.4\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/fetch-http-handler@2.1.3\n  - @smithy/node-http-handler@2.1.3\n\n## 2.0.9\n\n### Patch Changes\n\n- d491b770: Add `HttpHandler` implementation for `util-stream.integ.spec.ts`\n\n## 2.0.8\n\n### Patch Changes\n\n- @smithy/fetch-http-handler@2.1.2\n- @smithy/node-http-handler@2.1.2\n\n## 2.0.7\n\n### Patch Changes\n\n- @smithy/fetch-http-handler@2.1.1\n- @smithy/node-http-handler@2.1.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/fetch-http-handler@2.1.0\n  - @smithy/node-http-handler@2.1.0\n\n## 2.0.5\n\n### Patch Changes\n\n- 1be3c4c9: Add integration tests\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/fetch-http-handler@2.0.5\n  - @smithy/node-http-handler@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/fetch-http-handler@2.0.4\n  - @smithy/node-http-handler@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/fetch-http-handler@2.0.3\n  - @smithy/node-http-handler@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/fetch-http-handler@2.0.2\n  - @smithy/node-http-handler@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/fetch-http-handler@2.0.1\n  - @smithy/node-http-handler@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/fetch-http-handler@2.0.0\n  - @smithy/node-http-handler@2.0.0\n  - @smithy/util-base64@2.0.0\n  - @smithy/util-buffer-from@2.0.0\n  - @smithy/util-hex-encoding@2.0.0\n  - @smithy/util-utf8@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/fetch-http-handler@1.1.0\n  - @smithy/node-http-handler@1.1.0\n  - @smithy/types@1.2.0\n  - @smithy/util-base64@1.1.0\n  - @smithy/util-buffer-from@1.1.0\n  - @smithy/util-hex-encoding@1.1.0\n  - @smithy/util-utf8@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- 99d00e98: Bump webpack to 5.76.0\n- Updated dependencies [99d00e98]\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/fetch-http-handler@1.0.3\n  - @smithy/types@2.0.0\n  - @smithy/node-http-handler@1.0.4\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/fetch-http-handler@1.0.2\n  - @smithy/node-http-handler@1.0.3\n  - @smithy/util-hex-encoding@1.0.2\n  - @smithy/util-buffer-from@1.0.2\n  - @smithy/util-base64@1.0.2\n  - @smithy/util-utf8@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- Updated dependencies [e051b157]\n  - @smithy/node-http-handler@1.0.2\n\n## 1.0.0\n\n### Patch Changes\n\n- Migrate util-stream, add collect-body-stream\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-stream](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-stream/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { Uint8ArrayBlobAdapter } from \"../../index\";\n\ndescribe(Uint8ArrayBlobAdapter.name, () => {\n  it(\"extends Uint8Array\", () => {\n    const blobby = Uint8ArrayBlobAdapter.mutate(new Uint8Array(5));\n\n    blobby[-1] = 8;\n    blobby[0] = 8;\n    blobby[1] = -1;\n    blobby[3] = 256;\n    blobby[4] = 8;\n    blobby[5] = 8;\n\n    // cannot use unallocated index left\n    expect(blobby[-1]).toEqual(undefined);\n    expect(blobby[0]).toEqual(8);\n    // downward overflow\n    expect(blobby[1]).toEqual(255);\n    // upward overflow\n    expect(blobby[3]).toEqual(0);\n    expect(blobby[4]).toEqual(8);\n    // cannot use unallocated index right\n    expect(blobby[5]).toEqual(undefined);\n\n    expect(blobby.length).toEqual(5);\n  });\n\n  it(\"should transform to string synchronously\", () => {\n    const blob = Uint8ArrayBlobAdapter.fromString(\"test-123\");\n    expect(blob.transformToString()).toEqual(\"test-123\");\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.ts",
    "content": "import type { Decoder, Encoder } from \"@smithy/types\";\n\n/**\n * Adapter for conversions of the native Uint8Array type.\n * @public\n */\nexport interface IUint8ArrayBlobAdapter extends Uint8Array {\n  /**\n   * @param encoding - default 'utf-8'.\n   * @returns the blob as string.\n   */\n  transformToString(encoding?: string): string;\n}\n\nexport interface Uint8ArrayBlobAdapterConstructor {\n  new (...args: any): IUint8ArrayBlobAdapter;\n  fromString(source: string, encoding?: string): IUint8ArrayBlobAdapter;\n  mutate(source: Uint8Array): IUint8ArrayBlobAdapter;\n}\n\nexport function bindUint8ArrayBlobAdapter(\n  toUtf8: Encoder,\n  fromUtf8: Decoder,\n  toBase64: Encoder,\n  fromBase64: Decoder\n): Uint8ArrayBlobAdapterConstructor {\n  return class Uint8ArrayBlobAdapter extends Uint8Array {\n    /**\n     * @param source - such as a string or Stream.\n     * @param encoding - utf-8 or base64.\n     * @returns a new Uint8ArrayBlobAdapter extending Uint8Array.\n     */\n    public static fromString(source: string, encoding = \"utf-8\"): Uint8ArrayBlobAdapter {\n      if (typeof source === \"string\") {\n        if (encoding === \"base64\") {\n          return Uint8ArrayBlobAdapter.mutate(fromBase64(source));\n        }\n        return Uint8ArrayBlobAdapter.mutate(fromUtf8(source));\n      }\n      throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);\n    }\n\n    /**\n     * @param source - Uint8Array to be mutated.\n     * @returns the same Uint8Array but with prototype switched to Uint8ArrayBlobAdapter.\n     */\n    public static mutate(source: Uint8Array): Uint8ArrayBlobAdapter {\n      Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);\n      return source as Uint8ArrayBlobAdapter;\n    }\n\n    public transformToString(encoding = \"utf-8\"): string {\n      if (encoding === \"base64\") {\n        return toBase64(this);\n      }\n      return toUtf8(this);\n    }\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/checksum/ChecksumStream.browser.ts",
    "content": "import type { Checksum, Encoder } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface ChecksumStreamInit {\n  /**\n   * Base64 value of the expected checksum.\n   */\n  expectedChecksum: string;\n  /**\n   * For error messaging, the location from which the checksum value was read.\n   */\n  checksumSourceLocation: string;\n  /**\n   * The checksum calculator.\n   */\n  checksum: Checksum;\n  /**\n   * The stream to be checked.\n   */\n  source: ReadableStream;\n\n  /**\n   * Optional base 64 encoder if calling from a request context.\n   */\n  base64Encoder?: Encoder;\n}\n\nconst ReadableStreamRef = typeof ReadableStream === \"function\" ? ReadableStream : function (): void {};\n\n/**\n * This stub exists so that the readable returned by createChecksumStream\n * identifies as \"ChecksumStream\" in alignment with the Node.js\n * implementation.\n *\n * @extends ReadableStream\n */\nexport class ChecksumStream extends (ReadableStreamRef as any) {}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/checksum/ChecksumStream.ts",
    "content": "import { Duplex, type Readable } from \"node:stream\";\nimport type { Checksum, Encoder } from \"@smithy/types\";\n\nimport { toBase64 } from \"../../util-base64/toBase64\";\n\n/**\n * @internal\n */\nexport interface ChecksumStreamInit<T extends Readable | ReadableStream> {\n  /**\n   * Base64 value of the expected checksum.\n   */\n  expectedChecksum: string;\n  /**\n   * For error messaging, the location from which the checksum value was read.\n   */\n  checksumSourceLocation: string;\n  /**\n   * The checksum calculator.\n   */\n  checksum: Checksum;\n  /**\n   * The stream to be checked.\n   */\n  source: T;\n\n  /**\n   * Optional base 64 encoder if calling from a request context.\n   */\n  base64Encoder?: Encoder;\n}\n\n/**\n * Wrapper for throwing checksum errors for streams without\n * buffering the stream.\n *\n * @internal\n */\nexport class ChecksumStream extends Duplex {\n  private expectedChecksum: string;\n  private checksumSourceLocation: string;\n  private checksum: Checksum;\n  private source?: Readable;\n  private base64Encoder: Encoder;\n  private pendingCallback: ((err?: Error) => void) | null = null;\n\n  public constructor({\n    expectedChecksum,\n    checksum,\n    source,\n    checksumSourceLocation,\n    base64Encoder,\n  }: ChecksumStreamInit<Readable>) {\n    super();\n    if (typeof (source as Readable).pipe === \"function\") {\n      this.source = source as Readable;\n    } else {\n      throw new Error(\n        `@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`\n      );\n    }\n\n    this.base64Encoder = base64Encoder ?? toBase64;\n    this.expectedChecksum = expectedChecksum;\n    this.checksum = checksum;\n    this.checksumSourceLocation = checksumSourceLocation;\n\n    // connect this stream to the end of the source stream.\n    this.source.pipe(this);\n  }\n\n  /**\n   * Do not call this directly.\n   * @internal\n   */\n  public _read(\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    size: number\n  ): void {\n    if (this.pendingCallback) {\n      const callback = this.pendingCallback;\n      this.pendingCallback = null;\n      callback();\n    }\n  }\n\n  /**\n   * When the upstream source flows data to this stream,\n   * calculate a step update of the checksum.\n   * Do not call this directly.\n   * @internal\n   */\n  public _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void): void {\n    try {\n      this.checksum.update(chunk);\n      const canPushMore = this.push(chunk);\n      if (!canPushMore) {\n        this.pendingCallback = callback;\n        return;\n      }\n    } catch (e: unknown) {\n      return callback(e as Error);\n    }\n    return callback();\n  }\n\n  /**\n   * When the upstream source finishes, perform the checksum comparison.\n   * Do not call this directly.\n   * @internal\n   */\n  public async _final(callback: (err?: Error) => void): Promise<void> {\n    try {\n      const digest: Uint8Array = await this.checksum.digest();\n      const received = this.base64Encoder(digest);\n      if (this.expectedChecksum !== received) {\n        return callback(\n          new Error(\n            `Checksum mismatch: expected \"${this.expectedChecksum}\" but received \"${received}\"` +\n              ` in response header \"${this.checksumSourceLocation}\".`\n          )\n        );\n      }\n    } catch (e: unknown) {\n      return callback(e as Error);\n    }\n    this.push(null);\n    return callback();\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/checksum/createChecksumStream.browser.spec.ts",
    "content": "import type { Checksum } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { toBase64 } from \"../../util-base64/toBase64\";\nimport { toUtf8 } from \"../../util-utf8/toUtf8\";\nimport { headStream } from \"../headStream.browser\";\nimport { ChecksumStream as ChecksumStreamWeb } from \"./ChecksumStream.browser\";\nimport { createChecksumStream } from \"./createChecksumStream.browser\";\n\n(typeof ReadableStream === \"function\" && process.version >= \"v18\" ? describe : describe.skip)(\n  \"Checksum streams\",\n  () => {\n    /**\n     * Hash \"algorithm\" that appends all data together.\n     */\n    class Appender implements Checksum {\n      public hash = \"\";\n      async digest(): Promise<Uint8Array> {\n        return Buffer.from(this.hash);\n      }\n      reset(): void {\n        throw new Error(\"Function not implemented.\");\n      }\n      update(chunk: Uint8Array): void {\n        this.hash += toUtf8(chunk);\n      }\n    }\n\n    const canonicalData = new Uint8Array(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((_) => _.charCodeAt(0)));\n\n    const canonicalUtf8 = toUtf8(canonicalData);\n    const canonicalBase64 = toBase64(canonicalUtf8);\n\n    describe(createChecksumStream.name + \" webstreams API\", () => {\n      if (typeof ReadableStream !== \"function\") {\n        // test not applicable to Node.js 16.\n        return;\n      }\n\n      const makeStream = () => {\n        return new ReadableStream({\n          start(controller) {\n            canonicalData.forEach((byte) => {\n              controller.enqueue(new Uint8Array([byte]));\n            });\n            controller.close();\n          },\n        });\n      };\n\n      it(\"should extend a ReadableStream\", async () => {\n        const stream = makeStream();\n        const checksumStream = createChecksumStream({\n          expectedChecksum: canonicalBase64,\n          checksum: new Appender(),\n          checksumSourceLocation: \"my-header\",\n          source: stream,\n        });\n\n        expect(checksumStream).toBeInstanceOf(ReadableStream);\n        expect(checksumStream).toBeInstanceOf(ChecksumStreamWeb);\n\n        const collected = toUtf8(await headStream(checksumStream, Infinity));\n        expect(collected).toEqual(canonicalUtf8);\n        expect(stream.locked).toEqual(true);\n\n        // expectation is that it is resolved.\n        expect(await checksumStream.getReader().closed);\n      });\n\n      it(\"should throw during stream read if the checksum does not match\", async () => {\n        const stream = makeStream();\n        const checksumStream = createChecksumStream({\n          expectedChecksum: \"different-expected-checksum\",\n          checksum: new Appender(),\n          checksumSourceLocation: \"my-header\",\n          source: stream,\n        });\n\n        try {\n          toUtf8(await headStream(checksumStream, Infinity));\n          throw new Error(\"stream was read successfully\");\n        } catch (e: unknown) {\n          expect(String(e)).toEqual(\n            `Error: Checksum mismatch: expected \"different-expected-checksum\" but` +\n              ` received \"${canonicalBase64}\"` +\n              ` in response header \"my-header\".`\n          );\n        }\n      });\n    });\n  }\n);\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/checksum/createChecksumStream.browser.ts",
    "content": "import { toBase64 } from \"../../util-base64/toBase64.browser\";\nimport { isReadableStream } from \"../stream-type-check\";\nimport { ChecksumStream, type ChecksumStreamInit } from \"./ChecksumStream.browser\";\n\n/**\n * Alias prevents compiler from turning\n * ReadableStream into ReadableStream<any>, which is incompatible\n * with the NodeJS.ReadableStream global type.\n * @internal\n */\nexport type ReadableStreamType = ReadableStream;\n\n/**\n * This is a local copy of\n * https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController\n * in case users do not have this type.\n */\ninterface TransformStreamDefaultController {\n  enqueue(chunk: any): void;\n  error(error: unknown): void;\n  terminate(): void;\n}\n\n/**\n * Creates a stream adapter for throwing checksum errors for streams without\n * buffering the stream.\n * @internal\n */\nexport const createChecksumStream = ({\n  expectedChecksum,\n  checksum,\n  source,\n  checksumSourceLocation,\n  base64Encoder,\n}: ChecksumStreamInit): ReadableStreamType => {\n  if (!isReadableStream(source)) {\n    throw new Error(\n      `@smithy/util-stream: unsupported source type ${(source as any)?.constructor?.name ?? source} in ChecksumStream.`\n    );\n  }\n\n  const encoder = base64Encoder ?? toBase64;\n\n  if (typeof TransformStream !== \"function\") {\n    throw new Error(\n      \"@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.\"\n    );\n  }\n\n  const transform = new TransformStream({\n    start() {},\n    async transform(chunk: any, controller: TransformStreamDefaultController) {\n      /**\n       * When the upstream source flows data to this stream,\n       * calculate a step update of the checksum.\n       */\n      checksum.update(chunk);\n      controller.enqueue(chunk);\n    },\n    async flush(controller: TransformStreamDefaultController) {\n      const digest: Uint8Array = await checksum.digest();\n      const received = encoder(digest);\n\n      if (expectedChecksum !== received) {\n        const error = new Error(\n          `Checksum mismatch: expected \"${expectedChecksum}\" but received \"${received}\"` +\n            ` in response header \"${checksumSourceLocation}\".`\n        );\n        controller.error(error);\n      } else {\n        controller.terminate();\n      }\n    },\n  });\n\n  source.pipeThrough(transform);\n  const readable = transform.readable;\n  Object.setPrototypeOf(readable, ChecksumStream.prototype);\n  return readable;\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/checksum/createChecksumStream.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport type { Checksum } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { toBase64 } from \"../../util-base64/toBase64\";\nimport { toUtf8 } from \"../../util-utf8/toUtf8\";\nimport { headStream } from \"../headStream\";\nimport { ChecksumStream } from \"./ChecksumStream\";\nimport { ChecksumStream as ChecksumStreamWeb } from \"./ChecksumStream.browser\";\nimport { createChecksumStream } from \"./createChecksumStream\";\n\ndescribe(\"Checksum streams\", () => {\n  /**\n   * Hash \"algorithm\" that appends all data together.\n   */\n  class Appender implements Checksum {\n    public hash = \"\";\n    async digest(): Promise<Uint8Array> {\n      return Buffer.from(this.hash);\n    }\n    reset(): void {\n      throw new Error(\"Function not implemented.\");\n    }\n    update(chunk: Uint8Array): void {\n      this.hash += toUtf8(chunk);\n    }\n  }\n\n  const canonicalData = new Uint8Array(\"abcdefghijklmnopqrstuvwxyz\".split(\"\").map((_) => _.charCodeAt(0)));\n\n  const canonicalUtf8 = toUtf8(canonicalData);\n  const canonicalBase64 = toBase64(canonicalUtf8);\n\n  describe(createChecksumStream.name, () => {\n    const makeStream = () => {\n      return Readable.from(Buffer.from(canonicalData.buffer, 0, 26));\n    };\n\n    it(\"should extend a Readable stream\", async () => {\n      const stream = makeStream();\n      const checksumStream = createChecksumStream({\n        expectedChecksum: canonicalBase64,\n        checksum: new Appender(),\n        checksumSourceLocation: \"my-header\",\n        source: stream,\n      });\n\n      expect(checksumStream).toBeInstanceOf(Readable);\n      expect(checksumStream).toBeInstanceOf(ChecksumStream);\n\n      const collected = toUtf8(await headStream(checksumStream, Infinity));\n      expect(collected).toEqual(canonicalUtf8);\n      expect(stream.readableEnded).toEqual(true);\n      expect(checksumStream.readableEnded).toEqual(true);\n    });\n\n    it(\"should throw during stream read if the checksum does not match\", async () => {\n      const stream = makeStream();\n      const checksumStream = createChecksumStream({\n        expectedChecksum: \"different-expected-checksum\",\n        checksum: new Appender(),\n        checksumSourceLocation: \"my-header\",\n        source: stream,\n      });\n\n      try {\n        toUtf8(await headStream(checksumStream, Infinity));\n        throw new Error(\"stream was read successfully\");\n      } catch (e: unknown) {\n        expect(String(e)).toEqual(\n          `Error: Checksum mismatch: expected \"different-expected-checksum\" but` +\n            ` received \"${canonicalBase64}\"` +\n            ` in response header \"my-header\".`\n        );\n      }\n    });\n\n    it(\"should handle backpressure\", async () => {\n      // for Node.js 22+ increased default highwater mark.\n      Readable.setDefaultHighWaterMark(false, 16_384);\n      let originalStreamBuffered = 0;\n      const stream = Readable.from(\n        {\n          async *[Symbol.asyncIterator]() {\n            for (let i = 0; i < 100; ++i) {\n              const chunk = new Uint8Array(16_384);\n              originalStreamBuffered += chunk.byteLength;\n              yield chunk;\n            }\n          },\n        },\n        {\n          highWaterMark: 1,\n        }\n      );\n      const checksumStream = createChecksumStream({\n        expectedChecksum: toBase64(new Uint8Array()),\n        checksum: {\n          async digest() {\n            return new Uint8Array();\n          },\n          update: () => {},\n          reset: () => {},\n        },\n        checksumSourceLocation: \"my-header\",\n        source: stream,\n      });\n\n      const ait = checksumStream[Symbol.asyncIterator]();\n\n      const c1 = await ait.next();\n      expect(c1.done).toBe(false);\n      expect(c1.value.byteLength).toEqual(16_384);\n      expect(originalStreamBuffered).toBeLessThanOrEqual(16_384 * 2);\n\n      await new Promise((r) => setTimeout(r, 200));\n      expect(originalStreamBuffered).toBeLessThanOrEqual(16_384 * 3);\n\n      const c2 = await ait.next();\n      expect(c2.done).toBe(false);\n      expect(c2.value.byteLength).toEqual(16_384);\n      expect(originalStreamBuffered).toBeLessThanOrEqual(16_384 * 4);\n\n      await new Promise((r) => setTimeout(r, 200));\n      expect(originalStreamBuffered).toBeLessThanOrEqual(16_384 * 4);\n\n      await new Promise((r) => setTimeout(r, 200));\n      expect(originalStreamBuffered).toBeLessThanOrEqual(16_384 * 4);\n\n      // the stream yields at the rate at which we read it.\n      let i = 5;\n      while (true) {\n        const { done } = await ait.next();\n        await new Promise((r) => setTimeout(r, 5));\n        expect(originalStreamBuffered).toBeLessThanOrEqual(16_384 * i++);\n        if (done) {\n          break;\n        }\n      }\n\n      expect(originalStreamBuffered).toEqual(16_384 * 100);\n    });\n  });\n\n  describe(createChecksumStream.name + \" webstreams API\", () => {\n    if (typeof ReadableStream !== \"function\") {\n      it.skip(\"Skipped when ReadableStream is not globally available.\", () => {});\n      // test not applicable to Node.js 16.\n      return;\n    }\n\n    const makeStream = () => {\n      return new ReadableStream({\n        start(controller) {\n          canonicalData.forEach((byte) => {\n            controller.enqueue(new Uint8Array([byte]));\n          });\n          controller.close();\n        },\n      });\n    };\n\n    it(\"should extend a ReadableStream\", async () => {\n      const stream = makeStream();\n      const checksumStream = createChecksumStream({\n        expectedChecksum: canonicalBase64,\n        checksum: new Appender(),\n        checksumSourceLocation: \"my-header\",\n        source: stream,\n      });\n\n      expect(checksumStream).toBeInstanceOf(ReadableStream);\n      expect(checksumStream).toBeInstanceOf(ChecksumStreamWeb);\n\n      const collected = toUtf8(await headStream(checksumStream, Infinity));\n      expect(collected).toEqual(canonicalUtf8);\n      expect(stream.locked).toEqual(true);\n\n      // expectation is that it is resolved.\n      expect(await checksumStream.getReader().closed);\n    });\n\n    it(\"should throw during stream read if the checksum does not match\", async () => {\n      const stream = makeStream();\n      const checksumStream = createChecksumStream({\n        expectedChecksum: \"different-expected-checksum\",\n        checksum: new Appender(),\n        checksumSourceLocation: \"my-header\",\n        source: stream,\n      });\n\n      try {\n        toUtf8(await headStream(checksumStream, Infinity));\n        throw new Error(\"stream was read successfully\");\n      } catch (e: unknown) {\n        expect(String(e)).toEqual(\n          `Error: Checksum mismatch: expected \"different-expected-checksum\" but` +\n            ` received \"${canonicalBase64}\"` +\n            ` in response header \"my-header\".`\n        );\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/checksum/createChecksumStream.ts",
    "content": "import type { Readable } from \"node:stream\";\n\nimport { isReadableStream } from \"../stream-type-check\";\nimport { ChecksumStream, type ChecksumStreamInit } from \"./ChecksumStream\";\nimport {\n  createChecksumStream as createChecksumStreamWeb,\n  type ReadableStreamType,\n} from \"./createChecksumStream.browser\";\n\n/**\n * Creates a stream mirroring the input stream's interface, but\n * performs checksumming when reading to the end of the stream.\n * @internal\n */\nexport function createChecksumStream(init: ChecksumStreamInit<ReadableStreamType>): ReadableStreamType;\n/**\n * @internal\n */\nexport function createChecksumStream(init: ChecksumStreamInit<Readable>): Readable;\n/**\n * @internal\n */\nexport function createChecksumStream(\n  init: ChecksumStreamInit<Readable | ReadableStreamType>\n): Readable | ReadableStreamType {\n  if (typeof ReadableStream === \"function\" && isReadableStream(init.source)) {\n    return createChecksumStreamWeb(init as ChecksumStreamInit<ReadableStreamType>);\n  }\n  return new ChecksumStream(init as ChecksumStreamInit<Readable>);\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/createBufferedReadable.browser.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { createBufferedReadableStream } from \"./createBufferedReadable.browser\";\nimport { headStream } from \"./headStream\";\n\ndescribe(\"Buffered ReadableStream\", () => {\n  function stringStream(size: number, chunkSize: number) {\n    async function* generate() {\n      while (size > 0) {\n        yield \"a\".repeat(chunkSize);\n        size -= chunkSize;\n      }\n    }\n    return Readable.toWeb(Readable.from(generate()));\n  }\n  function byteStream(size: number, chunkSize: number) {\n    async function* generate() {\n      while (size > 0) {\n        yield new Uint8Array(chunkSize);\n        size -= chunkSize;\n      }\n    }\n    return Readable.toWeb(Readable.from(generate()));\n  }\n  function patternedByteStream(size: number, chunkSize: number) {\n    let n = 0;\n    const data = Array(size);\n    for (let i = 0; i < size; ++i) {\n      data[i] = n++ % 255;\n    }\n    let dataCursor = 0;\n\n    async function* generate() {\n      while (size > 0) {\n        const z = Math.min(size, chunkSize);\n        const bytes = new Uint8Array(data.slice(dataCursor, dataCursor + z));\n        size -= z;\n        dataCursor += z;\n        yield bytes;\n      }\n    }\n    return {\n      stream: Readable.toWeb(Readable.from(size === 0 ? Buffer.from(\"\") : generate())) as unknown as ReadableStream,\n      array: new Uint8Array(data),\n    };\n  }\n  const logger = {\n    debug: vi.fn(),\n    info: vi.fn(),\n    warn: vi.fn(),\n    error() {},\n  };\n\n  it(\"should join upstream chunks if they are too small (stringStream)\", async () => {\n    let upstreamChunkCount = 0;\n    let downstreamChunkCount = 0;\n\n    const upstream = stringStream(1024, 8);\n    const upstreamReader = upstream.getReader();\n\n    const midstream = new ReadableStream({\n      async pull(controller) {\n        const { value, done } = await upstreamReader.read();\n        if (done) {\n          controller.close();\n        } else {\n          expect(value.length).toBe(8);\n          upstreamChunkCount += 1;\n          controller.enqueue(value);\n        }\n      },\n    });\n    const downstream = createBufferedReadableStream(midstream, 64);\n    const reader = downstream.getReader();\n\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) {\n        break;\n      } else {\n        downstreamChunkCount += 1;\n        expect(value.length).toBe(64);\n      }\n    }\n\n    expect(upstreamChunkCount).toEqual(128);\n    expect(downstreamChunkCount).toEqual(16);\n  });\n\n  it(\"should join upstream chunks if they are too small (byteStream)\", async () => {\n    let upstreamChunkCount = 0;\n    let downstreamChunkCount = 0;\n\n    const upstream = byteStream(1031, 7);\n    const upstreamReader = upstream.getReader();\n\n    const midstream = new ReadableStream({\n      async pull(controller) {\n        const { value, done } = await upstreamReader.read();\n        if (done) {\n          controller.close();\n        } else {\n          expect(value.length).toBe(7);\n          upstreamChunkCount += 1;\n          controller.enqueue(value);\n        }\n      },\n    });\n    const downstream = createBufferedReadableStream(midstream, 49, logger);\n    const downstreamReader = downstream.getReader();\n\n    while (true) {\n      const { done, value } = await downstreamReader.read();\n      if (done) {\n        break;\n      } else {\n        downstreamChunkCount += 1;\n        if (value.byteLength > 7) {\n          expect(value.byteLength).toBe(49);\n        }\n      }\n    }\n\n    expect(upstreamChunkCount).toEqual(148);\n    expect(downstreamChunkCount).toEqual(22);\n    expect(logger.warn).toHaveBeenCalled();\n  });\n\n  const dataSizes = [0, 10, 101, 1_001, 10_001, 100_001];\n  const chunkSizes = [1, 8, 16, 32, 64, 128, 1024, 8 * 1024, 64 * 1024, 1024 * 1024];\n  const bufferSizes = [0, 1024, 8 * 1024, 32 * 1024, 64 * 1024, 1024 * 1024];\n\n  for (const dataSize of dataSizes) {\n    for (const chunkSize of chunkSizes) {\n      for (const bufferSize of bufferSizes) {\n        it(`should maintain data integrity for data=${dataSize} chunk=${chunkSize} min-buffer=${bufferSize}`, async () => {\n          const { stream, array } = patternedByteStream(dataSize, chunkSize);\n          const bufferedStream = createBufferedReadableStream(stream, bufferSize);\n          const collected = await headStream(bufferedStream, Infinity);\n          expect(collected).toEqual(array);\n        });\n      }\n    }\n  }\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/createBufferedReadable.browser.ts",
    "content": "import type { Logger } from \"@smithy/types\";\n\nimport { ByteArrayCollector } from \"./ByteArrayCollector\";\n\nexport type BufferStore = [string, ByteArrayCollector, ByteArrayCollector?];\nexport type BufferUnion = string | Uint8Array;\nexport type Modes = 0 | 1 | 2;\n\n/**\n * the minimum size is met, except for the last chunk.\n *\n * @internal\n * @param upstream - any ReadableStream.\n * @param size - byte or character length minimum. Buffering occurs when a chunk fails to meet this value.\n * @param logger - for emitting warnings when buffering occurs.\n * @returns another stream of the same data, but buffers chunks until\n */\nexport function createBufferedReadableStream(upstream: ReadableStream, size: number, logger?: Logger): ReadableStream {\n  const reader = upstream.getReader();\n  let streamBufferingLoggedWarning = false;\n  let bytesSeen = 0;\n\n  const buffers = [\"\", new ByteArrayCollector((size) => new Uint8Array(size))] as BufferStore;\n  let mode: Modes | -1 = -1;\n\n  const pull = async (controller: { enqueue(chunk: any): void; close(): void }) => {\n    const { value, done } = await reader.read();\n    const chunk = value;\n\n    if (done) {\n      if (mode !== -1) {\n        const remainder = flush(buffers, mode);\n        if (sizeOf(remainder) > 0) {\n          controller.enqueue(remainder);\n        }\n      }\n      controller.close();\n    } else {\n      const chunkMode = modeOf(chunk, false);\n      if (mode !== chunkMode) {\n        if (mode >= 0) {\n          controller.enqueue(flush(buffers, mode));\n        }\n        mode = chunkMode;\n      }\n      if (mode === -1) {\n        controller.enqueue(chunk);\n        return;\n      }\n\n      const chunkSize = sizeOf(chunk);\n      bytesSeen += chunkSize;\n      const bufferSize = sizeOf(buffers[mode]);\n      if (chunkSize >= size && bufferSize === 0) {\n        // skip writing to the intermediate buffer\n        // because the upstream chunk is already large enough.\n        controller.enqueue(chunk);\n      } else {\n        // buffer and potentially flush the data downstream.\n        const newSize = merge(buffers, mode, chunk);\n        if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {\n          streamBufferingLoggedWarning = true;\n          logger?.warn(\n            `@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`\n          );\n        }\n        if (newSize >= size) {\n          controller.enqueue(flush(buffers, mode));\n        } else {\n          // repeat the pull because a call to pull must enqueue\n          // something but this call did not enqueue anything.\n          await pull(controller);\n        }\n      }\n    }\n  };\n\n  return new ReadableStream({\n    pull,\n  });\n}\n\n/**\n * Replaces R/RS polymorphic implementation in environments with only ReadableStream.\n * @internal\n */\nexport const createBufferedReadable = createBufferedReadableStream;\n\n/**\n * @internal\n * @param buffers\n * @param mode\n * @param chunk\n * @returns the new buffer size after merging the chunk with its appropriate buffer.\n */\nexport function merge(buffers: BufferStore, mode: Modes, chunk: string | Uint8Array): number {\n  switch (mode) {\n    case 0:\n      buffers[0] += chunk;\n      return sizeOf(buffers[0]);\n    case 1:\n    case 2:\n      buffers[mode]!.push(chunk as Uint8Array);\n      return sizeOf(buffers[mode]);\n  }\n}\n\n/**\n * @internal\n * @param buffers\n * @param mode\n * @returns the buffer matching the mode.\n */\nexport function flush(buffers: BufferStore, mode: Modes | -1): BufferUnion {\n  switch (mode) {\n    case 0:\n      const s = buffers[0];\n      buffers[0] = \"\";\n      return s;\n    case 1:\n    case 2:\n      return buffers[mode]!.flush();\n  }\n  throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);\n}\n\n/**\n * @internal\n * @param chunk\n * @returns size of the chunk in bytes or characters.\n */\nexport function sizeOf(chunk?: { byteLength?: number; length?: number }): number {\n  return (chunk as Uint8Array)?.byteLength ?? chunk?.length ?? 0;\n}\n\n/**\n * @internal\n * @param chunk - from upstream Readable.\n * @param allowBuffer - allow mode 2 (Buffer), otherwise Buffer will return mode 1.\n * @returns type index of the chunk.\n */\nexport function modeOf(chunk: BufferUnion, allowBuffer = true): Modes | -1 {\n  if (allowBuffer && typeof Buffer !== \"undefined\" && chunk instanceof Buffer) {\n    return 2;\n  }\n  if (chunk instanceof Uint8Array) {\n    return 1;\n  }\n  if (typeof chunk === \"string\") {\n    return 0;\n  }\n  return -1;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/createBufferedReadable.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { createBufferedReadable } from \"./createBufferedReadable\";\nimport { headStream } from \"./headStream\";\n\ndescribe(\"Buffered Readable stream\", () => {\n  function stringStream(size: number, chunkSize: number) {\n    async function* generate() {\n      while (size > 0) {\n        yield \"a\".repeat(chunkSize);\n        size -= chunkSize;\n      }\n    }\n    return Readable.from(generate());\n  }\n  function byteStream(size: number, chunkSize: number) {\n    async function* generate() {\n      while (size > 0) {\n        yield Buffer.from(new Uint8Array(chunkSize));\n        size -= chunkSize;\n      }\n    }\n    return Readable.from(generate());\n  }\n\n  function patternedByteStream(size: number, chunkSize: number) {\n    let n = 0;\n    const data = Array(size);\n    for (let i = 0; i < size; ++i) {\n      data[i] = n++ % 255;\n    }\n    let dataCursor = 0;\n\n    async function* generate() {\n      while (size > 0) {\n        const z = Math.min(size, chunkSize);\n        const bytes = new Uint8Array(data.slice(dataCursor, dataCursor + z));\n        size -= z;\n        dataCursor += z;\n        yield bytes;\n      }\n    }\n    return {\n      stream: Readable.from(size === 0 ? Buffer.from(\"\") : generate()),\n      array: new Uint8Array(data),\n    };\n  }\n\n  const logger = {\n    debug: vi.fn(),\n    info: vi.fn(),\n    warn: vi.fn(),\n    error() {},\n  };\n\n  const KB = 1024;\n\n  const dataSizes = [0, 10, 101, 1_001, 10_001, 100_001];\n  const chunkSizes = [1, 8, 16, 32, 64, 128, 1024, 8 * 1024, 64 * 1024, 1024 * 1024];\n  const bufferSizes = [0, 1024, 8 * 1024, 32 * 1024, 64 * 1024, 1024 * 1024];\n\n  for (const dataSize of dataSizes) {\n    for (const chunkSize of chunkSizes) {\n      for (const bufferSize of bufferSizes) {\n        it(`should maintain data integrity for data=${dataSize} chunk=${chunkSize} min-buffer=${bufferSize}`, async () => {\n          const { stream, array } = patternedByteStream(dataSize, chunkSize);\n          const bufferedStream = createBufferedReadable(stream, bufferSize);\n          const collected = await headStream(bufferedStream, Infinity);\n          expect(collected).toEqual(array);\n        });\n      }\n    }\n  }\n\n  for (const [dataSize, chunkSize, bufferSize] of [\n    [10 * KB, 1 * KB, 0 * KB],\n    [10 * KB, 1 * KB, 1 * KB],\n    [10 * KB, 1 * KB, 2.1 * KB],\n    [10 * KB, 1 * KB, 4 * KB],\n    [10 * KB, 2 * KB, 1 * KB],\n  ]) {\n    it(`should maintain data integrity for data=${dataSize} chunk=${chunkSize} min-buffer=${bufferSize}`, async () => {\n      const { stream, array } = patternedByteStream(dataSize, chunkSize);\n      const bufferedStream = createBufferedReadable(stream, bufferSize);\n      const collected = await headStream(bufferedStream, Infinity);\n      expect(collected).toEqual(array);\n    });\n  }\n\n  it(\"should join upstream chunks if they are too small (stringStream)\", async () => {\n    const upstream = stringStream(1024, 8);\n    const downstream = createBufferedReadable(upstream, 64);\n\n    let upstreamChunkCount = 0;\n    upstream.on(\"data\", () => {\n      upstreamChunkCount += 1;\n    });\n\n    let downstreamChunkCount = 0;\n    downstream.on(\"data\", () => {\n      downstreamChunkCount += 1;\n    });\n\n    await headStream(downstream, Infinity);\n\n    expect(upstreamChunkCount).toEqual(128);\n    expect(downstreamChunkCount).toEqual(16);\n  });\n\n  it(\"should join upstream chunks if they are too small (byteStream)\", async () => {\n    const upstream = byteStream(1031, 7);\n    const downstream = createBufferedReadable(upstream, 49, logger);\n\n    let upstreamChunkCount = 0;\n    upstream.on(\"data\", () => {\n      upstreamChunkCount += 1;\n    });\n\n    let downstreamChunkCount = 0;\n    downstream.on(\"data\", () => {\n      downstreamChunkCount += 1;\n    });\n\n    await headStream(downstream, Infinity);\n\n    expect(Math.ceil(1031 / 7)).toBe(148);\n    expect(Math.ceil(1031 / 49)).toBe(22);\n\n    expect(upstreamChunkCount).toEqual(148);\n    expect(downstreamChunkCount).toEqual(22);\n    expect(logger.warn).toHaveBeenCalled();\n  });\n}, 30_000);\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/createBufferedReadable.ts",
    "content": "import { Readable } from \"node:stream\";\nimport type { Logger } from \"@smithy/types\";\n\nimport { ByteArrayCollector } from \"./ByteArrayCollector\";\nimport {\n  createBufferedReadableStream,\n  flush,\n  merge,\n  modeOf,\n  sizeOf,\n  type BufferStore,\n  type Modes,\n} from \"./createBufferedReadable.browser\";\nimport { isReadableStream } from \"./stream-type-check\";\n\n/**\n * the minimum size is met, except for the last chunk.\n *\n * @internal\n * @param upstream - any Readable or ReadableStream.\n * @param size - byte or character length minimum. Buffering occurs when a chunk fails to meet this value.\n * @param logger - for emitting warnings when buffering occurs.\n * @returns another stream of the same data and stream class, but buffers chunks until\n */\nexport function createBufferedReadable(upstream: Readable, size: number, logger?: Logger): Readable;\n/**\n * @internal\n */\nexport function createBufferedReadable(upstream: ReadableStream, size: number, logger?: Logger): ReadableStream;\n/**\n * @internal\n */\nexport function createBufferedReadable(\n  upstream: Readable | ReadableStream,\n  size: number,\n  logger?: Logger\n): Readable | ReadableStream {\n  if (isReadableStream(upstream)) {\n    return createBufferedReadableStream(upstream, size, logger);\n  }\n  const downstream = new Readable({ read() {} });\n  let streamBufferingLoggedWarning = false;\n  let bytesSeen = 0;\n\n  const buffers = [\n    \"\",\n    new ByteArrayCollector((size) => new Uint8Array(size)),\n    new ByteArrayCollector((size) => Buffer.from(new Uint8Array(size))),\n  ] as BufferStore;\n  let mode: Modes | -1 = -1;\n\n  upstream.on(\"data\", (chunk) => {\n    const chunkMode = modeOf(chunk, true);\n    if (mode !== chunkMode) {\n      if (mode >= 0) {\n        downstream.push(flush(buffers, mode));\n      }\n      mode = chunkMode;\n    }\n    if (mode === -1) {\n      downstream.push(chunk);\n      return;\n    }\n\n    const chunkSize = sizeOf(chunk);\n    bytesSeen += chunkSize;\n    const bufferSize = sizeOf(buffers[mode]);\n    if (chunkSize >= size && bufferSize === 0) {\n      // skip writing to the intermediate buffer\n      // because the upstream chunk is already large enough.\n      downstream.push(chunk);\n    } else {\n      // buffer and potentially flush the data downstream.\n      const newSize = merge(buffers, mode, chunk);\n      if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {\n        streamBufferingLoggedWarning = true;\n        logger?.warn(\n          `@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`\n        );\n      }\n      if (newSize >= size) {\n        downstream.push(flush(buffers, mode));\n      }\n    }\n  });\n  upstream.on(\"end\", () => {\n    if (mode !== -1) {\n      const remainder = flush(buffers, mode);\n      if (sizeOf(remainder) > 0) {\n        downstream.push(remainder);\n      }\n    }\n    downstream.push(null);\n  });\n\n  return downstream;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { getAwsChunkedEncodingStream as getAwsChunkedEncodingStreamRs } from \"./getAwsChunkedEncodingStream\";\nimport { getAwsChunkedEncodingStream } from \"./getAwsChunkedEncodingStream.browser\";\n\ndescribe(getAwsChunkedEncodingStream.name, () => {\n  const mockChecksum = \"mockChecksum\";\n  const mockRawChecksum = Buffer.from(mockChecksum);\n  const mockStreamChunks = [\"Hello\", \"World\"];\n  const mockBodyLength = 5;\n\n  const mockBase64Encoder = () => mockChecksum;\n  const mockBodyLengthChecker = () => mockBodyLength;\n  const mockChecksumAlgorithmFn = () => {};\n  const mockChecksumLocationName = \"mockChecksumLocationName\";\n  const mockStreamHasher = () => mockRawChecksum;\n\n  const mockOptions: any = {\n    base64Encoder: mockBase64Encoder,\n    bodyLengthChecker: mockBodyLengthChecker,\n    checksumAlgorithmFn: mockChecksumAlgorithmFn,\n    checksumLocationName: mockChecksumLocationName,\n    streamHasher: mockStreamHasher,\n  };\n\n  const getMockReadableStream = () => {\n    return new ReadableStream({\n      start(controller) {\n        for (const chunk of mockStreamChunks) {\n          controller.enqueue(chunk);\n        }\n        controller.close();\n      },\n    });\n  };\n\n  const validateStream = async (readableStream: ReadableStream, expectedBuffer: string) => {\n    let buffer = \"\";\n    const reader = readableStream.getReader();\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) {\n        break;\n      }\n      buffer += value;\n    }\n    reader.releaseLock();\n    expect(buffer).toEqual(expectedBuffer);\n  };\n\n  describe(\"skips checksum computation\", () => {\n    const expectedBuffer = `5\\r\nHello\\r\n5\\r\nWorld\\r\n0\\r\n`;\n\n    it(\"if none of the required options are passed\", async () => {\n      const readableStream = getMockReadableStream();\n      const awsChunkedBody = getAwsChunkedEncodingStream(readableStream, {\n        bodyLengthChecker: mockBodyLengthChecker,\n      });\n      await validateStream(awsChunkedBody, expectedBuffer);\n    });\n\n    [\"base64Encoder\", \"checksumAlgorithmFn\", \"checksumLocationName\", \"streamHasher\"].forEach((optionToRemove) => {\n      it(`if option '${optionToRemove} is not passed`, async () => {\n        const readableStream = getMockReadableStream();\n        const awsChunkedBody = getAwsChunkedEncodingStream(readableStream, {\n          ...mockOptions,\n          [optionToRemove]: undefined,\n        });\n        await validateStream(awsChunkedBody, expectedBuffer);\n      });\n    });\n  });\n\n  it(\"computes checksum and adds it to the end event\", async () => {\n    const readableStream = getMockReadableStream();\n    const awsChunkedBody = getAwsChunkedEncodingStream(readableStream, mockOptions);\n    const expectedBuffer = `5\\r\nHello\\r\n5\\r\nWorld\\r\n0\\r\n${mockChecksumLocationName}:${mockChecksum}\\r\n\\r\n`;\n    await validateStream(awsChunkedBody, expectedBuffer);\n  });\n\n  it(\"redirects from Readable to ReadableStream implementation\", async () => {\n    const readableStream = getMockReadableStream();\n    const awsChunkedBody = getAwsChunkedEncodingStreamRs(readableStream, mockOptions);\n    const expectedBuffer = `5\\r\nHello\\r\n5\\r\nWorld\\r\n0\\r\n${mockChecksumLocationName}:${mockChecksum}\\r\n\\r\n`;\n    await validateStream(awsChunkedBody, expectedBuffer);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.ts",
    "content": "import type { GetAwsChunkedEncodingStream, GetAwsChunkedEncodingStreamOptions } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const getAwsChunkedEncodingStream: GetAwsChunkedEncodingStream<ReadableStream> = (\n  readableStream: ReadableStream,\n  options: GetAwsChunkedEncodingStreamOptions\n) => {\n  const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;\n\n  const checksumRequired =\n    base64Encoder !== undefined &&\n    bodyLengthChecker !== undefined &&\n    checksumAlgorithmFn !== undefined &&\n    checksumLocationName !== undefined &&\n    streamHasher !== undefined;\n  const digest = checksumRequired ? streamHasher!(checksumAlgorithmFn!, readableStream) : undefined;\n\n  // ToDo: Validate the ReadableStream and getReader() is accessible before calling.\n  // ReactNative doesn't support ReadableStream. They might not be available in older browsers, or some polyfills.\n  const reader = readableStream.getReader();\n  return new ReadableStream({\n    async pull(controller) {\n      const { value, done } = await reader.read();\n\n      if (done) {\n        controller.enqueue(`0\\r\\n`);\n        if (checksumRequired) {\n          const checksum = base64Encoder!(await digest!);\n          controller.enqueue(`${checksumLocationName}:${checksum}\\r\\n`);\n          controller.enqueue(`\\r\\n`);\n        }\n        controller.close();\n      } else {\n        controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\\r\\n${value}\\r\\n`);\n      }\n    },\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/getAwsChunkedEncodingStream.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getAwsChunkedEncodingStream } from \"./getAwsChunkedEncodingStream\";\n\ndescribe(getAwsChunkedEncodingStream.name, () => {\n  const mockBase64Encoder = vi.fn();\n  const mockBodyLengthChecker = vi.fn();\n  const mockChecksumAlgorithmFn = vi.fn();\n  const mockChecksumLocationName = \"mockChecksumLocationName\";\n  const mockStreamHasher = vi.fn();\n\n  const mockOptions = {\n    base64Encoder: mockBase64Encoder,\n    bodyLengthChecker: mockBodyLengthChecker,\n    checksumAlgorithmFn: mockChecksumAlgorithmFn,\n    checksumLocationName: mockChecksumLocationName,\n    streamHasher: mockStreamHasher,\n  };\n\n  const mockChecksum = \"mockChecksum\";\n  const mockRawChecksum = Buffer.from(mockChecksum);\n  const mockStreamChunks = [\"Hello\", \"World\"];\n  const mockBodyLength = 5;\n\n  const getMockReadableStream = () => {\n    const readableStream = new Readable();\n    mockStreamChunks.forEach((chunk) => {\n      readableStream.push(chunk);\n    });\n    readableStream.push(null);\n    return readableStream;\n  };\n\n  beforeEach(() => {\n    mockStreamHasher.mockResolvedValue(mockRawChecksum);\n    mockBase64Encoder.mockReturnValue(mockChecksum);\n  });\n\n  describe(\"mock stream\", () => {\n    beforeEach(() => {\n      mockBodyLengthChecker.mockReturnValue(mockBodyLength);\n    });\n\n    afterEach(() => {\n      expect(mockBodyLengthChecker).toHaveBeenCalledTimes(mockStreamChunks.length);\n      mockStreamChunks.forEach((chunk, index) => {\n        expect(mockBodyLengthChecker).toHaveBeenNthCalledWith(index + 1, Buffer.from(chunk));\n      });\n      vi.clearAllMocks();\n    });\n\n    describe(\"skips checksum computation\", () => {\n      const validateStreamWithoutChecksum = async (awsChunkedEncodingStream: Readable) => {\n        let buffer = \"\";\n        let resolve: Function;\n        const promise = new Promise((r) => (resolve = r));\n        awsChunkedEncodingStream.on(\"data\", (data) => {\n          buffer += data.toString();\n        });\n        awsChunkedEncodingStream.on(\"end\", () => {\n          expect(mockStreamHasher).not.toHaveBeenCalled();\n          expect(mockBase64Encoder).not.toHaveBeenCalled();\n          expect(buffer).toEqual(`5\\r\nHello\\r\n5\\r\nWorld\\r\n0\\r\n`);\n          resolve();\n        });\n        await promise;\n      };\n\n      it(\"if none of the required options are passed\", async () => {\n        const readableStream = getMockReadableStream();\n        const awsChunkedEncodingStream = getAwsChunkedEncodingStream(readableStream, {\n          bodyLengthChecker: mockBodyLengthChecker,\n        });\n        await validateStreamWithoutChecksum(awsChunkedEncodingStream);\n      });\n\n      [\"base64Encoder\", \"checksumAlgorithmFn\", \"checksumLocationName\", \"streamHasher\"].forEach((optionToRemove) => {\n        it(`if option '${optionToRemove}' is not passed`, async () => {\n          const readableStream = getMockReadableStream();\n          const awsChunkedEncodingStream = getAwsChunkedEncodingStream(readableStream, {\n            ...mockOptions,\n            [optionToRemove]: undefined,\n          });\n          await validateStreamWithoutChecksum(awsChunkedEncodingStream);\n        });\n      });\n    });\n\n    it(\"computes checksum and adds it to the end event\", async () => {\n      const readableStream = getMockReadableStream();\n      const awsChunkedEncodingStream = getAwsChunkedEncodingStream(readableStream, mockOptions);\n      let resolve: Function;\n      const promise = new Promise((r) => (resolve = r));\n      let buffer = \"\";\n      awsChunkedEncodingStream.on(\"data\", (data) => {\n        buffer += data.toString();\n      });\n      awsChunkedEncodingStream.on(\"end\", () => {\n        expect(mockStreamHasher).toHaveBeenCalledWith(mockChecksumAlgorithmFn, readableStream);\n        expect(mockBase64Encoder).toHaveBeenCalledWith(mockRawChecksum);\n        expect(buffer).toStrictEqual(`5\\r\nHello\\r\n5\\r\nWorld\\r\n0\\r\nmockChecksumLocationName:mockChecksum\\r\n\\r\n`);\n        resolve();\n      });\n      await promise;\n    });\n  });\n\n  it(\"does not emit chunks of zero length\", async () => {\n    const readableStream = Readable.from({\n      async *[Symbol.asyncIterator]() {\n        yield \"\";\n        yield \"\";\n        yield \"\";\n        yield \"\";\n      },\n    });\n    const awsChunkedEncodingStream = getAwsChunkedEncodingStream(readableStream, {\n      ...mockOptions,\n      bodyLengthChecker: () => 0,\n    });\n    let resolve: Function;\n    const promise = new Promise((r) => (resolve = r));\n    let buffer = \"\";\n    awsChunkedEncodingStream.on(\"data\", (data) => {\n      buffer += data.toString();\n    });\n    awsChunkedEncodingStream.on(\"end\", () => {\n      expect(mockStreamHasher).toHaveBeenCalledWith(mockChecksumAlgorithmFn, readableStream);\n      expect(mockBase64Encoder).toHaveBeenCalledWith(mockRawChecksum);\n      expect(buffer).toStrictEqual(`0\\r\nmockChecksumLocationName:mockChecksum\\r\n\\r\n`);\n      resolve();\n    });\n    await promise;\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/getAwsChunkedEncodingStream.ts",
    "content": "import { Readable } from \"node:stream\";\nimport type { GetAwsChunkedEncodingStreamOptions } from \"@smithy/types\";\n\nimport { getAwsChunkedEncodingStream as getAwsChunkedEncodingStreamBrowser } from \"./getAwsChunkedEncodingStream.browser\";\nimport { isReadableStream } from \"./stream-type-check\";\n\n/**\n * @internal\n */\nexport function getAwsChunkedEncodingStream(stream: Readable, options: GetAwsChunkedEncodingStreamOptions): Readable;\n/**\n * @internal\n */\nexport function getAwsChunkedEncodingStream(\n  stream: ReadableStream,\n  options: GetAwsChunkedEncodingStreamOptions\n): ReadableStream;\n/**\n * @internal\n */\nexport function getAwsChunkedEncodingStream(\n  stream: Readable | ReadableStream,\n  options: GetAwsChunkedEncodingStreamOptions\n): Readable | ReadableStream {\n  const readable = stream as Readable;\n  const readableStream = stream as ReadableStream;\n  if (isReadableStream(readableStream)) {\n    return getAwsChunkedEncodingStreamBrowser(readableStream, options);\n  }\n  const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;\n\n  const checksumRequired =\n    base64Encoder !== undefined &&\n    checksumAlgorithmFn !== undefined &&\n    checksumLocationName !== undefined &&\n    streamHasher !== undefined;\n  const digest = checksumRequired ? streamHasher!(checksumAlgorithmFn!, readable) : undefined;\n\n  const awsChunkedEncodingStream = new Readable({\n    read: () => {},\n  });\n  readable.on(\"data\", (data) => {\n    const length = bodyLengthChecker(data) || 0;\n    if (length === 0) {\n      return;\n    }\n    awsChunkedEncodingStream.push(`${length.toString(16)}\\r\\n`);\n    awsChunkedEncodingStream.push(data);\n    awsChunkedEncodingStream.push(\"\\r\\n\");\n  });\n  readable.on(\"end\", async () => {\n    awsChunkedEncodingStream.push(`0\\r\\n`);\n    if (checksumRequired) {\n      const checksum = base64Encoder!(await digest!);\n      awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\\r\\n`);\n      awsChunkedEncodingStream.push(`\\r\\n`);\n    }\n    awsChunkedEncodingStream.push(null);\n  });\n  return awsChunkedEncodingStream;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/headStream.browser.ts",
    "content": "/**\n * Caution: the input stream must be destroyed separately, this function does not do so.\n * @internal\n * @param stream\n * @param bytes - read head bytes from the stream and discard the rest of it.\n */\nexport async function headStream(stream: ReadableStream, bytes: number): Promise<Uint8Array> {\n  let byteLengthCounter = 0;\n  const chunks = [];\n  const reader = stream.getReader();\n  let isDone = false;\n\n  while (!isDone) {\n    const { done, value } = await reader.read();\n    if (value) {\n      chunks.push(value);\n      byteLengthCounter += value?.byteLength ?? 0;\n    }\n    if (byteLengthCounter >= bytes) {\n      break;\n    }\n    isDone = done;\n  }\n  reader.releaseLock();\n\n  const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));\n  let offset = 0;\n  for (const chunk of chunks) {\n    if (chunk.byteLength > collected.byteLength - offset) {\n      collected.set(chunk.subarray(0, collected.byteLength - offset), offset);\n      break;\n    } else {\n      collected.set(chunk, offset);\n    }\n    offset += chunk.length;\n  }\n  return collected;\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/headStream.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { headStream } from \"./headStream\";\nimport { headStream as headWebStream } from \"./headStream.browser\";\nimport { splitStream } from \"./splitStream\";\nimport { splitStream as splitWebStream } from \"./splitStream.browser\";\n\nconst CHUNK_SIZE = 4;\nconst a32 = \"abcd\".repeat(32_000 / CHUNK_SIZE);\nconst a16 = \"abcd\".repeat(16_000 / CHUNK_SIZE);\nconst a8 = \"abcd\".repeat(8);\nconst a4 = \"abcd\".repeat(4);\nconst a2 = \"abcd\".repeat(2);\nconst a1 = \"abcd\".repeat(1);\n\ndescribe(headStream.name, () => {\n  it(\"should collect the head of a Node.js stream\", async () => {\n    const data = Buffer.from(a32);\n    const myStream = Readable.from(data);\n\n    const head = await headStream(myStream, 16_000);\n\n    expect(Buffer.from(head).toString()).toEqual(a16);\n  });\n\n  it(\"should collect the head of a web stream\", async () => {\n    if (typeof ReadableStream !== \"undefined\") {\n      const buffer = Buffer.from(a32);\n      const data = Array.from(new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength));\n\n      const myStream = new ReadableStream({\n        start(controller) {\n          for (const inputChunk of data) {\n            controller.enqueue(new Uint8Array([inputChunk]));\n          }\n          controller.close();\n        },\n      });\n\n      const head = await headWebStream(myStream, 16_000);\n      expect(Buffer.from(head).toString()).toEqual(a16);\n    }\n  });\n});\n\ndescribe(\"splitStream and headStream integration\", () => {\n  it(\"should split and head streams for Node.js\", async () => {\n    const data = Buffer.from(a32);\n    const myStream = Readable.from(data);\n\n    const [a, _1] = await splitStream(myStream);\n    const [b, _2] = await splitStream(_1);\n    const [c, _3] = await splitStream(_2);\n    const [d, _4] = await splitStream(_3);\n    const [e, f] = await splitStream(_4);\n\n    const byteArr1 = await headStream(a, Infinity);\n    const byteArr2 = await headStream(b, 16_000);\n    const byteArr3 = await headStream(c, 8 * CHUNK_SIZE);\n    const byteArr4 = await headStream(d, 4 * CHUNK_SIZE);\n    const byteArr5 = await headStream(e, 2 * CHUNK_SIZE);\n    const byteArr6 = await headStream(f, CHUNK_SIZE);\n\n    await Promise.all([a, b, c, d, e, f].map((stream) => stream.destroy()));\n\n    expect(Buffer.from(byteArr1).toString()).toEqual(a32);\n    expect(Buffer.from(byteArr2).toString()).toEqual(a16);\n    expect(Buffer.from(byteArr3).toString()).toEqual(a8);\n    expect(Buffer.from(byteArr4).toString()).toEqual(a4);\n    expect(Buffer.from(byteArr5).toString()).toEqual(a2);\n    expect(Buffer.from(byteArr6).toString()).toEqual(a1);\n  });\n\n  it(\"should split and head streams for web streams API\", async () => {\n    if (typeof ReadableStream !== \"undefined\") {\n      const buffer = Buffer.from(a8);\n      const data = Array.from(new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength));\n\n      const myStream = new ReadableStream({\n        start(controller) {\n          for (let i = 0; i < data.length; i += CHUNK_SIZE) {\n            controller.enqueue(new Uint8Array(data.slice(i, i + CHUNK_SIZE)));\n          }\n          controller.close();\n        },\n      });\n\n      const [a, _1] = await splitWebStream(myStream);\n      const [b, _2] = await splitWebStream(_1);\n      const [c, _3] = await splitWebStream(_2);\n      const [d, e] = await splitWebStream(_3);\n\n      const byteArr1 = await headWebStream(a, Infinity);\n      const byteArr2 = await headWebStream(b, 8 * CHUNK_SIZE);\n      const byteArr3 = await headWebStream(c, 4 * CHUNK_SIZE);\n      const byteArr4 = await headWebStream(d, 2 * CHUNK_SIZE);\n      const byteArr5 = await headWebStream(e, CHUNK_SIZE);\n\n      await Promise.all([a, b, c, d, e].map((stream) => stream.cancel()));\n\n      expect(Buffer.from(byteArr1).toString()).toEqual(a8);\n      expect(Buffer.from(byteArr2).toString()).toEqual(a8);\n      expect(Buffer.from(byteArr3).toString()).toEqual(a4);\n      expect(Buffer.from(byteArr4).toString()).toEqual(a2);\n      expect(Buffer.from(byteArr5).toString()).toEqual(a1);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/headStream.ts",
    "content": "import { Writable, type Readable } from \"node:stream\";\n\nimport { headStream as headWebStream } from \"./headStream.browser\";\nimport { isReadableStream } from \"./stream-type-check\";\n\n/**\n * Caution: the input stream must be destroyed separately, this function does not do so.\n *\n * @internal\n * @param stream - to be read.\n * @param bytes - read head bytes from the stream and discard the rest of it.\n */\nexport const headStream = (stream: Readable | ReadableStream, bytes: number): Promise<Uint8Array> => {\n  if (isReadableStream(stream)) {\n    return headWebStream(stream, bytes);\n  }\n  return new Promise((resolve, reject) => {\n    const collector = new Collector();\n    collector.limit = bytes;\n    stream.pipe(collector);\n    stream.on(\"error\", (err) => {\n      collector.end();\n      reject(err);\n    });\n    collector.on(\"error\", reject);\n    collector.on(\"finish\", function (this: Collector) {\n      const bytes = new Uint8Array(Buffer.concat(this.buffers));\n      resolve(bytes);\n    });\n  });\n};\n\nclass Collector extends Writable {\n  public readonly buffers: Buffer[] = [];\n  public limit = Infinity;\n  private bytesBuffered = 0;\n\n  _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void) {\n    this.buffers.push(chunk);\n    this.bytesBuffered += chunk.byteLength ?? 0;\n    if (this.bytesBuffered >= this.limit) {\n      const excess = this.bytesBuffered - this.limit;\n      const tailBuffer = this.buffers[this.buffers.length - 1];\n      this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);\n      this.emit(\"finish\");\n    }\n    callback();\n  }\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/sdk-stream-mixin.browser.spec.ts",
    "content": "import type { SdkStreamMixin } from \"@smithy/types\";\nimport { afterEach, beforeAll, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { toBase64 } from \"../util-base64/toBase64.browser\";\nimport { toHex } from \"../util-hex-encoding/hex-encoding\";\nimport { toUtf8 } from \"../util-utf8/toUtf8.browser\";\nimport { sdkStreamMixin } from \"./sdk-stream-mixin.browser\";\nimport { streamCollector } from \"./stream-collector.browser\";\n\nvi.mock(\"./stream-collector.browser\");\nvi.mock(\"../util-base64/toBase64.browser\");\nvi.mock(\"../util-hex-encoding/hex-encoding\");\nvi.mock(\"../util-utf8/toUtf8.browser\");\n\nconst mockStreamCollectorReturn = Uint8Array.from([117, 112, 113]);\nvi.mocked(streamCollector).mockReturnValue(Promise.resolve(mockStreamCollectorReturn));\n\ndescribe(sdkStreamMixin.name, () => {\n  const expectAllTransformsToFail = async (sdkStream: SdkStreamMixin) => {\n    const transformMethods: Array<keyof SdkStreamMixin> = [\n      \"transformToByteArray\",\n      \"transformToString\",\n      \"transformToWebStream\",\n    ];\n    for (const method of transformMethods) {\n      try {\n        await sdkStream[method]();\n        fail(new Error(\"expect subsequent transform to fail\"));\n      } catch (error) {\n        expect(error.message).toContain(\"The stream has already been transformed\");\n      }\n    }\n  };\n\n  let originalReadableStreamCtr = global.ReadableStream;\n  const mockReadableStream = vi.fn();\n  class ReadableStream {\n    constructor() {\n      mockReadableStream();\n    }\n  }\n\n  let payloadStream: ReadableStream;\n\n  beforeAll(() => {\n    global.ReadableStream = ReadableStream as any;\n  });\n\n  beforeEach(() => {\n    originalReadableStreamCtr = global.ReadableStream;\n    vi.clearAllMocks();\n    payloadStream = new ReadableStream();\n  });\n\n  afterEach(() => {\n    global.ReadableStream = originalReadableStreamCtr;\n  });\n\n  it(\"should throw if input stream is not a Blob or Web Stream instance\", () => {\n    const originalBlobCtr = global.Blob;\n    // @ts-expect-error\n    global.Blob = undefined;\n    // @ts-expect-error\n    global.ReadableStream = undefined;\n    try {\n      sdkStreamMixin({});\n      fail(\"expect unexpected stream to fail\");\n    } catch (e) {\n      expect(e.message).toContain(\"Unexpected stream implementation\");\n      global.Blob = originalBlobCtr;\n    }\n  });\n\n  describe(\"transformToByteArray\", () => {\n    it(\"should transform binary stream to byte array\", async () => {\n      const sdkStream = sdkStreamMixin(payloadStream);\n      const byteArray = await sdkStream.transformToByteArray();\n      expect(vi.mocked(streamCollector)).toBeCalledWith(payloadStream);\n      expect(byteArray).toEqual(mockStreamCollectorReturn);\n    });\n\n    it(\"should fail any subsequent transform calls\", async () => {\n      const sdkStream = sdkStreamMixin(payloadStream);\n      await sdkStream.transformToByteArray();\n      await expectAllTransformsToFail(sdkStream);\n    });\n  });\n\n  describe(\"transformToString\", () => {\n    let originalTextDecoder = global.TextDecoder;\n    const mockDecode = vi.fn();\n    global.TextDecoder = vi.fn().mockImplementation(function () {\n      return { decode: mockDecode };\n    });\n\n    beforeEach(() => {\n      originalTextDecoder = global.TextDecoder;\n      vi.clearAllMocks();\n    });\n\n    afterEach(() => {\n      global.TextDecoder = originalTextDecoder;\n    });\n\n    it.each([\n      [undefined, toUtf8],\n      [\"utf8\", toUtf8],\n      [\"utf-8\", toUtf8],\n      [\"base64\", toBase64],\n      [\"hex\", toHex],\n    ])(\"should transform to string with %s encoding\", async (encoding, encodingFn) => {\n      const mockEncodedStringValue = `a string with ${encoding} encoding`;\n      vi.mocked(encodingFn).mockReturnValueOnce(mockEncodedStringValue);\n      const sdkStream = sdkStreamMixin(payloadStream);\n      const str = await sdkStream.transformToString(encoding);\n      expect(streamCollector).toBeCalled();\n      expect(encodingFn).toBeCalledWith(mockStreamCollectorReturn);\n      expect(str).toEqual(mockEncodedStringValue);\n    });\n\n    it(\"should use TexDecoder to handle other encodings\", async () => {\n      const utfLabel = \"windows-1251\";\n      mockDecode.mockReturnValue(`a string with ${utfLabel} encoding`);\n      const sdkStream = sdkStreamMixin(payloadStream);\n      const str = await sdkStream.transformToString(utfLabel);\n      expect(global.TextDecoder).toBeCalledWith(utfLabel);\n      expect(str).toEqual(`a string with ${utfLabel} encoding`);\n    });\n\n    it(\"should throw if TextDecoder is not available\", async () => {\n      // @ts-expect-error\n      global.TextDecoder = null;\n      const utfLabel = \"windows-1251\";\n      const sdkStream = sdkStreamMixin(payloadStream);\n      try {\n        await sdkStream.transformToString(utfLabel);\n        fail(\"expect transformToString to throw when TextDecoder is not available\");\n      } catch (error) {\n        expect(error.message).toContain(\"TextDecoder is not available\");\n      }\n    });\n\n    it(\"should fail any subsequent transform calls\", async () => {\n      const sdkStream = sdkStreamMixin(payloadStream);\n      await sdkStream.transformToString();\n      await expectAllTransformsToFail(sdkStream);\n    });\n  });\n\n  describe(\"transformToWebStream with ReadableStream payload\", () => {\n    it(\"should return the payload if it is Web Stream instance\", () => {\n      const payloadStream = new ReadableStream();\n      const sdkStream = sdkStreamMixin(payloadStream as any);\n      const transformed = sdkStream.transformToWebStream();\n      expect(transformed).toBe(payloadStream);\n    });\n\n    it(\"should fail any subsequent transform calls\", async () => {\n      const payloadStream = new ReadableStream();\n      const sdkStream = sdkStreamMixin(payloadStream as any);\n      sdkStream.transformToWebStream();\n      await expectAllTransformsToFail(sdkStream);\n    });\n  });\n\n  describe(\"transformToWebStream with Blob payload\", () => {\n    let originalBlobCtr = global.Blob;\n    const mockBlob = vi.fn();\n    const mockBlobStream = vi.fn();\n    class Blob {\n      constructor() {\n        mockBlob();\n      }\n\n      stream() {\n        return mockBlobStream();\n      }\n    }\n    global.Blob = Blob as any;\n\n    beforeEach(() => {\n      // @ts-expect-error\n      global.ReadableStream = undefined;\n      originalBlobCtr = global.Blob;\n      vi.clearAllMocks();\n    });\n\n    afterEach(() => {\n      global.Blob = originalBlobCtr;\n    });\n\n    it(\"should transform blob to web stream with Blob.stream()\", () => {\n      mockBlobStream.mockReturnValue(\"transformed\");\n      const payloadStream = new Blob();\n      const sdkStream = sdkStreamMixin(payloadStream as any);\n      const transformed = sdkStream.transformToWebStream();\n      expect(transformed).toBe(\"transformed\");\n      expect(mockBlobStream).toBeCalled();\n    });\n\n    it(\"should fail if Blob.stream() is not available\", async () => {\n      class Blob {\n        constructor() {\n          mockBlob();\n        }\n      }\n\n      global.Blob = Blob as any;\n      const payloadStream = new Blob();\n      const sdkStream = sdkStreamMixin(payloadStream as any);\n      try {\n        sdkStream.transformToWebStream();\n        fail(\"expect to fail\");\n      } catch (e) {\n        expect(e.message).toContain(\"Please make sure the Blob.stream() is polyfilled\");\n      }\n    });\n\n    it(\"should fail any subsequent transform calls\", async () => {\n      const payloadStream = new Blob();\n      const sdkStream = sdkStreamMixin(payloadStream as any);\n      sdkStream.transformToWebStream();\n      await expectAllTransformsToFail(sdkStream);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/sdk-stream-mixin.browser.ts",
    "content": "import type { SdkStream, SdkStreamMixin } from \"@smithy/types\";\n\nimport { toBase64 } from \"../util-base64/toBase64.browser\";\nimport { toHex } from \"../util-hex-encoding/hex-encoding\";\nimport { toUtf8 } from \"../util-utf8/toUtf8.browser\";\nimport { streamCollector } from \"./stream-collector.browser\";\nimport { isReadableStream } from \"./stream-type-check\";\n\nconst ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = \"The stream has already been transformed.\";\n\n/**\n * The stream handling utility functions for browsers and React Native\n *\n * @internal\n */\nexport const sdkStreamMixin = (stream: unknown): SdkStream<ReadableStream | Blob> => {\n  if (!isBlobInstance(stream) && !isReadableStream(stream)) {\n    //@ts-ignore\n    const name = stream?.__proto__?.constructor?.name || stream;\n    throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);\n  }\n\n  let transformed = false;\n  const transformToByteArray = async () => {\n    if (transformed) {\n      throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);\n    }\n    transformed = true;\n    return await streamCollector(stream);\n  };\n\n  const blobToWebStream = (blob: Blob) => {\n    if (typeof blob.stream !== \"function\") {\n      throw new Error(\n        \"Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\\n\" +\n          \"If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body\"\n      );\n    }\n    return blob.stream();\n  };\n\n  return Object.assign<ReadableStream | Blob, SdkStreamMixin>(stream, {\n    transformToByteArray: transformToByteArray,\n\n    transformToString: async (encoding?: string) => {\n      const buf = await transformToByteArray();\n      if (encoding === \"base64\") {\n        return toBase64(buf);\n      } else if (encoding === \"hex\") {\n        return toHex(buf);\n      } else if (encoding === undefined || encoding === \"utf8\" || encoding === \"utf-8\") {\n        // toUtf8() itself will use TextDecoder and fallback to pure JS implementation.\n        return toUtf8(buf);\n      } else if (typeof TextDecoder === \"function\") {\n        return new TextDecoder(encoding).decode(buf);\n      } else {\n        throw new Error(\"TextDecoder is not available, please make sure polyfill is provided.\");\n      }\n    },\n\n    transformToWebStream: () => {\n      if (transformed) {\n        throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);\n      }\n      transformed = true;\n      if (isBlobInstance(stream)) {\n        // ReadableStream is undefined in React Native\n        return blobToWebStream(stream);\n      } else if (isReadableStream(stream)) {\n        return stream;\n      } else {\n        throw new Error(`Cannot transform payload to web stream, got ${stream}`);\n      }\n    },\n  });\n};\n\nconst isBlobInstance = (stream: unknown): stream is Blob => typeof Blob === \"function\" && stream instanceof Blob;\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/sdk-stream-mixin.spec.ts",
    "content": "import { PassThrough, Readable, type Writable } from \"node:stream\";\nimport type { SdkStreamMixin } from \"@smithy/types\";\nimport { afterAll, beforeAll, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { fromArrayBuffer } from \"../util-buffer-from/buffer-from\";\nimport { sdkStreamMixin } from \"./sdk-stream-mixin\";\n\nvi.mock(\"../util-buffer-from/buffer-from\");\n\ndescribe(sdkStreamMixin.name, () => {\n  const writeDataToStream = (stream: Writable, data: Array<ArrayBufferLike>): Promise<void> =>\n    new Promise((resolve, reject) => {\n      data.forEach((chunk) => {\n        stream.write(chunk, (err) => {\n          if (err) reject(err);\n        });\n      });\n      stream.end(resolve);\n    });\n  const byteArrayFromBuffer = (buf: Buffer) => new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n  let passThrough: PassThrough;\n  const expectAllTransformsToFail = async (sdkStream: SdkStreamMixin) => {\n    const transformMethods: Array<keyof SdkStreamMixin> = [\n      \"transformToByteArray\",\n      \"transformToString\",\n      \"transformToWebStream\",\n    ];\n    for (const method of transformMethods) {\n      try {\n        await sdkStream[method]();\n        fail(new Error(\"expect subsequent transform to fail\"));\n      } catch (error) {\n        expect(error.message).toContain(\"The stream has already been transformed\");\n      }\n    }\n  };\n\n  beforeEach(() => {\n    passThrough = new PassThrough();\n  });\n\n  it(\"should attempt to use the ReadableStream version if the input is not a Readable\", async () => {\n    if (typeof ReadableStream !== \"undefined\") {\n      // ReadableStream is global only as of Node.js 18.\n      const sdkStream = sdkStreamMixin(\n        new ReadableStream({\n          start(controller) {\n            controller.enqueue(Buffer.from(\"abcd\"));\n            controller.close();\n          },\n        })\n      );\n      expect(await sdkStream.transformToByteArray()).toEqual(new Uint8Array([97, 98, 99, 100]));\n    }\n  });\n\n  it(\"should throw if unexpected stream implementation is supplied\", () => {\n    try {\n      const payload = {};\n      sdkStreamMixin(payload);\n      fail(\"should throw when unexpected stream is supplied\");\n    } catch (error) {\n      expect(error.message).toContain(\"Unexpected stream implementation\");\n    }\n  });\n\n  describe(\"transformToByteArray\", () => {\n    it(\"should transform binary stream to byte array\", async () => {\n      const mockData = [Buffer.from(\"foo\"), Buffer.from(\"bar\"), Buffer.from(\"buzz\")];\n      const expected = byteArrayFromBuffer(Buffer.from(\"foobarbuzz\"));\n      const sdkStream = sdkStreamMixin(passThrough);\n      await writeDataToStream(passThrough, mockData);\n      expect(await sdkStream.transformToByteArray()).toEqual(expected);\n    });\n\n    it(\"should fail any subsequent transform calls\", async () => {\n      const sdkStream = sdkStreamMixin(passThrough);\n      await writeDataToStream(passThrough, [Buffer.from(\"abc\")]);\n      expect(await sdkStream.transformToByteArray()).toEqual(byteArrayFromBuffer(Buffer.from(\"abc\")));\n      await expectAllTransformsToFail(sdkStream);\n    });\n  });\n\n  describe(\"transformToString\", () => {\n    const toStringMock = vi.fn();\n    beforeAll(() => {\n      vi.resetAllMocks();\n    });\n\n    it(\"should transform the stream to string with utf-8 encoding by default\", async () => {\n      vi.mocked(fromArrayBuffer).mockImplementation(\n        ((await vi.importActual(\"@smithy/core/serde\")) as any).fromArrayBuffer\n      );\n      const sdkStream = sdkStreamMixin(passThrough);\n      await writeDataToStream(passThrough, [Buffer.from(\"foo\")]);\n      const transformed = await sdkStream.transformToString();\n      expect(transformed).toEqual(\"foo\");\n    });\n\n    it.each([undefined, \"utf-8\", \"ascii\", \"base64\", \"latin1\", \"binary\"])(\n      \"should transform the stream to string with %s encoding\",\n      async (encoding) => {\n        vi.mocked(fromArrayBuffer).mockReturnValue({ toString: toStringMock } as any);\n        const sdkStream = sdkStreamMixin(passThrough);\n        await writeDataToStream(passThrough, [Buffer.from(\"foo\")]);\n        await sdkStream.transformToString(encoding);\n        expect(toStringMock).toBeCalledWith(encoding);\n      }\n    );\n\n    it.each([\"ibm866\", \"iso-8859-2\", \"koi8-r\", \"macintosh\", \"windows-874\", \"gbk\", \"gb18030\", \"euc-jp\"])(\n      \"should transform the stream to string with TextDecoder config %s\",\n      async (encoding) => {\n        vi.spyOn(global, \"TextDecoder\").mockImplementation(\n          () =>\n            ({\n              decode: vi.fn(),\n            }) as any\n        );\n        vi.mocked(fromArrayBuffer).mockReturnValue({ toString: toStringMock } as any);\n        const sdkStream = sdkStreamMixin(passThrough);\n        await writeDataToStream(passThrough, [Buffer.from(\"foo\")]);\n        await sdkStream.transformToString(encoding as BufferEncoding);\n        expect(TextDecoder).toBeCalledWith(encoding);\n      }\n    );\n\n    it(\"should fail any subsequent transform calls\", async () => {\n      const sdkStream = sdkStreamMixin(passThrough);\n      await writeDataToStream(passThrough, [Buffer.from(\"foo\")]);\n      await sdkStream.transformToString();\n      await expectAllTransformsToFail(sdkStream);\n    });\n  });\n\n  describe(\"transformToWebStream\", () => {\n    it(\"should throw if any event listener is attached on the underlying stream\", async () => {\n      passThrough.on(\"data\", console.log);\n      const sdkStream = sdkStreamMixin(passThrough);\n      try {\n        sdkStream.transformToWebStream();\n        fail(new Error(\"expect web stream transformation to fail\"));\n      } catch (error) {\n        expect(error.message).toContain(\"The stream has been consumed by other callbacks\");\n      }\n    });\n\n    describe(\"when Readable.toWeb() is not supported\", () => {\n      const originalToWebImpl = Readable.toWeb;\n      beforeAll(() => {\n        // @ts-expect-error\n        Readable.toWeb = undefined;\n      });\n      afterAll(() => {\n        Readable.toWeb = originalToWebImpl;\n      });\n\n      it(\"should throw\", async () => {\n        const sdkStream = sdkStreamMixin(passThrough);\n        try {\n          sdkStream.transformToWebStream();\n          fail(new Error(\"expect web stream transformation to fail\"));\n        } catch (error) {\n          expect(error.message).toContain(\"Readable.toWeb() is not supported\");\n        }\n      });\n    });\n\n    describe(\"when Readable.toWeb() is supported\", () => {\n      const originalToWebImpl = Readable.toWeb;\n      beforeAll(() => {\n        Readable.toWeb = vi.fn().mockReturnValue(\"A web stream\");\n      });\n\n      afterAll(() => {\n        Readable.toWeb = originalToWebImpl;\n      });\n\n      it(\"should transform Node stream to web stream\", async () => {\n        const sdkStream = sdkStreamMixin(passThrough);\n        sdkStream.transformToWebStream();\n        expect(Readable.toWeb).toBeCalled();\n      });\n\n      it(\"should fail any subsequent transform calls\", async () => {\n        const sdkStream = sdkStreamMixin(passThrough);\n        await writeDataToStream(passThrough, [Buffer.from(\"foo\")]);\n        await sdkStream.transformToWebStream();\n        await expectAllTransformsToFail(sdkStream);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/sdk-stream-mixin.ts",
    "content": "import { Readable } from \"node:stream\";\nimport type { SdkStream, SdkStreamMixin } from \"@smithy/types\";\n\nimport { fromArrayBuffer } from \"../util-buffer-from/buffer-from\";\nimport { sdkStreamMixin as sdkStreamMixinReadableStream } from \"./sdk-stream-mixin.browser\";\nimport { streamCollector } from \"./stream-collector\";\n\nconst ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = \"The stream has already been transformed.\";\n\n/**\n * The function that mixes in the utility functions to help consuming runtime-specific payload stream.\n *\n * @internal\n */\nexport const sdkStreamMixin = (stream: unknown): SdkStream<ReadableStream | Blob> | SdkStream<Readable> => {\n  if (!(stream instanceof Readable)) {\n    try {\n      /**\n       * If the stream is not node:stream::Readable, it may be a web stream within Node.js.\n       */\n      return sdkStreamMixinReadableStream(stream);\n    } catch (e: unknown) {\n      // @ts-ignore\n      const name = stream?.__proto__?.constructor?.name || stream;\n      throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);\n    }\n  }\n\n  let transformed = false;\n  const transformToByteArray = async () => {\n    if (transformed) {\n      throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);\n    }\n    transformed = true;\n    return await streamCollector(stream);\n  };\n\n  return Object.assign<Readable, SdkStreamMixin>(stream, {\n    transformToByteArray,\n    transformToString: async (encoding?: string) => {\n      const buf = await transformToByteArray();\n      if (encoding === undefined || Buffer.isEncoding(encoding)) {\n        return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding as BufferEncoding);\n      } else {\n        const decoder = new TextDecoder(encoding);\n        return decoder.decode(buf);\n      }\n    },\n    transformToWebStream: () => {\n      if (transformed) {\n        throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);\n      }\n      if (stream.readableFlowing !== null) {\n        // Prevent side effect of consuming webstream.\n        throw new Error(\"The stream has been consumed by other callbacks.\");\n      }\n      if (typeof Readable.toWeb !== \"function\") {\n        throw new Error(\"Readable.toWeb() is not supported. Please ensure a polyfill is available.\");\n      }\n      transformed = true;\n      return Readable.toWeb(stream) as ReadableStream;\n    },\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/splitStream.browser.ts",
    "content": "/**\n * @param stream\n * @returns stream split into two identical streams.\n */\nexport async function splitStream(stream: ReadableStream | Blob): Promise<[ReadableStream, ReadableStream]> {\n  if (typeof (stream as Blob).stream === \"function\") {\n    stream = (stream as Blob).stream();\n  }\n  const readableStream = stream as ReadableStream;\n  return readableStream.tee();\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/splitStream.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { streamCollector as webStreamCollector } from \"@smithy/fetch-http-handler\";\nimport { streamCollector } from \"@smithy/node-http-handler\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { splitStream } from \"./splitStream\";\nimport { splitStream as splitWebStream } from \"./splitStream.browser\";\n\ndescribe(splitStream.name, () => {\n  it(\"should split a node:Readable stream\", async () => {\n    const data = Buffer.from(\"abcd\");\n\n    const myStream = Readable.from(data);\n    const [a, b] = await splitStream(myStream);\n\n    const buffer1 = await streamCollector(a);\n    const buffer2 = await streamCollector(b);\n\n    expect(buffer1).toEqual(new Uint8Array([97, 98, 99, 100]));\n    expect(buffer1).toEqual(buffer2);\n  });\n  it(\"should split a web:ReadableStream stream\", async () => {\n    if (typeof ReadableStream !== \"undefined\") {\n      const inputChunks = [97, 98, 99, 100];\n\n      const myStream = new ReadableStream({\n        start(controller) {\n          for (const inputChunk of inputChunks) {\n            controller.enqueue(new Uint8Array([inputChunk]));\n          }\n          controller.close();\n        },\n      });\n\n      const [a, b] = await splitWebStream(myStream);\n\n      const bytes1 = await webStreamCollector(a);\n      const bytes2 = await webStreamCollector(b);\n\n      expect(bytes1).toEqual(new Uint8Array([97, 98, 99, 100]));\n      expect(bytes1).toEqual(bytes2);\n    }\n  });\n  it(\"should split a web:Blob\", async () => {\n    if (typeof Blob !== \"undefined\") {\n      const inputChunks = [97, 98, 99, 100];\n\n      const myBlob = new Blob([new Uint8Array(inputChunks)]);\n\n      const [a, b] = await splitWebStream(myBlob);\n\n      const bytes1 = await webStreamCollector(a);\n      const bytes2 = await webStreamCollector(b);\n\n      expect(bytes1).toEqual(new Uint8Array([97, 98, 99, 100]));\n      expect(bytes1).toEqual(bytes2);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/splitStream.ts",
    "content": "import { PassThrough, type Readable } from \"node:stream\";\n\nimport { splitStream as splitWebStream } from \"./splitStream.browser\";\nimport { isBlob, isReadableStream } from \"./stream-type-check\";\n\n/**\n * @internal\n * @param stream - to be split.\n * @returns stream split into two identical streams.\n */\nexport async function splitStream(stream: Readable): Promise<[Readable, Readable]>;\n/**\n * @internal\n */\nexport async function splitStream(stream: ReadableStream): Promise<[ReadableStream, ReadableStream]>;\n/**\n * @internal\n */\nexport async function splitStream(\n  stream: Readable | ReadableStream\n): Promise<[Readable | ReadableStream, Readable | ReadableStream]> {\n  if (isReadableStream(stream) || isBlob(stream)) {\n    return splitWebStream(stream);\n  }\n  const stream1 = new PassThrough();\n  const stream2 = new PassThrough();\n  stream.pipe(stream1);\n  stream.pipe(stream2);\n  return [stream1, stream2];\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/stream-collector.browser.ts",
    "content": "import { fromBase64 } from \"../util-base64/fromBase64.browser\";\n\n/**\n * Inlined from @smithy/fetch-http-handler streamCollector.\n *\n * @internal\n */\nexport const streamCollector = async (stream: Blob | ReadableStream): Promise<Uint8Array> => {\n  if ((typeof Blob === \"function\" && stream instanceof Blob) || stream.constructor?.name === \"Blob\") {\n    if (Blob.prototype.arrayBuffer !== undefined) {\n      return new Uint8Array(await (stream as Blob).arrayBuffer());\n    }\n    return collectBlob(stream as Blob);\n  }\n  return collectStream(stream as ReadableStream);\n};\n\nasync function collectBlob(blob: Blob): Promise<Uint8Array> {\n  const base64 = await readToBase64(blob);\n  const arrayBuffer = fromBase64(base64);\n  return new Uint8Array(arrayBuffer);\n}\n\nasync function collectStream(stream: ReadableStream): Promise<Uint8Array> {\n  const chunks = [];\n  const reader = stream.getReader();\n  let isDone = false;\n  let length = 0;\n  while (!isDone) {\n    const { done, value } = await reader.read();\n    if (value) {\n      chunks.push(value);\n      length += value.length;\n    }\n    isDone = done;\n  }\n  const collected = new Uint8Array(length);\n  let offset = 0;\n  for (const chunk of chunks) {\n    collected.set(chunk, offset);\n    offset += chunk.length;\n  }\n  return collected;\n}\n\nfunction readToBase64(blob: Blob): Promise<string> {\n  return new Promise((resolve, reject) => {\n    const reader = new FileReader();\n    reader.onloadend = () => {\n      if (reader.readyState !== 2) {\n        return reject(new Error(\"Reader aborted too early\"));\n      }\n      const result = (reader.result ?? \"\") as string;\n      const commaIndex = result.indexOf(\",\");\n      const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n      resolve(result.substring(dataOffset));\n    };\n    reader.onabort = () => reject(new Error(\"Read aborted\"));\n    reader.onerror = () => reject(reader.error);\n    reader.readAsDataURL(blob);\n  });\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/stream-collector.ts",
    "content": "import { Writable, type Readable } from \"node:stream\";\nimport type { ReadableStream as IReadableStream } from \"node:stream/web\";\n\n/**\n * Inlined from @smithy/node-http-handler streamCollector.\n *\n * @internal\n */\nclass Collector extends Writable {\n  public readonly bufferedBytes: Buffer[] = [];\n  _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void) {\n    this.bufferedBytes.push(chunk);\n    callback();\n  }\n}\n\nconst isReadableStreamInstance = (stream: unknown): stream is IReadableStream =>\n  typeof ReadableStream === \"function\" && stream instanceof ReadableStream;\n\nasync function collectReadableStream(stream: IReadableStream): Promise<Uint8Array> {\n  const chunks = [];\n  const reader = stream.getReader();\n  let isDone = false;\n  let length = 0;\n  while (!isDone) {\n    const { done, value } = await reader.read();\n    if (value) {\n      chunks.push(value);\n      length += value.length;\n    }\n    isDone = done;\n  }\n  const collected = new Uint8Array(length);\n  let offset = 0;\n  for (const chunk of chunks) {\n    collected.set(chunk, offset);\n    offset += chunk.length;\n  }\n  return collected;\n}\n\nexport const streamCollector = (stream: Readable | IReadableStream): Promise<Uint8Array> => {\n  if (isReadableStreamInstance(stream)) {\n    return collectReadableStream(stream);\n  }\n  return new Promise((resolve, reject) => {\n    const collector = new Collector();\n    stream.pipe(collector);\n    stream.on(\"error\", (err) => {\n      collector.end();\n      reject(err);\n    });\n    collector.on(\"error\", reject);\n    collector.on(\"finish\", function (this: Collector) {\n      const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));\n      resolve(bytes);\n    });\n  });\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/stream-type-check.ts",
    "content": "/**\n * Alias prevents compiler from turning\n * ReadableStream into ReadableStream<any>, which is incompatible\n * with the NodeJS.ReadableStream global type.\n *\n * @internal\n */\ntype ReadableStreamType = ReadableStream;\n\n/**\n * @internal\n */\nexport const isReadableStream = (stream: unknown): stream is ReadableStreamType =>\n  typeof ReadableStream === \"function\" &&\n  (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);\n\n/**\n * @internal\n */\nexport const isBlob = (blob: unknown): blob is Blob => {\n  return typeof Blob === \"function\" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-stream/util-stream.integ.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { HttpResponse, type HttpHandler } from \"@smithy/protocol-http\";\nimport type { HttpRequest as IHttpRequest } from \"@smithy/types\";\nimport { requireRequestsFrom } from \"@smithy/util-test/src\";\nimport { describe, expect, test as it } from \"vitest\";\nimport { Weather } from \"weather\";\n\nimport { Uint8ArrayBlobAdapter } from \"../index\";\nimport { fromUtf8 } from \"../util-utf8/fromUtf8\";\n\ndescribe(\"util-stream\", () => {\n  describe(Weather.name, () => {\n    it(\"should be uniform between string and Uint8Array payloads\", async () => {\n      const client = new Weather({\n        endpoint: \"https://foo.bar\",\n        region: \"us-west-2\",\n        credentials: {\n          accessKeyId: \"INTEG\",\n          secretAccessKey: \"INTEG\",\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        method: \"POST\",\n        hostname: \"foo.bar\",\n        query: {},\n        headers: {\n          \"content-type\": \"application/octet-stream\",\n          \"content-length\": \"17\",\n        },\n        body(raw) {\n          expect(raw.toString(\"utf-8\")).toEqual('{\"hello\":\"world\"}');\n        },\n        protocol: \"https:\",\n        path: \"/invoke\",\n      });\n\n      // string\n      await client.invoke({\n        payload: JSON.stringify({\n          hello: \"world\",\n        }),\n      });\n\n      // Uint8Array\n      await client.invoke({\n        payload: Buffer.from(\n          JSON.stringify({\n            hello: \"world\",\n          })\n        ),\n      });\n    });\n  });\n\n  describe(\"blob helper integration\", () => {\n    const client = new Weather({\n      endpoint: \"https://foo.bar\",\n      region: \"us-west-2\",\n      credentials: {\n        accessKeyId: \"INTEG\",\n        secretAccessKey: \"INTEG\",\n      },\n    });\n\n    requireRequestsFrom(client).toMatch({\n      method: \"POST\",\n      hostname: \"foo.bar\",\n      query: {},\n      headers: {\n        \"content-type\": \"application/octet-stream\",\n      },\n      protocol: \"https:\",\n      path: \"/invoke\",\n    });\n\n    client.config.requestHandler = new (class implements HttpHandler {\n      async handle(request: IHttpRequest) {\n        return {\n          response: new HttpResponse({\n            statusCode: 200,\n            body: typeof request.body === \"string\" ? fromUtf8(request.body) : Uint8Array.from(request.body),\n          }),\n        };\n      }\n      updateHttpClientConfig() {}\n      httpHandlerConfigs(): Record<string, any> {\n        return {};\n      }\n    })();\n\n    it(\"should allow string as payload blob and allow conversion of output payload blob to string\", async () => {\n      const payload = JSON.stringify({ hello: \"world\" });\n      const invoke = await client.invoke({ payload: payload });\n      expect(JSON.parse(invoke?.payload?.transformToString() ?? \"{}\")).toEqual({ hello: \"world\" });\n    });\n\n    it(\"should allow Uint8Array as payload blob\", async () => {\n      const payload = Uint8ArrayBlobAdapter.fromString(JSON.stringify({ hello: \"world\" }));\n      const invoke = await client.invoke({ payload: payload });\n      expect(JSON.parse(invoke?.payload?.transformToString() ?? \"{}\")).toEqual({ hello: \"world\" });\n    });\n\n    it(\"should allow buffer as payload blob\", async () => {\n      // note: Buffer extends Uint8Array\n      const payload = Buffer.from(Uint8ArrayBlobAdapter.fromString(JSON.stringify({ hello: \"world\" })));\n      const invoke = await client.invoke({ payload: payload });\n      expect(JSON.parse(invoke?.payload?.transformToString() ?? \"{}\")).toEqual({ hello: \"world\" });\n    });\n\n    it(\"should allow stream as payload blob but not be able to sign it\", async () => {\n      const payload = Readable.from(Buffer.from(Uint8ArrayBlobAdapter.fromString(JSON.stringify({ hello: \"world\" }))), {\n        encoding: \"utf-8\",\n      });\n      expect(JSON.parse(await streamToString(payload))).toEqual({ hello: \"world\" });\n      await client.invoke({ payload: payload }).catch((e) => {\n        expect(e.toString()).toContain(\"InvalidSignatureException\");\n      });\n      expect.hasAssertions();\n    });\n  });\n\n  function streamToString(stream: Readable): Promise<string> {\n    const chunks: any[] = [];\n    return new Promise((resolve, reject) => {\n      stream.on(\"data\", (chunk) => chunks.push(Buffer.from(chunk)));\n      stream.on(\"error\", (err) => reject(err));\n      stream.on(\"end\", () => resolve(Buffer.concat(chunks).toString(\"utf8\")));\n    });\n  }\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-buffer-from@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/util-buffer-from@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/util-buffer-from@4.2.0\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- Updated dependencies [64cda93]\n  - @smithy/util-buffer-from@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-buffer-from@4.0.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [671aa704]\n  - @smithy/util-buffer-from@3.0.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n  - @smithy/util-buffer-from@2.2.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 43f3e1e2: encoders allow string inputs\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/util-buffer-from@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/util-buffer-from@2.1.0\n\n## 2.0.2\n\n### Patch Changes\n\n- f2a04b7e: Use Node.js implementations in react-native\n\n## 2.0.1\n\n### Patch Changes\n\n- 5598a033: update bundler replacement directives in package.json\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/util-buffer-from@2.0.0\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/util-buffer-from@1.1.0\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/util-buffer-from@1.0.2\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/util-buffer-from@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/util-utf8](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/util-utf8/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/fromUtf8.browser.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { fromUtf8 } from \"./fromUtf8.browser\";\n\ndeclare const global: any;\n\ndescribe(\"fromUtf8\", () => {\n  it(\"should use the Encoding API\", () => {\n    const expected = new Uint8Array(0);\n    const encode = vi.fn().mockReturnValue(expected);\n    (global as any).TextEncoder = vi.fn(() => ({ encode }));\n\n    expect(fromUtf8(\"ABC\")).toBe(expected);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/fromUtf8.browser.ts",
    "content": "export const fromUtf8 = (input: string): Uint8Array => new TextEncoder().encode(input);\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/fromUtf8.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { fromUtf8 } from \"./fromUtf8\";\n\nconst utf8StringsToByteArrays: Record<string, Uint8Array> = {\n  ABC: new Uint8Array([\"A\".charCodeAt(0), \"B\".charCodeAt(0), \"C\".charCodeAt(0)]),\n  \"🐎👱❤\": new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]),\n  \"☃💩\": new Uint8Array([226, 152, 131, 240, 159, 146, 169]),\n  \"The rain in Spain falls mainly on the plain.\": new Uint8Array([\n    84, 104, 101, 32, 114, 97, 105, 110, 32, 105, 110, 32, 83, 112, 97, 105, 110, 32, 102, 97, 108, 108, 115, 32, 109,\n    97, 105, 110, 108, 121, 32, 111, 110, 32, 116, 104, 101, 32, 112, 108, 97, 105, 110, 46,\n  ]),\n  \"دست‌نوشته‌ها نمی‌سوزند\": new Uint8Array([\n    216, 175, 216, 179, 216, 170, 226, 128, 140, 217, 134, 217, 136, 216, 180, 216, 170, 217, 135, 226, 128, 140, 217,\n    135, 216, 167, 32, 217, 134, 217, 133, 219, 140, 226, 128, 140, 216, 179, 217, 136, 216, 178, 217, 134, 216, 175,\n  ]),\n  \"Рукописи не горят\": new Uint8Array([\n    208, 160, 209, 131, 208, 186, 208, 190, 208, 191, 208, 184, 209, 129, 208, 184, 32, 208, 189, 208, 181, 32, 208,\n    179, 208, 190, 209, 128, 209, 143, 209, 130,\n  ]),\n};\n\ndescribe(\"fromUtf8\", () => {\n  for (const string of Object.keys(utf8StringsToByteArrays)) {\n    it(`should UTF-8 decode \"${string}\" to the correct value`, () => {\n      expect(fromUtf8(string)).toEqual(utf8StringsToByteArrays[string]);\n    });\n  }\n\n  it(\"should throw when given a number\", () => {\n    expect(() => fromUtf8(255 as any)).toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/fromUtf8.ts",
    "content": "import { fromString } from \"../util-buffer-from/buffer-from\";\n\nexport const fromUtf8 = (input: string): Uint8Array => {\n  const buf = fromString(input, \"utf8\");\n  return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUint8Array.browser.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { toUint8Array } from \"./toUint8Array.browser\";\n\ndescribe(\"toUint8Array\", () => {\n  it(`should convert string to Uint8Array`, () => {\n    const expected = new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]);\n    expect(toUint8Array(\"🐎👱❤\")).toStrictEqual(expected);\n  });\n  it(`should convert buffer to Uint8Array`, () => {\n    const expected = new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]);\n    const buffer = Buffer.from(expected);\n    expect(toUint8Array(buffer)).toStrictEqual(expected);\n  });\n  it(`should convert ArrayBuffer to Uint8Array`, () => {\n    const input = new Uint32Array([240]);\n    const expected = new Uint8Array([240, 0, 0, 0]);\n    expect(toUint8Array(input)).toStrictEqual(expected);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUint8Array.browser.ts",
    "content": "import { fromUtf8 } from \"./fromUtf8.browser\";\n\n/**\n * @internal\n */\nexport const toUint8Array = (data: string | ArrayBuffer | ArrayBufferView): Uint8Array => {\n  if (typeof data === \"string\") {\n    return fromUtf8(data);\n  }\n\n  if (ArrayBuffer.isView(data)) {\n    return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n  }\n\n  return new Uint8Array(data);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUint8Array.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { toUint8Array } from \"./toUint8Array\";\n\ndescribe(\"toUint8Array\", () => {\n  it(`should convert string to Uint8Array`, () => {\n    const expected = new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]);\n    expect(toUint8Array(\"🐎👱❤\")).toStrictEqual(expected);\n  });\n  it(`should convert buffer to Uint8Array`, () => {\n    const expected = new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]);\n    const buffer = Buffer.from(expected);\n    expect(toUint8Array(buffer)).toStrictEqual(expected);\n  });\n  it(`should convert ArrayBuffer to Uint8Array`, () => {\n    const input = new Uint32Array([240]);\n    const expected = new Uint8Array([240, 0, 0, 0]);\n    expect(toUint8Array(input)).toStrictEqual(expected);\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUint8Array.ts",
    "content": "import { fromUtf8 } from \"./fromUtf8\";\n\nexport const toUint8Array = (data: string | ArrayBuffer | ArrayBufferView): Uint8Array => {\n  if (typeof data === \"string\") {\n    return fromUtf8(data);\n  }\n\n  if (ArrayBuffer.isView(data)) {\n    return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n  }\n\n  return new Uint8Array(data);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUtf8.browser.spec.ts",
    "content": "import type { Encoder } from \"@smithy/types\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { toUtf8 } from \"./toUtf8.browser\";\n\ndeclare const global: any;\n\ndescribe(\"toUtf8\", () => {\n  it(\"should use the Encoding API\", () => {\n    const expected = \"ABC\";\n    const decode = vi.fn().mockReturnValue(expected);\n    (global as any).TextDecoder = vi.fn(() => ({ decode }));\n\n    expect(toUtf8(new Uint8Array(0))).toBe(expected);\n  });\n\n  it(\"passes through strings\", () => {\n    expect(toUtf8(\"hello\")).toEqual(\"hello\");\n  });\n\n  it(\"throws on non-string non-Uint8Array\", () => {\n    expect(() => (toUtf8 as Encoder)(new Date())).toThrow();\n    expect(() => (toUtf8 as Encoder)({})).toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUtf8.browser.ts",
    "content": "/**\n *\n * This does not convert non-utf8 strings to utf8, it only passes through strings if\n * a string is received instead of a Uint8Array.\n *\n */\nexport const toUtf8 = (input: Uint8Array | string): string => {\n  if (typeof input === \"string\") {\n    return input;\n  }\n  if (typeof input !== \"object\" || typeof input.byteOffset !== \"number\" || typeof input.byteLength !== \"number\") {\n    throw new Error(\"@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.\");\n  }\n  return new TextDecoder(\"utf-8\").decode(input);\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUtf8.spec.ts",
    "content": "import type { Encoder } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { toUtf8 } from \"./toUtf8\";\n\nconst utf8StringsToByteArrays: Record<string, Uint8Array> = {\n  ABC: new Uint8Array([\"A\".charCodeAt(0), \"B\".charCodeAt(0), \"C\".charCodeAt(0)]),\n  \"🐎👱❤\": new Uint8Array([240, 159, 144, 142, 240, 159, 145, 177, 226, 157, 164]),\n  \"☃💩\": new Uint8Array([226, 152, 131, 240, 159, 146, 169]),\n  \"The rain in Spain falls mainly on the plain.\": new Uint8Array([\n    84, 104, 101, 32, 114, 97, 105, 110, 32, 105, 110, 32, 83, 112, 97, 105, 110, 32, 102, 97, 108, 108, 115, 32, 109,\n    97, 105, 110, 108, 121, 32, 111, 110, 32, 116, 104, 101, 32, 112, 108, 97, 105, 110, 46,\n  ]),\n  \"دست‌نوشته‌ها نمی‌سوزند\": new Uint8Array([\n    216, 175, 216, 179, 216, 170, 226, 128, 140, 217, 134, 217, 136, 216, 180, 216, 170, 217, 135, 226, 128, 140, 217,\n    135, 216, 167, 32, 217, 134, 217, 133, 219, 140, 226, 128, 140, 216, 179, 217, 136, 216, 178, 217, 134, 216, 175,\n  ]),\n  \"Рукописи не горят\": new Uint8Array([\n    208, 160, 209, 131, 208, 186, 208, 190, 208, 191, 208, 184, 209, 129, 208, 184, 32, 208, 189, 208, 181, 32, 208,\n    179, 208, 190, 209, 128, 209, 143, 209, 130,\n  ]),\n};\n\ndescribe(\"toUtf8\", () => {\n  for (const string of Object.keys(utf8StringsToByteArrays)) {\n    it(`should derive \"${string}\" from the UTF-8 decoded bytes`, () => {\n      expect(toUtf8(utf8StringsToByteArrays[string])).toBe(string);\n    });\n  }\n\n  it(\"should throw when given a number\", () => {\n    expect(() => toUtf8(255 as any)).toThrow();\n  });\n\n  it(\"passes through strings\", () => {\n    expect(toUtf8(\"hello\")).toEqual(\"hello\");\n  });\n\n  it(\"throws on non-string non-Uint8Array\", () => {\n    expect(() => (toUtf8 as Encoder)(new Date())).toThrow();\n    expect(() => (toUtf8 as Encoder)({})).toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/util-utf8/toUtf8.ts",
    "content": "import { fromArrayBuffer } from \"../util-buffer-from/buffer-from\";\n\n/**\n *\n * This does not convert non-utf8 strings to utf8, it only passes through strings if\n * a string is received instead of a Uint8Array.\n *\n */\nexport const toUtf8 = (input: Uint8Array | string): string => {\n  if (typeof input === \"string\") {\n    return input;\n  }\n  if (typeof input !== \"object\" || typeof input.byteOffset !== \"number\" || typeof input.byteLength !== \"number\") {\n    throw new Error(\"@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.\");\n  }\n  return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString(\"utf8\");\n};\n"
  },
  {
    "path": "packages/core/src/submodules/serde/uuid/CHANGELOG.md",
    "content": "# Change Log\n\nThis is a past changelog, the package has been consolidated into `@smithy/core/serde`.\n\n## 1.1.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 1.1.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 1.1.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 1.0.0\n\n### Major Changes\n\n- 9489059: Add polyfill for uuid v4 with preference for native implementations\n"
  },
  {
    "path": "packages/core/src/submodules/serde/uuid/v4.spec.ts",
    "content": "import { getRandomValues } from \"node:crypto\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { bindV4 } from \"./v4\";\n\nconst UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\ndescribe(\"v4\", () => {\n  afterEach(() => {\n    vi.restoreAllMocks();\n  });\n\n  it(\"should call native crypto.randomUUID when available\", () => {\n    const mockUUID = \"mocked-uuid-value\";\n    vi.stubGlobal(\"crypto\", { randomUUID: vi.fn(() => mockUUID), getRandomValues });\n\n    const v4 = bindV4(getRandomValues as (array: Uint8Array) => Uint8Array);\n    const uuid = v4();\n\n    expect(crypto.randomUUID).toHaveBeenCalled();\n    expect(uuid).toBe(mockUUID);\n  });\n\n  describe(\"when native randomUUID is not available\", () => {\n    it(\"falls back to getRandomValues\", () => {\n      vi.stubGlobal(\"crypto\", { getRandomValues });\n\n      const mockGetRandomValues = vi.fn((array: Uint8Array) => {\n        getRandomValues(array);\n        return array;\n      });\n      const v4 = bindV4(mockGetRandomValues);\n\n      const uuid = v4();\n\n      expect(mockGetRandomValues).toHaveBeenCalledWith(expect.any(Uint8Array));\n      expect(uuid).toMatch(UUID_REGEX);\n    });\n\n    it(\"each generation is unique and matches regex\", () => {\n      vi.stubGlobal(\"crypto\", { getRandomValues });\n\n      const v4 = bindV4(getRandomValues as (array: Uint8Array) => Uint8Array);\n      const uuids = new Set<string>();\n      const iterations = 10_000;\n\n      for (let i = 0; i < iterations; i++) {\n        const uuid = v4();\n        expect(uuid).toMatch(UUID_REGEX);\n        uuids.add(uuid);\n      }\n\n      expect(uuids.size).toBe(iterations);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/uuid/v4.ts",
    "content": "const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, \"0\"));\n\n/**\n * @internal\n */\nexport type GetRandomValues = (array: Uint8Array) => Uint8Array;\n\n/**\n * Creates a RFC4122 version 4 UUID generator.\n *\n * Uses the native crypto.randomUUID() if available, otherwise falls back\n * to a manual implementation using the provided getRandomValues function.\n *\n * The fallback implementation:\n * - Generates 16 random bytes using getRandomValues()\n * - Sets the version bits to indicate version 4\n * - Sets the variant bits to indicate RFC4122\n * - Formats the bytes as a UUID string with dashes\n *\n * @param getRandomValues - platform-specific random byte source.\n * @returns A function that generates version 4 UUID strings\n * in the format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\n * where x is any hexadecimal digit and y is one of 8, 9, a, or b.\n *\n * @internal\n */\nexport function bindV4(getRandomValues: GetRandomValues) {\n  if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") {\n    return () => crypto.randomUUID();\n  }\n\n  return (): string => {\n    const rnds = new Uint8Array(16);\n    getRandomValues(rnds);\n\n    // Set version (4) and variant (RFC4122)\n    rnds[6] = (rnds[6] & 0x0f) | 0x40; // version 4\n    rnds[8] = (rnds[8] & 0x3f) | 0x80; // variant\n\n    return (\n      decimalToHex[rnds[0]] +\n      decimalToHex[rnds[1]] +\n      decimalToHex[rnds[2]] +\n      decimalToHex[rnds[3]] +\n      \"-\" +\n      decimalToHex[rnds[4]] +\n      decimalToHex[rnds[5]] +\n      \"-\" +\n      decimalToHex[rnds[6]] +\n      decimalToHex[rnds[7]] +\n      \"-\" +\n      decimalToHex[rnds[8]] +\n      decimalToHex[rnds[9]] +\n      \"-\" +\n      decimalToHex[rnds[10]] +\n      decimalToHex[rnds[11]] +\n      decimalToHex[rnds[12]] +\n      decimalToHex[rnds[13]] +\n      decimalToHex[rnds[14]] +\n      decimalToHex[rnds[15]]\n    );\n  };\n}\n"
  },
  {
    "path": "packages/core/src/submodules/serde/value/NumericValue.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { NumericValue, nv } from \"./NumericValue\";\n\ndescribe(NumericValue.name, () => {\n  it(\"holds a string representation of a numeric value\", () => {\n    const num = nv(\"1.0\");\n    expect(num).toBeInstanceOf(NumericValue);\n    expect(num.string).toEqual(\"1.0\");\n    expect(num.type).toEqual(\"bigDecimal\");\n  });\n\n  it(\"allows only numeric digits and at most one decimal point\", () => {\n    expect(() => nv(\"a\")).toThrow();\n    expect(() => nv(\"1.0.1\")).toThrow();\n    expect(() => nv(\"-10.1\")).not.toThrow();\n    expect(() => nv(\"-.101\")).not.toThrow();\n  });\n\n  it(\"has a custom instanceof check\", () => {\n    const isInstance = [\n      nv(\"0\"),\n      nv(\"-0.00\"),\n      new NumericValue(\"0\", \"bigDecimal\"),\n      new NumericValue(\"-0.00\", \"bigDecimal\"),\n      {\n        string: \"-.123\",\n        type: \"bigDecimal\",\n      },\n      (() => {\n        const x = {};\n        Object.setPrototypeOf(x, NumericValue.prototype);\n        return x;\n      })(),\n      (() => {\n        function F() {}\n        F.prototype = Object.create(NumericValue.prototype);\n        // @ts-ignore\n        return new F();\n      })(),\n      (() => {\n        return new (class extends NumericValue {})(\"0\", \"bigDecimal\");\n      })(),\n    ] as unknown[];\n\n    const isNotInstance = [\n      BigInt(0),\n      \"-0.00\",\n      {\n        string: \"abcd\",\n        type: \"bigDecimal\",\n      },\n      (() => {\n        const x = {};\n        Object.setPrototypeOf(x, NumericValue);\n        return x;\n      })(),\n    ] as unknown[];\n\n    for (const instance of isInstance) {\n      expect(instance).toBeInstanceOf(NumericValue);\n    }\n\n    for (const instance of isNotInstance) {\n      expect(instance).not.toBeInstanceOf(NumericValue);\n    }\n  });\n});\n"
  },
  {
    "path": "packages/core/src/submodules/serde/value/NumericValue.ts",
    "content": "/**\n * Types which may be represented by {@link NumericValue}.\n *\n * There is currently only one option, because BigInteger and Long should\n * use JS BigInt directly, and all other numeric types can be contained in JS Number.\n *\n * @public\n */\nexport type NumericType = \"bigDecimal\";\n\n/**\n * @internal\n */\nconst format = /^-?\\d*(\\.\\d+)?$/;\n\n/**\n * Serialization container for Smithy simple types that do not have a\n * direct JavaScript runtime representation.\n *\n * This container does not perform numeric mathematical operations.\n * It is a container for discerning a value's true type.\n *\n * It allows storage of numeric types not representable in JS without\n * making a decision on what numeric library to use.\n *\n * @public\n */\nexport class NumericValue {\n  public constructor(\n    public readonly string: string,\n    public readonly type: NumericType\n  ) {\n    if (!format.test(string)) {\n      throw new Error(\n        `@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point \".\", and an optional negation prefix \"-\".`\n      );\n    }\n  }\n\n  public toString() {\n    return this.string;\n  }\n\n  public static [Symbol.hasInstance](object: unknown) {\n    if (!object || typeof object !== \"object\") {\n      return false;\n    }\n    const _nv = object as NumericValue;\n    return NumericValue.prototype.isPrototypeOf(object) || (_nv.type === \"bigDecimal\" && format.test(_nv.string));\n  }\n}\n\n/**\n * Serde shortcut.\n * @internal\n */\nexport function nv(input: string | unknown): NumericValue {\n  return new NumericValue(String(input), \"bigDecimal\");\n}\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/DefaultIdentityProviderConfig.ts",
    "content": "import type { HttpAuthSchemeId, Identity, IdentityProvider, IdentityProviderConfig } from \"@smithy/types\";\n\n/**\n * Default implementation of IdentityProviderConfig\n * @internal\n */\nexport class DefaultIdentityProviderConfig implements IdentityProviderConfig {\n  private authSchemes: Map<HttpAuthSchemeId, IdentityProvider<Identity>> = new Map();\n\n  /**\n   * Creates an IdentityProviderConfig with a record of scheme IDs to identity providers.\n   *\n   * @param config scheme IDs and identity providers to configure\n   */\n  constructor(config: Record<HttpAuthSchemeId, IdentityProvider<Identity> | undefined>) {\n    for (const key in config) {\n      const value = config[key];\n      if (value !== undefined) {\n        this.authSchemes.set(key, value);\n      }\n    }\n  }\n\n  public getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined {\n    return this.authSchemes.get(schemeId);\n  }\n}\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport {\n  HttpApiKeyAuthLocation,\n  type ApiKeyIdentity,\n  type HttpSigner,\n  type HttpRequest as IHttpRequest,\n} from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport class HttpApiKeyAuthSigner implements HttpSigner {\n  public async sign(\n    httpRequest: HttpRequest,\n    identity: ApiKeyIdentity,\n    signingProperties: Record<string, any>\n  ): Promise<IHttpRequest> {\n    if (!signingProperties) {\n      throw new Error(\n        \"request could not be signed with `apiKey` since the `name` and `in` signer properties are missing\"\n      );\n    }\n    if (!signingProperties.name) {\n      throw new Error(\"request could not be signed with `apiKey` since the `name` signer property is missing\");\n    }\n    if (!signingProperties.in) {\n      throw new Error(\"request could not be signed with `apiKey` since the `in` signer property is missing\");\n    }\n    if (!identity.apiKey) {\n      throw new Error(\"request could not be signed with `apiKey` since the `apiKey` is not defined\");\n    }\n    const clonedRequest = HttpRequest.clone(httpRequest);\n    if (signingProperties.in === HttpApiKeyAuthLocation.QUERY) {\n      clonedRequest.query[signingProperties.name] = identity.apiKey;\n    } else if (signingProperties.in === HttpApiKeyAuthLocation.HEADER) {\n      clonedRequest.headers[signingProperties.name] = signingProperties.scheme\n        ? `${signingProperties.scheme} ${identity.apiKey}`\n        : identity.apiKey;\n    } else {\n      throw new Error(\n        \"request can only be signed with `apiKey` locations `query` or `header`, \" +\n          \"but found: `\" +\n          signingProperties.in +\n          \"`\"\n      );\n    }\n    return clonedRequest;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpSigner, HttpRequest as IHttpRequest, TokenIdentity } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport class HttpBearerAuthSigner implements HttpSigner {\n  public async sign(\n    httpRequest: HttpRequest,\n    identity: TokenIdentity,\n    signingProperties: Record<string, any>\n  ): Promise<IHttpRequest> {\n    const clonedRequest = HttpRequest.clone(httpRequest);\n    if (!identity.token) {\n      throw new Error(\"request could not be signed with `token` since the `token` is not defined\");\n    }\n    clonedRequest.headers[\"Authorization\"] = `Bearer ${identity.token}`;\n    return clonedRequest;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/httpAuthSchemes/index.ts",
    "content": "export * from \"./httpApiKeyAuth\";\nexport * from \"./httpBearerAuth\";\nexport * from \"./noAuth\";\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/httpAuthSchemes/noAuth.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { HttpRequest, HttpSigner, Identity } from \"@smithy/types\";\n\n/**\n * Signer for the synthetic @smithy.api#noAuth auth scheme.\n * @internal\n */\nexport class NoAuthSigner implements HttpSigner {\n  async sign(\n    httpRequest: HttpRequest,\n    identity: Identity,\n    signingProperties: Record<string, unknown>\n  ): Promise<HttpRequest> {\n    return httpRequest;\n  }\n}\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/index.ts",
    "content": "export * from \"./DefaultIdentityProviderConfig\";\nexport * from \"./httpAuthSchemes\";\nexport * from \"./memoizeIdentityProvider\";\n"
  },
  {
    "path": "packages/core/src/util-identity-and-auth/memoizeIdentityProvider.ts",
    "content": "import type { Identity, IdentityProvider } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const createIsIdentityExpiredFunction = (expirationMs: number) =>\n  function isIdentityExpired(identity: Identity) {\n    return doesIdentityRequireRefresh(identity) && identity.expiration!.getTime() - Date.now() < expirationMs;\n  };\n\n/**\n * This may need to be configurable in the future, but for now it is defaulted to 5min.\n *\n * @internal\n */\nexport const EXPIRATION_MS = 300_000;\n\n/**\n * @internal\n */\nexport const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);\n\n/**\n * @internal\n */\nexport const doesIdentityRequireRefresh = (identity: Identity) => identity.expiration !== undefined;\n\n/**\n * @internal\n */\nexport interface MemoizedIdentityProvider<IdentityT extends Identity> {\n  (options?: Record<string, any> & { forceRefresh?: boolean }): Promise<IdentityT>;\n}\n\n/**\n * @internal\n */\nexport const memoizeIdentityProvider = <IdentityT extends Identity>(\n  provider: IdentityT | IdentityProvider<IdentityT> | undefined,\n  isExpired: (resolved: Identity) => boolean,\n  requiresRefresh: (resolved: Identity) => boolean\n): MemoizedIdentityProvider<IdentityT> | undefined => {\n  if (provider === undefined) {\n    return undefined;\n  }\n  const normalizedProvider: IdentityProvider<IdentityT> =\n    typeof provider !== \"function\" ? async () => Promise.resolve(provider) : provider;\n  let resolved: IdentityT;\n  let pending: Promise<IdentityT> | undefined;\n  let hasResult: boolean;\n  let isConstant = false;\n  // Wrapper over supplied provider with side effect to handle concurrent invocation.\n  const coalesceProvider: MemoizedIdentityProvider<IdentityT> = async (options) => {\n    if (!pending) {\n      pending = normalizedProvider(options);\n    }\n    try {\n      resolved = await pending;\n      hasResult = true;\n      isConstant = false;\n    } finally {\n      pending = undefined;\n    }\n    return resolved;\n  };\n\n  if (isExpired === undefined) {\n    // This is a static memoization; no need to incorporate refreshing unless using forceRefresh;\n    return async (options) => {\n      if (!hasResult || options?.forceRefresh) {\n        resolved = await coalesceProvider(options);\n      }\n      return resolved;\n    };\n  }\n\n  return async (options) => {\n    if (!hasResult || options?.forceRefresh) {\n      resolved = await coalesceProvider(options);\n    }\n    if (isConstant) {\n      return resolved;\n    }\n\n    if (!requiresRefresh(resolved)) {\n      isConstant = true;\n      return resolved;\n    }\n    if (isExpired(resolved)) {\n      await coalesceProvider(options);\n      return resolved;\n    }\n    return resolved;\n  };\n};\n"
  },
  {
    "path": "packages/core/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\",\n    \"paths\": {\n      \"@smithy/core/checksum\": [\"./src/submodules/checksum/index.ts\"],\n      \"@smithy/core/cbor\": [\"./src/submodules/cbor/index.ts\"],\n      \"@smithy/core/client\": [\"./src/submodules/client/index.ts\"],\n      \"@smithy/core/config\": [\"./src/submodules/config/index.ts\"],\n      \"@smithy/core/endpoints\": [\"./src/submodules/endpoints/index.ts\"],\n      \"@smithy/core/event-streams\": [\"./src/submodules/event-streams/index.ts\"],\n      \"@smithy/core/retry\": [\"./src/submodules/retry/index.ts\"],\n      \"@smithy/core/protocols\": [\"./src/submodules/protocols/index.ts\"],\n      \"@smithy/core/schema\": [\"./src/submodules/schema/index.ts\"],\n      \"@smithy/core/serde\": [\"./src/submodules/serde/index.ts\"]\n    }\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/core/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\",\n    \"paths\": {\n      \"@smithy/core/checksum\": [\"./src/submodules/checksum/index.ts\"],\n      \"@smithy/core/cbor\": [\"./src/submodules/cbor/index.ts\"],\n      \"@smithy/core/config\": [\"./src/submodules/config/index.ts\"],\n      \"@smithy/core/client\": [\"./src/submodules/client/index.ts\"],\n      \"@smithy/core/retry\": [\"./src/submodules/retry/index.ts\"],\n      \"@smithy/core/protocols\": [\"./src/submodules/protocols/index.ts\"],\n      \"@smithy/core/serde\": [\"./src/submodules/serde/index.ts\"],\n      \"@smithy/core/schema\": [\"./src/submodules/schema/index.ts\"],\n      \"@smithy/core/event-streams\": [\"./src/submodules/event-streams/index.ts\"],\n      \"@smithy/core/endpoints\": [\"./src/submodules/endpoints/index.ts\"]\n    }\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/core/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\",\n    \"paths\": {\n      \"@smithy/core/checksum\": [\"./src/submodules/checksum/index.ts\"],\n      \"@smithy/core/cbor\": [\"./src/submodules/cbor/index.ts\"],\n      \"@smithy/core/config\": [\"./src/submodules/config/index.ts\"],\n      \"@smithy/core/client\": [\"./src/submodules/client/index.ts\"],\n      \"@smithy/core/retry\": [\"./src/submodules/retry/index.ts\"],\n      \"@smithy/core/protocols\": [\"./src/submodules/protocols/index.ts\"],\n      \"@smithy/core/serde\": [\"./src/submodules/serde/index.ts\"],\n      \"@smithy/core/schema\": [\"./src/submodules/schema/index.ts\"],\n      \"@smithy/core/event-streams\": [\"./src/submodules/event-streams/index.ts\"],\n      \"@smithy/core/endpoints\": [\"./src/submodules/endpoints/index.ts\"]\n    }\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/core/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{e2e,browser}.spec.ts\"],\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n    hideSkippedTests: true,\n  },\n});\n"
  },
  {
    "path": "packages/core/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n    hideSkippedTests: true,\n  },\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/credential-provider-imds/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 4.2.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/node-config-provider@4.3.14\n  - @smithy/property-provider@4.2.14\n  - @smithy/url-parser@4.2.14\n\n## 4.2.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/node-config-provider@4.3.13\n  - @smithy/property-provider@4.2.13\n  - @smithy/url-parser@4.2.13\n\n## 4.2.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/node-config-provider@4.3.12\n  - @smithy/property-provider@4.2.12\n  - @smithy/url-parser@4.2.12\n\n## 4.2.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/node-config-provider@4.3.11\n  - @smithy/property-provider@4.2.11\n  - @smithy/url-parser@4.2.11\n\n## 4.2.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/node-config-provider@4.3.10\n  - @smithy/property-provider@4.2.10\n  - @smithy/url-parser@4.2.10\n\n## 4.2.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/property-provider@4.2.9\n  - @smithy/types@4.12.1\n  - @smithy/url-parser@4.2.9\n\n## 4.2.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/node-config-provider@4.3.8\n  - @smithy/property-provider@4.2.8\n  - @smithy/url-parser@4.2.8\n\n## 4.2.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/node-config-provider@4.3.7\n  - @smithy/property-provider@4.2.7\n  - @smithy/url-parser@4.2.7\n\n## 4.2.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/node-config-provider@4.3.6\n  - @smithy/property-provider@4.2.6\n  - @smithy/url-parser@4.2.6\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/node-config-provider@4.3.5\n  - @smithy/property-provider@4.2.5\n  - @smithy/url-parser@4.2.5\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/node-config-provider@4.3.4\n  - @smithy/property-provider@4.2.4\n  - @smithy/url-parser@4.2.4\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/node-config-provider@4.3.3\n  - @smithy/property-provider@4.2.3\n  - @smithy/url-parser@4.2.3\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/node-config-provider@4.3.2\n  - @smithy/property-provider@4.2.2\n  - @smithy/url-parser@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/node-config-provider@4.3.1\n  - @smithy/property-provider@4.2.1\n  - @smithy/url-parser@4.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/property-provider@4.2.0\n  - @smithy/types@4.6.0\n  - @smithy/url-parser@4.2.0\n\n## 4.1.2\n\n### Patch Changes\n\n- @smithy/node-config-provider@4.2.2\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/node-config-provider@4.2.1\n  - @smithy/property-provider@4.1.1\n  - @smithy/url-parser@4.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/property-provider@4.1.0\n  - @smithy/url-parser@4.1.0\n  - @smithy/types@4.4.0\n\n## 4.0.7\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/node-config-provider@4.1.4\n  - @smithy/property-provider@4.0.5\n  - @smithy/url-parser@4.0.5\n\n## 4.0.6\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/node-config-provider@4.1.3\n  - @smithy/property-provider@4.0.4\n  - @smithy/url-parser@4.0.4\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/node-config-provider@4.1.2\n  - @smithy/property-provider@4.0.3\n  - @smithy/url-parser@4.0.3\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n\n## 4.0.3\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n\n## 4.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/types@4.2.0\n  - @smithy/node-config-provider@4.0.2\n  - @smithy/property-provider@4.0.2\n  - @smithy/url-parser@4.0.2\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/node-config-provider@4.0.1\n  - @smithy/property-provider@4.0.1\n  - @smithy/url-parser@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/property-provider@4.0.0\n  - @smithy/types@4.0.0\n  - @smithy/url-parser@4.0.0\n\n## 3.2.8\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/node-config-provider@3.1.12\n  - @smithy/property-provider@3.1.11\n  - @smithy/url-parser@3.0.11\n\n## 3.2.7\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/node-config-provider@3.1.11\n  - @smithy/property-provider@3.1.10\n  - @smithy/url-parser@3.0.10\n\n## 3.2.6\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/node-config-provider@3.1.10\n  - @smithy/property-provider@3.1.9\n  - @smithy/url-parser@3.0.9\n\n## 3.2.5\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/node-config-provider@3.1.9\n  - @smithy/property-provider@3.1.8\n  - @smithy/url-parser@3.0.8\n\n## 3.2.4\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/node-config-provider@3.1.8\n  - @smithy/property-provider@3.1.7\n  - @smithy/url-parser@3.0.7\n\n## 3.2.3\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/node-config-provider@3.1.7\n  - @smithy/property-provider@3.1.6\n  - @smithy/url-parser@3.0.6\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/node-config-provider@3.1.6\n  - @smithy/property-provider@3.1.5\n  - @smithy/url-parser@3.0.5\n\n## 3.2.1\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/node-config-provider@3.1.5\n  - @smithy/property-provider@3.1.4\n  - @smithy/url-parser@3.0.4\n\n## 3.2.0\n\n### Minor Changes\n\n- 3d72b04: sources accountId from IMDS\n\n## 3.1.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@3.1.4\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/node-config-provider@3.1.3\n  - @smithy/property-provider@3.1.3\n  - @smithy/url-parser@3.0.3\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/node-config-provider@3.1.2\n  - @smithy/property-provider@3.1.2\n  - @smithy/url-parser@3.0.2\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/node-config-provider@3.1.1\n  - @smithy/property-provider@3.1.1\n  - @smithy/url-parser@3.0.1\n\n## 3.1.0\n\n### Minor Changes\n\n- 1cdd3be0: new logging-compatible signature for CredentialsProviderError\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n  - @smithy/node-config-provider@3.1.0\n  - @smithy/property-provider@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/node-config-provider@3.0.0\n  - @smithy/property-provider@3.0.0\n  - @smithy/url-parser@3.0.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/property-provider@2.2.0\n  - @smithy/url-parser@2.2.0\n  - @smithy/types@2.12.0\n\n## 2.2.6\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/node-config-provider@2.2.5\n  - @smithy/property-provider@2.1.4\n  - @smithy/url-parser@2.1.4\n\n## 2.2.5\n\n### Patch Changes\n\n- eea7af7d: fix: credential expiration extension log message\n- e136eb93: exporting Endpoint from credential-provider-imds to use for JSv3 EC2 IMDS utils\n\n## 2.2.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.2.4\n\n## 2.2.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/node-config-provider@2.2.3\n  - @smithy/property-provider@2.1.3\n  - @smithy/url-parser@2.1.3\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/node-config-provider@2.2.2\n  - @smithy/property-provider@2.1.2\n  - @smithy/url-parser@2.1.2\n\n## 2.2.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/property-provider@2.1.1\n  - @smithy/types@2.9.1\n  - @smithy/url-parser@2.1.1\n\n## 2.2.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/property-provider@2.1.0\n  - @smithy/url-parser@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/node-config-provider@2.1.9\n  - @smithy/property-provider@2.0.17\n  - @smithy/url-parser@2.0.16\n\n## 2.1.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.8\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/node-config-provider@2.1.7\n  - @smithy/property-provider@2.0.16\n  - @smithy/url-parser@2.0.15\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/node-config-provider@2.1.6\n  - @smithy/property-provider@2.0.15\n  - @smithy/url-parser@2.0.14\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/node-config-provider@2.1.5\n  - @smithy/property-provider@2.0.14\n  - @smithy/url-parser@2.0.13\n\n## 2.1.0\n\n### Minor Changes\n\n- 4693031d: Add IMDSv1 toggle.\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.4\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/node-config-provider@2.1.3\n  - @smithy/property-provider@2.0.13\n  - @smithy/url-parser@2.0.12\n\n## 2.0.17\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.1.2\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/node-config-provider@2.1.1\n  - @smithy/property-provider@2.0.12\n  - @smithy/url-parser@2.0.11\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [7b568c39]\n  - @smithy/node-config-provider@2.1.0\n\n## 2.0.14\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.14\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/node-config-provider@2.0.13\n  - @smithy/property-provider@2.0.11\n  - @smithy/url-parser@2.0.10\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/node-config-provider@2.0.12\n  - @smithy/property-provider@2.0.10\n  - @smithy/url-parser@2.0.9\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/node-config-provider@2.0.11\n  - @smithy/property-provider@2.0.9\n  - @smithy/url-parser@2.0.8\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/node-config-provider@2.0.10\n  - @smithy/property-provider@2.0.8\n  - @smithy/url-parser@2.0.7\n\n## 2.0.9\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.9\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/node-config-provider@2.0.8\n  - @smithy/property-provider@2.0.7\n  - @smithy/url-parser@2.0.6\n\n## 2.0.7\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.0.7\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [a7598a5d]\n  - @smithy/property-provider@2.0.6\n  - @smithy/node-config-provider@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/node-config-provider@2.0.5\n  - @smithy/property-provider@2.0.5\n  - @smithy/url-parser@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/node-config-provider@2.0.4\n  - @smithy/property-provider@2.0.4\n  - @smithy/url-parser@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/node-config-provider@2.0.3\n  - @smithy/property-provider@2.0.3\n  - @smithy/url-parser@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/node-config-provider@2.0.2\n  - @smithy/property-provider@2.0.2\n  - @smithy/url-parser@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/node-config-provider@2.0.1\n  - @smithy/property-provider@2.0.1\n  - @smithy/url-parser@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/node-config-provider@2.0.0\n  - @smithy/property-provider@2.0.0\n  - @smithy/url-parser@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/node-config-provider@1.1.0\n  - @smithy/property-provider@1.2.0\n  - @smithy/types@1.2.0\n  - @smithy/url-parser@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [4ad43c6a]\n- Updated dependencies [d90a45b5]\n- Updated dependencies [5f7bcc79]\n  - @smithy/types@2.0.0\n  - @smithy/property-provider@1.1.0\n  - @smithy/node-config-provider@1.0.3\n  - @smithy/url-parser@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/node-config-provider@1.0.2\n  - @smithy/property-provider@1.0.2\n  - @smithy/url-parser@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/node-config-provider@1.0.1\n  - @smithy/property-provider@1.0.1\n  - @smithy/url-parser@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/credential-provider-imds](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/credential-provider-imds/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/credential-provider-imds/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/credential-provider-imds/README.md",
    "content": "# @smithy/credential-provider-imds\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/credential-provider-imds/latest.svg)](https://www.npmjs.com/package/@smithy/credential-provider-imds)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/credential-provider-imds.svg)](https://www.npmjs.com/package/@smithy/credential-provider-imds)\n\n### :warning: Internal API :warning:\n\n> This is an internal package.\n> That means this is used as a dependency for other, public packages, but\n> should not be taken directly as a dependency in your application's `package.json`.\n\n> If you are updating the version of this package, for example to bring in a\n> bug-fix, you should do so by updating your application lockfile with\n> e.g. `npm up @scope/package` or equivalent command in another\n> package manager, rather than taking a direct dependency.\n\n---\n\nPlease use [@smithy/credential-providers](https://www.npmjs.com/package/@smithy/credential-providers)\ninstead.\n"
  },
  {
    "path": "packages/credential-provider-imds/package.json",
    "content": "{\n  \"name\": \"@smithy/credential-provider-imds\",\n  \"version\": \"4.3.3\",\n  \"description\": \"AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline credential-provider-imds\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"keywords\": [\n    \"aws\",\n    \"credentials\"\n  ],\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/credential-provider-imds\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/credential-provider-imds\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/src/config/Endpoint.ts",
    "content": "/**\n * @internal\n */\nexport enum Endpoint {\n  IPv4 = \"http://169.254.169.254\",\n  IPv6 = \"http://[fd00:ec2::254]\",\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/src/config/EndpointConfigOptions.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { CONFIG_ENDPOINT_NAME, ENDPOINT_CONFIG_OPTIONS, ENV_ENDPOINT_NAME } from \"./EndpointConfigOptions\";\n\ndescribe(\"ENDPOINT_CONFIG_OPTIONS\", () => {\n  describe(\"environmentVariableSelector\", () => {\n    const { environmentVariableSelector } = ENDPOINT_CONFIG_OPTIONS;\n    it.each([undefined, \"mockEndpoint\"])(`when env[${ENV_ENDPOINT_NAME}]: %s`, (mockEndpoint) => {\n      expect(environmentVariableSelector({ [ENV_ENDPOINT_NAME]: mockEndpoint })).toBe(mockEndpoint);\n    });\n  });\n\n  describe(\"configFileSelector\", () => {\n    const { configFileSelector } = ENDPOINT_CONFIG_OPTIONS;\n    it.each([undefined, \"mockEndpoint\"])(`when env[${CONFIG_ENDPOINT_NAME}]: %s`, (mockEndpoint) => {\n      expect(configFileSelector({ [CONFIG_ENDPOINT_NAME]: mockEndpoint })).toBe(mockEndpoint);\n    });\n  });\n\n  it(\"default returns undefined\", () => {\n    const { default: defaultKey } = ENDPOINT_CONFIG_OPTIONS;\n    expect(defaultKey).toBe(undefined);\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/config/EndpointConfigOptions.ts",
    "content": "import type { LoadedConfigSelectors } from \"@smithy/core/config\";\n\n/**\n * @internal\n */\nexport const ENV_ENDPOINT_NAME = \"AWS_EC2_METADATA_SERVICE_ENDPOINT\";\n/**\n * @internal\n */\nexport const CONFIG_ENDPOINT_NAME = \"ec2_metadata_service_endpoint\";\n\n/**\n * @internal\n */\nexport const ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<string | undefined> = {\n  environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],\n  configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],\n  default: undefined,\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/config/EndpointMode.ts",
    "content": "/**\n * @internal\n */\nexport enum EndpointMode {\n  IPv4 = \"IPv4\",\n  IPv6 = \"IPv6\",\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/src/config/EndpointModeConfigOptions.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { EndpointMode } from \"./EndpointMode\";\nimport {\n  CONFIG_ENDPOINT_MODE_NAME,\n  ENDPOINT_MODE_CONFIG_OPTIONS,\n  ENV_ENDPOINT_MODE_NAME,\n} from \"./EndpointModeConfigOptions\";\n\ndescribe(\"ENDPOINT_MODE_CONFIG_OPTIONS\", () => {\n  describe(\"environmentVariableSelector\", () => {\n    const { environmentVariableSelector } = ENDPOINT_MODE_CONFIG_OPTIONS;\n    it.each([undefined, \"mockEndpointMode\"])(`when env[${ENV_ENDPOINT_MODE_NAME}]: %s`, (mockEndpoint) => {\n      expect(environmentVariableSelector({ [ENV_ENDPOINT_MODE_NAME]: mockEndpoint })).toBe(mockEndpoint);\n    });\n  });\n\n  describe(\"configFileSelector\", () => {\n    const { configFileSelector } = ENDPOINT_MODE_CONFIG_OPTIONS;\n    it.each([undefined, \"mockEndpointMode\"])(`when env[${CONFIG_ENDPOINT_MODE_NAME}]: %s`, (mockEndpoint) => {\n      expect(configFileSelector({ [CONFIG_ENDPOINT_MODE_NAME]: mockEndpoint })).toBe(mockEndpoint);\n    });\n  });\n\n  it(`default returns ${EndpointMode.IPv4}`, () => {\n    const { default: defaultKey } = ENDPOINT_MODE_CONFIG_OPTIONS;\n    expect(defaultKey).toBe(EndpointMode.IPv4);\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/config/EndpointModeConfigOptions.ts",
    "content": "import type { LoadedConfigSelectors } from \"@smithy/core/config\";\n\nimport { EndpointMode } from \"./EndpointMode\";\n\n/**\n * @internal\n */\nexport const ENV_ENDPOINT_MODE_NAME = \"AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE\";\n/**\n * @internal\n */\nexport const CONFIG_ENDPOINT_MODE_NAME = \"ec2_metadata_service_endpoint_mode\";\n\n/**\n * @internal\n */\nexport const ENDPOINT_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<string | undefined> = {\n  environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],\n  configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],\n  default: EndpointMode.IPv4,\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/error/InstanceMetadataV1FallbackError.ts",
    "content": "import { CredentialsProviderError } from \"@smithy/core/config\";\n\n/**\n * A specific sub-case of CredentialsProviderError, when the IMDSv1 fallback\n * has been attempted but shut off by SDK configuration.\n *\n * @public\n */\nexport class InstanceMetadataV1FallbackError extends CredentialsProviderError {\n  public name = \"InstanceMetadataV1FallbackError\";\n\n  constructor(\n    message: string,\n    public readonly tryNextLink: boolean = true\n  ) {\n    super(message, tryNextLink);\n    Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype);\n  }\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/src/fromContainerMetadata.spec.ts",
    "content": "import { afterAll, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  ENV_CMDS_AUTH_TOKEN,\n  ENV_CMDS_FULL_URI,\n  ENV_CMDS_RELATIVE_URI,\n  fromContainerMetadata,\n} from \"./fromContainerMetadata\";\nimport { fromImdsCredentials, type ImdsCredentials } from \"./remoteProvider/ImdsCredentials\";\nimport { httpRequest } from \"./remoteProvider/httpRequest\";\n\nconst mockHttpRequest = <any>httpRequest;\nvi.mock(\"./remoteProvider/httpRequest\");\n\nconst relativeUri = process.env[ENV_CMDS_RELATIVE_URI];\nconst fullUri = process.env[ENV_CMDS_FULL_URI];\nconst authToken = process.env[ENV_CMDS_AUTH_TOKEN];\n\nbeforeEach(() => {\n  mockHttpRequest.mockReset();\n  delete process.env[ENV_CMDS_RELATIVE_URI];\n  delete process.env[ENV_CMDS_FULL_URI];\n  delete process.env[ENV_CMDS_AUTH_TOKEN];\n});\n\nafterAll(() => {\n  process.env[ENV_CMDS_RELATIVE_URI] = relativeUri;\n  process.env[ENV_CMDS_FULL_URI] = fullUri;\n  process.env[ENV_CMDS_AUTH_TOKEN] = authToken;\n});\n\ndescribe(\"fromContainerMetadata\", () => {\n  const creds: ImdsCredentials = Object.freeze({\n    AccessKeyId: \"foo\",\n    SecretAccessKey: \"bar\",\n    Token: \"baz\",\n    Expiration: new Date().toISOString(),\n  });\n\n  it(\"should reject the promise with a terminal error if the container credentials environment variable is not set\", async () => {\n    await fromContainerMetadata()().then(\n      () => {\n        throw new Error(\"The promise should have been rejected\");\n      },\n      (err) => {\n        expect((err as any).tryNextLink).toBeFalsy();\n      }\n    );\n  });\n\n  it(`should inject an authorization header containing the contents of the ${ENV_CMDS_AUTH_TOKEN} environment variable if defined`, async () => {\n    const token = \"Basic abcd\";\n    process.env[ENV_CMDS_FULL_URI] = \"http://localhost:8080/path\";\n    process.env[ENV_CMDS_AUTH_TOKEN] = token;\n    mockHttpRequest.mockReturnValue(Promise.resolve(JSON.stringify(creds)));\n\n    await fromContainerMetadata()();\n\n    expect(mockHttpRequest.mock.calls.length).toBe(1);\n    const [options = {}] = mockHttpRequest.mock.calls[0];\n    expect(options.headers).toMatchObject({\n      Authorization: token,\n    });\n  });\n\n  describe(ENV_CMDS_RELATIVE_URI, () => {\n    beforeEach(() => {\n      process.env[ENV_CMDS_RELATIVE_URI] = \"/relative/uri\";\n    });\n\n    it(\"should resolve credentials by fetching them from the container metadata service\", async () => {\n      mockHttpRequest.mockReturnValue(Promise.resolve(JSON.stringify(creds)));\n\n      expect(await fromContainerMetadata()()).toEqual(fromImdsCredentials(creds));\n    });\n\n    it(\"should retry the fetching operation up to maxRetries times\", async () => {\n      const maxRetries = 5;\n      for (let i = 0; i < maxRetries - 1; i++) {\n        mockHttpRequest.mockReturnValueOnce(Promise.reject(\"No!\"));\n      }\n      mockHttpRequest.mockReturnValueOnce(Promise.resolve(JSON.stringify(creds)));\n\n      expect(await fromContainerMetadata({ maxRetries })()).toEqual(fromImdsCredentials(creds));\n      expect(mockHttpRequest.mock.calls.length).toEqual(maxRetries);\n    });\n\n    it(\"should retry responses that receive invalid response values\", async () => {\n      for (const key of Object.keys(creds)) {\n        const invalidCreds: any = { ...creds };\n        delete invalidCreds[key];\n        mockHttpRequest.mockReturnValueOnce(Promise.resolve(JSON.stringify(invalidCreds)));\n      }\n      mockHttpRequest.mockReturnValueOnce(Promise.resolve(JSON.stringify(creds)));\n\n      await fromContainerMetadata({ maxRetries: 100 })();\n      expect(mockHttpRequest.mock.calls.length).toEqual(Object.keys(creds).length + 1);\n    });\n\n    it(\"should pass relevant configuration to httpRequest\", async () => {\n      const timeout = Math.ceil(Math.random() * 1000);\n      mockHttpRequest.mockReturnValue(Promise.resolve(JSON.stringify(creds)));\n      await fromContainerMetadata({ timeout })();\n      expect(mockHttpRequest.mock.calls.length).toEqual(1);\n      expect(mockHttpRequest.mock.calls[0][0]).toEqual({\n        hostname: \"169.254.170.2\",\n        path: process.env[ENV_CMDS_RELATIVE_URI],\n        timeout,\n      });\n    });\n  });\n\n  describe(ENV_CMDS_FULL_URI, () => {\n    it(\"should pass relevant configuration to httpRequest\", async () => {\n      process.env[ENV_CMDS_FULL_URI] = \"http://localhost:8080/path\";\n\n      const timeout = Math.ceil(Math.random() * 1000);\n      mockHttpRequest.mockReturnValue(Promise.resolve(JSON.stringify(creds)));\n      await fromContainerMetadata({ timeout })();\n      expect(mockHttpRequest.mock.calls.length).toEqual(1);\n      const { protocol, hostname, path, port, timeout: actualTimeout } = mockHttpRequest.mock.calls[0][0];\n      expect(protocol).toBe(\"http:\");\n      expect(hostname).toBe(\"localhost\");\n      expect(path).toBe(\"/path\");\n      expect(port).toBe(8080);\n      expect(actualTimeout).toBe(timeout);\n    });\n\n    it(`should prefer ${ENV_CMDS_RELATIVE_URI} to ${ENV_CMDS_FULL_URI}`, async () => {\n      process.env[ENV_CMDS_RELATIVE_URI] = \"foo\";\n      process.env[ENV_CMDS_FULL_URI] = \"http://localhost:8080/path\";\n\n      const timeout = Math.ceil(Math.random() * 1000);\n      mockHttpRequest.mockReturnValue(Promise.resolve(JSON.stringify(creds)));\n      await fromContainerMetadata({ timeout })();\n      expect(mockHttpRequest.mock.calls.length).toEqual(1);\n      expect(mockHttpRequest.mock.calls[0][0]).toEqual({\n        hostname: \"169.254.170.2\",\n        path: \"foo\",\n        timeout,\n      });\n    });\n\n    it(\"should reject the promise with a terminal error if a unexpected protocol is specified\", async () => {\n      process.env[ENV_CMDS_FULL_URI] = \"wss://localhost:8080/path\";\n\n      await fromContainerMetadata()().then(\n        () => {\n          throw new Error(\"The promise should have been rejected\");\n        },\n        (err) => {\n          expect((err as any).tryNextLink).toBeFalsy();\n        }\n      );\n    });\n\n    it(\"should reject the promise with a terminal error if a unexpected hostname is specified\", async () => {\n      process.env[ENV_CMDS_FULL_URI] = \"https://bucket.s3.amazonaws.com/key\";\n\n      await fromContainerMetadata()().then(\n        () => {\n          throw new Error(\"The promise should have been rejected\");\n        },\n        (err) => {\n          expect((err as any).tryNextLink).toBeFalsy();\n        }\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/fromContainerMetadata.ts",
    "content": "import type { RequestOptions } from \"node:http\";\nimport { parse } from \"node:url\";\nimport { CredentialsProviderError } from \"@smithy/core/config\";\nimport type { AwsCredentialIdentityProvider, Logger } from \"@smithy/types\";\n\nimport { fromImdsCredentials, isImdsCredentials } from \"./remoteProvider/ImdsCredentials\";\nimport { providerConfigFromInit, type RemoteProviderInit } from \"./remoteProvider/RemoteProviderInit\";\nimport { httpRequest } from \"./remoteProvider/httpRequest\";\nimport { retry } from \"./remoteProvider/retry\";\n\n/**\n * @internal\n */\nexport const ENV_CMDS_FULL_URI = \"AWS_CONTAINER_CREDENTIALS_FULL_URI\";\n/**\n * @internal\n */\nexport const ENV_CMDS_RELATIVE_URI = \"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\";\n/**\n * @internal\n */\nexport const ENV_CMDS_AUTH_TOKEN = \"AWS_CONTAINER_AUTHORIZATION_TOKEN\";\n\n/**\n * Creates a credential provider that will source credentials from the ECS\n * Container Metadata Service\n *\n * @internal\n */\nexport const fromContainerMetadata = (init: RemoteProviderInit = {}): AwsCredentialIdentityProvider => {\n  const { timeout, maxRetries } = providerConfigFromInit(init);\n  return () =>\n    retry(async () => {\n      const requestOptions = await getCmdsUri({ logger: init.logger });\n      const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));\n      if (!isImdsCredentials(credsResponse)) {\n        throw new CredentialsProviderError(\"Invalid response received from instance metadata service.\", {\n          logger: init.logger,\n        });\n      }\n      return fromImdsCredentials(credsResponse);\n    }, maxRetries);\n};\n\nconst requestFromEcsImds = async (timeout: number, options: RequestOptions): Promise<string> => {\n  if (process.env[ENV_CMDS_AUTH_TOKEN]) {\n    options.headers = {\n      ...options.headers,\n      Authorization: process.env[ENV_CMDS_AUTH_TOKEN],\n    };\n  }\n\n  const buffer = await httpRequest({\n    ...options,\n    timeout,\n  });\n  return buffer.toString();\n};\n\nconst CMDS_IP = \"169.254.170.2\";\nconst GREENGRASS_HOSTS = {\n  localhost: true,\n  \"127.0.0.1\": true,\n};\nconst GREENGRASS_PROTOCOLS = {\n  \"http:\": true,\n  \"https:\": true,\n};\n\nconst getCmdsUri = async ({ logger }: { logger?: Logger }): Promise<RequestOptions> => {\n  if (process.env[ENV_CMDS_RELATIVE_URI]) {\n    return {\n      hostname: CMDS_IP,\n      path: process.env[ENV_CMDS_RELATIVE_URI],\n    };\n  }\n\n  if (process.env[ENV_CMDS_FULL_URI]) {\n    const parsed = parse(process.env[ENV_CMDS_FULL_URI]!);\n    if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {\n      throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {\n        tryNextLink: false,\n        logger,\n      });\n    }\n\n    if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {\n      throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {\n        tryNextLink: false,\n        logger,\n      });\n    }\n\n    return {\n      ...parsed,\n      port: parsed.port ? parseInt(parsed.port, 10) : undefined,\n    };\n  }\n\n  throw new CredentialsProviderError(\n    \"The container metadata credential provider cannot be used unless\" +\n      ` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` +\n      \" variable is set\",\n    {\n      tryNextLink: false,\n      logger,\n    }\n  );\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/fromInstanceMetadata.spec.ts",
    "content": "import { CredentialsProviderError } from \"@smithy/core/config\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { InstanceMetadataV1FallbackError } from \"./error/InstanceMetadataV1FallbackError\";\nimport { fromInstanceMetadata } from \"./fromInstanceMetadata\";\nimport { fromImdsCredentials, isImdsCredentials } from \"./remoteProvider/ImdsCredentials\";\nimport { providerConfigFromInit } from \"./remoteProvider/RemoteProviderInit\";\nimport { httpRequest } from \"./remoteProvider/httpRequest\";\nimport { retry } from \"./remoteProvider/retry\";\nimport { getInstanceMetadataEndpoint } from \"./utils/getInstanceMetadataEndpoint\";\nimport { staticStabilityProvider } from \"./utils/staticStabilityProvider\";\n\nvi.mock(\"./remoteProvider/httpRequest\");\nvi.mock(\"./remoteProvider/ImdsCredentials\");\nvi.mock(\"./remoteProvider/retry\");\nvi.mock(\"./remoteProvider/RemoteProviderInit\");\nvi.mock(\"./utils/getInstanceMetadataEndpoint\");\nvi.mock(\"./utils/staticStabilityProvider\");\n\ndescribe(\"fromInstanceMetadata\", () => {\n  const hostname = \"127.0.0.1\";\n  const mockTimeout = 1000;\n  const mockMaxRetries = 3;\n  const mockToken = \"fooToken\";\n  const mockProfile = \"fooProfile\";\n\n  const mockTokenRequestOptions = {\n    hostname,\n    path: \"/latest/api/token\",\n    method: \"PUT\",\n    headers: {\n      \"x-aws-ec2-metadata-token-ttl-seconds\": \"21600\",\n    },\n    timeout: mockTimeout,\n  };\n\n  const mockProfileRequestOptions = {\n    hostname,\n    path: \"/latest/meta-data/iam/security-credentials/\",\n    timeout: mockTimeout,\n    headers: {\n      \"x-aws-ec2-metadata-token\": mockToken,\n    },\n  };\n\n  const ONE_HOUR_IN_FUTURE = new Date(Date.now() + 60 * 60 * 1000);\n  const mockImdsCreds = Object.freeze({\n    AccessKeyId: \"foo\",\n    SecretAccessKey: \"bar\",\n    Token: \"baz\",\n    Expiration: ONE_HOUR_IN_FUTURE.toISOString(),\n  });\n\n  const mockCreds = Object.freeze({\n    accessKeyId: mockImdsCreds.AccessKeyId,\n    secretAccessKey: mockImdsCreds.SecretAccessKey,\n    sessionToken: mockImdsCreds.Token,\n    expiration: new Date(mockImdsCreds.Expiration),\n  });\n\n  beforeEach(() => {\n    vi.mocked(staticStabilityProvider).mockImplementation((input) => input);\n    vi.mocked(getInstanceMetadataEndpoint).mockResolvedValue({ hostname } as any);\n    (isImdsCredentials as unknown as any).mockReturnValue(true);\n    vi.mocked(providerConfigFromInit).mockReturnValue({\n      timeout: mockTimeout,\n      maxRetries: mockMaxRetries,\n    });\n  });\n\n  afterEach(() => {\n    vi.resetAllMocks();\n  });\n\n  it(\"gets token and profile name to fetch credentials\", async () => {\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n\n    await expect(fromInstanceMetadata()()).resolves.toEqual(mockCreds);\n    expect(httpRequest).toHaveBeenCalledTimes(3);\n    expect(httpRequest).toHaveBeenNthCalledWith(1, mockTokenRequestOptions);\n    expect(httpRequest).toHaveBeenNthCalledWith(2, mockProfileRequestOptions);\n    expect(httpRequest).toHaveBeenNthCalledWith(3, {\n      ...mockProfileRequestOptions,\n      path: `${mockProfileRequestOptions.path}${mockProfile}`,\n    });\n  });\n\n  it(\"trims profile returned name from IMDS\", async () => {\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce((\"   \" + mockProfile + \"  \") as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n\n    await expect(fromInstanceMetadata()()).resolves.toEqual(mockCreds);\n    expect(httpRequest).toHaveBeenNthCalledWith(3, {\n      ...mockProfileRequestOptions,\n      path: `${mockProfileRequestOptions.path}${mockProfile}`,\n    });\n  });\n\n  it(\"passes {} to providerConfigFromInit if init not defined\", async () => {\n    vi.mocked(retry).mockResolvedValueOnce(mockProfile).mockResolvedValueOnce(mockCreds);\n\n    await expect(fromInstanceMetadata()()).resolves.toEqual(mockCreds);\n    expect(providerConfigFromInit).toHaveBeenCalledTimes(1);\n    expect(providerConfigFromInit).toHaveBeenCalledWith({});\n  });\n\n  it(\"passes init to providerConfigFromInit\", async () => {\n    vi.mocked(retry).mockResolvedValueOnce(mockProfile).mockResolvedValueOnce(mockCreds);\n\n    const init = { maxRetries: 5, timeout: 1213 };\n    await expect(fromInstanceMetadata(init)()).resolves.toEqual(mockCreds);\n    expect(providerConfigFromInit).toHaveBeenCalledTimes(1);\n    expect(providerConfigFromInit).toHaveBeenCalledWith(init);\n  });\n\n  it(\"passes maxRetries returned from providerConfigFromInit to retry\", async () => {\n    vi.mocked(retry).mockResolvedValueOnce(mockProfile).mockResolvedValueOnce(mockCreds);\n\n    await expect(fromInstanceMetadata()()).resolves.toEqual(mockCreds);\n    expect(retry).toHaveBeenCalledTimes(2);\n    expect(vi.mocked(retry).mock.calls[0][1]).toBe(mockMaxRetries);\n    expect(vi.mocked(retry).mock.calls[1][1]).toBe(mockMaxRetries);\n  });\n\n  it(\"throws CredentialsProviderError if credentials returned are incorrect\", async () => {\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    (isImdsCredentials as unknown as any).mockReturnValueOnce(false);\n\n    await expect(fromInstanceMetadata()()).rejects.toEqual(\n      new CredentialsProviderError(\"Invalid response received from instance metadata service.\")\n    );\n    expect(retry).toHaveBeenCalledTimes(2);\n    expect(httpRequest).toHaveBeenCalledTimes(3);\n    expect(isImdsCredentials).toHaveBeenCalledTimes(1);\n    expect(isImdsCredentials).toHaveBeenCalledWith(mockImdsCreds);\n    expect(fromImdsCredentials).not.toHaveBeenCalled();\n  });\n\n  it(\"throws Error if httpRequest for profile fails\", async () => {\n    const mockError = new Error(\"profile not found\");\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockRejectedValueOnce(mockError);\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n\n    await expect(fromInstanceMetadata()()).rejects.toEqual(mockError);\n    expect(retry).toHaveBeenCalledTimes(1);\n    expect(httpRequest).toHaveBeenCalledTimes(2);\n  });\n\n  it(\"throws Error if httpRequest for credentials fails\", async () => {\n    const mockError = new Error(\"creds not found\");\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockRejectedValueOnce(mockError);\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n\n    await expect(fromInstanceMetadata()()).rejects.toEqual(mockError);\n    expect(retry).toHaveBeenCalledTimes(2);\n    expect(httpRequest).toHaveBeenCalledTimes(3);\n    expect(fromImdsCredentials).not.toHaveBeenCalled();\n  });\n\n  it(\"throws SyntaxError if httpRequest returns unparseable creds\", async () => {\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(\".\" as any);\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n\n    await expect(fromInstanceMetadata()()).rejects.toThrow(\"Unexpected token\");\n    expect(retry).toHaveBeenCalledTimes(2);\n    expect(httpRequest).toHaveBeenCalledTimes(3);\n    expect(fromImdsCredentials).not.toHaveBeenCalled();\n  });\n\n  it(\"throws error if metadata token errors with statusCode 400\", async () => {\n    const tokenError = Object.assign(new Error(\"token not found\"), {\n      statusCode: 400,\n    });\n    vi.mocked(httpRequest).mockRejectedValueOnce(tokenError);\n\n    await expect(fromInstanceMetadata()()).rejects.toEqual(tokenError);\n  });\n\n  it(\"should call staticStabilityProvider with the credential loader\", async () => {\n    vi.mocked(httpRequest)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n\n    await fromInstanceMetadata()();\n    expect(vi.mocked(staticStabilityProvider)).toBeCalledTimes(1);\n  });\n\n  describe(\"disables fetching of token\", () => {\n    beforeEach(() => {\n      vi.mocked(retry).mockImplementation((fn: any) => fn());\n      vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n    });\n\n    it(\"when token fetch returns with TimeoutError\", async () => {\n      const tokenError = new Error(\"TimeoutError\");\n\n      vi.mocked(httpRequest)\n        .mockRejectedValueOnce(tokenError)\n        .mockResolvedValueOnce(mockProfile as any)\n        .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any)\n        .mockResolvedValueOnce(mockProfile as any)\n        .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n      const fromInstanceMetadataFunc = fromInstanceMetadata();\n      await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n      await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n    });\n\n    [403, 404, 405].forEach((statusCode) => {\n      it(`when token fetch errors with statusCode ${statusCode}`, async () => {\n        const tokenError = Object.assign(new Error(), { statusCode });\n\n        vi.mocked(httpRequest)\n          .mockRejectedValueOnce(tokenError)\n          .mockResolvedValueOnce(mockProfile as any)\n          .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any)\n          .mockResolvedValueOnce(mockProfile as any)\n          .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n        const fromInstanceMetadataFunc = fromInstanceMetadata();\n        await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n        await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n      });\n    });\n  });\n\n  it(\"uses insecure data flow once, if error is not TimeoutError\", async () => {\n    const tokenError = new Error(\"Error\");\n\n    vi.mocked(httpRequest)\n      .mockRejectedValueOnce(tokenError)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n\n    const fromInstanceMetadataFunc = fromInstanceMetadata();\n    await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n    await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n  });\n\n  it(\"uses insecure data flow once, if error statusCode is not 400, 403, 404, 405\", async () => {\n    const tokenError = Object.assign(new Error(\"Error\"), { statusCode: 406 });\n\n    vi.mocked(httpRequest)\n      .mockRejectedValueOnce(tokenError)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any)\n      .mockResolvedValueOnce(mockToken as any)\n      .mockResolvedValueOnce(mockProfile as any)\n      .mockResolvedValueOnce(JSON.stringify(mockImdsCreds) as any);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n\n    const fromInstanceMetadataFunc = fromInstanceMetadata();\n    await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n    await expect(fromInstanceMetadataFunc()).resolves.toEqual(mockCreds);\n  });\n\n  it(\"allows blocking imdsv1 fallback\", async () => {\n    const tokenError = Object.assign(new Error(\"Error\"), { statusCode: 406 });\n\n    vi.mocked(httpRequest).mockRejectedValueOnce(tokenError);\n\n    vi.mocked(retry).mockImplementation((fn: any) => fn());\n    vi.mocked(fromImdsCredentials).mockReturnValue(mockCreds);\n\n    const fromInstanceMetadataFunc = fromInstanceMetadata({\n      ec2MetadataV1Disabled: true,\n    });\n    await expect(() => fromInstanceMetadataFunc()).rejects.toBeInstanceOf(InstanceMetadataV1FallbackError);\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/fromInstanceMetadata.ts",
    "content": "import type { RequestOptions } from \"node:http\";\nimport { CredentialsProviderError, loadConfig } from \"@smithy/core/config\";\nimport type { AwsCredentialIdentity, Provider } from \"@smithy/types\";\n\nimport { InstanceMetadataV1FallbackError } from \"./error/InstanceMetadataV1FallbackError\";\nimport { fromImdsCredentials, isImdsCredentials } from \"./remoteProvider/ImdsCredentials\";\nimport { providerConfigFromInit, type RemoteProviderInit } from \"./remoteProvider/RemoteProviderInit\";\nimport { httpRequest } from \"./remoteProvider/httpRequest\";\nimport { retry } from \"./remoteProvider/retry\";\nimport type { InstanceMetadataCredentials } from \"./types\";\nimport { getInstanceMetadataEndpoint } from \"./utils/getInstanceMetadataEndpoint\";\nimport { staticStabilityProvider } from \"./utils/staticStabilityProvider\";\n\nconst IMDS_PATH = \"/latest/meta-data/iam/security-credentials/\";\nconst IMDS_TOKEN_PATH = \"/latest/api/token\";\nconst AWS_EC2_METADATA_V1_DISABLED = \"AWS_EC2_METADATA_V1_DISABLED\";\nconst PROFILE_AWS_EC2_METADATA_V1_DISABLED = \"ec2_metadata_v1_disabled\";\nconst X_AWS_EC2_METADATA_TOKEN = \"x-aws-ec2-metadata-token\";\n\n/**\n * Creates a credential provider that will source credentials from the EC2\n * Instance Metadata Service\n *\n * @internal\n */\nexport const fromInstanceMetadata = (init: RemoteProviderInit = {}): Provider<InstanceMetadataCredentials> =>\n  staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });\n\n/**\n * @internal\n */\nconst getInstanceMetadataProvider = (init: RemoteProviderInit = {}) => {\n  // when set to true, metadata service will not fetch token\n  let disableFetchToken = false;\n  const { logger, profile } = init;\n  const { timeout, maxRetries } = providerConfigFromInit(init);\n\n  const getCredentials = async (maxRetries: number, options: RequestOptions) => {\n    const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;\n\n    if (isImdsV1Fallback) {\n      let fallbackBlockedFromProfile = false;\n      let fallbackBlockedFromProcessEnv = false;\n\n      const configValue = await loadConfig(\n        {\n          environmentVariableSelector: (env) => {\n            const envValue = env[AWS_EC2_METADATA_V1_DISABLED];\n            fallbackBlockedFromProcessEnv = !!envValue && envValue !== \"false\";\n            if (envValue === undefined) {\n              throw new CredentialsProviderError(\n                `${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`,\n                { logger: init.logger }\n              );\n            }\n            return fallbackBlockedFromProcessEnv;\n          },\n          configFileSelector: (profile) => {\n            const profileValue = profile[PROFILE_AWS_EC2_METADATA_V1_DISABLED];\n            fallbackBlockedFromProfile = !!profileValue && profileValue !== \"false\";\n            return fallbackBlockedFromProfile;\n          },\n          default: false,\n        },\n        {\n          profile,\n        }\n      )();\n\n      if (init.ec2MetadataV1Disabled || configValue) {\n        const causes: string[] = [];\n        if (init.ec2MetadataV1Disabled)\n          causes.push(\"credential provider initialization (runtime option ec2MetadataV1Disabled)\");\n        if (fallbackBlockedFromProfile) causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);\n        if (fallbackBlockedFromProcessEnv)\n          causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);\n\n        throw new InstanceMetadataV1FallbackError(\n          `AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(\n            \", \"\n          )}].`\n        );\n      }\n    }\n\n    const imdsProfile = (\n      await retry<string>(async () => {\n        let profile: string;\n        try {\n          profile = await getProfile(options);\n        } catch (err) {\n          if (err.statusCode === 401) {\n            disableFetchToken = false;\n          }\n          throw err;\n        }\n        return profile;\n      }, maxRetries)\n    ).trim();\n\n    return retry(async () => {\n      let creds: AwsCredentialIdentity;\n      try {\n        creds = await getCredentialsFromProfile(imdsProfile, options, init);\n      } catch (err) {\n        if (err.statusCode === 401) {\n          disableFetchToken = false;\n        }\n        throw err;\n      }\n      return creds;\n    }, maxRetries);\n  };\n\n  return async () => {\n    const endpoint = await getInstanceMetadataEndpoint();\n    if (disableFetchToken) {\n      logger?.debug(\"AWS SDK Instance Metadata\", \"using v1 fallback (no token fetch)\");\n      return getCredentials(maxRetries, { ...endpoint, timeout });\n    } else {\n      let token: string;\n      try {\n        token = (await getMetadataToken({ ...endpoint, timeout })).toString();\n      } catch (error) {\n        if (error?.statusCode === 400) {\n          throw Object.assign(error, {\n            message: \"EC2 Metadata token request returned error\",\n          });\n        } else if (error.message === \"TimeoutError\" || [403, 404, 405].includes(error.statusCode)) {\n          disableFetchToken = true;\n        }\n        logger?.debug(\"AWS SDK Instance Metadata\", \"using v1 fallback (initial)\");\n        return getCredentials(maxRetries, { ...endpoint, timeout });\n      }\n      return getCredentials(maxRetries, {\n        ...endpoint,\n        headers: {\n          [X_AWS_EC2_METADATA_TOKEN]: token,\n        },\n        timeout,\n      });\n    }\n  };\n};\n\nconst getMetadataToken = async (options: RequestOptions) =>\n  httpRequest({\n    ...options,\n    path: IMDS_TOKEN_PATH,\n    method: \"PUT\",\n    headers: {\n      \"x-aws-ec2-metadata-token-ttl-seconds\": \"21600\",\n    },\n  });\n\nconst getProfile = async (options: RequestOptions) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();\n\nconst getCredentialsFromProfile = async (profile: string, options: RequestOptions, init: RemoteProviderInit) => {\n  const credentialsResponse = JSON.parse(\n    (\n      await httpRequest({\n        ...options,\n        path: IMDS_PATH + profile,\n      })\n    ).toString()\n  );\n\n  if (!isImdsCredentials(credentialsResponse)) {\n    throw new CredentialsProviderError(\"Invalid response received from instance metadata service.\", {\n      logger: init.logger,\n    });\n  }\n\n  return fromImdsCredentials(credentialsResponse);\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/index.ts",
    "content": "/**\n * @internal\n */\nexport * from \"./fromContainerMetadata\";\n/**\n * @internal\n */\nexport * from \"./fromInstanceMetadata\";\n/**\n * @internal\n */\nexport * from \"./remoteProvider/RemoteProviderInit\";\n/**\n * @internal\n */\nexport * from \"./types\";\n/**\n * @internal\n */\nexport { httpRequest } from \"./remoteProvider/httpRequest\";\n/**\n * @internal\n */\nexport { getInstanceMetadataEndpoint } from \"./utils/getInstanceMetadataEndpoint\";\n/**\n * @internal\n */\nexport { Endpoint } from \"./config/Endpoint\";\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.spec.ts",
    "content": "import type { AwsCredentialIdentity } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { fromImdsCredentials, isImdsCredentials, type ImdsCredentials } from \"./ImdsCredentials\";\n\nconst creds: ImdsCredentials = Object.freeze({\n  AccessKeyId: \"foo\",\n  SecretAccessKey: \"bar\",\n  Token: \"baz\",\n  Expiration: new Date().toISOString(),\n  AccountId: \"123456789012\",\n});\n\ndescribe(\"isImdsCredentials\", () => {\n  it(\"should accept valid ImdsCredentials objects\", () => {\n    expect(isImdsCredentials(creds)).toBe(true);\n    const { AccountId, ...credsWithoutAccountId } = creds;\n    expect(AccountId).toBe(\"123456789012\");\n    expect(isImdsCredentials(credsWithoutAccountId)).toBe(true);\n  });\n\n  it(\"should reject credentials without an AccessKeyId\", () => {\n    expect(isImdsCredentials({ ...creds, AccessKeyId: void 0 })).toBe(false);\n  });\n\n  it(\"should reject credentials without a SecretAccessKey\", () => {\n    expect(isImdsCredentials({ ...creds, SecretAccessKey: void 0 })).toBe(false);\n  });\n\n  it(\"should reject credentials without a Token\", () => {\n    expect(isImdsCredentials({ ...creds, Token: void 0 })).toBe(false);\n  });\n\n  it(\"should reject credentials without an Expiration\", () => {\n    expect(isImdsCredentials({ ...creds, Expiration: void 0 })).toBe(false);\n  });\n\n  it(\"should reject scalar values\", () => {\n    for (const scalar of [\"string\", 1, true, null, void 0]) {\n      expect(isImdsCredentials(scalar)).toBe(false);\n    }\n  });\n});\n\ndescribe(\"fromImdsCredentials\", () => {\n  it(\"should convert IMDS credentials to a credentials object\", () => {\n    const converted: AwsCredentialIdentity = fromImdsCredentials(creds);\n    expect(converted.accessKeyId).toEqual(creds.AccessKeyId);\n    expect(converted.secretAccessKey).toEqual(creds.SecretAccessKey);\n    expect(converted.sessionToken).toEqual(creds.Token);\n    expect(converted.expiration).toEqual(new Date(creds.Expiration));\n    expect(converted.accountId).toEqual(creds.AccountId);\n  });\n\n  it(\"should convert IMDS credentials to a credentials object without accountId when it's not provided\", () => {\n    const credsWithoutAccountId: ImdsCredentials = {\n      AccessKeyId: \"foo\",\n      SecretAccessKey: \"bar\",\n      Token: \"baz\",\n      Expiration: new Date().toISOString(),\n      // AccountId is omitted\n    };\n    const converted: AwsCredentialIdentity = fromImdsCredentials(credsWithoutAccountId);\n    expect(converted.accessKeyId).toEqual(credsWithoutAccountId.AccessKeyId);\n    expect(converted.secretAccessKey).toEqual(credsWithoutAccountId.SecretAccessKey);\n    expect(converted.sessionToken).toEqual(credsWithoutAccountId.Token);\n    expect(converted.expiration).toEqual(new Date(credsWithoutAccountId.Expiration));\n    expect(converted.accountId).toBeUndefined(); // Verify accountId is undefined\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts",
    "content": "import type { AwsCredentialIdentity } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface ImdsCredentials {\n  AccessKeyId: string;\n  SecretAccessKey: string;\n  Token: string;\n  Expiration: string;\n  AccountId?: string;\n}\n\n/**\n * @internal\n */\nexport const isImdsCredentials = (arg: any): arg is ImdsCredentials =>\n  Boolean(arg) &&\n  typeof arg === \"object\" &&\n  typeof arg.AccessKeyId === \"string\" &&\n  typeof arg.SecretAccessKey === \"string\" &&\n  typeof arg.Token === \"string\" &&\n  typeof arg.Expiration === \"string\";\n\n/**\n * @internal\n */\nexport const fromImdsCredentials = (creds: ImdsCredentials): AwsCredentialIdentity => ({\n  accessKeyId: creds.AccessKeyId,\n  secretAccessKey: creds.SecretAccessKey,\n  sessionToken: creds.Token,\n  expiration: new Date(creds.Expiration),\n  ...(creds.AccountId && { accountId: creds.AccountId }),\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/RemoteProviderInit.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT, providerConfigFromInit } from \"./RemoteProviderInit\";\n\ndescribe(\"providerConfigFromInit\", () => {\n  it(\"should populate default values for retries and timeouts\", () => {\n    expect(providerConfigFromInit({})).toEqual({\n      timeout: DEFAULT_TIMEOUT,\n      maxRetries: DEFAULT_MAX_RETRIES,\n    });\n  });\n\n  it(\"should pass through timeout and retries overrides\", () => {\n    const timeout = 123456789;\n    const maxRetries = 987654321;\n\n    expect(providerConfigFromInit({ timeout, maxRetries })).toEqual({\n      timeout,\n      maxRetries,\n    });\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/RemoteProviderInit.ts",
    "content": "import type { Logger } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const DEFAULT_TIMEOUT = 1000;\n\n// The default in AWS SDK for Python and CLI (botocore) is no retry or one attempt\n// https://github.com/boto/botocore/blob/646c61a7065933e75bab545b785e6098bc94c081/botocore/utils.py#L273\n/**\n * @internal\n */\nexport const DEFAULT_MAX_RETRIES = 0;\n\n/**\n * @public\n */\nexport interface RemoteProviderConfig {\n  /**\n   * The connection timeout (in milliseconds)\n   */\n  timeout: number;\n\n  /**\n   * The maximum number of times the HTTP connection should be retried\n   */\n  maxRetries: number;\n}\n\n/**\n * @public\n */\nexport interface RemoteProviderInit extends Partial<RemoteProviderConfig> {\n  logger?: Logger;\n  /**\n   * Only used in the IMDS credential provider.\n   */\n  ec2MetadataV1Disabled?: boolean;\n  /**\n   * AWS_PROFILE.\n   */\n  profile?: string;\n}\n\n/**\n * @internal\n */\nexport const providerConfigFromInit = ({\n  maxRetries = DEFAULT_MAX_RETRIES,\n  timeout = DEFAULT_TIMEOUT,\n}: RemoteProviderInit): RemoteProviderConfig => ({ maxRetries, timeout });\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/httpRequest.spec.ts",
    "content": "import EventEmitter from \"node:events\";\nimport { request } from \"node:http\";\nimport { ProviderError } from \"@smithy/core/config\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { httpRequest } from \"./httpRequest\";\n\nvi.mock(\"http\", async () => {\n  const actual: any = vi.importActual(\"http\");\n\n  const pkg = {\n    ...actual,\n    request: vi.fn(),\n  };\n  return {\n    ...pkg,\n    default: pkg,\n  };\n});\n\ndescribe(\"httpRequest\", () => {\n  const hostname = \"localhost\";\n  const path = \"/\";\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  function mockResponse({ expectedResponse, statusCode = 200 }: any) {\n    return vi.mocked(request).mockImplementationOnce((() => {\n      const request = Object.assign(new EventEmitter(), {\n        destroy: vi.fn(),\n        end: vi.fn(),\n      });\n      const response = new EventEmitter() as any;\n      response.statusCode = statusCode;\n      setTimeout(() => {\n        request.emit(\"response\", response);\n        setTimeout(() => {\n          response.emit(\"data\", Buffer.from(expectedResponse));\n          response.emit(\"end\");\n        }, 50);\n      }, 50);\n      return request;\n    }) as any);\n  }\n\n  describe(\"returns response\", () => {\n    it(\"defaults to method GET\", async () => {\n      const expectedResponse = \"expectedResponse\";\n\n      mockResponse({ expectedResponse });\n\n      const response = await httpRequest({ hostname, path });\n      expect(response.toString()).toStrictEqual(expectedResponse);\n    });\n\n    it(\"uses method passed in options\", async () => {\n      const method = \"POST\";\n      const expectedResponse = \"expectedResponse\";\n      mockResponse({ expectedResponse });\n\n      const response = await httpRequest({ hostname, path, method });\n      expect(response.toString()).toStrictEqual(expectedResponse);\n    });\n\n    it(\"works with IPv6 hostname with encapsulated brackets\", async () => {\n      const expectedResponse = \"expectedResponse\";\n      const encapsulatedIPv6Hostname = \"[::1]\";\n      mockResponse({ expectedResponse });\n\n      const response = await httpRequest({ hostname: encapsulatedIPv6Hostname, path });\n      expect(response.toString()).toStrictEqual(expectedResponse);\n    });\n  });\n\n  describe(\"throws error\", () => {\n    const errorOnStatusCode = async (statusCode: number) => {\n      it(`statusCode: ${statusCode}`, async () => {\n        mockResponse({\n          statusCode,\n          expectedResponse: \"continue\",\n        });\n\n        await expect(httpRequest({ hostname, path })).rejects.toStrictEqual(\n          Object.assign(new ProviderError(\"Error response received from instance metadata service\"), { statusCode })\n        );\n      });\n    };\n\n    it(\"when request throws error\", async () => {\n      vi.mocked(request).mockImplementationOnce((() => {\n        const request = Object.assign(new EventEmitter(), {\n          destroy: vi.fn(),\n          end: vi.fn(),\n        });\n        setTimeout(() => {\n          request.emit(\"error\");\n        }, 50);\n        return request;\n      }) as any);\n\n      await expect(httpRequest({ hostname, path })).rejects.toStrictEqual(\n        new ProviderError(\"Unable to connect to instance metadata service\")\n      );\n    });\n\n    describe(\"when request returns with statusCode < 200\", () => {\n      [100, 101, 103].forEach(errorOnStatusCode);\n    });\n\n    describe(\"when request returns with statusCode >= 300\", () => {\n      [300, 400, 500].forEach(errorOnStatusCode);\n    });\n  });\n\n  it(\"timeout\", async () => {\n    const timeout = 1000;\n    vi.mocked(request).mockImplementationOnce((() => {\n      const request = Object.assign(new EventEmitter(), {\n        destroy: vi.fn(),\n        end: vi.fn(),\n      });\n      const response = new EventEmitter() as any;\n      response.statusCode = 200;\n      setTimeout(() => {\n        request.emit(\"timeout\");\n      }, 50);\n      return request;\n    }) as any);\n\n    await expect(httpRequest({ hostname, path, timeout })).rejects.toStrictEqual(\n      new ProviderError(\"TimeoutError from instance metadata service\")\n    );\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/httpRequest.ts",
    "content": "import { request, type IncomingMessage, type RequestOptions } from \"node:http\";\nimport { ProviderError } from \"@smithy/core/config\";\n\n/**\n * @internal\n */\nexport function httpRequest(options: RequestOptions): Promise<Buffer> {\n  return new Promise((resolve, reject) => {\n    const req = request({\n      method: \"GET\",\n      ...options,\n      // Node.js http module doesn't accept hostname with square brackets\n      // Refs: https://github.com/nodejs/node/issues/39738\n      hostname: options.hostname?.replace(/^\\[(.+)\\]$/, \"$1\"),\n    });\n\n    req.on(\"error\", (err) => {\n      reject(Object.assign(new ProviderError(\"Unable to connect to instance metadata service\"), err));\n      req.destroy();\n    });\n\n    req.on(\"timeout\", () => {\n      reject(new ProviderError(\"TimeoutError from instance metadata service\"));\n      req.destroy();\n    });\n\n    req.on(\"response\", (res: IncomingMessage) => {\n      const { statusCode = 400 } = res;\n      if (statusCode < 200 || 300 <= statusCode) {\n        reject(\n          Object.assign(new ProviderError(\"Error response received from instance metadata service\"), { statusCode })\n        );\n        req.destroy();\n      }\n\n      const chunks: Array<Buffer> = [];\n      res.on(\"data\", (chunk) => {\n        chunks.push(chunk as Buffer);\n      });\n      res.on(\"end\", () => {\n        resolve(Buffer.concat(chunks));\n        req.destroy();\n      });\n    });\n\n    req.end();\n  });\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/index.ts",
    "content": "/**\n * @internal\n */\nexport * from \"./ImdsCredentials\";\n/**\n * @internal\n */\nexport * from \"./RemoteProviderInit\";\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/retry.spec.ts",
    "content": "import { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { retry } from \"./retry\";\n\ndescribe(\"retry\", () => {\n  const successMsg = \"Success\";\n  const errorMsg = \"Expected failure\";\n  const retries = 10;\n  const retryable = vi.fn().mockRejectedValue(errorMsg);\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should retry a function the specified number of times\", async () => {\n    await expect(retry(retryable, retries)).rejects.toStrictEqual(errorMsg);\n    expect(retryable).toHaveBeenCalledTimes(retries + 1);\n  });\n\n  it(\"should not retry if successful\", async () => {\n    retryable.mockResolvedValueOnce(successMsg);\n    await expect(retry(retryable, retries)).resolves.toStrictEqual(successMsg);\n    expect(retryable).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"should stop retrying after the first successful invocation\", async () => {\n    const successfulInvocationIndex = 3;\n    for (let i = 1; i < successfulInvocationIndex; i++) {\n      retryable.mockRejectedValueOnce(errorMsg);\n    }\n    retryable.mockResolvedValueOnce(successMsg);\n\n    await expect(retry(retryable, retries)).resolves.toStrictEqual(successMsg);\n    expect(retryable).toHaveBeenCalledTimes(successfulInvocationIndex);\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/remoteProvider/retry.ts",
    "content": "/**\n * @internal\n */\nexport interface RetryableProvider<T> {\n  (): Promise<T>;\n}\n\n/**\n * @internal\n */\nexport const retry = <T>(toRetry: RetryableProvider<T>, maxRetries: number): Promise<T> => {\n  let promise = toRetry();\n  for (let i = 0; i < maxRetries; i++) {\n    promise = promise.catch(toRetry);\n  }\n\n  return promise;\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/types.ts",
    "content": "import type { AwsCredentialIdentity } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface InstanceMetadataCredentials extends AwsCredentialIdentity {\n  readonly originalExpiration?: Date;\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/src/utils/getExtendedInstanceMetadataCredentials.spec.ts",
    "content": "import type { Logger } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getExtendedInstanceMetadataCredentials } from \"./getExtendedInstanceMetadataCredentials\";\n\ndescribe(\"getExtendedInstanceMetadataCredentials()\", () => {\n  let nowMock: any;\n  const staticSecret = {\n    accessKeyId: \"key\",\n    secretAccessKey: \"secret\",\n  };\n  const logger: Logger = {\n    warn: vi.fn(),\n  } as any;\n\n  beforeEach(() => {\n    vi.spyOn(global.Math, \"random\");\n    nowMock = vi.spyOn(Date, \"now\").mockReturnValueOnce(new Date(\"2022-02-22T00:00:00Z\").getTime());\n  });\n\n  afterEach(() => {\n    nowMock.mockRestore();\n  });\n\n  it(\"should extend the expiration random time(5~10 mins) from now\", () => {\n    const anyDate: Date = \"any date\" as unknown as Date;\n    (Math.random as any).mockReturnValue(0.5);\n    expect(getExtendedInstanceMetadataCredentials({ ...staticSecret, expiration: anyDate }, logger)).toEqual({\n      ...staticSecret,\n      originalExpiration: anyDate,\n      expiration: new Date(\"2022-02-22T00:07:30Z\"),\n    });\n    expect(Math.random).toBeCalledTimes(1);\n  });\n\n  it(\"should print warning message when extending the credentials\", () => {\n    const anyDate: Date = \"any date\" as unknown as Date;\n    getExtendedInstanceMetadataCredentials({ ...staticSecret, expiration: anyDate }, logger);\n    expect(logger.warn).toBeCalledWith(expect.stringContaining(\"Attempting credential expiration extension\"));\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/utils/getExtendedInstanceMetadataCredentials.ts",
    "content": "import type { Logger } from \"@smithy/types\";\n\nimport type { InstanceMetadataCredentials } from \"../types\";\n\nconst STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;\nconst STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;\nconst STATIC_STABILITY_DOC_URL = \"https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html\";\n\n/**\n * @internal\n */\nexport const getExtendedInstanceMetadataCredentials = (\n  credentials: InstanceMetadataCredentials,\n  logger: Logger\n): InstanceMetadataCredentials => {\n  const refreshInterval =\n    STATIC_STABILITY_REFRESH_INTERVAL_SECONDS +\n    Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);\n  const newExpiration = new Date(Date.now() + refreshInterval * 1000);\n  logger.warn(\n    \"Attempting credential expiration extension due to a credential service availability issue. A refresh of these \" +\n      `credentials will be attempted after ${new Date(newExpiration)}.\\nFor more information, please visit: ` +\n      STATIC_STABILITY_DOC_URL\n  );\n  const originalExpiration = credentials.originalExpiration ?? credentials.expiration;\n  return {\n    ...credentials,\n    ...(originalExpiration ? { originalExpiration } : {}),\n    expiration: newExpiration,\n  };\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/utils/getInstanceMetadataEndpoint.spec.ts",
    "content": "import { loadConfig } from \"@smithy/core/config\";\nimport { parseUrl } from \"@smithy/core/protocols\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { Endpoint } from \"../config/Endpoint\";\nimport { ENDPOINT_CONFIG_OPTIONS } from \"../config/EndpointConfigOptions\";\nimport { EndpointMode } from \"../config/EndpointMode\";\nimport { ENDPOINT_MODE_CONFIG_OPTIONS } from \"../config/EndpointModeConfigOptions\";\nimport { getInstanceMetadataEndpoint } from \"./getInstanceMetadataEndpoint\";\n\nvi.mock(\"@smithy/core/config\");\nvi.mock(\"@smithy/core/protocols\");\n\ndescribe(getInstanceMetadataEndpoint.name, () => {\n  let mockURL: string;\n  const mockEndpoint = { protocol: \"http:\", hostname: \"localhost\", port: 80, path: \"\" };\n\n  beforeEach(() => {\n    vi.mocked(parseUrl).mockReturnValue(mockEndpoint);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  describe(\"when endpoint is defined\", () => {\n    afterEach(() => {\n      expect(loadConfig).toHaveBeenCalledTimes(1);\n      expect(loadConfig).toHaveBeenCalledWith(ENDPOINT_CONFIG_OPTIONS);\n      expect(parseUrl).toHaveBeenCalledTimes(1);\n      expect(parseUrl).toHaveBeenCalledWith(mockURL);\n    });\n\n    it(\"throws error when endpoint is invalid\", () => {\n      mockURL = \"invalid_endpoint\";\n      const mockError = new Error(`Invalid endpoint: ${mockURL}`);\n      vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.resolve(mockURL));\n      vi.mocked(parseUrl).mockImplementation(() => {\n        throw mockError;\n      });\n      return expect(getInstanceMetadataEndpoint()).rejects.toThrow(mockError);\n    });\n\n    describe(\"returns host when endpoint is valid\", () => {\n      const mockProtocol = \"http:\";\n      const mockHostname = \"127.0.0.1\";\n\n      it(\"with port\", async () => {\n        const mockPort = 80;\n        mockURL = `${mockProtocol}://${mockHostname}:${mockPort}`;\n        vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.resolve(mockURL));\n        expect(await getInstanceMetadataEndpoint()).toStrictEqual(mockEndpoint);\n      });\n\n      it(\"without port\", async () => {\n        mockURL = `${mockProtocol}://${mockHostname}`;\n        vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.resolve(mockURL));\n        expect(await getInstanceMetadataEndpoint()).toStrictEqual(mockEndpoint);\n      });\n    });\n  });\n\n  describe(\"when endpoint is not defined\", () => {\n    beforeEach(() => {\n      vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.resolve(undefined));\n    });\n\n    afterEach(() => {\n      expect(loadConfig).toHaveBeenCalledTimes(2);\n      expect(loadConfig).toHaveBeenNthCalledWith(1, ENDPOINT_CONFIG_OPTIONS);\n      expect(loadConfig).toHaveBeenNthCalledWith(2, ENDPOINT_MODE_CONFIG_OPTIONS);\n    });\n\n    it.each([\n      [Endpoint.IPv4, EndpointMode.IPv4],\n      [Endpoint.IPv6, EndpointMode.IPv6],\n    ])(\"returns %s when endpointMode=%s\", async (endpoint, endpointMode) => {\n      vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.resolve(endpointMode));\n      expect(await getInstanceMetadataEndpoint()).toEqual(mockEndpoint);\n      expect(parseUrl).toHaveBeenCalledTimes(1);\n      expect(parseUrl).toHaveBeenCalledWith(endpoint);\n    });\n\n    it(`throws Error when endpointMode is unsupported`, () => {\n      const unsupportedEndpointMode = \"unsupportedEndpointMode\";\n      vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.resolve(unsupportedEndpointMode));\n      return expect(getInstanceMetadataEndpoint()).rejects.toThrowError(\n        `Unsupported endpoint mode: ${unsupportedEndpointMode}.` + ` Select from ${Object.values(EndpointMode)}`\n      );\n    });\n\n    it(`rethrows Error when reading endpointMode throws error`, () => {\n      const error = new Error(\"error\");\n      vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.reject(error));\n      return expect(getInstanceMetadataEndpoint()).rejects.toThrow(error);\n    });\n  });\n\n  describe(\"when reading endpoint throws error\", () => {\n    it(\"rethrows error\", () => {\n      const error = new Error(\"error\");\n      vi.mocked(loadConfig).mockReturnValueOnce(() => Promise.reject(error));\n      expect(getInstanceMetadataEndpoint()).rejects.toThrow(error);\n      expect(loadConfig).toHaveBeenCalledTimes(1);\n      expect(loadConfig).toHaveBeenCalledWith(ENDPOINT_CONFIG_OPTIONS);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/utils/getInstanceMetadataEndpoint.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { loadConfig } from \"@smithy/core/config\";\nimport { parseUrl } from \"@smithy/core/protocols\";\nimport type { Endpoint } from \"@smithy/types\";\n\nimport { Endpoint as InstanceMetadataEndpoint } from \"../config/Endpoint\";\nimport { CONFIG_ENDPOINT_NAME, ENDPOINT_CONFIG_OPTIONS, ENV_ENDPOINT_NAME } from \"../config/EndpointConfigOptions\";\nimport { EndpointMode } from \"../config/EndpointMode\";\nimport {\n  CONFIG_ENDPOINT_MODE_NAME,\n  ENDPOINT_MODE_CONFIG_OPTIONS,\n  ENV_ENDPOINT_MODE_NAME,\n} from \"../config/EndpointModeConfigOptions\";\n\n/**\n * Returns the host to use for instance metadata service call.\n *\n * The host is read from endpoint which can be set either in\n * {@link ENV_ENDPOINT_NAME} environment variable or {@link CONFIG_ENDPOINT_NAME}\n * configuration property.\n *\n * If endpoint is not set, then endpoint mode is read either from\n * {@link ENV_ENDPOINT_MODE_NAME} environment variable or {@link CONFIG_ENDPOINT_MODE_NAME}\n * configuration property. If endpoint mode is not set, then default endpoint mode\n * {@link EndpointMode.IPv4} is used.\n *\n * If endpoint mode is set to {@link EndpointMode.IPv4}, then the host is {@link Endpoint.IPv4}.\n * If endpoint mode is set to {@link EndpointMode.IPv6}, then the host is {@link Endpoint.IPv6}.\n *\n * @returns Host to use for instance metadata service call.\n *\n * @internal\n */\nexport const getInstanceMetadataEndpoint = async (): Promise<Endpoint> =>\n  parseUrl((await getFromEndpointConfig()) || (await getFromEndpointModeConfig()));\n\nconst getFromEndpointConfig = async (): Promise<string | undefined> => loadConfig(ENDPOINT_CONFIG_OPTIONS)();\n\nconst getFromEndpointModeConfig = async (): Promise<string> => {\n  const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();\n  switch (endpointMode) {\n    case EndpointMode.IPv4:\n      return InstanceMetadataEndpoint.IPv4;\n    case EndpointMode.IPv6:\n      return InstanceMetadataEndpoint.IPv6;\n    default:\n      throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode)}`);\n  }\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/src/utils/staticStabilityProvider.spec.ts",
    "content": "import type { Logger } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { getExtendedInstanceMetadataCredentials } from \"./getExtendedInstanceMetadataCredentials\";\nimport { staticStabilityProvider } from \"./staticStabilityProvider\";\n\nvi.mock(\"./getExtendedInstanceMetadataCredentials\");\n\ndescribe(\"staticStabilityProvider\", () => {\n  const ONE_HOUR_IN_FUTURE = new Date(Date.now() + 60 * 60 * 1000);\n  const mockCreds = {\n    accessKeyId: \"key\",\n    secretAccessKey: \"secret\",\n    sessionToken: \"settion\",\n    expiration: ONE_HOUR_IN_FUTURE,\n  };\n\n  beforeEach(() => {\n    vi.mocked(getExtendedInstanceMetadataCredentials).mockImplementation(\n      (() => {\n        let extensionCount = 0;\n        return (input) => {\n          extensionCount++;\n          return {\n            ...input,\n            expiration: `Extending expiration count: ${extensionCount}`,\n          } as any;\n        };\n      })()\n    );\n    vi.spyOn(global.console, \"warn\").mockImplementation(() => {});\n  });\n\n  afterEach(() => {\n    vi.resetAllMocks();\n  });\n\n  it(\"should refresh credentials if provider is functional\", async () => {\n    const provider = vi.fn();\n    const stableProvider = staticStabilityProvider(provider);\n    const repeat = 3;\n    for (let i = 0; i < repeat; i++) {\n      const newCreds = { ...mockCreds, accessKeyId: String(i + 1) };\n      provider.mockReset().mockResolvedValue(newCreds);\n      expect(await stableProvider()).toEqual(newCreds);\n    }\n  });\n\n  it(\"should throw if cannot load credentials at 1st load\", async () => {\n    const provider = vi.fn().mockRejectedValue(\"Error\");\n    try {\n      await staticStabilityProvider(provider)();\n      fail(\"This provider should throw\");\n    } catch (e) {\n      expect(getExtendedInstanceMetadataCredentials).not.toBeCalled();\n      expect(provider).toBeCalledTimes(1);\n      expect(e).toEqual(\"Error\");\n    }\n  });\n\n  it(\"should extend expired credentials if refresh fails\", async () => {\n    const provider = vi.fn().mockResolvedValueOnce(mockCreds).mockRejectedValue(\"Error\");\n    const stableProvider = staticStabilityProvider(provider);\n    expect(await stableProvider()).toEqual(mockCreds);\n    const repeat = 3;\n    for (let i = 0; i < repeat; i++) {\n      const newCreds = await stableProvider();\n      expect(newCreds).toMatchObject({ ...mockCreds, expiration: expect.stringContaining(`count: ${i + 1}`) });\n      expect(console.warn).toHaveBeenLastCalledWith(\n        expect.stringContaining(\"Credential renew failed:\"),\n        expect.anything()\n      );\n    }\n    expect(getExtendedInstanceMetadataCredentials).toBeCalledTimes(repeat);\n    expect(console.warn).toBeCalledTimes(repeat);\n  });\n\n  it(\"should extend expired credentials if loaded expired credentials\", async () => {\n    const ONE_HOUR_AGO = new Date(Date.now() - 60 * 60 * 1000);\n    const provider = vi.fn().mockResolvedValue({ ...mockCreds, expiration: ONE_HOUR_AGO });\n    const stableProvider = staticStabilityProvider(provider);\n    const repeat = 3;\n    for (let i = 0; i < repeat; i++) {\n      const newCreds = await stableProvider();\n      expect(newCreds).toMatchObject({ ...mockCreds, expiration: expect.stringContaining(`count: ${i + 1}`) });\n    }\n    expect(getExtendedInstanceMetadataCredentials).toBeCalledTimes(repeat);\n    expect(console.warn).not.toBeCalled();\n  });\n\n  it(\"should allow custom logger to print warning messages\", async () => {\n    const provider = vi.fn().mockResolvedValueOnce(mockCreds).mockRejectedValue(\"Error\");\n    const logger = { warn: vi.fn() } as unknown as Logger;\n    const stableProvider = staticStabilityProvider(provider, { logger });\n    expect(await stableProvider()).toEqual(mockCreds); // load initial creds\n    await stableProvider();\n    expect(logger.warn).toBeCalledTimes(1);\n    expect(console.warn).toBeCalledTimes(0);\n  });\n});\n"
  },
  {
    "path": "packages/credential-provider-imds/src/utils/staticStabilityProvider.ts",
    "content": "import type { Logger, Provider } from \"@smithy/types\";\n\nimport type { InstanceMetadataCredentials } from \"../types\";\nimport { getExtendedInstanceMetadataCredentials } from \"./getExtendedInstanceMetadataCredentials\";\n\n/**\n * IMDS credential supports static stability feature. When used, the expiration\n * of recently issued credentials is extended. The server side allows using\n * the recently expired credentials. This mitigates impact when clients using\n * refreshable credentials are unable to retrieve updates.\n *\n * @internal\n * @param provider Credential provider\n * @returns A credential provider that supports static stability\n */\nexport const staticStabilityProvider = (\n  provider: Provider<InstanceMetadataCredentials>,\n  options: {\n    logger?: Logger;\n  } = {}\n): Provider<InstanceMetadataCredentials> => {\n  // Unlike normal SDK logger message, the key extension message must be transparent to users.\n  // When customer doesn't supply a custom logger, we need to log the warnings to console.\n  const logger = options?.logger || console;\n  let pastCredentials: InstanceMetadataCredentials;\n  return async () => {\n    let credentials: InstanceMetadataCredentials;\n    try {\n      credentials = await provider();\n      if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {\n        credentials = getExtendedInstanceMetadataCredentials(credentials, logger);\n      }\n    } catch (e) {\n      if (pastCredentials) {\n        logger.warn(\"Credential renew failed: \", e);\n        credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);\n      } else {\n        throw e;\n      }\n    }\n    pastCredentials = credentials;\n    return credentials;\n  };\n};\n"
  },
  {
    "path": "packages/credential-provider-imds/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/credential-provider-imds/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/eventstream-codec/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/eventstream-codec/CHANGELOG.md",
    "content": "# @smithy/eventstream-codec\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n- cad44fc: consolidate core/event-streams\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/eventstream-codec/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/eventstream-codec/package.json",
    "content": "{\n  \"name\": \"@smithy/eventstream-codec\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"premove\": \"4.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/eventstream-codec\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/eventstream-codec\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/eventstream-codec/scripts/buildTestVectorsFixture.js",
    "content": "const { Buffer } = require(\"buffer\");\nconst { readdirSync, readFileSync, writeFileSync } = require(\"fs\");\nconst { dirname, join } = require(\"path\");\n\nconst HEADER_TYPES = [\"boolean\", \"byte\", \"short\", \"integer\", \"long\", \"binary\", \"string\", \"timestamp\", \"uuid\"];\n\nconst vectorsDir = join(dirname(__dirname), \"test_vectors\");\nlet vectors = \"\\n\";\n\nfor (const dirName of [\"positive\", \"negative\"]) {\n  const encodedVectorsDir = join(vectorsDir, \"encoded\", dirName);\n  const decodedVectorsDir = join(vectorsDir, \"decoded\", dirName);\n\n  for (const vectorName of readdirSync(encodedVectorsDir)) {\n    vectors += `    ${vectorName}: {\n        expectation: '${dirName === \"positive\" ? \"success\" : \"failure\"}',\n        encoded: Uint8Array.from([${readFileSync(join(encodedVectorsDir, vectorName))\n          .map((byte) => byte.toString(10))\n          .join(\", \")}]),\n`;\n\n    if (dirName === \"positive\") {\n      const decoded = JSON.parse(readFileSync(join(decodedVectorsDir, vectorName)));\n      const headers = decoded.headers\n        .map(\n          (declaration) =>\n            `               '${declaration.name}': {\n                    type: '${HEADER_TYPES[declaration.type]}',\n                    value: ${headerValue(declaration.type, declaration.value)},\n                },`\n        )\n        .join(\"\\n\");\n\n      vectors += `        decoded: {\n            headers: {\n${headers}\n            },\n            body: ${writeBuffer(Buffer.from(decoded.payload, \"base64\"))},\n        },\n`;\n    }\n\n    vectors += \"    },\\n\";\n  }\n}\n\nwriteFileSync(\n  join(dirname(__dirname), \"src\", \"TestVectors.fixture.ts\"),\n  `import { TestVectors } from './vectorTypes.fixture';\nimport { Int64 } from './Int64';\n\nexport const vectors: TestVectors = {${vectors}};\n`\n);\n\nfunction headerValue(type, vectorRepresentation) {\n  switch (type) {\n    case 0:\n      return \"true\";\n    case 1:\n      return \"false\";\n    case 5:\n      return `Int64.fromNumber(${vectorRepresentation})`;\n    case 6:\n      return writeBuffer(Buffer.from(vectorRepresentation, \"base64\"));\n    case 7:\n      return `'${Buffer.from(vectorRepresentation, \"base64\").toString()}'`;\n    case 8:\n      return `new Date(${vectorRepresentation})`;\n    case 9:\n      const hex = Buffer.from(vectorRepresentation, \"base64\").toString(\"hex\");\n      return `'${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}'`;\n    default:\n      return vectorRepresentation;\n  }\n}\n\nfunction writeBuffer(buffer) {\n  return `Uint8Array.from([${buffer.map((byte) => byte.toString(10)).join(\", \")}])`;\n}\n"
  },
  {
    "path": "packages/eventstream-codec/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/event-streams instead. */\nexport {\n  EventStreamCodec,\n  HeaderMarshaller,\n  Int64,\n  MessageDecoderStream,\n  MessageEncoderStream,\n  SmithyMessageDecoderStream,\n  SmithyMessageEncoderStream,\n} from \"@smithy/core/event-streams\";\nexport type {\n  BinaryHeaderValue,\n  BooleanHeaderValue,\n  ByteHeaderValue,\n  IntegerHeaderValue,\n  LongHeaderValue,\n  Message,\n  MessageDecoderStreamOptions,\n  MessageEncoderStreamOptions,\n  MessageHeaders,\n  MessageHeaderValue,\n  ShortHeaderValue,\n  SmithyMessageDecoderStreamOptions,\n  SmithyMessageEncoderStreamOptions,\n  StringHeaderValue,\n  TimestampHeaderValue,\n  UuidHeaderValue,\n} from \"@smithy/core/event-streams\";\n"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/negative/corrupted_header_len",
    "content": "Prelude checksum mismatch"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/negative/corrupted_headers",
    "content": "Message checksum mismatch"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/negative/corrupted_length",
    "content": "Prelude checksum mismatch"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/negative/corrupted_payload",
    "content": "Message checksum mismatch"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/positive/all_headers",
    "content": "{\n  \"total_length\": 204,\n  \"headers_length\": 175,\n  \"prelude_crc\": 263087306,\n  \"headers\": [    {\n      \"name\": \"event-type\",\n      \"type\": 4,\n      \"value\": 40972\n    },\n    {\n      \"name\": \"content-type\",\n      \"type\": 7,\n      \"value\": \"YXBwbGljYXRpb24vanNvbg==\"\n    },\n    {\n      \"name\": \"bool false\",\n      \"type\": 1,\n      \"value\": false\n    },\n    {\n      \"name\": \"bool true\",\n      \"type\": 0,\n      \"value\": true\n    },\n    {\n      \"name\": \"byte\",\n      \"type\": 2,\n      \"value\": -49\n    },\n    {\n      \"name\": \"byte buf\",\n      \"type\": 6,\n      \"value\": \"SSdtIGEgbGl0dGxlIHRlYXBvdCE=\"\n    },\n    {\n      \"name\": \"timestamp\",\n      \"type\": 8,\n      \"value\": 8675309\n    },\n    {\n      \"name\": \"int16\",\n      \"type\": 3,\n      \"value\": 42\n    },\n    {\n      \"name\": \"int64\",\n      \"type\": 5,\n      \"value\": 42424242\n    },\n    {\n      \"name\": \"uuid\",\n      \"type\": 9,\n      \"value\": \"AQIDBAUGBwgJCgsMDQ4PEA==\"\n    }\n  ],\n  \"payload\": \"eydmb28nOidiYXInfQ==\",\n  \"message_crc\": -1415188212\n}\n"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/positive/empty_message",
    "content": "{\n  \"total_length\": 16,\n  \"headers_length\": 0,\n  \"prelude_crc\": 96618731,\n  \"headers\": [  ],\n  \"payload\": \"\",\n  \"message_crc\": 2107164927\n}\n"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/positive/int32_header",
    "content": "{\n  \"total_length\": 45,\n  \"headers_length\": 16,\n  \"prelude_crc\": 1103373496,\n  \"headers\": [    {\n      \"name\": \"event-type\",\n      \"type\": 4,\n      \"value\": 40972\n    }\n  ],\n  \"payload\": \"eydmb28nOidiYXInfQ==\",\n  \"message_crc\": 921993376\n}\n"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/positive/payload_no_headers",
    "content": "{\n  \"total_length\": 29,\n  \"headers_length\": 0,\n  \"prelude_crc\": -44921766,\n  \"headers\": [  ],\n  \"payload\": \"eydmb28nOidiYXInfQ==\",\n  \"message_crc\": -1016776394\n}\n"
  },
  {
    "path": "packages/eventstream-codec/test_vectors/decoded/positive/payload_one_str_header",
    "content": "{\n  \"total_length\": 61,\n  \"headers_length\": 32,\n  \"prelude_crc\": 134054806,\n  \"headers\": [    {\n      \"name\": \"content-type\",\n      \"type\": 7,\n      \"value\": \"YXBwbGljYXRpb24vanNvbg==\"\n    }\n  ],\n  \"payload\": \"eydmb28nOidiYXInfQ==\",\n  \"message_crc\": -1919153999\n}\n"
  },
  {
    "path": "packages/eventstream-codec/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-codec/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-codec/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-browser/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/eventstream-serde-browser/CHANGELOG.md",
    "content": "# @smithy/eventstream-serde-browser\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- cad44fc: consolidate core/event-streams\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/eventstream-serde-browser/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/eventstream-serde-browser/package.json",
    "content": "{\n  \"name\": \"@smithy/eventstream-serde-browser\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"premove\": \"4.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/eventstream-serde-browser\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/eventstream-serde-browser\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/eventstream-serde-browser/src/index.ts",
    "content": "import { readableStreamToIterable } from \"@smithy/core/event-streams\";\n\n/** @deprecated Use @smithy/core/event-streams instead. */\nexport { EventStreamMarshaller, eventStreamSerdeProvider, iterableToReadableStream } from \"@smithy/core/event-streams\";\nexport type { EventStreamMarshallerOptions } from \"@smithy/core/event-streams\";\n\n/**\n * @deprecated capitalization typo.\n */\nexport const readableStreamtoIterable = readableStreamToIterable;\n"
  },
  {
    "path": "packages/eventstream-serde-browser/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-browser/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"DOM\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-browser/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/CHANGELOG.md",
    "content": "# @smithy/eventstream-serde-config-resolver\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- cad44fc: consolidate core/event-streams\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/eventstream-serde-config-resolver/package.json",
    "content": "{\n  \"name\": \"@smithy/eventstream-serde-config-resolver\",\n  \"version\": \"4.4.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"premove\": \"4.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/eventstream-serde-config-resolver\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/eventstream-serde-config-resolver\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/event-streams instead. */\nexport { resolveEventStreamSerdeConfig } from \"@smithy/core/event-streams\";\nexport type { EventStreamSerdeInputConfig, EventStreamSerdeResolvedConfig } from \"@smithy/core/event-streams\";\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-config-resolver/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-node/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/eventstream-serde-node/CHANGELOG.md",
    "content": "# @smithy/eventstream-serde-node\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- cad44fc: consolidate core/event-streams\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/eventstream-serde-node/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/eventstream-serde-node/package.json",
    "content": "{\n  \"name\": \"@smithy/eventstream-serde-node\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"premove\": \"4.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/eventstream-serde-node\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/eventstream-serde-node\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/eventstream-serde-node/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/event-streams instead. */\nexport { EventStreamMarshaller, eventStreamSerdeProvider } from \"@smithy/core/event-streams\";\nexport type { EventStreamMarshallerOptions } from \"@smithy/core/event-streams\";\n"
  },
  {
    "path": "packages/eventstream-serde-node/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-node/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-node/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-universal/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/eventstream-serde-universal/CHANGELOG.md",
    "content": "# @smithy/eventstream-serde-universal\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n- cad44fc: consolidate core/event-streams\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/eventstream-serde-universal/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/eventstream-serde-universal/package.json",
    "content": "{\n  \"name\": \"@smithy/eventstream-serde-universal\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"premove\": \"4.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/eventstream-serde-universal\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/eventstream-serde-universal\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/eventstream-serde-universal/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/event-streams instead. */\nexport {\n  UniversalEventStreamMarshaller as EventStreamMarshaller,\n  universalEventStreamSerdeProvider as eventStreamSerdeProvider,\n} from \"@smithy/core/event-streams\";\nexport type { UniversalEventStreamMarshallerOptions as EventStreamMarshallerOptions } from \"@smithy/core/event-streams\";\n"
  },
  {
    "path": "packages/eventstream-serde-universal/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-universal/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/eventstream-serde-universal/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/CHANGELOG.md",
    "content": "# Change Log\n\n## 0.6.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n  - @smithy/signature-v4@5.4.3\n  - @smithy/middleware-retry@4.6.3\n\n## 0.6.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n  - @smithy/middleware-retry@4.6.2\n  - @smithy/signature-v4@5.4.2\n\n## 0.6.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n  - @smithy/middleware-retry@4.6.1\n  - @smithy/signature-v4@5.4.1\n\n## 0.6.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n  - @smithy/middleware-retry@4.6.0\n  - @smithy/signature-v4@5.4.0\n\n## 0.5.54\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.5.7\n\n## 0.5.53\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.5.6\n\n## 0.5.52\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.5.5\n- @smithy/middleware-endpoint@4.4.32\n- @smithy/middleware-serde@4.2.20\n\n## 0.5.51\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.31\n- @smithy/middleware-retry@4.5.4\n- @smithy/middleware-serde@4.2.19\n\n## 0.5.50\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.5.3\n\n## 0.5.49\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/signature-v4@5.3.14\n  - @smithy/middleware-retry@4.5.2\n  - @smithy/middleware-endpoint@4.4.30\n  - @smithy/middleware-serde@4.2.18\n  - @smithy/protocol-http@5.3.14\n  - @smithy/util-middleware@4.2.14\n\n## 0.5.48\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.5.1\n\n## 0.5.47\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/middleware-retry@4.5.0\n  - @smithy/types@4.14.0\n  - @smithy/middleware-endpoint@4.4.29\n  - @smithy/middleware-serde@4.2.17\n  - @smithy/protocol-http@5.3.13\n  - @smithy/signature-v4@5.3.13\n  - @smithy/util-middleware@4.2.13\n\n## 0.5.46\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.4.46\n\n## 0.5.45\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.28\n- @smithy/middleware-serde@4.2.16\n- @smithy/middleware-retry@4.4.45\n\n## 0.5.44\n\n### Patch Changes\n\n- Updated dependencies [b1f0dba]\n  - @smithy/middleware-endpoint@4.4.27\n  - @smithy/middleware-retry@4.4.44\n\n## 0.5.43\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.26\n- @smithy/middleware-serde@4.2.15\n- @smithy/middleware-retry@4.4.43\n\n## 0.5.42\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.25\n- @smithy/middleware-serde@4.2.14\n- @smithy/middleware-retry@4.4.42\n\n## 0.5.41\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n- Updated dependencies [dfc743d]\n  - @smithy/types@4.13.1\n  - @smithy/middleware-endpoint@4.4.24\n  - @smithy/middleware-serde@4.2.13\n  - @smithy/middleware-retry@4.4.41\n  - @smithy/protocol-http@5.3.12\n  - @smithy/signature-v4@5.3.12\n  - @smithy/util-middleware@4.2.12\n\n## 0.5.40\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.23\n- @smithy/middleware-retry@4.4.40\n\n## 0.5.39\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/middleware-endpoint@4.4.22\n  - @smithy/middleware-retry@4.4.39\n  - @smithy/middleware-serde@4.2.12\n  - @smithy/util-middleware@4.2.11\n  - @smithy/protocol-http@5.3.11\n  - @smithy/signature-v4@5.3.11\n\n## 0.5.38\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.21\n- @smithy/middleware-retry@4.4.38\n\n## 0.5.37\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/middleware-retry@4.4.37\n  - @smithy/middleware-endpoint@4.4.20\n  - @smithy/middleware-serde@4.2.11\n  - @smithy/protocol-http@5.3.10\n  - @smithy/signature-v4@5.3.10\n  - @smithy/util-middleware@4.2.10\n\n## 0.5.36\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.19\n- @smithy/middleware-retry@4.4.36\n\n## 0.5.35\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/middleware-endpoint@4.4.18\n  - @smithy/middleware-retry@4.4.35\n  - @smithy/middleware-serde@4.2.10\n  - @smithy/protocol-http@5.3.9\n  - @smithy/signature-v4@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-middleware@4.2.9\n\n## 0.5.34\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.17\n- @smithy/middleware-retry@4.4.34\n\n## 0.5.33\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.16\n- @smithy/middleware-retry@4.4.33\n\n## 0.5.32\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.15\n- @smithy/middleware-retry@4.4.32\n\n## 0.5.31\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.14\n- @smithy/middleware-retry@4.4.31\n\n## 0.5.30\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.13\n- @smithy/middleware-retry@4.4.30\n\n## 0.5.29\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.12\n- @smithy/middleware-retry@4.4.29\n\n## 0.5.28\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.4.28\n\n## 0.5.27\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.11\n- @smithy/middleware-retry@4.4.27\n\n## 0.5.26\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.10\n- @smithy/middleware-retry@4.4.26\n\n## 0.5.25\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.9\n- @smithy/middleware-retry@4.4.25\n\n## 0.5.24\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.8\n- @smithy/middleware-retry@4.4.24\n\n## 0.5.23\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.7\n- @smithy/middleware-retry@4.4.23\n\n## 0.5.22\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/middleware-endpoint@4.4.6\n  - @smithy/middleware-retry@4.4.22\n  - @smithy/middleware-serde@4.2.9\n  - @smithy/protocol-http@5.3.8\n  - @smithy/signature-v4@5.3.8\n  - @smithy/util-middleware@4.2.8\n\n## 0.5.21\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.5\n- @smithy/middleware-retry@4.4.21\n\n## 0.5.20\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.4\n- @smithy/middleware-retry@4.4.20\n\n## 0.5.19\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.3\n- @smithy/middleware-retry@4.4.19\n\n## 0.5.18\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.4.2\n- @smithy/middleware-retry@4.4.18\n\n## 0.5.17\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/middleware-endpoint@4.4.1\n  - @smithy/middleware-retry@4.4.17\n  - @smithy/middleware-serde@4.2.8\n  - @smithy/protocol-http@5.3.7\n  - @smithy/signature-v4@5.3.7\n  - @smithy/util-middleware@4.2.7\n\n## 0.5.16\n\n### Patch Changes\n\n- Updated dependencies [76d7994]\n  - @smithy/middleware-endpoint@4.4.0\n  - @smithy/middleware-retry@4.4.16\n\n## 0.5.15\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/middleware-retry@4.4.15\n  - @smithy/middleware-endpoint@4.3.15\n  - @smithy/middleware-serde@4.2.7\n  - @smithy/protocol-http@5.3.6\n  - @smithy/signature-v4@5.3.6\n  - @smithy/util-middleware@4.2.6\n\n## 0.5.14\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.14\n- @smithy/middleware-retry@4.4.14\n\n## 0.5.13\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.13\n- @smithy/middleware-retry@4.4.13\n\n## 0.5.12\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.12\n- @smithy/middleware-retry@4.4.12\n\n## 0.5.11\n\n### Patch Changes\n\n- Updated dependencies [e659a06]\n  - @smithy/middleware-serde@4.2.6\n  - @smithy/middleware-endpoint@4.3.11\n  - @smithy/middleware-retry@4.4.11\n\n## 0.5.10\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.10\n- @smithy/middleware-retry@4.4.10\n\n## 0.5.9\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.9\n- @smithy/middleware-retry@4.4.9\n\n## 0.5.8\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.8\n- @smithy/middleware-retry@4.4.8\n\n## 0.5.7\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/middleware-endpoint@4.3.7\n  - @smithy/middleware-retry@4.4.7\n  - @smithy/middleware-serde@4.2.5\n  - @smithy/protocol-http@5.3.5\n  - @smithy/signature-v4@5.3.5\n  - @smithy/util-middleware@4.2.5\n\n## 0.5.6\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/middleware-endpoint@4.3.6\n  - @smithy/middleware-retry@4.4.6\n  - @smithy/middleware-serde@4.2.4\n  - @smithy/protocol-http@5.3.4\n  - @smithy/signature-v4@5.3.4\n  - @smithy/util-middleware@4.2.4\n\n## 0.5.5\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.5\n- @smithy/middleware-retry@4.4.5\n\n## 0.5.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/middleware-retry@4.4.4\n  - @smithy/middleware-endpoint@4.3.4\n  - @smithy/middleware-serde@4.2.3\n  - @smithy/protocol-http@5.3.3\n  - @smithy/signature-v4@5.3.3\n  - @smithy/util-middleware@4.2.3\n\n## 0.5.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/middleware-endpoint@4.3.3\n  - @smithy/middleware-retry@4.4.3\n  - @smithy/middleware-serde@4.2.2\n  - @smithy/protocol-http@5.3.2\n  - @smithy/signature-v4@5.3.2\n  - @smithy/util-middleware@4.2.2\n\n## 0.5.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/middleware-endpoint@4.3.2\n  - @smithy/middleware-retry@4.4.2\n  - @smithy/middleware-serde@4.2.1\n  - @smithy/protocol-http@5.3.1\n  - @smithy/signature-v4@5.3.1\n  - @smithy/util-middleware@4.2.1\n\n## 0.5.1\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.3.1\n- @smithy/middleware-retry@4.4.1\n\n## 0.5.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/middleware-endpoint@4.3.0\n  - @smithy/middleware-retry@4.4.0\n  - @smithy/middleware-serde@4.2.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/signature-v4@5.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-middleware@4.2.0\n\n## 0.4.6\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.2.5\n- @smithy/middleware-retry@4.3.1\n\n## 0.4.5\n\n### Patch Changes\n\n- Updated dependencies [97fe0d8]\n  - @smithy/middleware-retry@4.3.0\n  - @smithy/middleware-endpoint@4.2.4\n\n## 0.4.4\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.2.3\n- @smithy/middleware-retry@4.2.4\n\n## 0.4.3\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.2.3\n\n## 0.4.2\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.2.2\n- @smithy/middleware-retry@4.2.2\n\n## 0.4.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/middleware-endpoint@4.2.1\n  - @smithy/middleware-retry@4.2.1\n  - @smithy/middleware-serde@4.1.1\n  - @smithy/protocol-http@5.2.1\n  - @smithy/signature-v4@5.2.1\n  - @smithy/util-middleware@4.1.1\n\n## 0.4.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/middleware-endpoint@4.2.0\n  - @smithy/middleware-retry@4.2.0\n  - @smithy/middleware-serde@4.1.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/signature-v4@5.2.0\n  - @smithy/types@4.4.0\n\n## 0.3.68\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.21\n- @smithy/middleware-retry@4.1.22\n\n## 0.3.67\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.20\n- @smithy/middleware-retry@4.1.21\n\n## 0.3.66\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.19\n- @smithy/middleware-retry@4.1.20\n\n## 0.3.65\n\n### Patch Changes\n\n- Updated dependencies [fd00602]\n- Updated dependencies [64e033f]\n  - @smithy/middleware-retry@4.1.19\n  - @smithy/types@4.3.2\n  - @smithy/middleware-endpoint@4.1.18\n  - @smithy/middleware-serde@4.0.9\n  - @smithy/protocol-http@5.1.3\n  - @smithy/signature-v4@5.1.3\n  - @smithy/util-middleware@4.0.5\n\n## 0.3.64\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.17\n- @smithy/middleware-retry@4.1.18\n\n## 0.3.63\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.16\n- @smithy/middleware-retry@4.1.17\n\n## 0.3.62\n\n### Patch Changes\n\n- Updated dependencies [bccb1b9]\n  - @smithy/middleware-endpoint@4.1.15\n  - @smithy/middleware-retry@4.1.16\n\n## 0.3.61\n\n### Patch Changes\n\n- Updated dependencies [3ecb1f4]\n  - @smithy/middleware-endpoint@4.1.14\n  - @smithy/middleware-retry@4.1.15\n\n## 0.3.60\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.13\n- @smithy/middleware-retry@4.1.14\n\n## 0.3.59\n\n### Patch Changes\n\n- Updated dependencies [22a286e]\n  - @smithy/middleware-endpoint@4.1.12\n  - @smithy/middleware-retry@4.1.13\n\n## 0.3.58\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.11\n- @smithy/middleware-retry@4.1.12\n\n## 0.3.57\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.10\n- @smithy/middleware-retry@4.1.11\n\n## 0.3.56\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/middleware-endpoint@4.1.9\n  - @smithy/middleware-retry@4.1.10\n  - @smithy/middleware-serde@4.0.8\n  - @smithy/protocol-http@5.1.2\n  - @smithy/signature-v4@5.1.2\n  - @smithy/util-middleware@4.0.4\n\n## 0.3.55\n\n### Patch Changes\n\n- Updated dependencies [ae11e3a]\n  - @smithy/middleware-serde@4.0.7\n  - @smithy/middleware-endpoint@4.1.8\n  - @smithy/middleware-retry@4.1.9\n\n## 0.3.54\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/middleware-endpoint@4.1.7\n  - @smithy/middleware-retry@4.1.8\n  - @smithy/middleware-serde@4.0.6\n  - @smithy/protocol-http@5.1.1\n  - @smithy/signature-v4@5.1.1\n  - @smithy/util-middleware@4.0.3\n\n## 0.3.53\n\n### Patch Changes\n\n- Updated dependencies [786dd3a]\n  - @smithy/middleware-endpoint@4.1.6\n  - @smithy/middleware-serde@4.0.5\n  - @smithy/middleware-retry@4.1.7\n\n## 0.3.52\n\n### Patch Changes\n\n- Updated dependencies [103535a]\n  - @smithy/middleware-serde@4.0.4\n  - @smithy/middleware-endpoint@4.1.5\n  - @smithy/middleware-retry@4.1.6\n\n## 0.3.51\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.4\n- @smithy/middleware-retry@4.1.5\n\n## 0.3.50\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.3\n- @smithy/middleware-retry@4.1.4\n\n## 0.3.49\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.2\n- @smithy/middleware-retry@4.1.3\n\n## 0.3.48\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.1.2\n\n## 0.3.47\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.1.1\n- @smithy/middleware-retry@4.1.1\n\n## 0.3.46\n\n### Patch Changes\n\n- Updated dependencies [e2a8b41]\n  - @smithy/signature-v4@5.1.0\n\n## 0.3.45\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/middleware-endpoint@4.1.0\n  - @smithy/middleware-retry@4.1.0\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n  - @smithy/signature-v4@5.0.2\n  - @smithy/middleware-serde@4.0.3\n  - @smithy/util-middleware@4.0.2\n\n## 0.3.44\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.0.6\n- @smithy/middleware-retry@4.0.7\n\n## 0.3.43\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.0.5\n- @smithy/middleware-retry@4.0.6\n\n## 0.3.42\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.0.4\n- @smithy/middleware-retry@4.0.5\n\n## 0.3.41\n\n### Patch Changes\n\n- Updated dependencies [f5d0bac]\n  - @smithy/middleware-serde@4.0.2\n  - @smithy/middleware-endpoint@4.0.3\n  - @smithy/middleware-retry@4.0.4\n\n## 0.3.40\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@4.0.2\n- @smithy/middleware-retry@4.0.3\n\n## 0.3.39\n\n### Patch Changes\n\n- @smithy/middleware-retry@4.0.2\n\n## 0.3.38\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/middleware-endpoint@4.0.1\n  - @smithy/middleware-retry@4.0.1\n  - @smithy/middleware-serde@4.0.1\n  - @smithy/protocol-http@5.0.1\n  - @smithy/signature-v4@5.0.1\n  - @smithy/util-middleware@4.0.1\n\n## 0.3.37\n\n### Patch Changes\n\n- 20d99be: major version bump for dropping node16 support\n- Updated dependencies [20d99be]\n  - @smithy/middleware-endpoint@4.0.0\n  - @smithy/middleware-retry@4.0.0\n  - @smithy/util-middleware@4.0.0\n  - @smithy/signature-v4@5.0.0\n  - @smithy/middleware-serde@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n\n## 0.3.36\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.34\n- @smithy/middleware-endpoint@3.2.8\n\n## 0.3.35\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.33\n\n## 0.3.34\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.2.7\n- @smithy/middleware-retry@3.0.32\n\n## 0.3.33\n\n### Patch Changes\n\n- Updated dependencies [e27d42d]\n  - @smithy/middleware-endpoint@3.2.6\n  - @smithy/middleware-retry@3.0.31\n\n## 0.3.32\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.30\n\n## 0.3.31\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/middleware-retry@3.0.29\n  - @smithy/middleware-endpoint@3.2.5\n  - @smithy/middleware-serde@3.0.11\n  - @smithy/protocol-http@4.1.8\n  - @smithy/signature-v4@4.2.4\n  - @smithy/util-middleware@3.0.11\n\n## 0.3.30\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.2.4\n- @smithy/middleware-retry@3.0.28\n\n## 0.3.29\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/middleware-endpoint@3.2.3\n  - @smithy/middleware-retry@3.0.27\n  - @smithy/middleware-serde@3.0.10\n  - @smithy/protocol-http@4.1.7\n  - @smithy/signature-v4@4.2.3\n  - @smithy/util-middleware@3.0.10\n\n## 0.3.28\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/middleware-endpoint@3.2.2\n  - @smithy/middleware-retry@3.0.26\n  - @smithy/middleware-serde@3.0.9\n  - @smithy/protocol-http@4.1.6\n  - @smithy/signature-v4@4.2.2\n  - @smithy/util-middleware@3.0.9\n\n## 0.3.27\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.2.1\n- @smithy/middleware-retry@3.0.25\n\n## 0.3.26\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n- Updated dependencies [d07b0ab]\n  - @smithy/types@3.6.0\n  - @smithy/middleware-endpoint@3.2.0\n  - @smithy/middleware-retry@3.0.24\n  - @smithy/middleware-serde@3.0.8\n  - @smithy/protocol-http@4.1.5\n  - @smithy/signature-v4@4.2.1\n  - @smithy/util-middleware@3.0.8\n\n## 0.3.25\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.23\n\n## 0.3.24\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/signature-v4@4.2.0\n  - @smithy/types@3.5.0\n  - @smithy/middleware-endpoint@3.1.4\n  - @smithy/middleware-retry@3.0.22\n  - @smithy/middleware-serde@3.0.7\n  - @smithy/protocol-http@4.1.4\n  - @smithy/util-middleware@3.0.7\n\n## 0.3.23\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.21\n\n## 0.3.22\n\n### Patch Changes\n\n- Updated dependencies [806cc7f]\n  - @smithy/signature-v4@4.1.4\n  - @smithy/middleware-retry@3.0.20\n\n## 0.3.21\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.19\n\n## 0.3.20\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/middleware-endpoint@3.1.3\n  - @smithy/middleware-retry@3.0.18\n  - @smithy/middleware-serde@3.0.6\n  - @smithy/protocol-http@4.1.3\n  - @smithy/signature-v4@4.1.3\n  - @smithy/util-middleware@3.0.6\n\n## 0.3.19\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/middleware-endpoint@3.1.2\n  - @smithy/middleware-retry@3.0.17\n  - @smithy/middleware-serde@3.0.5\n  - @smithy/protocol-http@4.1.2\n  - @smithy/signature-v4@4.1.2\n  - @smithy/util-middleware@3.0.5\n\n## 0.3.18\n\n### Patch Changes\n\n- Updated dependencies [c8c53ae]\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/middleware-endpoint@3.1.1\n  - @smithy/types@3.4.0\n  - @smithy/middleware-retry@3.0.16\n  - @smithy/middleware-serde@3.0.4\n  - @smithy/protocol-http@4.1.1\n  - @smithy/signature-v4@4.1.1\n  - @smithy/util-middleware@3.0.4\n\n## 0.3.17\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.15\n\n## 0.3.16\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.14\n\n## 0.3.15\n\n### Patch Changes\n\n- a40e1e9: set identity&auth SRA active by default\n\n## 0.3.14\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.13\n\n## 0.3.13\n\n### Patch Changes\n\n- 86862ea: switch to static HttpRequest clone method\n- Updated dependencies [4a40961]\n- Updated dependencies [86862ea]\n  - @smithy/middleware-endpoint@3.1.0\n  - @smithy/protocol-http@4.1.0\n  - @smithy/signature-v4@4.1.0\n  - @smithy/middleware-retry@3.0.12\n  - @smithy/middleware-serde@3.0.3\n\n## 0.3.12\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.11\n\n## 0.3.11\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n- Updated dependencies [ae8bf5c]\n  - @smithy/protocol-http@4.0.4\n  - @smithy/signature-v4@4.0.0\n  - @smithy/middleware-retry@3.0.10\n  - @smithy/middleware-serde@3.0.3\n\n## 0.3.10\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.0.5\n- @smithy/middleware-retry@3.0.9\n\n## 0.3.9\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.8\n\n## 0.3.8\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/middleware-endpoint@3.0.4\n  - @smithy/middleware-retry@3.0.7\n  - @smithy/middleware-serde@3.0.3\n  - @smithy/protocol-http@4.0.3\n  - @smithy/signature-v4@3.1.2\n  - @smithy/util-middleware@3.0.3\n\n## 0.3.7\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/middleware-endpoint@3.0.3\n  - @smithy/middleware-retry@3.0.6\n  - @smithy/middleware-serde@3.0.2\n  - @smithy/protocol-http@4.0.2\n  - @smithy/signature-v4@3.1.1\n  - @smithy/util-middleware@3.0.2\n\n## 0.3.6\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.5\n\n## 0.3.5\n\n### Patch Changes\n\n- Updated dependencies [3c23a83b]\n  - @smithy/signature-v4@3.1.0\n\n## 0.3.4\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/middleware-endpoint@3.0.2\n  - @smithy/middleware-retry@3.0.4\n  - @smithy/middleware-serde@3.0.1\n  - @smithy/protocol-http@4.0.1\n  - @smithy/signature-v4@3.0.1\n  - @smithy/util-middleware@3.0.1\n\n## 0.3.3\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.3\n\n## 0.3.2\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@3.0.1\n- @smithy/middleware-retry@3.0.2\n\n## 0.3.1\n\n### Patch Changes\n\n- @smithy/middleware-retry@3.0.1\n\n## 0.3.0\n\n### Minor Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/middleware-endpoint@3.0.0\n  - @smithy/middleware-retry@3.0.0\n  - @smithy/middleware-serde@3.0.0\n  - @smithy/util-middleware@3.0.0\n  - @smithy/protocol-http@4.0.0\n  - @smithy/signature-v4@3.0.0\n\n## 0.2.3\n\n### Patch Changes\n\n- Updated dependencies [2e090d70]\n  - @smithy/signature-v4@2.3.0\n\n## 0.2.2\n\n### Patch Changes\n\n- Updated dependencies [9961e59d]\n- Updated dependencies [cc54b8d1]\n  - @smithy/signature-v4@2.2.1\n  - @smithy/middleware-endpoint@2.5.1\n  - @smithy/middleware-retry@2.3.1\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies [e03a10ac]\n  - @smithy/middleware-retry@2.3.0\n\n## 0.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/middleware-endpoint@2.5.0\n  - @smithy/middleware-retry@2.2.0\n  - @smithy/middleware-serde@2.3.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/signature-v4@2.2.0\n  - @smithy/types@2.12.0\n\n## 0.1.7\n\n### Patch Changes\n\n- @smithy/middleware-retry@2.1.7\n\n## 0.1.6\n\n### Patch Changes\n\n- Updated dependencies [32e3f6ff]\n  - @smithy/middleware-serde@2.2.1\n  - @smithy/middleware-endpoint@2.4.6\n  - @smithy/middleware-retry@2.1.6\n\n## 0.1.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n- Updated dependencies [49640d6c]\n  - @smithy/middleware-serde@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/middleware-endpoint@2.4.5\n  - @smithy/signature-v4@2.1.4\n  - @smithy/middleware-retry@2.1.5\n  - @smithy/protocol-http@3.2.2\n  - @smithy/util-middleware@2.1.4\n\n## 0.1.4\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.4.4\n- @smithy/middleware-retry@2.1.4\n\n## 0.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/middleware-retry@2.1.3\n  - @smithy/types@2.10.1\n  - @smithy/middleware-endpoint@2.4.3\n  - @smithy/middleware-serde@2.1.3\n  - @smithy/protocol-http@3.2.1\n  - @smithy/signature-v4@2.1.3\n  - @smithy/util-middleware@2.1.3\n\n## 0.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/middleware-endpoint@2.4.2\n  - @smithy/middleware-retry@2.1.2\n  - @smithy/middleware-serde@2.1.2\n  - @smithy/signature-v4@2.1.2\n  - @smithy/util-middleware@2.1.2\n\n## 0.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/middleware-endpoint@2.4.1\n  - @smithy/middleware-retry@2.1.1\n  - @smithy/middleware-serde@2.1.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/signature-v4@2.1.1\n  - @smithy/types@2.9.1\n  - @smithy/util-middleware@2.1.1\n\n## 0.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/middleware-endpoint@2.4.0\n  - @smithy/middleware-retry@2.1.0\n  - @smithy/middleware-serde@2.1.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/signature-v4@2.1.0\n  - @smithy/types@2.9.0\n\n## 0.0.31\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/middleware-endpoint@2.3.0\n  - @smithy/types@2.8.0\n  - @smithy/middleware-retry@2.0.26\n  - @smithy/middleware-serde@2.0.16\n  - @smithy/protocol-http@3.0.12\n  - @smithy/signature-v4@2.0.19\n  - @smithy/util-middleware@2.0.9\n\n## 0.0.30\n\n### Patch Changes\n\n- 164f3bbd: add missing dependency declarations\n  - @smithy/middleware-retry@2.0.25\n\n## 0.0.29\n\n### Patch Changes\n\n- Updated dependencies [7a8023b2]\n  - @smithy/signature-v4@2.0.18\n\n## 0.0.28\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.2.3\n- @smithy/middleware-retry@2.0.24\n\n## 0.0.27\n\n### Patch Changes\n\n- @smithy/middleware-retry@2.0.23\n\n## 0.0.26\n\n### Patch Changes\n\n- Updated dependencies [44f78bd9]\n- Updated dependencies [340634a5]\n- Updated dependencies [3ba4bd93]\n  - @smithy/middleware-retry@2.0.22\n  - @smithy/types@2.7.0\n  - @smithy/signature-v4@2.0.17\n  - @smithy/middleware-endpoint@2.2.2\n  - @smithy/middleware-serde@2.0.15\n  - @smithy/protocol-http@3.0.11\n\n## 0.0.25\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/middleware-endpoint@2.2.1\n  - @smithy/middleware-retry@2.0.21\n  - @smithy/middleware-serde@2.0.14\n  - @smithy/protocol-http@3.0.10\n  - @smithy/signature-v4@2.0.16\n\n## 0.0.24\n\n### Patch Changes\n\n- 8044a814: feat(experimentalIdentityAndAuth): move `experimentalIdentityAndAuth` types and interfaces to `@smithy/types` and `@smithy/core`\n- Updated dependencies [8044a814]\n- Updated dependencies [9e0a5a74]\n  - @smithy/middleware-endpoint@2.2.0\n  - @smithy/types@2.5.0\n  - @smithy/middleware-retry@2.0.20\n  - @smithy/middleware-serde@2.0.13\n  - @smithy/protocol-http@3.0.9\n  - @smithy/signature-v4@2.0.15\n\n## 0.0.23\n\n### Patch Changes\n\n- @smithy/signature-v4@2.0.14\n\n## 0.0.22\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/middleware-endpoint@2.1.5\n  - @smithy/signature-v4@2.0.13\n\n## 0.0.21\n\n### Patch Changes\n\n- e92dbafc: Fix typo in `HttpAuthScheme` not enabled message in `httpAuthSchemeMiddleware`.\n  - @smithy/middleware-endpoint@2.1.4\n  - @smithy/middleware-retry@2.0.19\n\n## 0.0.20\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/middleware-endpoint@2.1.3\n  - @smithy/middleware-retry@2.0.18\n  - @smithy/middleware-serde@2.0.12\n  - @smithy/protocol-http@3.0.8\n  - @smithy/signature-v4@2.0.12\n\n## 0.0.19\n\n### Patch Changes\n\n- @smithy/middleware-endpoint@2.1.2\n- @smithy/middleware-retry@2.0.17\n\n## 0.0.18\n\n### Patch Changes\n\n- 49f75b47: Add `@httpBearerAuth` integration tests.\n- 56bdadd4: Add strict check for `token` in `HttpBearerAuthSigner`.\n- 940aad53: Add `@httpApiKeyAuth` integration tests.\n- 3d5da269: Add strict check for `apiKey` in `HttpApiKeyAuthSigner`.\n- Updated dependencies [afaa68af]\n  - @smithy/middleware-endpoint@2.1.1\n\n## 0.0.17\n\n### Patch Changes\n\n- e5ee17ad: Move `@smithy/util-test` to `devDependencies`.\n\n## 0.0.16\n\n### Patch Changes\n\n- a0957ef1: Fix test script to use `jest`.\n- 58824d85: Remove generic parameter defaults.\n- 6c53a93b: Add different `httpAuthSchemeMiddleware` plugins depending on `@endpointRuleSet`\n- c8c9de77: Await `signer.sign()` in `httpSigningMiddleware`\n- d4df615a: Remove extra `# Change Log from `HttpApiKeyAuthSigner`\n- f38771a3: Scaffold integration tests.\n\n## 0.0.15\n\n### Patch Changes\n\n- Updated dependencies [f64c4c2d]\n  - @smithy/middleware-endpoint@2.1.0\n\n## 0.0.14\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/middleware-endpoint@2.0.11\n  - @smithy/middleware-retry@2.0.16\n  - @smithy/protocol-http@3.0.7\n  - @smithy/signature-v4@2.0.11\n\n## 0.0.13\n\n### Patch Changes\n\n- @smithy/middleware-retry@2.0.15\n\n## 0.0.12\n\n### Patch Changes\n\n- @smithy/middleware-retry@2.0.14\n\n## 0.0.11\n\n### Patch Changes\n\n- 890feeb1: Add aliases for `httpSigningMiddleware`\n\n## 0.0.10\n\n### Patch Changes\n\n- 2503655d: Add `createEndpointRuleSetHttpAuthSchemeParametersProvider()` to generically create `HttpAuthSchemeParametersProvider`s for `@smithy.rules#endpointRuleSet`\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/middleware-endpoint@2.0.10\n  - @smithy/middleware-retry@2.0.13\n  - @smithy/protocol-http@3.0.6\n  - @smithy/signature-v4@2.0.10\n\n## 0.0.9\n\n### Patch Changes\n\n- 76e2ef3c: Allow `DefaultIdentityProviderConfig` to accept `undefined` in the constructor\n- 76e2ef3c: Add `httpAuthSchemeMiddleware` to select an auth scheme\n- 76e2ef3c: Add `memoizeIdentityProvider()`\n- c346d597: Add `createEndpointRuleSetHttpAuthSchemeProvider()` to generically create `HttpAuthSchemeProvider`s for `@smithy.rules#endpointRuleSet`\n\n## 0.0.8\n\n### Patch Changes\n\n- 85448cbc: Update `HttpAuthSchemeParametersProvider` to take in `input`\n- 51b014c8: Add `httpSigningMiddleware` to sign a request based on a selected auth scheme\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/middleware-retry@2.0.12\n  - @smithy/protocol-http@3.0.5\n  - @smithy/signature-v4@2.0.9\n\n## 0.0.7\n\n### Patch Changes\n\n- 36d56a1d: Add additional `HttpAuthScheme` interfaces for auth scheme resolution\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/protocol-http@3.0.4\n  - @smithy/signature-v4@2.0.8\n\n## 0.0.6\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/protocol-http@3.0.3\n  - @smithy/signature-v4@2.0.7\n\n## 0.0.5\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n  - @smithy/signature-v4@2.0.6\n\n## 0.0.4\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n  - @smithy/signature-v4@2.0.6\n\n## 0.0.3\n\n### Patch Changes\n\n- c6251b7a: INTERNAL USE ONLY: Update `HttpAuthScheme` and `IdentityProviderConfig` interfaces\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n  - @smithy/signature-v4@2.0.6\n\n## 0.0.2\n\n### Patch Changes\n\n- 019109d6: INTERNAL USE ONLY: Add `@aws.auth#sigv4` interfaces and classes\n- bae9b5de: INTERNAL USE ONLY: Add `@httpApiKeyAuth` interfaces and classes\n- 2fc7e78e: INTERNAL USE ONLY: Add `@httpBearerAuth` interfaces and classes\n\n## 0.0.1\n\n### Patch Changes\n\n- 632e7d76: INTERNAL USE ONLY: Add experimental package for `experimentalIdentityAndAuth` types and implementations.\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/experimental-identity-and-auth/README.md",
    "content": "# @smithy/experimental-identity-and-auth\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/experimental-identity-and-auth/latest.svg)](https://www.npmjs.com/package/@smithy/experimental-identity-and-auth)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/experimental-identity-and-auth.svg)](https://www.npmjs.com/package/@smithy/experimental-identity-and-auth)\n\n## Usage\n\n**WARNING: This package should NOT be consumed directly in any way.**\n\nThis package is experimental for the development of `experimentalIdentityAndAuth`.\n\nSee [experimental features](https://github.com/smithy-lang/smithy-typescript/blob/main/CONTRIBUTING.md#experimental-features)\nfor more information.\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/package.json",
    "content": "{\n  \"name\": \"@smithy/experimental-identity-and-auth\",\n  \"version\": \"0.6.3\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline experimental-identity-and-auth\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run --passWithNoTests\",\n    \"test:integration\": \"yarn g:vitest run -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"yarn g:vitest watch -c vitest.config.integ.mts\",\n    \"test:watch\": \"yarn g:vitest watch --passWithNoTests\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS Smithy Team\",\n    \"email\": \"\",\n    \"url\": \"https://smithy.io\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/middleware-retry\": \"workspace:^\",\n    \"@smithy/signature-v4\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/experimental-identity-and-auth\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/experimental-identity-and-auth\"\n  },\n  \"devDependencies\": {\n    \"@smithy/util-test\": \"workspace:^\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/HttpAuthScheme.ts",
    "content": "import type { HandlerExecutionContext, Identity, IdentityProvider } from \"@smithy/types\";\n\nimport type { HttpSigner } from \"./HttpSigner\";\nimport type { IdentityProviderConfig } from \"./IdentityProviderConfig\";\n\n/**\n * ID for {@link HttpAuthScheme}\n * @internal\n */\nexport type HttpAuthSchemeId = string;\n\n/**\n * Interface that defines an HttpAuthScheme\n * @internal\n */\nexport interface HttpAuthScheme {\n  /**\n   * ID for an HttpAuthScheme, typically the absolute shape ID of a Smithy auth trait.\n   */\n  schemeId: HttpAuthSchemeId;\n  /**\n   * Gets the IdentityProvider corresponding to an HttpAuthScheme.\n   */\n  identityProvider(config: IdentityProviderConfig): IdentityProvider<Identity> | undefined;\n  /**\n   * HttpSigner corresponding to an HttpAuthScheme.\n   */\n  signer: HttpSigner;\n}\n\n/**\n * Interface that defines the identity and signing properties when selecting\n * an HttpAuthScheme.\n * @internal\n */\nexport interface HttpAuthOption {\n  schemeId: HttpAuthSchemeId;\n  identityProperties?: Record<string, unknown>;\n  signingProperties?: Record<string, unknown>;\n  propertiesExtractor?: <TConfig extends object, TContext extends HandlerExecutionContext>(\n    config: TConfig,\n    context: TContext\n  ) => {\n    identityProperties?: Record<string, unknown>;\n    signingProperties?: Record<string, unknown>;\n  };\n}\n\n/**\n * @internal\n */\nexport interface SelectedHttpAuthScheme {\n  httpAuthOption: HttpAuthOption;\n  identity: Identity;\n  signer: HttpSigner;\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/HttpAuthSchemeProvider.ts",
    "content": "import type { HandlerExecutionContext } from \"@smithy/types\";\n\nimport type { HttpAuthOption } from \"./HttpAuthScheme\";\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeParameters {\n  operation?: string;\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeProvider<TParameters extends HttpAuthSchemeParameters> {\n  (authParameters: TParameters): HttpAuthOption[];\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeParametersProvider<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  (config: TConfig, context: TContext, input: TInput): Promise<TParameters>;\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/HttpSigner.ts",
    "content": "import type { HttpRequest, Identity } from \"@smithy/types\";\n\n/**\n * Interface to sign identity and signing properties.\n * @internal\n */\nexport interface HttpSigner {\n  /**\n   * Signs an HttpRequest with an identity and signing properties.\n   * @param httpRequest request to sign\n   * @param identity identity to sing the request with\n   * @param signingProperties property bag for signing\n   * @returns signed request in a promise\n   */\n  sign(httpRequest: HttpRequest, identity: Identity, signingProperties: Record<string, unknown>): Promise<HttpRequest>;\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/IdentityProviderConfig.ts",
    "content": "import type { Identity, IdentityProvider } from \"@smithy/types\";\n\nimport type { HttpAuthSchemeId } from \"./HttpAuthScheme\";\n\n/**\n * Interface to get an IdentityProvider for a specified HttpAuthScheme\n * @internal\n */\nexport interface IdentityProviderConfig {\n  /**\n   * Get the IdentityProvider for a specified HttpAuthScheme.\n   * @param schemeId schemeId of the HttpAuthScheme\n   * @returns IdentityProvider or undefined if HttpAuthScheme is not found\n   */\n  getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined;\n}\n\n/**\n * Default implementation of IdentityProviderConfig\n * @internal\n */\nexport class DefaultIdentityProviderConfig implements IdentityProviderConfig {\n  private authSchemes: Map<HttpAuthSchemeId, IdentityProvider<Identity>> = new Map();\n\n  /**\n   * Creates an IdentityProviderConfig with a record of scheme IDs to identity providers.\n   *\n   * @param config scheme IDs and identity providers to configure\n   */\n  constructor(config: Record<HttpAuthSchemeId, IdentityProvider<Identity> | undefined>) {\n    for (const [key, value] of Object.entries(config)) {\n      if (value !== undefined) {\n        this.authSchemes.set(key, value);\n      }\n    }\n  }\n\n  public getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined {\n    return this.authSchemes.get(schemeId);\n  }\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/SigV4Signer.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport { SignatureV4 } from \"@smithy/signature-v4\";\nimport type { AwsCredentialIdentity, HttpRequest as IHttpRequest } from \"@smithy/types\";\n\nimport type { HttpSigner } from \"./HttpSigner\";\n\n/**\n * @internal\n */\nexport class SigV4Signer implements HttpSigner {\n  async sign(\n    httpRequest: HttpRequest,\n    identity: AwsCredentialIdentity,\n    signingProperties: Record<string, any>\n  ): Promise<IHttpRequest> {\n    const clonedRequest = HttpRequest.clone(httpRequest);\n    const signer = new SignatureV4({\n      applyChecksum: signingProperties.applyChecksum !== undefined ? signingProperties.applyChecksum : true,\n      credentials: identity,\n      region: signingProperties.region,\n      service: signingProperties.name,\n      sha256: signingProperties.sha256,\n      uriEscapePath: signingProperties.uriEscapePath !== undefined ? signingProperties.uriEscapePath : true,\n    });\n    return signer.sign(clonedRequest, {\n      signingDate: new Date(),\n      signableHeaders: signingProperties.signableHeaders,\n      unsignableHeaders: signingProperties.unsignableHeaders,\n      signingRegion: signingProperties.signingRegion,\n      signingService: signingProperties.signingService,\n    });\n  }\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/apiKeyIdentity.ts",
    "content": "import type { Identity, IdentityProvider } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface ApiKeyIdentity extends Identity {\n  readonly apiKey: string;\n}\n\n/**\n * @internal\n */\nexport type ApiKeyIdentityProvider = IdentityProvider<ApiKeyIdentity>;\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/endpointRuleSet.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport { resolveParams, type EndpointParameterInstructions } from \"@smithy/core/endpoints\";\nimport type { EndpointParameters, EndpointV2, HandlerExecutionContext, Logger } from \"@smithy/types\";\n\nimport type { HttpAuthOption } from \"./HttpAuthScheme\";\nimport type {\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  HttpAuthSchemeProvider,\n} from \"./HttpAuthSchemeProvider\";\n\n/**\n * @internal\n */\nexport interface EndpointRuleSetHttpAuthSchemeProvider<\n  EndpointParametersT extends EndpointParameters,\n  HttpAuthSchemeParametersT extends HttpAuthSchemeParameters,\n> extends HttpAuthSchemeProvider<EndpointParametersT & HttpAuthSchemeParametersT> {}\n\n/**\n * @internal\n */\nexport interface DefaultEndpointResolver<EndpointParametersT extends EndpointParameters> {\n  (params: EndpointParametersT, context?: { logger?: Logger }): EndpointV2;\n}\n\n/**\n * @internal\n */\nexport const createEndpointRuleSetHttpAuthSchemeProvider = <\n  EndpointParametersT extends EndpointParameters,\n  HttpAuthSchemeParametersT extends HttpAuthSchemeParameters,\n>(\n  defaultEndpointResolver: DefaultEndpointResolver<EndpointParametersT>,\n  defaultHttpAuthSchemeResolver: HttpAuthSchemeProvider<HttpAuthSchemeParametersT>\n): EndpointRuleSetHttpAuthSchemeProvider<EndpointParametersT, HttpAuthSchemeParametersT> => {\n  const endpointRuleSetHttpAuthSchemeProvider: EndpointRuleSetHttpAuthSchemeProvider<\n    EndpointParametersT,\n    HttpAuthSchemeParametersT\n  > = (authParameters) => {\n    const endpoint: EndpointV2 = defaultEndpointResolver(authParameters);\n    const authSchemes = endpoint.properties?.authSchemes;\n    if (!authSchemes) {\n      return defaultHttpAuthSchemeResolver(authParameters);\n    }\n    const options: HttpAuthOption[] = [];\n    for (const scheme of authSchemes) {\n      const { name: resolvedName, properties = {}, ...rest } = scheme;\n      const name = resolvedName.toLowerCase();\n      if (resolvedName !== name) {\n        console.warn(`HttpAuthScheme has been normalized with lowercasing: \\`${resolvedName}\\` to \\`${name}\\``);\n      }\n      let schemeId;\n      if (name === \"sigv4\") {\n        schemeId = \"aws.auth#sigv4\";\n      } else if (name === \"sigv4a\") {\n        schemeId = \"aws.auth#sigv4a\";\n      } else {\n        throw new Error(`Unknown HttpAuthScheme found in \\`@smithy.rules#endpointRuleSet\\`: \\`${name}\\``);\n      }\n      options.push({\n        schemeId,\n        signingProperties: {\n          ...rest,\n          ...properties,\n        },\n      });\n    }\n    return options;\n  };\n\n  return endpointRuleSetHttpAuthSchemeProvider;\n};\n\n/**\n * @internal\n */\nexport interface EndpointRuleSetSmithyContext {\n  endpointRuleSet?: {\n    getEndpointParameterInstructions?: () => EndpointParameterInstructions;\n  };\n}\n\n/**\n * @internal\n */\nexport interface EndpointRuleSetHttpAuthSchemeParametersProvider<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters & EndpointParameters,\n  TInput extends object,\n> extends HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput> {}\n\n/**\n * @internal\n */\nexport const createEndpointRuleSetHttpAuthSchemeParametersProvider =\n  <\n    TConfig extends object,\n    TContext extends HandlerExecutionContext,\n    THttpAuthSchemeParameters extends HttpAuthSchemeParameters,\n    TEndpointParameters extends EndpointParameters,\n    TParameters extends THttpAuthSchemeParameters & TEndpointParameters,\n    TInput extends object,\n  >(\n    defaultHttpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<\n      TConfig,\n      TContext,\n      THttpAuthSchemeParameters,\n      TInput\n    >\n  ): EndpointRuleSetHttpAuthSchemeParametersProvider<\n    TConfig,\n    TContext,\n    THttpAuthSchemeParameters & TEndpointParameters,\n    TInput\n  > =>\n  async (config: TConfig, context: TContext, input: TInput): Promise<TParameters> => {\n    if (!input) {\n      throw new Error(`Could not find \\`input\\` for \\`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\\``);\n    }\n    const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);\n    const instructionsFn = (getSmithyContext(context) as EndpointRuleSetSmithyContext)?.endpointRuleSet\n      ?.getEndpointParameterInstructions;\n    if (!instructionsFn) {\n      throw new Error(`getEndpointParameterInstructions() is not defined on \\`${context.commandName!}\\``);\n    }\n    const endpointParameters = await resolveParams(\n      input as Record<string, unknown>,\n      { getEndpointParameterInstructions: instructionsFn! },\n      config as Record<string, unknown>\n    );\n    return Object.assign(defaultParameters, endpointParameters) as TParameters;\n  };\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/httpApiKeyAuth.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpRequest as IHttpRequest } from \"@smithy/types\";\n\nimport type { HttpSigner } from \"./HttpSigner\";\nimport type { ApiKeyIdentity } from \"./apiKeyIdentity\";\n\n/**\n * @internal\n */\nexport enum HttpApiKeyAuthLocation {\n  HEADER = \"header\",\n  QUERY = \"query\",\n}\n\n/**\n * @internal\n */\nexport class HttpApiKeyAuthSigner implements HttpSigner {\n  public async sign(\n    httpRequest: HttpRequest,\n    identity: ApiKeyIdentity,\n    signingProperties: Record<string, any>\n  ): Promise<IHttpRequest> {\n    if (!signingProperties) {\n      throw new Error(\n        \"request could not be signed with `apiKey` since the `name` and `in` signer properties are missing\"\n      );\n    }\n    if (!signingProperties.name) {\n      throw new Error(\"request could not be signed with `apiKey` since the `name` signer property is missing\");\n    }\n    if (!signingProperties.in) {\n      throw new Error(\"request could not be signed with `apiKey` since the `in` signer property is missing\");\n    }\n    if (!identity.apiKey) {\n      throw new Error(\"request could not be signed with `apiKey` since the `apiKey` is not defined\");\n    }\n    const clonedRequest = HttpRequest.clone(httpRequest);\n    if (signingProperties.in === HttpApiKeyAuthLocation.QUERY) {\n      clonedRequest.query[signingProperties.name] = identity.apiKey;\n    } else if (signingProperties.in === HttpApiKeyAuthLocation.HEADER) {\n      clonedRequest.headers[signingProperties.name] = signingProperties.scheme\n        ? `${signingProperties.scheme} ${identity.apiKey}`\n        : identity.apiKey;\n    } else {\n      throw new Error(\n        \"request can only be signed with `apiKey` locations `query` or `header`, \" +\n          \"but found: `\" +\n          signingProperties.in +\n          \"`\"\n      );\n    }\n    return clonedRequest;\n  }\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/httpBearerAuth.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpRequest as IHttpRequest } from \"@smithy/types\";\n\nimport type { HttpSigner } from \"./HttpSigner\";\nimport type { TokenIdentity } from \"./tokenIdentity\";\n\n/**\n * @internal\n */\nexport class HttpBearerAuthSigner implements HttpSigner {\n  public async sign(\n    httpRequest: HttpRequest,\n    identity: TokenIdentity,\n    signingProperties: Record<string, any>\n  ): Promise<IHttpRequest> {\n    const clonedRequest = HttpRequest.clone(httpRequest);\n    if (!identity.token) {\n      throw new Error(\"request could not be signed with `token` since the `token` is not defined\");\n    }\n    clonedRequest.headers[\"Authorization\"] = `Bearer ${identity.token}`;\n    return clonedRequest;\n  }\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/index.ts",
    "content": "export * from \"./HttpAuthScheme\";\nexport * from \"./HttpAuthSchemeProvider\";\nexport * from \"./HttpSigner\";\nexport * from \"./IdentityProviderConfig\";\nexport * from \"./SigV4Signer\";\nexport * from \"./apiKeyIdentity\";\nexport * from \"./endpointRuleSet\";\nexport * from \"./httpApiKeyAuth\";\nexport * from \"./httpBearerAuth\";\nexport * from \"./memoizeIdentityProvider\";\nexport * from \"./middleware-http-auth-scheme\";\nexport * from \"./middleware-http-signing\";\nexport * from \"./noAuth\";\nexport * from \"./tokenIdentity\";\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/integration/httpApiKeyAuth.integ.spec.ts",
    "content": "import {\n  HttpApiKeyAuthServiceClient,\n  OnlyHttpApiKeyAuthCommand,\n  OnlyHttpApiKeyAuthOptionalCommand,\n  SameAsServiceCommand,\n} from \"@smithy/identity-and-auth-http-api-key-auth-service\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { requireRequestsFrom } from \"../../../../private/util-test/src/index\";\n\ndescribe(\"@httpApiKeyAuth integration tests\", () => {\n  // Match `HttpApiKeyAuthService` `@httpApiKeyAuth` trait\n  const MOCK_API_KEY_NAME = \"Authorization\";\n  const MOCK_API_KEY_SCHEME = \"ApiKey\";\n  const MOCK_API_KEY = \"APIKEY_123\";\n\n  // Arbitrary mock endpoint (`requireRequestsFrom()` intercepts network requests)\n  const MOCK_ENDPOINT = \"https://foo.bar\";\n\n  describe(\"Operation requires `@httpApiKeyAuth`\", () => {\n    it(\"Request is thrown when `apiKey` is not configured\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpApiKeyAuthCommand({}))).rejects.toThrow(\n        \"HttpAuthScheme `smithy.api#httpApiKeyAuth` did not have an IdentityProvider configured.\"\n      );\n    });\n\n    it(\"Request is thrown when `apiKey` is configured incorrectly\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: {} as any,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpApiKeyAuthCommand({}))).rejects.toThrow(\n        \"request could not be signed with `apiKey` since the `apiKey` is not defined\"\n      );\n    });\n\n    it(\"Request is thrown given configured `apiKey` identity provider throws\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: async () => {\n          throw new Error(\"IdentityProvider throws this error\");\n        },\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpApiKeyAuthCommand({}))).rejects.toThrow(\n        \"IdentityProvider throws this error\"\n      );\n    });\n\n    it(\"Request is signed given configured `apiKey` identity provider\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: async () => ({\n          apiKey: MOCK_API_KEY,\n        }),\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: `${MOCK_API_KEY_SCHEME} ${MOCK_API_KEY}`,\n        },\n      });\n      await client.send(new OnlyHttpApiKeyAuthCommand({}));\n    });\n\n    it(\"Request is signed given configured `apiKey` identity\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: {\n          apiKey: MOCK_API_KEY,\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: `${MOCK_API_KEY_SCHEME} ${MOCK_API_KEY}`,\n        },\n      });\n      await client.send(new OnlyHttpApiKeyAuthCommand({}));\n    });\n  });\n\n  describe(\"Operation has `@httpApiKeyAuth` and `@optionalAuth`\", () => {\n    it(\"Request is NOT thrown and NOT signed when `apiKey` is not configured\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: (value) => expect(value).toBeUndefined(),\n        },\n      });\n      await client.send(new OnlyHttpApiKeyAuthOptionalCommand({}));\n    });\n\n    it(\"Request is thrown when `apiKey` is configured incorrectly\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: {} as any,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpApiKeyAuthOptionalCommand({}))).rejects.toThrow(\n        \"request could not be signed with `apiKey` since the `apiKey` is not defined\"\n      );\n    });\n\n    it(\"Request is thrown given configured `apiKey` identity provider throws\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: async () => {\n          throw new Error(\"IdentityProvider throws this error\");\n        },\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpApiKeyAuthOptionalCommand({}))).rejects.toThrow(\n        \"IdentityProvider throws this error\"\n      );\n    });\n\n    it(\"Request is signed given configured `apiKey` identity provider\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: async () => ({\n          apiKey: MOCK_API_KEY,\n        }),\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: `${MOCK_API_KEY_SCHEME} ${MOCK_API_KEY}`,\n        },\n      });\n      await client.send(new OnlyHttpApiKeyAuthOptionalCommand({}));\n    });\n\n    it(\"Request is signed given configured `apiKey` identity\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: {\n          apiKey: MOCK_API_KEY,\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: `${MOCK_API_KEY_SCHEME} ${MOCK_API_KEY}`,\n        },\n      });\n      await client.send(new OnlyHttpApiKeyAuthOptionalCommand({}));\n    });\n  });\n\n  describe(\"Service has `@httpApiKeyAuth`\", () => {\n    it(\"Request is thrown when `apiKey` is not configured\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new SameAsServiceCommand({}))).rejects.toThrow(\n        \"HttpAuthScheme `smithy.api#httpApiKeyAuth` did not have an IdentityProvider configured.\"\n      );\n    });\n\n    it(\"Request is thrown when `apiKey` is configured incorrectly\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: {} as any,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new SameAsServiceCommand({}))).rejects.toThrow(\n        \"request could not be signed with `apiKey` since the `apiKey` is not defined\"\n      );\n    });\n\n    it(\"Request is thrown given configured `apiKey` identity provider throws\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: async () => {\n          throw new Error(\"IdentityProvider throws this error\");\n        },\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new SameAsServiceCommand({}))).rejects.toThrow(\"IdentityProvider throws this error\");\n    });\n\n    it(\"Request is signed given configured `apiKey` identity provider\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: async () => ({\n          apiKey: MOCK_API_KEY,\n        }),\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: `${MOCK_API_KEY_SCHEME} ${MOCK_API_KEY}`,\n        },\n      });\n      await client.send(new SameAsServiceCommand({}));\n    });\n\n    it(\"Request is signed given configured `apiKey` identity\", async () => {\n      const client = new HttpApiKeyAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        apiKey: {\n          apiKey: MOCK_API_KEY,\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          [MOCK_API_KEY_NAME]: `${MOCK_API_KEY_SCHEME} ${MOCK_API_KEY}`,\n        },\n      });\n      await client.send(new SameAsServiceCommand({}));\n    });\n  });\n});\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/integration/httpBearerAuth.integ.spec.ts",
    "content": "import {\n  HttpBearerAuthServiceClient,\n  OnlyHttpBearerAuthCommand,\n  OnlyHttpBearerAuthOptionalCommand,\n  SameAsServiceCommand,\n} from \"@smithy/identity-and-auth-http-bearer-auth-service\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { requireRequestsFrom } from \"../../../../private/util-test/src/index\";\n\ndescribe(\"@httpBearerAuth integration tests\", () => {\n  // Arbitrary mock token\n  const MOCK_TOKEN = \"TOKEN_123\";\n\n  // Arbitrary mock endpoint (`requireRequestsFrom()` intercepts network requests)\n  const MOCK_ENDPOINT = \"https://foo.bar\";\n\n  describe(\"Operation requires `@httpBearerAuth`\", () => {\n    it(\"Request is thrown when `token` is not configured\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpBearerAuthCommand({}))).rejects.toThrow(\n        \"HttpAuthScheme `smithy.api#httpBearerAuth` did not have an IdentityProvider configured.\"\n      );\n    });\n\n    it(\"Request is thrown when `token` is configured incorrectly\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: {} as any,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpBearerAuthCommand({}))).rejects.toThrow(\n        \"request could not be signed with `token` since the `token` is not defined\"\n      );\n    });\n\n    it(\"Request is thrown given configured `token` identity provider throws\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: async () => {\n          throw new Error(\"IdentityProvider throws this error\");\n        },\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpBearerAuthCommand({}))).rejects.toThrow(\n        \"IdentityProvider throws this error\"\n      );\n    });\n\n    it(\"Request is signed given configured `token` identity provider\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: async () => ({\n          token: MOCK_TOKEN,\n        }),\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: `Bearer ${MOCK_TOKEN}`,\n        },\n      });\n      await client.send(new OnlyHttpBearerAuthCommand({}));\n    });\n\n    it(\"Request is signed given configured `token` identity\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: {\n          token: MOCK_TOKEN,\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: `Bearer ${MOCK_TOKEN}`,\n        },\n      });\n      await client.send(new OnlyHttpBearerAuthCommand({}));\n    });\n  });\n\n  describe(\"Operation has `@httpBearerAuth` and `@optionalAuth`\", () => {\n    it(\"Request is NOT thrown and NOT signed when `token` is not configured\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: (value) => expect(value).toBeUndefined(),\n        },\n      });\n      await client.send(new OnlyHttpBearerAuthOptionalCommand({}));\n    });\n\n    it(\"Request is thrown when `token` is configured incorrectly\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: {} as any,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpBearerAuthOptionalCommand({}))).rejects.toThrow(\n        \"request could not be signed with `token` since the `token` is not defined\"\n      );\n    });\n\n    it(\"Request is thrown given configured `token` identity provider throws\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: async () => {\n          throw new Error(\"IdentityProvider throws this error\");\n        },\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new OnlyHttpBearerAuthOptionalCommand({}))).rejects.toThrow(\n        \"IdentityProvider throws this error\"\n      );\n    });\n\n    it(\"Request is signed given configured `token` identity provider\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: async () => ({\n          token: MOCK_TOKEN,\n        }),\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: `Bearer ${MOCK_TOKEN}`,\n        },\n      });\n      await client.send(new OnlyHttpBearerAuthOptionalCommand({}));\n    });\n\n    it(\"Request is signed given configured `token` identity\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: {\n          token: MOCK_TOKEN,\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: `Bearer ${MOCK_TOKEN}`,\n        },\n      });\n      await client.send(new OnlyHttpBearerAuthOptionalCommand({}));\n    });\n  });\n\n  describe(\"Service has `@httpBearerAuth`\", () => {\n    it(\"Request is thrown when `token` is not configured\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new SameAsServiceCommand({}))).rejects.toThrow(\n        \"HttpAuthScheme `smithy.api#httpBearerAuth` did not have an IdentityProvider configured.\"\n      );\n    });\n\n    it(\"Request is thrown when `token` is configured incorrectly\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: {} as any,\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new SameAsServiceCommand({}))).rejects.toThrow(\n        \"request could not be signed with `token` since the `token` is not defined\"\n      );\n    });\n\n    it(\"Request is thrown given configured `token` identity provider throws\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: async () => {\n          throw new Error(\"IdentityProvider throws this error\");\n        },\n      });\n      requireRequestsFrom(client).toMatch({});\n      await expect(client.send(new SameAsServiceCommand({}))).rejects.toThrow(\"IdentityProvider throws this error\");\n    });\n\n    it(\"Request is signed given configured `token` identity provider\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: async () => ({\n          token: MOCK_TOKEN,\n        }),\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: `Bearer ${MOCK_TOKEN}`,\n        },\n      });\n      await client.send(new SameAsServiceCommand({}));\n    });\n\n    it(\"Request is signed given configured `token` identity\", async () => {\n      const client = new HttpBearerAuthServiceClient({\n        endpoint: MOCK_ENDPOINT,\n        token: {\n          token: MOCK_TOKEN,\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          Authorization: `Bearer ${MOCK_TOKEN}`,\n        },\n      });\n      await client.send(new SameAsServiceCommand({}));\n    });\n  });\n});\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/memoizeIdentityProvider.ts",
    "content": "import type { Identity, IdentityProvider } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const createIsIdentityExpiredFunction = (expirationMs: number) =>\n  function isIdentityExpired(identity: Identity) {\n    return doesIdentityRequireRefresh(identity) && identity.expiration!.getTime() - Date.now() < expirationMs;\n  };\n\n/**\n * This may need to be configurable in the future, but for now it is defaulted to 5min.\n *\n * @internal\n */\nexport const EXPIRATION_MS = 300_000;\n\n/**\n * @internal\n */\nexport const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);\n\n/**\n * @internal\n */\nexport const doesIdentityRequireRefresh = (identity: Identity) => identity.expiration !== undefined;\n\n/**\n * @internal\n */\nexport interface MemoizedIdentityProvider<IdentityT extends Identity> {\n  (options?: Record<string, any> & { forceRefresh?: boolean }): Promise<IdentityT>;\n}\n\n/**\n * @internal\n */\nexport const memoizeIdentityProvider = <IdentityT extends Identity>(\n  provider: IdentityT | IdentityProvider<IdentityT> | undefined,\n  isExpired: (resolved: Identity) => boolean,\n  requiresRefresh: (resolved: Identity) => boolean\n): MemoizedIdentityProvider<IdentityT> | undefined => {\n  if (provider === undefined) {\n    return undefined;\n  }\n  const normalizedProvider: IdentityProvider<IdentityT> =\n    typeof provider !== \"function\" ? async () => Promise.resolve(provider) : provider;\n  let resolved: IdentityT;\n  let pending: Promise<IdentityT> | undefined;\n  let hasResult: boolean;\n  let isConstant = false;\n  // Wrapper over supplied provider with side effect to handle concurrent invocation.\n  const coalesceProvider: MemoizedIdentityProvider<IdentityT> = async (options) => {\n    if (!pending) {\n      pending = normalizedProvider(options);\n    }\n    try {\n      resolved = await pending;\n      hasResult = true;\n      isConstant = false;\n    } finally {\n      pending = undefined;\n    }\n    return resolved;\n  };\n\n  if (isExpired === undefined) {\n    // This is a static memoization; no need to incorporate refreshing unless using forceRefresh;\n    return async (options) => {\n      if (!hasResult || options?.forceRefresh) {\n        resolved = await coalesceProvider(options);\n      }\n      return resolved;\n    };\n  }\n\n  return async (options) => {\n    if (!hasResult || options?.forceRefresh) {\n      resolved = await coalesceProvider(options);\n    }\n    if (isConstant) {\n      return resolved;\n    }\n\n    if (!requiresRefresh(resolved)) {\n      isConstant = true;\n      return resolved;\n    }\n    if (isExpired(resolved)) {\n      await coalesceProvider(options);\n      return resolved;\n    }\n    return resolved;\n  };\n};\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.ts",
    "content": "import { endpointMiddlewareOptions } from \"@smithy/core/endpoints\";\nimport type {\n  HandlerExecutionContext,\n  Pluggable,\n  RelativeMiddlewareOptions,\n  SerializeHandlerOptions,\n} from \"@smithy/types\";\n\nimport type { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider } from \"../HttpAuthSchemeProvider\";\nimport type { IdentityProviderConfig } from \"../IdentityProviderConfig\";\nimport { httpAuthSchemeMiddleware, type PreviouslyResolved } from \"./httpAuthSchemeMiddleware\";\n\n/**\n * @internal\n */\nexport const httpAuthSchemeEndpointRuleSetMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"serialize\",\n  tags: [\"HTTP_AUTH_SCHEME\"],\n  name: \"httpAuthSchemeMiddleware\",\n  override: true,\n  relation: \"before\",\n  toMiddleware: endpointMiddlewareOptions.name!,\n};\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeEndpointRuleSetPluginOptions<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;\n  identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;\n}\n\n/**\n * @internal\n */\nexport const getHttpAuthSchemeEndpointRuleSetPlugin = <\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n>(\n  config: TConfig & PreviouslyResolved<TParameters>,\n  {\n    httpAuthSchemeParametersProvider,\n    identityProviderConfigProvider,\n  }: HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig, TContext, TParameters, TInput>\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(\n      httpAuthSchemeMiddleware(config, {\n        httpAuthSchemeParametersProvider,\n        identityProviderConfigProvider,\n      }),\n      httpAuthSchemeEndpointRuleSetMiddlewareOptions\n    );\n  },\n});\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-auth-scheme/getHttpAuthSchemePlugin.ts",
    "content": "import { serializerMiddlewareOption } from \"@smithy/core/serde\";\nimport type {\n  HandlerExecutionContext,\n  Pluggable,\n  RelativeMiddlewareOptions,\n  SerializeHandlerOptions,\n} from \"@smithy/types\";\n\nimport type { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider } from \"../HttpAuthSchemeProvider\";\nimport type { IdentityProviderConfig } from \"../IdentityProviderConfig\";\nimport { httpAuthSchemeMiddleware, type PreviouslyResolved } from \"./httpAuthSchemeMiddleware\";\n\n/**\n * @internal\n */\nexport const httpAuthSchemeMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"serialize\",\n  tags: [\"HTTP_AUTH_SCHEME\"],\n  name: \"httpAuthSchemeMiddleware\",\n  override: true,\n  relation: \"before\",\n  toMiddleware: serializerMiddlewareOption.name!,\n};\n\n/**\n * @internal\n */\ninterface HttpAuthSchemePluginOptions<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;\n  identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;\n}\n\n/**\n * @internal\n */\nexport const getHttpAuthSchemePlugin = <\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n>(\n  config: TConfig & PreviouslyResolved<TParameters>,\n  {\n    httpAuthSchemeParametersProvider,\n    identityProviderConfigProvider,\n  }: HttpAuthSchemePluginOptions<TConfig, TContext, TParameters, TInput>\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(\n      httpAuthSchemeMiddleware(config, {\n        httpAuthSchemeParametersProvider,\n        identityProviderConfigProvider,\n      }),\n      httpAuthSchemeMiddlewareOptions\n    );\n  },\n});\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-auth-scheme/httpAuthSchemeMiddleware.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport type {\n  HandlerExecutionContext,\n  SMITHY_CONTEXT_KEY,\n  SerializeHandler,\n  SerializeHandlerArguments,\n  SerializeHandlerOutput,\n  SerializeMiddleware,\n} from \"@smithy/types\";\n\nimport type { HttpAuthScheme, HttpAuthSchemeId, SelectedHttpAuthScheme } from \"../HttpAuthScheme\";\nimport type {\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  HttpAuthSchemeProvider,\n} from \"../HttpAuthSchemeProvider\";\nimport type { IdentityProviderConfig } from \"../IdentityProviderConfig\";\n\n/**\n * @internal\n */\nexport interface PreviouslyResolved<TParameters extends HttpAuthSchemeParameters> {\n  httpAuthSchemes: HttpAuthScheme[];\n  httpAuthSchemeProvider: HttpAuthSchemeProvider<TParameters>;\n}\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeMiddlewareOptions<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;\n  identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;\n}\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeMiddlewareSmithyContext extends Record<string, unknown> {\n  selectedHttpAuthScheme?: SelectedHttpAuthScheme;\n}\n\n/**\n * @internal\n */\ninterface HttpAuthSchemeMiddlewareHandlerExecutionContext extends HandlerExecutionContext {\n  [SMITHY_CONTEXT_KEY]?: HttpAuthSchemeMiddlewareSmithyContext;\n}\n\n/**\n * Later HttpAuthSchemes with the same HttpAuthSchemeId will overwrite previous ones.\n *\n * @internal\n */\nfunction convertHttpAuthSchemesToMap(httpAuthSchemes: HttpAuthScheme[]): Map<HttpAuthSchemeId, HttpAuthScheme> {\n  const map = new Map();\n  for (const scheme of httpAuthSchemes) {\n    map.set(scheme.schemeId, scheme);\n  }\n  return map;\n}\n\n/**\n * @internal\n */\nexport const httpAuthSchemeMiddleware =\n  <\n    TInput extends object,\n    Output extends object,\n    TConfig extends object,\n    TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext,\n    TParameters extends HttpAuthSchemeParameters,\n  >(\n    config: TConfig & PreviouslyResolved<TParameters>,\n    mwOptions: HttpAuthSchemeMiddlewareOptions<TConfig, TContext, TParameters, TInput>\n  ): SerializeMiddleware<TInput, Output> =>\n  (\n    next: SerializeHandler<TInput, Output>,\n    context: HttpAuthSchemeMiddlewareHandlerExecutionContext\n  ): SerializeHandler<TInput, Output> =>\n  async (args: SerializeHandlerArguments<TInput>): Promise<SerializeHandlerOutput<Output>> => {\n    const options = config.httpAuthSchemeProvider(\n      await mwOptions.httpAuthSchemeParametersProvider(config, context as TContext, args.input)\n    );\n    const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);\n    const smithyContext: HttpAuthSchemeMiddlewareSmithyContext = getSmithyContext(context);\n    const failureReasons = [];\n    for (const option of options) {\n      const scheme = authSchemes.get(option.schemeId);\n      if (!scheme) {\n        failureReasons.push(`HttpAuthScheme \\`${option.schemeId}\\` was not enabled for this service.`);\n        continue;\n      }\n      const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));\n      if (!identityProvider) {\n        failureReasons.push(`HttpAuthScheme \\`${option.schemeId}\\` did not have an IdentityProvider configured.`);\n        continue;\n      }\n      const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};\n      option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);\n      option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);\n      smithyContext.selectedHttpAuthScheme = {\n        httpAuthOption: option,\n        identity: await identityProvider(option.identityProperties),\n        signer: scheme.signer,\n      };\n      break;\n    }\n    if (!smithyContext.selectedHttpAuthScheme) {\n      throw new Error(failureReasons.join(\"\\n\"));\n    }\n    return next(args);\n  };\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-auth-scheme/index.ts",
    "content": "export * from \"./httpAuthSchemeMiddleware\";\nexport * from \"./getHttpAuthSchemeEndpointRuleSetPlugin\";\nexport * from \"./getHttpAuthSchemePlugin\";\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-signing/getHttpSigningMiddleware.ts",
    "content": "import { retryMiddlewareOptions } from \"@smithy/core/retry\";\nimport type { FinalizeRequestHandlerOptions, Pluggable, RelativeMiddlewareOptions } from \"@smithy/types\";\n\nimport { httpSigningMiddleware } from \"./httpSigningMiddleware\";\n\n/**\n * @internal\n */\nexport const httpSigningMiddlewareOptions: FinalizeRequestHandlerOptions & RelativeMiddlewareOptions = {\n  step: \"finalizeRequest\",\n  tags: [\"HTTP_SIGNING\"],\n  name: \"httpSigningMiddleware\",\n  aliases: [\"apiKeyMiddleware\", \"tokenMiddleware\", \"awsAuthMiddleware\"],\n  override: true,\n  relation: \"after\",\n  toMiddleware: retryMiddlewareOptions.name!,\n};\n\n/**\n * @internal\n */\nexport const getHttpSigningPlugin = <Input extends object, Output extends object>(\n  config: object\n): Pluggable<Input, Output> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);\n  },\n});\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-signing/httpSigningMiddleware.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { getSmithyContext } from \"@smithy/core/client\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport type {\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  FinalizeHandlerOutput,\n  FinalizeRequestMiddleware,\n  HandlerExecutionContext,\n  SMITHY_CONTEXT_KEY,\n} from \"@smithy/types\";\n\nimport type { SelectedHttpAuthScheme } from \"../HttpAuthScheme\";\n\n/**\n * @internal\n */\ninterface HttpSigningMiddlewareSmithyContext extends Record<string, unknown> {\n  selectedHttpAuthScheme?: SelectedHttpAuthScheme;\n}\n\n/**\n * @internal\n */\ninterface HttpSigningMiddlewareHandlerExecutionContext extends HandlerExecutionContext {\n  [SMITHY_CONTEXT_KEY]?: HttpSigningMiddlewareSmithyContext;\n}\n\n/**\n * @internal\n */\nexport const httpSigningMiddleware =\n  <Input extends object, Output extends object>(config: object): FinalizeRequestMiddleware<Input, Output> =>\n  (\n    next: FinalizeHandler<Input, Output>,\n    context: HttpSigningMiddlewareHandlerExecutionContext\n  ): FinalizeHandler<Input, Output> =>\n  async (args: FinalizeHandlerArguments<Input>): Promise<FinalizeHandlerOutput<Output>> => {\n    if (!HttpRequest.isInstance(args.request)) {\n      return next(args);\n    }\n\n    const smithyContext: HttpSigningMiddlewareSmithyContext = getSmithyContext(context);\n    const scheme = smithyContext.selectedHttpAuthScheme;\n    if (!scheme) {\n      throw new Error(`No HttpAuthScheme was selected: unable to sign request`);\n    }\n    const {\n      httpAuthOption: { signingProperties },\n      identity,\n      signer,\n    } = scheme;\n    return next({\n      ...args,\n      request: await signer.sign(args.request, identity, signingProperties || {}),\n    });\n  };\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/middleware-http-signing/index.ts",
    "content": "export * from \"./httpSigningMiddleware\";\nexport * from \"./getHttpSigningMiddleware\";\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/noAuth.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { HttpRequest, Identity } from \"@smithy/types\";\n\nimport type { HttpSigner } from \"./HttpSigner\";\n\n/**\n * Signer for the synthetic @smithy.api#noAuth auth scheme.\n * @internal\n */\nexport class NoAuthSigner implements HttpSigner {\n  async sign(\n    httpRequest: HttpRequest,\n    identity: Identity,\n    signingProperties: Record<string, unknown>\n  ): Promise<HttpRequest> {\n    return httpRequest;\n  }\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/src/tokenIdentity.ts",
    "content": "import type { Identity, IdentityProvider } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport interface TokenIdentity extends Identity {\n  /**\n   * The literal token string\n   */\n  readonly token: string;\n}\n\n/**\n * @internal\n */\nexport type TokenIdentityProvider = IdentityProvider<TokenIdentity>;\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/tsconfig.test.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"rootDir\": \"src\",\n    \"noEmit\": true\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"],\n  \"exclude\": []\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/experimental-identity-and-auth/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/fetch-http-handler/CHANGELOG.md",
    "content": "# Change Log\n\n## 5.4.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 5.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 5.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 5.4.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 5.3.17\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/protocol-http@5.3.14\n  - @smithy/querystring-builder@4.2.14\n\n## 5.3.16\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/protocol-http@5.3.13\n  - @smithy/querystring-builder@4.2.13\n\n## 5.3.15\n\n### Patch Changes\n\n- dab22f1: fix: do not return caller's Error directly from buildAbortError\n\n  Always create a new mutable Error when the abort reason is an Error, preserving the original via `.cause`. Fixes TypeError when retry middleware tries to set `$metadata` on a frozen/sealed abort reason.\n\n## 5.3.14\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/protocol-http@5.3.12\n  - @smithy/querystring-builder@4.2.12\n\n## 5.3.13\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/querystring-builder@4.2.11\n  - @smithy/protocol-http@5.3.11\n  - @smithy/util-base64@4.3.2\n\n## 5.3.12\n\n### Patch Changes\n\n- 9bf9ae2: fix: reject aborted requests with AbortSignal.reason instead of a generic Error\n\n## 5.3.11\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/protocol-http@5.3.10\n  - @smithy/querystring-builder@4.2.10\n\n## 5.3.10\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/protocol-http@5.3.9\n  - @smithy/querystring-builder@4.2.9\n  - @smithy/types@4.12.1\n  - @smithy/util-base64@4.3.1\n\n## 5.3.9\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/protocol-http@5.3.8\n  - @smithy/querystring-builder@4.2.8\n\n## 5.3.8\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/protocol-http@5.3.7\n  - @smithy/querystring-builder@4.2.7\n\n## 5.3.7\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/protocol-http@5.3.6\n  - @smithy/querystring-builder@4.2.6\n\n## 5.3.6\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/protocol-http@5.3.5\n  - @smithy/querystring-builder@4.2.5\n\n## 5.3.5\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/protocol-http@5.3.4\n  - @smithy/querystring-builder@4.2.4\n\n## 5.3.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/protocol-http@5.3.3\n  - @smithy/querystring-builder@4.2.3\n\n## 5.3.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/protocol-http@5.3.2\n  - @smithy/querystring-builder@4.2.2\n\n## 5.3.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/protocol-http@5.3.1\n  - @smithy/querystring-builder@4.2.1\n\n## 5.3.1\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/util-base64@4.3.0\n\n## 5.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/protocol-http@5.3.0\n  - @smithy/querystring-builder@4.2.0\n  - @smithy/types@4.6.0\n  - @smithy/util-base64@4.2.0\n\n## 5.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/protocol-http@5.2.1\n  - @smithy/querystring-builder@4.1.1\n\n## 5.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/querystring-builder@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/util-base64@4.1.0\n  - @smithy/types@4.4.0\n\n## 5.1.1\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/protocol-http@5.1.3\n  - @smithy/querystring-builder@4.0.5\n\n## 5.1.0\n\n### Minor Changes\n\n- c4e923a: per-request timeouts support\n\n## 5.0.4\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/protocol-http@5.1.2\n  - @smithy/querystring-builder@4.0.4\n\n## 5.0.3\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/protocol-http@5.1.1\n  - @smithy/querystring-builder@4.0.3\n\n## 5.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n  - @smithy/querystring-builder@4.0.2\n\n## 5.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/protocol-http@5.0.1\n  - @smithy/querystring-builder@4.0.1\n\n## 5.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-base64@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/querystring-builder@4.0.0\n  - @smithy/types@4.0.0\n\n## 4.1.3\n\n### Patch Changes\n\n- 1dd6ace: Add polyfill to collect Blob in react-native environments\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/protocol-http@4.1.8\n  - @smithy/querystring-builder@3.0.11\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/protocol-http@4.1.7\n  - @smithy/querystring-builder@3.0.10\n\n## 4.1.0\n\n### Minor Changes\n\n- cd1929b: vitest compatibility\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/protocol-http@4.1.6\n  - @smithy/querystring-builder@3.0.9\n\n## 4.0.0\n\n### Major Changes\n\n- c257049: replace FileReader with Blob.arrayBuffer() where possible\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/protocol-http@4.1.5\n  - @smithy/querystring-builder@3.0.8\n\n## 3.2.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/protocol-http@4.1.4\n  - @smithy/querystring-builder@3.0.7\n\n## 3.2.8\n\n### Patch Changes\n\n- 0d5ab1d: Omit setting cache setting on request init when using default value\n\n## 3.2.7\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/protocol-http@4.1.3\n  - @smithy/querystring-builder@3.0.6\n\n## 3.2.6\n\n### Patch Changes\n\n- cf9257e: add requestInit options to fetch\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/protocol-http@4.1.2\n  - @smithy/querystring-builder@3.0.5\n\n## 3.2.5\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/protocol-http@4.1.1\n  - @smithy/querystring-builder@3.0.4\n\n## 3.2.4\n\n### Patch Changes\n\n- 3ea4789: Initialize removeSignalEventListener as an empty function\n\n## 3.2.3\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n\n## 3.2.1\n\n### Patch Changes\n\n- f31cc5f: remove abort signal event listeners after request completion\n\n## 3.2.0\n\n### Minor Changes\n\n- 4784fb9: Adding support for setting the fetch API credentials mode\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/protocol-http@4.0.3\n  - @smithy/querystring-builder@3.0.3\n\n## 3.1.0\n\n### Minor Changes\n\n- c2a5595: use platform AbortController|AbortSignal implementations\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/protocol-http@4.0.2\n  - @smithy/querystring-builder@3.0.2\n\n## 3.0.3\n\n### Patch Changes\n\n- fedce37: move keepAliveSupport check to FetchHttpHandler constructor\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/protocol-http@4.0.1\n  - @smithy/querystring-builder@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- cc9fa00e: set duplex on fetch options\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- e76e736b: improve stream collection speed\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/querystring-builder@3.0.0\n  - @smithy/protocol-http@4.0.0\n  - @smithy/util-base64@3.0.0\n\n## 2.5.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/querystring-builder@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/util-base64@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.4.5\n\n### Patch Changes\n\n- Updated dependencies [8e8f3513]\n  - @smithy/util-base64@2.2.1\n\n## 2.4.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-base64@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/protocol-http@3.2.2\n  - @smithy/querystring-builder@2.1.4\n\n## 2.4.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/protocol-http@3.2.1\n  - @smithy/querystring-builder@2.1.3\n\n## 2.4.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/querystring-builder@2.1.2\n\n## 2.4.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/protocol-http@3.1.1\n  - @smithy/querystring-builder@2.1.1\n  - @smithy/types@2.9.1\n  - @smithy/util-base64@2.1.1\n\n## 2.4.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/querystring-builder@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/util-base64@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.3.2\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/protocol-http@3.0.12\n  - @smithy/querystring-builder@2.0.16\n\n## 2.3.1\n\n### Patch Changes\n\n- e2e3f7d5: align ctor and static creation signatures for http handlers\n\n## 2.3.0\n\n### Minor Changes\n\n- 340634a5: move default fetch and http handler ctor types to the types package\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/protocol-http@3.0.11\n  - @smithy/querystring-builder@2.0.15\n\n## 2.2.7\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/protocol-http@3.0.10\n  - @smithy/querystring-builder@2.0.14\n\n## 2.2.6\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/protocol-http@3.0.9\n  - @smithy/querystring-builder@2.0.13\n\n## 2.2.5\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-base64@2.0.1\n\n## 2.2.4\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/protocol-http@3.0.8\n  - @smithy/querystring-builder@2.0.12\n\n## 2.2.3\n\n### Patch Changes\n\n- 34b7f7b6: set keepalive default to false in fetch handler\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/protocol-http@3.0.7\n  - @smithy/querystring-builder@2.0.11\n\n## 2.2.1\n\n### Patch Changes\n\n- b411ffd1: use valid dummy URL\n\n## 2.2.0\n\n### Minor Changes\n\n- 4528c37d: add fetch http handler keepAlive option\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/protocol-http@3.0.6\n  - @smithy/querystring-builder@2.0.10\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/protocol-http@3.0.5\n  - @smithy/querystring-builder@2.0.9\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/protocol-http@3.0.4\n  - @smithy/querystring-builder@2.0.8\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/protocol-http@3.0.3\n  - @smithy/querystring-builder@2.0.7\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n\n## 2.1.0\n\n### Minor Changes\n\n- a03026e3: Add http client component to runtime extension\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n  - @smithy/querystring-builder@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/protocol-http@2.0.5\n  - @smithy/querystring-builder@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/protocol-http@2.0.4\n  - @smithy/querystring-builder@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/protocol-http@2.0.3\n  - @smithy/querystring-builder@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/protocol-http@2.0.2\n  - @smithy/querystring-builder@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/protocol-http@2.0.1\n  - @smithy/querystring-builder@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/protocol-http@2.0.0\n  - @smithy/querystring-builder@2.0.0\n  - @smithy/util-base64@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/protocol-http@1.2.0\n  - @smithy/querystring-builder@1.1.0\n  - @smithy/types@1.2.0\n  - @smithy/util-base64@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- 99d00e98: Bump webpack to 5.76.0\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/protocol-http@1.1.2\n  - @smithy/querystring-builder@1.0.3\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/querystring-builder@1.0.2\n  - @smithy/protocol-http@1.1.1\n  - @smithy/util-base64@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/querystring-builder@1.0.1\n  - @smithy/util-base64@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/fetch-http-handler](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/fetch-http-handler/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/fetch-http-handler/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/fetch-http-handler/README.md",
    "content": "# @smithy/fetch-http-handler\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/fetch-http-handler/latest.svg)](https://www.npmjs.com/package/@smithy/fetch-http-handler)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/fetch-http-handler.svg)](https://www.npmjs.com/package/@smithy/fetch-http-handler)\n\nThis is the default `requestHandler` used for browser applications.\nSince Node.js introduced experimental Web Streams API in v16.5.0 and made it stable in v21.0.0,\nyou can consider using `fetch-http-handler` in Node.js, although it's not recommended.\n\nFor the Node.js default `requestHandler` implementation, see instead\n[`@smithy/node-http-handler`](https://www.npmjs.com/package/@smithy/node-http-handler).\n"
  },
  {
    "path": "packages/fetch-http-handler/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/package.json",
    "content": "{\n  \"name\": \"@smithy/fetch-http-handler\",\n  \"version\": \"5.4.3\",\n  \"description\": \"Provides a way to make requests\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline fetch-http-handler\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run && yarn test:browser\",\n    \"test:browser\": \"yarn g:vitest run -c vitest.config.browser.mts\",\n    \"test:browser:watch\": \"yarn g:vitest watch -c vitest.config.browser.mts\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@smithy/abort-controller\": \"workspace:^\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/fetch-http-handler\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/fetch-http-handler\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/src/create-request.ts",
    "content": "import type { AdditionalRequestParameters } from \"./fetch-http-handler\";\n\n/**\n * For mocking/interception.\n *\n * @internal\n */\nexport function createRequest(url: string, requestOptions?: RequestInit & AdditionalRequestParameters) {\n  return new Request(url, requestOptions);\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/src/fetch-http-handler.browser.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/protocol-http\";\nimport type { QueryParameterBag } from \"@smithy/types\";\nimport { afterEach, beforeAll, describe, expect, test as it, vi } from \"vitest\";\n\nimport { createRequest } from \"./create-request\";\nimport { FetchHttpHandler, keepAliveSupport } from \"./fetch-http-handler\";\n\nvi.mock(\"./create-request\", async () => {\n  return {\n    createRequest: vi.fn().mockImplementation((_url, options) => {\n      const url = new URL(_url);\n      return {\n        protocol: url.protocol,\n        hostname: url.hostname,\n        ...options,\n      } as any;\n    }),\n  };\n});\n\nvi.spyOn(global, \"fetch\").mockImplementation((async () => {\n  return {\n    headers: {\n      entries() {\n        return [];\n      },\n    },\n    async blob() {\n      return undefined;\n    },\n  };\n}) as any);\n\n(typeof Blob === \"function\" ? describe : describe.skip)(FetchHttpHandler.name, () => {\n  interface MockHttpRequestOptions {\n    method?: string;\n    body?: any;\n    query?: QueryParameterBag;\n    fragment?: string;\n    username?: string;\n    password?: string;\n  }\n\n  const getMockHttpRequest = (options: MockHttpRequestOptions): HttpRequest =>\n    new HttpRequest({ hostname: \"localhost\", protocol: \"http\", ...options });\n\n  describe(\"fetch\", () => {\n    beforeAll(() => {\n      keepAliveSupport.supported = true;\n    });\n\n    afterEach(() => {\n      vi.clearAllMocks();\n    });\n\n    it(\"sends basic fetch request\", async () => {\n      const fetchHttpHandler = new FetchHttpHandler();\n\n      const mockHttpRequest = getMockHttpRequest({});\n      await fetchHttpHandler.handle(mockHttpRequest);\n\n      const expectedUrl = `${mockHttpRequest.protocol}//${mockHttpRequest.hostname}/`;\n      const requestArgs = vi.mocked(createRequest).mock.calls[0];\n\n      expect(requestArgs[0]).toEqual(expectedUrl);\n      expect(requestArgs[1]!.method).toEqual(mockHttpRequest.method);\n      expect(requestArgs[1]!.keepalive).toEqual(false);\n    });\n\n    for (const method of [\"GET\", \"HEAD\"]) {\n      it(`sets body to undefined when method: '${method}'`, async () => {\n        const fetchHttpHandler = new FetchHttpHandler();\n\n        const mockHttpRequest = getMockHttpRequest({ method, body: \"test\" });\n        await fetchHttpHandler.handle(mockHttpRequest);\n\n        const requestArgs = vi.mocked(createRequest).mock.calls[0];\n        expect(requestArgs[1]!.method).toEqual(mockHttpRequest.method);\n        expect(requestArgs[1]!.body).toEqual(undefined);\n      });\n    }\n\n    it(`sets keepalive to true if explicitly requested`, async () => {\n      const fetchHttpHandler = new FetchHttpHandler({ keepAlive: true });\n\n      const mockHttpRequest = getMockHttpRequest({});\n      await fetchHttpHandler.handle(mockHttpRequest);\n\n      const requestArgs = vi.mocked(createRequest).mock.calls[0];\n      expect(requestArgs[1]!.keepalive).toEqual(true);\n    });\n\n    it(`builds querystring if provided`, async () => {\n      const fetchHttpHandler = new FetchHttpHandler();\n\n      const query = { foo: \"bar\" };\n      const fragment = \"test\";\n      const mockHttpRequest = getMockHttpRequest({ query, fragment });\n      await fetchHttpHandler.handle(mockHttpRequest);\n\n      const expectedUrl = `${mockHttpRequest.protocol}//${mockHttpRequest.hostname}/?${Object.entries(query)\n        .map(([key, val]) => `${key}=${val}`)\n        .join(\"&\")}#${fragment}`;\n      const requestArgs = vi.mocked(createRequest).mock.calls[0];\n      expect(requestArgs[0]).toEqual(expectedUrl);\n    });\n\n    it(`sets auth if username/password are provided`, async () => {\n      const fetchHttpHandler = new FetchHttpHandler();\n\n      const username = \"foo\";\n      const password = \"bar\";\n      const mockHttpRequest = getMockHttpRequest({ username, password });\n      await fetchHttpHandler.handle(mockHttpRequest).catch((error) => {\n        expect(String(error)).toContain(\n          \"TypeError: Request cannot be constructed from a URL that includes credentials\"\n        );\n      });\n\n      const mockAuth = `${mockHttpRequest.username}:${mockHttpRequest.password}`;\n      const expectedUrl = `${mockHttpRequest.protocol}//${mockAuth}@${mockHttpRequest.hostname}/`;\n      const requestArgs = vi.mocked(createRequest).mock.calls[0];\n      expect(requestArgs[0]).toEqual(expectedUrl);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/src/fetch-http-handler.spec.ts",
    "content": "import { AbortController } from \"@smithy/abort-controller\";\nimport { HttpRequest } from \"@smithy/protocol-http\";\nimport { afterAll, afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { FetchHttpHandler, keepAliveSupport } from \"./fetch-http-handler\";\nimport { requestTimeout } from \"./request-timeout\";\n\nconst mockRequest = vi.fn();\nlet timeoutSpy: any;\n\n(global as any).Request = mockRequest;\n(global as any).Headers = vi.fn();\nconst globalFetch = global.fetch;\n\n(typeof Blob === \"function\" ? describe : describe.skip)(FetchHttpHandler.name, () => {\n  beforeEach(() => {\n    (global as any).AbortController = void 0;\n    vi.clearAllMocks();\n  });\n\n  afterEach(() => {\n    vi.clearAllTimers();\n    if (timeoutSpy) {\n      timeoutSpy.mockRestore();\n    }\n  });\n\n  afterAll(() => {\n    global.fetch = globalFetch;\n  });\n\n  it(\"makes requests using fetch\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob([\"FOO\"])),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    const response = await fetchHttpHandler.handle({} as any, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n    expect(await blobToText(response.response.body)).toBe(\"FOO\");\n  });\n\n  it(\"put HttpClientConfig\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob([\"FOO\"])),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler();\n    fetchHttpHandler.updateHttpClientConfig(\"requestTimeout\", 200);\n\n    await fetchHttpHandler.handle({} as any, {});\n\n    expect(fetchHttpHandler.httpHandlerConfigs().requestTimeout).toBe(200);\n  });\n\n  it(\"update HttpClientConfig\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob([\"FOO\"])),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler({ requestTimeout: 200 });\n    fetchHttpHandler.updateHttpClientConfig(\"requestTimeout\", 300);\n\n    await fetchHttpHandler.handle({} as any, {});\n\n    expect(fetchHttpHandler.httpHandlerConfigs().requestTimeout).toBe(300);\n  });\n\n  it(\"httpHandlerConfigs returns empty object if handle is not called\", async () => {\n    const fetchHttpHandler = new FetchHttpHandler();\n    fetchHttpHandler.updateHttpClientConfig(\"requestTimeout\", 300);\n    expect(fetchHttpHandler.httpHandlerConfigs()).toEqual({});\n  });\n\n  it(\"defaults to response.blob for response.body = null\", async () => {\n    const mockResponse = {\n      body: null,\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob([\"FOO\"])),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    const response = await fetchHttpHandler.handle({} as any, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n    expect(await blobToText(response.response.body)).toBe(\"FOO\");\n  });\n\n  it(\"properly constructs url\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob()),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n\n    const httpRequest = new HttpRequest({\n      headers: {},\n      hostname: \"foo.amazonaws.com\",\n      method: \"GET\",\n      path: \"/test\",\n      query: { bar: \"baz\" },\n      username: \"username\",\n      password: \"password\",\n      fragment: \"fragment\",\n      protocol: \"https:\",\n      port: 443,\n    });\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    await fetchHttpHandler.handle(httpRequest, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n    const requestCall = mockRequest.mock.calls[0];\n    expect(requestCall[0]).toBe(\"https://username:password@foo.amazonaws.com:443/test?bar=baz#fragment\");\n  });\n\n  it(\"will omit body if method is GET\", async () => {\n    const mockResponse = {\n      headers: { entries: vi.fn().mockReturnValue([]) },\n      blob: vi.fn().mockResolvedValue(new Blob()),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n\n    const httpRequest = new HttpRequest({\n      headers: {},\n      hostname: \"foo.amazonaws.com\",\n      method: \"GET\",\n      path: \"/\",\n      body: \"will be omitted\",\n    });\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    await fetchHttpHandler.handle(httpRequest, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n    const requestCall = mockRequest.mock.calls[0];\n    expect(requestCall[1].body).toBeUndefined();\n  });\n\n  it(\"will omit body if method is HEAD\", async () => {\n    const mockResponse = {\n      headers: { entries: vi.fn().mockReturnValue([]) },\n      blob: vi.fn().mockResolvedValue(new Blob()),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n\n    const httpRequest = new HttpRequest({\n      headers: {},\n      hostname: \"foo.amazonaws.com\",\n      method: \"HEAD\",\n      path: \"/\",\n      body: \"will be omitted\",\n    });\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    await fetchHttpHandler.handle(httpRequest, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n    const requestCall = mockRequest.mock.calls[0];\n    expect(requestCall[1].body).toBeUndefined();\n  });\n\n  it(\"will not make request if already aborted\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob()),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    await expect(\n      fetchHttpHandler.handle({} as any, {\n        abortSignal: {\n          aborted: true,\n          onabort: null,\n        },\n      })\n    ).rejects.toHaveProperty(\"name\", \"AbortError\");\n\n    expect(mockFetch.mock.calls.length).toBe(0);\n  });\n\n  it(\"rejects with a mutable error when abort reason is a frozen Error\", async () => {\n    const mockFetch = vi.fn();\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler();\n    const frozenReason = Object.freeze(new Error(\"frozen\"));\n\n    try {\n      await fetchHttpHandler.handle({} as any, {\n        abortSignal: {\n          aborted: true,\n          reason: frozenReason,\n          onabort: null,\n        },\n      });\n      expect.unreachable(\"should have thrown\");\n    } catch (e: any) {\n      expect(e.name).toBe(\"AbortError\");\n      expect(e.cause).toBe(frozenReason);\n      expect(() => {\n        e.$metadata = {};\n      }).not.toThrow();\n    }\n  });\n\n  it(\"will pass abortSignal to fetch if supported\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob()),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n    (global as any).fetch = mockFetch;\n    (global as any).AbortController = vi.fn();\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    await fetchHttpHandler.handle({} as any, {\n      abortSignal: {\n        aborted: false,\n        onabort: null,\n      },\n    });\n\n    expect(mockRequest.mock.calls[0][1]).toHaveProperty(\"signal\");\n    expect(mockFetch.mock.calls.length).toBe(1);\n  });\n\n  it(\"will pass timeout to request timeout\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([\n          [\"foo\", \"bar\"],\n          [\"bizz\", \"bazz\"],\n        ]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob()),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n    (global as any).fetch = mockFetch;\n\n    timeoutSpy = vi.spyOn({ requestTimeout }, \"requestTimeout\");\n    const fetchHttpHandler = new FetchHttpHandler({\n      requestTimeout: 500,\n    });\n\n    await fetchHttpHandler.handle({} as any, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n  });\n\n  it(\"will pass timeout from a provider to request timeout\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: () => [],\n      },\n      blob: async () => new Blob(),\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n    (global as any).fetch = mockFetch;\n\n    timeoutSpy = vi.spyOn({ requestTimeout }, \"requestTimeout\");\n    const fetchHttpHandler = new FetchHttpHandler(async () => ({\n      requestTimeout: 500,\n    }));\n\n    await fetchHttpHandler.handle({} as any, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n  });\n\n  describe(\"per-request requestTimeout\", () => {\n    it(\"should use per-request timeout over handler config timeout\", async () => {\n      const mockFetch = vi.fn(() => new Promise(() => {})); // never resolve\n      (global as any).fetch = mockFetch;\n\n      const fetchHttpHandler = new FetchHttpHandler({ requestTimeout: 5000 });\n\n      const start = Date.now();\n      await expect(fetchHttpHandler.handle({} as any, { requestTimeout: 50 })).rejects.toHaveProperty(\n        \"name\",\n        \"TimeoutError\"\n      );\n\n      const elapsed = Date.now() - start;\n      expect(elapsed).toBeLessThan(100); // should timeout quickly\n    });\n\n    it(\"should fall back to handler config timeout when per-request timeout not provided\", async () => {\n      const mockFetch = vi.fn(() => new Promise(() => {}));\n      (global as any).fetch = mockFetch;\n\n      const fetchHttpHandler = new FetchHttpHandler({ requestTimeout: 50 });\n\n      const start = Date.now();\n      await expect(fetchHttpHandler.handle({} as any, {})).rejects.toHaveProperty(\"name\", \"TimeoutError\");\n\n      const elapsed = Date.now() - start;\n      expect(elapsed).toBeLessThan(100);\n    });\n  });\n\n  it(\"will throw timeout error it timeout finishes before request\", async () => {\n    const mockFetch = vi.fn(() => {\n      return new Promise(() => {});\n    });\n    (global as any).fetch = mockFetch;\n    const fetchHttpHandler = new FetchHttpHandler({\n      requestTimeout: 5,\n    });\n\n    await expect(fetchHttpHandler.handle({} as any, {})).rejects.toHaveProperty(\"name\", \"TimeoutError\");\n    expect(mockFetch.mock.calls.length).toBe(1);\n  });\n\n  it(\"can be aborted before fetch completes\", async () => {\n    const abortController = new AbortController();\n\n    const mockFetch = vi.fn(() => {\n      return new Promise(() => {});\n    });\n    (global as any).fetch = mockFetch;\n\n    setTimeout(() => {\n      abortController.abort();\n    }, 100);\n    const fetchHttpHandler = new FetchHttpHandler();\n\n    await expect(\n      fetchHttpHandler.handle({} as any, {\n        abortSignal: abortController.signal,\n      })\n    ).rejects.toHaveProperty(\"name\", \"AbortError\");\n\n    // ensure that fetch's built-in mechanism isn't being used\n    expect(mockRequest.mock.calls[0][1]).not.toHaveProperty(\"signal\");\n  });\n\n  it(\"creates correct HTTPResponse object\", async () => {\n    const mockResponse = {\n      headers: {\n        entries: vi.fn().mockReturnValue([[\"foo\", \"bar\"]]),\n      },\n      blob: vi.fn().mockResolvedValue(new Blob([\"FOO\"])),\n      status: 200,\n      statusText: \"foo\",\n    };\n    const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n    (global as any).fetch = mockFetch;\n\n    const fetchHttpHandler = new FetchHttpHandler();\n    const { response } = await fetchHttpHandler.handle({} as any, {});\n\n    expect(mockFetch.mock.calls.length).toBe(1);\n    expect(response.headers).toStrictEqual({ foo: \"bar\" });\n    expect(response.reason).toBe(\"foo\");\n    expect(response.statusCode).toBe(200);\n    expect(await blobToText(response.body)).toBe(\"FOO\");\n  });\n\n  it.each([\"include\", \"omit\", \"same-origin\"])(\n    \"will pass credentials mode '%s' from a provider to a request\",\n    async (credentialsMode) => {\n      const mockResponse = {\n        headers: { entries: vi.fn().mockReturnValue([]) },\n        blob: vi.fn().mockResolvedValue(new Blob()),\n      };\n      const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n\n      (global as any).fetch = mockFetch;\n\n      const httpRequest = new HttpRequest({\n        headers: {},\n        hostname: \"foo.amazonaws.com\",\n        method: \"GET\",\n        path: \"/\",\n        body: \"will be omitted\",\n      });\n      const fetchHttpHandler = new FetchHttpHandler();\n      fetchHttpHandler.updateHttpClientConfig(\"credentials\", credentialsMode as RequestCredentials);\n\n      await fetchHttpHandler.handle(httpRequest, {});\n\n      expect(mockFetch.mock.calls.length).toBe(1);\n      const requestCall = mockRequest.mock.calls[0];\n      expect(requestCall[1].credentials).toBe(credentialsMode);\n    }\n  );\n\n  describe(\"#destroy\", () => {\n    it(\"should be callable and return nothing\", () => {\n      const httpHandler = new FetchHttpHandler();\n      expect(httpHandler.destroy()).toBeUndefined();\n    });\n  });\n\n  describe(\"keepalive\", () => {\n    it(\"will pass keepalive as false by default to request if supported\", async () => {\n      const mockResponse = {\n        headers: {\n          entries: vi.fn().mockReturnValue([\n            [\"foo\", \"bar\"],\n            [\"bizz\", \"bazz\"],\n          ]),\n        },\n        blob: vi.fn().mockResolvedValue(new Blob()),\n      };\n      const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n      (global as any).fetch = mockFetch;\n\n      const fetchHttpHandler = new FetchHttpHandler();\n\n      keepAliveSupport.supported = true;\n      await fetchHttpHandler.handle({} as any, {});\n\n      expect(mockRequest.mock.calls[0][1].keepalive).toBe(false);\n    });\n\n    it(\"will pass keepalive to request if supported\", async () => {\n      const mockResponse = {\n        headers: {\n          entries: vi.fn().mockReturnValue([\n            [\"foo\", \"bar\"],\n            [\"bizz\", \"bazz\"],\n          ]),\n        },\n        blob: vi.fn().mockResolvedValue(new Blob()),\n      };\n      const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n      (global as any).fetch = mockFetch;\n\n      const fetchHttpHandler = new FetchHttpHandler({ keepAlive: true });\n\n      keepAliveSupport.supported = true;\n      await fetchHttpHandler.handle({} as any, {});\n\n      expect(mockRequest.mock.calls[0][1].keepalive).toBe(true);\n    });\n\n    it(\"will not have keepalive property in request if not supported\", async () => {\n      const mockResponse = {\n        headers: {\n          entries: vi.fn().mockReturnValue([\n            [\"foo\", \"bar\"],\n            [\"bizz\", \"bazz\"],\n          ]),\n        },\n        blob: vi.fn().mockResolvedValue(new Blob()),\n      };\n      const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n      (global as any).fetch = mockFetch;\n      mockRequest.mockImplementation(() => null);\n\n      const fetchHttpHandler = new FetchHttpHandler({ keepAlive: false });\n\n      keepAliveSupport.supported = false;\n      await fetchHttpHandler.handle({} as any, {});\n      expect(mockRequest.mock.calls[0][1]).not.toHaveProperty(\"keepalive\");\n    });\n  });\n\n  describe(\"custom requestInit\", () => {\n    it(\"should allow setting cache requestInit\", async () => {\n      const mockResponse = {\n        headers: {\n          entries() {\n            return [];\n          },\n        },\n        blob: vi.fn().mockResolvedValue(new Blob()),\n      };\n      const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n      (global as any).fetch = mockFetch;\n\n      const fetchHttpHandler = new FetchHttpHandler({\n        cache: \"no-store\",\n      });\n\n      await fetchHttpHandler.handle({} as any, {});\n\n      expect(mockRequest.mock.calls[0][1].cache).toBe(\"no-store\");\n    });\n\n    it(\"should allow setting custom requestInit\", async () => {\n      const mockResponse = {\n        headers: {\n          entries() {\n            return [];\n          },\n        },\n        blob: vi.fn().mockResolvedValue(new Blob()),\n      };\n      const mockFetch = vi.fn().mockResolvedValue(mockResponse);\n      (global as any).fetch = mockFetch;\n\n      const fetchHttpHandler = new FetchHttpHandler({\n        requestInit(req) {\n          return {\n            referrer: \"me\",\n            cache: \"reload\",\n            headers: {\n              a: \"a\",\n              b: req.headers.b,\n            },\n          };\n        },\n      });\n\n      await fetchHttpHandler.handle(\n        {\n          headers: {\n            b: \"b\",\n          },\n        } as any,\n        {}\n      );\n\n      expect(mockRequest.mock.calls[0][1]).toEqual({\n        referrer: \"me\",\n        cache: \"reload\",\n        headers: {\n          a: \"a\",\n          b: \"b\",\n        },\n      });\n    });\n  });\n\n  // The Blob implementation does not implement Blob.text, so we deal with it here.\n  async function blobToText(blob: Blob): Promise<string> {\n    return blob.text();\n  }\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/src/fetch-http-handler.ts",
    "content": "import { HttpResponse, buildQueryString, type HttpHandler, type HttpRequest } from \"@smithy/core/protocols\";\nimport type { FetchHttpHandlerOptions, HeaderBag, HttpHandlerOptions, Provider } from \"@smithy/types\";\n\nimport { createRequest } from \"./create-request\";\nimport { requestTimeout as requestTimeoutFn } from \"./request-timeout\";\n\ndeclare let AbortController: any;\n\n/**\n * @public\n */\nexport { FetchHttpHandlerOptions };\n\n/**\n * Detection of keepalive support. Can be overridden for testing.\n *\n * @internal\n */\nexport const keepAliveSupport = {\n  supported: undefined as undefined | boolean,\n};\n\n/**\n * @internal\n */\nexport type AdditionalRequestParameters = {\n  // This is required in Node.js when Request has a body, and does nothing in the browser.\n  // Duplex: half means the request is fully transmitted before attempting to process the response.\n  // As of writing this is the only accepted value in https://fetch.spec.whatwg.org/.\n  duplex?: \"half\";\n};\n\n/**\n * HttpHandler implementation using browsers' `fetch` global function.\n *\n * @public\n */\nexport class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOptions> {\n  private config?: FetchHttpHandlerOptions;\n  private configProvider: Promise<FetchHttpHandlerOptions>;\n\n  /**\n   * @returns the input if it is an HttpHandler of any class,\n   * or instantiates a new instance of this handler.\n   */\n  public static create(\n    instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>\n  ) {\n    if (typeof (instanceOrOptions as any)?.handle === \"function\") {\n      // is already an instance of HttpHandler.\n      return instanceOrOptions as HttpHandler<any>;\n    }\n    // input is ctor options or undefined.\n    return new FetchHttpHandler(instanceOrOptions as FetchHttpHandlerOptions);\n  }\n\n  constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>) {\n    if (typeof options === \"function\") {\n      this.configProvider = options().then((opts) => opts || {});\n    } else {\n      this.config = options ?? {};\n      this.configProvider = Promise.resolve(this.config);\n    }\n    if (keepAliveSupport.supported === undefined) {\n      keepAliveSupport.supported = Boolean(\n        typeof Request !== \"undefined\" && \"keepalive\" in createRequest(\"https://[::1]\")\n      );\n    }\n  }\n\n  destroy(): void {\n    // Do nothing. TLS and HTTP/2 connection pooling is handled by the browser.\n  }\n\n  async handle(\n    request: HttpRequest,\n    { abortSignal, requestTimeout }: HttpHandlerOptions = {}\n  ): Promise<{ response: HttpResponse }> {\n    if (!this.config) {\n      this.config = await this.configProvider;\n    }\n    const requestTimeoutInMs = requestTimeout ?? this.config!.requestTimeout;\n    const keepAlive = this.config!.keepAlive === true;\n    const credentials = this.config!.credentials as RequestInit[\"credentials\"];\n\n    // if the request was already aborted, prevent doing extra work\n    if (abortSignal?.aborted) {\n      const abortError = buildAbortError(abortSignal);\n      return Promise.reject(abortError);\n    }\n\n    let path = request.path;\n    const queryString = buildQueryString(request.query || {});\n    if (queryString) {\n      path += `?${queryString}`;\n    }\n    if (request.fragment) {\n      path += `#${request.fragment}`;\n    }\n\n    let auth = \"\";\n    if (request.username != null || request.password != null) {\n      const username = request.username ?? \"\";\n      const password = request.password ?? \"\";\n      auth = `${username}:${password}@`;\n    }\n\n    const { port, method } = request;\n    const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : \"\"}${path}`;\n    // Request constructor doesn't allow GET/HEAD request with body\n    // ref: https://github.com/whatwg/fetch/issues/551\n    const body = method === \"GET\" || method === \"HEAD\" ? undefined : request.body;\n    const requestOptions: RequestInit & AdditionalRequestParameters = {\n      body,\n      headers: new Headers(request.headers),\n      method: method,\n      credentials,\n    };\n    // cache property is not supported in workerd runtime\n    // TODO: can we feature detect support for cache and not set this property when not supported?\n    if (this.config?.cache) {\n      requestOptions.cache = this.config.cache;\n    }\n\n    if (body) {\n      requestOptions.duplex = \"half\";\n    }\n\n    // some browsers support abort signal\n    if (typeof AbortController !== \"undefined\") {\n      requestOptions.signal = abortSignal as AbortSignal;\n    }\n\n    // some browsers support keepalive\n    if (keepAliveSupport.supported) {\n      requestOptions.keepalive = keepAlive;\n    }\n\n    if (typeof this.config.requestInit === \"function\") {\n      Object.assign(requestOptions, this.config.requestInit(request));\n    }\n\n    let removeSignalEventListener = () => {};\n\n    const fetchRequest = createRequest(url, requestOptions);\n    const raceOfPromises = [\n      fetch(fetchRequest).then((response) => {\n        const fetchHeaders: any = response.headers;\n        const transformedHeaders: HeaderBag = {};\n\n        for (const pair of <Array<string[]>>fetchHeaders.entries()) {\n          transformedHeaders[pair[0]] = pair[1];\n        }\n\n        // Check for undefined as well as null.\n        const hasReadableStream = response.body != undefined;\n\n        // Return the response with buffered body\n        if (!hasReadableStream) {\n          return response.blob().then((body) => ({\n            response: new HttpResponse({\n              headers: transformedHeaders,\n              reason: response.statusText,\n              statusCode: response.status,\n              body,\n            }),\n          }));\n        }\n        // Return the response with streaming body\n        return {\n          response: new HttpResponse({\n            headers: transformedHeaders,\n            reason: response.statusText,\n            statusCode: response.status,\n            body: response.body,\n          }),\n        };\n      }),\n      requestTimeoutFn(requestTimeoutInMs),\n    ];\n    if (abortSignal) {\n      raceOfPromises.push(\n        new Promise<never>((resolve, reject) => {\n          const onAbort = () => {\n            const abortError = buildAbortError(abortSignal);\n            reject(abortError);\n          };\n          if (typeof (abortSignal as AbortSignal).addEventListener === \"function\") {\n            // preferred.\n            const signal = abortSignal as AbortSignal;\n            signal.addEventListener(\"abort\", onAbort, { once: true });\n            removeSignalEventListener = () => signal.removeEventListener(\"abort\", onAbort);\n          } else {\n            // backwards compatibility\n            abortSignal.onabort = onAbort;\n          }\n        })\n      );\n    }\n    return Promise.race(raceOfPromises).finally(removeSignalEventListener);\n  }\n\n  updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void {\n    this.config = undefined;\n    this.configProvider = this.configProvider.then((config) => {\n      (config as Record<typeof key, typeof value>)[key] = value;\n      return config;\n    });\n  }\n\n  httpHandlerConfigs(): FetchHttpHandlerOptions {\n    return this.config ?? {};\n  }\n}\n\n/**\n * Builds an abort error, using the AbortSignal's reason if available.\n */\nfunction buildAbortError(abortSignal?: unknown): Error {\n  const reason =\n    abortSignal && typeof abortSignal === \"object\" && \"reason\" in abortSignal\n      ? (abortSignal as { reason?: unknown }).reason\n      : undefined;\n  if (reason) {\n    if (reason instanceof Error) {\n      const abortError = new Error(\"Request aborted\");\n      abortError.name = \"AbortError\";\n      (abortError as { cause?: unknown }).cause = reason;\n      return abortError;\n    }\n    const abortError = new Error(String(reason));\n    abortError.name = \"AbortError\";\n    return abortError;\n  }\n  const abortError = new Error(\"Request aborted\");\n  abortError.name = \"AbortError\";\n  return abortError;\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/src/index.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { FetchHttpHandler } from \"./index\";\n\ndescribe(\"index\", () => {\n  it(\"exports FetchHttpHandler\", () => {\n    expect(typeof FetchHttpHandler).toBe(\"function\");\n  });\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/src/index.ts",
    "content": "export * from \"./fetch-http-handler\";\nexport * from \"./stream-collector\";\n"
  },
  {
    "path": "packages/fetch-http-handler/src/request-timeout.ts",
    "content": "export function requestTimeout(timeoutInMs = 0): Promise<never> {\n  return new Promise((resolve, reject) => {\n    if (timeoutInMs) {\n      setTimeout(() => {\n        const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);\n        timeoutError.name = \"TimeoutError\";\n        reject(timeoutError);\n      }, timeoutInMs);\n    }\n  });\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/src/stream-collector.browser.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { streamCollector } from \"./stream-collector\";\n\ndescribe(\"streamCollector\", () => {\n  it(\"returns a Uint8Array from a blob\", async () => {\n    const expected = Uint8Array.from([102, 111, 111]);\n    const dataPromise = new Response(expected.buffer).blob().then((blob) => streamCollector(blob));\n    await dataPromise.then((data: any) => {\n      expect(data).toEqual(expected);\n    });\n  });\n\n  it(\"returns a Uint8Array from a ReadableStream\", async () => {\n    const expected = Uint8Array.from([102, 111, 111]);\n    const dataPromise = streamCollector(new Response(expected.buffer).body);\n    await dataPromise.then((data: any) => {\n      expect(data).toEqual(expected);\n    });\n  });\n\n  it(\"returns a Uint8Array when stream is empty\", async () => {\n    const expected = new Uint8Array(0);\n    const dataPromise = streamCollector(new Response(expected.buffer).body);\n    await dataPromise.then((data: any) => {\n      expect(data).toEqual(expected);\n    });\n  });\n\n  it(\"returns a Uint8Array when blob is empty\", async () => {\n    const expected = new Uint8Array(0);\n\n    const dataPromise = new Response(expected.buffer).blob().then((blob) => streamCollector(blob));\n    await dataPromise.then((data: any) => {\n      expect(data).toEqual(expected);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/src/stream-collector.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { streamCollector } from \"./stream-collector\";\n\ndescribe(\"streamCollector\", () => {\n  const blobAvailable = typeof Blob === \"function\";\n  const readableStreamAvailable = typeof ReadableStream === \"function\";\n\n  (blobAvailable ? it : it.skip)(\"collects Blob into bytearray\", async () => {\n    const blobby = new Blob([new Uint8Array([1, 2]), new Uint8Array([3, 4])]);\n    const collected = await streamCollector(blobby);\n    expect(collected).toEqual(new Uint8Array([1, 2, 3, 4]));\n  });\n\n  (readableStreamAvailable ? it : it.skip)(\"collects ReadableStream into bytearray\", async () => {\n    const stream = new ReadableStream({\n      start(controller) {\n        controller.enqueue(new Uint8Array([1, 2]));\n        controller.enqueue(new Uint8Array([3, 4]));\n        controller.close();\n      },\n    });\n    const collected = await streamCollector(stream);\n    expect(collected).toEqual(new Uint8Array([1, 2, 3, 4]));\n  });\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/src/stream-collector.ts",
    "content": "import { fromBase64 } from \"@smithy/core/serde\";\nimport type { StreamCollector } from \"@smithy/types\";\n\nexport const streamCollector: StreamCollector = async (stream: Blob | ReadableStream): Promise<Uint8Array> => {\n  if ((typeof Blob === \"function\" && stream instanceof Blob) || stream.constructor?.name === \"Blob\") {\n    if (Blob.prototype.arrayBuffer !== undefined) {\n      return new Uint8Array(await (stream as Blob).arrayBuffer());\n    }\n    return collectBlob(stream as Blob);\n  }\n\n  return collectStream(stream as ReadableStream);\n};\n\nasync function collectBlob(blob: Blob): Promise<Uint8Array> {\n  const base64 = await readToBase64(blob);\n  const arrayBuffer = fromBase64(base64);\n  return new Uint8Array(arrayBuffer);\n}\n\nasync function collectStream(stream: ReadableStream): Promise<Uint8Array> {\n  const chunks = [];\n  const reader = stream.getReader();\n  let isDone = false;\n  let length = 0;\n\n  while (!isDone) {\n    const { done, value } = await reader.read();\n    if (value) {\n      chunks.push(value);\n      length += value.length;\n    }\n    isDone = done;\n  }\n\n  const collected = new Uint8Array(length);\n  let offset = 0;\n  for (const chunk of chunks) {\n    collected.set(chunk, offset);\n    offset += chunk.length;\n  }\n\n  return collected;\n}\n\nfunction readToBase64(blob: Blob): Promise<string> {\n  return new Promise((resolve, reject) => {\n    const reader = new FileReader();\n    reader.onloadend = () => {\n      // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n      // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n      if (reader.readyState !== 2) {\n        return reject(new Error(\"Reader aborted too early\"));\n      }\n      const result = (reader.result ?? \"\") as string;\n      // Response can include only 'data:' for empty blob, return empty string in this case.\n      // Otherwise, return the string after ','\n      const commaIndex = result.indexOf(\",\");\n      const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n      resolve(result.substring(dataOffset));\n    };\n    reader.onabort = () => reject(new Error(\"Read aborted\"));\n    reader.onerror = () => reject(reader.error);\n    // reader.readAsArrayBuffer is not always available\n    reader.readAsDataURL(blob);\n  });\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/fetch-http-handler/vitest.config.browser.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"happy-dom\",\n  },\n});\n"
  },
  {
    "path": "packages/fetch-http-handler/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/hash-blob-browser/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/hash-blob-browser/CHANGELOG.md",
    "content": "# @smithy/hash-blob-browser\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- ee92b6b: move core/serde checksum components to core/checksum\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/hash-blob-browser/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/hash-blob-browser/package.json",
    "content": "{\n  \"name\": \"@smithy/hash-blob-browser\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/hash-blob-browser\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/hash-blob-browser\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/hash-blob-browser/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { blobHasher } from \"@smithy/core/checksum\";\n"
  },
  {
    "path": "packages/hash-blob-browser/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-blob-browser/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-blob-browser/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-node/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/hash-node/CHANGELOG.md",
    "content": "# @smithy/hash-node\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/hash-node/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/hash-node/package.json",
    "content": "{\n  \"name\": \"@smithy/hash-node\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/hash-node\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/hash-node\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/hash-node/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { Hash } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/hash-node/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-node/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": { \"baseUrl\": \".\", \"outDir\": \"dist-es\", \"rootDir\": \"src\" },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-node/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-stream-node/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/hash-stream-node/CHANGELOG.md",
    "content": "# @smithy/hash-stream-node\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- ee92b6b: move core/serde checksum components to core/checksum\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/hash-stream-node/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/hash-stream-node/package.json",
    "content": "{\n  \"name\": \"@smithy/hash-stream-node\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/hash-stream-node\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/hash-stream-node\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/hash-stream-node/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { fileStreamHasher, readableStreamHasher } from \"@smithy/core/checksum\";\n"
  },
  {
    "path": "packages/hash-stream-node/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-stream-node/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": { \"baseUrl\": \".\", \"outDir\": \"dist-es\", \"rootDir\": \"src\" },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/hash-stream-node/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/invalid-dependency/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/invalid-dependency/CHANGELOG.md",
    "content": "# @smithy/invalid-dependency\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/invalid-dependency/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/invalid-dependency/package.json",
    "content": "{\n  \"name\": \"@smithy/invalid-dependency\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/invalid-dependency\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/invalid-dependency\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/invalid-dependency/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/client instead. */\nexport { invalidFunction, invalidProvider } from \"@smithy/core/client\";\n"
  },
  {
    "path": "packages/invalid-dependency/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/invalid-dependency/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/invalid-dependency/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/is-array-buffer/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/is-array-buffer/CHANGELOG.md",
    "content": "# @smithy/is-array-buffer\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/is-array-buffer/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/is-array-buffer/package.json",
    "content": "{\n  \"name\": \"@smithy/is-array-buffer\",\n  \"version\": \"4.3.3\",\n  \"description\": \"Provides a function for detecting if an argument is an ArrayBuffer\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/is-array-buffer\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/is-array-buffer\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/is-array-buffer/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { isArrayBuffer } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/is-array-buffer/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/is-array-buffer/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/is-array-buffer/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/md5-js/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/md5-js/CHANGELOG.md",
    "content": "# @smithy/md5-js\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- ee92b6b: move core/serde checksum components to core/checksum\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/md5-js/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/md5-js/package.json",
    "content": "{\n  \"name\": \"@smithy/md5-js\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/md5-js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/md5-js\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/md5-js/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { Md5 } from \"@smithy/core/checksum\";\n"
  },
  {
    "path": "packages/md5-js/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"include\": [\"src/\"],\n  \"extends\": \"../../tsconfig.cjs.json\"\n}\n"
  },
  {
    "path": "packages/md5-js/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"include\": [\"src/\"],\n  \"extends\": \"../../tsconfig.es.json\"\n}\n"
  },
  {
    "path": "packages/md5-js/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 4.3.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/protocol-http@5.3.14\n\n## 4.3.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/protocol-http@5.3.13\n\n## 4.3.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/protocol-http@5.3.12\n\n## 4.3.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/is-array-buffer@4.2.2\n  - @smithy/protocol-http@5.3.11\n\n## 4.3.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/protocol-http@5.3.10\n\n## 4.3.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/is-array-buffer@4.2.1\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n\n## 4.3.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/protocol-http@5.3.8\n\n## 4.3.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/protocol-http@5.3.7\n\n## 4.3.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/protocol-http@5.3.6\n\n## 4.3.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/protocol-http@5.3.5\n\n## 4.3.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/protocol-http@5.3.4\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/protocol-http@5.3.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/protocol-http@5.3.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/protocol-http@5.3.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/is-array-buffer@4.2.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/protocol-http@5.2.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/is-array-buffer@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/types@4.4.0\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/protocol-http@5.1.3\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/protocol-http@5.1.2\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/protocol-http@5.1.1\n\n## 4.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/protocol-http@5.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/is-array-buffer@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n\n## 3.0.13\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/protocol-http@4.1.8\n\n## 3.0.12\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/protocol-http@4.1.7\n\n## 3.0.11\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/protocol-http@4.1.6\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/protocol-http@4.1.5\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/protocol-http@4.1.4\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/protocol-http@4.1.3\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/protocol-http@4.1.2\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/protocol-http@4.1.1\n\n## 3.0.5\n\n### Patch Changes\n\n- 9624938: Fix request copying with `HttpRequest.clone()`.\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/protocol-http@4.0.3\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/protocol-http@4.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/protocol-http@4.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/is-array-buffer@3.0.0\n  - @smithy/protocol-http@4.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/is-array-buffer@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/protocol-http@3.2.2\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/protocol-http@3.2.1\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/is-array-buffer@2.1.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/types@2.9.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/is-array-buffer@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.18\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/protocol-http@3.0.12\n\n## 2.0.17\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/protocol-http@3.0.11\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/protocol-http@3.0.10\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/protocol-http@3.0.9\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/protocol-http@3.0.8\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/protocol-http@3.0.7\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/protocol-http@3.0.6\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/protocol-http@3.0.5\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/protocol-http@3.0.4\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/protocol-http@3.0.3\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n\n## 2.0.5\n\n### Patch Changes\n\n- 1be3c4c9: Add integration tests\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/protocol-http@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/protocol-http@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/protocol-http@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/protocol-http@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/protocol-http@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/is-array-buffer@2.0.0\n  - @smithy/protocol-http@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/is-array-buffer@1.1.0\n  - @smithy/protocol-http@1.2.0\n  - @smithy/types@1.2.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/protocol-http@1.1.2\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/is-array-buffer@1.0.2\n  - @smithy/protocol-http@1.1.1\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/is-array-buffer@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/middleware-apply-body-checksum](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/middleware-apply-body-checksum/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/middleware-apply-body-checksum/README.md",
    "content": "# @smithy/middleware-apply-body-checksum\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/middleware-apply-body-checksum/latest.svg)](https://www.npmjs.com/package/@smithy/middleware-apply-body-checksum)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/middleware-apply-body-checksum.svg)](https://www.npmjs.com/package/@smithy/middleware-apply-body-checksum)\n\n### :warning: Internal API :warning:\n\n> This is an internal package.\n> That means this is used as a dependency for other, public packages, but\n> should not be taken directly as a dependency in your application's `package.json`.\n\n> If you are updating the version of this package, for example to bring in a\n> bug-fix, you should do so by updating your application lockfile with\n> e.g. `npm up @scope/package` or equivalent command in another\n> package manager, rather than taking a direct dependency.\n\n---\n\nThis package provides AWS SDK for JavaScript middleware that applies a checksum\nof the request body as a header.\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-apply-body-checksum\",\n  \"version\": \"4.4.3\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-apply-body-checksum\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:integration\": \"yarn g:vitest run -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"yarn g:vitest watch -c vitest.config.integ.mts\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-apply-body-checksum\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-apply-body-checksum\"\n  },\n  \"devDependencies\": {\n    \"@smithy/util-test\": \"workspace:^\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/src/applyMd5BodyChecksumMiddleware.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type { ChecksumConstructor } from \"@smithy/types\";\nimport { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { applyMd5BodyChecksumMiddleware } from \"./applyMd5BodyChecksumMiddleware\";\n\ndescribe(\"applyMd5BodyChecksumMiddleware\", () => {\n  const mockEncoder = vi.fn().mockReturnValue(\"encoded\");\n  const mockHashUpdate = vi.fn();\n  const mockHashDigest = vi.fn().mockReturnValue(new Uint8Array(0));\n  const mockHashReset = vi.fn();\n  const MockHash: ChecksumConstructor = class {} as any;\n  MockHash.prototype.update = mockHashUpdate;\n  MockHash.prototype.digest = mockHashDigest;\n  MockHash.prototype.reset = mockHashReset;\n\n  const next = vi.fn();\n\n  class ExoticStream {}\n\n  beforeEach(() => {\n    mockEncoder.mockClear();\n    mockHashUpdate.mockClear();\n    mockHashDigest.mockClear();\n    mockHashReset.mockClear();\n    next.mockClear();\n  });\n\n  for (const body of [\"body\", new ArrayBuffer(10), new Uint8Array(10), void 0]) {\n    it(\"should calculate the body hash, encode the result, and set the encoded hash to content-md5 header\", async () => {\n      const handler = applyMd5BodyChecksumMiddleware({\n        md5: MockHash,\n        base64Encoder: mockEncoder,\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        streamHasher: async (stream: ExoticStream) => new Uint8Array(5),\n      })(next, {} as any);\n\n      await handler({\n        input: {},\n        request: new HttpRequest({\n          body: body,\n        }),\n      });\n\n      expect(next.mock.calls.length).toBe(1);\n      const { request } = next.mock.calls[0][0];\n      expect(request.headers[\"content-md5\"]).toBe(\"encoded\");\n      expect(mockHashUpdate.mock.calls).toEqual([[body || \"\"]]);\n    });\n\n    it(\"should do nothing if a case-insenitive match for the desired header has already been set\", async () => {\n      const handler = applyMd5BodyChecksumMiddleware({\n        md5: MockHash,\n        base64Encoder: mockEncoder,\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        streamHasher: async (stream: ExoticStream) => new Uint8Array(5),\n      })(next, {} as any);\n\n      await handler({\n        input: {},\n        request: new HttpRequest({\n          body: body,\n          headers: {\n            \"CoNtEnT-Md5\": \"foo\",\n          },\n        }),\n      });\n\n      expect(next.mock.calls.length).toBe(1);\n      const { request } = next.mock.calls[0][0];\n      expect(request.headers[\"CoNtEnT-Md5\"]).toBe(\"foo\");\n      expect(request.headers[\"content-md5\"]).toBe(undefined);\n      expect(mockHashUpdate.mock.calls.length).toBe(0);\n      expect(mockHashDigest.mock.calls.length).toBe(0);\n      expect(mockEncoder.mock.calls.length).toBe(0);\n    });\n\n    it(\"should clone the request when applying the checksum\", async () => {\n      const handler = applyMd5BodyChecksumMiddleware({\n        md5: MockHash,\n        base64Encoder: mockEncoder,\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n        streamHasher: async (stream: ExoticStream) => new Uint8Array(5),\n      })(next, {} as any);\n\n      await handler({\n        input: {},\n        request: new HttpRequest({\n          body: body,\n        }),\n      });\n\n      expect(next.mock.calls.length).toBe(1);\n      const { request } = next.mock.calls[0][0];\n      // Assert that non-enumerable properties like the method `clone()` are preserved.\n      expect(request.clone).toBeDefined();\n    });\n  }\n\n  it(\"should use the supplied stream hasher to calculate the hash of a streaming body\", async () => {\n    const handler = applyMd5BodyChecksumMiddleware({\n      md5: MockHash,\n      base64Encoder: mockEncoder,\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      streamHasher: async (stream: ExoticStream) => new Uint8Array(5),\n    })(next, {} as any);\n\n    await handler({\n      input: {},\n      request: new HttpRequest({\n        body: new ExoticStream(),\n      }),\n    });\n\n    expect(next.mock.calls.length).toBe(1);\n    const { request } = next.mock.calls[0][0];\n    expect(request.body).toStrictEqual(new ExoticStream());\n    expect(request.headers[\"content-md5\"]).toBe(\"encoded\");\n    expect(mockHashDigest.mock.calls.length).toBe(0);\n    expect(mockEncoder.mock.calls.length).toBe(1);\n    expect(mockEncoder.mock.calls).toEqual([[new Uint8Array(5)]]);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/src/applyMd5BodyChecksumMiddleware.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport { isArrayBuffer } from \"@smithy/core/serde\";\nimport type {\n  BuildHandler,\n  BuildHandlerArguments,\n  BuildHandlerOptions,\n  BuildHandlerOutput,\n  BuildMiddleware,\n  HeaderBag,\n  MetadataBearer,\n  Pluggable,\n} from \"@smithy/types\";\n\nimport type { Md5BodyChecksumResolvedConfig } from \"./md5Configuration\";\n\nexport const applyMd5BodyChecksumMiddleware =\n  (options: Md5BodyChecksumResolvedConfig): BuildMiddleware<any, any> =>\n  <Output extends MetadataBearer>(next: BuildHandler<any, Output>): BuildHandler<any, Output> =>\n  async (args: BuildHandlerArguments<any>): Promise<BuildHandlerOutput<Output>> => {\n    const { request } = args;\n    if (HttpRequest.isInstance(request)) {\n      const { body, headers } = request;\n      if (!hasHeader(\"content-md5\", headers)) {\n        let digest: Promise<Uint8Array>;\n        if (body === undefined || typeof body === \"string\" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {\n          const hash = new options.md5();\n          hash.update(body || \"\");\n          digest = hash.digest();\n        } else {\n          digest = options.streamHasher(options.md5, body);\n        }\n\n        const cloned = HttpRequest.clone(request);\n        cloned.headers = {\n          ...headers,\n          \"content-md5\": options.base64Encoder(await digest),\n        };\n        return next({\n          ...args,\n          request: cloned,\n        });\n      }\n    }\n    return next(args);\n  };\n\nexport const applyMd5BodyChecksumMiddlewareOptions: BuildHandlerOptions = {\n  name: \"applyMd5BodyChecksumMiddleware\",\n  step: \"build\",\n  tags: [\"SET_CONTENT_MD5\", \"BODY_CHECKSUM\"],\n  override: true,\n};\n\nexport const getApplyMd5BodyChecksumPlugin = (config: Md5BodyChecksumResolvedConfig): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.add(applyMd5BodyChecksumMiddleware(config), applyMd5BodyChecksumMiddlewareOptions);\n  },\n});\n\nconst hasHeader = (soughtHeader: string, headers: HeaderBag): boolean => {\n  soughtHeader = soughtHeader.toLowerCase();\n  for (const headerName of Object.keys(headers)) {\n    if (soughtHeader === headerName.toLowerCase()) {\n      return true;\n    }\n  }\n\n  return false;\n};\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/src/index.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { applyMd5BodyChecksumMiddleware, resolveMd5BodyChecksumConfig } from \"./index\";\n\ndescribe(\"middleware-apply-body-checksum package exports\", () => {\n  it(\"maintains object custody\", () => {\n    const input = {\n      md5: vi.fn(),\n      base64Encoder: vi.fn(),\n      streamHasher: vi.fn(),\n    };\n    expect(resolveMd5BodyChecksumConfig(input)).toBe(input);\n  });\n\n  it(\"applyMd5BodyChecksumMiddleware\", () => {\n    expect(typeof applyMd5BodyChecksumMiddleware).toBe(\"function\");\n  });\n});\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/src/index.ts",
    "content": "export * from \"./applyMd5BodyChecksumMiddleware\";\nexport * from \"./md5Configuration\";\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/src/md5Configuration.ts",
    "content": "import type { ChecksumConstructor, Encoder, HashConstructor, StreamHasher } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface Md5BodyChecksumInputConfig {}\ninterface PreviouslyResolved {\n  md5: ChecksumConstructor | HashConstructor;\n  base64Encoder: Encoder;\n  streamHasher: StreamHasher<any>;\n}\n\nexport interface Md5BodyChecksumResolvedConfig {\n  /**\n   * A constructor for a class implementing the @smithy/types.Hash interface that computes MD5 hashes.\n   * @internal\n   */\n  md5: ChecksumConstructor | HashConstructor;\n  /**\n   * The function that will be used to convert binary data to a base64-encoded string.\n   * @internal\n   */\n  base64Encoder: Encoder;\n  /**\n   * A function that, given a hash constructor and a stream, calculates the hash of the streamed value.\n   * @internal\n   */\n  streamHasher: StreamHasher<any>;\n}\n\nexport const resolveMd5BodyChecksumConfig = <T>(\n  input: T & PreviouslyResolved & Md5BodyChecksumInputConfig\n): T & Md5BodyChecksumResolvedConfig => input;\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/src/middleware-apply-body-checksum.integ.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\nimport { Weather } from \"weather\";\n\nimport { requireRequestsFrom } from \"../../../private/util-test/src/index\";\n\ndescribe(\"middleware-apply-body-checksum\", () => {\n  describe(Weather.name, () => {\n    it(\"should add body-checksum\", async () => {\n      const client = new Weather({\n        endpoint: \"https://foo.bar\",\n        region: \"us-west-2\",\n        credentials: {\n          accessKeyId: \"INTEG\",\n          secretAccessKey: \"INTEG\",\n        },\n      });\n      requireRequestsFrom(client).toMatch({\n        headers: {\n          \"content-md5\": /^.{22}(==)?$/i,\n        },\n      });\n\n      await client.getCity({\n        cityId: \"my-city\",\n      });\n\n      expect.assertions(1);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/middleware-apply-body-checksum/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/middleware-compression/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.4.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- 62fed78: package consolidation for core/config\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 4.3.46\n\n### Patch Changes\n\n- @smithy/core@3.23.17\n\n## 4.3.45\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n  - @smithy/core@3.23.16\n\n## 4.3.44\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/core@3.23.15\n  - @smithy/node-config-provider@4.3.14\n  - @smithy/protocol-http@5.3.14\n  - @smithy/util-middleware@4.2.14\n\n## 4.3.43\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/node-config-provider@4.3.13\n  - @smithy/protocol-http@5.3.13\n  - @smithy/util-middleware@4.2.13\n\n## 4.3.42\n\n### Patch Changes\n\n- Updated dependencies [7198e09]\n  - @smithy/core@3.23.13\n\n## 4.3.41\n\n### Patch Changes\n\n- @smithy/core@3.23.12\n\n## 4.3.40\n\n### Patch Changes\n\n- Updated dependencies [2edd638]\n  - @smithy/core@3.23.11\n\n## 4.3.39\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/core@3.23.10\n  - @smithy/types@4.13.1\n  - @smithy/node-config-provider@4.3.12\n  - @smithy/protocol-http@5.3.12\n  - @smithy/util-middleware@4.2.12\n\n## 4.3.38\n\n### Patch Changes\n\n- Updated dependencies [6ef5430]\n- Updated dependencies [6ef5430]\n  - @smithy/core@3.23.9\n\n## 4.3.37\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/node-config-provider@4.3.11\n  - @smithy/util-config-provider@4.2.2\n  - @smithy/is-array-buffer@4.2.2\n  - @smithy/util-middleware@4.2.11\n  - @smithy/protocol-http@5.3.11\n  - @smithy/util-utf8@4.2.2\n  - @smithy/core@3.23.8\n\n## 4.3.36\n\n### Patch Changes\n\n- Updated dependencies [11569eb]\n  - @smithy/core@3.23.7\n\n## 4.3.35\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/core@3.23.6\n  - @smithy/node-config-provider@4.3.10\n  - @smithy/protocol-http@5.3.10\n  - @smithy/util-middleware@4.2.10\n\n## 4.3.34\n\n### Patch Changes\n\n- Updated dependencies [026b177]\n- Updated dependencies [cde9f09]\n  - @smithy/core@3.23.5\n\n## 4.3.33\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/core@3.23.4\n  - @smithy/is-array-buffer@4.2.1\n  - @smithy/node-config-provider@4.3.9\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-config-provider@4.2.1\n  - @smithy/util-middleware@4.2.9\n  - @smithy/util-utf8@4.2.1\n\n## 4.3.32\n\n### Patch Changes\n\n- @smithy/core@3.23.3\n\n## 4.3.31\n\n### Patch Changes\n\n- Updated dependencies [c5db01c]\n  - @smithy/core@3.23.2\n\n## 4.3.30\n\n### Patch Changes\n\n- Updated dependencies [6f96c01]\n  - @smithy/core@3.23.1\n\n## 4.3.29\n\n### Patch Changes\n\n- Updated dependencies [4f05c6a]\n  - @smithy/core@3.23.0\n\n## 4.3.28\n\n### Patch Changes\n\n- @smithy/core@3.22.1\n\n## 4.3.27\n\n### Patch Changes\n\n- Updated dependencies [472bf01]\n  - @smithy/core@3.22.0\n\n## 4.3.26\n\n### Patch Changes\n\n- Updated dependencies [fa0e0c4]\n  - @smithy/core@3.21.1\n\n## 4.3.25\n\n### Patch Changes\n\n- Updated dependencies [c2a6f46]\n  - @smithy/core@3.21.0\n\n## 4.3.24\n\n### Patch Changes\n\n- Updated dependencies [96cc077]\n  - @smithy/core@3.20.8\n\n## 4.3.23\n\n### Patch Changes\n\n- Updated dependencies [ae6ef2e]\n  - @smithy/core@3.20.7\n\n## 4.3.22\n\n### Patch Changes\n\n- Updated dependencies [862c942]\n  - @smithy/core@3.20.6\n\n## 4.3.21\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/core@3.20.5\n  - @smithy/node-config-provider@4.3.8\n  - @smithy/protocol-http@5.3.8\n  - @smithy/util-middleware@4.2.8\n\n## 4.3.20\n\n### Patch Changes\n\n- @smithy/core@3.20.4\n\n## 4.3.19\n\n### Patch Changes\n\n- Updated dependencies [681d6c4]\n  - @smithy/core@3.20.3\n\n## 4.3.18\n\n### Patch Changes\n\n- Updated dependencies [dd55f1f]\n  - @smithy/core@3.20.2\n\n## 4.3.17\n\n### Patch Changes\n\n- Updated dependencies [aa954bc]\n  - @smithy/core@3.20.1\n\n## 4.3.16\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/core@3.20.0\n  - @smithy/node-config-provider@4.3.7\n  - @smithy/protocol-http@5.3.7\n  - @smithy/util-middleware@4.2.7\n\n## 4.3.15\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/core@3.19.0\n  - @smithy/node-config-provider@4.3.6\n  - @smithy/protocol-http@5.3.6\n  - @smithy/util-middleware@4.2.6\n\n## 4.3.14\n\n### Patch Changes\n\n- Updated dependencies [541a18f]\n  - @smithy/core@3.18.7\n\n## 4.3.13\n\n### Patch Changes\n\n- Updated dependencies [1d6db03]\n  - @smithy/core@3.18.6\n\n## 4.3.12\n\n### Patch Changes\n\n- Updated dependencies [77c149f]\n  - @smithy/core@3.18.5\n\n## 4.3.11\n\n### Patch Changes\n\n- Updated dependencies [e659a06]\n  - @smithy/core@3.18.4\n\n## 4.3.10\n\n### Patch Changes\n\n- Updated dependencies [5bcd041]\n  - @smithy/core@3.18.3\n\n## 4.3.9\n\n### Patch Changes\n\n- Updated dependencies [c8b148c]\n  - @smithy/core@3.18.2\n\n## 4.3.8\n\n### Patch Changes\n\n- Updated dependencies [0976f42]\n  - @smithy/core@3.18.1\n\n## 4.3.7\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n- Updated dependencies [e77f705]\n  - @smithy/types@4.9.0\n  - @smithy/core@3.18.0\n  - @smithy/node-config-provider@4.3.5\n  - @smithy/protocol-http@5.3.5\n  - @smithy/util-middleware@4.2.5\n\n## 4.3.6\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n- Updated dependencies [df00095]\n  - @smithy/types@4.8.1\n  - @smithy/core@3.17.2\n  - @smithy/node-config-provider@4.3.4\n  - @smithy/protocol-http@5.3.4\n  - @smithy/util-middleware@4.2.4\n\n## 4.3.5\n\n### Patch Changes\n\n- @smithy/core@3.17.1\n\n## 4.3.4\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/core@3.17.0\n  - @smithy/node-config-provider@4.3.3\n  - @smithy/protocol-http@5.3.3\n  - @smithy/util-middleware@4.2.3\n\n## 4.3.3\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/core@3.16.1\n  - @smithy/types@4.7.1\n  - @smithy/node-config-provider@4.3.2\n  - @smithy/protocol-http@5.3.2\n  - @smithy/util-middleware@4.2.2\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n- Updated dependencies [8a2873c]\n  - @smithy/types@4.7.0\n  - @smithy/core@3.16.0\n  - @smithy/node-config-provider@4.3.1\n  - @smithy/protocol-http@5.3.1\n  - @smithy/util-middleware@4.2.1\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [813c9a5]\n  - @smithy/core@3.15.0\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/core@3.14.0\n  - @smithy/is-array-buffer@4.2.0\n  - @smithy/node-config-provider@4.3.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-config-provider@4.2.0\n  - @smithy/util-middleware@4.2.0\n  - @smithy/util-utf8@4.2.0\n\n## 4.2.5\n\n### Patch Changes\n\n- Updated dependencies [59e9952]\n  - @smithy/core@3.13.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [97fe0d8]\n- Updated dependencies [3eb73f3]\n  - @smithy/core@3.12.0\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [f8793be]\n  - @smithy/core@3.11.1\n\n## 4.2.2\n\n### Patch Changes\n\n- @smithy/node-config-provider@4.2.2\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/core@3.11.0\n  - @smithy/node-config-provider@4.2.1\n  - @smithy/protocol-http@5.2.1\n  - @smithy/util-middleware@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/node-config-provider@4.2.0\n  - @smithy/util-config-provider@4.1.0\n  - @smithy/is-array-buffer@4.1.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n  - @smithy/core@3.10.0\n\n## 4.1.19\n\n### Patch Changes\n\n- Updated dependencies [06ac1f6]\n  - @smithy/core@3.9.2\n\n## 4.1.18\n\n### Patch Changes\n\n- Updated dependencies [29fad01]\n  - @smithy/core@3.9.1\n\n## 4.1.17\n\n### Patch Changes\n\n- Updated dependencies [ab4f33f]\n- Updated dependencies [d79dc91]\n  - @smithy/core@3.9.0\n\n## 4.1.16\n\n### Patch Changes\n\n- Updated dependencies [fd00602]\n- Updated dependencies [64e033f]\n  - @smithy/core@3.8.0\n  - @smithy/types@4.3.2\n  - @smithy/node-config-provider@4.1.4\n  - @smithy/protocol-http@5.1.3\n  - @smithy/util-middleware@4.0.5\n\n## 4.1.15\n\n### Patch Changes\n\n- Updated dependencies [f4dcba0]\n  - @smithy/core@3.7.2\n\n## 4.1.14\n\n### Patch Changes\n\n- Updated dependencies [312801c]\n- Updated dependencies [bb7975e]\n  - @smithy/core@3.7.1\n\n## 4.1.13\n\n### Patch Changes\n\n- Updated dependencies [d105c97]\n  - @smithy/core@3.7.0\n\n## 4.1.12\n\n### Patch Changes\n\n- Updated dependencies [10a0534]\n  - @smithy/core@3.6.0\n\n## 4.1.11\n\n### Patch Changes\n\n- Updated dependencies [4a31774]\n  - @smithy/core@3.5.3\n\n## 4.1.10\n\n### Patch Changes\n\n- Updated dependencies [4642e7e]\n- Updated dependencies [147ceed]\n- Updated dependencies [ae8f1f4]\n  - @smithy/core@3.5.2\n\n## 4.1.9\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/core@3.5.1\n  - @smithy/node-config-provider@4.1.3\n  - @smithy/protocol-http@5.1.2\n  - @smithy/util-middleware@4.0.4\n\n## 4.1.8\n\n### Patch Changes\n\n- Updated dependencies [ae11e3a]\n- Updated dependencies [23812a9]\n  - @smithy/core@3.5.0\n\n## 4.1.7\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n- Updated dependencies [efb27ee]\n- Updated dependencies [06b0ce8]\n  - @smithy/types@4.3.0\n  - @smithy/core@3.4.0\n  - @smithy/node-config-provider@4.1.2\n  - @smithy/protocol-http@5.1.1\n  - @smithy/util-middleware@4.0.3\n\n## 4.1.6\n\n### Patch Changes\n\n- @smithy/core@3.3.3\n\n## 4.1.5\n\n### Patch Changes\n\n- @smithy/core@3.3.2\n\n## 4.1.4\n\n### Patch Changes\n\n- Updated dependencies [9f8d075]\n  - @smithy/node-config-provider@4.1.1\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [acefcf5]\n- Updated dependencies [9ff783b]\n  - @smithy/node-config-provider@4.1.0\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [40ffcd5]\n  - @smithy/core@3.3.1\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [5896264]\n  - @smithy/core@3.3.0\n\n## 4.1.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n### Patch Changes\n\n- Updated dependencies [02ef79c]\n- Updated dependencies [e917e61]\n  - @smithy/core@3.2.0\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n  - @smithy/node-config-provider@4.0.2\n  - @smithy/util-middleware@4.0.2\n\n## 4.0.6\n\n### Patch Changes\n\n- @smithy/core@3.1.5\n\n## 4.0.5\n\n### Patch Changes\n\n- @smithy/core@3.1.4\n\n## 4.0.4\n\n### Patch Changes\n\n- @smithy/core@3.1.3\n\n## 4.0.3\n\n### Patch Changes\n\n- @smithy/core@3.1.2\n\n## 4.0.2\n\n### Patch Changes\n\n- @smithy/core@3.1.1\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/core@3.1.0\n  - @smithy/node-config-provider@4.0.1\n  - @smithy/protocol-http@5.0.1\n  - @smithy/util-middleware@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/node-config-provider@4.0.0\n  - @smithy/util-config-provider@4.0.0\n  - @smithy/util-middleware@4.0.0\n  - @smithy/util-utf8@4.0.0\n  - @smithy/core@3.0.0\n  - @smithy/is-array-buffer@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n\n## 3.1.7\n\n### Patch Changes\n\n- @smithy/core@2.5.7\n\n## 3.1.6\n\n### Patch Changes\n\n- @smithy/core@2.5.6\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/core@2.5.5\n  - @smithy/node-config-provider@3.1.12\n  - @smithy/protocol-http@4.1.8\n  - @smithy/util-middleware@3.0.11\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [9c40f7b]\n  - @smithy/core@2.5.4\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/core@2.5.3\n  - @smithy/node-config-provider@3.1.11\n  - @smithy/protocol-http@4.1.7\n  - @smithy/util-middleware@3.0.10\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [c6ef519]\n- Updated dependencies [cd1929b]\n  - @smithy/core@2.5.2\n  - @smithy/types@3.7.0\n  - @smithy/node-config-provider@3.1.10\n  - @smithy/protocol-http@4.1.6\n  - @smithy/util-middleware@3.0.9\n\n## 3.1.1\n\n### Patch Changes\n\n- @smithy/core@2.5.1\n\n## 3.1.0\n\n### Minor Changes\n\n- d07b0ab: feature detection for custom endpoint and gzip\n\n### Patch Changes\n\n- d07b0ab: reorganize smithy/core to be upstream of smithy/smithy-client\n- Updated dependencies [84bec05]\n- Updated dependencies [d07b0ab]\n- Updated dependencies [d07b0ab]\n  - @smithy/types@3.6.0\n  - @smithy/core@2.5.0\n  - @smithy/node-config-provider@3.1.9\n  - @smithy/protocol-http@4.1.5\n  - @smithy/util-middleware@3.0.8\n\n## 3.0.12\n\n### Patch Changes\n\n- 75e0125: comma spacing\n\n## 3.0.11\n\n### Patch Changes\n\n- dfb0664: use lowercase headers\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/node-config-provider@3.1.8\n  - @smithy/protocol-http@4.1.4\n  - @smithy/util-middleware@3.0.7\n\n## 3.0.10\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/node-config-provider@3.1.7\n  - @smithy/protocol-http@4.1.3\n  - @smithy/util-middleware@3.0.6\n\n## 3.0.9\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/node-config-provider@3.1.6\n  - @smithy/protocol-http@4.1.2\n  - @smithy/util-middleware@3.0.5\n\n## 3.0.8\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/node-config-provider@3.1.5\n  - @smithy/protocol-http@4.1.1\n  - @smithy/util-middleware@3.0.4\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 3.0.6\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n\n## 3.0.5\n\n### Patch Changes\n\n- @smithy/node-config-provider@3.1.4\n\n## 3.0.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/node-config-provider@3.1.3\n  - @smithy/protocol-http@4.0.3\n  - @smithy/util-middleware@3.0.3\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/node-config-provider@3.1.2\n  - @smithy/protocol-http@4.0.2\n  - @smithy/util-middleware@3.0.2\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/node-config-provider@3.1.1\n  - @smithy/protocol-http@4.0.1\n  - @smithy/util-middleware@3.0.1\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [1cdd3be0]\n  - @smithy/node-config-provider@3.1.0\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/node-config-provider@3.0.0\n  - @smithy/util-config-provider@3.0.0\n  - @smithy/is-array-buffer@3.0.0\n  - @smithy/util-middleware@3.0.0\n  - @smithy/protocol-http@4.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/node-config-provider@2.3.0\n  - @smithy/util-config-provider@2.3.0\n  - @smithy/is-array-buffer@2.2.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/util-utf8@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-utf8@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/node-config-provider@2.2.5\n  - @smithy/protocol-http@3.2.2\n  - @smithy/util-middleware@2.1.4\n\n## 2.1.4\n\n### Patch Changes\n\n- @smithy/node-config-provider@2.2.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/node-config-provider@2.2.3\n  - @smithy/protocol-http@3.2.1\n  - @smithy/util-middleware@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/node-config-provider@2.2.2\n  - @smithy/util-middleware@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/is-array-buffer@2.1.1\n  - @smithy/node-config-provider@2.2.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/types@2.9.1\n  - @smithy/util-config-provider@2.2.1\n  - @smithy/util-middleware@2.1.1\n  - @smithy/util-utf8@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/node-config-provider@2.2.0\n  - @smithy/util-config-provider@2.2.0\n  - @smithy/is-array-buffer@2.1.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/util-utf8@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.2\n\n### Patch Changes\n\n- f48de633: Make CompressionInputConfig properties optional\n\n## 2.0.1\n\n### Patch Changes\n\n- e21ed11d: Accept Provider in CompressionInputConfig\n\n## 2.0.0\n\n### Major Changes\n\n- 35d6b218: Add middleware and plugin for request compression\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n"
  },
  {
    "path": "packages/middleware-compression/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/middleware-compression/README.md",
    "content": "# @smithy/middleware-compression\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/middleware-token/latest.svg)](https://www.npmjs.com/package/@smithy/middleware-compression)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/middleware-token.svg)](https://www.npmjs.com/package/@smithy/middleware-compression)\n\n### :warning: Internal API :warning:\n\n> This is an internal package.\n> That means this is used as a dependency for other, public packages, but\n> should not be taken directly as a dependency in your application's `package.json`.\n\n> If you are updating the version of this package, for example to bring in a\n> bug-fix, you should do so by updating your application lockfile with\n> e.g. `npm up @scope/package` or equivalent command in another\n> package manager, rather than taking a direct dependency.\n\n----"
  },
  {
    "path": "packages/middleware-compression/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-compression\",\n  \"version\": \"4.4.3\",\n  \"description\": \"Middleware and Plugin for request compression.\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-compression\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"fflate\": \"0.8.1\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"web-streams-polyfill\": \"3.2.1\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"keywords\": [\n    \"middleware\",\n    \"compression\",\n    \"gzip\"\n  ],\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"browser\": {\n    \"./dist-es/compressStream\": \"./dist-es/compressStream.browser\",\n    \"./dist-es/compressString\": \"./dist-es/compressString.browser\"\n  },\n  \"react-native\": {\n    \"./dist-es/compressStream\": \"./dist-es/compressStream.browser\",\n    \"./dist-cjs/compressStream\": \"./dist-cjs/compressStream.browser\",\n    \"./dist-es/compressString\": \"./dist-es/compressString.browser\",\n    \"./dist-cjs/compressString\": \"./dist-cjs/compressString.browser\"\n  },\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-compression\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-compression\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-compression/src/NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS.spec.ts",
    "content": "import { SelectorType, booleanSelector } from \"@smithy/core/config\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  DEFAULT_DISABLE_REQUEST_COMPRESSION,\n  NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS,\n  NODE_DISABLE_REQUEST_COMPRESSION_ENV_NAME,\n  NODE_DISABLE_REQUEST_COMPRESSION_INI_NAME,\n} from \"./NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS\";\n\nvi.mock(\"@smithy/core/config\");\n\ndescribe(\"NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS\", () => {\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {\n    it.each([true, false, undefined])(\"returns %s\", (output) => {\n      vi.mocked(booleanSelector).mockReturnValueOnce(output);\n      expect(func(obj)).toEqual(output);\n      expect(booleanSelector).toBeCalledWith(obj, key, type);\n    });\n\n    it(\"throws error\", () => {\n      const mockError = new Error(\"error\");\n      vi.mocked(booleanSelector).mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => {\n        func(obj);\n      }).toThrow(mockError);\n    });\n  };\n\n  describe(\"calls booleanSelector for environmentVariableSelector\", () => {\n    const env: { [NODE_DISABLE_REQUEST_COMPRESSION_ENV_NAME]: any } = {} as any;\n    const { environmentVariableSelector } = NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS;\n    test(environmentVariableSelector, env, NODE_DISABLE_REQUEST_COMPRESSION_ENV_NAME, SelectorType.ENV);\n  });\n\n  describe(\"calls booleanSelector for configFileSelector\", () => {\n    const profileContent: { [NODE_DISABLE_REQUEST_COMPRESSION_INI_NAME]: any } = {} as any;\n    const { configFileSelector } = NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS;\n    test(configFileSelector, profileContent, NODE_DISABLE_REQUEST_COMPRESSION_INI_NAME, SelectorType.CONFIG);\n  });\n\n  it(`returns ${DEFAULT_DISABLE_REQUEST_COMPRESSION} for default`, () => {\n    const { default: defaultValue } = NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS;\n    expect(defaultValue).toEqual(DEFAULT_DISABLE_REQUEST_COMPRESSION);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS.ts",
    "content": "import { SelectorType, booleanSelector, type LoadedConfigSelectors } from \"@smithy/core/config\";\n\n/**\n * @internal\n */\nexport const NODE_DISABLE_REQUEST_COMPRESSION_ENV_NAME = \"AWS_DISABLE_REQUEST_COMPRESSION\";\n\n/**\n * @internal\n */\nexport const NODE_DISABLE_REQUEST_COMPRESSION_INI_NAME = \"disable_request_compression\";\n\n/**\n * @internal\n */\nexport const DEFAULT_DISABLE_REQUEST_COMPRESSION = false;\n\n/**\n * @internal\n */\nexport const NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS: LoadedConfigSelectors<boolean> = {\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) =>\n    booleanSelector(env, NODE_DISABLE_REQUEST_COMPRESSION_ENV_NAME, SelectorType.ENV),\n  configFileSelector: (profile) =>\n    booleanSelector(profile, NODE_DISABLE_REQUEST_COMPRESSION_INI_NAME, SelectorType.CONFIG),\n  default: DEFAULT_DISABLE_REQUEST_COMPRESSION,\n};\n"
  },
  {
    "path": "packages/middleware-compression/src/NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS.spec.ts",
    "content": "import { SelectorType, numberSelector } from \"@smithy/core/config\";\nimport { afterEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES,\n  NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS,\n  NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_NAME,\n  NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_INI_NAME,\n} from \"./NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS\";\n\nvi.mock(\"@smithy/core/config\");\n\ndescribe(\"NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS\", () => {\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  const test = (func: Function, obj: Record<string, string>, key: string, type: SelectorType) => {\n    it.each([0, 1, undefined])(\"returns %s\", (output) => {\n      vi.mocked(numberSelector).mockReturnValueOnce(output);\n      expect(func(obj)).toEqual(output);\n      expect(numberSelector).toBeCalledWith(obj, key, type);\n    });\n\n    it(\"throws error\", () => {\n      const mockError = new Error(\"error\");\n      vi.mocked(numberSelector).mockImplementationOnce(() => {\n        throw mockError;\n      });\n      expect(() => {\n        func(obj);\n      }).toThrow(mockError);\n    });\n  };\n\n  describe(\"calls numberSelector for environmentVariableSelector\", () => {\n    const env: { [NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_NAME]: any } = {} as any;\n    const { environmentVariableSelector } = NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS;\n    test(environmentVariableSelector, env, NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_NAME, SelectorType.ENV);\n  });\n\n  describe(\"calls numberSelector for configFileSelector\", () => {\n    const profileContent: { [NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_INI_NAME]: any } = {} as any;\n    const { configFileSelector } = NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS;\n    test(configFileSelector, profileContent, NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_INI_NAME, SelectorType.CONFIG);\n  });\n\n  it(`returns ${DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES} for default`, () => {\n    const { default: defaultValue } = NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS;\n    expect(defaultValue).toEqual(DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS.ts",
    "content": "import { SelectorType, numberSelector, type LoadedConfigSelectors } from \"@smithy/core/config\";\n\n/**\n * @internal\n */\nexport const NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_NAME = \"AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES\";\n\n/**\n * @internal\n */\nexport const NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_INI_NAME = \"request_min_compression_size_bytes\";\n\n/**\n * @internal\n */\nexport const DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES = 10240;\n\n/**\n * @internal\n */\nexport const NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS: LoadedConfigSelectors<number> = {\n  environmentVariableSelector: (env: NodeJS.ProcessEnv) =>\n    numberSelector(env, NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_NAME, SelectorType.ENV),\n  configFileSelector: (profile) =>\n    numberSelector(profile, NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_INI_NAME, SelectorType.CONFIG),\n  default: DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES,\n};\n"
  },
  {
    "path": "packages/middleware-compression/src/compressStream.browser.spec.ts",
    "content": "import { AsyncGzip } from \"fflate\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\nimport { ReadableStream } from \"web-streams-polyfill\";\n\nimport { compressStream } from \"./compressStream.browser\";\n\nvi.mock(\"fflate\");\n\ndescribe(compressStream.name, () => {\n  const compressionSuffix = \"compressed\";\n  const compressionSeparator = \".\";\n  const asyncGzip = {\n    ondata: vi.fn(),\n    push: vi.fn().mockImplementation((chunk, final) => {\n      const data = typeof chunk === \"string\" ? [chunk, compressionSuffix].join(compressionSeparator) : null;\n      asyncGzip.ondata(undefined, data, final);\n    }),\n    terminate() {},\n  };\n\n  beforeEach(() => {\n    vi.mocked(AsyncGzip).mockImplementation(() => asyncGzip);\n  });\n\n  afterEach(() => {\n    vi.resetAllMocks();\n  });\n\n  it(\"compresses a stream\", async () => {\n    const inputChunks = [\"hello\", \"world\"];\n    const inputStream = new ReadableStream({\n      start(controller) {\n        for (const inputChunk of inputChunks) {\n          controller.enqueue(inputChunk);\n        }\n        controller.close();\n      },\n    });\n\n    const compressionStream = await compressStream(inputStream);\n    const reader = compressionStream.getReader();\n    for (const inputChunk of inputChunks) {\n      const { value, done } = await reader.read();\n      expect(value).toEqual([inputChunk, compressionSuffix].join(compressionSeparator));\n      expect(done).toEqual(false);\n    }\n\n    // Mock for last push.\n    const { value, done } = await reader.read();\n    expect(value).toEqual(null);\n    expect(done).toEqual(false);\n\n    // Mock for stream ending.\n    const { value: valueFinal, done: doneFinal } = await reader.read();\n    expect(valueFinal).toEqual(undefined);\n    expect(doneFinal).toEqual(true);\n  });\n\n  it(\"should throw an error if compression fails\", async () => {\n    const compressionErrorMsg = \"compression error message\";\n    const compressionError = new Error(compressionErrorMsg);\n    vi.mocked(AsyncGzip).mockImplementationOnce(() => {\n      throw compressionError;\n    });\n\n    const inputStream = new ReadableStream({\n      start(controller) {\n        controller.close();\n      },\n    });\n\n    await expect(compressStream(inputStream)).rejects.toThrow(compressionError);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/compressStream.browser.ts",
    "content": "import { AsyncGzip } from \"fflate\";\n\nexport const compressStream = async (body: ReadableStream): Promise<ReadableStream> => {\n  let endCallback: () => void;\n  const asyncGzip = new AsyncGzip();\n\n  // Replace with Compression Streams API once supported in all browsers.\n  // https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API\n  const compressionStream = new TransformStream({\n    start(controller) {\n      asyncGzip.ondata = (err, data, final) => {\n        if (err) {\n          controller.error(err);\n        } else {\n          controller.enqueue(data);\n          if (final) {\n            if (endCallback) endCallback();\n            else controller.terminate();\n          }\n        }\n      };\n    },\n    transform(chunk) {\n      asyncGzip.push(chunk);\n    },\n    flush() {\n      return new Promise((resolve) => {\n        endCallback = resolve;\n        asyncGzip.push(new Uint8Array(0), true);\n      });\n    },\n  });\n\n  return body.pipeThrough(compressionStream);\n};\n"
  },
  {
    "path": "packages/middleware-compression/src/compressStream.spec.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { createGzip } from \"node:zlib\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { compressStream } from \"./compressStream\";\n\nvi.mock(\"zlib\");\n\ndescribe(compressStream.name, () => {\n  const getGenerator = (chunks: string[]) =>\n    async function* generator() {\n      for (const chunk of chunks) {\n        yield chunk;\n      }\n    };\n\n  const testInputStream = Readable.from(getGenerator([\"input\"])());\n  const mockGzipFn = vi.fn();\n  const testOutputStream = Readable.from(getGenerator([\"input\", \"gzipped\"])());\n\n  beforeEach(() => {\n    vi.mocked(createGzip).mockReturnValue(mockGzipFn as any);\n    testInputStream.pipe = vi.fn().mockReturnValue(testOutputStream);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should compress a readable stream using gzip\", async () => {\n    const outputStream = await compressStream(testInputStream);\n\n    expect(outputStream).toBeInstanceOf(Readable);\n    expect(outputStream).toBe(testOutputStream);\n\n    expect(testInputStream.pipe).toHaveBeenCalledTimes(1);\n    expect(testInputStream.pipe).toHaveBeenCalledWith(mockGzipFn);\n    expect(createGzip).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"should throw an error if compression fails\", async () => {\n    const compressionErrorMsg = \"compression error message\";\n    const compressionError = new Error(compressionErrorMsg);\n    vi.mocked(createGzip).mockImplementationOnce(() => {\n      throw compressionError;\n    });\n\n    await expect(compressStream(testInputStream)).rejects.toThrow(compressionError);\n\n    expect(createGzip).toHaveBeenCalledTimes(1);\n    expect(testInputStream.pipe).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/compressStream.ts",
    "content": "import type { Readable } from \"node:stream\";\nimport { createGzip } from \"node:zlib\";\n\nexport const compressStream = async (body: Readable): Promise<Readable> => body.pipe(createGzip());\n"
  },
  {
    "path": "packages/middleware-compression/src/compressString.browser.spec.ts",
    "content": "import { toUint8Array } from \"@smithy/core/serde\";\nimport { gzip } from \"fflate\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { compressString } from \"./compressString.browser\";\n\nvi.mock(\"@smithy/core/serde\");\nvi.mock(\"fflate\");\n\ndescribe(compressString.name, () => {\n  const testData = \"test\";\n  const compressionSuffix = \"compressed\";\n  const compressionSeparator = \".\";\n\n  beforeEach(() => {\n    vi.mocked(toUint8Array).mockImplementation((data) => data as any);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should compress data with gzip\", async () => {\n    vi.mocked(gzip).mockImplementation(((data: any, callback: any) => {\n      callback(null, [data, compressionSuffix].join(compressionSeparator));\n    }) as any);\n    const receivedOutput = await compressString(testData);\n    const expectedOutput = [testData, compressionSuffix].join(compressionSeparator);\n\n    expect(receivedOutput).toEqual(expectedOutput);\n    expect(gzip).toHaveBeenCalledTimes(1);\n    expect(gzip).toHaveBeenCalledWith(testData, expect.any(Function));\n    expect(toUint8Array).toHaveBeenCalledTimes(1);\n    expect(toUint8Array).toHaveBeenCalledWith(testData);\n  });\n\n  it(\"should throw an error if compression fails\", async () => {\n    const compressionErrorMsg = \"compression error message\";\n    const compressionError = new Error(compressionErrorMsg);\n    vi.mocked(gzip).mockImplementation(((data: any, callback: any) => {\n      callback(compressionError);\n    }) as any);\n\n    await expect(compressString(testData)).rejects.toThrow(\n      new Error(\"Failure during compression: \" + compressionErrorMsg)\n    );\n\n    expect(gzip).toHaveBeenCalledTimes(1);\n    expect(gzip).toHaveBeenCalledWith(testData, expect.any(Function));\n    expect(toUint8Array).toHaveBeenCalledTimes(1);\n    expect(toUint8Array).toHaveBeenCalledWith(testData);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/compressString.browser.ts",
    "content": "import { toUint8Array } from \"@smithy/core/serde\";\nimport { gzip } from \"fflate\";\n\nexport const compressString = async (body: any): Promise<Uint8Array> =>\n  new Promise((resolve, reject) => {\n    gzip(toUint8Array(body || \"\"), (err, data) => {\n      if (err) {\n        reject(new Error(\"Failure during compression: \" + err.message));\n      } else {\n        resolve(data);\n      }\n    });\n  });\n"
  },
  {
    "path": "packages/middleware-compression/src/compressString.spec.ts",
    "content": "import { gzip } from \"node:zlib\";\nimport { toUint8Array } from \"@smithy/core/serde\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { compressString } from \"./compressString\";\n\nconst compressionSuffix = \"compressed\";\nconst compressionSeparator = \".\";\n\nvi.mock(\"@smithy/core/serde\");\nvi.mock(\"util\", () => ({ promisify: vi.fn().mockImplementation((fn) => fn) }));\nvi.mock(\"zlib\", () => ({\n  gzip: vi.fn().mockImplementation((data) => [data, compressionSuffix].join(compressionSeparator)),\n}));\n\ndescribe(compressString.name, () => {\n  const testData = \"test\";\n\n  beforeEach(() => {\n    vi.mocked(toUint8Array).mockImplementation((data: any) => data);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"should compress data with gzip\", async () => {\n    const receivedOutput = await compressString(testData);\n    const expectedOutput = [testData, compressionSuffix].join(compressionSeparator);\n\n    expect(receivedOutput).toEqual(expectedOutput);\n    expect(gzip).toHaveBeenCalledTimes(1);\n    expect(gzip).toHaveBeenCalledWith(testData);\n    expect(toUint8Array).toHaveBeenCalledTimes(2);\n    expect(toUint8Array).toHaveBeenNthCalledWith(1, testData);\n    expect(toUint8Array).toHaveBeenNthCalledWith(2, expectedOutput);\n  });\n\n  it(\"should throw an error if compression fails\", async () => {\n    const compressionErrorMsg = \"compression error message\";\n    const compressionError = new Error(compressionErrorMsg);\n    (gzip as unknown as any).mockImplementationOnce(() => {\n      throw compressionError;\n    });\n\n    await expect(compressString(testData)).rejects.toThrow(\n      new Error(\"Failure during compression: \" + compressionErrorMsg)\n    );\n\n    expect(gzip).toHaveBeenCalledTimes(1);\n    expect(gzip).toHaveBeenCalledWith(testData);\n    expect(toUint8Array).toHaveBeenCalledTimes(1);\n    expect(toUint8Array).toHaveBeenCalledWith(testData);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/compressString.ts",
    "content": "import { promisify } from \"node:util\";\nimport { gzip } from \"node:zlib\";\nimport { toUint8Array } from \"@smithy/core/serde\";\n\nconst gzipAsync = promisify(gzip);\n\nexport const compressString = async (body: any): Promise<Uint8Array> => {\n  // Only gzip shall be supported initial release.\n  try {\n    const compressedBuffer = await gzipAsync(toUint8Array(body || \"\"));\n    return toUint8Array(compressedBuffer);\n  } catch (err) {\n    throw new Error(\"Failure during compression: \" + err.message);\n  }\n};\n"
  },
  {
    "path": "packages/middleware-compression/src/compressionMiddleware.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { compressStream } from \"./compressStream\";\nimport { compressString } from \"./compressString\";\nimport { compressionMiddleware } from \"./compressionMiddleware\";\nimport { CompressionAlgorithm } from \"./constants\";\nimport { isStreaming } from \"./isStreaming\";\n\nvi.mock(\"@smithy/core/protocols\");\nvi.mock(\"./compressString\");\nvi.mock(\"./compressStream\");\nvi.mock(\"./isStreaming\");\n\ndescribe(compressionMiddleware.name, () => {\n  const mockBody = \"body\";\n  const mockConfig = {\n    bodyLengthChecker: vi.fn().mockReturnValue(mockBody.length),\n    disableRequestCompression: async () => false,\n    requestMinCompressionSizeBytes: async () => 0,\n  };\n  const mockMiddlewareConfig = {\n    encodings: [CompressionAlgorithm.GZIP],\n  };\n\n  const mockNext = vi.fn();\n  const mockContext = {};\n  const mockArgs = { request: { headers: {}, body: mockBody } };\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"skips compression if it's not an HttpRequest\", async () => {\n    const { isInstance } = HttpRequest;\n    (isInstance as unknown as any).mockReturnValue(false);\n    await compressionMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, mockContext)({ ...mockArgs } as any);\n    expect(mockNext).toHaveBeenCalledWith(mockArgs);\n  });\n\n  describe(\"HttpRequest\", () => {\n    beforeEach(() => {\n      const { isInstance } = HttpRequest;\n      (isInstance as unknown as any).mockReturnValue(true);\n      vi.mocked(isStreaming).mockReturnValue(false);\n    });\n\n    it(\"skips compression if disabled\", async () => {\n      await compressionMiddleware({ ...mockConfig, disableRequestCompression: async () => true }, mockMiddlewareConfig)(\n        mockNext,\n        mockContext\n      )({ ...mockArgs } as any);\n      expect(mockNext).toHaveBeenCalledWith(mockArgs);\n    });\n\n    it(\"skips compression if encodings are not provided\", async () => {\n      await compressionMiddleware(mockConfig, { encodings: [] })(mockNext, mockContext)({ ...mockArgs } as any);\n      expect(mockNext).toHaveBeenCalledWith(mockArgs);\n    });\n\n    it(\"skips compression if encodings are not supported\", async () => {\n      await compressionMiddleware(mockConfig, { encodings: [\"brotli\"] })(mockNext, mockContext)({ ...mockArgs } as any);\n      expect(mockNext).toHaveBeenCalledWith(mockArgs);\n    });\n\n    describe(\"streaming\", () => {\n      beforeEach(() => {\n        vi.mocked(isStreaming).mockReturnValue(true);\n      });\n\n      it(\"throws error if streaming blob requires length\", async () => {\n        await expect(\n          compressionMiddleware(mockConfig, { ...mockMiddlewareConfig, streamRequiresLength: true })(\n            mockNext,\n            mockContext\n          )({ ...mockArgs } as any)\n        ).rejects.toThrow(\"Compression is not supported for streaming blobs that require a length.\");\n\n        expect(isStreaming).toHaveBeenCalledTimes(1);\n        expect(isStreaming).toHaveBeenCalledWith(mockBody);\n        expect(mockNext).not.toHaveBeenCalled();\n      });\n\n      it(\"compresses streaming blob\", async () => {\n        const mockCompressedStream = \"compressed-stream\" as any;\n        vi.mocked(compressStream).mockResolvedValueOnce(mockCompressedStream);\n\n        await compressionMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, mockContext)({ ...mockArgs } as any);\n\n        expect(isStreaming).toHaveBeenCalledTimes(1);\n        expect(isStreaming).toHaveBeenCalledWith(mockBody);\n        expect(mockNext).toHaveBeenCalledWith({\n          ...mockArgs,\n          request: {\n            ...mockArgs.request,\n            body: mockCompressedStream,\n            headers: {\n              ...mockArgs.request.headers,\n              \"content-encoding\": \"gzip\",\n            },\n          },\n        });\n        expect(compressStream).toHaveBeenCalledTimes(1);\n        expect(compressStream).toHaveBeenCalledWith(mockBody);\n      });\n    });\n\n    describe(\"not streaming\", () => {\n      it(\"skips compression if body is smaller than min size\", async () => {\n        await compressionMiddleware(\n          { ...mockConfig, requestMinCompressionSizeBytes: async () => mockBody.length + 1 },\n          mockMiddlewareConfig\n        )(\n          mockNext,\n          mockContext\n        )({ ...mockArgs } as any);\n\n        expect(mockNext).toHaveBeenCalledWith(mockArgs);\n      });\n\n      it(\"compresses body\", async () => {\n        const mockCompressedBody = \"compressed-body\" as any;\n        vi.mocked(compressString).mockResolvedValueOnce(mockCompressedBody);\n\n        await compressionMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, mockContext)({ ...mockArgs } as any);\n\n        expect(mockNext).toHaveBeenCalledWith({\n          ...mockArgs,\n          request: {\n            ...mockArgs.request,\n            body: mockCompressedBody,\n            headers: {\n              ...mockArgs.request.headers,\n              \"content-encoding\": \"gzip\",\n            },\n          },\n        });\n        expect(compressString).toHaveBeenCalledTimes(1);\n        expect(compressString).toHaveBeenCalledWith(mockBody);\n      });\n\n      it(\"appends algorithm to existing Content-Encoding header\", async () => {\n        const mockCompressedBody = \"compressed-body\" as any;\n        vi.mocked(compressString).mockResolvedValueOnce(mockCompressedBody);\n\n        const mockExistingContentEncoding = \"deflate\";\n        await compressionMiddleware(mockConfig, mockMiddlewareConfig)(mockNext, mockContext)({\n          ...mockArgs,\n          request: {\n            ...mockArgs.request,\n            headers: {\n              \"content-encoding\": mockExistingContentEncoding,\n            },\n          },\n        } as any);\n\n        expect(mockNext).toHaveBeenCalledWith({\n          ...mockArgs,\n          request: {\n            ...mockArgs.request,\n            body: mockCompressedBody,\n            headers: {\n              ...mockArgs.request.headers,\n              \"content-encoding\": [mockExistingContentEncoding, \"gzip\"].join(\", \"),\n            },\n          },\n        });\n        expect(compressString).toHaveBeenCalledTimes(1);\n        expect(compressString).toHaveBeenCalledWith(mockBody);\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/compressionMiddleware.ts",
    "content": "import { setFeature } from \"@smithy/core\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport type {\n  AbsoluteLocation,\n  BuildHandler,\n  BuildHandlerArguments,\n  BuildHandlerOptions,\n  BuildHandlerOutput,\n  BuildMiddleware,\n  HandlerExecutionContext,\n  MetadataBearer,\n} from \"@smithy/types\";\n\nimport { compressStream } from \"./compressStream\";\nimport { compressString } from \"./compressString\";\nimport type { CompressionPreviouslyResolved, CompressionResolvedConfig } from \"./configurations\";\nimport { CLIENT_SUPPORTED_ALGORITHMS, type CompressionAlgorithm } from \"./constants\";\nimport { isStreaming } from \"./isStreaming\";\n\n/**\n * @internal\n */\nexport interface CompressionMiddlewareConfig {\n  /**\n   * Defines the priority-ordered list of compression algorithms supported by the service operation.\n   */\n  encodings: string[];\n\n  /**\n   * Indicates that the streaming blob MUST be finite and have a known size when sending data from a client to a server.\n   * Populated if smithy requiresLength is set https://smithy.io/2.0/spec/streaming.html#requireslength-trait\n   */\n  streamRequiresLength?: boolean;\n}\n\n/**\n * @internal\n */\nexport const compressionMiddleware =\n  (\n    config: CompressionResolvedConfig & CompressionPreviouslyResolved,\n    middlewareConfig: CompressionMiddlewareConfig\n  ): BuildMiddleware<any, any> =>\n  <Output extends MetadataBearer>(\n    next: BuildHandler<any, Output>,\n    context: HandlerExecutionContext\n  ): BuildHandler<any, Output> =>\n  async (args: BuildHandlerArguments<any>): Promise<BuildHandlerOutput<Output>> => {\n    if (!HttpRequest.isInstance(args.request)) {\n      return next(args);\n    }\n\n    const disableRequestCompression = await config.disableRequestCompression();\n    if (disableRequestCompression) {\n      return next(args);\n    }\n\n    const { request } = args;\n    const { body, headers } = request;\n    const { encodings, streamRequiresLength } = middlewareConfig;\n\n    let updatedBody = body;\n    let updatedHeaders = headers;\n\n    for (const algorithm of encodings) {\n      if (CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm as CompressionAlgorithm)) {\n        let isRequestCompressed = false;\n        if (isStreaming(body)) {\n          if (!streamRequiresLength) {\n            updatedBody = await compressStream(body);\n            isRequestCompressed = true;\n          } else {\n            // Invalid case. We should never get here.\n            throw new Error(\"Compression is not supported for streaming blobs that require a length.\");\n          }\n        } else {\n          const bodyLength = config.bodyLengthChecker(body);\n          const requestMinCompressionSizeBytes = await config.requestMinCompressionSizeBytes();\n          if (bodyLength && bodyLength >= requestMinCompressionSizeBytes) {\n            updatedBody = await compressString(body);\n            isRequestCompressed = true;\n          }\n        }\n\n        if (isRequestCompressed) {\n          // Either append to the header if it already exists, else set it\n          if (headers[\"content-encoding\"]) {\n            updatedHeaders = {\n              ...headers,\n              \"content-encoding\": `${headers[\"content-encoding\"]}, ${algorithm}`,\n            };\n          } else {\n            updatedHeaders = { ...headers, \"content-encoding\": algorithm };\n          }\n\n          if (updatedHeaders[\"content-encoding\"].includes(\"gzip\")) {\n            setFeature(context, \"GZIP_REQUEST_COMPRESSION\", \"L\");\n          }\n\n          // We've matched on one supported algorithm in the\n          // priority-ordered list, so we're finished.\n          break;\n        }\n      }\n    }\n\n    return next({\n      ...args,\n      request: {\n        ...request,\n        body: updatedBody,\n        headers: updatedHeaders,\n      },\n    });\n  };\n\nexport const compressionMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation = {\n  name: \"compressionMiddleware\",\n  step: \"build\",\n  tags: [\"REQUEST_BODY_COMPRESSION\", \"GZIP\"],\n  override: true,\n  priority: \"high\",\n};\n"
  },
  {
    "path": "packages/middleware-compression/src/configurations.ts",
    "content": "import type { BodyLengthCalculator, Provider } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface CompressionInputConfig {\n  /**\n   * Whether to disable request compression.\n   */\n  disableRequestCompression?: boolean | Provider<boolean>;\n\n  /**\n   * The minimum size in bytes that a request body should be to trigger compression.\n   * The value must be a non-negative integer value between 0 and 10485760 bytes inclusive.\n   */\n  requestMinCompressionSizeBytes?: number | Provider<number>;\n}\n\n/**\n * @internal\n */\nexport interface CompressionPreviouslyResolved {\n  /**\n   * A function that can calculate the length of a body.\n   */\n  bodyLengthChecker: BodyLengthCalculator;\n}\n\n/**\n * @internal\n */\nexport interface CompressionResolvedConfig {\n  /**\n   * Resolved value for input config {@link CompressionInputConfig.disableRequestCompression}\n   */\n  disableRequestCompression: Provider<boolean>;\n\n  /**\n   * Resolved value for input config {@link CompressionInputConfig.requestMinCompressionSizeBytes}\n   */\n  requestMinCompressionSizeBytes: Provider<number>;\n}\n"
  },
  {
    "path": "packages/middleware-compression/src/constants.ts",
    "content": "/**\n * Compression Algorithms supported by the SDK.\n */\nexport enum CompressionAlgorithm {\n  GZIP = \"gzip\",\n}\n\nexport const CLIENT_SUPPORTED_ALGORITHMS: CompressionAlgorithm[] = [CompressionAlgorithm.GZIP];\n"
  },
  {
    "path": "packages/middleware-compression/src/getCompressionPlugin.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { compressionMiddleware, compressionMiddlewareOptions } from \"./compressionMiddleware\";\nimport { getCompressionPlugin } from \"./getCompressionPlugin\";\n\nvi.mock(\"./compressionMiddleware\");\n\ndescribe(getCompressionPlugin.name, () => {\n  const config = {\n    bodyLengthChecker: vi.fn(),\n    disableRequestCompression: async () => false,\n    requestMinCompressionSizeBytes: async () => 0,\n  };\n  const middlewareConfig = { encodings: [] };\n\n  it(\"applyToStack adds compressionMiddleware\", () => {\n    const middlewareReturn = {} as any;\n    vi.mocked(compressionMiddleware).mockReturnValueOnce(middlewareReturn);\n\n    const plugin = getCompressionPlugin(config, middlewareConfig);\n    const commandStack = { add: vi.fn() };\n\n    // @ts-ignore\n    plugin.applyToStack(commandStack);\n    expect(commandStack.add).toHaveBeenCalledWith(middlewareReturn, compressionMiddlewareOptions);\n    expect(compressionMiddleware).toHaveBeenCalled();\n    expect(compressionMiddleware).toHaveBeenCalledWith(config, middlewareConfig);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/getCompressionPlugin.ts",
    "content": "import type { Pluggable } from \"@smithy/types\";\n\nimport {\n  compressionMiddleware,\n  compressionMiddlewareOptions,\n  type CompressionMiddlewareConfig,\n} from \"./compressionMiddleware\";\nimport type { CompressionPreviouslyResolved, CompressionResolvedConfig } from \"./configurations\";\n\n/**\n * @internal\n */\nexport const getCompressionPlugin = (\n  config: CompressionResolvedConfig & CompressionPreviouslyResolved,\n  middlewareConfig: CompressionMiddlewareConfig\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.add(compressionMiddleware(config, middlewareConfig), compressionMiddlewareOptions);\n  },\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/index.ts",
    "content": "export * from \"./NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS\";\nexport * from \"./NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS\";\nexport * from \"./compressionMiddleware\";\nexport * from \"./configurations\";\nexport * from \"./getCompressionPlugin\";\nexport * from \"./resolveCompressionConfig\";\n"
  },
  {
    "path": "packages/middleware-compression/src/isStreaming.spec.ts",
    "content": "import { isArrayBuffer } from \"@smithy/core/serde\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { isStreaming } from \"./isStreaming\";\n\nvi.mock(\"@smithy/core/serde\");\n\ndescribe(isStreaming.name, () => {\n  beforeEach(() => {\n    (isArrayBuffer as unknown as any).mockReturnValue(true);\n  });\n\n  afterEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"returns true when body is a stream\", () => {\n    (isArrayBuffer as unknown as any).mockReturnValue(false);\n    // Mocking {} as a stream\n    const mockStream = {};\n    expect(isStreaming(mockStream)).toBe(true);\n    expect(isArrayBuffer).toHaveBeenCalledTimes(1);\n    expect(isArrayBuffer).toHaveBeenCalledWith(mockStream);\n  });\n\n  describe(\"returns false when body is\", () => {\n    it.each([undefined, \"str\"])(\"special case: %s\", (val) => {\n      expect(isStreaming(val)).toBe(false);\n      expect(isArrayBuffer).not.toHaveBeenCalled();\n    });\n\n    it.each([null, true, 1])(\"primitive data type: %s\", (val) => {\n      expect(isStreaming(val)).toBe(false);\n      expect(isArrayBuffer).toHaveBeenCalledTimes(1);\n      expect(isArrayBuffer).toHaveBeenCalledWith(val);\n    });\n\n    const buffer = new ArrayBuffer(4);\n    const arr = [...Array(4).keys()];\n    const addPointOne = (num: number) => num + 0.1;\n    it.each([\n      Buffer.from(buffer),\n      new DataView(buffer),\n      new Int8Array(arr),\n      new Uint8Array(arr),\n      new Uint8ClampedArray(arr),\n      new Int16Array(arr),\n      new Uint16Array(arr),\n      new Int32Array(arr),\n      new Uint32Array(arr),\n      new Float32Array(arr.map(addPointOne)),\n      new Float64Array(arr.map(addPointOne)),\n      new BigInt64Array(arr.map(BigInt)),\n      new BigUint64Array(arr.map(BigInt)),\n    ])(\"ArrayBuffer View: %s\", (arrayBufferView) => {\n      expect(isStreaming(arrayBufferView)).toBe(false);\n      expect(isArrayBuffer).not.toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/isStreaming.ts",
    "content": "import { isArrayBuffer } from \"@smithy/core/serde\";\n\n/**\n * Returns true if the given value is a streaming response.\n */\nexport const isStreaming = (body: unknown) =>\n  body !== undefined && typeof body !== \"string\" && !ArrayBuffer.isView(body) && !isArrayBuffer(body);\n"
  },
  {
    "path": "packages/middleware-compression/src/resolveCompressionConfig.spec.ts",
    "content": "import { describe, expect, test as it, vi } from \"vitest\";\n\nimport { resolveCompressionConfig } from \"./resolveCompressionConfig\";\n\ndescribe(resolveCompressionConfig.name, () => {\n  const mockConfig = {\n    bodyLengthChecker: vi.fn(),\n    disableRequestCompression: false,\n    requestMinCompressionSizeBytes: 0,\n  };\n\n  it(\"maintains object custody\", () => {\n    const input = {\n      disableRequestCompression: false,\n      requestMinCompressionSizeBytes: 10_000,\n    };\n    expect(resolveCompressionConfig(input)).toBe(input);\n  });\n\n  it(\"should throw an error if requestMinCompressionSizeBytes is less than 0\", async () => {\n    const requestMinCompressionSizeBytes = -1;\n    const resolvedConfig = resolveCompressionConfig({ ...mockConfig, requestMinCompressionSizeBytes });\n    await expect(resolvedConfig.requestMinCompressionSizeBytes()).rejects.toThrow(\n      new RangeError(\n        \"The value for requestMinCompressionSizeBytes must be between 0 and 10485760 inclusive. \" +\n          `The provided value ${requestMinCompressionSizeBytes} is outside this range.\"`\n      )\n    );\n  });\n\n  it(\"should throw an error if requestMinCompressionSizeBytes is greater than 10485760\", async () => {\n    const requestMinCompressionSizeBytes = 10485761;\n    const resolvedConfig = resolveCompressionConfig({ ...mockConfig, requestMinCompressionSizeBytes });\n    await expect(resolvedConfig.requestMinCompressionSizeBytes()).rejects.toThrow(\n      new RangeError(\n        \"The value for requestMinCompressionSizeBytes must be between 0 and 10485760 inclusive. \" +\n          `The provided value ${requestMinCompressionSizeBytes} is outside this range.\"`\n      )\n    );\n  });\n\n  it.each([0, 10240, 10485760])(\n    \"returns requestMinCompressionSizeBytes value %s\",\n    async (requestMinCompressionSizeBytes) => {\n      const inputConfig = { ...mockConfig, requestMinCompressionSizeBytes };\n      const resolvedConfig = resolveCompressionConfig(inputConfig);\n      await expect(resolvedConfig.requestMinCompressionSizeBytes()).resolves.toEqual(requestMinCompressionSizeBytes);\n    }\n  );\n\n  it.each([false, true])(\"returns disableRequestCompression value %s\", async (disableRequestCompression) => {\n    const inputConfig = { ...mockConfig, disableRequestCompression };\n    const resolvedConfig = resolveCompressionConfig(inputConfig);\n    await expect(resolvedConfig.disableRequestCompression()).resolves.toEqual(disableRequestCompression);\n  });\n});\n"
  },
  {
    "path": "packages/middleware-compression/src/resolveCompressionConfig.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\n\nimport type { CompressionInputConfig, CompressionResolvedConfig } from \"./configurations\";\n\n/**\n * @internal\n */\nexport const resolveCompressionConfig = <T>(\n  input: T & Required<CompressionInputConfig>\n): T & CompressionResolvedConfig => {\n  const { disableRequestCompression, requestMinCompressionSizeBytes: _requestMinCompressionSizeBytes } = input;\n  return Object.assign(input, {\n    disableRequestCompression: normalizeProvider(disableRequestCompression),\n    requestMinCompressionSizeBytes: async () => {\n      const requestMinCompressionSizeBytes = await normalizeProvider(_requestMinCompressionSizeBytes)();\n\n      // The requestMinCompressionSizeBytes should be less than the upper limit for API Gateway\n      // https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html\n      if (requestMinCompressionSizeBytes < 0 || requestMinCompressionSizeBytes > 10485760) {\n        throw new RangeError(\n          \"The value for requestMinCompressionSizeBytes must be between 0 and 10485760 inclusive. \" +\n            `The provided value ${requestMinCompressionSizeBytes} is outside this range.\"`\n        );\n      }\n\n      return requestMinCompressionSizeBytes;\n    },\n  });\n};\n"
  },
  {
    "path": "packages/middleware-compression/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-compression/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-compression/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-compression/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\n  export default defineConfig({\n    test: {\n      exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n      include: [\"**/*.spec.ts\"],\n      environment: \"node\",\n      \n    },\n  });\n  "
  },
  {
    "path": "packages/middleware-content-length/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/middleware-content-length/CHANGELOG.md",
    "content": "# @smithy/middleware-content-length\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/middleware-content-length/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/middleware-content-length/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-content-length\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-content-length\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-content-length\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-content-length/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/protocols instead. */\nexport {\n  contentLengthMiddleware,\n  contentLengthMiddlewareOptions,\n  getContentLengthPlugin,\n} from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/middleware-content-length/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-content-length/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-content-length/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-endpoint/CHANGELOG.md",
    "content": "# @smithy/middleware-endpoint\n\n## 4.5.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.5.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.5.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- 9194e9f: consolidate into core/endpoints\n- 62fed78: package consolidation for core/config\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/middleware-endpoint/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/middleware-endpoint/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-endpoint\",\n  \"version\": \"4.5.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-endpoint\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-endpoint\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-endpoint/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/endpoints instead. */\nexport {\n  getEndpointFromInstructions,\n  resolveParams,\n  toEndpointV1,\n  endpointMiddleware,\n  endpointMiddlewareOptions,\n  getEndpointPlugin,\n  resolveEndpointConfig,\n  resolveEndpointRequiredConfig,\n} from \"@smithy/core/endpoints\";\nexport type {\n  EndpointInputConfig,\n  EndpointResolvedConfig,\n  EndpointRequiredInputConfig,\n  EndpointRequiredResolvedConfig,\n  EndpointParameterInstructions,\n  EndpointParameterInstructionsSupplier,\n  BuiltInParamInstruction,\n  ClientContextParamInstruction,\n  ContextParamInstruction,\n  OperationContextParamInstruction,\n  StaticContextParamInstruction,\n} from \"@smithy/core/endpoints\";\n"
  },
  {
    "path": "packages/middleware-endpoint/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-endpoint/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-endpoint/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-retry/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/middleware-retry/CHANGELOG.md",
    "content": "# @smithy/middleware-retry\n\n## 4.6.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.6.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.6.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.6.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- 62fed78: package consolidation for core/config\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/middleware-retry/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/middleware-retry/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-retry\",\n  \"version\": \"4.6.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-retry\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-retry\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-retry/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/retry instead. */\nexport {\n  DeprecatedAdaptiveRetryStrategy as AdaptiveRetryStrategy,\n  DeprecatedStandardRetryStrategy as StandardRetryStrategy,\n  CONFIG_MAX_ATTEMPTS,\n  CONFIG_RETRY_MODE,\n  ENV_MAX_ATTEMPTS,\n  ENV_RETRY_MODE,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  NODE_RETRY_MODE_CONFIG_OPTIONS,\n  defaultDelayDecider,\n  defaultRetryDecider,\n  getOmitRetryHeadersPlugin,\n  getRetryAfterHint,\n  getRetryPlugin,\n  omitRetryHeadersMiddleware,\n  omitRetryHeadersMiddlewareOptions,\n  resolveRetryConfig,\n  retryMiddleware,\n  retryMiddlewareOptions,\n} from \"@smithy/core/retry\";\nexport type {\n  DeprecatedAdaptiveRetryStrategyOptions as AdaptiveRetryStrategyOptions,\n  DeprecatedStandardRetryStrategyOptions as StandardRetryStrategyOptions,\n  RetryInputConfig,\n  RetryResolvedConfig,\n  PreviouslyResolved,\n} from \"@smithy/core/retry\";\n"
  },
  {
    "path": "packages/middleware-retry/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-retry/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-retry/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-serde/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/middleware-serde/CHANGELOG.md",
    "content": "# @smithy/middleware-serde\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/middleware-serde/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/middleware-serde/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-serde\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-serde\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-serde\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-serde/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport {\n  deserializerMiddleware,\n  deserializerMiddlewareOption,\n  serializerMiddlewareOption,\n  type V1OrV2Endpoint,\n  getSerdePlugin,\n  serializerMiddleware,\n} from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/middleware-serde/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-serde/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-serde/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-stack/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/middleware-stack/CHANGELOG.md",
    "content": "# @smithy/middleware-stack\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/middleware-stack/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/middleware-stack/package.json",
    "content": "{\n  \"name\": \"@smithy/middleware-stack\",\n  \"version\": \"4.3.3\",\n  \"description\": \"Provides a means for composing multiple middleware functions into a single handler\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"email\": \"\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/middleware-stack\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/middleware-stack\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/middleware-stack/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/client instead. */\nexport { constructStack } from \"@smithy/core/client\";\n"
  },
  {
    "path": "packages/middleware-stack/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-stack/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/middleware-stack/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-config-provider/CHANGELOG.md",
    "content": "# @smithy/node-config-provider\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/node-config-provider/LICENSE",
    "content": "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 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/node-config-provider/package.json",
    "content": "{\n  \"name\": \"@smithy/node-config-provider\",\n  \"version\": \"4.4.3\",\n  \"description\": \"Load config default values from ini config files and environmental variable\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"email\": \"\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/node-config-provider\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/node-config-provider\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/node-config-provider/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport {\n  loadConfig,\n  type LocalConfigOptions,\n  type LoadedConfigSelectors,\n  type NodeSharedConfigInit as SharedConfigInit,\n} from \"@smithy/core/config\";\nexport type { EnvOptions, GetterFromEnv } from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/node-config-provider/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-config-provider/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-config-provider/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-http-handler/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/node-http-handler/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.7.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 4.7.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.7.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.7.0\n\n### Minor Changes\n\n- 9194e9f: consolidate into core/endpoints\n\n### Patch Changes\n\n- da4e89e: Avoid array allocation in header transform\n- 5329323: Remove empty object allocation in hot paths\n- 09093fb: Support passing options through to Node's http2.connect\n- 75603d4: Replace timeouts array with individual variables\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 4.6.1\n\n### Patch Changes\n\n- 769ed47: update http2 session closure to prefer session.close() on goaway rather than immediately invoking session.destroy()\n\n## 4.6.0\n\n### Minor Changes\n\n- 60d13c8: adds ref-counting logic for http2 sessions in the client connection pool.\n\n## 4.5.3\n\n### Patch Changes\n\n- 131fce4: add eventStream indicator signal for NodeHttp2ConnectionManager so it does not reuse connections for event streams\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/protocol-http@5.3.14\n  - @smithy/querystring-builder@4.2.14\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/protocol-http@5.3.13\n  - @smithy/querystring-builder@4.2.13\n\n## 4.5.1\n\n### Patch Changes\n\n- fac1a34: Move `@smithy/abort-controller` to devDeps\n\n## 4.5.0\n\n### Minor Changes\n\n- 4e7fa38: defer loading of node:http module\n\n## 4.4.16\n\n### Patch Changes\n\n- dab22f1: fix: do not return caller's Error directly from buildAbortError\n\n  Always create a new mutable Error when the abort reason is an Error, preserving the original via `.cause`. Fixes TypeError when retry middleware tries to set `$metadata` on a frozen/sealed abort reason.\n\n## 4.4.15\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/abort-controller@4.2.12\n  - @smithy/protocol-http@5.3.12\n  - @smithy/querystring-builder@4.2.12\n\n## 4.4.14\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/querystring-builder@4.2.11\n  - @smithy/abort-controller@4.2.11\n  - @smithy/protocol-http@5.3.11\n\n## 4.4.13\n\n### Patch Changes\n\n- 9bf9ae2: fix: reject aborted requests with AbortSignal.reason instead of a generic Error\n\n## 4.4.12\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/abort-controller@4.2.10\n  - @smithy/protocol-http@5.3.10\n  - @smithy/querystring-builder@4.2.10\n\n## 4.4.11\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/abort-controller@4.2.9\n  - @smithy/protocol-http@5.3.9\n  - @smithy/querystring-builder@4.2.9\n  - @smithy/types@4.12.1\n\n## 4.4.10\n\n### Patch Changes\n\n- f6f0de9: write request.end() with no arg if empty buffer\n\n## 4.4.9\n\n### Patch Changes\n\n- 3ee4e66: Use configured logger when provided.\n\n## 4.4.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/abort-controller@4.2.8\n  - @smithy/protocol-http@5.3.8\n  - @smithy/querystring-builder@4.2.8\n\n## 4.4.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/abort-controller@4.2.7\n  - @smithy/protocol-http@5.3.7\n  - @smithy/querystring-builder@4.2.7\n\n## 4.4.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/abort-controller@4.2.6\n  - @smithy/protocol-http@5.3.6\n  - @smithy/querystring-builder@4.2.6\n\n## 4.4.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/abort-controller@4.2.5\n  - @smithy/protocol-http@5.3.5\n  - @smithy/querystring-builder@4.2.5\n\n## 4.4.4\n\n### Patch Changes\n\n- df00095: skip body write delay when http Agent is externally owned\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/abort-controller@4.2.4\n  - @smithy/protocol-http@5.3.4\n  - @smithy/querystring-builder@4.2.4\n\n## 4.4.3\n\n### Patch Changes\n\n- 344d06a: shfit http1 calls with expect 100-continue header to isolated http Agents\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/abort-controller@4.2.3\n  - @smithy/protocol-http@5.3.3\n  - @smithy/querystring-builder@4.2.3\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/abort-controller@4.2.2\n  - @smithy/protocol-http@5.3.2\n  - @smithy/querystring-builder@4.2.2\n\n## 4.4.0\n\n### Minor Changes\n\n- 761d89c: undeprecate socketTimeout for node:https requests\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/abort-controller@4.2.1\n  - @smithy/protocol-http@5.3.1\n  - @smithy/querystring-builder@4.2.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/abort-controller@4.2.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/querystring-builder@4.2.0\n  - @smithy/types@4.6.0\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/abort-controller@4.1.1\n  - @smithy/protocol-http@5.2.1\n  - @smithy/querystring-builder@4.1.1\n\n## 4.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/querystring-builder@4.1.0\n  - @smithy/abort-controller@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/types@4.4.0\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/abort-controller@4.0.5\n  - @smithy/protocol-http@5.1.3\n  - @smithy/querystring-builder@4.0.5\n\n## 4.1.0\n\n### Minor Changes\n\n- c4e923a: per-request timeouts support\n\n## 4.0.6\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/abort-controller@4.0.4\n  - @smithy/protocol-http@5.1.2\n  - @smithy/querystring-builder@4.0.4\n\n## 4.0.5\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/abort-controller@4.0.3\n  - @smithy/protocol-http@5.1.1\n  - @smithy/querystring-builder@4.0.3\n\n## 4.0.4\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n  - @smithy/abort-controller@4.0.2\n  - @smithy/querystring-builder@4.0.2\n\n## 4.0.3\n\n### Patch Changes\n\n- 54d2416: Fix constructor socketAcquisitionWarningTimeout does not work\n- fba050c: Clear obsolete timeout handlers from socket.\n\n## 4.0.2\n\n### Patch Changes\n\n- fbd06eb: fix sending request when 100 Continue response takes more than 1 second\n\n## 4.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/abort-controller@4.0.1\n  - @smithy/protocol-http@5.0.1\n  - @smithy/querystring-builder@4.0.1\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/abort-controller@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/querystring-builder@4.0.0\n  - @smithy/types@4.0.0\n\n## 3.3.3\n\n### Patch Changes\n\n- 5e73108: fix delayed calling of setTimeout on requests\n\n## 3.3.2\n\n### Patch Changes\n\n- f4e1a45: skip sending body without waiting for a timeout on response, if \"expect\" request header with \"100-continue\" is provided\n- a257792: Added context binding to the setTimeout and clearTimeout functions\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/abort-controller@3.1.9\n  - @smithy/protocol-http@4.1.8\n  - @smithy/querystring-builder@3.0.11\n\n## 3.3.1\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/abort-controller@3.1.8\n  - @smithy/protocol-http@4.1.7\n  - @smithy/querystring-builder@3.0.10\n\n## 3.3.0\n\n### Minor Changes\n\n- cd1929b: vitest compatibility\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/abort-controller@3.1.7\n  - @smithy/protocol-http@4.1.6\n  - @smithy/querystring-builder@3.0.9\n\n## 3.2.5\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/abort-controller@3.1.6\n  - @smithy/protocol-http@4.1.5\n  - @smithy/querystring-builder@3.0.8\n\n## 3.2.4\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/abort-controller@3.1.5\n  - @smithy/protocol-http@4.1.4\n  - @smithy/querystring-builder@3.0.7\n\n## 3.2.3\n\n### Patch Changes\n\n- 08fbedf: remove brackets from hostname\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/abort-controller@3.1.4\n  - @smithy/protocol-http@4.1.3\n  - @smithy/querystring-builder@3.0.6\n\n## 3.2.1\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/abort-controller@3.1.3\n  - @smithy/protocol-http@4.1.2\n  - @smithy/querystring-builder@3.0.5\n\n## 3.2.0\n\n### Minor Changes\n\n- c86a02c: defer socket event listeners for node:http\n\n### Patch Changes\n\n- 5510e83: call socket operations if socket is present in deferred listeners\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/abort-controller@3.1.2\n  - @smithy/protocol-http@4.1.1\n  - @smithy/querystring-builder@3.0.4\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n\n## 3.1.2\n\n### Patch Changes\n\n- f31cc5f: remove abort signal event listeners after request completion\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/abort-controller@3.1.1\n  - @smithy/protocol-http@4.0.3\n  - @smithy/querystring-builder@3.0.3\n\n## 3.1.0\n\n### Minor Changes\n\n- c16e014: add logger option to node-http-handler parameters, clear socket usage check timeout on error\n- c2a5595: use platform AbortController|AbortSignal implementations\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/abort-controller@3.1.0\n  - @smithy/protocol-http@4.0.2\n  - @smithy/querystring-builder@3.0.2\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/abort-controller@3.0.1\n  - @smithy/protocol-http@4.0.1\n  - @smithy/querystring-builder@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Minor Changes\n\n- 3500f341: handle web streams in streamCollector and sdkStreamMixin\n\n### Patch Changes\n\n- e76e736b: improve stream collection speed\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/querystring-builder@3.0.0\n  - @smithy/abort-controller@3.0.0\n  - @smithy/protocol-http@4.0.0\n\n## 2.5.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/querystring-builder@2.2.0\n  - @smithy/abort-controller@2.2.0\n  - @smithy/protocol-http@3.3.0\n  - @smithy/types@2.12.0\n\n## 2.4.3\n\n### Patch Changes\n\n- 511206e5: reduce buffer copies\n\n## 2.4.2\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/abort-controller@2.1.4\n  - @smithy/protocol-http@3.2.2\n  - @smithy/querystring-builder@2.1.4\n\n## 2.4.1\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/abort-controller@2.1.3\n  - @smithy/protocol-http@3.2.1\n  - @smithy/querystring-builder@2.1.3\n\n## 2.4.0\n\n### Minor Changes\n\n- d70a00ac: allow ctor args in lieu of Agent instances in node-http-handler ctor\n- 1e23f967: add socket exhaustion checked warning to node-http-handler\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n  - @smithy/abort-controller@2.1.2\n  - @smithy/querystring-builder@2.1.2\n\n## 2.3.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/abort-controller@2.1.1\n  - @smithy/protocol-http@3.1.1\n  - @smithy/querystring-builder@2.1.1\n  - @smithy/types@2.9.1\n\n## 2.3.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/querystring-builder@2.1.0\n  - @smithy/abort-controller@2.1.0\n  - @smithy/protocol-http@3.1.0\n  - @smithy/types@2.9.0\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/abort-controller@2.0.16\n  - @smithy/protocol-http@3.0.12\n  - @smithy/querystring-builder@2.0.16\n\n## 2.2.1\n\n### Patch Changes\n\n- e2e3f7d5: align ctor and static creation signatures for http handlers\n\n## 2.2.0\n\n### Minor Changes\n\n- 340634a5: move default fetch and http handler ctor types to the types package\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/abort-controller@2.0.15\n  - @smithy/protocol-http@3.0.11\n  - @smithy/querystring-builder@2.0.15\n\n## 2.1.10\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/abort-controller@2.0.14\n  - @smithy/protocol-http@3.0.10\n  - @smithy/querystring-builder@2.0.14\n\n## 2.1.9\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/abort-controller@2.0.13\n  - @smithy/protocol-http@3.0.9\n  - @smithy/querystring-builder@2.0.13\n\n## 2.1.8\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/abort-controller@2.0.12\n  - @smithy/protocol-http@3.0.8\n  - @smithy/querystring-builder@2.0.12\n\n## 2.1.7\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/abort-controller@2.0.11\n  - @smithy/protocol-http@3.0.7\n  - @smithy/querystring-builder@2.0.11\n\n## 2.1.6\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/abort-controller@2.0.10\n  - @smithy/protocol-http@3.0.6\n  - @smithy/querystring-builder@2.0.10\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/abort-controller@2.0.9\n  - @smithy/protocol-http@3.0.5\n  - @smithy/querystring-builder@2.0.9\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/abort-controller@2.0.8\n  - @smithy/protocol-http@3.0.4\n  - @smithy/querystring-builder@2.0.8\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/abort-controller@2.0.7\n  - @smithy/protocol-http@3.0.3\n  - @smithy/querystring-builder@2.0.7\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n\n## 2.1.0\n\n### Minor Changes\n\n- a03026e3: Add http client component to runtime extension\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n  - @smithy/abort-controller@2.0.6\n  - @smithy/querystring-builder@2.0.6\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/abort-controller@2.0.5\n  - @smithy/protocol-http@2.0.5\n  - @smithy/querystring-builder@2.0.5\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/abort-controller@2.0.4\n  - @smithy/protocol-http@2.0.4\n  - @smithy/querystring-builder@2.0.4\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/abort-controller@2.0.3\n  - @smithy/protocol-http@2.0.3\n  - @smithy/querystring-builder@2.0.3\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/abort-controller@2.0.2\n  - @smithy/protocol-http@2.0.2\n  - @smithy/querystring-builder@2.0.2\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/abort-controller@2.0.1\n  - @smithy/protocol-http@2.0.1\n  - @smithy/querystring-builder@2.0.1\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/abort-controller@2.0.0\n  - @smithy/protocol-http@2.0.0\n  - @smithy/querystring-builder@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/abort-controller@1.1.0\n  - @smithy/protocol-http@1.2.0\n  - @smithy/querystring-builder@1.1.0\n  - @smithy/types@1.2.0\n\n## 1.0.4\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/abort-controller@1.0.3\n  - @smithy/protocol-http@1.1.2\n  - @smithy/querystring-builder@1.0.3\n\n## 1.0.3\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/querystring-builder@1.0.2\n  - @smithy/abort-controller@1.0.2\n  - @smithy/protocol-http@1.1.1\n  - @smithy/types@1.1.1\n\n## 1.0.2\n\n### Patch Changes\n\n- e051b157: Rejoin main promise when error is thrown in writeRequestBody\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/querystring-builder@1.0.1\n  - @smithy/abort-controller@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/node-http-handler](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/node-http-handler/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/node-http-handler/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/node-http-handler/README.md",
    "content": "# @smithy/node-http-handler\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/node-http-handler/latest.svg)](https://www.npmjs.com/package/@smithy/node-http-handler)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/node-http-handler.svg)](https://www.npmjs.com/package/@smithy/node-http-handler)\n\nThis package implements the default `requestHandler` for Node.js using `node:http`, `node:https`, and `node:http2`.\n\nFor an example on how `requestHandler`s are used by Smithy generated SDK clients, refer to\nthe [AWS SDK for JavaScript (v3) supplemental docs](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md#request-handler-requesthandler).\n"
  },
  {
    "path": "packages/node-http-handler/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/node-http-handler/fixtures/test-server-cert.pem",
    "content": "-----BEGIN CERTIFICATE-----\nMIIEWjCCAkICCQDK848c0wG7ajANBgkqhkiG9w0BAQsFADBvMQswCQYDVQQGEwJV\nUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTElMCMGA1UE\nCgwcTWVzc2FnZSBWYWxpZGF0b3IgVW5pdCBUZXN0czESMBAGA1UEAwwJbG9jYWxo\nb3N0MB4XDTE3MDYyMzAxMTQzOFoXDTIzMDEzMTAxMTQzOFowbzELMAkGA1UEBhMC\nVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxJTAjBgNV\nBAoMHE1lc3NhZ2UgVmFsaWRhdG9yIFVuaXQgVGVzdHMxEjAQBgNVBAMMCWxvY2Fs\naG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANknobw2ZghFY9yE\nOrk5dSlW2giIk2Sb/0GajCX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nz+WEUGJ+XQxP2bsZsfUbSsBqYOYSqqGVJaBsIXR4s+iB27l/XAKDuPsYr\neYH7HbDf6afxEz5Bbf2E8ZvEZQ0M+UrPRB75IOmvAoGBAL5G2IJWCD7IuPY+I9IS\npI5tBAZGVez/kWmV33t2Ib9nlaBGaEAXNli2Dqxdm3N7pdbE2LB244RHb26L7Yeb\nIm4FdpKcPphKJVcTI4lKQNZ0wfWbwKfaUTH07dfTPCmU4QBxY/RS/P6X5wrMzt4V\nWxExvZPhYyDNGBvj3S2QvBCJAoGBAIZmKjM2TbMhKYUIiNiYEHkH1syhtBpLMD4o\nULboDTllbwDm9CG/1rhzbdRjHjVFqvM1+zt5vkeJlT0TN3ee40D5krq8CCj0iDNt\nn40OUvfEslEUK42g5cIekimVcnlZp7zhiLkYsfAxzSvX6P62/9N1+1OUlahG2OD4\nTxGFGiNlAoGAE6S7R3GJyBUrgEd7ViOFGYkArmZnYgEvGgZ8IuS17BXFZdENdzjz\nb78WsPgxyRSMttKnmcDEErdtfVNyS2tFNSfTRpHHFxM8x2Ot/mw0krUSpXzMGc1s\ni6TltbVl1gSrhE1P8Kpuw4farJaP8M6P5UMU/HpPCO38EmnvKvxdTgA=\n-----END RSA PRIVATE KEY-----\n"
  },
  {
    "path": "packages/node-http-handler/package.json",
    "content": "{\n  \"name\": \"@smithy/node-http-handler\",\n  \"version\": \"4.7.3\",\n  \"description\": \"Provides a way to make requests\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline node-http-handler\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"email\": \"\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@smithy/abort-controller\": \"workspace:^\",\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/node-http-handler\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/node-http-handler\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/build-abort-error.ts",
    "content": "/**\n * Builds an abort error, using the AbortSignal's reason if available.\n *\n * @param abortSignal - Optional AbortSignal that may contain a reason.\n * @returns A new Error with name \"AbortError\". If the signal has a reason that's\n *          already an Error, the reason is set as `cause`. Otherwise creates a\n *          new Error with the reason as the message, or \"Request aborted\" if no\n *          reason.\n */\nexport function buildAbortError(abortSignal?: unknown): Error {\n  const reason =\n    abortSignal && typeof abortSignal === \"object\" && \"reason\" in abortSignal\n      ? (abortSignal as { reason?: unknown }).reason\n      : undefined;\n  if (reason) {\n    if (reason instanceof Error) {\n      const abortError = new Error(\"Request aborted\");\n      abortError.name = \"AbortError\";\n      (abortError as { cause?: unknown }).cause = reason;\n      return abortError;\n    }\n    const abortError = new Error(String(reason));\n    abortError.name = \"AbortError\";\n    return abortError;\n  }\n  const abortError = new Error(\"Request aborted\");\n  abortError.name = \"AbortError\";\n  return abortError;\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/constants.ts",
    "content": "/**\n * Node.js system error codes that indicate timeout.\n * @deprecated use NODEJS_TIMEOUT_ERROR_CODES from @smithy/service-error-classification/constants\n */\nexport const NODEJS_TIMEOUT_ERROR_CODES = [\"ECONNRESET\", \"EPIPE\", \"ETIMEDOUT\"];\n"
  },
  {
    "path": "packages/node-http-handler/src/get-transformed-headers.ts",
    "content": "import type { IncomingHttpHeaders } from \"node:http2\";\nimport type { HeaderBag } from \"@smithy/types\";\n\nconst getTransformedHeaders = (headers: IncomingHttpHeaders) => {\n  const transformedHeaders: HeaderBag = {};\n\n  for (const name in headers) {\n    const headerValues = <string>headers[name];\n    transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(\",\") : headerValues;\n  }\n\n  return transformedHeaders;\n};\n\nexport { getTransformedHeaders };\n"
  },
  {
    "path": "packages/node-http-handler/src/http2/ClientHttp2SessionRef.spec.ts",
    "content": "import type { ClientHttp2Session } from \"node:http2\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { ClientHttp2SessionRef } from \"./ClientHttp2SessionRef\";\n\nconst createMockSession = (destroyed = false) => {\n  const session = {\n    ref: vi.fn(),\n    unref: vi.fn(),\n    destroy: vi.fn(() => {\n      (session as any).destroyed = true;\n    }),\n    destroyed,\n  } as unknown as ClientHttp2Session;\n  return session;\n};\n\ndescribe(ClientHttp2SessionRef.name, () => {\n  it(\"calls unref on the session at the start of object lifecycle\", () => {\n    const session = createMockSession();\n    new ClientHttp2SessionRef(session);\n    expect(session.unref).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"retain() calls ref on the session\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    ref.retain();\n    expect(session.ref).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"retain() throws if session is destroyed\", () => {\n    const session = createMockSession(true);\n    const ref = new ClientHttp2SessionRef(session);\n    expect(() => ref.retain()).toThrow(\"cannot acquire reference to destroyed session\");\n  });\n\n  it(\"deref() returns the session without ref-counting\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    expect(ref.deref()).toBe(session);\n    expect(session.ref).not.toHaveBeenCalled();\n  });\n\n  it(\"free() calls unref when refcount reaches zero\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    ref.retain();\n    // 1 from constructor\n    expect(session.unref).toHaveBeenCalledTimes(1);\n    ref.free();\n    // 1 from constructor + 1 from free reaching zero\n    expect(session.unref).toHaveBeenCalledTimes(2);\n  });\n\n  it(\"free() does not call unref when refcount is still positive\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    ref.retain();\n    ref.retain();\n    ref.free(); // refcount 2 -> 1\n    // only constructor unref\n    expect(session.unref).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"free() throws when refcount goes below zero\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    expect(() => ref.free()).toThrow(\"refcount at zero, cannot decrement\");\n  });\n\n  it(\"free() is a no-op on destroyed session\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    ref.retain();\n    ref.destroy();\n    // should not throw\n    ref.free();\n  });\n\n  it(\"destroy() destroys the session and resets refcount\", () => {\n    const session = createMockSession();\n    const ref = new ClientHttp2SessionRef(session);\n    ref.retain();\n    ref.destroy();\n    expect(session.destroy).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"destroy() is safe to call on already-destroyed session\", () => {\n    const session = createMockSession(true);\n    const ref = new ClientHttp2SessionRef(session);\n    ref.destroy();\n    expect(session.destroy).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/http2/ClientHttp2SessionRef.ts",
    "content": "import type { ClientHttp2Session } from \"node:http2\";\n\nconst ids = new Uint16Array(1);\n\n/**\n * Shared access ref counter for ClientHttp2Session, where owners are\n * in-flight requests.\n *\n * @internal\n * @since 4.6.0\n */\nexport class ClientHttp2SessionRef {\n  // debug information\n  public readonly id = ids[0]++;\n  /**\n   * Total calls to retain for this session.\n   */\n  public total = 0;\n  /**\n   * Max ref count observed.\n   */\n  public max = 0;\n\n  private readonly session: ClientHttp2Session;\n  private refs = 0;\n\n  public constructor(session: ClientHttp2Session) {\n    // The session starts in unref state.\n    // The start of the request (call to retain) will bring it into ref state.\n    session.unref();\n    this.session = session;\n  }\n\n  /**\n   * Signal that the session is entering a request span and has an additional owning request.\n   * This must be called when beginning a request using the session.\n   */\n  public retain(): void {\n    if (this.session.destroyed) {\n      throw new Error(\"@smithy/node-http-handler - cannot acquire reference to destroyed session.\");\n    }\n    this.refs += 1;\n    this.total += 1;\n\n    this.max = Math.max(this.refs, this.max);\n    this.session.ref();\n  }\n\n  /**\n   * Release reference to session, to be called when it exits request span, indicating one fewer owning request.\n   * When reaching zero, the session is unref'd.\n   * This must be called when concluding a request using the session.\n   */\n  public free(): void {\n    if (this.session.destroyed) {\n      return;\n    }\n    this.refs -= 1;\n    if (this.refs === 0) {\n      this.session.unref();\n    }\n    if (this.refs < 0) {\n      throw new Error(\"@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.\");\n    }\n  }\n\n  /**\n   * Access the session (don't call ref/unref on it).\n   */\n  public deref(): ClientHttp2Session {\n    return this.session;\n  }\n\n  /**\n   * Allow open refs to free on their own.\n   */\n  public close(): void {\n    if (!this.session.closed) {\n      this.session.close();\n    }\n  }\n\n  public destroy(): void {\n    this.refs = 0;\n    if (!this.session.destroyed) {\n      this.session.destroy();\n    }\n  }\n\n  /**\n   * @returns the current number of active references (in-flight requests).\n   */\n  public useCount(): number {\n    return this.refs;\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/index.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { NodeHttpHandler } from \"./index\";\n\ndescribe(\"index\", () => {\n  it(\"exports NodeHttpHandler\", () => {\n    expect(typeof NodeHttpHandler).toBe(\"function\");\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/index.ts",
    "content": "export * from \"./node-http-handler\";\nexport * from \"./node-http2-handler\";\nexport * from \"./stream-collector\";\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http-handler.mock-server.spec.ts",
    "content": "import http, { request as hRequest, type Server as HttpServer } from \"node:http\";\nimport https, { request as hsRequest, type Server as HttpsServer } from \"node:https\";\nimport type { AddressInfo } from \"node:net\";\nimport { AbortController as AbortControllerPolyfill } from \"@smithy/abort-controller\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport { afterAll, afterEach, beforeAll, describe, expect, test as it, vi } from \"vitest\";\n\nimport { NodeHttpHandler } from \"./node-http-handler\";\nimport { ReadFromBuffers } from \"./readable.mock\";\nimport {\n  createContinueResponseFunction,\n  createMirrorResponseFunction,\n  createMockHttpServer,\n  createMockHttpsServer,\n  createResponseFunction,\n  getResponseBody,\n} from \"./server.mock\";\n\nvi.mock(\"http\", async () => {\n  const actual = (await vi.importActual(\"http\")) as any;\n  const pkg = {\n    ...actual,\n    request: vi.fn().mockImplementation(actual.request),\n  };\n  return {\n    ...pkg,\n    default: pkg,\n  };\n});\n\nvi.mock(\"https\", async () => {\n  const actual = (await vi.importActual(\"https\")) as any;\n  const pkg = {\n    ...actual,\n    request: vi.fn().mockImplementation(actual.request),\n  };\n  return {\n    ...pkg,\n    default: pkg,\n  };\n});\n\ndescribe(\"http\", () => {\n  let mockHttpServer: HttpServer;\n  beforeAll(() => {\n    mockHttpServer = createMockHttpServer().listen(54321);\n  });\n\n  afterEach(() => {\n    mockHttpServer.removeAllListeners(\"request\");\n    mockHttpServer.removeAllListeners(\"checkContinue\");\n  });\n\n  afterAll(() => {\n    mockHttpServer.close();\n  });\n\n  it(\"has metadata\", () => {\n    const nodeHttpHandler = new NodeHttpHandler();\n    expect(nodeHttpHandler.metadata.handlerProtocol).toContain(\"http/1.1\");\n  });\n\n  it(\"can send http requests\", async () => {\n    const mockResponse = {\n      statusCode: 200,\n      reason: \"OK\",\n      headers: {},\n      body: \"test\",\n    };\n    mockHttpServer.addListener(\"request\", createResponseFunction(mockResponse));\n    const nodeHttpHandler = new NodeHttpHandler();\n\n    const { response } = await nodeHttpHandler.handle(\n      new HttpRequest({\n        hostname: \"localhost\",\n        method: \"GET\",\n        port: (mockHttpServer.address() as AddressInfo).port,\n        protocol: \"http:\",\n        path: \"/\",\n        headers: {},\n      }),\n      {}\n    );\n\n    expect(response.statusCode).toEqual(mockResponse.statusCode);\n    expect(response.reason).toEqual(mockResponse.reason);\n    expect(response.headers).toBeDefined();\n    expect(response.headers).toMatchObject(mockResponse.headers);\n    expect(response.body).toBeDefined();\n  });\n\n  [\n    { name: \"buffer\", body: Buffer.from(\"Buffering🚀\") },\n    { name: \"uint8Array\", body: Uint8Array.from(Buffer.from(\"uint8Array 🚀\")) },\n    { name: \"string\", body: Buffer.from(\"string-test 🚀\") },\n    { name: \"uint8Array subarray\", body: Uint8Array.from(Buffer.from(\"test\")).subarray(1, 3) },\n    { name: \"buffer subarray\", body: Buffer.from(\"test\").subarray(1, 3) },\n  ].forEach(({ body, name }) => {\n    it(`can send requests with bodies ${name}`, async () => {\n      const mockResponse = {\n        statusCode: 200,\n        headers: {},\n      };\n      mockHttpServer.addListener(\"request\", createMirrorResponseFunction(mockResponse));\n      const nodeHttpHandler = new NodeHttpHandler();\n      const { response } = await nodeHttpHandler.handle(\n        new HttpRequest({\n          hostname: \"localhost\",\n          method: \"PUT\",\n          port: (mockHttpServer.address() as AddressInfo).port,\n          protocol: \"http:\",\n          path: \"/\",\n          headers: {},\n          body,\n        }),\n        {}\n      );\n\n      expect(response.statusCode).toEqual(mockResponse.statusCode);\n      expect(response.headers).toBeDefined();\n      expect(response.headers).toMatchObject(mockResponse.headers);\n      const responseBody = await getResponseBody(response);\n      expect(responseBody).toEqual(Buffer.from(body).toString());\n    });\n  });\n\n  it(\"can handle expect 100-continue\", async () => {\n    const body = Buffer.from(\"test\");\n    const mockResponse = {\n      statusCode: 200,\n      headers: {},\n    };\n\n    mockHttpServer.addListener(\"checkContinue\", createContinueResponseFunction(mockResponse));\n    let endSpy: any;\n    let continueWasTriggered = false;\n    const spy = vi.mocked(hRequest).mockImplementationOnce(() => {\n      const calls = spy.mock.calls;\n      const currentIndex = calls.length - 1;\n      const request = http.request(calls[currentIndex][0], calls[currentIndex][1]);\n      request.on(\"continue\", () => {\n        continueWasTriggered = true;\n      });\n      endSpy = vi.spyOn(request, \"end\");\n\n      return request;\n    });\n\n    const nodeHttpHandler = new NodeHttpHandler();\n    const { response } = await nodeHttpHandler.handle(\n      new HttpRequest({\n        hostname: \"localhost\",\n        method: \"PUT\",\n        port: (mockHttpServer.address() as AddressInfo).port,\n        protocol: \"http:\",\n        path: \"/\",\n        headers: {\n          Expect: \"100-continue\",\n        },\n        body,\n      }),\n      {}\n    );\n\n    expect(response.statusCode).toEqual(mockResponse.statusCode);\n    expect(response.headers).toBeDefined();\n    expect(response.headers).toMatchObject(mockResponse.headers);\n    expect(endSpy!.mock.calls.length).toBe(1);\n    expect(endSpy!.mock.calls[0][0]).toStrictEqual(body);\n    expect(continueWasTriggered).toBe(true);\n  });\n\n  it(\"can send requests with streaming bodies\", async () => {\n    const body = new ReadFromBuffers({\n      buffers: [Buffer.from(\"t\"), Buffer.from(\"e\"), Buffer.from(\"s\"), Buffer.from(\"t\")],\n    });\n    const inputBodySpy = vi.spyOn(body, \"pipe\");\n    const mockResponse = {\n      statusCode: 200,\n      headers: {},\n    };\n    mockHttpServer.addListener(\"request\", createResponseFunction(mockResponse));\n    const nodeHttpHandler = new NodeHttpHandler();\n\n    const { response } = await nodeHttpHandler.handle(\n      new HttpRequest({\n        hostname: \"localhost\",\n        method: \"PUT\",\n        port: (mockHttpServer.address() as AddressInfo).port,\n        protocol: \"http:\",\n        path: \"/\",\n        headers: {},\n        body,\n      }),\n      {}\n    );\n\n    expect(response.statusCode).toEqual(mockResponse.statusCode);\n    expect(response.headers).toBeDefined();\n    expect(response.headers).toMatchObject(mockResponse.headers);\n    expect(inputBodySpy.mock.calls.length).toBeTruthy();\n  });\n\n  it(\"can send requests with Uint8Array bodies\", async () => {\n    const body = Buffer.from([0, 1, 2, 3]);\n    const mockResponse = {\n      statusCode: 200,\n      headers: {},\n    };\n    mockHttpServer.addListener(\"request\", createResponseFunction(mockResponse));\n    let endSpy: any;\n    const spy = vi.mocked(hRequest).mockImplementationOnce(() => {\n      const calls = spy.mock.calls;\n      const currentIndex = calls.length - 1;\n      const request = http.request(calls[currentIndex][0], calls[currentIndex][1]);\n      endSpy = vi.spyOn(request, \"end\");\n      return request;\n    });\n\n    const nodeHttpHandler = new NodeHttpHandler();\n    const { response } = await nodeHttpHandler.handle(\n      new HttpRequest({\n        hostname: \"localhost\",\n        method: \"PUT\",\n        port: (mockHttpServer.address() as AddressInfo).port,\n        protocol: \"http:\",\n        path: \"/\",\n        headers: {},\n        body,\n      }),\n      {}\n    );\n\n    expect(response.statusCode).toEqual(mockResponse.statusCode);\n    expect(response.headers).toBeDefined();\n    expect(response.headers).toMatchObject(mockResponse.headers);\n    expect(endSpy!.mock.calls.length).toBe(1);\n    expect(endSpy!.mock.calls[0][0]).toStrictEqual(body);\n  });\n});\n\ndescribe(\"https\", () => {\n  const mockHttpsServer: HttpsServer = createMockHttpsServer().listen(54322);\n\n  afterEach(() => {\n    mockHttpsServer.removeAllListeners(\"request\");\n    mockHttpsServer.removeAllListeners(\"checkContinue\");\n  });\n\n  afterAll(() => {\n    mockHttpsServer.close();\n  });\n\n  it(\"rejects if the request encounters an error\", async () => {\n    const mockResponse = {\n      statusCode: 200,\n      headers: {},\n      body: \"test\",\n    };\n    mockHttpsServer.addListener(\"request\", createResponseFunction(mockResponse));\n    const nodeHttpHandler = new NodeHttpHandler();\n\n    await expect(\n      nodeHttpHandler.handle(\n        new HttpRequest({\n          hostname: \"localhost\",\n          method: \"GET\",\n          port: (mockHttpsServer.address() as AddressInfo).port,\n          protocol: \"fake:\", // trigger a request error\n          path: \"/\",\n          headers: {},\n        }),\n        {}\n      )\n    ).rejects.toHaveProperty(\"message\");\n  });\n\n  it(\"will not make request if already aborted\", async () => {\n    const mockResponse = {\n      statusCode: 200,\n      headers: {},\n      body: \"test\",\n    };\n    mockHttpsServer.addListener(\"request\", createResponseFunction(mockResponse));\n    const spy = vi.mocked(hsRequest).mockImplementationOnce(() => {\n      const calls = spy.mock.calls;\n      const currentIndex = calls.length - 1;\n      return https.request(calls[currentIndex][0], calls[currentIndex][1]);\n    });\n    // clear data held from previous tests\n    spy.mockClear();\n    const nodeHttpHandler = new NodeHttpHandler();\n\n    await expect(\n      nodeHttpHandler.handle(\n        new HttpRequest({\n          hostname: \"localhost\",\n          method: \"GET\",\n          port: (mockHttpsServer.address() as AddressInfo).port,\n          protocol: \"https:\",\n          path: \"/\",\n          headers: {},\n        }),\n        {\n          abortSignal: {\n            aborted: true,\n            onabort: null,\n          },\n        }\n      )\n    ).rejects.toHaveProperty(\"name\", \"AbortError\");\n\n    expect(spy.mock.calls.length).toBe(0);\n  });\n\n  it(`won't throw uncatchable error in writeRequestBody`, async () => {\n    const nodeHttpHandler = new NodeHttpHandler();\n\n    await expect(\n      nodeHttpHandler.handle(\n        new HttpRequest({\n          hostname: \"localhost\",\n          method: \"GET\",\n          port: (mockHttpsServer.address() as AddressInfo).port,\n          protocol: \"https:\",\n          path: \"/\",\n          headers: {},\n          body: {},\n        })\n      )\n    ).rejects.toHaveProperty(\"name\", \"TypeError\");\n  });\n\n  it.each([\n    { AbortController, label: \"native\" },\n    { AbortController: AbortControllerPolyfill, label: \"polyfill\" },\n  ])(\"will destroy the request when aborted ($label)\", async ({ AbortController }) => {\n    const mockResponse = {\n      statusCode: 200,\n      headers: {},\n      body: \"test\",\n    };\n    mockHttpsServer.addListener(\"request\", createResponseFunction(mockResponse));\n    let httpRequest: http.ClientRequest;\n    let reqDestroySpy: any;\n    const spy = vi.mocked(hsRequest).mockImplementationOnce(() => {\n      const calls = spy.mock.calls;\n      const currentIndex = calls.length - 1;\n      httpRequest = https.request(calls[currentIndex][0], calls[currentIndex][1]);\n      reqDestroySpy = vi.spyOn(httpRequest, \"destroy\");\n      return httpRequest;\n    });\n    const nodeHttpHandler = new NodeHttpHandler();\n    const abortController = new AbortController();\n\n    setTimeout(() => {\n      abortController.abort();\n    }, 0);\n\n    await expect(\n      nodeHttpHandler.handle(\n        new HttpRequest({\n          hostname: \"localhost\",\n          method: \"GET\",\n          port: (mockHttpsServer.address() as AddressInfo).port,\n          protocol: \"https:\",\n          path: \"/\",\n          headers: {},\n        }),\n        {\n          abortSignal: abortController.signal,\n        }\n      )\n    ).rejects.toHaveProperty(\"name\", \"AbortError\");\n\n    expect(reqDestroySpy.mock.calls.length).toBe(1);\n  });\n});\n\ndescribe(\"configs\", () => {\n  const mockResponse = {\n    statusCode: 200,\n    statusText: \"OK\",\n    headers: {},\n    body: \"test\",\n  };\n\n  let mockHttpServer: HttpServer;\n  let request: HttpRequest;\n\n  beforeAll(() => {\n    mockHttpServer = createMockHttpServer().listen(54320);\n    request = new HttpRequest({\n      hostname: \"localhost\",\n      method: \"GET\",\n      port: (mockHttpServer.address() as AddressInfo).port,\n      protocol: \"http:\",\n      path: \"/\",\n      headers: {},\n    });\n  });\n\n  afterEach(() => {\n    mockHttpServer.removeAllListeners(\"request\");\n    mockHttpServer.removeAllListeners(\"checkContinue\");\n  });\n\n  afterAll(() => {\n    mockHttpServer.close();\n  });\n\n  it(\"put HttpClientConfig\", async () => {\n    mockHttpServer.addListener(\"request\", createResponseFunction(mockResponse));\n\n    const nodeHttpHandler = new NodeHttpHandler();\n    const requestTimeout = 200;\n\n    nodeHttpHandler.updateHttpClientConfig(\"requestTimeout\", requestTimeout);\n\n    await nodeHttpHandler.handle(request, {});\n\n    expect(nodeHttpHandler.httpHandlerConfigs().requestTimeout).toEqual(requestTimeout);\n  });\n\n  it(\"update existing HttpClientConfig\", async () => {\n    mockHttpServer.addListener(\"request\", createResponseFunction(mockResponse));\n\n    const nodeHttpHandler = new NodeHttpHandler({ requestTimeout: 200 });\n    const requestTimeout = 300;\n\n    nodeHttpHandler.updateHttpClientConfig(\"requestTimeout\", requestTimeout);\n\n    await nodeHttpHandler.handle(request, {});\n\n    expect(nodeHttpHandler.httpHandlerConfigs().requestTimeout).toEqual(requestTimeout);\n  });\n\n  it(\"httpHandlerConfigs returns empty object if handle is not called\", async () => {\n    const nodeHttpHandler = new NodeHttpHandler();\n    expect(nodeHttpHandler.httpHandlerConfigs()).toEqual({});\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http-handler.spec.ts",
    "content": "import http, { request as hRequest } from \"node:http\";\nimport https, { request as hsRequest } from \"node:https\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { NodeHttpHandler } from \"./node-http-handler\";\nimport * as setConnectionTimeoutModule from \"./set-connection-timeout\";\nimport * as setRequestTimeoutModule from \"./set-request-timeout\";\nimport * as setSocketTimeoutModule from \"./set-socket-timeout\";\nimport { timing } from \"./timing\";\n\nvi.mock(\"node:http\", async () => {\n  const actual = (await vi.importActual(\"node:http\")) as any;\n  const pkg = {\n    ...actual,\n    request: vi.fn().mockImplementation((_options, cb) => {\n      cb({\n        statusCode: 200,\n        body: \"body\",\n        headers: {},\n        protocol: \"http:\",\n      });\n      return new actual.ClientRequest({ ..._options, protocol: \"http:\" });\n    }),\n  };\n  return {\n    ...pkg,\n    default: pkg,\n  };\n});\n\nvi.mock(\"node:https\", async () => {\n  const actual = (await vi.importActual(\"node:https\")) as any;\n  const http = (await vi.importActual(\"node:http\")) as any;\n  const pkg = {\n    ...actual,\n    request: vi.fn().mockImplementation((_options, cb) => {\n      cb({\n        statusCode: 200,\n        body: \"body\",\n        headers: {},\n        protocol: \"https:\",\n      });\n      return new http.ClientRequest({ ..._options, protocol: \"https:\" });\n    }),\n  };\n  return {\n    ...pkg,\n    default: pkg,\n  };\n});\n\ndescribe(\"NodeHttpHandler\", () => {\n  describe(\"constructor and #handle\", () => {\n    const randomMaxSocket = Math.round(Math.random() * 50) + 1;\n    const randomSocketAcquisitionWarningTimeout = Math.round(Math.random() * 10000) + 1;\n    const randomConnectionTimeout = Math.round(Math.random() * 10000) + 1;\n    const randomSocketTimeout = Math.round(Math.random() * 10000) + 1;\n    const randomRequestTimeout = Math.round(Math.random() * 10000) + 1;\n\n    beforeEach(() => {});\n\n    afterEach(() => {\n      vi.clearAllMocks();\n    });\n\n    describe(\"constructor\", () => {\n      it(\"allows https.Agent and http.Agent ctor args in place of actual instances\", async () => {\n        const nodeHttpHandler = new NodeHttpHandler({\n          httpAgent: { maxSockets: 37 },\n          httpsAgent: { maxSockets: 39, keepAlive: false },\n        });\n\n        await nodeHttpHandler.handle({} as any);\n\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent.maxSockets).toEqual(37);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent.keepAlive).toEqual(true);\n\n        expect((nodeHttpHandler as any).config.httpsAgent.maxSockets).toEqual(39);\n        expect((nodeHttpHandler as any).config.httpsAgent.keepAlive).toEqual(false);\n      });\n\n      it.each([\n        [\"empty\", undefined],\n        [\"a provider\", async () => {}],\n      ])(\"sets keepAlive=true by default when input is %s\", async (_, option) => {\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({} as any);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent.keepAlive).toEqual(true);\n      });\n\n      it.each([\n        [\"empty\", undefined],\n        [\"a provider\", async () => {}],\n      ])(\"sets maxSockets=50 by default when input is %s\", async (_, option) => {\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({} as any);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent.maxSockets).toEqual(50);\n      });\n\n      it.each([\n        [\"an options hash\", { socketAcquisitionWarningTimeout: randomSocketAcquisitionWarningTimeout }],\n        [\n          \"a provider\",\n          async () => ({\n            socketAcquisitionWarningTimeout: randomSocketAcquisitionWarningTimeout,\n          }),\n        ],\n      ])(\"sets socketAcquisitionWarningTimeout correctly when input is %s\", async (_, option) => {\n        vi.spyOn(timing, \"setTimeout\");\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({} as any);\n        expect(vi.mocked(timing.setTimeout).mock.calls[0][1]).toBe(randomSocketAcquisitionWarningTimeout);\n      });\n\n      it.each([\n        [\"an options hash\", { connectionTimeout: randomConnectionTimeout }],\n        [\n          \"a provider\",\n          async () => ({\n            connectionTimeout: randomConnectionTimeout,\n          }),\n        ],\n      ])(\"sets connectionTimeout correctly when input is %s\", async (_, option) => {\n        vi.spyOn(setConnectionTimeoutModule, \"setConnectionTimeout\");\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({} as any);\n        expect(vi.mocked(setConnectionTimeoutModule.setConnectionTimeout).mock.calls[0][2]).toBe(\n          randomConnectionTimeout\n        );\n      });\n\n      it.each([\n        [\"an options hash\", { requestTimeout: randomRequestTimeout }],\n        [\n          \"a provider\",\n          async () => ({\n            requestTimeout: randomRequestTimeout,\n          }),\n        ],\n      ])(\"sets requestTimeout correctly when input is %s\", async (_, option) => {\n        vi.spyOn(setRequestTimeoutModule, \"setRequestTimeout\");\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({} as any);\n        expect(vi.mocked(setRequestTimeoutModule.setRequestTimeout).mock.calls[0][2]).toBe(randomRequestTimeout);\n      });\n\n      it.each([\n        [\"an options hash\", { socketTimeout: randomSocketTimeout }],\n        [\n          \"a provider\",\n          async () => ({\n            socketTimeout: randomSocketTimeout,\n          }),\n        ],\n      ])(\"sets socketTimeout correctly when input is %s\", async (_, option) => {\n        vi.spyOn(setSocketTimeoutModule, \"setSocketTimeout\");\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({} as any);\n        expect(vi.mocked(setSocketTimeoutModule.setSocketTimeout).mock.calls[0][2]).toBe(randomSocketTimeout);\n      });\n\n      it.each([\n        [\"an options hash\", { httpAgent: new http.Agent({ keepAlive: false, maxSockets: randomMaxSocket }) }],\n        [\n          \"a provider\",\n          async () => ({\n            httpAgent: new http.Agent({ keepAlive: false, maxSockets: randomMaxSocket }),\n          }),\n        ],\n      ])(\"sets httpAgent when input is %s\", async (_, option) => {\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({ protocol: \"http:\", headers: {}, method: \"GET\", hostname: \"localhost\" } as any);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent.keepAlive).toEqual(false);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent.maxSockets).toEqual(randomMaxSocket);\n      });\n\n      it.each([\n        [\"an option hash\", { httpsAgent: new https.Agent({ keepAlive: true, maxSockets: randomMaxSocket }) }],\n        [\n          \"a provider\",\n          async () => ({\n            httpsAgent: new https.Agent({ keepAlive: true, maxSockets: randomMaxSocket }),\n          }),\n        ],\n      ])(\"sets httpsAgent when input is %s\", async (_, option) => {\n        const nodeHttpHandler = new NodeHttpHandler(option);\n        await nodeHttpHandler.handle({ protocol: \"https:\" } as any);\n        expect(vi.mocked(hsRequest as any).mock.calls[0][0]?.agent.keepAlive).toEqual(true);\n        expect(vi.mocked(hsRequest as any).mock.calls[0][0]?.agent.maxSockets).toEqual(randomMaxSocket);\n      });\n    });\n\n    describe(\"#handle\", () => {\n      it(\"should only generate a single config when the config provider is async and it is not ready yet\", async () => {\n        let providerInvokedCount = 0;\n        let providerResolvedCount = 0;\n        const slowConfigProvider = async () => {\n          providerInvokedCount += 1;\n          await new Promise((r) => setTimeout(r, 15));\n          providerResolvedCount += 1;\n          return {\n            connectionTimeout: 12345,\n            socketTimeout: 12345,\n            httpAgent: void 0,\n            httpsAgent: void 0,\n          };\n        };\n\n        const nodeHttpHandler = new NodeHttpHandler(slowConfigProvider);\n\n        const promises = Promise.all(\n          Array.from({ length: 10 }).map(() =>\n            nodeHttpHandler.handle({\n              protocol: \"https:\",\n              hostname: \"localhost\",\n              port: 54321,\n              path: \"/\",\n            } as unknown as HttpRequest)\n          )\n        );\n\n        expect(providerInvokedCount).toBe(1);\n        expect(providerResolvedCount).toBe(0);\n        await promises;\n        expect(providerInvokedCount).toBe(1);\n        expect(providerResolvedCount).toBe(1);\n      });\n\n      it(\"sends requests to the right url\", async () => {\n        const nodeHttpHandler = new NodeHttpHandler({});\n        const httpRequest = {\n          protocol: \"http:\",\n          username: \"username\",\n          password: \"password\",\n          hostname: \"host\",\n          port: 1234,\n          path: \"/some/path\",\n          query: {\n            some: \"query\",\n          },\n          fragment: \"fragment\",\n        };\n        await nodeHttpHandler.handle(httpRequest as any);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.auth).toEqual(\"username:password\");\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.host).toEqual(\"host\");\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.port).toEqual(1234);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.path).toEqual(\"/some/path?some=query#fragment\");\n      });\n\n      it(\"removes brackets from hostname\", async () => {\n        const nodeHttpHandler = new NodeHttpHandler({});\n        const httpRequest = {\n          protocol: \"http:\",\n          username: \"username\",\n          password: \"password\",\n          hostname: \"[host]\",\n          port: 1234,\n          path: \"/some/path\",\n          query: {\n            some: \"query\",\n          },\n          fragment: \"fragment\",\n        };\n        await nodeHttpHandler.handle(httpRequest as any);\n        expect(vi.mocked(hRequest as any).mock.calls[0][0]?.host).toEqual(\"host\");\n      });\n\n      describe(\"per-request requestTimeout\", () => {\n        it(\"should use per-request timeout over handler config timeout\", async () => {\n          const testTimeout = async (handlerTimeout: number, requestTimeout?: number) => {\n            const handler = new NodeHttpHandler({ requestTimeout: handlerTimeout });\n            await handler.handle(\n              new HttpRequest({\n                protocol: \"http:\",\n                username: \"username\",\n                password: \"password\",\n                hostname: \"host\",\n                port: 1234,\n                path: \"/some/path\",\n                query: {\n                  some: \"query\",\n                },\n                fragment: \"fragment\",\n              }),\n              {\n                requestTimeout,\n              }\n            );\n            expect(timing.setTimeout).toHaveBeenCalledWith(expect.any(Function), requestTimeout ?? handlerTimeout);\n          };\n\n          await testTimeout(5123.1, 125.1);\n          await testTimeout(264.1, undefined);\n          await testTimeout(234.1);\n          expect.assertions(3);\n        });\n      });\n\n      describe(\"expect 100-continue\", () => {\n        it(\"creates a new http(s) Agent if the request has expect: 100-continue header and agents are NodeHttpHandler-owned\", async () => {\n          const nodeHttpHandler = new NodeHttpHandler({\n            httpAgent: {\n              maxSockets: 25,\n            },\n            httpsAgent: {\n              maxSockets: 25,\n            },\n          });\n          {\n            const httpRequest = {\n              protocol: \"http:\",\n              hostname: \"[host]\",\n              path: \"/some/path\",\n              headers: {\n                expect: \"100-continue\",\n              },\n            };\n            await nodeHttpHandler.handle(httpRequest as any);\n            expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent).not.toBe(\n              (nodeHttpHandler as any).config.httpAgent\n            );\n          }\n          {\n            const httpRequest = {\n              protocol: \"http:\",\n              hostname: \"[host]\",\n              path: \"/some/path\",\n              headers: {},\n            };\n            await nodeHttpHandler.handle(httpRequest as any);\n            expect(vi.mocked(hRequest as any).mock.calls[1][0]?.agent).toBe((nodeHttpHandler as any).config.httpAgent);\n          }\n        });\n\n        it(\"does not create a new Agent if configured Agent is caller-owned (e.g. proxy), but instead skips the writeBody delay\", async () => {\n          const nodeHttpHandler = new NodeHttpHandler({\n            httpAgent: new http.Agent(),\n          });\n          {\n            const httpRequest = {\n              protocol: \"http:\",\n              hostname: \"[host]\",\n              path: \"/some/path\",\n              headers: {\n                expect: \"100-continue\",\n              },\n            };\n            await nodeHttpHandler.handle(httpRequest as any);\n            expect(vi.mocked(hRequest as any).mock.calls[0][0]?.agent).toBe((nodeHttpHandler as any).config.httpAgent);\n          }\n          {\n            const httpRequest = {\n              protocol: \"http:\",\n              hostname: \"[host]\",\n              path: \"/some/path\",\n              headers: {},\n            };\n            await nodeHttpHandler.handle(httpRequest as any);\n            expect(vi.mocked(hRequest as any).mock.calls[1][0]?.agent).toBe((nodeHttpHandler as any).config.httpAgent);\n          }\n        });\n      });\n    });\n  });\n\n  describe(\"create\", () => {\n    const randomRequestTimeout = Math.round(Math.random() * 10000) + 1;\n\n    it.each([\n      [\"existing handler instance\", new NodeHttpHandler()],\n      [\n        \"custom HttpHandler object\",\n        {\n          handle: vi.fn(),\n        } as any,\n      ],\n    ])(\"returns the input handler when passed %s\", (_, handler) => {\n      const result = NodeHttpHandler.create(handler);\n      expect(result).toBe(handler);\n    });\n\n    it.each([\n      [\"undefined\", undefined],\n      [\"an empty options hash\", {}],\n      [\"empty provider\", async () => undefined],\n    ])(\"creates new handler instance when input is %s\", async (_, input) => {\n      const result = NodeHttpHandler.create(input);\n      expect(result).toBeInstanceOf(NodeHttpHandler);\n    });\n\n    it.each([\n      [\"an options hash\", { requestTimeout: randomRequestTimeout }],\n      [\"a provider\", async () => ({ requestTimeout: randomRequestTimeout })],\n    ])(\"creates new handler instance with config when input is %s\", async (_, input) => {\n      const result = NodeHttpHandler.create(input);\n      expect(result).toBeInstanceOf(NodeHttpHandler);\n\n      // Verify configuration by calling handle\n      await result.handle({} as any);\n\n      expect(result.httpHandlerConfigs().requestTimeout).toBe(randomRequestTimeout);\n    });\n  });\n\n  describe(\"#destroy\", () => {\n    it(\"should be callable and return nothing\", () => {\n      const nodeHttpHandler = new NodeHttpHandler();\n      expect(nodeHttpHandler.destroy()).toBeUndefined();\n    });\n  });\n\n  describe(\"abort signal handling\", () => {\n    it(\"rejects with AbortSignal.reason when signal is already aborted with a custom reason\", async () => {\n      const nodeHttpHandler = new NodeHttpHandler();\n      const customReason = new Error(\"custom abort reason\");\n      customReason.name = \"CustomAbortError\";\n      const abortController = new AbortController();\n      abortController.abort(customReason);\n\n      try {\n        await nodeHttpHandler.handle({ protocol: \"http:\", hostname: \"host\", path: \"/\", headers: {} } as any, {\n          abortSignal: abortController.signal as any,\n        });\n        expect.unreachable(\"should have thrown\");\n      } catch (e: any) {\n        expect(e.message).toBe(\"Request aborted\");\n        expect(e.name).toBe(\"AbortError\");\n        expect(e.cause).toBe(customReason);\n      }\n    });\n\n    it(\"rejects with default AbortError when signal has no reason\", async () => {\n      const nodeHttpHandler = new NodeHttpHandler();\n      const signal = {\n        aborted: true,\n        onabort: null,\n      };\n\n      await expect(\n        nodeHttpHandler.handle({ protocol: \"http:\", hostname: \"host\", path: \"/\", headers: {} } as any, {\n          abortSignal: signal as any,\n        })\n      ).rejects.toThrow(\"Request aborted\");\n    });\n\n    it(\"rejects with a mutable error when reason is a frozen Error\", async () => {\n      const nodeHttpHandler = new NodeHttpHandler();\n      const frozenReason = Object.freeze(new Error(\"frozen\"));\n      const abortController = new AbortController();\n      abortController.abort(frozenReason);\n\n      try {\n        await nodeHttpHandler.handle({ protocol: \"http:\", hostname: \"host\", path: \"/\", headers: {} } as any, {\n          abortSignal: abortController.signal as any,\n        });\n        expect.unreachable(\"should have thrown\");\n      } catch (e: any) {\n        expect(e.name).toBe(\"AbortError\");\n        expect(e.cause).toBe(frozenReason);\n        // The returned error must be mutable so retry middleware can set $metadata.\n        expect(() => {\n          e.$metadata = {};\n        }).not.toThrow();\n      }\n    });\n\n    it(\"rejects with string reason wrapped in an Error\", async () => {\n      const nodeHttpHandler = new NodeHttpHandler();\n      const abortController = new AbortController();\n      abortController.abort(\"string reason\");\n\n      try {\n        await nodeHttpHandler.handle({ protocol: \"http:\", hostname: \"host\", path: \"/\", headers: {} } as any, {\n          abortSignal: abortController.signal as any,\n        });\n        expect.unreachable(\"should have thrown\");\n      } catch (e: any) {\n        expect(e.message).toBe(\"string reason\");\n        expect(e.name).toBe(\"AbortError\");\n      }\n    });\n  });\n\n  describe(\"checkSocketUsage\", () => {\n    beforeEach(() => {\n      vi.spyOn(console, \"warn\").mockImplementation(vi.fn() as any);\n    });\n\n    afterEach(() => {\n      vi.resetAllMocks();\n    });\n\n    it(\"warns when socket exhaustion is detected\", async () => {\n      const lastTimestamp = Date.now() - 30_000;\n      const warningTimestamp = NodeHttpHandler.checkSocketUsage(\n        {\n          maxSockets: 2,\n          sockets: {\n            addr: [],\n            addr2: [null],\n            addr3: [null, null],\n            // this is not checked because an earlier addr causes the warning to be emitted.\n            addr4: Array.from({ length: 400 }),\n          },\n          requests: {\n            addr: Array.from({ length: 0 }),\n            addr2: Array.from({ length: 3 }),\n            addr3: Array.from({ length: 4 }),\n            // this is not checked because an earlier addr causes the warning to be emitted.\n            addr4: Array.from({ length: 800 }),\n          },\n        } as any,\n        lastTimestamp\n      );\n\n      expect(warningTimestamp).toBeGreaterThan(lastTimestamp);\n      expect(console.warn).toHaveBeenCalledWith(\n        `@smithy/node-http-handler:WARN - socket usage at capacity=2 and 4 additional requests are enqueued.\nSee https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html\nor increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http-handler.ts",
    "content": "import type { Agent as hAgentType, request as hRequestType } from \"node:http\";\nimport { Agent as hsAgent, request as hsRequest, type RequestOptions } from \"node:https\";\nimport { HttpResponse, buildQueryString, type HttpHandler, type HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpHandlerOptions, Logger, NodeHttpHandlerOptions, Provider } from \"@smithy/types\";\n\nimport { buildAbortError } from \"./build-abort-error\";\nimport { NODEJS_TIMEOUT_ERROR_CODES } from \"./constants\";\nimport { getTransformedHeaders } from \"./get-transformed-headers\";\nimport { setConnectionTimeout } from \"./set-connection-timeout\";\nimport { setRequestTimeout } from \"./set-request-timeout\";\nimport { setSocketKeepAlive } from \"./set-socket-keep-alive\";\nimport { setSocketTimeout } from \"./set-socket-timeout\";\nimport { timing } from \"./timing\";\nimport { writeRequestBody } from \"./write-request-body\";\n\nexport { NodeHttpHandlerOptions };\n\ninterface ResolvedNodeHttpHandlerConfig extends Omit<NodeHttpHandlerOptions, \"httpAgent\" | \"httpsAgent\"> {\n  httpAgentProvider: () => Promise<hAgentType>;\n  httpAgent?: hAgentType;\n  httpsAgent: hsAgent;\n}\n\n/**\n * A default of 0 means no timeout.\n *\n * @public\n */\nexport const DEFAULT_REQUEST_TIMEOUT = 0;\n\nlet hAgent: { new (...args: any): hAgentType } | undefined = undefined;\nlet hRequest: typeof hRequestType | undefined = undefined;\n\n/**\n * A request handler that uses the Node.js http and https modules.\n *\n * @public\n */\nexport class NodeHttpHandler implements HttpHandler<NodeHttpHandlerOptions> {\n  private config?: ResolvedNodeHttpHandlerConfig;\n  private configProvider: Promise<ResolvedNodeHttpHandlerConfig>;\n  private socketWarningTimestamp = 0;\n  private externalAgent = false;\n\n  // Node http handler is hard-coded to http/1.1: https://github.com/nodejs/node/blob/ff5664b83b89c55e4ab5d5f60068fb457f1f5872/lib/_http_server.js#L286\n  public readonly metadata = { handlerProtocol: \"http/1.1\" };\n\n  /**\n   * @returns the input if it is an HttpHandler of any class,\n   * or instantiates a new instance of this handler.\n   */\n  public static create(\n    instanceOrOptions?: HttpHandler<any> | NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>\n  ) {\n    if (typeof (instanceOrOptions as any)?.handle === \"function\") {\n      // is already an instance of HttpHandler.\n      return instanceOrOptions as HttpHandler<any>;\n    }\n    // input is ctor options or undefined.\n    return new NodeHttpHandler(instanceOrOptions as NodeHttpHandlerOptions);\n  }\n\n  /**\n   * @internal\n   *\n   * @param agent - http(s) agent in use by the NodeHttpHandler instance.\n   * @param socketWarningTimestamp - last socket usage check timestamp.\n   * @param logger - channel for the warning.\n   * @returns timestamp of last emitted warning.\n   */\n  public static checkSocketUsage(\n    agent: hAgentType | hsAgent,\n    socketWarningTimestamp: number,\n    logger: Logger = console\n  ): number {\n    // note, maxSockets is per origin.\n    const { sockets, requests, maxSockets } = agent;\n\n    if (typeof maxSockets !== \"number\" || maxSockets === Infinity) {\n      return socketWarningTimestamp;\n    }\n\n    const interval = 15_000;\n    if (Date.now() - interval < socketWarningTimestamp) {\n      return socketWarningTimestamp;\n    }\n\n    if (sockets && requests) {\n      for (const origin in sockets) {\n        const socketsInUse = sockets[origin]?.length ?? 0;\n        const requestsEnqueued = requests[origin]?.length ?? 0;\n\n        /**\n         * Running at maximum socket usage can be intentional and normal.\n         * That is why this warning emits at a delay which can be seen\n         * at the call site's setTimeout wrapper. The warning will be cancelled\n         * if the request finishes in a reasonable amount of time regardless\n         * of socket saturation.\n         *\n         * Additionally, when the warning is emitted, there is an interval\n         * lockout.\n         */\n        if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {\n          logger?.warn?.(\n            `@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.\nSee https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html\nor increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`\n          );\n          return Date.now();\n        }\n      }\n    }\n\n    return socketWarningTimestamp;\n  }\n\n  constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>) {\n    this.configProvider = new Promise((resolve, reject) => {\n      if (typeof options === \"function\") {\n        options()\n          .then((_options) => {\n            resolve(this.resolveDefaultConfig(_options));\n          })\n          .catch(reject);\n      } else {\n        resolve(this.resolveDefaultConfig(options));\n      }\n    });\n  }\n\n  public destroy(): void {\n    this.config?.httpAgent?.destroy();\n    this.config?.httpsAgent?.destroy();\n  }\n\n  public async handle(\n    request: HttpRequest,\n    { abortSignal, requestTimeout }: HttpHandlerOptions = {}\n  ): Promise<{ response: HttpResponse }> {\n    if (!this.config) {\n      this.config = await this.configProvider;\n    }\n\n    const config = this.config!;\n\n    // determine which http(s) client to use\n    const isSSL = request.protocol === \"https:\";\n    if (!isSSL && !this.config.httpAgent) {\n      this.config.httpAgent = await this.config.httpAgentProvider();\n    }\n\n    return new Promise((_resolve, _reject) => {\n      let writeRequestBodyPromise: Promise<void> | undefined = undefined;\n\n      // Individual timeout handles for this request, cleared upon completion.\n      // Using individual variables avoids array allocation and forEach on the hot path.\n      type TimeoutId = number | NodeJS.Timeout;\n      let socketWarningTimeoutId: TimeoutId = -1;\n      let connectionTimeoutId: TimeoutId = -1;\n      let requestTimeoutId: TimeoutId = -1;\n      let socketTimeoutId: TimeoutId = -1;\n      let keepAliveTimeoutId: TimeoutId = -1;\n\n      const clearTimeouts = () => {\n        timing.clearTimeout(socketWarningTimeoutId);\n        timing.clearTimeout(connectionTimeoutId);\n        timing.clearTimeout(requestTimeoutId);\n        timing.clearTimeout(socketTimeoutId);\n        timing.clearTimeout(keepAliveTimeoutId);\n      };\n\n      const resolve = async (arg: { response: HttpResponse }) => {\n        await writeRequestBodyPromise;\n        clearTimeouts();\n        _resolve(arg);\n      };\n      const reject = async (arg: unknown) => {\n        await writeRequestBodyPromise;\n        clearTimeouts();\n        _reject(arg);\n      };\n\n      // if the request was already aborted, prevent doing extra work\n      if (abortSignal?.aborted) {\n        const abortError = buildAbortError(abortSignal);\n        reject(abortError);\n        return;\n      }\n\n      const headers = request.headers;\n      const expectContinue = headers ? (headers.Expect ?? headers.expect) === \"100-continue\" : false;\n\n      let agent = isSSL ? config.httpsAgent : config.httpAgent;\n      if (expectContinue && !this.externalAgent) {\n        // Because awaiting 100-continue desynchronizes the request and request body transmission,\n        // such requests must be offloaded to a separate Agent instance.\n        // Additional logic will exist on the client using this handler to determine whether to add the header at all.\n        agent = new (isSSL ? hsAgent : hAgent!)({\n          keepAlive: false,\n          // This is an explicit value matching the default (Infinity).\n          // This should allow the connection to close cleanly after making the single request.\n          maxSockets: Infinity,\n        });\n      }\n\n      // If the request is taking a long time, check socket usage and potentially warn.\n      // This warning will be cancelled if the request resolves.\n      socketWarningTimeoutId = timing.setTimeout(\n        () => {\n          this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(\n            agent!,\n            this.socketWarningTimestamp,\n            config.logger\n          );\n        },\n        config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2000) + (config.connectionTimeout ?? 1000)\n      );\n\n      const queryString = request.query ? buildQueryString(request.query) : \"\";\n      let auth = undefined;\n      if (request.username != null || request.password != null) {\n        const username = request.username ?? \"\";\n        const password = request.password ?? \"\";\n        auth = `${username}:${password}`;\n      }\n      let path = request.path;\n      if (queryString) {\n        path += `?${queryString}`;\n      }\n      if (request.fragment) {\n        path += `#${request.fragment}`;\n      }\n\n      let hostname = request.hostname ?? \"\";\n      if (hostname[0] === \"[\" && hostname.endsWith(\"]\")) {\n        hostname = request.hostname.slice(1, -1);\n      } else {\n        hostname = request.hostname;\n      }\n\n      const nodeHttpsOptions: RequestOptions = {\n        headers: request.headers,\n        host: hostname,\n        method: request.method,\n        path,\n        port: request.port,\n        agent,\n        auth,\n      };\n\n      // create the http request\n      const requestFunc = isSSL ? hsRequest : hRequest!;\n\n      const req = requestFunc(nodeHttpsOptions, (res) => {\n        const httpResponse = new HttpResponse({\n          statusCode: res.statusCode || -1,\n          reason: res.statusMessage,\n          headers: getTransformedHeaders(res.headers),\n          body: res,\n        });\n        resolve({ response: httpResponse });\n      });\n\n      req.on(\"error\", (err: Error) => {\n        if (NODEJS_TIMEOUT_ERROR_CODES.includes((err as any).code)) {\n          reject(Object.assign(err, { name: \"TimeoutError\" }));\n        } else {\n          reject(err);\n        }\n      });\n\n      // wire-up abort logic\n      if (abortSignal) {\n        const onAbort = () => {\n          // ensure request is destroyed\n          req.destroy();\n          const abortError = buildAbortError(abortSignal);\n          reject(abortError);\n        };\n        if (typeof (abortSignal as AbortSignal).addEventListener === \"function\") {\n          // preferred.\n          const signal = abortSignal as AbortSignal;\n          signal.addEventListener(\"abort\", onAbort, { once: true });\n          req.once(\"close\", () => signal.removeEventListener(\"abort\", onAbort));\n        } else {\n          // backwards compatibility\n          abortSignal.onabort = onAbort;\n        }\n      }\n\n      // Defer registration of socket event listeners if the connection and request timeouts\n      // are longer than a few seconds. This avoids slowing down faster operations.\n      const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout;\n      connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout);\n      requestTimeoutId = setRequestTimeout(\n        req,\n        reject,\n        effectiveRequestTimeout,\n        config.throwOnRequestTimeout,\n        config.logger ?? console\n      );\n      socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout);\n\n      // Workaround for bug report in Node.js https://github.com/nodejs/node/issues/47137\n      const httpAgent = nodeHttpsOptions.agent;\n      if (typeof httpAgent === \"object\" && \"keepAlive\" in httpAgent) {\n        keepAliveTimeoutId = setSocketKeepAlive(req, {\n          // @ts-expect-error keepAlive is not public on httpAgent.\n          keepAlive: (httpAgent as hAgent).keepAlive,\n          // @ts-expect-error keepAliveMsecs is not public on httpAgent.\n          keepAliveMsecs: (httpAgent as hAgent).keepAliveMsecs,\n        });\n      }\n\n      writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch(\n        (e) => {\n          clearTimeouts();\n          return _reject(e);\n        }\n      );\n    });\n  }\n\n  public updateHttpClientConfig(key: keyof NodeHttpHandlerOptions, value: NodeHttpHandlerOptions[typeof key]): void {\n    this.config = undefined;\n    this.configProvider = this.configProvider.then((config) => {\n      return {\n        ...config,\n        [key]: value,\n      };\n    });\n  }\n\n  public httpHandlerConfigs(): NodeHttpHandlerOptions {\n    return this.config ?? {};\n  }\n\n  private resolveDefaultConfig(options?: NodeHttpHandlerOptions | void): ResolvedNodeHttpHandlerConfig {\n    const {\n      requestTimeout,\n      connectionTimeout,\n      socketTimeout,\n      socketAcquisitionWarningTimeout,\n      httpAgent,\n      httpsAgent,\n      throwOnRequestTimeout,\n      logger,\n    } = options || {};\n    const keepAlive = true;\n    const maxSockets = 50;\n\n    return {\n      connectionTimeout,\n      requestTimeout,\n      socketTimeout,\n      socketAcquisitionWarningTimeout,\n      throwOnRequestTimeout,\n      httpAgentProvider: async () => {\n        const { Agent, request } = await import(\"node:http\");\n        hRequest = request;\n        hAgent = Agent;\n\n        if (httpAgent instanceof hAgent || typeof (httpAgent as hAgentType)?.destroy === \"function\") {\n          this.externalAgent = true;\n          return httpAgent as hAgentType;\n        }\n        return new hAgent({ keepAlive, maxSockets, ...httpAgent });\n      },\n      httpsAgent: (() => {\n        if (httpsAgent instanceof hsAgent || typeof (httpsAgent as hsAgent)?.destroy === \"function\") {\n          this.externalAgent = true;\n          return httpsAgent as hsAgent;\n        }\n        return new hsAgent({ keepAlive, maxSockets, ...httpsAgent });\n      })(),\n      logger,\n    };\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http2-connection-manager.ts",
    "content": "import http2, { type ClientHttp2Session, type ClientSessionOptions, type SecureClientSessionOptions } from \"node:http2\";\nimport type {\n  ConnectConfiguration,\n  ConnectionManager,\n  ConnectionManagerConfiguration,\n  RequestContext,\n} from \"@smithy/types\";\n\nimport { ClientHttp2SessionRef } from \"./http2/ClientHttp2SessionRef\";\nimport { NodeHttp2ConnectionPool } from \"./node-http2-connection-pool\";\n\n/**\n * This class previously implemented the ConnectionManager<ClientHttp2Session> interface,\n * but this class isn't exported from this package, except as a private property of NodeHttp2Handler.\n *\n * @since 4.6.0\n * @internal\n */\nexport class NodeHttp2ConnectionManager implements ConnectionManager<ClientHttp2SessionRef> {\n  private config: ConnectionManagerConfiguration;\n  private connectOptions?: Partial<SecureClientSessionOptions | ClientSessionOptions>;\n  private readonly connectionPools: Map<string, NodeHttp2ConnectionPool> = new Map<string, NodeHttp2ConnectionPool>();\n\n  constructor(config: ConnectionManagerConfiguration) {\n    this.config = config;\n\n    if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {\n      throw new RangeError(\"maxConcurrency must be greater than zero.\");\n    }\n  }\n\n  /**\n   * Acquire a session for making a request.\n   */\n  public lease(requestContext: RequestContext, connectionConfiguration: ConnectConfiguration): ClientHttp2SessionRef {\n    const url = this.getUrlString(requestContext);\n\n    const pool = this.getPool(url);\n\n    if (!this.config.disableConcurrency && !connectionConfiguration.isEventStream) {\n      const available = pool.poll();\n      if (available) {\n        available.retain();\n        return available;\n      }\n    }\n\n    const ref = new ClientHttp2SessionRef(this.connect(url));\n    const session = ref.deref();\n\n    if (this.config.maxConcurrency) {\n      session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => {\n        if (err) {\n          throw new Error(\n            \"Fail to set maxConcurrentStreams to \" +\n              this.config.maxConcurrency +\n              \"when creating new session for \" +\n              requestContext.destination.toString()\n          );\n        }\n      });\n    }\n\n    const graceful = () => {\n      this.removeFromPoolAndClose(url, ref);\n    };\n    const ensureDestroyed = () => {\n      this.removeFromPoolAndCheckedDestroy(url, ref);\n    };\n    session.on(\"goaway\", graceful);\n    session.on(\"error\", ensureDestroyed);\n    session.on(\"frameError\", ensureDestroyed);\n    session.on(\"close\", ensureDestroyed);\n\n    if (connectionConfiguration.requestTimeout) {\n      session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);\n    }\n\n    pool.offerLast(ref);\n    ref.retain();\n    return ref;\n  }\n\n  /**\n   * Signal that a request using this session has completed.\n   *\n   * The session remains in its pool for reuse.\n   * This method is not called for isolated sessions.\n   */\n  public release(_requestContext: RequestContext, ref: ClientHttp2SessionRef): void {\n    ref.free();\n  }\n\n  /**\n   * Create an isolated session that isn't part of the connection pools.\n   * For use in event-streams or when concurrency is turned off.\n   */\n  public createIsolatedSession(\n    requestContext: RequestContext,\n    connectionConfiguration: ConnectConfiguration\n  ): ClientHttp2SessionRef {\n    const url = this.getUrlString(requestContext);\n    const ref = new ClientHttp2SessionRef(this.connect(url));\n    const session = ref.deref();\n\n    session.settings({ maxConcurrentStreams: 1 });\n\n    const ensureDestroyed = () => {\n      ref.destroy();\n    };\n\n    // note: there is no goaway handler for an isolated session.\n    // the session is already closing after receiving \"goaway\" and\n    // there is no pool from which to remove it.\n    session.on(\"error\", ensureDestroyed);\n    session.on(\"frameError\", ensureDestroyed);\n    session.on(\"close\", ensureDestroyed);\n\n    if (connectionConfiguration.requestTimeout) {\n      session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed);\n    }\n\n    ref.retain();\n    return ref;\n  }\n\n  public destroy(): void {\n    for (const [url, connectionPool] of this.connectionPools) {\n      // copy pool array to avoid potential synchronous mutation from\n      // call to session.destroy().\n      for (const session of [...connectionPool]) {\n        session.destroy();\n      }\n      this.connectionPools.delete(url);\n    }\n  }\n\n  public setMaxConcurrentStreams(maxConcurrentStreams: number) {\n    if (maxConcurrentStreams && maxConcurrentStreams <= 0) {\n      throw new RangeError(\"maxConcurrentStreams must be greater than zero.\");\n    }\n    this.config.maxConcurrency = maxConcurrentStreams;\n    for (const pool of this.connectionPools.values()) {\n      pool.setMaxConcurrency(maxConcurrentStreams);\n    }\n  }\n\n  public setDisableConcurrentStreams(disableConcurrentStreams: boolean) {\n    this.config.disableConcurrency = disableConcurrentStreams;\n  }\n\n  public setNodeHttp2ConnectOptions(\n    nodeHttp2ConnectOptions: Partial<SecureClientSessionOptions | ClientSessionOptions>\n  ) {\n    this.connectOptions = nodeHttp2ConnectOptions;\n  }\n\n  /**\n   * @internal\n   * @returns a snapshot of the state of all connection pools and their sessions.\n   */\n  public debug() {\n    const pools: Record<string, any> = {};\n    for (const [url, pool] of this.connectionPools) {\n      const sessions = [];\n      for (const ref of pool) {\n        sessions.push({\n          id: ref.id,\n          active: ref.useCount(),\n          maxConcurrent: ref.max,\n          totalRequests: ref.total,\n        });\n      }\n      pools[url] = { sessions };\n    }\n    return pools;\n  }\n\n  private removeFromPoolAndClose(authority: string, ref: ClientHttp2SessionRef): void {\n    this.connectionPools.get(authority)?.remove(ref);\n    // no-op when this function is called as a \"goaway\" reaction,\n    // but in case the method is called from another path, this is a defensive closure\n    // because we lose the reference to the session.\n    ref.close();\n  }\n\n  private removeFromPoolAndCheckedDestroy(authority: string, ref: ClientHttp2SessionRef): void {\n    this.connectionPools.get(authority)?.remove(ref);\n    ref.destroy();\n  }\n\n  private getPool(url: string): NodeHttp2ConnectionPool {\n    if (!this.connectionPools.has(url)) {\n      const pool = new NodeHttp2ConnectionPool();\n      if (this.config.maxConcurrency) {\n        pool.setMaxConcurrency(this.config.maxConcurrency);\n      }\n      this.connectionPools.set(url, pool);\n    }\n    return this.connectionPools.get(url)!;\n  }\n\n  private getUrlString(request: RequestContext): string {\n    return request.destination.toString();\n  }\n\n  private connect(url: string): ClientHttp2Session {\n    return this.connectOptions === undefined ? http2.connect(url) : http2.connect(url, this.connectOptions);\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http2-connection-pool.ts",
    "content": "import type { ClientHttp2Session } from \"node:http2\";\nimport type { ConnectionPool } from \"@smithy/types\";\n\nimport { ClientHttp2SessionRef } from \"./http2/ClientHttp2SessionRef\";\n\n/**\n * These are keyed by URL, therefore all sessions within this class' state\n * are for the same URL.\n *\n * Sessions remain in the pool for their entire lifetime (until destroyed or\n * removed). The pool tracks capacity via each session's ref count.\n *\n * Interface implementation changed from ConnectionPool<ClientHttp2Session>.\n * @since 4.6.0\n * @internal\n */\nexport class NodeHttp2ConnectionPool implements ConnectionPool<ClientHttp2SessionRef> {\n  private readonly sessions: ClientHttp2SessionRef[] = [];\n  private maxConcurrency = 0;\n\n  constructor(sessions?: ClientHttp2Session[]) {\n    this.sessions = (sessions ?? []).map((session: ClientHttp2Session) => new ClientHttp2SessionRef(session));\n  }\n\n  /**\n   * Find a session with available capacity (refs < maxConcurrency).\n   * Returns undefined if all sessions are at capacity or the pool is empty.\n   */\n  public poll(): ClientHttp2SessionRef | undefined {\n    let cleanup = false;\n    for (const session of this.sessions) {\n      if (session.deref().destroyed) {\n        cleanup = true;\n        continue;\n      }\n      if (!this.maxConcurrency || session.useCount() < this.maxConcurrency) {\n        return session;\n      }\n    }\n    if (cleanup) {\n      for (const session of this.sessions) {\n        if (session.deref().destroyed) {\n          this.remove(session);\n        }\n      }\n    }\n  }\n\n  /**\n   * Add a session to the pool.\n   */\n  public offerLast(ref: ClientHttp2SessionRef): void {\n    this.sessions.push(ref);\n  }\n\n  public remove(ref: ClientHttp2SessionRef): void {\n    const ix = this.sessions.indexOf(ref);\n    if (ix > -1) {\n      this.sessions.splice(ix, 1);\n    }\n  }\n\n  public [Symbol.iterator]() {\n    return this.sessions[Symbol.iterator]();\n  }\n\n  public setMaxConcurrency(maxConcurrency: number): void {\n    this.maxConcurrency = maxConcurrency;\n  }\n\n  /**\n   * This is unused, but part of the interface.\n   * @deprecated\n   */\n  public destroy(ref: ClientHttp2SessionRef): void {\n    this.remove(ref);\n    ref.destroy();\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http2-handler.spec.ts",
    "content": "import { rejects } from \"node:assert\";\nimport http2, {\n  constants,\n  type ClientHttp2Session,\n  type ClientHttp2Stream,\n  type Http2Server,\n  type Http2Session,\n  type Http2Stream,\n} from \"node:http2\";\nimport { Duplex } from \"node:stream\";\nimport { promisify } from \"node:util\";\nimport { AbortController as AbortControllerPolyfill } from \"@smithy/abort-controller\";\nimport { HttpRequest, type HttpResponse } from \"@smithy/core/protocols\";\nimport type { Mutable } from \"@smithy/types\";\nimport getPort, { portNumbers } from \"get-port\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport type { ClientHttp2SessionRef } from \"./http2/ClientHttp2SessionRef\";\nimport type { NodeHttp2ConnectionManager } from \"./node-http2-connection-manager\";\nimport { NodeHttp2ConnectionPool } from \"./node-http2-connection-pool\";\nimport { NodeHttp2Handler, type NodeHttp2HandlerOptions } from \"./node-http2-handler\";\nimport { createMockHttp2Server, createResponseFunction, createResponseFunctionWithDelay } from \"./server.mock\";\nimport { timing } from \"./timing\";\n\nconst getConnectionManager = (handler: NodeHttp2Handler) =>\n  (handler as any).connectionManager as NodeHttp2ConnectionManager;\n\nconst getConnectionPools = (handler: NodeHttp2Handler) =>\n  (getConnectionManager(handler) as any).connectionPools as Map<string, NodeHttp2ConnectionPool>;\n\nconst getSessions = (handler: NodeHttp2Handler, authority: string) =>\n  (getConnectionPools(handler).get(authority) as any).sessions as ClientHttp2SessionRef[];\n\nconst getFirstSession = (handler: NodeHttp2Handler, authority: string) => getSessions(handler, authority)[0];\n\ndescribe(NodeHttp2Handler.name, () => {\n  let nodeH2Handler: NodeHttp2Handler;\n\n  const protocol = \"http:\";\n  const hostname = \"localhost\";\n  let port1: number = 0;\n  let port2: number = 0;\n  let port3: number = 0;\n  let port4: number = 0;\n\n  let mockH2Server: any = undefined;\n  const mockH2Servers: Record<string, Http2Server> = {};\n\n  let authority: string;\n  const getMockReqOptions = () => ({\n    protocol,\n    hostname,\n    port: port1,\n    method: \"GET\",\n    path: \"/\",\n    headers: {},\n  });\n\n  const mockResponse = {\n    statusCode: 200,\n    headers: {},\n    body: \"test\",\n  };\n\n  beforeEach(async () => {\n    for (let i = 0; i < 4; ++i) {\n      const port = await getPort({ port: portNumbers(45_341, 50_000) });\n      mockH2Servers[port] = createMockHttp2Server().listen(port);\n    }\n\n    [port1, port2, port3, port4] = Object.keys(mockH2Servers).map(Number);\n    authority = `${protocol}//${hostname}:${port1}/`;\n\n    mockH2Server = mockH2Servers[port1];\n    mockH2Server.on(\"request\", createResponseFunction(mockResponse));\n  });\n\n  afterEach(() => {\n    mockH2Server.removeAllListeners(\"request\");\n    vi.clearAllMocks();\n    for (const p in mockH2Servers) {\n      mockH2Servers[p].removeAllListeners(\"request\");\n      mockH2Servers[p].close();\n    }\n    Object.keys(mockH2Servers).forEach((key) => {\n      delete mockH2Servers[key];\n    });\n  });\n\n  describe.each([\n    [\"undefined\", undefined],\n    [\"empty object\", {}],\n    [\"undefined provider\", async () => void 0],\n    [\"empty object provider\", async () => ({})],\n  ])(\"without options in constructor parameter of %s\", (_, option) => {\n    let createdSessions!: ClientHttp2Session[];\n    const connectReal = http2.connect;\n    let connectSpy!: typeof http2.connect;\n\n    beforeEach(() => {\n      createdSessions = [];\n      connectSpy = vi.spyOn(http2, \"connect\").mockImplementation((...args: any[]) => {\n        const session = connectReal(args[0], args[1]);\n        vi.spyOn(session, \"ref\");\n        vi.spyOn(session, \"unref\");\n        vi.spyOn(session, \"settings\");\n        createdSessions.push(session);\n        return session;\n      }) as any;\n\n      nodeH2Handler = new NodeHttp2Handler(option);\n    });\n\n    const closeConnection = async (response: HttpResponse) => {\n      const responseBody = response.body as ClientHttp2Stream;\n      const closePromise = new Promise((resolve) => responseBody.once(\"close\", resolve));\n      responseBody.destroy();\n      await closePromise;\n    };\n\n    // Keeping node alive while request is open.\n    // With ref-counting: constructor calls unref once, each get() calls ref once.\n    const expectSessionCreatedAndReferred = (session: ClientHttp2Session, requestCount = 1) => {\n      expect(session.ref).toHaveBeenCalledTimes(requestCount);\n      expect(session.unref).toHaveBeenCalledTimes(1); // initial unref in constructor\n    };\n\n    // No longer keeping node alive.\n    // With ref-counting: constructor calls unref once, each get() calls ref once,\n    // free() calls unref when refcount reaches zero.\n    const expectSessionCreatedAndUnreffed = (session: ClientHttp2Session, requestCount = 1) => {\n      expect(session.ref).toHaveBeenCalledTimes(requestCount);\n      // 1 (constructor) + 1 (final free reaching zero)\n      expect(session.unref).toHaveBeenCalledTimes(2);\n    };\n\n    // Session was destroyed (e.g. goaway/error), free() is a no-op on destroyed sessions.\n    const expectSessionCreatedAndDestroyed = (session: ClientHttp2Session, requestCount = 1) => {\n      expect(session.ref).toHaveBeenCalledTimes(requestCount);\n      expect(session.unref).toHaveBeenCalledTimes(1); // only constructor unref\n    };\n\n    afterEach(() => {\n      nodeH2Handler.destroy();\n    });\n\n    it(\"has metadata\", () => {\n      expect(nodeH2Handler.metadata.handlerProtocol).toContain(\"h2\");\n    });\n\n    describe(\"number calls to http2.connect\", () => {\n      it(\"is zero on initialization\", () => {\n        expect(connectSpy).not.toHaveBeenCalled();\n      });\n\n      it(\"is one when request is made\", async () => {\n        // Make single request.\n        const { response } = await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        expect(connectSpy).toHaveBeenCalledTimes(1);\n        expect(connectSpy).toHaveBeenCalledWith(authority);\n\n        expectSessionCreatedAndReferred(createdSessions[0]);\n        await closeConnection(response);\n        expectSessionCreatedAndUnreffed(createdSessions[0]);\n      });\n\n      it(\"is one if multiple requests are made on same URL\", async () => {\n        const connectSpy = vi.spyOn(http2, \"connect\");\n\n        // Make two requests.\n        const { response: response1 } = await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n        const { response: response2 } = await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        expect(connectSpy).toHaveBeenCalledTimes(1);\n        expect(connectSpy).toHaveBeenCalledWith(authority);\n\n        expectSessionCreatedAndReferred(createdSessions[0], 2);\n        await closeConnection(response1);\n        await closeConnection(response2);\n        expectSessionCreatedAndUnreffed(createdSessions[0], 2);\n      });\n\n      it(\"is many if requests are made on different URLs\", async () => {\n        const connectSpy = vi.spyOn(http2, \"connect\");\n\n        // Make first request on default URL.\n        const { response: response1 } = await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        const mockH2Server2 = mockH2Servers[port2];\n        mockH2Server2.on(\"request\", createResponseFunction(mockResponse));\n\n        // Make second request on URL with port2.\n        const { response: response2 } = await nodeH2Handler.handle(\n          new HttpRequest({ ...getMockReqOptions(), port: port2 }),\n          {}\n        );\n\n        const authorityPrefix = `${protocol}//${hostname}`;\n        expect(connectSpy).toHaveBeenCalledTimes(2);\n        expect(connectSpy).toHaveBeenNthCalledWith(1, `${authorityPrefix}:${port1}/`);\n        expect(connectSpy).toHaveBeenNthCalledWith(2, `${authorityPrefix}:${port2}/`);\n        mockH2Server2.close();\n\n        expectSessionCreatedAndReferred(createdSessions[0]);\n        expectSessionCreatedAndReferred(createdSessions[1]);\n        await closeConnection(response1);\n        await closeConnection(response2);\n        expectSessionCreatedAndUnreffed(createdSessions[0]);\n        expectSessionCreatedAndUnreffed(createdSessions[1]);\n      });\n    });\n\n    describe(\"errors\", () => {\n      const UNEXPECTEDLY_CLOSED_REGEX = /closed|destroy|cancel|did not get a response|failed/i;\n      it(\"handles goaway frames\", async () => {\n        const mockH2Server3 = mockH2Servers[port3];\n        let establishedConnections = 0;\n        let numRequests = 0;\n        let shouldSendGoAway = true;\n\n        mockH2Server3.on(\"stream\", (request: Http2Stream) => {\n          // transmit goaway frame without shutting down the connection\n          // to simulate an unlikely error mode.\n          numRequests += 1;\n          if (shouldSendGoAway) {\n            request.session!.goaway(constants.NGHTTP2_PROTOCOL_ERROR);\n          }\n        });\n        mockH2Server3.on(\"connection\", () => {\n          establishedConnections += 1;\n        });\n        const req = new HttpRequest({ ...getMockReqOptions(), port: port3 });\n        expect(establishedConnections).toBe(0);\n        expect(numRequests).toBe(0);\n        await rejects(\n          nodeH2Handler.handle(req, {}),\n          UNEXPECTEDLY_CLOSED_REGEX,\n          \"should be rejected promptly due to goaway frame\"\n        );\n        expect(establishedConnections).toBe(1);\n        expect(numRequests).toBe(1);\n        await rejects(\n          nodeH2Handler.handle(req, {}),\n          UNEXPECTEDLY_CLOSED_REGEX,\n          \"should be rejected promptly due to goaway frame\"\n        );\n        expect(establishedConnections).toBe(2);\n        expect(numRequests).toBe(2);\n        await rejects(\n          nodeH2Handler.handle(req, {}),\n          UNEXPECTEDLY_CLOSED_REGEX,\n          \"should be rejected promptly due to goaway frame\"\n        );\n        expect(establishedConnections).toBe(3);\n        expect(numRequests).toBe(3);\n\n        // Not keeping node alive\n        expect(createdSessions).toHaveLength(3);\n        expectSessionCreatedAndDestroyed(createdSessions[0]);\n        expectSessionCreatedAndDestroyed(createdSessions[1]);\n        expectSessionCreatedAndDestroyed(createdSessions[2]);\n\n        // should be able to recover from goaway after reconnecting to a server\n        // that doesn't send goaway, and reuse the TCP connection (Http2Session)\n        shouldSendGoAway = false;\n        mockH2Server3.on(\"request\", createResponseFunction(mockResponse));\n        const result = await nodeH2Handler.handle(req, {});\n        const resultReader = result.response.body;\n\n        // Keeping node alive\n        expect(createdSessions).toHaveLength(4);\n        expectSessionCreatedAndReferred(createdSessions[3]);\n\n        // ...and validate that the mocked response is received\n        const responseBody = await new Promise((resolve) => {\n          const buffers: any[] = [];\n          resultReader.on(\"data\", (chunk: any) => buffers.push(chunk));\n          resultReader.on(\"close\", () => {\n            resolve(Buffer.concat(buffers).toString(\"utf8\"));\n          });\n        });\n        expect(responseBody).toBe(\"test\");\n        expect(establishedConnections).toBe(4);\n        expect(numRequests).toBe(4);\n        mockH2Server3.close();\n\n        // Not keeping node alive\n        expect(createdSessions).toHaveLength(4);\n        expectSessionCreatedAndUnreffed(createdSessions[3]);\n      });\n\n      it(\"handles servers calling connections destroy\", async () => {\n        const port = port2;\n        const mockH2Server4 = mockH2Servers[port];\n        let establishedConnections = 0;\n        let numRequests = 0;\n\n        mockH2Server4.on(\"stream\", (request: Http2Stream) => {\n          numRequests += 1;\n          (request.session as any)!.destroy();\n        });\n        mockH2Server4.on(\"connection\", () => {\n          establishedConnections += 1;\n        });\n        const req = new HttpRequest({ ...getMockReqOptions(), port });\n        expect(establishedConnections).toBe(0);\n        expect(numRequests).toBe(0);\n        await rejects(\n          nodeH2Handler.handle(req, {}),\n          UNEXPECTEDLY_CLOSED_REGEX,\n          \"should be rejected promptly due to destroyed connection\"\n        );\n        expect(establishedConnections).toBe(1);\n        expect(numRequests).toBe(1);\n        await rejects(\n          nodeH2Handler.handle(req, {}),\n          UNEXPECTEDLY_CLOSED_REGEX,\n          \"should be rejected promptly due to destroyed connection\"\n        );\n        expect(establishedConnections).toBe(2);\n        expect(numRequests).toBe(2);\n        await rejects(\n          nodeH2Handler.handle(req, {}),\n          UNEXPECTEDLY_CLOSED_REGEX,\n          \"should be rejected promptly due to destroyed connection\"\n        );\n        expect(establishedConnections).toBe(3);\n        expect(numRequests).toBe(3);\n        mockH2Server4.close();\n\n        // Not keeping node alive\n        expect(createdSessions).toHaveLength(3);\n        expectSessionCreatedAndDestroyed(createdSessions[0]);\n        expectSessionCreatedAndDestroyed(createdSessions[1]);\n        expectSessionCreatedAndDestroyed(createdSessions[2]);\n      });\n\n      it(\"handles servers calling connections close\", async () => {\n        const port = port3;\n        const mockH2Server4 = mockH2Servers[port];\n\n        mockH2Server4.on(\"stream\", (request: Http2Stream) => {\n          // Server gracefully closes the session (sends GOAWAY with NO_ERROR)\n          // and resets the stream so it completes.\n          request.close();\n          (request.session as any)!.close();\n        });\n\n        const req = new HttpRequest({ ...getMockReqOptions(), port });\n\n        // Each request should be rejected because the server closes\n        // without sending a response. Subsequent requests may fail\n        // client-side (frameError on closed session) before reaching\n        // the server.\n        await rejects(nodeH2Handler.handle(req, {}), UNEXPECTEDLY_CLOSED_REGEX);\n        await rejects(nodeH2Handler.handle(req, {}), UNEXPECTEDLY_CLOSED_REGEX);\n        await rejects(nodeH2Handler.handle(req, {}), UNEXPECTEDLY_CLOSED_REGEX);\n\n        mockH2Server4.close();\n      });\n    });\n\n    describe(\"destroy\", () => {\n      it(\"destroys session and clears connectionPools\", async () => {\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        const sessionRef = getFirstSession(nodeH2Handler, authority);\n        const session: ClientHttp2Session = sessionRef.deref();\n\n        expect(getConnectionPools(nodeH2Handler).size).toBe(1);\n        expect(session.destroyed).toBe(false);\n        nodeH2Handler.destroy();\n        expect(getConnectionPools(nodeH2Handler).size).toBe(0);\n        expect(session.destroyed).toBe(true);\n      });\n    });\n\n    describe(\"abortSignal\", () => {\n      it(\"will not create session if request already aborted\", async () => {\n        expect(getConnectionPools(nodeH2Handler).size).toBe(0);\n        await expect(\n          nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {\n            abortSignal: {\n              aborted: true,\n              onabort: null,\n            },\n          })\n        ).rejects.toHaveProperty(\"name\", \"AbortError\");\n        expect(getConnectionPools(nodeH2Handler).size).toBe(0);\n      });\n\n      it(\"will not create request on session if request already aborted\", async () => {\n        // Create a session by sending a request.\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        const session: ClientHttp2Session = getFirstSession(nodeH2Handler, authority).deref();\n        const requestSpy = vi.spyOn(session, \"request\");\n\n        await expect(\n          nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {\n            abortSignal: {\n              aborted: true,\n              onabort: null,\n            },\n          })\n        ).rejects.toHaveProperty(\"name\", \"AbortError\");\n        expect(requestSpy.mock.calls.length).toBe(0);\n      });\n\n      it.each([\n        { AbortController, label: \"native\" },\n        { AbortController: AbortControllerPolyfill, label: \"polyfill\" },\n      ])(\"will close request on session when aborted ($label)\", async ({ AbortController }) => {\n        const abortController = new AbortController();\n        mockH2Server.removeAllListeners(\"request\");\n        mockH2Server.on(\"request\", () => {\n          abortController.abort();\n          return createResponseFunction(mockResponse);\n        });\n\n        await expect(\n          nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {\n            abortSignal: abortController.signal,\n          })\n        ).rejects.toHaveProperty(\"name\", \"AbortError\");\n      });\n    });\n  });\n\n  describe(\"requestTimeout\", () => {\n    const requestTimeout = 200;\n\n    describe(\"does not throw error when request not timed out\", () => {\n      it.each([\n        [\"static object\", { requestTimeout }],\n        [\"object provider\", async () => ({ requestTimeout })],\n      ])(\"disableConcurrentStreams: false (default) in constructor parameter of %s\", async (_, options) => {\n        mockH2Server.removeAllListeners(\"request\");\n        mockH2Server.on(\"request\", createResponseFunctionWithDelay(mockResponse, requestTimeout - 100));\n\n        nodeH2Handler = new NodeHttp2Handler(options);\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n      });\n\n      it.each([\n        [\"static object\", { requestTimeout, disableConcurrentStreams: true }],\n        [\"object provider\", async () => ({ requestTimeout, disableConcurrentStreams: true })],\n      ])(\"disableConcurrentStreams: true in constructor parameter of %s\", async (_, options) => {\n        mockH2Server.removeAllListeners(\"request\");\n        mockH2Server.on(\"request\", createResponseFunctionWithDelay(mockResponse, requestTimeout - 100));\n\n        nodeH2Handler = new NodeHttp2Handler(options);\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n      });\n    });\n\n    describe(\"throws timeoutError on requestTimeout\", () => {\n      it.each([\n        [\"static object\", { requestTimeout }],\n        [\"object provider\", async () => ({ requestTimeout })],\n      ])(\"disableConcurrentStreams: false (default) in constructor parameter of %s\", async (_, options) => {\n        mockH2Server.removeAllListeners(\"request\");\n        mockH2Server.on(\"request\", createResponseFunctionWithDelay(mockResponse, requestTimeout + 100));\n\n        nodeH2Handler = new NodeHttp2Handler(options);\n        await rejects(nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {}), {\n          name: \"TimeoutError\",\n          message: `Stream timed out because of no activity for ${requestTimeout} ms`,\n        });\n      });\n\n      it.each([\n        [\"object provider\", async () => ({ requestTimeout })],\n        [\"static object\", { requestTimeout }],\n      ])(\"disableConcurrentStreams: true in constructor parameter of %s\", async () => {\n        mockH2Server.removeAllListeners(\"request\");\n        mockH2Server.on(\"request\", createResponseFunctionWithDelay(mockResponse, requestTimeout + 100));\n\n        nodeH2Handler = new NodeHttp2Handler({ requestTimeout, disableConcurrentStreams: true });\n        await rejects(nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {}), {\n          name: \"TimeoutError\",\n          message: `Stream timed out because of no activity for ${requestTimeout} ms`,\n        });\n      });\n    });\n  });\n\n  describe(\"sessionTimeout\", () => {\n    const sessionTimeout = 200;\n\n    describe(\"destroys sessions on sessionTimeout\", () => {\n      it.each([\n        [\"object provider\", async () => ({ sessionTimeout })],\n        [\"static object\", { sessionTimeout }],\n      ])(\"disableConcurrentStreams: false (default) in constructor parameter of %s\", async (_, options) => {\n        nodeH2Handler = new NodeHttp2Handler(options);\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), { requestTimeout: sessionTimeout });\n\n        const session: ClientHttp2Session = getFirstSession(nodeH2Handler, authority).deref();\n        expect(session.destroyed).toBe(false);\n        expect(getSessions(nodeH2Handler, authority).length).toStrictEqual(1);\n        await promisify(setTimeout)(sessionTimeout + 100);\n        expect(session.destroyed).toBe(true);\n        expect(getSessions(nodeH2Handler, authority).length).toStrictEqual(0);\n      });\n\n      it.each([\n        [\"object provider\", async () => ({ sessionTimeout, disableConcurrentStreams: true })],\n        [\"static object\", { sessionTimeout, disableConcurrentStreams: true }],\n      ])(\"disableConcurrentStreams: true in constructor parameter of %s\", async (_, options) => {\n        let session: any;\n\n        nodeH2Handler = new NodeHttp2Handler(options);\n\n        const connectReal = http2.connect;\n        vi.spyOn(http2, \"connect\").mockImplementation((...args: any[]) => {\n          session = connectReal(args[0], args[1]);\n          return session;\n        });\n\n        mockH2Server.removeAllListeners(\"request\");\n        mockH2Server.on(\"request\", (request: any, response: any) => {\n          createResponseFunction(mockResponse)(request, response);\n        });\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        expect(session?.destroyed).toBe(false);\n        await promisify(setTimeout)(sessionTimeout + 100);\n        expect(session?.destroyed).toBe(true);\n      });\n    });\n  });\n\n  describe(\"maxConcurrency\", () => {\n    it.each([\n      [\"static object\", {}],\n      [\"static object\", { maxConcurrentStreams: 0 }],\n      [\"static object\", { maxConcurrentStreams: 1 }],\n      [\"static object\", { maxConcurrentStreams: 2 }],\n      [\"static object\", { maxConcurrentStreams: 3 }],\n    ])(\"verify session settings' maxConcurrentStreams\", async (_, options: NodeHttp2HandlerOptions) => {\n      nodeH2Handler = new NodeHttp2Handler(options);\n\n      await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n      const session = getFirstSession(nodeH2Handler, authority).deref();\n\n      if (options.maxConcurrentStreams) {\n        expect(session.localSettings.maxConcurrentStreams).toBe(options.maxConcurrentStreams);\n      } else {\n        expect(session.localSettings.maxConcurrentStreams).toBe(4294967295);\n      }\n    });\n\n    it(\"verify error thrown when maxConcurrentStreams is negative\", async () => {\n      let error: Error | undefined = undefined;\n      try {\n        nodeH2Handler = new NodeHttp2Handler({ maxConcurrentStreams: -1 });\n\n        const options = getMockReqOptions();\n        await nodeH2Handler.handle(new HttpRequest(options), {});\n      } catch (e) {\n        error = e;\n      }\n\n      expect(error).toBeDefined();\n      expect(error!.message).toEqual(\"maxConcurrentStreams must be greater than zero.\");\n    });\n  });\n\n  it(\"will throw reasonable error when connection aborted abnormally\", async () => {\n    nodeH2Handler = new NodeHttp2Handler();\n    // Create a session by sending a request.\n    await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n    const session: ClientHttp2Session = getFirstSession(nodeH2Handler, authority).deref();\n    const fakeStream = new Duplex() as ClientHttp2Stream;\n    const fakeRstCode = 1;\n    // @ts-ignore: fake result code\n    (fakeStream as Mutable<typeof fakeStream>).rstCode = fakeRstCode;\n    vi.spyOn(session, \"request\").mockImplementation(() => fakeStream);\n    getConnectionPools(nodeH2Handler).set(authority, new NodeHttp2ConnectionPool([session]));\n    // Delay response so that onabort is called earlier\n    timing.setTimeout(() => {\n      fakeStream.emit(\"aborted\");\n    }, 0);\n\n    await expect(nodeH2Handler.handle(new HttpRequest({ ...getMockReqOptions() }), {})).rejects.toHaveProperty(\n      \"message\",\n      `HTTP/2 stream is abnormally aborted in mid-communication with result code ${fakeRstCode}.`\n    );\n  });\n\n  it(\"will throw reasonable error when frameError is thrown\", async () => {\n    nodeH2Handler = new NodeHttp2Handler();\n    // Create a session by sending a request.\n    await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n    const session: ClientHttp2Session = getFirstSession(nodeH2Handler, authority).deref();\n    const fakeStream = new Duplex() as ClientHttp2Stream;\n    vi.spyOn(session, \"request\").mockImplementation(() => fakeStream);\n    getConnectionPools(nodeH2Handler).set(authority, new NodeHttp2ConnectionPool([session]));\n    // Delay response so that onabort is called earlier\n    timing.setTimeout(() => {\n      fakeStream.emit(\"frameError\", \"TYPE\", \"CODE\", \"ID\");\n    }, 0);\n\n    await expect(nodeH2Handler.handle(new HttpRequest({ ...getMockReqOptions() }), {})).rejects.toHaveProperty(\n      \"message\",\n      `Frame type id TYPE in stream id ID has failed with code CODE.`\n    );\n  });\n\n  describe(\"per-request requestTimeout\", () => {\n    it(\"should use per-request timeout over handler config timeout\", async () => {\n      const nodeH2Handler = new NodeHttp2Handler({ requestTimeout: 5000 });\n\n      const mockH2Server = mockH2Servers[port1];\n      mockH2Server.removeAllListeners(\"request\");\n      mockH2Server.on(\"request\", () => {\n        // don't respond - let it timeout\n      });\n\n      const mockRequest = new HttpRequest(getMockReqOptions());\n\n      const start = Date.now();\n      await expect(nodeH2Handler.handle(mockRequest, { requestTimeout: 100 })).rejects.toHaveProperty(\n        \"name\",\n        \"TimeoutError\"\n      );\n\n      const elapsed = Date.now() - start;\n      expect(elapsed).toBeLessThan(200);\n    });\n\n    it(\"should fall back to handler config timeout when per-request timeout not provided\", async () => {\n      const nodeH2Handler = new NodeHttp2Handler({ requestTimeout: 100 });\n\n      const mockH2Server = mockH2Servers[port1];\n      mockH2Server.removeAllListeners(\"request\");\n      mockH2Server.on(\"request\", () => {});\n\n      const mockRequest = new HttpRequest(getMockReqOptions());\n\n      const start = Date.now();\n      await expect(nodeH2Handler.handle(mockRequest, {})).rejects.toHaveProperty(\"name\", \"TimeoutError\");\n\n      const elapsed = Date.now() - start;\n      expect(elapsed).toBeLessThan(200);\n    });\n  });\n\n  describe.each([\n    [\"object provider\", async () => ({ disableConcurrentStreams: true })],\n    [\"static object\", { disableConcurrentStreams: true }],\n  ])(\"disableConcurrentStreams in constructor parameter of %s\", (_, options) => {\n    beforeEach(() => {\n      nodeH2Handler = new NodeHttp2Handler(options);\n    });\n\n    describe(\"number calls to http2.connect\", () => {\n      it(\"is zero on initialization\", () => {\n        const connectSpy = vi.spyOn(http2, \"connect\");\n        expect(connectSpy).not.toHaveBeenCalled();\n      });\n\n      it(\"is one when request is made\", async () => {\n        const connectSpy = vi.spyOn(http2, \"connect\");\n\n        // Make single request.\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n        expect(connectSpy).toHaveBeenCalledTimes(1);\n        expect(connectSpy).toHaveBeenCalledWith(authority);\n      });\n\n      it(\"is many if multiple requests are made on same URL\", async () => {\n        const connectSpy = vi.spyOn(http2, \"connect\");\n\n        // Make two requests.\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        expect(connectSpy).toHaveBeenCalledTimes(2);\n        expect(connectSpy).toHaveBeenNthCalledWith(1, authority);\n        expect(connectSpy).toHaveBeenNthCalledWith(2, authority);\n      });\n\n      it(\"is many if requests are made on different URLs\", async () => {\n        const connectSpy = vi.spyOn(http2, \"connect\");\n\n        // Make first request on default URL.\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        const mockH2Server2 = mockH2Servers[port2];\n        mockH2Server2.on(\"request\", createResponseFunction(mockResponse));\n\n        // Make second request on URL with port2.\n        await nodeH2Handler.handle(new HttpRequest({ ...getMockReqOptions(), port: port2 }), {});\n\n        const authorityPrefix = `${protocol}//${hostname}`;\n        expect(connectSpy).toHaveBeenCalledTimes(2);\n        expect(connectSpy).toHaveBeenNthCalledWith(1, `${authorityPrefix}:${port1}/`);\n        expect(connectSpy).toHaveBeenNthCalledWith(2, `${authorityPrefix}:${port2}/`);\n        mockH2Server2.close();\n      });\n    });\n\n    describe(\"destroy\", () => {\n      it(\"destroys session and empties connectionPools\", async () => {\n        const connectReal = http2.connect;\n        let createdSession: ClientHttp2Session | undefined;\n        vi.spyOn(http2, \"connect\").mockImplementation((...args: any[]) => {\n          const session = connectReal(args[0], args[1]);\n          createdSession = session;\n          return session;\n        });\n\n        await nodeH2Handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n        // Isolated sessions (disableConcurrentStreams) are not in the pool.\n        expect(createdSession).toBeDefined();\n        expect(createdSession!.destroyed).toBe(false);\n\n        nodeH2Handler.destroy();\n        // Pool should be empty (isolated sessions were never added).\n        expect(getConnectionPools(nodeH2Handler).size).toBe(0);\n      });\n    });\n  });\n\n  describe(\"server\", () => {\n    let server: Http2Server;\n\n    beforeEach(async () => {\n      const port = await getPort({ port: portNumbers(45_321, 50_000) });\n      server = createMockHttp2Server().listen(port);\n    });\n\n    afterEach(() => {\n      server.close();\n    });\n\n    it(\"sends the request to the correct url\", async () => {\n      server.on(\"request\", (request, response) => {\n        expect(request.url).toBe(\"http://foo:bar@localhost/foo/bar?foo=bar#foo\");\n        response.statusCode = 200;\n      });\n      const handler = new NodeHttp2Handler({});\n      await handler.handle({\n        ...getMockReqOptions(),\n        username: \"foo\",\n        password: \"bar\",\n        path: \"/foo/bar\",\n        query: { foo: \"bar\" },\n        fragment: \"foo\",\n      } as any);\n      handler.destroy();\n    });\n\n    it(\"put HttpClientConfig\", async () => {\n      server.on(\"request\", (request, response) => {\n        expect(request.url).toBe(\"http://foo:bar@localhost/\");\n        response.statusCode = 200;\n      });\n      const handler = new NodeHttp2Handler({});\n\n      const requestTimeout = 200;\n\n      handler.updateHttpClientConfig(\"requestTimeout\", requestTimeout);\n\n      await handler.handle({\n        ...getMockReqOptions(),\n        username: \"foo\",\n        password: \"bar\",\n        path: \"/\",\n      } as any);\n      handler.destroy();\n\n      expect(handler.httpHandlerConfigs().requestTimeout).toEqual(requestTimeout);\n    });\n\n    it(\"update existing HttpClientConfig\", async () => {\n      server.on(\"request\", (request, response) => {\n        expect(request.url).toBe(\"http://foo:bar@localhost/\");\n        response.statusCode = 200;\n      });\n      const handler = new NodeHttp2Handler({ requestTimeout: 200 });\n\n      const requestTimeout = 300;\n\n      handler.updateHttpClientConfig(\"requestTimeout\", requestTimeout);\n\n      await handler.handle({\n        ...getMockReqOptions(),\n        username: \"foo\",\n        password: \"bar\",\n        path: \"/\",\n      } as any);\n      handler.destroy();\n\n      expect(handler.httpHandlerConfigs().requestTimeout).toEqual(requestTimeout);\n    });\n  });\n\n  it(\"httpHandlerConfigs returns empty object if handle is not called\", async () => {\n    const nodeHttpHandler = new NodeHttp2Handler();\n    expect(nodeHttpHandler.httpHandlerConfigs()).toEqual({});\n  });\n\n  describe(\"ref-counting for http2 sessions\", () => {\n    let createdSessions: ClientHttp2Session[];\n    const connectReal = http2.connect;\n\n    beforeEach(() => {\n      createdSessions = [];\n      vi.spyOn(http2, \"connect\").mockImplementation((...args: any[]) => {\n        const session = connectReal(args[0], args[1]);\n        vi.spyOn(session, \"ref\");\n        vi.spyOn(session, \"unref\");\n        createdSessions.push(session);\n        return session;\n      });\n    });\n\n    it(\"acquires ref on request start and releases on stream close\", async () => {\n      const handler = new NodeHttp2Handler();\n      const { response } = await handler.handle(new HttpRequest(getMockReqOptions()), {});\n      const session = createdSessions[0];\n\n      // constructor unref + get() ref = session is ref'd (keeping node alive)\n      expect(session.unref).toHaveBeenCalledTimes(1);\n      expect(session.ref).toHaveBeenCalledTimes(1);\n\n      // close the response stream to trigger req \"close\" -> ref.free()\n      const body = response.body as ClientHttp2Stream;\n      const closePromise = new Promise((resolve) => body.once(\"close\", resolve));\n      body.destroy();\n      await closePromise;\n\n      // free() reached zero -> unref called again\n      expect(session.unref).toHaveBeenCalledTimes(2);\n      handler.destroy();\n    });\n\n    it(\"maintains positive refcount across concurrent requests on same session\", async () => {\n      const handler = new NodeHttp2Handler();\n      const { response: r1 } = await handler.handle(new HttpRequest(getMockReqOptions()), {});\n      const { response: r2 } = await handler.handle(new HttpRequest(getMockReqOptions()), {});\n      const session = createdSessions[0];\n\n      // 1 session, 2 get() calls\n      expect(createdSessions).toHaveLength(1);\n      expect(session.ref).toHaveBeenCalledTimes(2);\n      // only constructor unref so far (refcount is 2, not zero)\n      expect(session.unref).toHaveBeenCalledTimes(1);\n\n      // close first stream — refcount drops to 1, no unref\n      const body1 = r1.body as ClientHttp2Stream;\n      const close1 = new Promise((resolve) => body1.once(\"close\", resolve));\n      body1.destroy();\n      await close1;\n      expect(session.unref).toHaveBeenCalledTimes(1); // still 1\n\n      // close second stream — refcount drops to 0, unref called\n      const body2 = r2.body as ClientHttp2Stream;\n      const close2 = new Promise((resolve) => body2.once(\"close\", resolve));\n      body2.destroy();\n      await close2;\n      expect(session.unref).toHaveBeenCalledTimes(2);\n      handler.destroy();\n    });\n\n    it(\"opens additional sessions when maxConcurrentStreams is reached\", async () => {\n      const maxConcurrentStreams = 3;\n      const totalRequests = 10;\n      const handler = new NodeHttp2Handler({ maxConcurrentStreams });\n\n      // Fire all requests concurrently.\n      const responses = await Promise.all(\n        Array.from({ length: totalRequests }, () => handler.handle(new HttpRequest(getMockReqOptions()), {}))\n      );\n\n      // 10 requests at concurrency 3 = ceil(10/3) = 4 sessions.\n      expect(createdSessions).toHaveLength(4);\n\n      const pools = getConnectionManager(handler).debug();\n      const sessions = pools[authority].sessions;\n      const inFlightCounts = sessions.map((s: any) => s.active).sort();\n      expect(inFlightCounts).toEqual([1, 3, 3, 3]);\n\n      // Close all streams.\n      for (const { response } of responses) {\n        const body = response.body as ClientHttp2Stream;\n        const close = new Promise((resolve) => body.once(\"close\", resolve));\n        body.destroy();\n        await close;\n      }\n\n      const poolsAfter = getConnectionManager(handler).debug();\n      for (const s of poolsAfter[authority].sessions) {\n        expect(s.active).toBe(0);\n      }\n\n      handler.destroy();\n    });\n  });\n\n  describe(\"nodeHttp2ConnectOptions\", () => {\n    it(\"passes nodeHttp2ConnectOptions to http2.connect\", async () => {\n      const handler = new NodeHttp2Handler({ nodeHttp2ConnectOptions: { maxSessionMemory: 64 } });\n      const connectSpy = vi.spyOn(http2, \"connect\");\n      await handler.handle(new HttpRequest(getMockReqOptions()), {});\n      expect(connectSpy).toHaveBeenCalledWith(authority, { maxSessionMemory: 64 });\n      handler.destroy();\n    });\n\n    it(\"passes nodeHttp2ConnectOptions to http2.connect for isolated sessions\", async () => {\n      const handler = new NodeHttp2Handler({\n        disableConcurrentStreams: true,\n        nodeHttp2ConnectOptions: { maxSessionMemory: 64 },\n      });\n      const connectSpy = vi.spyOn(http2, \"connect\");\n\n      await handler.handle(new HttpRequest(getMockReqOptions()), {});\n\n      expect(connectSpy).toHaveBeenCalledWith(authority, { maxSessionMemory: 64 });\n      handler.destroy();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/node-http2-handler.ts",
    "content": "import { constants, type ClientSessionOptions, type SecureClientSessionOptions } from \"node:http2\";\nimport { HttpResponse, buildQueryString, type HttpHandler, type HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpHandlerOptions, Provider, RequestContext } from \"@smithy/types\";\n\nimport { buildAbortError } from \"./build-abort-error\";\nimport { getTransformedHeaders } from \"./get-transformed-headers\";\nimport { NodeHttp2ConnectionManager } from \"./node-http2-connection-manager\";\nimport { writeRequestBody } from \"./write-request-body\";\n\n/**\n * Represents the http2 options that can be passed to a node http2 client.\n * @public\n */\nexport interface NodeHttp2HandlerOptions {\n  /**\n   * The maximum time in milliseconds that a stream may remain idle before it\n   * is closed.\n   */\n  requestTimeout?: number;\n\n  /**\n   * The maximum time in milliseconds that a session or socket may remain idle\n   * before it is closed.\n   * https://nodejs.org/docs/latest-v12.x/api/http2.html#http2_http2session_and_sockets\n   */\n  sessionTimeout?: number;\n\n  /**\n   * Disables processing concurrent streams on a ClientHttp2Session instance. When set\n   * to true, a new session instance is created for each request to a URL.\n   * **Default:** false.\n   * https://nodejs.org/api/http2.html#http2_class_clienthttp2session\n   */\n  disableConcurrentStreams?: boolean;\n\n  /**\n   * Maximum number of concurrent Http2Stream instances per ClientHttp2Session. Each session\n   * may have up to 2^31-1 Http2Stream instances over its lifetime.\n   * This value must be greater than or equal to 0.\n   * https://nodejs.org/api/http2.html#class-http2stream\n   */\n  maxConcurrentStreams?: number;\n\n  /**\n   * A set of raw options that will be passed to http2.connect.\n   * https://nodejs.org/api/http2.html#http2connectauthority-options-listener\n   */\n  nodeHttp2ConnectOptions?: Partial<SecureClientSessionOptions | ClientSessionOptions>;\n}\n\n/**\n * This is derived from the smithyContext object. This signals to the NodeHttp2Handler specifically\n * that the connection pool should not be used to acquire a connection. The event stream should\n * have its own new connection.\n *\n * This does not apply to WebSocket event streams, since there is no pooling.\n *\n * @internal\n */\ntype EventStreamSignal = {\n  isEventStream?: boolean;\n};\n\n/**\n * A request handler using the node:http2 package.\n * @public\n */\nexport class NodeHttp2Handler implements HttpHandler<NodeHttp2HandlerOptions> {\n  private config?: NodeHttp2HandlerOptions;\n  private configProvider: Promise<NodeHttp2HandlerOptions>;\n\n  public readonly metadata = { handlerProtocol: \"h2\" };\n\n  private readonly connectionManager: NodeHttp2ConnectionManager = new NodeHttp2ConnectionManager({});\n\n  /**\n   * @returns the input if it is an HttpHandler of any class,\n   * or instantiates a new instance of this handler.\n   */\n  public static create(\n    instanceOrOptions?: HttpHandler<any> | NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>\n  ) {\n    if (typeof (instanceOrOptions as any)?.handle === \"function\") {\n      // is already an instance of HttpHandler.\n      return instanceOrOptions as HttpHandler<any>;\n    }\n    // input is ctor options or undefined.\n    return new NodeHttp2Handler(instanceOrOptions as NodeHttp2HandlerOptions);\n  }\n\n  constructor(options?: NodeHttp2HandlerOptions | Provider<NodeHttp2HandlerOptions | void>) {\n    this.configProvider = new Promise((resolve, reject) => {\n      if (typeof options === \"function\") {\n        options()\n          .then((opts) => {\n            resolve(opts || {});\n          })\n          .catch(reject);\n      } else {\n        resolve(options || {});\n      }\n    });\n  }\n\n  public destroy(): void {\n    this.connectionManager.destroy();\n  }\n\n  public async handle(\n    request: HttpRequest,\n    { abortSignal, requestTimeout, isEventStream }: HttpHandlerOptions & EventStreamSignal = {}\n  ): Promise<{ response: HttpResponse }> {\n    if (!this.config) {\n      this.config = await this.configProvider;\n      const { disableConcurrentStreams, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config;\n\n      this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);\n      if (maxConcurrentStreams) {\n        this.connectionManager.setMaxConcurrentStreams(maxConcurrentStreams);\n      }\n      if (nodeHttp2ConnectOptions) {\n        this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions);\n      }\n    }\n\n    const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;\n    const useIsolatedSession = disableConcurrentStreams || isEventStream;\n    const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;\n\n    return new Promise((_resolve, _reject) => {\n      // It's redundant to track fulfilled because promises use the first resolution/rejection\n      // but avoids generating unnecessary stack traces in the \"close\" event handler.\n      let fulfilled = false;\n\n      let writeRequestBodyPromise: Promise<void> | undefined = undefined;\n      const resolve = async (arg: { response: HttpResponse }) => {\n        await writeRequestBodyPromise;\n        _resolve(arg);\n      };\n      const reject = async (arg: unknown) => {\n        await writeRequestBodyPromise;\n        _reject(arg);\n      };\n\n      // if the request was already aborted, prevent doing extra work\n      if (abortSignal?.aborted) {\n        fulfilled = true;\n        const abortError = buildAbortError(abortSignal);\n        reject(abortError);\n        return;\n      }\n\n      const { hostname, method, port, protocol, query } = request;\n      let auth = \"\";\n      if (request.username != null || request.password != null) {\n        const username = request.username ?? \"\";\n        const password = request.password ?? \"\";\n        auth = `${username}:${password}@`;\n      }\n      const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : \"\"}`;\n      const requestContext = { destination: new URL(authority) } as RequestContext;\n\n      const connectConfig = {\n        requestTimeout: this.config?.sessionTimeout,\n        isEventStream,\n      };\n      const ref = useIsolatedSession\n        ? this.connectionManager.createIsolatedSession(requestContext, connectConfig)\n        : this.connectionManager.lease(requestContext, connectConfig);\n\n      const session = ref.deref();\n\n      const rejectWithDestroy = (err: Error) => {\n        if (useIsolatedSession) {\n          ref.destroy();\n        }\n        fulfilled = true;\n        reject(err);\n      };\n\n      const queryString = query ? buildQueryString(query) : \"\";\n      let path = request.path;\n      if (queryString) {\n        path += `?${queryString}`;\n      }\n      if (request.fragment) {\n        path += `#${request.fragment}`;\n      }\n      // create the http2 request\n      const clientHttp2Stream = session.request({\n        ...request.headers,\n        [constants.HTTP2_HEADER_PATH]: path,\n        [constants.HTTP2_HEADER_METHOD]: method,\n      });\n\n      if (effectiveRequestTimeout) {\n        clientHttp2Stream.setTimeout(effectiveRequestTimeout, () => {\n          clientHttp2Stream.close();\n          const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`);\n          timeoutError.name = \"TimeoutError\";\n          rejectWithDestroy(timeoutError);\n        });\n      }\n\n      if (abortSignal) {\n        const onAbort = () => {\n          clientHttp2Stream.close();\n          const abortError = buildAbortError(abortSignal);\n          rejectWithDestroy(abortError);\n        };\n        if (typeof (abortSignal as AbortSignal).addEventListener === \"function\") {\n          // preferred.\n          const signal = abortSignal as AbortSignal;\n          signal.addEventListener(\"abort\", onAbort, { once: true });\n          clientHttp2Stream.once(\"close\", () => signal.removeEventListener(\"abort\", onAbort));\n        } else {\n          // backwards compatibility\n          abortSignal.onabort = onAbort;\n        }\n      }\n\n      // Set up handlers for errors\n      clientHttp2Stream.on(\"frameError\", (type: number, code: number, id: number) => {\n        rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`));\n      });\n      clientHttp2Stream.on(\"error\", rejectWithDestroy);\n      clientHttp2Stream.on(\"aborted\", () => {\n        rejectWithDestroy(\n          new Error(\n            `HTTP/2 stream is abnormally aborted in mid-communication with result code ${clientHttp2Stream.rstCode}.`\n          )\n        );\n      });\n\n      clientHttp2Stream.on(\"response\", (headers) => {\n        const httpResponse = new HttpResponse({\n          statusCode: headers[\":status\"] ?? -1,\n          headers: getTransformedHeaders(headers),\n          body: clientHttp2Stream,\n        });\n        fulfilled = true;\n        resolve({ response: httpResponse });\n\n        if (useIsolatedSession) {\n          // Gracefully closes the Http2Session, allowing any existing streams to complete\n          // on their own and preventing new Http2Stream instances from being created.\n          session.close();\n        }\n      });\n\n      // The HTTP/2 error code used when closing the stream can be retrieved using the\n      // http2stream.rstCode property. If the code is any value other than NGHTTP2_NO_ERROR (0),\n      // an 'error' event will have also been emitted.\n      clientHttp2Stream.on(\"close\", () => {\n        if (useIsolatedSession) {\n          ref.destroy();\n        } else {\n          this.connectionManager.release(requestContext, ref);\n        }\n        if (!fulfilled) {\n          rejectWithDestroy(new Error(\"Unexpected error: http2 request did not get a response\"));\n        }\n      });\n\n      writeRequestBodyPromise = writeRequestBody(clientHttp2Stream, request, effectiveRequestTimeout);\n    });\n  }\n\n  public updateHttpClientConfig(key: keyof NodeHttp2HandlerOptions, value: NodeHttp2HandlerOptions[typeof key]): void {\n    this.config = undefined;\n    this.configProvider = this.configProvider.then((config) => {\n      return {\n        ...config,\n        [key]: value,\n      };\n    });\n  }\n\n  public httpHandlerConfigs(): NodeHttp2HandlerOptions {\n    return this.config ?? {};\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/readable.mock.ts",
    "content": "import { Readable, type ReadableOptions } from \"node:stream\";\n\nexport interface ReadFromBuffersOptions extends ReadableOptions {\n  buffers: Buffer[];\n  errorAfter?: number;\n}\n\nexport class ReadFromBuffers extends Readable {\n  private buffersToRead: Buffer[];\n  private numBuffersRead = 0;\n\n  private errorAfter: number;\n  constructor(options: ReadFromBuffersOptions) {\n    super(options);\n    this.buffersToRead = options.buffers;\n    this.errorAfter = typeof options.errorAfter === \"number\" ? options.errorAfter : -1;\n  }\n\n  _read() {\n    if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) {\n      this.emit(\"error\", new Error(\"Mock Error\"));\n      return;\n    }\n    if (this.numBuffersRead >= this.buffersToRead.length) {\n      return this.push(null);\n    }\n    return this.push(this.buffersToRead[this.numBuffersRead++]);\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/server.mock.ts",
    "content": "import { readFileSync } from \"node:fs\";\nimport { createServer as createHttp2Server, type Http2Server } from \"node:http2\";\nimport {\n  createServer as createHttpServer,\n  type Server as HttpServer,\n  type IncomingMessage,\n  type ServerResponse,\n} from \"node:http\";\nimport { createServer as createHttpsServer, type Server as HttpsServer } from \"node:https\";\nimport { join } from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport type { HeaderBag, HttpResponse, NodeJsRuntimeBlobTypes } from \"@smithy/types\";\n\nimport { timing } from \"./timing\";\n\nconst fixturesDir = join(__dirname, \"..\", \"fixtures\");\n\nconst setResponseHeaders = (response: ServerResponse, headers: HeaderBag) => {\n  for (const [key, value] of Object.entries(headers)) {\n    response.setHeader(key, value);\n  }\n};\n\nconst setResponseBody = (response: ServerResponse, body: string | NodeJsRuntimeBlobTypes) => {\n  if (body instanceof Readable) {\n    body.pipe(response);\n  } else {\n    response.end(body);\n  }\n};\n\nexport const createResponseFunction =\n  (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => {\n    response.statusCode = httpResp.statusCode;\n    if (httpResp.reason) {\n      response.statusMessage = httpResp.reason;\n    }\n    setResponseHeaders(response, httpResp.headers);\n    setResponseBody(response, httpResp.body);\n  };\n\nexport const createResponseFunctionWithDelay =\n  (httpResp: HttpResponse, delay: number) => (request: IncomingMessage, response: ServerResponse) => {\n    response.statusCode = httpResp.statusCode;\n    if (httpResp.reason) {\n      response.statusMessage = httpResp.reason;\n    }\n    setResponseHeaders(response, httpResp.headers);\n    timing.setTimeout(() => setResponseBody(response, httpResp.body), delay);\n  };\n\nexport const createContinueResponseFunction =\n  (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => {\n    response.writeContinue();\n    timing.setTimeout(() => {\n      createResponseFunction(httpResp)(request, response);\n    }, 100);\n  };\n\nexport const createMockHttpsServer = (): HttpsServer => {\n  const server = createHttpsServer({\n    key: readFileSync(join(fixturesDir, \"test-server-key.pem\")),\n    cert: readFileSync(join(fixturesDir, \"test-server-cert.pem\")),\n  });\n  return server;\n};\n\nexport const createMockHttpServer = (): HttpServer => {\n  const server = createHttpServer();\n  return server;\n};\n\nexport const createMockHttp2Server = (): Http2Server => {\n  const server = createHttp2Server();\n  return server;\n};\n\nexport const createMirrorResponseFunction =\n  (httpResp: HttpResponse) => (request: IncomingMessage, response: ServerResponse) => {\n    const bufs: Buffer[] = [];\n    request.on(\"data\", (chunk) => {\n      bufs.push(chunk);\n    });\n    request.on(\"end\", () => {\n      response.statusCode = httpResp.statusCode;\n      setResponseHeaders(response, httpResp.headers);\n      setResponseBody(response, Buffer.concat(bufs));\n    });\n    request.on(\"error\", (err) => {\n      response.statusCode = 500;\n      setResponseHeaders(response, httpResp.headers);\n      setResponseBody(response, err.message);\n    });\n  };\n\nexport const getResponseBody = (response: HttpResponse) => {\n  return new Promise<string>((resolve, reject) => {\n    const bufs: Buffer[] = [];\n    response.body.on(\"data\", function (d: Buffer) {\n      bufs.push(d);\n    });\n    response.body.on(\"end\", function () {\n      resolve(Buffer.concat(bufs).toString());\n    });\n    response.body.on(\"error\", (err: Error) => {\n      reject(err);\n    });\n  });\n};\n"
  },
  {
    "path": "packages/node-http-handler/src/set-connection-timeout.spec.ts",
    "content": "import EventEmitter from \"node:events\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { setConnectionTimeout } from \"./set-connection-timeout\";\nimport { timing } from \"./timing\";\n\ndescribe(\"setConnectionTimeout\", () => {\n  const reject = vi.fn();\n  const clientRequest: any = {\n    on: vi.fn(),\n    destroy: vi.fn(),\n  };\n\n  vi.spyOn(timing, \"setTimeout\").mockImplementation(((fn: Function, ms: number) => {\n    return setTimeout(fn, ms);\n  }) as any);\n  vi.spyOn(timing, \"clearTimeout\").mockImplementation(((timer: any) => {\n    return clearTimeout(timer);\n  }) as any);\n\n  beforeEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"will not attach listeners if timeout is 0\", () => {\n    setConnectionTimeout(clientRequest, reject, 0);\n    expect(clientRequest.on).not.toHaveBeenCalled();\n  });\n\n  it(\"will not attach listeners if timeout is not provided\", () => {\n    setConnectionTimeout(clientRequest, reject);\n    expect(clientRequest.on).not.toHaveBeenCalled();\n  });\n\n  describe(\"when timeout is provided\", () => {\n    const timeoutInMs = 100;\n    const mockSocket = {\n      connecting: true,\n      on: vi.fn(),\n    };\n\n    beforeEach(() => {\n      vi.useFakeTimers();\n      vi.clearAllMocks();\n    });\n\n    afterEach(() => {\n      vi.advanceTimersByTime(10000);\n      vi.useRealTimers();\n    });\n\n    it(\"attaches listener\", () => {\n      setConnectionTimeout(clientRequest, reject, timeoutInMs);\n      expect(clientRequest.on).toHaveBeenCalledTimes(1);\n      expect(clientRequest.on).toHaveBeenCalledWith(\"socket\", expect.any(Function));\n    });\n\n    it(\"doesn't set timeout if socket is already connected\", () => {\n      setConnectionTimeout(clientRequest, reject, timeoutInMs);\n      expect(mockSocket.on).not.toHaveBeenCalled();\n      expect(timing.setTimeout).toHaveBeenCalled();\n      expect(reject).not.toHaveBeenCalled();\n    });\n\n    it(\"rejects and aborts request if socket isn't connected by timeout\", async () => {\n      setConnectionTimeout(clientRequest, reject, timeoutInMs);\n      clientRequest.on.mock.calls[0][1](mockSocket);\n      expect(timing.setTimeout).toHaveBeenCalledTimes(1);\n      expect(timing.setTimeout).toHaveBeenCalledWith(expect.any(Function), timeoutInMs);\n      expect(mockSocket.on).toHaveBeenCalledTimes(1);\n      expect(mockSocket.on).toHaveBeenCalledWith(\"connect\", expect.any(Function));\n\n      expect(clientRequest.destroy).not.toHaveBeenCalled();\n      expect(reject).not.toHaveBeenCalled();\n\n      // Fast-forward until timer has been executed.\n      vi.advanceTimersByTime(timeoutInMs);\n      expect(clientRequest.destroy).toHaveBeenCalledTimes(1);\n      expect(reject).toHaveBeenCalledTimes(1);\n      expect(reject).toHaveBeenCalledWith(\n        Object.assign(\n          new Error(\n            `@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`\n          ),\n          {\n            name: \"TimeoutError\",\n          }\n        )\n      );\n    });\n\n    it(\"calls socket operations directly if socket is available\", async () => {\n      setConnectionTimeout(clientRequest, reject, timeoutInMs);\n      const request = {\n        on: vi.fn(),\n        socket: {\n          on: vi.fn(),\n          connecting: true,\n        },\n        destroy() {},\n      } as any;\n      setConnectionTimeout(request, () => {}, 1);\n      vi.runAllTimers();\n\n      expect(request.socket.on).toHaveBeenCalled();\n      expect(request.on).not.toHaveBeenCalled();\n    });\n\n    it(\"clears timeout if socket gets connected\", () => {\n      const socket = new EventEmitter() as any;\n      socket.connecting = true;\n\n      setConnectionTimeout(\n        {\n          ...clientRequest,\n          socket,\n        },\n        reject,\n        timeoutInMs\n      );\n\n      expect(clientRequest.destroy).not.toHaveBeenCalled();\n      expect(reject).not.toHaveBeenCalled();\n      expect(timing.clearTimeout).not.toHaveBeenCalled();\n\n      // Fast-forward for half the amount of time and call connect callback to clear timer.\n      vi.advanceTimersByTime(timeoutInMs / 2);\n      socket.emit(\"connect\");\n\n      expect(timing.clearTimeout).toHaveBeenCalled();\n\n      // Fast-forward until timer has been executed.\n      vi.runAllTimers();\n      expect(clientRequest.destroy).not.toHaveBeenCalled();\n      expect(reject).not.toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/set-connection-timeout.ts",
    "content": "import type { ClientRequest } from \"node:http\";\n\nimport { timing } from \"./timing\";\n\nconst DEFER_EVENT_LISTENER_TIME = 1000;\n\nexport const setConnectionTimeout = (\n  request: ClientRequest,\n  reject: (err: Error) => void,\n  timeoutInMs = 0\n): NodeJS.Timeout | number => {\n  if (!timeoutInMs) {\n    return -1;\n  }\n\n  const registerTimeout = (offset: number) => {\n    // Throw a connecting timeout error unless a connection is made within time.\n    const timeoutId = timing.setTimeout(() => {\n      request.destroy();\n      reject(\n        Object.assign(\n          new Error(\n            `@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`\n          ),\n          {\n            name: \"TimeoutError\",\n          }\n        )\n      );\n    }, timeoutInMs - offset);\n\n    const doWithSocket = (socket: typeof request.socket) => {\n      if (socket?.connecting) {\n        socket.on(\"connect\", () => {\n          timing.clearTimeout(timeoutId);\n        });\n      } else {\n        timing.clearTimeout(timeoutId);\n      }\n    };\n\n    if (request.socket) {\n      doWithSocket(request.socket);\n    } else {\n      request.on(\"socket\", doWithSocket);\n    }\n  };\n\n  if (timeoutInMs < 2000) {\n    registerTimeout(0);\n    return 0;\n  }\n\n  return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);\n};\n"
  },
  {
    "path": "packages/node-http-handler/src/set-request-timeout.spec.ts",
    "content": "import { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { setRequestTimeout } from \"./set-request-timeout\";\n\ndescribe(\"setRequestTimeout\", () => {\n  const reject = vi.fn();\n  const clientRequest: any = {\n    destroy: vi.fn(),\n  };\n\n  beforeEach(() => {\n    vi.clearAllMocks();\n  });\n\n  it(\"returns -1 if no timeout is given\", () => {\n    {\n      const id = setRequestTimeout(clientRequest, reject, 0);\n      expect(id).toEqual(-1);\n    }\n    {\n      const id = setRequestTimeout(clientRequest, reject, undefined);\n      expect(id).toEqual(-1);\n    }\n  });\n\n  describe(\"when timeout is provided\", () => {\n    it(\"rejects after the timeout\", async () => {\n      setRequestTimeout(clientRequest, reject, 1, true);\n      await new Promise((r) => setTimeout(r, 2));\n      expect(reject).toHaveBeenCalledWith(\n        Object.assign(\n          new Error(\n            `@smithy/node-http-handler - [ERROR] a request has exceeded the configured ${1} ms requestTimeout.`\n          ),\n          {\n            name: \"TimeoutError\",\n            code: \"ETIMEDOUT\",\n          }\n        )\n      );\n      expect(clientRequest.destroy).toHaveBeenCalled();\n    });\n\n    it(\"logs a warning\", async () => {\n      const logger = {\n        ...console,\n        warn: vi.fn(),\n      };\n      setRequestTimeout(clientRequest, reject, 1, false, logger);\n      await new Promise((r) => setTimeout(r, 2));\n      expect(logger.warn).toHaveBeenCalledWith(\n        `@smithy/node-http-handler - [WARN] a request has exceeded the configured ${1} ms requestTimeout.` +\n          ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`\n      );\n      expect(clientRequest.destroy).not.toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/set-request-timeout.ts",
    "content": "import type { ClientRequest } from \"node:http\";\nimport type { Logger } from \"@smithy/types\";\n\nimport { timing } from \"./timing\";\n\n/**\n * @internal\n */\nexport const setRequestTimeout = (\n  req: ClientRequest,\n  reject: (err: Error) => void,\n  timeoutInMs = 0,\n  throwOnRequestTimeout?: boolean,\n  logger?: Logger\n) => {\n  if (timeoutInMs) {\n    return timing.setTimeout(() => {\n      let msg = `@smithy/node-http-handler - [${\n        throwOnRequestTimeout ? \"ERROR\" : \"WARN\"\n      }] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`;\n      if (throwOnRequestTimeout) {\n        const error = Object.assign(new Error(msg), {\n          name: \"TimeoutError\",\n          code: \"ETIMEDOUT\",\n        });\n        req.destroy(error);\n        reject(error);\n      } else {\n        msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`;\n        logger?.warn?.(msg);\n      }\n    }, timeoutInMs);\n  }\n  return -1;\n};\n"
  },
  {
    "path": "packages/node-http-handler/src/set-socket-keep-alive.spec.ts",
    "content": "import { EventEmitter } from \"node:events\";\nimport type { ClientRequest } from \"node:http\";\nimport { Socket } from \"node:net\";\nimport { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { setSocketKeepAlive } from \"./set-socket-keep-alive\";\n\ndescribe(\"setSocketKeepAlive\", () => {\n  let request: ClientRequest;\n  let socket: Socket;\n\n  beforeEach(() => {\n    request = new EventEmitter() as ClientRequest;\n    socket = new Socket();\n  });\n\n  it(\"should set keepAlive to true\", () => {\n    setSocketKeepAlive(request, { keepAlive: true }, 0);\n\n    const setKeepAliveSpy = vi.spyOn(socket, \"setKeepAlive\");\n    request.emit(\"socket\", socket);\n\n    expect(setKeepAliveSpy).toHaveBeenCalled();\n    expect(setKeepAliveSpy).toHaveBeenCalledWith(true, 0);\n  });\n\n  it(\"should set keepAlive to true with custom initialDelay\", () => {\n    const initialDelay = 5 * 1000;\n    setSocketKeepAlive(request, { keepAlive: true, keepAliveMsecs: initialDelay }, 0);\n\n    const setKeepAliveSpy = vi.spyOn(socket, \"setKeepAlive\");\n    request.emit(\"socket\", socket);\n\n    expect(setKeepAliveSpy).toHaveBeenCalled();\n    expect(setKeepAliveSpy).toHaveBeenCalledWith(true, initialDelay);\n  });\n\n  it(\"should not set keepAlive at all when keepAlive is false\", () => {\n    setSocketKeepAlive(request, { keepAlive: false }, 0);\n\n    const setKeepAliveSpy = vi.spyOn(socket, \"setKeepAlive\");\n    request.emit(\"socket\", socket);\n\n    expect(setKeepAliveSpy).not.toHaveBeenCalled();\n  });\n\n  it(\"calls socket operations directly if socket is available\", async () => {\n    const request = {\n      on: vi.fn(),\n      socket: {\n        setKeepAlive: vi.fn(),\n      },\n    } as any;\n    setSocketKeepAlive(request, { keepAlive: true, keepAliveMsecs: 1000 }, 0);\n\n    expect(request.socket.setKeepAlive).toHaveBeenCalled();\n    expect(request.on).not.toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/set-socket-keep-alive.ts",
    "content": "import type { ClientRequest } from \"node:http\";\n\nimport { timing } from \"./timing\";\n\nconst DEFER_EVENT_LISTENER_TIME = 3000;\n\nexport interface SocketKeepAliveOptions {\n  keepAlive: boolean;\n  keepAliveMsecs?: number;\n}\n\nexport const setSocketKeepAlive = (\n  request: ClientRequest,\n  { keepAlive, keepAliveMsecs }: SocketKeepAliveOptions,\n  deferTimeMs = DEFER_EVENT_LISTENER_TIME\n): NodeJS.Timeout | number => {\n  if (keepAlive !== true) {\n    return -1;\n  }\n\n  const registerListener = () => {\n    if (request.socket) {\n      request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);\n    } else {\n      request.on(\"socket\", (socket) => {\n        socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);\n      });\n    }\n  };\n\n  if (deferTimeMs === 0) {\n    registerListener();\n    return 0;\n  }\n\n  return timing.setTimeout(registerListener, deferTimeMs);\n};\n"
  },
  {
    "path": "packages/node-http-handler/src/set-socket-timeout.spec.ts",
    "content": "import { afterAll, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { setSocketTimeout } from \"./set-socket-timeout\";\nimport { timing } from \"./timing\";\n\ndescribe(\"setSocketTimeout\", () => {\n  const clientRequest: any = {\n    destroy: vi.fn(),\n    setTimeout: vi.fn(),\n  };\n\n  vi.spyOn(timing, \"setTimeout\").mockImplementation(((fn: Function, ms: number) => {\n    return setTimeout(fn, ms);\n  }) as any);\n  vi.spyOn(timing, \"clearTimeout\").mockImplementation(((timer: any) => {\n    return clearTimeout(timer);\n  }) as any);\n\n  beforeEach(() => {\n    vi.clearAllMocks();\n    vi.useFakeTimers();\n  });\n\n  afterAll(() => {\n    vi.clearAllMocks();\n    vi.useRealTimers();\n  });\n\n  it(`sets the request's timeout if provided`, () => {\n    setSocketTimeout(clientRequest, vi.fn(), 100);\n\n    expect(clientRequest.setTimeout).toHaveBeenCalledTimes(1);\n    expect(clientRequest.setTimeout).toHaveBeenLastCalledWith(100, expect.any(Function));\n  });\n\n  it(`sets the request's timeout to 0 if not provided`, async () => {\n    setSocketTimeout(clientRequest, vi.fn());\n\n    vi.runAllTimers();\n\n    expect(clientRequest.setTimeout).toHaveBeenCalledTimes(1);\n    expect(clientRequest.setTimeout).toHaveBeenLastCalledWith(0, expect.any(Function));\n  });\n\n  describe(\"event listener registration deferral\", () => {\n    const clientRequestWithSocket: any = {\n      destroy: vi.fn(),\n      setTimeout: vi.fn(),\n      socket: {\n        setTimeout: vi.fn(),\n      },\n      on: vi.fn(),\n    };\n\n    it(\"calls setTimeout on the socket if it is available after deferral\", async () => {\n      const eventListenerMinimumTimeoutToDefer = 6000;\n      const deferralTimeout = 3000;\n      const expectedDeferredSocketTimeout = eventListenerMinimumTimeoutToDefer - deferralTimeout;\n      setSocketTimeout(clientRequestWithSocket, vi.fn(), eventListenerMinimumTimeoutToDefer);\n\n      vi.runAllTimers();\n\n      expect(clientRequestWithSocket.socket.setTimeout).toHaveBeenCalledTimes(1);\n      expect(clientRequestWithSocket.socket.setTimeout).toHaveBeenLastCalledWith(\n        expectedDeferredSocketTimeout,\n        expect.any(Function)\n      );\n      expect(clientRequestWithSocket.on).toHaveBeenCalledTimes(1);\n      expect(clientRequestWithSocket.on).toHaveBeenLastCalledWith(\"close\", expect.any(Function));\n    });\n  });\n\n  it(`destroys the request on timeout`, () => {\n    setSocketTimeout(clientRequest, vi.fn(), 1);\n    expect(clientRequest.destroy).not.toHaveBeenCalled();\n\n    // call setTimeout callback\n    clientRequest.setTimeout.mock.calls[0][1]();\n    expect(clientRequest.destroy).toHaveBeenCalledTimes(1);\n  });\n\n  it(`rejects on timeout with a TimeoutError`, () => {\n    const reject = vi.fn();\n    const timeoutInMs = 100;\n\n    setSocketTimeout(clientRequest, reject, timeoutInMs);\n    expect(reject).not.toHaveBeenCalled();\n\n    // call setTimeout callback\n    clientRequest.setTimeout.mock.calls[0][1]();\n    expect(reject).toHaveBeenCalledTimes(1);\n    expect(reject).toHaveBeenCalledWith(\n      Object.assign(\n        new Error(\n          `@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`\n        ),\n        { name: \"TimeoutError\" }\n      )\n    );\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/set-socket-timeout.ts",
    "content": "import type { ClientRequest } from \"node:http\";\n\nimport { timing } from \"./timing\";\n\nconst DEFER_EVENT_LISTENER_TIME = 3000;\n\nexport const setSocketTimeout = (\n  request: ClientRequest,\n  reject: (err: Error) => void,\n  timeoutInMs = 0\n): NodeJS.Timeout | number => {\n  const registerTimeout = (offset: number) => {\n    const timeout = timeoutInMs - offset;\n    const onTimeout = () => {\n      request.destroy();\n      reject(\n        Object.assign(\n          new Error(\n            `@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`\n          ),\n          { name: \"TimeoutError\" }\n        )\n      );\n    };\n\n    if (request.socket) {\n      request.socket.setTimeout(timeout, onTimeout);\n      request.on(\"close\", () => request.socket?.removeListener(\"timeout\", onTimeout));\n    } else {\n      request.setTimeout(timeout, onTimeout);\n    }\n  };\n\n  if (0 < timeoutInMs && timeoutInMs < 6000) {\n    registerTimeout(0);\n    return 0;\n  }\n\n  return timing.setTimeout(\n    registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME),\n    DEFER_EVENT_LISTENER_TIME\n  );\n};\n"
  },
  {
    "path": "packages/node-http-handler/src/stream-collector/collector.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { Collector } from \"./collector\";\n\ndescribe(\"Collector\", () => {\n  const writePromise = (collector: Collector, chunk: any, encoding: BufferEncoding = \"utf-8\"): Promise<void> => {\n    return new Promise((resolve, reject) => {\n      collector.write(chunk, encoding, (err) => {\n        if (err) {\n          reject(err);\n        } else {\n          resolve();\n        }\n      });\n    });\n  };\n\n  const listOfBuffers: Buffer[] = [Buffer.from(\"foo\"), Buffer.from(\"bar\"), Buffer.from(\"buzz\")];\n\n  it(\"stores a collection of buffers internally\", async () => {\n    const collector = new Collector();\n\n    await writePromise(collector, listOfBuffers[0]);\n    await writePromise(collector, listOfBuffers[1]);\n    await writePromise(collector, listOfBuffers[2]);\n    collector.end();\n\n    expect(collector.bufferedBytes.length).toBe(3);\n    expect(collector.bufferedBytes[0]).toBe(listOfBuffers[0]);\n    expect(collector.bufferedBytes[1]).toBe(listOfBuffers[1]);\n    expect(collector.bufferedBytes[2]).toBe(listOfBuffers[2]);\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/stream-collector/collector.ts",
    "content": "import { Writable } from \"node:stream\";\n\nexport class Collector extends Writable {\n  public readonly bufferedBytes: Buffer[] = [];\n  _write(chunk: Buffer, encoding: string, callback: (err?: Error) => void) {\n    this.bufferedBytes.push(chunk);\n    callback();\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/stream-collector/index.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { streamCollector } from \"./index\";\nimport { ReadFromBuffers } from \"./readable.mock\";\n\ndescribe(\"streamCollector\", () => {\n  it(\"returns a Uint8Array containing all data from a stream\", async () => {\n    const mockData = [Buffer.from(\"foo\"), Buffer.from(\"bar\"), Buffer.from(\"buzz\")];\n    const mockReadStream = new ReadFromBuffers({\n      buffers: mockData,\n    });\n    const expected = new Uint8Array([102, 111, 111, 98, 97, 114, 98, 117, 122, 122]);\n    const collectedData = await streamCollector(mockReadStream);\n    expect(collectedData).toEqual(expected);\n  });\n\n  it(\"accepts ReadableStream if the global web stream implementation exists in Node.js\", async () => {\n    if (typeof ReadableStream === \"function\") {\n      const data = await streamCollector(\n        new ReadableStream({\n          start(controller) {\n            controller.enqueue(Buffer.from(\"abcd\"));\n            controller.close();\n          },\n        })\n      );\n      expect(Buffer.from(data)).toEqual(Buffer.from(\"abcd\"));\n    }\n  });\n\n  it(\"will propagate errors from the stream\", async () => {\n    // stream should emit an error right away\n    const mockReadStream = new ReadFromBuffers({\n      buffers: [],\n      errorAfter: 0,\n    });\n\n    try {\n      await streamCollector(mockReadStream);\n    } catch (err) {\n      expect(err).toBeDefined();\n    }\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/stream-collector/index.ts",
    "content": "import type { Readable } from \"node:stream\";\nimport type { ReadableStream as IReadableStream } from \"node:stream/web\";\nimport type { StreamCollector } from \"@smithy/types\";\n\nimport { Collector } from \"./collector\";\n\n/**\n * Converts a stream to a byte array.\n *\n * @internal\n */\nexport const streamCollector: StreamCollector = (stream: Readable | IReadableStream): Promise<Uint8Array> => {\n  if (isReadableStreamInstance(stream)) {\n    // Web stream API in Node.js\n    return collectReadableStream(stream);\n  }\n  return new Promise((resolve, reject) => {\n    const collector = new Collector();\n    stream.pipe(collector);\n    stream.on(\"error\", (err) => {\n      // if the source errors, the destination stream needs to manually end\n      collector.end();\n      reject(err);\n    });\n    collector.on(\"error\", reject);\n    collector.on(\"finish\", function (this: Collector) {\n      const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));\n      resolve(bytes);\n    });\n  });\n};\n\n/**\n * Note: the global.ReadableStream object is marked experimental, and was added in v18.0.0 of Node.js.\n * The importable version was added in v16.5.0. We only test for the global version so as not to\n * enforce an import on a Node.js version that may not have it, and import\n * only the type from stream/web.\n */\nconst isReadableStreamInstance = (stream: unknown): stream is IReadableStream =>\n  typeof ReadableStream === \"function\" && stream instanceof ReadableStream;\n\nasync function collectReadableStream(stream: IReadableStream): Promise<Uint8Array> {\n  const chunks = [];\n  const reader = stream.getReader();\n  let isDone = false;\n  let length = 0;\n\n  while (!isDone) {\n    const { done, value } = await reader.read();\n    if (value) {\n      chunks.push(value);\n      length += value.length;\n    }\n    isDone = done;\n  }\n\n  const collected = new Uint8Array(length);\n  let offset = 0;\n  for (const chunk of chunks) {\n    collected.set(chunk, offset);\n    offset += chunk.length;\n  }\n\n  return collected;\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/stream-collector/readable.mock.ts",
    "content": "import { Readable, type ReadableOptions } from \"node:stream\";\n\nexport interface ReadFromBuffersOptions extends ReadableOptions {\n  buffers: Buffer[];\n  errorAfter?: number;\n}\n\nexport class ReadFromBuffers extends Readable {\n  private buffersToRead: Buffer[];\n  private numBuffersRead = 0;\n\n  private errorAfter: number;\n  constructor(options: ReadFromBuffersOptions) {\n    super(options);\n    this.buffersToRead = options.buffers;\n    this.errorAfter = typeof options.errorAfter === \"number\" ? options.errorAfter : -1;\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  _read(size: number) {\n    if (this.errorAfter !== -1 && this.errorAfter === this.numBuffersRead) {\n      this.emit(\"error\", new Error(\"Mock Error\"));\n      return;\n    }\n    if (this.numBuffersRead >= this.buffersToRead.length) {\n      return this.push(null);\n    }\n    return this.push(this.buffersToRead[this.numBuffersRead++]);\n  }\n}\n"
  },
  {
    "path": "packages/node-http-handler/src/timing.ts",
    "content": "/**\n * For test spies.\n *\n * @internal\n */\nexport const timing = {\n  setTimeout: (cb: (...ignored: any[]) => void | unknown, ms?: number) => setTimeout(cb, ms),\n  clearTimeout: (timeoutId: string | number | undefined | unknown) =>\n    clearTimeout(timeoutId as Parameters<typeof clearTimeout>[0]),\n};\n"
  },
  {
    "path": "packages/node-http-handler/src/write-request-body.spec.ts",
    "content": "import EventEmitter from \"node:events\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { writeRequestBody } from \"./write-request-body\";\n\ndescribe(writeRequestBody.name, () => {\n  it(\"should wait for the continue event if request has expect=100-continue\", async () => {\n    const httpRequest = Object.assign(new EventEmitter(), {\n      end: vi.fn(),\n    }) as any;\n    const request = {\n      headers: {\n        expect: \"100-continue\",\n      },\n      body: Buffer.from(\"abcd\"),\n      method: \"GET\",\n      hostname: \"\",\n      protocol: \"https:\",\n      path: \"/\",\n    };\n    setTimeout(async () => {\n      httpRequest.emit(\"continue\", {});\n    }, 200);\n    const promise = writeRequestBody(httpRequest, request);\n    expect(httpRequest.end).not.toHaveBeenCalled();\n    await promise;\n    expect(httpRequest.end).toHaveBeenCalled();\n  });\n\n  it(\"should not wait for the continue event if request has expect=100-continue but agent is external\", async () => {\n    const httpRequest = Object.assign(new EventEmitter(), {\n      end: vi.fn(),\n    }) as any;\n    const request = {\n      headers: {\n        expect: \"100-continue\",\n      },\n      body: Buffer.from(\"abcd\"),\n      method: \"GET\",\n      hostname: \"\",\n      protocol: \"https:\",\n      path: \"/\",\n    };\n    const id = setTimeout(async () => {\n      httpRequest.emit(\"continue\", {});\n    }, 200);\n    const promise = writeRequestBody(httpRequest, request, 6000, true);\n    expect(httpRequest.end).toHaveBeenCalled();\n    await promise;\n    clearTimeout(id);\n  });\n\n  it(\n    \"should not send the body if the request is expect=100-continue\" +\n      \"but a response is received before the continue event\",\n    async () => {\n      const httpRequest = Object.assign(new EventEmitter(), {\n        end: vi.fn(),\n      }) as any;\n      const request = {\n        headers: {\n          expect: \"100-continue\",\n        },\n        body: {\n          pipe: vi.fn(),\n        },\n        method: \"GET\",\n        hostname: \"\",\n        protocol: \"https:\",\n        path: \"/\",\n      };\n      setTimeout(() => {\n        httpRequest.emit(\"response\", {});\n      }, 25);\n      await writeRequestBody(httpRequest, request);\n      expect(request.body.pipe).not.toHaveBeenCalled();\n      expect(httpRequest.end).not.toHaveBeenCalled();\n    }\n  );\n\n  describe(\"with fake timers\", () => {\n    beforeEach(() => {\n      vi.useFakeTimers();\n    });\n\n    afterEach(() => {\n      vi.useRealTimers();\n    });\n    it(\"should send the body if the 100 Continue response is not received before the timeout\", async () => {\n      const httpRequest = Object.assign(new EventEmitter(), {\n        end: vi.fn(),\n      }) as any;\n      const request = {\n        headers: {\n          expect: \"100-continue\",\n        },\n        body: Buffer.from(\"abcd\"),\n        method: \"GET\",\n        hostname: \"\",\n        protocol: \"https:\",\n        path: \"/\",\n      };\n\n      const promise = writeRequestBody(httpRequest, request, 12_000);\n      expect(httpRequest.end).not.toHaveBeenCalled();\n      vi.advanceTimersByTime(13000);\n      await promise;\n\n      expect(httpRequest.end).toHaveBeenCalled();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/node-http-handler/src/write-request-body.ts",
    "content": "import type { ClientHttp2Stream } from \"node:http2\";\nimport type { ClientRequest } from \"node:http\";\nimport { Readable } from \"node:stream\";\nimport type { HttpRequest } from \"@smithy/types\";\n\nimport { timing } from \"./timing\";\n\nconst MIN_WAIT_TIME = 6_000;\n\n/**\n * This resolves when writeBody has been called.\n *\n * @param httpRequest - opened Node.js request.\n * @param request - container with the request body.\n * @param maxContinueTimeoutMs - time to wait for the continue event.\n * @param externalAgent - whether agent is owned by caller code.\n */\nexport async function writeRequestBody(\n  httpRequest: ClientRequest | ClientHttp2Stream,\n  request: HttpRequest,\n  maxContinueTimeoutMs = MIN_WAIT_TIME,\n  externalAgent = false\n): Promise<void> {\n  const headers = request.headers;\n  const expect = headers ? headers.Expect || headers.expect : undefined;\n\n  let timeoutId = -1;\n  let sendBody = true;\n\n  if (!externalAgent && expect === \"100-continue\") {\n    sendBody = await Promise.race<boolean>([\n      new Promise((resolve) => {\n        // If this resolves first (wins the race), it means that at least MIN_WAIT_TIME ms\n        // elapsed and no continue, response, or error has happened.\n        // The high default timeout is to give the server ample time to respond.\n        // This is an unusual situation, and indicates the server may not be S3 actual\n        // and did not correctly implement 100-continue event handling.\n        // Strictly speaking, we should perhaps keep waiting up to the request timeout\n        // and then throw an error, but we resolve true to allow the server to deal\n        // with the request body.\n        timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));\n      }),\n      new Promise((resolve) => {\n        httpRequest.on(\"continue\", () => {\n          timing.clearTimeout(timeoutId);\n          resolve(true);\n        });\n        httpRequest.on(\"response\", () => {\n          // if this handler is called, then response is\n          // already received and there is no point in\n          // sending body or waiting\n          timing.clearTimeout(timeoutId);\n          resolve(false);\n        });\n        httpRequest.on(\"error\", () => {\n          timing.clearTimeout(timeoutId);\n          // this handler does not reject with the error\n          // because there is already an error listener\n          // on the request in node-http-handler\n          // and node-http2-handler.\n          resolve(false);\n        });\n      }),\n    ]);\n  }\n\n  if (sendBody) {\n    writeBody(httpRequest, request.body);\n  }\n}\n\nfunction writeBody(\n  httpRequest: ClientRequest | ClientHttp2Stream,\n  body?: string | ArrayBuffer | ArrayBufferView | Readable | Uint8Array\n) {\n  if (body instanceof Readable) {\n    // pipe automatically handles end\n    body.pipe(httpRequest);\n    return;\n  }\n\n  if (body) {\n    const isBuffer = Buffer.isBuffer(body);\n    const isString = typeof body === \"string\";\n    if (isBuffer || isString) {\n      // https://github.com/aws/aws-sdk-js-v3/issues/6426\n      // describes why we don't send an empty Buffer.\n      if (isBuffer && body.byteLength === 0) {\n        httpRequest.end();\n      } else {\n        httpRequest.end(body);\n      }\n      return;\n    }\n\n    const uint8 = body as Uint8Array;\n    if (\n      typeof uint8 === \"object\" &&\n      uint8.buffer &&\n      typeof uint8.byteOffset === \"number\" &&\n      typeof uint8.byteLength === \"number\"\n    ) {\n      // this avoids copying the array.\n      httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));\n      return;\n    }\n\n    httpRequest.end(Buffer.from(body as ArrayBuffer));\n    return;\n  }\n\n  httpRequest.end();\n}\n"
  },
  {
    "path": "packages/node-http-handler/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-http-handler/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-http-handler/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/node-http-handler/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/property-provider/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/property-provider/CHANGELOG.md",
    "content": "# @smithy/property-provider\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/property-provider/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/property-provider/package.json",
    "content": "{\n  \"name\": \"@smithy/property-provider\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/property-provider\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/property-provider\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/property-provider/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport {\n  ProviderError,\n  CredentialsProviderError,\n  TokenProviderError,\n  chain,\n  fromValue as fromStatic,\n  memoize,\n} from \"@smithy/core/config\";\nexport type { ProviderErrorOptionsType } from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/property-provider/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/property-provider/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/property-provider/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/protocol-http/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/protocol-http/CHANGELOG.md",
    "content": "# @smithy/protocol-http\n\n## 5.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 5.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 5.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 5.4.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/protocol-http/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/protocol-http/package.json",
    "content": "{\n  \"name\": \"@smithy/protocol-http\",\n  \"version\": \"5.4.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS Smithy Team\",\n    \"email\": \"\",\n    \"url\": \"https://smithy.io\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/protocol-http\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/protocol-http\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/protocol-http/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/protocols instead. */\nexport {\n  Field,\n  Fields,\n  HttpRequest,\n  HttpResponse,\n  isValidHostname,\n  getHttpHandlerExtensionConfiguration,\n  resolveHttpHandlerRuntimeConfig,\n} from \"@smithy/core/protocols\";\nexport type {\n  FieldsOptions,\n  HttpHandler,\n  HttpHandlerUserInput,\n  IHttpRequest,\n  HttpHandlerExtensionConfiguration,\n  HttpHandlerExtensionConfigType,\n  FieldOptions,\n  FieldPosition,\n  HeaderBag,\n  HttpMessage,\n  HttpHandlerOptions,\n} from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/protocol-http/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/protocol-http/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/protocol-http/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/querystring-builder/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/querystring-builder/CHANGELOG.md",
    "content": "# @smithy/querystring-builder\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/querystring-builder/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/querystring-builder/package.json",
    "content": "{\n  \"name\": \"@smithy/querystring-builder\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/querystring-builder\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/querystring-builder\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/querystring-builder/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/protocols instead. */\nexport { buildQueryString } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/querystring-builder/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/querystring-builder/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/querystring-builder/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/querystring-parser/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/querystring-parser/CHANGELOG.md",
    "content": "# @smithy/querystring-parser\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/querystring-parser/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/querystring-parser/package.json",
    "content": "{\n  \"name\": \"@smithy/querystring-parser\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/querystring-parser\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/querystring-parser\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/querystring-parser/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/protocols instead. */\nexport { parseQueryString } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/querystring-parser/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/querystring-parser/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/querystring-parser/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/service-client-documentation-generator/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/service-client-documentation-generator/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.2.2\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n\n## 4.2.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.2.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.1.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/service-client-documentation-generator](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/service-client-documentation-generator/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/service-client-documentation-generator/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/service-client-documentation-generator/README.md",
    "content": "# @smithy/client-documentation-generator\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/client-documentation-generator/latest.svg)](https://www.npmjs.com/package/@smithy/client-documentation-generator)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/client-documentation-generator.svg)](https://www.npmjs.com/package/@smithy/client-documentation-generator)\n\n### :warning: Internal API :warning:\n\n> This is an internal package.\n> That means this is used as a dependency for other, public packages, but\n> should not be taken directly as a dependency in your application's `package.json`.\n\n> If you are updating the version of this package, for example to bring in a\n> bug-fix, you should do so by updating your application lockfile with\n> e.g. `npm up @scope/package` or equivalent command in another\n> package manager, rather than taking a direct dependency.\n\n---\n"
  },
  {
    "path": "packages/service-client-documentation-generator/package.json",
    "content": "{\n  \"name\": \"@smithy/service-client-documentation-generator\",\n  \"version\": \"4.2.2\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline service-client-documentation-generator\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"exit 0\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"keywords\": [\n    \"typedocplugin\"\n  ],\n  \"dependencies\": {\n    \"tslib\": \"^2.6.2\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/client-documentation-generator\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/client-documentation-generator\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/service-client-documentation-generator/src/index.ts",
    "content": "import { ParameterType, type Application } from \"typedoc\";\n\nimport { SdkClientTocPlugin } from \"./sdk-client-toc-plugin\";\n\n/**\n * @internal\n */\nexport function load(app: Application) {\n  app.options.addDeclaration({\n    name: \"defaultGroup\",\n    help: \"Default group to place categories as children\",\n    defaultValue: \"SDK\",\n    type: ParameterType.String,\n  });\n\n  new SdkClientTocPlugin(app.options, app.logger, app.renderer);\n}\n"
  },
  {
    "path": "packages/service-client-documentation-generator/src/sdk-client-toc-plugin.ts",
    "content": "import { dirname } from \"node:path\";\nimport type {\n  Context,\n  DeclarationReflection,\n  Logger,\n  Options,\n  ProjectReflection,\n  ReferenceType,\n  Renderer,\n} from \"typedoc\";\nimport {\n  BindOption,\n  ContainerReflection,\n  Converter,\n  ReflectionCategory,\n  ReflectionFlag,\n  ReflectionGroup,\n  ReflectionKind,\n} from \"typedoc\";\n\nimport { isClientModel } from \"./utils\";\n\n/**\n * Group the ToC for easier observability.\n *\n * @internal\n */\nexport class SdkClientTocPlugin {\n  private clientDir?: string;\n\n  @BindOption(\"defaultGroup\")\n  readonly defaultGroup: string;\n\n  @BindOption(\"defaultCategory\")\n  readonly defaultCategory: string;\n\n  constructor(\n    public readonly options: Options,\n    public readonly logger: Logger,\n    private readonly renderer: Renderer\n  ) {\n    this.renderer.application.converter.on(Converter.EVENT_END, this.changeLinksToLowerCase);\n    this.renderer.application.converter.on(Converter.EVENT_RESOLVE_END, this.onEndResolve);\n  }\n\n  private changeLinksToLowerCase = (context: Context) => {\n    Object.keys(context.project.reflections).forEach((reflectionName) => {\n      context.project.reflections[reflectionName]._alias = context.project.reflections[reflectionName]\n        .getAlias()\n        .toLowerCase();\n    });\n  };\n\n  private onEndResolve = (context: Context) => {\n    if (!this.clientDir) this.clientDir = this.loadClientDir(context.project);\n    for (const model of Object.values(context.project.reflections)) {\n      const isEffectiveParent = (model instanceof ContainerReflection && model.children?.length) || model.isProject();\n      if (!isEffectiveParent || model.kindOf(ReflectionKind.SomeModule)) {\n        return;\n      }\n\n      if (!model.groups) {\n        model.groups = [];\n      }\n\n      let group = model.groups.find((value) => value.title === this.defaultGroup);\n\n      if (!group) {\n        group = new ReflectionGroup(this.defaultGroup);\n        model.groups.push(group);\n      }\n\n      group.categories = this.defineCategories(group, model.children);\n\n      const modulesIndex = model.groups.findIndex((value) => value.title === \"Modules\");\n      // Removing `Modules` group from array\n      if (modulesIndex >= 0) {\n        model.groups.splice(modulesIndex, 1);\n      }\n    }\n  };\n\n  // Confirm declaration comes from the same folder as the client class\n  private belongsToClientPackage(model: DeclarationReflection): boolean {\n    return this.clientDir && model.sources?.[0].fullFileName.indexOf(this.clientDir) === 0;\n  }\n\n  private isClient(model: DeclarationReflection): boolean {\n    const { extendedTypes = [] } = model;\n    return (\n      model.kindOf(ReflectionKind.Class) &&\n      model.getFullName() !== \"Client\" && // Exclude the Smithy Client class.\n      (model.name.endsWith(\"Client\") /* Modular client like S3Client */ ||\n        extendedTypes.filter((reference) => (reference as ReferenceType).name === `${model.name}Client`).length > 0) &&\n      /* Filter out other client classes that not sourced from the same directory as current client. e.g. STS, SSO */\n      this.belongsToClientPackage(model)\n    );\n  }\n\n  private isCommand(model: DeclarationReflection): boolean {\n    return (\n      model.kindOf(ReflectionKind.Class) &&\n      model.name.endsWith(\"Command\") &&\n      // model.children?.some((child) => child.name === \"resolveMiddleware\") &&\n      this.belongsToClientPackage(model)\n    );\n  }\n\n  private isPaginator(model: DeclarationReflection): boolean {\n    return (\n      model.name.startsWith(\"paginate\") && model.kindOf(ReflectionKind.Function) && this.belongsToClientPackage(model)\n    );\n  }\n\n  private isInputOrOutput(model: DeclarationReflection): boolean {\n    return (\n      model.kindOf(ReflectionKind.Interface) &&\n      (model.name.endsWith(\"CommandInput\") || model.name.endsWith(\"CommandOutput\")) &&\n      this.belongsToClientPackage(model)\n    );\n  }\n\n  private isWaiter(model: DeclarationReflection): boolean {\n    return (\n      model.name.startsWith(\"waitFor\") && model.kindOf(ReflectionKind.Function) && this.belongsToClientPackage(model)\n    );\n  }\n  /**\n   * Define navigation categories in Client, Commands, Paginators and Waiters sections. It will update the\n   * supplied categories array.\n   *\n   * @param group   The parent group where the categories will be placed under.\n   * @param reflections   The reflections that should be categorized.\n   */\n  private defineCategories(group: ReflectionGroup, reflections: DeclarationReflection[]): ReflectionCategory[] {\n    const categories = group.categories || [];\n    if (this.isCategorized(categories)) return group.categories;\n\n    const clients = new ReflectionCategory(\"Clients\");\n    const commands = new ReflectionCategory(\"Commands\");\n    const paginators = new ReflectionCategory(\"Paginators\");\n    const waiters = new ReflectionCategory(\"Waiters\");\n    reflections.forEach((reflection: DeclarationReflection) => {\n      if (reflection.kindOf(ReflectionKind.SomeModule)) {\n        return;\n      }\n\n      if (this.isClient(reflection)) {\n        clients.children.push(reflection);\n        reflection.flags.setFlag(ReflectionFlag.Public, false);\n      } else if (this.isCommand(reflection)) {\n        commands.children.push(reflection);\n        reflection.flags.setFlag(ReflectionFlag.Protected, true);\n      } else if (this.isPaginator(reflection)) {\n        paginators.children.push(reflection);\n        reflection.flags.setFlag(ReflectionFlag.Protected, true);\n      } else if (this.isInputOrOutput(reflection)) {\n        commands.children.push(reflection);\n        reflection.flags.setFlag(ReflectionFlag.Protected, true);\n      } else if (this.isWaiter(reflection)) {\n        waiters.children.push(reflection);\n        reflection.flags.setFlag(ReflectionFlag.Protected, true);\n      }\n    });\n    // Group commands and input/output interface of each command.\n    commands.children.sort((childA, childB) => childA.name.localeCompare(childB.name));\n\n    categories.push(...[clients, commands, paginators, waiters]);\n    return categories;\n  }\n\n  private isCategorized(categories: ReflectionCategory[]): boolean {\n    const childrenNames = categories.map((child) => child.title);\n    return (\n      childrenNames.includes(\"Clients\") &&\n      childrenNames.includes(\"Commands\") &&\n      childrenNames.includes(\"Paginators\") &&\n      childrenNames.includes(\"Waiters\")\n    );\n  }\n\n  private loadClientDir(project: ProjectReflection) {\n    const children = Object.values(project.reflections).filter(isClientModel);\n    const fullFileName = children.find((child) => child.sources[0].fileName.endsWith(\"Client.ts\")).sources[0]\n      .fullFileName;\n    return dirname(dirname(fullFileName));\n  }\n}\n"
  },
  {
    "path": "packages/service-client-documentation-generator/src/utils.ts",
    "content": "import { sep } from \"node:path\";\nimport type { Reflection } from \"typedoc\";\n\n/**\n * @internal\n */\nexport const isClientModel = (model: Reflection | undefined) =>\n  model?.sources?.[0]?.fullFileName.includes(`${sep}clients${sep}`);\n"
  },
  {
    "path": "packages/service-client-documentation-generator/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"experimentalDecorators\": true,\n    \"outDir\": \"dist-cjs\",\n    \"pretty\": true,\n    \"rootDir\": \"src\",\n    \"strict\": false\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/service-client-documentation-generator/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"experimentalDecorators\": true,\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"pretty\": true,\n    \"rootDir\": \"src\",\n    \"strict\": false\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/service-client-documentation-generator/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"experimentalDecorators\": true,\n    \"rootDir\": \"src\",\n    \"strict\": false\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/service-error-classification/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/service-error-classification/CHANGELOG.md",
    "content": "# @smithy/service-error-classification\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/service-error-classification/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/service-error-classification/package.json",
    "content": "{\n  \"name\": \"@smithy/service-error-classification\",\n  \"version\": \"4.4.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/service-error-classification\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/service-error-classification\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  }\n}\n"
  },
  {
    "path": "packages/service-error-classification/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/retry instead. */\nexport {\n  isRetryableByTrait,\n  isClockSkewError,\n  isClockSkewCorrectedError,\n  isBrowserNetworkError,\n  isThrottlingError,\n  isTransientError,\n  isServerError,\n  isNodeJsHttp2TransientError,\n} from \"@smithy/core/retry\";\n"
  },
  {
    "path": "packages/service-error-classification/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/service-error-classification/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/service-error-classification/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/shared-ini-file-loader/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/shared-ini-file-loader/CHANGELOG.md",
    "content": "# @smithy/shared-ini-file-loader\n\n## 4.5.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.5.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.5.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.5.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/shared-ini-file-loader/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/shared-ini-file-loader/package.json",
    "content": "{\n  \"name\": \"@smithy/shared-ini-file-loader\",\n  \"version\": \"4.5.3\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/shared-ini-file-loader\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/shared-ini-file-loader\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/shared-ini-file-loader/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport {\n  getHomeDir,\n  ENV_PROFILE,\n  DEFAULT_PROFILE,\n  getProfileName,\n  getSSOTokenFilepath,\n  getSSOTokenFromFile,\n  CONFIG_PREFIX_SEPARATOR,\n  loadSharedConfigFiles,\n  loadSsoSessionData,\n  parseKnownFiles,\n  externalDataInterceptor,\n  readFile,\n} from \"@smithy/core/config\";\nexport type {\n  SSOToken,\n  SharedConfigInit,\n  SsoSessionInit,\n  SourceProfileInit,\n  Profile,\n  ParsedIniData,\n  SharedConfigFiles,\n  ReadFileOptions,\n} from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/shared-ini-file-loader/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/shared-ini-file-loader/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/shared-ini-file-loader/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4/.gitignore",
    "content": "/node_modules/\n/build/\n/dist/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/signature-v4/CHANGELOG.md",
    "content": "# Change Log\n\n## 5.4.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 5.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 5.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 5.4.0\n\n### Minor Changes\n\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 5.3.14\n\n### Patch Changes\n\n- 52b4789: allow snapshot of credentials for event-stream signing\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/protocol-http@5.3.14\n  - @smithy/util-middleware@4.2.14\n\n## 5.3.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/protocol-http@5.3.13\n  - @smithy/util-middleware@4.2.13\n\n## 5.3.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/protocol-http@5.3.12\n  - @smithy/util-middleware@4.2.12\n\n## 5.3.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-hex-encoding@4.2.2\n  - @smithy/is-array-buffer@4.2.2\n  - @smithy/util-middleware@4.2.11\n  - @smithy/util-uri-escape@4.2.2\n  - @smithy/protocol-http@5.3.11\n  - @smithy/util-utf8@4.2.2\n\n## 5.3.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/protocol-http@5.3.10\n  - @smithy/util-middleware@4.2.10\n\n## 5.3.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/is-array-buffer@4.2.1\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-hex-encoding@4.2.1\n  - @smithy/util-middleware@4.2.9\n  - @smithy/util-uri-escape@4.2.1\n  - @smithy/util-utf8@4.2.1\n\n## 5.3.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/protocol-http@5.3.8\n  - @smithy/util-middleware@4.2.8\n\n## 5.3.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/protocol-http@5.3.7\n  - @smithy/util-middleware@4.2.7\n\n## 5.3.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/protocol-http@5.3.6\n  - @smithy/util-middleware@4.2.6\n\n## 5.3.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/protocol-http@5.3.5\n  - @smithy/util-middleware@4.2.5\n\n## 5.3.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/protocol-http@5.3.4\n  - @smithy/util-middleware@4.2.4\n\n## 5.3.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/protocol-http@5.3.3\n  - @smithy/util-middleware@4.2.3\n\n## 5.3.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/protocol-http@5.3.2\n  - @smithy/util-middleware@4.2.2\n\n## 5.3.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/protocol-http@5.3.1\n  - @smithy/util-middleware@4.2.1\n\n## 5.3.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/is-array-buffer@4.2.0\n  - @smithy/protocol-http@5.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-hex-encoding@4.2.0\n  - @smithy/util-middleware@4.2.0\n  - @smithy/util-uri-escape@4.2.0\n  - @smithy/util-utf8@4.2.0\n\n## 5.2.1\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/protocol-http@5.2.1\n  - @smithy/util-middleware@4.1.1\n\n## 5.2.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-hex-encoding@4.1.0\n  - @smithy/is-array-buffer@4.1.0\n  - @smithy/util-middleware@4.1.0\n  - @smithy/util-uri-escape@4.1.0\n  - @smithy/protocol-http@5.2.0\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 5.1.3\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/protocol-http@5.1.3\n  - @smithy/util-middleware@4.0.5\n\n## 5.1.2\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/protocol-http@5.1.2\n  - @smithy/util-middleware@4.0.4\n\n## 5.1.1\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/protocol-http@5.1.1\n  - @smithy/util-middleware@4.0.3\n\n## 5.1.0\n\n### Minor Changes\n\n- e2a8b41: Adding Signature V4a implementation\n\n## 5.0.2\n\n### Patch Changes\n\n- Updated dependencies [e917e61]\n  - @smithy/protocol-http@5.1.0\n  - @smithy/types@4.2.0\n  - @smithy/util-middleware@4.0.2\n\n## 5.0.1\n\n### Patch Changes\n\n- Updated dependencies [2aff9df]\n- Updated dependencies [000b2ae]\n  - @smithy/types@4.1.0\n  - @smithy/protocol-http@5.0.1\n  - @smithy/util-middleware@4.0.1\n\n## 5.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n### Patch Changes\n\n- Updated dependencies [20d99be]\n  - @smithy/util-middleware@4.0.0\n  - @smithy/util-utf8@4.0.0\n  - @smithy/is-array-buffer@4.0.0\n  - @smithy/protocol-http@5.0.0\n  - @smithy/types@4.0.0\n  - @smithy/util-hex-encoding@4.0.0\n  - @smithy/util-uri-escape@4.0.0\n\n## 4.2.4\n\n### Patch Changes\n\n- Updated dependencies [b52b4e8]\n  - @smithy/types@3.7.2\n  - @smithy/protocol-http@4.1.8\n  - @smithy/util-middleware@3.0.11\n\n## 4.2.3\n\n### Patch Changes\n\n- Updated dependencies [fcd5ca8]\n  - @smithy/types@3.7.1\n  - @smithy/protocol-http@4.1.7\n  - @smithy/util-middleware@3.0.10\n\n## 4.2.2\n\n### Patch Changes\n\n- Updated dependencies [cd1929b]\n  - @smithy/types@3.7.0\n  - @smithy/protocol-http@4.1.6\n  - @smithy/util-middleware@3.0.9\n\n## 4.2.1\n\n### Patch Changes\n\n- Updated dependencies [84bec05]\n  - @smithy/types@3.6.0\n  - @smithy/protocol-http@4.1.5\n  - @smithy/util-middleware@3.0.8\n\n## 4.2.0\n\n### Minor Changes\n\n- a4c1285: configurable hoisted headers\n\n### Patch Changes\n\n- Updated dependencies [a4c1285]\n  - @smithy/types@3.5.0\n  - @smithy/protocol-http@4.1.4\n  - @smithy/util-middleware@3.0.7\n\n## 4.1.4\n\n### Patch Changes\n\n- 806cc7f: fix: sort query parameter keys after encoding\n\n## 4.1.3\n\n### Patch Changes\n\n- Updated dependencies [e7b438b]\n  - @smithy/types@3.4.2\n  - @smithy/protocol-http@4.1.3\n  - @smithy/util-middleware@3.0.6\n\n## 4.1.2\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/protocol-http@4.1.2\n  - @smithy/util-middleware@3.0.5\n\n## 4.1.1\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/protocol-http@4.1.1\n  - @smithy/util-middleware@3.0.4\n\n## 4.1.0\n\n### Minor Changes\n\n- 86862ea: switch to static HttpRequest clone method\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 4.0.0\n\n### Major Changes\n\n- ae8bf5c: Make sha256 required parameter for SigV4 constructor\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/util-middleware@3.0.3\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/util-middleware@3.0.2\n\n## 3.1.0\n\n### Minor Changes\n\n- 3c23a83b: update versions of @aws-crypto/\\* packages\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/util-middleware@3.0.1\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/util-hex-encoding@3.0.0\n  - @smithy/is-array-buffer@3.0.0\n  - @smithy/util-middleware@3.0.0\n  - @smithy/util-uri-escape@3.0.0\n  - @smithy/util-utf8@3.0.0\n\n## 2.3.0\n\n### Minor Changes\n\n- 2e090d70: Escape non-standard characters in URI paths according to RFC 3986\n\n## 2.2.1\n\n### Patch Changes\n\n- 9961e59d: internalize header format function from eventstream-codec into signature-v4\n\n## 2.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/eventstream-codec@2.2.0\n  - @smithy/util-hex-encoding@2.2.0\n  - @smithy/is-array-buffer@2.2.0\n  - @smithy/util-middleware@2.2.0\n  - @smithy/util-uri-escape@2.2.0\n  - @smithy/util-utf8@2.3.0\n  - @smithy/types@2.12.0\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/util-utf8@2.2.0\n  - @smithy/types@2.11.0\n  - @smithy/eventstream-codec@2.1.4\n  - @smithy/util-middleware@2.1.4\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/eventstream-codec@2.1.3\n  - @smithy/util-middleware@2.1.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n  - @smithy/types@2.10.0\n  - @smithy/eventstream-codec@2.1.2\n  - @smithy/util-middleware@2.1.2\n\n## 2.1.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/eventstream-codec@2.1.1\n  - @smithy/is-array-buffer@2.1.1\n  - @smithy/types@2.9.1\n  - @smithy/util-hex-encoding@2.1.1\n  - @smithy/util-middleware@2.1.1\n  - @smithy/util-uri-escape@2.1.1\n  - @smithy/util-utf8@2.1.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/eventstream-codec@2.1.0\n  - @smithy/util-hex-encoding@2.1.0\n  - @smithy/is-array-buffer@2.1.0\n  - @smithy/util-middleware@2.1.0\n  - @smithy/util-uri-escape@2.1.0\n  - @smithy/util-utf8@2.1.0\n  - @smithy/types@2.9.0\n\n## 2.0.19\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/eventstream-codec@2.0.16\n  - @smithy/util-middleware@2.0.9\n\n## 2.0.18\n\n### Patch Changes\n\n- 7a8023b2: fix readme brackets\n\n## 2.0.17\n\n### Patch Changes\n\n- 3ba4bd93: add readme content for signature-v4\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/eventstream-codec@2.0.15\n  - @smithy/util-middleware@2.0.8\n\n## 2.0.16\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/eventstream-codec@2.0.14\n  - @smithy/util-middleware@2.0.7\n\n## 2.0.15\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/eventstream-codec@2.0.13\n  - @smithy/util-middleware@2.0.6\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies [f2a04b7e]\n  - @smithy/util-utf8@2.0.2\n  - @smithy/eventstream-codec@2.0.12\n\n## 2.0.13\n\n### Patch Changes\n\n- Updated dependencies [5598a033]\n  - @smithy/util-utf8@2.0.1\n  - @smithy/eventstream-codec@2.0.12\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/eventstream-codec@2.0.12\n  - @smithy/util-middleware@2.0.5\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/eventstream-codec@2.0.11\n  - @smithy/util-middleware@2.0.4\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/eventstream-codec@2.0.10\n  - @smithy/util-middleware@2.0.3\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/eventstream-codec@2.0.9\n  - @smithy/util-middleware@2.0.2\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [e6ea6bd5]\n- Updated dependencies [c0b17a13]\n- Updated dependencies [5b6fa539]\n  - @smithy/types@2.3.2\n  - @smithy/util-middleware@2.0.1\n  - @smithy/eventstream-codec@2.0.8\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/eventstream-codec@2.0.7\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n  - @smithy/types@2.3.0\n  - @smithy/eventstream-codec@2.0.6\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/eventstream-codec@2.0.5\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [381e03c4]\n  - @smithy/types@2.2.1\n  - @smithy/eventstream-codec@2.0.4\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [f6cb949d]\n  - @smithy/types@2.2.0\n  - @smithy/eventstream-codec@2.0.3\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.2\n\n### Patch Changes\n\n- bb5beab2: fix: multiple value parameters query string signature\n- Updated dependencies [59548ba9]\n- Updated dependencies [3e1ab589]\n  - @smithy/types@2.1.0\n  - @smithy/eventstream-codec@2.0.2\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [1b951769]\n  - @smithy/types@2.0.2\n  - @smithy/eventstream-codec@2.0.1\n  - @smithy/util-middleware@2.0.0\n\n## 2.0.0\n\n### Major Changes\n\n- 9d53bc76: update to 2.x major versions\n\n### Patch Changes\n\n- Updated dependencies [9d53bc76]\n  - @smithy/eventstream-codec@2.0.0\n  - @smithy/is-array-buffer@2.0.0\n  - @smithy/util-hex-encoding@2.0.0\n  - @smithy/util-middleware@2.0.0\n  - @smithy/util-uri-escape@2.0.0\n  - @smithy/util-utf8@2.0.0\n  - @smithy/types@2.0.1\n\n## 1.1.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n### Patch Changes\n\n- Updated dependencies [e3cbb3cc]\n  - @smithy/eventstream-codec@1.1.0\n  - @smithy/is-array-buffer@1.1.0\n  - @smithy/types@1.2.0\n  - @smithy/util-hex-encoding@1.1.0\n  - @smithy/util-middleware@1.1.0\n  - @smithy/util-uri-escape@1.1.0\n  - @smithy/util-utf8@1.1.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [8cd89c75]\n- Updated dependencies [d90a45b5]\n  - @smithy/types@2.0.0\n  - @smithy/eventstream-codec@1.0.3\n  - @smithy/util-middleware@1.0.2\n\n## 1.0.2\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n- Updated dependencies [6e312329]\n  - @smithy/eventstream-codec@1.0.2\n  - @smithy/util-hex-encoding@1.0.2\n  - @smithy/is-array-buffer@1.0.2\n  - @smithy/util-middleware@1.0.2\n  - @smithy/util-uri-escape@1.0.2\n  - @smithy/util-utf8@1.0.2\n  - @smithy/types@1.1.1\n\n## 1.0.1\n\n### Patch Changes\n\n- 2c57033f: Set correct publishConfig directory\n- Updated dependencies [2c57033f]\n  - @smithy/eventstream-codec@1.0.1\n  - @smithy/util-hex-encoding@1.0.1\n  - @smithy/is-array-buffer@1.0.1\n  - @smithy/util-middleware@1.0.1\n  - @smithy/util-uri-escape@1.0.1\n  - @smithy/util-utf8@1.0.1\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/signature-v4](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/signature-v4/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/signature-v4/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/signature-v4/README.md",
    "content": "# @smithy/signature-v4\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/signature-v4/latest.svg)](https://www.npmjs.com/package/@smithy/signature-v4)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/signature-v4.svg)](https://www.npmjs.com/package/@smithy/signature-v4)\n\nThis package contains an implementation of the [AWS Signature Version 4](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html)\nauthentication scheme.\n\nIt is internal to Smithy-TypeScript generated clients, and not generally intended for standalone usage outside this context.\n\nFor custom usage, inspect the interface of the SignatureV4 class.\n"
  },
  {
    "path": "packages/signature-v4/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/signature-v4/package.json",
    "content": "{\n  \"name\": \"@smithy/signature-v4\",\n  \"version\": \"5.4.3\",\n  \"description\": \"A standalone implementation of the AWS Signature V4 request signing algorithm\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline signature-v4\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@aws-crypto/sha256-js\": \"5.2.0\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/signature-v4\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/signature-v4\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/signature-v4/src/HeaderFormatter.spec.ts",
    "content": "import type { MessageHeaders } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { HeaderFormatter, Int64 } from \"./HeaderFormatter\";\n\n/**\n * TODO: this test duplicates a test in HeaderMarshaller in eventstream-codec.\n * TODO: when submodules are implemented this should be reunified/deduped.\n */\ndescribe(\"HeaderFormatter\", () => {\n  const marshaller = new HeaderFormatter();\n  const name = [0x04, 0xf0, 0x9f, 0xa6, 0x84];\n\n  const testCases: Array<[string, Uint8Array, MessageHeaders]> = [\n    [\n      \"boolean true headers\",\n      Uint8Array.from([...name, 0]),\n      {\n        \"🦄\": {\n          type: \"boolean\",\n          value: true,\n        },\n      },\n    ],\n    [\n      \"boolean false headers\",\n      Uint8Array.from([...name, 1]),\n      {\n        \"🦄\": {\n          type: \"boolean\",\n          value: false,\n        },\n      },\n    ],\n    [\n      \"byte headers\",\n      Uint8Array.from([...name, 2, 0x7f]),\n      {\n        \"🦄\": {\n          type: \"byte\",\n          value: 127,\n        },\n      },\n    ],\n    [\n      \"short headers\",\n      Uint8Array.from([...name, 3, 0x7f, 0xff]),\n      {\n        \"🦄\": {\n          type: \"short\",\n          value: 32767,\n        },\n      },\n    ],\n    [\n      \"integer headers\",\n      Uint8Array.from([...name, 4, 0x7f, 0xff, 0xff, 0xff]),\n      {\n        \"🦄\": {\n          type: \"integer\",\n          value: 2147483647,\n        },\n      },\n    ],\n    [\n      \"long headers\",\n      Uint8Array.from([...name, 5, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),\n      {\n        \"🦄\": {\n          type: \"long\",\n          value: new Int64(Uint8Array.from([0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])),\n        },\n      },\n    ],\n    [\n      \"binary headers\",\n      Uint8Array.from([...name, 6, 0x00, 0x08, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe]),\n      {\n        \"🦄\": {\n          type: \"binary\",\n          value: Uint8Array.from([0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe]),\n        },\n      },\n    ],\n    [\n      \"string headers\",\n      Uint8Array.from([\n        ...name,\n        7,\n        0x00,\n        0x2e,\n        0xd8,\n        0xaf,\n        0xd8,\n        0xb3,\n        0xd8,\n        0xaa,\n        0xe2,\n        0x80,\n        0x8c,\n        0xd9,\n        0x86,\n        0xd9,\n        0x88,\n        0xd8,\n        0xb4,\n        0xd8,\n        0xaa,\n        0xd9,\n        0x87,\n        0xe2,\n        0x80,\n        0x8c,\n        0xd9,\n        0x87,\n        0xd8,\n        0xa7,\n        0x20,\n        0xd9,\n        0x86,\n        0xd9,\n        0x85,\n        0xdb,\n        0x8c,\n        0xe2,\n        0x80,\n        0x8c,\n        0xd8,\n        0xb3,\n        0xd9,\n        0x88,\n        0xd8,\n        0xb2,\n        0xd9,\n        0x86,\n        0xd8,\n        0xaf,\n      ]),\n      {\n        \"🦄\": {\n          type: \"string\",\n          value: \"دست‌نوشته‌ها نمی‌سوزند\",\n        },\n      },\n    ],\n    [\n      \"timestamp headers\",\n      Uint8Array.from([...name, 8, 0x00, 0x00, 0x01, 0x61, 0x97, 0x16, 0xac, 0xc2]),\n      {\n        \"🦄\": {\n          type: \"timestamp\",\n          value: new Date(1518658301122),\n        },\n      },\n    ],\n    [\n      \"UUID headers\",\n      Uint8Array.from([\n        ...name,\n        9,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n        0xff,\n      ]),\n      {\n        \"🦄\": {\n          type: \"uuid\",\n          value: \"ffffffff-ffff-ffff-ffff-ffffffffffff\",\n        },\n      },\n    ],\n    [\n      \"a sequence of headers\",\n      Uint8Array.from([\n        0x04, 0xf0, 0x9f, 0xa6, 0x84, 0x06, 0x00, 0x04, 0xde, 0xad, 0xbe, 0xef, 0x04, 0xf0, 0x9f, 0x8f, 0x87, 0x00,\n        0x04, 0xf0, 0x9f, 0x90, 0x8e, 0x07, 0x00, 0x07, 0xe2, 0x98, 0x83, 0xf0, 0x9f, 0x92, 0xa9, 0x04, 0xf0, 0x9f,\n        0x90, 0xb4, 0x01,\n      ]),\n      {\n        \"🦄\": {\n          type: \"binary\",\n          value: Uint8Array.from([0xde, 0xad, 0xbe, 0xef]),\n        },\n        \"🏇\": {\n          type: \"boolean\",\n          value: true,\n        },\n        \"🐎\": {\n          type: \"string\",\n          value: \"☃💩\",\n        },\n        \"🐴\": {\n          type: \"boolean\",\n          value: false,\n        },\n      },\n    ],\n  ];\n\n  describe(\"#format\", () => {\n    for (const [description, encoded, decoded] of testCases) {\n      it(`should format ${description}`, () => {\n        expect(marshaller.format(decoded)).toEqual(encoded);\n      });\n    }\n\n    it(\"should throw if it receives an invalid UUID\", () => {\n      expect(() =>\n        marshaller.format({\n          uuid: {\n            type: \"uuid\",\n            value: \"foo\",\n          },\n        })\n      ).toThrowError(\"Invalid UUID received\");\n    });\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/HeaderFormatter.ts",
    "content": "import { fromHex, fromUtf8, toHex } from \"@smithy/core/serde\";\nimport type { Int64 as IInt64, MessageHeaderValue, MessageHeaders } from \"@smithy/types\";\n\n/**\n * TODO: duplicated from @smithy/eventstream-codec to break large dependency.\n * TODO: This should be moved to its own deduped submodule in @smithy/core when submodules are implemented.\n *\n * @internal\n */\nexport class HeaderFormatter {\n  public format(headers: MessageHeaders): Uint8Array {\n    const chunks: Array<Uint8Array> = [];\n\n    for (const headerName of Object.keys(headers)) {\n      const bytes = fromUtf8(headerName);\n      chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n    }\n\n    const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n    let position = 0;\n    for (const chunk of chunks) {\n      out.set(chunk, position);\n      position += chunk.byteLength;\n    }\n\n    return out;\n  }\n\n  private formatHeaderValue(header: MessageHeaderValue): Uint8Array {\n    switch (header.type) {\n      case \"boolean\":\n        return Uint8Array.from([header.value ? HEADER_VALUE_TYPE.boolTrue : HEADER_VALUE_TYPE.boolFalse]);\n      case \"byte\":\n        return Uint8Array.from([HEADER_VALUE_TYPE.byte, header.value]);\n      case \"short\":\n        const shortView = new DataView(new ArrayBuffer(3));\n        shortView.setUint8(0, HEADER_VALUE_TYPE.short);\n        shortView.setInt16(1, header.value, false);\n        return new Uint8Array(shortView.buffer);\n      case \"integer\":\n        const intView = new DataView(new ArrayBuffer(5));\n        intView.setUint8(0, HEADER_VALUE_TYPE.integer);\n        intView.setInt32(1, header.value, false);\n        return new Uint8Array(intView.buffer);\n      case \"long\":\n        const longBytes = new Uint8Array(9);\n        longBytes[0] = HEADER_VALUE_TYPE.long;\n        longBytes.set(header.value.bytes, 1);\n        return longBytes;\n      case \"binary\":\n        const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n        binView.setUint8(0, HEADER_VALUE_TYPE.byteArray);\n        binView.setUint16(1, header.value.byteLength, false);\n        const binBytes = new Uint8Array(binView.buffer);\n        binBytes.set(header.value, 3);\n        return binBytes;\n      case \"string\":\n        const utf8Bytes = fromUtf8(header.value);\n        const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n        strView.setUint8(0, HEADER_VALUE_TYPE.string);\n        strView.setUint16(1, utf8Bytes.byteLength, false);\n        const strBytes = new Uint8Array(strView.buffer);\n        strBytes.set(utf8Bytes, 3);\n        return strBytes;\n      case \"timestamp\":\n        const tsBytes = new Uint8Array(9);\n        tsBytes[0] = HEADER_VALUE_TYPE.timestamp;\n        tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n        return tsBytes;\n      case \"uuid\":\n        if (!UUID_PATTERN.test(header.value)) {\n          throw new Error(`Invalid UUID received: ${header.value}`);\n        }\n        const uuidBytes = new Uint8Array(17);\n        uuidBytes[0] = HEADER_VALUE_TYPE.uuid;\n        uuidBytes.set(fromHex(header.value.replace(/\\-/g, \"\")), 1);\n        return uuidBytes;\n    }\n  }\n}\n\nconst enum HEADER_VALUE_TYPE {\n  boolTrue = 0,\n  boolFalse,\n  byte,\n  short,\n  integer,\n  long,\n  byteArray,\n  string,\n  timestamp,\n  uuid,\n}\n\nconst UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\n\n/**\n * TODO: duplicated from @smithy/eventstream-codec to break large dependency.\n * TODO: This should be moved to its own deduped submodule in @smithy/core when submodules are implemented.\n */\nexport class Int64 implements IInt64 {\n  constructor(readonly bytes: Uint8Array) {\n    if (bytes.byteLength !== 8) {\n      throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n    }\n  }\n\n  static fromNumber(number: number): Int64 {\n    // eslint-disable-next-line @typescript-eslint/no-loss-of-precision\n    if (number > 9_223_372_036_854_775_807 || number < -9_223_372_036_854_775_808) {\n      throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n    }\n\n    const bytes = new Uint8Array(8);\n    for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n      bytes[i] = remaining;\n    }\n\n    if (number < 0) {\n      negate(bytes);\n    }\n\n    return new Int64(bytes);\n  }\n\n  /**\n   * Called implicitly by infix arithmetic operators.\n   */\n  valueOf(): number {\n    const bytes = this.bytes.slice(0);\n    const negative = bytes[0] & 0b10000000;\n    if (negative) {\n      negate(bytes);\n    }\n\n    return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);\n  }\n\n  toString() {\n    return String(this.valueOf());\n  }\n}\n\nfunction negate(bytes: Uint8Array): void {\n  for (let i = 0; i < 8; i++) {\n    bytes[i] ^= 0xff;\n  }\n\n  for (let i = 7; i > -1; i--) {\n    bytes[i]++;\n    if (bytes[i] !== 0) break;\n  }\n}\n"
  },
  {
    "path": "packages/signature-v4/src/SignatureV4.spec.ts",
    "content": "import { Sha256 } from \"@aws-crypto/sha256-js\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport type { AwsCredentialIdentity, SignableMessage, TimestampHeaderValue } from \"@smithy/types\";\nimport { afterEach, beforeEach, describe, expect, test as it, vi, type MockInstance } from \"vitest\";\n\nimport { SignatureV4 } from \"./SignatureV4\";\nimport {\n  ALGORITHM_IDENTIFIER,\n  ALGORITHM_QUERY_PARAM,\n  AMZ_DATE_HEADER,\n  AMZ_DATE_QUERY_PARAM,\n  AUTH_HEADER,\n  CREDENTIAL_QUERY_PARAM,\n  EXPIRES_QUERY_PARAM,\n  HOST_HEADER,\n  SIGNATURE_QUERY_PARAM,\n  SIGNED_HEADERS_QUERY_PARAM,\n  TOKEN_HEADER,\n  TOKEN_QUERY_PARAM,\n  UNSIGNED_PAYLOAD,\n} from \"./constants\";\nimport { iso8601 } from \"./utilDate\";\n\nimport Spy = jasmine.Spy;\n\nconst signerInit = {\n  service: \"foo\",\n  region: \"us-bar-1\",\n  sha256: Sha256,\n  credentials: {\n    accessKeyId: \"foo\",\n    secretAccessKey: \"bar\",\n  },\n};\n\nconst signer = new SignatureV4(signerInit);\n\nconst minimalRequest = new HttpRequest({\n  method: \"POST\",\n  protocol: \"https:\",\n  path: \"/\",\n  headers: {\n    host: \"foo.us-bar-1.amazonaws.com\",\n  },\n  hostname: \"foo.us-bar-1.amazonaws.com\",\n});\n\nconst credentials: AwsCredentialIdentity = {\n  accessKeyId: \"foo\",\n  secretAccessKey: \"bar\",\n};\n\ndescribe(\"SignatureV4\", () => {\n  describe(\"#presignRequest\", () => {\n    const presigningOptions = {\n      expiresIn: 1800,\n      signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n    };\n\n    it(\"should throw on invalid credential\", async () => {\n      const signer = new SignatureV4({ ...signerInit, credentials: {} as any });\n      try {\n        await signer.presign(minimalRequest, presigningOptions);\n        fail(\"This test is expected to fail\");\n      } catch (e) {\n        expect(e.message).toBe(\"Resolved credential object is not valid\");\n      }\n    });\n\n    it(\"should sign requests without bodies\", async () => {\n      const { query } = await signer.presign(minimalRequest, presigningOptions);\n      expect(query).toEqual({\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"46f0091f3e84cbd4552a184f43830a4f8b42fd18ceaefcdc2c225be1efd9e00e\",\n      });\n    });\n\n    it(\"should sign request without hoisting some headers\", async () => {\n      const { query, headers } = await signer.presign(\n        {\n          ...minimalRequest,\n          headers: {\n            ...minimalRequest.headers,\n            \"x-amz-not-hoisted\": \"test\",\n          },\n        },\n        { ...presigningOptions, unhoistableHeaders: new Set([\"x-amz-not-hoisted\"]) }\n      );\n      expect(query).toEqual({\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: `${HOST_HEADER};x-amz-not-hoisted`,\n        [SIGNATURE_QUERY_PARAM]: \"3c3ef586754b111e9528009710b797a07457d6a671058ba89041a06bab45f585\",\n      });\n      expect(headers).toMatchObject({\n        \"x-amz-not-hoisted\": \"test\",\n      });\n    });\n\n    it(\"should support overriding region and service in the signer instance\", async () => {\n      const signer = new SignatureV4({\n        ...signerInit,\n        service: \"qux\",\n        region: \"us-foo-1\",\n      });\n      const { query } = await signer.presign(minimalRequest, {\n        ...presigningOptions,\n        signingService: signerInit.service,\n        signingRegion: signerInit.region,\n      });\n      expect(query).toEqual({\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"46f0091f3e84cbd4552a184f43830a4f8b42fd18ceaefcdc2c225be1efd9e00e\",\n      });\n    });\n\n    it(\"should default expires to 3600 seconds if not explicitly passed\", async () => {\n      const { query } = await signer.presign(minimalRequest);\n      expect(query).toMatchObject({\n        [EXPIRES_QUERY_PARAM]: \"3600\",\n      });\n    });\n\n    it(\"should sign requests with string bodies\", async () => {\n      const { query } = await signer.presign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: \"It was the best of times, it was the worst of times\",\n        }),\n        presigningOptions\n      );\n      expect(query).toEqual({\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"3a7fc2cef9cab09384d0ef7a69bab0d942996846422bd041da5e52cae82612c3\",\n      });\n    });\n\n    it(\"should sign requests with binary bodies\", async () => {\n      const { query } = await signer.presign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new Uint8Array([0xde, 0xad, 0xbe, 0xef]),\n        }),\n        presigningOptions\n      );\n      expect(query).toEqual({\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"bd1427cfdc9a3b0a55609b0114d1dab4dfebca81a9496d6c47dedf65a3ec3bcb\",\n      });\n    });\n\n    it(\"should sign requests with streaming (unsigned) bodies\", async () => {\n      /**\n       * An environment specific stream that the signer knows nothing about.\n       */\n      class ExoticStream {}\n\n      const { query } = await signer.presign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new ExoticStream() as any,\n        }),\n        presigningOptions\n      );\n      expect(query).toEqual({\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"457d44313f7b225c3523ddfc0ca161dfd010269b98c837a7a6f1b26ceb87ae4c\",\n      });\n    });\n\n    it(`should set and sign the ${TOKEN_QUERY_PARAM} query parameter if the credentials have a session token`, async () => {\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: \"us-bar-1\",\n        sha256: Sha256,\n        credentials: {\n          ...credentials,\n          sessionToken: \"baz\",\n        },\n      });\n      const { query } = await signer.presign(minimalRequest, presigningOptions);\n\n      expect(query).toEqual({\n        [TOKEN_QUERY_PARAM]: \"baz\",\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"1b57912615b8e7ae78790ba713193d34baa793d6be2a1b18370dd27dce2d05a7\",\n      });\n    });\n\n    it(\"should use the precalculated payload checksum if provided\", async () => {\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: \"us-bar-1\",\n        sha256: Sha256,\n        credentials,\n      });\n\n      const { query } = await signer.presign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new Uint8Array([0xde, 0xad, 0xbe, 0xef]),\n          headers: {\n            ...minimalRequest.headers,\n            \"X-Amz-Content-Sha256\": \"UNSIGNED-PAYLOAD\",\n          },\n        }),\n        presigningOptions\n      );\n\n      expect(query).toEqual({\n        \"X-Amz-Content-Sha256\": \"UNSIGNED-PAYLOAD\",\n        [ALGORITHM_QUERY_PARAM]: ALGORITHM_IDENTIFIER,\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n        [AMZ_DATE_QUERY_PARAM]: \"20000101T000000Z\",\n        [EXPIRES_QUERY_PARAM]: presigningOptions.expiresIn.toString(),\n        [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n        [SIGNATURE_QUERY_PARAM]: \"04ccc7891757c0ca3811d0e018e4655919ef11fa7b956fe9b782f273cec2374f\",\n      });\n    });\n\n    it(\"should allow specifying custom unsignable headers\", async () => {\n      const headers = {\n        host: \"foo.us-bar-1.amazonaws.com\",\n        foo: \"bar\",\n        \"user-agent\": \"baz\",\n      };\n      const { headers: headersAsSigned, query } = await signer.presign(\n        new HttpRequest({\n          ...minimalRequest,\n          headers,\n        }),\n        {\n          ...presigningOptions,\n          unsignableHeaders: new Set([\"foo\"]),\n        }\n      );\n      expect((query as any)[SIGNED_HEADERS_QUERY_PARAM]).toBe(\"host\");\n      expect(headersAsSigned).toEqual(headers);\n    });\n\n    it(\"should return a rejected promise if the expiresIn is more than one week in the future\", async () => {\n      await expect(\n        signer.presign(minimalRequest, {\n          ...presigningOptions,\n          expiresIn: 7 * 24 * 60 * 60 + 1,\n        })\n      ).rejects.toMatch(/less than one week in the future/);\n    });\n\n    it(\"should support presigning with asynchronously resolved credentials\", async () => {\n      const credsProvider = () =>\n        Promise.resolve({\n          accessKeyId: \"foo\",\n          secretAccessKey: \"bar\",\n        });\n\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: \"us-bar-1\",\n        sha256: Sha256,\n        credentials: credsProvider,\n      });\n\n      const { query } = await signer.presign(minimalRequest, presigningOptions);\n\n      expect(query).toMatchObject({\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n      });\n    });\n\n    it(\"should support presigning with an asynchronously resolved region\", async () => {\n      const regionProvider = () => Promise.resolve(\"us-bar-1\");\n\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: regionProvider,\n        sha256: Sha256,\n        credentials: {\n          accessKeyId: \"foo\",\n          secretAccessKey: \"bar\",\n        },\n      });\n\n      const { query } = await signer.presign(minimalRequest, presigningOptions);\n\n      expect(query).toMatchObject({\n        [CREDENTIAL_QUERY_PARAM]: \"foo/20000101/us-bar-1/foo/aws4_request\",\n      });\n    });\n\n    describe(\"URI encoding paths\", () => {\n      const minimalRequest = new HttpRequest({\n        method: \"POST\",\n        protocol: \"https:\",\n        path: \"/foo%3Dbar\",\n        headers: {\n          host: \"foo.us-bar-1.amazonaws.com\",\n        },\n        hostname: \"foo.us-bar-1.amazonaws.com\",\n      });\n\n      it(\"should URI-encode the path by default\", async () => {\n        const { query = {} } = await signer.presign(minimalRequest, presigningOptions);\n        expect(query[SIGNATURE_QUERY_PARAM]).toBe(\"6267d8b6f44d165d2b9f4d2c2b45fd6971de0962820243669bf685818c9c7849\");\n      });\n\n      it(\"should normalize relative path by default\", async () => {\n        const { query = {} } = await signer.presign(\n          { ...minimalRequest, path: \"/abc/../foo%3Dbar\" },\n          presigningOptions\n        );\n        expect(query[SIGNATURE_QUERY_PARAM]).toBe(\"6267d8b6f44d165d2b9f4d2c2b45fd6971de0962820243669bf685818c9c7849\");\n      });\n\n      it(\"should normalize path with consecutive slashes by default\", async () => {\n        const { query = {} } = await signer.presign({ ...minimalRequest, path: \"//foo%3Dbar\" }, presigningOptions);\n        expect(query[SIGNATURE_QUERY_PARAM]).toBe(\"6267d8b6f44d165d2b9f4d2c2b45fd6971de0962820243669bf685818c9c7849\");\n      });\n\n      it(\"should not URI-encode the path if URI path escaping was disabled on the signer\", async () => {\n        // Setting `uriEscapePath` to `false` creates an\n        // S3-compatible signer. The expected signature included\n        // below was calculated using the\n        // `Aws\\Signature\\S3SignatureV4` class from the AWS SDK for\n        // PHP\n        const signer = new SignatureV4({\n          service: \"foo\",\n          region: \"us-bar-1\",\n          sha256: Sha256,\n          credentials: {\n            accessKeyId: \"foo\",\n            secretAccessKey: \"bar\",\n          },\n          uriEscapePath: false,\n        });\n\n        const { query = {} } = await signer.presign(\n          new HttpRequest({\n            ...minimalRequest,\n            path: \"/foo/bar/baz\",\n            headers: {\n              ...minimalRequest.headers,\n              \"X-Amz-Content-Sha256\": \"UNSIGNED-PAYLOAD\",\n            },\n          }),\n          presigningOptions\n        );\n        expect(query[SIGNATURE_QUERY_PARAM]).toBe(\"d1a68eff5d8d5be581f20c7793a67a6cd2e561a5b818055b21ad064139eb83b1\");\n      });\n    });\n  });\n\n  describe(\"#sign (request)\", () => {\n    it(\"should throw on invalid credential\", async () => {\n      const signer = new SignatureV4({ ...signerInit, credentials: {} as any });\n      try {\n        await signer.sign(minimalRequest);\n        fail(\"This test is expected to fail\");\n      } catch (e) {\n        expect(e.message).toBe(\"Resolved credential object is not valid\");\n      }\n    });\n\n    it(\"should sign requests without bodies\", async () => {\n      const { headers } = await signer.sign(minimalRequest, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      });\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=1e3b24fcfd7655c0c245d99ba7b6b5ca6174eab903ebfbda09ce457af062ad30\"\n      );\n    });\n\n    it(\"should support overriding region and service in the signer instance\", async () => {\n      const signer = new SignatureV4({\n        ...signerInit,\n        service: \"qux\",\n        region: \"us-foo-1\",\n      });\n      const { headers } = await signer.sign(minimalRequest, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n        signingService: signerInit.service,\n        signingRegion: signerInit.region,\n      });\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=1e3b24fcfd7655c0c245d99ba7b6b5ca6174eab903ebfbda09ce457af062ad30\"\n      );\n    });\n\n    it(\"should sign requests without host header\", async () => {\n      const request = HttpRequest.clone(minimalRequest);\n      delete request.headers[HOST_HEADER];\n      const { headers } = await signer.sign(request, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      });\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=x-amz-content-sha256;x-amz-date, Signature=36cfca5cdb2c8d094f100663925d408a9608908ffc10b83133e5b25829ef7f5f\"\n      );\n    });\n\n    it(\"should sign requests with string bodies\", async () => {\n      const { headers } = await signer.sign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: \"It was the best of times, it was the worst of times\",\n        }),\n        { signingDate: new Date(\"2000-01-01T00:00:00.000Z\") }\n      );\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=cf22a0befff359388f136b158f0b1b43db7b18d2ca65ce4112bc88a16815c4b6\"\n      );\n    });\n\n    it(\"should sign requests with binary bodies\", async () => {\n      const { headers } = await signer.sign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new Uint8Array([0xde, 0xad, 0xbe, 0xef]),\n        }),\n        { signingDate: new Date(\"2000-01-01T00:00:00.000Z\") }\n      );\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=89f092f52faedb8a6be1890b2a511b88e7998389d62bd7d72915e2f4ee271a64\"\n      );\n    });\n\n    it(\"should sign requests with streaming (unsigned) bodies\", async () => {\n      /**\n       * An environment specific stream that the signer knows nothing about.\n       */\n      class ExoticStream {}\n      const { headers } = await signer.sign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new ExoticStream() as any,\n          headers: {\n            ...minimalRequest.headers,\n            \"X-Amz-Content-Sha256\": \"UNSIGNED-PAYLOAD\",\n          },\n        }),\n        { signingDate: new Date(\"2000-01-01T00:00:00.000Z\") }\n      );\n\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=2d17bf1aa1624819549626389790503937599b27a998286e0e190b897b1467dd\"\n      );\n      expect(headers[\"X-Amz-Content-Sha256\"]).toBe(UNSIGNED_PAYLOAD);\n    });\n\n    it(\"should sign requests with unsigned bodies when so directed\", async () => {\n      const { headers } = await signer.sign(\n        new HttpRequest({\n          ...minimalRequest,\n          body: \"It was the best of times, it was the worst of times\",\n          headers: {\n            ...minimalRequest.headers,\n            \"X-Amz-Content-Sha256\": \"UNSIGNED-PAYLOAD\",\n          },\n        }),\n        { signingDate: new Date(\"2000-01-01T00:00:00.000Z\") }\n      );\n\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=2d17bf1aa1624819549626389790503937599b27a998286e0e190b897b1467dd\"\n      );\n      expect(headers[\"X-Amz-Content-Sha256\"]).toBe(UNSIGNED_PAYLOAD);\n    });\n\n    it(`should set the ${AMZ_DATE_HEADER}`, async () => {\n      const { headers } = await signer.sign(minimalRequest, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      });\n      expect(headers[AMZ_DATE_HEADER]).toBe(\"20000101T000000Z\");\n    });\n\n    it(`should set and sign the ${TOKEN_HEADER} header if the credentials have a session token`, async () => {\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: \"us-bar-1\",\n        sha256: Sha256,\n        credentials: {\n          ...credentials,\n          sessionToken: \"baz\",\n        },\n      });\n      const { headers } = await signer.sign(minimalRequest, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      });\n      expect(headers[AUTH_HEADER]).toBe(\n        \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=4fd09a8cf3b28a62a9c6c424f03ababcd703528578bc6ec9184fc585f18c3fbb\"\n      );\n    });\n\n    it(\"should allow specifying custom unsignable headers\", async () => {\n      const { headers } = await signer.sign(\n        new HttpRequest({\n          ...minimalRequest,\n          headers: {\n            host: \"foo.us-bar-1.amazonaws.com\",\n            foo: \"bar\",\n            \"user-agent\": \"baz\",\n          },\n        }),\n        {\n          signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n          unsignableHeaders: new Set([\"foo\"]),\n        }\n      );\n      expect(headers[AUTH_HEADER]).toMatch(\n        /^AWS4-HMAC-SHA256 Credential=foo\\/20000101\\/us-bar-1\\/foo\\/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=/\n      );\n    });\n\n    it(\"should allow specifying custom signable headers to override custom and always unsignable ones\", async () => {\n      const { headers } = await signer.sign(\n        {\n          ...minimalRequest,\n          headers: {\n            host: \"foo.us-bar-1.amazonaws.com\",\n            foo: \"bar\",\n            \"user-agent\": \"baz\",\n          },\n        },\n        {\n          signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n          unsignableHeaders: new Set([\"foo\"]),\n          signableHeaders: new Set([\"foo\", \"user-agent\"]),\n        }\n      );\n      expect(headers[AUTH_HEADER]).toMatch(\n        /^AWS4-HMAC-SHA256 Credential=foo\\/20000101\\/us-bar-1\\/foo\\/aws4_request, SignedHeaders=foo;host;user-agent;x-amz-content-sha256;x-amz-date, Signature=/\n      );\n    });\n\n    it(\"should support signing with asynchronously resolved credentials\", async () => {\n      const credsProvider = () =>\n        Promise.resolve({\n          accessKeyId: \"foo\",\n          secretAccessKey: \"bar\",\n        });\n\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: \"us-bar-1\",\n        sha256: Sha256,\n        credentials: credsProvider,\n      });\n\n      const { headers } = await signer.sign(minimalRequest, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      });\n\n      expect(headers[AUTH_HEADER]).toMatch(/^AWS4-HMAC-SHA256 Credential=foo\\/20000101\\/us-bar-1\\/foo\\/aws4_request/);\n    });\n\n    it(\"should support presigning with an asynchronously resolved region\", async () => {\n      const regionProvider = () => Promise.resolve(\"us-bar-1\");\n\n      const signer = new SignatureV4({\n        service: \"foo\",\n        region: regionProvider,\n        sha256: Sha256,\n        credentials: {\n          accessKeyId: \"foo\",\n          secretAccessKey: \"bar\",\n        },\n      });\n\n      const { headers } = await signer.sign(minimalRequest, {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      });\n\n      expect(headers[AUTH_HEADER]).toMatch(/^AWS4-HMAC-SHA256 Credential=foo\\/20000101\\/us-bar-1\\/foo\\/aws4_request/);\n    });\n\n    describe(\"URI encoding paths\", () => {\n      const minimalRequest = new HttpRequest({\n        method: \"POST\",\n        protocol: \"https:\",\n        path: \"/foo%3Dbar\",\n        headers: {\n          host: \"foo.us-bar-1.amazonaws.com\",\n        },\n        hostname: \"foo.us-bar-1.amazonaws.com\",\n      });\n\n      const signingOptions = {\n        signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n      };\n\n      it(\"should URI-encode the path by default\", async () => {\n        const { headers } = await signer.sign(minimalRequest, signingOptions);\n        expect(headers[AUTH_HEADER]).toBe(\n          \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=fb4948cab44a9c47ce3b1a2489d01ec939fea9e79eccdb4593c11a94f207e075\"\n        );\n      });\n\n      it(\"should normalize relative path by default\", async () => {\n        const { headers } = await signer.sign({ ...minimalRequest, path: \"/abc/../foo%3Dbar\" }, signingOptions);\n        expect(headers[AUTH_HEADER]).toEqual(\n          expect.stringContaining(\"Signature=fb4948cab44a9c47ce3b1a2489d01ec939fea9e79eccdb4593c11a94f207e075\")\n        );\n      });\n\n      it(\"should normalize path with consecutive slashes by default\", async () => {\n        const { headers } = await signer.sign({ ...minimalRequest, path: \"//foo%3Dbar\" }, signingOptions);\n        expect(headers[AUTH_HEADER]).toEqual(\n          expect.stringContaining(\"Signature=fb4948cab44a9c47ce3b1a2489d01ec939fea9e79eccdb4593c11a94f207e075\")\n        );\n      });\n\n      it(\"should normalize path with non-standard characters by default\", async () => {\n        const { headers } = await signer.sign({ ...minimalRequest, path: \"/foo/!'()*\" }, signingOptions);\n        expect(headers[AUTH_HEADER]).toEqual(\n          expect.stringContaining(\"Signature=698b237cc68fe34535e57f374fa81f63219314b5a877742f889f6222c9ecab7b\")\n        );\n      });\n\n      it(\"should not URI-encode the path if URI path escaping was disabled on the signer\", async () => {\n        // Setting `uriEscapePath` to `false` creates an\n        // S3-compatible signer. The expected authorization header\n        // included below was calculated using the\n        // `Aws\\Signature\\S3SignatureV4` class from the AWS SDK for\n        // PHP\n        const signer = new SignatureV4({\n          service: \"foo\",\n          region: \"us-bar-1\",\n          sha256: Sha256,\n          credentials: {\n            accessKeyId: \"foo\",\n            secretAccessKey: \"bar\",\n          },\n          uriEscapePath: false,\n        });\n\n        const { headers } = await signer.sign(\n          new HttpRequest({\n            ...minimalRequest,\n            headers: {\n              ...minimalRequest.headers,\n              \"X-Amz-Content-Sha256\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\n            },\n          }),\n          {\n            signingDate: new Date(\"2000-01-01T00:00:00.000Z\"),\n          }\n        );\n        expect(headers[AUTH_HEADER]).toBe(\n          \"AWS4-HMAC-SHA256 Credential=foo/20000101/us-bar-1/foo/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=0d859e5a74374efc2c9f14ba9352df14c68e411a1f44bd639fdd024e5f7b7ef1\"\n        );\n      });\n    });\n  });\n\n  describe(\"#sign (string)\", () => {\n    const signerInit = {\n      service: \"s3\",\n      region: \"us-east-1\",\n      credentials: {\n        accessKeyId: \"AKIAIOSFODNN7EXAMPLE\",\n        secretAccessKey: \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n      },\n      sha256: Sha256,\n    };\n\n    it(\"should throw on invalid credential\", async () => {\n      const signer = new SignatureV4({ ...signerInit, credentials: {} as any });\n      try {\n        await signer.sign(\"STRING_TO_SIGN\");\n        fail(\"This test is expected to fail\");\n      } catch (e) {\n        expect(e.message).toBe(\"Resolved credential object is not valid\");\n      }\n    });\n\n    it(\"should produce signatures matching known outputs\", async () => {\n      // Example copied from https://github.com/aws/aws-sdk-php/blob/3.42.0/tests/S3/PostObjectV4Test.php#L37\n      const signer = new SignatureV4(signerInit);\n      const signingDate = new Date(\"2015-12-29T00:00:00Z\");\n      const stringToSign =\n        \"eyJleHBpcmF0aW9uIjoiMjAxNS0xMi0yOVQwMTowMDowMFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJzaWd2NGV4YW1wbGVidWNrZXQifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVzZXJcL3VzZXIxXC8iXSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9yZWRpcmVjdCI6Imh0dHA6XC9cL3NpZ3Y0ZXhhbXBsZWJ1Y2tldC5zMy5hbWF6b25hd3MuY29tXC9zdWNjZXNzZnVsX3VwbG9hZC5odG1sIn0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCJpbWFnZVwvIl0seyJ4LWFtei1tZXRhLXV1aWQiOiIxNDM2NTEyMzY1MTI3NCJ9LHsieC1hbXotc2VydmVyLXNpZGUtZW5jcnlwdGlvbiI6IkFFUzI1NiJ9LFsic3RhcnRzLXdpdGgiLCIkeC1hbXotbWV0YS10YWciLCIiXSx7IlgtQW16LURhdGUiOiIyMDE1MTIyOVQwMDAwWiJ9LHsiWC1BbXotQ3JlZGVudGlhbCI6IkFLSUFJT1NGT0ROTjdFWEFNUExFXC8yMDE1MTIyOVwvdXMtZWFzdC0xXC9zM1wvYXdzNF9yZXF1ZXN0In0seyJYLUFtei1BbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In1dfQ==\";\n      expect(await signer.sign(stringToSign, { signingDate })).toBe(\n        \"683963a1575bb197c642490ac60f3f08cda08233cd3a163ad31b554e9327a3ff\"\n      );\n    });\n\n    it(\"should support overriding region and service in the signer instance\", async () => {\n      const signer = new SignatureV4({\n        ...signerInit,\n        service: \"qux\",\n        region: \"us-foo-1\",\n      });\n      const signingDate = new Date(\"2015-12-29T00:00:00Z\");\n      const stringToSign =\n        \"eyJleHBpcmF0aW9uIjoiMjAxNS0xMi0yOVQwMTowMDowMFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJzaWd2NGV4YW1wbGVidWNrZXQifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInVzZXJcL3VzZXIxXC8iXSx7ImFjbCI6InB1YmxpYy1yZWFkIn0seyJzdWNjZXNzX2FjdGlvbl9yZWRpcmVjdCI6Imh0dHA6XC9cL3NpZ3Y0ZXhhbXBsZWJ1Y2tldC5zMy5hbWF6b25hd3MuY29tXC9zdWNjZXNzZnVsX3VwbG9hZC5odG1sIn0sWyJzdGFydHMtd2l0aCIsIiRDb250ZW50LVR5cGUiLCJpbWFnZVwvIl0seyJ4LWFtei1tZXRhLXV1aWQiOiIxNDM2NTEyMzY1MTI3NCJ9LHsieC1hbXotc2VydmVyLXNpZGUtZW5jcnlwdGlvbiI6IkFFUzI1NiJ9LFsic3RhcnRzLXdpdGgiLCIkeC1hbXotbWV0YS10YWciLCIiXSx7IlgtQW16LURhdGUiOiIyMDE1MTIyOVQwMDAwWiJ9LHsiWC1BbXotQ3JlZGVudGlhbCI6IkFLSUFJT1NGT0ROTjdFWEFNUExFXC8yMDE1MTIyOVwvdXMtZWFzdC0xXC9zM1wvYXdzNF9yZXF1ZXN0In0seyJYLUFtei1BbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In1dfQ==\";\n      expect(\n        await signer.sign(stringToSign, {\n          signingDate,\n          signingRegion: signerInit.region,\n          signingService: signerInit.service,\n        })\n      ).toBe(\"683963a1575bb197c642490ac60f3f08cda08233cd3a163ad31b554e9327a3ff\");\n    });\n  });\n\n  describe(\"#sign (event)\", () => {\n    //adopt to Ruby SDK: https://github.com/aws/aws-sdk-ruby/blob/3c47c05aa77bdbb7b803a3ff932b3a89c32276ac/gems/aws-sigv4/spec/signer_spec.rb#L274\n    const signerInit = {\n      service: \"SERVICE\",\n      region: \"REGION\",\n      credentials: {\n        accessKeyId: \"akid\",\n        secretAccessKey: \"secret\",\n      },\n      sha256: Sha256,\n    };\n\n    it(\"should throw on invalid credential\", async () => {\n      const signer = new SignatureV4({ ...signerInit, credentials: {} as any });\n      try {\n        await signer.sign(\n          {\n            headers: Uint8Array.from([5, 58, 100, 97, 116, 101, 8, 0, 0, 1, 103, 247, 125, 87, 112]),\n            payload: \"foo\" as any,\n          },\n          {\n            signingDate: new Date(1369353600000),\n            priorSignature: \"\",\n          }\n        );\n        fail(\"This test is expected to fail\");\n      } catch (e) {\n        expect(e.message).toBe(\"Resolved credential object is not valid\");\n      }\n    });\n\n    it(\"support event signing\", async () => {\n      const signer = new SignatureV4(signerInit);\n      const eventSignature = await signer.sign(\n        {\n          headers: Uint8Array.from([5, 58, 100, 97, 116, 101, 8, 0, 0, 1, 103, 247, 125, 87, 112]),\n          payload: \"foo\" as any,\n        },\n        {\n          signingDate: new Date(1369353600000),\n          priorSignature: \"\",\n        }\n      );\n      expect(eventSignature).toEqual(\"204bb5e2713e95354680e9522986d3ac0304aeafd33397f39e6540ca51ffe226\");\n    });\n\n    it(\"should support overriding region and service in the signer instance\", async () => {\n      const signer = new SignatureV4({\n        ...signerInit,\n        service: \"qux\",\n        // region: \"us-foo-1\",\n      });\n      const eventSignature = await signer.sign(\n        {\n          headers: Uint8Array.from([5, 58, 100, 97, 116, 101, 8, 0, 0, 1, 103, 247, 125, 87, 112]),\n          payload: \"foo\" as any,\n        },\n        {\n          signingDate: new Date(1369353600000),\n          priorSignature: \"\",\n          // signingRegion: signerInit.region,\n          signingService: signerInit.service,\n        }\n      );\n      expect(eventSignature).toEqual(\"204bb5e2713e95354680e9522986d3ac0304aeafd33397f39e6540ca51ffe226\");\n    });\n\n    it(\"should use eventStreamCredentials when provided instead of credential provider\", async () => {\n      const credentialProvider = vi.fn().mockRejectedValue(new Error(\"should not be called\"));\n      const signer = new SignatureV4({\n        ...signerInit,\n        credentials: credentialProvider,\n      });\n      const eventSignature = await signer.sign(\n        {\n          headers: Uint8Array.from([5, 58, 100, 97, 116, 101, 8, 0, 0, 1, 103, 247, 125, 87, 112]),\n          payload: \"foo\" as any,\n        },\n        {\n          signingDate: new Date(1369353600000),\n          priorSignature: \"\",\n          eventStreamCredentials: {\n            accessKeyId: \"akid\",\n            secretAccessKey: \"secret\",\n          },\n        }\n      );\n      expect(credentialProvider).not.toHaveBeenCalled();\n      expect(eventSignature).toEqual(\"204bb5e2713e95354680e9522986d3ac0304aeafd33397f39e6540ca51ffe226\");\n    });\n\n    it(\"should produce different signature when eventStreamCredentials differ from signer credentials\", async () => {\n      const signer = new SignatureV4(signerInit);\n      const differentCreds = {\n        accessKeyId: \"other-akid\",\n        secretAccessKey: \"other-secret\",\n      };\n      const event = {\n        headers: Uint8Array.from([5, 58, 100, 97, 116, 101, 8, 0, 0, 1, 103, 247, 125, 87, 112]),\n        payload: \"foo\" as any,\n      };\n      const opts = {\n        signingDate: new Date(1369353600000),\n        priorSignature: \"\",\n      };\n\n      const signatureWithDefault = await signer.sign(event, opts);\n      const signatureWithOverride = await signer.sign(event, {\n        ...opts,\n        eventStreamCredentials: differentCreds,\n      });\n\n      expect(signatureWithDefault).not.toEqual(signatureWithOverride);\n    });\n  });\n\n  describe(\"#sign (message)\", () => {\n    const signerInit = {\n      service: \"SERVICE\",\n      region: \"REGION\",\n      credentials: {\n        accessKeyId: \"akid\",\n        secretAccessKey: \"secret\",\n      },\n      sha256: Sha256,\n    };\n\n    it(\"support message signing\", async () => {\n      const signer = new SignatureV4(signerInit);\n\n      const headers = {\n        \":date\": {\n          type: \"timestamp\",\n          value: new Date(\"2018-12-29T01:04:06.000Z\"),\n        } as TimestampHeaderValue,\n      };\n\n      const signedMessage = await signer.sign(\n        {\n          message: {\n            headers,\n            body: \"foo\" as any,\n          },\n          priorSignature: \"\",\n        } as SignableMessage,\n        {\n          signingDate: new Date(1369353600000),\n        }\n      );\n      expect(signedMessage.signature).toEqual(\"204bb5e2713e95354680e9522986d3ac0304aeafd33397f39e6540ca51ffe226\");\n      expect(signedMessage.message.body).toEqual(\"foo\");\n      expect(signedMessage.message.headers).toEqual(headers);\n    });\n\n    it(\"should use eventStreamCredentials when provided instead of credential provider\", async () => {\n      const credentialProvider = vi.fn().mockRejectedValue(new Error(\"should not be called\"));\n      const signer = new SignatureV4({\n        ...signerInit,\n        credentials: credentialProvider,\n      });\n\n      const signedMessage = await signer.sign(\n        {\n          message: {\n            headers: {\n              \":date\": {\n                type: \"timestamp\",\n                value: new Date(\"2018-12-29T01:04:06.000Z\"),\n              } as TimestampHeaderValue,\n            },\n            body: \"foo\" as any,\n          },\n          priorSignature: \"\",\n        } as SignableMessage,\n        {\n          signingDate: new Date(1369353600000),\n          eventStreamCredentials: {\n            accessKeyId: \"akid\",\n            secretAccessKey: \"secret\",\n          },\n        }\n      );\n      expect(credentialProvider).not.toHaveBeenCalled();\n      expect(signedMessage.signature).toEqual(\"204bb5e2713e95354680e9522986d3ac0304aeafd33397f39e6540ca51ffe226\");\n    });\n  });\n\n  describe(\"ambient Date usage\", () => {\n    let dateSpy: MockInstance;\n    const mockDate = new Date();\n\n    beforeEach(() => {\n      dateSpy = vi.spyOn(global, \"Date\").mockImplementation(() => mockDate as any);\n    });\n\n    afterEach(() => {\n      expect(dateSpy).toHaveBeenCalledTimes(1);\n      vi.clearAllMocks();\n    });\n\n    it(\"should use the current date for presigning if no signing date was supplied\", async () => {\n      const { query } = await signer.presign(minimalRequest);\n      expect((query as any)[AMZ_DATE_QUERY_PARAM]).toBe(iso8601(mockDate).replace(/[\\-:]/g, \"\"));\n    });\n\n    it(\"should use the current date for signing if no signing date supplied\", async () => {\n      const { headers } = await signer.sign(minimalRequest);\n      expect(headers[AMZ_DATE_HEADER]).toBe(iso8601(mockDate).replace(/[\\-:]/g, \"\"));\n    });\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/SignatureV4.ts",
    "content": "import { toHex, toUint8Array } from \"@smithy/core/serde\";\nimport type {\n  AwsCredentialIdentity,\n  EventSigner,\n  EventSigningArguments,\n  FormattedEvent,\n  HttpRequest,\n  MessageSigner,\n  MessageSigningArguments,\n  RequestPresigner,\n  RequestPresigningArguments,\n  RequestSigner,\n  RequestSigningArguments,\n  SignableMessage,\n  SignedMessage,\n  SigningArguments,\n  StringSigner,\n} from \"@smithy/types\";\n\nimport { HeaderFormatter } from \"./HeaderFormatter\";\nimport { SignatureV4Base, type SignatureV4CryptoInit, type SignatureV4Init } from \"./SignatureV4Base\";\nimport {\n  ALGORITHM_IDENTIFIER,\n  ALGORITHM_QUERY_PARAM,\n  AMZ_DATE_HEADER,\n  AMZ_DATE_QUERY_PARAM,\n  AUTH_HEADER,\n  CREDENTIAL_QUERY_PARAM,\n  EVENT_ALGORITHM_IDENTIFIER,\n  EXPIRES_QUERY_PARAM,\n  MAX_PRESIGNED_TTL,\n  SHA256_HEADER,\n  SIGNATURE_QUERY_PARAM,\n  SIGNED_HEADERS_QUERY_PARAM,\n  TOKEN_HEADER,\n  TOKEN_QUERY_PARAM,\n} from \"./constants\";\nimport { createScope, getSigningKey } from \"./credentialDerivation\";\nimport { getCanonicalHeaders } from \"./getCanonicalHeaders\";\nimport { getPayloadHash } from \"./getPayloadHash\";\nimport { hasHeader } from \"./headerUtil\";\nimport { moveHeadersToQuery } from \"./moveHeadersToQuery\";\nimport { prepareRequest } from \"./prepareRequest\";\n\n/**\n * @public\n */\nexport class SignatureV4\n  extends SignatureV4Base\n  implements RequestPresigner, RequestSigner, StringSigner, EventSigner, MessageSigner\n{\n  private readonly headerFormatter = new HeaderFormatter();\n\n  constructor({\n    applyChecksum,\n    credentials,\n    region,\n    service,\n    sha256,\n    uriEscapePath = true,\n  }: SignatureV4Init & SignatureV4CryptoInit) {\n    super({\n      applyChecksum,\n      credentials,\n      region,\n      service,\n      sha256,\n      uriEscapePath,\n    });\n  }\n\n  public async presign(originalRequest: HttpRequest, options: RequestPresigningArguments = {}): Promise<HttpRequest> {\n    const {\n      signingDate = new Date(),\n      expiresIn = 3600,\n      unsignableHeaders,\n      unhoistableHeaders,\n      signableHeaders,\n      hoistableHeaders,\n      signingRegion,\n      signingService,\n    } = options;\n    const credentials = await this.credentialProvider();\n    this.validateResolvedCredentials(credentials);\n    const region = signingRegion ?? (await this.regionProvider());\n\n    const { longDate, shortDate } = this.formatDate(signingDate);\n    if (expiresIn > MAX_PRESIGNED_TTL) {\n      return Promise.reject(\n        \"Signature version 4 presigned URLs\" + \" must have an expiration date less than one week in\" + \" the future\"\n      );\n    }\n\n    const scope = createScope(shortDate, region, signingService ?? this.service);\n    const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders });\n\n    if (credentials.sessionToken) {\n      request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;\n    }\n    request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;\n    request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;\n    request.query[AMZ_DATE_QUERY_PARAM] = longDate;\n    request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);\n\n    const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n    request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders);\n\n    request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(\n      longDate,\n      scope,\n      this.getSigningKey(credentials, region, shortDate, signingService),\n      this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))\n    );\n\n    return request;\n  }\n\n  public async sign(stringToSign: string, options?: SigningArguments): Promise<string>;\n  public async sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;\n  public async sign(event: SignableMessage, options: MessageSigningArguments): Promise<SignedMessage>;\n  public async sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;\n  public async sign(toSign: any, options: any): Promise<any> {\n    if (typeof toSign === \"string\") {\n      return this.signString(toSign, options);\n    } else if (toSign.headers && toSign.payload) {\n      return this.signEvent(toSign, options);\n    } else if (toSign.message) {\n      return this.signMessage(toSign, options);\n    } else {\n      return this.signRequest(toSign, options);\n    }\n  }\n\n  private async signEvent(\n    { headers, payload }: FormattedEvent,\n    {\n      signingDate = new Date(),\n      priorSignature,\n      signingRegion,\n      signingService,\n      eventStreamCredentials,\n    }: EventSigningArguments\n  ): Promise<string> {\n    const region = signingRegion ?? (await this.regionProvider());\n    const { shortDate, longDate } = this.formatDate(signingDate);\n    const scope = createScope(shortDate, region, signingService ?? this.service);\n    const hashedPayload = await getPayloadHash({ headers: {}, body: payload } as any, this.sha256);\n    const hash = new this.sha256();\n    hash.update(headers);\n    const hashedHeaders = toHex(await hash.digest());\n    const stringToSign = [\n      EVENT_ALGORITHM_IDENTIFIER,\n      longDate,\n      scope,\n      priorSignature,\n      hashedHeaders,\n      hashedPayload,\n    ].join(\"\\n\");\n    return this.signString(stringToSign, {\n      signingDate,\n      signingRegion: region,\n      signingService,\n      eventStreamCredentials,\n    });\n  }\n\n  async signMessage(\n    signableMessage: SignableMessage,\n    { signingDate = new Date(), signingRegion, signingService, eventStreamCredentials }: MessageSigningArguments\n  ): Promise<SignedMessage> {\n    const promise = this.signEvent(\n      {\n        headers: this.headerFormatter.format(signableMessage.message.headers),\n        payload: signableMessage.message.body,\n      },\n      {\n        signingDate,\n        signingRegion,\n        signingService,\n        priorSignature: signableMessage.priorSignature,\n        eventStreamCredentials,\n      }\n    );\n\n    return promise.then((signature) => {\n      return { message: signableMessage.message, signature };\n    });\n  }\n\n  private async signString(\n    stringToSign: string,\n    {\n      signingDate = new Date(),\n      signingRegion,\n      signingService,\n      eventStreamCredentials,\n    }: SigningArguments & Partial<EventSigningArguments> = {}\n  ): Promise<string> {\n    const credentials = eventStreamCredentials ?? (await this.credentialProvider());\n    this.validateResolvedCredentials(credentials);\n    const region = signingRegion ?? (await this.regionProvider());\n    const { shortDate } = this.formatDate(signingDate);\n\n    const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));\n    hash.update(toUint8Array(stringToSign));\n    return toHex(await hash.digest());\n  }\n\n  private async signRequest(\n    requestToSign: HttpRequest,\n    {\n      signingDate = new Date(),\n      signableHeaders,\n      unsignableHeaders,\n      signingRegion,\n      signingService,\n    }: RequestSigningArguments = {}\n  ): Promise<HttpRequest> {\n    const credentials = await this.credentialProvider();\n    this.validateResolvedCredentials(credentials);\n    const region = signingRegion ?? (await this.regionProvider());\n    const request = prepareRequest(requestToSign);\n    const { longDate, shortDate } = this.formatDate(signingDate);\n    const scope = createScope(shortDate, region, signingService ?? this.service);\n\n    request.headers[AMZ_DATE_HEADER] = longDate;\n    if (credentials.sessionToken) {\n      request.headers[TOKEN_HEADER] = credentials.sessionToken;\n    }\n\n    const payloadHash = await getPayloadHash(request, this.sha256);\n    if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {\n      request.headers[SHA256_HEADER] = payloadHash;\n    }\n\n    const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n    const signature = await this.getSignature(\n      longDate,\n      scope,\n      this.getSigningKey(credentials, region, shortDate, signingService),\n      this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n    );\n\n    request.headers[AUTH_HEADER] =\n      `${ALGORITHM_IDENTIFIER} ` +\n      `Credential=${credentials.accessKeyId}/${scope}, ` +\n      `SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, ` +\n      `Signature=${signature}`;\n\n    return request;\n  }\n\n  private async getSignature(\n    longDate: string,\n    credentialScope: string,\n    keyPromise: Promise<Uint8Array>,\n    canonicalRequest: string\n  ): Promise<string> {\n    const stringToSign = await this.createStringToSign(\n      longDate,\n      credentialScope,\n      canonicalRequest,\n      ALGORITHM_IDENTIFIER\n    );\n\n    const hash = new this.sha256(await keyPromise);\n    hash.update(toUint8Array(stringToSign));\n    return toHex(await hash.digest());\n  }\n\n  private getSigningKey(\n    credentials: AwsCredentialIdentity,\n    region: string,\n    shortDate: string,\n    service?: string\n  ): Promise<Uint8Array> {\n    return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);\n  }\n}\n"
  },
  {
    "path": "packages/signature-v4/src/SignatureV4Base.ts",
    "content": "import { normalizeProvider } from \"@smithy/core/client\";\nimport { escapeUri } from \"@smithy/core/protocols\";\nimport { toHex, toUint8Array } from \"@smithy/core/serde\";\nimport type {\n  AwsCredentialIdentity,\n  ChecksumConstructor,\n  DateInput,\n  HashConstructor,\n  HeaderBag,\n  HttpRequest,\n  Provider,\n} from \"@smithy/types\";\n\nimport { getCanonicalQuery } from \"./getCanonicalQuery\";\nimport { iso8601 } from \"./utilDate\";\n\n/**\n * @public\n */\nexport interface SignatureV4Init {\n  /**\n   * The service signing name.\n   */\n  service: string;\n\n  /**\n   * The region name or a function that returns a promise that will be\n   * resolved with the region name.\n   */\n  region: string | Provider<string>;\n\n  /**\n   * The credentials with which the request should be signed or a function\n   * that returns a promise that will be resolved with credentials.\n   */\n  credentials: AwsCredentialIdentity | Provider<AwsCredentialIdentity>;\n\n  /**\n   * A constructor function for a hash object that will calculate SHA-256 HMAC\n   * checksums.\n   */\n  sha256?: ChecksumConstructor | HashConstructor;\n\n  /**\n   * Whether to uri-escape the request URI path as part of computing the\n   * canonical request string. This is required for every AWS service, except\n   * Amazon S3, as of late 2017.\n   *\n   * @default [true]\n   */\n  uriEscapePath?: boolean;\n\n  /**\n   * Whether to calculate a checksum of the request body and include it as\n   * either a request header (when signing) or as a query string parameter\n   * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n   * every other AWS service as of late 2017.\n   *\n   * @default [true]\n   */\n  applyChecksum?: boolean;\n}\n\n/**\n * @public\n */\nexport interface SignatureV4CryptoInit {\n  sha256: ChecksumConstructor | HashConstructor;\n}\n\n/**\n * @internal\n */\nexport abstract class SignatureV4Base {\n  protected readonly service: string;\n  protected readonly regionProvider: Provider<string>;\n  protected readonly credentialProvider: Provider<AwsCredentialIdentity>;\n  protected readonly sha256: ChecksumConstructor | HashConstructor;\n  private readonly uriEscapePath: boolean;\n  protected readonly applyChecksum: boolean;\n\n  protected constructor({\n    applyChecksum,\n    credentials,\n    region,\n    service,\n    sha256,\n    uriEscapePath = true,\n  }: SignatureV4Init & SignatureV4CryptoInit) {\n    this.service = service;\n    this.sha256 = sha256;\n    this.uriEscapePath = uriEscapePath;\n    // default to true if applyChecksum isn't set\n    this.applyChecksum = typeof applyChecksum === \"boolean\" ? applyChecksum : true;\n    this.regionProvider = normalizeProvider(region);\n    this.credentialProvider = normalizeProvider(credentials);\n  }\n\n  protected createCanonicalRequest(request: HttpRequest, canonicalHeaders: HeaderBag, payloadHash: string): string {\n    const sortedHeaders = Object.keys(canonicalHeaders).sort();\n    return `${request.method}\n${this.getCanonicalPath(request)}\n${getCanonicalQuery(request)}\n${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join(\"\\n\")}\n\n${sortedHeaders.join(\";\")}\n${payloadHash}`;\n  }\n\n  protected async createStringToSign(\n    longDate: string,\n    credentialScope: string,\n    canonicalRequest: string,\n    algorithmIdentifier: string\n  ): Promise<string> {\n    const hash = new this.sha256();\n    hash.update(toUint8Array(canonicalRequest));\n    const hashedRequest = await hash.digest();\n\n    return `${algorithmIdentifier}\n${longDate}\n${credentialScope}\n${toHex(hashedRequest)}`;\n  }\n\n  private getCanonicalPath({ path }: HttpRequest): string {\n    if (this.uriEscapePath) {\n      // Non-S3 services, we normalize the path and then double URI encode it.\n      // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n      const normalizedPathSegments = [];\n      for (const pathSegment of path.split(\"/\")) {\n        if (pathSegment?.length === 0) continue;\n        if (pathSegment === \".\") continue;\n        if (pathSegment === \"..\") {\n          normalizedPathSegments.pop();\n        } else {\n          normalizedPathSegments.push(pathSegment);\n        }\n      }\n      // Joining by single slashes to remove consecutive slashes.\n      const normalizedPath = `${path?.startsWith(\"/\") ? \"/\" : \"\"}${normalizedPathSegments.join(\"/\")}${\n        normalizedPathSegments.length > 0 && path?.endsWith(\"/\") ? \"/\" : \"\"\n      }`;\n\n      // Double encode and replace non-standard characters !'()* according to RFC 3986\n      const doubleEncoded = escapeUri(normalizedPath);\n      return doubleEncoded.replace(/%2F/g, \"/\");\n    }\n\n    // For S3, we shouldn't normalize the path. For example, object name\n    // my-object//example//photo.user should not be normalized to\n    // my-object/example/photo.user\n    return path;\n  }\n\n  protected validateResolvedCredentials(credentials: unknown) {\n    if (\n      typeof credentials !== \"object\" ||\n      // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339)\n      typeof credentials.accessKeyId !== \"string\" ||\n      // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339)\n      typeof credentials.secretAccessKey !== \"string\"\n    ) {\n      throw new Error(\"Resolved credential object is not valid\");\n    }\n  }\n\n  protected formatDate(now: DateInput): { longDate: string; shortDate: string } {\n    const longDate = iso8601(now).replace(/[\\-:]/g, \"\");\n    return {\n      longDate,\n      shortDate: longDate.slice(0, 8),\n    };\n  }\n\n  protected getCanonicalHeaderList(headers: object): string {\n    return Object.keys(headers).sort().join(\";\");\n  }\n}\n"
  },
  {
    "path": "packages/signature-v4/src/constants.ts",
    "content": "export const ALGORITHM_QUERY_PARAM = \"X-Amz-Algorithm\";\nexport const CREDENTIAL_QUERY_PARAM = \"X-Amz-Credential\";\nexport const AMZ_DATE_QUERY_PARAM = \"X-Amz-Date\";\nexport const SIGNED_HEADERS_QUERY_PARAM = \"X-Amz-SignedHeaders\";\nexport const EXPIRES_QUERY_PARAM = \"X-Amz-Expires\";\nexport const SIGNATURE_QUERY_PARAM = \"X-Amz-Signature\";\nexport const TOKEN_QUERY_PARAM = \"X-Amz-Security-Token\";\nexport const REGION_SET_PARAM = \"X-Amz-Region-Set\";\n\nexport const AUTH_HEADER = \"authorization\";\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();\nexport const DATE_HEADER = \"date\";\nexport const GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];\nexport const SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();\nexport const SHA256_HEADER = \"x-amz-content-sha256\";\nexport const TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();\nexport const HOST_HEADER = \"host\";\n\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n  authorization: true,\n  \"cache-control\": true,\n  connection: true,\n  expect: true,\n  from: true,\n  \"keep-alive\": true,\n  \"max-forwards\": true,\n  pragma: true,\n  referer: true,\n  te: true,\n  trailer: true,\n  \"transfer-encoding\": true,\n  upgrade: true,\n  \"user-agent\": true,\n  \"x-amzn-trace-id\": true,\n};\n\nexport const PROXY_HEADER_PATTERN = /^proxy-/;\n\nexport const SEC_HEADER_PATTERN = /^sec-/;\n\nexport const UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i];\n\nexport const ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256\";\nexport const ALGORITHM_IDENTIFIER_V4A = \"AWS4-ECDSA-P256-SHA256\";\n\nexport const EVENT_ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256-PAYLOAD\";\n\nexport const UNSIGNED_PAYLOAD = \"UNSIGNED-PAYLOAD\";\n\nexport const MAX_CACHE_SIZE = 50;\nexport const KEY_TYPE_IDENTIFIER = \"aws4_request\";\n\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;\n"
  },
  {
    "path": "packages/signature-v4/src/credentialDerivation.spec.ts",
    "content": "import { Sha256 } from \"@aws-crypto/sha256-js\";\nimport { toHex } from \"@smithy/core/serde\";\nimport type { AwsCredentialIdentity } from \"@smithy/types\";\nimport { beforeEach, describe, expect, test as it, vi } from \"vitest\";\n\nimport { clearCredentialCache, createScope, getSigningKey } from \"./credentialDerivation\";\n\ndescribe(\"createScope\", () => {\n  it(\"should create a scoped identifier for the credentials used\", () => {\n    expect(createScope(\"date\", \"region\", \"service\")).toBe(\"date/region/service/aws4_request\");\n  });\n});\n\ndescribe(\"getSigningKey\", () => {\n  beforeEach(clearCredentialCache);\n\n  const credentials: AwsCredentialIdentity = {\n    accessKeyId: \"foo\",\n    secretAccessKey: \"bar\",\n  };\n  const shortDate = \"19700101\";\n  const region = \"us-foo-1\";\n  const service = \"bar\";\n\n  it(\n    \"should return a buffer containing a signing key derived from the\" +\n      \" provided credentials, date, region, and service\",\n    () => {\n      return expect(getSigningKey(Sha256, credentials, shortDate, region, service).then(toHex)).resolves.toBe(\n        \"b7c34d23320b5cd909500c889eac033a33c93f5a4bf67f71988a58f299e62e0a\"\n      );\n    }\n  );\n\n  it(\"should trap errors encountered while hashing\", () => {\n    return expect(\n      getSigningKey(\n        vi.fn(() => {\n          throw new Error(\"PANIC\");\n        }),\n        credentials,\n        shortDate,\n        region,\n        service\n      )\n    ).rejects.toMatchObject(new Error(\"PANIC\"));\n  });\n\n  describe(\"caching\", () => {\n    it(\"should return the same signing key when called with the same date, region, service, and credentials\", async () => {\n      const mockSha256Constructor = vi.fn().mockImplementation((args) => {\n        return new Sha256(args);\n      });\n      const key1 = await getSigningKey(mockSha256Constructor, credentials, shortDate, region, service);\n      const key2 = await getSigningKey(mockSha256Constructor, credentials, shortDate, region, service);\n      expect(key1).toBe(key2);\n      expect(mockSha256Constructor).toHaveBeenCalledTimes(6);\n    });\n\n    it(\"should cache a maximum of 50 entries\", async () => {\n      const keys: Array<Uint8Array> = new Array(50);\n      // fill the cache\n      for (let i = 0; i < 50; i++) {\n        keys[i] = await getSigningKey(Sha256, credentials, shortDate, `us-foo-${i.toString(10)}`, service);\n      }\n\n      // evict the oldest member from the cache\n      await getSigningKey(Sha256, credentials, shortDate, `us-foo-50`, service);\n\n      // the second oldest member should still be in cache\n      await expect(getSigningKey(Sha256, credentials, shortDate, `us-foo-1`, service)).resolves.toStrictEqual(keys[1]);\n\n      // the oldest member should not be in the cache\n      await expect(getSigningKey(Sha256, credentials, shortDate, `us-foo-0`, service)).resolves.not.toBe(keys[0]);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/credentialDerivation.ts",
    "content": "import { toHex, toUint8Array } from \"@smithy/core/serde\";\nimport type { AwsCredentialIdentity, ChecksumConstructor, HashConstructor, SourceData } from \"@smithy/types\";\n\nimport { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from \"./constants\";\n\nconst signingKeyCache: Record<string, Uint8Array> = {};\nconst cacheQueue: Array<string> = [];\n\n/**\n * Create a string describing the scope of credentials used to sign a request.\n *\n * @internal\n *\n * @param shortDate - the current calendar date in the form YYYYMMDD.\n * @param region    - the AWS region in which the service resides.\n * @param service   - the service to which the signed request is being sent.\n */\nexport const createScope = (shortDate: string, region: string, service: string): string =>\n  `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;\n\n/**\n * Derive a signing key from its composite parts.\n *\n * @internal\n *\n * @param sha256Constructor - a constructor function that can instantiate SHA-256\n *                          hash objects.\n * @param credentials       - the credentials with which the request will be\n *                          signed.\n * @param shortDate         - the current calendar date in the form YYYYMMDD.\n * @param region            - the AWS region in which the service resides.\n * @param service           - the service to which the signed request is being\n *                          sent.\n */\nexport const getSigningKey = async (\n  sha256Constructor: ChecksumConstructor | HashConstructor,\n  credentials: AwsCredentialIdentity,\n  shortDate: string,\n  region: string,\n  service: string\n): Promise<Uint8Array> => {\n  const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);\n  const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;\n  if (cacheKey in signingKeyCache) {\n    return signingKeyCache[cacheKey];\n  }\n\n  cacheQueue.push(cacheKey);\n  while (cacheQueue.length > MAX_CACHE_SIZE) {\n    delete signingKeyCache[cacheQueue.shift() as string];\n  }\n\n  let key: SourceData = `AWS4${credentials.secretAccessKey}`;\n  for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {\n    key = await hmac(sha256Constructor, key, signable);\n  }\n  return (signingKeyCache[cacheKey] = key as Uint8Array);\n};\n\n/**\n * @internal\n */\nexport const clearCredentialCache = (): void => {\n  cacheQueue.length = 0;\n  Object.keys(signingKeyCache).forEach((cacheKey) => {\n    delete signingKeyCache[cacheKey];\n  });\n};\n\nconst hmac = (\n  ctor: ChecksumConstructor | HashConstructor,\n  secret: SourceData,\n  data: SourceData\n): Promise<Uint8Array> => {\n  const hash = new ctor(secret);\n  hash.update(toUint8Array(data));\n  return hash.digest();\n};\n"
  },
  {
    "path": "packages/signature-v4/src/getCanonicalHeaders.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type { HeaderBag } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { ALWAYS_UNSIGNABLE_HEADERS } from \"./constants\";\nimport { getCanonicalHeaders } from \"./getCanonicalHeaders\";\n\ndescribe(\"getCanonicalHeaders\", () => {\n  it(\"should downcase all headers\", () => {\n    expect(\n      getCanonicalHeaders(\n        new HttpRequest({\n          method: \"POST\",\n          protocol: \"https:\",\n          path: \"/\",\n          headers: {\n            fOo: \"bar\",\n            BaZ: \"QUUX\",\n            HoSt: \"foo.us-east-1.amazonaws.com\",\n          },\n          hostname: \"foo.us-east-1.amazonaws.com\",\n        })\n      )\n    ).toEqual({\n      foo: \"bar\",\n      baz: \"QUUX\",\n      host: \"foo.us-east-1.amazonaws.com\",\n    });\n  });\n\n  it(\"should remove all unsignable headers\", () => {\n    const request = new HttpRequest({\n      method: \"POST\",\n      protocol: \"https:\",\n      path: \"/\",\n      headers: {\n        \"x-amz-user-agent\": \"aws-sdk-js-v3\",\n        host: \"foo.us-east-1.amazonaws.com\",\n        foo: \"bar\",\n      },\n      hostname: \"foo.us-east-1.amazonaws.com\",\n    });\n    for (const headerName of Object.keys(ALWAYS_UNSIGNABLE_HEADERS)) {\n      request.headers[headerName] = \"baz\";\n    }\n\n    expect(getCanonicalHeaders(request)).toEqual({\n      \"x-amz-user-agent\": \"aws-sdk-js-v3\",\n      host: \"foo.us-east-1.amazonaws.com\",\n      foo: \"bar\",\n    });\n  });\n\n  it(\"should ignore headers with undefined values\", () => {\n    const headers: HeaderBag = {\n      \"x-amz-user-agent\": \"aws-sdk-js-v3\",\n      host: \"foo.us-east-1.amazonaws.com\",\n      \":authority\": \"\",\n    };\n\n    const request = new HttpRequest({\n      method: \"POST\",\n      protocol: \"https:\",\n      path: \"/\",\n      headers: {\n        ...headers,\n        foo: undefined as any,\n        bar: null as any,\n      },\n      hostname: \"foo.us-east-1.amazonaws.com\",\n    });\n\n    expect(getCanonicalHeaders(request)).toEqual(headers);\n  });\n\n  it(\"should allow specifying custom unsignable headers\", () => {\n    const request = new HttpRequest({\n      method: \"POST\",\n      protocol: \"https:\",\n      path: \"/\",\n      headers: {\n        host: \"foo.us-east-1.amazonaws.com\",\n        foo: \"bar\",\n        \"user-agent\": \"foo-user\",\n      },\n      hostname: \"foo.us-east-1.amazonaws.com\",\n    });\n\n    expect(getCanonicalHeaders(request, new Set([\"foo\"]))).toEqual({\n      host: \"foo.us-east-1.amazonaws.com\",\n    });\n  });\n\n  it(\"should allow specifying custom signable headers that override unsignable ones\", () => {\n    const request = new HttpRequest({\n      method: \"POST\",\n      protocol: \"https:\",\n      path: \"/\",\n      headers: {\n        host: \"foo.us-east-1.amazonaws.com\",\n        foo: \"bar\",\n        \"user-agent\": \"foo-user\",\n      },\n      hostname: \"foo.us-east-1.amazonaws.com\",\n    });\n\n    expect(getCanonicalHeaders(request, new Set([\"foo\"]), new Set([\"foo\", \"user-agent\"]))).toEqual({\n      host: \"foo.us-east-1.amazonaws.com\",\n      foo: \"bar\",\n      \"user-agent\": \"foo-user\",\n    });\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/getCanonicalHeaders.ts",
    "content": "import type { HeaderBag, HttpRequest } from \"@smithy/types\";\n\nimport { ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN } from \"./constants\";\n\n/**\n * @internal\n */\nexport const getCanonicalHeaders = (\n  { headers }: HttpRequest,\n  unsignableHeaders?: Set<string>,\n  signableHeaders?: Set<string>\n): HeaderBag => {\n  const canonical: HeaderBag = {};\n  for (const headerName of Object.keys(headers).sort()) {\n    if (headers[headerName] == undefined) {\n      continue;\n    }\n\n    const canonicalHeaderName = headerName.toLowerCase();\n    if (\n      canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS ||\n      unsignableHeaders?.has(canonicalHeaderName) ||\n      PROXY_HEADER_PATTERN.test(canonicalHeaderName) ||\n      SEC_HEADER_PATTERN.test(canonicalHeaderName)\n    ) {\n      if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) {\n        continue;\n      }\n    }\n\n    canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, \" \");\n  }\n\n  return canonical;\n};\n"
  },
  {
    "path": "packages/signature-v4/src/getCanonicalQuery.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { getCanonicalQuery } from \"./getCanonicalQuery\";\n\nconst httpRequestOptions = {\n  method: \"POST\",\n  protocol: \"https:\",\n  path: \"/\",\n  headers: {},\n  hostname: \"foo.us-east-1.amazonaws.com\",\n};\n\ndescribe(\"getCanonicalQuery\", () => {\n  it(\"should return an empty string for requests with no querystring\", () => {\n    expect(getCanonicalQuery(new HttpRequest(httpRequestOptions))).toBe(\"\");\n  });\n\n  it(\"should serialize simple key => value pairs\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { fizz: \"buzz\", foo: \"bar\" },\n        })\n      )\n    ).toBe(\"fizz=buzz&foo=bar\");\n  });\n\n  it(\"should sort query keys alphabetically\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { foo: \"bar\", baz: \"quux\", fizz: \"buzz\" },\n        })\n      )\n    ).toBe(\"baz=quux&fizz=buzz&foo=bar\");\n  });\n\n  it(\"should sort query keys alphabetically after URI-encode\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { A: \"65\", \"[\": \"91\", a: \"97\", \"{\": \"123\" },\n        })\n      )\n    ).toBe(\"%5B=91&%7B=123&A=65&a=97\");\n  });\n\n  it(\"should URI-encode keys and values\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { \"🐎\": \"🦄\", \"💩\": \"☃️\" },\n        })\n      )\n    ).toBe(\"%F0%9F%90%8E=%F0%9F%A6%84&%F0%9F%92%A9=%E2%98%83%EF%B8%8F\");\n  });\n\n  it(\"should omit the x-amz-signature parameter, regardless of case\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: {\n            \"x-amz-signature\": \"foo\",\n            \"X-Amz-Signature\": \"bar\",\n            fizz: \"buzz\",\n          },\n        })\n      )\n    ).toBe(\"fizz=buzz\");\n  });\n\n  it(\"should serialize arrays of values\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { foo: [\"bar\", \"baz\"] },\n        })\n      )\n    ).toBe(\"foo=bar&foo=baz\");\n  });\n\n  it(\"should serialize arrays using an alphabetic sort\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { snap: [\"pop\", \"crackle\"] },\n        })\n      )\n    ).toBe(\"snap=crackle&snap=pop\");\n  });\n\n  it(\"should URI-encode members of query param arrays\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { \"🐎\": [\"💩\", \"🦄\"] },\n        })\n      )\n    ).toBe(\"%F0%9F%90%8E=%F0%9F%92%A9&%F0%9F%90%8E=%F0%9F%A6%84\");\n  });\n\n  it(\"should sort URI-encode members of query param arrays\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { p: [\"a\", \"à\"] },\n        })\n      )\n    ).toBe(\"p=%C3%A0&p=a\");\n  });\n\n  it(\"should omit non-string, non-array values from the serialized query\", () => {\n    expect(\n      getCanonicalQuery(\n        new HttpRequest({\n          ...httpRequestOptions,\n          query: { foo: \"bar\", baz: new Uint8Array(0) as any },\n        })\n      )\n    ).toBe(\"foo=bar\");\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/getCanonicalQuery.ts",
    "content": "import { escapeUri } from \"@smithy/core/protocols\";\nimport type { HttpRequest } from \"@smithy/types\";\n\nimport { SIGNATURE_HEADER } from \"./constants\";\n\n/**\n * @internal\n */\nexport const getCanonicalQuery = ({ query = {} }: HttpRequest): string => {\n  const keys: Array<string> = [];\n  const serialized: Record<string, string> = {};\n  for (const key of Object.keys(query)) {\n    if (key.toLowerCase() === SIGNATURE_HEADER) {\n      continue;\n    }\n\n    const encodedKey = escapeUri(key);\n    keys.push(encodedKey);\n    const value = query[key];\n    if (typeof value === \"string\") {\n      serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;\n    } else if (Array.isArray(value)) {\n      serialized[encodedKey] = value\n        .slice(0)\n        .reduce((encoded: Array<string>, value: string) => encoded.concat([`${encodedKey}=${escapeUri(value)}`]), [])\n        .sort()\n        .join(\"&\");\n    }\n  }\n\n  return keys\n    .sort()\n    .map((key) => serialized[key])\n    .filter((serialized) => serialized) // omit any falsy values\n    .join(\"&\");\n};\n"
  },
  {
    "path": "packages/signature-v4/src/getPayloadHash.spec.ts",
    "content": "import { Sha256 } from \"@aws-crypto/sha256-js\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { SHA256_HEADER, UNSIGNED_PAYLOAD } from \"./constants\";\nimport { getPayloadHash } from \"./getPayloadHash\";\n\ndescribe(\"getPayloadHash\", () => {\n  const minimalRequest = new HttpRequest({\n    method: \"POST\",\n    protocol: \"https:\",\n    path: \"/\",\n    headers: {},\n    hostname: \"foo.us-east-1.amazonaws.com\",\n  });\n\n  it(\"should return the SHA-256 hash of an empty string if a request has no payload (body)\", async () => {\n    await expect(getPayloadHash(minimalRequest, Sha256)).resolves.toBe(\n      \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n    );\n  });\n\n  it(`should return the value in the '${SHA256_HEADER}' header (if present)`, async () => {\n    await expect(\n      getPayloadHash(\n        new HttpRequest({\n          ...minimalRequest,\n          headers: {\n            [SHA256_HEADER]: \"foo\",\n          },\n        }),\n        vi.fn(() => {\n          throw new Error(\"I should not have been invoked!\");\n        })\n      )\n    ).resolves.toBe(\"foo\");\n  });\n\n  it(\"should return the hex-encoded hash of a string body\", async () => {\n    await expect(\n      getPayloadHash(\n        new HttpRequest({\n          ...minimalRequest,\n          body: \"foo\",\n        }),\n        Sha256\n      )\n    ).resolves.toBe(\"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\");\n  });\n\n  it(\"should return the hex-encoded hash of a ArrayBufferView body\", async () => {\n    await expect(\n      getPayloadHash(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new Uint8Array([0xde, 0xad, 0xbe, 0xef]),\n        }),\n        Sha256\n      )\n    ).resolves.toBe(\"5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953\");\n  });\n\n  it(\"should return the hex-encoded hash of a ArrayBuffer body\", async () => {\n    await expect(\n      getPayloadHash(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new Uint8Array([0xde, 0xad, 0xbe, 0xef]).buffer,\n        }),\n        Sha256\n      )\n    ).resolves.toBe(\"5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953\");\n  });\n\n  it(`should return ${UNSIGNED_PAYLOAD} if the request has a streaming body and no stream collector is provided`, async () => {\n    /**\n     * An environment specific stream that the signer knows nothing about.\n     */\n    class ExoticStream {}\n\n    await expect(\n      getPayloadHash(\n        new HttpRequest({\n          ...minimalRequest,\n          body: new ExoticStream() as any,\n        }),\n        Sha256\n      )\n    ).resolves.toBe(UNSIGNED_PAYLOAD);\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/getPayloadHash.ts",
    "content": "import { isArrayBuffer, toHex, toUint8Array } from \"@smithy/core/serde\";\nimport type { ChecksumConstructor, HashConstructor, HttpRequest } from \"@smithy/types\";\n\nimport { SHA256_HEADER, UNSIGNED_PAYLOAD } from \"./constants\";\n\n/**\n * @internal\n */\nexport const getPayloadHash = async (\n  { headers, body }: HttpRequest,\n  hashConstructor: ChecksumConstructor | HashConstructor\n): Promise<string> => {\n  for (const headerName of Object.keys(headers)) {\n    if (headerName.toLowerCase() === SHA256_HEADER) {\n      return headers[headerName];\n    }\n  }\n\n  if (body == undefined) {\n    return \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\";\n  } else if (typeof body === \"string\" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {\n    const hashCtor = new hashConstructor();\n    hashCtor.update(toUint8Array(body));\n    return toHex(await hashCtor.digest());\n  }\n\n  // As any defined body that is not a string or binary data is a stream, this\n  // body is unsignable. Attempt to send the request with an unsigned payload,\n  // which may or may not be accepted by the service.\n  return UNSIGNED_PAYLOAD;\n};\n"
  },
  {
    "path": "packages/signature-v4/src/headerUtil.ts",
    "content": "import type { HeaderBag } from \"@smithy/types\";\n\nexport const hasHeader = (soughtHeader: string, headers: HeaderBag): boolean => {\n  soughtHeader = soughtHeader.toLowerCase();\n  for (const headerName of Object.keys(headers)) {\n    if (soughtHeader === headerName.toLowerCase()) {\n      return true;\n    }\n  }\n\n  return false;\n};\n\n/* Get the value of one request header, ignore the case. Return string if header is in the headers, else return undefined */\nexport const getHeaderValue = (soughtHeader: string, headers: HeaderBag): string | undefined => {\n  soughtHeader = soughtHeader.toLowerCase();\n  for (const headerName of Object.keys(headers)) {\n    if (soughtHeader === headerName.toLowerCase()) {\n      return headers[headerName];\n    }\n  }\n\n  return undefined;\n};\n\n/* Delete the one request header, ignore the case. Do nothing if it's not there */\nexport const deleteHeader = (soughtHeader: string, headers: HeaderBag) => {\n  soughtHeader = soughtHeader.toLowerCase();\n  for (const headerName of Object.keys(headers)) {\n    if (soughtHeader === headerName.toLowerCase()) {\n      delete headers[headerName];\n    }\n  }\n};\n"
  },
  {
    "path": "packages/signature-v4/src/index.ts",
    "content": "export * from \"./SignatureV4\";\nexport * from \"./constants\";\nexport { getCanonicalHeaders } from \"./getCanonicalHeaders\";\nexport { getCanonicalQuery } from \"./getCanonicalQuery\";\nexport { getPayloadHash } from \"./getPayloadHash\";\nexport { moveHeadersToQuery } from \"./moveHeadersToQuery\";\nexport { prepareRequest } from \"./prepareRequest\";\nexport * from \"./credentialDerivation\";\nexport { SignatureV4Base, type SignatureV4Init, type SignatureV4CryptoInit } from \"./SignatureV4Base\";\nexport { hasHeader } from \"./headerUtil\";\nexport * from \"./signature-v4a-container\";\n"
  },
  {
    "path": "packages/signature-v4/src/moveHeadersToQuery.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { moveHeadersToQuery } from \"./moveHeadersToQuery\";\n\nconst minimalRequest = new HttpRequest({\n  method: \"POST\",\n  protocol: \"https:\",\n  path: \"/\",\n  headers: {\n    host: \"foo.us-east-1.amazonaws.com\",\n  },\n  hostname: \"foo.us-east-1.amazonaws.com\",\n});\n\ndescribe(\"moveHeadersToQuery\", () => {\n  it('should hoist \"x-amz-\" headers to the querystring', () => {\n    const req = moveHeadersToQuery(\n      new HttpRequest({\n        ...minimalRequest,\n        headers: {\n          Host: \"www.example.com\",\n          \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n          Foo: \"bar\",\n          fizz: \"buzz\",\n          SNAP: \"crackle, pop\",\n          \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n        },\n      })\n    );\n\n    expect(req.query).toEqual({\n      \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n      \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n    });\n\n    expect(req.headers).toEqual({\n      Host: \"www.example.com\",\n      Foo: \"bar\",\n      fizz: \"buzz\",\n      SNAP: \"crackle, pop\",\n    });\n  });\n\n  it(\"should not overwrite existing query values with different keys\", () => {\n    const req = moveHeadersToQuery(\n      new HttpRequest({\n        ...minimalRequest,\n        headers: {\n          Host: \"www.example.com\",\n          \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n          Foo: \"bar\",\n          fizz: \"buzz\",\n          SNAP: \"crackle, pop\",\n          \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n        },\n        query: {\n          Foo: \"buzz\",\n          fizz: \"bar\",\n          \"X-Amz-Storage-Class\": \"REDUCED_REDUNDANCY\",\n        },\n      })\n    );\n\n    expect(req.query).toEqual({\n      Foo: \"buzz\",\n      fizz: \"bar\",\n      \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n      \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n    });\n  });\n\n  it(\"should skip hoisting headers to the querystring supplied in unhoistedHeaders\", () => {\n    const req = moveHeadersToQuery(\n      new HttpRequest({\n        ...minimalRequest,\n        headers: {\n          Host: \"www.example.com\",\n          \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n          Foo: \"bar\",\n          fizz: \"buzz\",\n          SNAP: \"crackle, pop\",\n          \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n        },\n      }),\n      {\n        unhoistableHeaders: new Set([\"x-amz-website-redirect-location\"]),\n      }\n    );\n\n    expect(req.query).toEqual({\n      \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n    });\n\n    expect(req.headers).toEqual({\n      Host: \"www.example.com\",\n      \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n      Foo: \"bar\",\n      fizz: \"buzz\",\n      SNAP: \"crackle, pop\",\n    });\n  });\n\n  it(\"should obey hoistableHeaders configuration over unhoistableHeaders\", () => {\n    const req = moveHeadersToQuery(\n      new HttpRequest({\n        ...minimalRequest,\n        headers: {\n          Host: \"www.example.com\",\n          \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n          Foo: \"bar\",\n          fizz: \"buzz\",\n          SNAP: \"crackle, pop\",\n          \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n        },\n      }),\n      {\n        hoistableHeaders: new Set([\"x-amz-website-redirect-location\", \"snap\"]),\n        unhoistableHeaders: new Set([\"x-amz-website-redirect-location\"]),\n      }\n    );\n\n    expect(req.query).toEqual({\n      SNAP: \"crackle, pop\",\n      \"X-Amz-Storage-Class\": \"STANDARD_IA\",\n      \"X-Amz-Website-Redirect-Location\": \"/index.html\",\n    });\n\n    expect(req.headers).toEqual({\n      Host: \"www.example.com\",\n      Foo: \"bar\",\n      fizz: \"buzz\",\n    });\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/moveHeadersToQuery.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpRequest as IHttpRequest, QueryParameterBag } from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport const moveHeadersToQuery = (\n  request: IHttpRequest,\n  options: { unhoistableHeaders?: Set<string>; hoistableHeaders?: Set<string> } = {}\n): IHttpRequest & { query: QueryParameterBag } => {\n  const { headers, query = {} as QueryParameterBag } = HttpRequest.clone(request);\n  for (const name of Object.keys(headers)) {\n    const lname = name.toLowerCase();\n    if (\n      (lname.slice(0, 6) === \"x-amz-\" && !options.unhoistableHeaders?.has(lname)) ||\n      options.hoistableHeaders?.has(lname)\n    ) {\n      query[name] = headers[name];\n      delete headers[name];\n    }\n  }\n\n  return {\n    ...request,\n    headers,\n    query,\n  };\n};\n"
  },
  {
    "path": "packages/signature-v4/src/prepareRequest.spec.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { AMZ_DATE_HEADER, AUTH_HEADER, DATE_HEADER } from \"./constants\";\nimport { prepareRequest } from \"./prepareRequest\";\n\nconst minimalRequest = new HttpRequest({\n  method: \"POST\",\n  protocol: \"https:\",\n  path: \"/\",\n  headers: {\n    host: \"foo.us-bar-1.amazonaws.com\",\n  },\n  hostname: \"foo.us-bar-1.amazonaws.com\",\n});\n\ndescribe(\"prepareRequest\", () => {\n  it(\"should clone requests\", () => {\n    const prepared = prepareRequest(minimalRequest);\n    expect(prepared).toEqual(prepareRequest(minimalRequest));\n    expect(prepared).not.toBe(prepareRequest(minimalRequest));\n  });\n\n  it(\"should ignore previously set authorization, date, and x-amz-date headers\", async () => {\n    const { headers } = prepareRequest(\n      new HttpRequest({\n        ...minimalRequest,\n        headers: {\n          [AUTH_HEADER]: \"foo\",\n          [AMZ_DATE_HEADER]: \"bar\",\n          [DATE_HEADER]: \"baz\",\n        },\n      })\n    );\n    expect(headers[AUTH_HEADER]).toBeUndefined();\n    expect(headers[AMZ_DATE_HEADER]).toBeUndefined();\n    expect(headers[DATE_HEADER]).toBeUndefined();\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/prepareRequest.ts",
    "content": "import { HttpRequest } from \"@smithy/core/protocols\";\nimport type { HttpRequest as IHttpRequest } from \"@smithy/types\";\n\nimport { GENERATED_HEADERS } from \"./constants\";\n\n/**\n * @internal\n */\nexport const prepareRequest = (request: IHttpRequest): IHttpRequest => {\n  // Create a clone of the request object that does not clone the body\n  request = HttpRequest.clone(request);\n\n  for (const headerName of Object.keys(request.headers)) {\n    if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n      delete request.headers[headerName];\n    }\n  }\n\n  return request;\n};\n"
  },
  {
    "path": "packages/signature-v4/src/signature-v4a-container.ts",
    "content": "import type { RequestSigner } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport type OptionalSigV4aSigner = {\n  /**\n   * This constructor is not typed so as not to require a type import\n   * from the signature-v4a package.\n   *\n   * The true type is SignatureV4a from @smithy/signature-v4a.\n   */\n  new (options: any): RequestSigner;\n};\n\n/**\n * \\@smithy/signature-v4a will install the constructor in this\n * container if it's installed.\n * This avoids a runtime-require being interpreted statically by bundlers.\n *\n * @public\n */\nexport const signatureV4aContainer: {\n  SignatureV4a: null | OptionalSigV4aSigner;\n} = {\n  SignatureV4a: null,\n};\n"
  },
  {
    "path": "packages/signature-v4/src/suite.fixture.ts",
    "content": "import type { HttpRequest } from \"@smithy/types\";\n\nexport interface TestCase {\n  name: string;\n  request: HttpRequest;\n  authorization: string;\n}\n\nexport const region = \"us-east-1\";\nexport const service = \"service\";\nexport const credentials = {\n  accessKeyId: \"AKIDEXAMPLE\",\n  secretAccessKey: \"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY\",\n};\n\nexport const signingDate = new Date(\"2015-08-30T12:36:00Z\");\n\nexport const requests: Array<TestCase> = [\n  {\n    name: \"get-header-key-duplicate\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"my-header1\": \"value2,value2,value1\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea\",\n  },\n  {\n    name: \"get-header-value-multiline\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"my-header1\": \"value1,value2,value3\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=ba17b383a53190154eb5fa66a1b836cc297cc0a3d70a5d00705980573d8ff790\",\n  },\n  {\n    name: \"get-header-value-order\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"my-header1\": \"value4,value1,value3,value2\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=08c7e5a9acfcfeb3ab6b2185e75ce8b1deb5e634ec47601a50643f830c755c01\",\n  },\n  {\n    name: \"get-header-value-trim\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"my-header1\": \"value1\",\n        \"my-header2\": '\"a   b   c\"',\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;my-header2;x-amz-date, Signature=acc3ed3afb60bb290fc8d2dd0098b9911fcaa05412b367055dee359757a9c736\",\n  },\n  {\n    name: \"get-unreserved\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=07ef7494c76fa4850883e2b006601f940f8a34d404d0cfa977f52a65bbf5f24f\",\n  },\n  {\n    name: \"get-utf8\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/ሴ\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=8318018e0b0f223aa2bbf98705b62bb787dc9c0e678f255a891fd03141be5d85\",\n  },\n  {\n    name: \"get-vanilla\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31\",\n  },\n  {\n    name: \"get-vanilla-empty-query-key\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        Param1: \"value1\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=a67d582fa61cc504c4bae71f336f98b97f1ea3c7a6bfe1b6e45aec72011b9aeb\",\n  },\n  {\n    name: \"get-vanilla-query\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31\",\n  },\n  {\n    name: \"get-vanilla-query-order-key-case\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        Param2: \"value2\",\n        Param1: \"value1\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=b97d918cfa904a5beff61c982a1b6f458b799221646efd99d3219ec94cdf2500\",\n  },\n  {\n    name: \"get-vanilla-query-unreserved\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        \"-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\":\n          \"-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=9c3e54bfcdf0b19771a7f523ee5669cdf59bc7cc0884027167c21bb143a40197\",\n  },\n  {\n    name: \"get-vanilla-utf8-query\",\n    request: {\n      protocol: \"https:\",\n      method: \"GET\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        ሴ: \"bar\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=2cdec8eed098649ff3a119c94853b13c643bcf08f8b0a1d91e12c9027818dd04\",\n  },\n  {\n    name: \"post-header-key-case\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b\",\n  },\n  {\n    name: \"post-header-key-sort\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"my-header1\": \"value1\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c5410059b04c1ee005303aed430f6e6645f61f4dc9e1461ec8f8916fdf18852c\",\n  },\n  {\n    name: \"post-header-value-case\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"my-header1\": \"VALUE1\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=cdbc9802e29d2942e5e10b5bccfdd67c5f22c7c4e8ae67b53629efa58b974b7d\",\n  },\n  {\n    name: \"post-sts-header-after\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b\",\n  },\n  {\n    name: \"post-sts-header-before\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n        \"x-amz-security-token\":\n          \"AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA==\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=85d96828115b5dc0cfc3bd16ad9e210dd772bbebba041836c64533a82be05ead\",\n  },\n  {\n    name: \"post-vanilla\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b\",\n  },\n  {\n    name: \"post-vanilla-empty-query-value\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        Param1: \"value1\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11\",\n  },\n  {\n    name: \"post-vanilla-query\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        Param1: \"value1\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11\",\n  },\n  {\n    name: \"post-vanilla-query-nonunreserved\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        \"@#$%^\": \"\",\n        \"+\": '/,?><`\";:\\\\|][{}',\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=66c82657c86e26fb25238d0e69f011edc4c6df5ae71119d7cb98ed9b87393c1e\",\n  },\n  {\n    name: \"post-vanilla-query-space\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {\n        p: \"\",\n      },\n      headers: {\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=e71688addb58a26418614085fb730ba3faa623b461c17f48f2fbdb9361b94a9b\",\n  },\n  {\n    name: \"post-x-www-form-urlencoded\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        \"content-type\": \"application/x-www-form-urlencoded\",\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      body: \"Param1=value1\",\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=ff11897932ad3f4e8b18135d722051e5ac45fc38421b1da7b9d196a0fe09473a\",\n  },\n  {\n    name: \"post-x-www-form-urlencoded-parameters\",\n    request: {\n      protocol: \"https:\",\n      method: \"POST\",\n      hostname: \"example.amazonaws.com\",\n      query: {},\n      headers: {\n        \"content-type\": \"application/x-www-form-urlencoded; charset=utf8\",\n        host: \"example.amazonaws.com\",\n        \"x-amz-date\": \"20150830T123600Z\",\n      },\n      body: \"Param1=value1\",\n      path: \"/\",\n    },\n    authorization:\n      \"AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=1a72ec8f64bd914b0e42e42607c7fbce7fb2c7465f63e3092b3b0d39fa77a6fe\",\n  },\n];\n"
  },
  {
    "path": "packages/signature-v4/src/suite.spec.ts",
    "content": "import { Sha256 } from \"@aws-crypto/sha256-js\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { SignatureV4 } from \"./SignatureV4\";\nimport { credentials, region, requests, service, signingDate } from \"./suite.fixture\";\n\n/**\n * Executes the official AWS Signature Version 4 test suite.\n *\n * @link http://docs.aws.amazon.com/general/latest/gr/signature-v4-test-suite.html\n */\ndescribe(\"AWS Signature Version 4 Test Suite\", () => {\n  const signer = new SignatureV4({\n    credentials,\n    region,\n    service,\n    sha256: Sha256,\n    applyChecksum: false,\n  });\n\n  for (const { name, request, authorization } of requests) {\n    it(`should calculate the correct signature for ${name}`, async () => {\n      const signed = await signer.sign(new HttpRequest(request), {\n        signingDate,\n      });\n      expect(signed.headers[\"authorization\"]).toEqual(authorization);\n    });\n  }\n});\n"
  },
  {
    "path": "packages/signature-v4/src/utilDate.spec.ts",
    "content": "import { describe, expect, test as it } from \"vitest\";\n\nimport { iso8601, toDate } from \"./utilDate\";\n\nconst toIsoString = \"2017-05-22T19:33:14.175Z\";\nconst iso8601String = \"2017-05-22T19:33:14Z\";\nconst rfc822String = \"Mon, 22 May 2017 19:33:14 GMT\";\nconst epochTs = 1495481594;\n\ndescribe(\"iso8601\", () => {\n  it(\"should convert date objects to ISO-8601 strings\", () => {\n    expect(iso8601(new Date(toIsoString))).toBe(iso8601String);\n  });\n\n  it(\"should convert parseable date strings to ISO-8601 strings\", () => {\n    const date = new Date(toIsoString);\n\n    expect(iso8601(date.toUTCString())).toBe(iso8601String);\n    expect(iso8601(date.toISOString())).toBe(iso8601String);\n  });\n\n  it(\"should assume numbers are epoch timestamps and convert them to ISO-8601 strings accordingly\", () => {\n    expect(iso8601(epochTs)).toBe(iso8601String);\n  });\n});\n\ndescribe(\"toDate\", () => {\n  it(\"should convert epoch timestamps to date objects\", () => {\n    const date = toDate(epochTs);\n    expect(date).toBeInstanceOf(Date);\n    expect(date.valueOf()).toBe(epochTs * 1000);\n  });\n\n  it(\"should convert ISO-8601 strings to date objects\", () => {\n    const date = toDate(iso8601String);\n    expect(date).toBeInstanceOf(Date);\n    expect(date.valueOf()).toBe(epochTs * 1000);\n  });\n\n  it(\"should convert RFC 822 strings to date objects\", () => {\n    const date = toDate(rfc822String);\n    expect(date).toBeInstanceOf(Date);\n    expect(date.valueOf()).toBe(epochTs * 1000);\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4/src/utilDate.ts",
    "content": "export const iso8601 = (time: number | string | Date): string =>\n  toDate(time)\n    .toISOString()\n    .replace(/\\.\\d{3}Z$/, \"Z\");\n\nexport const toDate = (time: number | string | Date): Date => {\n  if (typeof time === \"number\") {\n    return new Date(time * 1000);\n  }\n\n  if (typeof time === \"string\") {\n    if (Number(time)) {\n      return new Date(Number(time) * 1000);\n    }\n    return new Date(time);\n  }\n\n  return time;\n};\n"
  },
  {
    "path": "packages/signature-v4/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/signature-v4a/.gitignore",
    "content": "/node_modules/\n/build/\n/dist/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/signature-v4a/CHANGELOG.md",
    "content": "# @smithy/signature-v4a\n\n## 3.2.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n  - @smithy/signature-v4@5.4.3\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n  - @smithy/signature-v4@5.4.2\n\n## 3.2.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n  - @smithy/signature-v4@5.4.1\n\n## 3.2.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n  - @smithy/signature-v4@5.4.0\n\n## 3.1.14\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/signature-v4@5.3.14\n\n## 3.1.13\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/signature-v4@5.3.13\n\n## 3.1.12\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/types@4.13.1\n  - @smithy/signature-v4@5.3.12\n\n## 3.1.11\n\n### Patch Changes\n\n- a4d95e6: Set downlevel types to be used in typescript@'<4.5'\n- Updated dependencies [a4d95e6]\n  - @smithy/util-hex-encoding@4.2.2\n  - @smithy/signature-v4@5.3.11\n  - @smithy/util-utf8@4.2.2\n\n## 3.1.10\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/signature-v4@5.3.10\n\n## 3.1.9\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/signature-v4@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-hex-encoding@4.2.1\n  - @smithy/util-utf8@4.2.1\n\n## 3.1.8\n\n### Patch Changes\n\n- Updated dependencies [745867a]\n  - @smithy/types@4.12.0\n  - @smithy/signature-v4@5.3.8\n\n## 3.1.7\n\n### Patch Changes\n\n- Updated dependencies [9ccb841]\n  - @smithy/types@4.11.0\n  - @smithy/signature-v4@5.3.7\n\n## 3.1.6\n\n### Patch Changes\n\n- Updated dependencies [5a56762]\n  - @smithy/types@4.10.0\n  - @smithy/signature-v4@5.3.6\n\n## 3.1.5\n\n### Patch Changes\n\n- Updated dependencies [3926fd7]\n  - @smithy/types@4.9.0\n  - @smithy/signature-v4@5.3.5\n\n## 3.1.4\n\n### Patch Changes\n\n- Updated dependencies [6da0ab3]\n  - @smithy/types@4.8.1\n  - @smithy/signature-v4@5.3.4\n\n## 3.1.3\n\n### Patch Changes\n\n- Updated dependencies [8a2a912]\n  - @smithy/types@4.8.0\n  - @smithy/signature-v4@5.3.3\n\n## 3.1.2\n\n### Patch Changes\n\n- Updated dependencies [052d261]\n  - @smithy/types@4.7.1\n  - @smithy/signature-v4@5.3.2\n\n## 3.1.1\n\n### Patch Changes\n\n- Updated dependencies [761d89c]\n- Updated dependencies [7f8af58]\n  - @smithy/types@4.7.0\n  - @smithy/signature-v4@5.3.1\n\n## 3.1.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n### Patch Changes\n\n- Updated dependencies [45ee67f]\n  - @smithy/signature-v4@5.3.0\n  - @smithy/types@4.6.0\n  - @smithy/util-hex-encoding@4.2.0\n  - @smithy/util-utf8@4.2.0\n\n## 3.0.7\n\n### Patch Changes\n\n- Updated dependencies [bb7c1c1]\n  - @smithy/types@4.5.0\n  - @smithy/signature-v4@5.2.1\n\n## 3.0.6\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n- Updated dependencies [64cda93]\n- Updated dependencies [f884df7]\n  - @smithy/util-hex-encoding@4.1.0\n  - @smithy/signature-v4@5.2.0\n  - @smithy/util-utf8@4.1.0\n  - @smithy/types@4.4.0\n\n## 3.0.5\n\n### Patch Changes\n\n- Updated dependencies [64e033f]\n  - @smithy/types@4.3.2\n  - @smithy/signature-v4@5.1.3\n\n## 3.0.4\n\n### Patch Changes\n\n- bb7975e: set sideEffects bundler metadata\n\n## 3.0.3\n\n### Patch Changes\n\n- Updated dependencies [358c1ff]\n  - @smithy/types@4.3.1\n  - @smithy/signature-v4@5.1.2\n\n## 3.0.2\n\n### Patch Changes\n\n- Updated dependencies [0547fab]\n  - @smithy/types@4.3.0\n  - @smithy/signature-v4@5.1.1\n\n## 3.0.1\n\n### Patch Changes\n\n- Updated dependencies [e2a8b41]\n  - @smithy/signature-v4@5.1.0\n"
  },
  {
    "path": "packages/signature-v4a/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/signature-v4a/README.md",
    "content": "# @smithy/signature-v4a\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/signature-v4a/latest.svg)](https://www.npmjs.com/package/@smithy/signature-v4a)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/signature-v4a.svg)](https://www.npmjs.com/package/@smithy/signature-v4a)\n\nThis package is an internal SigV4a addon for AWS Signature Version 4 (SigV4).\n"
  },
  {
    "path": "packages/signature-v4a/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/signature-v4a/package.json",
    "content": "{\n  \"name\": \"@smithy/signature-v4a\",\n  \"version\": \"3.2.3\",\n  \"description\": \"Asymmetric addon for the @smithy/signature-v4 package\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:elliptic\": \"node ./scripts/esbuild.mjs\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline signature-v4a\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": true,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/signature-v4\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@aws-crypto/sha256-js\": \"5.2.0\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"elliptic\": \"6.5.5\",\n    \"premove\": \"4.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/awslabs/smithy-typescript/tree/main/packages/signature-v4a\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/awslabs/smithy-typescript.git\",\n    \"directory\": \"packages/signature-v4a\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/signature-v4a/scripts/Ec.js",
    "content": "export { ec as Ec } from \"elliptic\";\n"
  },
  {
    "path": "packages/signature-v4a/scripts/esbuild.mjs",
    "content": "import * as esbuild from \"esbuild\";\nimport * as path from \"path\";\nimport * as fs from \"fs\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst bundledSource = path.join(__dirname, \"..\", \"src\", \"elliptic\", \"Ec.ts\");\n\nconst buildOptions = {\n  platform: \"browser\",\n  target: [\"node16\"],\n  bundle: true,\n  format: \"esm\",\n  mainFields: [\"module\", \"main\"],\n  allowOverwrite: true,\n  entryPoints: [path.join(__dirname, \"Ec.js\")],\n  supported: {},\n  outfile: bundledSource,\n  keepNames: false,\n  external: [],\n};\n\nawait esbuild.build(buildOptions);\n\nconst typescript = fs.readFileSync(bundledSource, \"utf-8\");\n\nfs.writeFileSync(\n  bundledSource,\n  `// @ts-nocheck\n/* eslint-disable */\n` + typescript,\n  \"utf-8\"\n);\n"
  },
  {
    "path": "packages/signature-v4a/src/SignatureV4a.spec.ts",
    "content": "import { Sha256 } from \"@aws-crypto/sha256-js\";\nimport type { AwsCredentialIdentity, HttpRequest } from \"@smithy/types\";\nimport { describe, expect, it } from \"vitest\";\n\nimport { SignatureV4a } from \"./SignatureV4a\";\n\ndescribe(\"SignatureV4a\", () => {\n  it(\"SignatureV4a credential check\", async () => {\n    const creds: AwsCredentialIdentity = {\n      accessKeyId: \"test-access-key\",\n      secretAccessKey: \"test-secret-access-key\",\n      sessionToken: \"test-secret\",\n    };\n\n    const sigV4aSigner = new SignatureV4a({\n      credentials: creds,\n      sha256: Sha256,\n      region: \"*\",\n      service: \"test-service\",\n      applyChecksum: false,\n    });\n\n    const request: HttpRequest = {\n      headers: {},\n      hostname: \"test\",\n      method: \"GET\",\n      path: \"/v1.1/test\",\n      protocol: \"HTTPS\",\n    };\n\n    const signingDate = new Date();\n    signingDate.setTime(1711493155780);\n    const result = await sigV4aSigner.sign(request, {\n      signingDate: signingDate,\n    });\n\n    expect(result.headers[\"x-amz-date\"]).toEqual(\"20240326T224555Z\");\n    expect(result.headers[\"x-amz-security-token\"]).toEqual(creds.sessionToken);\n    expect(result.headers[\"x-amz-region-set\"]).toEqual(\"*\");\n    expect(result.headers[\"authorization\"]).toEqual(\n      \"AWS4-ECDSA-P256-SHA256 Credential=test-access-key/20240326/test-service/aws4_request, SignedHeaders=x-amz-date;x-amz-region-set;x-amz-security-token, Signature=30440220145f66a150392193d4c50ec322ac2ab930989bbd56566a43132962f8f5bed2280220346d08e335f58e7d515c45618841869650d11f0dff107733f74228a891828919\"\n    );\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4a/src/SignatureV4a.ts",
    "content": "import { toHex, toUint8Array } from \"@smithy/core/serde\";\nimport {\n  ALGORITHM_IDENTIFIER_V4A,\n  AMZ_DATE_HEADER,\n  AUTH_HEADER,\n  SHA256_HEADER,\n  SignatureV4Base,\n  TOKEN_HEADER,\n  getCanonicalHeaders,\n  getPayloadHash,\n  hasHeader,\n  prepareRequest,\n  type SignatureV4CryptoInit,\n  type SignatureV4Init,\n} from \"@smithy/signature-v4\";\nimport type { HttpRequest, RequestSigner, RequestSigningArguments } from \"@smithy/types\";\n\nimport { REGION_HEADER } from \"./constants\";\nimport { createSigV4aScope, getSigV4aSigningKey } from \"./credentialDerivation\";\n// @ts-ignore\nimport { Ec } from \"./elliptic/Ec\";\n\n/**\n * @public\n */\nexport class SignatureV4a extends SignatureV4Base implements RequestSigner {\n  /**\n   * Creates a SigV4a signer\n   * @param applyChecksum Apply checksum header\n   * @param credentials Credentials to use when signing\n   * @param region Region to sign for, Wildcard (*) also accepted\n   * @param service Service to sign for\n   * @param uriEscapePath Defaults to true. Used for non s3 services.\n   */\n  constructor({\n    applyChecksum,\n    credentials,\n    region,\n    service,\n    sha256,\n    uriEscapePath = true,\n  }: SignatureV4Init & SignatureV4CryptoInit) {\n    super({\n      applyChecksum,\n      credentials,\n      region,\n      service,\n      sha256,\n      uriEscapePath,\n    });\n  }\n\n  /**\n   * Sign a request using SigV4a\n   * @param toSign HttpRequest to sign\n   * @param options Additional options\n   */\n  public async sign(toSign: HttpRequest, options: any): Promise<any> {\n    return this.signRequest(toSign, options);\n  }\n\n  /**\n   * Sign a SigV4a request and return its modified HttpRequest. See SigV4a wiki for implementation details\n   * @param requestToSign HttpRequest to sign\n   * @param signingDate Signing date (uses UTC now if not specified)\n   * @param signableHeaders Headers to include in the signing process\n   * @param unsignableHeaders Headers to not include in the signing process\n   * @param signingRegion Region to sign the request for. '*' can be used as a wildcard. Falls back to constructor value\n   * @param signingService Service to sign for\n   * @private\n   */\n  private async signRequest(\n    requestToSign: HttpRequest,\n    {\n      signingDate = new Date(),\n      signableHeaders,\n      unsignableHeaders,\n      signingRegion,\n      signingService,\n    }: RequestSigningArguments = {}\n  ): Promise<HttpRequest> {\n    const credentials = await this.credentialProvider();\n    this.validateResolvedCredentials(credentials);\n    const region = signingRegion ?? (await this.regionProvider());\n    const request = prepareRequest(requestToSign);\n    const { longDate, shortDate } = this.formatDate(signingDate);\n    const scope = createSigV4aScope(shortDate, signingService ?? this.service);\n    const pKey = await getSigV4aSigningKey(this.sha256, credentials.accessKeyId, credentials.secretAccessKey);\n\n    request.headers[AMZ_DATE_HEADER] = longDate;\n    if (credentials.sessionToken) {\n      request.headers[TOKEN_HEADER] = credentials.sessionToken;\n    }\n\n    // Region can also be '*' for SigV4a\n    request.headers[REGION_HEADER] = region;\n\n    const payloadHash = await getPayloadHash(request, this.sha256);\n    if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {\n      request.headers[SHA256_HEADER] = payloadHash;\n    }\n\n    const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n    const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash);\n    const stringToSign = await this.createStringToSign(longDate, scope, canonicalRequest, ALGORITHM_IDENTIFIER_V4A);\n\n    const signature = await this.getSignature(pKey, stringToSign);\n\n    request.headers[AUTH_HEADER] =\n      `${ALGORITHM_IDENTIFIER_V4A} ` +\n      `Credential=${credentials.accessKeyId}/${scope}, ` +\n      `SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, ` +\n      `Signature=${signature}`;\n\n    return request;\n  }\n\n  /**\n   *\n   * @param privateKey Calculated private key\n   * @param stringToSign String to sign using private key\n   * @private\n   */\n  private async getSignature(privateKey: Uint8Array, stringToSign: string): Promise<string> {\n    // Create ECDSA and get key pair\n    const ecdsa = new Ec(\"p256\");\n    const key = ecdsa.keyFromPrivate(privateKey);\n\n    // Format request using SHA256\n    const hash = new this.sha256();\n    hash.update(toUint8Array(stringToSign));\n    const hashResult = await hash.digest();\n\n    // Finally sign using ECDSA keypair.\n    const signature = key.sign(hashResult);\n\n    // Convert signature to DER format (ASN.1's normal singing format)\n    return toHex(new Uint8Array(signature.toDER()));\n  }\n}\n"
  },
  {
    "path": "packages/signature-v4a/src/constants.ts",
    "content": "import { REGION_SET_PARAM } from \"@smithy/signature-v4\";\n\n/**\n * @internal\n */\nexport const REGION_HEADER = REGION_SET_PARAM.toLowerCase();\n\n// AWS SigV4a private signing key constants\n/**\n * @internal\n */\nexport const ONE_AS_4_BYTES = [0x00, 0x00, 0x00, 0x01];\n\n/**\n * @internal\n */\nexport const TWOFIFTYSIX_AS_4_BYTES = [0x00, 0x00, 0x01, 0x00];\n\n/**\n * @internal\n */\nexport const N_MINUS_TWO = [\n  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa,\n  0xad, 0xa7, 0x17, 0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x4f,\n];\n"
  },
  {
    "path": "packages/signature-v4a/src/credentialDerivation.spec.ts",
    "content": "import { Sha256 } from \"@aws-crypto/sha256-js\";\nimport { describe, expect, it, vi } from \"vitest\";\n\nimport { N_MINUS_TWO } from \"./constants\";\nimport { addOneToArray, buildFixedInputBuffer, getSigV4aSigningKey, isBiggerThanNMinus2 } from \"./credentialDerivation\";\n\ndescribe(\"signatureV4a signing key\", () => {\n  it(\"should get signing key\", async () => {\n    const secret = \"test-secret\";\n    const accessKey = \"test-access-key\";\n\n    const mockSha256Constructor = vi.fn().mockImplementation((args) => {\n      return new Sha256(args);\n    });\n\n    const result = await getSigV4aSigningKey(mockSha256Constructor, secret, accessKey);\n\n    const expectedResult = new Uint8Array([\n      107, 171, 179, 226, 62, 241, 77, 131, 240, 163, 149, 40, 120, 236, 169, 100, 28, 130, 40, 97, 214, 239, 24, 15,\n      158, 224, 37, 30, 241, 83, 119, 174,\n    ]);\n\n    expect(result).toEqual(expectedResult);\n  });\n\n  it(\"buildFixedInputBuffer\", () => {\n    const startBuffer = \"start\";\n    const accessKey = \"key\";\n    const result = buildFixedInputBuffer(startBuffer, accessKey, 1);\n\n    const expectedString =\n      \"start\" +\n      \"\\u0000\\u0000\\u0000\\u0001\" +\n      \"AWS4-ECDSA-P256-SHA256\" +\n      \"\\u0000\" +\n      \"key\" +\n      \"\\u0001\" +\n      \"\\u0000\\u0000\\u0001\\u0000\";\n\n    expect(result).toEqual(expectedString);\n  });\n\n  it(\"addOneToArray, no carry\", () => {\n    const originalValue = new Uint8Array(32);\n    originalValue[31] = 0xfe;\n\n    const result = addOneToArray(originalValue);\n\n    expect(result.length).toEqual(32);\n    expect(result[31]).toEqual(0xff);\n    expect(result[30]).toEqual(0x00);\n  });\n\n  it(\"addOneToArray, carry\", () => {\n    const originalValue = new Uint8Array(32);\n    originalValue[31] = 0xff;\n    originalValue[30] = 0xff;\n    originalValue[29] = 0xfe;\n\n    const result = addOneToArray(originalValue);\n\n    expect(result.length).toEqual(32);\n    expect(result[31]).toEqual(0x00);\n    expect(result[30]).toEqual(0x00);\n    expect(result[29]).toEqual(0xff);\n  });\n\n  it(\"addOneToArray, carry to last digit\", () => {\n    const originalValue = new Uint8Array(32);\n    for (let i = 0; i < originalValue.length; i++) {\n      originalValue[i] = 0xff;\n    }\n\n    const result = addOneToArray(originalValue);\n\n    expect(result.length).toEqual(33);\n\n    expect(result[0]).toEqual(0x01);\n\n    for (let i = 1; i < originalValue.length; i++) {\n      expect(result[i]).toEqual(0x00);\n    }\n  });\n\n  it(\"Number smaller than NMinus2\", () => {\n    let comparisonNumber = new Uint8Array(32);\n\n    let result = isBiggerThanNMinus2(comparisonNumber);\n    expect(result).toBeFalsy();\n\n    comparisonNumber = new Uint8Array(N_MINUS_TWO);\n    comparisonNumber[31] = comparisonNumber[31] - 1;\n\n    result = isBiggerThanNMinus2(comparisonNumber);\n    expect(result).toBeFalsy();\n  });\n\n  it(\"Number bigger than NMinus2\", () => {\n    let comparisonNumber = new Uint8Array(32);\n    comparisonNumber[0] = 0xff;\n    comparisonNumber[1] = 0xff;\n    comparisonNumber[2] = 0xff;\n    comparisonNumber[3] = 0xff;\n    comparisonNumber[4] = 0x01;\n\n    let result = isBiggerThanNMinus2(comparisonNumber);\n    expect(result).toBeTruthy();\n\n    comparisonNumber = new Uint8Array(N_MINUS_TWO);\n    comparisonNumber[31] = comparisonNumber[31] + 1;\n\n    result = isBiggerThanNMinus2(comparisonNumber);\n    expect(result).toBeTruthy();\n  });\n\n  it(\"Number equals NMinus2\", () => {\n    const comparisonNumber = new Uint8Array(N_MINUS_TWO);\n\n    const result = isBiggerThanNMinus2(comparisonNumber);\n\n    expect(result).toBeFalsy();\n  });\n});\n"
  },
  {
    "path": "packages/signature-v4a/src/credentialDerivation.ts",
    "content": "import { toUint8Array } from \"@smithy/core/serde\";\nimport { ALGORITHM_IDENTIFIER_V4A, KEY_TYPE_IDENTIFIER } from \"@smithy/signature-v4\";\nimport type { ChecksumConstructor, HashConstructor } from \"@smithy/types\";\n\nimport { N_MINUS_TWO, ONE_AS_4_BYTES, TWOFIFTYSIX_AS_4_BYTES } from \"./constants\";\n\nconst signingKeyCache: Record<string, Uint8Array> = {};\nconst cacheQueue: Array<string> = [];\n\n/**\n * Create a string describing the scope of credentials used to sign a request. * @param shortDate\n * @param shortDate The current calendar date in the form YYYYMMDD.\n * @param service   The service to which the signed request is being sent.\n */\nexport const createSigV4aScope = (shortDate: string, service: string): string =>\n  `${shortDate}/${service}/${KEY_TYPE_IDENTIFIER}`;\n\n/**\n * @internal\n */\nexport const clearCredentialCache = (): void => {\n  cacheQueue.length = 0;\n  Object.keys(signingKeyCache).forEach((cacheKey) => {\n    delete signingKeyCache[cacheKey];\n  });\n};\n\n/**\n * @internal\n */\nexport const getSigV4aSigningKey = async (\n  sha256: ChecksumConstructor | HashConstructor,\n  accessKey: string,\n  secretKey: string\n): Promise<Uint8Array> => {\n  let outputBufferWriter = \"\";\n  /*\n   * The maximum number of iterations we will attempt to derive a valid ecc key for.  The probability that this counter\n   * value ever gets reached is vanishingly low -- with reasonable uniformity/independence assumptions, it's\n   * approximately\n   *\n   *  2 ^ (-32 * 254)\n   */\n  const maxTrials = 254;\n  const aws4ALength = 5;\n  const inputKeyLength = aws4ALength + secretKey.length;\n\n  // Allocate array\n  const inputKeyBuf = inputKeyLength <= 64 ? new Uint8Array(64) : new Uint8Array(inputKeyLength);\n\n  // Input AWS4A and secret into array\n  const aws4aArray = \"AWS4A\".split(\"\");\n\n  for (let index = 0; index < aws4aArray.length; index++) {\n    inputKeyBuf[index] = aws4aArray[index].charCodeAt(0);\n  }\n\n  const secretKeyArray = secretKey.split(\"\");\n\n  for (let index = 0; index < secretKeyArray.length; index++) {\n    inputKeyBuf[aws4aArray.length + index] = secretKeyArray[index].charCodeAt(0);\n  }\n\n  let trial = 1;\n  while (trial < maxTrials) {\n    outputBufferWriter = buildFixedInputBuffer(outputBufferWriter, accessKey, trial);\n\n    const secretKey = inputKeyBuf.subarray(0, inputKeyLength);\n    const hash = new sha256(secretKey);\n\n    const hashVal = toUint8Array(outputBufferWriter);\n    hash.update(hashVal);\n\n    const hashedOutput = await hash.digest();\n\n    if (isBiggerThanNMinus2(hashedOutput)) {\n      trial++;\n      continue;\n    }\n\n    return addOneToArray(hashedOutput);\n  }\n\n  throw new Error(\"Cannot derive signing key: number of maximum trials exceeded.\");\n};\n\n/**\n * Build the signing key request. Implementation copied from .NET implementation\n * @param bufferInput Input string. Will append values and return as new string\n * @param accessKey Access key used for signing\n * @param counter Trial number\n */\nexport const buildFixedInputBuffer = (bufferInput: string, accessKey: string, counter: number): string => {\n  /*\n  Label = “AWS4-ECDSA-P256-SHA256”\n  ExternalCounter = 0x01\n  This counter would be incremented by 1 if the step below fails.\n  Context = \"AccessKeyID\" || ExternalCounter\n  Length = “256”, 0x0100 (32-bit integer)\n  FixedInputString= 1 || Label || 0x00 || Context || Length\n   */\n\n  let outputBuffer = bufferInput;\n\n  outputBuffer += ONE_AS_4_BYTES.map((value) => String.fromCharCode(value)).join(\"\");\n\n  outputBuffer += ALGORITHM_IDENTIFIER_V4A;\n\n  outputBuffer += String.fromCharCode(0x00);\n\n  outputBuffer += accessKey;\n\n  outputBuffer += String.fromCharCode(counter);\n\n  outputBuffer += TWOFIFTYSIX_AS_4_BYTES.map((value) => String.fromCharCode(value)).join(\"\");\n\n  return outputBuffer;\n};\n\n/**\n * Check if calculated value is larger than NMinus2 constant\n * @param value Array in Big-Endian format\n */\nexport const isBiggerThanNMinus2 = (value: Uint8Array): boolean => {\n  // N_MINUS_TWO constant is 32 in length, hashed input is also 32 in length\n  // It is in Big-Endian format, significant digit first.\n\n  for (let index = 0; index < value.length; index++) {\n    if (value[index] > N_MINUS_TWO[index]) {\n      // Value is greater than const\n      return true;\n    } else if (value[index] < N_MINUS_TWO[index]) {\n      // Const is greater\n      return false;\n    }\n  }\n\n  // Numbers are then same\n  return false;\n};\n\n/**\n * Adds one to a big-endian number\n * @param value Big-endian formatted number\n */\nexport const addOneToArray = (value: Uint8Array): Uint8Array => {\n  // Value is in Big-Endian format, significant digit first. This is why we go the opposite way when calculating\n  const output = new Uint8Array(32);\n\n  // We are adding one, we can simply add this to carry\n  let carry = 1;\n\n  for (let index = value.length - 1; index >= 0; index--) {\n    const newValueAtIndex = (value[index] + carry) % 256;\n\n    // If the new value is less than the old, we must have eclipsed 255. We need to carry a digit\n    if (newValueAtIndex < value[index]) {\n      carry = 1;\n    } else {\n      carry = 0;\n    }\n\n    output[index] = newValueAtIndex;\n  }\n\n  if (carry !== 0) {\n    return new Uint8Array([carry, ...output]);\n  }\n\n  return output;\n};\n"
  },
  {
    "path": "packages/signature-v4a/src/elliptic/Ec.ts",
    "content": "// @ts-nocheck\n/* eslint-disable */\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) =>\n  function __require() {\n    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\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, {\n          get: () => from[key],\n          enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,\n        });\n  }\n  return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (\n  (target = mod != null ? __create(__getProtoOf(mod)) : {}),\n  __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);\n\n// ../../node_modules/elliptic/package.json\nvar require_package = __commonJS({\n  \"../../node_modules/elliptic/package.json\"(exports, module) {\n    module.exports = {\n      name: \"elliptic\",\n      version: \"6.5.5\",\n      description: \"EC cryptography\",\n      main: \"lib/elliptic.js\",\n      files: [\"lib\"],\n      scripts: {\n        lint: \"eslint lib test\",\n        \"lint:fix\": \"npm run lint -- --fix\",\n        unit: \"istanbul test _mocha --reporter=spec test/index.js\",\n        test: \"npm run lint && npm run unit\",\n        version: \"grunt dist && git add dist/\",\n      },\n      repository: {\n        type: \"git\",\n        url: \"git@github.com:indutny/elliptic\",\n      },\n      keywords: [\"EC\", \"Elliptic\", \"curve\", \"Cryptography\"],\n      author: \"Fedor Indutny <fedor@indutny.com>\",\n      license: \"MIT\",\n      bugs: {\n        url: \"https://github.com/indutny/elliptic/issues\",\n      },\n      homepage: \"https://github.com/indutny/elliptic\",\n      devDependencies: {\n        brfs: \"^2.0.2\",\n        coveralls: \"^3.1.0\",\n        eslint: \"^7.6.0\",\n        grunt: \"^1.2.1\",\n        \"grunt-browserify\": \"^5.3.0\",\n        \"grunt-cli\": \"^1.3.2\",\n        \"grunt-contrib-connect\": \"^3.0.0\",\n        \"grunt-contrib-copy\": \"^1.0.0\",\n        \"grunt-contrib-uglify\": \"^5.0.0\",\n        \"grunt-mocha-istanbul\": \"^5.0.2\",\n        \"grunt-saucelabs\": \"^9.0.1\",\n        istanbul: \"^0.4.5\",\n        mocha: \"^8.0.1\",\n      },\n      dependencies: {\n        \"bn.js\": \"^4.11.9\",\n        brorand: \"^1.1.0\",\n        \"hash.js\": \"^1.0.0\",\n        \"hmac-drbg\": \"^1.0.1\",\n        inherits: \"^2.0.4\",\n        \"minimalistic-assert\": \"^1.0.1\",\n        \"minimalistic-crypto-utils\": \"^1.0.1\",\n      },\n    };\n  },\n});\n\n// (disabled):../../node_modules/buffer/index.js\nvar require_buffer = __commonJS({\n  \"(disabled):../../node_modules/buffer/index.js\"() {},\n});\n\n// ../../node_modules/bn.js/lib/bn.js\nvar require_bn = __commonJS({\n  \"../../node_modules/bn.js/lib/bn.js\"(exports, module) {\n    (function (module2, exports2) {\n      \"use strict\";\n      function assert(val, msg) {\n        if (!val) throw new Error(msg || \"Assertion failed\");\n      }\n      function inherits(ctor, superCtor) {\n        ctor.super_ = superCtor;\n        var TempCtor = function () {};\n        TempCtor.prototype = superCtor.prototype;\n        ctor.prototype = new TempCtor();\n        ctor.prototype.constructor = ctor;\n      }\n      function BN(number, base, endian) {\n        if (BN.isBN(number)) {\n          return number;\n        }\n        this.negative = 0;\n        this.words = null;\n        this.length = 0;\n        this.red = null;\n        if (number !== null) {\n          if (base === \"le\" || base === \"be\") {\n            endian = base;\n            base = 10;\n          }\n          this._init(number || 0, base || 10, endian || \"be\");\n        }\n      }\n      if (typeof module2 === \"object\") {\n        module2.exports = BN;\n      } else {\n        exports2.BN = BN;\n      }\n      BN.BN = BN;\n      BN.wordSize = 26;\n      var Buffer2;\n      try {\n        if (typeof window !== \"undefined\" && typeof window.Buffer !== \"undefined\") {\n          Buffer2 = window.Buffer;\n        } else {\n          Buffer2 = require_buffer().Buffer;\n        }\n      } catch (e) {}\n      BN.isBN = function isBN(num) {\n        if (num instanceof BN) {\n          return true;\n        }\n        return (\n          num !== null &&\n          typeof num === \"object\" &&\n          num.constructor.wordSize === BN.wordSize &&\n          Array.isArray(num.words)\n        );\n      };\n      BN.max = function max(left, right) {\n        if (left.cmp(right) > 0) return left;\n        return right;\n      };\n      BN.min = function min(left, right) {\n        if (left.cmp(right) < 0) return left;\n        return right;\n      };\n      BN.prototype._init = function init(number, base, endian) {\n        if (typeof number === \"number\") {\n          return this._initNumber(number, base, endian);\n        }\n        if (typeof number === \"object\") {\n          return this._initArray(number, base, endian);\n        }\n        if (base === \"hex\") {\n          base = 16;\n        }\n        assert(base === (base | 0) && base >= 2 && base <= 36);\n        number = number.toString().replace(/\\s+/g, \"\");\n        var start = 0;\n        if (number[0] === \"-\") {\n          start++;\n          this.negative = 1;\n        }\n        if (start < number.length) {\n          if (base === 16) {\n            this._parseHex(number, start, endian);\n          } else {\n            this._parseBase(number, base, start);\n            if (endian === \"le\") {\n              this._initArray(this.toArray(), base, endian);\n            }\n          }\n        }\n      };\n      BN.prototype._initNumber = function _initNumber(number, base, endian) {\n        if (number < 0) {\n          this.negative = 1;\n          number = -number;\n        }\n        if (number < 67108864) {\n          this.words = [number & 67108863];\n          this.length = 1;\n        } else if (number < 4503599627370496) {\n          this.words = [number & 67108863, (number / 67108864) & 67108863];\n          this.length = 2;\n        } else {\n          assert(number < 9007199254740992);\n          this.words = [number & 67108863, (number / 67108864) & 67108863, 1];\n          this.length = 3;\n        }\n        if (endian !== \"le\") return;\n        this._initArray(this.toArray(), base, endian);\n      };\n      BN.prototype._initArray = function _initArray(number, base, endian) {\n        assert(typeof number.length === \"number\");\n        if (number.length <= 0) {\n          this.words = [0];\n          this.length = 1;\n          return this;\n        }\n        this.length = Math.ceil(number.length / 3);\n        this.words = new Array(this.length);\n        for (var i = 0; i < this.length; i++) {\n          this.words[i] = 0;\n        }\n        var j, w;\n        var off = 0;\n        if (endian === \"be\") {\n          for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n            w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n            this.words[j] |= (w << off) & 67108863;\n            this.words[j + 1] = (w >>> (26 - off)) & 67108863;\n            off += 24;\n            if (off >= 26) {\n              off -= 26;\n              j++;\n            }\n          }\n        } else if (endian === \"le\") {\n          for (i = 0, j = 0; i < number.length; i += 3) {\n            w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n            this.words[j] |= (w << off) & 67108863;\n            this.words[j + 1] = (w >>> (26 - off)) & 67108863;\n            off += 24;\n            if (off >= 26) {\n              off -= 26;\n              j++;\n            }\n          }\n        }\n        return this.strip();\n      };\n      function parseHex4Bits(string, index) {\n        var c = string.charCodeAt(index);\n        if (c >= 65 && c <= 70) {\n          return c - 55;\n        } else if (c >= 97 && c <= 102) {\n          return c - 87;\n        } else {\n          return (c - 48) & 15;\n        }\n      }\n      function parseHexByte(string, lowerBound, index) {\n        var r = parseHex4Bits(string, index);\n        if (index - 1 >= lowerBound) {\n          r |= parseHex4Bits(string, index - 1) << 4;\n        }\n        return r;\n      }\n      BN.prototype._parseHex = function _parseHex(number, start, endian) {\n        this.length = Math.ceil((number.length - start) / 6);\n        this.words = new Array(this.length);\n        for (var i = 0; i < this.length; i++) {\n          this.words[i] = 0;\n        }\n        var off = 0;\n        var j = 0;\n        var w;\n        if (endian === \"be\") {\n          for (i = number.length - 1; i >= start; i -= 2) {\n            w = parseHexByte(number, start, i) << off;\n            this.words[j] |= w & 67108863;\n            if (off >= 18) {\n              off -= 18;\n              j += 1;\n              this.words[j] |= w >>> 26;\n            } else {\n              off += 8;\n            }\n          }\n        } else {\n          var parseLength = number.length - start;\n          for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n            w = parseHexByte(number, start, i) << off;\n            this.words[j] |= w & 67108863;\n            if (off >= 18) {\n              off -= 18;\n              j += 1;\n              this.words[j] |= w >>> 26;\n            } else {\n              off += 8;\n            }\n          }\n        }\n        this.strip();\n      };\n      function parseBase(str, start, end, mul) {\n        var r = 0;\n        var len = Math.min(str.length, end);\n        for (var i = start; i < len; i++) {\n          var c = str.charCodeAt(i) - 48;\n          r *= mul;\n          if (c >= 49) {\n            r += c - 49 + 10;\n          } else if (c >= 17) {\n            r += c - 17 + 10;\n          } else {\n            r += c;\n          }\n        }\n        return r;\n      }\n      BN.prototype._parseBase = function _parseBase(number, base, start) {\n        this.words = [0];\n        this.length = 1;\n        for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {\n          limbLen++;\n        }\n        limbLen--;\n        limbPow = (limbPow / base) | 0;\n        var total = number.length - start;\n        var mod = total % limbLen;\n        var end = Math.min(total, total - mod) + start;\n        var word = 0;\n        for (var i = start; i < end; i += limbLen) {\n          word = parseBase(number, i, i + limbLen, base);\n          this.imuln(limbPow);\n          if (this.words[0] + word < 67108864) {\n            this.words[0] += word;\n          } else {\n            this._iaddn(word);\n          }\n        }\n        if (mod !== 0) {\n          var pow = 1;\n          word = parseBase(number, i, number.length, base);\n          for (i = 0; i < mod; i++) {\n            pow *= base;\n          }\n          this.imuln(pow);\n          if (this.words[0] + word < 67108864) {\n            this.words[0] += word;\n          } else {\n            this._iaddn(word);\n          }\n        }\n        this.strip();\n      };\n      BN.prototype.copy = function copy(dest) {\n        dest.words = new Array(this.length);\n        for (var i = 0; i < this.length; i++) {\n          dest.words[i] = this.words[i];\n        }\n        dest.length = this.length;\n        dest.negative = this.negative;\n        dest.red = this.red;\n      };\n      BN.prototype.clone = function clone() {\n        var r = new BN(null);\n        this.copy(r);\n        return r;\n      };\n      BN.prototype._expand = function _expand(size) {\n        while (this.length < size) {\n          this.words[this.length++] = 0;\n        }\n        return this;\n      };\n      BN.prototype.strip = function strip() {\n        while (this.length > 1 && this.words[this.length - 1] === 0) {\n          this.length--;\n        }\n        return this._normSign();\n      };\n      BN.prototype._normSign = function _normSign() {\n        if (this.length === 1 && this.words[0] === 0) {\n          this.negative = 0;\n        }\n        return this;\n      };\n      BN.prototype.inspect = function inspect() {\n        return (this.red ? \"<BN-R: \" : \"<BN: \") + this.toString(16) + \">\";\n      };\n      var zeros = [\n        \"\",\n        \"0\",\n        \"00\",\n        \"000\",\n        \"0000\",\n        \"00000\",\n        \"000000\",\n        \"0000000\",\n        \"00000000\",\n        \"000000000\",\n        \"0000000000\",\n        \"00000000000\",\n        \"000000000000\",\n        \"0000000000000\",\n        \"00000000000000\",\n        \"000000000000000\",\n        \"0000000000000000\",\n        \"00000000000000000\",\n        \"000000000000000000\",\n        \"0000000000000000000\",\n        \"00000000000000000000\",\n        \"000000000000000000000\",\n        \"0000000000000000000000\",\n        \"00000000000000000000000\",\n        \"000000000000000000000000\",\n        \"0000000000000000000000000\",\n      ];\n      var groupSizes = [\n        0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n        5,\n      ];\n      var groupBases = [\n        0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808,\n        62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624,\n        9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875,\n        60466176,\n      ];\n      BN.prototype.toString = function toString(base, padding) {\n        base = base || 10;\n        padding = padding | 0 || 1;\n        var out;\n        if (base === 16 || base === \"hex\") {\n          out = \"\";\n          var off = 0;\n          var carry = 0;\n          for (var i = 0; i < this.length; i++) {\n            var w = this.words[i];\n            var word = (((w << off) | carry) & 16777215).toString(16);\n            carry = (w >>> (24 - off)) & 16777215;\n            if (carry !== 0 || i !== this.length - 1) {\n              out = zeros[6 - word.length] + word + out;\n            } else {\n              out = word + out;\n            }\n            off += 2;\n            if (off >= 26) {\n              off -= 26;\n              i--;\n            }\n          }\n          if (carry !== 0) {\n            out = carry.toString(16) + out;\n          }\n          while (out.length % padding !== 0) {\n            out = \"0\" + out;\n          }\n          if (this.negative !== 0) {\n            out = \"-\" + out;\n          }\n          return out;\n        }\n        if (base === (base | 0) && base >= 2 && base <= 36) {\n          var groupSize = groupSizes[base];\n          var groupBase = groupBases[base];\n          out = \"\";\n          var c = this.clone();\n          c.negative = 0;\n          while (!c.isZero()) {\n            var r = c.modn(groupBase).toString(base);\n            c = c.idivn(groupBase);\n            if (!c.isZero()) {\n              out = zeros[groupSize - r.length] + r + out;\n            } else {\n              out = r + out;\n            }\n          }\n          if (this.isZero()) {\n            out = \"0\" + out;\n          }\n          while (out.length % padding !== 0) {\n            out = \"0\" + out;\n          }\n          if (this.negative !== 0) {\n            out = \"-\" + out;\n          }\n          return out;\n        }\n        assert(false, \"Base should be between 2 and 36\");\n      };\n      BN.prototype.toNumber = function toNumber() {\n        var ret = this.words[0];\n        if (this.length === 2) {\n          ret += this.words[1] * 67108864;\n        } else if (this.length === 3 && this.words[2] === 1) {\n          ret += 4503599627370496 + this.words[1] * 67108864;\n        } else if (this.length > 2) {\n          assert(false, \"Number can only safely store up to 53 bits\");\n        }\n        return this.negative !== 0 ? -ret : ret;\n      };\n      BN.prototype.toJSON = function toJSON() {\n        return this.toString(16);\n      };\n      BN.prototype.toBuffer = function toBuffer(endian, length) {\n        assert(typeof Buffer2 !== \"undefined\");\n        return this.toArrayLike(Buffer2, endian, length);\n      };\n      BN.prototype.toArray = function toArray(endian, length) {\n        return this.toArrayLike(Array, endian, length);\n      };\n      BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {\n        var byteLength = this.byteLength();\n        var reqLength = length || Math.max(1, byteLength);\n        assert(byteLength <= reqLength, \"byte array longer than desired length\");\n        assert(reqLength > 0, \"Requested array length <= 0\");\n        this.strip();\n        var littleEndian = endian === \"le\";\n        var res = new ArrayType(reqLength);\n        var b, i;\n        var q = this.clone();\n        if (!littleEndian) {\n          for (i = 0; i < reqLength - byteLength; i++) {\n            res[i] = 0;\n          }\n          for (i = 0; !q.isZero(); i++) {\n            b = q.andln(255);\n            q.iushrn(8);\n            res[reqLength - i - 1] = b;\n          }\n        } else {\n          for (i = 0; !q.isZero(); i++) {\n            b = q.andln(255);\n            q.iushrn(8);\n            res[i] = b;\n          }\n          for (; i < reqLength; i++) {\n            res[i] = 0;\n          }\n        }\n        return res;\n      };\n      if (Math.clz32) {\n        BN.prototype._countBits = function _countBits(w) {\n          return 32 - Math.clz32(w);\n        };\n      } else {\n        BN.prototype._countBits = function _countBits(w) {\n          var t = w;\n          var r = 0;\n          if (t >= 4096) {\n            r += 13;\n            t >>>= 13;\n          }\n          if (t >= 64) {\n            r += 7;\n            t >>>= 7;\n          }\n          if (t >= 8) {\n            r += 4;\n            t >>>= 4;\n          }\n          if (t >= 2) {\n            r += 2;\n            t >>>= 2;\n          }\n          return r + t;\n        };\n      }\n      BN.prototype._zeroBits = function _zeroBits(w) {\n        if (w === 0) return 26;\n        var t = w;\n        var r = 0;\n        if ((t & 8191) === 0) {\n          r += 13;\n          t >>>= 13;\n        }\n        if ((t & 127) === 0) {\n          r += 7;\n          t >>>= 7;\n        }\n        if ((t & 15) === 0) {\n          r += 4;\n          t >>>= 4;\n        }\n        if ((t & 3) === 0) {\n          r += 2;\n          t >>>= 2;\n        }\n        if ((t & 1) === 0) {\n          r++;\n        }\n        return r;\n      };\n      BN.prototype.bitLength = function bitLength() {\n        var w = this.words[this.length - 1];\n        var hi = this._countBits(w);\n        return (this.length - 1) * 26 + hi;\n      };\n      function toBitArray(num) {\n        var w = new Array(num.bitLength());\n        for (var bit = 0; bit < w.length; bit++) {\n          var off = (bit / 26) | 0;\n          var wbit = bit % 26;\n          w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n        }\n        return w;\n      }\n      BN.prototype.zeroBits = function zeroBits() {\n        if (this.isZero()) return 0;\n        var r = 0;\n        for (var i = 0; i < this.length; i++) {\n          var b = this._zeroBits(this.words[i]);\n          r += b;\n          if (b !== 26) break;\n        }\n        return r;\n      };\n      BN.prototype.byteLength = function byteLength() {\n        return Math.ceil(this.bitLength() / 8);\n      };\n      BN.prototype.toTwos = function toTwos(width) {\n        if (this.negative !== 0) {\n          return this.abs().inotn(width).iaddn(1);\n        }\n        return this.clone();\n      };\n      BN.prototype.fromTwos = function fromTwos(width) {\n        if (this.testn(width - 1)) {\n          return this.notn(width).iaddn(1).ineg();\n        }\n        return this.clone();\n      };\n      BN.prototype.isNeg = function isNeg() {\n        return this.negative !== 0;\n      };\n      BN.prototype.neg = function neg() {\n        return this.clone().ineg();\n      };\n      BN.prototype.ineg = function ineg() {\n        if (!this.isZero()) {\n          this.negative ^= 1;\n        }\n        return this;\n      };\n      BN.prototype.iuor = function iuor(num) {\n        while (this.length < num.length) {\n          this.words[this.length++] = 0;\n        }\n        for (var i = 0; i < num.length; i++) {\n          this.words[i] = this.words[i] | num.words[i];\n        }\n        return this.strip();\n      };\n      BN.prototype.ior = function ior(num) {\n        assert((this.negative | num.negative) === 0);\n        return this.iuor(num);\n      };\n      BN.prototype.or = function or(num) {\n        if (this.length > num.length) return this.clone().ior(num);\n        return num.clone().ior(this);\n      };\n      BN.prototype.uor = function uor(num) {\n        if (this.length > num.length) return this.clone().iuor(num);\n        return num.clone().iuor(this);\n      };\n      BN.prototype.iuand = function iuand(num) {\n        var b;\n        if (this.length > num.length) {\n          b = num;\n        } else {\n          b = this;\n        }\n        for (var i = 0; i < b.length; i++) {\n          this.words[i] = this.words[i] & num.words[i];\n        }\n        this.length = b.length;\n        return this.strip();\n      };\n      BN.prototype.iand = function iand(num) {\n        assert((this.negative | num.negative) === 0);\n        return this.iuand(num);\n      };\n      BN.prototype.and = function and(num) {\n        if (this.length > num.length) return this.clone().iand(num);\n        return num.clone().iand(this);\n      };\n      BN.prototype.uand = function uand(num) {\n        if (this.length > num.length) return this.clone().iuand(num);\n        return num.clone().iuand(this);\n      };\n      BN.prototype.iuxor = function iuxor(num) {\n        var a;\n        var b;\n        if (this.length > num.length) {\n          a = this;\n          b = num;\n        } else {\n          a = num;\n          b = this;\n        }\n        for (var i = 0; i < b.length; i++) {\n          this.words[i] = a.words[i] ^ b.words[i];\n        }\n        if (this !== a) {\n          for (; i < a.length; i++) {\n            this.words[i] = a.words[i];\n          }\n        }\n        this.length = a.length;\n        return this.strip();\n      };\n      BN.prototype.ixor = function ixor(num) {\n        assert((this.negative | num.negative) === 0);\n        return this.iuxor(num);\n      };\n      BN.prototype.xor = function xor(num) {\n        if (this.length > num.length) return this.clone().ixor(num);\n        return num.clone().ixor(this);\n      };\n      BN.prototype.uxor = function uxor(num) {\n        if (this.length > num.length) return this.clone().iuxor(num);\n        return num.clone().iuxor(this);\n      };\n      BN.prototype.inotn = function inotn(width) {\n        assert(typeof width === \"number\" && width >= 0);\n        var bytesNeeded = Math.ceil(width / 26) | 0;\n        var bitsLeft = width % 26;\n        this._expand(bytesNeeded);\n        if (bitsLeft > 0) {\n          bytesNeeded--;\n        }\n        for (var i = 0; i < bytesNeeded; i++) {\n          this.words[i] = ~this.words[i] & 67108863;\n        }\n        if (bitsLeft > 0) {\n          this.words[i] = ~this.words[i] & (67108863 >> (26 - bitsLeft));\n        }\n        return this.strip();\n      };\n      BN.prototype.notn = function notn(width) {\n        return this.clone().inotn(width);\n      };\n      BN.prototype.setn = function setn(bit, val) {\n        assert(typeof bit === \"number\" && bit >= 0);\n        var off = (bit / 26) | 0;\n        var wbit = bit % 26;\n        this._expand(off + 1);\n        if (val) {\n          this.words[off] = this.words[off] | (1 << wbit);\n        } else {\n          this.words[off] = this.words[off] & ~(1 << wbit);\n        }\n        return this.strip();\n      };\n      BN.prototype.iadd = function iadd(num) {\n        var r;\n        if (this.negative !== 0 && num.negative === 0) {\n          this.negative = 0;\n          r = this.isub(num);\n          this.negative ^= 1;\n          return this._normSign();\n        } else if (this.negative === 0 && num.negative !== 0) {\n          num.negative = 0;\n          r = this.isub(num);\n          num.negative = 1;\n          return r._normSign();\n        }\n        var a, b;\n        if (this.length > num.length) {\n          a = this;\n          b = num;\n        } else {\n          a = num;\n          b = this;\n        }\n        var carry = 0;\n        for (var i = 0; i < b.length; i++) {\n          r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n          this.words[i] = r & 67108863;\n          carry = r >>> 26;\n        }\n        for (; carry !== 0 && i < a.length; i++) {\n          r = (a.words[i] | 0) + carry;\n          this.words[i] = r & 67108863;\n          carry = r >>> 26;\n        }\n        this.length = a.length;\n        if (carry !== 0) {\n          this.words[this.length] = carry;\n          this.length++;\n        } else if (a !== this) {\n          for (; i < a.length; i++) {\n            this.words[i] = a.words[i];\n          }\n        }\n        return this;\n      };\n      BN.prototype.add = function add(num) {\n        var res;\n        if (num.negative !== 0 && this.negative === 0) {\n          num.negative = 0;\n          res = this.sub(num);\n          num.negative ^= 1;\n          return res;\n        } else if (num.negative === 0 && this.negative !== 0) {\n          this.negative = 0;\n          res = num.sub(this);\n          this.negative = 1;\n          return res;\n        }\n        if (this.length > num.length) return this.clone().iadd(num);\n        return num.clone().iadd(this);\n      };\n      BN.prototype.isub = function isub(num) {\n        if (num.negative !== 0) {\n          num.negative = 0;\n          var r = this.iadd(num);\n          num.negative = 1;\n          return r._normSign();\n        } else if (this.negative !== 0) {\n          this.negative = 0;\n          this.iadd(num);\n          this.negative = 1;\n          return this._normSign();\n        }\n        var cmp = this.cmp(num);\n        if (cmp === 0) {\n          this.negative = 0;\n          this.length = 1;\n          this.words[0] = 0;\n          return this;\n        }\n        var a, b;\n        if (cmp > 0) {\n          a = this;\n          b = num;\n        } else {\n          a = num;\n          b = this;\n        }\n        var carry = 0;\n        for (var i = 0; i < b.length; i++) {\n          r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n          carry = r >> 26;\n          this.words[i] = r & 67108863;\n        }\n        for (; carry !== 0 && i < a.length; i++) {\n          r = (a.words[i] | 0) + carry;\n          carry = r >> 26;\n          this.words[i] = r & 67108863;\n        }\n        if (carry === 0 && i < a.length && a !== this) {\n          for (; i < a.length; i++) {\n            this.words[i] = a.words[i];\n          }\n        }\n        this.length = Math.max(this.length, i);\n        if (a !== this) {\n          this.negative = 1;\n        }\n        return this.strip();\n      };\n      BN.prototype.sub = function sub(num) {\n        return this.clone().isub(num);\n      };\n      function smallMulTo(self2, num, out) {\n        out.negative = num.negative ^ self2.negative;\n        var len = (self2.length + num.length) | 0;\n        out.length = len;\n        len = (len - 1) | 0;\n        var a = self2.words[0] | 0;\n        var b = num.words[0] | 0;\n        var r = a * b;\n        var lo = r & 67108863;\n        var carry = (r / 67108864) | 0;\n        out.words[0] = lo;\n        for (var k = 1; k < len; k++) {\n          var ncarry = carry >>> 26;\n          var rword = carry & 67108863;\n          var maxJ = Math.min(k, num.length - 1);\n          for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) {\n            var i = (k - j) | 0;\n            a = self2.words[i] | 0;\n            b = num.words[j] | 0;\n            r = a * b + rword;\n            ncarry += (r / 67108864) | 0;\n            rword = r & 67108863;\n          }\n          out.words[k] = rword | 0;\n          carry = ncarry | 0;\n        }\n        if (carry !== 0) {\n          out.words[k] = carry | 0;\n        } else {\n          out.length--;\n        }\n        return out.strip();\n      }\n      var comb10MulTo = function comb10MulTo2(self2, num, out) {\n        var a = self2.words;\n        var b = num.words;\n        var o = out.words;\n        var c = 0;\n        var lo;\n        var mid;\n        var hi;\n        var a0 = a[0] | 0;\n        var al0 = a0 & 8191;\n        var ah0 = a0 >>> 13;\n        var a1 = a[1] | 0;\n        var al1 = a1 & 8191;\n        var ah1 = a1 >>> 13;\n        var a2 = a[2] | 0;\n        var al2 = a2 & 8191;\n        var ah2 = a2 >>> 13;\n        var a3 = a[3] | 0;\n        var al3 = a3 & 8191;\n        var ah3 = a3 >>> 13;\n        var a4 = a[4] | 0;\n        var al4 = a4 & 8191;\n        var ah4 = a4 >>> 13;\n        var a5 = a[5] | 0;\n        var al5 = a5 & 8191;\n        var ah5 = a5 >>> 13;\n        var a6 = a[6] | 0;\n        var al6 = a6 & 8191;\n        var ah6 = a6 >>> 13;\n        var a7 = a[7] | 0;\n        var al7 = a7 & 8191;\n        var ah7 = a7 >>> 13;\n        var a8 = a[8] | 0;\n        var al8 = a8 & 8191;\n        var ah8 = a8 >>> 13;\n        var a9 = a[9] | 0;\n        var al9 = a9 & 8191;\n        var ah9 = a9 >>> 13;\n        var b0 = b[0] | 0;\n        var bl0 = b0 & 8191;\n        var bh0 = b0 >>> 13;\n        var b1 = b[1] | 0;\n        var bl1 = b1 & 8191;\n        var bh1 = b1 >>> 13;\n        var b2 = b[2] | 0;\n        var bl2 = b2 & 8191;\n        var bh2 = b2 >>> 13;\n        var b3 = b[3] | 0;\n        var bl3 = b3 & 8191;\n        var bh3 = b3 >>> 13;\n        var b4 = b[4] | 0;\n        var bl4 = b4 & 8191;\n        var bh4 = b4 >>> 13;\n        var b5 = b[5] | 0;\n        var bl5 = b5 & 8191;\n        var bh5 = b5 >>> 13;\n        var b6 = b[6] | 0;\n        var bl6 = b6 & 8191;\n        var bh6 = b6 >>> 13;\n        var b7 = b[7] | 0;\n        var bl7 = b7 & 8191;\n        var bh7 = b7 >>> 13;\n        var b8 = b[8] | 0;\n        var bl8 = b8 & 8191;\n        var bh8 = b8 >>> 13;\n        var b9 = b[9] | 0;\n        var bl9 = b9 & 8191;\n        var bh9 = b9 >>> 13;\n        out.negative = self2.negative ^ num.negative;\n        out.length = 19;\n        lo = Math.imul(al0, bl0);\n        mid = Math.imul(al0, bh0);\n        mid = (mid + Math.imul(ah0, bl0)) | 0;\n        hi = Math.imul(ah0, bh0);\n        var w0 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n        w0 &= 67108863;\n        lo = Math.imul(al1, bl0);\n        mid = Math.imul(al1, bh0);\n        mid = (mid + Math.imul(ah1, bl0)) | 0;\n        hi = Math.imul(ah1, bh0);\n        lo = (lo + Math.imul(al0, bl1)) | 0;\n        mid = (mid + Math.imul(al0, bh1)) | 0;\n        mid = (mid + Math.imul(ah0, bl1)) | 0;\n        hi = (hi + Math.imul(ah0, bh1)) | 0;\n        var w1 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n        w1 &= 67108863;\n        lo = Math.imul(al2, bl0);\n        mid = Math.imul(al2, bh0);\n        mid = (mid + Math.imul(ah2, bl0)) | 0;\n        hi = Math.imul(ah2, bh0);\n        lo = (lo + Math.imul(al1, bl1)) | 0;\n        mid = (mid + Math.imul(al1, bh1)) | 0;\n        mid = (mid + Math.imul(ah1, bl1)) | 0;\n        hi = (hi + Math.imul(ah1, bh1)) | 0;\n        lo = (lo + Math.imul(al0, bl2)) | 0;\n        mid = (mid + Math.imul(al0, bh2)) | 0;\n        mid = (mid + Math.imul(ah0, bl2)) | 0;\n        hi = (hi + Math.imul(ah0, bh2)) | 0;\n        var w2 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n        w2 &= 67108863;\n        lo = Math.imul(al3, bl0);\n        mid = Math.imul(al3, bh0);\n        mid = (mid + Math.imul(ah3, bl0)) | 0;\n        hi = Math.imul(ah3, bh0);\n        lo = (lo + Math.imul(al2, bl1)) | 0;\n        mid = (mid + Math.imul(al2, bh1)) | 0;\n        mid = (mid + Math.imul(ah2, bl1)) | 0;\n        hi = (hi + Math.imul(ah2, bh1)) | 0;\n        lo = (lo + Math.imul(al1, bl2)) | 0;\n        mid = (mid + Math.imul(al1, bh2)) | 0;\n        mid = (mid + Math.imul(ah1, bl2)) | 0;\n        hi = (hi + Math.imul(ah1, bh2)) | 0;\n        lo = (lo + Math.imul(al0, bl3)) | 0;\n        mid = (mid + Math.imul(al0, bh3)) | 0;\n        mid = (mid + Math.imul(ah0, bl3)) | 0;\n        hi = (hi + Math.imul(ah0, bh3)) | 0;\n        var w3 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n        w3 &= 67108863;\n        lo = Math.imul(al4, bl0);\n        mid = Math.imul(al4, bh0);\n        mid = (mid + Math.imul(ah4, bl0)) | 0;\n        hi = Math.imul(ah4, bh0);\n        lo = (lo + Math.imul(al3, bl1)) | 0;\n        mid = (mid + Math.imul(al3, bh1)) | 0;\n        mid = (mid + Math.imul(ah3, bl1)) | 0;\n        hi = (hi + Math.imul(ah3, bh1)) | 0;\n        lo = (lo + Math.imul(al2, bl2)) | 0;\n        mid = (mid + Math.imul(al2, bh2)) | 0;\n        mid = (mid + Math.imul(ah2, bl2)) | 0;\n        hi = (hi + Math.imul(ah2, bh2)) | 0;\n        lo = (lo + Math.imul(al1, bl3)) | 0;\n        mid = (mid + Math.imul(al1, bh3)) | 0;\n        mid = (mid + Math.imul(ah1, bl3)) | 0;\n        hi = (hi + Math.imul(ah1, bh3)) | 0;\n        lo = (lo + Math.imul(al0, bl4)) | 0;\n        mid = (mid + Math.imul(al0, bh4)) | 0;\n        mid = (mid + Math.imul(ah0, bl4)) | 0;\n        hi = (hi + Math.imul(ah0, bh4)) | 0;\n        var w4 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n        w4 &= 67108863;\n        lo = Math.imul(al5, bl0);\n        mid = Math.imul(al5, bh0);\n        mid = (mid + Math.imul(ah5, bl0)) | 0;\n        hi = Math.imul(ah5, bh0);\n        lo = (lo + Math.imul(al4, bl1)) | 0;\n        mid = (mid + Math.imul(al4, bh1)) | 0;\n        mid = (mid + Math.imul(ah4, bl1)) | 0;\n        hi = (hi + Math.imul(ah4, bh1)) | 0;\n        lo = (lo + Math.imul(al3, bl2)) | 0;\n        mid = (mid + Math.imul(al3, bh2)) | 0;\n        mid = (mid + Math.imul(ah3, bl2)) | 0;\n        hi = (hi + Math.imul(ah3, bh2)) | 0;\n        lo = (lo + Math.imul(al2, bl3)) | 0;\n        mid = (mid + Math.imul(al2, bh3)) | 0;\n        mid = (mid + Math.imul(ah2, bl3)) | 0;\n        hi = (hi + Math.imul(ah2, bh3)) | 0;\n        lo = (lo + Math.imul(al1, bl4)) | 0;\n        mid = (mid + Math.imul(al1, bh4)) | 0;\n        mid = (mid + Math.imul(ah1, bl4)) | 0;\n        hi = (hi + Math.imul(ah1, bh4)) | 0;\n        lo = (lo + Math.imul(al0, bl5)) | 0;\n        mid = (mid + Math.imul(al0, bh5)) | 0;\n        mid = (mid + Math.imul(ah0, bl5)) | 0;\n        hi = (hi + Math.imul(ah0, bh5)) | 0;\n        var w5 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n        w5 &= 67108863;\n        lo = Math.imul(al6, bl0);\n        mid = Math.imul(al6, bh0);\n        mid = (mid + Math.imul(ah6, bl0)) | 0;\n        hi = Math.imul(ah6, bh0);\n        lo = (lo + Math.imul(al5, bl1)) | 0;\n        mid = (mid + Math.imul(al5, bh1)) | 0;\n        mid = (mid + Math.imul(ah5, bl1)) | 0;\n        hi = (hi + Math.imul(ah5, bh1)) | 0;\n        lo = (lo + Math.imul(al4, bl2)) | 0;\n        mid = (mid + Math.imul(al4, bh2)) | 0;\n        mid = (mid + Math.imul(ah4, bl2)) | 0;\n        hi = (hi + Math.imul(ah4, bh2)) | 0;\n        lo = (lo + Math.imul(al3, bl3)) | 0;\n        mid = (mid + Math.imul(al3, bh3)) | 0;\n        mid = (mid + Math.imul(ah3, bl3)) | 0;\n        hi = (hi + Math.imul(ah3, bh3)) | 0;\n        lo = (lo + Math.imul(al2, bl4)) | 0;\n        mid = (mid + Math.imul(al2, bh4)) | 0;\n        mid = (mid + Math.imul(ah2, bl4)) | 0;\n        hi = (hi + Math.imul(ah2, bh4)) | 0;\n        lo = (lo + Math.imul(al1, bl5)) | 0;\n        mid = (mid + Math.imul(al1, bh5)) | 0;\n        mid = (mid + Math.imul(ah1, bl5)) | 0;\n        hi = (hi + Math.imul(ah1, bh5)) | 0;\n        lo = (lo + Math.imul(al0, bl6)) | 0;\n        mid = (mid + Math.imul(al0, bh6)) | 0;\n        mid = (mid + Math.imul(ah0, bl6)) | 0;\n        hi = (hi + Math.imul(ah0, bh6)) | 0;\n        var w6 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n        w6 &= 67108863;\n        lo = Math.imul(al7, bl0);\n        mid = Math.imul(al7, bh0);\n        mid = (mid + Math.imul(ah7, bl0)) | 0;\n        hi = Math.imul(ah7, bh0);\n        lo = (lo + Math.imul(al6, bl1)) | 0;\n        mid = (mid + Math.imul(al6, bh1)) | 0;\n        mid = (mid + Math.imul(ah6, bl1)) | 0;\n        hi = (hi + Math.imul(ah6, bh1)) | 0;\n        lo = (lo + Math.imul(al5, bl2)) | 0;\n        mid = (mid + Math.imul(al5, bh2)) | 0;\n        mid = (mid + Math.imul(ah5, bl2)) | 0;\n        hi = (hi + Math.imul(ah5, bh2)) | 0;\n        lo = (lo + Math.imul(al4, bl3)) | 0;\n        mid = (mid + Math.imul(al4, bh3)) | 0;\n        mid = (mid + Math.imul(ah4, bl3)) | 0;\n        hi = (hi + Math.imul(ah4, bh3)) | 0;\n        lo = (lo + Math.imul(al3, bl4)) | 0;\n        mid = (mid + Math.imul(al3, bh4)) | 0;\n        mid = (mid + Math.imul(ah3, bl4)) | 0;\n        hi = (hi + Math.imul(ah3, bh4)) | 0;\n        lo = (lo + Math.imul(al2, bl5)) | 0;\n        mid = (mid + Math.imul(al2, bh5)) | 0;\n        mid = (mid + Math.imul(ah2, bl5)) | 0;\n        hi = (hi + Math.imul(ah2, bh5)) | 0;\n        lo = (lo + Math.imul(al1, bl6)) | 0;\n        mid = (mid + Math.imul(al1, bh6)) | 0;\n        mid = (mid + Math.imul(ah1, bl6)) | 0;\n        hi = (hi + Math.imul(ah1, bh6)) | 0;\n        lo = (lo + Math.imul(al0, bl7)) | 0;\n        mid = (mid + Math.imul(al0, bh7)) | 0;\n        mid = (mid + Math.imul(ah0, bl7)) | 0;\n        hi = (hi + Math.imul(ah0, bh7)) | 0;\n        var w7 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n        w7 &= 67108863;\n        lo = Math.imul(al8, bl0);\n        mid = Math.imul(al8, bh0);\n        mid = (mid + Math.imul(ah8, bl0)) | 0;\n        hi = Math.imul(ah8, bh0);\n        lo = (lo + Math.imul(al7, bl1)) | 0;\n        mid = (mid + Math.imul(al7, bh1)) | 0;\n        mid = (mid + Math.imul(ah7, bl1)) | 0;\n        hi = (hi + Math.imul(ah7, bh1)) | 0;\n        lo = (lo + Math.imul(al6, bl2)) | 0;\n        mid = (mid + Math.imul(al6, bh2)) | 0;\n        mid = (mid + Math.imul(ah6, bl2)) | 0;\n        hi = (hi + Math.imul(ah6, bh2)) | 0;\n        lo = (lo + Math.imul(al5, bl3)) | 0;\n        mid = (mid + Math.imul(al5, bh3)) | 0;\n        mid = (mid + Math.imul(ah5, bl3)) | 0;\n        hi = (hi + Math.imul(ah5, bh3)) | 0;\n        lo = (lo + Math.imul(al4, bl4)) | 0;\n        mid = (mid + Math.imul(al4, bh4)) | 0;\n        mid = (mid + Math.imul(ah4, bl4)) | 0;\n        hi = (hi + Math.imul(ah4, bh4)) | 0;\n        lo = (lo + Math.imul(al3, bl5)) | 0;\n        mid = (mid + Math.imul(al3, bh5)) | 0;\n        mid = (mid + Math.imul(ah3, bl5)) | 0;\n        hi = (hi + Math.imul(ah3, bh5)) | 0;\n        lo = (lo + Math.imul(al2, bl6)) | 0;\n        mid = (mid + Math.imul(al2, bh6)) | 0;\n        mid = (mid + Math.imul(ah2, bl6)) | 0;\n        hi = (hi + Math.imul(ah2, bh6)) | 0;\n        lo = (lo + Math.imul(al1, bl7)) | 0;\n        mid = (mid + Math.imul(al1, bh7)) | 0;\n        mid = (mid + Math.imul(ah1, bl7)) | 0;\n        hi = (hi + Math.imul(ah1, bh7)) | 0;\n        lo = (lo + Math.imul(al0, bl8)) | 0;\n        mid = (mid + Math.imul(al0, bh8)) | 0;\n        mid = (mid + Math.imul(ah0, bl8)) | 0;\n        hi = (hi + Math.imul(ah0, bh8)) | 0;\n        var w8 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n        w8 &= 67108863;\n        lo = Math.imul(al9, bl0);\n        mid = Math.imul(al9, bh0);\n        mid = (mid + Math.imul(ah9, bl0)) | 0;\n        hi = Math.imul(ah9, bh0);\n        lo = (lo + Math.imul(al8, bl1)) | 0;\n        mid = (mid + Math.imul(al8, bh1)) | 0;\n        mid = (mid + Math.imul(ah8, bl1)) | 0;\n        hi = (hi + Math.imul(ah8, bh1)) | 0;\n        lo = (lo + Math.imul(al7, bl2)) | 0;\n        mid = (mid + Math.imul(al7, bh2)) | 0;\n        mid = (mid + Math.imul(ah7, bl2)) | 0;\n        hi = (hi + Math.imul(ah7, bh2)) | 0;\n        lo = (lo + Math.imul(al6, bl3)) | 0;\n        mid = (mid + Math.imul(al6, bh3)) | 0;\n        mid = (mid + Math.imul(ah6, bl3)) | 0;\n        hi = (hi + Math.imul(ah6, bh3)) | 0;\n        lo = (lo + Math.imul(al5, bl4)) | 0;\n        mid = (mid + Math.imul(al5, bh4)) | 0;\n        mid = (mid + Math.imul(ah5, bl4)) | 0;\n        hi = (hi + Math.imul(ah5, bh4)) | 0;\n        lo = (lo + Math.imul(al4, bl5)) | 0;\n        mid = (mid + Math.imul(al4, bh5)) | 0;\n        mid = (mid + Math.imul(ah4, bl5)) | 0;\n        hi = (hi + Math.imul(ah4, bh5)) | 0;\n        lo = (lo + Math.imul(al3, bl6)) | 0;\n        mid = (mid + Math.imul(al3, bh6)) | 0;\n        mid = (mid + Math.imul(ah3, bl6)) | 0;\n        hi = (hi + Math.imul(ah3, bh6)) | 0;\n        lo = (lo + Math.imul(al2, bl7)) | 0;\n        mid = (mid + Math.imul(al2, bh7)) | 0;\n        mid = (mid + Math.imul(ah2, bl7)) | 0;\n        hi = (hi + Math.imul(ah2, bh7)) | 0;\n        lo = (lo + Math.imul(al1, bl8)) | 0;\n        mid = (mid + Math.imul(al1, bh8)) | 0;\n        mid = (mid + Math.imul(ah1, bl8)) | 0;\n        hi = (hi + Math.imul(ah1, bh8)) | 0;\n        lo = (lo + Math.imul(al0, bl9)) | 0;\n        mid = (mid + Math.imul(al0, bh9)) | 0;\n        mid = (mid + Math.imul(ah0, bl9)) | 0;\n        hi = (hi + Math.imul(ah0, bh9)) | 0;\n        var w9 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n        w9 &= 67108863;\n        lo = Math.imul(al9, bl1);\n        mid = Math.imul(al9, bh1);\n        mid = (mid + Math.imul(ah9, bl1)) | 0;\n        hi = Math.imul(ah9, bh1);\n        lo = (lo + Math.imul(al8, bl2)) | 0;\n        mid = (mid + Math.imul(al8, bh2)) | 0;\n        mid = (mid + Math.imul(ah8, bl2)) | 0;\n        hi = (hi + Math.imul(ah8, bh2)) | 0;\n        lo = (lo + Math.imul(al7, bl3)) | 0;\n        mid = (mid + Math.imul(al7, bh3)) | 0;\n        mid = (mid + Math.imul(ah7, bl3)) | 0;\n        hi = (hi + Math.imul(ah7, bh3)) | 0;\n        lo = (lo + Math.imul(al6, bl4)) | 0;\n        mid = (mid + Math.imul(al6, bh4)) | 0;\n        mid = (mid + Math.imul(ah6, bl4)) | 0;\n        hi = (hi + Math.imul(ah6, bh4)) | 0;\n        lo = (lo + Math.imul(al5, bl5)) | 0;\n        mid = (mid + Math.imul(al5, bh5)) | 0;\n        mid = (mid + Math.imul(ah5, bl5)) | 0;\n        hi = (hi + Math.imul(ah5, bh5)) | 0;\n        lo = (lo + Math.imul(al4, bl6)) | 0;\n        mid = (mid + Math.imul(al4, bh6)) | 0;\n        mid = (mid + Math.imul(ah4, bl6)) | 0;\n        hi = (hi + Math.imul(ah4, bh6)) | 0;\n        lo = (lo + Math.imul(al3, bl7)) | 0;\n        mid = (mid + Math.imul(al3, bh7)) | 0;\n        mid = (mid + Math.imul(ah3, bl7)) | 0;\n        hi = (hi + Math.imul(ah3, bh7)) | 0;\n        lo = (lo + Math.imul(al2, bl8)) | 0;\n        mid = (mid + Math.imul(al2, bh8)) | 0;\n        mid = (mid + Math.imul(ah2, bl8)) | 0;\n        hi = (hi + Math.imul(ah2, bh8)) | 0;\n        lo = (lo + Math.imul(al1, bl9)) | 0;\n        mid = (mid + Math.imul(al1, bh9)) | 0;\n        mid = (mid + Math.imul(ah1, bl9)) | 0;\n        hi = (hi + Math.imul(ah1, bh9)) | 0;\n        var w10 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n        w10 &= 67108863;\n        lo = Math.imul(al9, bl2);\n        mid = Math.imul(al9, bh2);\n        mid = (mid + Math.imul(ah9, bl2)) | 0;\n        hi = Math.imul(ah9, bh2);\n        lo = (lo + Math.imul(al8, bl3)) | 0;\n        mid = (mid + Math.imul(al8, bh3)) | 0;\n        mid = (mid + Math.imul(ah8, bl3)) | 0;\n        hi = (hi + Math.imul(ah8, bh3)) | 0;\n        lo = (lo + Math.imul(al7, bl4)) | 0;\n        mid = (mid + Math.imul(al7, bh4)) | 0;\n        mid = (mid + Math.imul(ah7, bl4)) | 0;\n        hi = (hi + Math.imul(ah7, bh4)) | 0;\n        lo = (lo + Math.imul(al6, bl5)) | 0;\n        mid = (mid + Math.imul(al6, bh5)) | 0;\n        mid = (mid + Math.imul(ah6, bl5)) | 0;\n        hi = (hi + Math.imul(ah6, bh5)) | 0;\n        lo = (lo + Math.imul(al5, bl6)) | 0;\n        mid = (mid + Math.imul(al5, bh6)) | 0;\n        mid = (mid + Math.imul(ah5, bl6)) | 0;\n        hi = (hi + Math.imul(ah5, bh6)) | 0;\n        lo = (lo + Math.imul(al4, bl7)) | 0;\n        mid = (mid + Math.imul(al4, bh7)) | 0;\n        mid = (mid + Math.imul(ah4, bl7)) | 0;\n        hi = (hi + Math.imul(ah4, bh7)) | 0;\n        lo = (lo + Math.imul(al3, bl8)) | 0;\n        mid = (mid + Math.imul(al3, bh8)) | 0;\n        mid = (mid + Math.imul(ah3, bl8)) | 0;\n        hi = (hi + Math.imul(ah3, bh8)) | 0;\n        lo = (lo + Math.imul(al2, bl9)) | 0;\n        mid = (mid + Math.imul(al2, bh9)) | 0;\n        mid = (mid + Math.imul(ah2, bl9)) | 0;\n        hi = (hi + Math.imul(ah2, bh9)) | 0;\n        var w11 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n        w11 &= 67108863;\n        lo = Math.imul(al9, bl3);\n        mid = Math.imul(al9, bh3);\n        mid = (mid + Math.imul(ah9, bl3)) | 0;\n        hi = Math.imul(ah9, bh3);\n        lo = (lo + Math.imul(al8, bl4)) | 0;\n        mid = (mid + Math.imul(al8, bh4)) | 0;\n        mid = (mid + Math.imul(ah8, bl4)) | 0;\n        hi = (hi + Math.imul(ah8, bh4)) | 0;\n        lo = (lo + Math.imul(al7, bl5)) | 0;\n        mid = (mid + Math.imul(al7, bh5)) | 0;\n        mid = (mid + Math.imul(ah7, bl5)) | 0;\n        hi = (hi + Math.imul(ah7, bh5)) | 0;\n        lo = (lo + Math.imul(al6, bl6)) | 0;\n        mid = (mid + Math.imul(al6, bh6)) | 0;\n        mid = (mid + Math.imul(ah6, bl6)) | 0;\n        hi = (hi + Math.imul(ah6, bh6)) | 0;\n        lo = (lo + Math.imul(al5, bl7)) | 0;\n        mid = (mid + Math.imul(al5, bh7)) | 0;\n        mid = (mid + Math.imul(ah5, bl7)) | 0;\n        hi = (hi + Math.imul(ah5, bh7)) | 0;\n        lo = (lo + Math.imul(al4, bl8)) | 0;\n        mid = (mid + Math.imul(al4, bh8)) | 0;\n        mid = (mid + Math.imul(ah4, bl8)) | 0;\n        hi = (hi + Math.imul(ah4, bh8)) | 0;\n        lo = (lo + Math.imul(al3, bl9)) | 0;\n        mid = (mid + Math.imul(al3, bh9)) | 0;\n        mid = (mid + Math.imul(ah3, bl9)) | 0;\n        hi = (hi + Math.imul(ah3, bh9)) | 0;\n        var w12 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n        w12 &= 67108863;\n        lo = Math.imul(al9, bl4);\n        mid = Math.imul(al9, bh4);\n        mid = (mid + Math.imul(ah9, bl4)) | 0;\n        hi = Math.imul(ah9, bh4);\n        lo = (lo + Math.imul(al8, bl5)) | 0;\n        mid = (mid + Math.imul(al8, bh5)) | 0;\n        mid = (mid + Math.imul(ah8, bl5)) | 0;\n        hi = (hi + Math.imul(ah8, bh5)) | 0;\n        lo = (lo + Math.imul(al7, bl6)) | 0;\n        mid = (mid + Math.imul(al7, bh6)) | 0;\n        mid = (mid + Math.imul(ah7, bl6)) | 0;\n        hi = (hi + Math.imul(ah7, bh6)) | 0;\n        lo = (lo + Math.imul(al6, bl7)) | 0;\n        mid = (mid + Math.imul(al6, bh7)) | 0;\n        mid = (mid + Math.imul(ah6, bl7)) | 0;\n        hi = (hi + Math.imul(ah6, bh7)) | 0;\n        lo = (lo + Math.imul(al5, bl8)) | 0;\n        mid = (mid + Math.imul(al5, bh8)) | 0;\n        mid = (mid + Math.imul(ah5, bl8)) | 0;\n        hi = (hi + Math.imul(ah5, bh8)) | 0;\n        lo = (lo + Math.imul(al4, bl9)) | 0;\n        mid = (mid + Math.imul(al4, bh9)) | 0;\n        mid = (mid + Math.imul(ah4, bl9)) | 0;\n        hi = (hi + Math.imul(ah4, bh9)) | 0;\n        var w13 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n        w13 &= 67108863;\n        lo = Math.imul(al9, bl5);\n        mid = Math.imul(al9, bh5);\n        mid = (mid + Math.imul(ah9, bl5)) | 0;\n        hi = Math.imul(ah9, bh5);\n        lo = (lo + Math.imul(al8, bl6)) | 0;\n        mid = (mid + Math.imul(al8, bh6)) | 0;\n        mid = (mid + Math.imul(ah8, bl6)) | 0;\n        hi = (hi + Math.imul(ah8, bh6)) | 0;\n        lo = (lo + Math.imul(al7, bl7)) | 0;\n        mid = (mid + Math.imul(al7, bh7)) | 0;\n        mid = (mid + Math.imul(ah7, bl7)) | 0;\n        hi = (hi + Math.imul(ah7, bh7)) | 0;\n        lo = (lo + Math.imul(al6, bl8)) | 0;\n        mid = (mid + Math.imul(al6, bh8)) | 0;\n        mid = (mid + Math.imul(ah6, bl8)) | 0;\n        hi = (hi + Math.imul(ah6, bh8)) | 0;\n        lo = (lo + Math.imul(al5, bl9)) | 0;\n        mid = (mid + Math.imul(al5, bh9)) | 0;\n        mid = (mid + Math.imul(ah5, bl9)) | 0;\n        hi = (hi + Math.imul(ah5, bh9)) | 0;\n        var w14 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n        w14 &= 67108863;\n        lo = Math.imul(al9, bl6);\n        mid = Math.imul(al9, bh6);\n        mid = (mid + Math.imul(ah9, bl6)) | 0;\n        hi = Math.imul(ah9, bh6);\n        lo = (lo + Math.imul(al8, bl7)) | 0;\n        mid = (mid + Math.imul(al8, bh7)) | 0;\n        mid = (mid + Math.imul(ah8, bl7)) | 0;\n        hi = (hi + Math.imul(ah8, bh7)) | 0;\n        lo = (lo + Math.imul(al7, bl8)) | 0;\n        mid = (mid + Math.imul(al7, bh8)) | 0;\n        mid = (mid + Math.imul(ah7, bl8)) | 0;\n        hi = (hi + Math.imul(ah7, bh8)) | 0;\n        lo = (lo + Math.imul(al6, bl9)) | 0;\n        mid = (mid + Math.imul(al6, bh9)) | 0;\n        mid = (mid + Math.imul(ah6, bl9)) | 0;\n        hi = (hi + Math.imul(ah6, bh9)) | 0;\n        var w15 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n        w15 &= 67108863;\n        lo = Math.imul(al9, bl7);\n        mid = Math.imul(al9, bh7);\n        mid = (mid + Math.imul(ah9, bl7)) | 0;\n        hi = Math.imul(ah9, bh7);\n        lo = (lo + Math.imul(al8, bl8)) | 0;\n        mid = (mid + Math.imul(al8, bh8)) | 0;\n        mid = (mid + Math.imul(ah8, bl8)) | 0;\n        hi = (hi + Math.imul(ah8, bh8)) | 0;\n        lo = (lo + Math.imul(al7, bl9)) | 0;\n        mid = (mid + Math.imul(al7, bh9)) | 0;\n        mid = (mid + Math.imul(ah7, bl9)) | 0;\n        hi = (hi + Math.imul(ah7, bh9)) | 0;\n        var w16 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n        w16 &= 67108863;\n        lo = Math.imul(al9, bl8);\n        mid = Math.imul(al9, bh8);\n        mid = (mid + Math.imul(ah9, bl8)) | 0;\n        hi = Math.imul(ah9, bh8);\n        lo = (lo + Math.imul(al8, bl9)) | 0;\n        mid = (mid + Math.imul(al8, bh9)) | 0;\n        mid = (mid + Math.imul(ah8, bl9)) | 0;\n        hi = (hi + Math.imul(ah8, bh9)) | 0;\n        var w17 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n        w17 &= 67108863;\n        lo = Math.imul(al9, bl9);\n        mid = Math.imul(al9, bh9);\n        mid = (mid + Math.imul(ah9, bl9)) | 0;\n        hi = Math.imul(ah9, bh9);\n        var w18 = (((c + lo) | 0) + ((mid & 8191) << 13)) | 0;\n        c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n        w18 &= 67108863;\n        o[0] = w0;\n        o[1] = w1;\n        o[2] = w2;\n        o[3] = w3;\n        o[4] = w4;\n        o[5] = w5;\n        o[6] = w6;\n        o[7] = w7;\n        o[8] = w8;\n        o[9] = w9;\n        o[10] = w10;\n        o[11] = w11;\n        o[12] = w12;\n        o[13] = w13;\n        o[14] = w14;\n        o[15] = w15;\n        o[16] = w16;\n        o[17] = w17;\n        o[18] = w18;\n        if (c !== 0) {\n          o[19] = c;\n          out.length++;\n        }\n        return out;\n      };\n      if (!Math.imul) {\n        comb10MulTo = smallMulTo;\n      }\n      function bigMulTo(self2, num, out) {\n        out.negative = num.negative ^ self2.negative;\n        out.length = self2.length + num.length;\n        var carry = 0;\n        var hncarry = 0;\n        for (var k = 0; k < out.length - 1; k++) {\n          var ncarry = hncarry;\n          hncarry = 0;\n          var rword = carry & 67108863;\n          var maxJ = Math.min(k, num.length - 1);\n          for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) {\n            var i = k - j;\n            var a = self2.words[i] | 0;\n            var b = num.words[j] | 0;\n            var r = a * b;\n            var lo = r & 67108863;\n            ncarry = (ncarry + ((r / 67108864) | 0)) | 0;\n            lo = (lo + rword) | 0;\n            rword = lo & 67108863;\n            ncarry = (ncarry + (lo >>> 26)) | 0;\n            hncarry += ncarry >>> 26;\n            ncarry &= 67108863;\n          }\n          out.words[k] = rword;\n          carry = ncarry;\n          ncarry = hncarry;\n        }\n        if (carry !== 0) {\n          out.words[k] = carry;\n        } else {\n          out.length--;\n        }\n        return out.strip();\n      }\n      function jumboMulTo(self2, num, out) {\n        var fftm = new FFTM();\n        return fftm.mulp(self2, num, out);\n      }\n      BN.prototype.mulTo = function mulTo(num, out) {\n        var res;\n        var len = this.length + num.length;\n        if (this.length === 10 && num.length === 10) {\n          res = comb10MulTo(this, num, out);\n        } else if (len < 63) {\n          res = smallMulTo(this, num, out);\n        } else if (len < 1024) {\n          res = bigMulTo(this, num, out);\n        } else {\n          res = jumboMulTo(this, num, out);\n        }\n        return res;\n      };\n      function FFTM(x, y) {\n        this.x = x;\n        this.y = y;\n      }\n      FFTM.prototype.makeRBT = function makeRBT(N) {\n        var t = new Array(N);\n        var l = BN.prototype._countBits(N) - 1;\n        for (var i = 0; i < N; i++) {\n          t[i] = this.revBin(i, l, N);\n        }\n        return t;\n      };\n      FFTM.prototype.revBin = function revBin(x, l, N) {\n        if (x === 0 || x === N - 1) return x;\n        var rb = 0;\n        for (var i = 0; i < l; i++) {\n          rb |= (x & 1) << (l - i - 1);\n          x >>= 1;\n        }\n        return rb;\n      };\n      FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {\n        for (var i = 0; i < N; i++) {\n          rtws[i] = rws[rbt[i]];\n          itws[i] = iws[rbt[i]];\n        }\n      };\n      FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {\n        this.permute(rbt, rws, iws, rtws, itws, N);\n        for (var s = 1; s < N; s <<= 1) {\n          var l = s << 1;\n          var rtwdf = Math.cos((2 * Math.PI) / l);\n          var itwdf = Math.sin((2 * Math.PI) / l);\n          for (var p = 0; p < N; p += l) {\n            var rtwdf_ = rtwdf;\n            var itwdf_ = itwdf;\n            for (var j = 0; j < s; j++) {\n              var re = rtws[p + j];\n              var ie = itws[p + j];\n              var ro = rtws[p + j + s];\n              var io = itws[p + j + s];\n              var rx = rtwdf_ * ro - itwdf_ * io;\n              io = rtwdf_ * io + itwdf_ * ro;\n              ro = rx;\n              rtws[p + j] = re + ro;\n              itws[p + j] = ie + io;\n              rtws[p + j + s] = re - ro;\n              itws[p + j + s] = ie - io;\n              if (j !== l) {\n                rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n                itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n                rtwdf_ = rx;\n              }\n            }\n          }\n        }\n      };\n      FFTM.prototype.guessLen13b = function guessLen13b(n, m) {\n        var N = Math.max(m, n) | 1;\n        var odd = N & 1;\n        var i = 0;\n        for (N = (N / 2) | 0; N; N = N >>> 1) {\n          i++;\n        }\n        return 1 << (i + 1 + odd);\n      };\n      FFTM.prototype.conjugate = function conjugate(rws, iws, N) {\n        if (N <= 1) return;\n        for (var i = 0; i < N / 2; i++) {\n          var t = rws[i];\n          rws[i] = rws[N - i - 1];\n          rws[N - i - 1] = t;\n          t = iws[i];\n          iws[i] = -iws[N - i - 1];\n          iws[N - i - 1] = -t;\n        }\n      };\n      FFTM.prototype.normalize13b = function normalize13b(ws, N) {\n        var carry = 0;\n        for (var i = 0; i < N / 2; i++) {\n          var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;\n          ws[i] = w & 67108863;\n          if (w < 67108864) {\n            carry = 0;\n          } else {\n            carry = (w / 67108864) | 0;\n          }\n        }\n        return ws;\n      };\n      FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {\n        var carry = 0;\n        for (var i = 0; i < len; i++) {\n          carry = carry + (ws[i] | 0);\n          rws[2 * i] = carry & 8191;\n          carry = carry >>> 13;\n          rws[2 * i + 1] = carry & 8191;\n          carry = carry >>> 13;\n        }\n        for (i = 2 * len; i < N; ++i) {\n          rws[i] = 0;\n        }\n        assert(carry === 0);\n        assert((carry & ~8191) === 0);\n      };\n      FFTM.prototype.stub = function stub(N) {\n        var ph = new Array(N);\n        for (var i = 0; i < N; i++) {\n          ph[i] = 0;\n        }\n        return ph;\n      };\n      FFTM.prototype.mulp = function mulp(x, y, out) {\n        var N = 2 * this.guessLen13b(x.length, y.length);\n        var rbt = this.makeRBT(N);\n        var _ = this.stub(N);\n        var rws = new Array(N);\n        var rwst = new Array(N);\n        var iwst = new Array(N);\n        var nrws = new Array(N);\n        var nrwst = new Array(N);\n        var niwst = new Array(N);\n        var rmws = out.words;\n        rmws.length = N;\n        this.convert13b(x.words, x.length, rws, N);\n        this.convert13b(y.words, y.length, nrws, N);\n        this.transform(rws, _, rwst, iwst, N, rbt);\n        this.transform(nrws, _, nrwst, niwst, N, rbt);\n        for (var i = 0; i < N; i++) {\n          var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n          iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n          rwst[i] = rx;\n        }\n        this.conjugate(rwst, iwst, N);\n        this.transform(rwst, iwst, rmws, _, N, rbt);\n        this.conjugate(rmws, _, N);\n        this.normalize13b(rmws, N);\n        out.negative = x.negative ^ y.negative;\n        out.length = x.length + y.length;\n        return out.strip();\n      };\n      BN.prototype.mul = function mul(num) {\n        var out = new BN(null);\n        out.words = new Array(this.length + num.length);\n        return this.mulTo(num, out);\n      };\n      BN.prototype.mulf = function mulf(num) {\n        var out = new BN(null);\n        out.words = new Array(this.length + num.length);\n        return jumboMulTo(this, num, out);\n      };\n      BN.prototype.imul = function imul(num) {\n        return this.clone().mulTo(num, this);\n      };\n      BN.prototype.imuln = function imuln(num) {\n        assert(typeof num === \"number\");\n        assert(num < 67108864);\n        var carry = 0;\n        for (var i = 0; i < this.length; i++) {\n          var w = (this.words[i] | 0) * num;\n          var lo = (w & 67108863) + (carry & 67108863);\n          carry >>= 26;\n          carry += (w / 67108864) | 0;\n          carry += lo >>> 26;\n          this.words[i] = lo & 67108863;\n        }\n        if (carry !== 0) {\n          this.words[i] = carry;\n          this.length++;\n        }\n        return this;\n      };\n      BN.prototype.muln = function muln(num) {\n        return this.clone().imuln(num);\n      };\n      BN.prototype.sqr = function sqr() {\n        return this.mul(this);\n      };\n      BN.prototype.isqr = function isqr() {\n        return this.imul(this.clone());\n      };\n      BN.prototype.pow = function pow(num) {\n        var w = toBitArray(num);\n        if (w.length === 0) return new BN(1);\n        var res = this;\n        for (var i = 0; i < w.length; i++, res = res.sqr()) {\n          if (w[i] !== 0) break;\n        }\n        if (++i < w.length) {\n          for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n            if (w[i] === 0) continue;\n            res = res.mul(q);\n          }\n        }\n        return res;\n      };\n      BN.prototype.iushln = function iushln(bits) {\n        assert(typeof bits === \"number\" && bits >= 0);\n        var r = bits % 26;\n        var s = (bits - r) / 26;\n        var carryMask = (67108863 >>> (26 - r)) << (26 - r);\n        var i;\n        if (r !== 0) {\n          var carry = 0;\n          for (i = 0; i < this.length; i++) {\n            var newCarry = this.words[i] & carryMask;\n            var c = ((this.words[i] | 0) - newCarry) << r;\n            this.words[i] = c | carry;\n            carry = newCarry >>> (26 - r);\n          }\n          if (carry) {\n            this.words[i] = carry;\n            this.length++;\n          }\n        }\n        if (s !== 0) {\n          for (i = this.length - 1; i >= 0; i--) {\n            this.words[i + s] = this.words[i];\n          }\n          for (i = 0; i < s; i++) {\n            this.words[i] = 0;\n          }\n          this.length += s;\n        }\n        return this.strip();\n      };\n      BN.prototype.ishln = function ishln(bits) {\n        assert(this.negative === 0);\n        return this.iushln(bits);\n      };\n      BN.prototype.iushrn = function iushrn(bits, hint, extended) {\n        assert(typeof bits === \"number\" && bits >= 0);\n        var h;\n        if (hint) {\n          h = (hint - (hint % 26)) / 26;\n        } else {\n          h = 0;\n        }\n        var r = bits % 26;\n        var s = Math.min((bits - r) / 26, this.length);\n        var mask = 67108863 ^ ((67108863 >>> r) << r);\n        var maskedWords = extended;\n        h -= s;\n        h = Math.max(0, h);\n        if (maskedWords) {\n          for (var i = 0; i < s; i++) {\n            maskedWords.words[i] = this.words[i];\n          }\n          maskedWords.length = s;\n        }\n        if (s === 0) {\n        } else if (this.length > s) {\n          this.length -= s;\n          for (i = 0; i < this.length; i++) {\n            this.words[i] = this.words[i + s];\n          }\n        } else {\n          this.words[0] = 0;\n          this.length = 1;\n        }\n        var carry = 0;\n        for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n          var word = this.words[i] | 0;\n          this.words[i] = (carry << (26 - r)) | (word >>> r);\n          carry = word & mask;\n        }\n        if (maskedWords && carry !== 0) {\n          maskedWords.words[maskedWords.length++] = carry;\n        }\n        if (this.length === 0) {\n          this.words[0] = 0;\n          this.length = 1;\n        }\n        return this.strip();\n      };\n      BN.prototype.ishrn = function ishrn(bits, hint, extended) {\n        assert(this.negative === 0);\n        return this.iushrn(bits, hint, extended);\n      };\n      BN.prototype.shln = function shln(bits) {\n        return this.clone().ishln(bits);\n      };\n      BN.prototype.ushln = function ushln(bits) {\n        return this.clone().iushln(bits);\n      };\n      BN.prototype.shrn = function shrn(bits) {\n        return this.clone().ishrn(bits);\n      };\n      BN.prototype.ushrn = function ushrn(bits) {\n        return this.clone().iushrn(bits);\n      };\n      BN.prototype.testn = function testn(bit) {\n        assert(typeof bit === \"number\" && bit >= 0);\n        var r = bit % 26;\n        var s = (bit - r) / 26;\n        var q = 1 << r;\n        if (this.length <= s) return false;\n        var w = this.words[s];\n        return !!(w & q);\n      };\n      BN.prototype.imaskn = function imaskn(bits) {\n        assert(typeof bits === \"number\" && bits >= 0);\n        var r = bits % 26;\n        var s = (bits - r) / 26;\n        assert(this.negative === 0, \"imaskn works only with positive numbers\");\n        if (this.length <= s) {\n          return this;\n        }\n        if (r !== 0) {\n          s++;\n        }\n        this.length = Math.min(s, this.length);\n        if (r !== 0) {\n          var mask = 67108863 ^ ((67108863 >>> r) << r);\n          this.words[this.length - 1] &= mask;\n        }\n        return this.strip();\n      };\n      BN.prototype.maskn = function maskn(bits) {\n        return this.clone().imaskn(bits);\n      };\n      BN.prototype.iaddn = function iaddn(num) {\n        assert(typeof num === \"number\");\n        assert(num < 67108864);\n        if (num < 0) return this.isubn(-num);\n        if (this.negative !== 0) {\n          if (this.length === 1 && (this.words[0] | 0) < num) {\n            this.words[0] = num - (this.words[0] | 0);\n            this.negative = 0;\n            return this;\n          }\n          this.negative = 0;\n          this.isubn(num);\n          this.negative = 1;\n          return this;\n        }\n        return this._iaddn(num);\n      };\n      BN.prototype._iaddn = function _iaddn(num) {\n        this.words[0] += num;\n        for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {\n          this.words[i] -= 67108864;\n          if (i === this.length - 1) {\n            this.words[i + 1] = 1;\n          } else {\n            this.words[i + 1]++;\n          }\n        }\n        this.length = Math.max(this.length, i + 1);\n        return this;\n      };\n      BN.prototype.isubn = function isubn(num) {\n        assert(typeof num === \"number\");\n        assert(num < 67108864);\n        if (num < 0) return this.iaddn(-num);\n        if (this.negative !== 0) {\n          this.negative = 0;\n          this.iaddn(num);\n          this.negative = 1;\n          return this;\n        }\n        this.words[0] -= num;\n        if (this.length === 1 && this.words[0] < 0) {\n          this.words[0] = -this.words[0];\n          this.negative = 1;\n        } else {\n          for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n            this.words[i] += 67108864;\n            this.words[i + 1] -= 1;\n          }\n        }\n        return this.strip();\n      };\n      BN.prototype.addn = function addn(num) {\n        return this.clone().iaddn(num);\n      };\n      BN.prototype.subn = function subn(num) {\n        return this.clone().isubn(num);\n      };\n      BN.prototype.iabs = function iabs() {\n        this.negative = 0;\n        return this;\n      };\n      BN.prototype.abs = function abs() {\n        return this.clone().iabs();\n      };\n      BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {\n        var len = num.length + shift;\n        var i;\n        this._expand(len);\n        var w;\n        var carry = 0;\n        for (i = 0; i < num.length; i++) {\n          w = (this.words[i + shift] | 0) + carry;\n          var right = (num.words[i] | 0) * mul;\n          w -= right & 67108863;\n          carry = (w >> 26) - ((right / 67108864) | 0);\n          this.words[i + shift] = w & 67108863;\n        }\n        for (; i < this.length - shift; i++) {\n          w = (this.words[i + shift] | 0) + carry;\n          carry = w >> 26;\n          this.words[i + shift] = w & 67108863;\n        }\n        if (carry === 0) return this.strip();\n        assert(carry === -1);\n        carry = 0;\n        for (i = 0; i < this.length; i++) {\n          w = -(this.words[i] | 0) + carry;\n          carry = w >> 26;\n          this.words[i] = w & 67108863;\n        }\n        this.negative = 1;\n        return this.strip();\n      };\n      BN.prototype._wordDiv = function _wordDiv(num, mode) {\n        var shift = this.length - num.length;\n        var a = this.clone();\n        var b = num;\n        var bhi = b.words[b.length - 1] | 0;\n        var bhiBits = this._countBits(bhi);\n        shift = 26 - bhiBits;\n        if (shift !== 0) {\n          b = b.ushln(shift);\n          a.iushln(shift);\n          bhi = b.words[b.length - 1] | 0;\n        }\n        var m = a.length - b.length;\n        var q;\n        if (mode !== \"mod\") {\n          q = new BN(null);\n          q.length = m + 1;\n          q.words = new Array(q.length);\n          for (var i = 0; i < q.length; i++) {\n            q.words[i] = 0;\n          }\n        }\n        var diff = a.clone()._ishlnsubmul(b, 1, m);\n        if (diff.negative === 0) {\n          a = diff;\n          if (q) {\n            q.words[m] = 1;\n          }\n        }\n        for (var j = m - 1; j >= 0; j--) {\n          var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);\n          qj = Math.min((qj / bhi) | 0, 67108863);\n          a._ishlnsubmul(b, qj, j);\n          while (a.negative !== 0) {\n            qj--;\n            a.negative = 0;\n            a._ishlnsubmul(b, 1, j);\n            if (!a.isZero()) {\n              a.negative ^= 1;\n            }\n          }\n          if (q) {\n            q.words[j] = qj;\n          }\n        }\n        if (q) {\n          q.strip();\n        }\n        a.strip();\n        if (mode !== \"div\" && shift !== 0) {\n          a.iushrn(shift);\n        }\n        return {\n          div: q || null,\n          mod: a,\n        };\n      };\n      BN.prototype.divmod = function divmod(num, mode, positive) {\n        assert(!num.isZero());\n        if (this.isZero()) {\n          return {\n            div: new BN(0),\n            mod: new BN(0),\n          };\n        }\n        var div, mod, res;\n        if (this.negative !== 0 && num.negative === 0) {\n          res = this.neg().divmod(num, mode);\n          if (mode !== \"mod\") {\n            div = res.div.neg();\n          }\n          if (mode !== \"div\") {\n            mod = res.mod.neg();\n            if (positive && mod.negative !== 0) {\n              mod.iadd(num);\n            }\n          }\n          return {\n            div,\n            mod,\n          };\n        }\n        if (this.negative === 0 && num.negative !== 0) {\n          res = this.divmod(num.neg(), mode);\n          if (mode !== \"mod\") {\n            div = res.div.neg();\n          }\n          return {\n            div,\n            mod: res.mod,\n          };\n        }\n        if ((this.negative & num.negative) !== 0) {\n          res = this.neg().divmod(num.neg(), mode);\n          if (mode !== \"div\") {\n            mod = res.mod.neg();\n            if (positive && mod.negative !== 0) {\n              mod.isub(num);\n            }\n          }\n          return {\n            div: res.div,\n            mod,\n          };\n        }\n        if (num.length > this.length || this.cmp(num) < 0) {\n          return {\n            div: new BN(0),\n            mod: this,\n          };\n        }\n        if (num.length === 1) {\n          if (mode === \"div\") {\n            return {\n              div: this.divn(num.words[0]),\n              mod: null,\n            };\n          }\n          if (mode === \"mod\") {\n            return {\n              div: null,\n              mod: new BN(this.modn(num.words[0])),\n            };\n          }\n          return {\n            div: this.divn(num.words[0]),\n            mod: new BN(this.modn(num.words[0])),\n          };\n        }\n        return this._wordDiv(num, mode);\n      };\n      BN.prototype.div = function div(num) {\n        return this.divmod(num, \"div\", false).div;\n      };\n      BN.prototype.mod = function mod(num) {\n        return this.divmod(num, \"mod\", false).mod;\n      };\n      BN.prototype.umod = function umod(num) {\n        return this.divmod(num, \"mod\", true).mod;\n      };\n      BN.prototype.divRound = function divRound(num) {\n        var dm = this.divmod(num);\n        if (dm.mod.isZero()) return dm.div;\n        var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n        var half = num.ushrn(1);\n        var r2 = num.andln(1);\n        var cmp = mod.cmp(half);\n        if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n        return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n      };\n      BN.prototype.modn = function modn(num) {\n        assert(num <= 67108863);\n        var p = (1 << 26) % num;\n        var acc = 0;\n        for (var i = this.length - 1; i >= 0; i--) {\n          acc = (p * acc + (this.words[i] | 0)) % num;\n        }\n        return acc;\n      };\n      BN.prototype.idivn = function idivn(num) {\n        assert(num <= 67108863);\n        var carry = 0;\n        for (var i = this.length - 1; i >= 0; i--) {\n          var w = (this.words[i] | 0) + carry * 67108864;\n          this.words[i] = (w / num) | 0;\n          carry = w % num;\n        }\n        return this.strip();\n      };\n      BN.prototype.divn = function divn(num) {\n        return this.clone().idivn(num);\n      };\n      BN.prototype.egcd = function egcd(p) {\n        assert(p.negative === 0);\n        assert(!p.isZero());\n        var x = this;\n        var y = p.clone();\n        if (x.negative !== 0) {\n          x = x.umod(p);\n        } else {\n          x = x.clone();\n        }\n        var A = new BN(1);\n        var B = new BN(0);\n        var C = new BN(0);\n        var D = new BN(1);\n        var g = 0;\n        while (x.isEven() && y.isEven()) {\n          x.iushrn(1);\n          y.iushrn(1);\n          ++g;\n        }\n        var yp = y.clone();\n        var xp = x.clone();\n        while (!x.isZero()) {\n          for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n          if (i > 0) {\n            x.iushrn(i);\n            while (i-- > 0) {\n              if (A.isOdd() || B.isOdd()) {\n                A.iadd(yp);\n                B.isub(xp);\n              }\n              A.iushrn(1);\n              B.iushrn(1);\n            }\n          }\n          for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n          if (j > 0) {\n            y.iushrn(j);\n            while (j-- > 0) {\n              if (C.isOdd() || D.isOdd()) {\n                C.iadd(yp);\n                D.isub(xp);\n              }\n              C.iushrn(1);\n              D.iushrn(1);\n            }\n          }\n          if (x.cmp(y) >= 0) {\n            x.isub(y);\n            A.isub(C);\n            B.isub(D);\n          } else {\n            y.isub(x);\n            C.isub(A);\n            D.isub(B);\n          }\n        }\n        return {\n          a: C,\n          b: D,\n          gcd: y.iushln(g),\n        };\n      };\n      BN.prototype._invmp = function _invmp(p) {\n        assert(p.negative === 0);\n        assert(!p.isZero());\n        var a = this;\n        var b = p.clone();\n        if (a.negative !== 0) {\n          a = a.umod(p);\n        } else {\n          a = a.clone();\n        }\n        var x1 = new BN(1);\n        var x2 = new BN(0);\n        var delta = b.clone();\n        while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n          for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n          if (i > 0) {\n            a.iushrn(i);\n            while (i-- > 0) {\n              if (x1.isOdd()) {\n                x1.iadd(delta);\n              }\n              x1.iushrn(1);\n            }\n          }\n          for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n          if (j > 0) {\n            b.iushrn(j);\n            while (j-- > 0) {\n              if (x2.isOdd()) {\n                x2.iadd(delta);\n              }\n              x2.iushrn(1);\n            }\n          }\n          if (a.cmp(b) >= 0) {\n            a.isub(b);\n            x1.isub(x2);\n          } else {\n            b.isub(a);\n            x2.isub(x1);\n          }\n        }\n        var res;\n        if (a.cmpn(1) === 0) {\n          res = x1;\n        } else {\n          res = x2;\n        }\n        if (res.cmpn(0) < 0) {\n          res.iadd(p);\n        }\n        return res;\n      };\n      BN.prototype.gcd = function gcd(num) {\n        if (this.isZero()) return num.abs();\n        if (num.isZero()) return this.abs();\n        var a = this.clone();\n        var b = num.clone();\n        a.negative = 0;\n        b.negative = 0;\n        for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n          a.iushrn(1);\n          b.iushrn(1);\n        }\n        do {\n          while (a.isEven()) {\n            a.iushrn(1);\n          }\n          while (b.isEven()) {\n            b.iushrn(1);\n          }\n          var r = a.cmp(b);\n          if (r < 0) {\n            var t = a;\n            a = b;\n            b = t;\n          } else if (r === 0 || b.cmpn(1) === 0) {\n            break;\n          }\n          a.isub(b);\n        } while (true);\n        return b.iushln(shift);\n      };\n      BN.prototype.invm = function invm(num) {\n        return this.egcd(num).a.umod(num);\n      };\n      BN.prototype.isEven = function isEven() {\n        return (this.words[0] & 1) === 0;\n      };\n      BN.prototype.isOdd = function isOdd() {\n        return (this.words[0] & 1) === 1;\n      };\n      BN.prototype.andln = function andln(num) {\n        return this.words[0] & num;\n      };\n      BN.prototype.bincn = function bincn(bit) {\n        assert(typeof bit === \"number\");\n        var r = bit % 26;\n        var s = (bit - r) / 26;\n        var q = 1 << r;\n        if (this.length <= s) {\n          this._expand(s + 1);\n          this.words[s] |= q;\n          return this;\n        }\n        var carry = q;\n        for (var i = s; carry !== 0 && i < this.length; i++) {\n          var w = this.words[i] | 0;\n          w += carry;\n          carry = w >>> 26;\n          w &= 67108863;\n          this.words[i] = w;\n        }\n        if (carry !== 0) {\n          this.words[i] = carry;\n          this.length++;\n        }\n        return this;\n      };\n      BN.prototype.isZero = function isZero() {\n        return this.length === 1 && this.words[0] === 0;\n      };\n      BN.prototype.cmpn = function cmpn(num) {\n        var negative = num < 0;\n        if (this.negative !== 0 && !negative) return -1;\n        if (this.negative === 0 && negative) return 1;\n        this.strip();\n        var res;\n        if (this.length > 1) {\n          res = 1;\n        } else {\n          if (negative) {\n            num = -num;\n          }\n          assert(num <= 67108863, \"Number is too big\");\n          var w = this.words[0] | 0;\n          res = w === num ? 0 : w < num ? -1 : 1;\n        }\n        if (this.negative !== 0) return -res | 0;\n        return res;\n      };\n      BN.prototype.cmp = function cmp(num) {\n        if (this.negative !== 0 && num.negative === 0) return -1;\n        if (this.negative === 0 && num.negative !== 0) return 1;\n        var res = this.ucmp(num);\n        if (this.negative !== 0) return -res | 0;\n        return res;\n      };\n      BN.prototype.ucmp = function ucmp(num) {\n        if (this.length > num.length) return 1;\n        if (this.length < num.length) return -1;\n        var res = 0;\n        for (var i = this.length - 1; i >= 0; i--) {\n          var a = this.words[i] | 0;\n          var b = num.words[i] | 0;\n          if (a === b) continue;\n          if (a < b) {\n            res = -1;\n          } else if (a > b) {\n            res = 1;\n          }\n          break;\n        }\n        return res;\n      };\n      BN.prototype.gtn = function gtn(num) {\n        return this.cmpn(num) === 1;\n      };\n      BN.prototype.gt = function gt(num) {\n        return this.cmp(num) === 1;\n      };\n      BN.prototype.gten = function gten(num) {\n        return this.cmpn(num) >= 0;\n      };\n      BN.prototype.gte = function gte(num) {\n        return this.cmp(num) >= 0;\n      };\n      BN.prototype.ltn = function ltn(num) {\n        return this.cmpn(num) === -1;\n      };\n      BN.prototype.lt = function lt(num) {\n        return this.cmp(num) === -1;\n      };\n      BN.prototype.lten = function lten(num) {\n        return this.cmpn(num) <= 0;\n      };\n      BN.prototype.lte = function lte(num) {\n        return this.cmp(num) <= 0;\n      };\n      BN.prototype.eqn = function eqn(num) {\n        return this.cmpn(num) === 0;\n      };\n      BN.prototype.eq = function eq(num) {\n        return this.cmp(num) === 0;\n      };\n      BN.red = function red(num) {\n        return new Red(num);\n      };\n      BN.prototype.toRed = function toRed(ctx) {\n        assert(!this.red, \"Already a number in reduction context\");\n        assert(this.negative === 0, \"red works only with positives\");\n        return ctx.convertTo(this)._forceRed(ctx);\n      };\n      BN.prototype.fromRed = function fromRed() {\n        assert(this.red, \"fromRed works only with numbers in reduction context\");\n        return this.red.convertFrom(this);\n      };\n      BN.prototype._forceRed = function _forceRed(ctx) {\n        this.red = ctx;\n        return this;\n      };\n      BN.prototype.forceRed = function forceRed(ctx) {\n        assert(!this.red, \"Already a number in reduction context\");\n        return this._forceRed(ctx);\n      };\n      BN.prototype.redAdd = function redAdd(num) {\n        assert(this.red, \"redAdd works only with red numbers\");\n        return this.red.add(this, num);\n      };\n      BN.prototype.redIAdd = function redIAdd(num) {\n        assert(this.red, \"redIAdd works only with red numbers\");\n        return this.red.iadd(this, num);\n      };\n      BN.prototype.redSub = function redSub(num) {\n        assert(this.red, \"redSub works only with red numbers\");\n        return this.red.sub(this, num);\n      };\n      BN.prototype.redISub = function redISub(num) {\n        assert(this.red, \"redISub works only with red numbers\");\n        return this.red.isub(this, num);\n      };\n      BN.prototype.redShl = function redShl(num) {\n        assert(this.red, \"redShl works only with red numbers\");\n        return this.red.shl(this, num);\n      };\n      BN.prototype.redMul = function redMul(num) {\n        assert(this.red, \"redMul works only with red numbers\");\n        this.red._verify2(this, num);\n        return this.red.mul(this, num);\n      };\n      BN.prototype.redIMul = function redIMul(num) {\n        assert(this.red, \"redMul works only with red numbers\");\n        this.red._verify2(this, num);\n        return this.red.imul(this, num);\n      };\n      BN.prototype.redSqr = function redSqr() {\n        assert(this.red, \"redSqr works only with red numbers\");\n        this.red._verify1(this);\n        return this.red.sqr(this);\n      };\n      BN.prototype.redISqr = function redISqr() {\n        assert(this.red, \"redISqr works only with red numbers\");\n        this.red._verify1(this);\n        return this.red.isqr(this);\n      };\n      BN.prototype.redSqrt = function redSqrt() {\n        assert(this.red, \"redSqrt works only with red numbers\");\n        this.red._verify1(this);\n        return this.red.sqrt(this);\n      };\n      BN.prototype.redInvm = function redInvm() {\n        assert(this.red, \"redInvm works only with red numbers\");\n        this.red._verify1(this);\n        return this.red.invm(this);\n      };\n      BN.prototype.redNeg = function redNeg() {\n        assert(this.red, \"redNeg works only with red numbers\");\n        this.red._verify1(this);\n        return this.red.neg(this);\n      };\n      BN.prototype.redPow = function redPow(num) {\n        assert(this.red && !num.red, \"redPow(normalNum)\");\n        this.red._verify1(this);\n        return this.red.pow(this, num);\n      };\n      var primes = {\n        k256: null,\n        p224: null,\n        p192: null,\n        p25519: null,\n      };\n      function MPrime(name, p) {\n        this.name = name;\n        this.p = new BN(p, 16);\n        this.n = this.p.bitLength();\n        this.k = new BN(1).iushln(this.n).isub(this.p);\n        this.tmp = this._tmp();\n      }\n      MPrime.prototype._tmp = function _tmp() {\n        var tmp = new BN(null);\n        tmp.words = new Array(Math.ceil(this.n / 13));\n        return tmp;\n      };\n      MPrime.prototype.ireduce = function ireduce(num) {\n        var r = num;\n        var rlen;\n        do {\n          this.split(r, this.tmp);\n          r = this.imulK(r);\n          r = r.iadd(this.tmp);\n          rlen = r.bitLength();\n        } while (rlen > this.n);\n        var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n        if (cmp === 0) {\n          r.words[0] = 0;\n          r.length = 1;\n        } else if (cmp > 0) {\n          r.isub(this.p);\n        } else {\n          if (r.strip !== void 0) {\n            r.strip();\n          } else {\n            r._strip();\n          }\n        }\n        return r;\n      };\n      MPrime.prototype.split = function split(input, out) {\n        input.iushrn(this.n, 0, out);\n      };\n      MPrime.prototype.imulK = function imulK(num) {\n        return num.imul(this.k);\n      };\n      function K256() {\n        MPrime.call(this, \"k256\", \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\");\n      }\n      inherits(K256, MPrime);\n      K256.prototype.split = function split(input, output) {\n        var mask = 4194303;\n        var outLen = Math.min(input.length, 9);\n        for (var i = 0; i < outLen; i++) {\n          output.words[i] = input.words[i];\n        }\n        output.length = outLen;\n        if (input.length <= 9) {\n          input.words[0] = 0;\n          input.length = 1;\n          return;\n        }\n        var prev = input.words[9];\n        output.words[output.length++] = prev & mask;\n        for (i = 10; i < input.length; i++) {\n          var next = input.words[i] | 0;\n          input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n          prev = next;\n        }\n        prev >>>= 22;\n        input.words[i - 10] = prev;\n        if (prev === 0 && input.length > 10) {\n          input.length -= 10;\n        } else {\n          input.length -= 9;\n        }\n      };\n      K256.prototype.imulK = function imulK(num) {\n        num.words[num.length] = 0;\n        num.words[num.length + 1] = 0;\n        num.length += 2;\n        var lo = 0;\n        for (var i = 0; i < num.length; i++) {\n          var w = num.words[i] | 0;\n          lo += w * 977;\n          num.words[i] = lo & 67108863;\n          lo = w * 64 + ((lo / 67108864) | 0);\n        }\n        if (num.words[num.length - 1] === 0) {\n          num.length--;\n          if (num.words[num.length - 1] === 0) {\n            num.length--;\n          }\n        }\n        return num;\n      };\n      function P224() {\n        MPrime.call(this, \"p224\", \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\");\n      }\n      inherits(P224, MPrime);\n      function P192() {\n        MPrime.call(this, \"p192\", \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\");\n      }\n      inherits(P192, MPrime);\n      function P25519() {\n        MPrime.call(this, \"25519\", \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\");\n      }\n      inherits(P25519, MPrime);\n      P25519.prototype.imulK = function imulK(num) {\n        var carry = 0;\n        for (var i = 0; i < num.length; i++) {\n          var hi = (num.words[i] | 0) * 19 + carry;\n          var lo = hi & 67108863;\n          hi >>>= 26;\n          num.words[i] = lo;\n          carry = hi;\n        }\n        if (carry !== 0) {\n          num.words[num.length++] = carry;\n        }\n        return num;\n      };\n      BN._prime = function prime(name) {\n        if (primes[name]) return primes[name];\n        var prime2;\n        if (name === \"k256\") {\n          prime2 = new K256();\n        } else if (name === \"p224\") {\n          prime2 = new P224();\n        } else if (name === \"p192\") {\n          prime2 = new P192();\n        } else if (name === \"p25519\") {\n          prime2 = new P25519();\n        } else {\n          throw new Error(\"Unknown prime \" + name);\n        }\n        primes[name] = prime2;\n        return prime2;\n      };\n      function Red(m) {\n        if (typeof m === \"string\") {\n          var prime = BN._prime(m);\n          this.m = prime.p;\n          this.prime = prime;\n        } else {\n          assert(m.gtn(1), \"modulus must be greater than 1\");\n          this.m = m;\n          this.prime = null;\n        }\n      }\n      Red.prototype._verify1 = function _verify1(a) {\n        assert(a.negative === 0, \"red works only with positives\");\n        assert(a.red, \"red works only with red numbers\");\n      };\n      Red.prototype._verify2 = function _verify2(a, b) {\n        assert((a.negative | b.negative) === 0, \"red works only with positives\");\n        assert(a.red && a.red === b.red, \"red works only with red numbers\");\n      };\n      Red.prototype.imod = function imod(a) {\n        if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n        return a.umod(this.m)._forceRed(this);\n      };\n      Red.prototype.neg = function neg(a) {\n        if (a.isZero()) {\n          return a.clone();\n        }\n        return this.m.sub(a)._forceRed(this);\n      };\n      Red.prototype.add = function add(a, b) {\n        this._verify2(a, b);\n        var res = a.add(b);\n        if (res.cmp(this.m) >= 0) {\n          res.isub(this.m);\n        }\n        return res._forceRed(this);\n      };\n      Red.prototype.iadd = function iadd(a, b) {\n        this._verify2(a, b);\n        var res = a.iadd(b);\n        if (res.cmp(this.m) >= 0) {\n          res.isub(this.m);\n        }\n        return res;\n      };\n      Red.prototype.sub = function sub(a, b) {\n        this._verify2(a, b);\n        var res = a.sub(b);\n        if (res.cmpn(0) < 0) {\n          res.iadd(this.m);\n        }\n        return res._forceRed(this);\n      };\n      Red.prototype.isub = function isub(a, b) {\n        this._verify2(a, b);\n        var res = a.isub(b);\n        if (res.cmpn(0) < 0) {\n          res.iadd(this.m);\n        }\n        return res;\n      };\n      Red.prototype.shl = function shl(a, num) {\n        this._verify1(a);\n        return this.imod(a.ushln(num));\n      };\n      Red.prototype.imul = function imul(a, b) {\n        this._verify2(a, b);\n        return this.imod(a.imul(b));\n      };\n      Red.prototype.mul = function mul(a, b) {\n        this._verify2(a, b);\n        return this.imod(a.mul(b));\n      };\n      Red.prototype.isqr = function isqr(a) {\n        return this.imul(a, a.clone());\n      };\n      Red.prototype.sqr = function sqr(a) {\n        return this.mul(a, a);\n      };\n      Red.prototype.sqrt = function sqrt(a) {\n        if (a.isZero()) return a.clone();\n        var mod3 = this.m.andln(3);\n        assert(mod3 % 2 === 1);\n        if (mod3 === 3) {\n          var pow = this.m.add(new BN(1)).iushrn(2);\n          return this.pow(a, pow);\n        }\n        var q = this.m.subn(1);\n        var s = 0;\n        while (!q.isZero() && q.andln(1) === 0) {\n          s++;\n          q.iushrn(1);\n        }\n        assert(!q.isZero());\n        var one = new BN(1).toRed(this);\n        var nOne = one.redNeg();\n        var lpow = this.m.subn(1).iushrn(1);\n        var z = this.m.bitLength();\n        z = new BN(2 * z * z).toRed(this);\n        while (this.pow(z, lpow).cmp(nOne) !== 0) {\n          z.redIAdd(nOne);\n        }\n        var c = this.pow(z, q);\n        var r = this.pow(a, q.addn(1).iushrn(1));\n        var t = this.pow(a, q);\n        var m = s;\n        while (t.cmp(one) !== 0) {\n          var tmp = t;\n          for (var i = 0; tmp.cmp(one) !== 0; i++) {\n            tmp = tmp.redSqr();\n          }\n          assert(i < m);\n          var b = this.pow(c, new BN(1).iushln(m - i - 1));\n          r = r.redMul(b);\n          c = b.redSqr();\n          t = t.redMul(c);\n          m = i;\n        }\n        return r;\n      };\n      Red.prototype.invm = function invm(a) {\n        var inv = a._invmp(this.m);\n        if (inv.negative !== 0) {\n          inv.negative = 0;\n          return this.imod(inv).redNeg();\n        } else {\n          return this.imod(inv);\n        }\n      };\n      Red.prototype.pow = function pow(a, num) {\n        if (num.isZero()) return new BN(1).toRed(this);\n        if (num.cmpn(1) === 0) return a.clone();\n        var windowSize = 4;\n        var wnd = new Array(1 << windowSize);\n        wnd[0] = new BN(1).toRed(this);\n        wnd[1] = a;\n        for (var i = 2; i < wnd.length; i++) {\n          wnd[i] = this.mul(wnd[i - 1], a);\n        }\n        var res = wnd[0];\n        var current = 0;\n        var currentLen = 0;\n        var start = num.bitLength() % 26;\n        if (start === 0) {\n          start = 26;\n        }\n        for (i = num.length - 1; i >= 0; i--) {\n          var word = num.words[i];\n          for (var j = start - 1; j >= 0; j--) {\n            var bit = (word >> j) & 1;\n            if (res !== wnd[0]) {\n              res = this.sqr(res);\n            }\n            if (bit === 0 && current === 0) {\n              currentLen = 0;\n              continue;\n            }\n            current <<= 1;\n            current |= bit;\n            currentLen++;\n            if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n            res = this.mul(res, wnd[current]);\n            currentLen = 0;\n            current = 0;\n          }\n          start = 26;\n        }\n        return res;\n      };\n      Red.prototype.convertTo = function convertTo(num) {\n        var r = num.umod(this.m);\n        return r === num ? r.clone() : r;\n      };\n      Red.prototype.convertFrom = function convertFrom(num) {\n        var res = num.clone();\n        res.red = null;\n        return res;\n      };\n      BN.mont = function mont(num) {\n        return new Mont(num);\n      };\n      function Mont(m) {\n        Red.call(this, m);\n        this.shift = this.m.bitLength();\n        if (this.shift % 26 !== 0) {\n          this.shift += 26 - (this.shift % 26);\n        }\n        this.r = new BN(1).iushln(this.shift);\n        this.r2 = this.imod(this.r.sqr());\n        this.rinv = this.r._invmp(this.m);\n        this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n        this.minv = this.minv.umod(this.r);\n        this.minv = this.r.sub(this.minv);\n      }\n      inherits(Mont, Red);\n      Mont.prototype.convertTo = function convertTo(num) {\n        return this.imod(num.ushln(this.shift));\n      };\n      Mont.prototype.convertFrom = function convertFrom(num) {\n        var r = this.imod(num.mul(this.rinv));\n        r.red = null;\n        return r;\n      };\n      Mont.prototype.imul = function imul(a, b) {\n        if (a.isZero() || b.isZero()) {\n          a.words[0] = 0;\n          a.length = 1;\n          return a;\n        }\n        var t = a.imul(b);\n        var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n        var u = t.isub(c).iushrn(this.shift);\n        var res = u;\n        if (u.cmp(this.m) >= 0) {\n          res = u.isub(this.m);\n        } else if (u.cmpn(0) < 0) {\n          res = u.iadd(this.m);\n        }\n        return res._forceRed(this);\n      };\n      Mont.prototype.mul = function mul(a, b) {\n        if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n        var t = a.mul(b);\n        var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n        var u = t.isub(c).iushrn(this.shift);\n        var res = u;\n        if (u.cmp(this.m) >= 0) {\n          res = u.isub(this.m);\n        } else if (u.cmpn(0) < 0) {\n          res = u.iadd(this.m);\n        }\n        return res._forceRed(this);\n      };\n      Mont.prototype.invm = function invm(a) {\n        var res = this.imod(a._invmp(this.m).mul(this.r2));\n        return res._forceRed(this);\n      };\n    })(typeof module === \"undefined\" || module, exports);\n  },\n});\n\n// ../../node_modules/minimalistic-assert/index.js\nvar require_minimalistic_assert = __commonJS({\n  \"../../node_modules/minimalistic-assert/index.js\"(exports, module) {\n    module.exports = assert;\n    function assert(val, msg) {\n      if (!val) throw new Error(msg || \"Assertion failed\");\n    }\n    assert.equal = function assertEqual(l, r, msg) {\n      if (l != r) throw new Error(msg || \"Assertion failed: \" + l + \" != \" + r);\n    };\n  },\n});\n\n// ../../node_modules/minimalistic-crypto-utils/lib/utils.js\nvar require_utils = __commonJS({\n  \"../../node_modules/minimalistic-crypto-utils/lib/utils.js\"(exports) {\n    \"use strict\";\n    var utils = exports;\n    function toArray(msg, enc) {\n      if (Array.isArray(msg)) return msg.slice();\n      if (!msg) return [];\n      var res = [];\n      if (typeof msg !== \"string\") {\n        for (var i = 0; i < msg.length; i++) res[i] = msg[i] | 0;\n        return res;\n      }\n      if (enc === \"hex\") {\n        msg = msg.replace(/[^a-z0-9]+/gi, \"\");\n        if (msg.length % 2 !== 0) msg = \"0\" + msg;\n        for (var i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));\n      } else {\n        for (var i = 0; i < msg.length; i++) {\n          var c = msg.charCodeAt(i);\n          var hi = c >> 8;\n          var lo = c & 255;\n          if (hi) res.push(hi, lo);\n          else res.push(lo);\n        }\n      }\n      return res;\n    }\n    utils.toArray = toArray;\n    function zero2(word) {\n      if (word.length === 1) return \"0\" + word;\n      else return word;\n    }\n    utils.zero2 = zero2;\n    function toHex(msg) {\n      var res = \"\";\n      for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));\n      return res;\n    }\n    utils.toHex = toHex;\n    utils.encode = function encode(arr, enc) {\n      if (enc === \"hex\") return toHex(arr);\n      else return arr;\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/utils.js\nvar require_utils2 = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/utils.js\"(exports) {\n    \"use strict\";\n    var utils = exports;\n    var BN = require_bn();\n    var minAssert = require_minimalistic_assert();\n    var minUtils = require_utils();\n    utils.assert = minAssert;\n    utils.toArray = minUtils.toArray;\n    utils.zero2 = minUtils.zero2;\n    utils.toHex = minUtils.toHex;\n    utils.encode = minUtils.encode;\n    function getNAF(num, w, bits) {\n      var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n      var i;\n      for (i = 0; i < naf.length; i += 1) {\n        naf[i] = 0;\n      }\n      var ws = 1 << (w + 1);\n      var k = num.clone();\n      for (i = 0; i < naf.length; i++) {\n        var z;\n        var mod = k.andln(ws - 1);\n        if (k.isOdd()) {\n          if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod;\n          else z = mod;\n          k.isubn(z);\n        } else {\n          z = 0;\n        }\n        naf[i] = z;\n        k.iushrn(1);\n      }\n      return naf;\n    }\n    utils.getNAF = getNAF;\n    function getJSF(k1, k2) {\n      var jsf = [[], []];\n      k1 = k1.clone();\n      k2 = k2.clone();\n      var d1 = 0;\n      var d2 = 0;\n      var m8;\n      while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n        var m14 = (k1.andln(3) + d1) & 3;\n        var m24 = (k2.andln(3) + d2) & 3;\n        if (m14 === 3) m14 = -1;\n        if (m24 === 3) m24 = -1;\n        var u1;\n        if ((m14 & 1) === 0) {\n          u1 = 0;\n        } else {\n          m8 = (k1.andln(7) + d1) & 7;\n          if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14;\n          else u1 = m14;\n        }\n        jsf[0].push(u1);\n        var u2;\n        if ((m24 & 1) === 0) {\n          u2 = 0;\n        } else {\n          m8 = (k2.andln(7) + d2) & 7;\n          if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24;\n          else u2 = m24;\n        }\n        jsf[1].push(u2);\n        if (2 * d1 === u1 + 1) d1 = 1 - d1;\n        if (2 * d2 === u2 + 1) d2 = 1 - d2;\n        k1.iushrn(1);\n        k2.iushrn(1);\n      }\n      return jsf;\n    }\n    utils.getJSF = getJSF;\n    function cachedProperty(obj, name, computer) {\n      var key = \"_\" + name;\n      obj.prototype[name] = function cachedProperty2() {\n        return this[key] !== void 0 ? this[key] : (this[key] = computer.call(this));\n      };\n    }\n    utils.cachedProperty = cachedProperty;\n    function parseBytes(bytes) {\n      return typeof bytes === \"string\" ? utils.toArray(bytes, \"hex\") : bytes;\n    }\n    utils.parseBytes = parseBytes;\n    function intFromLE(bytes) {\n      return new BN(bytes, \"hex\", \"le\");\n    }\n    utils.intFromLE = intFromLE;\n  },\n});\n\n// (disabled):crypto\nvar require_crypto = __commonJS({\n  \"(disabled):crypto\"() {},\n});\n\n// ../../node_modules/brorand/index.js\nvar require_brorand = __commonJS({\n  \"../../node_modules/brorand/index.js\"(exports, module) {\n    var r;\n    module.exports = function rand(len) {\n      if (!r) r = new Rand(null);\n      return r.generate(len);\n    };\n    function Rand(rand) {\n      this.rand = rand;\n    }\n    module.exports.Rand = Rand;\n    Rand.prototype.generate = function generate(len) {\n      return this._rand(len);\n    };\n    Rand.prototype._rand = function _rand(n) {\n      if (this.rand.getBytes) return this.rand.getBytes(n);\n      var res = new Uint8Array(n);\n      for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte();\n      return res;\n    };\n    if (typeof self === \"object\") {\n      if (self.crypto && self.crypto.getRandomValues) {\n        Rand.prototype._rand = function _rand(n) {\n          var arr = new Uint8Array(n);\n          self.crypto.getRandomValues(arr);\n          return arr;\n        };\n      } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n        Rand.prototype._rand = function _rand(n) {\n          var arr = new Uint8Array(n);\n          self.msCrypto.getRandomValues(arr);\n          return arr;\n        };\n      } else if (typeof window === \"object\") {\n        Rand.prototype._rand = function () {\n          throw new Error(\"Not implemented yet\");\n        };\n      }\n    } else {\n      try {\n        crypto = require_crypto();\n        if (typeof crypto.randomBytes !== \"function\") throw new Error(\"Not supported\");\n        Rand.prototype._rand = function _rand(n) {\n          return crypto.randomBytes(n);\n        };\n      } catch (e) {}\n    }\n    var crypto;\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/curve/base.js\nvar require_base = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/curve/base.js\"(exports, module) {\n    \"use strict\";\n    var BN = require_bn();\n    var utils = require_utils2();\n    var getNAF = utils.getNAF;\n    var getJSF = utils.getJSF;\n    var assert = utils.assert;\n    function BaseCurve(type, conf) {\n      this.type = type;\n      this.p = new BN(conf.p, 16);\n      this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n      this.zero = new BN(0).toRed(this.red);\n      this.one = new BN(1).toRed(this.red);\n      this.two = new BN(2).toRed(this.red);\n      this.n = conf.n && new BN(conf.n, 16);\n      this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n      this._wnafT1 = new Array(4);\n      this._wnafT2 = new Array(4);\n      this._wnafT3 = new Array(4);\n      this._wnafT4 = new Array(4);\n      this._bitLength = this.n ? this.n.bitLength() : 0;\n      var adjustCount = this.n && this.p.div(this.n);\n      if (!adjustCount || adjustCount.cmpn(100) > 0) {\n        this.redN = null;\n      } else {\n        this._maxwellTrick = true;\n        this.redN = this.n.toRed(this.red);\n      }\n    }\n    module.exports = BaseCurve;\n    BaseCurve.prototype.point = function point() {\n      throw new Error(\"Not implemented\");\n    };\n    BaseCurve.prototype.validate = function validate() {\n      throw new Error(\"Not implemented\");\n    };\n    BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n      assert(p.precomputed);\n      var doubles = p._getDoubles();\n      var naf = getNAF(k, 1, this._bitLength);\n      var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n      I /= 3;\n      var repr = [];\n      var j;\n      var nafW;\n      for (j = 0; j < naf.length; j += doubles.step) {\n        nafW = 0;\n        for (var l = j + doubles.step - 1; l >= j; l--) nafW = (nafW << 1) + naf[l];\n        repr.push(nafW);\n      }\n      var a = this.jpoint(null, null, null);\n      var b = this.jpoint(null, null, null);\n      for (var i = I; i > 0; i--) {\n        for (j = 0; j < repr.length; j++) {\n          nafW = repr[j];\n          if (nafW === i) b = b.mixedAdd(doubles.points[j]);\n          else if (nafW === -i) b = b.mixedAdd(doubles.points[j].neg());\n        }\n        a = a.add(b);\n      }\n      return a.toP();\n    };\n    BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n      var w = 4;\n      var nafPoints = p._getNAFPoints(w);\n      w = nafPoints.wnd;\n      var wnd = nafPoints.points;\n      var naf = getNAF(k, w, this._bitLength);\n      var acc = this.jpoint(null, null, null);\n      for (var i = naf.length - 1; i >= 0; i--) {\n        for (var l = 0; i >= 0 && naf[i] === 0; i--) l++;\n        if (i >= 0) l++;\n        acc = acc.dblp(l);\n        if (i < 0) break;\n        var z = naf[i];\n        assert(z !== 0);\n        if (p.type === \"affine\") {\n          if (z > 0) acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n          else acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n        } else {\n          if (z > 0) acc = acc.add(wnd[(z - 1) >> 1]);\n          else acc = acc.add(wnd[(-z - 1) >> 1].neg());\n        }\n      }\n      return p.type === \"affine\" ? acc.toP() : acc;\n    };\n    BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) {\n      var wndWidth = this._wnafT1;\n      var wnd = this._wnafT2;\n      var naf = this._wnafT3;\n      var max = 0;\n      var i;\n      var j;\n      var p;\n      for (i = 0; i < len; i++) {\n        p = points[i];\n        var nafPoints = p._getNAFPoints(defW);\n        wndWidth[i] = nafPoints.wnd;\n        wnd[i] = nafPoints.points;\n      }\n      for (i = len - 1; i >= 1; i -= 2) {\n        var a = i - 1;\n        var b = i;\n        if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n          naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n          naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n          max = Math.max(naf[a].length, max);\n          max = Math.max(naf[b].length, max);\n          continue;\n        }\n        var comb = [\n          points[a],\n          /* 1 */\n          null,\n          /* 3 */\n          null,\n          /* 5 */\n          points[b],\n          /* 7 */\n        ];\n        if (points[a].y.cmp(points[b].y) === 0) {\n          comb[1] = points[a].add(points[b]);\n          comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n        } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n          comb[1] = points[a].toJ().mixedAdd(points[b]);\n          comb[2] = points[a].add(points[b].neg());\n        } else {\n          comb[1] = points[a].toJ().mixedAdd(points[b]);\n          comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n        }\n        var index = [\n          -3 /* -1 -1 */, -1 /* -1 0 */, -5 /* -1 1 */, -7 /* 0 -1 */, 0 /* 0 0 */, 7 /* 0 1 */, 5 /* 1 -1 */,\n          1 /* 1 0 */, 3,\n          /* 1 1 */\n        ];\n        var jsf = getJSF(coeffs[a], coeffs[b]);\n        max = Math.max(jsf[0].length, max);\n        naf[a] = new Array(max);\n        naf[b] = new Array(max);\n        for (j = 0; j < max; j++) {\n          var ja = jsf[0][j] | 0;\n          var jb = jsf[1][j] | 0;\n          naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n          naf[b][j] = 0;\n          wnd[a] = comb;\n        }\n      }\n      var acc = this.jpoint(null, null, null);\n      var tmp = this._wnafT4;\n      for (i = max; i >= 0; i--) {\n        var k = 0;\n        while (i >= 0) {\n          var zero = true;\n          for (j = 0; j < len; j++) {\n            tmp[j] = naf[j][i] | 0;\n            if (tmp[j] !== 0) zero = false;\n          }\n          if (!zero) break;\n          k++;\n          i--;\n        }\n        if (i >= 0) k++;\n        acc = acc.dblp(k);\n        if (i < 0) break;\n        for (j = 0; j < len; j++) {\n          var z = tmp[j];\n          p;\n          if (z === 0) continue;\n          else if (z > 0) p = wnd[j][(z - 1) >> 1];\n          else if (z < 0) p = wnd[j][(-z - 1) >> 1].neg();\n          if (p.type === \"affine\") acc = acc.mixedAdd(p);\n          else acc = acc.add(p);\n        }\n      }\n      for (i = 0; i < len; i++) wnd[i] = null;\n      if (jacobianResult) return acc;\n      else return acc.toP();\n    };\n    function BasePoint(curve, type) {\n      this.curve = curve;\n      this.type = type;\n      this.precomputed = null;\n    }\n    BaseCurve.BasePoint = BasePoint;\n    BasePoint.prototype.eq = function eq() {\n      throw new Error(\"Not implemented\");\n    };\n    BasePoint.prototype.validate = function validate() {\n      return this.curve.validate(this);\n    };\n    BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n      bytes = utils.toArray(bytes, enc);\n      var len = this.p.byteLength();\n      if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {\n        if (bytes[0] === 6) assert(bytes[bytes.length - 1] % 2 === 0);\n        else if (bytes[0] === 7) assert(bytes[bytes.length - 1] % 2 === 1);\n        var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));\n        return res;\n      } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) {\n        return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);\n      }\n      throw new Error(\"Unknown point format\");\n    };\n    BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n      return this.encode(enc, true);\n    };\n    BasePoint.prototype._encode = function _encode(compact) {\n      var len = this.curve.p.byteLength();\n      var x = this.getX().toArray(\"be\", len);\n      if (compact) return [this.getY().isEven() ? 2 : 3].concat(x);\n      return [4].concat(x, this.getY().toArray(\"be\", len));\n    };\n    BasePoint.prototype.encode = function encode(enc, compact) {\n      return utils.encode(this._encode(compact), enc);\n    };\n    BasePoint.prototype.precompute = function precompute(power) {\n      if (this.precomputed) return this;\n      var precomputed = {\n        doubles: null,\n        naf: null,\n        beta: null,\n      };\n      precomputed.naf = this._getNAFPoints(8);\n      precomputed.doubles = this._getDoubles(4, power);\n      precomputed.beta = this._getBeta();\n      this.precomputed = precomputed;\n      return this;\n    };\n    BasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n      if (!this.precomputed) return false;\n      var doubles = this.precomputed.doubles;\n      if (!doubles) return false;\n      return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n    };\n    BasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n      if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;\n      var doubles = [this];\n      var acc = this;\n      for (var i = 0; i < power; i += step) {\n        for (var j = 0; j < step; j++) acc = acc.dbl();\n        doubles.push(acc);\n      }\n      return {\n        step,\n        points: doubles,\n      };\n    };\n    BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n      if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;\n      var res = [this];\n      var max = (1 << wnd) - 1;\n      var dbl = max === 1 ? null : this.dbl();\n      for (var i = 1; i < max; i++) res[i] = res[i - 1].add(dbl);\n      return {\n        wnd,\n        points: res,\n      };\n    };\n    BasePoint.prototype._getBeta = function _getBeta() {\n      return null;\n    };\n    BasePoint.prototype.dblp = function dblp(k) {\n      var r = this;\n      for (var i = 0; i < k; i++) r = r.dbl();\n      return r;\n    };\n  },\n});\n\n// ../../node_modules/has-symbols/shams.js\nvar require_shams = __commonJS({\n  \"../../node_modules/has-symbols/shams.js\"(exports, module) {\n    \"use strict\";\n    module.exports = function hasSymbols() {\n      if (typeof Symbol !== \"function\" || typeof Object.getOwnPropertySymbols !== \"function\") {\n        return false;\n      }\n      if (typeof Symbol.iterator === \"symbol\") {\n        return true;\n      }\n      var obj = {};\n      var sym = Symbol(\"test\");\n      var symObj = Object(sym);\n      if (typeof sym === \"string\") {\n        return false;\n      }\n      if (Object.prototype.toString.call(sym) !== \"[object Symbol]\") {\n        return false;\n      }\n      if (Object.prototype.toString.call(symObj) !== \"[object Symbol]\") {\n        return false;\n      }\n      var symVal = 42;\n      obj[sym] = symVal;\n      for (sym in obj) {\n        return false;\n      }\n      if (typeof Object.keys === \"function\" && Object.keys(obj).length !== 0) {\n        return false;\n      }\n      if (typeof Object.getOwnPropertyNames === \"function\" && Object.getOwnPropertyNames(obj).length !== 0) {\n        return false;\n      }\n      var syms = Object.getOwnPropertySymbols(obj);\n      if (syms.length !== 1 || syms[0] !== sym) {\n        return false;\n      }\n      if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {\n        return false;\n      }\n      if (typeof Object.getOwnPropertyDescriptor === \"function\") {\n        var descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n        if (descriptor.value !== symVal || descriptor.enumerable !== true) {\n          return false;\n        }\n      }\n      return true;\n    };\n  },\n});\n\n// ../../node_modules/has-tostringtag/shams.js\nvar require_shams2 = __commonJS({\n  \"../../node_modules/has-tostringtag/shams.js\"(exports, module) {\n    \"use strict\";\n    var hasSymbols = require_shams();\n    module.exports = function hasToStringTagShams() {\n      return hasSymbols() && !!Symbol.toStringTag;\n    };\n  },\n});\n\n// ../../node_modules/has-symbols/index.js\nvar require_has_symbols = __commonJS({\n  \"../../node_modules/has-symbols/index.js\"(exports, module) {\n    \"use strict\";\n    var origSymbol = typeof Symbol !== \"undefined\" && Symbol;\n    var hasSymbolSham = require_shams();\n    module.exports = function hasNativeSymbols() {\n      if (typeof origSymbol !== \"function\") {\n        return false;\n      }\n      if (typeof Symbol !== \"function\") {\n        return false;\n      }\n      if (typeof origSymbol(\"foo\") !== \"symbol\") {\n        return false;\n      }\n      if (typeof Symbol(\"bar\") !== \"symbol\") {\n        return false;\n      }\n      return hasSymbolSham();\n    };\n  },\n});\n\n// ../../node_modules/is-arguments/node_modules/function-bind/implementation.js\nvar require_implementation = __commonJS({\n  \"../../node_modules/is-arguments/node_modules/function-bind/implementation.js\"(exports, module) {\n    \"use strict\";\n    var ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\n    var slice = Array.prototype.slice;\n    var toStr = Object.prototype.toString;\n    var funcType = \"[object Function]\";\n    module.exports = function bind(that) {\n      var target = this;\n      if (typeof target !== \"function\" || toStr.call(target) !== funcType) {\n        throw new TypeError(ERROR_MESSAGE + target);\n      }\n      var args = slice.call(arguments, 1);\n      var bound;\n      var binder = function () {\n        if (this instanceof bound) {\n          var result = target.apply(this, args.concat(slice.call(arguments)));\n          if (Object(result) === result) {\n            return result;\n          }\n          return this;\n        } else {\n          return target.apply(that, args.concat(slice.call(arguments)));\n        }\n      };\n      var boundLength = Math.max(0, target.length - args.length);\n      var boundArgs = [];\n      for (var i = 0; i < boundLength; i++) {\n        boundArgs.push(\"$\" + i);\n      }\n      bound = Function(\n        \"binder\",\n        \"return function (\" + boundArgs.join(\",\") + \"){ return binder.apply(this,arguments); }\"\n      )(binder);\n      if (target.prototype) {\n        var Empty = function Empty2() {};\n        Empty.prototype = target.prototype;\n        bound.prototype = new Empty();\n        Empty.prototype = null;\n      }\n      return bound;\n    };\n  },\n});\n\n// ../../node_modules/is-arguments/node_modules/function-bind/index.js\nvar require_function_bind = __commonJS({\n  \"../../node_modules/is-arguments/node_modules/function-bind/index.js\"(exports, module) {\n    \"use strict\";\n    var implementation = require_implementation();\n    module.exports = Function.prototype.bind || implementation;\n  },\n});\n\n// ../../node_modules/has/node_modules/function-bind/implementation.js\nvar require_implementation2 = __commonJS({\n  \"../../node_modules/has/node_modules/function-bind/implementation.js\"(exports, module) {\n    \"use strict\";\n    var ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\n    var slice = Array.prototype.slice;\n    var toStr = Object.prototype.toString;\n    var funcType = \"[object Function]\";\n    module.exports = function bind(that) {\n      var target = this;\n      if (typeof target !== \"function\" || toStr.call(target) !== funcType) {\n        throw new TypeError(ERROR_MESSAGE + target);\n      }\n      var args = slice.call(arguments, 1);\n      var bound;\n      var binder = function () {\n        if (this instanceof bound) {\n          var result = target.apply(this, args.concat(slice.call(arguments)));\n          if (Object(result) === result) {\n            return result;\n          }\n          return this;\n        } else {\n          return target.apply(that, args.concat(slice.call(arguments)));\n        }\n      };\n      var boundLength = Math.max(0, target.length - args.length);\n      var boundArgs = [];\n      for (var i = 0; i < boundLength; i++) {\n        boundArgs.push(\"$\" + i);\n      }\n      bound = Function(\n        \"binder\",\n        \"return function (\" + boundArgs.join(\",\") + \"){ return binder.apply(this,arguments); }\"\n      )(binder);\n      if (target.prototype) {\n        var Empty = function Empty2() {};\n        Empty.prototype = target.prototype;\n        bound.prototype = new Empty();\n        Empty.prototype = null;\n      }\n      return bound;\n    };\n  },\n});\n\n// ../../node_modules/has/node_modules/function-bind/index.js\nvar require_function_bind2 = __commonJS({\n  \"../../node_modules/has/node_modules/function-bind/index.js\"(exports, module) {\n    \"use strict\";\n    var implementation = require_implementation2();\n    module.exports = Function.prototype.bind || implementation;\n  },\n});\n\n// ../../node_modules/has/src/index.js\nvar require_src = __commonJS({\n  \"../../node_modules/has/src/index.js\"(exports, module) {\n    \"use strict\";\n    var bind = require_function_bind2();\n    module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n  },\n});\n\n// ../../node_modules/is-arguments/node_modules/get-intrinsic/index.js\nvar require_get_intrinsic = __commonJS({\n  \"../../node_modules/is-arguments/node_modules/get-intrinsic/index.js\"(exports, module) {\n    \"use strict\";\n    var undefined2;\n    var $SyntaxError = SyntaxError;\n    var $Function = Function;\n    var $TypeError = TypeError;\n    var getEvalledConstructor = function (expressionSyntax) {\n      try {\n        return $Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n      } catch (e) {}\n    };\n    var $gOPD = Object.getOwnPropertyDescriptor;\n    if ($gOPD) {\n      try {\n        $gOPD({}, \"\");\n      } catch (e) {\n        $gOPD = null;\n      }\n    }\n    var throwTypeError = function () {\n      throw new $TypeError();\n    };\n    var ThrowTypeError = $gOPD\n      ? (function () {\n          try {\n            arguments.callee;\n            return throwTypeError;\n          } catch (calleeThrows) {\n            try {\n              return $gOPD(arguments, \"callee\").get;\n            } catch (gOPDthrows) {\n              return throwTypeError;\n            }\n          }\n        })()\n      : throwTypeError;\n    var hasSymbols = require_has_symbols()();\n    var getProto =\n      Object.getPrototypeOf ||\n      function (x) {\n        return x.__proto__;\n      };\n    var needsEval = {};\n    var TypedArray = typeof Uint8Array === \"undefined\" ? undefined2 : getProto(Uint8Array);\n    var INTRINSICS = {\n      \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined2 : AggregateError,\n      \"%Array%\": Array,\n      \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined2 : ArrayBuffer,\n      \"%ArrayIteratorPrototype%\": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,\n      \"%AsyncFromSyncIteratorPrototype%\": undefined2,\n      \"%AsyncFunction%\": needsEval,\n      \"%AsyncGenerator%\": needsEval,\n      \"%AsyncGeneratorFunction%\": needsEval,\n      \"%AsyncIteratorPrototype%\": needsEval,\n      \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined2 : Atomics,\n      \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined2 : BigInt,\n      \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined2 : BigInt64Array,\n      \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined2 : BigUint64Array,\n      \"%Boolean%\": Boolean,\n      \"%DataView%\": typeof DataView === \"undefined\" ? undefined2 : DataView,\n      \"%Date%\": Date,\n      \"%decodeURI%\": decodeURI,\n      \"%decodeURIComponent%\": decodeURIComponent,\n      \"%encodeURI%\": encodeURI,\n      \"%encodeURIComponent%\": encodeURIComponent,\n      \"%Error%\": Error,\n      \"%eval%\": eval,\n      // eslint-disable-line no-eval\n      \"%EvalError%\": EvalError,\n      \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined2 : Float32Array,\n      \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined2 : Float64Array,\n      \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined2 : FinalizationRegistry,\n      \"%Function%\": $Function,\n      \"%GeneratorFunction%\": needsEval,\n      \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined2 : Int8Array,\n      \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined2 : Int16Array,\n      \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined2 : Int32Array,\n      \"%isFinite%\": isFinite,\n      \"%isNaN%\": isNaN,\n      \"%IteratorPrototype%\": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,\n      \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined2,\n      \"%Map%\": typeof Map === \"undefined\" ? undefined2 : Map,\n      \"%MapIteratorPrototype%\":\n        typeof Map === \"undefined\" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Map()[Symbol.iterator]()),\n      \"%Math%\": Math,\n      \"%Number%\": Number,\n      \"%Object%\": Object,\n      \"%parseFloat%\": parseFloat,\n      \"%parseInt%\": parseInt,\n      \"%Promise%\": typeof Promise === \"undefined\" ? undefined2 : Promise,\n      \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined2 : Proxy,\n      \"%RangeError%\": RangeError,\n      \"%ReferenceError%\": ReferenceError,\n      \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined2 : Reflect,\n      \"%RegExp%\": RegExp,\n      \"%Set%\": typeof Set === \"undefined\" ? undefined2 : Set,\n      \"%SetIteratorPrototype%\":\n        typeof Set === \"undefined\" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Set()[Symbol.iterator]()),\n      \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined2 : SharedArrayBuffer,\n      \"%String%\": String,\n      \"%StringIteratorPrototype%\": hasSymbols ? getProto(\"\"[Symbol.iterator]()) : undefined2,\n      \"%Symbol%\": hasSymbols ? Symbol : undefined2,\n      \"%SyntaxError%\": $SyntaxError,\n      \"%ThrowTypeError%\": ThrowTypeError,\n      \"%TypedArray%\": TypedArray,\n      \"%TypeError%\": $TypeError,\n      \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined2 : Uint8Array,\n      \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined2 : Uint8ClampedArray,\n      \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined2 : Uint16Array,\n      \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined2 : Uint32Array,\n      \"%URIError%\": URIError,\n      \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined2 : WeakMap,\n      \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined2 : WeakRef,\n      \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined2 : WeakSet,\n    };\n    try {\n      null.error;\n    } catch (e) {\n      errorProto = getProto(getProto(e));\n      INTRINSICS[\"%Error.prototype%\"] = errorProto;\n    }\n    var errorProto;\n    var doEval = function doEval2(name) {\n      var value;\n      if (name === \"%AsyncFunction%\") {\n        value = getEvalledConstructor(\"async function () {}\");\n      } else if (name === \"%GeneratorFunction%\") {\n        value = getEvalledConstructor(\"function* () {}\");\n      } else if (name === \"%AsyncGeneratorFunction%\") {\n        value = getEvalledConstructor(\"async function* () {}\");\n      } else if (name === \"%AsyncGenerator%\") {\n        var fn = doEval2(\"%AsyncGeneratorFunction%\");\n        if (fn) {\n          value = fn.prototype;\n        }\n      } else if (name === \"%AsyncIteratorPrototype%\") {\n        var gen = doEval2(\"%AsyncGenerator%\");\n        if (gen) {\n          value = getProto(gen.prototype);\n        }\n      }\n      INTRINSICS[name] = value;\n      return value;\n    };\n    var LEGACY_ALIASES = {\n      \"%ArrayBufferPrototype%\": [\"ArrayBuffer\", \"prototype\"],\n      \"%ArrayPrototype%\": [\"Array\", \"prototype\"],\n      \"%ArrayProto_entries%\": [\"Array\", \"prototype\", \"entries\"],\n      \"%ArrayProto_forEach%\": [\"Array\", \"prototype\", \"forEach\"],\n      \"%ArrayProto_keys%\": [\"Array\", \"prototype\", \"keys\"],\n      \"%ArrayProto_values%\": [\"Array\", \"prototype\", \"values\"],\n      \"%AsyncFunctionPrototype%\": [\"AsyncFunction\", \"prototype\"],\n      \"%AsyncGenerator%\": [\"AsyncGeneratorFunction\", \"prototype\"],\n      \"%AsyncGeneratorPrototype%\": [\"AsyncGeneratorFunction\", \"prototype\", \"prototype\"],\n      \"%BooleanPrototype%\": [\"Boolean\", \"prototype\"],\n      \"%DataViewPrototype%\": [\"DataView\", \"prototype\"],\n      \"%DatePrototype%\": [\"Date\", \"prototype\"],\n      \"%ErrorPrototype%\": [\"Error\", \"prototype\"],\n      \"%EvalErrorPrototype%\": [\"EvalError\", \"prototype\"],\n      \"%Float32ArrayPrototype%\": [\"Float32Array\", \"prototype\"],\n      \"%Float64ArrayPrototype%\": [\"Float64Array\", \"prototype\"],\n      \"%FunctionPrototype%\": [\"Function\", \"prototype\"],\n      \"%Generator%\": [\"GeneratorFunction\", \"prototype\"],\n      \"%GeneratorPrototype%\": [\"GeneratorFunction\", \"prototype\", \"prototype\"],\n      \"%Int8ArrayPrototype%\": [\"Int8Array\", \"prototype\"],\n      \"%Int16ArrayPrototype%\": [\"Int16Array\", \"prototype\"],\n      \"%Int32ArrayPrototype%\": [\"Int32Array\", \"prototype\"],\n      \"%JSONParse%\": [\"JSON\", \"parse\"],\n      \"%JSONStringify%\": [\"JSON\", \"stringify\"],\n      \"%MapPrototype%\": [\"Map\", \"prototype\"],\n      \"%NumberPrototype%\": [\"Number\", \"prototype\"],\n      \"%ObjectPrototype%\": [\"Object\", \"prototype\"],\n      \"%ObjProto_toString%\": [\"Object\", \"prototype\", \"toString\"],\n      \"%ObjProto_valueOf%\": [\"Object\", \"prototype\", \"valueOf\"],\n      \"%PromisePrototype%\": [\"Promise\", \"prototype\"],\n      \"%PromiseProto_then%\": [\"Promise\", \"prototype\", \"then\"],\n      \"%Promise_all%\": [\"Promise\", \"all\"],\n      \"%Promise_reject%\": [\"Promise\", \"reject\"],\n      \"%Promise_resolve%\": [\"Promise\", \"resolve\"],\n      \"%RangeErrorPrototype%\": [\"RangeError\", \"prototype\"],\n      \"%ReferenceErrorPrototype%\": [\"ReferenceError\", \"prototype\"],\n      \"%RegExpPrototype%\": [\"RegExp\", \"prototype\"],\n      \"%SetPrototype%\": [\"Set\", \"prototype\"],\n      \"%SharedArrayBufferPrototype%\": [\"SharedArrayBuffer\", \"prototype\"],\n      \"%StringPrototype%\": [\"String\", \"prototype\"],\n      \"%SymbolPrototype%\": [\"Symbol\", \"prototype\"],\n      \"%SyntaxErrorPrototype%\": [\"SyntaxError\", \"prototype\"],\n      \"%TypedArrayPrototype%\": [\"TypedArray\", \"prototype\"],\n      \"%TypeErrorPrototype%\": [\"TypeError\", \"prototype\"],\n      \"%Uint8ArrayPrototype%\": [\"Uint8Array\", \"prototype\"],\n      \"%Uint8ClampedArrayPrototype%\": [\"Uint8ClampedArray\", \"prototype\"],\n      \"%Uint16ArrayPrototype%\": [\"Uint16Array\", \"prototype\"],\n      \"%Uint32ArrayPrototype%\": [\"Uint32Array\", \"prototype\"],\n      \"%URIErrorPrototype%\": [\"URIError\", \"prototype\"],\n      \"%WeakMapPrototype%\": [\"WeakMap\", \"prototype\"],\n      \"%WeakSetPrototype%\": [\"WeakSet\", \"prototype\"],\n    };\n    var bind = require_function_bind();\n    var hasOwn = require_src();\n    var $concat = bind.call(Function.call, Array.prototype.concat);\n    var $spliceApply = bind.call(Function.apply, Array.prototype.splice);\n    var $replace = bind.call(Function.call, String.prototype.replace);\n    var $strSlice = bind.call(Function.call, String.prototype.slice);\n    var $exec = bind.call(Function.call, RegExp.prototype.exec);\n    var rePropName =\n      /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\n    var reEscapeChar = /\\\\(\\\\)?/g;\n    var stringToPath = function stringToPath2(string) {\n      var first = $strSlice(string, 0, 1);\n      var last = $strSlice(string, -1);\n      if (first === \"%\" && last !== \"%\") {\n        throw new $SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n      } else if (last === \"%\" && first !== \"%\") {\n        throw new $SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n      }\n      var result = [];\n      $replace(string, rePropName, function (match, number, quote, subString) {\n        result[result.length] = quote ? $replace(subString, reEscapeChar, \"$1\") : number || match;\n      });\n      return result;\n    };\n    var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {\n      var intrinsicName = name;\n      var alias;\n      if (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n        alias = LEGACY_ALIASES[intrinsicName];\n        intrinsicName = \"%\" + alias[0] + \"%\";\n      }\n      if (hasOwn(INTRINSICS, intrinsicName)) {\n        var value = INTRINSICS[intrinsicName];\n        if (value === needsEval) {\n          value = doEval(intrinsicName);\n        }\n        if (typeof value === \"undefined\" && !allowMissing) {\n          throw new $TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n        }\n        return {\n          alias,\n          name: intrinsicName,\n          value,\n        };\n      }\n      throw new $SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n    };\n    module.exports = function GetIntrinsic(name, allowMissing) {\n      if (typeof name !== \"string\" || name.length === 0) {\n        throw new $TypeError(\"intrinsic name must be a non-empty string\");\n      }\n      if (arguments.length > 1 && typeof allowMissing !== \"boolean\") {\n        throw new $TypeError('\"allowMissing\" argument must be a boolean');\n      }\n      if ($exec(/^%?[^%]*%?$/, name) === null) {\n        throw new $SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n      }\n      var parts = stringToPath(name);\n      var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n      var intrinsic = getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n      var intrinsicRealName = intrinsic.name;\n      var value = intrinsic.value;\n      var skipFurtherCaching = false;\n      var alias = intrinsic.alias;\n      if (alias) {\n        intrinsicBaseName = alias[0];\n        $spliceApply(parts, $concat([0, 1], alias));\n      }\n      for (var i = 1, isOwn = true; i < parts.length; i += 1) {\n        var part = parts[i];\n        var first = $strSlice(part, 0, 1);\n        var last = $strSlice(part, -1);\n        if (\n          (first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") &&\n          first !== last\n        ) {\n          throw new $SyntaxError(\"property names with quotes must have matching quotes\");\n        }\n        if (part === \"constructor\" || !isOwn) {\n          skipFurtherCaching = true;\n        }\n        intrinsicBaseName += \".\" + part;\n        intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n        if (hasOwn(INTRINSICS, intrinsicRealName)) {\n          value = INTRINSICS[intrinsicRealName];\n        } else if (value != null) {\n          if (!(part in value)) {\n            if (!allowMissing) {\n              throw new $TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n            }\n            return void 0;\n          }\n          if ($gOPD && i + 1 >= parts.length) {\n            var desc = $gOPD(value, part);\n            isOwn = !!desc;\n            if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) {\n              value = desc.get;\n            } else {\n              value = value[part];\n            }\n          } else {\n            isOwn = hasOwn(value, part);\n            value = value[part];\n          }\n          if (isOwn && !skipFurtherCaching) {\n            INTRINSICS[intrinsicRealName] = value;\n          }\n        }\n      }\n      return value;\n    };\n  },\n});\n\n// ../../node_modules/is-arguments/node_modules/call-bind/index.js\nvar require_call_bind = __commonJS({\n  \"../../node_modules/is-arguments/node_modules/call-bind/index.js\"(exports, module) {\n    \"use strict\";\n    var bind = require_function_bind();\n    var GetIntrinsic = require_get_intrinsic();\n    var $apply = GetIntrinsic(\"%Function.prototype.apply%\");\n    var $call = GetIntrinsic(\"%Function.prototype.call%\");\n    var $reflectApply = GetIntrinsic(\"%Reflect.apply%\", true) || bind.call($call, $apply);\n    var $gOPD = GetIntrinsic(\"%Object.getOwnPropertyDescriptor%\", true);\n    var $defineProperty = GetIntrinsic(\"%Object.defineProperty%\", true);\n    var $max = GetIntrinsic(\"%Math.max%\");\n    if ($defineProperty) {\n      try {\n        $defineProperty({}, \"a\", { value: 1 });\n      } catch (e) {\n        $defineProperty = null;\n      }\n    }\n    module.exports = function callBind(originalFunction) {\n      var func = $reflectApply(bind, $call, arguments);\n      if ($gOPD && $defineProperty) {\n        var desc = $gOPD(func, \"length\");\n        if (desc.configurable) {\n          $defineProperty(func, \"length\", { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) });\n        }\n      }\n      return func;\n    };\n    var applyBind = function applyBind2() {\n      return $reflectApply(bind, $apply, arguments);\n    };\n    if ($defineProperty) {\n      $defineProperty(module.exports, \"apply\", { value: applyBind });\n    } else {\n      module.exports.apply = applyBind;\n    }\n  },\n});\n\n// ../../node_modules/is-arguments/node_modules/call-bind/callBound.js\nvar require_callBound = __commonJS({\n  \"../../node_modules/is-arguments/node_modules/call-bind/callBound.js\"(exports, module) {\n    \"use strict\";\n    var GetIntrinsic = require_get_intrinsic();\n    var callBind = require_call_bind();\n    var $indexOf = callBind(GetIntrinsic(\"String.prototype.indexOf\"));\n    module.exports = function callBoundIntrinsic(name, allowMissing) {\n      var intrinsic = GetIntrinsic(name, !!allowMissing);\n      if (typeof intrinsic === \"function\" && $indexOf(name, \".prototype.\") > -1) {\n        return callBind(intrinsic);\n      }\n      return intrinsic;\n    };\n  },\n});\n\n// ../../node_modules/is-arguments/index.js\nvar require_is_arguments = __commonJS({\n  \"../../node_modules/is-arguments/index.js\"(exports, module) {\n    \"use strict\";\n    var hasToStringTag = require_shams2()();\n    var callBound = require_callBound();\n    var $toString = callBound(\"Object.prototype.toString\");\n    var isStandardArguments = function isArguments(value) {\n      if (hasToStringTag && value && typeof value === \"object\" && Symbol.toStringTag in value) {\n        return false;\n      }\n      return $toString(value) === \"[object Arguments]\";\n    };\n    var isLegacyArguments = function isArguments(value) {\n      if (isStandardArguments(value)) {\n        return true;\n      }\n      return (\n        value !== null &&\n        typeof value === \"object\" &&\n        typeof value.length === \"number\" &&\n        value.length >= 0 &&\n        $toString(value) !== \"[object Array]\" &&\n        $toString(value.callee) === \"[object Function]\"\n      );\n    };\n    var supportsStandardArguments = (function () {\n      return isStandardArguments(arguments);\n    })();\n    isStandardArguments.isLegacyArguments = isLegacyArguments;\n    module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n  },\n});\n\n// ../../node_modules/is-generator-function/index.js\nvar require_is_generator_function = __commonJS({\n  \"../../node_modules/is-generator-function/index.js\"(exports, module) {\n    \"use strict\";\n    var toStr = Object.prototype.toString;\n    var fnToStr = Function.prototype.toString;\n    var isFnRegex = /^\\s*(?:function)?\\*/;\n    var hasToStringTag = require_shams2()();\n    var getProto = Object.getPrototypeOf;\n    var getGeneratorFunc = function () {\n      if (!hasToStringTag) {\n        return false;\n      }\n      try {\n        return Function(\"return function*() {}\")();\n      } catch (e) {}\n    };\n    var GeneratorFunction;\n    module.exports = function isGeneratorFunction(fn) {\n      if (typeof fn !== \"function\") {\n        return false;\n      }\n      if (isFnRegex.test(fnToStr.call(fn))) {\n        return true;\n      }\n      if (!hasToStringTag) {\n        var str = toStr.call(fn);\n        return str === \"[object GeneratorFunction]\";\n      }\n      if (!getProto) {\n        return false;\n      }\n      if (typeof GeneratorFunction === \"undefined\") {\n        var generatorFunc = getGeneratorFunc();\n        GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n      }\n      return getProto(fn) === GeneratorFunction;\n    };\n  },\n});\n\n// ../../node_modules/is-callable/index.js\nvar require_is_callable = __commonJS({\n  \"../../node_modules/is-callable/index.js\"(exports, module) {\n    \"use strict\";\n    var fnToStr = Function.prototype.toString;\n    var reflectApply = typeof Reflect === \"object\" && Reflect !== null && Reflect.apply;\n    var badArrayLike;\n    var isCallableMarker;\n    if (typeof reflectApply === \"function\" && typeof Object.defineProperty === \"function\") {\n      try {\n        badArrayLike = Object.defineProperty({}, \"length\", {\n          get: function () {\n            throw isCallableMarker;\n          },\n        });\n        isCallableMarker = {};\n        reflectApply(\n          function () {\n            throw 42;\n          },\n          null,\n          badArrayLike\n        );\n      } catch (_) {\n        if (_ !== isCallableMarker) {\n          reflectApply = null;\n        }\n      }\n    } else {\n      reflectApply = null;\n    }\n    var constructorRegex = /^\\s*class\\b/;\n    var isES6ClassFn = function isES6ClassFunction(value) {\n      try {\n        var fnStr = fnToStr.call(value);\n        return constructorRegex.test(fnStr);\n      } catch (e) {\n        return false;\n      }\n    };\n    var tryFunctionObject = function tryFunctionToStr(value) {\n      try {\n        if (isES6ClassFn(value)) {\n          return false;\n        }\n        fnToStr.call(value);\n        return true;\n      } catch (e) {\n        return false;\n      }\n    };\n    var toStr = Object.prototype.toString;\n    var objectClass = \"[object Object]\";\n    var fnClass = \"[object Function]\";\n    var genClass = \"[object GeneratorFunction]\";\n    var ddaClass = \"[object HTMLAllCollection]\";\n    var ddaClass2 = \"[object HTML document.all class]\";\n    var ddaClass3 = \"[object HTMLCollection]\";\n    var hasToStringTag = typeof Symbol === \"function\" && !!Symbol.toStringTag;\n    var isIE68 = !(0 in [,]);\n    var isDDA = function isDocumentDotAll() {\n      return false;\n    };\n    if (typeof document === \"object\") {\n      all = document.all;\n      if (toStr.call(all) === toStr.call(document.all)) {\n        isDDA = function isDocumentDotAll(value) {\n          if ((isIE68 || !value) && (typeof value === \"undefined\" || typeof value === \"object\")) {\n            try {\n              var str = toStr.call(value);\n              return (\n                (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value(\"\") == null\n              );\n            } catch (e) {}\n          }\n          return false;\n        };\n      }\n    }\n    var all;\n    module.exports = reflectApply\n      ? function isCallable(value) {\n          if (isDDA(value)) {\n            return true;\n          }\n          if (!value) {\n            return false;\n          }\n          if (typeof value !== \"function\" && typeof value !== \"object\") {\n            return false;\n          }\n          try {\n            reflectApply(value, null, badArrayLike);\n          } catch (e) {\n            if (e !== isCallableMarker) {\n              return false;\n            }\n          }\n          return !isES6ClassFn(value) && tryFunctionObject(value);\n        }\n      : function isCallable(value) {\n          if (isDDA(value)) {\n            return true;\n          }\n          if (!value) {\n            return false;\n          }\n          if (typeof value !== \"function\" && typeof value !== \"object\") {\n            return false;\n          }\n          if (hasToStringTag) {\n            return tryFunctionObject(value);\n          }\n          if (isES6ClassFn(value)) {\n            return false;\n          }\n          var strClass = toStr.call(value);\n          if (strClass !== fnClass && strClass !== genClass && !/^\\[object HTML/.test(strClass)) {\n            return false;\n          }\n          return tryFunctionObject(value);\n        };\n  },\n});\n\n// ../../node_modules/for-each/index.js\nvar require_for_each = __commonJS({\n  \"../../node_modules/for-each/index.js\"(exports, module) {\n    \"use strict\";\n    var isCallable = require_is_callable();\n    var toStr = Object.prototype.toString;\n    var hasOwnProperty = Object.prototype.hasOwnProperty;\n    var forEachArray = function forEachArray2(array, iterator, receiver) {\n      for (var i = 0, len = array.length; i < len; i++) {\n        if (hasOwnProperty.call(array, i)) {\n          if (receiver == null) {\n            iterator(array[i], i, array);\n          } else {\n            iterator.call(receiver, array[i], i, array);\n          }\n        }\n      }\n    };\n    var forEachString = function forEachString2(string, iterator, receiver) {\n      for (var i = 0, len = string.length; i < len; i++) {\n        if (receiver == null) {\n          iterator(string.charAt(i), i, string);\n        } else {\n          iterator.call(receiver, string.charAt(i), i, string);\n        }\n      }\n    };\n    var forEachObject = function forEachObject2(object, iterator, receiver) {\n      for (var k in object) {\n        if (hasOwnProperty.call(object, k)) {\n          if (receiver == null) {\n            iterator(object[k], k, object);\n          } else {\n            iterator.call(receiver, object[k], k, object);\n          }\n        }\n      }\n    };\n    var forEach = function forEach2(list, iterator, thisArg) {\n      if (!isCallable(iterator)) {\n        throw new TypeError(\"iterator must be a function\");\n      }\n      var receiver;\n      if (arguments.length >= 3) {\n        receiver = thisArg;\n      }\n      if (toStr.call(list) === \"[object Array]\") {\n        forEachArray(list, iterator, receiver);\n      } else if (typeof list === \"string\") {\n        forEachString(list, iterator, receiver);\n      } else {\n        forEachObject(list, iterator, receiver);\n      }\n    };\n    module.exports = forEach;\n  },\n});\n\n// ../../node_modules/util/node_modules/available-typed-arrays/index.js\nvar require_available_typed_arrays = __commonJS({\n  \"../../node_modules/util/node_modules/available-typed-arrays/index.js\"(exports, module) {\n    \"use strict\";\n    var possibleNames = [\n      \"BigInt64Array\",\n      \"BigUint64Array\",\n      \"Float32Array\",\n      \"Float64Array\",\n      \"Int16Array\",\n      \"Int32Array\",\n      \"Int8Array\",\n      \"Uint16Array\",\n      \"Uint32Array\",\n      \"Uint8Array\",\n      \"Uint8ClampedArray\",\n    ];\n    var g = typeof globalThis === \"undefined\" ? global : globalThis;\n    module.exports = function availableTypedArrays() {\n      var out = [];\n      for (var i = 0; i < possibleNames.length; i++) {\n        if (typeof g[possibleNames[i]] === \"function\") {\n          out[out.length] = possibleNames[i];\n        }\n      }\n      return out;\n    };\n  },\n});\n\n// ../../node_modules/util/node_modules/function-bind/implementation.js\nvar require_implementation3 = __commonJS({\n  \"../../node_modules/util/node_modules/function-bind/implementation.js\"(exports, module) {\n    \"use strict\";\n    var ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\n    var slice = Array.prototype.slice;\n    var toStr = Object.prototype.toString;\n    var funcType = \"[object Function]\";\n    module.exports = function bind(that) {\n      var target = this;\n      if (typeof target !== \"function\" || toStr.call(target) !== funcType) {\n        throw new TypeError(ERROR_MESSAGE + target);\n      }\n      var args = slice.call(arguments, 1);\n      var bound;\n      var binder = function () {\n        if (this instanceof bound) {\n          var result = target.apply(this, args.concat(slice.call(arguments)));\n          if (Object(result) === result) {\n            return result;\n          }\n          return this;\n        } else {\n          return target.apply(that, args.concat(slice.call(arguments)));\n        }\n      };\n      var boundLength = Math.max(0, target.length - args.length);\n      var boundArgs = [];\n      for (var i = 0; i < boundLength; i++) {\n        boundArgs.push(\"$\" + i);\n      }\n      bound = Function(\n        \"binder\",\n        \"return function (\" + boundArgs.join(\",\") + \"){ return binder.apply(this,arguments); }\"\n      )(binder);\n      if (target.prototype) {\n        var Empty = function Empty2() {};\n        Empty.prototype = target.prototype;\n        bound.prototype = new Empty();\n        Empty.prototype = null;\n      }\n      return bound;\n    };\n  },\n});\n\n// ../../node_modules/util/node_modules/function-bind/index.js\nvar require_function_bind3 = __commonJS({\n  \"../../node_modules/util/node_modules/function-bind/index.js\"(exports, module) {\n    \"use strict\";\n    var implementation = require_implementation3();\n    module.exports = Function.prototype.bind || implementation;\n  },\n});\n\n// ../../node_modules/util/node_modules/get-intrinsic/index.js\nvar require_get_intrinsic2 = __commonJS({\n  \"../../node_modules/util/node_modules/get-intrinsic/index.js\"(exports, module) {\n    \"use strict\";\n    var undefined2;\n    var $SyntaxError = SyntaxError;\n    var $Function = Function;\n    var $TypeError = TypeError;\n    var getEvalledConstructor = function (expressionSyntax) {\n      try {\n        return $Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n      } catch (e) {}\n    };\n    var $gOPD = Object.getOwnPropertyDescriptor;\n    if ($gOPD) {\n      try {\n        $gOPD({}, \"\");\n      } catch (e) {\n        $gOPD = null;\n      }\n    }\n    var throwTypeError = function () {\n      throw new $TypeError();\n    };\n    var ThrowTypeError = $gOPD\n      ? (function () {\n          try {\n            arguments.callee;\n            return throwTypeError;\n          } catch (calleeThrows) {\n            try {\n              return $gOPD(arguments, \"callee\").get;\n            } catch (gOPDthrows) {\n              return throwTypeError;\n            }\n          }\n        })()\n      : throwTypeError;\n    var hasSymbols = require_has_symbols()();\n    var getProto =\n      Object.getPrototypeOf ||\n      function (x) {\n        return x.__proto__;\n      };\n    var needsEval = {};\n    var TypedArray = typeof Uint8Array === \"undefined\" ? undefined2 : getProto(Uint8Array);\n    var INTRINSICS = {\n      \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined2 : AggregateError,\n      \"%Array%\": Array,\n      \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined2 : ArrayBuffer,\n      \"%ArrayIteratorPrototype%\": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,\n      \"%AsyncFromSyncIteratorPrototype%\": undefined2,\n      \"%AsyncFunction%\": needsEval,\n      \"%AsyncGenerator%\": needsEval,\n      \"%AsyncGeneratorFunction%\": needsEval,\n      \"%AsyncIteratorPrototype%\": needsEval,\n      \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined2 : Atomics,\n      \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined2 : BigInt,\n      \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined2 : BigInt64Array,\n      \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined2 : BigUint64Array,\n      \"%Boolean%\": Boolean,\n      \"%DataView%\": typeof DataView === \"undefined\" ? undefined2 : DataView,\n      \"%Date%\": Date,\n      \"%decodeURI%\": decodeURI,\n      \"%decodeURIComponent%\": decodeURIComponent,\n      \"%encodeURI%\": encodeURI,\n      \"%encodeURIComponent%\": encodeURIComponent,\n      \"%Error%\": Error,\n      \"%eval%\": eval,\n      // eslint-disable-line no-eval\n      \"%EvalError%\": EvalError,\n      \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined2 : Float32Array,\n      \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined2 : Float64Array,\n      \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined2 : FinalizationRegistry,\n      \"%Function%\": $Function,\n      \"%GeneratorFunction%\": needsEval,\n      \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined2 : Int8Array,\n      \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined2 : Int16Array,\n      \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined2 : Int32Array,\n      \"%isFinite%\": isFinite,\n      \"%isNaN%\": isNaN,\n      \"%IteratorPrototype%\": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,\n      \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined2,\n      \"%Map%\": typeof Map === \"undefined\" ? undefined2 : Map,\n      \"%MapIteratorPrototype%\":\n        typeof Map === \"undefined\" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Map()[Symbol.iterator]()),\n      \"%Math%\": Math,\n      \"%Number%\": Number,\n      \"%Object%\": Object,\n      \"%parseFloat%\": parseFloat,\n      \"%parseInt%\": parseInt,\n      \"%Promise%\": typeof Promise === \"undefined\" ? undefined2 : Promise,\n      \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined2 : Proxy,\n      \"%RangeError%\": RangeError,\n      \"%ReferenceError%\": ReferenceError,\n      \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined2 : Reflect,\n      \"%RegExp%\": RegExp,\n      \"%Set%\": typeof Set === \"undefined\" ? undefined2 : Set,\n      \"%SetIteratorPrototype%\":\n        typeof Set === \"undefined\" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Set()[Symbol.iterator]()),\n      \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined2 : SharedArrayBuffer,\n      \"%String%\": String,\n      \"%StringIteratorPrototype%\": hasSymbols ? getProto(\"\"[Symbol.iterator]()) : undefined2,\n      \"%Symbol%\": hasSymbols ? Symbol : undefined2,\n      \"%SyntaxError%\": $SyntaxError,\n      \"%ThrowTypeError%\": ThrowTypeError,\n      \"%TypedArray%\": TypedArray,\n      \"%TypeError%\": $TypeError,\n      \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined2 : Uint8Array,\n      \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined2 : Uint8ClampedArray,\n      \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined2 : Uint16Array,\n      \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined2 : Uint32Array,\n      \"%URIError%\": URIError,\n      \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined2 : WeakMap,\n      \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined2 : WeakRef,\n      \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined2 : WeakSet,\n    };\n    try {\n      null.error;\n    } catch (e) {\n      errorProto = getProto(getProto(e));\n      INTRINSICS[\"%Error.prototype%\"] = errorProto;\n    }\n    var errorProto;\n    var doEval = function doEval2(name) {\n      var value;\n      if (name === \"%AsyncFunction%\") {\n        value = getEvalledConstructor(\"async function () {}\");\n      } else if (name === \"%GeneratorFunction%\") {\n        value = getEvalledConstructor(\"function* () {}\");\n      } else if (name === \"%AsyncGeneratorFunction%\") {\n        value = getEvalledConstructor(\"async function* () {}\");\n      } else if (name === \"%AsyncGenerator%\") {\n        var fn = doEval2(\"%AsyncGeneratorFunction%\");\n        if (fn) {\n          value = fn.prototype;\n        }\n      } else if (name === \"%AsyncIteratorPrototype%\") {\n        var gen = doEval2(\"%AsyncGenerator%\");\n        if (gen) {\n          value = getProto(gen.prototype);\n        }\n      }\n      INTRINSICS[name] = value;\n      return value;\n    };\n    var LEGACY_ALIASES = {\n      \"%ArrayBufferPrototype%\": [\"ArrayBuffer\", \"prototype\"],\n      \"%ArrayPrototype%\": [\"Array\", \"prototype\"],\n      \"%ArrayProto_entries%\": [\"Array\", \"prototype\", \"entries\"],\n      \"%ArrayProto_forEach%\": [\"Array\", \"prototype\", \"forEach\"],\n      \"%ArrayProto_keys%\": [\"Array\", \"prototype\", \"keys\"],\n      \"%ArrayProto_values%\": [\"Array\", \"prototype\", \"values\"],\n      \"%AsyncFunctionPrototype%\": [\"AsyncFunction\", \"prototype\"],\n      \"%AsyncGenerator%\": [\"AsyncGeneratorFunction\", \"prototype\"],\n      \"%AsyncGeneratorPrototype%\": [\"AsyncGeneratorFunction\", \"prototype\", \"prototype\"],\n      \"%BooleanPrototype%\": [\"Boolean\", \"prototype\"],\n      \"%DataViewPrototype%\": [\"DataView\", \"prototype\"],\n      \"%DatePrototype%\": [\"Date\", \"prototype\"],\n      \"%ErrorPrototype%\": [\"Error\", \"prototype\"],\n      \"%EvalErrorPrototype%\": [\"EvalError\", \"prototype\"],\n      \"%Float32ArrayPrototype%\": [\"Float32Array\", \"prototype\"],\n      \"%Float64ArrayPrototype%\": [\"Float64Array\", \"prototype\"],\n      \"%FunctionPrototype%\": [\"Function\", \"prototype\"],\n      \"%Generator%\": [\"GeneratorFunction\", \"prototype\"],\n      \"%GeneratorPrototype%\": [\"GeneratorFunction\", \"prototype\", \"prototype\"],\n      \"%Int8ArrayPrototype%\": [\"Int8Array\", \"prototype\"],\n      \"%Int16ArrayPrototype%\": [\"Int16Array\", \"prototype\"],\n      \"%Int32ArrayPrototype%\": [\"Int32Array\", \"prototype\"],\n      \"%JSONParse%\": [\"JSON\", \"parse\"],\n      \"%JSONStringify%\": [\"JSON\", \"stringify\"],\n      \"%MapPrototype%\": [\"Map\", \"prototype\"],\n      \"%NumberPrototype%\": [\"Number\", \"prototype\"],\n      \"%ObjectPrototype%\": [\"Object\", \"prototype\"],\n      \"%ObjProto_toString%\": [\"Object\", \"prototype\", \"toString\"],\n      \"%ObjProto_valueOf%\": [\"Object\", \"prototype\", \"valueOf\"],\n      \"%PromisePrototype%\": [\"Promise\", \"prototype\"],\n      \"%PromiseProto_then%\": [\"Promise\", \"prototype\", \"then\"],\n      \"%Promise_all%\": [\"Promise\", \"all\"],\n      \"%Promise_reject%\": [\"Promise\", \"reject\"],\n      \"%Promise_resolve%\": [\"Promise\", \"resolve\"],\n      \"%RangeErrorPrototype%\": [\"RangeError\", \"prototype\"],\n      \"%ReferenceErrorPrototype%\": [\"ReferenceError\", \"prototype\"],\n      \"%RegExpPrototype%\": [\"RegExp\", \"prototype\"],\n      \"%SetPrototype%\": [\"Set\", \"prototype\"],\n      \"%SharedArrayBufferPrototype%\": [\"SharedArrayBuffer\", \"prototype\"],\n      \"%StringPrototype%\": [\"String\", \"prototype\"],\n      \"%SymbolPrototype%\": [\"Symbol\", \"prototype\"],\n      \"%SyntaxErrorPrototype%\": [\"SyntaxError\", \"prototype\"],\n      \"%TypedArrayPrototype%\": [\"TypedArray\", \"prototype\"],\n      \"%TypeErrorPrototype%\": [\"TypeError\", \"prototype\"],\n      \"%Uint8ArrayPrototype%\": [\"Uint8Array\", \"prototype\"],\n      \"%Uint8ClampedArrayPrototype%\": [\"Uint8ClampedArray\", \"prototype\"],\n      \"%Uint16ArrayPrototype%\": [\"Uint16Array\", \"prototype\"],\n      \"%Uint32ArrayPrototype%\": [\"Uint32Array\", \"prototype\"],\n      \"%URIErrorPrototype%\": [\"URIError\", \"prototype\"],\n      \"%WeakMapPrototype%\": [\"WeakMap\", \"prototype\"],\n      \"%WeakSetPrototype%\": [\"WeakSet\", \"prototype\"],\n    };\n    var bind = require_function_bind3();\n    var hasOwn = require_src();\n    var $concat = bind.call(Function.call, Array.prototype.concat);\n    var $spliceApply = bind.call(Function.apply, Array.prototype.splice);\n    var $replace = bind.call(Function.call, String.prototype.replace);\n    var $strSlice = bind.call(Function.call, String.prototype.slice);\n    var $exec = bind.call(Function.call, RegExp.prototype.exec);\n    var rePropName =\n      /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\n    var reEscapeChar = /\\\\(\\\\)?/g;\n    var stringToPath = function stringToPath2(string) {\n      var first = $strSlice(string, 0, 1);\n      var last = $strSlice(string, -1);\n      if (first === \"%\" && last !== \"%\") {\n        throw new $SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n      } else if (last === \"%\" && first !== \"%\") {\n        throw new $SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n      }\n      var result = [];\n      $replace(string, rePropName, function (match, number, quote, subString) {\n        result[result.length] = quote ? $replace(subString, reEscapeChar, \"$1\") : number || match;\n      });\n      return result;\n    };\n    var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {\n      var intrinsicName = name;\n      var alias;\n      if (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n        alias = LEGACY_ALIASES[intrinsicName];\n        intrinsicName = \"%\" + alias[0] + \"%\";\n      }\n      if (hasOwn(INTRINSICS, intrinsicName)) {\n        var value = INTRINSICS[intrinsicName];\n        if (value === needsEval) {\n          value = doEval(intrinsicName);\n        }\n        if (typeof value === \"undefined\" && !allowMissing) {\n          throw new $TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n        }\n        return {\n          alias,\n          name: intrinsicName,\n          value,\n        };\n      }\n      throw new $SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n    };\n    module.exports = function GetIntrinsic(name, allowMissing) {\n      if (typeof name !== \"string\" || name.length === 0) {\n        throw new $TypeError(\"intrinsic name must be a non-empty string\");\n      }\n      if (arguments.length > 1 && typeof allowMissing !== \"boolean\") {\n        throw new $TypeError('\"allowMissing\" argument must be a boolean');\n      }\n      if ($exec(/^%?[^%]*%?$/, name) === null) {\n        throw new $SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n      }\n      var parts = stringToPath(name);\n      var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n      var intrinsic = getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n      var intrinsicRealName = intrinsic.name;\n      var value = intrinsic.value;\n      var skipFurtherCaching = false;\n      var alias = intrinsic.alias;\n      if (alias) {\n        intrinsicBaseName = alias[0];\n        $spliceApply(parts, $concat([0, 1], alias));\n      }\n      for (var i = 1, isOwn = true; i < parts.length; i += 1) {\n        var part = parts[i];\n        var first = $strSlice(part, 0, 1);\n        var last = $strSlice(part, -1);\n        if (\n          (first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") &&\n          first !== last\n        ) {\n          throw new $SyntaxError(\"property names with quotes must have matching quotes\");\n        }\n        if (part === \"constructor\" || !isOwn) {\n          skipFurtherCaching = true;\n        }\n        intrinsicBaseName += \".\" + part;\n        intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n        if (hasOwn(INTRINSICS, intrinsicRealName)) {\n          value = INTRINSICS[intrinsicRealName];\n        } else if (value != null) {\n          if (!(part in value)) {\n            if (!allowMissing) {\n              throw new $TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n            }\n            return void 0;\n          }\n          if ($gOPD && i + 1 >= parts.length) {\n            var desc = $gOPD(value, part);\n            isOwn = !!desc;\n            if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) {\n              value = desc.get;\n            } else {\n              value = value[part];\n            }\n          } else {\n            isOwn = hasOwn(value, part);\n            value = value[part];\n          }\n          if (isOwn && !skipFurtherCaching) {\n            INTRINSICS[intrinsicRealName] = value;\n          }\n        }\n      }\n      return value;\n    };\n  },\n});\n\n// ../../node_modules/util/node_modules/call-bind/index.js\nvar require_call_bind2 = __commonJS({\n  \"../../node_modules/util/node_modules/call-bind/index.js\"(exports, module) {\n    \"use strict\";\n    var bind = require_function_bind3();\n    var GetIntrinsic = require_get_intrinsic2();\n    var $apply = GetIntrinsic(\"%Function.prototype.apply%\");\n    var $call = GetIntrinsic(\"%Function.prototype.call%\");\n    var $reflectApply = GetIntrinsic(\"%Reflect.apply%\", true) || bind.call($call, $apply);\n    var $gOPD = GetIntrinsic(\"%Object.getOwnPropertyDescriptor%\", true);\n    var $defineProperty = GetIntrinsic(\"%Object.defineProperty%\", true);\n    var $max = GetIntrinsic(\"%Math.max%\");\n    if ($defineProperty) {\n      try {\n        $defineProperty({}, \"a\", { value: 1 });\n      } catch (e) {\n        $defineProperty = null;\n      }\n    }\n    module.exports = function callBind(originalFunction) {\n      var func = $reflectApply(bind, $call, arguments);\n      if ($gOPD && $defineProperty) {\n        var desc = $gOPD(func, \"length\");\n        if (desc.configurable) {\n          $defineProperty(func, \"length\", { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) });\n        }\n      }\n      return func;\n    };\n    var applyBind = function applyBind2() {\n      return $reflectApply(bind, $apply, arguments);\n    };\n    if ($defineProperty) {\n      $defineProperty(module.exports, \"apply\", { value: applyBind });\n    } else {\n      module.exports.apply = applyBind;\n    }\n  },\n});\n\n// ../../node_modules/util/node_modules/call-bind/callBound.js\nvar require_callBound2 = __commonJS({\n  \"../../node_modules/util/node_modules/call-bind/callBound.js\"(exports, module) {\n    \"use strict\";\n    var GetIntrinsic = require_get_intrinsic2();\n    var callBind = require_call_bind2();\n    var $indexOf = callBind(GetIntrinsic(\"String.prototype.indexOf\"));\n    module.exports = function callBoundIntrinsic(name, allowMissing) {\n      var intrinsic = GetIntrinsic(name, !!allowMissing);\n      if (typeof intrinsic === \"function\" && $indexOf(name, \".prototype.\") > -1) {\n        return callBind(intrinsic);\n      }\n      return intrinsic;\n    };\n  },\n});\n\n// ../../node_modules/gopd/node_modules/function-bind/implementation.js\nvar require_implementation4 = __commonJS({\n  \"../../node_modules/gopd/node_modules/function-bind/implementation.js\"(exports, module) {\n    \"use strict\";\n    var ERROR_MESSAGE = \"Function.prototype.bind called on incompatible \";\n    var slice = Array.prototype.slice;\n    var toStr = Object.prototype.toString;\n    var funcType = \"[object Function]\";\n    module.exports = function bind(that) {\n      var target = this;\n      if (typeof target !== \"function\" || toStr.call(target) !== funcType) {\n        throw new TypeError(ERROR_MESSAGE + target);\n      }\n      var args = slice.call(arguments, 1);\n      var bound;\n      var binder = function () {\n        if (this instanceof bound) {\n          var result = target.apply(this, args.concat(slice.call(arguments)));\n          if (Object(result) === result) {\n            return result;\n          }\n          return this;\n        } else {\n          return target.apply(that, args.concat(slice.call(arguments)));\n        }\n      };\n      var boundLength = Math.max(0, target.length - args.length);\n      var boundArgs = [];\n      for (var i = 0; i < boundLength; i++) {\n        boundArgs.push(\"$\" + i);\n      }\n      bound = Function(\n        \"binder\",\n        \"return function (\" + boundArgs.join(\",\") + \"){ return binder.apply(this,arguments); }\"\n      )(binder);\n      if (target.prototype) {\n        var Empty = function Empty2() {};\n        Empty.prototype = target.prototype;\n        bound.prototype = new Empty();\n        Empty.prototype = null;\n      }\n      return bound;\n    };\n  },\n});\n\n// ../../node_modules/gopd/node_modules/function-bind/index.js\nvar require_function_bind4 = __commonJS({\n  \"../../node_modules/gopd/node_modules/function-bind/index.js\"(exports, module) {\n    \"use strict\";\n    var implementation = require_implementation4();\n    module.exports = Function.prototype.bind || implementation;\n  },\n});\n\n// ../../node_modules/gopd/node_modules/get-intrinsic/index.js\nvar require_get_intrinsic3 = __commonJS({\n  \"../../node_modules/gopd/node_modules/get-intrinsic/index.js\"(exports, module) {\n    \"use strict\";\n    var undefined2;\n    var $SyntaxError = SyntaxError;\n    var $Function = Function;\n    var $TypeError = TypeError;\n    var getEvalledConstructor = function (expressionSyntax) {\n      try {\n        return $Function('\"use strict\"; return (' + expressionSyntax + \").constructor;\")();\n      } catch (e) {}\n    };\n    var $gOPD = Object.getOwnPropertyDescriptor;\n    if ($gOPD) {\n      try {\n        $gOPD({}, \"\");\n      } catch (e) {\n        $gOPD = null;\n      }\n    }\n    var throwTypeError = function () {\n      throw new $TypeError();\n    };\n    var ThrowTypeError = $gOPD\n      ? (function () {\n          try {\n            arguments.callee;\n            return throwTypeError;\n          } catch (calleeThrows) {\n            try {\n              return $gOPD(arguments, \"callee\").get;\n            } catch (gOPDthrows) {\n              return throwTypeError;\n            }\n          }\n        })()\n      : throwTypeError;\n    var hasSymbols = require_has_symbols()();\n    var getProto =\n      Object.getPrototypeOf ||\n      function (x) {\n        return x.__proto__;\n      };\n    var needsEval = {};\n    var TypedArray = typeof Uint8Array === \"undefined\" ? undefined2 : getProto(Uint8Array);\n    var INTRINSICS = {\n      \"%AggregateError%\": typeof AggregateError === \"undefined\" ? undefined2 : AggregateError,\n      \"%Array%\": Array,\n      \"%ArrayBuffer%\": typeof ArrayBuffer === \"undefined\" ? undefined2 : ArrayBuffer,\n      \"%ArrayIteratorPrototype%\": hasSymbols ? getProto([][Symbol.iterator]()) : undefined2,\n      \"%AsyncFromSyncIteratorPrototype%\": undefined2,\n      \"%AsyncFunction%\": needsEval,\n      \"%AsyncGenerator%\": needsEval,\n      \"%AsyncGeneratorFunction%\": needsEval,\n      \"%AsyncIteratorPrototype%\": needsEval,\n      \"%Atomics%\": typeof Atomics === \"undefined\" ? undefined2 : Atomics,\n      \"%BigInt%\": typeof BigInt === \"undefined\" ? undefined2 : BigInt,\n      \"%BigInt64Array%\": typeof BigInt64Array === \"undefined\" ? undefined2 : BigInt64Array,\n      \"%BigUint64Array%\": typeof BigUint64Array === \"undefined\" ? undefined2 : BigUint64Array,\n      \"%Boolean%\": Boolean,\n      \"%DataView%\": typeof DataView === \"undefined\" ? undefined2 : DataView,\n      \"%Date%\": Date,\n      \"%decodeURI%\": decodeURI,\n      \"%decodeURIComponent%\": decodeURIComponent,\n      \"%encodeURI%\": encodeURI,\n      \"%encodeURIComponent%\": encodeURIComponent,\n      \"%Error%\": Error,\n      \"%eval%\": eval,\n      // eslint-disable-line no-eval\n      \"%EvalError%\": EvalError,\n      \"%Float32Array%\": typeof Float32Array === \"undefined\" ? undefined2 : Float32Array,\n      \"%Float64Array%\": typeof Float64Array === \"undefined\" ? undefined2 : Float64Array,\n      \"%FinalizationRegistry%\": typeof FinalizationRegistry === \"undefined\" ? undefined2 : FinalizationRegistry,\n      \"%Function%\": $Function,\n      \"%GeneratorFunction%\": needsEval,\n      \"%Int8Array%\": typeof Int8Array === \"undefined\" ? undefined2 : Int8Array,\n      \"%Int16Array%\": typeof Int16Array === \"undefined\" ? undefined2 : Int16Array,\n      \"%Int32Array%\": typeof Int32Array === \"undefined\" ? undefined2 : Int32Array,\n      \"%isFinite%\": isFinite,\n      \"%isNaN%\": isNaN,\n      \"%IteratorPrototype%\": hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined2,\n      \"%JSON%\": typeof JSON === \"object\" ? JSON : undefined2,\n      \"%Map%\": typeof Map === \"undefined\" ? undefined2 : Map,\n      \"%MapIteratorPrototype%\":\n        typeof Map === \"undefined\" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Map()[Symbol.iterator]()),\n      \"%Math%\": Math,\n      \"%Number%\": Number,\n      \"%Object%\": Object,\n      \"%parseFloat%\": parseFloat,\n      \"%parseInt%\": parseInt,\n      \"%Promise%\": typeof Promise === \"undefined\" ? undefined2 : Promise,\n      \"%Proxy%\": typeof Proxy === \"undefined\" ? undefined2 : Proxy,\n      \"%RangeError%\": RangeError,\n      \"%ReferenceError%\": ReferenceError,\n      \"%Reflect%\": typeof Reflect === \"undefined\" ? undefined2 : Reflect,\n      \"%RegExp%\": RegExp,\n      \"%Set%\": typeof Set === \"undefined\" ? undefined2 : Set,\n      \"%SetIteratorPrototype%\":\n        typeof Set === \"undefined\" || !hasSymbols ? undefined2 : getProto(/* @__PURE__ */ new Set()[Symbol.iterator]()),\n      \"%SharedArrayBuffer%\": typeof SharedArrayBuffer === \"undefined\" ? undefined2 : SharedArrayBuffer,\n      \"%String%\": String,\n      \"%StringIteratorPrototype%\": hasSymbols ? getProto(\"\"[Symbol.iterator]()) : undefined2,\n      \"%Symbol%\": hasSymbols ? Symbol : undefined2,\n      \"%SyntaxError%\": $SyntaxError,\n      \"%ThrowTypeError%\": ThrowTypeError,\n      \"%TypedArray%\": TypedArray,\n      \"%TypeError%\": $TypeError,\n      \"%Uint8Array%\": typeof Uint8Array === \"undefined\" ? undefined2 : Uint8Array,\n      \"%Uint8ClampedArray%\": typeof Uint8ClampedArray === \"undefined\" ? undefined2 : Uint8ClampedArray,\n      \"%Uint16Array%\": typeof Uint16Array === \"undefined\" ? undefined2 : Uint16Array,\n      \"%Uint32Array%\": typeof Uint32Array === \"undefined\" ? undefined2 : Uint32Array,\n      \"%URIError%\": URIError,\n      \"%WeakMap%\": typeof WeakMap === \"undefined\" ? undefined2 : WeakMap,\n      \"%WeakRef%\": typeof WeakRef === \"undefined\" ? undefined2 : WeakRef,\n      \"%WeakSet%\": typeof WeakSet === \"undefined\" ? undefined2 : WeakSet,\n    };\n    try {\n      null.error;\n    } catch (e) {\n      errorProto = getProto(getProto(e));\n      INTRINSICS[\"%Error.prototype%\"] = errorProto;\n    }\n    var errorProto;\n    var doEval = function doEval2(name) {\n      var value;\n      if (name === \"%AsyncFunction%\") {\n        value = getEvalledConstructor(\"async function () {}\");\n      } else if (name === \"%GeneratorFunction%\") {\n        value = getEvalledConstructor(\"function* () {}\");\n      } else if (name === \"%AsyncGeneratorFunction%\") {\n        value = getEvalledConstructor(\"async function* () {}\");\n      } else if (name === \"%AsyncGenerator%\") {\n        var fn = doEval2(\"%AsyncGeneratorFunction%\");\n        if (fn) {\n          value = fn.prototype;\n        }\n      } else if (name === \"%AsyncIteratorPrototype%\") {\n        var gen = doEval2(\"%AsyncGenerator%\");\n        if (gen) {\n          value = getProto(gen.prototype);\n        }\n      }\n      INTRINSICS[name] = value;\n      return value;\n    };\n    var LEGACY_ALIASES = {\n      \"%ArrayBufferPrototype%\": [\"ArrayBuffer\", \"prototype\"],\n      \"%ArrayPrototype%\": [\"Array\", \"prototype\"],\n      \"%ArrayProto_entries%\": [\"Array\", \"prototype\", \"entries\"],\n      \"%ArrayProto_forEach%\": [\"Array\", \"prototype\", \"forEach\"],\n      \"%ArrayProto_keys%\": [\"Array\", \"prototype\", \"keys\"],\n      \"%ArrayProto_values%\": [\"Array\", \"prototype\", \"values\"],\n      \"%AsyncFunctionPrototype%\": [\"AsyncFunction\", \"prototype\"],\n      \"%AsyncGenerator%\": [\"AsyncGeneratorFunction\", \"prototype\"],\n      \"%AsyncGeneratorPrototype%\": [\"AsyncGeneratorFunction\", \"prototype\", \"prototype\"],\n      \"%BooleanPrototype%\": [\"Boolean\", \"prototype\"],\n      \"%DataViewPrototype%\": [\"DataView\", \"prototype\"],\n      \"%DatePrototype%\": [\"Date\", \"prototype\"],\n      \"%ErrorPrototype%\": [\"Error\", \"prototype\"],\n      \"%EvalErrorPrototype%\": [\"EvalError\", \"prototype\"],\n      \"%Float32ArrayPrototype%\": [\"Float32Array\", \"prototype\"],\n      \"%Float64ArrayPrototype%\": [\"Float64Array\", \"prototype\"],\n      \"%FunctionPrototype%\": [\"Function\", \"prototype\"],\n      \"%Generator%\": [\"GeneratorFunction\", \"prototype\"],\n      \"%GeneratorPrototype%\": [\"GeneratorFunction\", \"prototype\", \"prototype\"],\n      \"%Int8ArrayPrototype%\": [\"Int8Array\", \"prototype\"],\n      \"%Int16ArrayPrototype%\": [\"Int16Array\", \"prototype\"],\n      \"%Int32ArrayPrototype%\": [\"Int32Array\", \"prototype\"],\n      \"%JSONParse%\": [\"JSON\", \"parse\"],\n      \"%JSONStringify%\": [\"JSON\", \"stringify\"],\n      \"%MapPrototype%\": [\"Map\", \"prototype\"],\n      \"%NumberPrototype%\": [\"Number\", \"prototype\"],\n      \"%ObjectPrototype%\": [\"Object\", \"prototype\"],\n      \"%ObjProto_toString%\": [\"Object\", \"prototype\", \"toString\"],\n      \"%ObjProto_valueOf%\": [\"Object\", \"prototype\", \"valueOf\"],\n      \"%PromisePrototype%\": [\"Promise\", \"prototype\"],\n      \"%PromiseProto_then%\": [\"Promise\", \"prototype\", \"then\"],\n      \"%Promise_all%\": [\"Promise\", \"all\"],\n      \"%Promise_reject%\": [\"Promise\", \"reject\"],\n      \"%Promise_resolve%\": [\"Promise\", \"resolve\"],\n      \"%RangeErrorPrototype%\": [\"RangeError\", \"prototype\"],\n      \"%ReferenceErrorPrototype%\": [\"ReferenceError\", \"prototype\"],\n      \"%RegExpPrototype%\": [\"RegExp\", \"prototype\"],\n      \"%SetPrototype%\": [\"Set\", \"prototype\"],\n      \"%SharedArrayBufferPrototype%\": [\"SharedArrayBuffer\", \"prototype\"],\n      \"%StringPrototype%\": [\"String\", \"prototype\"],\n      \"%SymbolPrototype%\": [\"Symbol\", \"prototype\"],\n      \"%SyntaxErrorPrototype%\": [\"SyntaxError\", \"prototype\"],\n      \"%TypedArrayPrototype%\": [\"TypedArray\", \"prototype\"],\n      \"%TypeErrorPrototype%\": [\"TypeError\", \"prototype\"],\n      \"%Uint8ArrayPrototype%\": [\"Uint8Array\", \"prototype\"],\n      \"%Uint8ClampedArrayPrototype%\": [\"Uint8ClampedArray\", \"prototype\"],\n      \"%Uint16ArrayPrototype%\": [\"Uint16Array\", \"prototype\"],\n      \"%Uint32ArrayPrototype%\": [\"Uint32Array\", \"prototype\"],\n      \"%URIErrorPrototype%\": [\"URIError\", \"prototype\"],\n      \"%WeakMapPrototype%\": [\"WeakMap\", \"prototype\"],\n      \"%WeakSetPrototype%\": [\"WeakSet\", \"prototype\"],\n    };\n    var bind = require_function_bind4();\n    var hasOwn = require_src();\n    var $concat = bind.call(Function.call, Array.prototype.concat);\n    var $spliceApply = bind.call(Function.apply, Array.prototype.splice);\n    var $replace = bind.call(Function.call, String.prototype.replace);\n    var $strSlice = bind.call(Function.call, String.prototype.slice);\n    var $exec = bind.call(Function.call, RegExp.prototype.exec);\n    var rePropName =\n      /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\n    var reEscapeChar = /\\\\(\\\\)?/g;\n    var stringToPath = function stringToPath2(string) {\n      var first = $strSlice(string, 0, 1);\n      var last = $strSlice(string, -1);\n      if (first === \"%\" && last !== \"%\") {\n        throw new $SyntaxError(\"invalid intrinsic syntax, expected closing `%`\");\n      } else if (last === \"%\" && first !== \"%\") {\n        throw new $SyntaxError(\"invalid intrinsic syntax, expected opening `%`\");\n      }\n      var result = [];\n      $replace(string, rePropName, function (match, number, quote, subString) {\n        result[result.length] = quote ? $replace(subString, reEscapeChar, \"$1\") : number || match;\n      });\n      return result;\n    };\n    var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {\n      var intrinsicName = name;\n      var alias;\n      if (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n        alias = LEGACY_ALIASES[intrinsicName];\n        intrinsicName = \"%\" + alias[0] + \"%\";\n      }\n      if (hasOwn(INTRINSICS, intrinsicName)) {\n        var value = INTRINSICS[intrinsicName];\n        if (value === needsEval) {\n          value = doEval(intrinsicName);\n        }\n        if (typeof value === \"undefined\" && !allowMissing) {\n          throw new $TypeError(\"intrinsic \" + name + \" exists, but is not available. Please file an issue!\");\n        }\n        return {\n          alias,\n          name: intrinsicName,\n          value,\n        };\n      }\n      throw new $SyntaxError(\"intrinsic \" + name + \" does not exist!\");\n    };\n    module.exports = function GetIntrinsic(name, allowMissing) {\n      if (typeof name !== \"string\" || name.length === 0) {\n        throw new $TypeError(\"intrinsic name must be a non-empty string\");\n      }\n      if (arguments.length > 1 && typeof allowMissing !== \"boolean\") {\n        throw new $TypeError('\"allowMissing\" argument must be a boolean');\n      }\n      if ($exec(/^%?[^%]*%?$/, name) === null) {\n        throw new $SyntaxError(\"`%` may not be present anywhere but at the beginning and end of the intrinsic name\");\n      }\n      var parts = stringToPath(name);\n      var intrinsicBaseName = parts.length > 0 ? parts[0] : \"\";\n      var intrinsic = getBaseIntrinsic(\"%\" + intrinsicBaseName + \"%\", allowMissing);\n      var intrinsicRealName = intrinsic.name;\n      var value = intrinsic.value;\n      var skipFurtherCaching = false;\n      var alias = intrinsic.alias;\n      if (alias) {\n        intrinsicBaseName = alias[0];\n        $spliceApply(parts, $concat([0, 1], alias));\n      }\n      for (var i = 1, isOwn = true; i < parts.length; i += 1) {\n        var part = parts[i];\n        var first = $strSlice(part, 0, 1);\n        var last = $strSlice(part, -1);\n        if (\n          (first === '\"' || first === \"'\" || first === \"`\" || last === '\"' || last === \"'\" || last === \"`\") &&\n          first !== last\n        ) {\n          throw new $SyntaxError(\"property names with quotes must have matching quotes\");\n        }\n        if (part === \"constructor\" || !isOwn) {\n          skipFurtherCaching = true;\n        }\n        intrinsicBaseName += \".\" + part;\n        intrinsicRealName = \"%\" + intrinsicBaseName + \"%\";\n        if (hasOwn(INTRINSICS, intrinsicRealName)) {\n          value = INTRINSICS[intrinsicRealName];\n        } else if (value != null) {\n          if (!(part in value)) {\n            if (!allowMissing) {\n              throw new $TypeError(\"base intrinsic for \" + name + \" exists, but the property is not available.\");\n            }\n            return void 0;\n          }\n          if ($gOPD && i + 1 >= parts.length) {\n            var desc = $gOPD(value, part);\n            isOwn = !!desc;\n            if (isOwn && \"get\" in desc && !(\"originalValue\" in desc.get)) {\n              value = desc.get;\n            } else {\n              value = value[part];\n            }\n          } else {\n            isOwn = hasOwn(value, part);\n            value = value[part];\n          }\n          if (isOwn && !skipFurtherCaching) {\n            INTRINSICS[intrinsicRealName] = value;\n          }\n        }\n      }\n      return value;\n    };\n  },\n});\n\n// ../../node_modules/gopd/index.js\nvar require_gopd = __commonJS({\n  \"../../node_modules/gopd/index.js\"(exports, module) {\n    \"use strict\";\n    var GetIntrinsic = require_get_intrinsic3();\n    var $gOPD = GetIntrinsic(\"%Object.getOwnPropertyDescriptor%\", true);\n    if ($gOPD) {\n      try {\n        $gOPD([], \"length\");\n      } catch (e) {\n        $gOPD = null;\n      }\n    }\n    module.exports = $gOPD;\n  },\n});\n\n// ../../node_modules/util/node_modules/is-typed-array/index.js\nvar require_is_typed_array = __commonJS({\n  \"../../node_modules/util/node_modules/is-typed-array/index.js\"(exports, module) {\n    \"use strict\";\n    var forEach = require_for_each();\n    var availableTypedArrays = require_available_typed_arrays();\n    var callBound = require_callBound2();\n    var $toString = callBound(\"Object.prototype.toString\");\n    var hasToStringTag = require_shams2()();\n    var gOPD = require_gopd();\n    var g = typeof globalThis === \"undefined\" ? global : globalThis;\n    var typedArrays = availableTypedArrays();\n    var $indexOf =\n      callBound(\"Array.prototype.indexOf\", true) ||\n      function indexOf(array, value) {\n        for (var i = 0; i < array.length; i += 1) {\n          if (array[i] === value) {\n            return i;\n          }\n        }\n        return -1;\n      };\n    var $slice = callBound(\"String.prototype.slice\");\n    var toStrTags = {};\n    var getPrototypeOf = Object.getPrototypeOf;\n    if (hasToStringTag && gOPD && getPrototypeOf) {\n      forEach(typedArrays, function (typedArray) {\n        var arr = new g[typedArray]();\n        if (Symbol.toStringTag in arr) {\n          var proto = getPrototypeOf(arr);\n          var descriptor = gOPD(proto, Symbol.toStringTag);\n          if (!descriptor) {\n            var superProto = getPrototypeOf(proto);\n            descriptor = gOPD(superProto, Symbol.toStringTag);\n          }\n          toStrTags[typedArray] = descriptor.get;\n        }\n      });\n    }\n    var tryTypedArrays = function tryAllTypedArrays(value) {\n      var anyTrue = false;\n      forEach(toStrTags, function (getter, typedArray) {\n        if (!anyTrue) {\n          try {\n            anyTrue = getter.call(value) === typedArray;\n          } catch (e) {}\n        }\n      });\n      return anyTrue;\n    };\n    module.exports = function isTypedArray(value) {\n      if (!value || typeof value !== \"object\") {\n        return false;\n      }\n      if (!hasToStringTag || !(Symbol.toStringTag in value)) {\n        var tag = $slice($toString(value), 8, -1);\n        return $indexOf(typedArrays, tag) > -1;\n      }\n      if (!gOPD) {\n        return false;\n      }\n      return tryTypedArrays(value);\n    };\n  },\n});\n\n// ../../node_modules/util/node_modules/which-typed-array/index.js\nvar require_which_typed_array = __commonJS({\n  \"../../node_modules/util/node_modules/which-typed-array/index.js\"(exports, module) {\n    \"use strict\";\n    var forEach = require_for_each();\n    var availableTypedArrays = require_available_typed_arrays();\n    var callBound = require_callBound2();\n    var gOPD = require_gopd();\n    var $toString = callBound(\"Object.prototype.toString\");\n    var hasToStringTag = require_shams2()();\n    var g = typeof globalThis === \"undefined\" ? global : globalThis;\n    var typedArrays = availableTypedArrays();\n    var $slice = callBound(\"String.prototype.slice\");\n    var toStrTags = {};\n    var getPrototypeOf = Object.getPrototypeOf;\n    if (hasToStringTag && gOPD && getPrototypeOf) {\n      forEach(typedArrays, function (typedArray) {\n        if (typeof g[typedArray] === \"function\") {\n          var arr = new g[typedArray]();\n          if (Symbol.toStringTag in arr) {\n            var proto = getPrototypeOf(arr);\n            var descriptor = gOPD(proto, Symbol.toStringTag);\n            if (!descriptor) {\n              var superProto = getPrototypeOf(proto);\n              descriptor = gOPD(superProto, Symbol.toStringTag);\n            }\n            toStrTags[typedArray] = descriptor.get;\n          }\n        }\n      });\n    }\n    var tryTypedArrays = function tryAllTypedArrays(value) {\n      var foundName = false;\n      forEach(toStrTags, function (getter, typedArray) {\n        if (!foundName) {\n          try {\n            var name = getter.call(value);\n            if (name === typedArray) {\n              foundName = name;\n            }\n          } catch (e) {}\n        }\n      });\n      return foundName;\n    };\n    var isTypedArray = require_is_typed_array();\n    module.exports = function whichTypedArray(value) {\n      if (!isTypedArray(value)) {\n        return false;\n      }\n      if (!hasToStringTag || !(Symbol.toStringTag in value)) {\n        return $slice($toString(value), 8, -1);\n      }\n      return tryTypedArrays(value);\n    };\n  },\n});\n\n// ../../node_modules/util/support/types.js\nvar require_types = __commonJS({\n  \"../../node_modules/util/support/types.js\"(exports) {\n    \"use strict\";\n    var isArgumentsObject = require_is_arguments();\n    var isGeneratorFunction = require_is_generator_function();\n    var whichTypedArray = require_which_typed_array();\n    var isTypedArray = require_is_typed_array();\n    function uncurryThis(f) {\n      return f.call.bind(f);\n    }\n    var BigIntSupported = typeof BigInt !== \"undefined\";\n    var SymbolSupported = typeof Symbol !== \"undefined\";\n    var ObjectToString = uncurryThis(Object.prototype.toString);\n    var numberValue = uncurryThis(Number.prototype.valueOf);\n    var stringValue = uncurryThis(String.prototype.valueOf);\n    var booleanValue = uncurryThis(Boolean.prototype.valueOf);\n    if (BigIntSupported) {\n      bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n    }\n    var bigIntValue;\n    if (SymbolSupported) {\n      symbolValue = uncurryThis(Symbol.prototype.valueOf);\n    }\n    var symbolValue;\n    function checkBoxedPrimitive(value, prototypeValueOf) {\n      if (typeof value !== \"object\") {\n        return false;\n      }\n      try {\n        prototypeValueOf(value);\n        return true;\n      } catch (e) {\n        return false;\n      }\n    }\n    exports.isArgumentsObject = isArgumentsObject;\n    exports.isGeneratorFunction = isGeneratorFunction;\n    exports.isTypedArray = isTypedArray;\n    function isPromise(input) {\n      return (\n        (typeof Promise !== \"undefined\" && input instanceof Promise) ||\n        (input !== null &&\n          typeof input === \"object\" &&\n          typeof input.then === \"function\" &&\n          typeof input.catch === \"function\")\n      );\n    }\n    exports.isPromise = isPromise;\n    function isArrayBufferView(value) {\n      if (typeof ArrayBuffer !== \"undefined\" && ArrayBuffer.isView) {\n        return ArrayBuffer.isView(value);\n      }\n      return isTypedArray(value) || isDataView(value);\n    }\n    exports.isArrayBufferView = isArrayBufferView;\n    function isUint8Array(value) {\n      return whichTypedArray(value) === \"Uint8Array\";\n    }\n    exports.isUint8Array = isUint8Array;\n    function isUint8ClampedArray(value) {\n      return whichTypedArray(value) === \"Uint8ClampedArray\";\n    }\n    exports.isUint8ClampedArray = isUint8ClampedArray;\n    function isUint16Array(value) {\n      return whichTypedArray(value) === \"Uint16Array\";\n    }\n    exports.isUint16Array = isUint16Array;\n    function isUint32Array(value) {\n      return whichTypedArray(value) === \"Uint32Array\";\n    }\n    exports.isUint32Array = isUint32Array;\n    function isInt8Array(value) {\n      return whichTypedArray(value) === \"Int8Array\";\n    }\n    exports.isInt8Array = isInt8Array;\n    function isInt16Array(value) {\n      return whichTypedArray(value) === \"Int16Array\";\n    }\n    exports.isInt16Array = isInt16Array;\n    function isInt32Array(value) {\n      return whichTypedArray(value) === \"Int32Array\";\n    }\n    exports.isInt32Array = isInt32Array;\n    function isFloat32Array(value) {\n      return whichTypedArray(value) === \"Float32Array\";\n    }\n    exports.isFloat32Array = isFloat32Array;\n    function isFloat64Array(value) {\n      return whichTypedArray(value) === \"Float64Array\";\n    }\n    exports.isFloat64Array = isFloat64Array;\n    function isBigInt64Array(value) {\n      return whichTypedArray(value) === \"BigInt64Array\";\n    }\n    exports.isBigInt64Array = isBigInt64Array;\n    function isBigUint64Array(value) {\n      return whichTypedArray(value) === \"BigUint64Array\";\n    }\n    exports.isBigUint64Array = isBigUint64Array;\n    function isMapToString(value) {\n      return ObjectToString(value) === \"[object Map]\";\n    }\n    isMapToString.working = typeof Map !== \"undefined\" && isMapToString(/* @__PURE__ */ new Map());\n    function isMap(value) {\n      if (typeof Map === \"undefined\") {\n        return false;\n      }\n      return isMapToString.working ? isMapToString(value) : value instanceof Map;\n    }\n    exports.isMap = isMap;\n    function isSetToString(value) {\n      return ObjectToString(value) === \"[object Set]\";\n    }\n    isSetToString.working = typeof Set !== \"undefined\" && isSetToString(/* @__PURE__ */ new Set());\n    function isSet(value) {\n      if (typeof Set === \"undefined\") {\n        return false;\n      }\n      return isSetToString.working ? isSetToString(value) : value instanceof Set;\n    }\n    exports.isSet = isSet;\n    function isWeakMapToString(value) {\n      return ObjectToString(value) === \"[object WeakMap]\";\n    }\n    isWeakMapToString.working = typeof WeakMap !== \"undefined\" && isWeakMapToString(/* @__PURE__ */ new WeakMap());\n    function isWeakMap(value) {\n      if (typeof WeakMap === \"undefined\") {\n        return false;\n      }\n      return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;\n    }\n    exports.isWeakMap = isWeakMap;\n    function isWeakSetToString(value) {\n      return ObjectToString(value) === \"[object WeakSet]\";\n    }\n    isWeakSetToString.working = typeof WeakSet !== \"undefined\" && isWeakSetToString(/* @__PURE__ */ new WeakSet());\n    function isWeakSet(value) {\n      return isWeakSetToString(value);\n    }\n    exports.isWeakSet = isWeakSet;\n    function isArrayBufferToString(value) {\n      return ObjectToString(value) === \"[object ArrayBuffer]\";\n    }\n    isArrayBufferToString.working = typeof ArrayBuffer !== \"undefined\" && isArrayBufferToString(new ArrayBuffer());\n    function isArrayBuffer(value) {\n      if (typeof ArrayBuffer === \"undefined\") {\n        return false;\n      }\n      return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;\n    }\n    exports.isArrayBuffer = isArrayBuffer;\n    function isDataViewToString(value) {\n      return ObjectToString(value) === \"[object DataView]\";\n    }\n    isDataViewToString.working =\n      typeof ArrayBuffer !== \"undefined\" &&\n      typeof DataView !== \"undefined\" &&\n      isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));\n    function isDataView(value) {\n      if (typeof DataView === \"undefined\") {\n        return false;\n      }\n      return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;\n    }\n    exports.isDataView = isDataView;\n    var SharedArrayBufferCopy = typeof SharedArrayBuffer !== \"undefined\" ? SharedArrayBuffer : void 0;\n    function isSharedArrayBufferToString(value) {\n      return ObjectToString(value) === \"[object SharedArrayBuffer]\";\n    }\n    function isSharedArrayBuffer(value) {\n      if (typeof SharedArrayBufferCopy === \"undefined\") {\n        return false;\n      }\n      if (typeof isSharedArrayBufferToString.working === \"undefined\") {\n        isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n      }\n      return isSharedArrayBufferToString.working\n        ? isSharedArrayBufferToString(value)\n        : value instanceof SharedArrayBufferCopy;\n    }\n    exports.isSharedArrayBuffer = isSharedArrayBuffer;\n    function isAsyncFunction(value) {\n      return ObjectToString(value) === \"[object AsyncFunction]\";\n    }\n    exports.isAsyncFunction = isAsyncFunction;\n    function isMapIterator(value) {\n      return ObjectToString(value) === \"[object Map Iterator]\";\n    }\n    exports.isMapIterator = isMapIterator;\n    function isSetIterator(value) {\n      return ObjectToString(value) === \"[object Set Iterator]\";\n    }\n    exports.isSetIterator = isSetIterator;\n    function isGeneratorObject(value) {\n      return ObjectToString(value) === \"[object Generator]\";\n    }\n    exports.isGeneratorObject = isGeneratorObject;\n    function isWebAssemblyCompiledModule(value) {\n      return ObjectToString(value) === \"[object WebAssembly.Module]\";\n    }\n    exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n    function isNumberObject(value) {\n      return checkBoxedPrimitive(value, numberValue);\n    }\n    exports.isNumberObject = isNumberObject;\n    function isStringObject(value) {\n      return checkBoxedPrimitive(value, stringValue);\n    }\n    exports.isStringObject = isStringObject;\n    function isBooleanObject(value) {\n      return checkBoxedPrimitive(value, booleanValue);\n    }\n    exports.isBooleanObject = isBooleanObject;\n    function isBigIntObject(value) {\n      return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n    }\n    exports.isBigIntObject = isBigIntObject;\n    function isSymbolObject(value) {\n      return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n    }\n    exports.isSymbolObject = isSymbolObject;\n    function isBoxedPrimitive(value) {\n      return (\n        isNumberObject(value) ||\n        isStringObject(value) ||\n        isBooleanObject(value) ||\n        isBigIntObject(value) ||\n        isSymbolObject(value)\n      );\n    }\n    exports.isBoxedPrimitive = isBoxedPrimitive;\n    function isAnyArrayBuffer(value) {\n      return typeof Uint8Array !== \"undefined\" && (isArrayBuffer(value) || isSharedArrayBuffer(value));\n    }\n    exports.isAnyArrayBuffer = isAnyArrayBuffer;\n    [\"isProxy\", \"isExternal\", \"isModuleNamespaceObject\"].forEach(function (method) {\n      Object.defineProperty(exports, method, {\n        enumerable: false,\n        value: function () {\n          throw new Error(method + \" is not supported in userland\");\n        },\n      });\n    });\n  },\n});\n\n// ../../node_modules/util/support/isBufferBrowser.js\nvar require_isBufferBrowser = __commonJS({\n  \"../../node_modules/util/support/isBufferBrowser.js\"(exports, module) {\n    module.exports = function isBuffer(arg) {\n      return (\n        arg &&\n        typeof arg === \"object\" &&\n        typeof arg.copy === \"function\" &&\n        typeof arg.fill === \"function\" &&\n        typeof arg.readUInt8 === \"function\"\n      );\n    };\n  },\n});\n\n// ../../node_modules/util/util.js\nvar require_util = __commonJS({\n  \"../../node_modules/util/util.js\"(exports) {\n    var getOwnPropertyDescriptors =\n      Object.getOwnPropertyDescriptors ||\n      function getOwnPropertyDescriptors2(obj) {\n        var keys = Object.keys(obj);\n        var descriptors = {};\n        for (var i = 0; i < keys.length; i++) {\n          descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n        }\n        return descriptors;\n      };\n    var formatRegExp = /%[sdj%]/g;\n    exports.format = function (f) {\n      if (!isString(f)) {\n        var objects = [];\n        for (var i = 0; i < arguments.length; i++) {\n          objects.push(inspect(arguments[i]));\n        }\n        return objects.join(\" \");\n      }\n      var i = 1;\n      var args = arguments;\n      var len = args.length;\n      var str = String(f).replace(formatRegExp, function (x2) {\n        if (x2 === \"%%\") return \"%\";\n        if (i >= len) return x2;\n        switch (x2) {\n          case \"%s\":\n            return String(args[i++]);\n          case \"%d\":\n            return Number(args[i++]);\n          case \"%j\":\n            try {\n              return JSON.stringify(args[i++]);\n            } catch (_) {\n              return \"[Circular]\";\n            }\n          default:\n            return x2;\n        }\n      });\n      for (var x = args[i]; i < len; x = args[++i]) {\n        if (isNull(x) || !isObject(x)) {\n          str += \" \" + x;\n        } else {\n          str += \" \" + inspect(x);\n        }\n      }\n      return str;\n    };\n    exports.deprecate = function (fn, msg) {\n      if (typeof process !== \"undefined\" && process.noDeprecation === true) {\n        return fn;\n      }\n      if (typeof process === \"undefined\") {\n        return function () {\n          return exports.deprecate(fn, msg).apply(this, arguments);\n        };\n      }\n      var warned = false;\n      function deprecated() {\n        if (!warned) {\n          if (process.throwDeprecation) {\n            throw new Error(msg);\n          } else if (process.traceDeprecation) {\n            console.trace(msg);\n          } else {\n            console.error(msg);\n          }\n          warned = true;\n        }\n        return fn.apply(this, arguments);\n      }\n      return deprecated;\n    };\n    var debugs = {};\n    var debugEnvRegex = /^$/;\n    if (process.env.NODE_DEBUG) {\n      debugEnv = process.env.NODE_DEBUG;\n      debugEnv = debugEnv\n        .replace(/[|\\\\{}()[\\]^$+?.]/g, \"\\\\$&\")\n        .replace(/\\*/g, \".*\")\n        .replace(/,/g, \"$|^\")\n        .toUpperCase();\n      debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\n    }\n    var debugEnv;\n    exports.debuglog = function (set) {\n      set = set.toUpperCase();\n      if (!debugs[set]) {\n        if (debugEnvRegex.test(set)) {\n          var pid = process.pid;\n          debugs[set] = function () {\n            var msg = exports.format.apply(exports, arguments);\n            console.error(\"%s %d: %s\", set, pid, msg);\n          };\n        } else {\n          debugs[set] = function () {};\n        }\n      }\n      return debugs[set];\n    };\n    function inspect(obj, opts) {\n      var ctx = {\n        seen: [],\n        stylize: stylizeNoColor,\n      };\n      if (arguments.length >= 3) ctx.depth = arguments[2];\n      if (arguments.length >= 4) ctx.colors = arguments[3];\n      if (isBoolean(opts)) {\n        ctx.showHidden = opts;\n      } else if (opts) {\n        exports._extend(ctx, opts);\n      }\n      if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n      if (isUndefined(ctx.depth)) ctx.depth = 2;\n      if (isUndefined(ctx.colors)) ctx.colors = false;\n      if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n      if (ctx.colors) ctx.stylize = stylizeWithColor;\n      return formatValue(ctx, obj, ctx.depth);\n    }\n    exports.inspect = inspect;\n    inspect.colors = {\n      bold: [1, 22],\n      italic: [3, 23],\n      underline: [4, 24],\n      inverse: [7, 27],\n      white: [37, 39],\n      grey: [90, 39],\n      black: [30, 39],\n      blue: [34, 39],\n      cyan: [36, 39],\n      green: [32, 39],\n      magenta: [35, 39],\n      red: [31, 39],\n      yellow: [33, 39],\n    };\n    inspect.styles = {\n      special: \"cyan\",\n      number: \"yellow\",\n      boolean: \"yellow\",\n      undefined: \"grey\",\n      null: \"bold\",\n      string: \"green\",\n      date: \"magenta\",\n      // \"name\": intentionally not styling\n      regexp: \"red\",\n    };\n    function stylizeWithColor(str, styleType) {\n      var style = inspect.styles[styleType];\n      if (style) {\n        return \"\\x1B[\" + inspect.colors[style][0] + \"m\" + str + \"\\x1B[\" + inspect.colors[style][1] + \"m\";\n      } else {\n        return str;\n      }\n    }\n    function stylizeNoColor(str, styleType) {\n      return str;\n    }\n    function arrayToHash(array) {\n      var hash = {};\n      array.forEach(function (val, idx) {\n        hash[val] = true;\n      });\n      return hash;\n    }\n    function formatValue(ctx, value, recurseTimes) {\n      if (\n        ctx.customInspect &&\n        value &&\n        isFunction(value.inspect) && // Filter out the util module, it's inspect function is special\n        value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check.\n        !(value.constructor && value.constructor.prototype === value)\n      ) {\n        var ret = value.inspect(recurseTimes, ctx);\n        if (!isString(ret)) {\n          ret = formatValue(ctx, ret, recurseTimes);\n        }\n        return ret;\n      }\n      var primitive = formatPrimitive(ctx, value);\n      if (primitive) {\n        return primitive;\n      }\n      var keys = Object.keys(value);\n      var visibleKeys = arrayToHash(keys);\n      if (ctx.showHidden) {\n        keys = Object.getOwnPropertyNames(value);\n      }\n      if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0)) {\n        return formatError(value);\n      }\n      if (keys.length === 0) {\n        if (isFunction(value)) {\n          var name = value.name ? \": \" + value.name : \"\";\n          return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n        }\n        if (isRegExp(value)) {\n          return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n        }\n        if (isDate(value)) {\n          return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n        }\n        if (isError(value)) {\n          return formatError(value);\n        }\n      }\n      var base = \"\",\n        array = false,\n        braces = [\"{\", \"}\"];\n      if (isArray(value)) {\n        array = true;\n        braces = [\"[\", \"]\"];\n      }\n      if (isFunction(value)) {\n        var n = value.name ? \": \" + value.name : \"\";\n        base = \" [Function\" + n + \"]\";\n      }\n      if (isRegExp(value)) {\n        base = \" \" + RegExp.prototype.toString.call(value);\n      }\n      if (isDate(value)) {\n        base = \" \" + Date.prototype.toUTCString.call(value);\n      }\n      if (isError(value)) {\n        base = \" \" + formatError(value);\n      }\n      if (keys.length === 0 && (!array || value.length == 0)) {\n        return braces[0] + base + braces[1];\n      }\n      if (recurseTimes < 0) {\n        if (isRegExp(value)) {\n          return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n        } else {\n          return ctx.stylize(\"[Object]\", \"special\");\n        }\n      }\n      ctx.seen.push(value);\n      var output;\n      if (array) {\n        output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n      } else {\n        output = keys.map(function (key) {\n          return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n        });\n      }\n      ctx.seen.pop();\n      return reduceToSingleString(output, base, braces);\n    }\n    function formatPrimitive(ctx, value) {\n      if (isUndefined(value)) return ctx.stylize(\"undefined\", \"undefined\");\n      if (isString(value)) {\n        var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n        return ctx.stylize(simple, \"string\");\n      }\n      if (isNumber(value)) return ctx.stylize(\"\" + value, \"number\");\n      if (isBoolean(value)) return ctx.stylize(\"\" + value, \"boolean\");\n      if (isNull(value)) return ctx.stylize(\"null\", \"null\");\n    }\n    function formatError(value) {\n      return \"[\" + Error.prototype.toString.call(value) + \"]\";\n    }\n    function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n      var output = [];\n      for (var i = 0, l = value.length; i < l; ++i) {\n        if (hasOwnProperty(value, String(i))) {\n          output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));\n        } else {\n          output.push(\"\");\n        }\n      }\n      keys.forEach(function (key) {\n        if (!key.match(/^\\d+$/)) {\n          output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));\n        }\n      });\n      return output;\n    }\n    function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n      var name, str, desc;\n      desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n      if (desc.get) {\n        if (desc.set) {\n          str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n        } else {\n          str = ctx.stylize(\"[Getter]\", \"special\");\n        }\n      } else {\n        if (desc.set) {\n          str = ctx.stylize(\"[Setter]\", \"special\");\n        }\n      }\n      if (!hasOwnProperty(visibleKeys, key)) {\n        name = \"[\" + key + \"]\";\n      }\n      if (!str) {\n        if (ctx.seen.indexOf(desc.value) < 0) {\n          if (isNull(recurseTimes)) {\n            str = formatValue(ctx, desc.value, null);\n          } else {\n            str = formatValue(ctx, desc.value, recurseTimes - 1);\n          }\n          if (str.indexOf(\"\\n\") > -1) {\n            if (array) {\n              str = str\n                .split(\"\\n\")\n                .map(function (line) {\n                  return \"  \" + line;\n                })\n                .join(\"\\n\")\n                .slice(2);\n            } else {\n              str =\n                \"\\n\" +\n                str\n                  .split(\"\\n\")\n                  .map(function (line) {\n                    return \"   \" + line;\n                  })\n                  .join(\"\\n\");\n            }\n          }\n        } else {\n          str = ctx.stylize(\"[Circular]\", \"special\");\n        }\n      }\n      if (isUndefined(name)) {\n        if (array && key.match(/^\\d+$/)) {\n          return str;\n        }\n        name = JSON.stringify(\"\" + key);\n        if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n          name = name.slice(1, -1);\n          name = ctx.stylize(name, \"name\");\n        } else {\n          name = name\n            .replace(/'/g, \"\\\\'\")\n            .replace(/\\\\\"/g, '\"')\n            .replace(/(^\"|\"$)/g, \"'\");\n          name = ctx.stylize(name, \"string\");\n        }\n      }\n      return name + \": \" + str;\n    }\n    function reduceToSingleString(output, base, braces) {\n      var numLinesEst = 0;\n      var length = output.reduce(function (prev, cur) {\n        numLinesEst++;\n        if (cur.indexOf(\"\\n\") >= 0) numLinesEst++;\n        return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, \"\").length + 1;\n      }, 0);\n      if (length > 60) {\n        return braces[0] + (base === \"\" ? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n  \") + \" \" + braces[1];\n      }\n      return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n    }\n    exports.types = require_types();\n    function isArray(ar) {\n      return Array.isArray(ar);\n    }\n    exports.isArray = isArray;\n    function isBoolean(arg) {\n      return typeof arg === \"boolean\";\n    }\n    exports.isBoolean = isBoolean;\n    function isNull(arg) {\n      return arg === null;\n    }\n    exports.isNull = isNull;\n    function isNullOrUndefined(arg) {\n      return arg == null;\n    }\n    exports.isNullOrUndefined = isNullOrUndefined;\n    function isNumber(arg) {\n      return typeof arg === \"number\";\n    }\n    exports.isNumber = isNumber;\n    function isString(arg) {\n      return typeof arg === \"string\";\n    }\n    exports.isString = isString;\n    function isSymbol(arg) {\n      return typeof arg === \"symbol\";\n    }\n    exports.isSymbol = isSymbol;\n    function isUndefined(arg) {\n      return arg === void 0;\n    }\n    exports.isUndefined = isUndefined;\n    function isRegExp(re) {\n      return isObject(re) && objectToString(re) === \"[object RegExp]\";\n    }\n    exports.isRegExp = isRegExp;\n    exports.types.isRegExp = isRegExp;\n    function isObject(arg) {\n      return typeof arg === \"object\" && arg !== null;\n    }\n    exports.isObject = isObject;\n    function isDate(d) {\n      return isObject(d) && objectToString(d) === \"[object Date]\";\n    }\n    exports.isDate = isDate;\n    exports.types.isDate = isDate;\n    function isError(e) {\n      return isObject(e) && (objectToString(e) === \"[object Error]\" || e instanceof Error);\n    }\n    exports.isError = isError;\n    exports.types.isNativeError = isError;\n    function isFunction(arg) {\n      return typeof arg === \"function\";\n    }\n    exports.isFunction = isFunction;\n    function isPrimitive(arg) {\n      return (\n        arg === null ||\n        typeof arg === \"boolean\" ||\n        typeof arg === \"number\" ||\n        typeof arg === \"string\" ||\n        typeof arg === \"symbol\" || // ES6 symbol\n        typeof arg === \"undefined\"\n      );\n    }\n    exports.isPrimitive = isPrimitive;\n    exports.isBuffer = require_isBufferBrowser();\n    function objectToString(o) {\n      return Object.prototype.toString.call(o);\n    }\n    function pad(n) {\n      return n < 10 ? \"0\" + n.toString(10) : n.toString(10);\n    }\n    var months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n    function timestamp() {\n      var d = /* @__PURE__ */ new Date();\n      var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n      return [d.getDate(), months[d.getMonth()], time].join(\" \");\n    }\n    exports.log = function () {\n      console.log(\"%s - %s\", timestamp(), exports.format.apply(exports, arguments));\n    };\n    exports.inherits = require_inherits();\n    exports._extend = function (origin, add) {\n      if (!add || !isObject(add)) return origin;\n      var keys = Object.keys(add);\n      var i = keys.length;\n      while (i--) {\n        origin[keys[i]] = add[keys[i]];\n      }\n      return origin;\n    };\n    function hasOwnProperty(obj, prop) {\n      return Object.prototype.hasOwnProperty.call(obj, prop);\n    }\n    var kCustomPromisifiedSymbol = typeof Symbol !== \"undefined\" ? Symbol(\"util.promisify.custom\") : void 0;\n    exports.promisify = function promisify(original) {\n      if (typeof original !== \"function\") throw new TypeError('The \"original\" argument must be of type Function');\n      if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n        var fn = original[kCustomPromisifiedSymbol];\n        if (typeof fn !== \"function\") {\n          throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n        }\n        Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n          value: fn,\n          enumerable: false,\n          writable: false,\n          configurable: true,\n        });\n        return fn;\n      }\n      function fn() {\n        var promiseResolve, promiseReject;\n        var promise = new Promise(function (resolve, reject) {\n          promiseResolve = resolve;\n          promiseReject = reject;\n        });\n        var args = [];\n        for (var i = 0; i < arguments.length; i++) {\n          args.push(arguments[i]);\n        }\n        args.push(function (err, value) {\n          if (err) {\n            promiseReject(err);\n          } else {\n            promiseResolve(value);\n          }\n        });\n        try {\n          original.apply(this, args);\n        } catch (err) {\n          promiseReject(err);\n        }\n        return promise;\n      }\n      Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n      if (kCustomPromisifiedSymbol)\n        Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n          value: fn,\n          enumerable: false,\n          writable: false,\n          configurable: true,\n        });\n      return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n    };\n    exports.promisify.custom = kCustomPromisifiedSymbol;\n    function callbackifyOnRejected(reason, cb) {\n      if (!reason) {\n        var newReason = new Error(\"Promise was rejected with a falsy value\");\n        newReason.reason = reason;\n        reason = newReason;\n      }\n      return cb(reason);\n    }\n    function callbackify(original) {\n      if (typeof original !== \"function\") {\n        throw new TypeError('The \"original\" argument must be of type Function');\n      }\n      function callbackified() {\n        var args = [];\n        for (var i = 0; i < arguments.length; i++) {\n          args.push(arguments[i]);\n        }\n        var maybeCb = args.pop();\n        if (typeof maybeCb !== \"function\") {\n          throw new TypeError(\"The last argument must be of type Function\");\n        }\n        var self2 = this;\n        var cb = function () {\n          return maybeCb.apply(self2, arguments);\n        };\n        original.apply(this, args).then(\n          function (ret) {\n            process.nextTick(cb.bind(null, null, ret));\n          },\n          function (rej) {\n            process.nextTick(callbackifyOnRejected.bind(null, rej, cb));\n          }\n        );\n      }\n      Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n      Object.defineProperties(callbackified, getOwnPropertyDescriptors(original));\n      return callbackified;\n    }\n    exports.callbackify = callbackify;\n  },\n});\n\n// ../../node_modules/inherits/inherits_browser.js\nvar require_inherits_browser = __commonJS({\n  \"../../node_modules/inherits/inherits_browser.js\"(exports, module) {\n    if (typeof Object.create === \"function\") {\n      module.exports = function inherits(ctor, superCtor) {\n        if (superCtor) {\n          ctor.super_ = superCtor;\n          ctor.prototype = Object.create(superCtor.prototype, {\n            constructor: {\n              value: ctor,\n              enumerable: false,\n              writable: true,\n              configurable: true,\n            },\n          });\n        }\n      };\n    } else {\n      module.exports = function inherits(ctor, superCtor) {\n        if (superCtor) {\n          ctor.super_ = superCtor;\n          var TempCtor = function () {};\n          TempCtor.prototype = superCtor.prototype;\n          ctor.prototype = new TempCtor();\n          ctor.prototype.constructor = ctor;\n        }\n      };\n    }\n  },\n});\n\n// ../../node_modules/inherits/inherits.js\nvar require_inherits = __commonJS({\n  \"../../node_modules/inherits/inherits.js\"(exports, module) {\n    try {\n      util = require_util();\n      if (typeof util.inherits !== \"function\") throw \"\";\n      module.exports = util.inherits;\n    } catch (e) {\n      module.exports = require_inherits_browser();\n    }\n    var util;\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/curve/short.js\nvar require_short = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/curve/short.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils2();\n    var BN = require_bn();\n    var inherits = require_inherits();\n    var Base = require_base();\n    var assert = utils.assert;\n    function ShortCurve(conf) {\n      Base.call(this, \"short\", conf);\n      this.a = new BN(conf.a, 16).toRed(this.red);\n      this.b = new BN(conf.b, 16).toRed(this.red);\n      this.tinv = this.two.redInvm();\n      this.zeroA = this.a.fromRed().cmpn(0) === 0;\n      this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n      this.endo = this._getEndomorphism(conf);\n      this._endoWnafT1 = new Array(4);\n      this._endoWnafT2 = new Array(4);\n    }\n    inherits(ShortCurve, Base);\n    module.exports = ShortCurve;\n    ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n      if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return;\n      var beta;\n      var lambda;\n      if (conf.beta) {\n        beta = new BN(conf.beta, 16).toRed(this.red);\n      } else {\n        var betas = this._getEndoRoots(this.p);\n        beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n        beta = beta.toRed(this.red);\n      }\n      if (conf.lambda) {\n        lambda = new BN(conf.lambda, 16);\n      } else {\n        var lambdas = this._getEndoRoots(this.n);\n        if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n          lambda = lambdas[0];\n        } else {\n          lambda = lambdas[1];\n          assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n        }\n      }\n      var basis;\n      if (conf.basis) {\n        basis = conf.basis.map(function (vec) {\n          return {\n            a: new BN(vec.a, 16),\n            b: new BN(vec.b, 16),\n          };\n        });\n      } else {\n        basis = this._getEndoBasis(lambda);\n      }\n      return {\n        beta,\n        lambda,\n        basis,\n      };\n    };\n    ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n      var red = num === this.p ? this.red : BN.mont(num);\n      var tinv = new BN(2).toRed(red).redInvm();\n      var ntinv = tinv.redNeg();\n      var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n      var l1 = ntinv.redAdd(s).fromRed();\n      var l2 = ntinv.redSub(s).fromRed();\n      return [l1, l2];\n    };\n    ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n      var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n      var u = lambda;\n      var v = this.n.clone();\n      var x1 = new BN(1);\n      var y1 = new BN(0);\n      var x2 = new BN(0);\n      var y2 = new BN(1);\n      var a0;\n      var b0;\n      var a1;\n      var b1;\n      var a2;\n      var b2;\n      var prevR;\n      var i = 0;\n      var r;\n      var x;\n      while (u.cmpn(0) !== 0) {\n        var q = v.div(u);\n        r = v.sub(q.mul(u));\n        x = x2.sub(q.mul(x1));\n        var y = y2.sub(q.mul(y1));\n        if (!a1 && r.cmp(aprxSqrt) < 0) {\n          a0 = prevR.neg();\n          b0 = x1;\n          a1 = r.neg();\n          b1 = x;\n        } else if (a1 && ++i === 2) {\n          break;\n        }\n        prevR = r;\n        v = u;\n        u = r;\n        x2 = x1;\n        x1 = x;\n        y2 = y1;\n        y1 = y;\n      }\n      a2 = r.neg();\n      b2 = x;\n      var len1 = a1.sqr().add(b1.sqr());\n      var len2 = a2.sqr().add(b2.sqr());\n      if (len2.cmp(len1) >= 0) {\n        a2 = a0;\n        b2 = b0;\n      }\n      if (a1.negative) {\n        a1 = a1.neg();\n        b1 = b1.neg();\n      }\n      if (a2.negative) {\n        a2 = a2.neg();\n        b2 = b2.neg();\n      }\n      return [\n        { a: a1, b: b1 },\n        { a: a2, b: b2 },\n      ];\n    };\n    ShortCurve.prototype._endoSplit = function _endoSplit(k) {\n      var basis = this.endo.basis;\n      var v1 = basis[0];\n      var v2 = basis[1];\n      var c1 = v2.b.mul(k).divRound(this.n);\n      var c2 = v1.b.neg().mul(k).divRound(this.n);\n      var p1 = c1.mul(v1.a);\n      var p2 = c2.mul(v2.a);\n      var q1 = c1.mul(v1.b);\n      var q2 = c2.mul(v2.b);\n      var k1 = k.sub(p1).sub(p2);\n      var k2 = q1.add(q2).neg();\n      return { k1, k2 };\n    };\n    ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n      x = new BN(x, 16);\n      if (!x.red) x = x.toRed(this.red);\n      var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n      var y = y2.redSqrt();\n      if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error(\"invalid point\");\n      var isOdd = y.fromRed().isOdd();\n      if ((odd && !isOdd) || (!odd && isOdd)) y = y.redNeg();\n      return this.point(x, y);\n    };\n    ShortCurve.prototype.validate = function validate(point) {\n      if (point.inf) return true;\n      var x = point.x;\n      var y = point.y;\n      var ax = this.a.redMul(x);\n      var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n      return y.redSqr().redISub(rhs).cmpn(0) === 0;\n    };\n    ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n      var npoints = this._endoWnafT1;\n      var ncoeffs = this._endoWnafT2;\n      for (var i = 0; i < points.length; i++) {\n        var split = this._endoSplit(coeffs[i]);\n        var p = points[i];\n        var beta = p._getBeta();\n        if (split.k1.negative) {\n          split.k1.ineg();\n          p = p.neg(true);\n        }\n        if (split.k2.negative) {\n          split.k2.ineg();\n          beta = beta.neg(true);\n        }\n        npoints[i * 2] = p;\n        npoints[i * 2 + 1] = beta;\n        ncoeffs[i * 2] = split.k1;\n        ncoeffs[i * 2 + 1] = split.k2;\n      }\n      var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n      for (var j = 0; j < i * 2; j++) {\n        npoints[j] = null;\n        ncoeffs[j] = null;\n      }\n      return res;\n    };\n    function Point(curve, x, y, isRed) {\n      Base.BasePoint.call(this, curve, \"affine\");\n      if (x === null && y === null) {\n        this.x = null;\n        this.y = null;\n        this.inf = true;\n      } else {\n        this.x = new BN(x, 16);\n        this.y = new BN(y, 16);\n        if (isRed) {\n          this.x.forceRed(this.curve.red);\n          this.y.forceRed(this.curve.red);\n        }\n        if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n        if (!this.y.red) this.y = this.y.toRed(this.curve.red);\n        this.inf = false;\n      }\n    }\n    inherits(Point, Base.BasePoint);\n    ShortCurve.prototype.point = function point(x, y, isRed) {\n      return new Point(this, x, y, isRed);\n    };\n    ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n      return Point.fromJSON(this, obj, red);\n    };\n    Point.prototype._getBeta = function _getBeta() {\n      if (!this.curve.endo) return;\n      var pre = this.precomputed;\n      if (pre && pre.beta) return pre.beta;\n      var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n      if (pre) {\n        var curve = this.curve;\n        var endoMul = function (p) {\n          return curve.point(p.x.redMul(curve.endo.beta), p.y);\n        };\n        pre.beta = beta;\n        beta.precomputed = {\n          beta: null,\n          naf: pre.naf && {\n            wnd: pre.naf.wnd,\n            points: pre.naf.points.map(endoMul),\n          },\n          doubles: pre.doubles && {\n            step: pre.doubles.step,\n            points: pre.doubles.points.map(endoMul),\n          },\n        };\n      }\n      return beta;\n    };\n    Point.prototype.toJSON = function toJSON() {\n      if (!this.precomputed) return [this.x, this.y];\n      return [\n        this.x,\n        this.y,\n        this.precomputed && {\n          doubles: this.precomputed.doubles && {\n            step: this.precomputed.doubles.step,\n            points: this.precomputed.doubles.points.slice(1),\n          },\n          naf: this.precomputed.naf && {\n            wnd: this.precomputed.naf.wnd,\n            points: this.precomputed.naf.points.slice(1),\n          },\n        },\n      ];\n    };\n    Point.fromJSON = function fromJSON(curve, obj, red) {\n      if (typeof obj === \"string\") obj = JSON.parse(obj);\n      var res = curve.point(obj[0], obj[1], red);\n      if (!obj[2]) return res;\n      function obj2point(obj2) {\n        return curve.point(obj2[0], obj2[1], red);\n      }\n      var pre = obj[2];\n      res.precomputed = {\n        beta: null,\n        doubles: pre.doubles && {\n          step: pre.doubles.step,\n          points: [res].concat(pre.doubles.points.map(obj2point)),\n        },\n        naf: pre.naf && {\n          wnd: pre.naf.wnd,\n          points: [res].concat(pre.naf.points.map(obj2point)),\n        },\n      };\n      return res;\n    };\n    Point.prototype.inspect = function inspect() {\n      if (this.isInfinity()) return \"<EC Point Infinity>\";\n      return \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" y: \" + this.y.fromRed().toString(16, 2) + \">\";\n    };\n    Point.prototype.isInfinity = function isInfinity() {\n      return this.inf;\n    };\n    Point.prototype.add = function add(p) {\n      if (this.inf) return p;\n      if (p.inf) return this;\n      if (this.eq(p)) return this.dbl();\n      if (this.neg().eq(p)) return this.curve.point(null, null);\n      if (this.x.cmp(p.x) === 0) return this.curve.point(null, null);\n      var c = this.y.redSub(p.y);\n      if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm());\n      var nx = c.redSqr().redISub(this.x).redISub(p.x);\n      var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n      return this.curve.point(nx, ny);\n    };\n    Point.prototype.dbl = function dbl() {\n      if (this.inf) return this;\n      var ys1 = this.y.redAdd(this.y);\n      if (ys1.cmpn(0) === 0) return this.curve.point(null, null);\n      var a = this.curve.a;\n      var x2 = this.x.redSqr();\n      var dyinv = ys1.redInvm();\n      var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n      var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n      var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n      return this.curve.point(nx, ny);\n    };\n    Point.prototype.getX = function getX() {\n      return this.x.fromRed();\n    };\n    Point.prototype.getY = function getY() {\n      return this.y.fromRed();\n    };\n    Point.prototype.mul = function mul(k) {\n      k = new BN(k, 16);\n      if (this.isInfinity()) return this;\n      else if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);\n      else if (this.curve.endo) return this.curve._endoWnafMulAdd([this], [k]);\n      else return this.curve._wnafMul(this, k);\n    };\n    Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n      var points = [this, p2];\n      var coeffs = [k1, k2];\n      if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs);\n      else return this.curve._wnafMulAdd(1, points, coeffs, 2);\n    };\n    Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n      var points = [this, p2];\n      var coeffs = [k1, k2];\n      if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs, true);\n      else return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n    };\n    Point.prototype.eq = function eq(p) {\n      return this === p || (this.inf === p.inf && (this.inf || (this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0)));\n    };\n    Point.prototype.neg = function neg(_precompute) {\n      if (this.inf) return this;\n      var res = this.curve.point(this.x, this.y.redNeg());\n      if (_precompute && this.precomputed) {\n        var pre = this.precomputed;\n        var negate = function (p) {\n          return p.neg();\n        };\n        res.precomputed = {\n          naf: pre.naf && {\n            wnd: pre.naf.wnd,\n            points: pre.naf.points.map(negate),\n          },\n          doubles: pre.doubles && {\n            step: pre.doubles.step,\n            points: pre.doubles.points.map(negate),\n          },\n        };\n      }\n      return res;\n    };\n    Point.prototype.toJ = function toJ() {\n      if (this.inf) return this.curve.jpoint(null, null, null);\n      var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n      return res;\n    };\n    function JPoint(curve, x, y, z) {\n      Base.BasePoint.call(this, curve, \"jacobian\");\n      if (x === null && y === null && z === null) {\n        this.x = this.curve.one;\n        this.y = this.curve.one;\n        this.z = new BN(0);\n      } else {\n        this.x = new BN(x, 16);\n        this.y = new BN(y, 16);\n        this.z = new BN(z, 16);\n      }\n      if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n      if (!this.y.red) this.y = this.y.toRed(this.curve.red);\n      if (!this.z.red) this.z = this.z.toRed(this.curve.red);\n      this.zOne = this.z === this.curve.one;\n    }\n    inherits(JPoint, Base.BasePoint);\n    ShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n      return new JPoint(this, x, y, z);\n    };\n    JPoint.prototype.toP = function toP() {\n      if (this.isInfinity()) return this.curve.point(null, null);\n      var zinv = this.z.redInvm();\n      var zinv2 = zinv.redSqr();\n      var ax = this.x.redMul(zinv2);\n      var ay = this.y.redMul(zinv2).redMul(zinv);\n      return this.curve.point(ax, ay);\n    };\n    JPoint.prototype.neg = function neg() {\n      return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n    };\n    JPoint.prototype.add = function add(p) {\n      if (this.isInfinity()) return p;\n      if (p.isInfinity()) return this;\n      var pz2 = p.z.redSqr();\n      var z2 = this.z.redSqr();\n      var u1 = this.x.redMul(pz2);\n      var u2 = p.x.redMul(z2);\n      var s1 = this.y.redMul(pz2.redMul(p.z));\n      var s2 = p.y.redMul(z2.redMul(this.z));\n      var h = u1.redSub(u2);\n      var r = s1.redSub(s2);\n      if (h.cmpn(0) === 0) {\n        if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);\n        else return this.dbl();\n      }\n      var h2 = h.redSqr();\n      var h3 = h2.redMul(h);\n      var v = u1.redMul(h2);\n      var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n      var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n      var nz = this.z.redMul(p.z).redMul(h);\n      return this.curve.jpoint(nx, ny, nz);\n    };\n    JPoint.prototype.mixedAdd = function mixedAdd(p) {\n      if (this.isInfinity()) return p.toJ();\n      if (p.isInfinity()) return this;\n      var z2 = this.z.redSqr();\n      var u1 = this.x;\n      var u2 = p.x.redMul(z2);\n      var s1 = this.y;\n      var s2 = p.y.redMul(z2).redMul(this.z);\n      var h = u1.redSub(u2);\n      var r = s1.redSub(s2);\n      if (h.cmpn(0) === 0) {\n        if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);\n        else return this.dbl();\n      }\n      var h2 = h.redSqr();\n      var h3 = h2.redMul(h);\n      var v = u1.redMul(h2);\n      var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n      var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n      var nz = this.z.redMul(h);\n      return this.curve.jpoint(nx, ny, nz);\n    };\n    JPoint.prototype.dblp = function dblp(pow) {\n      if (pow === 0) return this;\n      if (this.isInfinity()) return this;\n      if (!pow) return this.dbl();\n      var i;\n      if (this.curve.zeroA || this.curve.threeA) {\n        var r = this;\n        for (i = 0; i < pow; i++) r = r.dbl();\n        return r;\n      }\n      var a = this.curve.a;\n      var tinv = this.curve.tinv;\n      var jx = this.x;\n      var jy = this.y;\n      var jz = this.z;\n      var jz4 = jz.redSqr().redSqr();\n      var jyd = jy.redAdd(jy);\n      for (i = 0; i < pow; i++) {\n        var jx2 = jx.redSqr();\n        var jyd2 = jyd.redSqr();\n        var jyd4 = jyd2.redSqr();\n        var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n        var t1 = jx.redMul(jyd2);\n        var nx = c.redSqr().redISub(t1.redAdd(t1));\n        var t2 = t1.redISub(nx);\n        var dny = c.redMul(t2);\n        dny = dny.redIAdd(dny).redISub(jyd4);\n        var nz = jyd.redMul(jz);\n        if (i + 1 < pow) jz4 = jz4.redMul(jyd4);\n        jx = nx;\n        jz = nz;\n        jyd = dny;\n      }\n      return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n    };\n    JPoint.prototype.dbl = function dbl() {\n      if (this.isInfinity()) return this;\n      if (this.curve.zeroA) return this._zeroDbl();\n      else if (this.curve.threeA) return this._threeDbl();\n      else return this._dbl();\n    };\n    JPoint.prototype._zeroDbl = function _zeroDbl() {\n      var nx;\n      var ny;\n      var nz;\n      if (this.zOne) {\n        var xx = this.x.redSqr();\n        var yy = this.y.redSqr();\n        var yyyy = yy.redSqr();\n        var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n        s = s.redIAdd(s);\n        var m = xx.redAdd(xx).redIAdd(xx);\n        var t = m.redSqr().redISub(s).redISub(s);\n        var yyyy8 = yyyy.redIAdd(yyyy);\n        yyyy8 = yyyy8.redIAdd(yyyy8);\n        yyyy8 = yyyy8.redIAdd(yyyy8);\n        nx = t;\n        ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n        nz = this.y.redAdd(this.y);\n      } else {\n        var a = this.x.redSqr();\n        var b = this.y.redSqr();\n        var c = b.redSqr();\n        var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n        d = d.redIAdd(d);\n        var e = a.redAdd(a).redIAdd(a);\n        var f = e.redSqr();\n        var c8 = c.redIAdd(c);\n        c8 = c8.redIAdd(c8);\n        c8 = c8.redIAdd(c8);\n        nx = f.redISub(d).redISub(d);\n        ny = e.redMul(d.redISub(nx)).redISub(c8);\n        nz = this.y.redMul(this.z);\n        nz = nz.redIAdd(nz);\n      }\n      return this.curve.jpoint(nx, ny, nz);\n    };\n    JPoint.prototype._threeDbl = function _threeDbl() {\n      var nx;\n      var ny;\n      var nz;\n      if (this.zOne) {\n        var xx = this.x.redSqr();\n        var yy = this.y.redSqr();\n        var yyyy = yy.redSqr();\n        var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n        s = s.redIAdd(s);\n        var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n        var t = m.redSqr().redISub(s).redISub(s);\n        nx = t;\n        var yyyy8 = yyyy.redIAdd(yyyy);\n        yyyy8 = yyyy8.redIAdd(yyyy8);\n        yyyy8 = yyyy8.redIAdd(yyyy8);\n        ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n        nz = this.y.redAdd(this.y);\n      } else {\n        var delta = this.z.redSqr();\n        var gamma = this.y.redSqr();\n        var beta = this.x.redMul(gamma);\n        var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n        alpha = alpha.redAdd(alpha).redIAdd(alpha);\n        var beta4 = beta.redIAdd(beta);\n        beta4 = beta4.redIAdd(beta4);\n        var beta8 = beta4.redAdd(beta4);\n        nx = alpha.redSqr().redISub(beta8);\n        nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n        var ggamma8 = gamma.redSqr();\n        ggamma8 = ggamma8.redIAdd(ggamma8);\n        ggamma8 = ggamma8.redIAdd(ggamma8);\n        ggamma8 = ggamma8.redIAdd(ggamma8);\n        ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n      }\n      return this.curve.jpoint(nx, ny, nz);\n    };\n    JPoint.prototype._dbl = function _dbl() {\n      var a = this.curve.a;\n      var jx = this.x;\n      var jy = this.y;\n      var jz = this.z;\n      var jz4 = jz.redSqr().redSqr();\n      var jx2 = jx.redSqr();\n      var jy2 = jy.redSqr();\n      var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n      var jxd4 = jx.redAdd(jx);\n      jxd4 = jxd4.redIAdd(jxd4);\n      var t1 = jxd4.redMul(jy2);\n      var nx = c.redSqr().redISub(t1.redAdd(t1));\n      var t2 = t1.redISub(nx);\n      var jyd8 = jy2.redSqr();\n      jyd8 = jyd8.redIAdd(jyd8);\n      jyd8 = jyd8.redIAdd(jyd8);\n      jyd8 = jyd8.redIAdd(jyd8);\n      var ny = c.redMul(t2).redISub(jyd8);\n      var nz = jy.redAdd(jy).redMul(jz);\n      return this.curve.jpoint(nx, ny, nz);\n    };\n    JPoint.prototype.trpl = function trpl() {\n      if (!this.curve.zeroA) return this.dbl().add(this);\n      var xx = this.x.redSqr();\n      var yy = this.y.redSqr();\n      var zz = this.z.redSqr();\n      var yyyy = yy.redSqr();\n      var m = xx.redAdd(xx).redIAdd(xx);\n      var mm = m.redSqr();\n      var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n      e = e.redIAdd(e);\n      e = e.redAdd(e).redIAdd(e);\n      e = e.redISub(mm);\n      var ee = e.redSqr();\n      var t = yyyy.redIAdd(yyyy);\n      t = t.redIAdd(t);\n      t = t.redIAdd(t);\n      t = t.redIAdd(t);\n      var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n      var yyu4 = yy.redMul(u);\n      yyu4 = yyu4.redIAdd(yyu4);\n      yyu4 = yyu4.redIAdd(yyu4);\n      var nx = this.x.redMul(ee).redISub(yyu4);\n      nx = nx.redIAdd(nx);\n      nx = nx.redIAdd(nx);\n      var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n      ny = ny.redIAdd(ny);\n      ny = ny.redIAdd(ny);\n      ny = ny.redIAdd(ny);\n      var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n      return this.curve.jpoint(nx, ny, nz);\n    };\n    JPoint.prototype.mul = function mul(k, kbase) {\n      k = new BN(k, kbase);\n      return this.curve._wnafMul(this, k);\n    };\n    JPoint.prototype.eq = function eq(p) {\n      if (p.type === \"affine\") return this.eq(p.toJ());\n      if (this === p) return true;\n      var z2 = this.z.redSqr();\n      var pz2 = p.z.redSqr();\n      if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) return false;\n      var z3 = z2.redMul(this.z);\n      var pz3 = pz2.redMul(p.z);\n      return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n    };\n    JPoint.prototype.eqXToP = function eqXToP(x) {\n      var zs = this.z.redSqr();\n      var rx = x.toRed(this.curve.red).redMul(zs);\n      if (this.x.cmp(rx) === 0) return true;\n      var xc = x.clone();\n      var t = this.curve.redN.redMul(zs);\n      for (;;) {\n        xc.iadd(this.curve.n);\n        if (xc.cmp(this.curve.p) >= 0) return false;\n        rx.redIAdd(t);\n        if (this.x.cmp(rx) === 0) return true;\n      }\n    };\n    JPoint.prototype.inspect = function inspect() {\n      if (this.isInfinity()) return \"<EC JPoint Infinity>\";\n      return (\n        \"<EC JPoint x: \" +\n        this.x.toString(16, 2) +\n        \" y: \" +\n        this.y.toString(16, 2) +\n        \" z: \" +\n        this.z.toString(16, 2) +\n        \">\"\n      );\n    };\n    JPoint.prototype.isInfinity = function isInfinity() {\n      return this.z.cmpn(0) === 0;\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/curve/mont.js\nvar require_mont = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/curve/mont.js\"(exports, module) {\n    \"use strict\";\n    var BN = require_bn();\n    var inherits = require_inherits();\n    var Base = require_base();\n    var utils = require_utils2();\n    function MontCurve(conf) {\n      Base.call(this, \"mont\", conf);\n      this.a = new BN(conf.a, 16).toRed(this.red);\n      this.b = new BN(conf.b, 16).toRed(this.red);\n      this.i4 = new BN(4).toRed(this.red).redInvm();\n      this.two = new BN(2).toRed(this.red);\n      this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n    }\n    inherits(MontCurve, Base);\n    module.exports = MontCurve;\n    MontCurve.prototype.validate = function validate(point) {\n      var x = point.normalize().x;\n      var x2 = x.redSqr();\n      var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n      var y = rhs.redSqrt();\n      return y.redSqr().cmp(rhs) === 0;\n    };\n    function Point(curve, x, z) {\n      Base.BasePoint.call(this, curve, \"projective\");\n      if (x === null && z === null) {\n        this.x = this.curve.one;\n        this.z = this.curve.zero;\n      } else {\n        this.x = new BN(x, 16);\n        this.z = new BN(z, 16);\n        if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n        if (!this.z.red) this.z = this.z.toRed(this.curve.red);\n      }\n    }\n    inherits(Point, Base.BasePoint);\n    MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n      return this.point(utils.toArray(bytes, enc), 1);\n    };\n    MontCurve.prototype.point = function point(x, z) {\n      return new Point(this, x, z);\n    };\n    MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n      return Point.fromJSON(this, obj);\n    };\n    Point.prototype.precompute = function precompute() {};\n    Point.prototype._encode = function _encode() {\n      return this.getX().toArray(\"be\", this.curve.p.byteLength());\n    };\n    Point.fromJSON = function fromJSON(curve, obj) {\n      return new Point(curve, obj[0], obj[1] || curve.one);\n    };\n    Point.prototype.inspect = function inspect() {\n      if (this.isInfinity()) return \"<EC Point Infinity>\";\n      return \"<EC Point x: \" + this.x.fromRed().toString(16, 2) + \" z: \" + this.z.fromRed().toString(16, 2) + \">\";\n    };\n    Point.prototype.isInfinity = function isInfinity() {\n      return this.z.cmpn(0) === 0;\n    };\n    Point.prototype.dbl = function dbl() {\n      var a = this.x.redAdd(this.z);\n      var aa = a.redSqr();\n      var b = this.x.redSub(this.z);\n      var bb = b.redSqr();\n      var c = aa.redSub(bb);\n      var nx = aa.redMul(bb);\n      var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n      return this.curve.point(nx, nz);\n    };\n    Point.prototype.add = function add() {\n      throw new Error(\"Not supported on Montgomery curve\");\n    };\n    Point.prototype.diffAdd = function diffAdd(p, diff) {\n      var a = this.x.redAdd(this.z);\n      var b = this.x.redSub(this.z);\n      var c = p.x.redAdd(p.z);\n      var d = p.x.redSub(p.z);\n      var da = d.redMul(a);\n      var cb = c.redMul(b);\n      var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n      var nz = diff.x.redMul(da.redISub(cb).redSqr());\n      return this.curve.point(nx, nz);\n    };\n    Point.prototype.mul = function mul(k) {\n      var t = k.clone();\n      var a = this;\n      var b = this.curve.point(null, null);\n      var c = this;\n      for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) bits.push(t.andln(1));\n      for (var i = bits.length - 1; i >= 0; i--) {\n        if (bits[i] === 0) {\n          a = a.diffAdd(b, c);\n          b = b.dbl();\n        } else {\n          b = a.diffAdd(b, c);\n          a = a.dbl();\n        }\n      }\n      return b;\n    };\n    Point.prototype.mulAdd = function mulAdd() {\n      throw new Error(\"Not supported on Montgomery curve\");\n    };\n    Point.prototype.jumlAdd = function jumlAdd() {\n      throw new Error(\"Not supported on Montgomery curve\");\n    };\n    Point.prototype.eq = function eq(other) {\n      return this.getX().cmp(other.getX()) === 0;\n    };\n    Point.prototype.normalize = function normalize() {\n      this.x = this.x.redMul(this.z.redInvm());\n      this.z = this.curve.one;\n      return this;\n    };\n    Point.prototype.getX = function getX() {\n      this.normalize();\n      return this.x.fromRed();\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/curve/edwards.js\nvar require_edwards = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/curve/edwards.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils2();\n    var BN = require_bn();\n    var inherits = require_inherits();\n    var Base = require_base();\n    var assert = utils.assert;\n    function EdwardsCurve(conf) {\n      this.twisted = (conf.a | 0) !== 1;\n      this.mOneA = this.twisted && (conf.a | 0) === -1;\n      this.extended = this.mOneA;\n      Base.call(this, \"edwards\", conf);\n      this.a = new BN(conf.a, 16).umod(this.red.m);\n      this.a = this.a.toRed(this.red);\n      this.c = new BN(conf.c, 16).toRed(this.red);\n      this.c2 = this.c.redSqr();\n      this.d = new BN(conf.d, 16).toRed(this.red);\n      this.dd = this.d.redAdd(this.d);\n      assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n      this.oneC = (conf.c | 0) === 1;\n    }\n    inherits(EdwardsCurve, Base);\n    module.exports = EdwardsCurve;\n    EdwardsCurve.prototype._mulA = function _mulA(num) {\n      if (this.mOneA) return num.redNeg();\n      else return this.a.redMul(num);\n    };\n    EdwardsCurve.prototype._mulC = function _mulC(num) {\n      if (this.oneC) return num;\n      else return this.c.redMul(num);\n    };\n    EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n      return this.point(x, y, z, t);\n    };\n    EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n      x = new BN(x, 16);\n      if (!x.red) x = x.toRed(this.red);\n      var x2 = x.redSqr();\n      var rhs = this.c2.redSub(this.a.redMul(x2));\n      var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n      var y2 = rhs.redMul(lhs.redInvm());\n      var y = y2.redSqrt();\n      if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error(\"invalid point\");\n      var isOdd = y.fromRed().isOdd();\n      if ((odd && !isOdd) || (!odd && isOdd)) y = y.redNeg();\n      return this.point(x, y);\n    };\n    EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n      y = new BN(y, 16);\n      if (!y.red) y = y.toRed(this.red);\n      var y2 = y.redSqr();\n      var lhs = y2.redSub(this.c2);\n      var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);\n      var x2 = lhs.redMul(rhs.redInvm());\n      if (x2.cmp(this.zero) === 0) {\n        if (odd) throw new Error(\"invalid point\");\n        else return this.point(this.zero, y);\n      }\n      var x = x2.redSqrt();\n      if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) throw new Error(\"invalid point\");\n      if (x.fromRed().isOdd() !== odd) x = x.redNeg();\n      return this.point(x, y);\n    };\n    EdwardsCurve.prototype.validate = function validate(point) {\n      if (point.isInfinity()) return true;\n      point.normalize();\n      var x2 = point.x.redSqr();\n      var y2 = point.y.redSqr();\n      var lhs = x2.redMul(this.a).redAdd(y2);\n      var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n      return lhs.cmp(rhs) === 0;\n    };\n    function Point(curve, x, y, z, t) {\n      Base.BasePoint.call(this, curve, \"projective\");\n      if (x === null && y === null && z === null) {\n        this.x = this.curve.zero;\n        this.y = this.curve.one;\n        this.z = this.curve.one;\n        this.t = this.curve.zero;\n        this.zOne = true;\n      } else {\n        this.x = new BN(x, 16);\n        this.y = new BN(y, 16);\n        this.z = z ? new BN(z, 16) : this.curve.one;\n        this.t = t && new BN(t, 16);\n        if (!this.x.red) this.x = this.x.toRed(this.curve.red);\n        if (!this.y.red) this.y = this.y.toRed(this.curve.red);\n        if (!this.z.red) this.z = this.z.toRed(this.curve.red);\n        if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red);\n        this.zOne = this.z === this.curve.one;\n        if (this.curve.extended && !this.t) {\n          this.t = this.x.redMul(this.y);\n          if (!this.zOne) this.t = this.t.redMul(this.z.redInvm());\n        }\n      }\n    }\n    inherits(Point, Base.BasePoint);\n    EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n      return Point.fromJSON(this, obj);\n    };\n    EdwardsCurve.prototype.point = function point(x, y, z, t) {\n      return new Point(this, x, y, z, t);\n    };\n    Point.fromJSON = function fromJSON(curve, obj) {\n      return new Point(curve, obj[0], obj[1], obj[2]);\n    };\n    Point.prototype.inspect = function inspect() {\n      if (this.isInfinity()) return \"<EC Point Infinity>\";\n      return (\n        \"<EC Point x: \" +\n        this.x.fromRed().toString(16, 2) +\n        \" y: \" +\n        this.y.fromRed().toString(16, 2) +\n        \" z: \" +\n        this.z.fromRed().toString(16, 2) +\n        \">\"\n      );\n    };\n    Point.prototype.isInfinity = function isInfinity() {\n      return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || (this.zOne && this.y.cmp(this.curve.c) === 0));\n    };\n    Point.prototype._extDbl = function _extDbl() {\n      var a = this.x.redSqr();\n      var b = this.y.redSqr();\n      var c = this.z.redSqr();\n      c = c.redIAdd(c);\n      var d = this.curve._mulA(a);\n      var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n      var g = d.redAdd(b);\n      var f = g.redSub(c);\n      var h = d.redSub(b);\n      var nx = e.redMul(f);\n      var ny = g.redMul(h);\n      var nt = e.redMul(h);\n      var nz = f.redMul(g);\n      return this.curve.point(nx, ny, nz, nt);\n    };\n    Point.prototype._projDbl = function _projDbl() {\n      var b = this.x.redAdd(this.y).redSqr();\n      var c = this.x.redSqr();\n      var d = this.y.redSqr();\n      var nx;\n      var ny;\n      var nz;\n      var e;\n      var h;\n      var j;\n      if (this.curve.twisted) {\n        e = this.curve._mulA(c);\n        var f = e.redAdd(d);\n        if (this.zOne) {\n          nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n          ny = f.redMul(e.redSub(d));\n          nz = f.redSqr().redSub(f).redSub(f);\n        } else {\n          h = this.z.redSqr();\n          j = f.redSub(h).redISub(h);\n          nx = b.redSub(c).redISub(d).redMul(j);\n          ny = f.redMul(e.redSub(d));\n          nz = f.redMul(j);\n        }\n      } else {\n        e = c.redAdd(d);\n        h = this.curve._mulC(this.z).redSqr();\n        j = e.redSub(h).redSub(h);\n        nx = this.curve._mulC(b.redISub(e)).redMul(j);\n        ny = this.curve._mulC(e).redMul(c.redISub(d));\n        nz = e.redMul(j);\n      }\n      return this.curve.point(nx, ny, nz);\n    };\n    Point.prototype.dbl = function dbl() {\n      if (this.isInfinity()) return this;\n      if (this.curve.extended) return this._extDbl();\n      else return this._projDbl();\n    };\n    Point.prototype._extAdd = function _extAdd(p) {\n      var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n      var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n      var c = this.t.redMul(this.curve.dd).redMul(p.t);\n      var d = this.z.redMul(p.z.redAdd(p.z));\n      var e = b.redSub(a);\n      var f = d.redSub(c);\n      var g = d.redAdd(c);\n      var h = b.redAdd(a);\n      var nx = e.redMul(f);\n      var ny = g.redMul(h);\n      var nt = e.redMul(h);\n      var nz = f.redMul(g);\n      return this.curve.point(nx, ny, nz, nt);\n    };\n    Point.prototype._projAdd = function _projAdd(p) {\n      var a = this.z.redMul(p.z);\n      var b = a.redSqr();\n      var c = this.x.redMul(p.x);\n      var d = this.y.redMul(p.y);\n      var e = this.curve.d.redMul(c).redMul(d);\n      var f = b.redSub(e);\n      var g = b.redAdd(e);\n      var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n      var nx = a.redMul(f).redMul(tmp);\n      var ny;\n      var nz;\n      if (this.curve.twisted) {\n        ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n        nz = f.redMul(g);\n      } else {\n        ny = a.redMul(g).redMul(d.redSub(c));\n        nz = this.curve._mulC(f).redMul(g);\n      }\n      return this.curve.point(nx, ny, nz);\n    };\n    Point.prototype.add = function add(p) {\n      if (this.isInfinity()) return p;\n      if (p.isInfinity()) return this;\n      if (this.curve.extended) return this._extAdd(p);\n      else return this._projAdd(p);\n    };\n    Point.prototype.mul = function mul(k) {\n      if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);\n      else return this.curve._wnafMul(this, k);\n    };\n    Point.prototype.mulAdd = function mulAdd(k1, p, k2) {\n      return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, false);\n    };\n    Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n      return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, true);\n    };\n    Point.prototype.normalize = function normalize() {\n      if (this.zOne) return this;\n      var zi = this.z.redInvm();\n      this.x = this.x.redMul(zi);\n      this.y = this.y.redMul(zi);\n      if (this.t) this.t = this.t.redMul(zi);\n      this.z = this.curve.one;\n      this.zOne = true;\n      return this;\n    };\n    Point.prototype.neg = function neg() {\n      return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());\n    };\n    Point.prototype.getX = function getX() {\n      this.normalize();\n      return this.x.fromRed();\n    };\n    Point.prototype.getY = function getY() {\n      this.normalize();\n      return this.y.fromRed();\n    };\n    Point.prototype.eq = function eq(other) {\n      return this === other || (this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0);\n    };\n    Point.prototype.eqXToP = function eqXToP(x) {\n      var rx = x.toRed(this.curve.red).redMul(this.z);\n      if (this.x.cmp(rx) === 0) return true;\n      var xc = x.clone();\n      var t = this.curve.redN.redMul(this.z);\n      for (;;) {\n        xc.iadd(this.curve.n);\n        if (xc.cmp(this.curve.p) >= 0) return false;\n        rx.redIAdd(t);\n        if (this.x.cmp(rx) === 0) return true;\n      }\n    };\n    Point.prototype.toP = Point.prototype.normalize;\n    Point.prototype.mixedAdd = Point.prototype.add;\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/curve/index.js\nvar require_curve = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/curve/index.js\"(exports) {\n    \"use strict\";\n    var curve = exports;\n    curve.base = require_base();\n    curve.short = require_short();\n    curve.mont = require_mont();\n    curve.edwards = require_edwards();\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/utils.js\nvar require_utils3 = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/utils.js\"(exports) {\n    \"use strict\";\n    var assert = require_minimalistic_assert();\n    var inherits = require_inherits();\n    exports.inherits = inherits;\n    function isSurrogatePair(msg, i) {\n      if ((msg.charCodeAt(i) & 64512) !== 55296) {\n        return false;\n      }\n      if (i < 0 || i + 1 >= msg.length) {\n        return false;\n      }\n      return (msg.charCodeAt(i + 1) & 64512) === 56320;\n    }\n    function toArray(msg, enc) {\n      if (Array.isArray(msg)) return msg.slice();\n      if (!msg) return [];\n      var res = [];\n      if (typeof msg === \"string\") {\n        if (!enc) {\n          var p = 0;\n          for (var i = 0; i < msg.length; i++) {\n            var c = msg.charCodeAt(i);\n            if (c < 128) {\n              res[p++] = c;\n            } else if (c < 2048) {\n              res[p++] = (c >> 6) | 192;\n              res[p++] = (c & 63) | 128;\n            } else if (isSurrogatePair(msg, i)) {\n              c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023);\n              res[p++] = (c >> 18) | 240;\n              res[p++] = ((c >> 12) & 63) | 128;\n              res[p++] = ((c >> 6) & 63) | 128;\n              res[p++] = (c & 63) | 128;\n            } else {\n              res[p++] = (c >> 12) | 224;\n              res[p++] = ((c >> 6) & 63) | 128;\n              res[p++] = (c & 63) | 128;\n            }\n          }\n        } else if (enc === \"hex\") {\n          msg = msg.replace(/[^a-z0-9]+/gi, \"\");\n          if (msg.length % 2 !== 0) msg = \"0\" + msg;\n          for (i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));\n        }\n      } else {\n        for (i = 0; i < msg.length; i++) res[i] = msg[i] | 0;\n      }\n      return res;\n    }\n    exports.toArray = toArray;\n    function toHex(msg) {\n      var res = \"\";\n      for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));\n      return res;\n    }\n    exports.toHex = toHex;\n    function htonl(w) {\n      var res = (w >>> 24) | ((w >>> 8) & 65280) | ((w << 8) & 16711680) | ((w & 255) << 24);\n      return res >>> 0;\n    }\n    exports.htonl = htonl;\n    function toHex32(msg, endian) {\n      var res = \"\";\n      for (var i = 0; i < msg.length; i++) {\n        var w = msg[i];\n        if (endian === \"little\") w = htonl(w);\n        res += zero8(w.toString(16));\n      }\n      return res;\n    }\n    exports.toHex32 = toHex32;\n    function zero2(word) {\n      if (word.length === 1) return \"0\" + word;\n      else return word;\n    }\n    exports.zero2 = zero2;\n    function zero8(word) {\n      if (word.length === 7) return \"0\" + word;\n      else if (word.length === 6) return \"00\" + word;\n      else if (word.length === 5) return \"000\" + word;\n      else if (word.length === 4) return \"0000\" + word;\n      else if (word.length === 3) return \"00000\" + word;\n      else if (word.length === 2) return \"000000\" + word;\n      else if (word.length === 1) return \"0000000\" + word;\n      else return word;\n    }\n    exports.zero8 = zero8;\n    function join32(msg, start, end, endian) {\n      var len = end - start;\n      assert(len % 4 === 0);\n      var res = new Array(len / 4);\n      for (var i = 0, k = start; i < res.length; i++, k += 4) {\n        var w;\n        if (endian === \"big\") w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n        else w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n        res[i] = w >>> 0;\n      }\n      return res;\n    }\n    exports.join32 = join32;\n    function split32(msg, endian) {\n      var res = new Array(msg.length * 4);\n      for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n        var m = msg[i];\n        if (endian === \"big\") {\n          res[k] = m >>> 24;\n          res[k + 1] = (m >>> 16) & 255;\n          res[k + 2] = (m >>> 8) & 255;\n          res[k + 3] = m & 255;\n        } else {\n          res[k + 3] = m >>> 24;\n          res[k + 2] = (m >>> 16) & 255;\n          res[k + 1] = (m >>> 8) & 255;\n          res[k] = m & 255;\n        }\n      }\n      return res;\n    }\n    exports.split32 = split32;\n    function rotr32(w, b) {\n      return (w >>> b) | (w << (32 - b));\n    }\n    exports.rotr32 = rotr32;\n    function rotl32(w, b) {\n      return (w << b) | (w >>> (32 - b));\n    }\n    exports.rotl32 = rotl32;\n    function sum32(a, b) {\n      return (a + b) >>> 0;\n    }\n    exports.sum32 = sum32;\n    function sum32_3(a, b, c) {\n      return (a + b + c) >>> 0;\n    }\n    exports.sum32_3 = sum32_3;\n    function sum32_4(a, b, c, d) {\n      return (a + b + c + d) >>> 0;\n    }\n    exports.sum32_4 = sum32_4;\n    function sum32_5(a, b, c, d, e) {\n      return (a + b + c + d + e) >>> 0;\n    }\n    exports.sum32_5 = sum32_5;\n    function sum64(buf, pos, ah, al) {\n      var bh = buf[pos];\n      var bl = buf[pos + 1];\n      var lo = (al + bl) >>> 0;\n      var hi = (lo < al ? 1 : 0) + ah + bh;\n      buf[pos] = hi >>> 0;\n      buf[pos + 1] = lo;\n    }\n    exports.sum64 = sum64;\n    function sum64_hi(ah, al, bh, bl) {\n      var lo = (al + bl) >>> 0;\n      var hi = (lo < al ? 1 : 0) + ah + bh;\n      return hi >>> 0;\n    }\n    exports.sum64_hi = sum64_hi;\n    function sum64_lo(ah, al, bh, bl) {\n      var lo = al + bl;\n      return lo >>> 0;\n    }\n    exports.sum64_lo = sum64_lo;\n    function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n      var carry = 0;\n      var lo = al;\n      lo = (lo + bl) >>> 0;\n      carry += lo < al ? 1 : 0;\n      lo = (lo + cl) >>> 0;\n      carry += lo < cl ? 1 : 0;\n      lo = (lo + dl) >>> 0;\n      carry += lo < dl ? 1 : 0;\n      var hi = ah + bh + ch + dh + carry;\n      return hi >>> 0;\n    }\n    exports.sum64_4_hi = sum64_4_hi;\n    function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n      var lo = al + bl + cl + dl;\n      return lo >>> 0;\n    }\n    exports.sum64_4_lo = sum64_4_lo;\n    function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n      var carry = 0;\n      var lo = al;\n      lo = (lo + bl) >>> 0;\n      carry += lo < al ? 1 : 0;\n      lo = (lo + cl) >>> 0;\n      carry += lo < cl ? 1 : 0;\n      lo = (lo + dl) >>> 0;\n      carry += lo < dl ? 1 : 0;\n      lo = (lo + el) >>> 0;\n      carry += lo < el ? 1 : 0;\n      var hi = ah + bh + ch + dh + eh + carry;\n      return hi >>> 0;\n    }\n    exports.sum64_5_hi = sum64_5_hi;\n    function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n      var lo = al + bl + cl + dl + el;\n      return lo >>> 0;\n    }\n    exports.sum64_5_lo = sum64_5_lo;\n    function rotr64_hi(ah, al, num) {\n      var r = (al << (32 - num)) | (ah >>> num);\n      return r >>> 0;\n    }\n    exports.rotr64_hi = rotr64_hi;\n    function rotr64_lo(ah, al, num) {\n      var r = (ah << (32 - num)) | (al >>> num);\n      return r >>> 0;\n    }\n    exports.rotr64_lo = rotr64_lo;\n    function shr64_hi(ah, al, num) {\n      return ah >>> num;\n    }\n    exports.shr64_hi = shr64_hi;\n    function shr64_lo(ah, al, num) {\n      var r = (ah << (32 - num)) | (al >>> num);\n      return r >>> 0;\n    }\n    exports.shr64_lo = shr64_lo;\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/common.js\nvar require_common = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/common.js\"(exports) {\n    \"use strict\";\n    var utils = require_utils3();\n    var assert = require_minimalistic_assert();\n    function BlockHash() {\n      this.pending = null;\n      this.pendingTotal = 0;\n      this.blockSize = this.constructor.blockSize;\n      this.outSize = this.constructor.outSize;\n      this.hmacStrength = this.constructor.hmacStrength;\n      this.padLength = this.constructor.padLength / 8;\n      this.endian = \"big\";\n      this._delta8 = this.blockSize / 8;\n      this._delta32 = this.blockSize / 32;\n    }\n    exports.BlockHash = BlockHash;\n    BlockHash.prototype.update = function update(msg, enc) {\n      msg = utils.toArray(msg, enc);\n      if (!this.pending) this.pending = msg;\n      else this.pending = this.pending.concat(msg);\n      this.pendingTotal += msg.length;\n      if (this.pending.length >= this._delta8) {\n        msg = this.pending;\n        var r = msg.length % this._delta8;\n        this.pending = msg.slice(msg.length - r, msg.length);\n        if (this.pending.length === 0) this.pending = null;\n        msg = utils.join32(msg, 0, msg.length - r, this.endian);\n        for (var i = 0; i < msg.length; i += this._delta32) this._update(msg, i, i + this._delta32);\n      }\n      return this;\n    };\n    BlockHash.prototype.digest = function digest(enc) {\n      this.update(this._pad());\n      assert(this.pending === null);\n      return this._digest(enc);\n    };\n    BlockHash.prototype._pad = function pad() {\n      var len = this.pendingTotal;\n      var bytes = this._delta8;\n      var k = bytes - ((len + this.padLength) % bytes);\n      var res = new Array(k + this.padLength);\n      res[0] = 128;\n      for (var i = 1; i < k; i++) res[i] = 0;\n      len <<= 3;\n      if (this.endian === \"big\") {\n        for (var t = 8; t < this.padLength; t++) res[i++] = 0;\n        res[i++] = 0;\n        res[i++] = 0;\n        res[i++] = 0;\n        res[i++] = 0;\n        res[i++] = (len >>> 24) & 255;\n        res[i++] = (len >>> 16) & 255;\n        res[i++] = (len >>> 8) & 255;\n        res[i++] = len & 255;\n      } else {\n        res[i++] = len & 255;\n        res[i++] = (len >>> 8) & 255;\n        res[i++] = (len >>> 16) & 255;\n        res[i++] = (len >>> 24) & 255;\n        res[i++] = 0;\n        res[i++] = 0;\n        res[i++] = 0;\n        res[i++] = 0;\n        for (t = 8; t < this.padLength; t++) res[i++] = 0;\n      }\n      return res;\n    };\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha/common.js\nvar require_common2 = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha/common.js\"(exports) {\n    \"use strict\";\n    var utils = require_utils3();\n    var rotr32 = utils.rotr32;\n    function ft_1(s, x, y, z) {\n      if (s === 0) return ch32(x, y, z);\n      if (s === 1 || s === 3) return p32(x, y, z);\n      if (s === 2) return maj32(x, y, z);\n    }\n    exports.ft_1 = ft_1;\n    function ch32(x, y, z) {\n      return (x & y) ^ (~x & z);\n    }\n    exports.ch32 = ch32;\n    function maj32(x, y, z) {\n      return (x & y) ^ (x & z) ^ (y & z);\n    }\n    exports.maj32 = maj32;\n    function p32(x, y, z) {\n      return x ^ y ^ z;\n    }\n    exports.p32 = p32;\n    function s0_256(x) {\n      return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n    }\n    exports.s0_256 = s0_256;\n    function s1_256(x) {\n      return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n    }\n    exports.s1_256 = s1_256;\n    function g0_256(x) {\n      return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n    }\n    exports.g0_256 = g0_256;\n    function g1_256(x) {\n      return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n    }\n    exports.g1_256 = g1_256;\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha/1.js\nvar require__ = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha/1.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils3();\n    var common = require_common();\n    var shaCommon = require_common2();\n    var rotl32 = utils.rotl32;\n    var sum32 = utils.sum32;\n    var sum32_5 = utils.sum32_5;\n    var ft_1 = shaCommon.ft_1;\n    var BlockHash = common.BlockHash;\n    var sha1_K = [1518500249, 1859775393, 2400959708, 3395469782];\n    function SHA1() {\n      if (!(this instanceof SHA1)) return new SHA1();\n      BlockHash.call(this);\n      this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];\n      this.W = new Array(80);\n    }\n    utils.inherits(SHA1, BlockHash);\n    module.exports = SHA1;\n    SHA1.blockSize = 512;\n    SHA1.outSize = 160;\n    SHA1.hmacStrength = 80;\n    SHA1.padLength = 64;\n    SHA1.prototype._update = function _update(msg, start) {\n      var W = this.W;\n      for (var i = 0; i < 16; i++) W[i] = msg[start + i];\n      for (; i < W.length; i++) W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n      var a = this.h[0];\n      var b = this.h[1];\n      var c = this.h[2];\n      var d = this.h[3];\n      var e = this.h[4];\n      for (i = 0; i < W.length; i++) {\n        var s = ~~(i / 20);\n        var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n        e = d;\n        d = c;\n        c = rotl32(b, 30);\n        b = a;\n        a = t;\n      }\n      this.h[0] = sum32(this.h[0], a);\n      this.h[1] = sum32(this.h[1], b);\n      this.h[2] = sum32(this.h[2], c);\n      this.h[3] = sum32(this.h[3], d);\n      this.h[4] = sum32(this.h[4], e);\n    };\n    SHA1.prototype._digest = function digest(enc) {\n      if (enc === \"hex\") return utils.toHex32(this.h, \"big\");\n      else return utils.split32(this.h, \"big\");\n    };\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha/256.js\nvar require__2 = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha/256.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils3();\n    var common = require_common();\n    var shaCommon = require_common2();\n    var assert = require_minimalistic_assert();\n    var sum32 = utils.sum32;\n    var sum32_4 = utils.sum32_4;\n    var sum32_5 = utils.sum32_5;\n    var ch32 = shaCommon.ch32;\n    var maj32 = shaCommon.maj32;\n    var s0_256 = shaCommon.s0_256;\n    var s1_256 = shaCommon.s1_256;\n    var g0_256 = shaCommon.g0_256;\n    var g1_256 = shaCommon.g1_256;\n    var BlockHash = common.BlockHash;\n    var sha256_K = [\n      1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080,\n      310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774,\n      264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808,\n      3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291,\n      1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817,\n      3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063,\n      1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298,\n    ];\n    function SHA256() {\n      if (!(this instanceof SHA256)) return new SHA256();\n      BlockHash.call(this);\n      this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];\n      this.k = sha256_K;\n      this.W = new Array(64);\n    }\n    utils.inherits(SHA256, BlockHash);\n    module.exports = SHA256;\n    SHA256.blockSize = 512;\n    SHA256.outSize = 256;\n    SHA256.hmacStrength = 192;\n    SHA256.padLength = 64;\n    SHA256.prototype._update = function _update(msg, start) {\n      var W = this.W;\n      for (var i = 0; i < 16; i++) W[i] = msg[start + i];\n      for (; i < W.length; i++) W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n      var a = this.h[0];\n      var b = this.h[1];\n      var c = this.h[2];\n      var d = this.h[3];\n      var e = this.h[4];\n      var f = this.h[5];\n      var g = this.h[6];\n      var h = this.h[7];\n      assert(this.k.length === W.length);\n      for (i = 0; i < W.length; i++) {\n        var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n        var T2 = sum32(s0_256(a), maj32(a, b, c));\n        h = g;\n        g = f;\n        f = e;\n        e = sum32(d, T1);\n        d = c;\n        c = b;\n        b = a;\n        a = sum32(T1, T2);\n      }\n      this.h[0] = sum32(this.h[0], a);\n      this.h[1] = sum32(this.h[1], b);\n      this.h[2] = sum32(this.h[2], c);\n      this.h[3] = sum32(this.h[3], d);\n      this.h[4] = sum32(this.h[4], e);\n      this.h[5] = sum32(this.h[5], f);\n      this.h[6] = sum32(this.h[6], g);\n      this.h[7] = sum32(this.h[7], h);\n    };\n    SHA256.prototype._digest = function digest(enc) {\n      if (enc === \"hex\") return utils.toHex32(this.h, \"big\");\n      else return utils.split32(this.h, \"big\");\n    };\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha/224.js\nvar require__3 = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha/224.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils3();\n    var SHA256 = require__2();\n    function SHA224() {\n      if (!(this instanceof SHA224)) return new SHA224();\n      SHA256.call(this);\n      this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];\n    }\n    utils.inherits(SHA224, SHA256);\n    module.exports = SHA224;\n    SHA224.blockSize = 512;\n    SHA224.outSize = 224;\n    SHA224.hmacStrength = 192;\n    SHA224.padLength = 64;\n    SHA224.prototype._digest = function digest(enc) {\n      if (enc === \"hex\") return utils.toHex32(this.h.slice(0, 7), \"big\");\n      else return utils.split32(this.h.slice(0, 7), \"big\");\n    };\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha/512.js\nvar require__4 = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha/512.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils3();\n    var common = require_common();\n    var assert = require_minimalistic_assert();\n    var rotr64_hi = utils.rotr64_hi;\n    var rotr64_lo = utils.rotr64_lo;\n    var shr64_hi = utils.shr64_hi;\n    var shr64_lo = utils.shr64_lo;\n    var sum64 = utils.sum64;\n    var sum64_hi = utils.sum64_hi;\n    var sum64_lo = utils.sum64_lo;\n    var sum64_4_hi = utils.sum64_4_hi;\n    var sum64_4_lo = utils.sum64_4_lo;\n    var sum64_5_hi = utils.sum64_5_hi;\n    var sum64_5_lo = utils.sum64_5_lo;\n    var BlockHash = common.BlockHash;\n    var sha512_K = [\n      1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163,\n      4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394,\n      310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206,\n      991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139,\n      264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692,\n      3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879,\n      3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895,\n      168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823,\n      1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921,\n      1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344,\n      3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616,\n      1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403,\n      1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452,\n      2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573,\n      3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271,\n      4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733,\n      587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158,\n      1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591,\n    ];\n    function SHA512() {\n      if (!(this instanceof SHA512)) return new SHA512();\n      BlockHash.call(this);\n      this.h = [\n        1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119,\n        2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209,\n      ];\n      this.k = sha512_K;\n      this.W = new Array(160);\n    }\n    utils.inherits(SHA512, BlockHash);\n    module.exports = SHA512;\n    SHA512.blockSize = 1024;\n    SHA512.outSize = 512;\n    SHA512.hmacStrength = 192;\n    SHA512.padLength = 128;\n    SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n      var W = this.W;\n      for (var i = 0; i < 32; i++) W[i] = msg[start + i];\n      for (; i < W.length; i += 2) {\n        var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);\n        var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n        var c1_hi = W[i - 14];\n        var c1_lo = W[i - 13];\n        var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);\n        var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n        var c3_hi = W[i - 32];\n        var c3_lo = W[i - 31];\n        W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n        W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);\n      }\n    };\n    SHA512.prototype._update = function _update(msg, start) {\n      this._prepareBlock(msg, start);\n      var W = this.W;\n      var ah = this.h[0];\n      var al = this.h[1];\n      var bh = this.h[2];\n      var bl = this.h[3];\n      var ch = this.h[4];\n      var cl = this.h[5];\n      var dh = this.h[6];\n      var dl = this.h[7];\n      var eh = this.h[8];\n      var el = this.h[9];\n      var fh = this.h[10];\n      var fl = this.h[11];\n      var gh = this.h[12];\n      var gl = this.h[13];\n      var hh = this.h[14];\n      var hl = this.h[15];\n      assert(this.k.length === W.length);\n      for (var i = 0; i < W.length; i += 2) {\n        var c0_hi = hh;\n        var c0_lo = hl;\n        var c1_hi = s1_512_hi(eh, el);\n        var c1_lo = s1_512_lo(eh, el);\n        var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n        var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n        var c3_hi = this.k[i];\n        var c3_lo = this.k[i + 1];\n        var c4_hi = W[i];\n        var c4_lo = W[i + 1];\n        var T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n        var T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);\n        c0_hi = s0_512_hi(ah, al);\n        c0_lo = s0_512_lo(ah, al);\n        c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n        c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n        var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n        var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n        hh = gh;\n        hl = gl;\n        gh = fh;\n        gl = fl;\n        fh = eh;\n        fl = el;\n        eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n        el = sum64_lo(dl, dl, T1_hi, T1_lo);\n        dh = ch;\n        dl = cl;\n        ch = bh;\n        cl = bl;\n        bh = ah;\n        bl = al;\n        ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n        al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n      }\n      sum64(this.h, 0, ah, al);\n      sum64(this.h, 2, bh, bl);\n      sum64(this.h, 4, ch, cl);\n      sum64(this.h, 6, dh, dl);\n      sum64(this.h, 8, eh, el);\n      sum64(this.h, 10, fh, fl);\n      sum64(this.h, 12, gh, gl);\n      sum64(this.h, 14, hh, hl);\n    };\n    SHA512.prototype._digest = function digest(enc) {\n      if (enc === \"hex\") return utils.toHex32(this.h, \"big\");\n      else return utils.split32(this.h, \"big\");\n    };\n    function ch64_hi(xh, xl, yh, yl, zh) {\n      var r = (xh & yh) ^ (~xh & zh);\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function ch64_lo(xh, xl, yh, yl, zh, zl) {\n      var r = (xl & yl) ^ (~xl & zl);\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function maj64_hi(xh, xl, yh, yl, zh) {\n      var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function maj64_lo(xh, xl, yh, yl, zh, zl) {\n      var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function s0_512_hi(xh, xl) {\n      var c0_hi = rotr64_hi(xh, xl, 28);\n      var c1_hi = rotr64_hi(xl, xh, 2);\n      var c2_hi = rotr64_hi(xl, xh, 7);\n      var r = c0_hi ^ c1_hi ^ c2_hi;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function s0_512_lo(xh, xl) {\n      var c0_lo = rotr64_lo(xh, xl, 28);\n      var c1_lo = rotr64_lo(xl, xh, 2);\n      var c2_lo = rotr64_lo(xl, xh, 7);\n      var r = c0_lo ^ c1_lo ^ c2_lo;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function s1_512_hi(xh, xl) {\n      var c0_hi = rotr64_hi(xh, xl, 14);\n      var c1_hi = rotr64_hi(xh, xl, 18);\n      var c2_hi = rotr64_hi(xl, xh, 9);\n      var r = c0_hi ^ c1_hi ^ c2_hi;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function s1_512_lo(xh, xl) {\n      var c0_lo = rotr64_lo(xh, xl, 14);\n      var c1_lo = rotr64_lo(xh, xl, 18);\n      var c2_lo = rotr64_lo(xl, xh, 9);\n      var r = c0_lo ^ c1_lo ^ c2_lo;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function g0_512_hi(xh, xl) {\n      var c0_hi = rotr64_hi(xh, xl, 1);\n      var c1_hi = rotr64_hi(xh, xl, 8);\n      var c2_hi = shr64_hi(xh, xl, 7);\n      var r = c0_hi ^ c1_hi ^ c2_hi;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function g0_512_lo(xh, xl) {\n      var c0_lo = rotr64_lo(xh, xl, 1);\n      var c1_lo = rotr64_lo(xh, xl, 8);\n      var c2_lo = shr64_lo(xh, xl, 7);\n      var r = c0_lo ^ c1_lo ^ c2_lo;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function g1_512_hi(xh, xl) {\n      var c0_hi = rotr64_hi(xh, xl, 19);\n      var c1_hi = rotr64_hi(xl, xh, 29);\n      var c2_hi = shr64_hi(xh, xl, 6);\n      var r = c0_hi ^ c1_hi ^ c2_hi;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n    function g1_512_lo(xh, xl) {\n      var c0_lo = rotr64_lo(xh, xl, 19);\n      var c1_lo = rotr64_lo(xl, xh, 29);\n      var c2_lo = shr64_lo(xh, xl, 6);\n      var r = c0_lo ^ c1_lo ^ c2_lo;\n      if (r < 0) r += 4294967296;\n      return r;\n    }\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha/384.js\nvar require__5 = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha/384.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils3();\n    var SHA512 = require__4();\n    function SHA384() {\n      if (!(this instanceof SHA384)) return new SHA384();\n      SHA512.call(this);\n      this.h = [\n        3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415,\n        4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428,\n      ];\n    }\n    utils.inherits(SHA384, SHA512);\n    module.exports = SHA384;\n    SHA384.blockSize = 1024;\n    SHA384.outSize = 384;\n    SHA384.hmacStrength = 192;\n    SHA384.padLength = 128;\n    SHA384.prototype._digest = function digest(enc) {\n      if (enc === \"hex\") return utils.toHex32(this.h.slice(0, 12), \"big\");\n      else return utils.split32(this.h.slice(0, 12), \"big\");\n    };\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/sha.js\nvar require_sha = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/sha.js\"(exports) {\n    \"use strict\";\n    exports.sha1 = require__();\n    exports.sha224 = require__3();\n    exports.sha256 = require__2();\n    exports.sha384 = require__5();\n    exports.sha512 = require__4();\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/ripemd.js\nvar require_ripemd = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/ripemd.js\"(exports) {\n    \"use strict\";\n    var utils = require_utils3();\n    var common = require_common();\n    var rotl32 = utils.rotl32;\n    var sum32 = utils.sum32;\n    var sum32_3 = utils.sum32_3;\n    var sum32_4 = utils.sum32_4;\n    var BlockHash = common.BlockHash;\n    function RIPEMD160() {\n      if (!(this instanceof RIPEMD160)) return new RIPEMD160();\n      BlockHash.call(this);\n      this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];\n      this.endian = \"little\";\n    }\n    utils.inherits(RIPEMD160, BlockHash);\n    exports.ripemd160 = RIPEMD160;\n    RIPEMD160.blockSize = 512;\n    RIPEMD160.outSize = 160;\n    RIPEMD160.hmacStrength = 192;\n    RIPEMD160.padLength = 64;\n    RIPEMD160.prototype._update = function update(msg, start) {\n      var A = this.h[0];\n      var B = this.h[1];\n      var C = this.h[2];\n      var D = this.h[3];\n      var E = this.h[4];\n      var Ah = A;\n      var Bh = B;\n      var Ch = C;\n      var Dh = D;\n      var Eh = E;\n      for (var j = 0; j < 80; j++) {\n        var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);\n        A = E;\n        E = D;\n        D = rotl32(C, 10);\n        C = B;\n        B = T;\n        T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh);\n        Ah = Eh;\n        Eh = Dh;\n        Dh = rotl32(Ch, 10);\n        Ch = Bh;\n        Bh = T;\n      }\n      T = sum32_3(this.h[1], C, Dh);\n      this.h[1] = sum32_3(this.h[2], D, Eh);\n      this.h[2] = sum32_3(this.h[3], E, Ah);\n      this.h[3] = sum32_3(this.h[4], A, Bh);\n      this.h[4] = sum32_3(this.h[0], B, Ch);\n      this.h[0] = T;\n    };\n    RIPEMD160.prototype._digest = function digest(enc) {\n      if (enc === \"hex\") return utils.toHex32(this.h, \"little\");\n      else return utils.split32(this.h, \"little\");\n    };\n    function f(j, x, y, z) {\n      if (j <= 15) return x ^ y ^ z;\n      else if (j <= 31) return (x & y) | (~x & z);\n      else if (j <= 47) return (x | ~y) ^ z;\n      else if (j <= 63) return (x & z) | (y & ~z);\n      else return x ^ (y | ~z);\n    }\n    function K(j) {\n      if (j <= 15) return 0;\n      else if (j <= 31) return 1518500249;\n      else if (j <= 47) return 1859775393;\n      else if (j <= 63) return 2400959708;\n      else return 2840853838;\n    }\n    function Kh(j) {\n      if (j <= 15) return 1352829926;\n      else if (j <= 31) return 1548603684;\n      else if (j <= 47) return 1836072691;\n      else if (j <= 63) return 2053994217;\n      else return 0;\n    }\n    var r = [\n      0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10,\n      14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9,\n      7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13,\n    ];\n    var rh = [\n      5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5,\n      1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10,\n      4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11,\n    ];\n    var s = [\n      11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n      11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9,\n      15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6,\n    ];\n    var sh = [\n      8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9,\n      7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5,\n      12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11,\n    ];\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash/hmac.js\nvar require_hmac = __commonJS({\n  \"../../node_modules/hash.js/lib/hash/hmac.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils3();\n    var assert = require_minimalistic_assert();\n    function Hmac(hash, key, enc) {\n      if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);\n      this.Hash = hash;\n      this.blockSize = hash.blockSize / 8;\n      this.outSize = hash.outSize / 8;\n      this.inner = null;\n      this.outer = null;\n      this._init(utils.toArray(key, enc));\n    }\n    module.exports = Hmac;\n    Hmac.prototype._init = function init(key) {\n      if (key.length > this.blockSize) key = new this.Hash().update(key).digest();\n      assert(key.length <= this.blockSize);\n      for (var i = key.length; i < this.blockSize; i++) key.push(0);\n      for (i = 0; i < key.length; i++) key[i] ^= 54;\n      this.inner = new this.Hash().update(key);\n      for (i = 0; i < key.length; i++) key[i] ^= 106;\n      this.outer = new this.Hash().update(key);\n    };\n    Hmac.prototype.update = function update(msg, enc) {\n      this.inner.update(msg, enc);\n      return this;\n    };\n    Hmac.prototype.digest = function digest(enc) {\n      this.outer.update(this.inner.digest());\n      return this.outer.digest(enc);\n    };\n  },\n});\n\n// ../../node_modules/hash.js/lib/hash.js\nvar require_hash = __commonJS({\n  \"../../node_modules/hash.js/lib/hash.js\"(exports) {\n    var hash = exports;\n    hash.utils = require_utils3();\n    hash.common = require_common();\n    hash.sha = require_sha();\n    hash.ripemd = require_ripemd();\n    hash.hmac = require_hmac();\n    hash.sha1 = hash.sha.sha1;\n    hash.sha256 = hash.sha.sha256;\n    hash.sha224 = hash.sha.sha224;\n    hash.sha384 = hash.sha.sha384;\n    hash.sha512 = hash.sha.sha512;\n    hash.ripemd160 = hash.ripemd.ripemd160;\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\nvar require_secp256k1 = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\"(exports, module) {\n    module.exports = {\n      doubles: {\n        step: 4,\n        points: [\n          [\n            \"e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\",\n            \"f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\",\n          ],\n          [\n            \"8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n            \"11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\",\n          ],\n          [\n            \"175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\",\n            \"d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\",\n          ],\n          [\n            \"363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n            \"4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\",\n          ],\n          [\n            \"8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\",\n            \"4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\",\n          ],\n          [\n            \"723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\",\n            \"96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\",\n          ],\n          [\n            \"eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\",\n            \"5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\",\n          ],\n          [\n            \"100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\",\n            \"cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\",\n          ],\n          [\n            \"e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\",\n            \"9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\",\n          ],\n          [\n            \"feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\",\n            \"e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\",\n          ],\n          [\n            \"da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\",\n            \"9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\",\n          ],\n          [\n            \"53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\",\n            \"5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\",\n          ],\n          [\n            \"8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\",\n            \"10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\",\n          ],\n          [\n            \"385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\",\n            \"283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\",\n          ],\n          [\n            \"6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\",\n            \"7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\",\n          ],\n          [\n            \"3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\",\n            \"56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\",\n          ],\n          [\n            \"85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\",\n            \"7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\",\n          ],\n          [\n            \"948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\",\n            \"53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\",\n          ],\n          [\n            \"6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\",\n            \"bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\",\n          ],\n          [\n            \"e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\",\n            \"4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\",\n          ],\n          [\n            \"e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\",\n            \"7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\",\n          ],\n          [\n            \"213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\",\n            \"4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\",\n          ],\n          [\n            \"4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\",\n            \"17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\",\n          ],\n          [\n            \"fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\",\n            \"6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\",\n          ],\n          [\n            \"76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\",\n            \"c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\",\n          ],\n          [\n            \"c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\",\n            \"893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\",\n          ],\n          [\n            \"d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\",\n            \"febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\",\n          ],\n          [\n            \"b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\",\n            \"2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\",\n          ],\n          [\n            \"e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\",\n            \"eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\",\n          ],\n          [\n            \"a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\",\n            \"7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\",\n          ],\n          [\n            \"90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\",\n            \"e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\",\n          ],\n          [\n            \"8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\",\n            \"662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\",\n          ],\n          [\n            \"e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\",\n            \"1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\",\n          ],\n          [\n            \"8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\",\n            \"efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\",\n          ],\n          [\n            \"e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\",\n            \"2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\",\n          ],\n          [\n            \"b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\",\n            \"67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\",\n          ],\n          [\n            \"d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\",\n            \"db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\",\n          ],\n          [\n            \"324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\",\n            \"648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\",\n          ],\n          [\n            \"4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\",\n            \"35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\",\n          ],\n          [\n            \"9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\",\n            \"ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\",\n          ],\n          [\n            \"6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\",\n            \"9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\",\n          ],\n          [\n            \"a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\",\n            \"40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\",\n          ],\n          [\n            \"7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\",\n            \"34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\",\n          ],\n          [\n            \"928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\",\n            \"c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\",\n          ],\n          [\n            \"85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\",\n            \"1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\",\n          ],\n          [\n            \"ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\",\n            \"493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\",\n          ],\n          [\n            \"827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\",\n            \"c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\",\n          ],\n          [\n            \"eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\",\n            \"be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\",\n          ],\n          [\n            \"e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\",\n            \"4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\",\n          ],\n          [\n            \"1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\",\n            \"aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\",\n          ],\n          [\n            \"146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\",\n            \"b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\",\n          ],\n          [\n            \"fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\",\n            \"6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\",\n          ],\n          [\n            \"da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\",\n            \"8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\",\n          ],\n          [\n            \"a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\",\n            \"7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\",\n          ],\n          [\n            \"174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\",\n            \"ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\",\n          ],\n          [\n            \"959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\",\n            \"2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\",\n          ],\n          [\n            \"d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\",\n            \"e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\",\n          ],\n          [\n            \"64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\",\n            \"d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\",\n          ],\n          [\n            \"8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\",\n            \"38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\",\n          ],\n          [\n            \"13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\",\n            \"69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\",\n          ],\n          [\n            \"bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\",\n            \"d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\",\n          ],\n          [\n            \"8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\",\n            \"40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\",\n          ],\n          [\n            \"8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\",\n            \"620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\",\n          ],\n          [\n            \"dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\",\n            \"7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\",\n          ],\n          [\n            \"f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\",\n            \"ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\",\n          ],\n        ],\n      },\n      naf: {\n        wnd: 7,\n        points: [\n          [\n            \"f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\",\n            \"388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\",\n          ],\n          [\n            \"2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\",\n            \"d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\",\n          ],\n          [\n            \"5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\",\n            \"6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\",\n          ],\n          [\n            \"acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\",\n            \"cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\",\n          ],\n          [\n            \"774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\",\n            \"d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\",\n          ],\n          [\n            \"f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\",\n            \"ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\",\n          ],\n          [\n            \"d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\",\n            \"581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\",\n          ],\n          [\n            \"defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\",\n            \"4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\",\n          ],\n          [\n            \"2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\",\n            \"85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\",\n          ],\n          [\n            \"352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\",\n            \"321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\",\n          ],\n          [\n            \"2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\",\n            \"2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\",\n          ],\n          [\n            \"9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\",\n            \"73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\",\n          ],\n          [\n            \"daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\",\n            \"a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\",\n          ],\n          [\n            \"c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\",\n            \"2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\",\n          ],\n          [\n            \"6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\",\n            \"e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\",\n          ],\n          [\n            \"1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\",\n            \"b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\",\n          ],\n          [\n            \"605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\",\n            \"2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\",\n          ],\n          [\n            \"62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\",\n            \"80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\",\n          ],\n          [\n            \"80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\",\n            \"1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\",\n          ],\n          [\n            \"7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\",\n            \"d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\",\n          ],\n          [\n            \"d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\",\n            \"eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\",\n          ],\n          [\n            \"49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\",\n            \"758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\",\n          ],\n          [\n            \"77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\",\n            \"958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\",\n          ],\n          [\n            \"f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\",\n            \"e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\",\n          ],\n          [\n            \"463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\",\n            \"5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\",\n          ],\n          [\n            \"f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\",\n            \"cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\",\n          ],\n          [\n            \"caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\",\n            \"cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\",\n          ],\n          [\n            \"2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\",\n            \"4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\",\n          ],\n          [\n            \"7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\",\n            \"91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\",\n          ],\n          [\n            \"754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\",\n            \"673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\",\n          ],\n          [\n            \"e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\",\n            \"59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\",\n          ],\n          [\n            \"186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\",\n            \"3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\",\n          ],\n          [\n            \"df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\",\n            \"55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\",\n          ],\n          [\n            \"5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\",\n            \"efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\",\n          ],\n          [\n            \"290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\",\n            \"e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\",\n          ],\n          [\n            \"af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\",\n            \"f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\",\n          ],\n          [\n            \"766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\",\n            \"744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\",\n          ],\n          [\n            \"59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\",\n            \"c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\",\n          ],\n          [\n            \"f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\",\n            \"e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\",\n          ],\n          [\n            \"7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\",\n            \"30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\",\n          ],\n          [\n            \"948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\",\n            \"e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\",\n          ],\n          [\n            \"7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\",\n            \"100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\",\n          ],\n          [\n            \"3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\",\n            \"ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\",\n          ],\n          [\n            \"d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\",\n            \"8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\",\n          ],\n          [\n            \"1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\",\n            \"68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\",\n          ],\n          [\n            \"733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\",\n            \"f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\",\n          ],\n          [\n            \"15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\",\n            \"d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\",\n          ],\n          [\n            \"a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\",\n            \"edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\",\n          ],\n          [\n            \"e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\",\n            \"a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\",\n          ],\n          [\n            \"311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\",\n            \"66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\",\n          ],\n          [\n            \"34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\",\n            \"9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\",\n          ],\n          [\n            \"f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\",\n            \"4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\",\n          ],\n          [\n            \"d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\",\n            \"fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\",\n          ],\n          [\n            \"32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\",\n            \"5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\",\n          ],\n          [\n            \"7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\",\n            \"8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\",\n          ],\n          [\n            \"ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\",\n            \"8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\",\n          ],\n          [\n            \"16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\",\n            \"5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\",\n          ],\n          [\n            \"eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\",\n            \"f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\",\n          ],\n          [\n            \"78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\",\n            \"f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\",\n          ],\n          [\n            \"494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\",\n            \"42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\",\n          ],\n          [\n            \"a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\",\n            \"204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\",\n          ],\n          [\n            \"c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\",\n            \"4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\",\n          ],\n          [\n            \"841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\",\n            \"73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\",\n          ],\n          [\n            \"5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\",\n            \"39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\",\n          ],\n          [\n            \"36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\",\n            \"d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\",\n          ],\n          [\n            \"336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\",\n            \"ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\",\n          ],\n          [\n            \"8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\",\n            \"6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\",\n          ],\n          [\n            \"1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\",\n            \"60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\",\n          ],\n          [\n            \"85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\",\n            \"3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\",\n          ],\n          [\n            \"29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\",\n            \"b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\",\n          ],\n          [\n            \"a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\",\n            \"ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\",\n          ],\n          [\n            \"4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\",\n            \"cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\",\n          ],\n          [\n            \"d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\",\n            \"6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\",\n          ],\n          [\n            \"ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\",\n            \"322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\",\n          ],\n          [\n            \"af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\",\n            \"6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\",\n          ],\n          [\n            \"e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\",\n            \"2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\",\n          ],\n          [\n            \"591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\",\n            \"b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\",\n          ],\n          [\n            \"11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\",\n            \"998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\",\n          ],\n          [\n            \"3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\",\n            \"b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\",\n          ],\n          [\n            \"cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\",\n            \"bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\",\n          ],\n          [\n            \"c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\",\n            \"6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\",\n          ],\n          [\n            \"c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\",\n            \"c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\",\n          ],\n          [\n            \"a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\",\n            \"21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\",\n          ],\n          [\n            \"347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\",\n            \"60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\",\n          ],\n          [\n            \"da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\",\n            \"49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\",\n          ],\n          [\n            \"c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\",\n            \"5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\",\n          ],\n          [\n            \"4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\",\n            \"7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\",\n          ],\n          [\n            \"3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\",\n            \"be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\",\n          ],\n          [\n            \"cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\",\n            \"8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\",\n          ],\n          [\n            \"b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\",\n            \"39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\",\n          ],\n          [\n            \"d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\",\n            \"62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\",\n          ],\n          [\n            \"48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\",\n            \"25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\",\n          ],\n          [\n            \"dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\",\n            \"ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\",\n          ],\n          [\n            \"6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\",\n            \"cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\",\n          ],\n          [\n            \"e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\",\n            \"f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\",\n          ],\n          [\n            \"eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\",\n            \"6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\",\n          ],\n          [\n            \"13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\",\n            \"fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\",\n          ],\n          [\n            \"ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\",\n            \"1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\",\n          ],\n          [\n            \"b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\",\n            \"5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\",\n          ],\n          [\n            \"ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\",\n            \"438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\",\n          ],\n          [\n            \"8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\",\n            \"cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\",\n          ],\n          [\n            \"52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\",\n            \"c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\",\n          ],\n          [\n            \"e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\",\n            \"6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\",\n          ],\n          [\n            \"7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\",\n            \"ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\",\n          ],\n          [\n            \"5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\",\n            \"9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\",\n          ],\n          [\n            \"32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\",\n            \"ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\",\n          ],\n          [\n            \"e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\",\n            \"d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\",\n          ],\n          [\n            \"8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\",\n            \"c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\",\n          ],\n          [\n            \"4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\",\n            \"67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\",\n          ],\n          [\n            \"3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\",\n            \"cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\",\n          ],\n          [\n            \"674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\",\n            \"299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\",\n          ],\n          [\n            \"d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\",\n            \"f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\",\n          ],\n          [\n            \"30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\",\n            \"462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\",\n          ],\n          [\n            \"be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\",\n            \"62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\",\n          ],\n          [\n            \"93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\",\n            \"7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\",\n          ],\n          [\n            \"b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\",\n            \"ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\",\n          ],\n          [\n            \"d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\",\n            \"4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\",\n          ],\n          [\n            \"d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\",\n            \"bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\",\n          ],\n          [\n            \"463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\",\n            \"bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\",\n          ],\n          [\n            \"7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\",\n            \"603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\",\n          ],\n          [\n            \"74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\",\n            \"cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\",\n          ],\n          [\n            \"30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\",\n            \"553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\",\n          ],\n          [\n            \"9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\",\n            \"712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\",\n          ],\n          [\n            \"176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\",\n            \"ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\",\n          ],\n          [\n            \"75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\",\n            \"9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\",\n          ],\n          [\n            \"809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\",\n            \"9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\",\n          ],\n          [\n            \"1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\",\n            \"4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\",\n          ],\n        ],\n      },\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/curves.js\nvar require_curves = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/curves.js\"(exports) {\n    \"use strict\";\n    var curves = exports;\n    var hash = require_hash();\n    var curve = require_curve();\n    var utils = require_utils2();\n    var assert = utils.assert;\n    function PresetCurve(options) {\n      if (options.type === \"short\") this.curve = new curve.short(options);\n      else if (options.type === \"edwards\") this.curve = new curve.edwards(options);\n      else this.curve = new curve.mont(options);\n      this.g = this.curve.g;\n      this.n = this.curve.n;\n      this.hash = options.hash;\n      assert(this.g.validate(), \"Invalid curve\");\n      assert(this.g.mul(this.n).isInfinity(), \"Invalid curve, G*N != O\");\n    }\n    curves.PresetCurve = PresetCurve;\n    function defineCurve(name, options) {\n      Object.defineProperty(curves, name, {\n        configurable: true,\n        enumerable: true,\n        get: function () {\n          var curve2 = new PresetCurve(options);\n          Object.defineProperty(curves, name, {\n            configurable: true,\n            enumerable: true,\n            value: curve2,\n          });\n          return curve2;\n        },\n      });\n    }\n    defineCurve(\"p192\", {\n      type: \"short\",\n      prime: \"p192\",\n      p: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",\n      a: \"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",\n      b: \"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",\n      n: \"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",\n      hash: hash.sha256,\n      gRed: false,\n      g: [\n        \"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\n        \"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\",\n      ],\n    });\n    defineCurve(\"p224\", {\n      type: \"short\",\n      prime: \"p224\",\n      p: \"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",\n      a: \"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",\n      b: \"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",\n      n: \"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",\n      hash: hash.sha256,\n      gRed: false,\n      g: [\n        \"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\n        \"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\",\n      ],\n    });\n    defineCurve(\"p256\", {\n      type: \"short\",\n      prime: null,\n      p: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",\n      a: \"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",\n      b: \"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",\n      n: \"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",\n      hash: hash.sha256,\n      gRed: false,\n      g: [\n        \"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\n        \"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\",\n      ],\n    });\n    defineCurve(\"p384\", {\n      type: \"short\",\n      prime: null,\n      p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",\n      a: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",\n      b: \"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",\n      n: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",\n      hash: hash.sha384,\n      gRed: false,\n      g: [\n        \"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\n        \"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\",\n      ],\n    });\n    defineCurve(\"p521\", {\n      type: \"short\",\n      prime: null,\n      p: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",\n      a: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",\n      b: \"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",\n      n: \"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",\n      hash: hash.sha512,\n      gRed: false,\n      g: [\n        \"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\n        \"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\",\n      ],\n    });\n    defineCurve(\"curve25519\", {\n      type: \"mont\",\n      prime: \"p25519\",\n      p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n      a: \"76d06\",\n      b: \"1\",\n      n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n      hash: hash.sha256,\n      gRed: false,\n      g: [\"9\"],\n    });\n    defineCurve(\"ed25519\", {\n      type: \"edwards\",\n      prime: \"p25519\",\n      p: \"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",\n      a: \"-1\",\n      c: \"1\",\n      // -121665 * (121666^(-1)) (mod P)\n      d: \"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",\n      n: \"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",\n      hash: hash.sha256,\n      gRed: false,\n      g: [\n        \"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\n        // 4/5\n        \"6666666666666666666666666666666666666666666666666666666666666658\",\n      ],\n    });\n    var pre;\n    try {\n      pre = require_secp256k1();\n    } catch (e) {\n      pre = void 0;\n    }\n    defineCurve(\"secp256k1\", {\n      type: \"short\",\n      prime: \"k256\",\n      p: \"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",\n      a: \"0\",\n      b: \"7\",\n      n: \"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",\n      h: \"1\",\n      hash: hash.sha256,\n      // Precomputed endomorphism\n      beta: \"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",\n      lambda: \"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",\n      basis: [\n        {\n          a: \"3086d221a7d46bcde86c90e49284eb15\",\n          b: \"-e4437ed6010e88286f547fa90abfe4c3\",\n        },\n        {\n          a: \"114ca50f7a8e2f3f657c1108d9d44cfd8\",\n          b: \"3086d221a7d46bcde86c90e49284eb15\",\n        },\n      ],\n      gRed: false,\n      g: [\n        \"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n        \"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        pre,\n      ],\n    });\n  },\n});\n\n// ../../node_modules/hmac-drbg/lib/hmac-drbg.js\nvar require_hmac_drbg = __commonJS({\n  \"../../node_modules/hmac-drbg/lib/hmac-drbg.js\"(exports, module) {\n    \"use strict\";\n    var hash = require_hash();\n    var utils = require_utils();\n    var assert = require_minimalistic_assert();\n    function HmacDRBG(options) {\n      if (!(this instanceof HmacDRBG)) return new HmacDRBG(options);\n      this.hash = options.hash;\n      this.predResist = !!options.predResist;\n      this.outLen = this.hash.outSize;\n      this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n      this._reseed = null;\n      this.reseedInterval = null;\n      this.K = null;\n      this.V = null;\n      var entropy = utils.toArray(options.entropy, options.entropyEnc || \"hex\");\n      var nonce = utils.toArray(options.nonce, options.nonceEnc || \"hex\");\n      var pers = utils.toArray(options.pers, options.persEnc || \"hex\");\n      assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\");\n      this._init(entropy, nonce, pers);\n    }\n    module.exports = HmacDRBG;\n    HmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n      var seed = entropy.concat(nonce).concat(pers);\n      this.K = new Array(this.outLen / 8);\n      this.V = new Array(this.outLen / 8);\n      for (var i = 0; i < this.V.length; i++) {\n        this.K[i] = 0;\n        this.V[i] = 1;\n      }\n      this._update(seed);\n      this._reseed = 1;\n      this.reseedInterval = 281474976710656;\n    };\n    HmacDRBG.prototype._hmac = function hmac() {\n      return new hash.hmac(this.hash, this.K);\n    };\n    HmacDRBG.prototype._update = function update(seed) {\n      var kmac = this._hmac().update(this.V).update([0]);\n      if (seed) kmac = kmac.update(seed);\n      this.K = kmac.digest();\n      this.V = this._hmac().update(this.V).digest();\n      if (!seed) return;\n      this.K = this._hmac().update(this.V).update([1]).update(seed).digest();\n      this.V = this._hmac().update(this.V).digest();\n    };\n    HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n      if (typeof entropyEnc !== \"string\") {\n        addEnc = add;\n        add = entropyEnc;\n        entropyEnc = null;\n      }\n      entropy = utils.toArray(entropy, entropyEnc);\n      add = utils.toArray(add, addEnc);\n      assert(entropy.length >= this.minEntropy / 8, \"Not enough entropy. Minimum is: \" + this.minEntropy + \" bits\");\n      this._update(entropy.concat(add || []));\n      this._reseed = 1;\n    };\n    HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n      if (this._reseed > this.reseedInterval) throw new Error(\"Reseed is required\");\n      if (typeof enc !== \"string\") {\n        addEnc = add;\n        add = enc;\n        enc = null;\n      }\n      if (add) {\n        add = utils.toArray(add, addEnc || \"hex\");\n        this._update(add);\n      }\n      var temp = [];\n      while (temp.length < len) {\n        this.V = this._hmac().update(this.V).digest();\n        temp = temp.concat(this.V);\n      }\n      var res = temp.slice(0, len);\n      this._update(add);\n      this._reseed++;\n      return utils.encode(res, enc);\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/ec/key.js\nvar require_key = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/ec/key.js\"(exports, module) {\n    \"use strict\";\n    var BN = require_bn();\n    var utils = require_utils2();\n    var assert = utils.assert;\n    function KeyPair(ec2, options) {\n      this.ec = ec2;\n      this.priv = null;\n      this.pub = null;\n      if (options.priv) this._importPrivate(options.priv, options.privEnc);\n      if (options.pub) this._importPublic(options.pub, options.pubEnc);\n    }\n    module.exports = KeyPair;\n    KeyPair.fromPublic = function fromPublic(ec2, pub, enc) {\n      if (pub instanceof KeyPair) return pub;\n      return new KeyPair(ec2, {\n        pub,\n        pubEnc: enc,\n      });\n    };\n    KeyPair.fromPrivate = function fromPrivate(ec2, priv, enc) {\n      if (priv instanceof KeyPair) return priv;\n      return new KeyPair(ec2, {\n        priv,\n        privEnc: enc,\n      });\n    };\n    KeyPair.prototype.validate = function validate() {\n      var pub = this.getPublic();\n      if (pub.isInfinity()) return { result: false, reason: \"Invalid public key\" };\n      if (!pub.validate()) return { result: false, reason: \"Public key is not a point\" };\n      if (!pub.mul(this.ec.curve.n).isInfinity()) return { result: false, reason: \"Public key * N != O\" };\n      return { result: true, reason: null };\n    };\n    KeyPair.prototype.getPublic = function getPublic(compact, enc) {\n      if (typeof compact === \"string\") {\n        enc = compact;\n        compact = null;\n      }\n      if (!this.pub) this.pub = this.ec.g.mul(this.priv);\n      if (!enc) return this.pub;\n      return this.pub.encode(enc, compact);\n    };\n    KeyPair.prototype.getPrivate = function getPrivate(enc) {\n      if (enc === \"hex\") return this.priv.toString(16, 2);\n      else return this.priv;\n    };\n    KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n      this.priv = new BN(key, enc || 16);\n      this.priv = this.priv.umod(this.ec.curve.n);\n    };\n    KeyPair.prototype._importPublic = function _importPublic(key, enc) {\n      if (key.x || key.y) {\n        if (this.ec.curve.type === \"mont\") {\n          assert(key.x, \"Need x coordinate\");\n        } else if (this.ec.curve.type === \"short\" || this.ec.curve.type === \"edwards\") {\n          assert(key.x && key.y, \"Need both x and y coordinate\");\n        }\n        this.pub = this.ec.curve.point(key.x, key.y);\n        return;\n      }\n      this.pub = this.ec.curve.decodePoint(key, enc);\n    };\n    KeyPair.prototype.derive = function derive(pub) {\n      if (!pub.validate()) {\n        assert(pub.validate(), \"public point not validated\");\n      }\n      return pub.mul(this.priv).getX();\n    };\n    KeyPair.prototype.sign = function sign(msg, enc, options) {\n      return this.ec.sign(msg, this, enc, options);\n    };\n    KeyPair.prototype.verify = function verify(msg, signature) {\n      return this.ec.verify(msg, signature, this);\n    };\n    KeyPair.prototype.inspect = function inspect() {\n      return (\n        \"<Key priv: \" + (this.priv && this.priv.toString(16, 2)) + \" pub: \" + (this.pub && this.pub.inspect()) + \" >\"\n      );\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/ec/signature.js\nvar require_signature = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/ec/signature.js\"(exports, module) {\n    \"use strict\";\n    var BN = require_bn();\n    var utils = require_utils2();\n    var assert = utils.assert;\n    function Signature(options, enc) {\n      if (options instanceof Signature) return options;\n      if (this._importDER(options, enc)) return;\n      assert(options.r && options.s, \"Signature without r or s\");\n      this.r = new BN(options.r, 16);\n      this.s = new BN(options.s, 16);\n      if (options.recoveryParam === void 0) this.recoveryParam = null;\n      else this.recoveryParam = options.recoveryParam;\n    }\n    module.exports = Signature;\n    function Position() {\n      this.place = 0;\n    }\n    function getLength(buf, p) {\n      var initial = buf[p.place++];\n      if (!(initial & 128)) {\n        return initial;\n      }\n      var octetLen = initial & 15;\n      if (octetLen === 0 || octetLen > 4) {\n        return false;\n      }\n      var val = 0;\n      for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n        val <<= 8;\n        val |= buf[off];\n        val >>>= 0;\n      }\n      if (val <= 127) {\n        return false;\n      }\n      p.place = off;\n      return val;\n    }\n    function rmPadding(buf) {\n      var i = 0;\n      var len = buf.length - 1;\n      while (!buf[i] && !(buf[i + 1] & 128) && i < len) {\n        i++;\n      }\n      if (i === 0) {\n        return buf;\n      }\n      return buf.slice(i);\n    }\n    Signature.prototype._importDER = function _importDER(data, enc) {\n      data = utils.toArray(data, enc);\n      var p = new Position();\n      if (data[p.place++] !== 48) {\n        return false;\n      }\n      var len = getLength(data, p);\n      if (len === false) {\n        return false;\n      }\n      if (len + p.place !== data.length) {\n        return false;\n      }\n      if (data[p.place++] !== 2) {\n        return false;\n      }\n      var rlen = getLength(data, p);\n      if (rlen === false) {\n        return false;\n      }\n      var r = data.slice(p.place, rlen + p.place);\n      p.place += rlen;\n      if (data[p.place++] !== 2) {\n        return false;\n      }\n      var slen = getLength(data, p);\n      if (slen === false) {\n        return false;\n      }\n      if (data.length !== slen + p.place) {\n        return false;\n      }\n      var s = data.slice(p.place, slen + p.place);\n      if (r[0] === 0) {\n        if (r[1] & 128) {\n          r = r.slice(1);\n        } else {\n          return false;\n        }\n      }\n      if (s[0] === 0) {\n        if (s[1] & 128) {\n          s = s.slice(1);\n        } else {\n          return false;\n        }\n      }\n      this.r = new BN(r);\n      this.s = new BN(s);\n      this.recoveryParam = null;\n      return true;\n    };\n    function constructLength(arr, len) {\n      if (len < 128) {\n        arr.push(len);\n        return;\n      }\n      var octets = 1 + ((Math.log(len) / Math.LN2) >>> 3);\n      arr.push(octets | 128);\n      while (--octets) {\n        arr.push((len >>> (octets << 3)) & 255);\n      }\n      arr.push(len);\n    }\n    Signature.prototype.toDER = function toDER(enc) {\n      var r = this.r.toArray();\n      var s = this.s.toArray();\n      if (r[0] & 128) r = [0].concat(r);\n      if (s[0] & 128) s = [0].concat(s);\n      r = rmPadding(r);\n      s = rmPadding(s);\n      while (!s[0] && !(s[1] & 128)) {\n        s = s.slice(1);\n      }\n      var arr = [2];\n      constructLength(arr, r.length);\n      arr = arr.concat(r);\n      arr.push(2);\n      constructLength(arr, s.length);\n      var backHalf = arr.concat(s);\n      var res = [48];\n      constructLength(res, backHalf.length);\n      res = res.concat(backHalf);\n      return utils.encode(res, enc);\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/ec/index.js\nvar require_ec = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/ec/index.js\"(exports, module) {\n    \"use strict\";\n    var BN = require_bn();\n    var HmacDRBG = require_hmac_drbg();\n    var utils = require_utils2();\n    var curves = require_curves();\n    var rand = require_brorand();\n    var assert = utils.assert;\n    var KeyPair = require_key();\n    var Signature = require_signature();\n    function EC(options) {\n      if (!(this instanceof EC)) return new EC(options);\n      if (typeof options === \"string\") {\n        assert(Object.prototype.hasOwnProperty.call(curves, options), \"Unknown curve \" + options);\n        options = curves[options];\n      }\n      if (options instanceof curves.PresetCurve) options = { curve: options };\n      this.curve = options.curve.curve;\n      this.n = this.curve.n;\n      this.nh = this.n.ushrn(1);\n      this.g = this.curve.g;\n      this.g = options.curve.g;\n      this.g.precompute(options.curve.n.bitLength() + 1);\n      this.hash = options.hash || options.curve.hash;\n    }\n    module.exports = EC;\n    EC.prototype.keyPair = function keyPair(options) {\n      return new KeyPair(this, options);\n    };\n    EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n      return KeyPair.fromPrivate(this, priv, enc);\n    };\n    EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n      return KeyPair.fromPublic(this, pub, enc);\n    };\n    EC.prototype.genKeyPair = function genKeyPair(options) {\n      if (!options) options = {};\n      var drbg = new HmacDRBG({\n        hash: this.hash,\n        pers: options.pers,\n        persEnc: options.persEnc || \"utf8\",\n        entropy: options.entropy || rand(this.hash.hmacStrength),\n        entropyEnc: (options.entropy && options.entropyEnc) || \"utf8\",\n        nonce: this.n.toArray(),\n      });\n      var bytes = this.n.byteLength();\n      var ns2 = this.n.sub(new BN(2));\n      for (;;) {\n        var priv = new BN(drbg.generate(bytes));\n        if (priv.cmp(ns2) > 0) continue;\n        priv.iaddn(1);\n        return this.keyFromPrivate(priv);\n      }\n    };\n    EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {\n      var delta = msg.byteLength() * 8 - this.n.bitLength();\n      if (delta > 0) msg = msg.ushrn(delta);\n      if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n);\n      else return msg;\n    };\n    EC.prototype.sign = function sign(msg, key, enc, options) {\n      if (typeof enc === \"object\") {\n        options = enc;\n        enc = null;\n      }\n      if (!options) options = {};\n      key = this.keyFromPrivate(key, enc);\n      msg = this._truncateToN(new BN(msg, 16));\n      var bytes = this.n.byteLength();\n      var bkey = key.getPrivate().toArray(\"be\", bytes);\n      var nonce = msg.toArray(\"be\", bytes);\n      var drbg = new HmacDRBG({\n        hash: this.hash,\n        entropy: bkey,\n        nonce,\n        pers: options.pers,\n        persEnc: options.persEnc || \"utf8\",\n      });\n      var ns1 = this.n.sub(new BN(1));\n      for (var iter = 0; ; iter++) {\n        var k = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));\n        k = this._truncateToN(k, true);\n        if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue;\n        var kp = this.g.mul(k);\n        if (kp.isInfinity()) continue;\n        var kpX = kp.getX();\n        var r = kpX.umod(this.n);\n        if (r.cmpn(0) === 0) continue;\n        var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n        s = s.umod(this.n);\n        if (s.cmpn(0) === 0) continue;\n        var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r) !== 0 ? 2 : 0);\n        if (options.canonical && s.cmp(this.nh) > 0) {\n          s = this.n.sub(s);\n          recoveryParam ^= 1;\n        }\n        return new Signature({ r, s, recoveryParam });\n      }\n    };\n    EC.prototype.verify = function verify(msg, signature, key, enc) {\n      msg = this._truncateToN(new BN(msg, 16));\n      key = this.keyFromPublic(key, enc);\n      signature = new Signature(signature, \"hex\");\n      var r = signature.r;\n      var s = signature.s;\n      if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) return false;\n      if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false;\n      var sinv = s.invm(this.n);\n      var u1 = sinv.mul(msg).umod(this.n);\n      var u2 = sinv.mul(r).umod(this.n);\n      var p;\n      if (!this.curve._maxwellTrick) {\n        p = this.g.mulAdd(u1, key.getPublic(), u2);\n        if (p.isInfinity()) return false;\n        return p.getX().umod(this.n).cmp(r) === 0;\n      }\n      p = this.g.jmulAdd(u1, key.getPublic(), u2);\n      if (p.isInfinity()) return false;\n      return p.eqXToP(r);\n    };\n    EC.prototype.recoverPubKey = function (msg, signature, j, enc) {\n      assert((3 & j) === j, \"The recovery param is more than two bits\");\n      signature = new Signature(signature, enc);\n      var n = this.n;\n      var e = new BN(msg);\n      var r = signature.r;\n      var s = signature.s;\n      var isYOdd = j & 1;\n      var isSecondKey = j >> 1;\n      if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n        throw new Error(\"Unable to find sencond key candinate\");\n      if (isSecondKey) r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n      else r = this.curve.pointFromX(r, isYOdd);\n      var rInv = signature.r.invm(n);\n      var s1 = n.sub(e).mul(rInv).umod(n);\n      var s2 = s.mul(rInv).umod(n);\n      return this.g.mulAdd(s1, r, s2);\n    };\n    EC.prototype.getKeyRecoveryParam = function (e, signature, Q, enc) {\n      signature = new Signature(signature, enc);\n      if (signature.recoveryParam !== null) return signature.recoveryParam;\n      for (var i = 0; i < 4; i++) {\n        var Qprime;\n        try {\n          Qprime = this.recoverPubKey(e, signature, i);\n        } catch (e2) {\n          continue;\n        }\n        if (Qprime.eq(Q)) return i;\n      }\n      throw new Error(\"Unable to find valid recovery factor\");\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/eddsa/key.js\nvar require_key2 = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/eddsa/key.js\"(exports, module) {\n    \"use strict\";\n    var utils = require_utils2();\n    var assert = utils.assert;\n    var parseBytes = utils.parseBytes;\n    var cachedProperty = utils.cachedProperty;\n    function KeyPair(eddsa, params) {\n      this.eddsa = eddsa;\n      this._secret = parseBytes(params.secret);\n      if (eddsa.isPoint(params.pub)) this._pub = params.pub;\n      else this._pubBytes = parseBytes(params.pub);\n    }\n    KeyPair.fromPublic = function fromPublic(eddsa, pub) {\n      if (pub instanceof KeyPair) return pub;\n      return new KeyPair(eddsa, { pub });\n    };\n    KeyPair.fromSecret = function fromSecret(eddsa, secret) {\n      if (secret instanceof KeyPair) return secret;\n      return new KeyPair(eddsa, { secret });\n    };\n    KeyPair.prototype.secret = function secret() {\n      return this._secret;\n    };\n    cachedProperty(KeyPair, \"pubBytes\", function pubBytes() {\n      return this.eddsa.encodePoint(this.pub());\n    });\n    cachedProperty(KeyPair, \"pub\", function pub() {\n      if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes);\n      return this.eddsa.g.mul(this.priv());\n    });\n    cachedProperty(KeyPair, \"privBytes\", function privBytes() {\n      var eddsa = this.eddsa;\n      var hash = this.hash();\n      var lastIx = eddsa.encodingLength - 1;\n      var a = hash.slice(0, eddsa.encodingLength);\n      a[0] &= 248;\n      a[lastIx] &= 127;\n      a[lastIx] |= 64;\n      return a;\n    });\n    cachedProperty(KeyPair, \"priv\", function priv() {\n      return this.eddsa.decodeInt(this.privBytes());\n    });\n    cachedProperty(KeyPair, \"hash\", function hash() {\n      return this.eddsa.hash().update(this.secret()).digest();\n    });\n    cachedProperty(KeyPair, \"messagePrefix\", function messagePrefix() {\n      return this.hash().slice(this.eddsa.encodingLength);\n    });\n    KeyPair.prototype.sign = function sign(message) {\n      assert(this._secret, \"KeyPair can only verify\");\n      return this.eddsa.sign(message, this);\n    };\n    KeyPair.prototype.verify = function verify(message, sig) {\n      return this.eddsa.verify(message, sig, this);\n    };\n    KeyPair.prototype.getSecret = function getSecret(enc) {\n      assert(this._secret, \"KeyPair is public only\");\n      return utils.encode(this.secret(), enc);\n    };\n    KeyPair.prototype.getPublic = function getPublic(enc) {\n      return utils.encode(this.pubBytes(), enc);\n    };\n    module.exports = KeyPair;\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/eddsa/signature.js\nvar require_signature2 = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/eddsa/signature.js\"(exports, module) {\n    \"use strict\";\n    var BN = require_bn();\n    var utils = require_utils2();\n    var assert = utils.assert;\n    var cachedProperty = utils.cachedProperty;\n    var parseBytes = utils.parseBytes;\n    function Signature(eddsa, sig) {\n      this.eddsa = eddsa;\n      if (typeof sig !== \"object\") sig = parseBytes(sig);\n      if (Array.isArray(sig)) {\n        sig = {\n          R: sig.slice(0, eddsa.encodingLength),\n          S: sig.slice(eddsa.encodingLength),\n        };\n      }\n      assert(sig.R && sig.S, \"Signature without R or S\");\n      if (eddsa.isPoint(sig.R)) this._R = sig.R;\n      if (sig.S instanceof BN) this._S = sig.S;\n      this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n      this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n    }\n    cachedProperty(Signature, \"S\", function S() {\n      return this.eddsa.decodeInt(this.Sencoded());\n    });\n    cachedProperty(Signature, \"R\", function R() {\n      return this.eddsa.decodePoint(this.Rencoded());\n    });\n    cachedProperty(Signature, \"Rencoded\", function Rencoded() {\n      return this.eddsa.encodePoint(this.R());\n    });\n    cachedProperty(Signature, \"Sencoded\", function Sencoded() {\n      return this.eddsa.encodeInt(this.S());\n    });\n    Signature.prototype.toBytes = function toBytes() {\n      return this.Rencoded().concat(this.Sencoded());\n    };\n    Signature.prototype.toHex = function toHex() {\n      return utils.encode(this.toBytes(), \"hex\").toUpperCase();\n    };\n    module.exports = Signature;\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic/eddsa/index.js\nvar require_eddsa = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic/eddsa/index.js\"(exports, module) {\n    \"use strict\";\n    var hash = require_hash();\n    var curves = require_curves();\n    var utils = require_utils2();\n    var assert = utils.assert;\n    var parseBytes = utils.parseBytes;\n    var KeyPair = require_key2();\n    var Signature = require_signature2();\n    function EDDSA(curve) {\n      assert(curve === \"ed25519\", \"only tested with ed25519 so far\");\n      if (!(this instanceof EDDSA)) return new EDDSA(curve);\n      curve = curves[curve].curve;\n      this.curve = curve;\n      this.g = curve.g;\n      this.g.precompute(curve.n.bitLength() + 1);\n      this.pointClass = curve.point().constructor;\n      this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n      this.hash = hash.sha512;\n    }\n    module.exports = EDDSA;\n    EDDSA.prototype.sign = function sign(message, secret) {\n      message = parseBytes(message);\n      var key = this.keyFromSecret(secret);\n      var r = this.hashInt(key.messagePrefix(), message);\n      var R = this.g.mul(r);\n      var Rencoded = this.encodePoint(R);\n      var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv());\n      var S = r.add(s_).umod(this.curve.n);\n      return this.makeSignature({ R, S, Rencoded });\n    };\n    EDDSA.prototype.verify = function verify(message, sig, pub) {\n      message = parseBytes(message);\n      sig = this.makeSignature(sig);\n      var key = this.keyFromPublic(pub);\n      var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n      var SG = this.g.mul(sig.S());\n      var RplusAh = sig.R().add(key.pub().mul(h));\n      return RplusAh.eq(SG);\n    };\n    EDDSA.prototype.hashInt = function hashInt() {\n      var hash2 = this.hash();\n      for (var i = 0; i < arguments.length; i++) hash2.update(arguments[i]);\n      return utils.intFromLE(hash2.digest()).umod(this.curve.n);\n    };\n    EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n      return KeyPair.fromPublic(this, pub);\n    };\n    EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n      return KeyPair.fromSecret(this, secret);\n    };\n    EDDSA.prototype.makeSignature = function makeSignature(sig) {\n      if (sig instanceof Signature) return sig;\n      return new Signature(this, sig);\n    };\n    EDDSA.prototype.encodePoint = function encodePoint(point) {\n      var enc = point.getY().toArray(\"le\", this.encodingLength);\n      enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0;\n      return enc;\n    };\n    EDDSA.prototype.decodePoint = function decodePoint(bytes) {\n      bytes = utils.parseBytes(bytes);\n      var lastIx = bytes.length - 1;\n      var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~128);\n      var xIsOdd = (bytes[lastIx] & 128) !== 0;\n      var y = utils.intFromLE(normed);\n      return this.curve.pointFromY(y, xIsOdd);\n    };\n    EDDSA.prototype.encodeInt = function encodeInt(num) {\n      return num.toArray(\"le\", this.encodingLength);\n    };\n    EDDSA.prototype.decodeInt = function decodeInt(bytes) {\n      return utils.intFromLE(bytes);\n    };\n    EDDSA.prototype.isPoint = function isPoint(val) {\n      return val instanceof this.pointClass;\n    };\n  },\n});\n\n// ../../node_modules/elliptic/lib/elliptic.js\nvar require_elliptic = __commonJS({\n  \"../../node_modules/elliptic/lib/elliptic.js\"(exports) {\n    \"use strict\";\n    var elliptic = exports;\n    elliptic.version = require_package().version;\n    elliptic.utils = require_utils2();\n    elliptic.rand = require_brorand();\n    elliptic.curve = require_curve();\n    elliptic.curves = require_curves();\n    elliptic.ec = require_ec();\n    elliptic.eddsa = require_eddsa();\n  },\n});\n\n// scripts/Ec.js\nvar import_elliptic = __toESM(require_elliptic());\nvar export_Ec = import_elliptic.ec;\nexport { export_Ec as Ec };\n"
  },
  {
    "path": "packages/signature-v4a/src/index.ts",
    "content": "import { signatureV4aContainer } from \"@smithy/signature-v4\";\n\nimport { SignatureV4a } from \"./SignatureV4a\";\n\nsignatureV4aContainer.SignatureV4a = SignatureV4a;\n\nexport * from \"./SignatureV4a\";\n"
  },
  {
    "path": "packages/signature-v4a/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4a/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4a/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/signature-v4a/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/node_modules/**\", \"**/es/**\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/smithy-client/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/smithy-client/CHANGELOG.md",
    "content": "# @smithy/smithy-client\n\n## 4.13.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 4.13.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.13.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.13.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/smithy-client/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/smithy-client/package.json",
    "content": "{\n  \"name\": \"@smithy/smithy-client\",\n  \"version\": \"4.13.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/smithy-client\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/smithy-client\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/smithy-client/scripts/fix-api-extractor.js",
    "content": "const fs = require(\"node:fs\");\nconst path = require(\"path\");\n\nconst file = path.join(__dirname, \"..\", \"dist-types\", \"index.d.ts\");\n\nconst contents = fs.readFileSync(file, \"utf-8\");\n\n/**\n * This build script temporarily excludes the statement\n * ```\n * export * from \"@smithy/core/serde\";\n * ```\n * from the package's type declarations during running api-extractor.\n *\n * This has no effect on the runtime, but api-extractor at this time cannot understand\n * the package.json exports field nor the compatibility redirect (packages/core/serde.d.ts).\n */\n\nmodule.exports = {\n  source: `export * from \"@smithy/core/serde\";`,\n  replacement: `/* export * from \"@smithy/core/serde\"; */`,\n  unset() {\n    fs.writeFileSync(file, contents.replace(module.exports.replacement, module.exports.source));\n  },\n  set() {\n    fs.writeFileSync(file, contents.replace(module.exports.source, module.exports.replacement));\n  },\n};\n\nif (process.argv.includes(\"--unset\")) {\n  module.exports.unset();\n} else {\n  module.exports.set();\n}\n"
  },
  {
    "path": "packages/smithy-client/src/index.ts",
    "content": "/** @deprecated Use @smithy/core submodules instead. */\nexport type { DocumentType, SdkError, SmithyException } from \"@smithy/types\";\n\n// from @smithy/core/serde\nexport {\n  LazyJsonString,\n  NumericValue,\n  _parseEpochTimestamp,\n  _parseRfc3339DateTimeWithOffset,\n  _parseRfc7231DateTime,\n  copyDocumentWithTransform,\n  dateToUtcString,\n  expectBoolean,\n  expectByte,\n  expectFloat32,\n  expectInt,\n  expectInt32,\n  expectLong,\n  expectNonNull,\n  expectNumber,\n  expectObject,\n  expectShort,\n  expectString,\n  expectUnion,\n  generateIdempotencyToken,\n  handleFloat,\n  limitedParseDouble,\n  limitedParseFloat,\n  limitedParseFloat32,\n  logger,\n  nv,\n  parseBoolean,\n  parseEpochTimestamp,\n  parseRfc3339DateTime,\n  parseRfc3339DateTimeWithOffset,\n  parseRfc7231DateTime,\n  quoteHeader,\n  splitEvery,\n  splitHeader,\n  strictParseByte,\n  strictParseDouble,\n  strictParseFloat,\n  strictParseFloat32,\n  strictParseInt,\n  strictParseInt32,\n  strictParseLong,\n  strictParseShort,\n} from \"@smithy/core/serde\";\nexport type { AutomaticJsonStringConversion, NumericType } from \"@smithy/core/serde\";\n\n// from @smithy/core/client\nexport {\n  Client,\n  Command,\n  NoOpLogger,\n  SENSITIVE_STRING,\n  ServiceException,\n  _json,\n  convertMap,\n  createAggregatedClient,\n  decorateServiceException,\n  emitWarningIfUnsupportedVersion,\n  getArrayIfSingleItem,\n  getDefaultClientConfiguration,\n  getDefaultExtensionConfiguration,\n  getValueFromTextNode,\n  isSerializableHeaderValue,\n  loadConfigsForDefaultMode,\n  map,\n  resolveDefaultRuntimeConfig,\n  serializeDateTime,\n  serializeFloat,\n  take,\n  throwDefaultError,\n  withBaseException,\n} from \"@smithy/core/client\";\nexport type {\n  CommandImpl,\n  ConditionalLazyValueInstruction,\n  ConditionalValueInstruction,\n  DefaultExtensionRuntimeConfigType,\n  DefaultsMode,\n  DefaultsModeConfigs,\n  ExceptionOptionType,\n  FilterStatus,\n  FilterStatusSupplier,\n  LazyValueInstruction,\n  ObjectMappingInstruction,\n  ObjectMappingInstructions,\n  ResolvedDefaultsMode,\n  ServiceExceptionOptions,\n  SimpleValueInstruction,\n  SmithyConfiguration,\n  SmithyResolvedConfiguration,\n  SourceMappingInstruction,\n  SourceMappingInstructions,\n  UnfilteredValue,\n  Value,\n  ValueFilteringFunction,\n  ValueMapper,\n  ValueSupplier,\n} from \"@smithy/core/client\";\n\n// from @smithy/core/protocols\nexport { collectBody, extendedEncodeURIComponent, resolvedPath } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/smithy-client/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/smithy-client/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"noUnusedLocals\": true,\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/smithy-client/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/snapshot-testing/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/snapshot-testing/CHANGELOG.md",
    "content": "# Change Log\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n  - @smithy/node-http-handler@4.7.3\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n  - @smithy/node-http-handler@4.7.2\n\n## 2.1.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n  - @smithy/node-http-handler@4.7.1\n\n## 2.1.0\n\n### Minor Changes\n\n- 4f30af1: consolidation for core/protocols\n- 8963b91: consolidate packages into core/serde\n- cad44fc: consolidate core/event-streams\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [da4e89e]\n- Updated dependencies [5329323]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [09093fb]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [75603d4]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n  - @smithy/node-http-handler@4.7.0\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies [769ed47]\n  - @smithy/node-http-handler@4.6.1\n  - @smithy/core@3.23.17\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n- Updated dependencies [60d13c8]\n  - @smithy/core@3.23.16\n  - @smithy/node-http-handler@4.6.0\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/node-http-handler@4.5.3\n  - @smithy/types@4.14.1\n  - @smithy/core@3.23.15\n  - @smithy/eventstream-codec@4.2.14\n  - @smithy/protocol-http@5.3.14\n\n## 2.0.5\n\n### Patch Changes\n\n- fe15001: generate sparse values in snapshots\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/eventstream-codec@4.2.13\n  - @smithy/node-http-handler@4.5.2\n  - @smithy/protocol-http@5.3.13\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies [fac1a34]\n- Updated dependencies [7198e09]\n  - @smithy/node-http-handler@4.5.1\n  - @smithy/core@3.23.13\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies [4e7fa38]\n  - @smithy/node-http-handler@4.5.0\n  - @smithy/core@3.23.12\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies [dab22f1]\n- Updated dependencies [2edd638]\n  - @smithy/node-http-handler@4.4.16\n  - @smithy/core@3.23.11\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/core@3.23.10\n  - @smithy/types@4.13.1\n  - @smithy/eventstream-codec@4.2.12\n  - @smithy/node-http-handler@4.4.15\n  - @smithy/protocol-http@5.3.12\n\n## 2.0.0\n\n### Major Changes\n\n- 8cc5514: add error snapshots\n\n## 1.0.10\n\n### Patch Changes\n\n- 6ef5430: add response snapshot generation\n- Updated dependencies [6ef5430]\n- Updated dependencies [6ef5430]\n  - @smithy/core@3.23.9\n\n## 1.0.9\n\n### Patch Changes\n\n- Updated dependencies [a4d95e6]\n  - @smithy/eventstream-codec@4.2.11\n  - @smithy/util-hex-encoding@4.2.2\n  - @smithy/protocol-http@5.3.11\n  - @smithy/util-base64@4.3.2\n  - @smithy/util-utf8@4.2.2\n  - @smithy/core@3.23.8\n\n## 1.0.8\n\n### Patch Changes\n\n- Updated dependencies [11569eb]\n  - @smithy/core@3.23.7\n\n## 1.0.7\n\n### Patch Changes\n\n- c8f3a9f: additional member value overrides for snapshot data generator\n\n## 1.0.6\n\n### Patch Changes\n\n- abfdfb6: in snapshot-testing, normalize date string timezone\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/core@3.23.6\n  - @smithy/eventstream-codec@4.2.10\n  - @smithy/protocol-http@5.3.10\n\n## 1.0.5\n\n### Patch Changes\n\n- Updated dependencies [026b177]\n- Updated dependencies [cde9f09]\n  - @smithy/core@3.23.5\n\n## 1.0.4\n\n### Patch Changes\n\n- 832fa25: omit exec env from user agent\n\n## 1.0.3\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/core@3.23.4\n  - @smithy/eventstream-codec@4.2.9\n  - @smithy/protocol-http@5.3.9\n  - @smithy/types@4.12.1\n  - @smithy/util-base64@4.3.1\n  - @smithy/util-hex-encoding@4.2.1\n  - @smithy/util-utf8@4.2.1\n\n## 1.0.2\n\n### Patch Changes\n\n- @smithy/core@3.23.3\n\n## 1.0.1\n\n### Patch Changes\n\n- b1c9f6c: fix snapshotting of AWS event stream inputs\n\n## 1.0.0\n\n### Major Changes\n\n- c5db01c: internal snapshot testing package\n\n### Patch Changes\n\n- Updated dependencies [c5db01c]\n  - @smithy/core@3.23.2\n"
  },
  {
    "path": "packages/snapshot-testing/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/snapshot-testing/README.md",
    "content": "# @smithy/snapshot-testing\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/snapshot-testing/latest.svg)](https://www.npmjs.com/package/@smithy/snapshot-testing)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/snapshot-testing.svg)](https://www.npmjs.com/package/@smithy/snapshot-testing)\n\nThis is an internal package used for snapshot testing.\n"
  },
  {
    "path": "packages/snapshot-testing/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/EmptyInputOutput.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/EmptyInputOutput\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 1\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/Float16.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/Float16\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/FractionalSeconds.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/FractionalSeconds\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/GreetingWithErrors.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/GreetingWithErrors\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/NoInputOutput.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/NoInputOutput\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/RecursiveShapes.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/RecursiveShapes\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 107\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"nested\": {\n    \"foo\": \"__foo__\",\n    \"nested\": {\n      \"bar\": \"__bar__\",\n      \"recursiveMember\": {\n        \"foo\": \"__foo__\",\n        \"nested\": {\n          \"bar\": \"__bar__\",\n          \"recursiveMember\": {}\n        }\n      }\n    }\n  }\n}\n\n[actual bytes]\n161, 102, 110, 101, 115, 116, 101, 100, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110, 101,\n115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114, 115,\n105, 118, 101, 77, 101, 109, 98, 101, 114, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110,\n101, 115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114,\n115, 105, 118, 101, 77, 101, 109, 98, 101, 114, 160\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/RpcV2CborSparseMaps.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 370\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStructMap\": {\n    \"key1\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key2\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key3\": {\n      \"hi\": \"__hi__\"\n    },\n    \"sparse\": null\n  },\n  \"sparseNumberMap\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0,\n    \"sparse\": null\n  },\n  \"sparseBooleanMap\": {\n    \"key1\": false,\n    \"key2\": false,\n    \"key3\": false,\n    \"sparse\": null\n  },\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  },\n  \"sparseSetMap\": {\n    \"key1\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key2\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key3\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n165, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 117, 99, 116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 161,\n98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 100, 107, 101, 121, 50, 161, 98, 104, 105, 102, 95, 95, 104, 105,\n95, 95, 100, 107, 101, 121, 51, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 102, 115, 112, 97, 114, 115,\n101, 246, 111, 115, 112, 97, 114, 115, 101, 78, 117, 109, 98, 101, 114, 77, 97, 112, 164, 100, 107, 101, 121, 49,\n0, 100, 107, 101, 121, 50, 0, 100, 107, 101, 121, 51, 0, 102, 115, 112, 97, 114, 115, 101, 246, 112, 115, 112,\n97, 114, 115, 101, 66, 111, 111, 108, 101, 97, 110, 77, 97, 112, 164, 100, 107, 101, 121, 49, 244, 100, 107, 101,\n121, 50, 244, 100, 107, 101, 121, 51, 244, 102, 115, 112, 97, 114, 115, 101, 246, 111, 115, 112, 97, 114, 115, 101,\n83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95,\n95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95,\n118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114, 115, 101, 246, 108, 115, 112, 97, 114, 115, 101, 83, 101,\n116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121,\n50, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121, 51, 131, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 102, 115, 112, 97, 114, 115, 101, 246\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/SimpleScalarProperties.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/SimpleScalarProperties\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 154\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"trueBooleanValue\": false,\n  \"falseBooleanValue\": false,\n  \"byteValue\": 0,\n  \"doubleValue\": 0,\n  \"floatValue\": 0,\n  \"integerValue\": 0,\n  \"longValue\": 0,\n  \"shortValue\": 0,\n  \"stringValue\": \"__stringValue__\",\n  \"blobValue\": {\n    \"type\": \"Buffer\",\n    \"data\": [\n      1,\n      0,\n      0,\n      1\n    ]\n  }\n}\n\n[actual bytes]\n170, 112, 116, 114, 117, 101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 113, 102, 97, 108, 115,\n101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 105, 98, 121, 116, 101, 86, 97, 108, 117, 101,\n0, 107, 100, 111, 117, 98, 108, 101, 86, 97, 108, 117, 101, 0, 106, 102, 108, 111, 97, 116, 86, 97, 108, 117,\n101, 0, 108, 105, 110, 116, 101, 103, 101, 114, 86, 97, 108, 117, 101, 0, 105, 108, 111, 110, 103, 86, 97, 108,\n117, 101, 0, 106, 115, 104, 111, 114, 116, 86, 97, 108, 117, 101, 0, 107, 115, 116, 114, 105, 110, 103, 86, 97,\n108, 117, 101, 111, 95, 95, 115, 116, 114, 105, 110, 103, 86, 97, 108, 117, 101, 95, 95, 105, 98, 108, 111, 98,\n86, 97, 108, 117, 101, 68, 1, 0, 0, 1\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/req/SparseNullsOperation.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/SparseNullsOperation\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 123\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStringList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\",\n    null\n  ],\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n162, 112, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 76, 105, 115, 116, 132, 106, 95, 95, 109, 101,\n109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 246, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107,\n101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108,\n117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114,\n115, 101, 246\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/EmptyInputOutput.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/Float16.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"value\": 0\n}\n\n[actual bytes]\n161, 101, 118, 97, 108, 117, 101, 0\n\n\n--- [output object] ---\n{\n  value: (number) 0,\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/FractionalSeconds.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"datetime\": {\n    \"tag\": 1,\n    \"value\": 946702799.999\n  }\n}\n\n[actual bytes]\n161, 104, 100, 97, 116, 101, 116, 105, 109, 101, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59\n\n\n--- [output object] ---\n{\n  datetime: (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time,\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/GreetingWithErrors.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"greeting\": \"__greeting__\"\n}\n\n[actual bytes]\n161, 104, 103, 114, 101, 101, 116, 105, 110, 103, 108, 95, 95, 103, 114, 101, 101, 116, 105, 110, 103, 95, 95\n\n\n--- [output object] ---\n{\n  greeting: \"__greeting__\",\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/NoInputOutput.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/RecursiveShapes.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"nested\": {\n    \"foo\": \"__foo__\",\n    \"nested\": {\n      \"bar\": \"__bar__\",\n      \"recursiveMember\": {\n        \"foo\": \"__foo__\",\n        \"nested\": {\n          \"bar\": \"__bar__\",\n          \"recursiveMember\": {}\n        }\n      }\n    }\n  }\n}\n\n[actual bytes]\n161, 102, 110, 101, 115, 116, 101, 100, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110, 101,\n115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114, 115,\n105, 118, 101, 77, 101, 109, 98, 101, 114, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110,\n101, 115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114,\n115, 105, 118, 101, 77, 101, 109, 98, 101, 114, 160\n\n\n--- [output object] ---\n{\n  nested: {\n    foo: \"__foo__\",\n    nested: {\n      bar: \"__bar__\",\n      recursiveMember: {\n        foo: \"__foo__\",\n        nested: {\n          bar: \"__bar__\",\n          recursiveMember: {}\n        }\n      }\n    }\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/RpcV2CborSparseMaps.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStructMap\": {\n    \"key1\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key2\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key3\": {\n      \"hi\": \"__hi__\"\n    },\n    \"sparse\": null\n  },\n  \"sparseNumberMap\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0,\n    \"sparse\": null\n  },\n  \"sparseBooleanMap\": {\n    \"key1\": false,\n    \"key2\": false,\n    \"key3\": false,\n    \"sparse\": null\n  },\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  },\n  \"sparseSetMap\": {\n    \"key1\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key2\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key3\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n165, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 117, 99, 116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 161,\n98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 100, 107, 101, 121, 50, 161, 98, 104, 105, 102, 95, 95, 104, 105,\n95, 95, 100, 107, 101, 121, 51, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 102, 115, 112, 97, 114, 115,\n101, 246, 111, 115, 112, 97, 114, 115, 101, 78, 117, 109, 98, 101, 114, 77, 97, 112, 164, 100, 107, 101, 121, 49,\n0, 100, 107, 101, 121, 50, 0, 100, 107, 101, 121, 51, 0, 102, 115, 112, 97, 114, 115, 101, 246, 112, 115, 112,\n97, 114, 115, 101, 66, 111, 111, 108, 101, 97, 110, 77, 97, 112, 164, 100, 107, 101, 121, 49, 244, 100, 107, 101,\n121, 50, 244, 100, 107, 101, 121, 51, 244, 102, 115, 112, 97, 114, 115, 101, 246, 111, 115, 112, 97, 114, 115, 101,\n83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95,\n95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95,\n118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114, 115, 101, 246, 108, 115, 112, 97, 114, 115, 101, 83, 101,\n116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121,\n50, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121, 51, 131, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 102, 115, 112, 97, 114, 115, 101, 246\n\n\n--- [output object] ---\n{\n  sparseStructMap: {\n    key1: {\n      hi: \"__hi__\"\n    },\n    key2: {\n      hi: \"__hi__\"\n    },\n    key3: {\n      hi: \"__hi__\"\n    },\n    sparse: (null)\n  },\n  sparseNumberMap: {\n    key1: (number) 0,\n    key2: (number) 0,\n    key3: (number) 0,\n    sparse: (null)\n  },\n  sparseBooleanMap: {\n    key1: (boolean) false,\n    key2: (boolean) false,\n    key3: (boolean) false,\n    sparse: (null)\n  },\n  sparseStringMap: {\n    key1: \"__value__\",\n    key2: \"__value__\",\n    key3: \"__value__\",\n    sparse: (null)\n  },\n  sparseSetMap: {\n    key1: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    key2: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    key3: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    sparse: (null)\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/SimpleScalarProperties.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"trueBooleanValue\": false,\n  \"falseBooleanValue\": false,\n  \"byteValue\": 0,\n  \"doubleValue\": 0,\n  \"floatValue\": 0,\n  \"integerValue\": 0,\n  \"longValue\": 0,\n  \"shortValue\": 0,\n  \"stringValue\": \"__stringValue__\",\n  \"blobValue\": {\n    \"type\": \"Buffer\",\n    \"data\": [\n      1,\n      0,\n      0,\n      1\n    ]\n  }\n}\n\n[actual bytes]\n170, 112, 116, 114, 117, 101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 113, 102, 97, 108, 115,\n101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 105, 98, 121, 116, 101, 86, 97, 108, 117, 101,\n0, 107, 100, 111, 117, 98, 108, 101, 86, 97, 108, 117, 101, 0, 106, 102, 108, 111, 97, 116, 86, 97, 108, 117,\n101, 0, 108, 105, 110, 116, 101, 103, 101, 114, 86, 97, 108, 117, 101, 0, 105, 108, 111, 110, 103, 86, 97, 108,\n117, 101, 0, 106, 115, 104, 111, 114, 116, 86, 97, 108, 117, 101, 0, 107, 115, 116, 114, 105, 110, 103, 86, 97,\n108, 117, 101, 111, 95, 95, 115, 116, 114, 105, 110, 103, 86, 97, 108, 117, 101, 95, 95, 105, 98, 108, 111, 98,\n86, 97, 108, 117, 101, 68, 1, 0, 0, 1\n\n\n--- [output object] ---\n{\n  trueBooleanValue: (boolean) false,\n  falseBooleanValue: (boolean) false,\n  byteValue: (number) 0,\n  doubleValue: (number) 0,\n  floatValue: (number) 0,\n  integerValue: (number) 0,\n  longValue: (number) 0,\n  shortValue: (number) 0,\n  stringValue: \"__stringValue__\",\n  blobValue: (Uint8Array) bytes[1, 0, 0, 1],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res/SparseNullsOperation.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStringList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\",\n    null\n  ],\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n162, 112, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 76, 105, 115, 116, 132, 106, 95, 95, 109, 101,\n109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 246, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107,\n101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108,\n117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114,\n115, 101, 246\n\n\n--- [output object] ---\n{\n  sparseStringList: [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\",\n    (null)\n  ],\n  sparseStringMap: {\n    key1: \"__value__\",\n    key2: \"__value__\",\n    key3: \"__value__\",\n    sparse: (null)\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res-err/ComplexError.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#ComplexError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 43, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 67, 111, 109, 112, 108, 101, 120,\n69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nComplexError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ComplexError\",\n  TopLevel: (undefined),\n  Nested: (undefined),\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"TopLevel\": \"__TopLevel__\",\n  \"Nested\": {\n    \"Foo\": \"__Foo__\"\n  },\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#ComplexError\"\n}\n\n[actual bytes]\n163, 104, 84, 111, 112, 76, 101, 118, 101, 108, 108, 95, 95, 84, 111, 112, 76, 101, 118, 101, 108, 95, 95, 102,\n78, 101, 115, 116, 101, 100, 161, 99, 70, 111, 111, 103, 95, 95, 70, 111, 111, 95, 95, 102, 95, 95, 116, 121,\n112, 101, 120, 43, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111, 108, 116, 101, 115, 116, 115,\n46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 67, 111, 109, 112, 108, 101, 120, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nComplexError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ComplexError\",\n  TopLevel: \"__TopLevel__\",\n  Nested: {\n    Foo: \"__Foo__\"\n  },\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res-err/InvalidGreeting.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#InvalidGreeting\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 46, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 73, 110, 118, 97, 108, 105, 100,\n71, 114, 101, 101, 116, 105, 110, 103\n\n\n--- [error name & message] ---\nInvalidGreeting: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"InvalidGreeting\",\n  Message: (undefined),\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"Message\": \"__Message__\",\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#InvalidGreeting\"\n}\n\n[actual bytes]\n162, 103, 77, 101, 115, 115, 97, 103, 101, 107, 95, 95, 77, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 120, 46, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111, 108, 116, 101, 115,\n116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 73, 110, 118, 97, 108, 105, 100, 71, 114, 101, 101,\n116, 105, 110, 103\n\n\n--- [error name & message] ---\nInvalidGreeting: __Message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"InvalidGreeting\",\n  Message: \"__Message__\",\n  message: \"__Message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res-err/RpcV2ProtocolServiceException.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.ts.sdk.synthetic.smithy.protocoltests.rpcv2Cbor#RpcV2ProtocolServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 84, 115, 109, 105, 116, 104, 121, 46, 116, 115, 46, 115, 100, 107, 46,\n115, 121, 110, 116, 104, 101, 116, 105, 99, 46, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 82, 112, 99, 86, 50, 80, 114,\n111, 116, 111, 99, 111, 108, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nundefined: Unknown\n\n--- [error object] ---\n{\n  $fault: (undefined),\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: (undefined),\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.ts.sdk.synthetic.smithy.protocoltests.rpcv2Cbor#RpcV2ProtocolServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 84, 115, 109, 105, 116, 104, 121, 46, 116, 115, 46, 115, 100, 107, 46,\n115, 121, 110, 116, 104, 101, 116, 105, 99, 46, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 82, 112, 99, 86, 50, 80, 114,\n111, 116, 111, 99, 111, 108, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nundefined: Unknown\n\n--- [error object] ---\n{\n  $fault: (undefined),\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: (undefined),\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res-err/UnmodeledServiceException.txt",
    "content": "======================== minimal response ========================\n[status] 500\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 56, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 85, 110, 109, 111, 100, 101, 108,\n101, 100, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nUnmodeledServiceException: \n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"UnmodeledServiceException\",\n  __type: \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\"\n}\n\n======================== w/ optional fields ========================\n[status] 500\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"Message\": \"__Message__\",\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\"\n}\n\n[actual bytes]\n162, 103, 77, 101, 115, 115, 97, 103, 101, 107, 95, 95, 77, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 120, 56, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111, 108, 116, 101, 115,\n116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 85, 110, 109, 111, 100, 101, 108, 101, 100, 83, 101,\n114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nUnmodeledServiceException: __Message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"UnmodeledServiceException\",\n  Message: \"__Message__\",\n  __type: \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\",\n  message: \"__Message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/integ-snapshots/res-err/ValidationException.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"message\": \"__message__\",\n  \"fieldList\": [\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    }\n  ],\n  \"__type\": \"smithy.framework#ValidationException\"\n}\n\n[actual bytes]\n163, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 105, 102, 105,\n101, 108, 100, 76, 105, 115, 116, 131, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103,\n109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116,\n104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115,\n115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101,\n115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95, 116, 121, 112, 101,\n120, 36, 115, 109, 105, 116, 104, 121, 46, 102, 114, 97, 109, 101, 119, 111, 114, 107, 35, 86, 97, 108, 105, 100,\n97, 116, 105, 111, 110, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nValidationException: __message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ValidationException\",\n  fieldList: [\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    }\n  ],\n  message: \"__message__\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"message\": \"__message__\",\n  \"fieldList\": [\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    }\n  ],\n  \"__type\": \"smithy.framework#ValidationException\"\n}\n\n[actual bytes]\n163, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 105, 102, 105,\n101, 108, 100, 76, 105, 115, 116, 131, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103,\n109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116,\n104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115,\n115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101,\n115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95, 116, 121, 112, 101,\n120, 36, 115, 109, 105, 116, 104, 121, 46, 102, 114, 97, 109, 101, 119, 111, 114, 107, 35, 86, 97, 108, 105, 100,\n97, 116, 105, 111, 110, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nValidationException: __message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ValidationException\",\n  fieldList: [\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    }\n  ],\n  message: \"__message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "packages/snapshot-testing/package.json",
    "content": "{\n  \"name\": \"@smithy/snapshot-testing\",\n  \"version\": \"2.1.3\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline snapshot-testing\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:integration\": \"yarn g:vitest run -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"yarn g:vitest watch -c vitest.config.integ.mts\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS Smithy Team\",\n    \"email\": \"\",\n    \"url\": \"https://smithy.io\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/node-http-handler\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<=4.0\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/snapshot-testing\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/snapshot-testing\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/SnapshotRequestHandler.ts",
    "content": "import type { HttpHandler } from \"@smithy/core/protocols\";\nimport { NormalizedSchema } from \"@smithy/core/schema\";\nimport type {\n  HttpHandlerOptions,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  Logger,\n  RequestHandlerOutput,\n} from \"@smithy/types\";\n\nimport { serializeHttpRequest } from \"./serializers/serializeHttpRequest\";\nimport { RequestSnapshotCompleted } from \"./snapshot-testing-types\";\n\n/**\n * @internal\n */\nexport interface SnapshotRequestHandlerOptions {\n  /**\n   * The serialized request will be pushed to the logger's trace method.\n   */\n  logger?: Logger;\n\n  /**\n   * Optional response to use.\n   */\n  response?: IHttpResponse;\n}\n\n/**\n * @internal\n */\ninterface ResolvedSnapshotRequestHandlerOptions extends SnapshotRequestHandlerOptions {}\n\n/**\n * @internal\n */\nexport class SnapshotRequestHandler implements HttpHandler<SnapshotRequestHandlerOptions> {\n  private readonly config: ResolvedSnapshotRequestHandlerOptions;\n\n  public constructor(options: SnapshotRequestHandlerOptions = {}) {\n    this.config = {\n      logger: console,\n      ...options,\n    };\n  }\n\n  public async handle(\n    request: IHttpRequest,\n    handlerOptions: (HttpHandlerOptions & any) | undefined = {}\n  ): Promise<RequestHandlerOutput<IHttpResponse>> {\n    const { logger, response } = this.config;\n\n    if (response) {\n      return { response };\n    }\n\n    const [client, [, namespace, name, traits, input, output], command] = [\n      handlerOptions[Symbol.for(\"$client\")],\n      handlerOptions[Symbol.for(\"$schema\")],\n      handlerOptions[Symbol.for(\"$command\")],\n    ];\n\n    const requestSerialization = await serializeHttpRequest(request);\n    logger?.trace?.(requestSerialization);\n\n    const $out = NormalizedSchema.of(output);\n\n    const eventStreamOutput = $out.getEventStreamMember();\n    const hasDataStreamResponsePayload = Object.values($out.getMemberSchemas()).some(\n      ($) => $.isStreaming() && $.isBlobSchema()\n    );\n    void [client, namespace, name, traits, input, command, eventStreamOutput, hasDataStreamResponsePayload];\n\n    throw new RequestSnapshotCompleted();\n  }\n\n  public updateHttpClientConfig<K extends keyof SnapshotRequestHandlerOptions>(\n    key: K,\n    value: SnapshotRequestHandlerOptions[K]\n  ): void {\n    this.config[key] = value;\n  }\n\n  public httpHandlerConfigs(): SnapshotRequestHandlerOptions {\n    return this.config;\n  }\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/SnapshotRunner.ts",
    "content": "import { accessSync, constants, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { NormalizedSchema } from \"@smithy/core/schema\";\nimport type {\n  Client,\n  Command,\n  HttpResponse as IHttpResponse,\n  Logger,\n  StaticErrorSchema,\n  StaticOperationSchema,\n} from \"@smithy/types\";\n\nimport { SnapshotRequestHandler } from \"./SnapshotRequestHandler\";\nimport { snapshotTestingProtocolResponseSerializers } from \"./protocols/index\";\nimport { serializeDocument } from \"./serializers/serializeDocument\";\nimport { serializeHttpResponse } from \"./serializers/serializeHttpResponse\";\nimport { RequestSnapshotCompleted } from \"./snapshot-testing-types\";\nimport { createFromSchema } from \"./structure/createFromSchema\";\n\n/**\n * @internal\n */\ntype $Client = Client<any, any, any>;\n/**\n * @internal\n */\ntype $Command = Command<any, any, any, any, any>;\n\n/**\n * @internal\n */\ntype $ClientCtor = { new (...args: any[]): $Client };\n/**\n * @internal\n */\ntype $CommandCtor = { new (...args: any[]): $Command };\n\n/**\n * @internal\n */\nexport interface SnapshotRunnerOptions {\n  /**\n   * Path to write snapshots. Should be a folder without other files.\n   */\n  snapshotDirPath: string;\n\n  /**\n   * Client constructor for the client that owns the commands in the schemas map.\n   */\n  Client: $ClientCtor;\n\n  /**\n   * Map of operation schema to command classes.\n   */\n  schemas: Map<StaticOperationSchema, $CommandCtor>;\n\n  /**\n   * Errors for which to generate response-error snapshots.\n   */\n  errors?: StaticErrorSchema[];\n\n  /**\n   * write - write the data without comparing.\n   * compare - throw if comparison to existing files in the same folder contain mismatches.\n   *\n   * @defaultValue \"write\"\n   */\n  mode?: \"write\" | \"compare\";\n\n  /**\n   * Provide this if running in a test framework.\n   */\n  testCase?(caseName: string, run: () => Promise<void>): void;\n\n  /**\n   * Provide this if running in a test framework.\n   */\n  assertions?(caseName: string, expected: string, actual: string): Promise<void>;\n}\n\n/**\n * Takes a client and map of commands to create a snapshot\n * of requests and responses associated with the client's operations.\n *\n * These snapshots can be visually inspected for e.g. regression diffs,\n * or exercised in snapshot tests.\n *\n * @internal\n */\nexport class SnapshotRunner {\n  public constructor(private options: SnapshotRunnerOptions) {\n    const dir = dirname(options.snapshotDirPath);\n    accessSync(dir, constants.W_OK);\n  }\n\n  public run(): Promise<void> {\n    const {\n      snapshotDirPath,\n      Client,\n      schemas,\n      mode = \"write\",\n      testCase = async (_, run) => {\n        await run();\n      },\n      assertions = (caseName, ex, act) => {\n        if (ex !== act) {\n          throw new Error(`Serialization for ${caseName} does not match snapshot on disk.`);\n        }\n      },\n      errors = [],\n    } = this.options;\n\n    if (mode === \"write\") {\n      rmSync(snapshotDirPath, { recursive: true, force: true });\n    }\n\n    const promises = [] as Promise<void>[];\n\n    // requests\n    for (const [schema, CommandCtor] of schemas) {\n      const operationName = CommandCtor.name.replace(/Command$/, \"\");\n\n      const testCaseExec = testCase(operationName + \" (request)\", async () => {\n        let buf = ``;\n        const logger = {\n          ...console,\n          trace(msg: string) {\n            buf += msg;\n          },\n        };\n\n        await this.executeCommand({\n          logger,\n          Client,\n          schema,\n          CommandCtor,\n        }).catch((e) => {\n          if (e instanceof RequestSnapshotCompleted) {\n            return;\n          }\n          logger.trace(\"\\n[CommandError]\\n\");\n          logger.trace(e.stack);\n          logger.error(`${e.name}: ${e.message}`);\n        });\n\n        const snapshotPath = join(snapshotDirPath, \"req\", operationName + \".txt\");\n        const containerFolder = dirname(snapshotPath);\n        if (!existsSync(containerFolder)) {\n          mkdirSync(containerFolder, { recursive: true });\n        }\n\n        if (mode === \"compare\") {\n          const canonical = readFileSync(snapshotPath, \"utf-8\");\n          if (assertions) {\n            assertions(operationName, canonical, buf);\n          } else {\n            if (canonical !== buf) {\n              throw new Error(`Serialization for ${CommandCtor.name} does not match snapshot on disk.`);\n            }\n          }\n        } else {\n          writeFileSync(snapshotPath, buf, \"utf-8\");\n        }\n      });\n\n      promises.push(Promise.resolve(testCaseExec));\n    }\n\n    // responses\n    for (const [schema, CommandCtor] of schemas) {\n      const [, namespace, name, traits, input, output] = schema;\n      const operationName = CommandCtor.name.replace(/Command$/, \"\");\n\n      const testCaseExec = testCase(operationName + \" (response)\", async () => {\n        let buf = ``;\n        const logger = {\n          ...console,\n          trace(msg: string) {\n            buf += msg;\n          },\n        };\n\n        const client = this.initClient(Client, { endpoint: \"https://localhost\", logger });\n        const protocolId = client.config.protocol.getShapeId();\n\n        for (const options of [{ mode: \"min\" }, { mode: \"max\" }] as const) {\n          if (options.mode === \"min\") {\n            logger.trace(\"=\".repeat(24) + ` minimal response ` + \"=\".repeat(24));\n          } else {\n            logger.trace(\"=\".repeat(24) + ` w/ optional fields ` + \"=\".repeat(24));\n          }\n          logger.trace(\"\\n\");\n\n          const snapshotProtocol = snapshotTestingProtocolResponseSerializers[protocolId];\n          if (!snapshotProtocol) {\n            throw new Error(`No response serializer found for protocol: ${protocolId}`);\n          }\n          snapshotProtocol.setSerdeContext(client.config);\n\n          // copies to allow two types of serializers to read the response stream.\n          const [r1, r2] = [\n            await snapshotProtocol.serializeResponse(schema, createFromSchema(output, undefined, options)),\n            await snapshotProtocol.serializeResponse(schema, createFromSchema(output, undefined, options)),\n          ];\n\n          const ns = NormalizedSchema.of(output);\n          const mayBufferResponseBody =\n            !ns.getEventStreamMember() &&\n            !Object.values(ns.getMemberSchemas()).some(($) => $.isBlobSchema() && $.isStreaming());\n\n          const serialization = await serializeHttpResponse(r1, mayBufferResponseBody);\n          logger.trace(serialization);\n\n          const command = new CommandCtor(createFromSchema(input));\n          client.config.requestHandler = new SnapshotRequestHandler({\n            response: r2,\n          });\n          try {\n            const output = await client.send(command);\n            const outputSerialization = await serializeDocument(output);\n\n            logger.trace(\"\\n\\n--- [output object] ---\\n\");\n            logger.trace(outputSerialization);\n          } catch (e) {\n            logger.trace(`\\n\\n[CommandError]\\n`);\n            logger.trace(e.stack);\n            logger.error(`${e.name}: ${e.message}`);\n          }\n          logger.trace(\"\\n\\n\");\n        }\n\n        const snapshotPath = join(snapshotDirPath, \"res\", operationName + \".txt\");\n        const containerFolder = dirname(snapshotPath);\n        if (!existsSync(containerFolder)) {\n          mkdirSync(containerFolder, { recursive: true });\n        }\n\n        if (mode === \"compare\") {\n          const canonical = readFileSync(snapshotPath, \"utf-8\");\n          if (assertions) {\n            assertions(operationName, canonical, buf);\n          } else {\n            if (canonical !== buf) {\n              throw new Error(`Deserialization for ${CommandCtor.name} does not match snapshot on disk.`);\n            }\n          }\n        } else {\n          writeFileSync(snapshotPath, buf, \"utf-8\");\n        }\n      });\n\n      promises.push(Promise.resolve(testCaseExec));\n    }\n\n    // errors\n    const [$operation, CommandCtor] = schemas[Symbol.iterator]().next().value!;\n    const [, ns] = $operation;\n\n    for (const $error of [\n      [-3, ns, \"UnmodeledServiceException\", { error: \"server\" }, [\"Message\"], [0]] satisfies StaticErrorSchema,\n      ...errors,\n    ]) {\n      const [, namespace, name, traits, memberNames, members, requiredMemberCount] = $error;\n      const $errorNormalized = NormalizedSchema.of($error);\n      const qualifiedName = $errorNormalized.getName(true);\n\n      const testCaseExec = testCase(qualifiedName + \" (error)\", async () => {\n        let buf = ``;\n        const logger = {\n          ...console,\n          trace(msg: string) {\n            buf += msg;\n          },\n        };\n\n        const client = this.initClient(Client, { endpoint: \"https://localhost\", logger, maxAttempts: 1 });\n        const protocolId = client.config.protocol.getShapeId();\n\n        for (const options of [{ mode: \"min\" }, { mode: \"max\" }, { mode: \"frontend\" }] as const) {\n          if (options.mode === \"frontend\") {\n            logger.trace(\"=\".repeat(24) + ` frontend error ` + \"=\".repeat(24));\n          } else if (options.mode === \"min\") {\n            logger.trace(\"=\".repeat(24) + ` minimal response ` + \"=\".repeat(24));\n          } else if (options.mode === \"max\") {\n            logger.trace(\"=\".repeat(24) + ` w/ optional fields ` + \"=\".repeat(24));\n          }\n          logger.trace(\"\\n\");\n\n          const snapshotProtocol = snapshotTestingProtocolResponseSerializers[protocolId];\n          if (!snapshotProtocol) {\n            throw new Error(`No response serializer found for protocol: ${protocolId}`);\n          }\n          snapshotProtocol.setSerdeContext(client.config);\n\n          // copies to allow two types of serializers to read the response stream.\n          const [r1, r2] =\n            options.mode === \"frontend\"\n              ? [\n                  await snapshotProtocol.serializeGenericFrontendErrorResponse(),\n                  await snapshotProtocol.serializeGenericFrontendErrorResponse(),\n                ]\n              : [\n                  await snapshotProtocol.serializeErrorResponse($error, createFromSchema($error, undefined, options)),\n                  await snapshotProtocol.serializeErrorResponse($error, createFromSchema($error, undefined, options)),\n                ];\n\n          const ns = NormalizedSchema.of($operation[5]);\n          const mayBufferResponseBody =\n            !ns.getEventStreamMember() &&\n            !Object.values(ns.getMemberSchemas()).some(($) => $.isBlobSchema() && $.isStreaming());\n\n          const serialization = await serializeHttpResponse(r1, mayBufferResponseBody);\n          logger.trace(serialization);\n\n          const command = new CommandCtor(createFromSchema($operation[4 /*input*/]));\n          client.config.requestHandler = new SnapshotRequestHandler({\n            response: r2,\n          });\n          try {\n            const output = await client.send(command).catch((e: any) => e);\n            const outputSerialization = await serializeDocument(output);\n\n            logger.trace(\"\\n\\n--- [error name & message] ---\\n\");\n            logger.trace(`${output.name}: ${output.message}`);\n            logger.trace(\"\\n\\n--- [error object] ---\\n\");\n            logger.trace(outputSerialization);\n          } catch (e) {\n            logger.trace(`\\n\\n[CommandError]\\n`);\n            logger.trace(e.stack);\n            logger.error(`${e.name}: ${e.message}`);\n          }\n          logger.trace(\"\\n\\n\");\n        }\n\n        const snapshotPath = join(snapshotDirPath, \"res-err\", name + \".txt\");\n        const containerFolder = dirname(snapshotPath);\n        if (!existsSync(containerFolder)) {\n          mkdirSync(containerFolder, { recursive: true });\n        }\n\n        if (mode === \"compare\") {\n          const canonical = readFileSync(snapshotPath, \"utf-8\");\n          if (assertions) {\n            assertions(name, canonical, buf);\n          } else {\n            if (canonical !== buf) {\n              throw new Error(`Error deserialization for ${name} does not match snapshot on disk.`);\n            }\n          }\n        } else {\n          writeFileSync(snapshotPath, buf, \"utf-8\");\n        }\n      });\n\n      promises.push(Promise.resolve(testCaseExec));\n    }\n\n    return Promise.all(promises).then(() => {});\n  }\n\n  private async executeCommand({\n    logger,\n    Client,\n    schema,\n    CommandCtor,\n    endpoint,\n  }: {\n    logger: Logger;\n    Client: $ClientCtor;\n    schema: StaticOperationSchema;\n    CommandCtor: $CommandCtor;\n    endpoint?: string;\n  }) {\n    const client = this.initClient(Client, { endpoint, logger });\n    const [, namespace, name, traits, input, output] = schema;\n    const command = new CommandCtor(createFromSchema(input));\n\n    const $ = NormalizedSchema.of(input);\n    if ($.getEventStreamMember()) {\n      client.middlewareStack.add(this.getEventStreamStaticSignatureMiddleware, {\n        tags: [\"EVENT_STREAM\", \"SIGNATURE\"],\n        name: \"eventStreamStaticSignatureMiddleware\",\n        step: \"build\" as const,\n        override: true,\n      });\n    }\n    const snapshotMetadata = {\n      [Symbol.for(\"$schema\")]: schema,\n      [Symbol.for(\"$client\")]: client,\n      [Symbol.for(\"$command\")]: command,\n    };\n    await client.send(command, snapshotMetadata).catch((e: any) => {\n      switch (e.name) {\n        case \"EndpointError\":\n          return this.executeCommand({\n            logger,\n            Client,\n            schema,\n            CommandCtor,\n            endpoint: \"https://localhost/mock-required-endpoint\",\n          });\n        default:\n          throw e;\n      }\n    });\n  }\n\n  private initClient(\n    Client: any,\n    {\n      endpoint,\n      logger,\n      response,\n      maxAttempts,\n    }: { endpoint?: string; logger?: Logger; response?: IHttpResponse; maxAttempts?: number }\n  ): any {\n    return new Client({\n      region: \"us-east-1\",\n      credentials: {\n        accessKeyId: \"MOCK_ak\",\n        secretAccessKey: \"MOCK_sak\",\n      },\n      apiKey: { apiKey: \"MOCK_api_key\" },\n      endpoint,\n      requestHandler: new SnapshotRequestHandler({\n        logger,\n        response,\n      }),\n      maxAttempts,\n    });\n  }\n\n  private getEventStreamStaticSignatureMiddleware = (next: any, context: any) => async (args: any) => {\n    context.__staticSignature = true;\n    return next(args);\n  };\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/index.ts",
    "content": "export { SnapshotRunner } from \"./SnapshotRunner\";\nexport { customFields } from \"./structure/createFromSchema\";\n\n/**\n * Extend this to create additional snapshot response serializers.\n *\n * @internal\n */\nexport { SnapshotProtocol } from \"./protocols/SnapshotProtocol\";\n\n/**\n * Add additional SnapshotProtocol to this object, key by protocol ShapeId.\n * @internal\n */\nexport { snapshotTestingProtocolResponseSerializers } from \"./protocols/index\";\n"
  },
  {
    "path": "packages/snapshot-testing/src/protocols/SmithyRpcV2CborSnapshotProtocol.ts",
    "content": "import { CborCodec } from \"@smithy/core/cbor\";\nimport { NormalizedSchema } from \"@smithy/core/schema\";\nimport type { HttpResponse, StaticErrorSchema, StaticOperationSchema } from \"@smithy/types\";\n\nimport type { SnapshotServerProtocol } from \"../snapshot-testing-types\";\nimport { SnapshotProtocol } from \"./SnapshotProtocol\";\n\n/**\n * @internal\n */\nexport class SmithyRpcV2CborSnapshotProtocol extends SnapshotProtocol implements SnapshotServerProtocol {\n  private codec = new CborCodec();\n  private serializer = this.codec.createSerializer();\n  private deserializer = this.codec.createDeserializer();\n\n  public getDefaultContentType(): string {\n    return \"application/cbor\";\n  }\n\n  public getShapeId(): string {\n    return \"smithy.protocols#rpcv2Cbor\";\n  }\n\n  public async serializeResponse(operationSchema: StaticOperationSchema, output: any): Promise<HttpResponse> {\n    const $output = NormalizedSchema.of(operationSchema[5]);\n    const eventStreamMember = $output.getEventStreamMember();\n\n    const response: HttpResponse = {\n      statusCode: 200,\n      headers: {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": this.getDefaultContentType(),\n      },\n    };\n\n    if (eventStreamMember) {\n      const eventStreamSerde = this.getEventStreamSerde(this.serializer, this.deserializer);\n\n      if (output[eventStreamMember]?.[Symbol.asyncIterator]) {\n        response.body = await eventStreamSerde.serializeEventStream({\n          eventStream: output[eventStreamMember],\n          requestSchema: $output,\n        });\n      } else {\n        response.body = {\n          async *[Symbol.asyncIterator]() {},\n        };\n      }\n    } else {\n      const { serializer } = this;\n      serializer.write($output, output);\n      // refrain from wrapping in Readable so the snapshot can use object view on the bytes.\n      response.body = serializer.flush();\n    }\n\n    return response;\n  }\n\n  public async serializeErrorResponse<Output extends object>(\n    errorSchema: StaticErrorSchema,\n    output: Output\n  ): Promise<HttpResponse> {\n    const $error = NormalizedSchema.of(errorSchema);\n    const clientFault = $error.getMergedTraits().error !== \"server\";\n    const httpError = $error.getMergedTraits().httpError;\n    const status = Number(typeof httpError === \"number\" ? httpError : clientFault ? 400 : 500);\n\n    const response: HttpResponse = {\n      statusCode: status,\n      headers: {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": this.getDefaultContentType(),\n      },\n    };\n\n    const { serializer } = this;\n\n    Object.assign(output, {\n      __type: $error.getName(true),\n    });\n    serializer.write($error, output);\n    response.body = serializer.flush();\n\n    return response;\n  }\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/protocols/SnapshotProtocol.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { EventStreamSerde } from \"@smithy/core/event-streams\";\nimport { HttpResponse, SerdeContext } from \"@smithy/core/protocols\";\nimport type {\n  $ShapeDeserializer,\n  $ShapeSerializer,\n  EventStreamMarshaller,\n  EventStreamSerdeContext,\n  HttpResponse as IHttpResponse,\n  StaticErrorSchema,\n  StaticOperationSchema,\n} from \"@smithy/types\";\n\nimport type { SnapshotServerProtocol } from \"../snapshot-testing-types\";\n\n/**\n * @internal\n */\nexport abstract class SnapshotProtocol extends SerdeContext implements SnapshotServerProtocol {\n  public abstract getShapeId(): string;\n\n  public abstract getDefaultContentType(): string;\n\n  public abstract serializeResponse<Output extends object>(\n    operationSchema: StaticOperationSchema,\n    output: Output\n  ): Promise<IHttpResponse>;\n\n  public abstract serializeErrorResponse<Output extends object>(\n    errorSchema: StaticErrorSchema,\n    output: Output\n  ): Promise<IHttpResponse>;\n\n  public async serializeGenericFrontendErrorResponse(): Promise<IHttpResponse> {\n    return new HttpResponse({\n      headers: {\n        \"content-type\": \"text/html\",\n      },\n      statusCode: 500,\n      body: Readable.from(\"An unmodeled error occurred in a front end layer.\"),\n    });\n  }\n\n  protected getEventStreamSerde(\n    serializer: $ShapeSerializer<string> | $ShapeSerializer,\n    deserializer: $ShapeDeserializer<string> | $ShapeDeserializer\n  ) {\n    return new EventStreamSerde({\n      marshaller: this.getEventStreamMarshaller(),\n      serializer,\n      deserializer,\n      defaultContentType: this.getDefaultContentType(),\n    });\n  }\n\n  protected getEventStreamMarshaller(): EventStreamMarshaller {\n    const context = this.serdeContext as unknown as EventStreamSerdeContext;\n    if (!context.eventStreamMarshaller) {\n      throw new Error(\"@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.\");\n    }\n    return context.eventStreamMarshaller;\n  }\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/protocols/index.ts",
    "content": "import { SmithyRpcV2CborSnapshotProtocol } from \"./SmithyRpcV2CborSnapshotProtocol\";\nimport type { SnapshotProtocol } from \"./SnapshotProtocol\";\n\nconst smithyRpcV2CborSnapshotProtocol = new SmithyRpcV2CborSnapshotProtocol();\n\n/**\n * @internal\n */\nexport const snapshotTestingProtocolResponseSerializers = {\n  [smithyRpcV2CborSnapshotProtocol.getShapeId()]: smithyRpcV2CborSnapshotProtocol,\n} as Record<string, SnapshotProtocol>;\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/ContentTypeDetection.ts",
    "content": "import { cbor } from \"@smithy/core/cbor\";\nimport { fromUtf8, toBase64, toUtf8 } from \"@smithy/core/serde\";\nimport type { HeaderBag } from \"@smithy/types\";\n\nimport { serializeBytes } from \"./serializeBytes\";\n\n/**\n * @internal\n */\nexport class ContentTypeDetection {\n  protected r!: {\n    headers: HeaderBag;\n  };\n\n  public isXml(): boolean {\n    return this.getContentType() === \"application/xml\";\n  }\n\n  public isQuery(): boolean {\n    return this.getContentType() === \"application/x-www-form-urlencoded\";\n  }\n\n  public isJson(): boolean {\n    return this.getContentType() === \"application/json\" || this.getContentType().startsWith(\"application/x-amz-json-\");\n  }\n\n  public isCbor(): boolean {\n    return this.r?.headers?.[\"smithy-protocol\"] === \"rpc-v2-cbor\" || this.getContentType() === \"application/cbor\";\n  }\n\n  public getContentType(): string {\n    return this.r?.headers?.[\"content-type\"] ?? \"\";\n  }\n\n  public formatStringBody(s: string): [string, string] {\n    try {\n      if (this.isJson()) {\n        try {\n          return [\"json\", JSON.stringify(JSON.parse(s), null, 2)];\n        } catch (e) {}\n        return [\"json\", s];\n      } else if (this.isXml()) {\n        return [\"xml\", simpleFormatXml(s)];\n      } else if (this.isQuery()) {\n        return [\"query\", formatQuery(s)];\n      }\n    } catch (e) {}\n    if (s.length === 0) {\n      return [\"empty\", s];\n    }\n    if (isAscii(s)) {\n      return [\"text\", s];\n    }\n    try {\n      return [\"unrecognized format as base64\", toBase64(fromUtf8(s))];\n    } catch (e) {}\n    return [\"??\", s];\n  }\n\n  public formatBody(bytes: Uint8Array): [string, string] {\n    if (this.isCbor()) {\n      try {\n        cbor.deserialize(bytes);\n        return [\"cbor object view\", serializeBytes(bytes)];\n      } catch (e) {}\n    }\n    return this.formatStringBody(toUtf8(bytes));\n  }\n}\n\n/**\n * Inserts line breaks and indentation for XML.\n */\nfunction simpleFormatXml(xml: string): string {\n  const indent = 4;\n  let b = \"\";\n  let indentation = 0;\n  for (let i = 0; i < xml.length; ++i) {\n    const c = xml[i];\n\n    if (c === \"<\") {\n      if (xml[i + 1] === \"/\") {\n        b += \"\\n\" + \" \".repeat(indentation - indent) + c;\n        indentation -= indent * 2;\n      } else {\n        b += c;\n      }\n    } else if (c === \">\") {\n      if (xml[i - 1] === \"/\" || xml[i - 1] === \"?\") {\n        b += c + \"\\n\";\n      } else {\n        indentation += indent;\n        b += c + \"\\n\" + \" \".repeat(indentation);\n      }\n    } else {\n      b += c;\n    }\n  }\n  return b\n    .split(\"\\n\")\n    .filter((s) => !!s.trim())\n    .join(\"\\n\");\n}\n\n/**\n * Inserts line breaks for Query format.\n */\nfunction formatQuery(q: string): string {\n  return q.replace(/(&)/g, \"&\\n\");\n}\n\nfunction isAscii(str: string) {\n  return /^[\\x00-\\x7F]*$/.test(str);\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/SnapshotEventStreamSerializer.ts",
    "content": "import { toHex, toUtf8 } from \"@smithy/core/serde\";\nimport type { Message } from \"@smithy/types\";\n\nimport { ContentTypeDetection } from \"./ContentTypeDetection\";\nimport { serializeDate } from \"./serializeDate\";\n\n/**\n * @internal\n */\nexport class SnapshotEventStreamSerializer extends ContentTypeDetection {\n  private headers: Message[\"headers\"] = {};\n\n  private totalLength = \"\";\n  private headerLength = \"\";\n  private preludeCrc = \"\";\n  private payloadAnnotation = \"\";\n  private payloadSnapshot = \"\";\n  private messageCrc = \"\";\n\n  private inner?: SnapshotEventStreamSerializer;\n\n  public constructor(private message: Uint8Array) {\n    super();\n  }\n\n  public decode() {\n    const message = this.message;\n    const dv = new DataView(message.buffer, message.byteOffset, message.byteLength);\n\n    const [totalByteLength, headersByteLength, preludeCrc] = [dv.getUint32(0), dv.getUint32(4), dv.getUint32(8)];\n    this.totalLength = String(totalByteLength);\n    this.headerLength = String(headersByteLength);\n    this.preludeCrc = String(preludeCrc);\n\n    const [headers, payload, messageCrc] = [\n      message.subarray(12, 12 + headersByteLength),\n      message.subarray(12 + headersByteLength, totalByteLength - 4),\n      dv.getUint32(totalByteLength - 4),\n    ];\n\n    this.messageCrc = String(messageCrc);\n\n    let i = 12;\n    while (i < 12 + headersByteLength) {\n      const headerNameByteLength = dv.getUint8(i);\n      i += 1;\n      const headerName = toUtf8(message.subarray(i, i + headerNameByteLength));\n      i += headerNameByteLength;\n      const headerValueType = dv.getUint8(i);\n      i += 1;\n      switch (headerValueType) {\n        case 0:\n        case 1:\n          this.headers[headerName] = {\n            type: \"boolean\",\n            value: headerValueType === 0,\n          };\n          break;\n        case 2:\n          this.headers[headerName] = {\n            type: \"byte\",\n            value: dv.getInt8(i),\n          };\n          i += 1;\n          break;\n        case 3:\n          this.headers[headerName] = {\n            type: \"short\",\n            value: dv.getInt16(i),\n          };\n          i += 2;\n          break;\n        case 4:\n          this.headers[headerName] = {\n            type: \"integer\",\n            value: dv.getInt32(i),\n          };\n          i += 4;\n          break;\n        case 5:\n          this.headers[headerName] = {\n            type: \"long\",\n            value: String(dv.getBigInt64(i)) as any,\n          };\n          i += 8;\n          break;\n        case 6:\n          const blobLength = dv.getUint16(i);\n          i += 2;\n          this.headers[headerName] = {\n            type: \"binary\",\n            value: message.subarray(i, i + blobLength),\n          };\n          i += blobLength;\n          break;\n        case 7:\n          const stringByteLength = dv.getUint16(i);\n          i += 2;\n          const value = toUtf8(message.subarray(i, i + stringByteLength));\n          this.headers[headerName] = {\n            type: \"string\",\n            value,\n          };\n          i += stringByteLength;\n          if (headerName === \":content-type\") {\n            this.r = {\n              headers: {\n                \"content-type\": value,\n              },\n            };\n          }\n          break;\n        case 8:\n          this.headers[headerName] = {\n            type: \"timestamp\",\n            value: new Date(Number(dv.getBigUint64(i))),\n          };\n          i += 8;\n          break;\n        case 9:\n          const uuidBytes = message.subarray(i, i + 16);\n          i += 16;\n          this.headers[headerName] = {\n            type: \"uuid\",\n            value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(\n              uuidBytes.subarray(6, 8)\n            )}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,\n          };\n          break;\n        default:\n          throw new Error(`Unrecognized header type tag=${headerValueType}`);\n      }\n    }\n\n    [this.payloadAnnotation, this.payloadSnapshot] = this.formatBody(payload);\n    if (this.headers[\":chunk-signature\"] && payload.byteLength > 0) {\n      // is signing transform stream chunk, need to decode another level.\n      const inner = new SnapshotEventStreamSerializer(payload);\n      inner.decode();\n      this.inner = inner;\n    }\n  }\n\n  public toString() {\n    this.decode();\n    if (this.inner) {\n      const { inner } = this;\n      return `[chunk (event-stream object view)]\n  [total-size] ${this.totalLength} [header-size] ${this.headerLength} [prelude-crc] ${this.preludeCrc}\n    [total-size] ${inner.totalLength} [header-size] ${inner.headerLength} [prelude-crc] ${inner.preludeCrc}\n${serializeEventHeaders(this.headers)}\n${serializeEventHeaders(inner.headers)}\n[${inner.payloadAnnotation}]\n${inner.payloadSnapshot}\n\n  [message-crc] ${inner.messageCrc}\n[message-crc] ${this.messageCrc}\n${\"===\".repeat(20)}\n\n`;\n    }\n    return `[chunk (event-stream object view)]\n  [total-size] ${this.totalLength} [header-size] ${this.headerLength} [prelude-crc] ${this.preludeCrc}\n${serializeEventHeaders(this.headers)}\n[${this.payloadAnnotation}]\n${this.payloadSnapshot}\n\n[message-crc] ${this.messageCrc}\n${\"===\".repeat(20)}\n\n`;\n  }\n}\n\nfunction serializeEventHeaders(headers: Message[\"headers\"]): string {\n  let b = \"\";\n  for (const [k, { type, value }] of Object.entries(headers ?? {})) {\n    if (type === \"string\") {\n      b += `${k}: ${value}\\n`;\n    } else if (value instanceof Date) {\n      b += `${k}: ${serializeDate(value)} (${type})\\n`;\n    } else {\n      b += `${k}: ${value} (${type})\\n`;\n    }\n  }\n  return b;\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/SnapshotPayloadSerializer.ts",
    "content": "import { fromUtf8, toBase64, toUtf8 } from \"@smithy/core/serde\";\n\nimport type { PayloadWithHeaders } from \"../snapshot-testing-types\";\nimport { ContentTypeDetection } from \"./ContentTypeDetection\";\nimport { SnapshotEventStreamSerializer } from \"./SnapshotEventStreamSerializer\";\n\n/**\n * @internal\n */\nexport class SnapshotPayloadSerializer extends ContentTypeDetection {\n  public constructor(protected r: PayloadWithHeaders) {\n    super();\n  }\n\n  /**\n   * @returns [body type hint, body snapshot serialization]\n   */\n  public async toStringAsync(): Promise<[string, string]> {\n    const { body } = this.r;\n    if (typeof body === \"undefined\") {\n      return [`[no body]`, \"\"];\n    }\n    if (typeof body === \"string\") {\n      const [annotation, payloadSnapshot] = this.formatStringBody(body);\n      return [`[string (${annotation})]`, payloadSnapshot];\n    }\n    let b = ``;\n    let header = ``;\n\n    if (body instanceof Uint8Array) {\n      const [annotation, payloadSnapshot] = this.formatBody(body);\n      return [`[Uint8Array (${annotation})]`, payloadSnapshot];\n    } else if (typeof body[Symbol.iterator] === \"function\") {\n      const iterable = body as {\n        [Symbol.iterator](): IterableIterator<unknown>;\n      };\n      const ctor = body.constructor.name;\n      header = `[iterable (${ctor})]\\n`;\n      for (const chunk of iterable) {\n        b += await serializeChunk(chunk);\n      }\n    } else if (typeof body[Symbol.asyncIterator] === \"function\") {\n      const asyncIterable = body as {\n        [Symbol.asyncIterator](): AsyncIterableIterator<unknown>;\n      };\n      const ctor = body.constructor.name;\n      header = `[async_iterable (${ctor})]\\n`;\n      for await (const chunk of asyncIterable) {\n        b += await serializeChunk(chunk);\n      }\n    } else {\n      throw new Error(`cannot serialize [body=${body}] without iterator.`);\n    }\n    return [header, b];\n  }\n}\n\n/**\n * Serialize a single chunk of a stream (HTTP payload).\n */\nasync function serializeChunk(chunk: unknown): Promise<string> {\n  if (!(chunk instanceof Uint8Array) && typeof chunk !== \"string\") {\n    chunk = String(chunk);\n  }\n  const utf8 = toUtf8(chunk as any) + \"\\n\";\n  if (isEvent(utf8)) {\n    const messageSerializer = new SnapshotEventStreamSerializer(chunk as Uint8Array);\n    return messageSerializer.toString();\n  }\n  return `[chunk (b64)]\n${toBase64(fromUtf8(utf8))}\n`;\n}\n\nfunction isEvent(str: string): boolean {\n  return (\n    (str.includes(\":message-type\") && str.includes(\":event-type\")) ||\n    str.includes(\":date\") ||\n    str.includes(\":chunk-signature\")\n  );\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/serializeBytes.ts",
    "content": "import { cbor } from \"@smithy/core/cbor\";\n\n/**\n * CBOR bytes with inline explanations.\n * @param bytes - to serialize.\n */\nexport function serializeBytes(bytes: Uint8Array): string {\n  const objectString = debugBytes(bytes);\n  const byteList = bytesToString(bytes);\n\n  return `${objectString}\\n\\n[actual bytes]\\n${byteList}`;\n}\n\n/**\n * @internal\n */\nexport function bytesToString(bytes: Uint8Array) {\n  const items = Array.from(bytes).map((b) => String(b));\n  const lines = [];\n  for (let i = 0; i < items.length; i += 24) {\n    lines.push(items.slice(i, i + 24).join(\", \"));\n  }\n  return lines.join(\",\\n\");\n}\n\n/**\n * @internal\n */\nexport function debugBytes(bytes: Uint8Array): string {\n  const object = cbor.deserialize(bytes);\n\n  return JSON.stringify(object, null, 2);\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/serializeDate.ts",
    "content": "export const serializeDate = (d: Date) =>\n  d.toLocaleString(\"en-US\", {\n    timeZone: \"America/Los_Angeles\",\n    weekday: \"short\",\n    year: \"numeric\",\n    month: \"short\",\n    day: \"numeric\",\n    hour: \"numeric\",\n    minute: \"2-digit\",\n    second: \"2-digit\",\n    timeZoneName: \"long\",\n    hour12: false,\n  });\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/serializeDocument.ts",
    "content": "import { serializeDate } from \"./serializeDate\";\n\n/**\n * @internal\n */\nexport async function serializeDocument(doc: any, indent = 0): Promise<string> {\n  const spaces = \" \".repeat(indent);\n  const type = doc instanceof Date ? \"Date\" : doc instanceof Uint8Array ? \"Uint8Array\" : typeof doc;\n\n  if (doc === null) {\n    return `${spaces}(null)`;\n  }\n  if (doc === undefined) {\n    return `${spaces}(undefined)`;\n  }\n  if (doc instanceof Date) {\n    return `${spaces}(Date) ${serializeDate(doc)}`;\n  }\n  if (doc instanceof Uint8Array) {\n    return `${spaces}(Uint8Array) bytes[${Array.from(doc).join(\", \")}]`;\n  }\n  if (typeof doc !== \"object\") {\n    if (type === \"string\") {\n      return `${spaces}\"${doc}\"`;\n    }\n    return `${spaces}(${type}) ${doc}`;\n  }\n\n  if (doc[Symbol.asyncIterator]) {\n    const values = [];\n    for await (const value of doc) {\n      values.push(await serializeDocument(value, indent + 2));\n    }\n    if (values.length === 0) {\n      return `${spaces}async_it[<empty>]`;\n    }\n    return `${spaces}async_it[\\n${values.join(\",\\n\")}\\n${spaces}]`;\n  }\n\n  if (Array.isArray(doc)) {\n    if (doc.length === 0) {\n      return `${spaces}[]`;\n    }\n    const serialized = await Promise.all(doc.map((v) => serializeDocument(v, indent + 2)));\n    return `${spaces}[\\n${serialized.join(\",\\n\")}\\n${spaces}]`;\n  }\n\n  const keys = Object.keys(doc);\n  if (keys.length === 0) {\n    return `${spaces}{}`;\n  }\n  const serialized = await Promise.all(\n    keys.map(async (k) => `${\" \".repeat(indent + 2)}${k}: ${(await serializeDocument(doc[k], indent + 2)).trim()}`)\n  );\n  return `${spaces}{\\n${serialized.join(\",\\n\")}\\n${spaces}}`;\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/serializeHttpRequest.spec.ts",
    "content": "import type { HttpRequest } from \"@smithy/types\";\nimport { describe, expect, it as test } from \"vitest\";\n\nimport { serializeHttpRequest } from \"./serializeHttpRequest\";\n\ndescribe(\"serializeHttpRequest user-agent replacement\", () => {\n  test(\"should replace aws-sdk-js version\", async () => {\n    const request: HttpRequest = {\n      method: \"GET\",\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/\",\n      headers: {\n        \"user-agent\": \"aws-sdk-js/3.123.456 os/linux lang/js\",\n      },\n    };\n\n    const result = await serializeHttpRequest(request);\n    expect(result).toEqual(`GET https://example.com \n/\n\nuser-agent: aws-sdk-js/3.___._ lang/js\n\n[no body]\n\n`);\n  });\n\n  test(\"should remove os metadata\", async () => {\n    const request: HttpRequest = {\n      method: \"GET\",\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/\",\n      headers: {\n        \"user-agent\": \"aws-sdk-js/3.0.0 os/darwin lang/js\",\n      },\n    };\n\n    const result = await serializeHttpRequest(request);\n    expect(result).toEqual(`GET https://example.com \n/\n\nuser-agent: aws-sdk-js/3.___._ lang/js\n\n[no body]\n\n`);\n  });\n\n  test(\"should remove exec-env with various formats\", async () => {\n    const request: HttpRequest = {\n      method: \"GET\",\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/\",\n      headers: {\n        \"user-agent\": \"aws-sdk-js/3.0.0 exec-env/AWS_Lambda_nodejs20.x lang/js\",\n      },\n    };\n\n    const result = await serializeHttpRequest(request);\n    expect(result).toEqual(`GET https://example.com \n/\n\nuser-agent: aws-sdk-js/3.___._ lang/js\n\n[no body]\n\n`);\n  });\n\n  test(\"should remove exec-env with periods, underscores, and dashes\", async () => {\n    const request: HttpRequest = {\n      method: \"GET\",\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/\",\n      headers: {\n        \"x-amz-user-agent\": \"aws-sdk-js/3.0.0 exec-env/test_env.name-123 lang/js\",\n      },\n    };\n\n    const result = await serializeHttpRequest(request);\n    expect(result).toEqual(`GET https://example.com \n/\n\nx-amz-user-agent: aws-sdk-js/3.___._ lang/js\n\n[no body]\n\n`);\n  });\n\n  test(\"should replace hash version\", async () => {\n    const request: HttpRequest = {\n      method: \"GET\",\n      protocol: \"https:\",\n      hostname: \"example.com\",\n      path: \"/\",\n      headers: {\n        \"user-agent\": \"aws-sdk-js/3.0.0 #1.2.3 lang/js\",\n      },\n    };\n\n    const result = await serializeHttpRequest(request);\n    expect(result).toEqual(`GET https://example.com \n/\n\nuser-agent: aws-sdk-js/3.___._ #_.__ lang/js\n\n[no body]\n\n`);\n  });\n});\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/serializeHttpRequest.ts",
    "content": "import type { HttpRequest as IHttpRequest } from \"@smithy/types\";\n\nimport { SnapshotPayloadSerializer } from \"./SnapshotPayloadSerializer\";\n\n/**\n * Serialize an http request to string for snapshotting.\n * @param request\n *\n * @internal\n */\nexport async function serializeHttpRequest(request: IHttpRequest): Promise<string> {\n  const { method, protocol, hostname, port, path, query, headers, username, password, fragment, body } = request;\n  const defaultPort = protocol === \"https:\" || protocol === \"wss:\" ? 443 : 80;\n\n  let slug = `${path}`;\n  let append = \"?\";\n  for (const [k, v] of Object.entries(query ?? {})) {\n    if (Array.isArray(v)) {\n      for (const v2 of v) {\n        slug += `${append}${k}=${v2}`;\n        append = \"&\";\n      }\n    } else {\n      slug += `${append}${k}=${v}`;\n      append = \"&\";\n    }\n  }\n  if (fragment) {\n    slug += `#${fragment}`;\n  }\n\n  if (username || password) {\n    slug = `<username>:***@${slug}`;\n  }\n\n  let headerLines = ``;\n  for (const [k, v] of Object.entries(headers ?? {})) {\n    if (k.toLowerCase().match(/security|-token/)) {\n      headerLines += `${k}: ***\\n`;\n    } else if (k.toLowerCase() === \"authorization\") {\n      let value = \"***\";\n      if (headers[k].match(/Credential=\\w+\\//)) {\n        value = headers[k]\n          .replace(/Credential=\\w+\\//g, \"Credential=***/\")\n          .replace(/Credential=\\*\\*\\*\\/\\d{8}\\//g, \"Credential=***/19991231/\")\n          .replace(/Signature=\\w+/g, \"Signature=***\");\n      }\n      headerLines += `${k}: ${value}\\n`;\n    } else if (k.toLowerCase() === \"x-amz-date\") {\n      headerLines += `${k}: ${v.replace(/^(\\d{8})T(\\d{6}Z)$/, \"19991231T235959Z\")}\\n`;\n    } else if (k.toLowerCase() === \"user-agent\" || k.toLowerCase() === \"x-amz-user-agent\") {\n      headerLines += `${k}: ${v\n        .replace(/aws-sdk-js\\/\\d\\.\\d+\\.\\d+/, \"aws-sdk-js/3.___._\")\n        .replace(/os\\/(.*?)\\s/g, \"\")\n        .replace(/exec-env\\/([\\w._-]+)\\s?/g, \"\")\n        .replace(/#(.*?)\\s/g, \"#_.__ \")}\\n`;\n    } else {\n      headerLines += `${k}: ${v}\\n`;\n    }\n  }\n\n  const [bodyAnnotation, bodySnapshot] = await new SnapshotPayloadSerializer(request).toStringAsync();\n\n  return derandomize(`${method} ${protocol}//${hostname}${port && port !== defaultPort ? `:${port}` : \"\"} \n${slug}\n\n${headerLines}\n${bodyAnnotation}\n${bodySnapshot}\n`);\n}\n\nfunction derandomize(str: string): string {\n  return str.replace(\n    /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,\n    \"1111abcd-uuid-uuid-uuid-000000001111\"\n  );\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/serializers/serializeHttpResponse.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { streamCollector } from \"@smithy/node-http-handler\";\nimport type { HttpResponse } from \"@smithy/types\";\n\nimport { SnapshotPayloadSerializer } from \"./SnapshotPayloadSerializer\";\n\n/**\n * @internal\n */\nexport async function serializeHttpResponse(r: HttpResponse, mayBufferResponseBody?: boolean): Promise<string> {\n  const { statusCode, headers } = r;\n\n  let headerLines = ``;\n  for (const [k, v] of Object.entries(headers ?? {})) {\n    headerLines += `${k}: ${v}\\n`;\n  }\n\n  if (mayBufferResponseBody && r.body instanceof Readable) {\n    r.body = await streamCollector(r.body);\n  }\n\n  const [bodyAnnotation, bodySnapshot] = await new SnapshotPayloadSerializer(r).toStringAsync();\n\n  return `[status] ${statusCode}\n  \n${headerLines}\n${bodyAnnotation}\n${bodySnapshot}\n`;\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/snapshot-testing-types.ts",
    "content": "import type {\n  HttpResponse,\n  HttpRequest as IHttpRequest,\n  HttpResponse as IHttpResponse,\n  StaticOperationSchema,\n} from \"@smithy/types\";\n\n/**\n * @internal\n */\nexport type PayloadWithHeaders = Pick<IHttpRequest, \"body\" | \"headers\"> | Pick<IHttpResponse, \"body\" | \"headers\">;\n\n/**\n * @internal\n */\nexport class RequestSnapshotCompleted extends Error {\n  public snapshotComplete = true;\n}\n\n/**\n * Server protocol for snapshot testing.\n *\n * @internal\n */\nexport interface SnapshotServerProtocol {\n  getShapeId(): string;\n\n  serializeResponse<Output extends object>(\n    operationSchema: StaticOperationSchema,\n    output: Output\n  ): Promise<HttpResponse>;\n}\n"
  },
  {
    "path": "packages/snapshot-testing/src/snapshot-testing.integ.spec.ts",
    "content": "import * as path from \"node:path\";\nimport {\n  ComplexError$,\n  EmptyInputOutput$,\n  EmptyInputOutputCommand,\n  Float16$,\n  Float16Command,\n  FractionalSeconds$,\n  FractionalSecondsCommand,\n  GreetingWithErrors$,\n  GreetingWithErrorsCommand,\n  InvalidGreeting$,\n  NoInputOutput$,\n  NoInputOutputCommand,\n  RecursiveShapes$,\n  RecursiveShapesCommand,\n  RpcV2CborSparseMaps$,\n  RpcV2CborSparseMapsCommand,\n  RpcV2Protocol,\n  RpcV2ProtocolServiceException$,\n  SimpleScalarProperties$,\n  SimpleScalarPropertiesCommand,\n  SparseNullsOperation$,\n  SparseNullsOperationCommand,\n  ValidationException$,\n} from \"@smithy/smithy-rpcv2-cbor-schema\";\nimport type { Command, StaticOperationSchema } from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { SnapshotRunner } from \"./SnapshotRunner\";\n\ntype $Command = Command<any, any, any, any, any>;\n\ndescribe(\"snapshot testing\", () => {\n  const runner = new SnapshotRunner({\n    snapshotDirPath: path.join(__dirname, \"..\", \"integ-snapshots\"),\n    Client: RpcV2Protocol,\n    schemas: new Map<StaticOperationSchema, { new (...args: any[]): $Command }>([\n      [EmptyInputOutput$, EmptyInputOutputCommand],\n      [Float16$, Float16Command],\n      [FractionalSeconds$, FractionalSecondsCommand],\n      [GreetingWithErrors$, GreetingWithErrorsCommand],\n      [NoInputOutput$, NoInputOutputCommand],\n      [RecursiveShapes$, RecursiveShapesCommand],\n      [RpcV2CborSparseMaps$, RpcV2CborSparseMapsCommand],\n      [SparseNullsOperation$, SparseNullsOperationCommand],\n      [SimpleScalarProperties$, SimpleScalarPropertiesCommand],\n    ]),\n    errors: [RpcV2ProtocolServiceException$, ValidationException$, ComplexError$, InvalidGreeting$],\n    mode: \"write\",\n    testCase(caseName: string, run: () => Promise<void>) {\n      it(caseName, run);\n    },\n    assertions(caseName: string, expected: string, actual: string): Promise<void> {\n      expect(actual).toEqual(expected);\n      return Promise.resolve();\n    },\n  });\n\n  runner.run();\n});\n"
  },
  {
    "path": "packages/snapshot-testing/src/structure/createFromSchema.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { NormalizedSchema } from \"@smithy/core/schema\";\nimport { NumericValue } from \"@smithy/core/serde\";\nimport type { $SchemaRef, StaticStructureSchema } from \"@smithy/types\";\n\n/**\n * Creates a static value for a given schema.\n *\n * @internal\n *\n * @param schema - for which to generate an object.\n * @param path - to cut off recursive schema at a certain depth.\n * @param options\n * @param options.mode - 'min' or 'max' for generating optional members.\n */\nexport function createFromSchema(schema: $SchemaRef, path = \"\", options: { mode?: \"min\" | \"max\" } = {}): any {\n  const { mode = \"max\" } = options;\n  const $ = NormalizedSchema.of(schema);\n\n  const memberName = $.isMemberSchema() ? $.getMemberName() : \"____\";\n  if (customFields[memberName]) {\n    return customFields[memberName];\n  }\n\n  const qualifiedName = $.getName(true) ?? \"UnknownSchema!\";\n  path += \" -> \" + qualifiedName + \"$\" + memberName;\n\n  const haltRecursion = path.split(qualifiedName).length >= 4;\n\n  if ($.isStringSchema()) {\n    if ($.isIdempotencyToken()) {\n      return \"00000000-0000-4000-8000-000000000000\";\n    }\n    return \"__\" + memberName + \"__\";\n  } else if ($.isNumericSchema()) {\n    return 0;\n  } else if ($.isBigIntegerSchema()) {\n    return BigInt(1000001);\n  } else if ($.isBigDecimalSchema()) {\n    return new NumericValue(\"9876543210.0123456789\", \"bigDecimal\");\n  } else if ($.isBooleanSchema()) {\n    return false;\n  } else if ($.isBlobSchema()) {\n    if ($.isStreaming()) {\n      return Readable.from(new Uint8Array([1, 0, 0, 1]));\n    }\n    return new Uint8Array([1, 0, 0, 1]);\n  } else if ($.isTimestampSchema()) {\n    return new Date(946702799999);\n  } else if ($.isMapSchema()) {\n    const map = {} as any;\n    if (haltRecursion) {\n      return map;\n    }\n    const $v = $.getValueSchema();\n    map.key1 = createFromSchema($v, path + \"$k1\", options);\n    map.key2 = createFromSchema($v, path + \"$k2\", options);\n    map.key3 = createFromSchema($v, path + \"$k3\", options);\n    if ($.getMergedTraits().sparse) {\n      map.sparse = null;\n    }\n    return map;\n  } else if ($.isListSchema()) {\n    const list = [] as any;\n    if (haltRecursion) {\n      return list;\n    }\n    const $v = $.getValueSchema();\n    list.push(\n      createFromSchema($v, path + \"$l1\", options),\n      createFromSchema($v, path + \"$l2\", options),\n      createFromSchema($v, path + \"$l3\", options)\n    );\n    if ($.getMergedTraits().sparse) {\n      list.push(null);\n    }\n    return list;\n  } else if ($.isStructSchema()) {\n    const isUnion = $.isUnionSchema();\n    const requiredMembers = ($.getSchema() as StaticStructureSchema)[6] ?? 0;\n    const isEventStream = isUnion && $.isStreaming();\n    const struct = {} as any;\n    if (isEventStream) {\n      return {\n        async *[Symbol.asyncIterator]() {\n          for (const [memberName, $member] of $.structIterator()) {\n            yield {\n              [memberName]: createFromSchema($member, path, options),\n            };\n          }\n        },\n      };\n    } else {\n      if (haltRecursion) {\n        return struct;\n      }\n      const unionMemberSelector =\n        path.split(\"\").reduce((a, c) => {\n          return a + c.charCodeAt(0);\n        }, 0) % Object.entries($.getMemberSchemas()).length;\n\n      let i = 0;\n\n      for (const [memberName, $member] of $.structIterator()) {\n        if (i >= requiredMembers && mode === \"min\") {\n          break;\n        }\n        if (!isUnion || i++ === unionMemberSelector) {\n          struct[memberName] = createFromSchema($member, path, options);\n          if (isUnion) {\n            break;\n          }\n        }\n      }\n    }\n    return struct;\n  } else if ($.isUnitSchema()) {\n    return {};\n  } else if ($.isDocumentSchema()) {\n    return {\n      doc_note: \"this is a document\",\n      doc_date: new Date(946702799999),\n      doc_blob: new Uint8Array([1, 0, 0, 1]),\n      doc_list: [-7, -3, 0, 1, 5],\n    };\n  }\n  console.warn(\"WARN: Unsupported schema type in snapshot test\", $);\n  return \"UNSUPPORTED_SCHEMA_TYPE\";\n}\n\n/**\n * Overrides the generated values for members with matching names.\n * @internal\n */\nexport const customFields: Record<string, string> = {\n  PredictEndpoint: \"https://localhost\",\n  ChecksumAlgorithm: \"CRC64NVME\",\n  AccountId: \"123456789012\",\n  OutpostId: \"OutpostId\",\n};\n"
  },
  {
    "path": "packages/snapshot-testing/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/snapshot-testing/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/snapshot-testing/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/snapshot-testing/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/snapshot-testing/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/typecheck/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/typecheck/CHANGELOG.md",
    "content": "# Change Log\n\n## 1.1.3\n\n### Patch Changes\n\n- Updated dependencies [cf00244]\n  - @smithy/types@4.14.2\n  - @smithy/core@3.24.3\n\n## 1.1.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 1.1.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 1.1.0\n\n### Minor Changes\n\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n\n## 1.0.25\n\n### Patch Changes\n\n- @smithy/core@3.23.17\n\n## 1.0.24\n\n### Patch Changes\n\n- Updated dependencies [a029f0e]\n  - @smithy/core@3.23.16\n\n## 1.0.23\n\n### Patch Changes\n\n- Updated dependencies [131fce4]\n- Updated dependencies [52b4789]\n  - @smithy/types@4.14.1\n  - @smithy/core@3.23.15\n  - @smithy/util-middleware@4.2.14\n\n## 1.0.22\n\n### Patch Changes\n\n- Updated dependencies [cffd868]\n  - @smithy/types@4.14.0\n  - @smithy/core@3.23.14\n  - @smithy/util-middleware@4.2.13\n\n## 1.0.21\n\n### Patch Changes\n\n- Updated dependencies [7198e09]\n  - @smithy/core@3.23.13\n\n## 1.0.20\n\n### Patch Changes\n\n- @smithy/core@3.23.12\n\n## 1.0.19\n\n### Patch Changes\n\n- Updated dependencies [2edd638]\n  - @smithy/core@3.23.11\n\n## 1.0.18\n\n### Patch Changes\n\n- Updated dependencies [5340b11]\n  - @smithy/core@3.23.10\n  - @smithy/types@4.13.1\n  - @smithy/util-middleware@4.2.12\n\n## 1.0.17\n\n### Patch Changes\n\n- Updated dependencies [6ef5430]\n- Updated dependencies [6ef5430]\n  - @smithy/core@3.23.9\n\n## 1.0.16\n\n### Patch Changes\n\n- Updated dependencies [a4d95e6]\n  - @smithy/util-middleware@4.2.11\n  - @smithy/core@3.23.8\n\n## 1.0.15\n\n### Patch Changes\n\n- Updated dependencies [11569eb]\n  - @smithy/core@3.23.7\n\n## 1.0.14\n\n### Patch Changes\n\n- Updated dependencies [d0954cc]\n  - @smithy/types@4.13.0\n  - @smithy/core@3.23.6\n  - @smithy/util-middleware@4.2.10\n\n## 1.0.13\n\n### Patch Changes\n\n- Updated dependencies [026b177]\n- Updated dependencies [cde9f09]\n  - @smithy/core@3.23.5\n\n## 1.0.12\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n- Updated dependencies [03c3dc8]\n  - @smithy/core@3.23.4\n  - @smithy/types@4.12.1\n  - @smithy/util-middleware@4.2.9\n\n## 1.0.11\n\n### Patch Changes\n\n- @smithy/core@3.23.3\n\n## 1.0.10\n\n### Patch Changes\n\n- Updated dependencies [c5db01c]\n  - @smithy/core@3.23.2\n\n## 1.0.9\n\n### Patch Changes\n\n- Updated dependencies [6f96c01]\n  - @smithy/core@3.23.1\n\n## 1.0.8\n\n### Patch Changes\n\n- Updated dependencies [4f05c6a]\n  - @smithy/core@3.23.0\n\n## 1.0.7\n\n### Patch Changes\n\n- @smithy/core@3.22.1\n\n## 1.0.6\n\n### Patch Changes\n\n- Updated dependencies [472bf01]\n  - @smithy/core@3.22.0\n\n## 1.0.5\n\n### Patch Changes\n\n- Updated dependencies [fa0e0c4]\n  - @smithy/core@3.21.1\n\n## 1.0.4\n\n### Patch Changes\n\n- Updated dependencies [c2a6f46]\n  - @smithy/core@3.21.0\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies [96cc077]\n  - @smithy/core@3.20.8\n\n## 1.0.2\n\n### Patch Changes\n\n- Updated dependencies [ae6ef2e]\n  - @smithy/core@3.20.7\n\n## 1.0.1\n\n### Patch Changes\n\n- Updated dependencies [862c942]\n  - @smithy/core@3.20.6\n\n## 1.0.0\n\n### Major Changes\n\n- 8ed2b6f: add runtime typecheck pkg\n"
  },
  {
    "path": "packages/typecheck/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/typecheck/README.md",
    "content": "# @smithy/typecheck\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/typecheck/latest.svg)](https://www.npmjs.com/package/@smithy/typecheck)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/typecheck.svg)](https://www.npmjs.com/package/@smithy/typecheck)\n\nThis package contains optional functions for runtime typechecking.\n\n## Prerequisites\n\nThis package requires Smithy-TypeScript client SDKs generated with v0.41.1 or greater.\n\nFor AWS SDK for JavaScript v3 clients (`@aws-sdk/client-*`),\nthis means [v3.953.0](https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.953.0)\nor higher is required.\n\nIf you attach the plugin to an unsupported client, an error will be thrown on any request made\nwith the client:\n\n```shell\nError: @smithy/typecheck::rttcMiddleware - unsupported client version.\n```\n\n## Use with caution\n\nRuntime typechecking has two disadvantages you should accept before use:\n\n- client-side typechecks are not as accurate as allowing the server to validate and potentially reject your request. The\n  older a client is, the more likely that the server implementation may have changed in comparison to the types shipped\n  with that client.\n- additional CPU time and memory will be used on executing the typechecks.\n\n## When to use runtime typechecks\n\nFor example, if you are developing a script against a service,\nenabling the runtime typechecking plugin can assist in the placement\nof input parameters by providing a faster feedback loop than making requests\nagainst the service.\n\nIt can also be potentially useful when accepting an input from another source.\n\n## Runtime Typecheck - Client Plugin Usage\n\n```ts\n// example: attaching the runtime typechecker.\nimport { getRuntimeTypecheckPlugin } from \"@smithy/typecheck\";\nimport { XYZClient, XYZCommand } from \"xyz\";\n\nconst client = new XYZClient({});\n\nclient.middlewareStack.use(\n  getRuntimeTypecheckPlugin({\n    logger: console,\n    // use false or a string corresponding to a log level,\n    // (trace, debug, info, warn, error)\n    // or \"throw\" to have an error be thrown.\n    input: \"warn\",\n    // use false or a log level string.\n    output: false,\n  })\n);\n\nawait client.send(new XYZCommand());\n```\n\nIn this example, the runtime typechecker plugin will now emit all type validation errors\nas warnings to the logger implementation.\n\n### Example log output\n\n```\nRpcV2ProtocolClient->RecursiveShapesCommand input validation:\n  {}.nested.foo: expected string, got number.\n  {}.nested.nested.bar: expected string, got number.\n  {}.nested.nested.recursiveMember.nested: unmatched keys: foo, extra1.\n  {}.nested.nested.recursiveMember.nested.bar: expected string, got number.\n```\n\nThe `{}` indicates the root object, and each error line logs\nthe path to the field in question and reason for the validation error.\n\n## Runtime Typecheck - Standalone Object Validation\n\nSee also [documentation on schemas](https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/SCHEMAS.md).\n\nAs of the prerequisite versions mentioned above, client packages\nexport schema definitions for all structural shapes used by\nthe client, derived from the Smithy service model.\n\nThese schemas can be used to validate the shape of an input object.\n\n```ts\n// example: validating a schema and object pair.\nimport { validateSchema } from \"@smithy/typecheck\";\nimport { MyStruct$ } from \"my-smithy-client-package\";\n\nconst errors: string[] = validateSchema(\n  // schema from generated client package.\n  MyStruct$,\n  // user-defined object.\n  {\n    x: 0,\n    y: 1,\n  }\n);\n```\n\n```ts\n// example: bound validator\nconst myStructValidator = validateSchema.bind(null, MyStruct$);\n\nconst errors: string[] = myStructValidator({ x: 0, y: 1 });\n```\n\nThe returned errors array will be the same statements as those appearing in the\nclient plugin example above.\n"
  },
  {
    "path": "packages/typecheck/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/typecheck/package.json",
    "content": "{\n  \"name\": \"@smithy/typecheck\",\n  \"version\": \"1.1.3\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline typecheck\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:vitest run\",\n    \"test:integration\": \"yarn g:vitest run -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"yarn g:vitest watch -c vitest.config.integ.mts\",\n    \"test:watch\": \"yarn g:vitest watch\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS Smithy Team\",\n    \"email\": \"\",\n    \"url\": \"https://smithy.io\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<=4.0\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/typecheck\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/typecheck\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/typecheck/src/getRuntimeTypecheckPlugin.ts",
    "content": "import { getSmithyContext } from \"@smithy/core/client\";\nimport type {\n  HandlerExecutionContext,\n  InitializeHandler,\n  InitializeHandlerArguments,\n  InitializeHandlerOptions,\n  MetadataBearer,\n  MiddlewareStack,\n  Pluggable,\n  StaticOperationSchema,\n} from \"@smithy/types\";\n\nimport type { RuntimeTypecheckOptions } from \"./types\";\nimport { validateSchema } from \"./validateSchema\";\n\n/**\n * Applies a configurable middleware that performs runtime typechecks on request inputs and response outputs.\n * @public\n */\nexport function getRuntimeTypecheckPlugin<InputType extends object = any, OutputType extends MetadataBearer = any>(\n  options: RuntimeTypecheckOptions\n): Pluggable<InputType, OutputType> {\n  return {\n    applyToStack: (commandStack: MiddlewareStack<InputType, OutputType>) => {\n      commandStack.add(runtimeTypecheckMiddleware(options), runtimeTypecheckOptions);\n    },\n  };\n}\n\n/**\n * @internal\n */\nconst runtimeTypecheckOptions: InitializeHandlerOptions = {\n  name: \"runtimeTypecheckMiddleware\",\n  step: \"initialize\",\n  tags: [\"RUNTIME_TYPECHECK\"],\n  override: true,\n};\n\n/**\n * @internal\n */\nconst runtimeTypecheckMiddleware =\n  (options: RuntimeTypecheckOptions) => (next: InitializeHandler<any, any>, context: HandlerExecutionContext) => {\n    const n = options;\n\n    return async (args: InitializeHandlerArguments<any>) => {\n      const { input } = args;\n      const { operationSchema } = getSmithyContext(context) as {\n        operationSchema: StaticOperationSchema;\n      };\n\n      if (!operationSchema) {\n        throw new Error(`@smithy/typecheck::rttcMiddleware - unsupported client version.`);\n      }\n\n      if (operationSchema?.[4]) {\n        const errors = validateSchema(operationSchema[4], input);\n        if (n.input && errors.length) {\n          const msg = `${context.clientName}->${context.commandName} input validation: \\n\\t${errors.join(\"\\n\\t\")}`;\n          if (n.input === \"throw\") {\n            throw new Error(msg);\n          } else {\n            options?.logger?.[n.input]?.(msg);\n          }\n        }\n      }\n\n      const result = await next(args);\n\n      const { output } = result;\n      if (operationSchema?.[5]) {\n        const copy = {\n          ...output,\n        };\n        delete copy.$metadata;\n        const errors = validateSchema(operationSchema[5], copy);\n        if (n.output && errors.length) {\n          const msg = `${context.clientName}->${context.commandName} output validation: \\n\\t${errors.join(\"\\n\\t\")}`;\n          options?.logger?.[n.output]?.(msg);\n        }\n      }\n      return result;\n    };\n  };\n"
  },
  {
    "path": "packages/typecheck/src/index.ts",
    "content": "export * from \"./getRuntimeTypecheckPlugin\";\nexport * from \"./types\";\nexport * from \"./validateSchema\";\n"
  },
  {
    "path": "packages/typecheck/src/runtime-typecheck.integ.spec.ts",
    "content": "import { cbor } from \"@smithy/core/cbor\";\nimport { HttpResponse } from \"@smithy/protocol-http\";\nimport { RpcV2Protocol as MICGClient } from \"@smithy/smithy-rpcv2-cbor\";\nimport { RpcV2Protocol } from \"@smithy/smithy-rpcv2-cbor-schema\";\nimport { requireRequestsFrom } from \"@smithy/util-test/src\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport { getRuntimeTypecheckPlugin } from \"./getRuntimeTypecheckPlugin\";\n\ndescribe(\"schema-based runtime typecheck integration test\", () => {\n  it(\"should detect type mismatches\", async () => {\n    const logger = {\n      info: vi.fn(),\n      debug: vi.fn(),\n      error: vi.fn(),\n      warn: vi.fn(),\n      trace: vi.fn(),\n    };\n    const client = new RpcV2Protocol({\n      endpoint: \"https://localhost\",\n      logger,\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        new HttpResponse({\n          headers: {\n            \"smithy-protocol\": \"rpc-v2-cbor\",\n          },\n          statusCode: 200,\n          body: cbor.serialize({\n            nested: {\n              foo: 5,\n            },\n          }),\n        })\n      );\n\n    client.middlewareStack.use(\n      getRuntimeTypecheckPlugin({\n        logger,\n        input: \"warn\",\n        output: \"info\",\n      })\n    );\n\n    const output = await client.recursiveShapes({\n      nested: {\n        foo: 0,\n        nested: {\n          bar: 0,\n          recursiveMember: {\n            nested: { foo: 1, extra1: 0, bar: 0, recursiveMember: {} },\n          },\n        },\n      },\n    } as any);\n\n    expect(output).toEqual({\n      $metadata: {\n        attempts: 1,\n        cfId: undefined,\n        extendedRequestId: undefined,\n        httpStatusCode: 200,\n        requestId: undefined,\n        totalRetryDelay: 0,\n      },\n      nested: {\n        foo: 5,\n      },\n    });\n\n    expect(logger.warn).toHaveBeenCalledWith(\n      \"RpcV2ProtocolClient->RecursiveShapesCommand input validation: \\n\" +\n        \"\\t{}.nested.foo: expected string, got number.\\n\" +\n        \"\\t{}.nested.nested.bar: expected string, got number.\\n\" +\n        \"\\t{}.nested.nested.recursiveMember.nested: unmatched keys: foo, extra1.\\n\" +\n        \"\\t{}.nested.nested.recursiveMember.nested.bar: expected string, got number.\"\n    );\n\n    expect(logger.info).toHaveBeenCalledWith(\n      \"RpcV2ProtocolClient->RecursiveShapesCommand output validation: \\n\" +\n        \"\\t{}.nested.foo: expected string, got number.\"\n    );\n  });\n\n  it(\"can be configured to throw an error\", async () => {\n    const logger = {\n      info: vi.fn(),\n      debug: vi.fn(),\n      error: vi.fn(),\n      warn: vi.fn(),\n      trace: vi.fn(),\n    };\n    const client = new RpcV2Protocol({\n      endpoint: \"https://localhost\",\n      logger,\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        new HttpResponse({\n          headers: {\n            \"smithy-protocol\": \"rpc-v2-cbor\",\n          },\n          statusCode: 200,\n          body: cbor.serialize({\n            nested: {\n              foo: 5,\n            },\n          }),\n        })\n      );\n\n    client.middlewareStack.use(\n      getRuntimeTypecheckPlugin({\n        logger,\n        input: \"throw\",\n        output: \"info\",\n      })\n    );\n\n    await expect(() =>\n      client.recursiveShapes({\n        nested: {\n          foo: 0,\n          nested: {\n            bar: 0,\n            recursiveMember: {\n              nested: { foo: 1, extra1: 0, bar: 0, recursiveMember: {} },\n            },\n          },\n        },\n      } as any)\n    ).rejects.toThrowError(\n      \"RpcV2ProtocolClient->RecursiveShapesCommand input validation: \\n\" +\n        \"\\t{}.nested.foo: expected string, got number.\\n\" +\n        \"\\t{}.nested.nested.bar: expected string, got number.\\n\" +\n        \"\\t{}.nested.nested.recursiveMember.nested: unmatched keys: foo, extra1.\\n\" +\n        \"\\t{}.nested.nested.recursiveMember.nested.bar: expected string, got number.\"\n    );\n\n    expect(logger.warn).not.toHaveBeenCalled();\n    expect(logger.info).not.toHaveBeenCalled();\n  });\n\n  it(\"should notify when an incompatible client is used\", async () => {\n    const logger = {\n      info: vi.fn(),\n      debug: vi.fn(),\n      error: vi.fn(),\n      warn: vi.fn(),\n      trace: vi.fn(),\n    };\n    const client = new MICGClient({\n      endpoint: \"https://localhost\",\n      logger,\n    });\n\n    requireRequestsFrom(client)\n      .toMatch({\n        hostname: /localhost/,\n      })\n      .respondWith(\n        new HttpResponse({\n          headers: {\n            \"smithy-protocol\": \"rpc-v2-cbor\",\n          },\n          statusCode: 200,\n          body: cbor.serialize({\n            nested: {\n              foo: \"5\",\n            },\n          }),\n        })\n      );\n\n    client.middlewareStack.use(\n      getRuntimeTypecheckPlugin({\n        logger,\n        input: \"warn\",\n        output: \"info\",\n      })\n    );\n\n    await expect(() =>\n      client.recursiveShapes({\n        nested: {\n          foo: 0,\n          nested: {\n            bar: 0,\n            recursiveMember: {\n              nested: { foo: 1, extra1: 0, bar: 0, recursiveMember: {} },\n            },\n          },\n        },\n      } as any)\n    ).rejects.toThrowError(\"@smithy/typecheck::rttcMiddleware - unsupported client version.\");\n  });\n});\n"
  },
  {
    "path": "packages/typecheck/src/types.ts",
    "content": "import type { Logger } from \"@smithy/types\";\n\n/**\n * Caution: the default and intended behavior is to skip runtime typechecking\n * for performance and compatibility reasons. The server response will\n * contain validation information if requirements are not met, and\n * is the most accurate source.\n *\n * Client-side RTTC is provided as a convenience for a faster feedback loop\n * during script development, but cannot be relied upon as the authority.\n *\n * `trace`, `debug`, `info`, `warn`, and `error` will call the corresponding logger channel.\n * `throw` will instead throw an exception.\n *\n * `false` shuts off all runtime typecheck behavior (the default).\n *\n * @public\n */\nexport type RuntimeTypecheckBehavior = false | keyof Logger | \"throw\";\n\n/**\n * Allows separate configuration of inputs and outputs.\n * If providing a single value (RuntimeTypecheckBehavior), it will apply ONLY\n * to inputs.\n *\n * @public\n */\nexport type RuntimeTypecheckOptions = {\n  /**\n   * The logger to call with the typecheck validation errors.\n   */\n  logger?: Logger;\n  input?: RuntimeTypecheckBehavior;\n  /**\n   * Automatic `throw` is not supported in output validation.\n   * We do not recommend throwing on output validation.\n   */\n  output?: false | keyof Logger;\n};\n"
  },
  {
    "path": "packages/typecheck/src/validateSchema.spec.ts",
    "content": "import type {\n  BigDecimalSchema,\n  BigIntegerSchema,\n  BlobSchema,\n  BooleanSchema,\n  DocumentSchema,\n  NumericSchema,\n  StaticListSchema,\n  StaticMapSchema,\n  StaticStructureSchema,\n  TimestampEpochSecondsSchema,\n} from \"@smithy/types\";\nimport { describe, expect, test as it } from \"vitest\";\n\nimport { validateSchema } from \"./validateSchema\";\n\ndescribe(\"schema-based runtime typecheck\", () => {\n  const Widget$: StaticStructureSchema = [\n    3,\n    \"ns\",\n    \"Widget\",\n    0,\n    [\n      \"string\",\n      \"n\",\n      \"bool\",\n      \"media\",\n      \"timestamp\",\n      \"document\",\n      \"bigint\",\n      \"bigdecimal\",\n      \"blob\",\n\n      \"list\",\n      \"sparseList\",\n      \"map\",\n      \"sparseMap\",\n\n      \"widget\",\n    ],\n    [\n      0,\n      1 satisfies NumericSchema,\n      2 satisfies BooleanSchema,\n      [0, \"ns\", \"Media\", { mediaType: \"application/json\" }, 0],\n      7 satisfies TimestampEpochSecondsSchema,\n      15 satisfies DocumentSchema,\n      17 satisfies BigIntegerSchema,\n      19 satisfies BigDecimalSchema,\n      21 satisfies BlobSchema,\n\n      [[1, \"ns\", \"List\", 0, () => Widget$] satisfies StaticListSchema, 0],\n      [[1, \"ns\", \"List\", 0, () => Widget$] satisfies StaticListSchema, { sparse: 1 }],\n      [2, \"ns\", \"Map\", 0, 0, () => Widget$] satisfies StaticMapSchema,\n      [[2, \"ns\", \"Map\", 0, 0, () => Widget$] satisfies StaticMapSchema, { sparse: 1 }],\n\n      () => Widget$,\n    ],\n    2,\n  ] satisfies StaticStructureSchema;\n\n  it(\"should detect type mismatches\", () => {\n    expect(\n      validateSchema(Widget$, {\n        string: 0,\n        n: \"\",\n        bool: 0,\n        media: \"ahh\",\n        timestamp: new Date(),\n        document: {\n          a: [0, 1, 2, 3],\n        },\n        bigint: 45,\n        bigdecimal: 1.2,\n        blob: [0, 1, 2, 3],\n\n        list: {},\n        sparseList: [0],\n        map: [],\n        sparseMap: { a: 0 },\n\n        widget: 5,\n      })\n    ).toEqual([\n      \"{}.string: expected string, got number.\",\n      \"{}.n: expected number, got string.\",\n      \"{}.bool: expected boolean, got number.\",\n      \"{}.bigint: expected bigint, got number.\",\n      \"{}.bigdecimal: expected NumericValue, got number.\",\n      \"{}.blob: expected Uint8Array, got object.\",\n      \"{}.list:expected array (list), got object.\",\n      \"{}.sparseList[0]: expected {ns#Widget}, got number\",\n      '{}.sparseMap[\"a\"]: expected {ns#Widget}, got number',\n      \"{}.widget: expected {ns#Widget}, got number\",\n    ]);\n  });\n  it(\"should detect missing required members\", () => {\n    expect(validateSchema(Widget$, {})).toEqual([\"{}.string: is required.\", \"{}.n: is required.\"]);\n\n    expect(\n      validateSchema(Widget$, {\n        string: \"\",\n        n: 0,\n        list: [null, { string: \"\", n: 0 }],\n        sparseList: [\n          null,\n          null,\n          {\n            string: \".\",\n          },\n        ],\n        sparseMap: {\n          a: null,\n          b: {\n            n: 0,\n          },\n        },\n        map: {\n          a: null,\n          b: {\n            n: 0,\n          },\n        },\n        widget: {\n          string: \"\",\n          n: 0,\n          widget: {\n            n: 0,\n          },\n        },\n      })\n    ).toEqual([\n      \"{}.list[0]: should be non-null.\",\n      \"{}.sparseList[2].n: is required.\",\n      \"{}.map[a]: should be non-null.\",\n      '{}.map[\"b\"].string: is required.',\n      '{}.sparseMap[\"b\"].string: is required.',\n      \"{}.widget.widget.string: is required.\",\n    ]);\n  });\n  it(\"should detect extraneous members\", () => {\n    expect(\n      validateSchema(Widget$, {\n        string: \"\",\n        n: 0,\n        document: {\n          a: 1,\n          b: 2,\n        },\n        extra1: 0,\n        extra2: 1,\n        widget: { string: \"\", n: 0, extra1: 0, extra2: 1 },\n      })\n    ).toEqual([\"{}: unmatched keys: extra1, extra2.\", \"{}.widget: unmatched keys: extra1, extra2.\"]);\n  });\n});\n"
  },
  {
    "path": "packages/typecheck/src/validateSchema.ts",
    "content": "import { NormalizedSchema } from \"@smithy/core/schema\";\nimport { NumericValue } from \"@smithy/core/serde\";\nimport type { $SchemaRef, StaticStructureSchema } from \"@smithy/types\";\n\n/**\n * Provides list of validation errors, which may be empty.\n * @public\n * @param schema - to validate against.\n * @param data - to validate.\n * @param path - object path for error message contextualization.\n */\nexport function validateSchema(schema: $SchemaRef, data: unknown, path = \"{}\"): string[] {\n  const errors: string[] = [];\n  if (data == undefined) {\n    return errors;\n  }\n  const $ = NormalizedSchema.of(schema);\n  if ($.isStringSchema()) {\n    if (typeof data !== \"string\") {\n      errors.push(`${path}: expected string, got ${typeof data}.`);\n    }\n  } else if ($.isNumericSchema()) {\n    if (typeof data !== \"number\") {\n      errors.push(`${path}: expected number, got ${typeof data}.`);\n    }\n  } else if ($.isBigIntegerSchema()) {\n    if (typeof data !== \"bigint\") {\n      errors.push(`${path}: expected bigint, got ${typeof data}.`);\n    }\n  } else if ($.isBigDecimalSchema()) {\n    if (!(data instanceof NumericValue)) {\n      errors.push(`${path}: expected NumericValue, got ${typeof data}.`);\n    }\n  } else if ($.isBooleanSchema()) {\n    if (typeof data !== \"boolean\") {\n      errors.push(`${path}: expected boolean, got ${typeof data}.`);\n    }\n  } else if ($.isBlobSchema()) {\n    if ($.isStreaming()) {\n      // many types are allowed for streaming payloads.\n    } else {\n      if (!(data instanceof Uint8Array)) {\n        errors.push(`${path}: expected Uint8Array, got ${typeof data}.`);\n      }\n    }\n  } else if ($.isTimestampSchema()) {\n    if (!(data instanceof Date)) {\n      errors.push(`${path}: expected Date, got ${typeof data}.`);\n    }\n  } else if ($.isMapSchema()) {\n    if (typeof data !== \"object\") {\n      errors.push(`${path}:expected map object, got ${typeof data}.`);\n    } else {\n      const sparse = !!$.getMergedTraits().sparse;\n      const map$ = $.getValueSchema();\n      for (const [key, value] of Object.entries(data)) {\n        if (value == null) {\n          if (!sparse) {\n            errors.push(`${path}[${key}]: should be non-null.`);\n          }\n        } else {\n          errors.push(...validateSchema(map$, value, path + `[\"${key}\"]`));\n        }\n      }\n    }\n  } else if ($.isListSchema()) {\n    if (!Array.isArray(data)) {\n      errors.push(`${path}:expected array (list), got ${typeof data}.`);\n    } else {\n      const list$ = $.getValueSchema();\n      const sparse = !!$.getMergedTraits().sparse;\n\n      for (let i = 0; i < data.length; ++i) {\n        const value = data[i];\n        if (value == null) {\n          if (!sparse) {\n            errors.push(`${path}[${i}]: should be non-null.`);\n          }\n        } else {\n          errors.push(...validateSchema(list$, value, path + `[${i}]`));\n        }\n      }\n    }\n  } else if ($.isStructSchema()) {\n    if (typeof data !== \"object\") {\n      errors.push(`${path}: expected {${$.getName(true)}}, got ${typeof data}`);\n    } else {\n      const keys = new Set(Object.keys(data));\n      let required = ($.getSchema() as StaticStructureSchema)?.[6] ?? 0;\n      for (const [member, member$] of $.structIterator()) {\n        keys.delete(member);\n        const value = (data as any)[member];\n        const isRequired = required-- > 0;\n        if (isRequired && value == null) {\n          errors.push(`${path}.${member}: is required.`);\n        } else {\n          errors.push(...validateSchema(member$, value, path + `.${member}`));\n        }\n      }\n      if (keys.size > 0) {\n        errors.unshift(`${path}: unmatched keys: ${Array.from(keys).join(\", \")}.`);\n      }\n    }\n  }\n\n  return errors;\n}\n"
  },
  {
    "path": "packages/typecheck/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/typecheck/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/typecheck/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/typecheck/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/typecheck/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ,e2e,browser}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "packages/types/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/types/CHANGELOG.md",
    "content": "# Change Log\n\n## 4.14.2\n\n### Patch Changes\n\n- cf00244: fix(types): exclude SharedArrayBuffer from recursive type transform\n\n## 4.14.1\n\n### Patch Changes\n\n- 131fce4: add eventStream indicator signal for NodeHttp2ConnectionManager so it does not reuse connections for event streams\n- 52b4789: allow snapshot of credentials for event-stream signing\n\n## 4.14.0\n\n### Minor Changes\n\n- cffd868: Introduce default retry behavior modifications slated for 2026. They are:\n  less time between server error retries, but slightly more time between throttling errors. Lower retry capacity consumption for throttling, and improved parsing of the retry-after and x-amz-retry-after headers.\n\n## 4.13.1\n\n### Patch Changes\n\n- 5340b11: apply resolved endpoint headers to final request\n\n## 4.13.0\n\n### Minor Changes\n\n- d0954cc: allow adding new checksum algorithms via extension\n\n## 4.12.1\n\n### Patch Changes\n\n- 03c3dc8: update for rollup build externalLiveBindings=false\n\n## 4.12.0\n\n### Minor Changes\n\n- 745867a: encode required member count in structure schemas\n\n## 4.11.0\n\n### Minor Changes\n\n- 9ccb841: add static union schema as a new type\n\n## 4.10.0\n\n### Minor Changes\n\n- 5a56762: make protocol selection easier\n\n## 4.9.0\n\n### Minor Changes\n\n- 3926fd7: set release level for schemas\n\n## 4.8.1\n\n### Patch Changes\n\n- 6da0ab3: export used types\n\n## 4.8.0\n\n### Minor Changes\n\n- 8a2a912: remove usage of non-static schema classes\n\n## 4.7.1\n\n### Patch Changes\n\n- 052d261: fix ordering of static simple schema type\n\n## 4.7.0\n\n### Minor Changes\n\n- 761d89c: undeprecate socketTimeout for node:https requests\n- 7f8af58: generation of static schema\n\n## 4.6.0\n\n### Minor Changes\n\n- 45ee67f: update dist-cjs generation to use rollup\n\n## 4.5.0\n\n### Minor Changes\n\n- bb7c1c1: schema code size optimizations\n\n## 4.4.0\n\n### Minor Changes\n\n- 64cda93: set sideEffects bundler metadata\n\n### Patch Changes\n\n- f884df7: enforce consistent-type-imports\n\n## 4.3.2\n\n### Patch Changes\n\n- 64e033f: schema serde: http binding and cbor serializer refactoring\n\n## 4.3.1\n\n### Patch Changes\n\n- 358c1ff: fix Command interface compatibility with type transformers\n\n## 4.3.0\n\n### Minor Changes\n\n- 0547fab: add types for schemas\n\n## 4.2.0\n\n### Minor Changes\n\n- e917e61: enforce singular config object during client instantiation\n\n## 4.1.0\n\n### Minor Changes\n\n- 2aff9df: Added middleware support to pagination\n- 000b2ae: allow paginator token fallback to be specified by operation input\n\n## 4.0.0\n\n### Major Changes\n\n- 20d99be: major version bump for dropping node16 support\n\n## 3.7.2\n\n### Patch Changes\n\n- b52b4e8: add support for error cause in transient error checks\n\n## 3.7.1\n\n### Patch Changes\n\n- fcd5ca8: prevent infinite recursion with NoUndefined and RecursiveRequired re: DocumentType\n\n## 3.7.0\n\n### Minor Changes\n\n- cd1929b: vitest compatibility\n\n## 3.6.0\n\n### Minor Changes\n\n- 84bec05: add feature identification map to smithy context\n\n## 3.5.0\n\n### Minor Changes\n\n- a4c1285: configurable hoisted headers\n\n## 3.4.2\n\n### Patch Changes\n\n- e7b438b: add interface stub for browser RequestInit type\n\n## 3.4.1\n\n### Patch Changes\n\n- cf9257e: add requestInit options to fetch\n\n## 3.4.0\n\n### Minor Changes\n\n- 2dad138: Add string array to EndpointParameters\n\n### Patch Changes\n\n- 9f3f2f5: fix type transforms\n\n## 3.3.0\n\n### Minor Changes\n\n- 4784fb9: Adding support for setting the fetch API credentials mode\n\n## 3.2.0\n\n### Minor Changes\n\n- c2a5595: use platform AbortController|AbortSignal implementations\n\n### Patch Changes\n\n- c16e014: add logger option to node-http-handler parameters, clear socket usage check timeout on error\n\n## 3.1.0\n\n### Minor Changes\n\n- 38da9009: adds accountId to the AwsCredentialIdentity interface\n\n## 3.0.0\n\n### Major Changes\n\n- 671aa704: update to node16 minimum\n\n### Minor Changes\n\n- 7a7c84d3: fix type transforms for method signatures with no arguments\n\n## 2.12.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- 661f1d60: allow command constructor argument to be omitted if no required members\n\n## 2.11.0\n\n### Minor Changes\n\n- 43f3e1e2: encoders allow string inputs\n\n## 2.10.1\n\n### Patch Changes\n\n- dd0d9b4b: make clock skew correcting errors transient\n\n## 2.10.0\n\n### Minor Changes\n\n- d70a00ac: allow ctor args in lieu of Agent instances in node-http-handler ctor\n- 1e23f967: add socket exhaustion checked warning to node-http-handler\n\n## 2.9.1\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n\n## 2.9.0\n\n### Minor Changes\n\n- 9939f823: bundle dist-cjs index\n\n## 2.8.0\n\n### Minor Changes\n\n- 590af6b7: support credential scope\n\n## 2.7.0\n\n### Minor Changes\n\n- 340634a5: move default fetch and http handler ctor types to the types package\n\n## 2.6.0\n\n### Minor Changes\n\n- 9bfc64ed: add type helper for nullability in clients\n\n### Patch Changes\n\n- 9579a9a0: Add internal error and success handlers to `HttpSigner`.\n\n## 2.5.0\n\n### Minor Changes\n\n- 8044a814: feat(experimentalIdentityAndAuth): move `experimentalIdentityAndAuth` types and interfaces to `@smithy/types` and `@smithy/core`\n\n## 2.4.0\n\n### Minor Changes\n\n- 5e9fd6ce: transform inputs for env specific type helpers\n\n### Patch Changes\n\n- 05f5d42c: Allow lowercase type names for endpoint parameter\n\n## 2.3.5\n\n### Patch Changes\n\n- d6b4c090: Add enum IniSectionType\n\n## 2.3.4\n\n### Patch Changes\n\n- 2f70f105: Support `aliases` for `MiddlewareStack`\n- 9a562d37: check for existence of browser Blob/ReadableStream types in payload union\n\n## 2.3.3\n\n### Patch Changes\n\n- ea0635d6: add debug method to middlewareStack\n\n## 2.3.2\n\n### Patch Changes\n\n- fbfeebee: Add `clientName` and `commandName` to `HandlerExecutionContext`\n- c0b17a13: Add Smithy context to `HandlerExecutionContext`\n\n## 2.3.1\n\n### Patch Changes\n\n- b9265813: fix: broken ChecksumConfiguration interface in TS < 4.4 and conditional generic types in TS<4.1\n- 6d1c2fb1: fix paginator type\n\n## 2.3.0\n\n### Minor Changes\n\n- 88bcec3d: Add retry to runtime extension\n\n## 2.2.2\n\n### Patch Changes\n\n- b753dd4c: move extensions code to smithy-client\n- 6c8ffa27: Rename defaultClientConfiguration to defaultExtensionConfiguration\n\n## 2.2.1\n\n### Patch Changes\n\n- 381e03c4: Remove symbol as an index from ChecksumConfiguration interface in @smithy/types\n\n## 2.2.0\n\n### Minor Changes\n\n- f6cb949d: add extensions to client runtime config\n\n## 2.1.0\n\n### Minor Changes\n\n- 59548ba9: Add type to check optional Client Configuration\n\n### Patch Changes\n\n- 3e1ab589: add release tag public to client init interface components\n\n## 2.0.2\n\n### Patch Changes\n\n- 1b951769: custom ts3.4 downlevel for types/transform/type-transform\n\n## 2.0.1\n\n### Patch Changes\n\n- 9d53bc76: update to 2.x major versions\n\n## 1.2.0\n\n### Minor Changes\n\n- e3cbb3cc: set types to the 1.x line\n\n## 2.0.0\n\n### Major Changes\n\n- d90a45b5: improved streaming payload types\n\n### Patch Changes\n\n- 8cd89c75: enable api extractor for documentation generation\n\n## 1.1.1\n\n### Patch Changes\n\n- 6e312329: restore downlevel types\n\n## 1.1.0\n\n### Minor Changes\n\n- adedc001c: Add types for migrated packages\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://conventionalcommits.org) for commit guidelines.\n\nSee [@aws-sdk/types](https://github.com/aws/aws-sdk-js-v3/blob/main/packages/types/CHANGELOG.md) for additional history.\n"
  },
  {
    "path": "packages/types/LICENSE",
    "content": "                                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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/types/README.md",
    "content": "# @smithy/types\n\n[![NPM version](https://img.shields.io/npm/v/@smithy/types/latest.svg)](https://www.npmjs.com/package/@smithy/types)\n[![NPM downloads](https://img.shields.io/npm/dm/@smithy/types.svg)](https://www.npmjs.com/package/@smithy/types)\n\n## Usage\n\nThis package is mostly used internally by generated clients.\nSome public components have independent applications.\n\n---\n\n### Scenario: Removing `| undefined` from input and output structures\n\nGenerated shapes' members are unioned with `undefined` for\ninput shapes, and are `?` (optional) for output shapes.\n\n- for inputs, this defers the validation to the service.\n- for outputs, this strongly suggests that you should runtime-check the output data.\n\nIf you would like to skip these steps, use the `AssertiveClient` or\n`UncheckedClient` type helpers.\n\nUsing AWS S3 as an example:\n\n```ts\nimport { S3 } from \"@aws-sdk/client-s3\";\nimport type { AssertiveClient, UncheckedClient } from \"@smithy/types\";\n\nconst s3a = new S3({}) as AssertiveClient<S3>;\nconst s3b = new S3({}) as UncheckedClient<S3>;\n\n// AssertiveClient enforces required inputs are not undefined\n// and required outputs are not undefined.\nconst get = await s3a.getObject({\n  Bucket: \"\",\n  // @ts-expect-error (undefined not assignable to string)\n  Key: undefined,\n});\n\n// UncheckedClient makes output fields non-nullable.\n// You should still perform type checks as you deem\n// necessary, but the SDK will no longer prompt you\n// with nullability errors.\nconst body = await (\n  await s3b.getObject({\n    Bucket: \"\",\n    Key: \"\",\n  })\n).Body.transformToString();\n```\n\nWhen using the transform on non-aggregated client with the `Command` syntax,\nthe input cannot be validated because it goes through another class.\n\n```ts\nimport { GetObjectCommand, GetObjectCommandInput, ListBucketsCommand, S3Client } from \"@aws-sdk/client-s3\";\nimport type { AssertiveClient, NoUndefined, UncheckedClient } from \"@smithy/types\";\n\nconst s3 = new S3Client({}) as UncheckedClient<S3Client>;\n\nconst list = await s3.send(\n  new ListBucketsCommand({\n    // command inputs are not validated by the type transform.\n    // because this is a separate class.\n  })\n);\n\n/**\n * Although less ergonomic, you can use the NoUndefined<T>\n * transform on the input type.\n */\nconst getObjectInput: NoUndefined<GetObjectCommandInput> = {\n  Bucket: \"undefined\",\n  // @ts-expect-error (undefined not assignable to string)\n  Key: undefined,\n  // optional params can still be undefined.\n  SSECustomerAlgorithm: undefined,\n};\n\nconst get = s3.send(new GetObjectCommand(getObjectInput));\n\n// outputs are still transformed.\nawait get.Body.TransformToString();\n```\n\n### Scenario: Narrowing a smithy-typescript generated client's output payload blob types\n\nThis is mostly relevant to operations with streaming bodies such as within\nthe S3Client in the AWS SDK for JavaScript v3.\n\nBecause blob payload types are platform dependent, you may wish to indicate in your application that a client is running in a specific\nenvironment. This narrows the blob payload types.\n\n```typescript\nimport type { IncomingMessage } from \"node:http\";\nimport { GetObjectCommand, S3Client } from \"@aws-sdk/client-s3\";\nimport type { NodeJsClient, SdkStream, StreamingBlobPayloadOutputTypes } from \"@smithy/types\";\n\n// default client init.\nconst s3Default = new S3Client({});\n\n// client init with type narrowing.\nconst s3NarrowType = new S3Client({}) as NodeJsClient<S3Client>;\n\n// The default type of blob payloads is a wide union type including multiple possible\n// request handlers.\nconst body1: StreamingBlobPayloadOutputTypes = (await s3Default.send(new GetObjectCommand({ Key: \"\", Bucket: \"\" })))\n  .Body!;\n\n// This is of the narrower type SdkStream<IncomingMessage> representing\n// blob payload responses using specifically the node:http request handler.\nconst body2: SdkStream<IncomingMessage> = (await s3NarrowType.send(new GetObjectCommand({ Key: \"\", Bucket: \"\" })))\n  .Body!;\n```\n"
  },
  {
    "path": "packages/types/api-extractor.json",
    "content": "{\n  \"extends\": \"../../api-extractor.packages.json\",\n  \"mainEntryPointFilePath\": \"./dist-types/index.d.ts\"\n}\n"
  },
  {
    "path": "packages/types/package.json",
    "content": "{\n  \"name\": \"@smithy/types\",\n  \"version\": \"4.14.2\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:types' 'yarn:build:es:cjs'\",\n    \"build:es:cjs\": \"yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline types\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4 && node scripts/downlevel\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"extract:docs\": \"api-extractor run --local\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"yarn g:tsc -p tsconfig.test.json\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS Smithy Team\",\n    \"email\": \"\",\n    \"url\": \"https://smithy.io\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<=4.0\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/types\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/types\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/types/scripts/downlevel.js",
    "content": "const fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst pkgRoot = path.join(__dirname, \"..\");\n\nfunction replaceDownlevelFile(pathFromSrc = \"\") {\n  const code = fs.readFileSync(path.join(pkgRoot, \"dist-types\", \"ts3.4\", \"downlevel-ts3.4\", pathFromSrc), \"utf-8\");\n  fs.writeFileSync(path.join(pkgRoot, \"dist-types\", \"ts3.4\", pathFromSrc), code, \"utf-8\");\n}\n\nreplaceDownlevelFile(\"transform/type-transform.d.ts\");\n"
  },
  {
    "path": "packages/types/src/abort-handler.ts",
    "content": "import type { AbortSignal as DeprecatedAbortSignal } from \"./abort\";\n\n/**\n * @public\n */\nexport interface AbortHandler {\n  (this: AbortSignal | DeprecatedAbortSignal, ev: any): any;\n}\n"
  },
  {
    "path": "packages/types/src/abort.ts",
    "content": "import type { AbortHandler } from \"./abort-handler\";\n\n/**\n * @public\n */\nexport { AbortHandler };\n\n/**\n * Holders of an AbortSignal object may query if the associated operation has\n * been aborted and register an onabort handler.\n *\n * @public\n * @deprecated use platform (global) type for AbortSignal.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal\n */\nexport interface AbortSignal {\n  /**\n   * Whether the action represented by this signal has been cancelled.\n   */\n  readonly aborted: boolean;\n\n  /**\n   * A function to be invoked when the action represented by this signal has\n   * been cancelled.\n   */\n  onabort: AbortHandler | Function | null;\n}\n\n/**\n * The AWS SDK uses a Controller/Signal model to allow for cooperative\n * cancellation of asynchronous operations. When initiating such an operation,\n * the caller can create an AbortController and then provide linked signal to\n * subtasks. This allows a single source to communicate to multiple consumers\n * that an action has been aborted without dictating how that cancellation\n * should be handled.\n *\n * @public\n * @deprecated use platform (global) type for AbortController.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController\n */\nexport interface AbortController {\n  /**\n   * An object that reports whether the action associated with this\n   * `AbortController` has been cancelled.\n   */\n  readonly signal: AbortSignal;\n\n  /**\n   * Declares the operation associated with this AbortController to have been\n   * cancelled.\n   */\n  abort(): void;\n}\n"
  },
  {
    "path": "packages/types/src/auth/HttpApiKeyAuth.ts",
    "content": "/**\n * @internal\n */\nexport enum HttpApiKeyAuthLocation {\n  HEADER = \"header\",\n  QUERY = \"query\",\n}\n"
  },
  {
    "path": "packages/types/src/auth/HttpAuthScheme.ts",
    "content": "import type { Identity, IdentityProvider } from \"../identity/identity\";\nimport type { HandlerExecutionContext } from \"../middleware\";\nimport type { HttpSigner } from \"./HttpSigner\";\nimport type { IdentityProviderConfig } from \"./IdentityProviderConfig\";\n\n/**\n * ID for {@link HttpAuthScheme}\n * @internal\n */\nexport type HttpAuthSchemeId = string;\n\n/**\n * Interface that defines an HttpAuthScheme\n * @internal\n */\nexport interface HttpAuthScheme {\n  /**\n   * ID for an HttpAuthScheme, typically the absolute shape ID of a Smithy auth trait.\n   */\n  schemeId: HttpAuthSchemeId;\n  /**\n   * Gets the IdentityProvider corresponding to an HttpAuthScheme.\n   */\n  identityProvider(config: IdentityProviderConfig): IdentityProvider<Identity> | undefined;\n  /**\n   * HttpSigner corresponding to an HttpAuthScheme.\n   */\n  signer: HttpSigner;\n}\n\n/**\n * Interface that defines the identity and signing properties when selecting\n * an HttpAuthScheme.\n * @internal\n */\nexport interface HttpAuthOption {\n  schemeId: HttpAuthSchemeId;\n  identityProperties?: Record<string, unknown>;\n  signingProperties?: Record<string, unknown>;\n  propertiesExtractor?: <TConfig extends object, TContext extends HandlerExecutionContext>(\n    config: TConfig,\n    context: TContext\n  ) => {\n    identityProperties?: Record<string, unknown>;\n    signingProperties?: Record<string, unknown>;\n  };\n}\n\n/**\n * @internal\n */\nexport interface SelectedHttpAuthScheme {\n  httpAuthOption: HttpAuthOption;\n  identity: Identity;\n  signer: HttpSigner;\n}\n"
  },
  {
    "path": "packages/types/src/auth/HttpAuthSchemeProvider.ts",
    "content": "import type { HandlerExecutionContext } from \"../middleware\";\nimport type { HttpAuthOption } from \"./HttpAuthScheme\";\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeParameters {\n  operation?: string;\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeProvider<TParameters extends HttpAuthSchemeParameters> {\n  (authParameters: TParameters): HttpAuthOption[];\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeParametersProvider<\n  TConfig extends object,\n  TContext extends HandlerExecutionContext,\n  TParameters extends HttpAuthSchemeParameters,\n  TInput extends object,\n> {\n  (config: TConfig, context: TContext, input: TInput): Promise<TParameters>;\n}\n"
  },
  {
    "path": "packages/types/src/auth/HttpSigner.ts",
    "content": "import type { HttpRequest, HttpResponse } from \"../http\";\nimport type { Identity } from \"../identity/identity\";\n\n/**\n * @internal\n */\nexport interface ErrorHandler {\n  (signingProperties: Record<string, unknown>): <E extends Error>(error: E) => never;\n}\n\n/**\n * @internal\n */\nexport interface SuccessHandler {\n  (httpResponse: HttpResponse | unknown, signingProperties: Record<string, unknown>): void;\n}\n\n/**\n * Interface to sign identity and signing properties.\n * @internal\n */\nexport interface HttpSigner {\n  /**\n   * Signs an HttpRequest with an identity and signing properties.\n   * @param httpRequest request to sign\n   * @param identity identity to sing the request with\n   * @param signingProperties property bag for signing\n   * @returns signed request in a promise\n   */\n  sign(httpRequest: HttpRequest, identity: Identity, signingProperties: Record<string, unknown>): Promise<HttpRequest>;\n  /**\n   * Handler that executes after the {@link HttpSigner.sign} invocation and corresponding\n   * middleware throws an error.\n   * The error handler is expected to throw the error it receives, so the return type of the error handler is `never`.\n   * @internal\n   */\n  errorHandler?: ErrorHandler;\n  /**\n   * Handler that executes after the {@link HttpSigner.sign} invocation and corresponding\n   * middleware succeeds.\n   * @internal\n   */\n  successHandler?: SuccessHandler;\n}\n"
  },
  {
    "path": "packages/types/src/auth/IdentityProviderConfig.ts",
    "content": "import type { Identity, IdentityProvider } from \"../identity/identity\";\nimport type { HttpAuthSchemeId } from \"./HttpAuthScheme\";\n\n/**\n * Interface to get an IdentityProvider for a specified HttpAuthScheme\n * @internal\n */\nexport interface IdentityProviderConfig {\n  /**\n   * Get the IdentityProvider for a specified HttpAuthScheme.\n   * @param schemeId schemeId of the HttpAuthScheme\n   * @returns IdentityProvider or undefined if HttpAuthScheme is not found\n   */\n  getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined;\n}\n"
  },
  {
    "path": "packages/types/src/auth/auth.ts",
    "content": "/**\n * Authentication schemes represent a way that the service will authenticate the customer’s identity.\n *\n * @internal\n */\nexport interface AuthScheme {\n  /**\n   * @example \"sigv4a\" or \"sigv4\"\n   */\n  name: \"sigv4\" | \"sigv4a\" | string;\n  /**\n   * @example \"s3\"\n   */\n  signingName: string;\n  /**\n   * @example \"us-east-1\"\n   */\n  signingRegion: string;\n  /**\n   * @example [\"*\"]\n   * @example [\"us-west-2\", \"us-east-1\"]\n   */\n  signingRegionSet?: string[];\n  /**\n   * @deprecated this field was renamed to signingRegion.\n   */\n  signingScope?: never;\n  properties: Record<string, unknown>;\n}\n\n/**\n * @deprecated\n *\n * @internal\n */\nexport interface HttpAuthDefinition {\n  /**\n   * Defines the location of where the Auth is serialized.\n   */\n  in: HttpAuthLocation;\n  /**\n   * Defines the name of the HTTP header or query string parameter\n   * that contains the Auth.\n   */\n  name: string;\n  /**\n   * Defines the security scheme to use on the `Authorization` header value.\n   * This can only be set if the \"in\" property is set to {@link HttpAuthLocation.HEADER}.\n   */\n  scheme?: string;\n}\n\n/**\n * @deprecated\n *\n * @internal\n */\nexport enum HttpAuthLocation {\n  HEADER = \"header\",\n  QUERY = \"query\",\n}\n"
  },
  {
    "path": "packages/types/src/auth/index.ts",
    "content": "export * from \"./auth\";\nexport * from \"./HttpApiKeyAuth\";\nexport * from \"./HttpAuthScheme\";\nexport * from \"./HttpAuthSchemeProvider\";\nexport * from \"./HttpSigner\";\nexport * from \"./IdentityProviderConfig\";\n"
  },
  {
    "path": "packages/types/src/blob/blob-payload-input-types.ts",
    "content": "import type { Readable } from \"node:stream\";\n\nimport type { BlobOptionalType, ReadableStreamOptionalType } from \"../externals-check/browser-externals-check\";\n\n/**\n * A union of types that can be used as inputs for the service model\n * \"blob\" type when it represents the request's entire payload or body.\n * For example, in Lambda::invoke, the payload is modeled as a blob type\n * and this union applies to it.\n * In contrast, in Lambda::createFunction the Zip file option is a blob type,\n * but is not the (entire) payload and this union does not apply.\n * Note: not all types are signable by the standard SignatureV4 signer when\n * used as the request body. For example, in Node.js a Readable stream\n * is not signable by the default signer.\n * They are included in the union because it may work in some cases,\n * but the expected types are primarily string and Uint8Array.\n * Additional details may be found in the internal\n * function \"getPayloadHash\" in the SignatureV4 module.\n *\n * @public\n */\nexport type BlobPayloadInputTypes =\n  | string\n  | ArrayBuffer\n  | ArrayBufferView\n  | Uint8Array\n  | NodeJsRuntimeBlobTypes\n  | BrowserRuntimeBlobTypes;\n\n/**\n * Additional blob types for the Node.js environment.\n *\n * @public\n */\nexport type NodeJsRuntimeBlobTypes = Readable | Buffer;\n\n/**\n * Additional blob types for the browser environment.\n *\n * @public\n */\nexport type BrowserRuntimeBlobTypes = BlobOptionalType | ReadableStreamOptionalType;\n\n/**\n * @internal\n * @deprecated renamed to BlobPayloadInputTypes.\n */\nexport type BlobTypes = BlobPayloadInputTypes;\n"
  },
  {
    "path": "packages/types/src/checksum.ts",
    "content": "import type { SourceData } from \"./crypto\";\n\n/**\n * An object that provides a checksum of data provided in chunks to `update`.\n * The checksum may be performed incrementally as chunks are received or all\n * at once when the checksum is finalized, depending on the underlying\n * implementation.\n * It's recommended to compute checksum incrementally to avoid reading the\n * entire payload in memory.\n * A class that implements this interface may accept an optional secret key in its\n * constructor while computing checksum value, when using HMAC. If provided,\n * this secret key would be used when computing checksum.\n *\n * @public\n */\nexport interface Checksum {\n  /**\n   * Constant length of the digest created by the algorithm in bytes.\n   */\n  digestLength?: number;\n\n  /**\n   * Creates a new checksum object that contains a deep copy of the internal\n   * state of the current `Checksum` object.\n   */\n  copy?(): Checksum;\n\n  /**\n   * Returns the digest of all of the data passed.\n   */\n  digest(): Promise<Uint8Array>;\n\n  /**\n   * Allows marking a checksum for checksums that support the ability\n   * to mark and reset.\n   *\n   * @param readLimit - The maximum limit of bytes that can be read\n   *   before the mark position becomes invalid.\n   */\n  mark?(readLimit: number): void;\n\n  /**\n   * Resets the checksum to its initial value.\n   */\n  reset(): void;\n\n  /**\n   * Adds a chunk of data for which checksum needs to be computed.\n   * This can be called many times with new data as it is streamed.\n   *\n   * Implementations may override this method which passes second param\n   * which makes Checksum object stateless.\n   *\n   * @param chunk - The buffer to update checksum with.\n   */\n  update(chunk: Uint8Array): void;\n}\n\n/**\n * A constructor for a Checksum that may be used to calculate an HMAC. Implementing\n * classes should not directly hold the provided key in memory beyond the\n * lexical scope of the constructor.\n *\n * @public\n */\nexport interface ChecksumConstructor {\n  new (secret?: SourceData): Checksum;\n}\n"
  },
  {
    "path": "packages/types/src/client.ts",
    "content": "import type { Command } from \"./command\";\nimport type { MiddlewareStack } from \"./middleware\";\nimport type { MetadataBearer } from \"./response\";\nimport type { OptionalParameter } from \"./util\";\n\n/**\n * A type which checks if the client configuration is optional.\n * If all entries of the client configuration are optional, it allows client creation without passing any config.\n *\n * @public\n */\nexport type CheckOptionalClientConfig<T> = OptionalParameter<T>;\n\n/**\n * function definition for different overrides of client's 'send' function.\n *\n * @public\n */\nexport interface InvokeFunction<\n  InputTypes extends object,\n  OutputTypes extends MetadataBearer,\n  ResolvedClientConfiguration,\n> {\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,\n    options?: any\n  ): Promise<OutputType>;\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,\n    cb: (err: any, data?: OutputType) => void\n  ): void;\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,\n    options: any,\n    cb: (err: any, data?: OutputType) => void\n  ): void;\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,\n    options?: any,\n    cb?: (err: any, data?: OutputType) => void\n  ): Promise<OutputType> | void;\n}\n\n/**\n * Signature that appears on aggregated clients' methods.\n *\n * @public\n */\nexport interface InvokeMethod<InputType extends object, OutputType extends MetadataBearer> {\n  (input: InputType, options?: any): Promise<OutputType>;\n  (input: InputType, cb: (err: any, data?: OutputType) => void): void;\n  (input: InputType, options: any, cb: (err: any, data?: OutputType) => void): void;\n  (input: InputType, options?: any, cb?: (err: any, data?: OutputType) => void): Promise<OutputType> | void;\n}\n\n/**\n * Signature that appears on aggregated clients' methods when argument is optional.\n *\n * @public\n */\nexport interface InvokeMethodOptionalArgs<InputType extends object, OutputType extends MetadataBearer> {\n  (): Promise<OutputType>;\n  (input: InputType, options?: any): Promise<OutputType>;\n  (input: InputType, cb: (err: any, data?: OutputType) => void): void;\n  (input: InputType, options: any, cb: (err: any, data?: OutputType) => void): void;\n  (input: InputType, options?: any, cb?: (err: any, data?: OutputType) => void): Promise<OutputType> | void;\n}\n\n/**\n * A general interface for service clients, idempotent to browser or node clients\n * This type corresponds to SmithyClient(https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/src/client.ts).\n * It's provided for using without importing the SmithyClient class.\n * @internal\n */\nexport interface Client<Input extends object, Output extends MetadataBearer, ResolvedClientConfiguration> {\n  readonly config: ResolvedClientConfiguration;\n  middlewareStack: MiddlewareStack<Input, Output>;\n  send: InvokeFunction<Input, Output, ResolvedClientConfiguration>;\n  destroy: () => void;\n}\n"
  },
  {
    "path": "packages/types/src/command.ts",
    "content": "import type { Handler, MiddlewareStack } from \"./middleware\";\nimport type { MetadataBearer } from \"./response\";\n\n/**\n * @public\n */\nexport interface Command<\n  ClientInput extends object,\n  InputType extends ClientInput,\n  ClientOutput extends MetadataBearer,\n  OutputType extends ClientOutput,\n  ResolvedConfiguration,\n> extends CommandIO<InputType, OutputType> {\n  readonly input: InputType;\n  readonly middlewareStack: MiddlewareStack<InputType, OutputType>;\n  /**\n   * This should be OperationSchema from @smithy/types, but would\n   * create problems with the client transform type adaptors.\n   */\n  readonly schema?: any;\n\n  resolveMiddleware(\n    stack: MiddlewareStack<ClientInput, ClientOutput>,\n    configuration: ResolvedConfiguration,\n    options: any\n  ): Handler<InputType, OutputType>;\n}\n\n/**\n * This is a subset of the Command type used only to detect the i/o types.\n *\n * @internal\n */\nexport interface CommandIO<InputType extends object, OutputType extends MetadataBearer> {\n  readonly input: InputType;\n  resolveMiddleware(stack: any, configuration: any, options: any): Handler<InputType, OutputType>;\n}\n\n/**\n * @internal\n */\nexport type GetOutputType<Command> = Command extends CommandIO<any, infer O> ? O : never;\n"
  },
  {
    "path": "packages/types/src/connection/config.ts",
    "content": "/**\n * @public\n */\nexport interface ConnectConfiguration {\n  /**\n   * The maximum time in milliseconds that the connection phase of a request\n   * may take before the connection attempt is abandoned.\n   */\n  requestTimeout?: number;\n\n  /**\n   * Signal from the Command class object context,\n   * tells the connection manager to use a new connection.\n   */\n  isEventStream?: boolean;\n}\n"
  },
  {
    "path": "packages/types/src/connection/index.ts",
    "content": "export * from \"./config\";\nexport * from \"./manager\";\nexport * from \"./pool\";\n"
  },
  {
    "path": "packages/types/src/connection/manager.ts",
    "content": "import type { RequestContext } from \"../transfer\";\nimport type { ConnectConfiguration } from \"./config\";\n\n/**\n * @public\n */\nexport interface ConnectionManagerConfiguration {\n  /**\n   * Maximum number of allowed concurrent requests per connection.\n   */\n  maxConcurrency?: number;\n\n  /**\n   * Disables concurrent requests per connection.\n   */\n  disableConcurrency?: boolean;\n}\n\n/**\n * @public\n */\nexport interface ConnectionManager<T> {\n  /**\n   * Retrieves a connection from the connection pool if available,\n   * otherwise establish a new connection\n   */\n  lease(requestContext: RequestContext, connectionConfiguration: ConnectConfiguration): T;\n\n  /**\n   * Releases the connection back to the pool making it potentially\n   * re-usable by other requests.\n   */\n  release(requestContext: RequestContext, connection: T): void;\n\n  /**\n   * Destroys the connection manager. All connections will be closed.\n   */\n  destroy(): void;\n}\n"
  },
  {
    "path": "packages/types/src/connection/pool.ts",
    "content": "/**\n * @public\n */\nexport interface ConnectionPool<T> {\n  /**\n   * Retrieve the first connection in the pool\n   */\n  poll(): T | void;\n\n  /**\n   * Release the connection back to the pool making it potentially\n   * re-usable by other requests.\n   */\n  offerLast(connection: T): void;\n\n  /**\n   * Removes the connection from the pool, and destroys it.\n   */\n  destroy(connection: T): void;\n\n  /**\n   * Implements the iterable protocol and allows arrays to be consumed\n   * by most syntaxes expecting iterables, such as the spread syntax\n   * and for...of loops\n   */\n  [Symbol.iterator](): Iterator<T>;\n}\n\n/**\n * Unused.\n * @internal\n * @deprecated\n */\nexport interface CacheKey {\n  destination: string;\n}\n"
  },
  {
    "path": "packages/types/src/crypto.ts",
    "content": "/**\n * @public\n */\nexport type SourceData = string | ArrayBuffer | ArrayBufferView;\n\n/**\n * An object that provides a hash of data provided in chunks to `update`. The\n * hash may be performed incrementally as chunks are received or all at once\n * when the hash is finalized, depending on the underlying implementation.\n *\n * @public\n * @deprecated use {@link Checksum}\n */\nexport interface Hash {\n  /**\n   * Adds a chunk of data to the hash. If a buffer is provided, the `encoding`\n   * argument will be ignored. If a string is provided without a specified\n   * encoding, implementations must assume UTF-8 encoding.\n   *\n   * Not all encodings are supported on all platforms, though all must support\n   * UTF-8.\n   */\n  update(toHash: SourceData, encoding?: \"utf8\" | \"ascii\" | \"latin1\"): void;\n\n  /**\n   * Finalizes the hash and provides a promise that will be fulfilled with the\n   * raw bytes of the calculated hash.\n   */\n  digest(): Promise<Uint8Array>;\n}\n\n/**\n * A constructor for a hash that may be used to calculate an HMAC. Implementing\n * classes should not directly hold the provided key in memory beyond the\n * lexical scope of the constructor.\n *\n * @public\n * @deprecated use {@link ChecksumConstructor}\n */\nexport interface HashConstructor {\n  new (secret?: SourceData): Hash;\n}\n\n/**\n * A function that calculates the hash of a data stream. Determining the hash\n * will consume the stream, so only replayable streams should be provided to an\n * implementation of this interface.\n *\n * @public\n */\nexport interface StreamHasher<StreamType = any> {\n  (hashCtor: HashConstructor, stream: StreamType): Promise<Uint8Array>;\n}\n\n/**\n * A function that returns a promise fulfilled with bytes from a\n * cryptographically secure pseudorandom number generator.\n *\n * @public\n */\nexport interface randomValues {\n  (byteLength: number): Promise<Uint8Array>;\n}\n"
  },
  {
    "path": "packages/types/src/downlevel-ts3.4/transform/type-transform.ts",
    "content": "/**\n * Transforms any members of the object T having type FromType\n * to ToType. This applies only to exact type matches.\n * This is for the case where FromType is a union and only those fields\n * matching the same union should be transformed.\n *\n * @public\n */\nexport type Transform<T, FromType, ToType> = RecursiveTransformExact<T, FromType, ToType>;\n\n/**\n * Returns ToType if T matches exactly with FromType.\n *\n * @internal\n */\ntype TransformExact<T, FromType, ToType> = [T] extends [FromType] ? ([FromType] extends [T] ? ToType : T) : T;\n\n/**\n * Applies TransformExact to members of an object recursively.\n *\n * @internal\n */\ntype RecursiveTransformExact<T, FromType, ToType> = T extends Function\n  ? T\n  : T extends object\n    ? {\n        [key in keyof T]: [T[key]] extends [FromType]\n          ? [FromType] extends [T[key]]\n            ? ToType\n            : RecursiveTransformExact<T[key], FromType, ToType>\n          : RecursiveTransformExact<T[key], FromType, ToType>;\n      }\n    : TransformExact<T, FromType, ToType>;\n"
  },
  {
    "path": "packages/types/src/encode.ts",
    "content": "import type { Message } from \"./eventStream\";\n\n/**\n * @public\n */\nexport interface MessageEncoder {\n  encode(message: Message): Uint8Array;\n}\n\n/**\n * @public\n */\nexport interface MessageDecoder {\n  decode(message: ArrayBufferView): Message;\n  feed(message: ArrayBufferView): void;\n  endOfStream(): void;\n  getMessage(): AvailableMessage;\n  getAvailableMessages(): AvailableMessages;\n}\n\n/**\n * @public\n */\nexport interface AvailableMessage {\n  getMessage(): Message | undefined;\n\n  isEndOfStream(): boolean;\n}\n\n/**\n * @public\n */\nexport interface AvailableMessages {\n  getMessages(): Message[];\n  isEndOfStream(): boolean;\n}\n"
  },
  {
    "path": "packages/types/src/endpoint.ts",
    "content": "import type { AuthScheme } from \"./auth/auth\";\n\n/**\n * @public\n */\nexport interface EndpointPartition {\n  name: string;\n  dnsSuffix: string;\n  dualStackDnsSuffix: string;\n  supportsFIPS: boolean;\n  supportsDualStack: boolean;\n}\n\n/**\n * @public\n */\nexport interface EndpointARN {\n  partition: string;\n  service: string;\n  region: string;\n  accountId: string;\n  resourceId: Array<string>;\n}\n\n/**\n * @public\n */\nexport enum EndpointURLScheme {\n  HTTP = \"http\",\n  HTTPS = \"https\",\n}\n\n/**\n * @public\n */\nexport interface EndpointURL {\n  /**\n   * The URL scheme such as http or https.\n   */\n  scheme: EndpointURLScheme;\n\n  /**\n   * The authority is the host and optional port component of the URL.\n   */\n  authority: string;\n\n  /**\n   * The parsed path segment of the URL.\n   * This value is as-is as provided by the user.\n   */\n  path: string;\n\n  /**\n   * The parsed path segment of the URL.\n   * This value is guranteed to start and end with a \"/\".\n   */\n  normalizedPath: string;\n\n  /**\n   * A boolean indicating whether the authority is an IP address.\n   */\n  isIp: boolean;\n}\n\n/**\n * @public\n */\nexport type EndpointObjectProperty =\n  | string\n  | boolean\n  | { [key: string]: EndpointObjectProperty }\n  | EndpointObjectProperty[];\n\n/**\n * @public\n */\nexport interface EndpointV2 {\n  url: URL;\n  properties?: {\n    authSchemes?: AuthScheme[];\n  } & Record<string, EndpointObjectProperty>;\n  headers?: Record<string, string[]>;\n}\n\n/**\n * @public\n */\nexport type EndpointParameters = { [name: string]: undefined | boolean | string | string[] };\n"
  },
  {
    "path": "packages/types/src/endpoints/EndpointRuleObject.ts",
    "content": "import type { EndpointObjectProperty } from \"../endpoint\";\nimport type { ConditionObject, Expression } from \"./shared\";\n\n/**\n * @public\n */\nexport type EndpointObjectProperties = Record<string, EndpointObjectProperty>;\n\n/**\n * @public\n */\nexport type EndpointObjectHeaders = Record<string, Expression[]>;\n\n/**\n * @public\n */\nexport type EndpointObject = {\n  url: Expression;\n  properties?: EndpointObjectProperties;\n  headers?: EndpointObjectHeaders;\n};\n\n/**\n * @public\n */\nexport type EndpointRuleObject = {\n  type: \"endpoint\";\n  conditions?: ConditionObject[];\n  endpoint: EndpointObject;\n  documentation?: string;\n};\n"
  },
  {
    "path": "packages/types/src/endpoints/ErrorRuleObject.ts",
    "content": "import type { ConditionObject, Expression } from \"./shared\";\n\n/**\n * @public\n */\nexport type ErrorRuleObject = {\n  type: \"error\";\n  conditions?: ConditionObject[];\n  error: Expression;\n  documentation?: string;\n};\n"
  },
  {
    "path": "packages/types/src/endpoints/RuleSetObject.ts",
    "content": "import type { RuleSetRules } from \"./TreeRuleObject\";\n\n/**\n * @public\n */\nexport type DeprecatedObject = {\n  message?: string;\n  since?: string;\n};\n\n/**\n * @public\n */\nexport type ParameterObject = {\n  type: \"String\" | \"string\" | \"Boolean\" | \"boolean\";\n  default?: string | boolean;\n  required?: boolean;\n  documentation?: string;\n  builtIn?: string;\n  deprecated?: DeprecatedObject;\n};\n\n/**\n * @public\n */\nexport type RuleSetObject = {\n  version: string;\n  serviceId?: string;\n  parameters: Record<string, ParameterObject>;\n  rules: RuleSetRules;\n};\n"
  },
  {
    "path": "packages/types/src/endpoints/TreeRuleObject.ts",
    "content": "import type { EndpointRuleObject } from \"./EndpointRuleObject\";\nimport type { ErrorRuleObject } from \"./ErrorRuleObject\";\nimport type { ConditionObject } from \"./shared\";\n\n/**\n * @public\n */\nexport type RuleSetRules = Array<EndpointRuleObject | ErrorRuleObject | TreeRuleObject>;\n\n/**\n * @public\n */\nexport type TreeRuleObject = {\n  type: \"tree\";\n  conditions?: ConditionObject[];\n  rules: RuleSetRules;\n  documentation?: string;\n};\n"
  },
  {
    "path": "packages/types/src/endpoints/index.ts",
    "content": "export * from \"./EndpointRuleObject\";\nexport * from \"./ErrorRuleObject\";\nexport * from \"./RuleSetObject\";\nexport * from \"./shared\";\nexport * from \"./TreeRuleObject\";\n"
  },
  {
    "path": "packages/types/src/endpoints/shared.ts",
    "content": "import type { Logger } from \"../logger\";\n\n/**\n * @public\n */\nexport type ReferenceObject = { ref: string };\n\n/**\n * @public\n */\nexport type FunctionObject = { fn: string; argv: FunctionArgv };\n/**\n * @public\n */\nexport type FunctionArgv = Array<Expression | boolean | number>;\n/**\n * @public\n */\nexport type FunctionReturn = string | boolean | number | { [key: string]: FunctionReturn };\n\n/**\n * @public\n */\nexport type ConditionObject = FunctionObject & { assign?: string };\n\n/**\n * @public\n */\nexport type Expression = string | ReferenceObject | FunctionObject;\n\n/**\n * @public\n */\nexport type EndpointParams = Record<string, string | boolean>;\n\n/**\n * @public\n */\nexport type EndpointResolverOptions = {\n  endpointParams: EndpointParams;\n  logger?: Logger;\n};\n\n/**\n * @public\n */\nexport type ReferenceRecord = Record<string, FunctionReturn>;\n\n/**\n * @public\n */\nexport type EvaluateOptions = EndpointResolverOptions & {\n  referenceRecord: ReferenceRecord;\n};\n"
  },
  {
    "path": "packages/types/src/eventStream.ts",
    "content": "import type { HttpRequest } from \"./http\";\nimport type {\n  FinalizeHandler,\n  FinalizeHandlerArguments,\n  FinalizeHandlerOutput,\n  HandlerExecutionContext,\n} from \"./middleware\";\nimport type { MetadataBearer } from \"./response\";\n\n/**\n * An event stream message. The headers and body properties will always be\n * defined, with empty headers represented as an object with no keys and an\n * empty body represented as a zero-length Uint8Array.\n *\n * @public\n */\nexport interface Message {\n  headers: MessageHeaders;\n  body: Uint8Array;\n}\n\n/**\n * @public\n */\nexport type MessageHeaders = Record<string, MessageHeaderValue>;\n\n/**\n * @public\n */\nexport type HeaderValue<K extends string, V> = { type: K; value: V };\n\n/**\n * @public\n */\nexport type BooleanHeaderValue = HeaderValue<\"boolean\", boolean>;\n/**\n * @public\n */\nexport type ByteHeaderValue = HeaderValue<\"byte\", number>;\n/**\n * @public\n */\nexport type ShortHeaderValue = HeaderValue<\"short\", number>;\n/**\n * @public\n */\nexport type IntegerHeaderValue = HeaderValue<\"integer\", number>;\n/**\n * @public\n */\nexport type LongHeaderValue = HeaderValue<\"long\", Int64>;\n/**\n * @public\n */\nexport type BinaryHeaderValue = HeaderValue<\"binary\", Uint8Array>;\n/**\n * @public\n */\nexport type StringHeaderValue = HeaderValue<\"string\", string>;\n/**\n * @public\n */\nexport type TimestampHeaderValue = HeaderValue<\"timestamp\", Date>;\n/**\n * @public\n */\nexport type UuidHeaderValue = HeaderValue<\"uuid\", string>;\n\n/**\n * @public\n */\nexport type MessageHeaderValue =\n  | BooleanHeaderValue\n  | ByteHeaderValue\n  | ShortHeaderValue\n  | IntegerHeaderValue\n  | LongHeaderValue\n  | BinaryHeaderValue\n  | StringHeaderValue\n  | TimestampHeaderValue\n  | UuidHeaderValue;\n\n/**\n * @public\n */\nexport interface Int64 {\n  readonly bytes: Uint8Array;\n  valueOf: () => number;\n  toString: () => string;\n}\n\n/**\n * Util functions for serializing or deserializing event stream\n *\n * @public\n */\nexport interface EventStreamSerdeContext {\n  eventStreamMarshaller: EventStreamMarshaller;\n}\n\n/**\n * A function which deserializes binary event stream message into modeled shape.\n *\n * @public\n */\nexport interface EventStreamMarshallerDeserFn<StreamType> {\n  <T>(body: StreamType, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T>;\n}\n\n/**\n * A function that serializes modeled shape into binary stream message.\n *\n * @public\n */\nexport interface EventStreamMarshallerSerFn<StreamType> {\n  <T>(input: AsyncIterable<T>, serializer: (event: T) => Message): StreamType;\n}\n\n/**\n * An interface which provides functions for serializing and deserializing binary event stream\n * to/from corresponsing modeled shape.\n *\n * @public\n */\nexport interface EventStreamMarshaller<StreamType = any> {\n  deserialize: EventStreamMarshallerDeserFn<StreamType>;\n  serialize: EventStreamMarshallerSerFn<StreamType>;\n}\n\n/**\n * @public\n */\nexport interface EventStreamRequestSigner {\n  sign(request: HttpRequest): Promise<HttpRequest>;\n}\n\n/**\n * @public\n */\nexport interface EventStreamPayloadHandler {\n  handle: <Input extends object, Output extends MetadataBearer>(\n    next: FinalizeHandler<Input, Output>,\n    args: FinalizeHandlerArguments<Input>,\n    context?: HandlerExecutionContext\n  ) => Promise<FinalizeHandlerOutput<Output>>;\n}\n\n/**\n * @public\n */\nexport interface EventStreamPayloadHandlerProvider {\n  (options: any): EventStreamPayloadHandler;\n}\n\n/**\n * @public\n */\nexport interface EventStreamSerdeProvider {\n  (options: any): EventStreamMarshaller;\n}\n\n/**\n * @public\n */\nexport interface EventStreamSignerProvider {\n  (options: any): EventStreamRequestSigner;\n}\n"
  },
  {
    "path": "packages/types/src/extensions/checksum.ts",
    "content": "import type { ChecksumConstructor } from \"../checksum\";\nimport type { HashConstructor } from \"../crypto\";\n\n/**\n * @internal\n */\nexport enum AlgorithmId {\n  MD5 = \"md5\",\n  CRC32 = \"crc32\",\n  CRC32C = \"crc32c\",\n  SHA1 = \"sha1\",\n  SHA256 = \"sha256\",\n}\n\n/**\n * @internal\n */\nexport interface ChecksumAlgorithm {\n  algorithmId(): AlgorithmId | string;\n  checksumConstructor(): ChecksumConstructor | HashConstructor;\n}\n\n/**\n * @deprecated unused.\n * @internal\n */\ntype ChecksumConfigurationLegacy = {\n  /**\n   * @deprecated unused.\n   */\n  [other in string | number]: any;\n};\n\n/**\n * @internal\n */\nexport interface ChecksumConfiguration extends ChecksumConfigurationLegacy {\n  addChecksumAlgorithm(algo: ChecksumAlgorithm): void;\n  checksumAlgorithms(): ChecksumAlgorithm[];\n}\n\n/**\n * @deprecated will be removed for implicit type.\n * @internal\n */\ntype GetChecksumConfigurationType = (\n  runtimeConfig: Partial<{\n    sha256: ChecksumConstructor | HashConstructor;\n    md5: ChecksumConstructor | HashConstructor;\n  }>\n) => ChecksumConfiguration;\n\n/**\n * @internal\n * @deprecated will be moved to smithy-client.\n */\nexport const getChecksumConfiguration: GetChecksumConfigurationType = (\n  runtimeConfig: Partial<{\n    sha256: ChecksumConstructor | HashConstructor;\n    md5: ChecksumConstructor | HashConstructor;\n  }>\n) => {\n  const checksumAlgorithms: ChecksumAlgorithm[] = [];\n\n  if (runtimeConfig.sha256 !== undefined) {\n    checksumAlgorithms.push({\n      algorithmId: () => AlgorithmId.SHA256,\n      checksumConstructor: () => runtimeConfig.sha256!,\n    });\n  }\n\n  if (runtimeConfig.md5 != undefined) {\n    checksumAlgorithms.push({\n      algorithmId: () => AlgorithmId.MD5,\n      checksumConstructor: () => runtimeConfig.md5!,\n    });\n  }\n\n  return {\n    addChecksumAlgorithm(algo: ChecksumAlgorithm): void {\n      checksumAlgorithms.push(algo);\n    },\n    checksumAlgorithms(): ChecksumAlgorithm[] {\n      return checksumAlgorithms;\n    },\n  };\n};\n\n/**\n * @internal\n * @deprecated will be removed for implicit type.\n */\ntype ResolveChecksumRuntimeConfigType = (clientConfig: ChecksumConfiguration) => any;\n\n/**\n * @internal\n *\n * @deprecated will be moved to smithy-client.\n */\nexport const resolveChecksumRuntimeConfig: ResolveChecksumRuntimeConfigType = (clientConfig: ChecksumConfiguration) => {\n  const runtimeConfig: any = {};\n\n  clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {\n    runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();\n  });\n\n  return runtimeConfig;\n};\n"
  },
  {
    "path": "packages/types/src/extensions/defaultClientConfiguration.ts",
    "content": "import { getChecksumConfiguration, resolveChecksumRuntimeConfig, type ChecksumConfiguration } from \"./checksum\";\n\n/**\n * Default client configuration consisting various configurations for modifying a service client\n *\n * @internal\n * @deprecated will be replaced by DefaultExtensionConfiguration.\n */\nexport interface DefaultClientConfiguration extends ChecksumConfiguration {}\n\n/**\n * @deprecated will be removed for implicit type.\n */\ntype GetDefaultConfigurationType = (runtimeConfig: any) => DefaultClientConfiguration;\n\n/**\n * Helper function to resolve default client configuration from runtime config\n *\n * @internal\n * @deprecated moving to @smithy/smithy-client.\n */\nexport const getDefaultClientConfiguration: GetDefaultConfigurationType = (runtimeConfig: any) => {\n  return getChecksumConfiguration(runtimeConfig);\n};\n\n/**\n * @deprecated will be removed for implicit type.\n */\ntype ResolveDefaultRuntimeConfigType = (clientConfig: DefaultClientConfiguration) => any;\n\n/**\n * Helper function to resolve runtime config from default client configuration\n *\n * @internal\n * @deprecated moving to @smithy/smithy-client.\n */\nexport const resolveDefaultRuntimeConfig: ResolveDefaultRuntimeConfigType = (config: DefaultClientConfiguration) => {\n  return resolveChecksumRuntimeConfig(config);\n};\n"
  },
  {
    "path": "packages/types/src/extensions/defaultExtensionConfiguration.ts",
    "content": "import type { ChecksumConfiguration } from \"./checksum\";\nimport type { RetryStrategyConfiguration } from \"./retry\";\n\n/**\n * Default extension configuration consisting various configurations for modifying a service client\n *\n * @internal\n */\nexport interface DefaultExtensionConfiguration extends ChecksumConfiguration, RetryStrategyConfiguration {}\n"
  },
  {
    "path": "packages/types/src/extensions/index.ts",
    "content": "export * from \"./defaultClientConfiguration\";\nexport * from \"./defaultExtensionConfiguration\";\nexport { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration } from \"./checksum\";\nexport { RetryStrategyConfiguration } from \"./retry\";\n"
  },
  {
    "path": "packages/types/src/extensions/retry.ts",
    "content": "import type { RetryStrategyV2 } from \"../retry\";\nimport type { Provider, RetryStrategy } from \"../util\";\n\n/**\n * A configuration interface with methods called by runtime extension\n * @internal\n */\nexport interface RetryStrategyConfiguration {\n  /**\n   * Set retry strategy used for all http requests\n   * @param retryStrategy\n   */\n  setRetryStrategy(retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>): void;\n\n  /**\n   * Get retry strategy used for all http requests\n   * @param retryStrategy\n   */\n  retryStrategy(): Provider<RetryStrategyV2 | RetryStrategy>;\n}\n"
  },
  {
    "path": "packages/types/src/externals-check/browser-externals-check.ts",
    "content": "import type { Exact } from \"../transform/exact\";\n\n/**\n * A checked type that resolves to Blob if it is defined as more than a stub, otherwise\n * resolves to 'never' so as not to widen the type of unions containing Blob\n * excessively.\n *\n * @public\n */\nexport type BlobOptionalType = BlobDefined extends true ? Blob : Unavailable;\n\n/**\n * A checked type that resolves to ReadableStream if it is defined as more than a stub, otherwise\n * resolves to 'never' so as not to widen the type of unions containing ReadableStream\n * excessively.\n *\n * @public\n */\nexport type ReadableStreamOptionalType = ReadableStreamDefined extends true ? ReadableStream : Unavailable;\n\n/**\n * Indicates a type is unavailable if it resolves to this.\n *\n * @public\n */\nexport type Unavailable = never;\n\n/**\n * Whether the global types define more than a stub for ReadableStream.\n *\n * @internal\n */\nexport type ReadableStreamDefined = Exact<ReadableStream, {}> extends true ? false : true;\n\n/**\n * Whether the global types define more than a stub for Blob.\n *\n * @internal\n */\nexport type BlobDefined = Exact<Blob, {}> extends true ? false : true;\n"
  },
  {
    "path": "packages/types/src/feature-ids.ts",
    "content": "/**\n * @internal\n */\nexport type SmithyFeatures = Partial<{\n  RESOURCE_MODEL: \"A\";\n  WAITER: \"B\";\n  PAGINATOR: \"C\";\n  RETRY_MODE_LEGACY: \"D\";\n  RETRY_MODE_STANDARD: \"E\";\n  RETRY_MODE_ADAPTIVE: \"F\";\n  GZIP_REQUEST_COMPRESSION: \"L\";\n  PROTOCOL_RPC_V2_CBOR: \"M\";\n  ENDPOINT_OVERRIDE: \"N\";\n  SIGV4A_SIGNING: \"S\";\n  CREDENTIALS_CODE: \"e\";\n}>;\n"
  },
  {
    "path": "packages/types/src/http/httpHandlerInitialization.ts",
    "content": "import type { Agent as hAgent, AgentOptions as hAgentOptions } from \"node:http\";\nimport type { Agent as hsAgent, AgentOptions as hsAgentOptions } from \"node:https\";\n\nimport type { HttpRequest as IHttpRequest } from \"../http\";\nimport type { Logger } from \"../logger\";\n\n/**\n *\n * This type represents an alternate client constructor option for the entry\n * \"requestHandler\". Instead of providing an instance of a requestHandler, the user\n * may provide the requestHandler's constructor options for either the\n * NodeHttpHandler or FetchHttpHandler.\n *\n * For other RequestHandlers like HTTP2 or WebSocket,\n * constructor parameter passthrough is not currently available.\n *\n * @public\n */\nexport type RequestHandlerParams = NodeHttpHandlerOptions | FetchHttpHandlerOptions;\n\n/**\n * Represents the http options that can be passed to a node http client.\n * @public\n */\nexport interface NodeHttpHandlerOptions {\n  /**\n   * The maximum time in milliseconds that the connection phase of a request\n   * may take before the connection attempt is abandoned.\n   * Defaults to 0, which disables the timeout.\n   */\n  connectionTimeout?: number;\n\n  /**\n   * The maximum number of milliseconds request & response should take.\n   * Defaults to 0, which disables the timeout.\n   *\n   * If exceeded, a warning will be emitted unless throwOnRequestTimeout=true,\n   * in which case a TimeoutError will be thrown.\n   */\n  requestTimeout?: number;\n\n  /**\n   * Because requestTimeout was for a long time incorrectly being set as a socket idle timeout,\n   * users must also opt-in for request timeout thrown errors.\n   * Without this setting, a breach of the request timeout will be logged as a warning.\n   */\n  throwOnRequestTimeout?: boolean;\n\n  /**\n   * The maximum time in milliseconds that a socket may remain idle before it\n   * is closed. Defaults to 0, which means no maximum.\n   *\n   * This does not affect the server, which may still close the connection due to an idle socket.\n   */\n  socketTimeout?: number;\n\n  /**\n   * Delay before the NodeHttpHandler checks for socket exhaustion,\n   * and emits a warning if the active sockets and enqueued request count is greater than\n   * 2x the maxSockets count.\n   *\n   * Defaults to connectionTimeout + requestTimeout or 3000ms if those are not set.\n   */\n  socketAcquisitionWarningTimeout?: number;\n\n  /**\n   * You can pass http.Agent or its constructor options.\n   */\n  httpAgent?: hAgent | hAgentOptions;\n\n  /**\n   * You can pass https.Agent or its constructor options.\n   */\n  httpsAgent?: hsAgent | hsAgentOptions;\n\n  /**\n   * Optional logger.\n   */\n  logger?: Logger;\n}\n\n/**\n * Represents the http options that can be passed to a browser http client.\n * @public\n */\nexport interface FetchHttpHandlerOptions {\n  /**\n   * The number of milliseconds a request can take before being automatically\n   * terminated.\n   */\n  requestTimeout?: number;\n\n  /**\n   * Whether to allow the request to outlive the page. Default value is false.\n   *\n   * There may be limitations to the payload size, number of concurrent requests,\n   * request duration etc. when using keepalive in browsers.\n   *\n   * These may change over time, so look for up to date information about\n   * these limitations before enabling keepalive.\n   */\n  keepAlive?: boolean;\n\n  /**\n   * A string indicating whether credentials will be sent with the request always, never, or\n   * only when sent to a same-origin URL.\n   * @see https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials\n   */\n  credentials?: \"include\" | \"omit\" | \"same-origin\" | undefined | string;\n\n  /**\n   * Cache settings for fetch.\n   * @see https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n   */\n  cache?: \"default\" | \"force-cache\" | \"no-cache\" | \"no-store\" | \"only-if-cached\" | \"reload\";\n\n  /**\n   * An optional function that produces additional RequestInit\n   * parameters for each httpRequest.\n   *\n   * This is applied last via merging with Object.assign() and overwrites other values\n   * set from other sources.\n   *\n   * @example\n   * ```js\n   * new Client({\n   *   requestHandler: {\n   *     requestInit(httpRequest) {\n   *       return { cache: \"no-store\" };\n   *     }\n   *   }\n   * });\n   * ```\n   */\n  requestInit?: (httpRequest: IHttpRequest) => RequestInit;\n}\n\ndeclare global {\n  /**\n   * interface merging stub.\n   */\n  interface RequestInit {}\n}\n"
  },
  {
    "path": "packages/types/src/http.ts",
    "content": "import type { AbortSignal as DeprecatedAbortSignal } from \"./abort\";\nimport type { URI } from \"./uri\";\n\n/**\n * @public\n *\n * @deprecated use {@link EndpointV2} from `@smithy/types`.\n */\nexport interface Endpoint {\n  protocol: string;\n  hostname: string;\n  port?: number;\n  path: string;\n  query?: QueryParameterBag;\n  headers?: HeaderBag;\n}\n\n/**\n * Interface an HTTP request class. Contains\n * addressing information in addition to standard message properties.\n *\n * @public\n */\nexport interface HttpRequest extends HttpMessage, URI {\n  method: string;\n}\n\n/**\n * Represents an HTTP message as received in reply to a request. Contains a\n * numeric status code in addition to standard message properties.\n *\n * @public\n */\nexport interface HttpResponse extends HttpMessage {\n  statusCode: number;\n  reason?: string;\n}\n\n/**\n * Represents an HTTP message with headers and an optional static or streaming\n * body. body: ArrayBuffer | ArrayBufferView | string | Uint8Array | Readable | ReadableStream;\n *\n * @public\n */\nexport interface HttpMessage {\n  headers: HeaderBag;\n  body?: any;\n}\n\n/**\n * A mapping of query parameter names to strings or arrays of strings, with the\n * second being used when a parameter contains a list of values. Value can be set\n * to null when query is not in key-value pairs shape\n *\n * @public\n */\nexport type QueryParameterBag = Record<string, string | Array<string> | null>;\n\n/**\n * @public\n */\nexport type FieldOptions = {\n  name: string;\n  kind?: FieldPosition;\n  values?: string[];\n};\n\n/**\n * @public\n */\nexport enum FieldPosition {\n  HEADER,\n  TRAILER,\n}\n\n/**\n * A mapping of header names to string values. Multiple values for the same\n * header should be represented as a single string with values separated by\n * `, `.\n * Keys should be considered case insensitive, even if this is not enforced by a\n * particular implementation. For example, given the following HeaderBag, where\n * keys differ only in case:\n * ```json\n * {\n * 'x-request-date': '2000-01-01T00:00:00Z',\n * 'X-Request-Date': '2001-01-01T00:00:00Z'\n * }\n * ```\n * The SDK may at any point during processing remove one of the object\n * properties in favor of the other. The headers may or may not be combined, and\n * the SDK will not deterministically select which header candidate to use.\n *\n * @public\n */\nexport type HeaderBag = Record<string, string>;\n\n/**\n * Represents an HTTP message with headers and an optional static or streaming\n * body. bode: ArrayBuffer | ArrayBufferView | string | Uint8Array | Readable | ReadableStream;\n *\n * @public\n */\nexport interface HttpMessage {\n  headers: HeaderBag;\n  body?: any;\n}\n\n/**\n * Represents the options that may be passed to an Http Handler.\n *\n * @public\n */\nexport interface HttpHandlerOptions {\n  abortSignal?: AbortSignal | DeprecatedAbortSignal;\n\n  /**\n   * The maximum time in milliseconds that the connection phase of a request\n   * may take before the connection attempt is abandoned.\n   */\n  requestTimeout?: number;\n}\n"
  },
  {
    "path": "packages/types/src/identity/apiKeyIdentity.ts",
    "content": "import type { Identity, IdentityProvider } from \"../identity/identity\";\n\n/**\n * @public\n */\nexport interface ApiKeyIdentity extends Identity {\n  /**\n   * The literal API Key\n   */\n  readonly apiKey: string;\n}\n\n/**\n * @public\n */\nexport type ApiKeyIdentityProvider = IdentityProvider<ApiKeyIdentity>;\n"
  },
  {
    "path": "packages/types/src/identity/awsCredentialIdentity.ts",
    "content": "import type { Identity, IdentityProvider } from \"./identity\";\n\n/**\n * @public\n */\nexport interface AwsCredentialIdentity extends Identity {\n  /**\n   * AWS access key ID\n   */\n  readonly accessKeyId: string;\n\n  /**\n   * AWS secret access key\n   */\n  readonly secretAccessKey: string;\n\n  /**\n   * A security or session token to use with these credentials. Usually\n   * present for temporary credentials.\n   */\n  readonly sessionToken?: string;\n\n  /**\n   * AWS credential scope for this set of credentials.\n   */\n  readonly credentialScope?: string;\n\n  /**\n   * AWS accountId.\n   */\n  readonly accountId?: string;\n}\n\n/**\n * @public\n */\nexport type AwsCredentialIdentityProvider = IdentityProvider<AwsCredentialIdentity>;\n"
  },
  {
    "path": "packages/types/src/identity/identity.ts",
    "content": "/**\n * @public\n */\nexport interface Identity {\n  /**\n   * A `Date` when the identity or credential will no longer be accepted.\n   */\n  readonly expiration?: Date;\n}\n\n/**\n * @public\n */\nexport interface IdentityProvider<IdentityT extends Identity> {\n  (identityProperties?: Record<string, any>): Promise<IdentityT>;\n}\n"
  },
  {
    "path": "packages/types/src/identity/index.ts",
    "content": "export * from \"./apiKeyIdentity\";\nexport * from \"./awsCredentialIdentity\";\nexport * from \"./identity\";\nexport * from \"./tokenIdentity\";\n"
  },
  {
    "path": "packages/types/src/identity/tokenIdentity.ts",
    "content": "import type { Identity, IdentityProvider } from \"../identity/identity\";\n\n/**\n * @internal\n */\nexport interface TokenIdentity extends Identity {\n  /**\n   * The literal token string\n   */\n  readonly token: string;\n}\n\n/**\n * @internal\n */\nexport type TokenIdentityProvider = IdentityProvider<TokenIdentity>;\n"
  },
  {
    "path": "packages/types/src/index.ts",
    "content": "export * from \"./abort\";\nexport * from \"./auth\";\nexport * from \"./blob/blob-payload-input-types\";\nexport * from \"./checksum\";\nexport * from \"./client\";\nexport * from \"./command\";\nexport * from \"./connection\";\nexport * from \"./crypto\";\nexport * from \"./encode\";\nexport * from \"./endpoint\";\nexport * from \"./endpoints\";\nexport * from \"./eventStream\";\nexport * from \"./extensions\";\nexport * from \"./feature-ids\";\nexport * from \"./http\";\nexport * from \"./http/httpHandlerInitialization\";\nexport * from \"./identity\";\nexport * from \"./logger\";\nexport * from \"./middleware\";\nexport * from \"./pagination\";\nexport * from \"./profile\";\nexport * from \"./response\";\nexport * from \"./retry\";\nexport * from \"./schema/schema\";\nexport * from \"./schema/traits\";\nexport * from \"./schema/schema-deprecated\";\nexport * from \"./schema/sentinels\";\nexport * from \"./schema/static-schemas\";\nexport * from \"./serde\";\nexport * from \"./shapes\";\nexport * from \"./signature\";\nexport * from \"./stream\";\nexport * from \"./streaming-payload/streaming-blob-common-types\";\nexport * from \"./streaming-payload/streaming-blob-payload-input-types\";\nexport * from \"./streaming-payload/streaming-blob-payload-output-types\";\nexport * from \"./transfer\";\nexport * from \"./transform/client-payload-blob-type-narrow\";\nexport * from \"./transform/mutable\";\nexport * from \"./transform/no-undefined\";\nexport * from \"./transform/type-transform\";\nexport * from \"./uri\";\nexport * from \"./util\";\nexport * from \"./waiter\";\n"
  },
  {
    "path": "packages/types/src/logger.ts",
    "content": "/**\n * Represents a logger object that is available in HandlerExecutionContext\n * throughout the middleware stack.\n *\n * @public\n */\nexport interface Logger {\n  trace?: (...content: any[]) => void;\n  debug: (...content: any[]) => void;\n  info: (...content: any[]) => void;\n  warn: (...content: any[]) => void;\n  error: (...content: any[]) => void;\n}\n"
  },
  {
    "path": "packages/types/src/middleware.ts",
    "content": "import type { SelectedHttpAuthScheme } from \"./auth/HttpAuthScheme\";\nimport type { AuthScheme, HttpAuthDefinition } from \"./auth/auth\";\nimport type { Command } from \"./command\";\nimport type { EndpointV2 } from \"./endpoint\";\nimport type { SmithyFeatures } from \"./feature-ids\";\nimport type { Logger } from \"./logger\";\nimport type { UserAgent } from \"./util\";\n\n/**\n * @public\n */\nexport interface InitializeHandlerArguments<Input extends object> {\n  /**\n   * User input to a command. Reflects the userland representation of the\n   * union of data types the command can effectively handle.\n   */\n  input: Input;\n}\n\n/**\n * @public\n */\nexport interface InitializeHandlerOutput<Output extends object> extends DeserializeHandlerOutput<Output> {\n  output: Output;\n}\n\n/**\n * @public\n */\nexport interface SerializeHandlerArguments<Input extends object> extends InitializeHandlerArguments<Input> {\n  /**\n   * The user input serialized as a request object. The request object is unknown,\n   * so you cannot modify it directly. When work with request, you need to guard its\n   * type to e.g. HttpRequest with 'instanceof' operand\n   *\n   * During the build phase of the execution of a middleware stack, a built\n   * request may or may not be available.\n   */\n  request?: unknown;\n}\n\n/**\n * @public\n */\nexport interface SerializeHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}\n\n/**\n * @public\n */\nexport interface BuildHandlerArguments<Input extends object> extends FinalizeHandlerArguments<Input> {}\n\n/**\n * @public\n */\nexport interface BuildHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}\n\n/**\n * @public\n */\nexport interface FinalizeHandlerArguments<Input extends object> extends SerializeHandlerArguments<Input> {\n  /**\n   * The user input serialized as a request.\n   */\n  request: unknown;\n}\n\n/**\n * @public\n */\nexport interface FinalizeHandlerOutput<Output extends object> extends InitializeHandlerOutput<Output> {}\n\n/**\n * @public\n */\nexport interface DeserializeHandlerArguments<Input extends object> extends FinalizeHandlerArguments<Input> {}\n\n/**\n * @public\n */\nexport interface DeserializeHandlerOutput<Output extends object> {\n  /**\n   * The raw response object from runtime is deserialized to structured output object.\n   * The response object is unknown so you cannot modify it directly. When work with\n   * response, you need to guard its type to e.g. HttpResponse with 'instanceof' operand.\n   *\n   * During the deserialize phase of the execution of a middleware stack, a deserialized\n   * response may or may not be available\n   */\n  response: unknown;\n  output?: Output;\n}\n\n/**\n * @public\n */\nexport interface InitializeHandler<Input extends object, Output extends object> {\n  /**\n   * Asynchronously converts an input object into an output object.\n   *\n   * @param args - An object containing a input to the command as well as any\n   *              associated or previously generated execution artifacts.\n   */\n  (args: InitializeHandlerArguments<Input>): Promise<InitializeHandlerOutput<Output>>;\n}\n\n/**\n * @public\n */\nexport type Handler<Input extends object, Output extends object> = InitializeHandler<Input, Output>;\n\n/**\n * @public\n */\nexport interface SerializeHandler<Input extends object, Output extends object> {\n  /**\n   * Asynchronously converts an input object into an output object.\n   *\n   * @param args - An object containing a input to the command as well as any\n   *              associated or previously generated execution artifacts.\n   */\n  (args: SerializeHandlerArguments<Input>): Promise<SerializeHandlerOutput<Output>>;\n}\n\n/**\n * @public\n */\nexport interface FinalizeHandler<Input extends object, Output extends object> {\n  /**\n   * Asynchronously converts an input object into an output object.\n   *\n   * @param args - An object containing a input to the command as well as any\n   *              associated or previously generated execution artifacts.\n   */\n  (args: FinalizeHandlerArguments<Input>): Promise<FinalizeHandlerOutput<Output>>;\n}\n\n/**\n * @public\n */\nexport interface BuildHandler<Input extends object, Output extends object> {\n  (args: BuildHandlerArguments<Input>): Promise<BuildHandlerOutput<Output>>;\n}\n\n/**\n * @public\n */\nexport interface DeserializeHandler<Input extends object, Output extends object> {\n  (args: DeserializeHandlerArguments<Input>): Promise<DeserializeHandlerOutput<Output>>;\n}\n\n/**\n * A factory function that creates functions implementing the `Handler`\n * interface.\n *\n * @public\n */\nexport interface InitializeMiddleware<Input extends object, Output extends object> {\n  /**\n   * @param next - The handler to invoke after this middleware has operated on\n   * the user input and before this middleware operates on the output.\n   *\n   * @param context - Invariant data and functions for use by the handler.\n   */\n  (next: InitializeHandler<Input, Output>, context: HandlerExecutionContext): InitializeHandler<Input, Output>;\n}\n\n/**\n * A factory function that creates functions implementing the `BuildHandler`\n * interface.\n *\n * @public\n */\nexport interface SerializeMiddleware<Input extends object, Output extends object> {\n  /**\n   * @param next - The handler to invoke after this middleware has operated on\n   * the user input and before this middleware operates on the output.\n   *\n   * @param context - Invariant data and functions for use by the handler.\n   */\n  (next: SerializeHandler<Input, Output>, context: HandlerExecutionContext): SerializeHandler<Input, Output>;\n}\n\n/**\n * A factory function that creates functions implementing the `FinalizeHandler`\n * interface.\n *\n * @public\n */\nexport interface FinalizeRequestMiddleware<Input extends object, Output extends object> {\n  /**\n   * @param next - The handler to invoke after this middleware has operated on\n   * the user input and before this middleware operates on the output.\n   *\n   * @param context - Invariant data and functions for use by the handler.\n   */\n  (next: FinalizeHandler<Input, Output>, context: HandlerExecutionContext): FinalizeHandler<Input, Output>;\n}\n\n/**\n * @public\n */\nexport interface BuildMiddleware<Input extends object, Output extends object> {\n  (next: BuildHandler<Input, Output>, context: HandlerExecutionContext): BuildHandler<Input, Output>;\n}\n\n/**\n * @public\n */\nexport interface DeserializeMiddleware<Input extends object, Output extends object> {\n  (next: DeserializeHandler<Input, Output>, context: HandlerExecutionContext): DeserializeHandler<Input, Output>;\n}\n\n/**\n * @public\n */\nexport type MiddlewareType<Input extends object, Output extends object> =\n  | InitializeMiddleware<Input, Output>\n  | SerializeMiddleware<Input, Output>\n  | BuildMiddleware<Input, Output>\n  | FinalizeRequestMiddleware<Input, Output>\n  | DeserializeMiddleware<Input, Output>;\n\n/**\n * A factory function that creates the terminal handler atop which a middleware\n * stack sits.\n *\n * @public\n */\nexport interface Terminalware {\n  <Input extends object, Output extends object>(context: HandlerExecutionContext): DeserializeHandler<Input, Output>;\n}\n\n/**\n * @public\n */\nexport type Step = \"initialize\" | \"serialize\" | \"build\" | \"finalizeRequest\" | \"deserialize\";\n\n/**\n * @public\n */\nexport type Priority = \"high\" | \"normal\" | \"low\";\n\n/**\n * @public\n */\nexport interface HandlerOptions {\n  /**\n   * Handlers are ordered using a \"step\" that describes the stage of command\n   * execution at which the handler will be executed. The available steps are:\n   *\n   * - initialize: The input is being prepared. Examples of typical\n   *      initialization tasks include injecting default options computing\n   *      derived parameters.\n   * - serialize: The input is complete and ready to be serialized. Examples\n   *      of typical serialization tasks include input validation and building\n   *      an HTTP request from user input.\n   * - build: The input has been serialized into an HTTP request, but that\n   *      request may require further modification. Any request alterations\n   *      will be applied to all retries. Examples of typical build tasks\n   *      include injecting HTTP headers that describe a stable aspect of the\n   *      request, such as `Content-Length` or a body checksum.\n   * - finalizeRequest: The request is being prepared to be sent over the wire. The\n   *      request in this stage should already be semantically complete and\n   *      should therefore only be altered as match the recipient's\n   *      expectations. Examples of typical finalization tasks include request\n   *      signing and injecting hop-by-hop headers.\n   * - deserialize: The response has arrived, the middleware here will deserialize\n   *      the raw response object to structured response\n   *\n   *      Unlike initialization and build handlers, which are executed once\n   *      per operation execution, finalization and deserialize handlers will be\n   *      executed foreach HTTP request sent.\n   *\n   * @defaultValue 'initialize'\n   */\n  step?: Step;\n\n  /**\n   * A list of strings to any that identify the general purpose or important\n   * characteristics of a given handler.\n   */\n  tags?: Array<string>;\n\n  /**\n   * A unique name to refer to a middleware\n   */\n  name?: string;\n\n  /**\n   * Aliases allows for middleware to be found by multiple names besides {@link HandlerOptions.name}.\n   * This allows for references to replaced middleware to continue working, e.g. replacing\n   * multiple auth-specific middleware with a single generic auth middleware.\n   *\n   * @internal\n   */\n  aliases?: Array<string>;\n\n  /**\n   * A flag to override the existing middleware with the same name. Without\n   * setting it, adding middleware with duplicated name will throw an exception.\n   * @internal\n   */\n  override?: boolean;\n}\n/**\n * @public\n */\nexport interface AbsoluteLocation {\n  /**\n   * By default middleware will be added to individual step in un-guaranteed order.\n   * In the case that\n   *\n   * @defaultValue 'normal'\n   */\n  priority?: Priority;\n}\n\n/**\n * @public\n */\nexport type Relation = \"before\" | \"after\";\n\n/**\n * @public\n */\nexport interface RelativeLocation {\n  /**\n   * Specify the relation to be before or after a know middleware.\n   */\n  relation: Relation;\n\n  /**\n   * A known middleware name to indicate inserting middleware's location.\n   */\n  toMiddleware: string;\n}\n\n/**\n * @public\n */\nexport type RelativeMiddlewareOptions = RelativeLocation & Omit<HandlerOptions, \"step\">;\n\n/**\n * @public\n */\nexport interface InitializeHandlerOptions extends HandlerOptions {\n  step?: \"initialize\";\n}\n\n/**\n * @public\n */\nexport interface SerializeHandlerOptions extends HandlerOptions {\n  step: \"serialize\";\n}\n\n/**\n * @public\n */\nexport interface BuildHandlerOptions extends HandlerOptions {\n  step: \"build\";\n}\n\n/**\n * @public\n */\nexport interface FinalizeRequestHandlerOptions extends HandlerOptions {\n  step: \"finalizeRequest\";\n}\n\n/**\n * @public\n */\nexport interface DeserializeHandlerOptions extends HandlerOptions {\n  step: \"deserialize\";\n}\n\n/**\n * A stack storing middleware. It can be resolved into a handler. It supports 2\n * approaches for adding middleware:\n * 1. Adding middleware to specific step with `add()`. The order of middleware\n * added into same step is determined by order of adding them. If one middleware\n * needs to be executed at the front of the step or at the end of step, set\n * `priority` options to `high` or `low`.\n * 2. Adding middleware to location relative to known middleware with `addRelativeTo()`.\n * This is useful when given middleware must be executed before or after specific\n * middleware(`toMiddleware`). You can add a middleware relatively to another\n * middleware which also added relatively. But eventually, this relative middleware\n * chain **must** be 'anchored' by a middleware that added using `add()` API\n * with absolute `step` and `priority`. This mothod will throw if specified\n * `toMiddleware` is not found.\n *\n * @public\n */\nexport interface MiddlewareStack<Input extends object, Output extends object> extends Pluggable<Input, Output> {\n  /**\n   * Add middleware to the stack to be executed during the \"initialize\" step,\n   * optionally specifying a priority, tags and name\n   */\n  add(middleware: InitializeMiddleware<Input, Output>, options?: InitializeHandlerOptions & AbsoluteLocation): void;\n\n  /**\n   * Add middleware to the stack to be executed during the \"serialize\" step,\n   * optionally specifying a priority, tags and name\n   */\n  add(middleware: SerializeMiddleware<Input, Output>, options: SerializeHandlerOptions & AbsoluteLocation): void;\n\n  /**\n   * Add middleware to the stack to be executed during the \"build\" step,\n   * optionally specifying a priority, tags and name\n   */\n  add(middleware: BuildMiddleware<Input, Output>, options: BuildHandlerOptions & AbsoluteLocation): void;\n\n  /**\n   * Add middleware to the stack to be executed during the \"finalizeRequest\" step,\n   * optionally specifying a priority, tags and name\n   */\n  add(\n    middleware: FinalizeRequestMiddleware<Input, Output>,\n    options: FinalizeRequestHandlerOptions & AbsoluteLocation\n  ): void;\n\n  /**\n   * Add middleware to the stack to be executed during the \"deserialize\" step,\n   * optionally specifying a priority, tags and name\n   */\n  add(middleware: DeserializeMiddleware<Input, Output>, options: DeserializeHandlerOptions & AbsoluteLocation): void;\n\n  /**\n   * Add middleware to a stack position before or after a known middleware，optionally\n   * specifying name and tags.\n   */\n  addRelativeTo(middleware: MiddlewareType<Input, Output>, options: RelativeMiddlewareOptions): void;\n\n  /**\n   * Apply a customization function to mutate the middleware stack, often\n   * used for customizations that requires mutating multiple middleware.\n   */\n  use(pluggable: Pluggable<Input, Output>): void;\n\n  /**\n   * Create a shallow clone of this stack. Step bindings and handler priorities\n   * and tags are preserved in the copy.\n   */\n  clone(): MiddlewareStack<Input, Output>;\n\n  /**\n   * Removes middleware from the stack.\n   *\n   * If a string is provided, it will be treated as middleware name. If a middleware\n   * is inserted with the given name, it will be removed.\n   *\n   * If a middleware class is provided, all usages thereof will be removed.\n   */\n  remove(toRemove: MiddlewareType<Input, Output> | string): boolean;\n\n  /**\n   * Removes middleware that contains given tag\n   *\n   * Multiple middleware will potentially be removed\n   */\n  removeByTag(toRemove: string): boolean;\n\n  /**\n   * Create a stack containing the middlewares in this stack as well as the\n   * middlewares in the `from` stack. Neither source is modified, and step\n   * bindings and handler priorities and tags are preserved in the copy.\n   */\n  concat<InputType extends Input, OutputType extends Output>(\n    from: MiddlewareStack<InputType, OutputType>\n  ): MiddlewareStack<InputType, OutputType>;\n\n  /**\n   * Returns a list of the current order of middleware in the stack.\n   * This does not execute the middleware functions, nor does it\n   * provide a reference to the stack itself.\n   */\n  identify(): string[];\n\n  /**\n   * When an operation is called using this stack,\n   * it will log its list of middleware to the console using\n   * the identify function.\n   * If no argument given, returns the current value.\n   *\n   * @internal\n   * @param toggle - set whether to log on resolve.\n   */\n  identifyOnResolve(toggle?: boolean): boolean;\n\n  /**\n   * Builds a single handler function from zero or more middleware classes and\n   * a core handler. The core handler is meant to send command objects to AWS\n   * services and return promises that will resolve with the operation result\n   * or be rejected with an error.\n   *\n   * When a composed handler is invoked, the arguments will pass through all\n   * middleware in a defined order, and the return from the innermost handler\n   * will pass through all middleware in the reverse of that order.\n   */\n  resolve<InputType extends Input, OutputType extends Output>(\n    handler: DeserializeHandler<InputType, OutputType>,\n    context: HandlerExecutionContext\n  ): InitializeHandler<InputType, OutputType>;\n}\n\n/**\n * @internal\n */\nexport const SMITHY_CONTEXT_KEY = \"__smithy_context\";\n\n/**\n * Data and helper objects that are not expected to change from one execution of\n * a composed handler to another.\n *\n * @public\n */\nexport interface HandlerExecutionContext {\n  /**\n   * A logger that may be invoked by any handler during execution of an\n   * operation.\n   */\n  logger?: Logger;\n\n  /**\n   * Name of the service the operation is being sent to.\n   */\n  clientName?: string;\n\n  /**\n   * Name of the operation being executed.\n   */\n  commandName?: string;\n\n  /**\n   * Additional user agent that inferred by middleware. It can be used to save\n   * the internal user agent sections without overriding the `customUserAgent`\n   * config in clients.\n   */\n  userAgent?: UserAgent;\n\n  /**\n   * Resolved by the endpointMiddleware function of `@smithy/middleware-endpoint`\n   * in the serialization stage.\n   */\n  endpointV2?: EndpointV2;\n\n  /**\n   * Set at the same time as endpointV2.\n   */\n  authSchemes?: AuthScheme[];\n\n  /**\n   * The current auth configuration that has been set by any auth middleware and\n   * that will prevent from being set more than once.\n   */\n  currentAuthConfig?: HttpAuthDefinition;\n\n  /**\n   * @deprecated do not extend this field, it is a carryover from AWS SDKs.\n   * Used by DynamoDbDocumentClient.\n   */\n  dynamoDbDocumentClientOptions?: Partial<{\n    overrideInputFilterSensitiveLog(...args: any[]): string | void;\n    overrideOutputFilterSensitiveLog(...args: any[]): string | void;\n  }>;\n\n  /**\n   * Context for Smithy properties.\n   *\n   * @internal\n   */\n  [SMITHY_CONTEXT_KEY]?: {\n    service?: string;\n    operation?: string;\n    commandInstance?: Command<any, any, any, any, any>;\n    selectedHttpAuthScheme?: SelectedHttpAuthScheme;\n    features?: SmithyFeatures;\n    /**\n     * @deprecated\n     * Do not assign arbitrary members to the Smithy Context,\n     * fields should be explicitly declared here to avoid collisions.\n     */\n    [key: string]: unknown;\n  };\n\n  /**\n   * Set by some operations which instructs the retry behavior to backoff\n   * after a failed request even when no further retry (of the same request) is expected.\n   * @internal\n   */\n  __retryLongPoll?: boolean;\n\n  /**\n   * @deprecated\n   * Do not assign arbitrary members to the context, since\n   * they can interfere with existing functionality.\n   *\n   * Additional members should instead be declared on the SMITHY_CONTEXT_KEY\n   * or other reserved keys.\n   */\n  [key: string]: any;\n}\n\n/**\n * @public\n */\nexport interface Pluggable<Input extends object, Output extends object> {\n  /**\n   * A function that mutate the passed in middleware stack. Functions implementing\n   * this interface can add, remove, modify existing middleware stack from clients\n   * or commands\n   */\n  applyToStack: (stack: MiddlewareStack<Input, Output>) => void;\n}\n"
  },
  {
    "path": "packages/types/src/pagination.ts",
    "content": "import type { Client } from \"./client\";\nimport type { Command } from \"./command\";\n\n/**\n * Expected type definition of a paginator.\n *\n * @public\n */\nexport type Paginator<T> = AsyncGenerator<T, undefined, unknown>;\n\n/**\n * Expected paginator configuration passed to an operation. Services will extend\n * this interface definition and may type client further.\n *\n * @public\n */\nexport interface PaginationConfiguration {\n  client: Client<any, any, any>;\n  pageSize?: number;\n  startingToken?: any;\n  /**\n   * For some APIs, such as CloudWatchLogs events, the next page token will always\n   * be present.\n   *\n   * When true, this config field will have the paginator stop when the token doesn't change\n   * instead of when it is not present.\n   */\n  stopOnSameToken?: boolean;\n  /**\n   * @param command - reference to the instantiated command. This callback is executed\n   *                  prior to sending the command with the paginator's client.\n   * @returns the original command or a replacement, defaulting to the original command object.\n   */\n  withCommand?: (command: Command<any, any, any, any, any>) => typeof command | undefined;\n}\n"
  },
  {
    "path": "packages/types/src/profile.ts",
    "content": "/**\n * @public\n */\nexport enum IniSectionType {\n  PROFILE = \"profile\",\n  SSO_SESSION = \"sso-session\",\n  SERVICES = \"services\",\n}\n\n/**\n * @public\n */\nexport type IniSection = Record<string, string | undefined>;\n\n/**\n * @public\n *\n * @deprecated Please use {@link IniSection}\n */\nexport interface Profile extends IniSection {}\n\n/**\n * @public\n */\nexport type ParsedIniData = Record<string, IniSection>;\n\n/**\n * @public\n */\nexport interface SharedConfigFiles {\n  credentialsFile: ParsedIniData;\n  configFile: ParsedIniData;\n}\n"
  },
  {
    "path": "packages/types/src/response.ts",
    "content": "/**\n * @public\n */\nexport interface ResponseMetadata {\n  /**\n   * The status code of the last HTTP response received for this operation.\n   */\n  httpStatusCode?: number;\n\n  /**\n   * A unique identifier for the last request sent for this operation. Often\n   * requested by AWS service teams to aid in debugging.\n   */\n  requestId?: string;\n\n  /**\n   * A secondary identifier for the last request sent. Used for debugging.\n   */\n  extendedRequestId?: string;\n\n  /**\n   * A tertiary identifier for the last request sent. Used for debugging.\n   */\n  cfId?: string;\n\n  /**\n   * The number of times this operation was attempted.\n   */\n  attempts?: number;\n\n  /**\n   * The total amount of time (in milliseconds) that was spent waiting between\n   * retry attempts.\n   */\n  totalRetryDelay?: number;\n}\n\n/**\n * @public\n */\nexport interface MetadataBearer {\n  /**\n   * Metadata pertaining to this request.\n   */\n  $metadata: ResponseMetadata;\n}\n"
  },
  {
    "path": "packages/types/src/retry.ts",
    "content": "import type { SdkError } from \"./shapes\";\n\n/**\n * @public\n */\nexport type RetryErrorType =\n  /**\n   * This is a connection level error such as a socket timeout, socket connect\n   * error, tls negotiation timeout etc...\n   * Typically these should never be applied for non-idempotent request types\n   * since in this scenario, it's impossible to know whether the operation had\n   * a side effect on the server.\n   */\n  | \"TRANSIENT\"\n\n  /**\n   * This is an error where the server explicitly told the client to back off,\n   * such as a 429 or 503 Http error.\n   */\n  | \"THROTTLING\"\n\n  /**\n   * This is a server error that isn't explicitly throttling but is considered\n   * by the client to be something that should be retried.\n   */\n  | \"SERVER_ERROR\"\n\n  /**\n   * Doesn't count against any budgets. This could be something like a 401\n   * challenge in Http.\n   */\n  | \"CLIENT_ERROR\";\n\n/**\n * @public\n */\nexport interface RetryErrorInfo {\n  /**\n   * The error thrown during the initial request, if available.\n   */\n  error?: SdkError;\n\n  errorType: RetryErrorType;\n\n  /**\n   * Protocol hint. This could come from Http's 'retry-after' header or\n   * something from MQTT or any other protocol that has the ability to convey\n   * retry info from a peer.\n   *\n   * The Date after which a retry should be attempted.\n   */\n  retryAfterHint?: Date;\n}\n\n/**\n * @public\n */\nexport interface RetryBackoffStrategy {\n  /**\n   * @returns the number of milliseconds to wait before retrying an action.\n   */\n  computeNextBackoffDelay(retryAttempt: number): number;\n}\n\n/**\n * @public\n */\nexport interface StandardRetryBackoffStrategy extends RetryBackoffStrategy {\n  /**\n   * Sets the delayBase used to compute backoff delays.\n   * @param delayBase -\n   */\n  setDelayBase(delayBase: number): void;\n}\n\n/**\n * @public\n */\nexport interface RetryStrategyOptions {\n  backoffStrategy: RetryBackoffStrategy;\n\n  maxRetriesBase: number;\n}\n\n/**\n * @public\n */\nexport interface RetryToken {\n  /**\n   * @returns the current count of retry.\n   */\n  getRetryCount(): number;\n\n  /**\n   * @returns the number of milliseconds to wait before retrying an action.\n   */\n  getRetryDelay(): number;\n\n  /**\n   * @returns whether the operation which generated this token is long polling.\n   */\n  isLongPoll?(): boolean;\n}\n\n/**\n * @public\n */\nexport interface StandardRetryToken extends RetryToken {\n  /**\n   * @returns the cost of the last retry attempt.\n   */\n  getRetryCost(): number | undefined;\n}\n\n/**\n * @public\n */\nexport interface RetryStrategyV2 {\n  /**\n   * Called before any retries (for the first call to the operation). It either\n   * returns a retry token or an error upon the failure to acquire a token prior.\n   *\n   * tokenScope is arbitrary and out of scope for this component. However,\n   * adding it here offers us a lot of future flexibility for outage detection.\n   * For example, it could be \"us-east-1\" on a shared retry strategy, or\n   * \"us-west-2-c:dynamodb\".\n   */\n  acquireInitialRetryToken(retryTokenScope: string): Promise<RetryToken>;\n\n  /**\n   * After a failed operation call, this function is invoked to refresh the\n   * retryToken returned by acquireInitialRetryToken(). This function can\n   * either choose to allow another retry and send a new or updated token,\n   * or reject the retry attempt and report the error either in an exception\n   * or returning an error.\n   */\n  refreshRetryTokenForRetry(tokenToRenew: RetryToken, errorInfo: RetryErrorInfo): Promise<RetryToken>;\n\n  /**\n   * Upon successful completion of the operation, this function is called\n   * to record that the operation was successful.\n   */\n  recordSuccess(token: RetryToken): void;\n}\n\n/**\n * @public\n */\nexport type ExponentialBackoffJitterType = \"DEFAULT\" | \"NONE\" | \"FULL\" | \"DECORRELATED\";\n\n/**\n * @public\n */\nexport interface ExponentialBackoffStrategyOptions {\n  jitterType: ExponentialBackoffJitterType;\n\n  /* Scaling factor to add for the backoff in milliseconds. Default is 25ms */\n  backoffScaleValue?: number;\n}\n"
  },
  {
    "path": "packages/types/src/schema/schema-deprecated.ts",
    "content": "import type { EndpointV2 } from \"../endpoint\";\nimport type { HandlerExecutionContext } from \"../middleware\";\nimport type { MetadataBearer } from \"../response\";\nimport type { EndpointBearer, SerdeFunctions } from \"../serde\";\nimport type { ConfigurableSerdeContext, NormalizedSchema, SchemaTraits, SimpleSchema, UnitSchema } from \"./schema\";\nimport type { StaticSchema } from \"./static-schemas\";\n\n/**\n * A schema is an object or value that describes how to serialize/deserialize data.\n * @internal\n * @deprecated use $Schema\n */\nexport type Schema =\n  | UnitSchema\n  | TraitsSchema\n  | SimpleSchema\n  | ListSchema\n  | MapSchema\n  | StructureSchema\n  | MemberSchema\n  | OperationSchema\n  | StaticSchema\n  | NormalizedSchema;\n\n/**\n * A schema \"reference\" is either a schema or a function that\n * provides a schema. This is useful for lazy loading, and to allow\n * code generation to define schema out of dependency order.\n * @internal\n * @deprecated use $SchemaRef\n */\nexport type SchemaRef = Schema | (() => Schema);\n\n/**\n * A schema that has traits.\n *\n * @internal\n * @deprecated use static schema.\n */\nexport interface TraitsSchema {\n  namespace: string;\n  name: string;\n  traits: SchemaTraits;\n}\n\n/**\n * Indicates the schema is a member of a parent Structure schema.\n * It may also have a set of member traits distinct from its target shape's traits.\n * @internal\n * @deprecated use $MemberSchema\n */\nexport type MemberSchema = [SchemaRef, SchemaTraits];\n\n/**\n * Schema for the structure aggregate type.\n * @internal\n * @deprecated use static schema.\n */\nexport interface StructureSchema extends TraitsSchema {\n  memberNames: string[];\n  memberList: SchemaRef[];\n\n  /**\n   * @deprecated structure member iteration will be linear on the memberNames and memberList arrays.\n   * It can be collected into a hashmap form on an ad-hoc basis, but will not initialize as such.\n   */\n  members?: Record<string, [SchemaRef, SchemaTraits]> | undefined;\n}\n\n/**\n * Schema for the list aggregate type.\n * @internal\n * @deprecated use static schema.\n */\nexport interface ListSchema extends TraitsSchema {\n  valueSchema: SchemaRef;\n}\n\n/**\n * Schema for the map aggregate type.\n * @internal\n * @deprecated use static schema.\n */\nexport interface MapSchema extends TraitsSchema {\n  keySchema: SchemaRef;\n  valueSchema: SchemaRef;\n}\n\n/**\n * Schema for an operation.\n * @internal\n * @deprecated use StaticOperationSchema or $OperationSchema\n */\nexport interface OperationSchema {\n  namespace: string;\n  name: string;\n  traits: SchemaTraits;\n  input: SchemaRef;\n  output: SchemaRef;\n}\n\n/**\n * Turns a serialization into a data object.\n * @internal\n * @deprecated use $ShapeDeserializer\n */\nexport interface ShapeDeserializer<SerializationType = Uint8Array> extends ConfigurableSerdeContext {\n  /**\n   * Optionally async.\n   */\n  read(schema: Schema, data: SerializationType): any | Promise<any>;\n}\n\n/**\n * Turns a data object into a serialization.\n * @internal\n * @deprecated use $ShapeSerializer\n */\nexport interface ShapeSerializer<SerializationType = Uint8Array> extends ConfigurableSerdeContext {\n  write(schema: Schema, value: unknown): void;\n\n  flush(): SerializationType;\n}\n\n/**\n * A codec creates serializers and deserializers for some format such as JSON, XML, or CBOR.\n *\n * @internal\n * @deprecated use $Codec\n */\nexport interface Codec<S, D> extends ConfigurableSerdeContext {\n  createSerializer(): ShapeSerializer<S>;\n  createDeserializer(): ShapeDeserializer<D>;\n}\n\n/**\n * A client protocol defines how to convert a message (e.g. HTTP request/response) to and from a data object.\n * @internal\n * @deprecated use $ClientProtocol\n */\nexport interface ClientProtocol<Request, Response> extends ConfigurableSerdeContext {\n  /**\n   * @returns the Smithy qualified shape id.\n   */\n  getShapeId(): string;\n\n  getRequestType(): { new (...args: any[]): Request };\n  getResponseType(): { new (...args: any[]): Response };\n\n  /**\n   * @returns the payload codec if the requests/responses have a symmetric format.\n   * It otherwise may return null.\n   */\n  getPayloadCodec(): Codec<any, any>;\n\n  serializeRequest<Input extends object>(\n    operationSchema: OperationSchema,\n    input: Input,\n    context: HandlerExecutionContext & SerdeFunctions & EndpointBearer\n  ): Promise<Request>;\n\n  updateServiceEndpoint(request: Request, endpoint: EndpointV2): Request;\n\n  deserializeResponse<Output extends MetadataBearer>(\n    operationSchema: OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: Response\n  ): Promise<Output>;\n}\n\n/**\n * @public\n * @deprecated use $ClientProtocolCtor.\n */\nexport interface ClientProtocolCtor<Request, Response> {\n  new (args: any): ClientProtocol<Request, Response>;\n}\n"
  },
  {
    "path": "packages/types/src/schema/schema.ts",
    "content": "import type { EndpointV2 } from \"../endpoint\";\nimport type { HandlerExecutionContext } from \"../middleware\";\nimport type { MetadataBearer } from \"../response\";\nimport type { EndpointBearer, SerdeFunctions } from \"../serde\";\nimport type {\n  BigDecimalSchema,\n  BigIntegerSchema,\n  BlobSchema,\n  BooleanSchema,\n  DocumentSchema,\n  NumericSchema,\n  StreamingBlobSchema,\n  StringSchema,\n  TimestampDateTimeSchema,\n  TimestampDefaultSchema,\n  TimestampEpochSecondsSchema,\n  TimestampHttpDateSchema,\n} from \"./sentinels\";\nimport type { StaticSchema } from \"./static-schemas\";\nimport type { TraitBitVector } from \"./traits\";\n\n/**\n * A schema is an object or value that describes how to serialize/deserialize data.\n * @public\n */\nexport type $Schema = UnitSchema | SimpleSchema | $MemberSchema | StaticSchema | NormalizedSchema;\n\n/**\n * Traits attached to schema objects.\n *\n * When this is a number, it refers to a pre-allocated\n * trait combination that is equivalent to one of the\n * object type's variations.\n *\n * @public\n */\nexport type SchemaTraits = TraitBitVector | SchemaTraitsObject;\n\n/**\n * Simple schemas are those corresponding to simple Smithy types.\n * @see https://smithy.io/2.0/spec/simple-types.html\n * @public\n */\nexport type SimpleSchema =\n  | BlobSchemas\n  | StringSchema\n  | BooleanSchema\n  | NumericSchema\n  | BigIntegerSchema\n  | BigDecimalSchema\n  | DocumentSchema\n  | TimestampSchemas\n  | number;\n\n/**\n * Sentinel value for Timestamp schema.\n * \"Default\" means unspecified and to use the protocol serializer's default format.\n *\n * @public\n */\nexport type TimestampSchemas =\n  | TimestampDefaultSchema\n  | TimestampDateTimeSchema\n  | TimestampHttpDateSchema\n  | TimestampEpochSecondsSchema;\n\n/**\n * Sentinel values for Blob schema.\n * @public\n */\nexport type BlobSchemas = BlobSchema | StreamingBlobSchema;\n\n/**\n * Signal value for the Smithy void value. Typically used for\n * operation input and outputs.\n *\n * @public\n */\nexport type UnitSchema = \"unit\";\n\n/**\n * See https://smithy.io/2.0/trait-index.html for individual definitions.\n *\n * @public\n */\nexport type SchemaTraitsObject = {\n  idempotent?: 1;\n  idempotencyToken?: 1;\n  sensitive?: 1;\n  sparse?: 1;\n\n  /**\n   * timestampFormat is expressed by the schema sentinel values of 4, 5, 6, and 7,\n   * and not contained in trait objects.\n   * @deprecated use schema value.\n   */\n  timestampFormat?: never;\n\n  httpLabel?: 1;\n  httpHeader?: string;\n  httpQuery?: string;\n  httpPrefixHeaders?: string;\n  httpQueryParams?: 1;\n  httpPayload?: 1;\n  /**\n   * [method, path, statusCode]\n   */\n  http?: [string, string, number];\n  httpResponseCode?: 1;\n  /**\n   * [hostPrefix]\n   */\n  endpoint?: [string];\n\n  xmlAttribute?: 1;\n  xmlName?: string;\n  /**\n   * [prefix, uri]\n   */\n  xmlNamespace?: [string, string];\n  xmlFlattened?: 1;\n  jsonName?: string;\n\n  mediaType?: string;\n  error?: \"client\" | \"server\";\n\n  streaming?: 1;\n  eventHeader?: 1;\n  eventPayload?: 1;\n  [traitName: string]: unknown;\n};\n\n/**\n * Indicates the schema is a member of a parent Structure schema.\n * It may also have a set of member traits distinct from its target shape's traits.\n * @public\n */\nexport type $MemberSchema = [$SchemaRef, SchemaTraits];\n\n/**\n * Schema for an operation.\n * @public\n */\nexport interface $OperationSchema {\n  namespace: string;\n  name: string;\n  traits: SchemaTraits;\n  input: $SchemaRef;\n  output: $SchemaRef;\n}\n\n/**\n * Normalization wrapper for various schema data objects.\n * @public\n */\nexport interface NormalizedSchema {\n  getSchema(): $Schema;\n  getName(): string | undefined;\n  isMemberSchema(): boolean;\n  isListSchema(): boolean;\n  isMapSchema(): boolean;\n  isStructSchema(): boolean;\n  isBlobSchema(): boolean;\n  isTimestampSchema(): boolean;\n  isStringSchema(): boolean;\n  isBooleanSchema(): boolean;\n  isNumericSchema(): boolean;\n  isBigIntegerSchema(): boolean;\n  isBigDecimalSchema(): boolean;\n  isStreaming(): boolean;\n  getMergedTraits(): SchemaTraitsObject;\n  getMemberTraits(): SchemaTraitsObject;\n  getOwnTraits(): SchemaTraitsObject;\n  /**\n   * For list/set/map.\n   */\n  getValueSchema(): NormalizedSchema;\n  /**\n   * For struct/union.\n   */\n  getMemberSchema(member: string): NormalizedSchema | undefined;\n  structIterator(): Generator<[string, NormalizedSchema], undefined, undefined>;\n}\n\n/**\n * A schema \"reference\" is either a schema or a function that\n * provides a schema. This is useful for lazy loading, and to allow\n * code generation to define schema out of dependency order.\n * @public\n */\nexport type $SchemaRef = $Schema | (() => $Schema);\n\n/**\n * A codec creates serializers and deserializers for some format such as JSON, XML, or CBOR.\n *\n * @public\n */\nexport interface $Codec<S, D> extends ConfigurableSerdeContext {\n  createSerializer(): $ShapeSerializer<S>;\n  createDeserializer(): $ShapeDeserializer<D>;\n}\n\n/**\n * Configuration for codecs. Different protocols may share codecs, but require different behaviors from them.\n *\n * @public\n */\nexport type CodecSettings = {\n  timestampFormat: {\n    /**\n     * Whether to use member timestamp format traits.\n     */\n    useTrait: boolean;\n    /**\n     * Default timestamp format.\n     */\n    default: TimestampDateTimeSchema | TimestampHttpDateSchema | TimestampEpochSecondsSchema;\n  };\n  /**\n   * Whether to use HTTP binding traits.\n   */\n  httpBindings?: boolean;\n};\n\n/**\n * Turns a serialization into a data object.\n * @public\n */\nexport interface $ShapeDeserializer<SerializationType = Uint8Array> extends ConfigurableSerdeContext {\n  /**\n   * Optionally async.\n   */\n  read(schema: $Schema, data: SerializationType): any | Promise<any>;\n}\n\n/**\n * Turns a data object into a serialization.\n * @public\n */\nexport interface $ShapeSerializer<SerializationType = Uint8Array> extends ConfigurableSerdeContext {\n  write(schema: $Schema, value: unknown): void;\n\n  flush(): SerializationType;\n}\n\n/**\n * A client protocol defines how to convert a message (e.g. HTTP request/response) to and from a data object.\n * @public\n */\nexport interface $ClientProtocol<Request, Response> extends ConfigurableSerdeContext {\n  /**\n   * @returns the Smithy qualified shape id.\n   */\n  getShapeId(): string;\n\n  getRequestType(): { new (...args: any[]): Request };\n  getResponseType(): { new (...args: any[]): Response };\n\n  /**\n   * @returns the payload codec if the requests/responses have a symmetric format.\n   * It otherwise may return null.\n   */\n  getPayloadCodec(): $Codec<any, any>;\n\n  serializeRequest<Input extends object>(\n    operationSchema: $OperationSchema,\n    input: Input,\n    context: HandlerExecutionContext & SerdeFunctions & EndpointBearer\n  ): Promise<Request>;\n\n  updateServiceEndpoint(request: Request, endpoint: EndpointV2): Request;\n\n  deserializeResponse<Output extends MetadataBearer>(\n    operationSchema: $OperationSchema,\n    context: HandlerExecutionContext & SerdeFunctions,\n    response: Response\n  ): Promise<Output>;\n}\n\n/**\n * @public\n */\nexport interface $ClientProtocolCtor<Request, Response> {\n  new (args: any): $ClientProtocol<Request, Response>;\n}\n\n/**\n * Allows a protocol, codec, or serde utility to accept the serdeContext\n * from a client configuration or request/response handlerExecutionContext.\n *\n * @public\n */\nexport interface ConfigurableSerdeContext {\n  setSerdeContext(serdeContext: SerdeFunctions): void;\n}\n\n// TODO(schema): transports are not required in the current implementation.\n// /**\n//  * @public\n//  */\n// export interface Transport<Request, Response> {\n//   getRequestType(): { new (...args: any[]): Request };\n//   getResponseType(): { new (...args: any[]): Response };\n//\n//   send(context: HandlerExecutionContext, request: Request): Promise<Response>;\n// }\n"
  },
  {
    "path": "packages/types/src/schema/sentinels.ts",
    "content": "// =============== Simple types ===================\n\n/**\n * The blob Smithy type, in JS as Uint8Array and other representations\n * such as Buffer, string, or Readable(Stream) depending on circumstances.\n * @public\n */\nexport type BlobSchema = 0b0001_0101; // 21\n\n/**\n * @public\n */\nexport type StreamingBlobSchema = 0b0010_1010; // 42\n\n/**\n * @public\n */\nexport type BooleanSchema = 0b0000_0010; // 2\n\n/**\n * Includes string and enum Smithy types.\n * @public\n */\nexport type StringSchema = 0b0000_0000; // 0\n\n/**\n * Includes all numeric Smithy types except bigInteger and bigDecimal.\n * byte, short, integer, long, float, double, intEnum.\n *\n * @public\n */\nexport type NumericSchema = 0b0000_0001; // 1\n\n/**\n * @public\n */\nexport type BigIntegerSchema = 0b0001_0001; // 17\n\n/**\n * @public\n */\nexport type BigDecimalSchema = 0b0001_0011; // 19\n\n/**\n * @public\n */\nexport type DocumentSchema = 0b0000_1111; // 15\n\n/**\n * Smithy type timestamp, in JS as native Date object.\n * @public\n */\nexport type TimestampDefaultSchema = 0b0000_0100; // 4\n/**\n * @public\n */\nexport type TimestampDateTimeSchema = 0b0000_0101; // 5\n/**\n * @public\n */\nexport type TimestampHttpDateSchema = 0b0000_0110; // 6\n/**\n * @public\n */\nexport type TimestampEpochSecondsSchema = 0b0000_0111; // 7\n\n// =============== Aggregate types ===================\n\n/**\n * Additional bit indicating the type is a list.\n * @public\n */\nexport type ListSchemaModifier = 0b0100_0000; // 64\n\n/**\n * Additional bit indicating the type is a map.\n * @public\n */\nexport type MapSchemaModifier = 0b1000_0000; // 128\n"
  },
  {
    "path": "packages/types/src/schema/static-schemas.ts",
    "content": "/*\nA static schema is a non-function-call object that has no side effects.\nSchemas are generated as static objects to improve tree-shaking behavior in downstream applications.\n */\n\nimport type { $SchemaRef, SchemaTraits } from \"../schema/schema\";\n\n/**\n * @public\n */\nexport type StaticSchemaIdSimple = 0;\n\n/**\n * @public\n */\nexport type StaticSchemaIdList = 1;\n\n/**\n * @public\n */\nexport type StaticSchemaIdMap = 2;\n\n/**\n * @public\n */\nexport type StaticSchemaIdStruct = 3;\n\n/**\n * @public\n */\nexport type StaticSchemaIdUnion = 4;\n\n/**\n * @public\n */\nexport type StaticSchemaIdError = -3;\n\n/**\n * @public\n */\nexport type StaticSchemaIdOperation = 9;\n\n/**\n * @public\n */\nexport type StaticSchema =\n  | StaticSimpleSchema\n  | StaticListSchema\n  | StaticMapSchema\n  | StaticStructureSchema\n  | StaticUnionSchema\n  | StaticErrorSchema\n  | StaticOperationSchema;\n\n/**\n * @public\n */\nexport type ShapeName = string;\n\n/**\n * @public\n */\nexport type ShapeNamespace = string;\n\n/**\n * @public\n */\nexport type StaticSimpleSchema = [StaticSchemaIdSimple, ShapeNamespace, ShapeName, SchemaTraits, $SchemaRef];\n\n/**\n * @public\n */\nexport type StaticListSchema = [StaticSchemaIdList, ShapeNamespace, ShapeName, SchemaTraits, $SchemaRef];\n\n/**\n * @public\n */\nexport type StaticMapSchema = [StaticSchemaIdMap, ShapeNamespace, ShapeName, SchemaTraits, $SchemaRef, $SchemaRef];\n\n/**\n * @public\n */\nexport type StaticStructureSchema = [\n  StaticSchemaIdStruct,\n  ShapeNamespace,\n  ShapeName,\n  SchemaTraits,\n  string[], // member name list.\n  $SchemaRef[], // member schema list.\n  number?, // required member count, front-loaded in the lists.\n];\n\n/**\n * @public\n */\nexport type StaticUnionSchema = [\n  StaticSchemaIdUnion,\n  ShapeNamespace,\n  ShapeName,\n  SchemaTraits,\n  string[], // member name list.\n  $SchemaRef[], // member schema list.\n];\n\n/**\n * @public\n */\nexport type StaticErrorSchema = [\n  StaticSchemaIdError,\n  ShapeNamespace,\n  ShapeName,\n  SchemaTraits,\n  string[], // member name list.\n  $SchemaRef[], // member schema list.\n  number?, // required member count, front-loaded in the lists.\n];\n\n/**\n * @public\n */\nexport type StaticOperationSchema = [\n  StaticSchemaIdOperation,\n  ShapeNamespace,\n  ShapeName,\n  SchemaTraits,\n  $SchemaRef, // input schema\n  $SchemaRef, // output schema\n];\n"
  },
  {
    "path": "packages/types/src/schema/traits.ts",
    "content": "/**\n * A bitvector representing a traits object.\n *\n * Vector index to trait:\n * 0 - httpLabel\n * 1 - idempotent\n * 2 - idempotencyToken\n * 3 - sensitive\n * 4 - httpPayload\n * 5 - httpResponseCode\n * 6 - httpQueryParams\n *\n * The singular trait values are enumerated for quick identification, but\n * combination values are left to the `number` union type.\n *\n * @public\n */\nexport type TraitBitVector =\n  | HttpLabelBitMask\n  | IdempotentBitMask\n  | IdempotencyTokenBitMask\n  | SensitiveBitMask\n  | HttpPayloadBitMask\n  | HttpResponseCodeBitMask\n  | HttpQueryParamsBitMask\n  | number;\n\n/**\n * @public\n */\nexport type HttpLabelBitMask = 1;\n/**\n * @public\n */\nexport type IdempotentBitMask = 2;\n/**\n * @public\n */\nexport type IdempotencyTokenBitMask = 4;\n/**\n * @public\n */\nexport type SensitiveBitMask = 8;\n/**\n * @public\n */\nexport type HttpPayloadBitMask = 16;\n/**\n * @public\n */\nexport type HttpResponseCodeBitMask = 32;\n/**\n * @public\n */\nexport type HttpQueryParamsBitMask = 64;\n"
  },
  {
    "path": "packages/types/src/serde.ts",
    "content": "import type { Endpoint } from \"./http\";\nimport type { $ClientProtocol } from \"./schema/schema\";\nimport type { RequestHandler } from \"./transfer\";\nimport type { Decoder, Encoder, Provider } from \"./util\";\n\n/**\n * Interface for object requires an Endpoint set.\n *\n * @public\n */\nexport interface EndpointBearer {\n  /* TODO(endpointsv2) post-release */\n  // Keep using Endpoint V1 interface in serde\n  // After all services have onboard EndpointV2, we need to migrate it to Endpoint V2 interface too.\n  endpoint: Provider<Endpoint>;\n}\n\n/**\n * @public\n */\nexport interface StreamCollector {\n  /**\n   * A function that converts a stream into an array of bytes.\n   *\n   * @param stream - The low-level native stream from browser or Nodejs runtime\n   */\n  (stream: any): Promise<Uint8Array>;\n}\n\n/**\n * Request and Response serde util functions and settings for AWS services\n *\n * @public\n */\nexport interface SerdeContext extends SerdeFunctions, EndpointBearer {\n  requestHandler: RequestHandler<any, any>;\n  disableHostPrefix: boolean;\n  protocol?: $ClientProtocol<any, any>;\n}\n\n/**\n * Serde functions from the client config.\n *\n * @public\n */\nexport interface SerdeFunctions {\n  base64Encoder: Encoder;\n  base64Decoder: Decoder;\n  utf8Encoder: Encoder;\n  utf8Decoder: Decoder;\n  streamCollector: StreamCollector;\n}\n\n/**\n * @public\n */\nexport interface RequestSerializer<Request, Context extends EndpointBearer = any> {\n  /**\n   * Converts the provided `input` into a request object\n   *\n   * @param input - The user input to serialize.\n   *\n   * @param context - Context containing runtime-specific util functions.\n   */\n  (input: any, context: Context): Promise<Request>;\n}\n\n/**\n * @public\n */\nexport interface ResponseDeserializer<OutputType, ResponseType = any, Context = any> {\n  /**\n   * Converts the output of an operation into JavaScript types.\n   *\n   * @param output - The HTTP response received from the service\n   *\n   * @param context - context containing runtime-specific util functions.\n   */\n  (output: ResponseType, context: Context): Promise<OutputType>;\n}\n\n/**\n * The interface contains mix-in utility functions to transfer the runtime-specific\n * stream implementation to specified format. Each stream can ONLY be transformed\n * once.\n * @public\n */\nexport interface SdkStreamMixin {\n  transformToByteArray: () => Promise<Uint8Array>;\n  transformToString: (encoding?: string) => Promise<string>;\n  transformToWebStream: () => ReadableStream;\n}\n\n/**\n * The type describing a runtime-specific stream implementation with mix-in\n * utility functions.\n *\n * @public\n */\nexport type SdkStream<BaseStream> = BaseStream & SdkStreamMixin;\n\n/**\n * Indicates that the member of type T with\n * key StreamKey have been extended\n * with the SdkStreamMixin helper methods.\n *\n * @public\n */\nexport type WithSdkStreamMixin<T, StreamKey extends keyof T> = {\n  [key in keyof T]: key extends StreamKey ? SdkStream<T[StreamKey]> : T[key];\n};\n\n/**\n * Interface for internal function to inject stream utility functions\n * implementation\n *\n * @internal\n */\nexport interface SdkStreamMixinInjector {\n  (stream: unknown): SdkStreamMixin;\n}\n\n/**\n * @internal\n */\nexport interface SdkStreamSerdeContext {\n  sdkStreamMixin: SdkStreamMixinInjector;\n}\n"
  },
  {
    "path": "packages/types/src/shapes.ts",
    "content": "import type { HttpResponse } from \"./http\";\nimport type { MetadataBearer } from \"./response\";\n\n/**\n * A document type represents an untyped JSON-like value.\n * Not all protocols support document types, and the serialization format of a\n * document type is protocol specific. All JSON protocols SHOULD support\n * document types and they SHOULD serialize document types inline as normal\n * JSON values.\n *\n * @public\n */\nexport type DocumentType =\n  | null\n  | boolean\n  | number\n  | string\n  | DocumentType[]\n  | {\n      [prop: string]: DocumentType;\n    };\n\n/**\n * A structure shape with the error trait.\n * https://smithy.io/2.0/spec/behavior-traits.html#smithy-api-retryable-trait\n *\n * @public\n */\nexport interface RetryableTrait {\n  /**\n   * Indicates that the error is a retryable throttling error.\n   */\n  readonly throttling?: boolean;\n}\n\n/**\n * Type that is implemented by all Smithy shapes marked with the\n * error trait.\n *\n * @public\n * @deprecated\n */\nexport interface SmithyException {\n  /**\n   * The shape ID name of the exception.\n   */\n  readonly name: string;\n  /**\n   * Whether the client or server are at fault.\n   */\n  readonly $fault: \"client\" | \"server\";\n  /**\n   * The service that encountered the exception.\n   */\n  readonly $service?: string;\n  /**\n   * Indicates that an error MAY be retried by the client.\n   */\n  readonly $retryable?: RetryableTrait;\n  /**\n   * Reference to low-level HTTP response object.\n   */\n  readonly $response?: HttpResponse;\n}\n\n/**\n * This type should not be used in your application.\n * Users of the AWS SDK for JavaScript v3 service clients should prefer to\n * use the specific Exception classes corresponding to each operation.\n * These can be found as code in the deserializer for the operation's Command class,\n * or as declarations in the service model file in codegen/sdk-codegen/aws-models.\n * If no exceptions are enumerated by a particular Command operation,\n * the base exception for the service should be used. Each client exports\n * a base ServiceException prefixed with the service name.\n *\n * @public\n * @deprecated See {@link https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/}\n */\nexport type SdkError = Error &\n  Partial<SmithyException> &\n  Partial<MetadataBearer> & {\n    $metadata?: Partial<MetadataBearer>[\"$metadata\"] & {\n      /**\n       * If present, will have value of true and indicates that the error resulted in a\n       * correction of the clock skew, a.k.a. config.systemClockOffset.\n       * This is specific to AWS SDK and sigv4.\n       */\n      readonly clockSkewCorrected?: true;\n    };\n    cause?: Error;\n  };\n"
  },
  {
    "path": "packages/types/src/signature.ts",
    "content": "import type { Message } from \"./eventStream\";\nimport type { HttpRequest } from \"./http\";\nimport type { AwsCredentialIdentity } from \"./identity/awsCredentialIdentity\";\n\n/**\n * A `Date` object, a unix (epoch) timestamp in seconds, or a string that can be\n * understood by the JavaScript `Date` constructor.\n *\n * @public\n */\nexport type DateInput = number | string | Date;\n\n/**\n * @public\n */\nexport interface SigningArguments {\n  /**\n   * The date and time to be used as signature metadata. This value should be\n   * a Date object, a unix (epoch) timestamp, or a string that can be\n   * understood by the JavaScript `Date` constructor.If not supplied, the\n   * value returned by `new Date()` will be used.\n   */\n  signingDate?: DateInput;\n\n  /**\n   * The service signing name. It will override the service name of the signer\n   * in current invocation\n   */\n  signingService?: string;\n\n  /**\n   * The region name to sign the request. It will override the signing region of the\n   * signer in current invocation\n   */\n  signingRegion?: string;\n}\n\n/**\n * @public\n */\nexport interface RequestSigningArguments extends SigningArguments {\n  /**\n   * A set of strings whose members represents headers that cannot be signed.\n   * All headers in the provided request will have their names converted to\n   * lower case and then checked for existence in the unsignableHeaders set.\n   */\n  unsignableHeaders?: Set<string>;\n\n  /**\n   * A set of strings whose members represents headers that should be signed.\n   * Any values passed here will override those provided via unsignableHeaders,\n   * allowing them to be signed.\n   *\n   * All headers in the provided request will have their names converted to\n   * lower case before signing.\n   */\n  signableHeaders?: Set<string>;\n}\n\n/**\n * @public\n */\nexport interface RequestPresigningArguments extends RequestSigningArguments {\n  /**\n   * The number of seconds before the presigned URL expires\n   */\n  expiresIn?: number;\n\n  /**\n   * A set of strings whose representing headers that should not be hoisted\n   * to presigned request's query string. If not supplied, the presigner\n   * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n   * query string. If supplied, these headers remain in the presigned request's\n   * header.\n   * All headers in the provided request will have their names converted to\n   * lower case and then checked for existence in the unhoistableHeaders set.\n   */\n  unhoistableHeaders?: Set<string>;\n\n  /**\n   * This overrides any headers with the same name(s) set by unhoistableHeaders.\n   * These headers will be hoisted into the query string and signed.\n   */\n  hoistableHeaders?: Set<string>;\n}\n\n/**\n * @public\n */\nexport interface EventSigningArguments extends SigningArguments, EventStreamRequestScopedCredentials {\n  priorSignature: string;\n}\n\n/**\n * @public\n */\nexport interface MessageSigningArguments extends SigningArguments, EventStreamRequestScopedCredentials {}\n\n/**\n * @internal\n */\nexport interface EventStreamRequestScopedCredentials {\n  /**\n   * Optional, static credentials used for the duration of the event-stream request.\n   * If not provided, the signer's internal credential provider would be used, if\n   * the signer is SignatureV4.\n   */\n  eventStreamCredentials?: AwsCredentialIdentity;\n}\n\n/**\n * @public\n */\nexport interface RequestPresigner {\n  /**\n   * Signs a request for future use.\n   *\n   * The request will be valid until either the provided `expiration` time has\n   * passed or the underlying credentials have expired.\n   *\n   * @param requestToSign - The request that should be signed.\n   * @param options - Additional signing options.\n   */\n  presign(requestToSign: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;\n}\n\n/**\n * An object that signs request objects with AWS credentials using one of the\n * AWS authentication protocols.\n *\n * @public\n */\nexport interface RequestSigner {\n  /**\n   * Sign the provided request for immediate dispatch.\n   */\n  sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;\n}\n\n/**\n * @public\n */\nexport interface StringSigner {\n  /**\n   * Sign the provided `stringToSign` for use outside of the context of\n   * request signing. Typical uses include signed policy generation.\n   */\n  sign(stringToSign: string, options?: SigningArguments): Promise<string>;\n}\n\n/**\n * @public\n */\nexport interface FormattedEvent {\n  headers: Uint8Array;\n  payload: Uint8Array;\n}\n/**\n * @public\n */\nexport interface EventSigner {\n  /**\n   * Sign the individual event of the event stream.\n   */\n  sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;\n}\n\n/**\n * @public\n */\nexport interface SignableMessage {\n  message: Message;\n\n  priorSignature: string;\n}\n\n/**\n * @public\n */\nexport interface SignedMessage {\n  message: Message;\n\n  signature: string;\n}\n\n/**\n * @public\n */\nexport interface MessageSigner {\n  signMessage(message: SignableMessage, args: MessageSigningArguments): Promise<SignedMessage>;\n  sign(event: SignableMessage, options: MessageSigningArguments): Promise<SignedMessage>;\n}\n"
  },
  {
    "path": "packages/types/src/stream.ts",
    "content": "import type { ChecksumConstructor } from \"./checksum\";\nimport type { HashConstructor, StreamHasher } from \"./crypto\";\nimport type { BodyLengthCalculator, Encoder } from \"./util\";\n\n/**\n * @public\n */\nexport interface GetAwsChunkedEncodingStreamOptions {\n  base64Encoder?: Encoder;\n  bodyLengthChecker: BodyLengthCalculator;\n  checksumAlgorithmFn?: ChecksumConstructor | HashConstructor;\n  checksumLocationName?: string;\n  streamHasher?: StreamHasher;\n}\n\n/**\n * A function that returns Readable Stream which follows aws-chunked encoding stream.\n * It optionally adds checksum if options are provided.\n *\n * @public\n */\nexport interface GetAwsChunkedEncodingStream<StreamType = any> {\n  (readableStream: StreamType, options: GetAwsChunkedEncodingStreamOptions): StreamType;\n}\n"
  },
  {
    "path": "packages/types/src/streaming-payload/streaming-blob-common-types.ts",
    "content": "import type { Readable } from \"node:stream\";\n\nimport type { BlobOptionalType, ReadableStreamOptionalType } from \"../externals-check/browser-externals-check\";\n\n/**\n * This is the union representing the modeled blob type with streaming trait\n * in a generic format that does not relate to HTTP input or output payloads.\n * Note: the non-streaming blob type is represented by Uint8Array, but because\n * the streaming blob type is always in the request/response paylod, it has\n * historically been handled with different types.\n * For compatibility with its historical representation, it must contain at least\n * Readble (Node.js), Blob (browser), and ReadableStream (browser).\n *\n * @public\n * @see https://smithy.io/2.0/spec/simple-types.html#blob\n * @see StreamingPayloadInputTypes for FAQ about mixing types from multiple environments.\n */\nexport type StreamingBlobTypes = NodeJsRuntimeStreamingBlobTypes | BrowserRuntimeStreamingBlobTypes;\n\n/**\n * Node.js streaming blob type.\n *\n * @public\n */\nexport type NodeJsRuntimeStreamingBlobTypes = Readable;\n\n/**\n * Browser streaming blob types.\n *\n * @public\n */\nexport type BrowserRuntimeStreamingBlobTypes = ReadableStreamOptionalType | BlobOptionalType;\n"
  },
  {
    "path": "packages/types/src/streaming-payload/streaming-blob-payload-input-types.ts",
    "content": "import type { Readable } from \"node:stream\";\n\nimport type { BlobOptionalType, ReadableStreamOptionalType } from \"../externals-check/browser-externals-check\";\n\n/**\n * This union represents a superset of the compatible types you\n * can use for streaming payload inputs.\n * FAQ:\n * Why does the type union mix mutually exclusive runtime types, namely\n * Node.js and browser types?\n * There are several reasons:\n * 1. For backwards compatibility.\n * 2. As a convenient compromise solution so that users in either environment may use the types\n * without customization.\n * 3. The SDK does not have static type information about the exact implementation\n * of the HTTP RequestHandler being used in your client(s) (e.g. fetch, XHR, node:http, or node:http2),\n * given that it is chosen at runtime. There are multiple possible request handlers\n * in both the Node.js and browser runtime environments.\n * Rather than restricting the type to a known common format (Uint8Array, for example)\n * which doesn't include a universal streaming format in the currently supported Node.js versions,\n * the type declaration is widened to multiple possible formats.\n * It is up to the user to ultimately select a compatible format with the\n * runtime and HTTP handler implementation they are using.\n * Usage:\n * The typical solution we expect users to have is to manually narrow the\n * type when needed, picking the appropriate one out of the union according to the\n * runtime environment and specific request handler.\n * There is also the type utility \"NodeJsClient\", \"BrowserClient\" and more\n * exported from this package. These can be applied at the client level\n * to pre-narrow these streaming payload blobs. For usage see the readme.md\n * in the root of the \\@smithy/types NPM package.\n *\n * @public\n */\nexport type StreamingBlobPayloadInputTypes =\n  | NodeJsRuntimeStreamingBlobPayloadInputTypes\n  | BrowserRuntimeStreamingBlobPayloadInputTypes;\n\n/**\n * Streaming payload input types in the Node.js environment.\n * These are derived from the types compatible with the request body used by node:http.\n * Note: not all types are signable by the standard SignatureV4 signer when\n * used as the request body. For example, in Node.js a Readable stream\n * is not signable by the default signer.\n * They are included in the union because it may be intended in some cases,\n * but the expected types are primarily string, Uint8Array, and Buffer.\n * Additional details may be found in the internal\n * function \"getPayloadHash\" in the SignatureV4 module.\n *\n * @public\n */\nexport type NodeJsRuntimeStreamingBlobPayloadInputTypes = string | Uint8Array | Buffer | Readable;\n\n/**\n * Streaming payload input types in the browser environment.\n * These are derived from the types compatible with fetch's Request.body.\n *\n * @public\n */\nexport type BrowserRuntimeStreamingBlobPayloadInputTypes =\n  | string\n  | Uint8Array\n  | ReadableStreamOptionalType\n  | BlobOptionalType;\n"
  },
  {
    "path": "packages/types/src/streaming-payload/streaming-blob-payload-output-types.ts",
    "content": "import type { IncomingMessage } from \"node:http\";\nimport type { Readable } from \"node:stream\";\n\nimport type { BlobOptionalType, ReadableStreamOptionalType } from \"../externals-check/browser-externals-check\";\nimport type { SdkStream } from \"../serde\";\n\n/**\n * This union represents a superset of the types you may receive\n * in streaming payload outputs.\n * To highlight the upstream docs about the SdkStream mixin:\n * The interface contains mix-in (via Object.assign) methods to transform the runtime-specific\n * stream implementation to specified format. Each stream can ONLY be transformed\n * once.\n * The available methods are described on the SdkStream type via SdkStreamMixin.\n *\n * @public\n * @see StreamingPayloadInputTypes for FAQ about mixing types from multiple environments.\n */\nexport type StreamingBlobPayloadOutputTypes =\n  | NodeJsRuntimeStreamingBlobPayloadOutputTypes\n  | BrowserRuntimeStreamingBlobPayloadOutputTypes;\n\n/**\n * Streaming payload output types in the Node.js environment.\n * This is by default the IncomingMessage type from node:http responses when\n * using the default node-http-handler in Node.js environments.\n * It can be other Readable types like node:http2's ClientHttp2Stream\n * such as when using the node-http2-handler.\n * The SdkStreamMixin adds methods on this type to help transform (collect) it to\n * other formats.\n *\n * @public\n */\nexport type NodeJsRuntimeStreamingBlobPayloadOutputTypes = SdkStream<IncomingMessage | Readable>;\n\n/**\n * Streaming payload output types in the browser environment.\n * This is by default fetch's Response.body type (ReadableStream) when using\n * the default fetch-http-handler in browser-like environments.\n * It may be a Blob, such as when using the XMLHttpRequest handler\n * and receiving an arraybuffer response body.\n * The SdkStreamMixin adds methods on this type to help transform (collect) it to\n * other formats.\n *\n * @public\n */\nexport type BrowserRuntimeStreamingBlobPayloadOutputTypes = SdkStream<ReadableStreamOptionalType | BlobOptionalType>;\n"
  },
  {
    "path": "packages/types/src/transfer.ts",
    "content": "/**\n * @public\n */\nexport type RequestHandlerOutput<ResponseType> = { response: ResponseType };\n\n/**\n * @public\n */\nexport interface RequestHandler<RequestType, ResponseType, HandlerOptions = {}> {\n  /**\n   * metadata contains information of a handler. For example\n   * 'h2' refers this handler is for handling HTTP/2 requests,\n   * whereas 'h1' refers handling HTTP1 requests\n   */\n  metadata?: RequestHandlerMetadata;\n  destroy?: () => void;\n  handle: (request: RequestType, handlerOptions?: HandlerOptions) => Promise<RequestHandlerOutput<ResponseType>>;\n}\n\n/**\n * @public\n */\nexport interface RequestHandlerMetadata {\n  handlerProtocol: RequestHandlerProtocol | string;\n}\n\n/**\n * Values from ALPN Protocol IDs.\n *\n * @public\n * @see https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids\n */\nexport enum RequestHandlerProtocol {\n  HTTP_0_9 = \"http/0.9\",\n  HTTP_1_0 = \"http/1.0\",\n  TDS_8_0 = \"tds/8.0\",\n}\n\n/**\n * @public\n */\nexport interface RequestContext {\n  destination: URL;\n}\n"
  },
  {
    "path": "packages/types/src/transform/client-method-transforms.ts",
    "content": "import type { CommandIO } from \"../command\";\nimport type { MetadataBearer } from \"../response\";\nimport type { StreamingBlobPayloadOutputTypes } from \"../streaming-payload/streaming-blob-payload-output-types\";\nimport type { Transform } from \"./type-transform\";\n\n/**\n * Narrowed version of InvokeFunction used in Client::send.\n *\n * @internal\n */\nexport interface NarrowedInvokeFunction<\n  NarrowType,\n  HttpHandlerOptions,\n  InputTypes extends object,\n  OutputTypes extends MetadataBearer,\n> {\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: CommandIO<InputType, OutputType>,\n    options?: HttpHandlerOptions\n  ): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>>;\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: CommandIO<InputType, OutputType>,\n    cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void\n  ): void;\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: CommandIO<InputType, OutputType>,\n    options: HttpHandlerOptions,\n    cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void\n  ): void;\n  <InputType extends InputTypes, OutputType extends OutputTypes>(\n    command: CommandIO<InputType, OutputType>,\n    options?: HttpHandlerOptions,\n    cb?: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void\n  ): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>> | void;\n}\n\n/**\n * Narrowed version of InvokeMethod used in aggregated Client methods.\n *\n * @internal\n */\nexport interface NarrowedInvokeMethod<\n  NarrowType,\n  HttpHandlerOptions,\n  InputType extends object,\n  OutputType extends MetadataBearer,\n> {\n  (\n    input: InputType,\n    options?: HttpHandlerOptions\n  ): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>>;\n  (\n    input: InputType,\n    cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void\n  ): void;\n  (\n    input: InputType,\n    options: HttpHandlerOptions,\n    cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void\n  ): void;\n  (\n    input: InputType,\n    options?: HttpHandlerOptions,\n    cb?: (err: unknown, data?: OutputType) => void\n  ): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>> | void;\n}\n"
  },
  {
    "path": "packages/types/src/transform/client-payload-blob-type-narrow.spec.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { IncomingMessage } from \"node:http\";\n\nimport type { Client } from \"../client\";\nimport type { CommandIO } from \"../command\";\nimport type { HttpHandlerOptions } from \"../http\";\nimport type { MetadataBearer } from \"../response\";\nimport type { SdkStream } from \"../serde\";\nimport type {\n  NodeJsRuntimeStreamingBlobPayloadInputTypes,\n  StreamingBlobPayloadInputTypes,\n} from \"../streaming-payload/streaming-blob-payload-input-types\";\nimport type { StreamingBlobPayloadOutputTypes } from \"../streaming-payload/streaming-blob-payload-output-types\";\nimport type { BrowserClient, NodeJsClient } from \"./client-payload-blob-type-narrow\";\nimport type { Exact } from \"./exact\";\nimport type { Transform } from \"./type-transform\";\n\n// it should narrow operational methods and the generic send method\n\ntype MyInput = Partial<{\n  a: boolean;\n  b: boolean | number;\n  c: boolean | number | string;\n  body?: StreamingBlobPayloadInputTypes;\n}>;\n\ntype MyOutput = {\n  a: boolean;\n  b: boolean | number;\n  c: boolean | number | string;\n  body?: StreamingBlobPayloadOutputTypes;\n} & MetadataBearer;\n\ntype MyConfig = {\n  version: number;\n};\n\ninterface MyClient extends Client<MyInput, MyOutput, MyConfig> {\n  getObject(args: MyInput, options?: HttpHandlerOptions): Promise<MyOutput>;\n  getObject(args: MyInput, cb: (err: any, data?: MyOutput) => void): void;\n  getObject(args: MyInput, options: HttpHandlerOptions, cb: (err: any, data?: MyOutput) => void): void;\n\n  putObject(args: MyInput, options?: HttpHandlerOptions): Promise<MyOutput>;\n  putObject(args: MyInput, cb: (err: any, data?: MyOutput) => void): void;\n  putObject(args: MyInput, options: HttpHandlerOptions, cb: (err: any, data?: MyOutput) => void): void;\n}\n\n{\n  interface NodeJsMyClient extends NodeJsClient<MyClient> {}\n  const mockClient = null as unknown as NodeJsMyClient;\n  type Input = Parameters<typeof mockClient.getObject>[0];\n\n  const assert1: Exact<\n    Input,\n    Transform<MyInput, StreamingBlobPayloadInputTypes | undefined, NodeJsRuntimeStreamingBlobPayloadInputTypes>\n  > = true as const;\n\n  const assert2: Exact<Input, MyInput> = false as const;\n}\n\n{\n  interface NodeJsMyClient extends NodeJsClient<MyClient> {}\n  const mockClient = null as unknown as NodeJsMyClient;\n  const getObjectCall = () => mockClient.getObject({});\n\n  type A = Awaited<ReturnType<typeof getObjectCall>>;\n  type B = Omit<MyOutput, \"body\"> & { body?: SdkStream<IncomingMessage> };\n\n  const assert1: Exact<A, B> = true as const;\n}\n\n{\n  interface NodeJsMyClient extends BrowserClient<MyClient> {}\n  const mockClient = null as unknown as NodeJsMyClient;\n  const putObjectCall = () =>\n    new Promise<B>((resolve) => {\n      mockClient.putObject({}, (err: unknown, data) => {\n        resolve(data!);\n      });\n    });\n\n  type A = Awaited<ReturnType<typeof putObjectCall>>;\n  type B = Omit<MyOutput, \"body\"> & { body?: SdkStream<ReadableStream> };\n\n  const assert1: Exact<A, B> = true as const;\n}\n\n{\n  interface NodeJsMyClient extends NodeJsClient<MyClient> {}\n  const mockClient = null as unknown as NodeJsMyClient;\n  const sendCall = () => mockClient.send(null as unknown as CommandIO<MyInput, MyOutput>, { abortSignal: null as any });\n\n  type A = Awaited<ReturnType<typeof sendCall>>;\n  type B = Omit<MyOutput, \"body\"> & { body?: SdkStream<IncomingMessage> };\n\n  const assert1: Exact<A, B> = true as const;\n}\n"
  },
  {
    "path": "packages/types/src/transform/client-payload-blob-type-narrow.ts",
    "content": "import type { ClientHttp2Stream } from \"node:http2\";\nimport type { IncomingMessage } from \"node:http\";\n\nimport type { InvokeMethod } from \"../client\";\nimport type { GetOutputType } from \"../command\";\nimport type { HttpHandlerOptions } from \"../http\";\nimport type { SdkStream } from \"../serde\";\nimport type {\n  BrowserRuntimeStreamingBlobPayloadInputTypes,\n  NodeJsRuntimeStreamingBlobPayloadInputTypes,\n  StreamingBlobPayloadInputTypes,\n} from \"../streaming-payload/streaming-blob-payload-input-types\";\nimport type { StreamingBlobPayloadOutputTypes } from \"../streaming-payload/streaming-blob-payload-output-types\";\nimport type { NarrowedInvokeMethod } from \"./client-method-transforms\";\nimport type { Transform } from \"./type-transform\";\n\n/**\n * Creates a type with a given client type that narrows payload blob output\n * types to SdkStream<IncomingMessage>.\n * This can be used for clients with the NodeHttpHandler requestHandler,\n * the default in Node.js when not using HTTP2.\n * Usage example:\n * ```typescript\n * const client = new YourClient({}) as NodeJsClient<YourClient>;\n * ```\n *\n * @public\n */\nexport type NodeJsClient<ClientType extends object> = NarrowPayloadBlobTypes<\n  NodeJsRuntimeStreamingBlobPayloadInputTypes,\n  SdkStream<IncomingMessage>,\n  ClientType\n>;\n/**\n * Variant of NodeJsClient for node:http2.\n *\n * @public\n */\nexport type NodeJsHttp2Client<ClientType extends object> = NarrowPayloadBlobTypes<\n  NodeJsRuntimeStreamingBlobPayloadInputTypes,\n  SdkStream<ClientHttp2Stream>,\n  ClientType\n>;\n\n/**\n * Creates a type with a given client type that narrows payload blob output\n * types to SdkStream<ReadableStream>.\n * This can be used for clients with the FetchHttpHandler requestHandler,\n * which is the default in browser environments.\n * Usage example:\n * ```typescript\n * const client = new YourClient({}) as BrowserClient<YourClient>;\n * ```\n *\n * @public\n */\nexport type BrowserClient<ClientType extends object> = NarrowPayloadBlobTypes<\n  BrowserRuntimeStreamingBlobPayloadInputTypes,\n  SdkStream<ReadableStream>,\n  ClientType\n>;\n/**\n * Variant of BrowserClient for XMLHttpRequest.\n *\n * @public\n */\nexport type BrowserXhrClient<ClientType extends object> = NarrowPayloadBlobTypes<\n  BrowserRuntimeStreamingBlobPayloadInputTypes,\n  SdkStream<ReadableStream | Blob>,\n  ClientType\n>;\n\n/**\n * Narrow a given Client's blob payload outputs to the given type T.\n *\n * @public\n * @deprecated use NarrowPayloadBlobTypes<I, O, ClientType>.\n */\nexport type NarrowPayloadBlobOutputType<T, ClientType extends object> = {\n  [key in keyof ClientType]: [ClientType[key]] extends [\n    InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>,\n  ]\n    ? NarrowedInvokeMethod<T, HttpHandlerOptions, FunctionInputTypes, FunctionOutputTypes>\n    : ClientType[key];\n} & {\n  send<Command>(\n    command: Command,\n    options?: any\n  ): Promise<Transform<GetOutputType<Command>, StreamingBlobPayloadOutputTypes | undefined, T>>;\n};\n\n/**\n * Narrow a Client's blob payload input and output types to I and O.\n *\n * @public\n */\nexport type NarrowPayloadBlobTypes<I, O, ClientType extends object> = {\n  [key in keyof ClientType]: [ClientType[key]] extends [\n    InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>,\n  ]\n    ? NarrowedInvokeMethod<\n        O,\n        HttpHandlerOptions,\n        Transform<FunctionInputTypes, StreamingBlobPayloadInputTypes | undefined, I>,\n        FunctionOutputTypes\n      >\n    : ClientType[key];\n} & {\n  send<Command>(\n    command: Command,\n    options?: any\n  ): Promise<Transform<GetOutputType<Command>, StreamingBlobPayloadOutputTypes | undefined, O>>;\n};\n"
  },
  {
    "path": "packages/types/src/transform/exact.ts",
    "content": "/**\n * Checks that A and B extend each other.\n *\n * @internal\n */\nexport type Exact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\n"
  },
  {
    "path": "packages/types/src/transform/mutable.ts",
    "content": "/**\n * @internal\n */\nexport type Mutable<Type> = {\n  -readonly [Property in keyof Type]: Type[Property];\n};\n"
  },
  {
    "path": "packages/types/src/transform/no-undefined.spec.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { Client } from \"../client\";\nimport type { CommandIO } from \"../command\";\nimport type { HttpHandlerOptions } from \"../http\";\nimport type { MetadataBearer } from \"../response\";\nimport type { DocumentType } from \"../shapes\";\nimport type { Exact } from \"./exact\";\nimport type { AssertiveClient, NoUndefined, UncheckedClient } from \"./no-undefined\";\n\ntype A = {\n  a: string;\n  b: number | string;\n  c: boolean | number | string;\n  required: string | undefined;\n  optional?: string;\n  nested: A;\n  document: DocumentType;\n};\n\n{\n  // it should remove undefined union from required fields.\n  type T = NoUndefined<A>;\n\n  const assert1: Exact<T[\"required\"], string> = true as const;\n  const assert2: Exact<T[\"nested\"][\"required\"], string> = true as const;\n  const assert3: Exact<T[\"nested\"][\"nested\"][\"required\"], string> = true as const;\n  const assert4: Exact<T[\"document\"], DocumentType> = true as const;\n  const assert5: Exact<T[\"nested\"][\"document\"], DocumentType> = true as const;\n}\n\n{\n  type MyInput = {\n    a: string | undefined;\n    b: number | undefined;\n    c: string | number | undefined;\n    optional?: string;\n    document: DocumentType | undefined;\n  };\n\n  type MyOutput = {\n    a?: string;\n    b?: number;\n    c?: string | number;\n    r?: MyOutput;\n    document?: DocumentType;\n  } & MetadataBearer;\n\n  type MyConfig = {\n    version: number;\n  };\n\n  interface MyClient extends Client<MyInput, MyOutput, MyConfig> {\n    getObject(args: MyInput, options?: HttpHandlerOptions): Promise<MyOutput>;\n    getObject(args: MyInput, cb: (err: any, data?: MyOutput) => void): void;\n    getObject(args: MyInput, options: HttpHandlerOptions, cb: (err: any, data?: MyOutput) => void): void;\n\n    putObject(args: MyInput, options?: HttpHandlerOptions): Promise<MyOutput>;\n    putObject(args: MyInput, cb: (err: any, data?: MyOutput) => void): void;\n    putObject(args: MyInput, options: HttpHandlerOptions, cb: (err: any, data?: MyOutput) => void): void;\n\n    listObjects(): Promise<MyOutput>;\n    listObjects(args: MyInput, options?: HttpHandlerOptions): Promise<MyOutput>;\n    listObjects(args: MyInput, cb: (err: any, data?: MyOutput) => void): void;\n    listObjects(args: MyInput, options: HttpHandlerOptions, cb: (err: any, data?: MyOutput) => void): void;\n  }\n\n  {\n    // AssertiveClient should enforce union of undefined on inputs\n    // but preserve undefined outputs.\n    const c = null as unknown as AssertiveClient<MyClient>;\n    const input = {\n      a: \"\",\n      b: 0,\n      c: 0,\n      document: { aa: \"b\" },\n    };\n    const get = c.getObject(input);\n    const output = null as unknown as Awaited<typeof get>;\n\n    const assert1: Exact<typeof output.a, string | undefined> = true as const;\n    const assert2: Exact<typeof output.b, number | undefined> = true as const;\n    const assert3: Exact<typeof output.c, string | number | undefined> = true as const;\n    const assert4: Exact<typeof output.document, DocumentType | undefined> = true as const;\n    if (output.r) {\n      const assert5: Exact<typeof output.r.a, string | undefined> = true as const;\n      const assert6: Exact<typeof output.r.b, number | undefined> = true as const;\n      const assert7: Exact<typeof output.r.c, string | number | undefined> = true as const;\n      const assert8: Exact<typeof output.r.document, DocumentType | undefined> = true as const;\n    }\n  }\n\n  {\n    // UncheckedClient both removes union-undefined from inputs\n    // and the nullability of outputs.\n    const c = null as unknown as UncheckedClient<MyClient>;\n    const input = {\n      a: \"\",\n      b: 0,\n      c: 0,\n      document: { aa: \"b\" },\n    };\n    const get = c.getObject(input);\n    const output = null as unknown as Awaited<typeof get>;\n\n    const assert1: Exact<typeof output.a, string> = true as const;\n    const assert2: Exact<typeof output.b, number> = true as const;\n    const assert3: Exact<typeof output.c, string | number> = true as const;\n    const assert4: Exact<typeof output.document, DocumentType> = true as const;\n    const assert5: Exact<typeof output.r.a, string> = true as const;\n    const assert6: Exact<typeof output.r.b, number> = true as const;\n    const assert7: Exact<typeof output.r.c, string | number> = true as const;\n    const assert8: Exact<typeof output.r.document, DocumentType> = true as const;\n  }\n\n  {\n    // Handles methods with optionally zero args.\n    const c = null as unknown as AssertiveClient<MyClient>;\n    const list = c.listObjects();\n    const output = null as unknown as Awaited<typeof list>;\n\n    const assert1: Exact<typeof output.a, string | undefined> = true as const;\n    const assert2: Exact<typeof output.b, number | undefined> = true as const;\n    const assert3: Exact<typeof output.c, string | number | undefined> = true as const;\n    const assert4: Exact<typeof output.document, DocumentType | undefined> = true as const;\n    if (output.r) {\n      const assert5: Exact<typeof output.r.a, string | undefined> = true as const;\n      const assert6: Exact<typeof output.r.b, number | undefined> = true as const;\n      const assert7: Exact<typeof output.r.c, string | number | undefined> = true as const;\n      const assert8: Exact<typeof output.r.document, DocumentType | undefined> = true as const;\n    }\n  }\n\n  {\n    // Works with outputs of the \"send\" method.\n    const c = null as unknown as AssertiveClient<MyClient>;\n    const list = c.send(null as unknown as CommandIO<MyInput, MyOutput>);\n    const output = null as unknown as Awaited<typeof list>;\n\n    const assert1: Exact<typeof output.a, string | undefined> = true as const;\n    const assert2: Exact<typeof output.b, number | undefined> = true as const;\n    const assert3: Exact<typeof output.c, string | number | undefined> = true as const;\n    const assert4: Exact<typeof output.document, DocumentType | undefined> = true as const;\n    if (output.r) {\n      const assert5: Exact<typeof output.r.a, string | undefined> = true as const;\n      const assert6: Exact<typeof output.r.b, number | undefined> = true as const;\n      const assert7: Exact<typeof output.r.c, string | number | undefined> = true as const;\n      const assert8: Exact<typeof output.r.document, DocumentType | undefined> = true as const;\n    }\n  }\n}\n"
  },
  {
    "path": "packages/types/src/transform/no-undefined.ts",
    "content": "import type { InvokeMethod, InvokeMethodOptionalArgs } from \"../client\";\nimport type { GetOutputType } from \"../command\";\nimport type { DocumentType } from \"../shapes\";\n\n/**\n * This type is intended as a type helper for generated clients.\n * When initializing client, cast it to this type by passing\n * the client constructor type as the type parameter.\n *\n * It will then recursively remove \"undefined\" as a union type from all\n * input and output shapes' members. Note, this does not affect\n * any member that is optional (?) such as outputs with no required members.\n *\n * @example\n * ```ts\n * const client = new Client({}) as AssertiveClient<Client>;\n * ```\n *\n * @public\n */\nexport type AssertiveClient<Client extends object> = NarrowClientIOTypes<Client>;\n\n/**\n * This is similar to AssertiveClient but additionally changes all\n * output types to (recursive) Required<T> so as to bypass all output nullability guards.\n *\n * @public\n */\nexport type UncheckedClient<Client extends object> = UncheckedClientOutputTypes<Client>;\n\n/**\n * Excludes undefined recursively.\n *\n * @internal\n */\nexport type NoUndefined<T> = T extends Function\n  ? T\n  : T extends DocumentType\n    ? T\n    : [T] extends [object]\n      ? {\n          [key in keyof T]: NoUndefined<T[key]>;\n        }\n      : Exclude<T, undefined>;\n\n/**\n * Excludes undefined and optional recursively.\n *\n * @internal\n */\nexport type RecursiveRequired<T> = T extends Function\n  ? T\n  : T extends DocumentType\n    ? T\n    : [T] extends [object]\n      ? {\n          [key in keyof T]-?: RecursiveRequired<T[key]>;\n        }\n      : Exclude<T, undefined>;\n\n/**\n * Removes undefined from unions.\n *\n * @internal\n */\ntype NarrowClientIOTypes<ClientType extends object> = {\n  [key in keyof ClientType]: [ClientType[key]] extends [\n    InvokeMethodOptionalArgs<infer FunctionInputTypes, infer FunctionOutputTypes>,\n  ]\n    ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>>\n    : [ClientType[key]] extends [InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>]\n      ? InvokeMethod<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>>\n      : ClientType[key];\n} & {\n  send<Command>(command: Command, options?: any): Promise<NoUndefined<GetOutputType<Command>>>;\n};\n\n/**\n * Removes undefined from unions and adds yolo output types.\n *\n * @internal\n */\ntype UncheckedClientOutputTypes<ClientType extends object> = {\n  [key in keyof ClientType]: [ClientType[key]] extends [\n    InvokeMethodOptionalArgs<infer FunctionInputTypes, infer FunctionOutputTypes>,\n  ]\n    ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>>\n    : [ClientType[key]] extends [InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>]\n      ? InvokeMethod<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>>\n      : ClientType[key];\n} & {\n  send<Command>(command: Command, options?: any): Promise<RecursiveRequired<NoUndefined<GetOutputType<Command>>>>;\n};\n"
  },
  {
    "path": "packages/types/src/transform/type-transform.spec.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { Transform as DownlevelTransform } from \"../downlevel-ts3.4/transform/type-transform\";\nimport type { Exact } from \"./exact\";\nimport type { Transform } from \"./type-transform\";\n\ntype A = {\n  a: string;\n  b: number | string;\n  c: boolean | number | string;\n  nested: A;\n};\n\n{\n  // It should transform exact unions recursively.\n\n  type T = Transform<A, number | string, \"enum\">;\n\n  const assert1: Exact<T[\"a\"], string> = true as const;\n  const assert2: Exact<T[\"b\"], \"enum\"> = true as const;\n\n  const assert3: Exact<T[\"nested\"][\"nested\"][\"nested\"][\"b\"], \"enum\"> = true as const;\n}\n\n// It should not recurse into SharedArrayBuffer.\ntype B = {\n  typed: SharedArrayBuffer;\n  untyped: {\n    byteLength: number;\n  };\n};\n\n// Transform targets number, which is a sub-property type of SharedArrayBuffer (e.g. byteLength).\n// If recursion occurred, SharedArrayBuffer's byteLength would be transformed.\ntype T = Transform<B, number, string>;\n\nconst assert1: Exact<T[\"typed\"][\"byteLength\"], number> = true as const;\nconst assert2: Exact<T[\"untyped\"][\"byteLength\"], string> = true as const;\n\n{\n  // the downlevel should function similarly\n  type T = DownlevelTransform<A, number | string, \"enum\">;\n\n  const assert1: Exact<T[\"a\"], string> = true as const;\n  const assert2: Exact<T[\"b\"], \"enum\"> = true as const;\n\n  const assert3: Exact<T[\"nested\"][\"nested\"][\"nested\"][\"b\"], \"enum\"> = true as const;\n}\n"
  },
  {
    "path": "packages/types/src/transform/type-transform.ts",
    "content": "/**\n * Transforms any members of the object T having type FromType\n * to ToType. This applies only to exact type matches.\n * This is for the case where FromType is a union and only those fields\n * matching the same union should be transformed.\n *\n * @public\n */\nexport type Transform<T, FromType, ToType> = ConditionalRecursiveTransformExact<T, FromType, ToType>;\n\n/**\n * Returns ToType if T matches exactly with FromType.\n *\n * @internal\n */\ntype TransformExact<T, FromType, ToType> = [T] extends [FromType] ? ([FromType] extends [T] ? ToType : T) : T;\n\n/**\n * Types excluded from recursive transformation to avoid circular references.\n *\n * @internal\n */\ntype ExcludedTransformTypes = SharedArrayBuffer;\n\n/**\n * Applies TransformExact to members of an object recursively.\n *\n * @internal\n */\ntype RecursiveTransformExact<T, FromType, ToType> = T extends Function\n  ? T\n  : T extends ExcludedTransformTypes\n    ? T\n    : T extends object\n      ? {\n          [key in keyof T]: [T[key]] extends [FromType]\n            ? [FromType] extends [T[key]]\n              ? ToType\n              : ConditionalRecursiveTransformExact<T[key], FromType, ToType>\n            : ConditionalRecursiveTransformExact<T[key], FromType, ToType>;\n        }\n      : TransformExact<T, FromType, ToType>;\n\n/**\n * Same as RecursiveTransformExact but does not assign to an object\n * unless there is a matching transformed member.\n *\n * @internal\n */\ntype ConditionalRecursiveTransformExact<T, FromType, ToType> = [T] extends [\n  RecursiveTransformExact<T, FromType, ToType>,\n]\n  ? [RecursiveTransformExact<T, FromType, ToType>] extends [T]\n    ? T\n    : RecursiveTransformExact<T, FromType, ToType>\n  : RecursiveTransformExact<T, FromType, ToType>;\n"
  },
  {
    "path": "packages/types/src/uri.ts",
    "content": "import type { QueryParameterBag } from \"./http\";\n\n/**\n * Represents the components parts of a Uniform Resource Identifier used to\n * construct the target location of a Request.\n *\n * @internal\n */\nexport type URI = {\n  protocol: string;\n  hostname: string;\n  port?: number;\n  path: string;\n  query?: QueryParameterBag;\n  username?: string;\n  password?: string;\n  fragment?: string;\n};\n"
  },
  {
    "path": "packages/types/src/util.spec.ts",
    "content": "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { Exact, OptionalParameter } from \"./util\";\n\ntype Assignable<LHS, RHS> = [RHS] extends [LHS] ? true : false;\n\ntype OptionalInput = {\n  key?: string;\n  optional?: string;\n};\n\ntype RequiredInput = {\n  key: string | undefined;\n  optional?: string;\n};\n\n{\n  // optional parameter transform of an optional input is not equivalent to exactly 1 parameter.\n  type A = [...OptionalParameter<OptionalInput>];\n  type B = [OptionalInput];\n  type C = [OptionalInput] | [];\n\n  const assert1: Exact<A, B> = false as const;\n  const assert2: Exact<A, C> = true as const;\n\n  const assert3: Assignable<A, []> = true as const;\n  const assert4: A = [];\n\n  const assert5: Assignable<A, [{ key: \"\" }]> = true as const;\n  const assert6: A = [{ key: \"\" }];\n}\n\n{\n  // optional parameter transform of a required input is equivalent to exactly 1 parameter.\n  type A = [...OptionalParameter<RequiredInput>];\n  type B = [RequiredInput];\n\n  const assert1: Exact<A, B> = true as const;\n  const assert2: Assignable<A, []> = false as const;\n  const assert3: Assignable<A, [{ key: \"\" }]> = true as const;\n  const assert4: A = [{ key: \"\" }];\n}\n"
  },
  {
    "path": "packages/types/src/util.ts",
    "content": "import type { Endpoint } from \"./http\";\nimport type { FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput } from \"./middleware\";\nimport type { MetadataBearer } from \"./response\";\n\n/**\n * A generic which checks if Type1 is exactly same as Type2.\n *\n * @public\n */\nexport type Exact<Type1, Type2> = [Type1] extends [Type2] ? ([Type2] extends [Type1] ? true : false) : false;\n\n/**\n * A function that, given a Uint8Array of bytes, can produce a string\n * representation thereof. The function may optionally attempt to\n * convert other input types to Uint8Array before encoding.\n *\n * @example An encoder function that converts bytes to hexadecimal\n * representation would return `'hello'` when given\n * `new Uint8Array([104, 101, 108, 108, 111])`.\n *\n * @public\n */\nexport interface Encoder {\n  /**\n   * Caution: the `any` type on the input is for backwards compatibility.\n   * Runtime support is limited to Uint8Array and string by default.\n   *\n   * You may choose to support more encoder input types if overriding the default\n   * implementations.\n   */\n  (input: Uint8Array | string | any): string;\n}\n\n/**\n * A function that, given a string, can derive the bytes represented by that\n * string.\n *\n * @example A decoder function that converts bytes to hexadecimal\n * representation would return `new Uint8Array([104, 101, 108, 108, 111])` when\n * given the string `'hello'`.\n *\n * @public\n */\nexport interface Decoder {\n  (input: string): Uint8Array;\n}\n\n/**\n * A function that, when invoked, returns a promise that will be fulfilled with\n * a value of type T.\n *\n * @example A function that reads credentials from shared SDK configuration\n * files, assuming roles and collecting MFA tokens as necessary.\n *\n * @public\n */\nexport interface Provider<T> {\n  (): Promise<T>;\n}\n\n/**\n * A tuple that represents an API name and optional version\n * of a library built using the AWS SDK.\n *\n * @public\n */\nexport type UserAgentPair = [name: string, version?: string];\n\n/**\n * User agent data that to be put into the request's user\n * agent.\n *\n * @public\n */\nexport type UserAgent = UserAgentPair[];\n\n/**\n * Parses a URL in string form into an Endpoint object.\n *\n * @public\n */\nexport interface UrlParser {\n  (url: string | URL): Endpoint;\n}\n\n/**\n * A function that, when invoked, returns a promise that will be fulfilled with\n * a value of type T. It memoizes the result from the previous invocation\n * instead of calling the underlying resources every time.\n *\n * You can force the provider to refresh the memoized value by invoke the\n * function with optional parameter hash with `forceRefresh` boolean key and\n * value `true`.\n *\n * @example A function that reads credentials from IMDS service that could\n * return expired credentials. The SDK will keep using the expired credentials\n * until an unretryable service error requiring a force refresh of the\n * credentials.\n *\n * @public\n */\nexport interface MemoizedProvider<T> {\n  (options?: { forceRefresh?: boolean }): Promise<T>;\n}\n\n/**\n * A function that, given a request body, determines the\n * length of the body. This is used to determine the Content-Length\n * that should be sent with a request.\n *\n * @example A function that reads a file stream and calculates\n * the size of the file.\n *\n * @public\n */\nexport interface BodyLengthCalculator {\n  (body: any): number | undefined;\n}\n\n/**\n * Object containing regionalization information of\n * AWS services.\n *\n * @public\n */\nexport interface RegionInfo {\n  hostname: string;\n  partition: string;\n  path?: string;\n  signingService?: string;\n  signingRegion?: string;\n}\n\n/**\n * Options to pass when calling {@link RegionInfoProvider}\n *\n * @public\n */\nexport interface RegionInfoProviderOptions {\n  /**\n   * Enables IPv6/IPv4 dualstack endpoint.\n   * @defaultValue false\n   */\n  useDualstackEndpoint: boolean;\n  /**\n   * Enables FIPS compatible endpoints.\n   * @defaultValue false\n   */\n  useFipsEndpoint: boolean;\n}\n\n/**\n * Function returns designated service's regionalization\n * information from given region. Each service client\n * comes with its regionalization provider. it serves\n * to provide the default values of related configurations\n *\n * @public\n */\nexport interface RegionInfoProvider {\n  (region: string, options?: RegionInfoProviderOptions): Promise<RegionInfo | undefined>;\n}\n\n/**\n * Interface that specifies the retry behavior\n *\n * @public\n */\nexport interface RetryStrategy {\n  /**\n   * The retry mode describing how the retry strategy control the traffic flow.\n   */\n  mode?: string;\n  /**\n   * the retry behavior the will invoke the next handler and handle the retry accordingly.\n   * This function should also update the $metadata from the response accordingly.\n   * @see {@link ResponseMetadata}\n   */\n  retry: <Input extends object, Output extends MetadataBearer>(\n    next: FinalizeHandler<Input, Output>,\n    args: FinalizeHandlerArguments<Input>\n  ) => Promise<FinalizeHandlerOutput<Output>>;\n}\n\n/**\n * Indicates the parameter may be omitted if the parameter object T\n * is equivalent to a Partial<T>, i.e. all properties optional.\n *\n * @public\n */\nexport type OptionalParameter<T> = Exact<Partial<T>, T> extends true ? [] | [T] : [T];\n"
  },
  {
    "path": "packages/types/src/waiter.ts",
    "content": "import type { AbortController as DeprecatedAbortController } from \"./abort\";\n\n/**\n * @public\n */\nexport interface WaiterConfiguration<Client> {\n  /**\n   * Required service client\n   */\n  client: Client;\n\n  /**\n   * The amount of time in seconds a user is willing to wait for a waiter to complete.\n   */\n  maxWaitTime: number;\n\n  /**\n   * @deprecated Use abortSignal\n   * Abort controller. Used for ending the waiter early.\n   */\n  abortController?: AbortController | DeprecatedAbortController;\n\n  /**\n   * Abort Signal. Used for ending the waiter early.\n   */\n  abortSignal?: AbortController[\"signal\"] | DeprecatedAbortController[\"signal\"];\n\n  /**\n   * The minimum amount of time to delay between retries in seconds. This is the\n   * floor of the exponential backoff. This value defaults to service default\n   * if not specified. This value MUST be less than or equal to maxDelay and greater than 0.\n   */\n  minDelay?: number;\n\n  /**\n   * The maximum amount of time to delay between retries in seconds. This is the\n   * ceiling of the exponential backoff. This value defaults to service default\n   * if not specified. If specified, this value MUST be greater than or equal to 1.\n   */\n  maxDelay?: number;\n}\n"
  },
  {
    "path": "packages/types/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/types/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/types/tsconfig.test.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"rootDir\": \"src\",\n    \"noEmit\": true\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"],\n  \"exclude\": []\n}\n"
  },
  {
    "path": "packages/types/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\",\n    \"noCheck\": false\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/url-parser/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/url-parser/CHANGELOG.md",
    "content": "# @smithy/url-parser\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/url-parser/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/url-parser/package.json",
    "content": "{\n  \"name\": \"@smithy/url-parser\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/url-parser\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/url-parser\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/url-parser/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/protocols instead. */\nexport { parseUrl } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/url-parser/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/url-parser/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/url-parser/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-base64/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-base64/CHANGELOG.md",
    "content": "# @smithy/util-base64\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-base64/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-base64/package.json",
    "content": "{\n  \"name\": \"@smithy/util-base64\",\n  \"version\": \"4.4.3\",\n  \"description\": \"A Base64 <-> UInt8Array converter\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-base64\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-base64\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-base64/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { fromBase64, toBase64 } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-base64/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-base64/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-base64/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-body-length-browser/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-body-length-browser/CHANGELOG.md",
    "content": "# @smithy/util-body-length-browser\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-body-length-browser/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-body-length-browser/package.json",
    "content": "{\n  \"name\": \"@smithy/util-body-length-browser\",\n  \"description\": \"Determines the length of a request body in browsers\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-body-length-browser\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-body-length-browser\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  }\n}\n"
  },
  {
    "path": "packages/util-body-length-browser/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { calculateBodyLength } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-body-length-browser/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-body-length-browser/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [\"dom\"],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-body-length-browser/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-body-length-node/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-body-length-node/CHANGELOG.md",
    "content": "# @smithy/util-body-length-node\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-body-length-node/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-body-length-node/package.json",
    "content": "{\n  \"name\": \"@smithy/util-body-length-node\",\n  \"description\": \"Determines the length of a request body in node.js\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-body-length-node\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-body-length-node\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-body-length-node/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { calculateBodyLength } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-body-length-node/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-body-length-node/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": { \"baseUrl\": \".\", \"outDir\": \"dist-es\", \"rootDir\": \"src\" },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-body-length-node/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-buffer-from/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-buffer-from/CHANGELOG.md",
    "content": "# @smithy/util-buffer-from\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-buffer-from/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-buffer-from/package.json",
    "content": "{\n  \"name\": \"@smithy/util-buffer-from\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-buffer-from\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-buffer-from\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-buffer-from/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { fromArrayBuffer, fromString, type StringEncoding } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-buffer-from/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-buffer-from/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-buffer-from/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-config-provider/CHANGELOG.md",
    "content": "# @smithy/util-config-provider\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-config-provider/LICENSE",
    "content": "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 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-config-provider/package.json",
    "content": "{\n  \"name\": \"@smithy/util-config-provider\",\n  \"version\": \"4.3.3\",\n  \"description\": \"Utilities package for configuration providers\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"email\": \"\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-config-provider\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-config-provider\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-config-provider/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport { booleanSelector, numberSelector, SelectorType } from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/util-config-provider/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-config-provider/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-config-provider/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-browser/CHANGELOG.md",
    "content": "# @smithy/util-defaults-mode-browser\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-defaults-mode-browser/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/util-defaults-mode-browser/package.json",
    "content": "{\n  \"name\": \"@smithy/util-defaults-mode-browser\",\n  \"version\": \"4.4.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-defaults-mode-node\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-defaults-mode-node\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-browser/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport { resolveDefaultsModeConfig } from \"@smithy/core/config\";\nexport type { ResolveDefaultsModeConfigOptions } from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/util-defaults-mode-browser/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-browser/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": { \"baseUrl\": \".\", \"outDir\": \"dist-es\", \"rootDir\": \"src\" },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-browser/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-node/CHANGELOG.md",
    "content": "# @smithy/util-defaults-mode-node\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 62fed78: package consolidation for core/config\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-defaults-mode-node/LICENSE",
    "content": "                                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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "packages/util-defaults-mode-node/package.json",
    "content": "{\n  \"name\": \"@smithy/util-defaults-mode-node\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-defaults-mode-node\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-defaults-mode-node\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-node/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/config instead. */\nexport { resolveDefaultsModeConfig } from \"@smithy/core/config\";\nexport type { ResolveDefaultsModeConfigOptions } from \"@smithy/core/config\";\n"
  },
  {
    "path": "packages/util-defaults-mode-node/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-node/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": { \"baseUrl\": \".\", \"outDir\": \"dist-es\", \"rootDir\": \"src\" },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-defaults-mode-node/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-endpoints/CHANGELOG.md",
    "content": "# @smithy/util-endpoints\n\n## 3.5.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 3.5.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 3.5.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 3.5.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n- 9194e9f: consolidate into core/endpoints\n- 62fed78: package consolidation for core/config\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-endpoints/LICENSE",
    "content": "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 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-endpoints/package.json",
    "content": "{\n  \"name\": \"@smithy/util-endpoints\",\n  \"version\": \"3.5.3\",\n  \"description\": \"Utilities to help with endpoint resolution.\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"keywords\": [\n    \"endpoint\"\n  ],\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/master/packages/util-endpoints\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-endpoints\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-endpoints/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/endpoints instead. */\nexport {\n  BinaryDecisionDiagram,\n  EndpointCache,\n  decideEndpoint,\n  isIpAddress,\n  isValidHostLabel,\n  customEndpointFunctions,\n  resolveEndpoint,\n  EndpointError,\n} from \"@smithy/core/endpoints\";\nexport type {\n  ConditionObject,\n  DeprecatedObject,\n  EndpointFunctions,\n  EndpointObject,\n  EndpointObjectHeaders,\n  EndpointObjectProperties,\n  EndpointParams,\n  EndpointResolverOptions,\n  EndpointRuleObject,\n  ErrorRuleObject,\n  EvaluateOptions,\n  Expression,\n  FunctionArgv,\n  FunctionObject,\n  FunctionReturn,\n  ParameterObject,\n  ReferenceObject,\n  ReferenceRecord,\n  RuleSetObject,\n  RuleSetRules,\n  TreeRuleObject,\n} from \"@smithy/core/endpoints\";\n"
  },
  {
    "path": "packages/util-endpoints/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-endpoints/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-endpoints/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-hex-encoding/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-hex-encoding/CHANGELOG.md",
    "content": "# @smithy/util-hex-encoding\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-hex-encoding/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-hex-encoding/package.json",
    "content": "{\n  \"name\": \"@smithy/util-hex-encoding\",\n  \"version\": \"4.3.3\",\n  \"description\": \"Converts binary buffers to and from lowercase hexadecimal encoding\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-hex-encoding\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-hex-encoding\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-hex-encoding/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { fromHex, toHex } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-hex-encoding/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-hex-encoding/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-hex-encoding/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-middleware/CHANGELOG.md",
    "content": "# @smithy/util-middleware\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-middleware/LICENSE",
    "content": "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 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-middleware/package.json",
    "content": "{\n  \"name\": \"@smithy/util-middleware\",\n  \"version\": \"4.3.3\",\n  \"description\": \"Shared utilities for to be used in middleware packages.\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"keywords\": [\n    \"aws\",\n    \"middleware\"\n  ],\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/master/packages/util-middleware\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-middleware\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-middleware/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/client instead. */\nexport { getSmithyContext, normalizeProvider } from \"@smithy/core/client\";\n"
  },
  {
    "path": "packages/util-middleware/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-middleware/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-middleware/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-retry/CHANGELOG.md",
    "content": "# @smithy/util-retry\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-retry/LICENSE",
    "content": "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 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-retry/package.json",
    "content": "{\n  \"name\": \"@smithy/util-retry\",\n  \"version\": \"4.4.3\",\n  \"description\": \"Shared retry utilities to be used in middleware packages.\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"keywords\": [\n    \"aws\",\n    \"retry\"\n  ],\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/master/packages/util-retry\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-retry\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-retry/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/retry instead. */\nexport {\n  AdaptiveRetryStrategy,\n  ConfiguredRetryStrategy,\n  DefaultRateLimiter,\n  StandardRetryStrategy,\n  DEFAULT_MAX_ATTEMPTS,\n  DEFAULT_RETRY_DELAY_BASE,\n  DEFAULT_RETRY_MODE,\n  INITIAL_RETRY_TOKENS,\n  INVOCATION_ID_HEADER,\n  MAXIMUM_RETRY_DELAY,\n  REQUEST_HEADER,\n  NO_RETRY_INCREMENT,\n  RETRY_COST,\n  RETRY_MODES,\n  Retry,\n  THROTTLING_RETRY_DELAY_BASE,\n  TIMEOUT_RETRY_COST,\n} from \"@smithy/core/retry\";\nexport type {\n  AdaptiveRetryStrategyOptions,\n  DefaultRateLimiterOptions,\n  RateLimiter,\n  StandardRetryStrategyOptions,\n} from \"@smithy/core/retry\";\n"
  },
  {
    "path": "packages/util-retry/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-retry/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-retry/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-stream/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-stream/CHANGELOG.md",
    "content": "# @smithy/util-stream\n\n## 4.6.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.6.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.6.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.6.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-stream/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-stream/package.json",
    "content": "{\n  \"name\": \"@smithy/util-stream\",\n  \"version\": \"4.6.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"browser\": {},\n  \"react-native\": {},\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-stream\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-stream\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-stream/src/index.ts",
    "content": "/**\n * @deprecated Use @smithy/core/serde instead.\n */\nexport {\n  Uint8ArrayBlobAdapter,\n  ChecksumStream,\n  createChecksumStream,\n  createBufferedReadable,\n  getAwsChunkedEncodingStream,\n  headStream,\n  sdkStreamMixin,\n  splitStream,\n  isReadableStream,\n  isBlob,\n} from \"@smithy/core/serde\";\nexport type { ChecksumStreamInit } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-stream/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-stream/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": { \"baseUrl\": \".\", \"outDir\": \"dist-es\", \"rootDir\": \"src\" },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-stream/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-uri-escape/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-uri-escape/CHANGELOG.md",
    "content": "# @smithy/util-uri-escape\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 540aeb4: consolidate core/retry and related cleanup\n- 4f30af1: consolidation for core/protocols\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-uri-escape/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-uri-escape/package.json",
    "content": "{\n  \"name\": \"@smithy/util-uri-escape\",\n  \"version\": \"4.3.3\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-uri-escape\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-uri-escape\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-uri-escape/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/protocols instead. */\nexport { escapeUri, escapeUriPath } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "packages/util-uri-escape/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-uri-escape/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-uri-escape/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-utf8/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-utf8/CHANGELOG.md",
    "content": "# @smithy/util-utf8\n\n## 4.3.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.3.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.3.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.3.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-utf8/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-utf8/package.json",
    "content": "{\n  \"name\": \"@smithy/util-utf8\",\n  \"version\": \"4.3.3\",\n  \"description\": \"A UTF-8 string <-> UInt8Array converter\",\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-utf8\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-utf8\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-utf8/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { fromUtf8, toUint8Array, toUtf8 } from \"@smithy/core/serde\";\nexport type { StringEncoding } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/util-utf8/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-utf8/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-utf8/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-waiter/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/util-waiter/CHANGELOG.md",
    "content": "# @smithy/util-waiter\n\n## 4.4.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 4.4.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 4.4.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 4.4.0\n\n### Minor Changes\n\n- f21bf6b: consolidate packages into core/client\n\n### Patch Changes\n\n- 0be0b36: clean up exported API surface\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/util-waiter/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/util-waiter/package.json",
    "content": "{\n  \"name\": \"@smithy/util-waiter\",\n  \"version\": \"4.4.3\",\n  \"description\": \"Shared utilities for client waiters for the AWS SDK\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/util-waiter\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/util-waiter\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/util-waiter/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/client instead. */\nexport { createWaiter, waiterServiceDefaults, WaiterState, checkExceptions } from \"@smithy/core/client\";\nexport type { WaiterConfiguration, WaiterOptions, WaiterResult } from \"@smithy/core/client\";\n"
  },
  {
    "path": "packages/util-waiter/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-waiter/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/util-waiter/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/uuid/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "packages/uuid/CHANGELOG.md",
    "content": "# @smithy/uuid\n\n## 1.2.3\n\n### Patch Changes\n\n- @smithy/core@3.24.3\n\n## 1.2.2\n\n### Patch Changes\n\n- Updated dependencies [6d4eb8a]\n  - @smithy/core@3.24.2\n\n## 1.2.1\n\n### Patch Changes\n\n- Updated dependencies [2dc5cf6]\n- Updated dependencies [1d0ff86]\n  - @smithy/core@3.24.1\n\n## 1.2.0\n\n### Minor Changes\n\n- 8963b91: consolidate packages into core/serde\n\n### Patch Changes\n\n- Updated dependencies [ee92b6b]\n- Updated dependencies [540aeb4]\n- Updated dependencies [0be0b36]\n- Updated dependencies [4f30af1]\n- Updated dependencies [8963b91]\n- Updated dependencies [fb323fb]\n- Updated dependencies [9194e9f]\n- Updated dependencies [7ec62a0]\n- Updated dependencies [62fed78]\n- Updated dependencies [cad44fc]\n- Updated dependencies [545589a]\n- Updated dependencies [f21bf6b]\n- Updated dependencies [7fd6ac0]\n  - @smithy/core@3.24.0\n"
  },
  {
    "path": "packages/uuid/LICENSE",
    "content": "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 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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."
  },
  {
    "path": "packages/uuid/package.json",
    "content": "{\n  \"name\": \"@smithy/uuid\",\n  \"version\": \"1.2.3\",\n  \"description\": \"Polyfill for generating UUID v4\",\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"scripts\": {\n    \"build\": \"yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json\",\n    \"build:types\": \"yarn g:tsc -p tsconfig.types.json\",\n    \"clean\": \"rm -rf dist-cjs dist-es dist-types\",\n    \"stage-release\": \"rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\"\n  },\n  \"author\": {\n    \"name\": \"AWS SDK for JavaScript Team\",\n    \"url\": \"https://aws.amazon.com/javascript/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"sideEffects\": false,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript/tree/main/packages/uuid\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"packages/uuid\"\n  },\n  \"typedoc\": {\n    \"entryPoint\": \"src/index.ts\"\n  },\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "packages/uuid/src/index.ts",
    "content": "/** @deprecated Use @smithy/core/serde instead. */\nexport { v4 } from \"@smithy/core/serde\";\n"
  },
  {
    "path": "packages/uuid/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/uuid/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "packages/uuid/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\"\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "prettier.config.js",
    "content": "module.exports = {\n  // Custom\n  printWidth: 120,\n  trailingComma: \"es5\",\n  plugins: [\"@ianvs/prettier-plugin-sort-imports\"],\n  importOrder: [\"<THIRD_PARTY_MODULES>\", \"\", \"^[.]\"],\n  importOrderTypeScriptVersion: \"5.0.0\",\n  importOrderCaseSensitive: true,\n};\n"
  },
  {
    "path": "private/my-local-model/package.json",
    "content": "{\n  \"name\": \"xyz\",\n  \"description\": \"xyz client\",\n  \"version\": \"3.24.1\",\n  \"scripts\": {\n    \"build\": \"concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"prepack\": \"npm run clean && npm run build\",\n    \"test\": \"npx vitest run --passWithNoTests\",\n    \"test:watch\": \"npx vitest watch --passWithNoTests\",\n    \"test:integration\": \"npx vitest run --passWithNoTests -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"npx vitest watch --passWithNoTests -c vitest.config.integ.mts\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"module\": \"./dist-es/index.js\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@aws-crypto/sha256-browser\": \"5.2.0\",\n    \"@aws-crypto/sha256-js\": \"5.2.0\",\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/fetch-http-handler\": \"workspace:^\",\n    \"@smithy/node-http-handler\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@tsconfig/node20\": \"20.1.8\",\n    \"@types/node\": \"^20.14.8\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\",\n    \"vitest\": \"^4.0.17\"\n  },\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"private\": true,\n  \"browser\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.browser\"\n  },\n  \"react-native\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.native\"\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/src/XYZService.ts",
    "content": "// smithy-typescript generated code\nimport { type WaiterResult, createAggregatedClient } from \"@smithy/core/client\";\nimport type {\n  HttpHandlerOptions as __HttpHandlerOptions,\n  PaginationConfiguration,\n  Paginator,\n  WaiterConfiguration,\n} from \"@smithy/types\";\n\nimport {\n  type CamelCaseOperationCommandInput,\n  type CamelCaseOperationCommandOutput,\n  CamelCaseOperationCommand,\n} from \"./commands/CamelCaseOperationCommand\";\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"./commands/GetNumbersCommand\";\nimport {\n  type HttpLabelCommandCommandInput,\n  type HttpLabelCommandCommandOutput,\n  HttpLabelCommandCommand,\n} from \"./commands/HttpLabelCommandCommand\";\nimport {\n  type TradeEventStreamCommandInput,\n  type TradeEventStreamCommandOutput,\n  TradeEventStreamCommand,\n} from \"./commands/TradeEventStreamCommand\";\nimport type { HaltError } from \"./models/errors\";\nimport type { XYZServiceSyntheticServiceException } from \"./models/XYZServiceSyntheticServiceException\";\nimport { paginatecamelCaseOperation as paginateCamelCaseOperation } from \"./pagination/camelCaseOperationPaginator\";\nimport { paginateGetNumbers } from \"./pagination/GetNumbersPaginator\";\nimport { waitUntilNumbersAligned } from \"./waiters/waitForNumbersAligned\";\nimport { waitUntilNumbersMisaligned } from \"./waiters/waitForNumbersMisaligned\";\nimport { waitUntilNumbersWhatDoTheyDoAnyway } from \"./waiters/waitForNumbersWhatDoTheyDoAnyway\";\nimport { XYZServiceClient } from \"./XYZServiceClient\";\n\nconst commands = {\n  HttpLabelCommandCommand,\n  CamelCaseOperationCommand,\n  GetNumbersCommand,\n  TradeEventStreamCommand,\n};\nconst paginators = {\n  paginateCamelCaseOperation,\n  paginateGetNumbers,\n};\nconst waiters = {\n  waitUntilNumbersAligned,\n  waitUntilNumbersMisaligned,\n  waitUntilNumbersWhatDoTheyDoAnyway,\n};\n\nexport interface XYZService {\n  /**\n   * @see {@link HttpLabelCommandCommand}\n   */\n  httpLabelCommand(\n    args: HttpLabelCommandCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<HttpLabelCommandCommandOutput>;\n  httpLabelCommand(\n    args: HttpLabelCommandCommandInput,\n    cb: (err: any, data?: HttpLabelCommandCommandOutput) => void\n  ): void;\n  httpLabelCommand(\n    args: HttpLabelCommandCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: HttpLabelCommandCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link CamelCaseOperationCommand}\n   */\n  camelCaseOperation(): Promise<CamelCaseOperationCommandOutput>;\n  camelCaseOperation(\n    args: CamelCaseOperationCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<CamelCaseOperationCommandOutput>;\n  camelCaseOperation(\n    args: CamelCaseOperationCommandInput,\n    cb: (err: any, data?: CamelCaseOperationCommandOutput) => void\n  ): void;\n  camelCaseOperation(\n    args: CamelCaseOperationCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: CamelCaseOperationCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   */\n  getNumbers(): Promise<GetNumbersCommandOutput>;\n  getNumbers(\n    args: GetNumbersCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<GetNumbersCommandOutput>;\n  getNumbers(\n    args: GetNumbersCommandInput,\n    cb: (err: any, data?: GetNumbersCommandOutput) => void\n  ): void;\n  getNumbers(\n    args: GetNumbersCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: GetNumbersCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link TradeEventStreamCommand}\n   */\n  tradeEventStream(): Promise<TradeEventStreamCommandOutput>;\n  tradeEventStream(\n    args: TradeEventStreamCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<TradeEventStreamCommandOutput>;\n  tradeEventStream(\n    args: TradeEventStreamCommandInput,\n    cb: (err: any, data?: TradeEventStreamCommandOutput) => void\n  ): void;\n  tradeEventStream(\n    args: TradeEventStreamCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: TradeEventStreamCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link CamelCaseOperationCommand}\n   * @param args - command input.\n   * @param paginationConfig - optional pagination config.\n   * @returns AsyncIterable of {@link CamelCaseOperationCommandOutput}.\n   */\n  paginateCamelCaseOperation(\n    args?: CamelCaseOperationCommandInput,\n    paginationConfig?: Omit<PaginationConfiguration, \"client\">\n  ): Paginator<CamelCaseOperationCommandOutput>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param paginationConfig - optional pagination config.\n   * @returns AsyncIterable of {@link GetNumbersCommandOutput}.\n   */\n  paginateGetNumbers(\n    args?: GetNumbersCommandInput,\n    paginationConfig?: Omit<PaginationConfiguration, \"client\">\n  ): Paginator<GetNumbersCommandOutput>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\n   */\n  waitUntilNumbersAligned(\n    args: GetNumbersCommandInput,\n    waiterConfig: number | Omit<WaiterConfiguration<XYZService>, \"client\">\n  ): Promise<WaiterResult<GetNumbersCommandOutput>>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\n   */\n  waitUntilNumbersMisaligned(\n    args: GetNumbersCommandInput,\n    waiterConfig: number | Omit<WaiterConfiguration<XYZService>, \"client\">\n  ): Promise<WaiterResult<HaltError>>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\n   */\n  waitUntilNumbersWhatDoTheyDoAnyway(\n    args: GetNumbersCommandInput,\n    waiterConfig: number | Omit<WaiterConfiguration<XYZService>, \"client\">\n  ): Promise<WaiterResult<GetNumbersCommandOutput | HaltError>>;\n}\n\n/**\n * xyz interfaces\n * @public\n */\nexport class XYZService extends XYZServiceClient implements XYZService {}\ncreateAggregatedClient(commands, XYZService, { paginators, waiters });\n"
  },
  {
    "path": "private/my-local-model/src/XYZServiceClient.ts",
    "content": "// smithy-typescript generated code\nimport {\n  DefaultIdentityProviderConfig,\n  getHttpAuthSchemeEndpointRuleSetPlugin,\n  getHttpSigningPlugin,\n} from \"@smithy/core\";\nimport {\n  type DefaultsMode as __DefaultsMode,\n  type SmithyConfiguration as __SmithyConfiguration,\n  type SmithyResolvedConfiguration as __SmithyResolvedConfiguration,\n  Client as __Client,\n} from \"@smithy/core/client\";\nimport { type EndpointInputConfig, type EndpointResolvedConfig, resolveEndpointConfig } from \"@smithy/core/endpoints\";\nimport {\n  type EventStreamSerdeInputConfig,\n  type EventStreamSerdeResolvedConfig,\n  resolveEventStreamSerdeConfig,\n} from \"@smithy/core/event-streams\";\nimport { type HttpHandlerUserInput as __HttpHandlerUserInput, getContentLengthPlugin } from \"@smithy/core/protocols\";\nimport {\n  type RetryInputConfig,\n  type RetryResolvedConfig,\n  getRetryPlugin,\n  resolveRetryConfig,\n} from \"@smithy/core/retry\";\nimport type {\n  BodyLengthCalculator as __BodyLengthCalculator,\n  CheckOptionalClientConfig as __CheckOptionalClientConfig,\n  ChecksumConstructor as __ChecksumConstructor,\n  Decoder as __Decoder,\n  Encoder as __Encoder,\n  EventStreamSerdeProvider as __EventStreamSerdeProvider,\n  HashConstructor as __HashConstructor,\n  HttpHandlerOptions as __HttpHandlerOptions,\n  Logger as __Logger,\n  Provider as __Provider,\n  StreamCollector as __StreamCollector,\n  UrlParser as __UrlParser,\n} from \"@smithy/types\";\n\nimport {\n  type HttpAuthSchemeInputConfig,\n  type HttpAuthSchemeResolvedConfig,\n  defaultXYZServiceHttpAuthSchemeParametersProvider,\n  resolveHttpAuthSchemeConfig,\n} from \"./auth/httpAuthSchemeProvider\";\nimport type {\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput,\n} from \"./commands/CamelCaseOperationCommand\";\nimport type { GetNumbersCommandInput, GetNumbersCommandOutput } from \"./commands/GetNumbersCommand\";\nimport type { HttpLabelCommandCommandInput, HttpLabelCommandCommandOutput } from \"./commands/HttpLabelCommandCommand\";\nimport type { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from \"./commands/TradeEventStreamCommand\";\nimport {\n  type ClientInputEndpointParameters,\n  type ClientResolvedEndpointParameters,\n  type EndpointParameters,\n  resolveClientEndpointParameters,\n} from \"./endpoint/EndpointParameters\";\nimport { getRuntimeConfig as __getRuntimeConfig } from \"./runtimeConfig\";\nimport { type RuntimeExtension, type RuntimeExtensionsConfig, resolveRuntimeExtensions } from \"./runtimeExtensions\";\n\nexport { __Client };\n\n/**\n * @public\n */\nexport type ServiceInputTypes =\n  | CamelCaseOperationCommandInput\n  | GetNumbersCommandInput\n  | HttpLabelCommandCommandInput\n  | TradeEventStreamCommandInput;\n\n/**\n * @public\n */\nexport type ServiceOutputTypes =\n  | CamelCaseOperationCommandOutput\n  | GetNumbersCommandOutput\n  | HttpLabelCommandCommandOutput\n  | TradeEventStreamCommandOutput;\n\n/**\n * @public\n */\nexport interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {\n  /**\n   * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.\n   */\n  requestHandler?: __HttpHandlerUserInput;\n\n  /**\n   * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface\n   * that computes the SHA-256 HMAC or checksum of a string or binary buffer.\n   * @internal\n   */\n  sha256?: __ChecksumConstructor | __HashConstructor;\n\n  /**\n   * The function that will be used to convert strings into HTTP endpoints.\n   * @internal\n   */\n  urlParser?: __UrlParser;\n\n  /**\n   * A function that can calculate the length of a request body.\n   * @internal\n   */\n  bodyLengthChecker?: __BodyLengthCalculator;\n\n  /**\n   * A function that converts a stream into an array of bytes.\n   * @internal\n   */\n  streamCollector?: __StreamCollector;\n\n  /**\n   * The function that will be used to convert a base64-encoded string to a byte array.\n   * @internal\n   */\n  base64Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a base64-encoded string.\n   * @internal\n   */\n  base64Encoder?: __Encoder;\n\n  /**\n   * The function that will be used to convert a UTF8-encoded string to a byte array.\n   * @internal\n   */\n  utf8Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a UTF-8 encoded string.\n   * @internal\n   */\n  utf8Encoder?: __Encoder;\n\n  /**\n   * The runtime environment.\n   * @internal\n   */\n  runtime?: string;\n\n  /**\n   * Disable dynamically changing the endpoint of the client based on the hostPrefix\n   * trait of an operation.\n   */\n  disableHostPrefix?: boolean;\n\n  /**\n   * Value for how many times a request will be made at most in case of retry.\n   */\n  maxAttempts?: number | __Provider<number>;\n\n  /**\n   * Specifies which retry algorithm to use.\n   * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/\n   *\n   */\n  retryMode?: string | __Provider<string>;\n\n  /**\n   * Optional logger for logging debug/info/warn/error.\n   */\n  logger?: __Logger;\n\n  /**\n   * Optional extensions\n   */\n  extensions?: RuntimeExtension[];\n\n  /**\n   * The function that provides necessary utilities for generating and parsing event stream\n   */\n  eventStreamSerdeProvider?: __EventStreamSerdeProvider;\n\n  /**\n   * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.\n   */\n  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;\n}\n\n/**\n * @public\n */\nexport type XYZServiceClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &\n  ClientDefaults &\n  RetryInputConfig &\n  EndpointInputConfig<EndpointParameters> &\n  EventStreamSerdeInputConfig &\n  HttpAuthSchemeInputConfig &\n  ClientInputEndpointParameters;\n/**\n * @public\n *\n *  The configuration interface of XYZServiceClient class constructor that set the region, credentials and other options.\n */\nexport interface XYZServiceClientConfig extends XYZServiceClientConfigType {}\n\n/**\n * @public\n */\nexport type XYZServiceClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &\n  Required<ClientDefaults> &\n  RuntimeExtensionsConfig &\n  RetryResolvedConfig &\n  EndpointResolvedConfig<EndpointParameters> &\n  EventStreamSerdeResolvedConfig &\n  HttpAuthSchemeResolvedConfig &\n  ClientResolvedEndpointParameters;\n/**\n * @public\n *\n *  The resolved configuration interface of XYZServiceClient class. This is resolved and normalized from the {@link XYZServiceClientConfig | constructor configuration interface}.\n */\nexport interface XYZServiceClientResolvedConfig extends XYZServiceClientResolvedConfigType {}\n\n/**\n * xyz interfaces\n * @public\n */\nexport class XYZServiceClient extends __Client<\n  __HttpHandlerOptions,\n  ServiceInputTypes,\n  ServiceOutputTypes,\n  XYZServiceClientResolvedConfig\n> {\n  /**\n   * The resolved configuration of XYZServiceClient class. This is resolved and normalized from the {@link XYZServiceClientConfig | constructor configuration interface}.\n   */\n  readonly config: XYZServiceClientResolvedConfig;\n\n  constructor(...[configuration]: __CheckOptionalClientConfig<XYZServiceClientConfig>) {\n    const _config_0 = __getRuntimeConfig(configuration || {});\n    super(_config_0 as any);\n    this.initConfig = _config_0;\n    const _config_1 = resolveClientEndpointParameters(_config_0);\n    const _config_2 = resolveRetryConfig(_config_1);\n    const _config_3 = resolveEndpointConfig(_config_2);\n    const _config_4 = resolveEventStreamSerdeConfig(_config_3);\n    const _config_5 = resolveHttpAuthSchemeConfig(_config_4);\n    const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []);\n    this.config = _config_6;\n    this.middlewareStack.use(getRetryPlugin(this.config));\n    this.middlewareStack.use(getContentLengthPlugin(this.config));\n    this.middlewareStack.use(\n      getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n        httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,\n        identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>\n          new DefaultIdentityProviderConfig({\n            \"smithy.api#httpApiKeyAuth\": config.apiKey,\n          }),\n      })\n    );\n    this.middlewareStack.use(getHttpSigningPlugin(this.config));\n  }\n\n  /**\n   * Destroy underlying resources, like sockets. It's usually not necessary to do this.\n   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.\n   * Otherwise, sockets might stay open for quite a long time before the server terminates them.\n   */\n  destroy(): void {\n    super.destroy();\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/src/auth/httpAuthExtensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { ApiKeyIdentity, ApiKeyIdentityProvider, HttpAuthScheme } from \"@smithy/types\";\n\nimport type { XYZServiceHttpAuthSchemeProvider } from \"./httpAuthSchemeProvider\";\n\n/**\n * @internal\n */\nexport interface HttpAuthExtensionConfiguration {\n  setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;\n  httpAuthSchemes(): HttpAuthScheme[];\n  setHttpAuthSchemeProvider(httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider): void;\n  httpAuthSchemeProvider(): XYZServiceHttpAuthSchemeProvider;\n  setApiKey(apiKey: ApiKeyIdentity | ApiKeyIdentityProvider): void;\n  apiKey(): ApiKeyIdentity | ApiKeyIdentityProvider | undefined;\n}\n\n/**\n * @internal\n */\nexport type HttpAuthRuntimeConfig = Partial<{\n  httpAuthSchemes: HttpAuthScheme[];\n  httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider;\n  apiKey: ApiKeyIdentity | ApiKeyIdentityProvider;\n}>;\n\n/**\n * @internal\n */\nexport const getHttpAuthExtensionConfiguration = (\n  runtimeConfig: HttpAuthRuntimeConfig\n): HttpAuthExtensionConfiguration => {\n  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;\n  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;\n  let _apiKey = runtimeConfig.apiKey;\n  return {\n    setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {\n      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n      if (index === -1) {\n        _httpAuthSchemes.push(httpAuthScheme);\n      } else {\n        _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n      }\n    },\n    httpAuthSchemes(): HttpAuthScheme[] {\n      return _httpAuthSchemes;\n    },\n    setHttpAuthSchemeProvider(httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider): void {\n      _httpAuthSchemeProvider = httpAuthSchemeProvider;\n    },\n    httpAuthSchemeProvider(): XYZServiceHttpAuthSchemeProvider {\n      return _httpAuthSchemeProvider;\n    },\n    setApiKey(apiKey: ApiKeyIdentity | ApiKeyIdentityProvider): void {\n      _apiKey = apiKey;\n    },\n    apiKey(): ApiKeyIdentity | ApiKeyIdentityProvider | undefined {\n      return _apiKey;\n    },\n  };\n};\n\n/**\n * @internal\n */\nexport const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => {\n  return {\n    httpAuthSchemes: config.httpAuthSchemes(),\n    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n    apiKey: config.apiKey(),\n  };\n};\n"
  },
  {
    "path": "private/my-local-model/src/auth/httpAuthSchemeProvider.ts",
    "content": "// smithy-typescript generated code\nimport { doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider } from \"@smithy/core\";\nimport { getSmithyContext, normalizeProvider } from \"@smithy/core/client\";\nimport {\n  type ApiKeyIdentity,\n  type ApiKeyIdentityProvider,\n  type HandlerExecutionContext,\n  type HttpAuthOption,\n  type HttpAuthScheme,\n  type HttpAuthSchemeParameters,\n  type HttpAuthSchemeParametersProvider,\n  type HttpAuthSchemeProvider,\n  type Provider,\n  HttpApiKeyAuthLocation,\n} from \"@smithy/types\";\n\nimport type { XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @internal\n */\nexport interface XYZServiceHttpAuthSchemeParameters extends HttpAuthSchemeParameters {}\n\n/**\n * @internal\n */\nexport interface XYZServiceHttpAuthSchemeParametersProvider\n  extends HttpAuthSchemeParametersProvider<\n    XYZServiceClientResolvedConfig,\n    HandlerExecutionContext,\n    XYZServiceHttpAuthSchemeParameters,\n    object\n  > {}\n\n/**\n * @internal\n */\nexport const defaultXYZServiceHttpAuthSchemeParametersProvider = async (\n  config: XYZServiceClientResolvedConfig,\n  context: HandlerExecutionContext,\n  input: object\n): Promise<XYZServiceHttpAuthSchemeParameters> => {\n  return {\n    operation: getSmithyContext(context).operation as string,\n  };\n};\n\nfunction createSmithyApiHttpApiKeyAuthHttpAuthOption(authParameters: XYZServiceHttpAuthSchemeParameters): HttpAuthOption {\n  return {\n    schemeId: \"smithy.api#httpApiKeyAuth\",\n    signingProperties: {\n      name: \"X-Api-Key\",\n      in: HttpApiKeyAuthLocation.HEADER,\n      scheme: undefined,\n    },\n  };\n}\n\n/**\n * @internal\n */\nexport interface XYZServiceHttpAuthSchemeProvider extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}\n\n/**\n * @internal\n */\nexport const defaultXYZServiceHttpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider = (authParameters) => {\n  const options: HttpAuthOption[] = [];\n  switch (authParameters.operation) {\n    default: {\n      options.push(createSmithyApiHttpApiKeyAuthHttpAuthOption(authParameters));\n    }\n  }\n  return options;\n};\n\n/**\n * @public\n */\nexport interface HttpAuthSchemeInputConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  authSchemePreference?: string[] | Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  httpAuthSchemes?: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  httpAuthSchemeProvider?: XYZServiceHttpAuthSchemeProvider;\n  /**\n   * The API key to use when making requests.\n   */\n  apiKey?: ApiKeyIdentity | ApiKeyIdentityProvider;\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeResolvedConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  readonly authSchemePreference: Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  readonly httpAuthSchemes: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  readonly httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider;\n  /**\n   * The API key to use when making requests.\n   */\n  readonly apiKey?: ApiKeyIdentityProvider;\n}\n\n/**\n * @internal\n */\nexport const resolveHttpAuthSchemeConfig = <T>(\n  config: T & HttpAuthSchemeInputConfig\n): T & HttpAuthSchemeResolvedConfig => {\n  const apiKey = memoizeIdentityProvider(config.apiKey, isIdentityExpired, doesIdentityRequireRefresh);\n  return Object.assign(config, {\n    authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),\n    apiKey,\n  }) as T & HttpAuthSchemeResolvedConfig;\n};\n"
  },
  {
    "path": "private/my-local-model/src/commands/CamelCaseOperationCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { CamelCaseOperationInput, CamelCaseOperationOutput } from \"../models/models_0\";\nimport { de_CamelCaseOperationCommand, se_CamelCaseOperationCommand } from \"../protocols/Rpcv2cbor\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link CamelCaseOperationCommand}.\n */\nexport interface CamelCaseOperationCommandInput extends CamelCaseOperationInput {}\n/**\n * @public\n *\n * The output of {@link CamelCaseOperationCommand}.\n */\nexport interface CamelCaseOperationCommandOutput extends CamelCaseOperationOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, CamelCaseOperationCommand } from \"xyz\"; // ES Modules import\n * // const { XYZServiceClient, CamelCaseOperationCommand } = require(\"xyz\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // camelCaseOperationInput\n *   token: \"STRING_VALUE\",\n * };\n * const command = new CamelCaseOperationCommand(input);\n * const response = await client.send(command);\n * // { // camelCaseOperationOutput\n * //   token: \"STRING_VALUE\",\n * //   results: [ // Blobs\n * //     new Uint8Array(),\n * //   ],\n * // };\n *\n * ```\n *\n * @param CamelCaseOperationCommandInput - {@link CamelCaseOperationCommandInput}\n * @returns {@link CamelCaseOperationCommandOutput}\n * @see {@link CamelCaseOperationCommandInput} for command's `input` shape.\n * @see {@link CamelCaseOperationCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class CamelCaseOperationCommand extends $Command\n  .classBuilder<\n    CamelCaseOperationCommandInput,\n    CamelCaseOperationCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"XYZService\", \"camelCaseOperation\", {})\n  .n(\"XYZServiceClient\", \"CamelCaseOperationCommand\")\n  .f(void 0, void 0)\n  .ser(se_CamelCaseOperationCommand)\n  .de(de_CamelCaseOperationCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: CamelCaseOperationInput;\n      output: CamelCaseOperationOutput;\n    };\n    sdk: {\n      input: CamelCaseOperationCommandInput;\n      output: CamelCaseOperationCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model/src/commands/GetNumbersCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { GetNumbersRequest, GetNumbersResponse } from \"../models/models_0\";\nimport { de_GetNumbersCommand, se_GetNumbersCommand } from \"../protocols/Rpcv2cbor\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link GetNumbersCommand}.\n */\nexport interface GetNumbersCommandInput extends GetNumbersRequest {}\n/**\n * @public\n *\n * The output of {@link GetNumbersCommand}.\n */\nexport interface GetNumbersCommandOutput extends GetNumbersResponse, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, GetNumbersCommand } from \"xyz\"; // ES Modules import\n * // const { XYZServiceClient, GetNumbersCommand } = require(\"xyz\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // GetNumbersRequest\n *   bigDecimal: Number(\"bigdecimal\"),\n *   bigInteger: Number(\"bigint\"),\n *   fieldWithoutMessage: \"STRING_VALUE\",\n *   fieldWithMessage: \"STRING_VALUE\",\n *   startToken: \"STRING_VALUE\",\n *   maxResults: Number(\"int\"),\n *   customHeaderInput: \"STRING_VALUE\",\n *   numbers: { // IntegerMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n *   sparseNumbers: { // SparseIntegerMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n * };\n * const command = new GetNumbersCommand(input);\n * const response = await client.send(command);\n * // { // GetNumbersResponse\n * //   bigDecimal: Number(\"bigdecimal\"),\n * //   bigInteger: Number(\"bigint\"),\n * //   numbers: [ // IntegerList\n * //     Number(\"int\"),\n * //   ],\n * //   sparseNumbers: [ // SparseIntegerList\n * //     Number(\"int\"),\n * //   ],\n * //   nextToken: \"STRING_VALUE\",\n * //   deprecatedNumbers: [\n * //     Number(\"int\"),\n * //   ],\n * //   deprecatedNumbersWithoutExplanation: [\n * //     Number(\"int\"),\n * //   ],\n * //   deprecatedNumbersWithoutChronology: [\n * //     Number(\"int\"),\n * //   ],\n * //   inexplicablyDeprecatedNumbers: [\n * //     Number(\"int\"),\n * //   ],\n * // };\n *\n * ```\n *\n * @param GetNumbersCommandInput - {@link GetNumbersCommandInput}\n * @returns {@link GetNumbersCommandOutput}\n * @see {@link GetNumbersCommandInput} for command's `input` shape.\n * @see {@link GetNumbersCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link CodedThrottlingError} (client fault)\n *\n * @throws {@link MysteryThrottlingError} (client fault)\n *\n * @throws {@link RetryableError} (client fault)\n *\n * @throws {@link HaltError} (client fault)\n *\n * @throws {@link XYZServiceServiceException} (client fault)\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class GetNumbersCommand extends $Command\n  .classBuilder<\n    GetNumbersCommandInput,\n    GetNumbersCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep({\n    ...commonParams,\n    CustomHeaderValue: { type: \"contextParams\", name: \"customHeaderInput\" },\n  })\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"XYZService\", \"GetNumbers\", {})\n  .n(\"XYZServiceClient\", \"GetNumbersCommand\")\n  .f(void 0, void 0)\n  .ser(se_GetNumbersCommand)\n  .de(de_GetNumbersCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: GetNumbersRequest;\n      output: GetNumbersResponse;\n    };\n    sdk: {\n      input: GetNumbersCommandInput;\n      output: GetNumbersCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model/src/commands/HttpLabelCommandCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { HttpLabelCommandInput, HttpLabelCommandOutput } from \"../models/models_0\";\nimport { de_HttpLabelCommandCommand, se_HttpLabelCommandCommand } from \"../protocols/Rpcv2cbor\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link HttpLabelCommandCommand}.\n */\nexport interface HttpLabelCommandCommandInput extends HttpLabelCommandInput {}\n/**\n * @public\n *\n * The output of {@link HttpLabelCommandCommand}.\n */\nexport interface HttpLabelCommandCommandOutput extends HttpLabelCommandOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, HttpLabelCommandCommand } from \"xyz\"; // ES Modules import\n * // const { XYZServiceClient, HttpLabelCommandCommand } = require(\"xyz\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // HttpLabelCommandInput\n *   LabelDoesNotApplyToRpcProtocol: \"STRING_VALUE\", // required\n * };\n * const command = new HttpLabelCommandCommand(input);\n * const response = await client.send(command);\n * // {};\n *\n * ```\n *\n * @param HttpLabelCommandCommandInput - {@link HttpLabelCommandCommandInput}\n * @returns {@link HttpLabelCommandCommandOutput}\n * @see {@link HttpLabelCommandCommandInput} for command's `input` shape.\n * @see {@link HttpLabelCommandCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class HttpLabelCommandCommand extends $Command\n  .classBuilder<\n    HttpLabelCommandCommandInput,\n    HttpLabelCommandCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"XYZService\", \"HttpLabelCommand\", {})\n  .n(\"XYZServiceClient\", \"HttpLabelCommandCommand\")\n  .f(void 0, void 0)\n  .ser(se_HttpLabelCommandCommand)\n  .de(de_HttpLabelCommandCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: HttpLabelCommandInput;\n      output: {};\n    };\n    sdk: {\n      input: HttpLabelCommandCommandInput;\n      output: HttpLabelCommandCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model/src/commands/TradeEventStreamCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport {\n  type TradeEventStreamRequest,\n  type TradeEventStreamResponse,\n  TradeEventStreamRequestFilterSensitiveLog,\n  TradeEventStreamResponseFilterSensitiveLog,\n} from \"../models/models_0\";\nimport { de_TradeEventStreamCommand, se_TradeEventStreamCommand } from \"../protocols/Rpcv2cbor\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link TradeEventStreamCommand}.\n */\nexport interface TradeEventStreamCommandInput extends TradeEventStreamRequest {}\n/**\n * @public\n *\n * The output of {@link TradeEventStreamCommand}.\n */\nexport interface TradeEventStreamCommandOutput extends TradeEventStreamResponse, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, TradeEventStreamCommand } from \"xyz\"; // ES Modules import\n * // const { XYZServiceClient, TradeEventStreamCommand } = require(\"xyz\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // TradeEventStreamRequest\n *   eventStream: { // TradeEvents Union: only one key present\n *     alpha: { // Alpha\n *       id: \"STRING_VALUE\",\n *       timestamp: new Date(\"TIMESTAMP\"),\n *     },\n *     beta: {},\n *     gamma: {},\n *     delta: { // DifferentShapeName\n *       name: \"STRING_VALUE\",\n *       number: Number(\"int\"),\n *     },\n *   },\n * };\n * const command = new TradeEventStreamCommand(input);\n * const response = await client.send(command);\n * // { // TradeEventStreamResponse\n * //   eventStream: { // TradeEvents Union: only one key present\n * //     alpha: { // Alpha\n * //       id: \"STRING_VALUE\",\n * //       timestamp: new Date(\"TIMESTAMP\"),\n * //     },\n * //     beta: {},\n * //     gamma: {},\n * //     delta: { // DifferentShapeName\n * //       name: \"STRING_VALUE\",\n * //       number: Number(\"int\"),\n * //     },\n * //   },\n * // };\n *\n * ```\n *\n * @param TradeEventStreamCommandInput - {@link TradeEventStreamCommandInput}\n * @returns {@link TradeEventStreamCommandOutput}\n * @see {@link TradeEventStreamCommandInput} for command's `input` shape.\n * @see {@link TradeEventStreamCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class TradeEventStreamCommand extends $Command\n  .classBuilder<\n    TradeEventStreamCommandInput,\n    TradeEventStreamCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"XYZService\", \"TradeEventStream\", {\n    /**\n     * @internal\n     */\n    eventStream: {\n      input: true,\n      output: true,\n    },\n  })\n  .n(\"XYZServiceClient\", \"TradeEventStreamCommand\")\n  .f(TradeEventStreamRequestFilterSensitiveLog, TradeEventStreamResponseFilterSensitiveLog)\n  .ser(se_TradeEventStreamCommand)\n  .de(de_TradeEventStreamCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: TradeEventStreamRequest;\n      output: TradeEventStreamResponse;\n    };\n    sdk: {\n      input: TradeEventStreamCommandInput;\n      output: TradeEventStreamCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model/src/commands/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./CamelCaseOperationCommand\";\nexport * from \"./GetNumbersCommand\";\nexport * from \"./HttpLabelCommandCommand\";\nexport * from \"./TradeEventStreamCommand\";\n"
  },
  {
    "path": "private/my-local-model/src/endpoint/EndpointParameters.ts",
    "content": "// smithy-typescript generated code\nimport type { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface ClientInputEndpointParameters {\n  clientContextParams?: {\n    apiKey?: string | undefined | Provider<string | undefined>;\n    region?: string | undefined | Provider<string | undefined>;\n    customParam?: string | undefined | Provider<string | undefined>;\n    enableFeature?: boolean | undefined | Provider<boolean | undefined>;\n    debugMode?: boolean | undefined | Provider<boolean | undefined>;\n    nonConflictingParam?: string | undefined | Provider<string | undefined>;\n    logger?: string | undefined | Provider<string | undefined>;\n  };\n  endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n  customParam?: string | undefined | Provider<string | undefined>;\n  enableFeature?: boolean | undefined | Provider<boolean | undefined>;\n  debugMode?: boolean | undefined | Provider<boolean | undefined>;\n  nonConflictingParam?: string | undefined | Provider<string | undefined>;\n}\n\n/**\n * @public\n */\nexport type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, \"endpoint\"> & {\n  defaultSigningName: string;\n};\n\n/**\n * @internal\n */\nconst clientContextParamDefaults = {\n  logger: \"default-logger\",\n} as const;\n\n/**\n * @internal\n */\nexport const resolveClientEndpointParameters = <T>(\n  options: T & ClientInputEndpointParameters\n): T & ClientResolvedEndpointParameters => {\n  return Object.assign(options, {\n    customParam: options.customParam ?? \"default-custom-value\",\n    enableFeature: options.enableFeature ?? true,\n    debugMode: options.debugMode ?? false,\n    nonConflictingParam: options.nonConflictingParam ?? \"non-conflict-default\",\n    defaultSigningName: \"\",\n    clientContextParams: Object.assign(clientContextParamDefaults, options.clientContextParams),\n  });\n};\n\n/**\n * @internal\n */\nexport const commonParams = {\n  ApiKey: { type: \"clientContextParams\", name: \"apiKey\" },\n  nonConflictingParam: { type: \"clientContextParams\", name: \"nonConflictingParam\" },\n  logger: { type: \"clientContextParams\", name: \"logger\" },\n  region: { type: \"clientContextParams\", name: \"region\" },\n  customParam: { type: \"clientContextParams\", name: \"customParam\" },\n  debugMode: { type: \"clientContextParams\", name: \"debugMode\" },\n  enableFeature: { type: \"clientContextParams\", name: \"enableFeature\" },\n  endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n} as const;\n\n/**\n * @internal\n */\nexport interface EndpointParameters extends __EndpointParameters {\n  endpoint?: string | undefined;\n  ApiKey?: string | undefined;\n  region?: string | undefined;\n  customParam?: string | undefined;\n  enableFeature?: boolean | undefined;\n  debugMode?: boolean | undefined;\n  nonConflictingParam?: string | undefined;\n  logger?: string | undefined;\n  CustomHeaderValue?: string | undefined;\n}\n"
  },
  {
    "path": "private/my-local-model/src/endpoint/bdd.ts",
    "content": "// smithy-typescript generated code\nimport { BinaryDecisionDiagram } from \"@smithy/core/endpoints\";\n\nconst d=\"x-api-key\";\nconst a=\"isSet\",\nb=\"{endpoint}\",\nc=[\"{ApiKey}\"];\nconst _data={\n  conditions: [\n    [a,[{ref:\"endpoint\"}]],\n    [a,[{ref:\"ApiKey\"}]],\n    [a,[{ref:\"CustomHeaderValue\"}]]\n  ],\n  results: [\n    [-1],\n    [b,{},{[d]:c,\"x-custom-header\":[\"{CustomHeaderValue}\"]}],\n    [b,{},{[d]:c}],\n    [b,{}],\n    [-1,\"endpoint is not set - you must configure an endpoint.\"]\n  ]\n};\n\nconst root = 2;\nconst r = 100_000_000;\nconst nodes = new Int32Array([\n  -1, 1, -1,\n  0, 3, r + 4,\n  1, 4, r + 3,\n  2, r + 1, r + 2,\n]);\nexport const bdd = BinaryDecisionDiagram.from(\n  nodes, root, _data.conditions, _data.results\n);\n"
  },
  {
    "path": "private/my-local-model/src/endpoint/endpointResolver.ts",
    "content": "// smithy-typescript generated code\nimport { type EndpointParams, decideEndpoint, EndpointCache } from \"@smithy/core/endpoints\";\nimport type { EndpointV2, Logger } from \"@smithy/types\";\n\nimport { bdd } from \"./bdd\";\nimport type { EndpointParameters } from \"./EndpointParameters\";\n\nconst cache = new EndpointCache({\n  size: 50,\n  params: [\"ApiKey\", \"CustomHeaderValue\", \"endpoint\"],\n});\n\n/**\n * @internal\n */\nexport const defaultEndpointResolver = (\n  endpointParams: EndpointParameters,\n  context: { logger?: Logger } = {}\n): EndpointV2 => {\n  return cache.get(endpointParams as EndpointParams, () =>\n    decideEndpoint(bdd, {\n      endpointParams: endpointParams as EndpointParams,\n      logger: context.logger,\n    })\n  );\n};\n"
  },
  {
    "path": "private/my-local-model/src/extensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { HttpHandlerExtensionConfiguration } from \"@smithy/core/protocols\";\nimport type { DefaultExtensionConfiguration } from \"@smithy/types\";\n\nimport type { HttpAuthExtensionConfiguration } from \"./auth/httpAuthExtensionConfiguration\";\n\n/**\n * @internal\n */\nexport interface XYZServiceExtensionConfiguration\n  extends HttpHandlerExtensionConfiguration,\n    DefaultExtensionConfiguration,\n    HttpAuthExtensionConfiguration {}\n"
  },
  {
    "path": "private/my-local-model/src/index.ts",
    "content": "// smithy-typescript generated code\n/* eslint-disable */\n/**\n * xyz interfaces\n *\n * @packageDocumentation\n */\nexport * from \"./XYZServiceClient\";\nexport * from \"./XYZService\";\nexport type { ClientInputEndpointParameters } from \"./endpoint/EndpointParameters\";\nexport type { RuntimeExtension } from \"./runtimeExtensions\";\nexport type { XYZServiceExtensionConfiguration } from \"./extensionConfiguration\";\nexport * from \"./commands\";\nexport * from \"./pagination\";\nexport * from \"./waiters\";\n\nexport * from \"./models/errors\";\nexport * from \"./models/models_0\";\n\nexport { XYZServiceSyntheticServiceException } from \"./models/XYZServiceSyntheticServiceException\";\n"
  },
  {
    "path": "private/my-local-model/src/models/XYZServiceSyntheticServiceException.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type ServiceExceptionOptions as __ServiceExceptionOptions,\n  ServiceException as __ServiceException,\n} from \"@smithy/core/client\";\n\nexport type { __ServiceExceptionOptions };\n\nexport { __ServiceException };\n\n/**\n * @public\n *\n * Base exception class for all service exceptions from XYZService service.\n */\nexport class XYZServiceSyntheticServiceException extends __ServiceException {\n  /**\n   * @internal\n   */\n  constructor(options: __ServiceExceptionOptions) {\n    super(options);\n    Object.setPrototypeOf(this, XYZServiceSyntheticServiceException.prototype);\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/src/models/errors.ts",
    "content": "// smithy-typescript generated code\nimport type { ExceptionOptionType as __ExceptionOptionType } from \"@smithy/core/client\";\n\nimport { XYZServiceSyntheticServiceException as __BaseException } from \"./XYZServiceSyntheticServiceException\";\n\n/**\n * @public\n */\nexport class MainServiceLinkedError extends __BaseException {\n  readonly name = \"MainServiceLinkedError\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<MainServiceLinkedError, __BaseException>) {\n    super({\n      name: \"MainServiceLinkedError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, MainServiceLinkedError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class CodedThrottlingError extends __BaseException {\n  readonly name = \"CodedThrottlingError\" as const;\n  readonly $fault = \"client\" as const;\n  $retryable = {\n    throttling: true,\n  };\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<CodedThrottlingError, __BaseException>) {\n    super({\n      name: \"CodedThrottlingError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, CodedThrottlingError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class HaltError extends __BaseException {\n  readonly name = \"HaltError\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<HaltError, __BaseException>) {\n    super({\n      name: \"HaltError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, HaltError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class MysteryThrottlingError extends __BaseException {\n  readonly name = \"MysteryThrottlingError\" as const;\n  readonly $fault = \"client\" as const;\n  $retryable = {\n    throttling: true,\n  };\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<MysteryThrottlingError, __BaseException>) {\n    super({\n      name: \"MysteryThrottlingError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, MysteryThrottlingError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class RetryableError extends __BaseException {\n  readonly name = \"RetryableError\" as const;\n  readonly $fault = \"client\" as const;\n  $retryable = {};\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<RetryableError, __BaseException>) {\n    super({\n      name: \"RetryableError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, RetryableError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class XYZServiceServiceException extends __BaseException {\n  readonly name = \"XYZServiceServiceException\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<XYZServiceServiceException, __BaseException>) {\n    super({\n      name: \"XYZServiceServiceException\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, XYZServiceServiceException.prototype);\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/src/models/models_0.ts",
    "content": "// smithy-typescript generated code\nimport type { NumericValue } from \"@smithy/core/serde\";\n\n/**\n * @public\n */\nexport interface HttpLabelCommandInput {\n  LabelDoesNotApplyToRpcProtocol: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface HttpLabelCommandOutput {}\n\n/**\n * @public\n */\nexport interface Alpha {\n  id?: string | undefined;\n  timestamp?: Date | undefined;\n}\n\n/**\n * @public\n */\nexport interface CamelCaseOperationInput {\n  token?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface CamelCaseOperationOutput {\n  token?: string | undefined;\n  results?: Uint8Array[] | undefined;\n}\n\n/**\n * @public\n */\nexport interface DifferentShapeName {\n  name?: string | undefined;\n  number?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface GetNumbersRequest {\n  bigDecimal?: NumericValue | undefined;\n  bigInteger?: bigint | undefined;\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated deprecated.\n   * @public\n   */\n  fieldWithoutMessage?: string | undefined;\n\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated (since 3.0) This field has been deprecated.\n   * @public\n   */\n  fieldWithMessage?: string | undefined;\n\n  startToken?: string | undefined;\n  maxResults?: number | undefined;\n  customHeaderInput?: string | undefined;\n  numbers?: Record<string, number> | undefined;\n  sparseNumbers?: Record<string, number | null> | undefined;\n}\n\n/**\n * @public\n */\nexport interface GetNumbersResponse {\n  bigDecimal?: NumericValue | undefined;\n  bigInteger?: bigint | undefined;\n  numbers?: number[] | undefined;\n  sparseNumbers?: (number | null)[] | undefined;\n  nextToken?: string | undefined;\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated (since 1685-12-31) these numbers are not used anymore.\n   * @public\n   */\n  deprecatedNumbers?: number[] | undefined;\n\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated since 1685-12-31.\n   * @public\n   */\n  deprecatedNumbersWithoutExplanation?: number[] | undefined;\n\n  /**\n   * @deprecated these numbers are not used anymore??\n   * @public\n   */\n  deprecatedNumbersWithoutChronology?: number[] | undefined;\n\n  /**\n   * @deprecated deprecated.\n   * @public\n   */\n  inexplicablyDeprecatedNumbers?: number[] | undefined;\n}\n\n/**\n * @public\n */\nexport interface Unit {}\n\n/**\n * @public\n */\nexport type TradeEvents =\n  | TradeEvents.AlphaMember\n  | TradeEvents.BetaMember\n  | TradeEvents.DeltaMember\n  | TradeEvents.GammaMember\n  | TradeEvents.$UnknownMember;\n\n/**\n * @public\n */\nexport namespace TradeEvents {\n  export interface AlphaMember {\n    alpha: Alpha;\n    beta?: never;\n    gamma?: never;\n    delta?: never;\n    $unknown?: never;\n  }\n\n  export interface BetaMember {\n    alpha?: never;\n    beta: Unit;\n    gamma?: never;\n    delta?: never;\n    $unknown?: never;\n  }\n\n  export interface GammaMember {\n    alpha?: never;\n    beta?: never;\n    gamma: Unit;\n    delta?: never;\n    $unknown?: never;\n  }\n\n  export interface DeltaMember {\n    alpha?: never;\n    beta?: never;\n    gamma?: never;\n    delta: DifferentShapeName;\n    $unknown?: never;\n  }\n\n  /**\n   * @public\n   */\n  export interface $UnknownMember {\n    alpha?: never;\n    beta?: never;\n    gamma?: never;\n    delta?: never;\n    $unknown: [string, any];\n  }\n\n  export interface Visitor<T> {\n    alpha: (value: Alpha) => T;\n    beta: (value: Unit) => T;\n    gamma: (value: Unit) => T;\n    delta: (value: DifferentShapeName) => T;\n    _: (name: string, value: any) => T;\n  }\n\n  export const visit = <T>(value: TradeEvents, visitor: Visitor<T>): T => {\n    if (value.alpha !== undefined) return visitor.alpha(value.alpha);\n    if (value.beta !== undefined) return visitor.beta(value.beta);\n    if (value.gamma !== undefined) return visitor.gamma(value.gamma);\n    if (value.delta !== undefined) return visitor.delta(value.delta);\n    return visitor._(value.$unknown[0], value.$unknown[1]);\n  };\n}\n/**\n * @internal\n */\nexport const TradeEventsFilterSensitiveLog = (obj: TradeEvents): any => {\n  if (obj.alpha !== undefined) {\n    return {\n      alpha: obj.alpha\n    };\n  }\n  if (obj.beta !== undefined) {\n    return {\n      beta: obj.beta\n    };\n  }\n  if (obj.gamma !== undefined) {\n    return {\n      gamma: obj.gamma\n    };\n  }\n  if (obj.delta !== undefined) {\n    return {\n      delta: obj.delta\n    };\n  }\n  if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: \"UNKNOWN\" };\n}\n\n/**\n * @public\n */\nexport interface TradeEventStreamRequest {\n  eventStream?: AsyncIterable<TradeEvents> | undefined;\n}\n\n/**\n * @internal\n */\nexport const TradeEventStreamRequestFilterSensitiveLog = (obj: TradeEventStreamRequest): any => ({\n  ...obj,\n  ...(obj.eventStream && { eventStream:\n    'STREAMING_CONTENT'\n  }),\n})\n\n/**\n * @public\n */\nexport interface TradeEventStreamResponse {\n  eventStream?: AsyncIterable<TradeEvents> | undefined;\n}\n\n/**\n * @internal\n */\nexport const TradeEventStreamResponseFilterSensitiveLog = (obj: TradeEventStreamResponse): any => ({\n  ...obj,\n  ...(obj.eventStream && { eventStream:\n    'STREAMING_CONTENT'\n  }),\n})\n"
  },
  {
    "path": "private/my-local-model/src/pagination/GetNumbersPaginator.ts",
    "content": "// smithy-typescript generated code\nimport { createPaginator } from \"@smithy/core\";\nimport type { Paginator } from \"@smithy/types\";\n\nimport { GetNumbersCommand, GetNumbersCommandInput, GetNumbersCommandOutput } from \"../commands/GetNumbersCommand\";\nimport { XYZServiceClient } from \"../XYZServiceClient\";\nimport type { XYZServicePaginationConfiguration } from \"./Interfaces\";\n\n/**\n * @public\n */\nexport const paginateGetNumbers: (\n  config: XYZServicePaginationConfiguration,\n  input: GetNumbersCommandInput,\n  ...rest: any[]\n) => Paginator<GetNumbersCommandOutput> = createPaginator<\n  XYZServicePaginationConfiguration,\n  GetNumbersCommandInput,\n  GetNumbersCommandOutput\n>(XYZServiceClient, GetNumbersCommand, \"startToken\", \"nextToken\", \"maxResults\");\n"
  },
  {
    "path": "private/my-local-model/src/pagination/Interfaces.ts",
    "content": "// smithy-typescript generated code\nimport type { PaginationConfiguration } from \"@smithy/types\";\n\nimport { XYZServiceClient } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport interface XYZServicePaginationConfiguration extends PaginationConfiguration {\n  client: XYZServiceClient;\n}\n"
  },
  {
    "path": "private/my-local-model/src/pagination/camelCaseOperationPaginator.ts",
    "content": "// smithy-typescript generated code\nimport { createPaginator } from \"@smithy/core\";\nimport type { Paginator } from \"@smithy/types\";\n\nimport {\n  CamelCaseOperationCommand,\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput,\n} from \"../commands/CamelCaseOperationCommand\";\nimport { XYZServiceClient } from \"../XYZServiceClient\";\nimport type { XYZServicePaginationConfiguration } from \"./Interfaces\";\n\n/**\n * @public\n */\nexport const paginatecamelCaseOperation: (\n  config: XYZServicePaginationConfiguration,\n  input: CamelCaseOperationCommandInput,\n  ...rest: any[]\n) => Paginator<CamelCaseOperationCommandOutput> = createPaginator<\n  XYZServicePaginationConfiguration,\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput\n>(XYZServiceClient, CamelCaseOperationCommand, \"token\", \"token\", \"\");\n"
  },
  {
    "path": "private/my-local-model/src/pagination/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./Interfaces\";\nexport * from \"./camelCaseOperationPaginator\";\nexport * from \"./GetNumbersPaginator\";\n"
  },
  {
    "path": "private/my-local-model/src/protocols/Rpcv2cbor.ts",
    "content": "// smithy-typescript generated code\nimport {\n  buildHttpRpcRequest,\n  cbor,\n  checkCborResponse as cr,\n  dateToTag as __dateToTag,\n  loadSmithyRpcV2CborErrorCode,\n  parseCborBody as parseBody,\n  parseCborErrorBody as parseErrorBody,\n} from \"@smithy/core/cbor\";\nimport {\n  _json,\n  decorateServiceException as __decorateServiceException,\n  take,\n  withBaseException,\n} from \"@smithy/core/client\";\nimport {\n  type HttpRequest as __HttpRequest,\n  type HttpResponse as __HttpResponse,\n  collectBody,\n} from \"@smithy/core/protocols\";\nimport {\n  expectInt32 as __expectInt32,\n  expectNonNull as __expectNonNull,\n  expectString as __expectString,\n  nv as __nv,\n  parseEpochTimestamp as __parseEpochTimestamp,\n} from \"@smithy/core/serde\";\nimport type {\n  Endpoint as __Endpoint,\n  EventStreamSerdeContext as __EventStreamSerdeContext,\n  HeaderBag as __HeaderBag,\n  Message as __Message,\n  MessageHeaders as __MessageHeaders,\n  ResponseMetadata as __ResponseMetadata,\n  SerdeContext as __SerdeContext,\n} from \"@smithy/types\";\n\nimport type {\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput,\n} from \"../commands/CamelCaseOperationCommand\";\nimport type { GetNumbersCommandInput, GetNumbersCommandOutput } from \"../commands/GetNumbersCommand\";\nimport type { HttpLabelCommandCommandInput, HttpLabelCommandCommandOutput } from \"../commands/HttpLabelCommandCommand\";\nimport type { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from \"../commands/TradeEventStreamCommand\";\nimport {\n  CodedThrottlingError,\n  HaltError,\n  MainServiceLinkedError,\n  MysteryThrottlingError,\n  RetryableError,\n  XYZServiceServiceException,\n} from \"../models/errors\";\nimport {\n  type Alpha,\n  type CamelCaseOperationInput,\n  type CamelCaseOperationOutput,\n  type DifferentShapeName,\n  type GetNumbersRequest,\n  type GetNumbersResponse,\n  type HttpLabelCommandInput,\n  type Unit,\n  TradeEvents,\n} from \"../models/models_0\";\nimport { XYZServiceSyntheticServiceException as __BaseException } from \"../models/XYZServiceSyntheticServiceException\";\n\n/**\n * serializeRpcv2cborHttpLabelCommandCommand\n */\nexport const se_HttpLabelCommandCommand = async (\n  input: HttpLabelCommandCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(_json(input));\n  return buildHttpRpcRequest(context, headers, \"/service/XYZService/operation/HttpLabelCommand\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborCamelCaseOperationCommand\n */\nexport const se_CamelCaseOperationCommand = async (\n  input: CamelCaseOperationCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(_json(input));\n  return buildHttpRpcRequest(context, headers, \"/service/XYZService/operation/camelCaseOperation\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborGetNumbersCommand\n */\nexport const se_GetNumbersCommand = async (\n  input: GetNumbersCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_GetNumbersRequest(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/XYZService/operation/GetNumbers\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborTradeEventStreamCommand\n */\nexport const se_TradeEventStreamCommand = async (\n  input: TradeEventStreamCommandInput,\n  context: __SerdeContext & __EventStreamSerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = { ...SHARED_HEADERS };\n  headers.accept = \"application/vnd.amazon.eventstream\";\n\n  headers[\"content-type\"] = \"application/vnd.amazon.eventstream\";\n\n  let body: any;\n  body = se_TradeEvents(input.eventStream, context);\n  return buildHttpRpcRequest(context, headers, \"/service/XYZService/operation/TradeEventStream\", undefined, body);\n};\n\n/**\n * deserializeRpcv2cborHttpLabelCommandCommand\n */\nexport const de_HttpLabelCommandCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<HttpLabelCommandCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = _json(data);\n  const response: HttpLabelCommandCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborCamelCaseOperationCommand\n */\nexport const de_CamelCaseOperationCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<CamelCaseOperationCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_CamelCaseOperationOutput(data, context);\n  const response: CamelCaseOperationCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborGetNumbersCommand\n */\nexport const de_GetNumbersCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<GetNumbersCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_GetNumbersResponse(data, context);\n  const response: GetNumbersCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborTradeEventStreamCommand\n */\nexport const de_TradeEventStreamCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext & __EventStreamSerdeContext\n): Promise<TradeEventStreamCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const contents = { eventStream: de_TradeEvents(output.body, context) };\n  const response: TradeEventStreamCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserialize_Rpcv2cborCommandError\n */\nconst de_CommandError = async (\n  output: __HttpResponse,\n  context: __SerdeContext,\n): Promise<never> => {\n  const parsedOutput: any = {\n    ...output,\n    body: await parseErrorBody(output.body, context)\n  };\n  const errorCode = loadSmithyRpcV2CborErrorCode(output, parsedOutput.body);\n  switch (errorCode) {\n    case \"MainServiceLinkedError\":\n    case \"org.xyz.v1#MainServiceLinkedError\":\n      throw await de_MainServiceLinkedErrorRes(parsedOutput, context);\n    case \"CodedThrottlingError\":\n    case \"org.xyz.v1#CodedThrottlingError\":\n      throw await de_CodedThrottlingErrorRes(parsedOutput, context);\n    case \"HaltError\":\n    case \"org.xyz.v1#HaltError\":\n      throw await de_HaltErrorRes(parsedOutput, context);\n    case \"MysteryThrottlingError\":\n    case \"org.xyz.v1#MysteryThrottlingError\":\n      throw await de_MysteryThrottlingErrorRes(parsedOutput, context);\n    case \"RetryableError\":\n    case \"org.xyz.v1#RetryableError\":\n      throw await de_RetryableErrorRes(parsedOutput, context);\n    case \"XYZServiceServiceException\":\n    case \"org.xyz.v1#XYZServiceServiceException\":\n      throw await de_XYZServiceServiceExceptionRes(parsedOutput, context);\n    default:\n      const parsedBody = parsedOutput.body;\n      return throwDefaultError({\n        output,\n        parsedBody,\n        errorCode\n      }) as never;\n  }\n}\n\n/**\n * deserializeRpcv2cborCodedThrottlingErrorRes\n */\nconst de_CodedThrottlingErrorRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<CodedThrottlingError> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new CodedThrottlingError({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborHaltErrorRes\n */\nconst de_HaltErrorRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<HaltError> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new HaltError({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborMainServiceLinkedErrorRes\n */\nconst de_MainServiceLinkedErrorRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<MainServiceLinkedError> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new MainServiceLinkedError({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborMysteryThrottlingErrorRes\n */\nconst de_MysteryThrottlingErrorRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<MysteryThrottlingError> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new MysteryThrottlingError({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborRetryableErrorRes\n */\nconst de_RetryableErrorRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<RetryableError> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new RetryableError({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborXYZServiceServiceExceptionRes\n */\nconst de_XYZServiceServiceExceptionRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<XYZServiceServiceException> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new XYZServiceServiceException({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * serializeRpcv2cborTradeEvents\n */\nconst se_TradeEvents = (\n  input: any,\n  context: __SerdeContext & __EventStreamSerdeContext\n): any => {\n  const eventMarshallingVisitor = (event: any): __Message => TradeEvents.visit(event, {\n    alpha: value => se_Alpha_event(value, context),\n    beta: value => se_Unit_event(value, context),\n    gamma: value => se_Unit_event(value, context),\n    delta: value => se_DifferentShapeName_event(value, context),\n    _: value => value as any\n  });\n  return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);\n}\nconst se_Alpha_event = (\n  input: Alpha,\n  context: __SerdeContext\n): __Message => {\n  const headers: __MessageHeaders = {\n    \":event-type\": { type: \"string\", value: \"alpha\" },\n    \":message-type\": { type: \"string\", value: \"event\" },\n    \":content-type\": { type: \"string\", value: \"application/cbor\" },\n  }\n  let body = new Uint8Array();\n  body = se_Alpha(input, context);\n  body = cbor.serialize(body);\n  return { headers, body };\n  }\n  const se_DifferentShapeName_event = (\n    input: DifferentShapeName,\n    context: __SerdeContext\n  ): __Message => {\n    const headers: __MessageHeaders = {\n      \":event-type\": { type: \"string\", value: \"delta\" },\n      \":message-type\": { type: \"string\", value: \"event\" },\n      \":content-type\": { type: \"string\", value: \"application/cbor\" },\n    }\n    let body = new Uint8Array();\n    body = _json(input);\n    body = cbor.serialize(body);\n    return { headers, body };\n    }\n    const se_Unit_event = (\n      input: Unit,\n      context: __SerdeContext\n    ): __Message => {\n      const headers: __MessageHeaders = {\n        \":event-type\": { type: \"string\", value: \"beta\" },\n        \":message-type\": { type: \"string\", value: \"event\" },\n        \":content-type\": { type: \"string\", value: \"application/cbor\" },\n      }\n      let body = new Uint8Array();\n      body = _json(input);\n      body = cbor.serialize(body);\n      return { headers, body };\n      }\n      /**\n       * deserializeRpcv2cborTradeEvents\n       */\n      const de_TradeEvents = (\n        output: any,\n        context: __SerdeContext & __EventStreamSerdeContext\n      ): AsyncIterable<TradeEvents> => {\n        return context.eventStreamMarshaller.deserialize(\n          output,\n          async event => {\n            if (event[\"alpha\"] != null) {\n              return {\n                alpha: await de_Alpha_event(event[\"alpha\"], context),\n              };\n            }\n            if (event[\"beta\"] != null) {\n              return {\n                beta: await de_Unit_event(event[\"beta\"], context),\n              };\n            }\n            if (event[\"gamma\"] != null) {\n              return {\n                gamma: await de_Unit_event(event[\"gamma\"], context),\n              };\n            }\n            if (event[\"delta\"] != null) {\n              return {\n                delta: await de_DifferentShapeName_event(event[\"delta\"], context),\n              };\n            }\n            return {$unknown: event as any};\n          }\n        );\n      }\n      const de_Alpha_event = async (\n        output: any,\n        context: __SerdeContext\n      ): Promise<Alpha> => {\n        const contents: Alpha = {} as any;\n        const data: any = await parseBody(output.body, context);\n        Object.assign(contents, de_Alpha(data, context));\n        return contents;\n      }\n      const de_DifferentShapeName_event = async (\n        output: any,\n        context: __SerdeContext\n      ): Promise<DifferentShapeName> => {\n        const contents: DifferentShapeName = {} as any;\n        const data: any = await parseBody(output.body, context);\n        Object.assign(contents, _json(data));\n        return contents;\n      }\n      const de_Unit_event = async (\n        output: any,\n        context: __SerdeContext\n      ): Promise<Unit> => {\n        const contents: Unit = {} as any;\n        const data: any = await parseBody(output.body, context);\n        Object.assign(contents, _json(data));\n        return contents;\n      }\n      // se_HttpLabelCommandInput omitted.\n\n      /**\n       * serializeRpcv2cborAlpha\n       */\n      const se_Alpha = (\n        input: Alpha,\n        context: __SerdeContext\n      ): any => {\n        return take(input, {\n          'id': [],\n          'timestamp': __dateToTag,\n        });\n      }\n\n      // se_CamelCaseOperationInput omitted.\n\n      // se_DifferentShapeName omitted.\n\n      /**\n       * serializeRpcv2cborGetNumbersRequest\n       */\n      const se_GetNumbersRequest = (\n        input: GetNumbersRequest,\n        context: __SerdeContext\n      ): any => {\n        return take(input, {\n          'bigDecimal': __nv,\n          'bigInteger': [],\n          'customHeaderInput': [],\n          'fieldWithMessage': [],\n          'fieldWithoutMessage': [],\n          'maxResults': [],\n          'numbers': _json,\n          'sparseNumbers': _ => se_SparseIntegerMap(_, context),\n          'startToken': [],\n        });\n      }\n\n      // se_IntegerMap omitted.\n\n      /**\n       * serializeRpcv2cborSparseIntegerMap\n       */\n      const se_SparseIntegerMap = (\n        input: Record<string, number | null>,\n        context: __SerdeContext\n      ): any => {\n        return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {\n          if (value !== null) {\n              acc[key] = value;\n          }\n\n          else {\n              acc[key] = null as any;\n          }\n\n          return acc;\n        }, {});\n      }\n\n      // se_Unit omitted.\n\n      // de_HttpLabelCommandOutput omitted.\n\n      /**\n       * deserializeRpcv2cborAlpha\n       */\n      const de_Alpha = (\n        output: any,\n        context: __SerdeContext\n      ): Alpha => {\n        return take(output, {\n          'id': __expectString,\n          'timestamp': (_: any) => __expectNonNull(__parseEpochTimestamp(_)),\n        }) as any;\n      }\n\n      /**\n       * deserializeRpcv2cborBlobs\n       */\n      const de_Blobs = (\n        output: any,\n        context: __SerdeContext\n      ): Uint8Array[] => {\n        const collection = (output || []).filter((e: any) => e != null)\n        return collection;\n      }\n\n      /**\n       * deserializeRpcv2cborCamelCaseOperationOutput\n       */\n      const de_CamelCaseOperationOutput = (\n        output: any,\n        context: __SerdeContext\n      ): CamelCaseOperationOutput => {\n        return take(output, {\n          'results': (_: any) => de_Blobs(_, context),\n          'token': __expectString,\n        }) as any;\n      }\n\n      // de_CodedThrottlingError omitted.\n\n      // de_DifferentShapeName omitted.\n\n      /**\n       * deserializeRpcv2cborGetNumbersResponse\n       */\n      const de_GetNumbersResponse = (\n        output: any,\n        context: __SerdeContext\n      ): GetNumbersResponse => {\n        return take(output, {\n          'bigDecimal': [],\n          'bigInteger': [],\n          'deprecatedNumbers': _json,\n          'deprecatedNumbersWithoutChronology': _json,\n          'deprecatedNumbersWithoutExplanation': _json,\n          'inexplicablyDeprecatedNumbers': _json,\n          'nextToken': __expectString,\n          'numbers': _json,\n          'sparseNumbers': (_: any) => de_SparseIntegerList(_, context),\n        }) as any;\n      }\n\n      // de_HaltError omitted.\n\n      // de_IntegerList omitted.\n\n      // de_MainServiceLinkedError omitted.\n\n      // de_MysteryThrottlingError omitted.\n\n      // de_RetryableError omitted.\n\n      /**\n       * deserializeRpcv2cborSparseIntegerList\n       */\n      const de_SparseIntegerList = (\n        output: any,\n        context: __SerdeContext\n      ): (number | null)[] => {\n        const collection = (output || []).map((entry: any) => {\n          if (entry === null) {\n            return null as any;\n          }\n          return __expectInt32(entry) as any;\n        });\n        return collection;\n      }\n\n      // de_XYZServiceServiceException omitted.\n\n      // de_Unit omitted.\n\n      const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({\n        httpStatusCode: output.statusCode,\n        requestId: output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"] ?? output.headers[\"x-amz-request-id\"],\n        extendedRequestId: output.headers[\"x-amz-id-2\"],\n        cfId: output.headers[\"x-amz-cf-id\"],\n      });\n\n      const throwDefaultError = withBaseException(__BaseException);\n      const SHARED_HEADERS: __HeaderBag = {\n        'content-type': \"application/cbor\",\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"accept\": \"application/cbor\",\n\n      };\n"
  },
  {
    "path": "private/my-local-model/src/runtimeConfig.browser.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport { eventStreamSerdeProvider } from \"@smithy/core/event-streams\";\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from \"@smithy/core/retry\";\nimport { calculateBodyLength } from \"@smithy/core/serde\";\nimport { FetchHttpHandler as RequestHandler, streamCollector } from \"@smithy/fetch-http-handler\";\n\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"browser\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,\n    maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),\n    sha256: config?.sha256 ?? Sha256,\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model/src/runtimeConfig.native.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-js\";\n\nimport { getRuntimeConfig as getBrowserRuntimeConfig } from \"./runtimeConfig.browser\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  const browserDefaults = getBrowserRuntimeConfig(config);\n  return {\n    ...browserDefaults,\n    ...config,\n    runtime: \"react-native\",\n    sha256: config?.sha256 ?? Sha256,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model/src/runtimeConfig.shared.ts",
    "content": "// smithy-typescript generated code\nimport { HttpApiKeyAuthSigner } from \"@smithy/core\";\nimport { NoOpLogger } from \"@smithy/core/client\";\nimport { parseUrl } from \"@smithy/core/protocols\";\nimport { fromBase64, fromUtf8, toBase64, toUtf8 } from \"@smithy/core/serde\";\nimport type { IdentityProviderConfig } from \"@smithy/types\";\n\nimport { defaultXYZServiceHttpAuthSchemeProvider } from \"./auth/httpAuthSchemeProvider\";\nimport { defaultEndpointResolver } from \"./endpoint/endpointResolver\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  return {\n    apiVersion: \"1.0\",\n    base64Decoder: config?.base64Decoder ?? fromBase64,\n    base64Encoder: config?.base64Encoder ?? toBase64,\n    disableHostPrefix: config?.disableHostPrefix ?? false,\n    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,\n    extensions: config?.extensions ?? [],\n    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultXYZServiceHttpAuthSchemeProvider,\n    httpAuthSchemes: config?.httpAuthSchemes ?? [\n      {\n        schemeId: \"smithy.api#httpApiKeyAuth\",\n        identityProvider: (ipc: IdentityProviderConfig) =>\n          ipc.getIdentityProvider(\"smithy.api#httpApiKeyAuth\"),\n        signer: new HttpApiKeyAuthSigner(),\n      },\n    ],\n    logger: config?.logger ?? new NoOpLogger(),\n    urlParser: config?.urlParser ?? parseUrl,\n    utf8Decoder: config?.utf8Decoder ?? fromUtf8,\n    utf8Encoder: config?.utf8Encoder ?? toUtf8,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model/src/runtimeConfig.ts",
    "content": "// smithy-typescript generated code\nimport { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { loadConfig as loadNodeConfig, resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport { eventStreamSerdeProvider } from \"@smithy/core/event-streams\";\nimport {\n  DEFAULT_RETRY_MODE,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  NODE_RETRY_MODE_CONFIG_OPTIONS,\n} from \"@smithy/core/retry\";\nimport { calculateBodyLength, Hash } from \"@smithy/core/serde\";\nimport { NodeHttpHandler as RequestHandler, streamCollector } from \"@smithy/node-http-handler\";\n\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  emitWarningIfUnsupportedVersion(process.version);\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"node\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,\n    maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode:\n      config?.retryMode ??\n      loadNodeConfig(\n        {\n          ...NODE_RETRY_MODE_CONFIG_OPTIONS,\n          default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,\n        },\n        config\n      ),\n    sha256: config?.sha256 ?? Hash.bind(null, \"sha256\"),\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model/src/runtimeExtensions.ts",
    "content": "// smithy-typescript generated code\nimport { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from \"@smithy/core/client\";\nimport { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from \"@smithy/core/protocols\";\n\nimport { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from \"./auth/httpAuthExtensionConfiguration\";\nimport type { XYZServiceExtensionConfiguration } from \"./extensionConfiguration\";\n\n/**\n * @public\n */\nexport interface RuntimeExtension {\n  configure(extensionConfiguration: XYZServiceExtensionConfiguration): void;\n}\n\n/**\n * @public\n */\nexport interface RuntimeExtensionsConfig {\n  extensions: RuntimeExtension[];\n}\n\n/**\n * @internal\n */\nexport const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {\n  const extensionConfiguration: XYZServiceExtensionConfiguration = Object.assign(\n    getDefaultExtensionConfiguration(runtimeConfig),\n    getHttpHandlerExtensionConfiguration(runtimeConfig),\n    getHttpAuthExtensionConfiguration(runtimeConfig)\n  );\n\n  extensions.forEach((extension) => extension.configure(extensionConfiguration));\n\n  return Object.assign(\n    runtimeConfig,\n    resolveDefaultRuntimeConfig(extensionConfiguration),\n    resolveHttpHandlerRuntimeConfig(extensionConfiguration),\n    resolveHttpAuthRuntimeConfig(extensionConfiguration)\n  );\n};\n"
  },
  {
    "path": "private/my-local-model/src/waiters/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./waitForNumbersAligned\";\nexport * from \"./waitForNumbersMisaligned\";\nexport * from \"./waitForNumbersWhatDoTheyDoAnyway\";\n"
  },
  {
    "path": "private/my-local-model/src/waiters/waitForNumbersAligned.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type WaiterConfiguration,\n  type WaiterResult,\n  checkExceptions,\n  createWaiter,\n  WaiterState,\n} from \"@smithy/core/client\";\n\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"../commands/GetNumbersCommand\";\nimport type { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\nimport type { XYZServiceClient } from \"../XYZServiceClient\";\n\nconst checkState = async (client: XYZServiceClient, input: GetNumbersCommandInput): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  let reason;\n  try {\n    let result: GetNumbersCommandOutput & any = await client.send(new GetNumbersCommand(input));\n    reason = result;\n    return { state: WaiterState.SUCCESS, reason };\n  } catch (exception) {\n    reason = exception;\n    if (exception.name === \"MysteryThrottlingError\") {\n      return { state: WaiterState.RETRY, reason };\n    }\n    if (exception.name === \"HaltError\") {\n      return { state: WaiterState.FAILURE, reason };\n    }\n  }\n  return { state: WaiterState.RETRY, reason };\n};\n/**\n * wait until the numbers align\n *  @deprecated Use waitUntilNumbersAligned instead. waitForNumbersAligned does not throw error in non-success cases.\n */\nexport const waitForNumbersAligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n};\n/**\n * wait until the numbers align\n *  @param params - Waiter configuration options.\n *  @param input - The input to GetNumbersCommand for polling.\n */\nexport const waitUntilNumbersAligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n  return checkExceptions(result) as WaiterResult<GetNumbersCommandOutput>;\n};\n"
  },
  {
    "path": "private/my-local-model/src/waiters/waitForNumbersMisaligned.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type WaiterConfiguration,\n  type WaiterResult,\n  checkExceptions,\n  createWaiter,\n  WaiterState,\n} from \"@smithy/core/client\";\n\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"../commands/GetNumbersCommand\";\nimport type { HaltError } from \"../models/errors\";\nimport type { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\nimport type { XYZServiceClient } from \"../XYZServiceClient\";\n\nconst checkState = async (client: XYZServiceClient, input: GetNumbersCommandInput): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  let reason;\n  try {\n    let result: GetNumbersCommandOutput & any = await client.send(new GetNumbersCommand(input));\n    reason = result;\n    return { state: WaiterState.RETRY, reason };\n  } catch (exception) {\n    reason = exception;\n    if (exception.name === \"HaltError\") {\n      return { state: WaiterState.SUCCESS, reason };\n    }\n  }\n  return { state: WaiterState.RETRY, reason };\n};\n/**\n * wait until the numbers don't align\n *  @deprecated Use waitUntilNumbersMisaligned instead. waitForNumbersMisaligned does not throw error in non-success cases.\n */\nexport const waitForNumbersMisaligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n};\n/**\n * wait until the numbers don't align\n *  @param params - Waiter configuration options.\n *  @param input - The input to GetNumbersCommand for polling.\n */\nexport const waitUntilNumbersMisaligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<HaltError>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n  return checkExceptions(result) as WaiterResult<HaltError>;\n};\n"
  },
  {
    "path": "private/my-local-model/src/waiters/waitForNumbersWhatDoTheyDoAnyway.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type WaiterConfiguration,\n  type WaiterResult,\n  checkExceptions,\n  createWaiter,\n  WaiterState,\n} from \"@smithy/core/client\";\n\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"../commands/GetNumbersCommand\";\nimport type { HaltError } from \"../models/errors\";\nimport type { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\nimport type { XYZServiceClient } from \"../XYZServiceClient\";\n\nconst checkState = async (client: XYZServiceClient, input: GetNumbersCommandInput): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  let reason;\n  try {\n    let result: GetNumbersCommandOutput & any = await client.send(new GetNumbersCommand(input));\n    reason = result;\n    return { state: WaiterState.SUCCESS, reason };\n  } catch (exception) {\n    reason = exception;\n    if (exception.name === \"HaltError\") {\n      return { state: WaiterState.SUCCESS, reason };\n    }\n  }\n  return { state: WaiterState.RETRY, reason };\n};\n/**\n * wait until the numbers align or don't align\n *  @deprecated Use waitUntilNumbersWhatDoTheyDoAnyway instead. waitForNumbersWhatDoTheyDoAnyway does not throw error in non-success cases.\n */\nexport const waitForNumbersWhatDoTheyDoAnyway = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n};\n/**\n * wait until the numbers align or don't align\n *  @param params - Waiter configuration options.\n *  @param input - The input to GetNumbersCommand for polling.\n */\nexport const waitUntilNumbersWhatDoTheyDoAnyway = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | HaltError>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n  return checkExceptions(result) as WaiterResult<GetNumbersCommandOutput | HaltError>;\n};\n"
  },
  {
    "path": "private/my-local-model/test/functional/rpcv2cbor.spec.ts",
    "content": "// smithy-typescript generated code\nimport { afterAll, expect, test as it } from \"vitest\";\n\nimport { GetNumbersCommand } from \"../../src/commands/GetNumbersCommand\";\nimport { HttpLabelCommandCommand } from \"../../src/commands/HttpLabelCommandCommand\";\nimport { XYZServiceClient } from \"../../src/XYZServiceClient\";\nimport { Readable } from \"node:stream\";\nimport { HttpRequest, HttpResponse, type HttpHandler } from \"@smithy/core/protocols\";\nimport type { Endpoint, HeaderBag, HttpHandlerOptions } from \"@smithy/types\";\n\n/**\n * Throws an expected exception that contains the serialized request.\n */\nclass EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error {\n  constructor(readonly request: HttpRequest) {\n    super();\n  }\n}\n\n/**\n * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a\n * request. The thrown exception contains the serialized request.\n */\nclass RequestSerializationTestHandler implements HttpHandler {\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request));\n  }\n  updateHttpClientConfig(key: never, value: never): void {}\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\n/**\n * Returns a resolved Promise of the specified response contents.\n */\nclass ResponseDeserializationTestHandler implements HttpHandler {\n  isSuccess: boolean;\n  code: number;\n  headers: HeaderBag;\n  body: string | Uint8Array;\n  isBase64Body: boolean;\n\n  constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) {\n    this.isSuccess = isSuccess;\n    this.code = code;\n    if (headers === undefined) {\n      this.headers = {};\n    } else {\n      this.headers = headers;\n    }\n    if (body === undefined) {\n      body = \"\";\n    }\n    this.body = body;\n    this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), \"base64\").toString(\"base64\") === body;\n  }\n\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.resolve({\n      response: new HttpResponse({\n        statusCode: this.code,\n        headers: this.headers,\n        body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]),\n      }),\n    });\n  }\n\n  updateHttpClientConfig(key: never, value: never): void {}\n\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\ninterface comparableParts {\n  [key: string]: string;\n}\n\n/**\n * Generates a standard map of un-equal values given input parts.\n */\nconst compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => {\n  const unequalParts: any = {};\n  Object.keys(expectedParts).forEach((key) => {\n    if (generatedParts[key] === undefined) {\n      unequalParts[key] = { exp: expectedParts[key], gen: undefined };\n    } else if (!equivalentContents(expectedParts[key], generatedParts[key])) {\n      unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] };\n    }\n  });\n\n  Object.keys(generatedParts).forEach((key) => {\n    if (expectedParts[key] === undefined) {\n      unequalParts[key] = { exp: undefined, gen: generatedParts[key] };\n    }\n  });\n\n  if (Object.keys(unequalParts).length !== 0) {\n    return unequalParts;\n  }\n  return undefined;\n};\n\n/**\n * Compares all types for equivalent contents, doing nested\n * equality checks based on non-`$metadata`\n * properties that have defined values.\n */\nconst equivalentContents = (expected: any, generated: any): boolean => {\n  if (typeof (global as any).expect === \"function\") {\n    expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected));\n    return true;\n  }\n\n  let localExpected = expected;\n\n  // Short circuit on equality.\n  if (localExpected == generated) {\n    return true;\n  }\n\n  if (typeof expected !== \"object\") {\n    return expected === generated;\n  }\n\n  // If a test fails with an issue in the below 6 lines, it's likely\n  // due to an issue in the nestedness or existence of the property\n  // being compared.\n  delete localExpected[\"$metadata\"];\n  delete generated[\"$metadata\"];\n  Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]);\n  Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]);\n\n  const expectedProperties = Object.getOwnPropertyNames(localExpected);\n  const generatedProperties = Object.getOwnPropertyNames(generated);\n\n  // Short circuit on different property counts.\n  if (expectedProperties.length != generatedProperties.length) {\n    return false;\n  }\n\n  // Compare properties directly.\n  for (var index = 0; index < expectedProperties.length; index++) {\n    const propertyName = expectedProperties[index];\n    if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nconst clientParams = {\n  region: \"us-west-2\",\n  credentials: { accessKeyId: \"key\", secretAccessKey: \"secret\" },\n  apiKey: { apiKey: \"apiKey\" },\n  endpoint: {\n    url: new URL(\"https://localhost/\"),\n    headers: {\n      \"x-default-header\": [\"default-header-value\"],\n    },\n  },\n};\n\n/**\n * A wrapper function that shadows `fail` from jest-jasmine2\n * (jasmine2 was replaced with circus in > v27 as the default test runner)\n */\nconst fail = (error?: any): never => {\n  throw new Error(error);\n};\n\n/**\n * Hexadecimal to byteArray.\n */\nconst toBytes = (hex: string) => {\n  return Buffer.from(hex, \"base64\");\n};\n\nfunction normalizeByteArrayType(data: any) {\n  // normalize float32 errors\n  if (typeof data === \"number\") {\n    const u = new Uint8Array(4);\n    const dv = new DataView(u.buffer, u.byteOffset, u.byteLength);\n    dv.setFloat32(0, data);\n    return dv.getFloat32(0);\n  }\n  if (!data || typeof data !== \"object\") {\n    return data;\n  }\n  if (data instanceof Uint8Array) {\n    return Uint8Array.from(data);\n  }\n  if (data instanceof String || data instanceof Boolean || data instanceof Number) {\n    return data.valueOf();\n  }\n  const output = {} as any;\n  for (const key of Object.getOwnPropertyNames(data)) {\n    output[key] = normalizeByteArrayType(data[key]);\n  }\n  return output;\n}\n\nconst WARMUP_ITERATIONS = 10_000;\nconst BENCHMARK_ITERATIONS = 10_000;\nconst BENCHMARK_TIMEOUT = 60_000;\n\n/**\n * Test name to benchmark data.\n */\nconst benchmarks = {} as Record<\n  string,\n  {\n    n: string;\n    p50: string;\n    p90: string;\n    p95: string;\n    p99: string;\n    mean: string;\n    stdDev: string;\n  }\n>;\n\nfunction logBenchmarks() {\n  console.table(benchmarks);\n}\n\nfunction logBenchmark(name: string, timings: number[]) {\n  const n = timings.length;\n  const p50 = timings[(n - 1) * 0.50 | 0] | 0;\n  const p90 = timings[(n - 1) * 0.90 | 0] | 0;\n  const p95 = timings[(n - 1) * 0.95 | 0] | 0;\n  const p99 = timings[(n - 1) * 0.99 | 0] | 0;\n  const mean = timings.reduce((a, b) => a + b, 0) / timings.length | 0;\n  const stdDev = Math.sqrt(timings.reduce((a, b) => a + (b - mean) ** 2, 0) / timings.length) | 0;\n\n  const fmt = (n: number) => String(n.toLocaleString()).padStart(10, ' ');\n  benchmarks[name] = {\n    n: fmt(n),\n    p50: fmt(p50),\n    p90: fmt(p90),\n    p95: fmt(p95),\n    p99: fmt(p99),\n    mean: fmt(mean),\n    stdDev: fmt(stdDev),\n  };\n  return {\n    name, p95, n, timings\n  };\n}\n\nfunction vizBenchmark({ name, p95, n, timings }: { name: string, p95: number, n: number, timings: number[] }) {\n  const decile = p95 / 10;\n  let d = 1;\n  const centIndex = (n / 100) | 0;\n  let line = \"\";\n\n  console.info(name);\n  console.info(\"=\".repeat(31), \"Distribution Viz\", \"=\".repeat(31));\n  for (let i = 0; i < n; i += centIndex) {\n    const t = timings[i];\n    if (t < decile * d) {\n      line += \".\";\n    } else {\n      line += ` <= ${(decile * d) | 0}`;\n      console.info(line);\n      d += 1;\n      line = \".\";\n    }\n  }\n  console.info(line + ` > ${(decile * (d - 1)) | 0}`);\n  console.info(\"=\".repeat(80));\n}\n\nit(\"HttpLabelCommandExample:Response\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      }\n    ),\n  });\n\n  const params: any = {\n    LabelDoesNotApplyToRpcProtocol: \"placeholder\",\n  };\n  const command = new HttpLabelCommandCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\nit(\"GetNumbersRequestExample:SerdeBenchmark:Request\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new GetNumbersCommand(\n    {\n    } as any,\n  );\n  const name = \"GetNumbersRequestExample:SerdeBenchmark:Request\";\n  const timings = [] as number[];\n  const testStart = performance.now();\n  const numeric = (a: number, b: number) => a - b;\n  let i = 0;\n\n  while (++i) {\n    const preSerialize = performance.now();\n    try {\n      await client.send(command);\n      fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n      return;\n    } catch (err) {\n      if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n        fail(err);\n        return;\n      }\n      const r = err.request;\n    };\n    const postSerialize = performance.now();\n    if (i >= WARMUP_ITERATIONS) {\n      // allow warmup\n      timings.push(postSerialize * 1_000_000 - preSerialize  * 1_000_000);\n    }\n\n    if (timings.length >= BENCHMARK_ITERATIONS) {\n      timings.length = BENCHMARK_ITERATIONS;\n      break;\n    } else if (testStart + 30_000 < preSerialize) {\n      break;\n    }\n  }\n\n  timings.sort(numeric);\n\n  vizBenchmark(logBenchmark(name, timings));\n\n}, BENCHMARK_TIMEOUT);\n\nit(\"EndpointResolvedHeadersApplied:Request\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new GetNumbersCommand(\n    {\n      customHeaderInput: \"test-custom-value\",\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/XYZService/operation/GetNumbers\");\n\n    expect(r.headers[\"x-custom-header\"]).toBe(\"test-custom-value\");\n\n  }\n});\n\nit(\"GetNumbersResponseExample:SerdeBenchmark:Response\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      }\n    ),\n  });\n\n  const params: any = {};\n  const command = new GetNumbersCommand(params);\n\n  const name = \"GetNumbersResponseExample:SerdeBenchmark:Response\";\n  const timings = [] as number[];\n  const numeric = (a: number, b: number) => a - b;\n  let i = 0;\n\n  client.middlewareStack.addRelativeTo(\n      (next: any) => async (args: any) => {\n        const preDeserialize = performance.now();\n        const r = await next(args);\n        const postDeserialize = performance.now();\n        if (i >= WARMUP_ITERATIONS) {\n          timings.push(postDeserialize * 1_000_000 - preDeserialize * 1_000_000);\n        }\n        return r;\n      },\n      {\n        name: \"deserializerBenchmarkMiddleware\",\n        toMiddleware: \"deserializerMiddleware\",\n        relation: \"before\",\n        override: true,\n      }\n  );\n\n  const benchmarkStart = performance.now();\n\n  while (++i) {\n    let r: any;\n    try {\n      r = await client.send(command);\n    } catch (err) {\n      fail(\"Expected a valid response to be returned, got \" + err);\n      return;\n    }\n    if (i >= WARMUP_ITERATIONS + BENCHMARK_ITERATIONS) {\n      break;\n    } else if (benchmarkStart + 30_000 < performance.now()) {\n      break;\n    }\n  }\n\n  timings.sort(numeric);\n  timings.length = Math.min(timings.length, BENCHMARK_ITERATIONS);\n\n  vizBenchmark(logBenchmark(name, timings));\n\n}, BENCHMARK_TIMEOUT);\n\nafterAll(() => {\n  logBenchmarks();\n});\n"
  },
  {
    "path": "private/my-local-model/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist-cjs\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"lib\": [\"dom\"],\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"outDir\": \"dist-es\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/tsconfig.json",
    "content": "{\n  \"extends\": \"@tsconfig/node20/tsconfig.json\",\n  \"compilerOptions\": {\n    \"downlevelIteration\": true,\n    \"importHelpers\": true,\n    \"incremental\": true,\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"rootDir\": \"src\",\n    \"useUnknownInCatchVariables\": false\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "private/my-local-model/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist-types\",\n    \"emitDeclarationOnly\": true,\n    \"noCheck\": false\n  }\n}\n"
  },
  {
    "path": "private/my-local-model/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "private/my-local-model/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    globals: true,\n  },\n});\n"
  },
  {
    "path": "private/my-local-model-schema/package.json",
    "content": "{\n  \"name\": \"xyz-schema\",\n  \"description\": \"xyz-schema client\",\n  \"version\": \"0.0.0\",\n  \"scripts\": {\n    \"build\": \"concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"downlevel-dts dist-types dist-types/ts3.4\",\n    \"test:index\": \"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"prepack\": \"npm run clean && npm run build\",\n    \"test\": \"npx vitest run --passWithNoTests\",\n    \"test:watch\": \"npx vitest watch --passWithNoTests\",\n    \"test:integration\": \"npx vitest run --passWithNoTests -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"npx vitest watch --passWithNoTests -c vitest.config.integ.mts\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"module\": \"./dist-es/index.js\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@aws-crypto/sha256-browser\": \"5.2.0\",\n    \"@aws-crypto/sha256-js\": \"5.2.0\",\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/fetch-http-handler\": \"workspace:^\",\n    \"@smithy/node-http-handler\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@smithy/snapshot-testing\": \"workspace:^\",\n    \"@tsconfig/node20\": \"20.1.8\",\n    \"@types/node\": \"^20.14.8\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\",\n    \"vitest\": \"^4.0.17\"\n  },\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"private\": true,\n  \"browser\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.browser\"\n  },\n  \"react-native\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.native\"\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/XYZService.ts",
    "content": "// smithy-typescript generated code\nimport { type WaiterResult, createAggregatedClient } from \"@smithy/core/client\";\nimport type {\n  HttpHandlerOptions as __HttpHandlerOptions,\n  PaginationConfiguration,\n  Paginator,\n  WaiterConfiguration,\n} from \"@smithy/types\";\n\nimport {\n  type CamelCaseOperationCommandInput,\n  type CamelCaseOperationCommandOutput,\n  CamelCaseOperationCommand,\n} from \"./commands/CamelCaseOperationCommand\";\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"./commands/GetNumbersCommand\";\nimport {\n  type HttpLabelCommandCommandInput,\n  type HttpLabelCommandCommandOutput,\n  HttpLabelCommandCommand,\n} from \"./commands/HttpLabelCommandCommand\";\nimport {\n  type TradeEventStreamCommandInput,\n  type TradeEventStreamCommandOutput,\n  TradeEventStreamCommand,\n} from \"./commands/TradeEventStreamCommand\";\nimport type { HaltError } from \"./models/errors\";\nimport type { XYZServiceSyntheticServiceException } from \"./models/XYZServiceSyntheticServiceException\";\nimport { paginatecamelCaseOperation as paginateCamelCaseOperation } from \"./pagination/camelCaseOperationPaginator\";\nimport { paginateGetNumbers } from \"./pagination/GetNumbersPaginator\";\nimport { waitUntilNumbersAligned } from \"./waiters/waitForNumbersAligned\";\nimport { waitUntilNumbersMisaligned } from \"./waiters/waitForNumbersMisaligned\";\nimport { waitUntilNumbersWhatDoTheyDoAnyway } from \"./waiters/waitForNumbersWhatDoTheyDoAnyway\";\nimport { XYZServiceClient } from \"./XYZServiceClient\";\n\nconst commands = {\n  HttpLabelCommandCommand,\n  CamelCaseOperationCommand,\n  GetNumbersCommand,\n  TradeEventStreamCommand,\n};\nconst paginators = {\n  paginateCamelCaseOperation,\n  paginateGetNumbers,\n};\nconst waiters = {\n  waitUntilNumbersAligned,\n  waitUntilNumbersMisaligned,\n  waitUntilNumbersWhatDoTheyDoAnyway,\n};\n\nexport interface XYZService {\n  /**\n   * @see {@link HttpLabelCommandCommand}\n   */\n  httpLabelCommand(\n    args: HttpLabelCommandCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<HttpLabelCommandCommandOutput>;\n  httpLabelCommand(\n    args: HttpLabelCommandCommandInput,\n    cb: (err: any, data?: HttpLabelCommandCommandOutput) => void\n  ): void;\n  httpLabelCommand(\n    args: HttpLabelCommandCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: HttpLabelCommandCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link CamelCaseOperationCommand}\n   */\n  camelCaseOperation(): Promise<CamelCaseOperationCommandOutput>;\n  camelCaseOperation(\n    args: CamelCaseOperationCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<CamelCaseOperationCommandOutput>;\n  camelCaseOperation(\n    args: CamelCaseOperationCommandInput,\n    cb: (err: any, data?: CamelCaseOperationCommandOutput) => void\n  ): void;\n  camelCaseOperation(\n    args: CamelCaseOperationCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: CamelCaseOperationCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   */\n  getNumbers(): Promise<GetNumbersCommandOutput>;\n  getNumbers(\n    args: GetNumbersCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<GetNumbersCommandOutput>;\n  getNumbers(\n    args: GetNumbersCommandInput,\n    cb: (err: any, data?: GetNumbersCommandOutput) => void\n  ): void;\n  getNumbers(\n    args: GetNumbersCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: GetNumbersCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link TradeEventStreamCommand}\n   */\n  tradeEventStream(): Promise<TradeEventStreamCommandOutput>;\n  tradeEventStream(\n    args: TradeEventStreamCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<TradeEventStreamCommandOutput>;\n  tradeEventStream(\n    args: TradeEventStreamCommandInput,\n    cb: (err: any, data?: TradeEventStreamCommandOutput) => void\n  ): void;\n  tradeEventStream(\n    args: TradeEventStreamCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: TradeEventStreamCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link CamelCaseOperationCommand}\n   * @param args - command input.\n   * @param paginationConfig - optional pagination config.\n   * @returns AsyncIterable of {@link CamelCaseOperationCommandOutput}.\n   */\n  paginateCamelCaseOperation(\n    args?: CamelCaseOperationCommandInput,\n    paginationConfig?: Omit<PaginationConfiguration, \"client\">\n  ): Paginator<CamelCaseOperationCommandOutput>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param paginationConfig - optional pagination config.\n   * @returns AsyncIterable of {@link GetNumbersCommandOutput}.\n   */\n  paginateGetNumbers(\n    args?: GetNumbersCommandInput,\n    paginationConfig?: Omit<PaginationConfiguration, \"client\">\n  ): Paginator<GetNumbersCommandOutput>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\n   */\n  waitUntilNumbersAligned(\n    args: GetNumbersCommandInput,\n    waiterConfig: number | Omit<WaiterConfiguration<XYZService>, \"client\">\n  ): Promise<WaiterResult<GetNumbersCommandOutput>>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\n   */\n  waitUntilNumbersMisaligned(\n    args: GetNumbersCommandInput,\n    waiterConfig: number | Omit<WaiterConfiguration<XYZService>, \"client\">\n  ): Promise<WaiterResult<HaltError>>;\n\n  /**\n   * @see {@link GetNumbersCommand}\n   * @param args - command input.\n   * @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\n   */\n  waitUntilNumbersWhatDoTheyDoAnyway(\n    args: GetNumbersCommandInput,\n    waiterConfig: number | Omit<WaiterConfiguration<XYZService>, \"client\">\n  ): Promise<WaiterResult<GetNumbersCommandOutput | HaltError>>;\n}\n\n/**\n * xyz interfaces\n * @public\n */\nexport class XYZService extends XYZServiceClient implements XYZService {}\ncreateAggregatedClient(commands, XYZService, { paginators, waiters });\n"
  },
  {
    "path": "private/my-local-model-schema/src/XYZServiceClient.ts",
    "content": "// smithy-typescript generated code\nimport {\n  DefaultIdentityProviderConfig,\n  getHttpAuthSchemeEndpointRuleSetPlugin,\n  getHttpSigningPlugin,\n} from \"@smithy/core\";\nimport {\n  type DefaultsMode as __DefaultsMode,\n  type SmithyConfiguration as __SmithyConfiguration,\n  type SmithyResolvedConfiguration as __SmithyResolvedConfiguration,\n  Client as __Client,\n} from \"@smithy/core/client\";\nimport { type EndpointInputConfig, type EndpointResolvedConfig, resolveEndpointConfig } from \"@smithy/core/endpoints\";\nimport {\n  type EventStreamSerdeInputConfig,\n  type EventStreamSerdeResolvedConfig,\n  resolveEventStreamSerdeConfig,\n} from \"@smithy/core/event-streams\";\nimport { type HttpHandlerUserInput as __HttpHandlerUserInput, getContentLengthPlugin } from \"@smithy/core/protocols\";\nimport {\n  type RetryInputConfig,\n  type RetryResolvedConfig,\n  getRetryPlugin,\n  resolveRetryConfig,\n} from \"@smithy/core/retry\";\nimport { getSchemaSerdePlugin } from \"@smithy/core/schema\";\nimport type {\n  BodyLengthCalculator as __BodyLengthCalculator,\n  CheckOptionalClientConfig as __CheckOptionalClientConfig,\n  ChecksumConstructor as __ChecksumConstructor,\n  Decoder as __Decoder,\n  Encoder as __Encoder,\n  EventStreamSerdeProvider as __EventStreamSerdeProvider,\n  HashConstructor as __HashConstructor,\n  HttpHandlerOptions as __HttpHandlerOptions,\n  Logger as __Logger,\n  Provider as __Provider,\n  StreamCollector as __StreamCollector,\n  UrlParser as __UrlParser,\n} from \"@smithy/types\";\n\nimport {\n  type HttpAuthSchemeInputConfig,\n  type HttpAuthSchemeResolvedConfig,\n  defaultXYZServiceHttpAuthSchemeParametersProvider,\n  resolveHttpAuthSchemeConfig,\n} from \"./auth/httpAuthSchemeProvider\";\nimport type {\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput,\n} from \"./commands/CamelCaseOperationCommand\";\nimport type { GetNumbersCommandInput, GetNumbersCommandOutput } from \"./commands/GetNumbersCommand\";\nimport type { HttpLabelCommandCommandInput, HttpLabelCommandCommandOutput } from \"./commands/HttpLabelCommandCommand\";\nimport type { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from \"./commands/TradeEventStreamCommand\";\nimport {\n  type ClientInputEndpointParameters,\n  type ClientResolvedEndpointParameters,\n  type EndpointParameters,\n  resolveClientEndpointParameters,\n} from \"./endpoint/EndpointParameters\";\nimport { getRuntimeConfig as __getRuntimeConfig } from \"./runtimeConfig\";\nimport { type RuntimeExtension, type RuntimeExtensionsConfig, resolveRuntimeExtensions } from \"./runtimeExtensions\";\n\nexport { __Client };\n\n/**\n * @public\n */\nexport type ServiceInputTypes =\n  | CamelCaseOperationCommandInput\n  | GetNumbersCommandInput\n  | HttpLabelCommandCommandInput\n  | TradeEventStreamCommandInput;\n\n/**\n * @public\n */\nexport type ServiceOutputTypes =\n  | CamelCaseOperationCommandOutput\n  | GetNumbersCommandOutput\n  | HttpLabelCommandCommandOutput\n  | TradeEventStreamCommandOutput;\n\n/**\n * @public\n */\nexport interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {\n  /**\n   * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.\n   */\n  requestHandler?: __HttpHandlerUserInput;\n\n  /**\n   * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface\n   * that computes the SHA-256 HMAC or checksum of a string or binary buffer.\n   * @internal\n   */\n  sha256?: __ChecksumConstructor | __HashConstructor;\n\n  /**\n   * The function that will be used to convert strings into HTTP endpoints.\n   * @internal\n   */\n  urlParser?: __UrlParser;\n\n  /**\n   * A function that can calculate the length of a request body.\n   * @internal\n   */\n  bodyLengthChecker?: __BodyLengthCalculator;\n\n  /**\n   * A function that converts a stream into an array of bytes.\n   * @internal\n   */\n  streamCollector?: __StreamCollector;\n\n  /**\n   * The function that will be used to convert a base64-encoded string to a byte array.\n   * @internal\n   */\n  base64Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a base64-encoded string.\n   * @internal\n   */\n  base64Encoder?: __Encoder;\n\n  /**\n   * The function that will be used to convert a UTF8-encoded string to a byte array.\n   * @internal\n   */\n  utf8Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a UTF-8 encoded string.\n   * @internal\n   */\n  utf8Encoder?: __Encoder;\n\n  /**\n   * The runtime environment.\n   * @internal\n   */\n  runtime?: string;\n\n  /**\n   * Disable dynamically changing the endpoint of the client based on the hostPrefix\n   * trait of an operation.\n   */\n  disableHostPrefix?: boolean;\n\n  /**\n   * Value for how many times a request will be made at most in case of retry.\n   */\n  maxAttempts?: number | __Provider<number>;\n\n  /**\n   * Specifies which retry algorithm to use.\n   * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/\n   *\n   */\n  retryMode?: string | __Provider<string>;\n\n  /**\n   * Optional logger for logging debug/info/warn/error.\n   */\n  logger?: __Logger;\n\n  /**\n   * Optional extensions\n   */\n  extensions?: RuntimeExtension[];\n\n  /**\n   * The function that provides necessary utilities for generating and parsing event stream\n   */\n  eventStreamSerdeProvider?: __EventStreamSerdeProvider;\n\n  /**\n   * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.\n   */\n  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;\n}\n\n/**\n * @public\n */\nexport type XYZServiceClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &\n  ClientDefaults &\n  RetryInputConfig &\n  EndpointInputConfig<EndpointParameters> &\n  EventStreamSerdeInputConfig &\n  HttpAuthSchemeInputConfig &\n  ClientInputEndpointParameters;\n/**\n * @public\n *\n *  The configuration interface of XYZServiceClient class constructor that set the region, credentials and other options.\n */\nexport interface XYZServiceClientConfig extends XYZServiceClientConfigType {}\n\n/**\n * @public\n */\nexport type XYZServiceClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &\n  Required<ClientDefaults> &\n  RuntimeExtensionsConfig &\n  RetryResolvedConfig &\n  EndpointResolvedConfig<EndpointParameters> &\n  EventStreamSerdeResolvedConfig &\n  HttpAuthSchemeResolvedConfig &\n  ClientResolvedEndpointParameters;\n/**\n * @public\n *\n *  The resolved configuration interface of XYZServiceClient class. This is resolved and normalized from the {@link XYZServiceClientConfig | constructor configuration interface}.\n */\nexport interface XYZServiceClientResolvedConfig extends XYZServiceClientResolvedConfigType {}\n\n/**\n * xyz interfaces\n * @public\n */\nexport class XYZServiceClient extends __Client<\n  __HttpHandlerOptions,\n  ServiceInputTypes,\n  ServiceOutputTypes,\n  XYZServiceClientResolvedConfig\n> {\n  /**\n   * The resolved configuration of XYZServiceClient class. This is resolved and normalized from the {@link XYZServiceClientConfig | constructor configuration interface}.\n   */\n  readonly config: XYZServiceClientResolvedConfig;\n\n  constructor(...[configuration]: __CheckOptionalClientConfig<XYZServiceClientConfig>) {\n    const _config_0 = __getRuntimeConfig(configuration || {});\n    super(_config_0 as any);\n    this.initConfig = _config_0;\n    const _config_1 = resolveClientEndpointParameters(_config_0);\n    const _config_2 = resolveRetryConfig(_config_1);\n    const _config_3 = resolveEndpointConfig(_config_2);\n    const _config_4 = resolveEventStreamSerdeConfig(_config_3);\n    const _config_5 = resolveHttpAuthSchemeConfig(_config_4);\n    const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []);\n    this.config = _config_6;\n    this.middlewareStack.use(getSchemaSerdePlugin(this.config));\n    this.middlewareStack.use(getRetryPlugin(this.config));\n    this.middlewareStack.use(getContentLengthPlugin(this.config));\n    this.middlewareStack.use(\n      getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n        httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,\n        identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>\n          new DefaultIdentityProviderConfig({\n            \"smithy.api#httpApiKeyAuth\": config.apiKey,\n          }),\n      })\n    );\n    this.middlewareStack.use(getHttpSigningPlugin(this.config));\n  }\n\n  /**\n   * Destroy underlying resources, like sockets. It's usually not necessary to do this.\n   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.\n   * Otherwise, sockets might stay open for quite a long time before the server terminates them.\n   */\n  destroy(): void {\n    super.destroy();\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/auth/httpAuthExtensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { ApiKeyIdentity, ApiKeyIdentityProvider, HttpAuthScheme } from \"@smithy/types\";\n\nimport type { XYZServiceHttpAuthSchemeProvider } from \"./httpAuthSchemeProvider\";\n\n/**\n * @internal\n */\nexport interface HttpAuthExtensionConfiguration {\n  setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;\n  httpAuthSchemes(): HttpAuthScheme[];\n  setHttpAuthSchemeProvider(httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider): void;\n  httpAuthSchemeProvider(): XYZServiceHttpAuthSchemeProvider;\n  setApiKey(apiKey: ApiKeyIdentity | ApiKeyIdentityProvider): void;\n  apiKey(): ApiKeyIdentity | ApiKeyIdentityProvider | undefined;\n}\n\n/**\n * @internal\n */\nexport type HttpAuthRuntimeConfig = Partial<{\n  httpAuthSchemes: HttpAuthScheme[];\n  httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider;\n  apiKey: ApiKeyIdentity | ApiKeyIdentityProvider;\n}>;\n\n/**\n * @internal\n */\nexport const getHttpAuthExtensionConfiguration = (\n  runtimeConfig: HttpAuthRuntimeConfig\n): HttpAuthExtensionConfiguration => {\n  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;\n  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;\n  let _apiKey = runtimeConfig.apiKey;\n  return {\n    setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {\n      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n      if (index === -1) {\n        _httpAuthSchemes.push(httpAuthScheme);\n      } else {\n        _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n      }\n    },\n    httpAuthSchemes(): HttpAuthScheme[] {\n      return _httpAuthSchemes;\n    },\n    setHttpAuthSchemeProvider(httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider): void {\n      _httpAuthSchemeProvider = httpAuthSchemeProvider;\n    },\n    httpAuthSchemeProvider(): XYZServiceHttpAuthSchemeProvider {\n      return _httpAuthSchemeProvider;\n    },\n    setApiKey(apiKey: ApiKeyIdentity | ApiKeyIdentityProvider): void {\n      _apiKey = apiKey;\n    },\n    apiKey(): ApiKeyIdentity | ApiKeyIdentityProvider | undefined {\n      return _apiKey;\n    },\n  };\n};\n\n/**\n * @internal\n */\nexport const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => {\n  return {\n    httpAuthSchemes: config.httpAuthSchemes(),\n    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n    apiKey: config.apiKey(),\n  };\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/auth/httpAuthSchemeProvider.ts",
    "content": "// smithy-typescript generated code\nimport { doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider } from \"@smithy/core\";\nimport { getSmithyContext, normalizeProvider } from \"@smithy/core/client\";\nimport {\n  type ApiKeyIdentity,\n  type ApiKeyIdentityProvider,\n  type HandlerExecutionContext,\n  type HttpAuthOption,\n  type HttpAuthScheme,\n  type HttpAuthSchemeParameters,\n  type HttpAuthSchemeParametersProvider,\n  type HttpAuthSchemeProvider,\n  type Provider,\n  HttpApiKeyAuthLocation,\n} from \"@smithy/types\";\n\nimport type { XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @internal\n */\nexport interface XYZServiceHttpAuthSchemeParameters extends HttpAuthSchemeParameters {}\n\n/**\n * @internal\n */\nexport interface XYZServiceHttpAuthSchemeParametersProvider\n  extends HttpAuthSchemeParametersProvider<\n    XYZServiceClientResolvedConfig,\n    HandlerExecutionContext,\n    XYZServiceHttpAuthSchemeParameters,\n    object\n  > {}\n\n/**\n * @internal\n */\nexport const defaultXYZServiceHttpAuthSchemeParametersProvider = async (\n  config: XYZServiceClientResolvedConfig,\n  context: HandlerExecutionContext,\n  input: object\n): Promise<XYZServiceHttpAuthSchemeParameters> => {\n  return {\n    operation: getSmithyContext(context).operation as string,\n  };\n};\n\nfunction createSmithyApiHttpApiKeyAuthHttpAuthOption(authParameters: XYZServiceHttpAuthSchemeParameters): HttpAuthOption {\n  return {\n    schemeId: \"smithy.api#httpApiKeyAuth\",\n    signingProperties: {\n      name: \"X-Api-Key\",\n      in: HttpApiKeyAuthLocation.HEADER,\n      scheme: undefined,\n    },\n  };\n}\n\n/**\n * @internal\n */\nexport interface XYZServiceHttpAuthSchemeProvider extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}\n\n/**\n * @internal\n */\nexport const defaultXYZServiceHttpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider = (authParameters) => {\n  const options: HttpAuthOption[] = [];\n  switch (authParameters.operation) {\n    default: {\n      options.push(createSmithyApiHttpApiKeyAuthHttpAuthOption(authParameters));\n    }\n  }\n  return options;\n};\n\n/**\n * @public\n */\nexport interface HttpAuthSchemeInputConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  authSchemePreference?: string[] | Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  httpAuthSchemes?: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  httpAuthSchemeProvider?: XYZServiceHttpAuthSchemeProvider;\n  /**\n   * The API key to use when making requests.\n   */\n  apiKey?: ApiKeyIdentity | ApiKeyIdentityProvider;\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeResolvedConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  readonly authSchemePreference: Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  readonly httpAuthSchemes: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  readonly httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider;\n  /**\n   * The API key to use when making requests.\n   */\n  readonly apiKey?: ApiKeyIdentityProvider;\n}\n\n/**\n * @internal\n */\nexport const resolveHttpAuthSchemeConfig = <T>(\n  config: T & HttpAuthSchemeInputConfig\n): T & HttpAuthSchemeResolvedConfig => {\n  const apiKey = memoizeIdentityProvider(config.apiKey, isIdentityExpired, doesIdentityRequireRefresh);\n  return Object.assign(config, {\n    authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),\n    apiKey,\n  }) as T & HttpAuthSchemeResolvedConfig;\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/commands/CamelCaseOperationCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { CamelCaseOperationInput, CamelCaseOperationOutput } from \"../models/models_0\";\nimport { camelCaseOperation$ } from \"../schemas/schemas_0\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link CamelCaseOperationCommand}.\n */\nexport interface CamelCaseOperationCommandInput extends CamelCaseOperationInput {}\n/**\n * @public\n *\n * The output of {@link CamelCaseOperationCommand}.\n */\nexport interface CamelCaseOperationCommandOutput extends CamelCaseOperationOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, CamelCaseOperationCommand } from \"xyz-schema\"; // ES Modules import\n * // const { XYZServiceClient, CamelCaseOperationCommand } = require(\"xyz-schema\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz-schema\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // camelCaseOperationInput\n *   token: \"STRING_VALUE\",\n * };\n * const command = new CamelCaseOperationCommand(input);\n * const response = await client.send(command);\n * // { // camelCaseOperationOutput\n * //   token: \"STRING_VALUE\",\n * //   results: [ // Blobs\n * //     new Uint8Array(),\n * //   ],\n * // };\n *\n * ```\n *\n * @param CamelCaseOperationCommandInput - {@link CamelCaseOperationCommandInput}\n * @returns {@link CamelCaseOperationCommandOutput}\n * @see {@link CamelCaseOperationCommandInput} for command's `input` shape.\n * @see {@link CamelCaseOperationCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class CamelCaseOperationCommand extends $Command\n  .classBuilder<\n    CamelCaseOperationCommandInput,\n    CamelCaseOperationCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"XYZService\", \"camelCaseOperation\", {})\n  .n(\"XYZServiceClient\", \"CamelCaseOperationCommand\")\n  .sc(camelCaseOperation$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: CamelCaseOperationInput;\n      output: CamelCaseOperationOutput;\n    };\n    sdk: {\n      input: CamelCaseOperationCommandInput;\n      output: CamelCaseOperationCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/commands/GetNumbersCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { GetNumbersRequest, GetNumbersResponse } from \"../models/models_0\";\nimport { GetNumbers$ } from \"../schemas/schemas_0\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link GetNumbersCommand}.\n */\nexport interface GetNumbersCommandInput extends GetNumbersRequest {}\n/**\n * @public\n *\n * The output of {@link GetNumbersCommand}.\n */\nexport interface GetNumbersCommandOutput extends GetNumbersResponse, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, GetNumbersCommand } from \"xyz-schema\"; // ES Modules import\n * // const { XYZServiceClient, GetNumbersCommand } = require(\"xyz-schema\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz-schema\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // GetNumbersRequest\n *   bigDecimal: Number(\"bigdecimal\"),\n *   bigInteger: Number(\"bigint\"),\n *   fieldWithoutMessage: \"STRING_VALUE\",\n *   fieldWithMessage: \"STRING_VALUE\",\n *   startToken: \"STRING_VALUE\",\n *   maxResults: Number(\"int\"),\n *   customHeaderInput: \"STRING_VALUE\",\n *   numbers: { // IntegerMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n *   sparseNumbers: { // SparseIntegerMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n * };\n * const command = new GetNumbersCommand(input);\n * const response = await client.send(command);\n * // { // GetNumbersResponse\n * //   bigDecimal: Number(\"bigdecimal\"),\n * //   bigInteger: Number(\"bigint\"),\n * //   numbers: [ // IntegerList\n * //     Number(\"int\"),\n * //   ],\n * //   sparseNumbers: [ // SparseIntegerList\n * //     Number(\"int\"),\n * //   ],\n * //   nextToken: \"STRING_VALUE\",\n * //   deprecatedNumbers: [\n * //     Number(\"int\"),\n * //   ],\n * //   deprecatedNumbersWithoutExplanation: [\n * //     Number(\"int\"),\n * //   ],\n * //   deprecatedNumbersWithoutChronology: [\n * //     Number(\"int\"),\n * //   ],\n * //   inexplicablyDeprecatedNumbers: [\n * //     Number(\"int\"),\n * //   ],\n * // };\n *\n * ```\n *\n * @param GetNumbersCommandInput - {@link GetNumbersCommandInput}\n * @returns {@link GetNumbersCommandOutput}\n * @see {@link GetNumbersCommandInput} for command's `input` shape.\n * @see {@link GetNumbersCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link CodedThrottlingError} (client fault)\n *\n * @throws {@link MysteryThrottlingError} (client fault)\n *\n * @throws {@link RetryableError} (client fault)\n *\n * @throws {@link HaltError} (client fault)\n *\n * @throws {@link XYZServiceServiceException} (client fault)\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class GetNumbersCommand extends $Command\n  .classBuilder<\n    GetNumbersCommandInput,\n    GetNumbersCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep({\n    ...commonParams,\n    CustomHeaderValue: { type: \"contextParams\", name: \"customHeaderInput\" },\n  })\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"XYZService\", \"GetNumbers\", {})\n  .n(\"XYZServiceClient\", \"GetNumbersCommand\")\n  .sc(GetNumbers$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: GetNumbersRequest;\n      output: GetNumbersResponse;\n    };\n    sdk: {\n      input: GetNumbersCommandInput;\n      output: GetNumbersCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/commands/HttpLabelCommandCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { HttpLabelCommandInput, HttpLabelCommandOutput } from \"../models/models_0\";\nimport { HttpLabelCommand$ } from \"../schemas/schemas_0\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link HttpLabelCommandCommand}.\n */\nexport interface HttpLabelCommandCommandInput extends HttpLabelCommandInput {}\n/**\n * @public\n *\n * The output of {@link HttpLabelCommandCommand}.\n */\nexport interface HttpLabelCommandCommandOutput extends HttpLabelCommandOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, HttpLabelCommandCommand } from \"xyz-schema\"; // ES Modules import\n * // const { XYZServiceClient, HttpLabelCommandCommand } = require(\"xyz-schema\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz-schema\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // HttpLabelCommandInput\n *   LabelDoesNotApplyToRpcProtocol: \"STRING_VALUE\", // required\n * };\n * const command = new HttpLabelCommandCommand(input);\n * const response = await client.send(command);\n * // {};\n *\n * ```\n *\n * @param HttpLabelCommandCommandInput - {@link HttpLabelCommandCommandInput}\n * @returns {@link HttpLabelCommandCommandOutput}\n * @see {@link HttpLabelCommandCommandInput} for command's `input` shape.\n * @see {@link HttpLabelCommandCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class HttpLabelCommandCommand extends $Command\n  .classBuilder<\n    HttpLabelCommandCommandInput,\n    HttpLabelCommandCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"XYZService\", \"HttpLabelCommand\", {})\n  .n(\"XYZServiceClient\", \"HttpLabelCommandCommand\")\n  .sc(HttpLabelCommand$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: HttpLabelCommandInput;\n      output: {};\n    };\n    sdk: {\n      input: HttpLabelCommandCommandInput;\n      output: HttpLabelCommandCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { TradeEventStreamRequest, TradeEventStreamResponse } from \"../models/models_0\";\nimport { TradeEventStream$ } from \"../schemas/schemas_0\";\nimport type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link TradeEventStreamCommand}.\n */\nexport interface TradeEventStreamCommandInput extends TradeEventStreamRequest {}\n/**\n * @public\n *\n * The output of {@link TradeEventStreamCommand}.\n */\nexport interface TradeEventStreamCommandOutput extends TradeEventStreamResponse, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { XYZServiceClient, TradeEventStreamCommand } from \"xyz-schema\"; // ES Modules import\n * // const { XYZServiceClient, TradeEventStreamCommand } = require(\"xyz-schema\"); // CommonJS import\n * // import type { XYZServiceClientConfig } from \"xyz-schema\";\n * const config = {}; // type is XYZServiceClientConfig\n * const client = new XYZServiceClient(config);\n * const input = { // TradeEventStreamRequest\n *   eventStream: { // TradeEvents Union: only one key present\n *     alpha: { // Alpha\n *       id: \"STRING_VALUE\",\n *       timestamp: new Date(\"TIMESTAMP\"),\n *     },\n *     beta: {},\n *     gamma: {},\n *     delta: { // DifferentShapeName\n *       name: \"STRING_VALUE\",\n *       number: Number(\"int\"),\n *     },\n *   },\n * };\n * const command = new TradeEventStreamCommand(input);\n * const response = await client.send(command);\n * // { // TradeEventStreamResponse\n * //   eventStream: { // TradeEvents Union: only one key present\n * //     alpha: { // Alpha\n * //       id: \"STRING_VALUE\",\n * //       timestamp: new Date(\"TIMESTAMP\"),\n * //     },\n * //     beta: {},\n * //     gamma: {},\n * //     delta: { // DifferentShapeName\n * //       name: \"STRING_VALUE\",\n * //       number: Number(\"int\"),\n * //     },\n * //   },\n * // };\n *\n * ```\n *\n * @param TradeEventStreamCommandInput - {@link TradeEventStreamCommandInput}\n * @returns {@link TradeEventStreamCommandOutput}\n * @see {@link TradeEventStreamCommandInput} for command's `input` shape.\n * @see {@link TradeEventStreamCommandOutput} for command's `response` shape.\n * @see {@link XYZServiceClientResolvedConfig | config} for XYZServiceClient's `config` shape.\n *\n * @throws {@link MainServiceLinkedError} (client fault)\n *\n * @throws {@link XYZServiceSyntheticServiceException}\n * <p>Base exception class for all service exceptions from XYZService service.</p>\n *\n *\n */\nexport class TradeEventStreamCommand extends $Command\n  .classBuilder<\n    TradeEventStreamCommandInput,\n    TradeEventStreamCommandOutput,\n    XYZServiceClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"XYZService\", \"TradeEventStream\", {\n    /**\n     * @internal\n     */\n    eventStream: {\n      input: true,\n      output: true,\n    },\n  })\n  .n(\"XYZServiceClient\", \"TradeEventStreamCommand\")\n  .sc(TradeEventStream$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: TradeEventStreamRequest;\n      output: TradeEventStreamResponse;\n    };\n    sdk: {\n      input: TradeEventStreamCommandInput;\n      output: TradeEventStreamCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/commands/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./CamelCaseOperationCommand\";\nexport * from \"./GetNumbersCommand\";\nexport * from \"./HttpLabelCommandCommand\";\nexport * from \"./TradeEventStreamCommand\";\n"
  },
  {
    "path": "private/my-local-model-schema/src/endpoint/EndpointParameters.ts",
    "content": "// smithy-typescript generated code\nimport type { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface ClientInputEndpointParameters {\n  clientContextParams?: {\n    apiKey?: string | undefined | Provider<string | undefined>;\n    region?: string | undefined | Provider<string | undefined>;\n    customParam?: string | undefined | Provider<string | undefined>;\n    enableFeature?: boolean | undefined | Provider<boolean | undefined>;\n    debugMode?: boolean | undefined | Provider<boolean | undefined>;\n    nonConflictingParam?: string | undefined | Provider<string | undefined>;\n    logger?: string | undefined | Provider<string | undefined>;\n  };\n  endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n  customParam?: string | undefined | Provider<string | undefined>;\n  enableFeature?: boolean | undefined | Provider<boolean | undefined>;\n  debugMode?: boolean | undefined | Provider<boolean | undefined>;\n  nonConflictingParam?: string | undefined | Provider<string | undefined>;\n}\n\n/**\n * @public\n */\nexport type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, \"endpoint\"> & {\n  defaultSigningName: string;\n};\n\n/**\n * @internal\n */\nconst clientContextParamDefaults = {\n  logger: \"default-logger\",\n} as const;\n\n/**\n * @internal\n */\nexport const resolveClientEndpointParameters = <T>(\n  options: T & ClientInputEndpointParameters\n): T & ClientResolvedEndpointParameters => {\n  return Object.assign(options, {\n    customParam: options.customParam ?? \"default-custom-value\",\n    enableFeature: options.enableFeature ?? true,\n    debugMode: options.debugMode ?? false,\n    nonConflictingParam: options.nonConflictingParam ?? \"non-conflict-default\",\n    defaultSigningName: \"\",\n    clientContextParams: Object.assign(clientContextParamDefaults, options.clientContextParams),\n  });\n};\n\n/**\n * @internal\n */\nexport const commonParams = {\n  ApiKey: { type: \"clientContextParams\", name: \"apiKey\" },\n  nonConflictingParam: { type: \"clientContextParams\", name: \"nonConflictingParam\" },\n  logger: { type: \"clientContextParams\", name: \"logger\" },\n  region: { type: \"clientContextParams\", name: \"region\" },\n  customParam: { type: \"clientContextParams\", name: \"customParam\" },\n  debugMode: { type: \"clientContextParams\", name: \"debugMode\" },\n  enableFeature: { type: \"clientContextParams\", name: \"enableFeature\" },\n  endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n} as const;\n\n/**\n * @internal\n */\nexport interface EndpointParameters extends __EndpointParameters {\n  endpoint?: string | undefined;\n  ApiKey?: string | undefined;\n  region?: string | undefined;\n  customParam?: string | undefined;\n  enableFeature?: boolean | undefined;\n  debugMode?: boolean | undefined;\n  nonConflictingParam?: string | undefined;\n  logger?: string | undefined;\n  CustomHeaderValue?: string | undefined;\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/endpoint/bdd.ts",
    "content": "// smithy-typescript generated code\nimport { BinaryDecisionDiagram } from \"@smithy/core/endpoints\";\n\nconst d=\"x-api-key\";\nconst a=\"isSet\",\nb=\"{endpoint}\",\nc=[\"{ApiKey}\"];\nconst _data={\n  conditions: [\n    [a,[{ref:\"endpoint\"}]],\n    [a,[{ref:\"ApiKey\"}]],\n    [a,[{ref:\"CustomHeaderValue\"}]]\n  ],\n  results: [\n    [-1],\n    [b,{},{[d]:c,\"x-custom-header\":[\"{CustomHeaderValue}\"]}],\n    [b,{},{[d]:c}],\n    [b,{}],\n    [-1,\"endpoint is not set - you must configure an endpoint.\"]\n  ]\n};\n\nconst root = 2;\nconst r = 100_000_000;\nconst nodes = new Int32Array([\n  -1, 1, -1,\n  0, 3, r + 4,\n  1, 4, r + 3,\n  2, r + 1, r + 2,\n]);\nexport const bdd = BinaryDecisionDiagram.from(\n  nodes, root, _data.conditions, _data.results\n);\n"
  },
  {
    "path": "private/my-local-model-schema/src/endpoint/endpointResolver.ts",
    "content": "// smithy-typescript generated code\nimport { type EndpointParams, decideEndpoint, EndpointCache } from \"@smithy/core/endpoints\";\nimport type { EndpointV2, Logger } from \"@smithy/types\";\n\nimport { bdd } from \"./bdd\";\nimport type { EndpointParameters } from \"./EndpointParameters\";\n\nconst cache = new EndpointCache({\n  size: 50,\n  params: [\"ApiKey\", \"CustomHeaderValue\", \"endpoint\"],\n});\n\n/**\n * @internal\n */\nexport const defaultEndpointResolver = (\n  endpointParams: EndpointParameters,\n  context: { logger?: Logger } = {}\n): EndpointV2 => {\n  return cache.get(endpointParams as EndpointParams, () =>\n    decideEndpoint(bdd, {\n      endpointParams: endpointParams as EndpointParams,\n      logger: context.logger,\n    })\n  );\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/extensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { HttpHandlerExtensionConfiguration } from \"@smithy/core/protocols\";\nimport type { DefaultExtensionConfiguration } from \"@smithy/types\";\n\nimport type { HttpAuthExtensionConfiguration } from \"./auth/httpAuthExtensionConfiguration\";\n\n/**\n * @internal\n */\nexport interface XYZServiceExtensionConfiguration\n  extends HttpHandlerExtensionConfiguration,\n    DefaultExtensionConfiguration,\n    HttpAuthExtensionConfiguration {}\n"
  },
  {
    "path": "private/my-local-model-schema/src/index.ts",
    "content": "// smithy-typescript generated code\n/* eslint-disable */\n/**\n * xyz interfaces\n *\n * @packageDocumentation\n */\nexport * from \"./XYZServiceClient\";\nexport * from \"./XYZService\";\nexport type { ClientInputEndpointParameters } from \"./endpoint/EndpointParameters\";\nexport type { RuntimeExtension } from \"./runtimeExtensions\";\nexport type { XYZServiceExtensionConfiguration } from \"./extensionConfiguration\";\nexport * from \"./commands\";\nexport * from \"./schemas/schemas_0\";\nexport * from \"./pagination\";\nexport * from \"./waiters\";\n\nexport * from \"./models/errors\";\nexport * from \"./models/models_0\";\n\nexport { XYZServiceSyntheticServiceException } from \"./models/XYZServiceSyntheticServiceException\";\n"
  },
  {
    "path": "private/my-local-model-schema/src/models/XYZServiceSyntheticServiceException.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type ServiceExceptionOptions as __ServiceExceptionOptions,\n  ServiceException as __ServiceException,\n} from \"@smithy/core/client\";\n\nexport type { __ServiceExceptionOptions };\n\nexport { __ServiceException };\n\n/**\n * @public\n *\n * Base exception class for all service exceptions from XYZService service.\n */\nexport class XYZServiceSyntheticServiceException extends __ServiceException {\n  /**\n   * @internal\n   */\n  constructor(options: __ServiceExceptionOptions) {\n    super(options);\n    Object.setPrototypeOf(this, XYZServiceSyntheticServiceException.prototype);\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/models/errors.ts",
    "content": "// smithy-typescript generated code\nimport type { ExceptionOptionType as __ExceptionOptionType } from \"@smithy/core/client\";\n\nimport { XYZServiceSyntheticServiceException as __BaseException } from \"./XYZServiceSyntheticServiceException\";\n\n/**\n * @public\n */\nexport class MainServiceLinkedError extends __BaseException {\n  readonly name = \"MainServiceLinkedError\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<MainServiceLinkedError, __BaseException>) {\n    super({\n      name: \"MainServiceLinkedError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, MainServiceLinkedError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class CodedThrottlingError extends __BaseException {\n  readonly name = \"CodedThrottlingError\" as const;\n  readonly $fault = \"client\" as const;\n  $retryable = {\n    throttling: true,\n  };\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<CodedThrottlingError, __BaseException>) {\n    super({\n      name: \"CodedThrottlingError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, CodedThrottlingError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class HaltError extends __BaseException {\n  readonly name = \"HaltError\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<HaltError, __BaseException>) {\n    super({\n      name: \"HaltError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, HaltError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class MysteryThrottlingError extends __BaseException {\n  readonly name = \"MysteryThrottlingError\" as const;\n  readonly $fault = \"client\" as const;\n  $retryable = {\n    throttling: true,\n  };\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<MysteryThrottlingError, __BaseException>) {\n    super({\n      name: \"MysteryThrottlingError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, MysteryThrottlingError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class RetryableError extends __BaseException {\n  readonly name = \"RetryableError\" as const;\n  readonly $fault = \"client\" as const;\n  $retryable = {};\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<RetryableError, __BaseException>) {\n    super({\n      name: \"RetryableError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, RetryableError.prototype);\n  }\n}\n\n/**\n * @public\n */\nexport class XYZServiceServiceException extends __BaseException {\n  readonly name = \"XYZServiceServiceException\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<XYZServiceServiceException, __BaseException>) {\n    super({\n      name: \"XYZServiceServiceException\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, XYZServiceServiceException.prototype);\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/models/models_0.ts",
    "content": "// smithy-typescript generated code\nimport type { NumericValue } from \"@smithy/core/serde\";\n\n/**\n * @public\n */\nexport interface HttpLabelCommandInput {\n  LabelDoesNotApplyToRpcProtocol: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface HttpLabelCommandOutput {}\n\n/**\n * @public\n */\nexport interface Alpha {\n  id?: string | undefined;\n  timestamp?: Date | undefined;\n}\n\n/**\n * @public\n */\nexport interface CamelCaseOperationInput {\n  token?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface CamelCaseOperationOutput {\n  token?: string | undefined;\n  results?: Uint8Array[] | undefined;\n}\n\n/**\n * @public\n */\nexport interface DifferentShapeName {\n  name?: string | undefined;\n  number?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface GetNumbersRequest {\n  bigDecimal?: NumericValue | undefined;\n  bigInteger?: bigint | undefined;\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated deprecated.\n   * @public\n   */\n  fieldWithoutMessage?: string | undefined;\n\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated (since 3.0) This field has been deprecated.\n   * @public\n   */\n  fieldWithMessage?: string | undefined;\n\n  startToken?: string | undefined;\n  maxResults?: number | undefined;\n  customHeaderInput?: string | undefined;\n  numbers?: Record<string, number> | undefined;\n  sparseNumbers?: Record<string, number | null> | undefined;\n}\n\n/**\n * @public\n */\nexport interface GetNumbersResponse {\n  bigDecimal?: NumericValue | undefined;\n  bigInteger?: bigint | undefined;\n  numbers?: number[] | undefined;\n  sparseNumbers?: (number | null)[] | undefined;\n  nextToken?: string | undefined;\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated (since 1685-12-31) these numbers are not used anymore.\n   * @public\n   */\n  deprecatedNumbers?: number[] | undefined;\n\n  /**\n   * This is deprecated documentation annotation.\n   *\n   * @deprecated since 1685-12-31.\n   * @public\n   */\n  deprecatedNumbersWithoutExplanation?: number[] | undefined;\n\n  /**\n   * @deprecated these numbers are not used anymore??\n   * @public\n   */\n  deprecatedNumbersWithoutChronology?: number[] | undefined;\n\n  /**\n   * @deprecated deprecated.\n   * @public\n   */\n  inexplicablyDeprecatedNumbers?: number[] | undefined;\n}\n\n/**\n * @public\n */\nexport interface Unit {}\n\n/**\n * @public\n */\nexport type TradeEvents =\n  | TradeEvents.AlphaMember\n  | TradeEvents.BetaMember\n  | TradeEvents.DeltaMember\n  | TradeEvents.GammaMember\n  | TradeEvents.$UnknownMember;\n\n/**\n * @public\n */\nexport namespace TradeEvents {\n  export interface AlphaMember {\n    alpha: Alpha;\n    beta?: never;\n    gamma?: never;\n    delta?: never;\n    $unknown?: never;\n  }\n\n  export interface BetaMember {\n    alpha?: never;\n    beta: Unit;\n    gamma?: never;\n    delta?: never;\n    $unknown?: never;\n  }\n\n  export interface GammaMember {\n    alpha?: never;\n    beta?: never;\n    gamma: Unit;\n    delta?: never;\n    $unknown?: never;\n  }\n\n  export interface DeltaMember {\n    alpha?: never;\n    beta?: never;\n    gamma?: never;\n    delta: DifferentShapeName;\n    $unknown?: never;\n  }\n\n  /**\n   * @public\n   */\n  export interface $UnknownMember {\n    alpha?: never;\n    beta?: never;\n    gamma?: never;\n    delta?: never;\n    $unknown: [string, any];\n  }\n\n  /**\n   * @deprecated unused in schema-serde mode.\n   *\n   */\n  export interface Visitor<T> {\n    alpha: (value: Alpha) => T;\n    beta: (value: Unit) => T;\n    gamma: (value: Unit) => T;\n    delta: (value: DifferentShapeName) => T;\n    _: (name: string, value: any) => T;\n  }\n}\n\n/**\n * @public\n */\nexport interface TradeEventStreamRequest {\n  eventStream?: AsyncIterable<TradeEvents> | undefined;\n}\n\n/**\n * @public\n */\nexport interface TradeEventStreamResponse {\n  eventStream?: AsyncIterable<TradeEvents> | undefined;\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/pagination/GetNumbersPaginator.ts",
    "content": "// smithy-typescript generated code\nimport { createPaginator } from \"@smithy/core\";\nimport type { Paginator } from \"@smithy/types\";\n\nimport { GetNumbersCommand, GetNumbersCommandInput, GetNumbersCommandOutput } from \"../commands/GetNumbersCommand\";\nimport { XYZServiceClient } from \"../XYZServiceClient\";\nimport type { XYZServicePaginationConfiguration } from \"./Interfaces\";\n\n/**\n * @public\n */\nexport const paginateGetNumbers: (\n  config: XYZServicePaginationConfiguration,\n  input: GetNumbersCommandInput,\n  ...rest: any[]\n) => Paginator<GetNumbersCommandOutput> = createPaginator<\n  XYZServicePaginationConfiguration,\n  GetNumbersCommandInput,\n  GetNumbersCommandOutput\n>(XYZServiceClient, GetNumbersCommand, \"startToken\", \"nextToken\", \"maxResults\");\n"
  },
  {
    "path": "private/my-local-model-schema/src/pagination/Interfaces.ts",
    "content": "// smithy-typescript generated code\nimport type { PaginationConfiguration } from \"@smithy/types\";\n\nimport { XYZServiceClient } from \"../XYZServiceClient\";\n\n/**\n * @public\n */\nexport interface XYZServicePaginationConfiguration extends PaginationConfiguration {\n  client: XYZServiceClient;\n}\n"
  },
  {
    "path": "private/my-local-model-schema/src/pagination/camelCaseOperationPaginator.ts",
    "content": "// smithy-typescript generated code\nimport { createPaginator } from \"@smithy/core\";\nimport type { Paginator } from \"@smithy/types\";\n\nimport {\n  CamelCaseOperationCommand,\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput,\n} from \"../commands/CamelCaseOperationCommand\";\nimport { XYZServiceClient } from \"../XYZServiceClient\";\nimport type { XYZServicePaginationConfiguration } from \"./Interfaces\";\n\n/**\n * @public\n */\nexport const paginatecamelCaseOperation: (\n  config: XYZServicePaginationConfiguration,\n  input: CamelCaseOperationCommandInput,\n  ...rest: any[]\n) => Paginator<CamelCaseOperationCommandOutput> = createPaginator<\n  XYZServicePaginationConfiguration,\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput\n>(XYZServiceClient, CamelCaseOperationCommand, \"token\", \"token\", \"\");\n"
  },
  {
    "path": "private/my-local-model-schema/src/pagination/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./Interfaces\";\nexport * from \"./camelCaseOperationPaginator\";\nexport * from \"./GetNumbersPaginator\";\n"
  },
  {
    "path": "private/my-local-model-schema/src/runtimeConfig.browser.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport { eventStreamSerdeProvider } from \"@smithy/core/event-streams\";\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from \"@smithy/core/retry\";\nimport { calculateBodyLength } from \"@smithy/core/serde\";\nimport { FetchHttpHandler as RequestHandler, streamCollector } from \"@smithy/fetch-http-handler\";\n\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"browser\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,\n    maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),\n    sha256: config?.sha256 ?? Sha256,\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/runtimeConfig.native.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-js\";\n\nimport { getRuntimeConfig as getBrowserRuntimeConfig } from \"./runtimeConfig.browser\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  const browserDefaults = getBrowserRuntimeConfig(config);\n  return {\n    ...browserDefaults,\n    ...config,\n    runtime: \"react-native\",\n    sha256: config?.sha256 ?? Sha256,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/runtimeConfig.shared.ts",
    "content": "// smithy-typescript generated code\nimport { HttpApiKeyAuthSigner } from \"@smithy/core\";\nimport { SmithyRpcV2CborProtocol } from \"@smithy/core/cbor\";\nimport { NoOpLogger } from \"@smithy/core/client\";\nimport { parseUrl } from \"@smithy/core/protocols\";\nimport { fromBase64, fromUtf8, toBase64, toUtf8 } from \"@smithy/core/serde\";\nimport type { IdentityProviderConfig } from \"@smithy/types\";\n\nimport { defaultXYZServiceHttpAuthSchemeProvider } from \"./auth/httpAuthSchemeProvider\";\nimport { defaultEndpointResolver } from \"./endpoint/endpointResolver\";\nimport { errorTypeRegistries } from \"./schemas/schemas_0\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  return {\n    apiVersion: \"1.0\",\n    base64Decoder: config?.base64Decoder ?? fromBase64,\n    base64Encoder: config?.base64Encoder ?? toBase64,\n    disableHostPrefix: config?.disableHostPrefix ?? false,\n    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,\n    extensions: config?.extensions ?? [],\n    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultXYZServiceHttpAuthSchemeProvider,\n    httpAuthSchemes: config?.httpAuthSchemes ?? [\n      {\n        schemeId: \"smithy.api#httpApiKeyAuth\",\n        identityProvider: (ipc: IdentityProviderConfig) =>\n          ipc.getIdentityProvider(\"smithy.api#httpApiKeyAuth\"),\n        signer: new HttpApiKeyAuthSigner(),\n      },\n    ],\n    logger: config?.logger ?? new NoOpLogger(),\n    protocol: config?.protocol ?? SmithyRpcV2CborProtocol,\n    protocolSettings: config?.protocolSettings ?? {\n      defaultNamespace: \"org.xyz.v1\",\n      errorTypeRegistries,\n    },\n    urlParser: config?.urlParser ?? parseUrl,\n    utf8Decoder: config?.utf8Decoder ?? fromUtf8,\n    utf8Encoder: config?.utf8Encoder ?? toUtf8,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/runtimeConfig.ts",
    "content": "// smithy-typescript generated code\nimport { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { loadConfig as loadNodeConfig, resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport { eventStreamSerdeProvider } from \"@smithy/core/event-streams\";\nimport {\n  DEFAULT_RETRY_MODE,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  NODE_RETRY_MODE_CONFIG_OPTIONS,\n} from \"@smithy/core/retry\";\nimport { calculateBodyLength, Hash } from \"@smithy/core/serde\";\nimport { NodeHttpHandler as RequestHandler, streamCollector } from \"@smithy/node-http-handler\";\n\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\nimport type { XYZServiceClientConfig } from \"./XYZServiceClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: XYZServiceClientConfig) => {\n  emitWarningIfUnsupportedVersion(process.version);\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"node\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,\n    maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode:\n      config?.retryMode ??\n      loadNodeConfig(\n        {\n          ...NODE_RETRY_MODE_CONFIG_OPTIONS,\n          default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,\n        },\n        config\n      ),\n    sha256: config?.sha256 ?? Hash.bind(null, \"sha256\"),\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/runtimeExtensions.ts",
    "content": "// smithy-typescript generated code\nimport { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from \"@smithy/core/client\";\nimport { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from \"@smithy/core/protocols\";\n\nimport { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from \"./auth/httpAuthExtensionConfiguration\";\nimport type { XYZServiceExtensionConfiguration } from \"./extensionConfiguration\";\n\n/**\n * @public\n */\nexport interface RuntimeExtension {\n  configure(extensionConfiguration: XYZServiceExtensionConfiguration): void;\n}\n\n/**\n * @public\n */\nexport interface RuntimeExtensionsConfig {\n  extensions: RuntimeExtension[];\n}\n\n/**\n * @internal\n */\nexport const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {\n  const extensionConfiguration: XYZServiceExtensionConfiguration = Object.assign(\n    getDefaultExtensionConfiguration(runtimeConfig),\n    getHttpHandlerExtensionConfiguration(runtimeConfig),\n    getHttpAuthExtensionConfiguration(runtimeConfig)\n  );\n\n  extensions.forEach((extension) => extension.configure(extensionConfiguration));\n\n  return Object.assign(\n    runtimeConfig,\n    resolveDefaultRuntimeConfig(extensionConfiguration),\n    resolveHttpHandlerRuntimeConfig(extensionConfiguration),\n    resolveHttpAuthRuntimeConfig(extensionConfiguration)\n  );\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/schemas/schemas_0.ts",
    "content": "const _A = \"Alpha\";\nconst _CTE = \"CodedThrottlingError\";\nconst _DSN = \"DifferentShapeName\";\nconst _GN = \"GetNumbers\";\nconst _GNR = \"GetNumbersRequest\";\nconst _GNRe = \"GetNumbersResponse\";\nconst _HE = \"HaltError\";\nconst _HLC = \"HttpLabelCommand\";\nconst _HLCI = \"HttpLabelCommandInput\";\nconst _HLCO = \"HttpLabelCommandOutput\";\nconst _LDNATRP = \"LabelDoesNotApplyToRpcProtocol\";\nconst _MSLE = \"MainServiceLinkedError\";\nconst _MTE = \"MysteryThrottlingError\";\nconst _RE = \"RetryableError\";\nconst _SIL = \"SparseIntegerList\";\nconst _SIM = \"SparseIntegerMap\";\nconst _TE = \"TradeEvents\";\nconst _TES = \"TradeEventStream\";\nconst _TESR = \"TradeEventStreamRequest\";\nconst _TESRr = \"TradeEventStreamResponse\";\nconst _XYZSSE = \"XYZServiceServiceException\";\nconst _a = \"alpha\";\nconst _b = \"beta\";\nconst _bD = \"bigDecimal\";\nconst _bI = \"bigInteger\";\nconst _c = \"client\";\nconst _cCO = \"camelCaseOperation\";\nconst _cCOI = \"camelCaseOperationInput\";\nconst _cCOO = \"camelCaseOperationOutput\";\nconst _cHI = \"customHeaderInput\";\nconst _d = \"delta\";\nconst _dN = \"deprecatedNumbers\";\nconst _dNWC = \"deprecatedNumbersWithoutChronology\";\nconst _dNWE = \"deprecatedNumbersWithoutExplanation\";\nconst _e = \"error\";\nconst _eS = \"eventStream\";\nconst _fWM = \"fieldWithoutMessage\";\nconst _fWMi = \"fieldWithMessage\";\nconst _g = \"gamma\";\nconst _h = \"http\";\nconst _hE = \"httpError\";\nconst _i = \"id\";\nconst _iDN = \"inexplicablyDeprecatedNumbers\";\nconst _m = \"message\";\nconst _mR = \"maxResults\";\nconst _n = \"name\";\nconst _nT = \"nextToken\";\nconst _nu = \"number\";\nconst _num = \"numbers\";\nconst _r = \"results\";\nconst _s = \"smithy.ts.sdk.synthetic.org.xyz.v1\";\nconst _sN = \"sparseNumbers\";\nconst _sT = \"startToken\";\nconst _sp = \"sparse\";\nconst _st = \"streaming\";\nconst _t = \"timestamp\";\nconst _to = \"token\";\nconst n0 = \"org.xyz.v1\";\nconst n1 = \"org.xyz.secondary\";\n\n// smithy-typescript generated code\nimport { TypeRegistry } from \"@smithy/core/schema\";\nimport type {\n  StaticErrorSchema,\n  StaticListSchema,\n  StaticMapSchema,\n  StaticOperationSchema,\n  StaticStructureSchema,\n  StaticUnionSchema,\n} from \"@smithy/types\";\n\nimport {\n  CodedThrottlingError,\n  HaltError,\n  MainServiceLinkedError,\n  MysteryThrottlingError,\n  RetryableError,\n  XYZServiceServiceException,\n} from \"../models/errors\";\nimport { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\n\n/* eslint no-var: 0 */\nconst _s_registry = TypeRegistry.for(_s);\nexport var XYZServiceSyntheticServiceException$: StaticErrorSchema = [-3, _s, \"XYZServiceSyntheticServiceException\", 0, [], []];\n_s_registry.registerError(XYZServiceSyntheticServiceException$, XYZServiceSyntheticServiceException);\nconst n0_registry = TypeRegistry.for(n0);\nexport var CodedThrottlingError$: StaticErrorSchema = [-3, n0, _CTE,\n  { [_e]: _c, [_hE]: 429 },\n  [],\n  []\n];\nn0_registry.registerError(CodedThrottlingError$, CodedThrottlingError);\nexport var HaltError$: StaticErrorSchema = [-3, n0, _HE,\n  { [_e]: _c },\n  [_m],\n  [0]\n];\nn0_registry.registerError(HaltError$, HaltError);\nexport var MainServiceLinkedError$: StaticErrorSchema = [-3, n0, _MSLE,\n  { [_e]: _c, [_hE]: 400 },\n  [],\n  []\n];\nn0_registry.registerError(MainServiceLinkedError$, MainServiceLinkedError);\nexport var MysteryThrottlingError$: StaticErrorSchema = [-3, n0, _MTE,\n  { [_e]: _c },\n  [],\n  []\n];\nn0_registry.registerError(MysteryThrottlingError$, MysteryThrottlingError);\nexport var RetryableError$: StaticErrorSchema = [-3, n0, _RE,\n  { [_e]: _c },\n  [_m],\n  [0]\n];\nn0_registry.registerError(RetryableError$, RetryableError);\nexport var XYZServiceServiceException$: StaticErrorSchema = [-3, n0, _XYZSSE,\n  { [_e]: _c },\n  [],\n  []\n];\nn0_registry.registerError(XYZServiceServiceException$, XYZServiceServiceException);\n/**\n * TypeRegistry instances containing modeled errors.\n * @internal\n *\n */\nexport const errorTypeRegistries = [\n  _s_registry,\n  n0_registry,\n]\nexport var HttpLabelCommandInput$: StaticStructureSchema = [3, n1, _HLCI,\n  0,\n  [_LDNATRP],\n  [[0, 1]], 1\n];\nexport var HttpLabelCommandOutput$: StaticStructureSchema = [3, n1, _HLCO,\n  0,\n  [],\n  []\n];\nexport var Alpha$: StaticStructureSchema = [3, n0, _A,\n  0,\n  [_i, _t],\n  [0, 4]\n];\nexport var camelCaseOperationInput$: StaticStructureSchema = [3, n0, _cCOI,\n  0,\n  [_to],\n  [0]\n];\nexport var camelCaseOperationOutput$: StaticStructureSchema = [3, n0, _cCOO,\n  0,\n  [_to, _r],\n  [0, 64 | 21]\n];\nexport var DifferentShapeName$: StaticStructureSchema = [3, n0, _DSN,\n  0,\n  [_n, _nu],\n  [0, 1]\n];\nexport var GetNumbersRequest$: StaticStructureSchema = [3, n0, _GNR,\n  0,\n  [_bD, _bI, _fWM, _fWMi, _sT, _mR, _cHI, _num, _sN],\n  [19, 17, 0, 0, 0, 1, 0, 128 | 1, [() => SparseIntegerMap, 0]]\n];\nexport var GetNumbersResponse$: StaticStructureSchema = [3, n0, _GNRe,\n  0,\n  [_bD, _bI, _num, _sN, _nT, _dN, _dNWE, _dNWC, _iDN],\n  [19, 17, 64 | 1, [() => SparseIntegerList, 0], 0, 64 | 1, 64 | 1, 64 | 1, 64 | 1]\n];\nexport var TradeEventStreamRequest$: StaticStructureSchema = [3, n0, _TESR,\n  0,\n  [_eS],\n  [[() => TradeEvents$, 0]]\n];\nexport var TradeEventStreamResponse$: StaticStructureSchema = [3, n0, _TESRr,\n  0,\n  [_eS],\n  [[() => TradeEvents$, 0]]\n];\nvar __Unit = \"unit\" as const;\nvar Blobs = 64 | 21;\nvar IntegerList = 64 | 1;\nvar SparseIntegerList: StaticListSchema = [1, n0, _SIL,\n  { [_sp]: 1 }, 1\n];\nvar IntegerMap = 128 | 1;\nvar SparseIntegerMap: StaticMapSchema = [2, n0, _SIM,\n  { [_sp]: 1 }, 0, 1\n];\nexport var TradeEvents$: StaticUnionSchema = [4, n0, _TE,\n  { [_st]: 1 },\n  [_a, _b, _g, _d],\n  [() => Alpha$, () => __Unit, () => __Unit, () => DifferentShapeName$]\n];\nexport var HttpLabelCommand$: StaticOperationSchema = [9, n1, _HLC,\n  { [_h]: [\"POST\", \"/{LabelDoesNotApplyToRpcProtocol}\", 200] }, () => HttpLabelCommandInput$, () => HttpLabelCommandOutput$\n];\nexport var camelCaseOperation$: StaticOperationSchema = [9, n0, _cCO,\n  { [_h]: [\"POST\", \"/camel-case\", 200] }, () => camelCaseOperationInput$, () => camelCaseOperationOutput$\n];\nexport var GetNumbers$: StaticOperationSchema = [9, n0, _GN,\n  { [_h]: [\"POST\", \"/get-numbers\", 200] }, () => GetNumbersRequest$, () => GetNumbersResponse$\n];\nexport var TradeEventStream$: StaticOperationSchema = [9, n0, _TES,\n  { [_h]: [\"POST\", \"/trade-event-stream\", 200] }, () => TradeEventStreamRequest$, () => TradeEventStreamResponse$\n];\n"
  },
  {
    "path": "private/my-local-model-schema/src/waiters/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./waitForNumbersAligned\";\nexport * from \"./waitForNumbersMisaligned\";\nexport * from \"./waitForNumbersWhatDoTheyDoAnyway\";\n"
  },
  {
    "path": "private/my-local-model-schema/src/waiters/waitForNumbersAligned.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type WaiterConfiguration,\n  type WaiterResult,\n  checkExceptions,\n  createWaiter,\n  WaiterState,\n} from \"@smithy/core/client\";\n\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"../commands/GetNumbersCommand\";\nimport type { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\nimport type { XYZServiceClient } from \"../XYZServiceClient\";\n\nconst checkState = async (client: XYZServiceClient, input: GetNumbersCommandInput): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  let reason;\n  try {\n    let result: GetNumbersCommandOutput & any = await client.send(new GetNumbersCommand(input));\n    reason = result;\n    return { state: WaiterState.SUCCESS, reason };\n  } catch (exception) {\n    reason = exception;\n    if (exception.name === \"MysteryThrottlingError\") {\n      return { state: WaiterState.RETRY, reason };\n    }\n    if (exception.name === \"HaltError\") {\n      return { state: WaiterState.FAILURE, reason };\n    }\n  }\n  return { state: WaiterState.RETRY, reason };\n};\n/**\n * wait until the numbers align\n *  @deprecated Use waitUntilNumbersAligned instead. waitForNumbersAligned does not throw error in non-success cases.\n */\nexport const waitForNumbersAligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n};\n/**\n * wait until the numbers align\n *  @param params - Waiter configuration options.\n *  @param input - The input to GetNumbersCommand for polling.\n */\nexport const waitUntilNumbersAligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n  return checkExceptions(result) as WaiterResult<GetNumbersCommandOutput>;\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/waiters/waitForNumbersMisaligned.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type WaiterConfiguration,\n  type WaiterResult,\n  checkExceptions,\n  createWaiter,\n  WaiterState,\n} from \"@smithy/core/client\";\n\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"../commands/GetNumbersCommand\";\nimport type { HaltError } from \"../models/errors\";\nimport type { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\nimport type { XYZServiceClient } from \"../XYZServiceClient\";\n\nconst checkState = async (client: XYZServiceClient, input: GetNumbersCommandInput): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  let reason;\n  try {\n    let result: GetNumbersCommandOutput & any = await client.send(new GetNumbersCommand(input));\n    reason = result;\n    return { state: WaiterState.RETRY, reason };\n  } catch (exception) {\n    reason = exception;\n    if (exception.name === \"HaltError\") {\n      return { state: WaiterState.SUCCESS, reason };\n    }\n  }\n  return { state: WaiterState.RETRY, reason };\n};\n/**\n * wait until the numbers don't align\n *  @deprecated Use waitUntilNumbersMisaligned instead. waitForNumbersMisaligned does not throw error in non-success cases.\n */\nexport const waitForNumbersMisaligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n};\n/**\n * wait until the numbers don't align\n *  @param params - Waiter configuration options.\n *  @param input - The input to GetNumbersCommand for polling.\n */\nexport const waitUntilNumbersMisaligned = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<HaltError>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n  return checkExceptions(result) as WaiterResult<HaltError>;\n};\n"
  },
  {
    "path": "private/my-local-model-schema/src/waiters/waitForNumbersWhatDoTheyDoAnyway.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type WaiterConfiguration,\n  type WaiterResult,\n  checkExceptions,\n  createWaiter,\n  WaiterState,\n} from \"@smithy/core/client\";\n\nimport {\n  type GetNumbersCommandInput,\n  type GetNumbersCommandOutput,\n  GetNumbersCommand,\n} from \"../commands/GetNumbersCommand\";\nimport type { HaltError } from \"../models/errors\";\nimport type { XYZServiceSyntheticServiceException } from \"../models/XYZServiceSyntheticServiceException\";\nimport type { XYZServiceClient } from \"../XYZServiceClient\";\n\nconst checkState = async (client: XYZServiceClient, input: GetNumbersCommandInput): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  let reason;\n  try {\n    let result: GetNumbersCommandOutput & any = await client.send(new GetNumbersCommand(input));\n    reason = result;\n    return { state: WaiterState.SUCCESS, reason };\n  } catch (exception) {\n    reason = exception;\n    if (exception.name === \"HaltError\") {\n      return { state: WaiterState.SUCCESS, reason };\n    }\n  }\n  return { state: WaiterState.RETRY, reason };\n};\n/**\n * wait until the numbers align or don't align\n *  @deprecated Use waitUntilNumbersWhatDoTheyDoAnyway instead. waitForNumbersWhatDoTheyDoAnyway does not throw error in non-success cases.\n */\nexport const waitForNumbersWhatDoTheyDoAnyway = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | XYZServiceSyntheticServiceException>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n};\n/**\n * wait until the numbers align or don't align\n *  @param params - Waiter configuration options.\n *  @param input - The input to GetNumbersCommand for polling.\n */\nexport const waitUntilNumbersWhatDoTheyDoAnyway = async (\n  params: WaiterConfiguration<XYZServiceClient>,\n  input: GetNumbersCommandInput\n): Promise<WaiterResult<GetNumbersCommandOutput | HaltError>> => {\n  const serviceDefaults = { minDelay: 2, maxDelay: 120 };\n  const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\n  return checkExceptions(result) as WaiterResult<GetNumbersCommandOutput | HaltError>;\n};\n"
  },
  {
    "path": "private/my-local-model-schema/test/functional/rpcv2cbor.spec.ts",
    "content": "// smithy-typescript generated code\nimport { afterAll, expect, test as it } from \"vitest\";\n\nimport { GetNumbersCommand } from \"../../src/commands/GetNumbersCommand\";\nimport { HttpLabelCommandCommand } from \"../../src/commands/HttpLabelCommandCommand\";\nimport { XYZServiceClient } from \"../../src/XYZServiceClient\";\nimport { Readable } from \"node:stream\";\nimport { HttpRequest, HttpResponse, type HttpHandler } from \"@smithy/core/protocols\";\nimport type { Endpoint, HeaderBag, HttpHandlerOptions } from \"@smithy/types\";\n\n/**\n * Throws an expected exception that contains the serialized request.\n */\nclass EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error {\n  constructor(readonly request: HttpRequest) {\n    super();\n  }\n}\n\n/**\n * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a\n * request. The thrown exception contains the serialized request.\n */\nclass RequestSerializationTestHandler implements HttpHandler {\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request));\n  }\n  updateHttpClientConfig(key: never, value: never): void {}\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\n/**\n * Returns a resolved Promise of the specified response contents.\n */\nclass ResponseDeserializationTestHandler implements HttpHandler {\n  isSuccess: boolean;\n  code: number;\n  headers: HeaderBag;\n  body: string | Uint8Array;\n  isBase64Body: boolean;\n\n  constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) {\n    this.isSuccess = isSuccess;\n    this.code = code;\n    if (headers === undefined) {\n      this.headers = {};\n    } else {\n      this.headers = headers;\n    }\n    if (body === undefined) {\n      body = \"\";\n    }\n    this.body = body;\n    this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), \"base64\").toString(\"base64\") === body;\n  }\n\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.resolve({\n      response: new HttpResponse({\n        statusCode: this.code,\n        headers: this.headers,\n        body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]),\n      }),\n    });\n  }\n\n  updateHttpClientConfig(key: never, value: never): void {}\n\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\ninterface comparableParts {\n  [key: string]: string;\n}\n\n/**\n * Generates a standard map of un-equal values given input parts.\n */\nconst compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => {\n  const unequalParts: any = {};\n  Object.keys(expectedParts).forEach((key) => {\n    if (generatedParts[key] === undefined) {\n      unequalParts[key] = { exp: expectedParts[key], gen: undefined };\n    } else if (!equivalentContents(expectedParts[key], generatedParts[key])) {\n      unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] };\n    }\n  });\n\n  Object.keys(generatedParts).forEach((key) => {\n    if (expectedParts[key] === undefined) {\n      unequalParts[key] = { exp: undefined, gen: generatedParts[key] };\n    }\n  });\n\n  if (Object.keys(unequalParts).length !== 0) {\n    return unequalParts;\n  }\n  return undefined;\n};\n\n/**\n * Compares all types for equivalent contents, doing nested\n * equality checks based on non-`$metadata`\n * properties that have defined values.\n */\nconst equivalentContents = (expected: any, generated: any): boolean => {\n  if (typeof (global as any).expect === \"function\") {\n    expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected));\n    return true;\n  }\n\n  let localExpected = expected;\n\n  // Short circuit on equality.\n  if (localExpected == generated) {\n    return true;\n  }\n\n  if (typeof expected !== \"object\") {\n    return expected === generated;\n  }\n\n  // If a test fails with an issue in the below 6 lines, it's likely\n  // due to an issue in the nestedness or existence of the property\n  // being compared.\n  delete localExpected[\"$metadata\"];\n  delete generated[\"$metadata\"];\n  Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]);\n  Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]);\n\n  const expectedProperties = Object.getOwnPropertyNames(localExpected);\n  const generatedProperties = Object.getOwnPropertyNames(generated);\n\n  // Short circuit on different property counts.\n  if (expectedProperties.length != generatedProperties.length) {\n    return false;\n  }\n\n  // Compare properties directly.\n  for (var index = 0; index < expectedProperties.length; index++) {\n    const propertyName = expectedProperties[index];\n    if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nconst clientParams = {\n  region: \"us-west-2\",\n  credentials: { accessKeyId: \"key\", secretAccessKey: \"secret\" },\n  apiKey: { apiKey: \"apiKey\" },\n  endpoint: {\n    url: new URL(\"https://localhost/\"),\n    headers: {\n      \"x-default-header\": [\"default-header-value\"],\n    },\n  },\n};\n\n/**\n * A wrapper function that shadows `fail` from jest-jasmine2\n * (jasmine2 was replaced with circus in > v27 as the default test runner)\n */\nconst fail = (error?: any): never => {\n  throw new Error(error);\n};\n\n/**\n * Hexadecimal to byteArray.\n */\nconst toBytes = (hex: string) => {\n  return Buffer.from(hex, \"base64\");\n};\n\nfunction normalizeByteArrayType(data: any) {\n  // normalize float32 errors\n  if (typeof data === \"number\") {\n    const u = new Uint8Array(4);\n    const dv = new DataView(u.buffer, u.byteOffset, u.byteLength);\n    dv.setFloat32(0, data);\n    return dv.getFloat32(0);\n  }\n  if (!data || typeof data !== \"object\") {\n    return data;\n  }\n  if (data instanceof Uint8Array) {\n    return Uint8Array.from(data);\n  }\n  if (data instanceof String || data instanceof Boolean || data instanceof Number) {\n    return data.valueOf();\n  }\n  const output = {} as any;\n  for (const key of Object.getOwnPropertyNames(data)) {\n    output[key] = normalizeByteArrayType(data[key]);\n  }\n  return output;\n}\n\nconst WARMUP_ITERATIONS = 10_000;\nconst BENCHMARK_ITERATIONS = 10_000;\nconst BENCHMARK_TIMEOUT = 60_000;\n\n/**\n * Test name to benchmark data.\n */\nconst benchmarks = {} as Record<\n  string,\n  {\n    n: string;\n    p50: string;\n    p90: string;\n    p95: string;\n    p99: string;\n    mean: string;\n    stdDev: string;\n  }\n>;\n\nfunction logBenchmarks() {\n  console.table(benchmarks);\n}\n\nfunction logBenchmark(name: string, timings: number[]) {\n  const n = timings.length;\n  const p50 = timings[(n - 1) * 0.50 | 0] | 0;\n  const p90 = timings[(n - 1) * 0.90 | 0] | 0;\n  const p95 = timings[(n - 1) * 0.95 | 0] | 0;\n  const p99 = timings[(n - 1) * 0.99 | 0] | 0;\n  const mean = timings.reduce((a, b) => a + b, 0) / timings.length | 0;\n  const stdDev = Math.sqrt(timings.reduce((a, b) => a + (b - mean) ** 2, 0) / timings.length) | 0;\n\n  const fmt = (n: number) => String(n.toLocaleString()).padStart(10, ' ');\n  benchmarks[name] = {\n    n: fmt(n),\n    p50: fmt(p50),\n    p90: fmt(p90),\n    p95: fmt(p95),\n    p99: fmt(p99),\n    mean: fmt(mean),\n    stdDev: fmt(stdDev),\n  };\n  return {\n    name, p95, n, timings\n  };\n}\n\nfunction vizBenchmark({ name, p95, n, timings }: { name: string, p95: number, n: number, timings: number[] }) {\n  const decile = p95 / 10;\n  let d = 1;\n  const centIndex = (n / 100) | 0;\n  let line = \"\";\n\n  console.info(name);\n  console.info(\"=\".repeat(31), \"Distribution Viz\", \"=\".repeat(31));\n  for (let i = 0; i < n; i += centIndex) {\n    const t = timings[i];\n    if (t < decile * d) {\n      line += \".\";\n    } else {\n      line += ` <= ${(decile * d) | 0}`;\n      console.info(line);\n      d += 1;\n      line = \".\";\n    }\n  }\n  console.info(line + ` > ${(decile * (d - 1)) | 0}`);\n  console.info(\"=\".repeat(80));\n}\n\nit(\"HttpLabelCommandExample:Response\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      }\n    ),\n  });\n\n  const params: any = {\n    LabelDoesNotApplyToRpcProtocol: \"placeholder\",\n  };\n  const command = new HttpLabelCommandCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\nit(\"GetNumbersRequestExample:SerdeBenchmark:Request\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new GetNumbersCommand(\n    {\n    } as any,\n  );\n  const name = \"GetNumbersRequestExample:SerdeBenchmark:Request\";\n  const timings = [] as number[];\n  const testStart = performance.now();\n  const numeric = (a: number, b: number) => a - b;\n  let i = 0;\n\n  while (++i) {\n    const preSerialize = performance.now();\n    try {\n      await client.send(command);\n      fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n      return;\n    } catch (err) {\n      if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n        fail(err);\n        return;\n      }\n      const r = err.request;\n    };\n    const postSerialize = performance.now();\n    if (i >= WARMUP_ITERATIONS) {\n      // allow warmup\n      timings.push(postSerialize * 1_000_000 - preSerialize  * 1_000_000);\n    }\n\n    if (timings.length >= BENCHMARK_ITERATIONS) {\n      timings.length = BENCHMARK_ITERATIONS;\n      break;\n    } else if (testStart + 30_000 < preSerialize) {\n      break;\n    }\n  }\n\n  timings.sort(numeric);\n\n  vizBenchmark(logBenchmark(name, timings));\n\n}, BENCHMARK_TIMEOUT);\n\nit(\"EndpointResolvedHeadersApplied:Request\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new GetNumbersCommand(\n    {\n      customHeaderInput: \"test-custom-value\",\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/XYZService/operation/GetNumbers\");\n\n    expect(r.headers[\"x-custom-header\"]).toBe(\"test-custom-value\");\n\n  }\n});\n\nit(\"GetNumbersResponseExample:SerdeBenchmark:Response\", async () => {\n  const client = new XYZServiceClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      }\n    ),\n  });\n\n  const params: any = {};\n  const command = new GetNumbersCommand(params);\n\n  const name = \"GetNumbersResponseExample:SerdeBenchmark:Response\";\n  const timings = [] as number[];\n  const numeric = (a: number, b: number) => a - b;\n  let i = 0;\n\n  client.middlewareStack.addRelativeTo(\n      (next: any) => async (args: any) => {\n        const preDeserialize = performance.now();\n        const r = await next(args);\n        const postDeserialize = performance.now();\n        if (i >= WARMUP_ITERATIONS) {\n          timings.push(postDeserialize * 1_000_000 - preDeserialize * 1_000_000);\n        }\n        return r;\n      },\n      {\n        name: \"deserializerBenchmarkMiddleware\",\n        toMiddleware: \"deserializerMiddleware\",\n        relation: \"before\",\n        override: true,\n      }\n  );\n\n  const benchmarkStart = performance.now();\n\n  while (++i) {\n    let r: any;\n    try {\n      r = await client.send(command);\n    } catch (err) {\n      fail(\"Expected a valid response to be returned, got \" + err);\n      return;\n    }\n    if (i >= WARMUP_ITERATIONS + BENCHMARK_ITERATIONS) {\n      break;\n    } else if (benchmarkStart + 30_000 < performance.now()) {\n      break;\n    }\n  }\n\n  timings.sort(numeric);\n  timings.length = Math.min(timings.length, BENCHMARK_ITERATIONS);\n\n  vizBenchmark(logBenchmark(name, timings));\n\n}, BENCHMARK_TIMEOUT);\n\nafterAll(() => {\n  logBenchmarks();\n});\n"
  },
  {
    "path": "private/my-local-model-schema/test/index-objects.spec.mjs",
    "content": "import {\n  Alpha$,\n  camelCaseOperation$,\n  CamelCaseOperationCommand,\n  camelCaseOperationInput$,\n  camelCaseOperationOutput$,\n  CodedThrottlingError,\n  CodedThrottlingError$,\n  DifferentShapeName$,\n  GetNumbers$,\n  GetNumbersCommand,\n  GetNumbersRequest$,\n  GetNumbersResponse$,\n  HaltError,\n  HaltError$,\n  HttpLabelCommand$,\n  HttpLabelCommandCommand,\n  HttpLabelCommandInput$,\n  HttpLabelCommandOutput$,\n  MainServiceLinkedError,\n  MainServiceLinkedError$,\n  MysteryThrottlingError,\n  MysteryThrottlingError$,\n  paginatecamelCaseOperation,\n  paginateGetNumbers,\n  RetryableError,\n  RetryableError$,\n  TradeEvents$,\n  TradeEventStream$,\n  TradeEventStreamCommand,\n  TradeEventStreamRequest$,\n  TradeEventStreamResponse$,\n  waitForNumbersAligned,\n  waitForNumbersMisaligned,\n  waitForNumbersWhatDoTheyDoAnyway,\n  waitUntilNumbersAligned,\n  waitUntilNumbersMisaligned,\n  waitUntilNumbersWhatDoTheyDoAnyway,\n  XYZService,\n  XYZServiceClient,\n  XYZServiceServiceException,\n  XYZServiceServiceException$,\n  XYZServiceSyntheticServiceException,\n} from \"../dist-cjs/index.js\";\nimport assert from \"node:assert\";\n// clients\nassert(typeof XYZServiceClient === \"function\");\nassert(typeof XYZService === \"function\");\n// commands\nassert(typeof HttpLabelCommandCommand === \"function\");\nassert(typeof HttpLabelCommand$ === \"object\");\nassert(typeof CamelCaseOperationCommand === \"function\");\nassert(typeof camelCaseOperation$ === \"object\");\nassert(typeof GetNumbersCommand === \"function\");\nassert(typeof GetNumbers$ === \"object\");\nassert(typeof TradeEventStreamCommand === \"function\");\nassert(typeof TradeEventStream$ === \"object\");\n// structural schemas\nassert(typeof HttpLabelCommandInput$ === \"object\");\nassert(typeof HttpLabelCommandOutput$ === \"object\");\nassert(typeof Alpha$ === \"object\");\nassert(typeof camelCaseOperationInput$ === \"object\");\nassert(typeof camelCaseOperationOutput$ === \"object\");\nassert(typeof DifferentShapeName$ === \"object\");\nassert(typeof GetNumbersRequest$ === \"object\");\nassert(typeof GetNumbersResponse$ === \"object\");\nassert(typeof TradeEvents$ === \"object\");\nassert(typeof TradeEventStreamRequest$ === \"object\");\nassert(typeof TradeEventStreamResponse$ === \"object\");\n// errors\nassert(CodedThrottlingError.prototype instanceof XYZServiceSyntheticServiceException);\nassert(typeof CodedThrottlingError$ === \"object\");\nassert(HaltError.prototype instanceof XYZServiceSyntheticServiceException);\nassert(typeof HaltError$ === \"object\");\nassert(MainServiceLinkedError.prototype instanceof XYZServiceSyntheticServiceException);\nassert(typeof MainServiceLinkedError$ === \"object\");\nassert(MysteryThrottlingError.prototype instanceof XYZServiceSyntheticServiceException);\nassert(typeof MysteryThrottlingError$ === \"object\");\nassert(RetryableError.prototype instanceof XYZServiceSyntheticServiceException);\nassert(typeof RetryableError$ === \"object\");\nassert(XYZServiceServiceException.prototype instanceof XYZServiceSyntheticServiceException);\nassert(typeof XYZServiceServiceException$ === \"object\");\nassert(XYZServiceSyntheticServiceException.prototype instanceof Error);\n// waiters\nassert(typeof waitForNumbersAligned === \"function\");\nassert(typeof waitForNumbersMisaligned === \"function\");\nassert(typeof waitForNumbersWhatDoTheyDoAnyway === \"function\");\nassert(typeof waitUntilNumbersAligned === \"function\");\nassert(typeof waitUntilNumbersMisaligned === \"function\");\nassert(typeof waitUntilNumbersWhatDoTheyDoAnyway === \"function\");\n// paginators\nassert(typeof paginateGetNumbers === \"function\");\nassert(typeof paginatecamelCaseOperation === \"function\");\nconsole.log(`XYZService index test passed.`);\n"
  },
  {
    "path": "private/my-local-model-schema/test/index-types.ts",
    "content": "// smithy-typescript generated code\nexport type {\n  XYZServiceClient,\n  XYZService,\n  HttpLabelCommandCommand,\n  HttpLabelCommandCommandInput,\n  HttpLabelCommandCommandOutput,\n  CamelCaseOperationCommand,\n  CamelCaseOperationCommandInput,\n  CamelCaseOperationCommandOutput,\n  GetNumbersCommand,\n  GetNumbersCommandInput,\n  GetNumbersCommandOutput,\n  TradeEventStreamCommand,\n  TradeEventStreamCommandInput,\n  TradeEventStreamCommandOutput,\n  HttpLabelCommandInput,\n  HttpLabelCommandOutput,\n  Alpha,\n  CamelCaseOperationInput,\n  CamelCaseOperationOutput,\n  DifferentShapeName,\n  GetNumbersRequest,\n  GetNumbersResponse,\n  TradeEvents,\n  TradeEventStreamRequest,\n  TradeEventStreamResponse,\n  CodedThrottlingError,\n  HaltError,\n  MainServiceLinkedError,\n  MysteryThrottlingError,\n  RetryableError,\n  XYZServiceServiceException,\n  XYZServiceSyntheticServiceException,\n  waitForNumbersAligned,\n  waitForNumbersMisaligned,\n  waitForNumbersWhatDoTheyDoAnyway,\n  waitUntilNumbersAligned,\n  waitUntilNumbersMisaligned,\n  waitUntilNumbersWhatDoTheyDoAnyway,\n  paginateGetNumbers,\n  paginatecamelCaseOperation,\n} from \"../dist-types/index.d\";\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/req/CamelCaseOperation.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/XYZService/operation/camelCaseOperation\n\nx-api-key: [object Object]\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 17\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\nX-Api-Key: MOCK_api_key\n\n[Uint8Array (cbor object view)]\n{\n  \"token\": \"__token__\"\n}\n\n[actual bytes]\n161, 101, 116, 111, 107, 101, 110, 105, 95, 95, 116, 111, 107, 101, 110, 95, 95\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/req/GetNumbers.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/XYZService/operation/GetNumbers\n\nx-api-key: [object Object]\nx-custom-header: __customHeaderInput__\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 270\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\nX-Api-Key: MOCK_api_key\n\n[Uint8Array (cbor object view)]\n{\n  \"bigDecimal\": {\n    \"string\": \"9876543210.0123456789\",\n    \"type\": \"bigDecimal\"\n  },\n  \"bigInteger\": 1000001,\n  \"fieldWithoutMessage\": \"__fieldWithoutMessage__\",\n  \"fieldWithMessage\": \"__fieldWithMessage__\",\n  \"startToken\": \"__startToken__\",\n  \"maxResults\": 0,\n  \"customHeaderInput\": \"__customHeaderInput__\",\n  \"numbers\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0\n  },\n  \"sparseNumbers\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0,\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n169, 106, 98, 105, 103, 68, 101, 99, 105, 109, 97, 108, 196, 130, 41, 194, 73, 5, 90, 165, 77, 54, 159, 210,\n53, 21, 106, 98, 105, 103, 73, 110, 116, 101, 103, 101, 114, 26, 0, 15, 66, 65, 115, 102, 105, 101, 108, 100,\n87, 105, 116, 104, 111, 117, 116, 77, 101, 115, 115, 97, 103, 101, 119, 95, 95, 102, 105, 101, 108, 100, 87, 105,\n116, 104, 111, 117, 116, 77, 101, 115, 115, 97, 103, 101, 95, 95, 112, 102, 105, 101, 108, 100, 87, 105, 116, 104,\n77, 101, 115, 115, 97, 103, 101, 116, 95, 95, 102, 105, 101, 108, 100, 87, 105, 116, 104, 77, 101, 115, 115, 97,\n103, 101, 95, 95, 106, 115, 116, 97, 114, 116, 84, 111, 107, 101, 110, 110, 95, 95, 115, 116, 97, 114, 116, 84,\n111, 107, 101, 110, 95, 95, 106, 109, 97, 120, 82, 101, 115, 117, 108, 116, 115, 0, 113, 99, 117, 115, 116, 111,\n109, 72, 101, 97, 100, 101, 114, 73, 110, 112, 117, 116, 117, 95, 95, 99, 117, 115, 116, 111, 109, 72, 101, 97,\n100, 101, 114, 73, 110, 112, 117, 116, 95, 95, 103, 110, 117, 109, 98, 101, 114, 115, 163, 100, 107, 101, 121, 49,\n0, 100, 107, 101, 121, 50, 0, 100, 107, 101, 121, 51, 0, 109, 115, 112, 97, 114, 115, 101, 78, 117, 109, 98,\n101, 114, 115, 164, 100, 107, 101, 121, 49, 0, 100, 107, 101, 121, 50, 0, 100, 107, 101, 121, 51, 0, 102, 115,\n112, 97, 114, 115, 101, 246\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/req/HttpLabelCommand.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/XYZService/operation/HttpLabelCommand\n\nx-api-key: [object Object]\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 69\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\nX-Api-Key: MOCK_api_key\n\n[Uint8Array (cbor object view)]\n{\n  \"LabelDoesNotApplyToRpcProtocol\": \"__LabelDoesNotApplyToRpcProtocol__\"\n}\n\n[actual bytes]\n161, 120, 30, 76, 97, 98, 101, 108, 68, 111, 101, 115, 78, 111, 116, 65, 112, 112, 108, 121, 84, 111, 82, 112,\n99, 80, 114, 111, 116, 111, 99, 111, 108, 120, 34, 95, 95, 76, 97, 98, 101, 108, 68, 111, 101, 115, 78, 111,\n116, 65, 112, 112, 108, 121, 84, 111, 82, 112, 99, 80, 114, 111, 116, 111, 99, 111, 108, 95, 95\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/req/TradeEventStream.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/XYZService/operation/TradeEventStream\n\nx-api-key: [object Object]\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: undefined\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\nX-Api-Key: MOCK_api_key\n\n[async_iterable (Readable)]\n\n[chunk (event-stream object view)]\n  [total-size] 102 [header-size] 85 [prelude-crc] 1750202623\n:event-type: initial-request\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{}\n\n[actual bytes]\n160\n\n[message-crc] 802441068\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 122 [header-size] 75 [prelude-crc] 927907615\n:event-type: alpha\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{\n  \"id\": \"__id__\",\n  \"timestamp\": {\n    \"tag\": 1,\n    \"value\": 946702799.999\n  }\n}\n\n[actual bytes]\n162, 98, 105, 100, 102, 95, 95, 105, 100, 95, 95, 105, 116, 105, 109, 101, 115, 116, 97, 109, 112, 193, 251, 65,\n204, 54, 196, 231, 255, 223, 59\n\n[message-crc] 2274737008\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 91 [header-size] 74 [prelude-crc] 3169356093\n:event-type: beta\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{}\n\n[actual bytes]\n160\n\n[message-crc] 3285270063\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 92 [header-size] 75 [prelude-crc] 2043635131\n:event-type: gamma\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{}\n\n[actual bytes]\n160\n\n[message-crc] 2477278713\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 114 [header-size] 75 [prelude-crc] 121566430\n:event-type: delta\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{\n  \"name\": \"__name__\",\n  \"number\": 0\n}\n\n[actual bytes]\n162, 100, 110, 97, 109, 101, 104, 95, 95, 110, 97, 109, 101, 95, 95, 102, 110, 117, 109, 98, 101, 114, 0\n\n[message-crc] 3691208368\n============================================================\n\n[chunk (b64)]\nCg==\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res/CamelCaseOperation.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"token\": \"__token__\",\n  \"results\": [\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    }\n  ]\n}\n\n[actual bytes]\n162, 101, 116, 111, 107, 101, 110, 105, 95, 95, 116, 111, 107, 101, 110, 95, 95, 103, 114, 101, 115, 117, 108, 116,\n115, 131, 68, 1, 0, 0, 1, 68, 1, 0, 0, 1, 68, 1, 0, 0, 1\n\n\n--- [output object] ---\n{\n  token: \"__token__\",\n  results: [\n    (Uint8Array) bytes[1, 0, 0, 1],\n    (Uint8Array) bytes[1, 0, 0, 1],\n    (Uint8Array) bytes[1, 0, 0, 1]\n  ],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res/GetNumbers.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"bigDecimal\": {\n    \"string\": \"9876543210.0123456789\",\n    \"type\": \"bigDecimal\"\n  },\n  \"bigInteger\": 1000001,\n  \"numbers\": [\n    0,\n    0,\n    0\n  ],\n  \"sparseNumbers\": [\n    0,\n    0,\n    0,\n    null\n  ],\n  \"nextToken\": \"__nextToken__\",\n  \"deprecatedNumbers\": [\n    0,\n    0,\n    0\n  ],\n  \"deprecatedNumbersWithoutExplanation\": [\n    0,\n    0,\n    0\n  ],\n  \"deprecatedNumbersWithoutChronology\": [\n    0,\n    0,\n    0\n  ],\n  \"inexplicablyDeprecatedNumbers\": [\n    0,\n    0,\n    0\n  ]\n}\n\n[actual bytes]\n169, 106, 98, 105, 103, 68, 101, 99, 105, 109, 97, 108, 196, 130, 41, 194, 73, 5, 90, 165, 77, 54, 159, 210,\n53, 21, 106, 98, 105, 103, 73, 110, 116, 101, 103, 101, 114, 26, 0, 15, 66, 65, 103, 110, 117, 109, 98, 101,\n114, 115, 131, 0, 0, 0, 109, 115, 112, 97, 114, 115, 101, 78, 117, 109, 98, 101, 114, 115, 132, 0, 0, 0,\n246, 105, 110, 101, 120, 116, 84, 111, 107, 101, 110, 109, 95, 95, 110, 101, 120, 116, 84, 111, 107, 101, 110, 95,\n95, 113, 100, 101, 112, 114, 101, 99, 97, 116, 101, 100, 78, 117, 109, 98, 101, 114, 115, 131, 0, 0, 0, 120,\n35, 100, 101, 112, 114, 101, 99, 97, 116, 101, 100, 78, 117, 109, 98, 101, 114, 115, 87, 105, 116, 104, 111, 117,\n116, 69, 120, 112, 108, 97, 110, 97, 116, 105, 111, 110, 131, 0, 0, 0, 120, 34, 100, 101, 112, 114, 101, 99,\n97, 116, 101, 100, 78, 117, 109, 98, 101, 114, 115, 87, 105, 116, 104, 111, 117, 116, 67, 104, 114, 111, 110, 111,\n108, 111, 103, 121, 131, 0, 0, 0, 120, 29, 105, 110, 101, 120, 112, 108, 105, 99, 97, 98, 108, 121, 68, 101,\n112, 114, 101, 99, 97, 116, 101, 100, 78, 117, 109, 98, 101, 114, 115, 131, 0, 0, 0\n\n\n--- [output object] ---\n{\n  bigDecimal: {\n    string: \"9876543210.0123456789\",\n    type: \"bigDecimal\"\n  },\n  bigInteger: (number) 1000001,\n  numbers: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  sparseNumbers: [\n    (number) 0,\n    (number) 0,\n    (number) 0,\n    (null)\n  ],\n  nextToken: \"__nextToken__\",\n  deprecatedNumbers: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  deprecatedNumbersWithoutExplanation: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  deprecatedNumbersWithoutChronology: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  inexplicablyDeprecatedNumbers: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res/HttpLabelCommand.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res/TradeEventStream.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[async_iterable (Object)]\n\n\n\n\n--- [output object] ---\n{\n  eventStream: async_it[<empty>],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[async_iterable (Readable)]\n\n[chunk (event-stream object view)]\n  [total-size] 122 [header-size] 75 [prelude-crc] 927907615\n:event-type: alpha\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{\n  \"id\": \"__id__\",\n  \"timestamp\": {\n    \"tag\": 1,\n    \"value\": 946702799.999\n  }\n}\n\n[actual bytes]\n162, 98, 105, 100, 102, 95, 95, 105, 100, 95, 95, 105, 116, 105, 109, 101, 115, 116, 97, 109, 112, 193, 251, 65,\n204, 54, 196, 231, 255, 223, 59\n\n[message-crc] 2274737008\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 91 [header-size] 74 [prelude-crc] 3169356093\n:event-type: beta\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{}\n\n[actual bytes]\n160\n\n[message-crc] 3285270063\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 92 [header-size] 75 [prelude-crc] 2043635131\n:event-type: gamma\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{}\n\n[actual bytes]\n160\n\n[message-crc] 2477278713\n============================================================\n\n[chunk (event-stream object view)]\n  [total-size] 114 [header-size] 75 [prelude-crc] 121566430\n:event-type: delta\n:message-type: event\n:content-type: application/cbor\n\n[cbor object view]\n{\n  \"name\": \"__name__\",\n  \"number\": 0\n}\n\n[actual bytes]\n162, 100, 110, 97, 109, 101, 104, 95, 95, 110, 97, 109, 101, 95, 95, 102, 110, 117, 109, 98, 101, 114, 0\n\n[message-crc] 3691208368\n============================================================\n\n[chunk (b64)]\nCg==\n\n\n\n--- [output object] ---\n{\n  eventStream: async_it[\n    {\n      alpha: {\n        id: \"__id__\",\n        timestamp: (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time\n      }\n    },\n    {\n      beta: {}\n    },\n    {\n      gamma: {}\n    },\n    {\n      delta: {\n        name: \"__name__\",\n        number: (number) 0\n      }\n    }\n  ],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/CodedThrottlingError.txt",
    "content": "======================== minimal response ========================\n[status] 429\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#CodedThrottlingError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 31, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 67, 111, 100,\n101, 100, 84, 104, 114, 111, 116, 116, 108, 105, 110, 103, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nCodedThrottlingError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: {\n    throttling: (boolean) true\n  },\n  $metadata: {\n    httpStatusCode: (number) 429,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"CodedThrottlingError\",\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 429\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#CodedThrottlingError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 31, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 67, 111, 100,\n101, 100, 84, 104, 114, 111, 116, 116, 108, 105, 110, 103, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nCodedThrottlingError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: {\n    throttling: (boolean) true\n  },\n  $metadata: {\n    httpStatusCode: (number) 429,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"CodedThrottlingError\",\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/HaltError.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#HaltError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 116, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 72, 97, 108, 116,\n69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nHaltError: undefined\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"HaltError\",\n  message: (undefined)\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"message\": \"__message__\",\n  \"__type\": \"org.xyz.v1#HaltError\"\n}\n\n[actual bytes]\n162, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 116, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 72, 97, 108, 116, 69, 114, 114, 111,\n114\n\n\n--- [error name & message] ---\nHaltError: __message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"HaltError\",\n  message: \"__message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/MainServiceLinkedError.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#MainServiceLinkedError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 33, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 77, 97, 105,\n110, 83, 101, 114, 118, 105, 99, 101, 76, 105, 110, 107, 101, 100, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nMainServiceLinkedError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"MainServiceLinkedError\",\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#MainServiceLinkedError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 33, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 77, 97, 105,\n110, 83, 101, 114, 118, 105, 99, 101, 76, 105, 110, 107, 101, 100, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nMainServiceLinkedError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"MainServiceLinkedError\",\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/MysteryThrottlingError.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#MysteryThrottlingError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 33, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 77, 121, 115,\n116, 101, 114, 121, 84, 104, 114, 111, 116, 116, 108, 105, 110, 103, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nMysteryThrottlingError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: {\n    throttling: (boolean) true\n  },\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"MysteryThrottlingError\",\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#MysteryThrottlingError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 33, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 77, 121, 115,\n116, 101, 114, 121, 84, 104, 114, 111, 116, 116, 108, 105, 110, 103, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nMysteryThrottlingError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: {\n    throttling: (boolean) true\n  },\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"MysteryThrottlingError\",\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/RetryableError.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#RetryableError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 25, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 82, 101, 116,\n114, 121, 97, 98, 108, 101, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nRetryableError: undefined\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: {},\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"RetryableError\",\n  message: (undefined)\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"message\": \"__message__\",\n  \"__type\": \"org.xyz.v1#RetryableError\"\n}\n\n[actual bytes]\n162, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 120, 25, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 82, 101, 116, 114, 121, 97, 98,\n108, 101, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nRetryableError: __message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: {},\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"RetryableError\",\n  message: \"__message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/UnmodeledServiceException.txt",
    "content": "======================== minimal response ========================\n[status] 500\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.secondary#UnmodeledServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 43, 111, 114, 103, 46, 120, 121, 122, 46, 115, 101, 99, 111, 110, 100,\n97, 114, 121, 35, 85, 110, 109, 111, 100, 101, 108, 101, 100, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101,\n112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nUnmodeledServiceException: \n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"UnmodeledServiceException\",\n  __type: \"org.xyz.secondary#UnmodeledServiceException\"\n}\n\n======================== w/ optional fields ========================\n[status] 500\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"Message\": \"__Message__\",\n  \"__type\": \"org.xyz.secondary#UnmodeledServiceException\"\n}\n\n[actual bytes]\n162, 103, 77, 101, 115, 115, 97, 103, 101, 107, 95, 95, 77, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 120, 43, 111, 114, 103, 46, 120, 121, 122, 46, 115, 101, 99, 111, 110, 100, 97, 114, 121, 35,\n85, 110, 109, 111, 100, 101, 108, 101, 100, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111,\n110\n\n\n--- [error name & message] ---\nUnmodeledServiceException: __Message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"UnmodeledServiceException\",\n  Message: \"__Message__\",\n  __type: \"org.xyz.secondary#UnmodeledServiceException\",\n  message: \"__Message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots/res-err/XYZServiceServiceException.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#XYZServiceServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 37, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 88, 89, 90,\n83, 101, 114, 118, 105, 99, 101, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nXYZServiceServiceException: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"XYZServiceServiceException\",\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"org.xyz.v1#XYZServiceServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 37, 111, 114, 103, 46, 120, 121, 122, 46, 118, 49, 35, 88, 89, 90,\n83, 101, 114, 118, 105, 99, 101, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nXYZServiceServiceException: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"XYZServiceServiceException\",\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/my-local-model-schema/test/snapshots.integ.spec.ts",
    "content": "// smithy-typescript generated code\nimport { SnapshotRunner } from \"@smithy/snapshot-testing\";\nimport { join } from \"node:path\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  camelCaseOperation$,\n  CamelCaseOperationCommand,\n  CodedThrottlingError$,\n  GetNumbers$,\n  GetNumbersCommand,\n  HaltError$,\n  HttpLabelCommand$,\n  HttpLabelCommandCommand,\n  MainServiceLinkedError$,\n  MysteryThrottlingError$,\n  RetryableError$,\n  TradeEventStream$,\n  TradeEventStreamCommand,\n  XYZServiceClient,\n  XYZServiceServiceException$,\n} from \"../src\";\n\nvi.setSystemTime(new Date(946702799999));\nconst Client = XYZServiceClient;\n\nconst mode = (process.env.SNAPSHOT_MODE as \"write\" | \"compare\") ?? \"write\";\n\ndescribe(\"XYZServiceClient\" + ` (${mode})`, () => {\n  const runner = new SnapshotRunner({\n    snapshotDirPath: join(__dirname, \"snapshots\"),\n    Client,\n    mode,\n    testCase(caseName: string, run: () => Promise<void>) {\n      it(caseName, run);\n    },\n    assertions(caseName: string, expected: string, actual: string): Promise<void> {\n      expect(actual).toEqual(expected);\n      return Promise.resolve();\n    },\n    schemas: new Map<any, any>([\n      [HttpLabelCommand$, HttpLabelCommandCommand],\n      [camelCaseOperation$, CamelCaseOperationCommand],\n      [GetNumbers$, GetNumbersCommand],\n      [TradeEventStream$, TradeEventStreamCommand],\n    ]),\n    errors: [\n      CodedThrottlingError$,\n      HaltError$,\n      MainServiceLinkedError$,\n      MysteryThrottlingError$,\n      RetryableError$,\n      XYZServiceServiceException$,\n    ],\n  });\n  runner.run();\n}, 30_000);\n"
  },
  {
    "path": "private/my-local-model-schema/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist-cjs\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"lib\": [\"dom\"],\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"outDir\": \"dist-es\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/tsconfig.json",
    "content": "{\n  \"extends\": \"@tsconfig/node20/tsconfig.json\",\n  \"compilerOptions\": {\n    \"downlevelIteration\": true,\n    \"importHelpers\": true,\n    \"incremental\": true,\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"rootDir\": \"src\",\n    \"useUnknownInCatchVariables\": false\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "private/my-local-model-schema/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist-types\",\n    \"emitDeclarationOnly\": true,\n    \"noCheck\": false\n  }\n}\n"
  },
  {
    "path": "private/my-local-model-schema/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "private/my-local-model-schema/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    globals: true,\n  },\n});\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/package.json",
    "content": "{\n  \"name\": \"@smithy/smithy-rpcv2-cbor\",\n  \"description\": \"@smithy/smithy-rpcv2-cbor client\",\n  \"version\": \"1.0.0-alpha.1\",\n  \"scripts\": {\n    \"build\": \"concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"downlevel-dts dist-types dist-types/ts3.4\",\n    \"test:index\": \"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"prepack\": \"npm run clean && npm run build\",\n    \"merged\": \"echo \\\"this is merged from user configuration.\\\"\",\n    \"test\": \"npx vitest run --passWithNoTests\",\n    \"test:watch\": \"npx vitest watch --passWithNoTests\",\n    \"test:integration\": \"npx vitest run --passWithNoTests -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"npx vitest watch --passWithNoTests -c vitest.config.integ.mts\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"module\": \"./dist-es/index.js\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@aws-crypto/sha256-browser\": \"5.2.0\",\n    \"@aws-crypto/sha256-js\": \"5.2.0\",\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/fetch-http-handler\": \"workspace:^\",\n    \"@smithy/node-http-handler\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@tsconfig/node20\": \"20.1.8\",\n    \"@types/node\": \"^20.14.8\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\",\n    \"vitest\": \"^4.0.17\"\n  },\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"author\": {\n    \"name\": \"Smithy team\",\n    \"url\": \"https://smithy.io/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"browser\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.browser\"\n  },\n  \"react-native\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.native\"\n  },\n  \"private\": true\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/RpcV2Protocol.ts",
    "content": "// smithy-typescript generated code\nimport { createAggregatedClient } from \"@smithy/core/client\";\nimport type { HttpHandlerOptions as __HttpHandlerOptions } from \"@smithy/types\";\n\nimport {\n  type EmptyInputOutputCommandInput,\n  type EmptyInputOutputCommandOutput,\n  EmptyInputOutputCommand,\n} from \"./commands/EmptyInputOutputCommand\";\nimport { type Float16CommandInput, type Float16CommandOutput, Float16Command } from \"./commands/Float16Command\";\nimport {\n  type FractionalSecondsCommandInput,\n  type FractionalSecondsCommandOutput,\n  FractionalSecondsCommand,\n} from \"./commands/FractionalSecondsCommand\";\nimport {\n  type GreetingWithErrorsCommandInput,\n  type GreetingWithErrorsCommandOutput,\n  GreetingWithErrorsCommand,\n} from \"./commands/GreetingWithErrorsCommand\";\nimport {\n  type NoInputOutputCommandInput,\n  type NoInputOutputCommandOutput,\n  NoInputOutputCommand,\n} from \"./commands/NoInputOutputCommand\";\nimport {\n  type OperationWithDefaultsCommandInput,\n  type OperationWithDefaultsCommandOutput,\n  OperationWithDefaultsCommand,\n} from \"./commands/OperationWithDefaultsCommand\";\nimport {\n  type OptionalInputOutputCommandInput,\n  type OptionalInputOutputCommandOutput,\n  OptionalInputOutputCommand,\n} from \"./commands/OptionalInputOutputCommand\";\nimport {\n  type RecursiveShapesCommandInput,\n  type RecursiveShapesCommandOutput,\n  RecursiveShapesCommand,\n} from \"./commands/RecursiveShapesCommand\";\nimport {\n  type RpcV2CborDenseMapsCommandInput,\n  type RpcV2CborDenseMapsCommandOutput,\n  RpcV2CborDenseMapsCommand,\n} from \"./commands/RpcV2CborDenseMapsCommand\";\nimport {\n  type RpcV2CborListsCommandInput,\n  type RpcV2CborListsCommandOutput,\n  RpcV2CborListsCommand,\n} from \"./commands/RpcV2CborListsCommand\";\nimport {\n  type RpcV2CborSparseMapsCommandInput,\n  type RpcV2CborSparseMapsCommandOutput,\n  RpcV2CborSparseMapsCommand,\n} from \"./commands/RpcV2CborSparseMapsCommand\";\nimport {\n  type SimpleScalarPropertiesCommandInput,\n  type SimpleScalarPropertiesCommandOutput,\n  SimpleScalarPropertiesCommand,\n} from \"./commands/SimpleScalarPropertiesCommand\";\nimport {\n  type SparseNullsOperationCommandInput,\n  type SparseNullsOperationCommandOutput,\n  SparseNullsOperationCommand,\n} from \"./commands/SparseNullsOperationCommand\";\nimport { RpcV2ProtocolClient } from \"./RpcV2ProtocolClient\";\n\nconst commands = {\n  EmptyInputOutputCommand,\n  Float16Command,\n  FractionalSecondsCommand,\n  GreetingWithErrorsCommand,\n  NoInputOutputCommand,\n  OperationWithDefaultsCommand,\n  OptionalInputOutputCommand,\n  RecursiveShapesCommand,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborListsCommand,\n  RpcV2CborSparseMapsCommand,\n  SimpleScalarPropertiesCommand,\n  SparseNullsOperationCommand,\n};\n\nexport interface RpcV2Protocol {\n  /**\n   * @see {@link EmptyInputOutputCommand}\n   */\n  emptyInputOutput(): Promise<EmptyInputOutputCommandOutput>;\n  emptyInputOutput(\n    args: EmptyInputOutputCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<EmptyInputOutputCommandOutput>;\n  emptyInputOutput(\n    args: EmptyInputOutputCommandInput,\n    cb: (err: any, data?: EmptyInputOutputCommandOutput) => void\n  ): void;\n  emptyInputOutput(\n    args: EmptyInputOutputCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: EmptyInputOutputCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link Float16Command}\n   */\n  float16(): Promise<Float16CommandOutput>;\n  float16(\n    args: Float16CommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<Float16CommandOutput>;\n  float16(\n    args: Float16CommandInput,\n    cb: (err: any, data?: Float16CommandOutput) => void\n  ): void;\n  float16(\n    args: Float16CommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: Float16CommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link FractionalSecondsCommand}\n   */\n  fractionalSeconds(): Promise<FractionalSecondsCommandOutput>;\n  fractionalSeconds(\n    args: FractionalSecondsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<FractionalSecondsCommandOutput>;\n  fractionalSeconds(\n    args: FractionalSecondsCommandInput,\n    cb: (err: any, data?: FractionalSecondsCommandOutput) => void\n  ): void;\n  fractionalSeconds(\n    args: FractionalSecondsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: FractionalSecondsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link GreetingWithErrorsCommand}\n   */\n  greetingWithErrors(): Promise<GreetingWithErrorsCommandOutput>;\n  greetingWithErrors(\n    args: GreetingWithErrorsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<GreetingWithErrorsCommandOutput>;\n  greetingWithErrors(\n    args: GreetingWithErrorsCommandInput,\n    cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void\n  ): void;\n  greetingWithErrors(\n    args: GreetingWithErrorsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link NoInputOutputCommand}\n   */\n  noInputOutput(): Promise<NoInputOutputCommandOutput>;\n  noInputOutput(\n    args: NoInputOutputCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<NoInputOutputCommandOutput>;\n  noInputOutput(\n    args: NoInputOutputCommandInput,\n    cb: (err: any, data?: NoInputOutputCommandOutput) => void\n  ): void;\n  noInputOutput(\n    args: NoInputOutputCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: NoInputOutputCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link OperationWithDefaultsCommand}\n   */\n  operationWithDefaults(): Promise<OperationWithDefaultsCommandOutput>;\n  operationWithDefaults(\n    args: OperationWithDefaultsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<OperationWithDefaultsCommandOutput>;\n  operationWithDefaults(\n    args: OperationWithDefaultsCommandInput,\n    cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void\n  ): void;\n  operationWithDefaults(\n    args: OperationWithDefaultsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link OptionalInputOutputCommand}\n   */\n  optionalInputOutput(): Promise<OptionalInputOutputCommandOutput>;\n  optionalInputOutput(\n    args: OptionalInputOutputCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<OptionalInputOutputCommandOutput>;\n  optionalInputOutput(\n    args: OptionalInputOutputCommandInput,\n    cb: (err: any, data?: OptionalInputOutputCommandOutput) => void\n  ): void;\n  optionalInputOutput(\n    args: OptionalInputOutputCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: OptionalInputOutputCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RecursiveShapesCommand}\n   */\n  recursiveShapes(): Promise<RecursiveShapesCommandOutput>;\n  recursiveShapes(\n    args: RecursiveShapesCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RecursiveShapesCommandOutput>;\n  recursiveShapes(\n    args: RecursiveShapesCommandInput,\n    cb: (err: any, data?: RecursiveShapesCommandOutput) => void\n  ): void;\n  recursiveShapes(\n    args: RecursiveShapesCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RecursiveShapesCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RpcV2CborDenseMapsCommand}\n   */\n  rpcV2CborDenseMaps(): Promise<RpcV2CborDenseMapsCommandOutput>;\n  rpcV2CborDenseMaps(\n    args: RpcV2CborDenseMapsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RpcV2CborDenseMapsCommandOutput>;\n  rpcV2CborDenseMaps(\n    args: RpcV2CborDenseMapsCommandInput,\n    cb: (err: any, data?: RpcV2CborDenseMapsCommandOutput) => void\n  ): void;\n  rpcV2CborDenseMaps(\n    args: RpcV2CborDenseMapsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RpcV2CborDenseMapsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RpcV2CborListsCommand}\n   */\n  rpcV2CborLists(): Promise<RpcV2CborListsCommandOutput>;\n  rpcV2CborLists(\n    args: RpcV2CborListsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RpcV2CborListsCommandOutput>;\n  rpcV2CborLists(\n    args: RpcV2CborListsCommandInput,\n    cb: (err: any, data?: RpcV2CborListsCommandOutput) => void\n  ): void;\n  rpcV2CborLists(\n    args: RpcV2CborListsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RpcV2CborListsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RpcV2CborSparseMapsCommand}\n   */\n  rpcV2CborSparseMaps(): Promise<RpcV2CborSparseMapsCommandOutput>;\n  rpcV2CborSparseMaps(\n    args: RpcV2CborSparseMapsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RpcV2CborSparseMapsCommandOutput>;\n  rpcV2CborSparseMaps(\n    args: RpcV2CborSparseMapsCommandInput,\n    cb: (err: any, data?: RpcV2CborSparseMapsCommandOutput) => void\n  ): void;\n  rpcV2CborSparseMaps(\n    args: RpcV2CborSparseMapsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RpcV2CborSparseMapsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link SimpleScalarPropertiesCommand}\n   */\n  simpleScalarProperties(): Promise<SimpleScalarPropertiesCommandOutput>;\n  simpleScalarProperties(\n    args: SimpleScalarPropertiesCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<SimpleScalarPropertiesCommandOutput>;\n  simpleScalarProperties(\n    args: SimpleScalarPropertiesCommandInput,\n    cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void\n  ): void;\n  simpleScalarProperties(\n    args: SimpleScalarPropertiesCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link SparseNullsOperationCommand}\n   */\n  sparseNullsOperation(): Promise<SparseNullsOperationCommandOutput>;\n  sparseNullsOperation(\n    args: SparseNullsOperationCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<SparseNullsOperationCommandOutput>;\n  sparseNullsOperation(\n    args: SparseNullsOperationCommandInput,\n    cb: (err: any, data?: SparseNullsOperationCommandOutput) => void\n  ): void;\n  sparseNullsOperation(\n    args: SparseNullsOperationCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: SparseNullsOperationCommandOutput) => void\n  ): void;\n}\n\n/**\n * @public\n */\nexport class RpcV2Protocol extends RpcV2ProtocolClient implements RpcV2Protocol {}\ncreateAggregatedClient(commands, RpcV2Protocol);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/RpcV2ProtocolClient.ts",
    "content": "// smithy-typescript generated code\nimport {\n  DefaultIdentityProviderConfig,\n  getHttpAuthSchemeEndpointRuleSetPlugin,\n  getHttpSigningPlugin,\n} from \"@smithy/core\";\nimport {\n  type DefaultsMode as __DefaultsMode,\n  type SmithyConfiguration as __SmithyConfiguration,\n  type SmithyResolvedConfiguration as __SmithyResolvedConfiguration,\n  Client as __Client,\n} from \"@smithy/core/client\";\nimport {\n  type EndpointInputConfig,\n  type EndpointRequiredInputConfig,\n  type EndpointRequiredResolvedConfig,\n  type EndpointResolvedConfig,\n  resolveEndpointConfig,\n  resolveEndpointRequiredConfig,\n} from \"@smithy/core/endpoints\";\nimport { type HttpHandlerUserInput as __HttpHandlerUserInput, getContentLengthPlugin } from \"@smithy/core/protocols\";\nimport {\n  type RetryInputConfig,\n  type RetryResolvedConfig,\n  getRetryPlugin,\n  resolveRetryConfig,\n} from \"@smithy/core/retry\";\nimport type {\n  BodyLengthCalculator as __BodyLengthCalculator,\n  CheckOptionalClientConfig as __CheckOptionalClientConfig,\n  ChecksumConstructor as __ChecksumConstructor,\n  Decoder as __Decoder,\n  Encoder as __Encoder,\n  HashConstructor as __HashConstructor,\n  HttpHandlerOptions as __HttpHandlerOptions,\n  Logger as __Logger,\n  Provider as __Provider,\n  StreamCollector as __StreamCollector,\n  UrlParser as __UrlParser,\n} from \"@smithy/types\";\n\nimport {\n  type HttpAuthSchemeInputConfig,\n  type HttpAuthSchemeResolvedConfig,\n  defaultRpcV2ProtocolHttpAuthSchemeParametersProvider,\n  resolveHttpAuthSchemeConfig,\n} from \"./auth/httpAuthSchemeProvider\";\nimport type { EmptyInputOutputCommandInput, EmptyInputOutputCommandOutput } from \"./commands/EmptyInputOutputCommand\";\nimport type { Float16CommandInput, Float16CommandOutput } from \"./commands/Float16Command\";\nimport type {\n  FractionalSecondsCommandInput,\n  FractionalSecondsCommandOutput,\n} from \"./commands/FractionalSecondsCommand\";\nimport type {\n  GreetingWithErrorsCommandInput,\n  GreetingWithErrorsCommandOutput,\n} from \"./commands/GreetingWithErrorsCommand\";\nimport type { NoInputOutputCommandInput, NoInputOutputCommandOutput } from \"./commands/NoInputOutputCommand\";\nimport type {\n  OperationWithDefaultsCommandInput,\n  OperationWithDefaultsCommandOutput,\n} from \"./commands/OperationWithDefaultsCommand\";\nimport type {\n  OptionalInputOutputCommandInput,\n  OptionalInputOutputCommandOutput,\n} from \"./commands/OptionalInputOutputCommand\";\nimport type { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from \"./commands/RecursiveShapesCommand\";\nimport type {\n  RpcV2CborDenseMapsCommandInput,\n  RpcV2CborDenseMapsCommandOutput,\n} from \"./commands/RpcV2CborDenseMapsCommand\";\nimport type { RpcV2CborListsCommandInput, RpcV2CborListsCommandOutput } from \"./commands/RpcV2CborListsCommand\";\nimport type {\n  RpcV2CborSparseMapsCommandInput,\n  RpcV2CborSparseMapsCommandOutput,\n} from \"./commands/RpcV2CborSparseMapsCommand\";\nimport type {\n  SimpleScalarPropertiesCommandInput,\n  SimpleScalarPropertiesCommandOutput,\n} from \"./commands/SimpleScalarPropertiesCommand\";\nimport type {\n  SparseNullsOperationCommandInput,\n  SparseNullsOperationCommandOutput,\n} from \"./commands/SparseNullsOperationCommand\";\nimport {\n  type ClientInputEndpointParameters,\n  type ClientResolvedEndpointParameters,\n  type EndpointParameters,\n  resolveClientEndpointParameters,\n} from \"./endpoint/EndpointParameters\";\nimport { getRuntimeConfig as __getRuntimeConfig } from \"./runtimeConfig\";\nimport { type RuntimeExtension, type RuntimeExtensionsConfig, resolveRuntimeExtensions } from \"./runtimeExtensions\";\n\nexport { __Client };\n\n/**\n * @public\n */\nexport type ServiceInputTypes =\n  | EmptyInputOutputCommandInput\n  | Float16CommandInput\n  | FractionalSecondsCommandInput\n  | GreetingWithErrorsCommandInput\n  | NoInputOutputCommandInput\n  | OperationWithDefaultsCommandInput\n  | OptionalInputOutputCommandInput\n  | RecursiveShapesCommandInput\n  | RpcV2CborDenseMapsCommandInput\n  | RpcV2CborListsCommandInput\n  | RpcV2CborSparseMapsCommandInput\n  | SimpleScalarPropertiesCommandInput\n  | SparseNullsOperationCommandInput;\n\n/**\n * @public\n */\nexport type ServiceOutputTypes =\n  | EmptyInputOutputCommandOutput\n  | Float16CommandOutput\n  | FractionalSecondsCommandOutput\n  | GreetingWithErrorsCommandOutput\n  | NoInputOutputCommandOutput\n  | OperationWithDefaultsCommandOutput\n  | OptionalInputOutputCommandOutput\n  | RecursiveShapesCommandOutput\n  | RpcV2CborDenseMapsCommandOutput\n  | RpcV2CborListsCommandOutput\n  | RpcV2CborSparseMapsCommandOutput\n  | SimpleScalarPropertiesCommandOutput\n  | SparseNullsOperationCommandOutput;\n\n/**\n * @public\n */\nexport interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {\n  /**\n   * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.\n   */\n  requestHandler?: __HttpHandlerUserInput;\n\n  /**\n   * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface\n   * that computes the SHA-256 HMAC or checksum of a string or binary buffer.\n   * @internal\n   */\n  sha256?: __ChecksumConstructor | __HashConstructor;\n\n  /**\n   * The function that will be used to convert strings into HTTP endpoints.\n   * @internal\n   */\n  urlParser?: __UrlParser;\n\n  /**\n   * A function that can calculate the length of a request body.\n   * @internal\n   */\n  bodyLengthChecker?: __BodyLengthCalculator;\n\n  /**\n   * A function that converts a stream into an array of bytes.\n   * @internal\n   */\n  streamCollector?: __StreamCollector;\n\n  /**\n   * The function that will be used to convert a base64-encoded string to a byte array.\n   * @internal\n   */\n  base64Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a base64-encoded string.\n   * @internal\n   */\n  base64Encoder?: __Encoder;\n\n  /**\n   * The function that will be used to convert a UTF8-encoded string to a byte array.\n   * @internal\n   */\n  utf8Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a UTF-8 encoded string.\n   * @internal\n   */\n  utf8Encoder?: __Encoder;\n\n  /**\n   * The runtime environment.\n   * @internal\n   */\n  runtime?: string;\n\n  /**\n   * Disable dynamically changing the endpoint of the client based on the hostPrefix\n   * trait of an operation.\n   */\n  disableHostPrefix?: boolean;\n\n  /**\n   * Value for how many times a request will be made at most in case of retry.\n   */\n  maxAttempts?: number | __Provider<number>;\n\n  /**\n   * Specifies which retry algorithm to use.\n   * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/\n   *\n   */\n  retryMode?: string | __Provider<string>;\n\n  /**\n   * Optional logger for logging debug/info/warn/error.\n   */\n  logger?: __Logger;\n\n  /**\n   * Optional extensions\n   */\n  extensions?: RuntimeExtension[];\n\n  /**\n   * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.\n   */\n  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;\n}\n\n/**\n * @public\n */\nexport type RpcV2ProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &\n  ClientDefaults &\n  RetryInputConfig &\n  EndpointInputConfig<EndpointParameters> &\n  EndpointRequiredInputConfig &\n  HttpAuthSchemeInputConfig &\n  ClientInputEndpointParameters;\n/**\n * @public\n *\n *  The configuration interface of RpcV2ProtocolClient class constructor that set the region, credentials and other options.\n */\nexport interface RpcV2ProtocolClientConfig extends RpcV2ProtocolClientConfigType {}\n\n/**\n * @public\n */\nexport type RpcV2ProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &\n  Required<ClientDefaults> &\n  RuntimeExtensionsConfig &\n  RetryResolvedConfig &\n  EndpointResolvedConfig<EndpointParameters> &\n  EndpointRequiredResolvedConfig &\n  HttpAuthSchemeResolvedConfig &\n  ClientResolvedEndpointParameters;\n/**\n * @public\n *\n *  The resolved configuration interface of RpcV2ProtocolClient class. This is resolved and normalized from the {@link RpcV2ProtocolClientConfig | constructor configuration interface}.\n */\nexport interface RpcV2ProtocolClientResolvedConfig extends RpcV2ProtocolClientResolvedConfigType {}\n\n/**\n * @public\n */\nexport class RpcV2ProtocolClient extends __Client<\n  __HttpHandlerOptions,\n  ServiceInputTypes,\n  ServiceOutputTypes,\n  RpcV2ProtocolClientResolvedConfig\n> {\n  /**\n   * The resolved configuration of RpcV2ProtocolClient class. This is resolved and normalized from the {@link RpcV2ProtocolClientConfig | constructor configuration interface}.\n   */\n  readonly config: RpcV2ProtocolClientResolvedConfig;\n\n  constructor(...[configuration]: __CheckOptionalClientConfig<RpcV2ProtocolClientConfig>) {\n    const _config_0 = __getRuntimeConfig(configuration || {});\n    super(_config_0 as any);\n    this.initConfig = _config_0;\n    const _config_1 = resolveClientEndpointParameters(_config_0);\n    const _config_2 = resolveRetryConfig(_config_1);\n    const _config_3 = resolveEndpointConfig(_config_2);\n    const _config_4 = resolveEndpointRequiredConfig(_config_3);\n    const _config_5 = resolveHttpAuthSchemeConfig(_config_4);\n    const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []);\n    this.config = _config_6;\n    this.middlewareStack.use(getRetryPlugin(this.config));\n    this.middlewareStack.use(getContentLengthPlugin(this.config));\n    this.middlewareStack.use(\n      getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n        httpAuthSchemeParametersProvider: defaultRpcV2ProtocolHttpAuthSchemeParametersProvider,\n        identityProviderConfigProvider: async (config: RpcV2ProtocolClientResolvedConfig) =>\n          new DefaultIdentityProviderConfig({}),\n      })\n    );\n    this.middlewareStack.use(getHttpSigningPlugin(this.config));\n  }\n\n  /**\n   * Destroy underlying resources, like sockets. It's usually not necessary to do this.\n   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.\n   * Otherwise, sockets might stay open for quite a long time before the server terminates them.\n   */\n  destroy(): void {\n    super.destroy();\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/auth/httpAuthExtensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { HttpAuthScheme } from \"@smithy/types\";\n\nimport type { RpcV2ProtocolHttpAuthSchemeProvider } from \"./httpAuthSchemeProvider\";\n\n/**\n * @internal\n */\nexport interface HttpAuthExtensionConfiguration {\n  setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;\n  httpAuthSchemes(): HttpAuthScheme[];\n  setHttpAuthSchemeProvider(httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider): void;\n  httpAuthSchemeProvider(): RpcV2ProtocolHttpAuthSchemeProvider;\n}\n\n/**\n * @internal\n */\nexport type HttpAuthRuntimeConfig = Partial<{\n  httpAuthSchemes: HttpAuthScheme[];\n  httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider;\n}>;\n\n/**\n * @internal\n */\nexport const getHttpAuthExtensionConfiguration = (\n  runtimeConfig: HttpAuthRuntimeConfig\n): HttpAuthExtensionConfiguration => {\n  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;\n  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;\n  return {\n    setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {\n      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n      if (index === -1) {\n        _httpAuthSchemes.push(httpAuthScheme);\n      } else {\n        _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n      }\n    },\n    httpAuthSchemes(): HttpAuthScheme[] {\n      return _httpAuthSchemes;\n    },\n    setHttpAuthSchemeProvider(httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider): void {\n      _httpAuthSchemeProvider = httpAuthSchemeProvider;\n    },\n    httpAuthSchemeProvider(): RpcV2ProtocolHttpAuthSchemeProvider {\n      return _httpAuthSchemeProvider;\n    },\n  };\n};\n\n/**\n * @internal\n */\nexport const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => {\n  return {\n    httpAuthSchemes: config.httpAuthSchemes(),\n    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/auth/httpAuthSchemeProvider.ts",
    "content": "// smithy-typescript generated code\nimport { getSmithyContext, normalizeProvider } from \"@smithy/core/client\";\nimport type {\n  HandlerExecutionContext,\n  HttpAuthOption,\n  HttpAuthScheme,\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  HttpAuthSchemeProvider,\n  Provider,\n} from \"@smithy/types\";\n\nimport type { RpcV2ProtocolClientResolvedConfig } from \"../RpcV2ProtocolClient\";\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters {}\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolHttpAuthSchemeParametersProvider\n  extends HttpAuthSchemeParametersProvider<\n    RpcV2ProtocolClientResolvedConfig,\n    HandlerExecutionContext,\n    RpcV2ProtocolHttpAuthSchemeParameters,\n    object\n  > {}\n\n/**\n * @internal\n */\nexport const defaultRpcV2ProtocolHttpAuthSchemeParametersProvider = async (\n  config: RpcV2ProtocolClientResolvedConfig,\n  context: HandlerExecutionContext,\n  input: object\n): Promise<RpcV2ProtocolHttpAuthSchemeParameters> => {\n  return {\n    operation: getSmithyContext(context).operation as string,\n  };\n};\n\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters: RpcV2ProtocolHttpAuthSchemeParameters): HttpAuthOption {\n  return {\n    schemeId: \"smithy.api#noAuth\",\n  };\n}\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolHttpAuthSchemeProvider\n  extends HttpAuthSchemeProvider<RpcV2ProtocolHttpAuthSchemeParameters> {}\n\n/**\n * @internal\n */\nexport const defaultRpcV2ProtocolHttpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider = (authParameters) => {\n  const options: HttpAuthOption[] = [];\n  switch (authParameters.operation) {\n    default: {\n      options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n    }\n  }\n  return options;\n};\n\n/**\n * @public\n */\nexport interface HttpAuthSchemeInputConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  authSchemePreference?: string[] | Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  httpAuthSchemes?: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  httpAuthSchemeProvider?: RpcV2ProtocolHttpAuthSchemeProvider;\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeResolvedConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  readonly authSchemePreference: Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  readonly httpAuthSchemes: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  readonly httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider;\n}\n\n/**\n * @internal\n */\nexport const resolveHttpAuthSchemeConfig = <T>(\n  config: T & HttpAuthSchemeInputConfig\n): T & HttpAuthSchemeResolvedConfig => {\n  return Object.assign(config, {\n    authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),\n  }) as T & HttpAuthSchemeResolvedConfig;\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/EmptyInputOutputCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { EmptyStructure } from \"../models/models_0\";\nimport { de_EmptyInputOutputCommand, se_EmptyInputOutputCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link EmptyInputOutputCommand}.\n */\nexport interface EmptyInputOutputCommandInput extends EmptyStructure {}\n/**\n * @public\n *\n * The output of {@link EmptyInputOutputCommand}.\n */\nexport interface EmptyInputOutputCommandOutput extends EmptyStructure, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, EmptyInputOutputCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, EmptyInputOutputCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new EmptyInputOutputCommand(input);\n * const response = await client.send(command);\n * // {};\n *\n * ```\n *\n * @param EmptyInputOutputCommandInput - {@link EmptyInputOutputCommandInput}\n * @returns {@link EmptyInputOutputCommandOutput}\n * @see {@link EmptyInputOutputCommandInput} for command's `input` shape.\n * @see {@link EmptyInputOutputCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class EmptyInputOutputCommand extends $Command\n  .classBuilder<\n    EmptyInputOutputCommandInput,\n    EmptyInputOutputCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"EmptyInputOutput\", {})\n  .n(\"RpcV2ProtocolClient\", \"EmptyInputOutputCommand\")\n  .f(void 0, void 0)\n  .ser(se_EmptyInputOutputCommand)\n  .de(de_EmptyInputOutputCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: {};\n    };\n    sdk: {\n      input: EmptyInputOutputCommandInput;\n      output: EmptyInputOutputCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/Float16Command.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { Float16Output } from \"../models/models_0\";\nimport { de_Float16Command, se_Float16Command } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link Float16Command}.\n */\nexport interface Float16CommandInput {}\n/**\n * @public\n *\n * The output of {@link Float16Command}.\n */\nexport interface Float16CommandOutput extends Float16Output, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, Float16Command } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, Float16Command } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new Float16Command(input);\n * const response = await client.send(command);\n * // { // Float16Output\n * //   value: Number(\"double\"),\n * // };\n *\n * ```\n *\n * @param Float16CommandInput - {@link Float16CommandInput}\n * @returns {@link Float16CommandOutput}\n * @see {@link Float16CommandInput} for command's `input` shape.\n * @see {@link Float16CommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class Float16Command extends $Command\n  .classBuilder<\n    Float16CommandInput,\n    Float16CommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"Float16\", {})\n  .n(\"RpcV2ProtocolClient\", \"Float16Command\")\n  .f(void 0, void 0)\n  .ser(se_Float16Command)\n  .de(de_Float16Command)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: Float16Output;\n    };\n    sdk: {\n      input: Float16CommandInput;\n      output: Float16CommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/FractionalSecondsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { FractionalSecondsOutput } from \"../models/models_0\";\nimport { de_FractionalSecondsCommand, se_FractionalSecondsCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link FractionalSecondsCommand}.\n */\nexport interface FractionalSecondsCommandInput {}\n/**\n * @public\n *\n * The output of {@link FractionalSecondsCommand}.\n */\nexport interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, FractionalSecondsCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, FractionalSecondsCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new FractionalSecondsCommand(input);\n * const response = await client.send(command);\n * // { // FractionalSecondsOutput\n * //   datetime: new Date(\"TIMESTAMP\"),\n * // };\n *\n * ```\n *\n * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput}\n * @returns {@link FractionalSecondsCommandOutput}\n * @see {@link FractionalSecondsCommandInput} for command's `input` shape.\n * @see {@link FractionalSecondsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class FractionalSecondsCommand extends $Command\n  .classBuilder<\n    FractionalSecondsCommandInput,\n    FractionalSecondsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"FractionalSeconds\", {})\n  .n(\"RpcV2ProtocolClient\", \"FractionalSecondsCommand\")\n  .f(void 0, void 0)\n  .ser(se_FractionalSecondsCommand)\n  .de(de_FractionalSecondsCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: FractionalSecondsOutput;\n    };\n    sdk: {\n      input: FractionalSecondsCommandInput;\n      output: FractionalSecondsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/GreetingWithErrorsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { GreetingWithErrorsOutput } from \"../models/models_0\";\nimport { de_GreetingWithErrorsCommand, se_GreetingWithErrorsCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link GreetingWithErrorsCommand}.\n */\nexport interface GreetingWithErrorsCommandInput {}\n/**\n * @public\n *\n * The output of {@link GreetingWithErrorsCommand}.\n */\nexport interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {}\n\n/**\n * This operation has three possible return values:\n *\n * 1. A successful response in the form of GreetingWithErrorsOutput\n * 2. An InvalidGreeting error.\n * 3. A ComplexError error.\n *\n * Implementations must be able to successfully take a response and\n * properly deserialize successful and error responses.\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, GreetingWithErrorsCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, GreetingWithErrorsCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new GreetingWithErrorsCommand(input);\n * const response = await client.send(command);\n * // { // GreetingWithErrorsOutput\n * //   greeting: \"STRING_VALUE\",\n * // };\n *\n * ```\n *\n * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput}\n * @returns {@link GreetingWithErrorsCommandOutput}\n * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape.\n * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link InvalidGreeting} (client fault)\n *  This error is thrown when an invalid greeting value is provided.\n *\n * @throws {@link ComplexError} (client fault)\n *  This error is thrown when a request is invalid.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n * @public\n */\nexport class GreetingWithErrorsCommand extends $Command\n  .classBuilder<\n    GreetingWithErrorsCommandInput,\n    GreetingWithErrorsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"GreetingWithErrors\", {})\n  .n(\"RpcV2ProtocolClient\", \"GreetingWithErrorsCommand\")\n  .f(void 0, void 0)\n  .ser(se_GreetingWithErrorsCommand)\n  .de(de_GreetingWithErrorsCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: GreetingWithErrorsOutput;\n    };\n    sdk: {\n      input: GreetingWithErrorsCommandInput;\n      output: GreetingWithErrorsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/NoInputOutputCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport { de_NoInputOutputCommand, se_NoInputOutputCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link NoInputOutputCommand}.\n */\nexport interface NoInputOutputCommandInput {}\n/**\n * @public\n *\n * The output of {@link NoInputOutputCommand}.\n */\nexport interface NoInputOutputCommandOutput extends __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, NoInputOutputCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, NoInputOutputCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new NoInputOutputCommand(input);\n * const response = await client.send(command);\n * // {};\n *\n * ```\n *\n * @param NoInputOutputCommandInput - {@link NoInputOutputCommandInput}\n * @returns {@link NoInputOutputCommandOutput}\n * @see {@link NoInputOutputCommandInput} for command's `input` shape.\n * @see {@link NoInputOutputCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class NoInputOutputCommand extends $Command\n  .classBuilder<\n    NoInputOutputCommandInput,\n    NoInputOutputCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"NoInputOutput\", {})\n  .n(\"RpcV2ProtocolClient\", \"NoInputOutputCommand\")\n  .f(void 0, void 0)\n  .ser(se_NoInputOutputCommand)\n  .de(de_NoInputOutputCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: {};\n    };\n    sdk: {\n      input: NoInputOutputCommandInput;\n      output: NoInputOutputCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/OperationWithDefaultsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { OperationWithDefaultsInput, OperationWithDefaultsOutput } from \"../models/models_0\";\nimport { de_OperationWithDefaultsCommand, se_OperationWithDefaultsCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link OperationWithDefaultsCommand}.\n */\nexport interface OperationWithDefaultsCommandInput extends OperationWithDefaultsInput {}\n/**\n * @public\n *\n * The output of {@link OperationWithDefaultsCommand}.\n */\nexport interface OperationWithDefaultsCommandOutput extends OperationWithDefaultsOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, OperationWithDefaultsCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, OperationWithDefaultsCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // OperationWithDefaultsInput\n *   defaults: { // Defaults\n *     defaultString: \"STRING_VALUE\",\n *     defaultBoolean: true || false,\n *     defaultList: [ // TestStringList\n *       \"STRING_VALUE\",\n *     ],\n *     defaultTimestamp: new Date(\"TIMESTAMP\"),\n *     defaultBlob: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n *     defaultByte: 0, // BYTE_VALUE\n *     defaultShort: Number(\"short\"),\n *     defaultInteger: Number(\"int\"),\n *     defaultLong: Number(\"long\"),\n *     defaultFloat: Number(\"float\"),\n *     defaultDouble: Number(\"double\"),\n *     defaultMap: { // TestStringMap\n *       \"<keys>\": \"STRING_VALUE\",\n *     },\n *     defaultEnum: \"FOO\" || \"BAR\" || \"BAZ\",\n *     defaultIntEnum: 1 || 2,\n *     emptyString: \"STRING_VALUE\",\n *     falseBoolean: true || false,\n *     emptyBlob: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n *     zeroByte: 0, // BYTE_VALUE\n *     zeroShort: Number(\"short\"),\n *     zeroInteger: Number(\"int\"),\n *     zeroLong: Number(\"long\"),\n *     zeroFloat: Number(\"float\"),\n *     zeroDouble: Number(\"double\"),\n *   },\n *   clientOptionalDefaults: { // ClientOptionalDefaults\n *     member: Number(\"int\"),\n *   },\n *   topLevelDefault: \"STRING_VALUE\",\n *   otherTopLevelDefault: Number(\"int\"),\n * };\n * const command = new OperationWithDefaultsCommand(input);\n * const response = await client.send(command);\n * // { // OperationWithDefaultsOutput\n * //   defaultString: \"STRING_VALUE\",\n * //   defaultBoolean: true || false,\n * //   defaultList: [ // TestStringList\n * //     \"STRING_VALUE\",\n * //   ],\n * //   defaultTimestamp: new Date(\"TIMESTAMP\"),\n * //   defaultBlob: new Uint8Array(),\n * //   defaultByte: 0, // BYTE_VALUE\n * //   defaultShort: Number(\"short\"),\n * //   defaultInteger: Number(\"int\"),\n * //   defaultLong: Number(\"long\"),\n * //   defaultFloat: Number(\"float\"),\n * //   defaultDouble: Number(\"double\"),\n * //   defaultMap: { // TestStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * //   defaultEnum: \"FOO\" || \"BAR\" || \"BAZ\",\n * //   defaultIntEnum: 1 || 2,\n * //   emptyString: \"STRING_VALUE\",\n * //   falseBoolean: true || false,\n * //   emptyBlob: new Uint8Array(),\n * //   zeroByte: 0, // BYTE_VALUE\n * //   zeroShort: Number(\"short\"),\n * //   zeroInteger: Number(\"int\"),\n * //   zeroLong: Number(\"long\"),\n * //   zeroFloat: Number(\"float\"),\n * //   zeroDouble: Number(\"double\"),\n * // };\n *\n * ```\n *\n * @param OperationWithDefaultsCommandInput - {@link OperationWithDefaultsCommandInput}\n * @returns {@link OperationWithDefaultsCommandOutput}\n * @see {@link OperationWithDefaultsCommandInput} for command's `input` shape.\n * @see {@link OperationWithDefaultsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class OperationWithDefaultsCommand extends $Command\n  .classBuilder<\n    OperationWithDefaultsCommandInput,\n    OperationWithDefaultsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"OperationWithDefaults\", {})\n  .n(\"RpcV2ProtocolClient\", \"OperationWithDefaultsCommand\")\n  .f(void 0, void 0)\n  .ser(se_OperationWithDefaultsCommand)\n  .de(de_OperationWithDefaultsCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: OperationWithDefaultsInput;\n      output: OperationWithDefaultsOutput;\n    };\n    sdk: {\n      input: OperationWithDefaultsCommandInput;\n      output: OperationWithDefaultsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/OptionalInputOutputCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { SimpleStructure } from \"../models/models_0\";\nimport { de_OptionalInputOutputCommand, se_OptionalInputOutputCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link OptionalInputOutputCommand}.\n */\nexport interface OptionalInputOutputCommandInput extends SimpleStructure {}\n/**\n * @public\n *\n * The output of {@link OptionalInputOutputCommand}.\n */\nexport interface OptionalInputOutputCommandOutput extends SimpleStructure, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, OptionalInputOutputCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, OptionalInputOutputCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // SimpleStructure\n *   value: \"STRING_VALUE\",\n * };\n * const command = new OptionalInputOutputCommand(input);\n * const response = await client.send(command);\n * // { // SimpleStructure\n * //   value: \"STRING_VALUE\",\n * // };\n *\n * ```\n *\n * @param OptionalInputOutputCommandInput - {@link OptionalInputOutputCommandInput}\n * @returns {@link OptionalInputOutputCommandOutput}\n * @see {@link OptionalInputOutputCommandInput} for command's `input` shape.\n * @see {@link OptionalInputOutputCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class OptionalInputOutputCommand extends $Command\n  .classBuilder<\n    OptionalInputOutputCommandInput,\n    OptionalInputOutputCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"OptionalInputOutput\", {})\n  .n(\"RpcV2ProtocolClient\", \"OptionalInputOutputCommand\")\n  .f(void 0, void 0)\n  .ser(se_OptionalInputOutputCommand)\n  .de(de_OptionalInputOutputCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: SimpleStructure;\n      output: SimpleStructure;\n    };\n    sdk: {\n      input: OptionalInputOutputCommandInput;\n      output: OptionalInputOutputCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/RecursiveShapesCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RecursiveShapesInputOutput } from \"../models/models_0\";\nimport { de_RecursiveShapesCommand, se_RecursiveShapesCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RecursiveShapesCommand}.\n */\nexport interface RecursiveShapesCommandInput extends RecursiveShapesInputOutput {}\n/**\n * @public\n *\n * The output of {@link RecursiveShapesCommand}.\n */\nexport interface RecursiveShapesCommandOutput extends RecursiveShapesInputOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RecursiveShapesCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RecursiveShapesCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RecursiveShapesInputOutput\n *   nested: { // RecursiveShapesInputOutputNested1\n *     foo: \"STRING_VALUE\",\n *     nested: { // RecursiveShapesInputOutputNested2\n *       bar: \"STRING_VALUE\",\n *       recursiveMember: {\n *         foo: \"STRING_VALUE\",\n *         nested: {\n *           bar: \"STRING_VALUE\",\n *           recursiveMember: \"<RecursiveShapesInputOutputNested1>\",\n *         },\n *       },\n *     },\n *   },\n * };\n * const command = new RecursiveShapesCommand(input);\n * const response = await client.send(command);\n * // { // RecursiveShapesInputOutput\n * //   nested: { // RecursiveShapesInputOutputNested1\n * //     foo: \"STRING_VALUE\",\n * //     nested: { // RecursiveShapesInputOutputNested2\n * //       bar: \"STRING_VALUE\",\n * //       recursiveMember: {\n * //         foo: \"STRING_VALUE\",\n * //         nested: {\n * //           bar: \"STRING_VALUE\",\n * //           recursiveMember: \"<RecursiveShapesInputOutputNested1>\",\n * //         },\n * //       },\n * //     },\n * //   },\n * // };\n *\n * ```\n *\n * @param RecursiveShapesCommandInput - {@link RecursiveShapesCommandInput}\n * @returns {@link RecursiveShapesCommandOutput}\n * @see {@link RecursiveShapesCommandInput} for command's `input` shape.\n * @see {@link RecursiveShapesCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class RecursiveShapesCommand extends $Command\n  .classBuilder<\n    RecursiveShapesCommandInput,\n    RecursiveShapesCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"RecursiveShapes\", {})\n  .n(\"RpcV2ProtocolClient\", \"RecursiveShapesCommand\")\n  .f(void 0, void 0)\n  .ser(se_RecursiveShapesCommand)\n  .de(de_RecursiveShapesCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RecursiveShapesInputOutput;\n      output: RecursiveShapesInputOutput;\n    };\n    sdk: {\n      input: RecursiveShapesCommandInput;\n      output: RecursiveShapesCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/RpcV2CborDenseMapsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2CborDenseMapsInputOutput } from \"../models/models_0\";\nimport { de_RpcV2CborDenseMapsCommand, se_RpcV2CborDenseMapsCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RpcV2CborDenseMapsCommand}.\n */\nexport interface RpcV2CborDenseMapsCommandInput extends RpcV2CborDenseMapsInputOutput {}\n/**\n * @public\n *\n * The output of {@link RpcV2CborDenseMapsCommand}.\n */\nexport interface RpcV2CborDenseMapsCommandOutput extends RpcV2CborDenseMapsInputOutput, __MetadataBearer {}\n\n/**\n * The example tests basic map serialization.\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RpcV2CborDenseMapsCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RpcV2CborDenseMapsCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RpcV2CborDenseMapsInputOutput\n *   denseStructMap: { // DenseStructMap\n *     \"<keys>\": { // GreetingStruct\n *       hi: \"STRING_VALUE\",\n *     },\n *   },\n *   denseNumberMap: { // DenseNumberMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n *   denseBooleanMap: { // DenseBooleanMap\n *     \"<keys>\": true || false,\n *   },\n *   denseStringMap: { // DenseStringMap\n *     \"<keys>\": \"STRING_VALUE\",\n *   },\n *   denseSetMap: { // DenseSetMap\n *     \"<keys>\": [ // StringSet\n *       \"STRING_VALUE\",\n *     ],\n *   },\n * };\n * const command = new RpcV2CborDenseMapsCommand(input);\n * const response = await client.send(command);\n * // { // RpcV2CborDenseMapsInputOutput\n * //   denseStructMap: { // DenseStructMap\n * //     \"<keys>\": { // GreetingStruct\n * //       hi: \"STRING_VALUE\",\n * //     },\n * //   },\n * //   denseNumberMap: { // DenseNumberMap\n * //     \"<keys>\": Number(\"int\"),\n * //   },\n * //   denseBooleanMap: { // DenseBooleanMap\n * //     \"<keys>\": true || false,\n * //   },\n * //   denseStringMap: { // DenseStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * //   denseSetMap: { // DenseSetMap\n * //     \"<keys>\": [ // StringSet\n * //       \"STRING_VALUE\",\n * //     ],\n * //   },\n * // };\n *\n * ```\n *\n * @param RpcV2CborDenseMapsCommandInput - {@link RpcV2CborDenseMapsCommandInput}\n * @returns {@link RpcV2CborDenseMapsCommandOutput}\n * @see {@link RpcV2CborDenseMapsCommandInput} for command's `input` shape.\n * @see {@link RpcV2CborDenseMapsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n * @public\n */\nexport class RpcV2CborDenseMapsCommand extends $Command\n  .classBuilder<\n    RpcV2CborDenseMapsCommandInput,\n    RpcV2CborDenseMapsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"RpcV2CborDenseMaps\", {})\n  .n(\"RpcV2ProtocolClient\", \"RpcV2CborDenseMapsCommand\")\n  .f(void 0, void 0)\n  .ser(se_RpcV2CborDenseMapsCommand)\n  .de(de_RpcV2CborDenseMapsCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RpcV2CborDenseMapsInputOutput;\n      output: RpcV2CborDenseMapsInputOutput;\n    };\n    sdk: {\n      input: RpcV2CborDenseMapsCommandInput;\n      output: RpcV2CborDenseMapsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/RpcV2CborListsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2CborListInputOutput } from \"../models/models_0\";\nimport { de_RpcV2CborListsCommand, se_RpcV2CborListsCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RpcV2CborListsCommand}.\n */\nexport interface RpcV2CborListsCommandInput extends RpcV2CborListInputOutput {}\n/**\n * @public\n *\n * The output of {@link RpcV2CborListsCommand}.\n */\nexport interface RpcV2CborListsCommandOutput extends RpcV2CborListInputOutput, __MetadataBearer {}\n\n/**\n * This test case serializes JSON lists for the following cases for both\n * input and output:\n *\n * 1. Normal lists.\n * 2. Normal sets.\n * 3. Lists of lists.\n * 4. Lists of structures.\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RpcV2CborListsCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RpcV2CborListsCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RpcV2CborListInputOutput\n *   stringList: [ // StringList\n *     \"STRING_VALUE\",\n *   ],\n *   stringSet: [ // StringSet\n *     \"STRING_VALUE\",\n *   ],\n *   integerList: [ // IntegerList\n *     Number(\"int\"),\n *   ],\n *   booleanList: [ // BooleanList\n *     true || false,\n *   ],\n *   timestampList: [ // TimestampList\n *     new Date(\"TIMESTAMP\"),\n *   ],\n *   enumList: [ // FooEnumList\n *     \"Foo\" || \"Baz\" || \"Bar\" || \"1\" || \"0\",\n *   ],\n *   intEnumList: [ // IntegerEnumList\n *     1 || 2 || 3,\n *   ],\n *   nestedStringList: [ // NestedStringList\n *     [\n *       \"STRING_VALUE\",\n *     ],\n *   ],\n *   structureList: [ // StructureList\n *     { // StructureListMember\n *       a: \"STRING_VALUE\",\n *       b: \"STRING_VALUE\",\n *     },\n *   ],\n *   blobList: [ // BlobList\n *     new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n *   ],\n * };\n * const command = new RpcV2CborListsCommand(input);\n * const response = await client.send(command);\n * // { // RpcV2CborListInputOutput\n * //   stringList: [ // StringList\n * //     \"STRING_VALUE\",\n * //   ],\n * //   stringSet: [ // StringSet\n * //     \"STRING_VALUE\",\n * //   ],\n * //   integerList: [ // IntegerList\n * //     Number(\"int\"),\n * //   ],\n * //   booleanList: [ // BooleanList\n * //     true || false,\n * //   ],\n * //   timestampList: [ // TimestampList\n * //     new Date(\"TIMESTAMP\"),\n * //   ],\n * //   enumList: [ // FooEnumList\n * //     \"Foo\" || \"Baz\" || \"Bar\" || \"1\" || \"0\",\n * //   ],\n * //   intEnumList: [ // IntegerEnumList\n * //     1 || 2 || 3,\n * //   ],\n * //   nestedStringList: [ // NestedStringList\n * //     [\n * //       \"STRING_VALUE\",\n * //     ],\n * //   ],\n * //   structureList: [ // StructureList\n * //     { // StructureListMember\n * //       a: \"STRING_VALUE\",\n * //       b: \"STRING_VALUE\",\n * //     },\n * //   ],\n * //   blobList: [ // BlobList\n * //     new Uint8Array(),\n * //   ],\n * // };\n *\n * ```\n *\n * @param RpcV2CborListsCommandInput - {@link RpcV2CborListsCommandInput}\n * @returns {@link RpcV2CborListsCommandOutput}\n * @see {@link RpcV2CborListsCommandInput} for command's `input` shape.\n * @see {@link RpcV2CborListsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n * @public\n */\nexport class RpcV2CborListsCommand extends $Command\n  .classBuilder<\n    RpcV2CborListsCommandInput,\n    RpcV2CborListsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"RpcV2CborLists\", {})\n  .n(\"RpcV2ProtocolClient\", \"RpcV2CborListsCommand\")\n  .f(void 0, void 0)\n  .ser(se_RpcV2CborListsCommand)\n  .de(de_RpcV2CborListsCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RpcV2CborListInputOutput;\n      output: RpcV2CborListInputOutput;\n    };\n    sdk: {\n      input: RpcV2CborListsCommandInput;\n      output: RpcV2CborListsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/RpcV2CborSparseMapsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2CborSparseMapsInputOutput } from \"../models/models_0\";\nimport { de_RpcV2CborSparseMapsCommand, se_RpcV2CborSparseMapsCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RpcV2CborSparseMapsCommand}.\n */\nexport interface RpcV2CborSparseMapsCommandInput extends RpcV2CborSparseMapsInputOutput {}\n/**\n * @public\n *\n * The output of {@link RpcV2CborSparseMapsCommand}.\n */\nexport interface RpcV2CborSparseMapsCommandOutput extends RpcV2CborSparseMapsInputOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RpcV2CborSparseMapsCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RpcV2CborSparseMapsCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RpcV2CborSparseMapsInputOutput\n *   sparseStructMap: { // SparseStructMap\n *     \"<keys>\": { // GreetingStruct\n *       hi: \"STRING_VALUE\",\n *     },\n *   },\n *   sparseNumberMap: { // SparseNumberMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n *   sparseBooleanMap: { // SparseBooleanMap\n *     \"<keys>\": true || false,\n *   },\n *   sparseStringMap: { // SparseStringMap\n *     \"<keys>\": \"STRING_VALUE\",\n *   },\n *   sparseSetMap: { // SparseSetMap\n *     \"<keys>\": [ // StringSet\n *       \"STRING_VALUE\",\n *     ],\n *   },\n * };\n * const command = new RpcV2CborSparseMapsCommand(input);\n * const response = await client.send(command);\n * // { // RpcV2CborSparseMapsInputOutput\n * //   sparseStructMap: { // SparseStructMap\n * //     \"<keys>\": { // GreetingStruct\n * //       hi: \"STRING_VALUE\",\n * //     },\n * //   },\n * //   sparseNumberMap: { // SparseNumberMap\n * //     \"<keys>\": Number(\"int\"),\n * //   },\n * //   sparseBooleanMap: { // SparseBooleanMap\n * //     \"<keys>\": true || false,\n * //   },\n * //   sparseStringMap: { // SparseStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * //   sparseSetMap: { // SparseSetMap\n * //     \"<keys>\": [ // StringSet\n * //       \"STRING_VALUE\",\n * //     ],\n * //   },\n * // };\n *\n * ```\n *\n * @param RpcV2CborSparseMapsCommandInput - {@link RpcV2CborSparseMapsCommandInput}\n * @returns {@link RpcV2CborSparseMapsCommandOutput}\n * @see {@link RpcV2CborSparseMapsCommandInput} for command's `input` shape.\n * @see {@link RpcV2CborSparseMapsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class RpcV2CborSparseMapsCommand extends $Command\n  .classBuilder<\n    RpcV2CborSparseMapsCommandInput,\n    RpcV2CborSparseMapsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"RpcV2CborSparseMaps\", {})\n  .n(\"RpcV2ProtocolClient\", \"RpcV2CborSparseMapsCommand\")\n  .f(void 0, void 0)\n  .ser(se_RpcV2CborSparseMapsCommand)\n  .de(de_RpcV2CborSparseMapsCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RpcV2CborSparseMapsInputOutput;\n      output: RpcV2CborSparseMapsInputOutput;\n    };\n    sdk: {\n      input: RpcV2CborSparseMapsCommandInput;\n      output: RpcV2CborSparseMapsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/SimpleScalarPropertiesCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { SimpleScalarStructure } from \"../models/models_0\";\nimport { de_SimpleScalarPropertiesCommand, se_SimpleScalarPropertiesCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link SimpleScalarPropertiesCommand}.\n */\nexport interface SimpleScalarPropertiesCommandInput extends SimpleScalarStructure {}\n/**\n * @public\n *\n * The output of {@link SimpleScalarPropertiesCommand}.\n */\nexport interface SimpleScalarPropertiesCommandOutput extends SimpleScalarStructure, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, SimpleScalarPropertiesCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, SimpleScalarPropertiesCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // SimpleScalarStructure\n *   trueBooleanValue: true || false,\n *   falseBooleanValue: true || false,\n *   byteValue: 0, // BYTE_VALUE\n *   doubleValue: Number(\"double\"),\n *   floatValue: Number(\"float\"),\n *   integerValue: Number(\"int\"),\n *   longValue: Number(\"long\"),\n *   shortValue: Number(\"short\"),\n *   stringValue: \"STRING_VALUE\",\n *   blobValue: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n * };\n * const command = new SimpleScalarPropertiesCommand(input);\n * const response = await client.send(command);\n * // { // SimpleScalarStructure\n * //   trueBooleanValue: true || false,\n * //   falseBooleanValue: true || false,\n * //   byteValue: 0, // BYTE_VALUE\n * //   doubleValue: Number(\"double\"),\n * //   floatValue: Number(\"float\"),\n * //   integerValue: Number(\"int\"),\n * //   longValue: Number(\"long\"),\n * //   shortValue: Number(\"short\"),\n * //   stringValue: \"STRING_VALUE\",\n * //   blobValue: new Uint8Array(),\n * // };\n *\n * ```\n *\n * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput}\n * @returns {@link SimpleScalarPropertiesCommandOutput}\n * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape.\n * @see {@link SimpleScalarPropertiesCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class SimpleScalarPropertiesCommand extends $Command\n  .classBuilder<\n    SimpleScalarPropertiesCommandInput,\n    SimpleScalarPropertiesCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"SimpleScalarProperties\", {})\n  .n(\"RpcV2ProtocolClient\", \"SimpleScalarPropertiesCommand\")\n  .f(void 0, void 0)\n  .ser(se_SimpleScalarPropertiesCommand)\n  .de(de_SimpleScalarPropertiesCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: SimpleScalarStructure;\n      output: SimpleScalarStructure;\n    };\n    sdk: {\n      input: SimpleScalarPropertiesCommandInput;\n      output: SimpleScalarPropertiesCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/SparseNullsOperationCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport { getSerdePlugin } from \"@smithy/core/serde\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { SparseNullsOperationInputOutput } from \"../models/models_0\";\nimport { de_SparseNullsOperationCommand, se_SparseNullsOperationCommand } from \"../protocols/Rpcv2cbor\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link SparseNullsOperationCommand}.\n */\nexport interface SparseNullsOperationCommandInput extends SparseNullsOperationInputOutput {}\n/**\n * @public\n *\n * The output of {@link SparseNullsOperationCommand}.\n */\nexport interface SparseNullsOperationCommandOutput extends SparseNullsOperationInputOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, SparseNullsOperationCommand } from \"@smithy/smithy-rpcv2-cbor\"; // ES Modules import\n * // const { RpcV2ProtocolClient, SparseNullsOperationCommand } = require(\"@smithy/smithy-rpcv2-cbor\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // SparseNullsOperationInputOutput\n *   sparseStringList: [ // SparseStringList\n *     \"STRING_VALUE\",\n *   ],\n *   sparseStringMap: { // SparseStringMap\n *     \"<keys>\": \"STRING_VALUE\",\n *   },\n * };\n * const command = new SparseNullsOperationCommand(input);\n * const response = await client.send(command);\n * // { // SparseNullsOperationInputOutput\n * //   sparseStringList: [ // SparseStringList\n * //     \"STRING_VALUE\",\n * //   ],\n * //   sparseStringMap: { // SparseStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * // };\n *\n * ```\n *\n * @param SparseNullsOperationCommandInput - {@link SparseNullsOperationCommandInput}\n * @returns {@link SparseNullsOperationCommandOutput}\n * @see {@link SparseNullsOperationCommandInput} for command's `input` shape.\n * @see {@link SparseNullsOperationCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class SparseNullsOperationCommand extends $Command\n  .classBuilder<\n    SparseNullsOperationCommandInput,\n    SparseNullsOperationCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [\n      getSerdePlugin(config, this.serialize, this.deserialize),\n      getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\n    ];\n  })\n  .s(\"RpcV2Protocol\", \"SparseNullsOperation\", {})\n  .n(\"RpcV2ProtocolClient\", \"SparseNullsOperationCommand\")\n  .f(void 0, void 0)\n  .ser(se_SparseNullsOperationCommand)\n  .de(de_SparseNullsOperationCommand)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: SparseNullsOperationInputOutput;\n      output: SparseNullsOperationInputOutput;\n    };\n    sdk: {\n      input: SparseNullsOperationCommandInput;\n      output: SparseNullsOperationCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/commands/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./EmptyInputOutputCommand\";\nexport * from \"./Float16Command\";\nexport * from \"./FractionalSecondsCommand\";\nexport * from \"./GreetingWithErrorsCommand\";\nexport * from \"./NoInputOutputCommand\";\nexport * from \"./OperationWithDefaultsCommand\";\nexport * from \"./OptionalInputOutputCommand\";\nexport * from \"./RecursiveShapesCommand\";\nexport * from \"./RpcV2CborDenseMapsCommand\";\nexport * from \"./RpcV2CborListsCommand\";\nexport * from \"./RpcV2CborSparseMapsCommand\";\nexport * from \"./SimpleScalarPropertiesCommand\";\nexport * from \"./SparseNullsOperationCommand\";\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/endpoint/EndpointParameters.ts",
    "content": "// smithy-typescript generated code\nimport type { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface ClientInputEndpointParameters {\n  endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n}\n\n/**\n * @public\n */\nexport type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, \"endpoint\"> & {\n  defaultSigningName: string;\n};\n\n/**\n * @internal\n */\nexport const resolveClientEndpointParameters = <T>(\n  options: T & ClientInputEndpointParameters\n): T & ClientResolvedEndpointParameters => {\n  return Object.assign(options, {\n    defaultSigningName: \"\",\n  });\n};\n\n/**\n * @internal\n */\nexport const commonParams = {\n  endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n} as const;\n\n/**\n * @internal\n */\nexport interface EndpointParameters extends __EndpointParameters {\n  endpoint?: string | undefined;\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/endpoint/bdd.ts",
    "content": "// smithy-typescript generated code\nimport { BinaryDecisionDiagram } from \"@smithy/core/endpoints\";\n\nconst a={\"ref\":\"endpoint\"};\nconst _data={\n  conditions: [\n    [\"isSet\",[a]]\n  ],\n  results: [\n    [-1],\n    [a,{}],\n    [-1,\"(default endpointRuleSet) endpoint is not set - you must configure an endpoint.\"]\n  ]\n};\n\nconst root = 2;\nconst r = 100_000_000;\nconst nodes = new Int32Array([\n  -1, 1, -1,\n  0, r + 1, r + 2,\n]);\nexport const bdd = BinaryDecisionDiagram.from(\n  nodes, root, _data.conditions, _data.results\n);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/endpoint/endpointResolver.ts",
    "content": "// smithy-typescript generated code\nimport { type EndpointParams, decideEndpoint, EndpointCache } from \"@smithy/core/endpoints\";\nimport type { EndpointV2, Logger } from \"@smithy/types\";\n\nimport { bdd } from \"./bdd\";\nimport type { EndpointParameters } from \"./EndpointParameters\";\n\nconst cache = new EndpointCache({\n  size: 50,\n  params: [\"endpoint\"],\n});\n\n/**\n * @internal\n */\nexport const defaultEndpointResolver = (\n  endpointParams: EndpointParameters,\n  context: { logger?: Logger } = {}\n): EndpointV2 => {\n  return cache.get(endpointParams as EndpointParams, () =>\n    decideEndpoint(bdd, {\n      endpointParams: endpointParams as EndpointParams,\n      logger: context.logger,\n    })\n  );\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/extensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { HttpHandlerExtensionConfiguration } from \"@smithy/core/protocols\";\nimport type { DefaultExtensionConfiguration } from \"@smithy/types\";\n\nimport type { HttpAuthExtensionConfiguration } from \"./auth/httpAuthExtensionConfiguration\";\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolExtensionConfiguration\n  extends HttpHandlerExtensionConfiguration,\n    DefaultExtensionConfiguration,\n    HttpAuthExtensionConfiguration {}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/index.ts",
    "content": "// smithy-typescript generated code\n/* eslint-disable */\nexport * from \"./RpcV2ProtocolClient\";\nexport * from \"./RpcV2Protocol\";\nexport type { ClientInputEndpointParameters } from \"./endpoint/EndpointParameters\";\nexport type { RuntimeExtension } from \"./runtimeExtensions\";\nexport type { RpcV2ProtocolExtensionConfiguration } from \"./extensionConfiguration\";\nexport * from \"./commands\";\n\nexport * from \"./models/enums\";\nexport * from \"./models/errors\";\nexport * from \"./models/models_0\";\n\nexport { RpcV2ProtocolServiceException } from \"./models/RpcV2ProtocolServiceException\";\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/models/RpcV2ProtocolServiceException.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type ServiceExceptionOptions as __ServiceExceptionOptions,\n  ServiceException as __ServiceException,\n} from \"@smithy/core/client\";\n\nexport type { __ServiceExceptionOptions };\n\nexport { __ServiceException };\n\n/**\n * @public\n *\n * Base exception class for all service exceptions from RpcV2Protocol service.\n */\nexport class RpcV2ProtocolServiceException extends __ServiceException {\n  /**\n   * @internal\n   */\n  constructor(options: __ServiceExceptionOptions) {\n    super(options);\n    Object.setPrototypeOf(this, RpcV2ProtocolServiceException.prototype);\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/models/enums.ts",
    "content": "// smithy-typescript generated code\n/**\n * @public\n * @enum\n */\nexport const TestEnum = {\n  BAR: \"BAR\",\n  BAZ: \"BAZ\",\n  FOO: \"FOO\",\n} as const;\n/**\n * @public\n */\nexport type TestEnum = (typeof TestEnum)[keyof typeof TestEnum];\n\nexport enum TestIntEnum {\n  ONE = 1,\n  TWO = 2,\n}\n\n/**\n * @public\n * @enum\n */\nexport const FooEnum = {\n  BAR: \"Bar\",\n  BAZ: \"Baz\",\n  FOO: \"Foo\",\n  ONE: \"1\",\n  ZERO: \"0\",\n} as const;\n/**\n * @public\n */\nexport type FooEnum = (typeof FooEnum)[keyof typeof FooEnum];\n\nexport enum IntegerEnum {\n  A = 1,\n  B = 2,\n  C = 3,\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/models/errors.ts",
    "content": "// smithy-typescript generated code\nimport type { ExceptionOptionType as __ExceptionOptionType } from \"@smithy/core/client\";\n\nimport type { ComplexNestedErrorData, ValidationExceptionField } from \"./models_0\";\nimport { RpcV2ProtocolServiceException as __BaseException } from \"./RpcV2ProtocolServiceException\";\n\n/**\n * A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n * @public\n */\nexport class ValidationException extends __BaseException {\n  readonly name = \"ValidationException\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * A list of specific failures encountered while validating the input.\n   * A member can appear in this list more than once if it failed to satisfy multiple constraints.\n   * @public\n   */\n  fieldList?: ValidationExceptionField[] | undefined;\n\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>) {\n    super({\n      name: \"ValidationException\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, ValidationException.prototype);\n    this.fieldList = opts.fieldList;\n  }\n}\n\n/**\n * This error is thrown when a request is invalid.\n * @public\n */\nexport class ComplexError extends __BaseException {\n  readonly name = \"ComplexError\" as const;\n  readonly $fault = \"client\" as const;\n  TopLevel?: string | undefined;\n  Nested?: ComplexNestedErrorData | undefined;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<ComplexError, __BaseException>) {\n    super({\n      name: \"ComplexError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, ComplexError.prototype);\n    this.TopLevel = opts.TopLevel;\n    this.Nested = opts.Nested;\n  }\n}\n\n/**\n * This error is thrown when an invalid greeting value is provided.\n * @public\n */\nexport class InvalidGreeting extends __BaseException {\n  readonly name = \"InvalidGreeting\" as const;\n  readonly $fault = \"client\" as const;\n  Message?: string | undefined;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<InvalidGreeting, __BaseException>) {\n    super({\n      name: \"InvalidGreeting\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, InvalidGreeting.prototype);\n    this.Message = opts.Message;\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/models/models_0.ts",
    "content": "// smithy-typescript generated code\nimport type { FooEnum, IntegerEnum, TestEnum, TestIntEnum } from \"./enums\";\n\n/**\n * Describes one specific validation failure for an input member.\n * @public\n */\nexport interface ValidationExceptionField {\n  /**\n   * A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.\n   * @public\n   */\n  path: string | undefined;\n\n  /**\n   * A detailed description of the validation failure.\n   * @public\n   */\n  message: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface ClientOptionalDefaults {\n  member?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface ComplexNestedErrorData {\n  Foo?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface Defaults {\n  defaultString?: string | undefined;\n  defaultBoolean?: boolean | undefined;\n  defaultList?: string[] | undefined;\n  defaultTimestamp?: Date | undefined;\n  defaultBlob?: Uint8Array | undefined;\n  defaultByte?: number | undefined;\n  defaultShort?: number | undefined;\n  defaultInteger?: number | undefined;\n  defaultLong?: number | undefined;\n  defaultFloat?: number | undefined;\n  defaultDouble?: number | undefined;\n  defaultMap?: Record<string, string> | undefined;\n  defaultEnum?: TestEnum | undefined;\n  defaultIntEnum?: TestIntEnum | undefined;\n  emptyString?: string | undefined;\n  falseBoolean?: boolean | undefined;\n  emptyBlob?: Uint8Array | undefined;\n  zeroByte?: number | undefined;\n  zeroShort?: number | undefined;\n  zeroInteger?: number | undefined;\n  zeroLong?: number | undefined;\n  zeroFloat?: number | undefined;\n  zeroDouble?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface GreetingStruct {\n  hi?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface EmptyStructure {}\n\n/**\n * @public\n */\nexport interface Float16Output {\n  value?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface FractionalSecondsOutput {\n  datetime?: Date | undefined;\n}\n\n/**\n * @public\n */\nexport interface GreetingWithErrorsOutput {\n  greeting?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface OperationWithDefaultsInput {\n  defaults?: Defaults | undefined;\n  clientOptionalDefaults?: ClientOptionalDefaults | undefined;\n  topLevelDefault?: string | undefined;\n  otherTopLevelDefault?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface OperationWithDefaultsOutput {\n  defaultString?: string | undefined;\n  defaultBoolean?: boolean | undefined;\n  defaultList?: string[] | undefined;\n  defaultTimestamp?: Date | undefined;\n  defaultBlob?: Uint8Array | undefined;\n  defaultByte?: number | undefined;\n  defaultShort?: number | undefined;\n  defaultInteger?: number | undefined;\n  defaultLong?: number | undefined;\n  defaultFloat?: number | undefined;\n  defaultDouble?: number | undefined;\n  defaultMap?: Record<string, string> | undefined;\n  defaultEnum?: TestEnum | undefined;\n  defaultIntEnum?: TestIntEnum | undefined;\n  emptyString?: string | undefined;\n  falseBoolean?: boolean | undefined;\n  emptyBlob?: Uint8Array | undefined;\n  zeroByte?: number | undefined;\n  zeroShort?: number | undefined;\n  zeroInteger?: number | undefined;\n  zeroLong?: number | undefined;\n  zeroFloat?: number | undefined;\n  zeroDouble?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface SimpleStructure {\n  value?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface RpcV2CborDenseMapsInputOutput {\n  denseStructMap?: Record<string, GreetingStruct> | undefined;\n  denseNumberMap?: Record<string, number> | undefined;\n  denseBooleanMap?: Record<string, boolean> | undefined;\n  denseStringMap?: Record<string, string> | undefined;\n  denseSetMap?: Record<string, string[]> | undefined;\n}\n\n/**\n * @public\n */\nexport interface StructureListMember {\n  a?: string | undefined;\n  b?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface RpcV2CborListInputOutput {\n  stringList?: string[] | undefined;\n  stringSet?: string[] | undefined;\n  integerList?: number[] | undefined;\n  booleanList?: boolean[] | undefined;\n  timestampList?: Date[] | undefined;\n  enumList?: FooEnum[] | undefined;\n  intEnumList?: IntegerEnum[] | undefined;\n  /**\n   * A list of lists of strings.\n   * @public\n   */\n  nestedStringList?: string[][] | undefined;\n\n  structureList?: StructureListMember[] | undefined;\n  blobList?: Uint8Array[] | undefined;\n}\n\n/**\n * @public\n */\nexport interface RpcV2CborSparseMapsInputOutput {\n  sparseStructMap?: Record<string, GreetingStruct | null> | undefined;\n  sparseNumberMap?: Record<string, number | null> | undefined;\n  sparseBooleanMap?: Record<string, boolean | null> | undefined;\n  sparseStringMap?: Record<string, string | null> | undefined;\n  sparseSetMap?: Record<string, string[] | null> | undefined;\n}\n\n/**\n * @public\n */\nexport interface SimpleScalarStructure {\n  trueBooleanValue?: boolean | undefined;\n  falseBooleanValue?: boolean | undefined;\n  byteValue?: number | undefined;\n  doubleValue?: number | undefined;\n  floatValue?: number | undefined;\n  integerValue?: number | undefined;\n  longValue?: number | undefined;\n  shortValue?: number | undefined;\n  stringValue?: string | undefined;\n  blobValue?: Uint8Array | undefined;\n}\n\n/**\n * @public\n */\nexport interface SparseNullsOperationInputOutput {\n  sparseStringList?: (string | null)[] | undefined;\n  sparseStringMap?: Record<string, string | null> | undefined;\n}\n\n/**\n * @public\n */\nexport interface RecursiveShapesInputOutputNested1 {\n  foo?: string | undefined;\n  nested?: RecursiveShapesInputOutputNested2 | undefined;\n}\n\n/**\n * @public\n */\nexport interface RecursiveShapesInputOutputNested2 {\n  bar?: string | undefined;\n  recursiveMember?: RecursiveShapesInputOutputNested1 | undefined;\n}\n\n/**\n * @public\n */\nexport interface RecursiveShapesInputOutput {\n  nested?: RecursiveShapesInputOutputNested1 | undefined;\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts",
    "content": "// smithy-typescript generated code\nimport {\n  buildHttpRpcRequest,\n  cbor,\n  checkCborResponse as cr,\n  dateToTag as __dateToTag,\n  loadSmithyRpcV2CborErrorCode,\n  parseCborBody as parseBody,\n  parseCborErrorBody as parseErrorBody,\n} from \"@smithy/core/cbor\";\nimport {\n  _json,\n  decorateServiceException as __decorateServiceException,\n  take,\n  withBaseException,\n} from \"@smithy/core/client\";\nimport {\n  type HttpRequest as __HttpRequest,\n  type HttpResponse as __HttpResponse,\n  collectBody,\n} from \"@smithy/core/protocols\";\nimport {\n  expectBoolean as __expectBoolean,\n  expectByte as __expectByte,\n  expectInt32 as __expectInt32,\n  expectLong as __expectLong,\n  expectNonNull as __expectNonNull,\n  expectShort as __expectShort,\n  expectString as __expectString,\n  limitedParseDouble as __limitedParseDouble,\n  limitedParseFloat32 as __limitedParseFloat32,\n  parseEpochTimestamp as __parseEpochTimestamp,\n} from \"@smithy/core/serde\";\nimport type {\n  Endpoint as __Endpoint,\n  HeaderBag as __HeaderBag,\n  ResponseMetadata as __ResponseMetadata,\n  SerdeContext as __SerdeContext,\n} from \"@smithy/types\";\n\nimport type { EmptyInputOutputCommandInput, EmptyInputOutputCommandOutput } from \"../commands/EmptyInputOutputCommand\";\nimport type { Float16CommandInput, Float16CommandOutput } from \"../commands/Float16Command\";\nimport type {\n  FractionalSecondsCommandInput,\n  FractionalSecondsCommandOutput,\n} from \"../commands/FractionalSecondsCommand\";\nimport type {\n  GreetingWithErrorsCommandInput,\n  GreetingWithErrorsCommandOutput,\n} from \"../commands/GreetingWithErrorsCommand\";\nimport type { NoInputOutputCommandInput, NoInputOutputCommandOutput } from \"../commands/NoInputOutputCommand\";\nimport type {\n  OperationWithDefaultsCommandInput,\n  OperationWithDefaultsCommandOutput,\n} from \"../commands/OperationWithDefaultsCommand\";\nimport type {\n  OptionalInputOutputCommandInput,\n  OptionalInputOutputCommandOutput,\n} from \"../commands/OptionalInputOutputCommand\";\nimport type { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from \"../commands/RecursiveShapesCommand\";\nimport type {\n  RpcV2CborDenseMapsCommandInput,\n  RpcV2CborDenseMapsCommandOutput,\n} from \"../commands/RpcV2CborDenseMapsCommand\";\nimport type { RpcV2CborListsCommandInput, RpcV2CborListsCommandOutput } from \"../commands/RpcV2CborListsCommand\";\nimport type {\n  RpcV2CborSparseMapsCommandInput,\n  RpcV2CborSparseMapsCommandOutput,\n} from \"../commands/RpcV2CborSparseMapsCommand\";\nimport type {\n  SimpleScalarPropertiesCommandInput,\n  SimpleScalarPropertiesCommandOutput,\n} from \"../commands/SimpleScalarPropertiesCommand\";\nimport type {\n  SparseNullsOperationCommandInput,\n  SparseNullsOperationCommandOutput,\n} from \"../commands/SparseNullsOperationCommand\";\nimport type { FooEnum, IntegerEnum } from \"../models/enums\";\nimport { ComplexError, InvalidGreeting, ValidationException } from \"../models/errors\";\nimport type {\n  ClientOptionalDefaults,\n  Defaults,\n  EmptyStructure,\n  Float16Output,\n  FractionalSecondsOutput,\n  GreetingStruct,\n  OperationWithDefaultsInput,\n  OperationWithDefaultsOutput,\n  RecursiveShapesInputOutput,\n  RecursiveShapesInputOutputNested1,\n  RecursiveShapesInputOutputNested2,\n  RpcV2CborDenseMapsInputOutput,\n  RpcV2CborListInputOutput,\n  RpcV2CborSparseMapsInputOutput,\n  SimpleScalarStructure,\n  SimpleStructure,\n  SparseNullsOperationInputOutput,\n  StructureListMember,\n} from \"../models/models_0\";\nimport { RpcV2ProtocolServiceException as __BaseException } from \"../models/RpcV2ProtocolServiceException\";\n\n/**\n * serializeRpcv2cborEmptyInputOutputCommand\n */\nexport const se_EmptyInputOutputCommand = async (\n  input: EmptyInputOutputCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(_json(input));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/EmptyInputOutput\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborFloat16Command\n */\nexport const se_Float16Command = async (\n  input: Float16CommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = { ...SHARED_HEADERS };\n  delete headers[\"content-type\"];\n\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/Float16\", undefined, undefined);\n};\n\n/**\n * serializeRpcv2cborFractionalSecondsCommand\n */\nexport const se_FractionalSecondsCommand = async (\n  input: FractionalSecondsCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = { ...SHARED_HEADERS };\n  delete headers[\"content-type\"];\n\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/FractionalSeconds\", undefined, undefined);\n};\n\n/**\n * serializeRpcv2cborGreetingWithErrorsCommand\n */\nexport const se_GreetingWithErrorsCommand = async (\n  input: GreetingWithErrorsCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = { ...SHARED_HEADERS };\n  delete headers[\"content-type\"];\n\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/GreetingWithErrors\", undefined, undefined);\n};\n\n/**\n * serializeRpcv2cborNoInputOutputCommand\n */\nexport const se_NoInputOutputCommand = async (\n  input: NoInputOutputCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = { ...SHARED_HEADERS };\n  delete headers[\"content-type\"];\n\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/NoInputOutput\", undefined, undefined);\n};\n\n/**\n * serializeRpcv2cborOperationWithDefaultsCommand\n */\nexport const se_OperationWithDefaultsCommand = async (\n  input: OperationWithDefaultsCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_OperationWithDefaultsInput(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/OperationWithDefaults\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborOptionalInputOutputCommand\n */\nexport const se_OptionalInputOutputCommand = async (\n  input: OptionalInputOutputCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(_json(input));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/OptionalInputOutput\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborRecursiveShapesCommand\n */\nexport const se_RecursiveShapesCommand = async (\n  input: RecursiveShapesCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_RecursiveShapesInputOutput(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/RecursiveShapes\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborRpcV2CborDenseMapsCommand\n */\nexport const se_RpcV2CborDenseMapsCommand = async (\n  input: RpcV2CborDenseMapsCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(_json(input));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborRpcV2CborListsCommand\n */\nexport const se_RpcV2CborListsCommand = async (\n  input: RpcV2CborListsCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_RpcV2CborListInputOutput(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/RpcV2CborLists\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborRpcV2CborSparseMapsCommand\n */\nexport const se_RpcV2CborSparseMapsCommand = async (\n  input: RpcV2CborSparseMapsCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_RpcV2CborSparseMapsInputOutput(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborSimpleScalarPropertiesCommand\n */\nexport const se_SimpleScalarPropertiesCommand = async (\n  input: SimpleScalarPropertiesCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_SimpleScalarStructure(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/SimpleScalarProperties\", undefined, body);\n};\n\n/**\n * serializeRpcv2cborSparseNullsOperationCommand\n */\nexport const se_SparseNullsOperationCommand = async (\n  input: SparseNullsOperationCommandInput,\n  context: __SerdeContext\n): Promise<__HttpRequest> => {\n  const headers: __HeaderBag = SHARED_HEADERS;\n  let body: any;\n  body = cbor.serialize(se_SparseNullsOperationInputOutput(input, context));\n  return buildHttpRpcRequest(context, headers, \"/service/RpcV2Protocol/operation/SparseNullsOperation\", undefined, body);\n};\n\n/**\n * deserializeRpcv2cborEmptyInputOutputCommand\n */\nexport const de_EmptyInputOutputCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<EmptyInputOutputCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = _json(data);\n  const response: EmptyInputOutputCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborFloat16Command\n */\nexport const de_Float16Command = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<Float16CommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_Float16Output(data, context);\n  const response: Float16CommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborFractionalSecondsCommand\n */\nexport const de_FractionalSecondsCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<FractionalSecondsCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_FractionalSecondsOutput(data, context);\n  const response: FractionalSecondsCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborGreetingWithErrorsCommand\n */\nexport const de_GreetingWithErrorsCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<GreetingWithErrorsCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = _json(data);\n  const response: GreetingWithErrorsCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborNoInputOutputCommand\n */\nexport const de_NoInputOutputCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<NoInputOutputCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  await collectBody(output.body, context);\n  const response: NoInputOutputCommandOutput = {\n    $metadata: deserializeMetadata(output),\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborOperationWithDefaultsCommand\n */\nexport const de_OperationWithDefaultsCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<OperationWithDefaultsCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_OperationWithDefaultsOutput(data, context);\n  const response: OperationWithDefaultsCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborOptionalInputOutputCommand\n */\nexport const de_OptionalInputOutputCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<OptionalInputOutputCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = _json(data);\n  const response: OptionalInputOutputCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborRecursiveShapesCommand\n */\nexport const de_RecursiveShapesCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<RecursiveShapesCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_RecursiveShapesInputOutput(data, context);\n  const response: RecursiveShapesCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborRpcV2CborDenseMapsCommand\n */\nexport const de_RpcV2CborDenseMapsCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<RpcV2CborDenseMapsCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = _json(data);\n  const response: RpcV2CborDenseMapsCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborRpcV2CborListsCommand\n */\nexport const de_RpcV2CborListsCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<RpcV2CborListsCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_RpcV2CborListInputOutput(data, context);\n  const response: RpcV2CborListsCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborRpcV2CborSparseMapsCommand\n */\nexport const de_RpcV2CborSparseMapsCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<RpcV2CborSparseMapsCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_RpcV2CborSparseMapsInputOutput(data, context);\n  const response: RpcV2CborSparseMapsCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborSimpleScalarPropertiesCommand\n */\nexport const de_SimpleScalarPropertiesCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<SimpleScalarPropertiesCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_SimpleScalarStructure(data, context);\n  const response: SimpleScalarPropertiesCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserializeRpcv2cborSparseNullsOperationCommand\n */\nexport const de_SparseNullsOperationCommand = async (\n  output: __HttpResponse,\n  context: __SerdeContext\n): Promise<SparseNullsOperationCommandOutput> => {\n  cr(output);\n  if (output.statusCode >= 300) {\n    return de_CommandError(output, context);\n  }\n\n  const data: any = await parseBody(output.body, context)\n  let contents: any = {};\n  contents = de_SparseNullsOperationInputOutput(data, context);\n  const response: SparseNullsOperationCommandOutput = {\n    $metadata: deserializeMetadata(output), ...contents,\n  };\n  return response;\n\n};\n\n/**\n * deserialize_Rpcv2cborCommandError\n */\nconst de_CommandError = async (\n  output: __HttpResponse,\n  context: __SerdeContext,\n): Promise<never> => {\n  const parsedOutput: any = {\n    ...output,\n    body: await parseErrorBody(output.body, context)\n  };\n  const errorCode = loadSmithyRpcV2CborErrorCode(output, parsedOutput.body);\n  switch (errorCode) {\n    case \"ComplexError\":\n    case \"smithy.protocoltests.rpcv2Cbor#ComplexError\":\n      throw await de_ComplexErrorRes(parsedOutput, context);\n    case \"InvalidGreeting\":\n    case \"smithy.protocoltests.rpcv2Cbor#InvalidGreeting\":\n      throw await de_InvalidGreetingRes(parsedOutput, context);\n    case \"ValidationException\":\n    case \"smithy.framework#ValidationException\":\n      throw await de_ValidationExceptionRes(parsedOutput, context);\n    default:\n      const parsedBody = parsedOutput.body;\n      return throwDefaultError({\n        output,\n        parsedBody,\n        errorCode\n      }) as never;\n  }\n}\n\n/**\n * deserializeRpcv2cborValidationExceptionRes\n */\nconst de_ValidationExceptionRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<ValidationException> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new ValidationException({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborComplexErrorRes\n */\nconst de_ComplexErrorRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<ComplexError> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new ComplexError({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n/**\n * deserializeRpcv2cborInvalidGreetingRes\n */\nconst de_InvalidGreetingRes = async (\n  parsedOutput: any,\n  context: __SerdeContext\n): Promise<InvalidGreeting> => {\n  const body = parsedOutput.body\n  const deserialized: any = _json(body);\n  const exception = new InvalidGreeting({\n    $metadata: deserializeMetadata(parsedOutput),\n    ...deserialized\n  });\n  return __decorateServiceException(exception, body);\n};\n\n// se_ClientOptionalDefaults omitted.\n\n/**\n * serializeRpcv2cborDefaults\n */\nconst se_Defaults = (\n  input: Defaults,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'defaultBlob': [],\n    'defaultBoolean': [],\n    'defaultByte': [],\n    'defaultDouble': [],\n    'defaultEnum': [],\n    'defaultFloat': [],\n    'defaultIntEnum': [],\n    'defaultInteger': [],\n    'defaultList': _json,\n    'defaultLong': [],\n    'defaultMap': _json,\n    'defaultShort': [],\n    'defaultString': [],\n    'defaultTimestamp': __dateToTag,\n    'emptyBlob': [],\n    'emptyString': [],\n    'falseBoolean': [],\n    'zeroByte': [],\n    'zeroDouble': [],\n    'zeroFloat': [],\n    'zeroInteger': [],\n    'zeroLong': [],\n    'zeroShort': [],\n  });\n}\n\n// se_DenseBooleanMap omitted.\n\n// se_DenseNumberMap omitted.\n\n// se_DenseSetMap omitted.\n\n// se_DenseStringMap omitted.\n\n// se_DenseStructMap omitted.\n\n// se_EmptyStructure omitted.\n\n/**\n * serializeRpcv2cborOperationWithDefaultsInput\n */\nconst se_OperationWithDefaultsInput = (\n  input: OperationWithDefaultsInput,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'clientOptionalDefaults': _json,\n    'defaults': _ => se_Defaults(_, context),\n    'otherTopLevelDefault': [],\n    'topLevelDefault': [],\n  });\n}\n\n/**\n * serializeRpcv2cborRecursiveShapesInputOutput\n */\nconst se_RecursiveShapesInputOutput = (\n  input: RecursiveShapesInputOutput,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'nested': _ => se_RecursiveShapesInputOutputNested1(_, context),\n  });\n}\n\n/**\n * serializeRpcv2cborRecursiveShapesInputOutputNested1\n */\nconst se_RecursiveShapesInputOutputNested1 = (\n  input: RecursiveShapesInputOutputNested1,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'foo': [],\n    'nested': _ => se_RecursiveShapesInputOutputNested2(_, context),\n  });\n}\n\n/**\n * serializeRpcv2cborRecursiveShapesInputOutputNested2\n */\nconst se_RecursiveShapesInputOutputNested2 = (\n  input: RecursiveShapesInputOutputNested2,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'bar': [],\n    'recursiveMember': _ => se_RecursiveShapesInputOutputNested1(_, context),\n  });\n}\n\n// se_RpcV2CborDenseMapsInputOutput omitted.\n\n/**\n * serializeRpcv2cborRpcV2CborListInputOutput\n */\nconst se_RpcV2CborListInputOutput = (\n  input: RpcV2CborListInputOutput,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'blobList': _ => se_BlobList(_, context),\n    'booleanList': _json,\n    'enumList': _json,\n    'intEnumList': _json,\n    'integerList': _json,\n    'nestedStringList': _json,\n    'stringList': _json,\n    'stringSet': _json,\n    'structureList': _json,\n    'timestampList': _ => se_TimestampList(_, context),\n  });\n}\n\n/**\n * serializeRpcv2cborRpcV2CborSparseMapsInputOutput\n */\nconst se_RpcV2CborSparseMapsInputOutput = (\n  input: RpcV2CborSparseMapsInputOutput,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'sparseBooleanMap': _ => se_SparseBooleanMap(_, context),\n    'sparseNumberMap': _ => se_SparseNumberMap(_, context),\n    'sparseSetMap': _ => se_SparseSetMap(_, context),\n    'sparseStringMap': _ => se_SparseStringMap(_, context),\n    'sparseStructMap': _ => se_SparseStructMap(_, context),\n  });\n}\n\n/**\n * serializeRpcv2cborSimpleScalarStructure\n */\nconst se_SimpleScalarStructure = (\n  input: SimpleScalarStructure,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'blobValue': [],\n    'byteValue': [],\n    'doubleValue': [],\n    'falseBooleanValue': [],\n    'floatValue': [],\n    'integerValue': [],\n    'longValue': [],\n    'shortValue': [],\n    'stringValue': [],\n    'trueBooleanValue': [],\n  });\n}\n\n// se_SimpleStructure omitted.\n\n/**\n * serializeRpcv2cborSparseBooleanMap\n */\nconst se_SparseBooleanMap = (\n  input: Record<string, boolean | null>,\n  context: __SerdeContext\n): any => {\n  return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {\n    if (value !== null) {\n        acc[key] = value;\n    }\n\n    else {\n        acc[key] = null as any;\n    }\n\n    return acc;\n  }, {});\n}\n\n/**\n * serializeRpcv2cborSparseNullsOperationInputOutput\n */\nconst se_SparseNullsOperationInputOutput = (\n  input: SparseNullsOperationInputOutput,\n  context: __SerdeContext\n): any => {\n  return take(input, {\n    'sparseStringList': _ => se_SparseStringList(_, context),\n    'sparseStringMap': _ => se_SparseStringMap(_, context),\n  });\n}\n\n/**\n * serializeRpcv2cborSparseNumberMap\n */\nconst se_SparseNumberMap = (\n  input: Record<string, number | null>,\n  context: __SerdeContext\n): any => {\n  return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {\n    if (value !== null) {\n        acc[key] = value;\n    }\n\n    else {\n        acc[key] = null as any;\n    }\n\n    return acc;\n  }, {});\n}\n\n/**\n * serializeRpcv2cborSparseSetMap\n */\nconst se_SparseSetMap = (\n  input: Record<string, string[] | null>,\n  context: __SerdeContext\n): any => {\n  return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {\n    if (value !== null) {\n        acc[key] = _json(value);\n    }\n\n    else {\n        acc[key] = null as any;\n    }\n\n    return acc;\n  }, {});\n}\n\n/**\n * serializeRpcv2cborSparseStructMap\n */\nconst se_SparseStructMap = (\n  input: Record<string, GreetingStruct | null>,\n  context: __SerdeContext\n): any => {\n  return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {\n    if (value !== null) {\n        acc[key] = _json(value);\n    }\n\n    else {\n        acc[key] = null as any;\n    }\n\n    return acc;\n  }, {});\n}\n\n// se_StructureList omitted.\n\n// se_StructureListMember omitted.\n\n// se_TestStringList omitted.\n\n// se_TestStringMap omitted.\n\n/**\n * serializeRpcv2cborBlobList\n */\nconst se_BlobList = (\n  input: Uint8Array[],\n  context: __SerdeContext\n): any => {\n  return input.filter((e: any) => e != null);\n}\n\n// se_BooleanList omitted.\n\n// se_FooEnumList omitted.\n\n// se_GreetingStruct omitted.\n\n// se_IntegerEnumList omitted.\n\n// se_IntegerList omitted.\n\n// se_NestedStringList omitted.\n\n/**\n * serializeRpcv2cborSparseStringList\n */\nconst se_SparseStringList = (\n  input: (string | null)[],\n  context: __SerdeContext\n): any => {\n  return input;\n}\n\n/**\n * serializeRpcv2cborSparseStringMap\n */\nconst se_SparseStringMap = (\n  input: Record<string, string | null>,\n  context: __SerdeContext\n): any => {\n  return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {\n    if (value !== null) {\n        acc[key] = value;\n    }\n\n    else {\n        acc[key] = null as any;\n    }\n\n    return acc;\n  }, {});\n}\n\n// se_StringList omitted.\n\n// se_StringSet omitted.\n\n/**\n * serializeRpcv2cborTimestampList\n */\nconst se_TimestampList = (\n  input: Date[],\n  context: __SerdeContext\n): any => {\n  return input.filter((e: any) => e != null).map(entry => {\n    return __dateToTag(entry);\n  });\n}\n\n// de_ValidationException omitted.\n\n// de_ValidationExceptionField omitted.\n\n// de_ValidationExceptionFieldList omitted.\n\n// de_ComplexError omitted.\n\n// de_ComplexNestedErrorData omitted.\n\n// de_DenseBooleanMap omitted.\n\n// de_DenseNumberMap omitted.\n\n// de_DenseSetMap omitted.\n\n// de_DenseStringMap omitted.\n\n// de_DenseStructMap omitted.\n\n// de_EmptyStructure omitted.\n\n/**\n * deserializeRpcv2cborFloat16Output\n */\nconst de_Float16Output = (\n  output: any,\n  context: __SerdeContext\n): Float16Output => {\n  return take(output, {\n    'value': __limitedParseDouble,\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborFractionalSecondsOutput\n */\nconst de_FractionalSecondsOutput = (\n  output: any,\n  context: __SerdeContext\n): FractionalSecondsOutput => {\n  return take(output, {\n    'datetime': (_: any) => __expectNonNull(__parseEpochTimestamp(_)),\n  }) as any;\n}\n\n// de_GreetingWithErrorsOutput omitted.\n\n// de_InvalidGreeting omitted.\n\n/**\n * deserializeRpcv2cborOperationWithDefaultsOutput\n */\nconst de_OperationWithDefaultsOutput = (\n  output: any,\n  context: __SerdeContext\n): OperationWithDefaultsOutput => {\n  return take(output, {\n    'defaultBlob': [],\n    'defaultBoolean': __expectBoolean,\n    'defaultByte': __expectByte,\n    'defaultDouble': __limitedParseDouble,\n    'defaultEnum': __expectString,\n    'defaultFloat': __limitedParseFloat32,\n    'defaultIntEnum': __expectInt32,\n    'defaultInteger': __expectInt32,\n    'defaultList': _json,\n    'defaultLong': __expectLong,\n    'defaultMap': _json,\n    'defaultShort': __expectShort,\n    'defaultString': __expectString,\n    'defaultTimestamp': (_: any) => __expectNonNull(__parseEpochTimestamp(_)),\n    'emptyBlob': [],\n    'emptyString': __expectString,\n    'falseBoolean': __expectBoolean,\n    'zeroByte': __expectByte,\n    'zeroDouble': __limitedParseDouble,\n    'zeroFloat': __limitedParseFloat32,\n    'zeroInteger': __expectInt32,\n    'zeroLong': __expectLong,\n    'zeroShort': __expectShort,\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborRecursiveShapesInputOutput\n */\nconst de_RecursiveShapesInputOutput = (\n  output: any,\n  context: __SerdeContext\n): RecursiveShapesInputOutput => {\n  return take(output, {\n    'nested': (_: any) => de_RecursiveShapesInputOutputNested1(_, context),\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborRecursiveShapesInputOutputNested1\n */\nconst de_RecursiveShapesInputOutputNested1 = (\n  output: any,\n  context: __SerdeContext\n): RecursiveShapesInputOutputNested1 => {\n  return take(output, {\n    'foo': __expectString,\n    'nested': (_: any) => de_RecursiveShapesInputOutputNested2(_, context),\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborRecursiveShapesInputOutputNested2\n */\nconst de_RecursiveShapesInputOutputNested2 = (\n  output: any,\n  context: __SerdeContext\n): RecursiveShapesInputOutputNested2 => {\n  return take(output, {\n    'bar': __expectString,\n    'recursiveMember': (_: any) => de_RecursiveShapesInputOutputNested1(_, context),\n  }) as any;\n}\n\n// de_RpcV2CborDenseMapsInputOutput omitted.\n\n/**\n * deserializeRpcv2cborRpcV2CborListInputOutput\n */\nconst de_RpcV2CborListInputOutput = (\n  output: any,\n  context: __SerdeContext\n): RpcV2CborListInputOutput => {\n  return take(output, {\n    'blobList': (_: any) => de_BlobList(_, context),\n    'booleanList': _json,\n    'enumList': _json,\n    'intEnumList': _json,\n    'integerList': _json,\n    'nestedStringList': _json,\n    'stringList': _json,\n    'stringSet': _json,\n    'structureList': _json,\n    'timestampList': (_: any) => de_TimestampList(_, context),\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborRpcV2CborSparseMapsInputOutput\n */\nconst de_RpcV2CborSparseMapsInputOutput = (\n  output: any,\n  context: __SerdeContext\n): RpcV2CborSparseMapsInputOutput => {\n  return take(output, {\n    'sparseBooleanMap': (_: any) => de_SparseBooleanMap(_, context),\n    'sparseNumberMap': (_: any) => de_SparseNumberMap(_, context),\n    'sparseSetMap': (_: any) => de_SparseSetMap(_, context),\n    'sparseStringMap': (_: any) => de_SparseStringMap(_, context),\n    'sparseStructMap': (_: any) => de_SparseStructMap(_, context),\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborSimpleScalarStructure\n */\nconst de_SimpleScalarStructure = (\n  output: any,\n  context: __SerdeContext\n): SimpleScalarStructure => {\n  return take(output, {\n    'blobValue': [],\n    'byteValue': __expectByte,\n    'doubleValue': __limitedParseDouble,\n    'falseBooleanValue': __expectBoolean,\n    'floatValue': __limitedParseFloat32,\n    'integerValue': __expectInt32,\n    'longValue': __expectLong,\n    'shortValue': __expectShort,\n    'stringValue': __expectString,\n    'trueBooleanValue': __expectBoolean,\n  }) as any;\n}\n\n// de_SimpleStructure omitted.\n\n/**\n * deserializeRpcv2cborSparseBooleanMap\n */\nconst de_SparseBooleanMap = (\n  output: any,\n  context: __SerdeContext\n): Record<string, boolean | null> => {\n  return Object.entries(output).reduce((acc: Record<string, boolean | null>, [key, value]: [string, any]) => {\n    if (value !== null) {\n      acc[key as string] = __expectBoolean(value) as any;\n    }\n    else {\n      acc[key as string] = null as any;\n    }\n    return acc;\n\n  }, {} as Record<string, boolean | null>);}\n\n/**\n * deserializeRpcv2cborSparseNullsOperationInputOutput\n */\nconst de_SparseNullsOperationInputOutput = (\n  output: any,\n  context: __SerdeContext\n): SparseNullsOperationInputOutput => {\n  return take(output, {\n    'sparseStringList': (_: any) => de_SparseStringList(_, context),\n    'sparseStringMap': (_: any) => de_SparseStringMap(_, context),\n  }) as any;\n}\n\n/**\n * deserializeRpcv2cborSparseNumberMap\n */\nconst de_SparseNumberMap = (\n  output: any,\n  context: __SerdeContext\n): Record<string, number | null> => {\n  return Object.entries(output).reduce((acc: Record<string, number | null>, [key, value]: [string, any]) => {\n    if (value !== null) {\n      acc[key as string] = __expectInt32(value) as any;\n    }\n    else {\n      acc[key as string] = null as any;\n    }\n    return acc;\n\n  }, {} as Record<string, number | null>);}\n\n/**\n * deserializeRpcv2cborSparseSetMap\n */\nconst de_SparseSetMap = (\n  output: any,\n  context: __SerdeContext\n): Record<string, string[] | null> => {\n  return Object.entries(output).reduce((acc: Record<string, string[] | null>, [key, value]: [string, any]) => {\n    if (value !== null) {\n      acc[key as string] = _json(value);\n    }\n    else {\n      acc[key as string] = null as any;\n    }\n    return acc;\n\n  }, {} as Record<string, string[] | null>);}\n\n/**\n * deserializeRpcv2cborSparseStructMap\n */\nconst de_SparseStructMap = (\n  output: any,\n  context: __SerdeContext\n): Record<string, GreetingStruct | null> => {\n  return Object.entries(output).reduce((acc: Record<string, GreetingStruct | null>, [key, value]: [string, any]) => {\n    if (value !== null) {\n      acc[key as string] = _json(value);\n    }\n    else {\n      acc[key as string] = null as any;\n    }\n    return acc;\n\n  }, {} as Record<string, GreetingStruct | null>);}\n\n// de_StructureList omitted.\n\n// de_StructureListMember omitted.\n\n// de_TestStringList omitted.\n\n// de_TestStringMap omitted.\n\n/**\n * deserializeRpcv2cborBlobList\n */\nconst de_BlobList = (\n  output: any,\n  context: __SerdeContext\n): Uint8Array[] => {\n  const collection = (output || []).filter((e: any) => e != null)\n  return collection;\n}\n\n// de_BooleanList omitted.\n\n// de_FooEnumList omitted.\n\n// de_GreetingStruct omitted.\n\n// de_IntegerEnumList omitted.\n\n// de_IntegerList omitted.\n\n// de_NestedStringList omitted.\n\n/**\n * deserializeRpcv2cborSparseStringList\n */\nconst de_SparseStringList = (\n  output: any,\n  context: __SerdeContext\n): (string | null)[] => {\n  const collection = (output || []).map((entry: any) => {\n    if (entry === null) {\n      return null as any;\n    }\n    return __expectString(entry) as any;\n  });\n  return collection;\n}\n\n/**\n * deserializeRpcv2cborSparseStringMap\n */\nconst de_SparseStringMap = (\n  output: any,\n  context: __SerdeContext\n): Record<string, string | null> => {\n  return Object.entries(output).reduce((acc: Record<string, string | null>, [key, value]: [string, any]) => {\n    if (value !== null) {\n      acc[key as string] = __expectString(value) as any;\n    }\n    else {\n      acc[key as string] = null as any;\n    }\n    return acc;\n\n  }, {} as Record<string, string | null>);}\n\n// de_StringList omitted.\n\n// de_StringSet omitted.\n\n/**\n * deserializeRpcv2cborTimestampList\n */\nconst de_TimestampList = (\n  output: any,\n  context: __SerdeContext\n): Date[] => {\n  const collection = (output || []).filter((e: any) => e != null).map((entry: any) => {\n    return __expectNonNull(__parseEpochTimestamp(entry));\n  });\n  return collection;\n}\n\nconst deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({\n  httpStatusCode: output.statusCode,\n  requestId: output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"] ?? output.headers[\"x-amz-request-id\"],\n  extendedRequestId: output.headers[\"x-amz-id-2\"],\n  cfId: output.headers[\"x-amz-cf-id\"],\n});\n\nconst throwDefaultError = withBaseException(__BaseException);\nconst SHARED_HEADERS: __HeaderBag = {\n  'content-type': \"application/cbor\",\n  \"smithy-protocol\": \"rpc-v2-cbor\",\n  \"accept\": \"application/cbor\",\n\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/runtimeConfig.browser.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from \"@smithy/core/retry\";\nimport { calculateBodyLength } from \"@smithy/core/serde\";\nimport { FetchHttpHandler as RequestHandler, streamCollector } from \"@smithy/fetch-http-handler\";\n\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"browser\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),\n    sha256: config?.sha256 ?? Sha256,\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/runtimeConfig.native.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-js\";\n\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { getRuntimeConfig as getBrowserRuntimeConfig } from \"./runtimeConfig.browser\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  const browserDefaults = getBrowserRuntimeConfig(config);\n  return {\n    ...browserDefaults,\n    ...config,\n    runtime: \"react-native\",\n    sha256: config?.sha256 ?? Sha256,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/runtimeConfig.shared.ts",
    "content": "// smithy-typescript generated code\nimport { NoAuthSigner } from \"@smithy/core\";\nimport { NoOpLogger } from \"@smithy/core/client\";\nimport { parseUrl } from \"@smithy/core/protocols\";\nimport { fromBase64, fromUtf8, toBase64, toUtf8 } from \"@smithy/core/serde\";\nimport type { IdentityProviderConfig } from \"@smithy/types\";\n\nimport { defaultRpcV2ProtocolHttpAuthSchemeProvider } from \"./auth/httpAuthSchemeProvider\";\nimport { defaultEndpointResolver } from \"./endpoint/endpointResolver\";\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  return {\n    apiVersion: \"2020-07-14\",\n    base64Decoder: config?.base64Decoder ?? fromBase64,\n    base64Encoder: config?.base64Encoder ?? toBase64,\n    disableHostPrefix: config?.disableHostPrefix ?? false,\n    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,\n    extensions: config?.extensions ?? [],\n    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultRpcV2ProtocolHttpAuthSchemeProvider,\n    httpAuthSchemes: config?.httpAuthSchemes ?? [\n      {\n        schemeId: \"smithy.api#noAuth\",\n        identityProvider: (ipc: IdentityProviderConfig) =>\n          ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n        signer: new NoAuthSigner(),\n      },\n    ],\n    logger: config?.logger ?? new NoOpLogger(),\n    urlParser: config?.urlParser ?? parseUrl,\n    utf8Decoder: config?.utf8Decoder ?? fromUtf8,\n    utf8Encoder: config?.utf8Encoder ?? toUtf8,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/runtimeConfig.ts",
    "content": "// smithy-typescript generated code\nimport { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { loadConfig as loadNodeConfig, resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport {\n  DEFAULT_RETRY_MODE,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  NODE_RETRY_MODE_CONFIG_OPTIONS,\n} from \"@smithy/core/retry\";\nimport { calculateBodyLength, Hash } from \"@smithy/core/serde\";\nimport { NodeHttpHandler as RequestHandler, streamCollector } from \"@smithy/node-http-handler\";\n\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  emitWarningIfUnsupportedVersion(process.version);\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"node\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode:\n      config?.retryMode ??\n      loadNodeConfig(\n        {\n          ...NODE_RETRY_MODE_CONFIG_OPTIONS,\n          default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,\n        },\n        config\n      ),\n    sha256: config?.sha256 ?? Hash.bind(null, \"sha256\"),\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/src/runtimeExtensions.ts",
    "content": "// smithy-typescript generated code\nimport { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from \"@smithy/core/client\";\nimport { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from \"@smithy/core/protocols\";\n\nimport { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from \"./auth/httpAuthExtensionConfiguration\";\nimport type { RpcV2ProtocolExtensionConfiguration } from \"./extensionConfiguration\";\n\n/**\n * @public\n */\nexport interface RuntimeExtension {\n  configure(extensionConfiguration: RpcV2ProtocolExtensionConfiguration): void;\n}\n\n/**\n * @public\n */\nexport interface RuntimeExtensionsConfig {\n  extensions: RuntimeExtension[];\n}\n\n/**\n * @internal\n */\nexport const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {\n  const extensionConfiguration: RpcV2ProtocolExtensionConfiguration = Object.assign(\n    getDefaultExtensionConfiguration(runtimeConfig),\n    getHttpHandlerExtensionConfiguration(runtimeConfig),\n    getHttpAuthExtensionConfiguration(runtimeConfig)\n  );\n\n  extensions.forEach((extension) => extension.configure(extensionConfiguration));\n\n  return Object.assign(\n    runtimeConfig,\n    resolveDefaultRuntimeConfig(extensionConfiguration),\n    resolveHttpHandlerRuntimeConfig(extensionConfiguration),\n    resolveHttpAuthRuntimeConfig(extensionConfiguration)\n  );\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts",
    "content": "// smithy-typescript generated code\nimport { cbor } from \"@smithy/core/cbor\";\nimport { expect, test as it } from \"vitest\";\n\nimport { EmptyInputOutputCommand } from \"../../src/commands/EmptyInputOutputCommand\";\nimport { Float16Command } from \"../../src/commands/Float16Command\";\nimport { FractionalSecondsCommand } from \"../../src/commands/FractionalSecondsCommand\";\nimport { GreetingWithErrorsCommand } from \"../../src/commands/GreetingWithErrorsCommand\";\nimport { NoInputOutputCommand } from \"../../src/commands/NoInputOutputCommand\";\nimport { OperationWithDefaultsCommand } from \"../../src/commands/OperationWithDefaultsCommand\";\nimport { OptionalInputOutputCommand } from \"../../src/commands/OptionalInputOutputCommand\";\nimport { RecursiveShapesCommand } from \"../../src/commands/RecursiveShapesCommand\";\nimport { RpcV2CborDenseMapsCommand } from \"../../src/commands/RpcV2CborDenseMapsCommand\";\nimport { RpcV2CborListsCommand } from \"../../src/commands/RpcV2CborListsCommand\";\nimport { RpcV2CborSparseMapsCommand } from \"../../src/commands/RpcV2CborSparseMapsCommand\";\nimport { SimpleScalarPropertiesCommand } from \"../../src/commands/SimpleScalarPropertiesCommand\";\nimport { SparseNullsOperationCommand } from \"../../src/commands/SparseNullsOperationCommand\";\nimport { RpcV2ProtocolClient } from \"../../src/RpcV2ProtocolClient\";\nimport { Readable } from \"node:stream\";\nimport { HttpRequest, HttpResponse, type HttpHandler } from \"@smithy/core/protocols\";\nimport type { Endpoint, HeaderBag, HttpHandlerOptions } from \"@smithy/types\";\n\n/**\n * Throws an expected exception that contains the serialized request.\n */\nclass EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error {\n  constructor(readonly request: HttpRequest) {\n    super();\n  }\n}\n\n/**\n * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a\n * request. The thrown exception contains the serialized request.\n */\nclass RequestSerializationTestHandler implements HttpHandler {\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request));\n  }\n  updateHttpClientConfig(key: never, value: never): void {}\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\n/**\n * Returns a resolved Promise of the specified response contents.\n */\nclass ResponseDeserializationTestHandler implements HttpHandler {\n  isSuccess: boolean;\n  code: number;\n  headers: HeaderBag;\n  body: string | Uint8Array;\n  isBase64Body: boolean;\n\n  constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) {\n    this.isSuccess = isSuccess;\n    this.code = code;\n    if (headers === undefined) {\n      this.headers = {};\n    } else {\n      this.headers = headers;\n    }\n    if (body === undefined) {\n      body = \"\";\n    }\n    this.body = body;\n    this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), \"base64\").toString(\"base64\") === body;\n  }\n\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.resolve({\n      response: new HttpResponse({\n        statusCode: this.code,\n        headers: this.headers,\n        body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]),\n      }),\n    });\n  }\n\n  updateHttpClientConfig(key: never, value: never): void {}\n\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\ninterface comparableParts {\n  [key: string]: string;\n}\n\n/**\n * Generates a standard map of un-equal values given input parts.\n */\nconst compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => {\n  const unequalParts: any = {};\n  Object.keys(expectedParts).forEach((key) => {\n    if (generatedParts[key] === undefined) {\n      unequalParts[key] = { exp: expectedParts[key], gen: undefined };\n    } else if (!equivalentContents(expectedParts[key], generatedParts[key])) {\n      unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] };\n    }\n  });\n\n  Object.keys(generatedParts).forEach((key) => {\n    if (expectedParts[key] === undefined) {\n      unequalParts[key] = { exp: undefined, gen: generatedParts[key] };\n    }\n  });\n\n  if (Object.keys(unequalParts).length !== 0) {\n    return unequalParts;\n  }\n  return undefined;\n};\n\n/**\n * Compares all types for equivalent contents, doing nested\n * equality checks based on non-`$metadata`\n * properties that have defined values.\n */\nconst equivalentContents = (expected: any, generated: any): boolean => {\n  if (typeof (global as any).expect === \"function\") {\n    expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected));\n    return true;\n  }\n\n  let localExpected = expected;\n\n  // Short circuit on equality.\n  if (localExpected == generated) {\n    return true;\n  }\n\n  if (typeof expected !== \"object\") {\n    return expected === generated;\n  }\n\n  // If a test fails with an issue in the below 6 lines, it's likely\n  // due to an issue in the nestedness or existence of the property\n  // being compared.\n  delete localExpected[\"$metadata\"];\n  delete generated[\"$metadata\"];\n  Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]);\n  Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]);\n\n  const expectedProperties = Object.getOwnPropertyNames(localExpected);\n  const generatedProperties = Object.getOwnPropertyNames(generated);\n\n  // Short circuit on different property counts.\n  if (expectedProperties.length != generatedProperties.length) {\n    return false;\n  }\n\n  // Compare properties directly.\n  for (var index = 0; index < expectedProperties.length; index++) {\n    const propertyName = expectedProperties[index];\n    if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nconst clientParams = {\n  region: \"us-west-2\",\n  credentials: { accessKeyId: \"key\", secretAccessKey: \"secret\" },\n  apiKey: { apiKey: \"apiKey\" },\n  endpoint: {\n    url: new URL(\"https://localhost/\"),\n    headers: {\n      \"x-default-header\": [\"default-header-value\"],\n    },\n  },\n};\n\n/**\n * A wrapper function that shadows `fail` from jest-jasmine2\n * (jasmine2 was replaced with circus in > v27 as the default test runner)\n */\nconst fail = (error?: any): never => {\n  throw new Error(error);\n};\n\n/**\n * Hexadecimal to byteArray.\n */\nconst toBytes = (hex: string) => {\n  return Buffer.from(hex, \"base64\");\n};\n\nfunction normalizeByteArrayType(data: any) {\n  // normalize float32 errors\n  if (typeof data === \"number\") {\n    const u = new Uint8Array(4);\n    const dv = new DataView(u.buffer, u.byteOffset, u.byteLength);\n    dv.setFloat32(0, data);\n    return dv.getFloat32(0);\n  }\n  if (!data || typeof data !== \"object\") {\n    return data;\n  }\n  if (data instanceof Uint8Array) {\n    return Uint8Array.from(data);\n  }\n  if (data instanceof String || data instanceof Boolean || data instanceof Number) {\n    return data.valueOf();\n  }\n  const output = {} as any;\n  for (const key of Object.getOwnPropertyNames(data)) {\n    output[key] = normalizeByteArrayType(data[key]);\n  }\n  return output;\n}\n\n/**\n * When Input structure is empty we write CBOR equivalent of {}\n */\nit(\"empty_input:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new EmptyInputOutputCommand(\n    {\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/EmptyInputOutput\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(\n      r.headers[\"x-amz-target\"],\n      `Header key \"x-amz-target\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * When output structure is empty we write CBOR equivalent of {}\n */\nit(\"empty_output:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new EmptyInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * When output structure is empty the client should accept an empty body\n */\nit(\"empty_output_no_body:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      ``\n    ),\n  });\n\n  const params: any = {};\n  const command = new EmptyInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Ensures that clients can correctly parse float16 +Inf.\n */\nit(\"RpcV2CborFloat16Inf:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfl8AA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse float16 -Inf.\n */\nit(\"RpcV2CborFloat16NegInf:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfn8AA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: -Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse float16 NaN with high LSB.\n */\nit(\"RpcV2CborFloat16LSBNaN:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfl8AQ==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: NaN,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse float16 NaN with high MSB.\n */\nit(\"RpcV2CborFloat16MSBNaN:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfl+AA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: NaN,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse a subnormal float16.\n */\nit(\"RpcV2CborFloat16Subnormal:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1ZfkAUA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: 4.76837158203125E-6,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse timestamps with fractional seconds\n */\nit(\"RpcV2CborDateTimeWithFractionalSeconds:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2hkYXRldGltZcH7Qcw32zgPvnf/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new FractionalSecondsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      datetime: new Date(9.46845296123E8 * 1000),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Parses simple RpcV2 Cbor errors\n */\nit(\"RpcV2CborInvalidGreetingError:Error:GreetingWithErrors\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      false,\n      400,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZfX3R5cGV4LnNtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNJbnZhbGlkR3JlZXRpbmdnTWVzc2FnZWJIaf8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new GreetingWithErrorsCommand(params);\n\n  try {\n    await client.send(command);\n  } catch (err) {\n    if (err.name !== \"InvalidGreeting\") {\n      console.log(err);\n      fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`);\n      return;\n    }\n    const r: any = err;\n    expect(r.$metadata.httpStatusCode).toBe(400);\n    const paramsToValidate: any = [\n      {\n        message: \"Hi\",\n      },\n    ][0];\n    Object.keys(paramsToValidate).forEach((param) => {\n      expect(\n        r[param],\n        `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n      ).toBeDefined();\n      expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n    });\n    return;\n  }\n  fail(\"Expected an exception to be thrown from response\");\n});\n\n/**\n * Parses a complex error with no message member\n */\nit(\"RpcV2CborComplexError:Error:GreetingWithErrors\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      false,\n      400,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3JoVG9wTGV2ZWxpVG9wIGxldmVsZk5lc3RlZL9jRm9vY2Jhcv//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new GreetingWithErrorsCommand(params);\n\n  try {\n    await client.send(command);\n  } catch (err) {\n    if (err.name !== \"ComplexError\") {\n      console.log(err);\n      fail(`Expected a ComplexError to be thrown, got ${err.name} instead`);\n      return;\n    }\n    const r: any = err;\n    expect(r.$metadata.httpStatusCode).toBe(400);\n    const paramsToValidate: any = [\n      {\n        TopLevel: \"Top level\",\n        Nested: {\n          Foo: \"bar\",\n        },\n      },\n    ][0];\n    Object.keys(paramsToValidate).forEach((param) => {\n      expect(\n        r[param],\n        `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n      ).toBeDefined();\n      expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n    });\n    return;\n  }\n  fail(\"Expected an exception to be thrown from response\");\n});\n\nit(\"RpcV2CborEmptyComplexError:Error:GreetingWithErrors\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      false,\n      400,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3L/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new GreetingWithErrorsCommand(params);\n\n  try {\n    await client.send(command);\n  } catch (err) {\n    if (err.name !== \"ComplexError\") {\n      console.log(err);\n      fail(`Expected a ComplexError to be thrown, got ${err.name} instead`);\n      return;\n    }\n    const r: any = err;\n    expect(r.$metadata.httpStatusCode).toBe(400);\n    return;\n  }\n  fail(\"Expected an exception to be thrown from response\");\n});\n\n/**\n * Body is empty and no Content-Type header if no input\n */\nit(\"no_input:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new NoInputOutputCommand({});\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/NoInputOutput\");\n\n    expect(\n      r.headers[\"content-type\"],\n      `Header key \"content-type\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n    expect(\n      r.headers[\"x-amz-target\"],\n      `Header key \"x-amz-target\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(!r.body || r.body === `{}`).toBeTruthy();\n  }\n});\n\n/**\n * A `Content-Type` header should not be set if the response body is empty.\n */\nit(\"no_output:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      },\n      ``\n    ),\n  });\n\n  const params: any = {};\n  const command = new NoInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Clients should accept a CBOR empty struct if there is no output.\n */\nit(\"NoOutputClientAllowsEmptyCbor:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new NoInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Clients should accept an empty body if there is no output and\n * should not raise an error if the `Content-Type` header is set.\n */\nit(\"NoOutputClientAllowsEmptyBody:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      ``\n    ),\n  });\n\n  const params: any = {};\n  const command = new NoInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Client populates default values in input.\n */\nit.skip(\"RpcV2CborClientPopulatesDefaultValuesInInput:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      defaults: {\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2hkZWZhdWx0c79tZGVmYXVsdFN0cmluZ2JoaW5kZWZhdWx0Qm9vbGVhbvVrZGVmYXVsdExpc3Sf/3BkZWZhdWx0VGltZXN0YW1wwQBrZGVmYXVsdEJsb2JDYWJja2RlZmF1bHRCeXRlAWxkZWZhdWx0U2hvcnQBbmRlZmF1bHRJbnRlZ2VyCmtkZWZhdWx0TG9uZxhkbGRlZmF1bHRGbG9hdPo/gAAAbWRlZmF1bHREb3VibGX6P4AAAGpkZWZhdWx0TWFwv/9rZGVmYXVsdEVudW1jRk9PbmRlZmF1bHRJbnRFbnVtAWtlbXB0eVN0cmluZ2BsZmFsc2VCb29sZWFu9GllbXB0eUJsb2JAaHplcm9CeXRlAGl6ZXJvU2hvcnQAa3plcm9JbnRlZ2VyAGh6ZXJvTG9uZwBpemVyb0Zsb2F0+gAAAABqemVyb0RvdWJsZfoAAAAA//8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Client skips top level default values in input.\n */\nit.skip(\"RpcV2CborClientSkipsTopLevelDefaultValuesInInput:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Client uses explicitly provided member values over defaults\n */\nit.skip(\"RpcV2CborClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      defaults: {\n        defaultString: \"bye\",\n        defaultBoolean: true,\n        defaultList: [\n          \"a\",\n        ],\n        defaultTimestamp: new Date(1000),\n        defaultBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n        defaultByte: 2,\n        defaultShort: 2,\n        defaultInteger: 20,\n        defaultLong: 200,\n        defaultFloat: 2.0,\n        defaultDouble: 2.0,\n        defaultMap: {\n          name: \"Jack\",\n        } as any,\n        defaultEnum: \"BAR\",\n        defaultIntEnum: 2,\n        emptyString: \"foo\",\n        falseBoolean: true,\n        emptyBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n        zeroByte: 1,\n        zeroShort: 1,\n        zeroInteger: 1,\n        zeroLong: 1,\n        zeroFloat: 1.0,\n        zeroDouble: 1.0,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2hkZWZhdWx0c7dtZGVmYXVsdFN0cmluZ2NieWVuZGVmYXVsdEJvb2xlYW71a2RlZmF1bHRMaXN0gWFhcGRlZmF1bHRUaW1lc3RhbXDB+z/wAAAAAAAAa2RlZmF1bHRCbG9iQmhpa2RlZmF1bHRCeXRlAmxkZWZhdWx0U2hvcnQCbmRlZmF1bHRJbnRlZ2VyFGtkZWZhdWx0TG9uZxjIbGRlZmF1bHRGbG9hdPpAAAAAbWRlZmF1bHREb3VibGX7QAAAAAAAAABqZGVmYXVsdE1hcKFkbmFtZWRKYWNra2RlZmF1bHRFbnVtY0JBUm5kZWZhdWx0SW50RW51bQJrZW1wdHlTdHJpbmdjZm9vbGZhbHNlQm9vbGVhbvVpZW1wdHlCbG9iQmhpaHplcm9CeXRlAWl6ZXJvU2hvcnQBa3plcm9JbnRlZ2VyAWh6ZXJvTG9uZwFpemVyb0Zsb2F0+j+AAABqemVyb0RvdWJsZfs/8AAAAAAAAP8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Any time a value is provided for a member in the top level of input, it is used, regardless of if its the default.\n */\nit.skip(\"RpcV2CborClientUsesExplicitlyProvidedValuesInTopLevel:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      topLevelDefault: \"hi\",\n      otherTopLevelDefault: 0,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v290b3BMZXZlbERlZmF1bHRiaGl0b3RoZXJUb3BMZXZlbERlZmF1bHQA/w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored.\n */\nit.skip(\"RpcV2CborClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      clientOptionalDefaults: {\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v3ZjbGllbnRPcHRpb25hbERlZmF1bHRzoP8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Client populates default values when missing in response.\n */\nit.skip(\"RpcV2CborClientPopulatesDefaultsValuesWhenMissingInResponse:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new OperationWithDefaultsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      defaultString: \"hi\",\n      defaultBoolean: true,\n      defaultList: [\n      ],\n      defaultTimestamp: new Date(0 * 1000),\n      defaultBlob: Uint8Array.from(\"abc\", (c) => c.charCodeAt(0)),\n      defaultByte: 1,\n      defaultShort: 1,\n      defaultInteger: 10,\n      defaultLong: 100,\n      defaultFloat: 1.0,\n      defaultDouble: 1.0,\n      defaultMap: {\n      },\n      defaultEnum: \"FOO\",\n      defaultIntEnum: 1,\n      emptyString: \"\",\n      falseBoolean: false,\n      emptyBlob: Uint8Array.from(\"\", (c) => c.charCodeAt(0)),\n      zeroByte: 0,\n      zeroShort: 0,\n      zeroInteger: 0,\n      zeroLong: 0,\n      zeroFloat: 0.0,\n      zeroDouble: 0.0,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Client ignores default values if member values are present in the response.\n */\nit.skip(\"RpcV2CborClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v21kZWZhdWx0U3RyaW5nY2J5ZW5kZWZhdWx0Qm9vbGVhbvRrZGVmYXVsdExpc3SBYWFwZGVmYXVsdFRpbWVzdGFtcMH7QAAAAAAAAABrZGVmYXVsdEJsb2JCaGlrZGVmYXVsdEJ5dGUCbGRlZmF1bHRTaG9ydAJuZGVmYXVsdEludGVnZXIUa2RlZmF1bHRMb25nGMhsZGVmYXVsdEZsb2F0+kAAAABtZGVmYXVsdERvdWJsZftAAAAAAAAAAGpkZWZhdWx0TWFwoWRuYW1lZEphY2trZGVmYXVsdEVudW1jQkFSbmRlZmF1bHRJbnRFbnVtAmtlbXB0eVN0cmluZ2Nmb29sZmFsc2VCb29sZWFu9WllbXB0eUJsb2JCaGloemVyb0J5dGUBaXplcm9TaG9ydAFremVyb0ludGVnZXIBaHplcm9Mb25nAWl6ZXJvRmxvYXT6P4AAAGp6ZXJvRG91Ymxl+z/wAAAAAAAA/w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new OperationWithDefaultsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      defaultString: \"bye\",\n      defaultBoolean: false,\n      defaultList: [\n        \"a\",\n      ],\n      defaultTimestamp: new Date(2 * 1000),\n      defaultBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n      defaultByte: 2,\n      defaultShort: 2,\n      defaultInteger: 20,\n      defaultLong: 200,\n      defaultFloat: 2.0,\n      defaultDouble: 2.0,\n      defaultMap: {\n        name: \"Jack\",\n      },\n      defaultEnum: \"BAR\",\n      defaultIntEnum: 2,\n      emptyString: \"foo\",\n      falseBoolean: true,\n      emptyBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n      zeroByte: 1,\n      zeroShort: 1,\n      zeroInteger: 1,\n      zeroLong: 1,\n      zeroFloat: 1.0,\n      zeroDouble: 1.0,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * When input is empty we write CBOR equivalent of {}\n */\nit(\"optional_input:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OptionalInputOutputCommand(\n    {\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OptionalInputOutput\");\n\n    expect(\n      r.headers[\"x-amz-target\"],\n      `Header key \"x-amz-target\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * When output is empty we write CBOR equivalent of {}\n */\nit(\"optional_output:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new OptionalInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Serializes recursive structures\n */\nit(\"RpcV2CborRecursiveShapes:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RecursiveShapesCommand(\n    {\n      nested: {\n        foo: \"Foo1\",\n        nested: {\n          bar: \"Bar1\",\n          recursiveMember: {\n            foo: \"Foo2\",\n            nested: {\n              bar: \"Bar2\",\n            } as any,\n          } as any,\n        } as any,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RecursiveShapes\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes recursive structures\n */\nit(\"RpcV2CborRecursiveShapes:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RecursiveShapesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      nested: {\n        foo: \"Foo1\",\n        nested: {\n          bar: \"Bar1\",\n          recursiveMember: {\n            foo: \"Foo2\",\n            nested: {\n              bar: \"Bar2\",\n            },\n          },\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes recursive structures encoded using a map with definite length\n */\nit(\"RpcV2CborRecursiveShapesUsingDefiniteLength:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWZuZXN0ZWSiY2Zvb2RGb28xZm5lc3RlZKJjYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyomNmb29kRm9vMmZuZXN0ZWShY2JhcmRCYXIy`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RecursiveShapesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      nested: {\n        foo: \"Foo1\",\n        nested: {\n          bar: \"Bar1\",\n          recursiveMember: {\n            foo: \"Foo2\",\n            nested: {\n              bar: \"Bar2\",\n            },\n          },\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes maps\n */\nit(\"RpcV2CborMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborDenseMapsCommand(\n    {\n      denseStructMap: {\n        foo: {\n          hi: \"there\",\n        } as any,\n        baz: {\n          hi: \"bye\",\n        } as any,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborSerializesZeroValuesInMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborDenseMapsCommand(\n    {\n      denseNumberMap: {\n        x: 0,\n      } as any,\n      denseBooleanMap: {\n        x: false,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * A request that contains a dense map of sets.\n */\nit(\"RpcV2CborSerializesDenseSetMap:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborDenseMapsCommand(\n    {\n      denseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Deserializes maps\n */\nit(\"RpcV2CborMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborDenseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      denseStructMap: {\n        foo: {\n          hi: \"there\",\n        },\n        baz: {\n          hi: \"bye\",\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborDeserializesZeroValuesInMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborDenseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      denseNumberMap: {\n        x: 0,\n      },\n      denseBooleanMap: {\n        x: false,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * A response that contains a dense map of sets\n */\nit(\"RpcV2CborDeserializesDenseSetMap:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborDenseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      denseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes RpcV2 Cbor lists\n */\nit(\"RpcV2CborLists:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborListsCommand(\n    {\n      stringList: [\n        \"foo\",\n        \"bar\",\n      ],\n      stringSet: [\n        \"foo\",\n        \"bar\",\n      ],\n      integerList: [\n        1,\n        2,\n      ],\n      booleanList: [\n        true,\n        false,\n      ],\n      timestampList: [\n        new Date(1398796238000),\n        new Date(1398796238000),\n      ],\n      enumList: [\n        \"Foo\",\n        \"0\",\n      ],\n      intEnumList: [\n        1,\n        2,\n      ],\n      nestedStringList: [\n        [\n          \"foo\",\n          \"bar\",\n        ],\n        [\n          \"baz\",\n          \"qux\",\n        ],\n      ],\n      structureList: [\n        {\n          a: \"1\",\n          b: \"2\",\n        } as any,\n        {\n          a: \"3\",\n          b: \"4\",\n        } as any,\n      ],\n      blobList: [\n        Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n        Uint8Array.from(\"bar\", (c) => c.charCodeAt(0)),\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborLists\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2pzdHJpbmdMaXN0gmNmb29jYmFyaXN0cmluZ1NldIJjZm9vY2JhcmtpbnRlZ2VyTGlzdIIBAmtib29sZWFuTGlzdIL19G10aW1lc3RhbXBMaXN0gsH7QdTX+/OAAADB+0HU1/vzgAAAaGVudW1MaXN0gmNGb29hMGtpbnRFbnVtTGlzdIIBAnBuZXN0ZWRTdHJpbmdMaXN0goJjZm9vY2JhcoJjYmF6Y3F1eG1zdHJ1Y3R1cmVMaXN0gqJhYWExYWJhMqJhYWEzYWJhNGhibG9iTGlzdIJDZm9vQ2Jhcv8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes empty JSON lists\n */\nit(\"RpcV2CborListsEmpty:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborListsCommand(\n    {\n      stringList: [\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborLists\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2pzdHJpbmdMaXN0n///`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes empty JSON definite length lists\n */\nit(\"RpcV2CborListsEmptyUsingDefiniteLength:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborListsCommand(\n    {\n      stringList: [\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborLists\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `oWpzdHJpbmdMaXN0gA==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes RpcV2 Cbor lists\n */\nit(\"RpcV2CborLists:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2pzdHJpbmdMaXN0n2Nmb29jYmFy/2lzdHJpbmdTZXSfY2Zvb2NiYXL/a2ludGVnZXJMaXN0nwEC/2tib29sZWFuTGlzdJ/19P9tdGltZXN0YW1wTGlzdJ/B+0HU1/vzgAAAwftB1Nf784AAAP9oZW51bUxpc3SfY0Zvb2Ew/2tpbnRFbnVtTGlzdJ8BAv9wbmVzdGVkU3RyaW5nTGlzdJ+fY2Zvb2NiYXL/n2NiYXpjcXV4//9tc3RydWN0dXJlTGlzdJ+/YWFhMWFiYTL/v2FhYTNhYmE0//9oYmxvYkxpc3SfQ2Zvb0NiYXL//w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n        \"foo\",\n        \"bar\",\n      ],\n      stringSet: [\n        \"foo\",\n        \"bar\",\n      ],\n      integerList: [\n        1,\n        2,\n      ],\n      booleanList: [\n        true,\n        false,\n      ],\n      timestampList: [\n        new Date(1398796238 * 1000),\n        new Date(1398796238 * 1000),\n      ],\n      enumList: [\n        \"Foo\",\n        \"0\",\n      ],\n      intEnumList: [\n        1,\n        2,\n      ],\n      nestedStringList: [\n        [\n          \"foo\",\n          \"bar\",\n        ],\n        [\n          \"baz\",\n          \"qux\",\n        ],\n      ],\n      structureList: [\n        {\n          a: \"1\",\n          b: \"2\",\n        },\n        {\n          a: \"3\",\n          b: \"4\",\n        },\n      ],\n      blobList: [\n        Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n        Uint8Array.from(\"bar\", (c) => c.charCodeAt(0)),\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes empty RpcV2 Cbor lists\n */\nit(\"RpcV2CborListsEmpty:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2pzdHJpbmdMaXN0n///`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Can deserialize indefinite length text strings inside an indefinite length list\n */\nit(\"RpcV2CborIndefiniteStringInsideIndefiniteListCanDeserialize:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2pzdHJpbmdMaXN0n394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n//8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n        \"An example indefinite string, which will be chunked, on each comma\",\n        \"Another example indefinite string with only one chunk\",\n        \"This is a plain string\",\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Can deserialize indefinite length text strings inside a definite length list\n */\nit(\"RpcV2CborIndefiniteStringInsideDefiniteListCanDeserialize:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWpzdHJpbmdMaXN0g394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n        \"An example indefinite string, which will be chunked, on each comma\",\n        \"Another example indefinite string with only one chunk\",\n        \"This is a plain string\",\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes sparse maps\n */\nit(\"RpcV2CborSparseMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseStructMap: {\n        foo: {\n          hi: \"there\",\n        } as any,\n        baz: {\n          hi: \"bye\",\n        } as any,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes null map values in sparse maps\n */\nit(\"RpcV2CborSerializesNullMapValues:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseBooleanMap: {\n        x: null,\n      } as any,\n      sparseNumberMap: {\n        x: null,\n      } as any,\n      sparseStringMap: {\n        x: null,\n      } as any,\n      sparseStructMap: {\n        x: null,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * A request that contains a sparse map of sets\n */\nit(\"RpcV2CborSerializesSparseSetMap:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL///8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * A request that contains a sparse map of sets.\n */\nit(\"RpcV2CborSerializesSparseSetMapAndRetainsNull:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n        z: null,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborSerializesZeroValuesInSparseMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseNumberMap: {\n        x: 0,\n      } as any,\n      sparseBooleanMap: {\n        x: false,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Deserializes sparse maps\n */\nit(\"RpcV2CborSparseJsonMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseStructMap: {\n        foo: {\n          hi: \"there\",\n        },\n        baz: {\n          hi: \"bye\",\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes null map values\n */\nit(\"RpcV2CborDeserializesNullMapValues:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseBooleanMap: {\n        x: null,\n      },\n      sparseNumberMap: {\n        x: null,\n      },\n      sparseStringMap: {\n        x: null,\n      },\n      sparseStructMap: {\n        x: null,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * A response that contains a sparse map of sets\n */\nit(\"RpcV2CborDeserializesSparseSetMap:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2xzcGFyc2VTZXRNYXC/YXmfYWFhYv9heJ////8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * A response that contains a sparse map of sets with a null\n */\nit(\"RpcV2CborDeserializesSparseSetMapAndRetainsNull:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n        z: null,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborDeserializesZeroValuesInSparseMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseNumberMap: {\n        x: 0,\n      },\n      sparseBooleanMap: {\n        x: false,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes simple scalar properties\n */\nit(\"RpcV2CborSimpleScalarProperties:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      byteValue: 5,\n      doubleValue: 1.889,\n      falseBooleanValue: false,\n      floatValue: 7.625,\n      integerValue: 256,\n      longValue: 9873,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      trueBooleanValue: true,\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * RpcV2 Cbor should not serialize null structure values\n */\nit(\"RpcV2CborClientDoesntSerializeNullStructureValues:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      stringValue: null,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Supports handling NaN float values.\n */\nit(\"RpcV2CborSupportsNaNFloatInputs:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      doubleValue: NaN,\n      floatValue: NaN,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Supports handling Infinity float values.\n */\nit(\"RpcV2CborSupportsInfinityFloatInputs:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      doubleValue: Infinity,\n      floatValue: Infinity,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Supports handling Infinity float values.\n */\nit(\"RpcV2CborSupportsNegativeInfinityFloatInputs:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      doubleValue: -Infinity,\n      floatValue: -Infinity,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes simple scalar properties\n */\nit(\"RpcV2CborSimpleScalarProperties:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb2//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      trueBooleanValue: true,\n      falseBooleanValue: false,\n      byteValue: 5,\n      doubleValue: 1.889,\n      floatValue: 7.625,\n      integerValue: 256,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes simple scalar properties encoded using a map with definite length\n */\nit(\"RpcV2CborSimpleScalarPropertiesUsingDefiniteLength:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `qXB0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb28=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      trueBooleanValue: true,\n      falseBooleanValue: false,\n      byteValue: 5,\n      doubleValue: 1.889,\n      floatValue: 7.625,\n      integerValue: 256,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * RpcV2 Cbor should not deserialize null structure values\n */\nit(\"RpcV2CborClientDoesntDeserializeNullStructureValues:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tzdHJpbmdWYWx1Zfb/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Supports handling NaN float values.\n */\nit(\"RpcV2CborSupportsNaNFloatOutputs:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: NaN,\n      floatValue: NaN,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Supports handling Infinity float values.\n */\nit(\"RpcV2CborSupportsInfinityFloatOutputs:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: Infinity,\n      floatValue: Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Supports handling Negative Infinity float values.\n */\nit(\"RpcV2CborSupportsNegativeInfinityFloatOutputs:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: -Infinity,\n      floatValue: -Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Supports upcasting from a smaller byte representation of the same data type.\n */\nit(\"RpcV2CborSupportsUpcastingDataOnDeserialize:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zfk+AGpmbG9hdFZhbHVl+UegbGludGVnZXJWYWx1ZRg4aWxvbmdWYWx1ZRkBAGpzaG9ydFZhbHVlCv8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: 1.5,\n      floatValue: 7.625,\n      integerValue: 56,\n      longValue: 256,\n      shortValue: 10,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * The client should skip over additional fields that are not part of the structure. This allows a\n * client generated against an older Smithy model to be able to communicate with a server that is\n * generated against a newer Smithy model.\n */\nit(\"RpcV2CborExtraFieldsInTheBodyShouldBeSkippedByClients:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABrZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      byteValue: 5,\n      doubleValue: 1.889,\n      falseBooleanValue: false,\n      floatValue: 7.625,\n      integerValue: 256,\n      longValue: 9873,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      trueBooleanValue: true,\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes null values in maps\n */\nit(\"RpcV2CborSparseMapsSerializeNullValues:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SparseNullsOperationCommand(\n    {\n      sparseStringMap: {\n        foo: null,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SparseNullsOperation\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes null values in lists\n */\nit(\"RpcV2CborSparseListsSerializeNull:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SparseNullsOperationCommand(\n    {\n      sparseStringList: [\n        null,\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SparseNullsOperation\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Deserializes null values in maps\n */\nit(\"RpcV2CborSparseMapsDeserializeNullValues:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SparseNullsOperationCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseStringMap: {\n        foo: null,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes null values in lists\n */\nit(\"RpcV2CborSparseListsDeserializeNull:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SparseNullsOperationCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseStringList: [\n        null,\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\nconst compareEquivalentCborBodies = (expectedBody: string, generatedBody: string | Uint8Array): undefined => {\n  expect(\n    normalizeByteArrayType(cbor.deserialize(typeof generatedBody === \"string\" ? toBytes(generatedBody) : generatedBody))\n  ).toEqual(normalizeByteArrayType(cbor.deserialize(toBytes(expectedBody))));\n  return undefined;\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/test/index-objects.spec.mjs",
    "content": "import {\n  ComplexError,\n  EmptyInputOutputCommand,\n  Float16Command,\n  FooEnum,\n  FractionalSecondsCommand,\n  GreetingWithErrorsCommand,\n  IntegerEnum,\n  InvalidGreeting,\n  NoInputOutputCommand,\n  OperationWithDefaultsCommand,\n  OptionalInputOutputCommand,\n  RecursiveShapesCommand,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborListsCommand,\n  RpcV2CborSparseMapsCommand,\n  RpcV2Protocol,\n  RpcV2ProtocolClient,\n  RpcV2ProtocolServiceException,\n  SimpleScalarPropertiesCommand,\n  SparseNullsOperationCommand,\n  TestEnum,\n  TestIntEnum,\n  ValidationException,\n} from \"../dist-cjs/index.js\";\nimport assert from \"node:assert\";\n// clients\nassert(typeof RpcV2ProtocolClient === \"function\");\nassert(typeof RpcV2Protocol === \"function\");\n// commands\nassert(typeof EmptyInputOutputCommand === \"function\");\nassert(typeof Float16Command === \"function\");\nassert(typeof FractionalSecondsCommand === \"function\");\nassert(typeof GreetingWithErrorsCommand === \"function\");\nassert(typeof NoInputOutputCommand === \"function\");\nassert(typeof OperationWithDefaultsCommand === \"function\");\nassert(typeof OptionalInputOutputCommand === \"function\");\nassert(typeof RecursiveShapesCommand === \"function\");\nassert(typeof RpcV2CborDenseMapsCommand === \"function\");\nassert(typeof RpcV2CborListsCommand === \"function\");\nassert(typeof RpcV2CborSparseMapsCommand === \"function\");\nassert(typeof SimpleScalarPropertiesCommand === \"function\");\nassert(typeof SparseNullsOperationCommand === \"function\");\n// structural schemas\n// enums\nassert(typeof TestEnum === \"object\");\nassert(typeof TestIntEnum === \"object\");\nassert(typeof FooEnum === \"object\");\nassert(typeof IntegerEnum === \"object\");\n// errors\nassert(ValidationException.prototype instanceof RpcV2ProtocolServiceException);\nassert(ComplexError.prototype instanceof RpcV2ProtocolServiceException);\nassert(InvalidGreeting.prototype instanceof RpcV2ProtocolServiceException);\nassert(RpcV2ProtocolServiceException.prototype instanceof Error);\nconsole.log(`RpcV2Protocol index test passed.`);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/test/index-types.ts",
    "content": "// smithy-typescript generated code\nexport type {\n  RpcV2ProtocolClient,\n  RpcV2Protocol,\n  EmptyInputOutputCommand,\n  EmptyInputOutputCommandInput,\n  EmptyInputOutputCommandOutput,\n  Float16Command,\n  Float16CommandInput,\n  Float16CommandOutput,\n  FractionalSecondsCommand,\n  FractionalSecondsCommandInput,\n  FractionalSecondsCommandOutput,\n  GreetingWithErrorsCommand,\n  GreetingWithErrorsCommandInput,\n  GreetingWithErrorsCommandOutput,\n  NoInputOutputCommand,\n  NoInputOutputCommandInput,\n  NoInputOutputCommandOutput,\n  OperationWithDefaultsCommand,\n  OperationWithDefaultsCommandInput,\n  OperationWithDefaultsCommandOutput,\n  OptionalInputOutputCommand,\n  OptionalInputOutputCommandInput,\n  OptionalInputOutputCommandOutput,\n  RecursiveShapesCommand,\n  RecursiveShapesCommandInput,\n  RecursiveShapesCommandOutput,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborDenseMapsCommandInput,\n  RpcV2CborDenseMapsCommandOutput,\n  RpcV2CborListsCommand,\n  RpcV2CborListsCommandInput,\n  RpcV2CborListsCommandOutput,\n  RpcV2CborSparseMapsCommand,\n  RpcV2CborSparseMapsCommandInput,\n  RpcV2CborSparseMapsCommandOutput,\n  SimpleScalarPropertiesCommand,\n  SimpleScalarPropertiesCommandInput,\n  SimpleScalarPropertiesCommandOutput,\n  SparseNullsOperationCommand,\n  SparseNullsOperationCommandInput,\n  SparseNullsOperationCommandOutput,\n  TestEnum,\n  TestIntEnum,\n  FooEnum,\n  IntegerEnum,\n  ValidationExceptionField,\n  ClientOptionalDefaults,\n  ComplexNestedErrorData,\n  Defaults,\n  EmptyStructure,\n  Float16Output,\n  FractionalSecondsOutput,\n  GreetingWithErrorsOutput,\n  OperationWithDefaultsInput,\n  OperationWithDefaultsOutput,\n  RecursiveShapesInputOutput,\n  RecursiveShapesInputOutputNested1,\n  RecursiveShapesInputOutputNested2,\n  RpcV2CborDenseMapsInputOutput,\n  RpcV2CborListInputOutput,\n  RpcV2CborSparseMapsInputOutput,\n  SimpleScalarStructure,\n  SimpleStructure,\n  SparseNullsOperationInputOutput,\n  StructureListMember,\n  GreetingStruct,\n  ValidationException,\n  ComplexError,\n  InvalidGreeting,\n  RpcV2ProtocolServiceException,\n} from \"../dist-types/index.d\";\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist-cjs\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"lib\": [\"dom\"],\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"outDir\": \"dist-es\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/tsconfig.json",
    "content": "{\n  \"extends\": \"@tsconfig/node20/tsconfig.json\",\n  \"compilerOptions\": {\n    \"downlevelIteration\": true,\n    \"importHelpers\": true,\n    \"incremental\": true,\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"rootDir\": \"src\",\n    \"useUnknownInCatchVariables\": false\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist-types\",\n    \"emitDeclarationOnly\": true,\n    \"noCheck\": false\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    globals: true,\n  },\n});\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/package.json",
    "content": "{\n  \"name\": \"@smithy/smithy-rpcv2-cbor-schema\",\n  \"description\": \"@smithy/smithy-rpcv2-cbor-schema client\",\n  \"version\": \"1.0.0-alpha.1\",\n  \"scripts\": {\n    \"build\": \"concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"downlevel-dts dist-types dist-types/ts3.4\",\n    \"test:index\": \"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"prepack\": \"npm run clean && npm run build\",\n    \"test\": \"npx vitest run --passWithNoTests\",\n    \"test:watch\": \"npx vitest watch --passWithNoTests\",\n    \"test:integration\": \"npx vitest run --passWithNoTests -c vitest.config.integ.mts\",\n    \"test:integration:watch\": \"npx vitest watch --passWithNoTests -c vitest.config.integ.mts\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"module\": \"./dist-es/index.js\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@aws-crypto/sha256-browser\": \"5.2.0\",\n    \"@aws-crypto/sha256-js\": \"5.2.0\",\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/fetch-http-handler\": \"workspace:^\",\n    \"@smithy/node-http-handler\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@smithy/snapshot-testing\": \"workspace:^\",\n    \"@tsconfig/node20\": \"20.1.8\",\n    \"@types/node\": \"^20.14.8\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\",\n    \"vitest\": \"^4.0.17\"\n  },\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\n        \"dist-types/ts3.4/*\"\n      ]\n    }\n  },\n  \"files\": [\n    \"dist-*/**\"\n  ],\n  \"author\": {\n    \"name\": \"Smithy team\",\n    \"url\": \"https://smithy.io/\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"browser\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.browser\"\n  },\n  \"react-native\": {\n    \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.native\"\n  },\n  \"private\": true\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/RpcV2Protocol.ts",
    "content": "// smithy-typescript generated code\nimport { createAggregatedClient } from \"@smithy/core/client\";\nimport type { HttpHandlerOptions as __HttpHandlerOptions } from \"@smithy/types\";\n\nimport {\n  type EmptyInputOutputCommandInput,\n  type EmptyInputOutputCommandOutput,\n  EmptyInputOutputCommand,\n} from \"./commands/EmptyInputOutputCommand\";\nimport { type Float16CommandInput, type Float16CommandOutput, Float16Command } from \"./commands/Float16Command\";\nimport {\n  type FractionalSecondsCommandInput,\n  type FractionalSecondsCommandOutput,\n  FractionalSecondsCommand,\n} from \"./commands/FractionalSecondsCommand\";\nimport {\n  type GreetingWithErrorsCommandInput,\n  type GreetingWithErrorsCommandOutput,\n  GreetingWithErrorsCommand,\n} from \"./commands/GreetingWithErrorsCommand\";\nimport {\n  type NoInputOutputCommandInput,\n  type NoInputOutputCommandOutput,\n  NoInputOutputCommand,\n} from \"./commands/NoInputOutputCommand\";\nimport {\n  type OperationWithDefaultsCommandInput,\n  type OperationWithDefaultsCommandOutput,\n  OperationWithDefaultsCommand,\n} from \"./commands/OperationWithDefaultsCommand\";\nimport {\n  type OptionalInputOutputCommandInput,\n  type OptionalInputOutputCommandOutput,\n  OptionalInputOutputCommand,\n} from \"./commands/OptionalInputOutputCommand\";\nimport {\n  type RecursiveShapesCommandInput,\n  type RecursiveShapesCommandOutput,\n  RecursiveShapesCommand,\n} from \"./commands/RecursiveShapesCommand\";\nimport {\n  type RpcV2CborDenseMapsCommandInput,\n  type RpcV2CborDenseMapsCommandOutput,\n  RpcV2CborDenseMapsCommand,\n} from \"./commands/RpcV2CborDenseMapsCommand\";\nimport {\n  type RpcV2CborListsCommandInput,\n  type RpcV2CborListsCommandOutput,\n  RpcV2CborListsCommand,\n} from \"./commands/RpcV2CborListsCommand\";\nimport {\n  type RpcV2CborSparseMapsCommandInput,\n  type RpcV2CborSparseMapsCommandOutput,\n  RpcV2CborSparseMapsCommand,\n} from \"./commands/RpcV2CborSparseMapsCommand\";\nimport {\n  type SimpleScalarPropertiesCommandInput,\n  type SimpleScalarPropertiesCommandOutput,\n  SimpleScalarPropertiesCommand,\n} from \"./commands/SimpleScalarPropertiesCommand\";\nimport {\n  type SparseNullsOperationCommandInput,\n  type SparseNullsOperationCommandOutput,\n  SparseNullsOperationCommand,\n} from \"./commands/SparseNullsOperationCommand\";\nimport { RpcV2ProtocolClient } from \"./RpcV2ProtocolClient\";\n\nconst commands = {\n  EmptyInputOutputCommand,\n  Float16Command,\n  FractionalSecondsCommand,\n  GreetingWithErrorsCommand,\n  NoInputOutputCommand,\n  OperationWithDefaultsCommand,\n  OptionalInputOutputCommand,\n  RecursiveShapesCommand,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborListsCommand,\n  RpcV2CborSparseMapsCommand,\n  SimpleScalarPropertiesCommand,\n  SparseNullsOperationCommand,\n};\n\nexport interface RpcV2Protocol {\n  /**\n   * @see {@link EmptyInputOutputCommand}\n   */\n  emptyInputOutput(): Promise<EmptyInputOutputCommandOutput>;\n  emptyInputOutput(\n    args: EmptyInputOutputCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<EmptyInputOutputCommandOutput>;\n  emptyInputOutput(\n    args: EmptyInputOutputCommandInput,\n    cb: (err: any, data?: EmptyInputOutputCommandOutput) => void\n  ): void;\n  emptyInputOutput(\n    args: EmptyInputOutputCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: EmptyInputOutputCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link Float16Command}\n   */\n  float16(): Promise<Float16CommandOutput>;\n  float16(\n    args: Float16CommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<Float16CommandOutput>;\n  float16(\n    args: Float16CommandInput,\n    cb: (err: any, data?: Float16CommandOutput) => void\n  ): void;\n  float16(\n    args: Float16CommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: Float16CommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link FractionalSecondsCommand}\n   */\n  fractionalSeconds(): Promise<FractionalSecondsCommandOutput>;\n  fractionalSeconds(\n    args: FractionalSecondsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<FractionalSecondsCommandOutput>;\n  fractionalSeconds(\n    args: FractionalSecondsCommandInput,\n    cb: (err: any, data?: FractionalSecondsCommandOutput) => void\n  ): void;\n  fractionalSeconds(\n    args: FractionalSecondsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: FractionalSecondsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link GreetingWithErrorsCommand}\n   */\n  greetingWithErrors(): Promise<GreetingWithErrorsCommandOutput>;\n  greetingWithErrors(\n    args: GreetingWithErrorsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<GreetingWithErrorsCommandOutput>;\n  greetingWithErrors(\n    args: GreetingWithErrorsCommandInput,\n    cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void\n  ): void;\n  greetingWithErrors(\n    args: GreetingWithErrorsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: GreetingWithErrorsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link NoInputOutputCommand}\n   */\n  noInputOutput(): Promise<NoInputOutputCommandOutput>;\n  noInputOutput(\n    args: NoInputOutputCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<NoInputOutputCommandOutput>;\n  noInputOutput(\n    args: NoInputOutputCommandInput,\n    cb: (err: any, data?: NoInputOutputCommandOutput) => void\n  ): void;\n  noInputOutput(\n    args: NoInputOutputCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: NoInputOutputCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link OperationWithDefaultsCommand}\n   */\n  operationWithDefaults(): Promise<OperationWithDefaultsCommandOutput>;\n  operationWithDefaults(\n    args: OperationWithDefaultsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<OperationWithDefaultsCommandOutput>;\n  operationWithDefaults(\n    args: OperationWithDefaultsCommandInput,\n    cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void\n  ): void;\n  operationWithDefaults(\n    args: OperationWithDefaultsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: OperationWithDefaultsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link OptionalInputOutputCommand}\n   */\n  optionalInputOutput(): Promise<OptionalInputOutputCommandOutput>;\n  optionalInputOutput(\n    args: OptionalInputOutputCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<OptionalInputOutputCommandOutput>;\n  optionalInputOutput(\n    args: OptionalInputOutputCommandInput,\n    cb: (err: any, data?: OptionalInputOutputCommandOutput) => void\n  ): void;\n  optionalInputOutput(\n    args: OptionalInputOutputCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: OptionalInputOutputCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RecursiveShapesCommand}\n   */\n  recursiveShapes(): Promise<RecursiveShapesCommandOutput>;\n  recursiveShapes(\n    args: RecursiveShapesCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RecursiveShapesCommandOutput>;\n  recursiveShapes(\n    args: RecursiveShapesCommandInput,\n    cb: (err: any, data?: RecursiveShapesCommandOutput) => void\n  ): void;\n  recursiveShapes(\n    args: RecursiveShapesCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RecursiveShapesCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RpcV2CborDenseMapsCommand}\n   */\n  rpcV2CborDenseMaps(): Promise<RpcV2CborDenseMapsCommandOutput>;\n  rpcV2CborDenseMaps(\n    args: RpcV2CborDenseMapsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RpcV2CborDenseMapsCommandOutput>;\n  rpcV2CborDenseMaps(\n    args: RpcV2CborDenseMapsCommandInput,\n    cb: (err: any, data?: RpcV2CborDenseMapsCommandOutput) => void\n  ): void;\n  rpcV2CborDenseMaps(\n    args: RpcV2CborDenseMapsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RpcV2CborDenseMapsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RpcV2CborListsCommand}\n   */\n  rpcV2CborLists(): Promise<RpcV2CborListsCommandOutput>;\n  rpcV2CborLists(\n    args: RpcV2CborListsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RpcV2CborListsCommandOutput>;\n  rpcV2CborLists(\n    args: RpcV2CborListsCommandInput,\n    cb: (err: any, data?: RpcV2CborListsCommandOutput) => void\n  ): void;\n  rpcV2CborLists(\n    args: RpcV2CborListsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RpcV2CborListsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link RpcV2CborSparseMapsCommand}\n   */\n  rpcV2CborSparseMaps(): Promise<RpcV2CborSparseMapsCommandOutput>;\n  rpcV2CborSparseMaps(\n    args: RpcV2CborSparseMapsCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<RpcV2CborSparseMapsCommandOutput>;\n  rpcV2CborSparseMaps(\n    args: RpcV2CborSparseMapsCommandInput,\n    cb: (err: any, data?: RpcV2CborSparseMapsCommandOutput) => void\n  ): void;\n  rpcV2CborSparseMaps(\n    args: RpcV2CborSparseMapsCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: RpcV2CborSparseMapsCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link SimpleScalarPropertiesCommand}\n   */\n  simpleScalarProperties(): Promise<SimpleScalarPropertiesCommandOutput>;\n  simpleScalarProperties(\n    args: SimpleScalarPropertiesCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<SimpleScalarPropertiesCommandOutput>;\n  simpleScalarProperties(\n    args: SimpleScalarPropertiesCommandInput,\n    cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void\n  ): void;\n  simpleScalarProperties(\n    args: SimpleScalarPropertiesCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: SimpleScalarPropertiesCommandOutput) => void\n  ): void;\n\n  /**\n   * @see {@link SparseNullsOperationCommand}\n   */\n  sparseNullsOperation(): Promise<SparseNullsOperationCommandOutput>;\n  sparseNullsOperation(\n    args: SparseNullsOperationCommandInput,\n    options?: __HttpHandlerOptions\n  ): Promise<SparseNullsOperationCommandOutput>;\n  sparseNullsOperation(\n    args: SparseNullsOperationCommandInput,\n    cb: (err: any, data?: SparseNullsOperationCommandOutput) => void\n  ): void;\n  sparseNullsOperation(\n    args: SparseNullsOperationCommandInput,\n    options: __HttpHandlerOptions,\n    cb: (err: any, data?: SparseNullsOperationCommandOutput) => void\n  ): void;\n}\n\n/**\n * @public\n */\nexport class RpcV2Protocol extends RpcV2ProtocolClient implements RpcV2Protocol {}\ncreateAggregatedClient(commands, RpcV2Protocol);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/RpcV2ProtocolClient.ts",
    "content": "// smithy-typescript generated code\nimport {\n  DefaultIdentityProviderConfig,\n  getHttpAuthSchemeEndpointRuleSetPlugin,\n  getHttpSigningPlugin,\n} from \"@smithy/core\";\nimport {\n  type DefaultsMode as __DefaultsMode,\n  type SmithyConfiguration as __SmithyConfiguration,\n  type SmithyResolvedConfiguration as __SmithyResolvedConfiguration,\n  Client as __Client,\n} from \"@smithy/core/client\";\nimport {\n  type EndpointInputConfig,\n  type EndpointRequiredInputConfig,\n  type EndpointRequiredResolvedConfig,\n  type EndpointResolvedConfig,\n  resolveEndpointConfig,\n  resolveEndpointRequiredConfig,\n} from \"@smithy/core/endpoints\";\nimport { type HttpHandlerUserInput as __HttpHandlerUserInput, getContentLengthPlugin } from \"@smithy/core/protocols\";\nimport {\n  type RetryInputConfig,\n  type RetryResolvedConfig,\n  getRetryPlugin,\n  resolveRetryConfig,\n} from \"@smithy/core/retry\";\nimport { getSchemaSerdePlugin } from \"@smithy/core/schema\";\nimport type {\n  BodyLengthCalculator as __BodyLengthCalculator,\n  CheckOptionalClientConfig as __CheckOptionalClientConfig,\n  ChecksumConstructor as __ChecksumConstructor,\n  Decoder as __Decoder,\n  Encoder as __Encoder,\n  HashConstructor as __HashConstructor,\n  HttpHandlerOptions as __HttpHandlerOptions,\n  Logger as __Logger,\n  Provider as __Provider,\n  StreamCollector as __StreamCollector,\n  UrlParser as __UrlParser,\n} from \"@smithy/types\";\n\nimport {\n  type HttpAuthSchemeInputConfig,\n  type HttpAuthSchemeResolvedConfig,\n  defaultRpcV2ProtocolHttpAuthSchemeParametersProvider,\n  resolveHttpAuthSchemeConfig,\n} from \"./auth/httpAuthSchemeProvider\";\nimport type { EmptyInputOutputCommandInput, EmptyInputOutputCommandOutput } from \"./commands/EmptyInputOutputCommand\";\nimport type { Float16CommandInput, Float16CommandOutput } from \"./commands/Float16Command\";\nimport type {\n  FractionalSecondsCommandInput,\n  FractionalSecondsCommandOutput,\n} from \"./commands/FractionalSecondsCommand\";\nimport type {\n  GreetingWithErrorsCommandInput,\n  GreetingWithErrorsCommandOutput,\n} from \"./commands/GreetingWithErrorsCommand\";\nimport type { NoInputOutputCommandInput, NoInputOutputCommandOutput } from \"./commands/NoInputOutputCommand\";\nimport type {\n  OperationWithDefaultsCommandInput,\n  OperationWithDefaultsCommandOutput,\n} from \"./commands/OperationWithDefaultsCommand\";\nimport type {\n  OptionalInputOutputCommandInput,\n  OptionalInputOutputCommandOutput,\n} from \"./commands/OptionalInputOutputCommand\";\nimport type { RecursiveShapesCommandInput, RecursiveShapesCommandOutput } from \"./commands/RecursiveShapesCommand\";\nimport type {\n  RpcV2CborDenseMapsCommandInput,\n  RpcV2CborDenseMapsCommandOutput,\n} from \"./commands/RpcV2CborDenseMapsCommand\";\nimport type { RpcV2CborListsCommandInput, RpcV2CborListsCommandOutput } from \"./commands/RpcV2CborListsCommand\";\nimport type {\n  RpcV2CborSparseMapsCommandInput,\n  RpcV2CborSparseMapsCommandOutput,\n} from \"./commands/RpcV2CborSparseMapsCommand\";\nimport type {\n  SimpleScalarPropertiesCommandInput,\n  SimpleScalarPropertiesCommandOutput,\n} from \"./commands/SimpleScalarPropertiesCommand\";\nimport type {\n  SparseNullsOperationCommandInput,\n  SparseNullsOperationCommandOutput,\n} from \"./commands/SparseNullsOperationCommand\";\nimport {\n  type ClientInputEndpointParameters,\n  type ClientResolvedEndpointParameters,\n  type EndpointParameters,\n  resolveClientEndpointParameters,\n} from \"./endpoint/EndpointParameters\";\nimport { getRuntimeConfig as __getRuntimeConfig } from \"./runtimeConfig\";\nimport { type RuntimeExtension, type RuntimeExtensionsConfig, resolveRuntimeExtensions } from \"./runtimeExtensions\";\n\nexport { __Client };\n\n/**\n * @public\n */\nexport type ServiceInputTypes =\n  | EmptyInputOutputCommandInput\n  | Float16CommandInput\n  | FractionalSecondsCommandInput\n  | GreetingWithErrorsCommandInput\n  | NoInputOutputCommandInput\n  | OperationWithDefaultsCommandInput\n  | OptionalInputOutputCommandInput\n  | RecursiveShapesCommandInput\n  | RpcV2CborDenseMapsCommandInput\n  | RpcV2CborListsCommandInput\n  | RpcV2CborSparseMapsCommandInput\n  | SimpleScalarPropertiesCommandInput\n  | SparseNullsOperationCommandInput;\n\n/**\n * @public\n */\nexport type ServiceOutputTypes =\n  | EmptyInputOutputCommandOutput\n  | Float16CommandOutput\n  | FractionalSecondsCommandOutput\n  | GreetingWithErrorsCommandOutput\n  | NoInputOutputCommandOutput\n  | OperationWithDefaultsCommandOutput\n  | OptionalInputOutputCommandOutput\n  | RecursiveShapesCommandOutput\n  | RpcV2CborDenseMapsCommandOutput\n  | RpcV2CborListsCommandOutput\n  | RpcV2CborSparseMapsCommandOutput\n  | SimpleScalarPropertiesCommandOutput\n  | SparseNullsOperationCommandOutput;\n\n/**\n * @public\n */\nexport interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {\n  /**\n   * The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.\n   */\n  requestHandler?: __HttpHandlerUserInput;\n\n  /**\n   * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface\n   * that computes the SHA-256 HMAC or checksum of a string or binary buffer.\n   * @internal\n   */\n  sha256?: __ChecksumConstructor | __HashConstructor;\n\n  /**\n   * The function that will be used to convert strings into HTTP endpoints.\n   * @internal\n   */\n  urlParser?: __UrlParser;\n\n  /**\n   * A function that can calculate the length of a request body.\n   * @internal\n   */\n  bodyLengthChecker?: __BodyLengthCalculator;\n\n  /**\n   * A function that converts a stream into an array of bytes.\n   * @internal\n   */\n  streamCollector?: __StreamCollector;\n\n  /**\n   * The function that will be used to convert a base64-encoded string to a byte array.\n   * @internal\n   */\n  base64Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a base64-encoded string.\n   * @internal\n   */\n  base64Encoder?: __Encoder;\n\n  /**\n   * The function that will be used to convert a UTF8-encoded string to a byte array.\n   * @internal\n   */\n  utf8Decoder?: __Decoder;\n\n  /**\n   * The function that will be used to convert binary data to a UTF-8 encoded string.\n   * @internal\n   */\n  utf8Encoder?: __Encoder;\n\n  /**\n   * The runtime environment.\n   * @internal\n   */\n  runtime?: string;\n\n  /**\n   * Disable dynamically changing the endpoint of the client based on the hostPrefix\n   * trait of an operation.\n   */\n  disableHostPrefix?: boolean;\n\n  /**\n   * Value for how many times a request will be made at most in case of retry.\n   */\n  maxAttempts?: number | __Provider<number>;\n\n  /**\n   * Specifies which retry algorithm to use.\n   * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/\n   *\n   */\n  retryMode?: string | __Provider<string>;\n\n  /**\n   * Optional logger for logging debug/info/warn/error.\n   */\n  logger?: __Logger;\n\n  /**\n   * Optional extensions\n   */\n  extensions?: RuntimeExtension[];\n\n  /**\n   * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.\n   */\n  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;\n}\n\n/**\n * @public\n */\nexport type RpcV2ProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &\n  ClientDefaults &\n  RetryInputConfig &\n  EndpointInputConfig<EndpointParameters> &\n  EndpointRequiredInputConfig &\n  HttpAuthSchemeInputConfig &\n  ClientInputEndpointParameters;\n/**\n * @public\n *\n *  The configuration interface of RpcV2ProtocolClient class constructor that set the region, credentials and other options.\n */\nexport interface RpcV2ProtocolClientConfig extends RpcV2ProtocolClientConfigType {}\n\n/**\n * @public\n */\nexport type RpcV2ProtocolClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &\n  Required<ClientDefaults> &\n  RuntimeExtensionsConfig &\n  RetryResolvedConfig &\n  EndpointResolvedConfig<EndpointParameters> &\n  EndpointRequiredResolvedConfig &\n  HttpAuthSchemeResolvedConfig &\n  ClientResolvedEndpointParameters;\n/**\n * @public\n *\n *  The resolved configuration interface of RpcV2ProtocolClient class. This is resolved and normalized from the {@link RpcV2ProtocolClientConfig | constructor configuration interface}.\n */\nexport interface RpcV2ProtocolClientResolvedConfig extends RpcV2ProtocolClientResolvedConfigType {}\n\n/**\n * @public\n */\nexport class RpcV2ProtocolClient extends __Client<\n  __HttpHandlerOptions,\n  ServiceInputTypes,\n  ServiceOutputTypes,\n  RpcV2ProtocolClientResolvedConfig\n> {\n  /**\n   * The resolved configuration of RpcV2ProtocolClient class. This is resolved and normalized from the {@link RpcV2ProtocolClientConfig | constructor configuration interface}.\n   */\n  readonly config: RpcV2ProtocolClientResolvedConfig;\n\n  constructor(...[configuration]: __CheckOptionalClientConfig<RpcV2ProtocolClientConfig>) {\n    const _config_0 = __getRuntimeConfig(configuration || {});\n    super(_config_0 as any);\n    this.initConfig = _config_0;\n    const _config_1 = resolveClientEndpointParameters(_config_0);\n    const _config_2 = resolveRetryConfig(_config_1);\n    const _config_3 = resolveEndpointConfig(_config_2);\n    const _config_4 = resolveEndpointRequiredConfig(_config_3);\n    const _config_5 = resolveHttpAuthSchemeConfig(_config_4);\n    const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []);\n    this.config = _config_6;\n    this.middlewareStack.use(getSchemaSerdePlugin(this.config));\n    this.middlewareStack.use(getRetryPlugin(this.config));\n    this.middlewareStack.use(getContentLengthPlugin(this.config));\n    this.middlewareStack.use(\n      getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {\n        httpAuthSchemeParametersProvider: defaultRpcV2ProtocolHttpAuthSchemeParametersProvider,\n        identityProviderConfigProvider: async (config: RpcV2ProtocolClientResolvedConfig) =>\n          new DefaultIdentityProviderConfig({}),\n      })\n    );\n    this.middlewareStack.use(getHttpSigningPlugin(this.config));\n  }\n\n  /**\n   * Destroy underlying resources, like sockets. It's usually not necessary to do this.\n   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.\n   * Otherwise, sockets might stay open for quite a long time before the server terminates them.\n   */\n  destroy(): void {\n    super.destroy();\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/auth/httpAuthExtensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { HttpAuthScheme } from \"@smithy/types\";\n\nimport type { RpcV2ProtocolHttpAuthSchemeProvider } from \"./httpAuthSchemeProvider\";\n\n/**\n * @internal\n */\nexport interface HttpAuthExtensionConfiguration {\n  setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;\n  httpAuthSchemes(): HttpAuthScheme[];\n  setHttpAuthSchemeProvider(httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider): void;\n  httpAuthSchemeProvider(): RpcV2ProtocolHttpAuthSchemeProvider;\n}\n\n/**\n * @internal\n */\nexport type HttpAuthRuntimeConfig = Partial<{\n  httpAuthSchemes: HttpAuthScheme[];\n  httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider;\n}>;\n\n/**\n * @internal\n */\nexport const getHttpAuthExtensionConfiguration = (\n  runtimeConfig: HttpAuthRuntimeConfig\n): HttpAuthExtensionConfiguration => {\n  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;\n  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;\n  return {\n    setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {\n      const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);\n      if (index === -1) {\n        _httpAuthSchemes.push(httpAuthScheme);\n      } else {\n        _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n      }\n    },\n    httpAuthSchemes(): HttpAuthScheme[] {\n      return _httpAuthSchemes;\n    },\n    setHttpAuthSchemeProvider(httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider): void {\n      _httpAuthSchemeProvider = httpAuthSchemeProvider;\n    },\n    httpAuthSchemeProvider(): RpcV2ProtocolHttpAuthSchemeProvider {\n      return _httpAuthSchemeProvider;\n    },\n  };\n};\n\n/**\n * @internal\n */\nexport const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => {\n  return {\n    httpAuthSchemes: config.httpAuthSchemes(),\n    httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/auth/httpAuthSchemeProvider.ts",
    "content": "// smithy-typescript generated code\nimport { getSmithyContext, normalizeProvider } from \"@smithy/core/client\";\nimport type {\n  HandlerExecutionContext,\n  HttpAuthOption,\n  HttpAuthScheme,\n  HttpAuthSchemeParameters,\n  HttpAuthSchemeParametersProvider,\n  HttpAuthSchemeProvider,\n  Provider,\n} from \"@smithy/types\";\n\nimport type { RpcV2ProtocolClientResolvedConfig } from \"../RpcV2ProtocolClient\";\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolHttpAuthSchemeParameters extends HttpAuthSchemeParameters {}\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolHttpAuthSchemeParametersProvider\n  extends HttpAuthSchemeParametersProvider<\n    RpcV2ProtocolClientResolvedConfig,\n    HandlerExecutionContext,\n    RpcV2ProtocolHttpAuthSchemeParameters,\n    object\n  > {}\n\n/**\n * @internal\n */\nexport const defaultRpcV2ProtocolHttpAuthSchemeParametersProvider = async (\n  config: RpcV2ProtocolClientResolvedConfig,\n  context: HandlerExecutionContext,\n  input: object\n): Promise<RpcV2ProtocolHttpAuthSchemeParameters> => {\n  return {\n    operation: getSmithyContext(context).operation as string,\n  };\n};\n\nfunction createSmithyApiNoAuthHttpAuthOption(authParameters: RpcV2ProtocolHttpAuthSchemeParameters): HttpAuthOption {\n  return {\n    schemeId: \"smithy.api#noAuth\",\n  };\n}\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolHttpAuthSchemeProvider\n  extends HttpAuthSchemeProvider<RpcV2ProtocolHttpAuthSchemeParameters> {}\n\n/**\n * @internal\n */\nexport const defaultRpcV2ProtocolHttpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider = (authParameters) => {\n  const options: HttpAuthOption[] = [];\n  switch (authParameters.operation) {\n    default: {\n      options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));\n    }\n  }\n  return options;\n};\n\n/**\n * @public\n */\nexport interface HttpAuthSchemeInputConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  authSchemePreference?: string[] | Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  httpAuthSchemes?: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  httpAuthSchemeProvider?: RpcV2ProtocolHttpAuthSchemeProvider;\n}\n\n/**\n * @internal\n */\nexport interface HttpAuthSchemeResolvedConfig {\n  /**\n   * A comma-separated list of case-sensitive auth scheme names.\n   * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n   * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n   * @public\n   */\n  readonly authSchemePreference: Provider<string[]>;\n\n  /**\n   * Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.\n   * @internal\n   */\n  readonly httpAuthSchemes: HttpAuthScheme[];\n\n  /**\n   * Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.\n   * @internal\n   */\n  readonly httpAuthSchemeProvider: RpcV2ProtocolHttpAuthSchemeProvider;\n}\n\n/**\n * @internal\n */\nexport const resolveHttpAuthSchemeConfig = <T>(\n  config: T & HttpAuthSchemeInputConfig\n): T & HttpAuthSchemeResolvedConfig => {\n  return Object.assign(config, {\n    authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),\n  }) as T & HttpAuthSchemeResolvedConfig;\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { EmptyStructure } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { EmptyInputOutput$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link EmptyInputOutputCommand}.\n */\nexport interface EmptyInputOutputCommandInput extends EmptyStructure {}\n/**\n * @public\n *\n * The output of {@link EmptyInputOutputCommand}.\n */\nexport interface EmptyInputOutputCommandOutput extends EmptyStructure, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, EmptyInputOutputCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, EmptyInputOutputCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new EmptyInputOutputCommand(input);\n * const response = await client.send(command);\n * // {};\n *\n * ```\n *\n * @param EmptyInputOutputCommandInput - {@link EmptyInputOutputCommandInput}\n * @returns {@link EmptyInputOutputCommandOutput}\n * @see {@link EmptyInputOutputCommandInput} for command's `input` shape.\n * @see {@link EmptyInputOutputCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class EmptyInputOutputCommand extends $Command\n  .classBuilder<\n    EmptyInputOutputCommandInput,\n    EmptyInputOutputCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"EmptyInputOutput\", {})\n  .n(\"RpcV2ProtocolClient\", \"EmptyInputOutputCommand\")\n  .sc(EmptyInputOutput$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: {};\n    };\n    sdk: {\n      input: EmptyInputOutputCommandInput;\n      output: EmptyInputOutputCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { Float16Output } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { Float16$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link Float16Command}.\n */\nexport interface Float16CommandInput {}\n/**\n * @public\n *\n * The output of {@link Float16Command}.\n */\nexport interface Float16CommandOutput extends Float16Output, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, Float16Command } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, Float16Command } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new Float16Command(input);\n * const response = await client.send(command);\n * // { // Float16Output\n * //   value: Number(\"double\"),\n * // };\n *\n * ```\n *\n * @param Float16CommandInput - {@link Float16CommandInput}\n * @returns {@link Float16CommandOutput}\n * @see {@link Float16CommandInput} for command's `input` shape.\n * @see {@link Float16CommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class Float16Command extends $Command\n  .classBuilder<\n    Float16CommandInput,\n    Float16CommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"Float16\", {})\n  .n(\"RpcV2ProtocolClient\", \"Float16Command\")\n  .sc(Float16$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: Float16Output;\n    };\n    sdk: {\n      input: Float16CommandInput;\n      output: Float16CommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { FractionalSecondsOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { FractionalSeconds$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link FractionalSecondsCommand}.\n */\nexport interface FractionalSecondsCommandInput {}\n/**\n * @public\n *\n * The output of {@link FractionalSecondsCommand}.\n */\nexport interface FractionalSecondsCommandOutput extends FractionalSecondsOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, FractionalSecondsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, FractionalSecondsCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new FractionalSecondsCommand(input);\n * const response = await client.send(command);\n * // { // FractionalSecondsOutput\n * //   datetime: new Date(\"TIMESTAMP\"),\n * // };\n *\n * ```\n *\n * @param FractionalSecondsCommandInput - {@link FractionalSecondsCommandInput}\n * @returns {@link FractionalSecondsCommandOutput}\n * @see {@link FractionalSecondsCommandInput} for command's `input` shape.\n * @see {@link FractionalSecondsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class FractionalSecondsCommand extends $Command\n  .classBuilder<\n    FractionalSecondsCommandInput,\n    FractionalSecondsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"FractionalSeconds\", {})\n  .n(\"RpcV2ProtocolClient\", \"FractionalSecondsCommand\")\n  .sc(FractionalSeconds$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: FractionalSecondsOutput;\n    };\n    sdk: {\n      input: FractionalSecondsCommandInput;\n      output: FractionalSecondsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { GreetingWithErrorsOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { GreetingWithErrors$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link GreetingWithErrorsCommand}.\n */\nexport interface GreetingWithErrorsCommandInput {}\n/**\n * @public\n *\n * The output of {@link GreetingWithErrorsCommand}.\n */\nexport interface GreetingWithErrorsCommandOutput extends GreetingWithErrorsOutput, __MetadataBearer {}\n\n/**\n * This operation has three possible return values:\n *\n * 1. A successful response in the form of GreetingWithErrorsOutput\n * 2. An InvalidGreeting error.\n * 3. A ComplexError error.\n *\n * Implementations must be able to successfully take a response and\n * properly deserialize successful and error responses.\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, GreetingWithErrorsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, GreetingWithErrorsCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new GreetingWithErrorsCommand(input);\n * const response = await client.send(command);\n * // { // GreetingWithErrorsOutput\n * //   greeting: \"STRING_VALUE\",\n * // };\n *\n * ```\n *\n * @param GreetingWithErrorsCommandInput - {@link GreetingWithErrorsCommandInput}\n * @returns {@link GreetingWithErrorsCommandOutput}\n * @see {@link GreetingWithErrorsCommandInput} for command's `input` shape.\n * @see {@link GreetingWithErrorsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link InvalidGreeting} (client fault)\n *  This error is thrown when an invalid greeting value is provided.\n *\n * @throws {@link ComplexError} (client fault)\n *  This error is thrown when a request is invalid.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n * @public\n */\nexport class GreetingWithErrorsCommand extends $Command\n  .classBuilder<\n    GreetingWithErrorsCommandInput,\n    GreetingWithErrorsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"GreetingWithErrors\", {})\n  .n(\"RpcV2ProtocolClient\", \"GreetingWithErrorsCommand\")\n  .sc(GreetingWithErrors$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: GreetingWithErrorsOutput;\n    };\n    sdk: {\n      input: GreetingWithErrorsCommandInput;\n      output: GreetingWithErrorsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { NoInputOutput$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link NoInputOutputCommand}.\n */\nexport interface NoInputOutputCommandInput {}\n/**\n * @public\n *\n * The output of {@link NoInputOutputCommand}.\n */\nexport interface NoInputOutputCommandOutput extends __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, NoInputOutputCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, NoInputOutputCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = {};\n * const command = new NoInputOutputCommand(input);\n * const response = await client.send(command);\n * // {};\n *\n * ```\n *\n * @param NoInputOutputCommandInput - {@link NoInputOutputCommandInput}\n * @returns {@link NoInputOutputCommandOutput}\n * @see {@link NoInputOutputCommandInput} for command's `input` shape.\n * @see {@link NoInputOutputCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class NoInputOutputCommand extends $Command\n  .classBuilder<\n    NoInputOutputCommandInput,\n    NoInputOutputCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"NoInputOutput\", {})\n  .n(\"RpcV2ProtocolClient\", \"NoInputOutputCommand\")\n  .sc(NoInputOutput$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: {};\n      output: {};\n    };\n    sdk: {\n      input: NoInputOutputCommandInput;\n      output: NoInputOutputCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { OperationWithDefaultsInput, OperationWithDefaultsOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { OperationWithDefaults$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link OperationWithDefaultsCommand}.\n */\nexport interface OperationWithDefaultsCommandInput extends OperationWithDefaultsInput {}\n/**\n * @public\n *\n * The output of {@link OperationWithDefaultsCommand}.\n */\nexport interface OperationWithDefaultsCommandOutput extends OperationWithDefaultsOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, OperationWithDefaultsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, OperationWithDefaultsCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // OperationWithDefaultsInput\n *   defaults: { // Defaults\n *     defaultString: \"STRING_VALUE\",\n *     defaultBoolean: true || false,\n *     defaultList: [ // TestStringList\n *       \"STRING_VALUE\",\n *     ],\n *     defaultTimestamp: new Date(\"TIMESTAMP\"),\n *     defaultBlob: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n *     defaultByte: 0, // BYTE_VALUE\n *     defaultShort: Number(\"short\"),\n *     defaultInteger: Number(\"int\"),\n *     defaultLong: Number(\"long\"),\n *     defaultFloat: Number(\"float\"),\n *     defaultDouble: Number(\"double\"),\n *     defaultMap: { // TestStringMap\n *       \"<keys>\": \"STRING_VALUE\",\n *     },\n *     defaultEnum: \"FOO\" || \"BAR\" || \"BAZ\",\n *     defaultIntEnum: 1 || 2,\n *     emptyString: \"STRING_VALUE\",\n *     falseBoolean: true || false,\n *     emptyBlob: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n *     zeroByte: 0, // BYTE_VALUE\n *     zeroShort: Number(\"short\"),\n *     zeroInteger: Number(\"int\"),\n *     zeroLong: Number(\"long\"),\n *     zeroFloat: Number(\"float\"),\n *     zeroDouble: Number(\"double\"),\n *   },\n *   clientOptionalDefaults: { // ClientOptionalDefaults\n *     member: Number(\"int\"),\n *   },\n *   topLevelDefault: \"STRING_VALUE\",\n *   otherTopLevelDefault: Number(\"int\"),\n * };\n * const command = new OperationWithDefaultsCommand(input);\n * const response = await client.send(command);\n * // { // OperationWithDefaultsOutput\n * //   defaultString: \"STRING_VALUE\",\n * //   defaultBoolean: true || false,\n * //   defaultList: [ // TestStringList\n * //     \"STRING_VALUE\",\n * //   ],\n * //   defaultTimestamp: new Date(\"TIMESTAMP\"),\n * //   defaultBlob: new Uint8Array(),\n * //   defaultByte: 0, // BYTE_VALUE\n * //   defaultShort: Number(\"short\"),\n * //   defaultInteger: Number(\"int\"),\n * //   defaultLong: Number(\"long\"),\n * //   defaultFloat: Number(\"float\"),\n * //   defaultDouble: Number(\"double\"),\n * //   defaultMap: { // TestStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * //   defaultEnum: \"FOO\" || \"BAR\" || \"BAZ\",\n * //   defaultIntEnum: 1 || 2,\n * //   emptyString: \"STRING_VALUE\",\n * //   falseBoolean: true || false,\n * //   emptyBlob: new Uint8Array(),\n * //   zeroByte: 0, // BYTE_VALUE\n * //   zeroShort: Number(\"short\"),\n * //   zeroInteger: Number(\"int\"),\n * //   zeroLong: Number(\"long\"),\n * //   zeroFloat: Number(\"float\"),\n * //   zeroDouble: Number(\"double\"),\n * // };\n *\n * ```\n *\n * @param OperationWithDefaultsCommandInput - {@link OperationWithDefaultsCommandInput}\n * @returns {@link OperationWithDefaultsCommandOutput}\n * @see {@link OperationWithDefaultsCommandInput} for command's `input` shape.\n * @see {@link OperationWithDefaultsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class OperationWithDefaultsCommand extends $Command\n  .classBuilder<\n    OperationWithDefaultsCommandInput,\n    OperationWithDefaultsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"OperationWithDefaults\", {})\n  .n(\"RpcV2ProtocolClient\", \"OperationWithDefaultsCommand\")\n  .sc(OperationWithDefaults$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: OperationWithDefaultsInput;\n      output: OperationWithDefaultsOutput;\n    };\n    sdk: {\n      input: OperationWithDefaultsCommandInput;\n      output: OperationWithDefaultsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { SimpleStructure } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { OptionalInputOutput$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link OptionalInputOutputCommand}.\n */\nexport interface OptionalInputOutputCommandInput extends SimpleStructure {}\n/**\n * @public\n *\n * The output of {@link OptionalInputOutputCommand}.\n */\nexport interface OptionalInputOutputCommandOutput extends SimpleStructure, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, OptionalInputOutputCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, OptionalInputOutputCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // SimpleStructure\n *   value: \"STRING_VALUE\",\n * };\n * const command = new OptionalInputOutputCommand(input);\n * const response = await client.send(command);\n * // { // SimpleStructure\n * //   value: \"STRING_VALUE\",\n * // };\n *\n * ```\n *\n * @param OptionalInputOutputCommandInput - {@link OptionalInputOutputCommandInput}\n * @returns {@link OptionalInputOutputCommandOutput}\n * @see {@link OptionalInputOutputCommandInput} for command's `input` shape.\n * @see {@link OptionalInputOutputCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class OptionalInputOutputCommand extends $Command\n  .classBuilder<\n    OptionalInputOutputCommandInput,\n    OptionalInputOutputCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"OptionalInputOutput\", {})\n  .n(\"RpcV2ProtocolClient\", \"OptionalInputOutputCommand\")\n  .sc(OptionalInputOutput$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: SimpleStructure;\n      output: SimpleStructure;\n    };\n    sdk: {\n      input: OptionalInputOutputCommandInput;\n      output: OptionalInputOutputCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RecursiveShapesInputOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { RecursiveShapes$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RecursiveShapesCommand}.\n */\nexport interface RecursiveShapesCommandInput extends RecursiveShapesInputOutput {}\n/**\n * @public\n *\n * The output of {@link RecursiveShapesCommand}.\n */\nexport interface RecursiveShapesCommandOutput extends RecursiveShapesInputOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RecursiveShapesCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RecursiveShapesCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RecursiveShapesInputOutput\n *   nested: { // RecursiveShapesInputOutputNested1\n *     foo: \"STRING_VALUE\",\n *     nested: { // RecursiveShapesInputOutputNested2\n *       bar: \"STRING_VALUE\",\n *       recursiveMember: {\n *         foo: \"STRING_VALUE\",\n *         nested: {\n *           bar: \"STRING_VALUE\",\n *           recursiveMember: \"<RecursiveShapesInputOutputNested1>\",\n *         },\n *       },\n *     },\n *   },\n * };\n * const command = new RecursiveShapesCommand(input);\n * const response = await client.send(command);\n * // { // RecursiveShapesInputOutput\n * //   nested: { // RecursiveShapesInputOutputNested1\n * //     foo: \"STRING_VALUE\",\n * //     nested: { // RecursiveShapesInputOutputNested2\n * //       bar: \"STRING_VALUE\",\n * //       recursiveMember: {\n * //         foo: \"STRING_VALUE\",\n * //         nested: {\n * //           bar: \"STRING_VALUE\",\n * //           recursiveMember: \"<RecursiveShapesInputOutputNested1>\",\n * //         },\n * //       },\n * //     },\n * //   },\n * // };\n *\n * ```\n *\n * @param RecursiveShapesCommandInput - {@link RecursiveShapesCommandInput}\n * @returns {@link RecursiveShapesCommandOutput}\n * @see {@link RecursiveShapesCommandInput} for command's `input` shape.\n * @see {@link RecursiveShapesCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class RecursiveShapesCommand extends $Command\n  .classBuilder<\n    RecursiveShapesCommandInput,\n    RecursiveShapesCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"RecursiveShapes\", {})\n  .n(\"RpcV2ProtocolClient\", \"RecursiveShapesCommand\")\n  .sc(RecursiveShapes$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RecursiveShapesInputOutput;\n      output: RecursiveShapesInputOutput;\n    };\n    sdk: {\n      input: RecursiveShapesCommandInput;\n      output: RecursiveShapesCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2CborDenseMapsInputOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { RpcV2CborDenseMaps$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RpcV2CborDenseMapsCommand}.\n */\nexport interface RpcV2CborDenseMapsCommandInput extends RpcV2CborDenseMapsInputOutput {}\n/**\n * @public\n *\n * The output of {@link RpcV2CborDenseMapsCommand}.\n */\nexport interface RpcV2CborDenseMapsCommandOutput extends RpcV2CborDenseMapsInputOutput, __MetadataBearer {}\n\n/**\n * The example tests basic map serialization.\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RpcV2CborDenseMapsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RpcV2CborDenseMapsCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RpcV2CborDenseMapsInputOutput\n *   denseStructMap: { // DenseStructMap\n *     \"<keys>\": { // GreetingStruct\n *       hi: \"STRING_VALUE\",\n *     },\n *   },\n *   denseNumberMap: { // DenseNumberMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n *   denseBooleanMap: { // DenseBooleanMap\n *     \"<keys>\": true || false,\n *   },\n *   denseStringMap: { // DenseStringMap\n *     \"<keys>\": \"STRING_VALUE\",\n *   },\n *   denseSetMap: { // DenseSetMap\n *     \"<keys>\": [ // StringSet\n *       \"STRING_VALUE\",\n *     ],\n *   },\n * };\n * const command = new RpcV2CborDenseMapsCommand(input);\n * const response = await client.send(command);\n * // { // RpcV2CborDenseMapsInputOutput\n * //   denseStructMap: { // DenseStructMap\n * //     \"<keys>\": { // GreetingStruct\n * //       hi: \"STRING_VALUE\",\n * //     },\n * //   },\n * //   denseNumberMap: { // DenseNumberMap\n * //     \"<keys>\": Number(\"int\"),\n * //   },\n * //   denseBooleanMap: { // DenseBooleanMap\n * //     \"<keys>\": true || false,\n * //   },\n * //   denseStringMap: { // DenseStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * //   denseSetMap: { // DenseSetMap\n * //     \"<keys>\": [ // StringSet\n * //       \"STRING_VALUE\",\n * //     ],\n * //   },\n * // };\n *\n * ```\n *\n * @param RpcV2CborDenseMapsCommandInput - {@link RpcV2CborDenseMapsCommandInput}\n * @returns {@link RpcV2CborDenseMapsCommandOutput}\n * @see {@link RpcV2CborDenseMapsCommandInput} for command's `input` shape.\n * @see {@link RpcV2CborDenseMapsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n * @public\n */\nexport class RpcV2CborDenseMapsCommand extends $Command\n  .classBuilder<\n    RpcV2CborDenseMapsCommandInput,\n    RpcV2CborDenseMapsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"RpcV2CborDenseMaps\", {})\n  .n(\"RpcV2ProtocolClient\", \"RpcV2CborDenseMapsCommand\")\n  .sc(RpcV2CborDenseMaps$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RpcV2CborDenseMapsInputOutput;\n      output: RpcV2CborDenseMapsInputOutput;\n    };\n    sdk: {\n      input: RpcV2CborDenseMapsCommandInput;\n      output: RpcV2CborDenseMapsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2CborListInputOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { RpcV2CborLists$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RpcV2CborListsCommand}.\n */\nexport interface RpcV2CborListsCommandInput extends RpcV2CborListInputOutput {}\n/**\n * @public\n *\n * The output of {@link RpcV2CborListsCommand}.\n */\nexport interface RpcV2CborListsCommandOutput extends RpcV2CborListInputOutput, __MetadataBearer {}\n\n/**\n * This test case serializes JSON lists for the following cases for both\n * input and output:\n *\n * 1. Normal lists.\n * 2. Normal sets.\n * 3. Lists of lists.\n * 4. Lists of structures.\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RpcV2CborListsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RpcV2CborListsCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RpcV2CborListInputOutput\n *   stringList: [ // StringList\n *     \"STRING_VALUE\",\n *   ],\n *   stringSet: [ // StringSet\n *     \"STRING_VALUE\",\n *   ],\n *   integerList: [ // IntegerList\n *     Number(\"int\"),\n *   ],\n *   booleanList: [ // BooleanList\n *     true || false,\n *   ],\n *   timestampList: [ // TimestampList\n *     new Date(\"TIMESTAMP\"),\n *   ],\n *   enumList: [ // FooEnumList\n *     \"Foo\" || \"Baz\" || \"Bar\" || \"1\" || \"0\",\n *   ],\n *   intEnumList: [ // IntegerEnumList\n *     1 || 2 || 3,\n *   ],\n *   nestedStringList: [ // NestedStringList\n *     [\n *       \"STRING_VALUE\",\n *     ],\n *   ],\n *   structureList: [ // StructureList\n *     { // StructureListMember\n *       a: \"STRING_VALUE\",\n *       b: \"STRING_VALUE\",\n *     },\n *   ],\n *   blobList: [ // BlobList\n *     new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n *   ],\n * };\n * const command = new RpcV2CborListsCommand(input);\n * const response = await client.send(command);\n * // { // RpcV2CborListInputOutput\n * //   stringList: [ // StringList\n * //     \"STRING_VALUE\",\n * //   ],\n * //   stringSet: [ // StringSet\n * //     \"STRING_VALUE\",\n * //   ],\n * //   integerList: [ // IntegerList\n * //     Number(\"int\"),\n * //   ],\n * //   booleanList: [ // BooleanList\n * //     true || false,\n * //   ],\n * //   timestampList: [ // TimestampList\n * //     new Date(\"TIMESTAMP\"),\n * //   ],\n * //   enumList: [ // FooEnumList\n * //     \"Foo\" || \"Baz\" || \"Bar\" || \"1\" || \"0\",\n * //   ],\n * //   intEnumList: [ // IntegerEnumList\n * //     1 || 2 || 3,\n * //   ],\n * //   nestedStringList: [ // NestedStringList\n * //     [\n * //       \"STRING_VALUE\",\n * //     ],\n * //   ],\n * //   structureList: [ // StructureList\n * //     { // StructureListMember\n * //       a: \"STRING_VALUE\",\n * //       b: \"STRING_VALUE\",\n * //     },\n * //   ],\n * //   blobList: [ // BlobList\n * //     new Uint8Array(),\n * //   ],\n * // };\n *\n * ```\n *\n * @param RpcV2CborListsCommandInput - {@link RpcV2CborListsCommandInput}\n * @returns {@link RpcV2CborListsCommandOutput}\n * @see {@link RpcV2CborListsCommandInput} for command's `input` shape.\n * @see {@link RpcV2CborListsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n * @public\n */\nexport class RpcV2CborListsCommand extends $Command\n  .classBuilder<\n    RpcV2CborListsCommandInput,\n    RpcV2CborListsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"RpcV2CborLists\", {})\n  .n(\"RpcV2ProtocolClient\", \"RpcV2CborListsCommand\")\n  .sc(RpcV2CborLists$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RpcV2CborListInputOutput;\n      output: RpcV2CborListInputOutput;\n    };\n    sdk: {\n      input: RpcV2CborListsCommandInput;\n      output: RpcV2CborListsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { RpcV2CborSparseMapsInputOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { RpcV2CborSparseMaps$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link RpcV2CborSparseMapsCommand}.\n */\nexport interface RpcV2CborSparseMapsCommandInput extends RpcV2CborSparseMapsInputOutput {}\n/**\n * @public\n *\n * The output of {@link RpcV2CborSparseMapsCommand}.\n */\nexport interface RpcV2CborSparseMapsCommandOutput extends RpcV2CborSparseMapsInputOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, RpcV2CborSparseMapsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, RpcV2CborSparseMapsCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // RpcV2CborSparseMapsInputOutput\n *   sparseStructMap: { // SparseStructMap\n *     \"<keys>\": { // GreetingStruct\n *       hi: \"STRING_VALUE\",\n *     },\n *   },\n *   sparseNumberMap: { // SparseNumberMap\n *     \"<keys>\": Number(\"int\"),\n *   },\n *   sparseBooleanMap: { // SparseBooleanMap\n *     \"<keys>\": true || false,\n *   },\n *   sparseStringMap: { // SparseStringMap\n *     \"<keys>\": \"STRING_VALUE\",\n *   },\n *   sparseSetMap: { // SparseSetMap\n *     \"<keys>\": [ // StringSet\n *       \"STRING_VALUE\",\n *     ],\n *   },\n * };\n * const command = new RpcV2CborSparseMapsCommand(input);\n * const response = await client.send(command);\n * // { // RpcV2CborSparseMapsInputOutput\n * //   sparseStructMap: { // SparseStructMap\n * //     \"<keys>\": { // GreetingStruct\n * //       hi: \"STRING_VALUE\",\n * //     },\n * //   },\n * //   sparseNumberMap: { // SparseNumberMap\n * //     \"<keys>\": Number(\"int\"),\n * //   },\n * //   sparseBooleanMap: { // SparseBooleanMap\n * //     \"<keys>\": true || false,\n * //   },\n * //   sparseStringMap: { // SparseStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * //   sparseSetMap: { // SparseSetMap\n * //     \"<keys>\": [ // StringSet\n * //       \"STRING_VALUE\",\n * //     ],\n * //   },\n * // };\n *\n * ```\n *\n * @param RpcV2CborSparseMapsCommandInput - {@link RpcV2CborSparseMapsCommandInput}\n * @returns {@link RpcV2CborSparseMapsCommandOutput}\n * @see {@link RpcV2CborSparseMapsCommandInput} for command's `input` shape.\n * @see {@link RpcV2CborSparseMapsCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link ValidationException} (client fault)\n *  A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class RpcV2CborSparseMapsCommand extends $Command\n  .classBuilder<\n    RpcV2CborSparseMapsCommandInput,\n    RpcV2CborSparseMapsCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"RpcV2CborSparseMaps\", {})\n  .n(\"RpcV2ProtocolClient\", \"RpcV2CborSparseMapsCommand\")\n  .sc(RpcV2CborSparseMaps$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: RpcV2CborSparseMapsInputOutput;\n      output: RpcV2CborSparseMapsInputOutput;\n    };\n    sdk: {\n      input: RpcV2CborSparseMapsCommandInput;\n      output: RpcV2CborSparseMapsCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { SimpleScalarStructure } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { SimpleScalarProperties$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link SimpleScalarPropertiesCommand}.\n */\nexport interface SimpleScalarPropertiesCommandInput extends SimpleScalarStructure {}\n/**\n * @public\n *\n * The output of {@link SimpleScalarPropertiesCommand}.\n */\nexport interface SimpleScalarPropertiesCommandOutput extends SimpleScalarStructure, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, SimpleScalarPropertiesCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, SimpleScalarPropertiesCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // SimpleScalarStructure\n *   trueBooleanValue: true || false,\n *   falseBooleanValue: true || false,\n *   byteValue: 0, // BYTE_VALUE\n *   doubleValue: Number(\"double\"),\n *   floatValue: Number(\"float\"),\n *   integerValue: Number(\"int\"),\n *   longValue: Number(\"long\"),\n *   shortValue: Number(\"short\"),\n *   stringValue: \"STRING_VALUE\",\n *   blobValue: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n * };\n * const command = new SimpleScalarPropertiesCommand(input);\n * const response = await client.send(command);\n * // { // SimpleScalarStructure\n * //   trueBooleanValue: true || false,\n * //   falseBooleanValue: true || false,\n * //   byteValue: 0, // BYTE_VALUE\n * //   doubleValue: Number(\"double\"),\n * //   floatValue: Number(\"float\"),\n * //   integerValue: Number(\"int\"),\n * //   longValue: Number(\"long\"),\n * //   shortValue: Number(\"short\"),\n * //   stringValue: \"STRING_VALUE\",\n * //   blobValue: new Uint8Array(),\n * // };\n *\n * ```\n *\n * @param SimpleScalarPropertiesCommandInput - {@link SimpleScalarPropertiesCommandInput}\n * @returns {@link SimpleScalarPropertiesCommandOutput}\n * @see {@link SimpleScalarPropertiesCommandInput} for command's `input` shape.\n * @see {@link SimpleScalarPropertiesCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class SimpleScalarPropertiesCommand extends $Command\n  .classBuilder<\n    SimpleScalarPropertiesCommandInput,\n    SimpleScalarPropertiesCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"SimpleScalarProperties\", {})\n  .n(\"RpcV2ProtocolClient\", \"SimpleScalarPropertiesCommand\")\n  .sc(SimpleScalarProperties$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: SimpleScalarStructure;\n      output: SimpleScalarStructure;\n    };\n    sdk: {\n      input: SimpleScalarPropertiesCommandInput;\n      output: SimpleScalarPropertiesCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts",
    "content": "// smithy-typescript generated code\nimport { Command as $Command } from \"@smithy/core/client\";\nimport { getEndpointPlugin } from \"@smithy/core/endpoints\";\nimport type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\nimport { commonParams } from \"../endpoint/EndpointParameters\";\nimport type { SparseNullsOperationInputOutput } from \"../models/models_0\";\nimport type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\nimport { SparseNullsOperation$ } from \"../schemas/schemas_0\";\n\n/**\n * @public\n */\nexport type { __MetadataBearer };\nexport { $Command };\n/**\n * @public\n *\n * The input for {@link SparseNullsOperationCommand}.\n */\nexport interface SparseNullsOperationCommandInput extends SparseNullsOperationInputOutput {}\n/**\n * @public\n *\n * The output of {@link SparseNullsOperationCommand}.\n */\nexport interface SparseNullsOperationCommandOutput extends SparseNullsOperationInputOutput, __MetadataBearer {}\n\n/**\n * @public\n *\n * @example\n * Use a bare-bones client and the command you need to make an API call.\n * ```javascript\n * import { RpcV2ProtocolClient, SparseNullsOperationCommand } from \"@smithy/smithy-rpcv2-cbor-schema\"; // ES Modules import\n * // const { RpcV2ProtocolClient, SparseNullsOperationCommand } = require(\"@smithy/smithy-rpcv2-cbor-schema\"); // CommonJS import\n * // import type { RpcV2ProtocolClientConfig } from \"@smithy/smithy-rpcv2-cbor-schema\";\n * const config = {}; // type is RpcV2ProtocolClientConfig\n * const client = new RpcV2ProtocolClient(config);\n * const input = { // SparseNullsOperationInputOutput\n *   sparseStringList: [ // SparseStringList\n *     \"STRING_VALUE\",\n *   ],\n *   sparseStringMap: { // SparseStringMap\n *     \"<keys>\": \"STRING_VALUE\",\n *   },\n * };\n * const command = new SparseNullsOperationCommand(input);\n * const response = await client.send(command);\n * // { // SparseNullsOperationInputOutput\n * //   sparseStringList: [ // SparseStringList\n * //     \"STRING_VALUE\",\n * //   ],\n * //   sparseStringMap: { // SparseStringMap\n * //     \"<keys>\": \"STRING_VALUE\",\n * //   },\n * // };\n *\n * ```\n *\n * @param SparseNullsOperationCommandInput - {@link SparseNullsOperationCommandInput}\n * @returns {@link SparseNullsOperationCommandOutput}\n * @see {@link SparseNullsOperationCommandInput} for command's `input` shape.\n * @see {@link SparseNullsOperationCommandOutput} for command's `response` shape.\n * @see {@link RpcV2ProtocolClientResolvedConfig | config} for RpcV2ProtocolClient's `config` shape.\n *\n * @throws {@link RpcV2ProtocolServiceException}\n * <p>Base exception class for all service exceptions from RpcV2Protocol service.</p>\n *\n *\n */\nexport class SparseNullsOperationCommand extends $Command\n  .classBuilder<\n    SparseNullsOperationCommandInput,\n    SparseNullsOperationCommandOutput,\n    RpcV2ProtocolClientResolvedConfig,\n    ServiceInputTypes,\n    ServiceOutputTypes\n  >()\n  .ep(commonParams)\n  .m(function (this: any, Command: any, cs: any, config: RpcV2ProtocolClientResolvedConfig, o: any) {\n    return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];\n  })\n  .s(\"RpcV2Protocol\", \"SparseNullsOperation\", {})\n  .n(\"RpcV2ProtocolClient\", \"SparseNullsOperationCommand\")\n  .sc(SparseNullsOperation$)\n  .build() {\n  /** @internal type navigation helper, not in runtime. */\n  protected declare static __types: {\n    api: {\n      input: SparseNullsOperationInputOutput;\n      output: SparseNullsOperationInputOutput;\n    };\n    sdk: {\n      input: SparseNullsOperationCommandInput;\n      output: SparseNullsOperationCommandOutput;\n    };\n  };\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/commands/index.ts",
    "content": "// smithy-typescript generated code\nexport * from \"./EmptyInputOutputCommand\";\nexport * from \"./Float16Command\";\nexport * from \"./FractionalSecondsCommand\";\nexport * from \"./GreetingWithErrorsCommand\";\nexport * from \"./NoInputOutputCommand\";\nexport * from \"./OperationWithDefaultsCommand\";\nexport * from \"./OptionalInputOutputCommand\";\nexport * from \"./RecursiveShapesCommand\";\nexport * from \"./RpcV2CborDenseMapsCommand\";\nexport * from \"./RpcV2CborListsCommand\";\nexport * from \"./RpcV2CborSparseMapsCommand\";\nexport * from \"./SimpleScalarPropertiesCommand\";\nexport * from \"./SparseNullsOperationCommand\";\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/endpoint/EndpointParameters.ts",
    "content": "// smithy-typescript generated code\nimport type { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from \"@smithy/types\";\n\n/**\n * @public\n */\nexport interface ClientInputEndpointParameters {\n  endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n}\n\n/**\n * @public\n */\nexport type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, \"endpoint\"> & {\n  defaultSigningName: string;\n};\n\n/**\n * @internal\n */\nexport const resolveClientEndpointParameters = <T>(\n  options: T & ClientInputEndpointParameters\n): T & ClientResolvedEndpointParameters => {\n  return Object.assign(options, {\n    defaultSigningName: \"\",\n  });\n};\n\n/**\n * @internal\n */\nexport const commonParams = {\n  endpoint: { type: \"builtInParams\", name: \"endpoint\" },\n} as const;\n\n/**\n * @internal\n */\nexport interface EndpointParameters extends __EndpointParameters {\n  endpoint?: string | undefined;\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/endpoint/bdd.ts",
    "content": "// smithy-typescript generated code\nimport { BinaryDecisionDiagram } from \"@smithy/core/endpoints\";\n\nconst a={\"ref\":\"endpoint\"};\nconst _data={\n  conditions: [\n    [\"isSet\",[a]]\n  ],\n  results: [\n    [-1],\n    [a,{}],\n    [-1,\"(default endpointRuleSet) endpoint is not set - you must configure an endpoint.\"]\n  ]\n};\n\nconst root = 2;\nconst r = 100_000_000;\nconst nodes = new Int32Array([\n  -1, 1, -1,\n  0, r + 1, r + 2,\n]);\nexport const bdd = BinaryDecisionDiagram.from(\n  nodes, root, _data.conditions, _data.results\n);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/endpoint/endpointResolver.ts",
    "content": "// smithy-typescript generated code\nimport { type EndpointParams, decideEndpoint, EndpointCache } from \"@smithy/core/endpoints\";\nimport type { EndpointV2, Logger } from \"@smithy/types\";\n\nimport { bdd } from \"./bdd\";\nimport type { EndpointParameters } from \"./EndpointParameters\";\n\nconst cache = new EndpointCache({\n  size: 50,\n  params: [\"endpoint\"],\n});\n\n/**\n * @internal\n */\nexport const defaultEndpointResolver = (\n  endpointParams: EndpointParameters,\n  context: { logger?: Logger } = {}\n): EndpointV2 => {\n  return cache.get(endpointParams as EndpointParams, () =>\n    decideEndpoint(bdd, {\n      endpointParams: endpointParams as EndpointParams,\n      logger: context.logger,\n    })\n  );\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/extensionConfiguration.ts",
    "content": "// smithy-typescript generated code\nimport type { HttpHandlerExtensionConfiguration } from \"@smithy/core/protocols\";\nimport type { DefaultExtensionConfiguration } from \"@smithy/types\";\n\nimport type { HttpAuthExtensionConfiguration } from \"./auth/httpAuthExtensionConfiguration\";\n\n/**\n * @internal\n */\nexport interface RpcV2ProtocolExtensionConfiguration\n  extends HttpHandlerExtensionConfiguration,\n    DefaultExtensionConfiguration,\n    HttpAuthExtensionConfiguration {}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/index.ts",
    "content": "// smithy-typescript generated code\n/* eslint-disable */\nexport * from \"./RpcV2ProtocolClient\";\nexport * from \"./RpcV2Protocol\";\nexport type { ClientInputEndpointParameters } from \"./endpoint/EndpointParameters\";\nexport type { RuntimeExtension } from \"./runtimeExtensions\";\nexport type { RpcV2ProtocolExtensionConfiguration } from \"./extensionConfiguration\";\nexport * from \"./commands\";\nexport * from \"./schemas/schemas_0\";\n\nexport * from \"./models/enums\";\nexport * from \"./models/errors\";\nexport * from \"./models/models_0\";\n\nexport { RpcV2ProtocolServiceException } from \"./models/RpcV2ProtocolServiceException\";\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/models/RpcV2ProtocolServiceException.ts",
    "content": "// smithy-typescript generated code\nimport {\n  type ServiceExceptionOptions as __ServiceExceptionOptions,\n  ServiceException as __ServiceException,\n} from \"@smithy/core/client\";\n\nexport type { __ServiceExceptionOptions };\n\nexport { __ServiceException };\n\n/**\n * @public\n *\n * Base exception class for all service exceptions from RpcV2Protocol service.\n */\nexport class RpcV2ProtocolServiceException extends __ServiceException {\n  /**\n   * @internal\n   */\n  constructor(options: __ServiceExceptionOptions) {\n    super(options);\n    Object.setPrototypeOf(this, RpcV2ProtocolServiceException.prototype);\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/models/enums.ts",
    "content": "// smithy-typescript generated code\n/**\n * @public\n * @enum\n */\nexport const TestEnum = {\n  BAR: \"BAR\",\n  BAZ: \"BAZ\",\n  FOO: \"FOO\",\n} as const;\n/**\n * @public\n */\nexport type TestEnum = (typeof TestEnum)[keyof typeof TestEnum];\n\nexport enum TestIntEnum {\n  ONE = 1,\n  TWO = 2,\n}\n\n/**\n * @public\n * @enum\n */\nexport const FooEnum = {\n  BAR: \"Bar\",\n  BAZ: \"Baz\",\n  FOO: \"Foo\",\n  ONE: \"1\",\n  ZERO: \"0\",\n} as const;\n/**\n * @public\n */\nexport type FooEnum = (typeof FooEnum)[keyof typeof FooEnum];\n\nexport enum IntegerEnum {\n  A = 1,\n  B = 2,\n  C = 3,\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/models/errors.ts",
    "content": "// smithy-typescript generated code\nimport type { ExceptionOptionType as __ExceptionOptionType } from \"@smithy/core/client\";\n\nimport type { ComplexNestedErrorData, ValidationExceptionField } from \"./models_0\";\nimport { RpcV2ProtocolServiceException as __BaseException } from \"./RpcV2ProtocolServiceException\";\n\n/**\n * A standard error for input validation failures.\n * This should be thrown by services when a member of the input structure\n * falls outside of the modeled or documented constraints.\n * @public\n */\nexport class ValidationException extends __BaseException {\n  readonly name = \"ValidationException\" as const;\n  readonly $fault = \"client\" as const;\n  /**\n   * A list of specific failures encountered while validating the input.\n   * A member can appear in this list more than once if it failed to satisfy multiple constraints.\n   * @public\n   */\n  fieldList?: ValidationExceptionField[] | undefined;\n\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>) {\n    super({\n      name: \"ValidationException\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, ValidationException.prototype);\n    this.fieldList = opts.fieldList;\n  }\n}\n\n/**\n * This error is thrown when a request is invalid.\n * @public\n */\nexport class ComplexError extends __BaseException {\n  readonly name = \"ComplexError\" as const;\n  readonly $fault = \"client\" as const;\n  TopLevel?: string | undefined;\n  Nested?: ComplexNestedErrorData | undefined;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<ComplexError, __BaseException>) {\n    super({\n      name: \"ComplexError\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, ComplexError.prototype);\n    this.TopLevel = opts.TopLevel;\n    this.Nested = opts.Nested;\n  }\n}\n\n/**\n * This error is thrown when an invalid greeting value is provided.\n * @public\n */\nexport class InvalidGreeting extends __BaseException {\n  readonly name = \"InvalidGreeting\" as const;\n  readonly $fault = \"client\" as const;\n  Message?: string | undefined;\n  /**\n   * @internal\n   */\n  constructor(opts: __ExceptionOptionType<InvalidGreeting, __BaseException>) {\n    super({\n      name: \"InvalidGreeting\",\n      $fault: \"client\",\n      ...opts,\n    });\n    Object.setPrototypeOf(this, InvalidGreeting.prototype);\n    this.Message = opts.Message;\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/models/models_0.ts",
    "content": "// smithy-typescript generated code\nimport type { FooEnum, IntegerEnum, TestEnum, TestIntEnum } from \"./enums\";\n\n/**\n * Describes one specific validation failure for an input member.\n * @public\n */\nexport interface ValidationExceptionField {\n  /**\n   * A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.\n   * @public\n   */\n  path: string | undefined;\n\n  /**\n   * A detailed description of the validation failure.\n   * @public\n   */\n  message: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface ClientOptionalDefaults {\n  member?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface ComplexNestedErrorData {\n  Foo?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface Defaults {\n  defaultString?: string | undefined;\n  defaultBoolean?: boolean | undefined;\n  defaultList?: string[] | undefined;\n  defaultTimestamp?: Date | undefined;\n  defaultBlob?: Uint8Array | undefined;\n  defaultByte?: number | undefined;\n  defaultShort?: number | undefined;\n  defaultInteger?: number | undefined;\n  defaultLong?: number | undefined;\n  defaultFloat?: number | undefined;\n  defaultDouble?: number | undefined;\n  defaultMap?: Record<string, string> | undefined;\n  defaultEnum?: TestEnum | undefined;\n  defaultIntEnum?: TestIntEnum | undefined;\n  emptyString?: string | undefined;\n  falseBoolean?: boolean | undefined;\n  emptyBlob?: Uint8Array | undefined;\n  zeroByte?: number | undefined;\n  zeroShort?: number | undefined;\n  zeroInteger?: number | undefined;\n  zeroLong?: number | undefined;\n  zeroFloat?: number | undefined;\n  zeroDouble?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface GreetingStruct {\n  hi?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface EmptyStructure {}\n\n/**\n * @public\n */\nexport interface Float16Output {\n  value?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface FractionalSecondsOutput {\n  datetime?: Date | undefined;\n}\n\n/**\n * @public\n */\nexport interface GreetingWithErrorsOutput {\n  greeting?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface OperationWithDefaultsInput {\n  defaults?: Defaults | undefined;\n  clientOptionalDefaults?: ClientOptionalDefaults | undefined;\n  topLevelDefault?: string | undefined;\n  otherTopLevelDefault?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface OperationWithDefaultsOutput {\n  defaultString?: string | undefined;\n  defaultBoolean?: boolean | undefined;\n  defaultList?: string[] | undefined;\n  defaultTimestamp?: Date | undefined;\n  defaultBlob?: Uint8Array | undefined;\n  defaultByte?: number | undefined;\n  defaultShort?: number | undefined;\n  defaultInteger?: number | undefined;\n  defaultLong?: number | undefined;\n  defaultFloat?: number | undefined;\n  defaultDouble?: number | undefined;\n  defaultMap?: Record<string, string> | undefined;\n  defaultEnum?: TestEnum | undefined;\n  defaultIntEnum?: TestIntEnum | undefined;\n  emptyString?: string | undefined;\n  falseBoolean?: boolean | undefined;\n  emptyBlob?: Uint8Array | undefined;\n  zeroByte?: number | undefined;\n  zeroShort?: number | undefined;\n  zeroInteger?: number | undefined;\n  zeroLong?: number | undefined;\n  zeroFloat?: number | undefined;\n  zeroDouble?: number | undefined;\n}\n\n/**\n * @public\n */\nexport interface SimpleStructure {\n  value?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface RpcV2CborDenseMapsInputOutput {\n  denseStructMap?: Record<string, GreetingStruct> | undefined;\n  denseNumberMap?: Record<string, number> | undefined;\n  denseBooleanMap?: Record<string, boolean> | undefined;\n  denseStringMap?: Record<string, string> | undefined;\n  denseSetMap?: Record<string, string[]> | undefined;\n}\n\n/**\n * @public\n */\nexport interface StructureListMember {\n  a?: string | undefined;\n  b?: string | undefined;\n}\n\n/**\n * @public\n */\nexport interface RpcV2CborListInputOutput {\n  stringList?: string[] | undefined;\n  stringSet?: string[] | undefined;\n  integerList?: number[] | undefined;\n  booleanList?: boolean[] | undefined;\n  timestampList?: Date[] | undefined;\n  enumList?: FooEnum[] | undefined;\n  intEnumList?: IntegerEnum[] | undefined;\n  /**\n   * A list of lists of strings.\n   * @public\n   */\n  nestedStringList?: string[][] | undefined;\n\n  structureList?: StructureListMember[] | undefined;\n  blobList?: Uint8Array[] | undefined;\n}\n\n/**\n * @public\n */\nexport interface RpcV2CborSparseMapsInputOutput {\n  sparseStructMap?: Record<string, GreetingStruct | null> | undefined;\n  sparseNumberMap?: Record<string, number | null> | undefined;\n  sparseBooleanMap?: Record<string, boolean | null> | undefined;\n  sparseStringMap?: Record<string, string | null> | undefined;\n  sparseSetMap?: Record<string, string[] | null> | undefined;\n}\n\n/**\n * @public\n */\nexport interface SimpleScalarStructure {\n  trueBooleanValue?: boolean | undefined;\n  falseBooleanValue?: boolean | undefined;\n  byteValue?: number | undefined;\n  doubleValue?: number | undefined;\n  floatValue?: number | undefined;\n  integerValue?: number | undefined;\n  longValue?: number | undefined;\n  shortValue?: number | undefined;\n  stringValue?: string | undefined;\n  blobValue?: Uint8Array | undefined;\n}\n\n/**\n * @public\n */\nexport interface SparseNullsOperationInputOutput {\n  sparseStringList?: (string | null)[] | undefined;\n  sparseStringMap?: Record<string, string | null> | undefined;\n}\n\n/**\n * @public\n */\nexport interface RecursiveShapesInputOutputNested1 {\n  foo?: string | undefined;\n  nested?: RecursiveShapesInputOutputNested2 | undefined;\n}\n\n/**\n * @public\n */\nexport interface RecursiveShapesInputOutputNested2 {\n  bar?: string | undefined;\n  recursiveMember?: RecursiveShapesInputOutputNested1 | undefined;\n}\n\n/**\n * @public\n */\nexport interface RecursiveShapesInputOutput {\n  nested?: RecursiveShapesInputOutputNested1 | undefined;\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/runtimeConfig.browser.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from \"@smithy/core/retry\";\nimport { calculateBodyLength } from \"@smithy/core/serde\";\nimport { FetchHttpHandler as RequestHandler, streamCollector } from \"@smithy/fetch-http-handler\";\n\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"browser\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),\n    sha256: config?.sha256 ?? Sha256,\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/runtimeConfig.native.ts",
    "content": "// smithy-typescript generated code\nimport { Sha256 } from \"@aws-crypto/sha256-js\";\n\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { getRuntimeConfig as getBrowserRuntimeConfig } from \"./runtimeConfig.browser\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  const browserDefaults = getBrowserRuntimeConfig(config);\n  return {\n    ...browserDefaults,\n    ...config,\n    runtime: \"react-native\",\n    sha256: config?.sha256 ?? Sha256,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/runtimeConfig.shared.ts",
    "content": "// smithy-typescript generated code\nimport { NoAuthSigner } from \"@smithy/core\";\nimport { SmithyRpcV2CborProtocol } from \"@smithy/core/cbor\";\nimport { NoOpLogger } from \"@smithy/core/client\";\nimport { parseUrl } from \"@smithy/core/protocols\";\nimport { fromBase64, fromUtf8, toBase64, toUtf8 } from \"@smithy/core/serde\";\nimport type { IdentityProviderConfig } from \"@smithy/types\";\n\nimport { defaultRpcV2ProtocolHttpAuthSchemeProvider } from \"./auth/httpAuthSchemeProvider\";\nimport { defaultEndpointResolver } from \"./endpoint/endpointResolver\";\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { errorTypeRegistries } from \"./schemas/schemas_0\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  return {\n    apiVersion: \"2020-07-14\",\n    base64Decoder: config?.base64Decoder ?? fromBase64,\n    base64Encoder: config?.base64Encoder ?? toBase64,\n    disableHostPrefix: config?.disableHostPrefix ?? false,\n    endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,\n    extensions: config?.extensions ?? [],\n    httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultRpcV2ProtocolHttpAuthSchemeProvider,\n    httpAuthSchemes: config?.httpAuthSchemes ?? [\n      {\n        schemeId: \"smithy.api#noAuth\",\n        identityProvider: (ipc: IdentityProviderConfig) =>\n          ipc.getIdentityProvider(\"smithy.api#noAuth\") || (async () => ({})),\n        signer: new NoAuthSigner(),\n      },\n    ],\n    logger: config?.logger ?? new NoOpLogger(),\n    protocol: config?.protocol ?? SmithyRpcV2CborProtocol,\n    protocolSettings: config?.protocolSettings ?? {\n      defaultNamespace: \"smithy.protocoltests.rpcv2Cbor\",\n      errorTypeRegistries,\n    },\n    urlParser: config?.urlParser ?? parseUrl,\n    utf8Decoder: config?.utf8Decoder ?? fromUtf8,\n    utf8Encoder: config?.utf8Encoder ?? toUtf8,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/runtimeConfig.ts",
    "content": "// smithy-typescript generated code\nimport { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from \"@smithy/core/client\";\nimport { loadConfig as loadNodeConfig, resolveDefaultsModeConfig } from \"@smithy/core/config\";\nimport {\n  DEFAULT_RETRY_MODE,\n  NODE_MAX_ATTEMPT_CONFIG_OPTIONS,\n  NODE_RETRY_MODE_CONFIG_OPTIONS,\n} from \"@smithy/core/retry\";\nimport { calculateBodyLength, Hash } from \"@smithy/core/serde\";\nimport { NodeHttpHandler as RequestHandler, streamCollector } from \"@smithy/node-http-handler\";\n\nimport type { RpcV2ProtocolClientConfig } from \"./RpcV2ProtocolClient\";\nimport { getRuntimeConfig as getSharedRuntimeConfig } from \"./runtimeConfig.shared\";\n\n/**\n * @internal\n */\nexport const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => {\n  emitWarningIfUnsupportedVersion(process.version);\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"node\",\n    defaultsMode,\n    bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,\n    maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),\n    requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),\n    retryMode:\n      config?.retryMode ??\n      loadNodeConfig(\n        {\n          ...NODE_RETRY_MODE_CONFIG_OPTIONS,\n          default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,\n        },\n        config\n      ),\n    sha256: config?.sha256 ?? Hash.bind(null, \"sha256\"),\n    streamCollector: config?.streamCollector ?? streamCollector,\n  };\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/runtimeExtensions.ts",
    "content": "// smithy-typescript generated code\nimport { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from \"@smithy/core/client\";\nimport { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from \"@smithy/core/protocols\";\n\nimport { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from \"./auth/httpAuthExtensionConfiguration\";\nimport type { RpcV2ProtocolExtensionConfiguration } from \"./extensionConfiguration\";\n\n/**\n * @public\n */\nexport interface RuntimeExtension {\n  configure(extensionConfiguration: RpcV2ProtocolExtensionConfiguration): void;\n}\n\n/**\n * @public\n */\nexport interface RuntimeExtensionsConfig {\n  extensions: RuntimeExtension[];\n}\n\n/**\n * @internal\n */\nexport const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {\n  const extensionConfiguration: RpcV2ProtocolExtensionConfiguration = Object.assign(\n    getDefaultExtensionConfiguration(runtimeConfig),\n    getHttpHandlerExtensionConfiguration(runtimeConfig),\n    getHttpAuthExtensionConfiguration(runtimeConfig)\n  );\n\n  extensions.forEach((extension) => extension.configure(extensionConfiguration));\n\n  return Object.assign(\n    runtimeConfig,\n    resolveDefaultRuntimeConfig(extensionConfiguration),\n    resolveHttpHandlerRuntimeConfig(extensionConfiguration),\n    resolveHttpAuthRuntimeConfig(extensionConfiguration)\n  );\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts",
    "content": "const _CE = \"ComplexError\";\nconst _CNED = \"ComplexNestedErrorData\";\nconst _COD = \"ClientOptionalDefaults\";\nconst _D = \"Defaults\";\nconst _DSM = \"DenseSetMap\";\nconst _DSMe = \"DenseStructMap\";\nconst _EIO = \"EmptyInputOutput\";\nconst _ES = \"EmptyStructure\";\nconst _F = \"Foo\";\nconst _FO = \"Float16Output\";\nconst _FS = \"FractionalSeconds\";\nconst _FSO = \"FractionalSecondsOutput\";\nconst _Fl = \"Float16\";\nconst _GS = \"GreetingStruct\";\nconst _GWE = \"GreetingWithErrors\";\nconst _GWEO = \"GreetingWithErrorsOutput\";\nconst _IG = \"InvalidGreeting\";\nconst _M = \"Message\";\nconst _N = \"Nested\";\nconst _NIO = \"NoInputOutput\";\nconst _NSL = \"NestedStringList\";\nconst _OIO = \"OptionalInputOutput\";\nconst _OWD = \"OperationWithDefaults\";\nconst _OWDI = \"OperationWithDefaultsInput\";\nconst _OWDO = \"OperationWithDefaultsOutput\";\nconst _RS = \"RecursiveShapes\";\nconst _RSIO = \"RecursiveShapesInputOutput\";\nconst _RSION = \"RecursiveShapesInputOutputNested1\";\nconst _RSIONe = \"RecursiveShapesInputOutputNested2\";\nconst _RVCDM = \"RpcV2CborDenseMaps\";\nconst _RVCDMIO = \"RpcV2CborDenseMapsInputOutput\";\nconst _RVCL = \"RpcV2CborLists\";\nconst _RVCLIO = \"RpcV2CborListInputOutput\";\nconst _RVCSM = \"RpcV2CborSparseMaps\";\nconst _RVCSMIO = \"RpcV2CborSparseMapsInputOutput\";\nconst _SBM = \"SparseBooleanMap\";\nconst _SL = \"StructureList\";\nconst _SLM = \"StructureListMember\";\nconst _SNM = \"SparseNumberMap\";\nconst _SNO = \"SparseNullsOperation\";\nconst _SNOIO = \"SparseNullsOperationInputOutput\";\nconst _SS = \"SimpleStructure\";\nconst _SSL = \"SparseStringList\";\nconst _SSM = \"SparseSetMap\";\nconst _SSMp = \"SparseStructMap\";\nconst _SSMpa = \"SparseStringMap\";\nconst _SSP = \"SimpleScalarProperties\";\nconst _SSS = \"SimpleScalarStructure\";\nconst _TL = \"TopLevel\";\nconst _VE = \"ValidationException\";\nconst _VEF = \"ValidationExceptionField\";\nconst _VEFL = \"ValidationExceptionFieldList\";\nconst _a = \"a\";\nconst _b = \"bar\";\nconst _bL = \"booleanList\";\nconst _bLl = \"blobList\";\nconst _bV = \"byteValue\";\nconst _bVl = \"blobValue\";\nconst _b_ = \"b\";\nconst _c = \"client\";\nconst _cOD = \"clientOptionalDefaults\";\nconst _d = \"datetime\";\nconst _dB = \"defaultBoolean\";\nconst _dBM = \"denseBooleanMap\";\nconst _dBe = \"defaultBlob\";\nconst _dBef = \"defaultByte\";\nconst _dD = \"defaultDouble\";\nconst _dE = \"defaultEnum\";\nconst _dF = \"defaultFloat\";\nconst _dI = \"defaultInteger\";\nconst _dIE = \"defaultIntEnum\";\nconst _dL = \"defaultList\";\nconst _dLe = \"defaultLong\";\nconst _dM = \"defaultMap\";\nconst _dNM = \"denseNumberMap\";\nconst _dS = \"defaultString\";\nconst _dSM = \"denseStructMap\";\nconst _dSMe = \"denseStringMap\";\nconst _dSMen = \"denseSetMap\";\nconst _dSe = \"defaultShort\";\nconst _dT = \"defaultTimestamp\";\nconst _dV = \"doubleValue\";\nconst _de = \"defaults\";\nconst _e = \"error\";\nconst _eB = \"emptyBlob\";\nconst _eL = \"enumList\";\nconst _eS = \"emptyString\";\nconst _f = \"foo\";\nconst _fB = \"falseBoolean\";\nconst _fBV = \"falseBooleanValue\";\nconst _fL = \"fieldList\";\nconst _fV = \"floatValue\";\nconst _g = \"greeting\";\nconst _h = \"hi\";\nconst _iEL = \"intEnumList\";\nconst _iL = \"integerList\";\nconst _iV = \"integerValue\";\nconst _lV = \"longValue\";\nconst _m = \"message\";\nconst _me = \"member\";\nconst _n = \"nested\";\nconst _nSL = \"nestedStringList\";\nconst _oTLD = \"otherTopLevelDefault\";\nconst _p = \"path\";\nconst _rM = \"recursiveMember\";\nconst _s = \"sparse\";\nconst _sBM = \"sparseBooleanMap\";\nconst _sC = \"smithy.ts.sdk.synthetic.smithy.protocoltests.rpcv2Cbor\";\nconst _sL = \"stringList\";\nconst _sLt = \"structureList\";\nconst _sNM = \"sparseNumberMap\";\nconst _sS = \"stringSet\";\nconst _sSL = \"sparseStringList\";\nconst _sSM = \"sparseStructMap\";\nconst _sSMp = \"sparseStringMap\";\nconst _sSMpa = \"sparseSetMap\";\nconst _sV = \"shortValue\";\nconst _sVt = \"stringValue\";\nconst _tBV = \"trueBooleanValue\";\nconst _tL = \"timestampList\";\nconst _tLD = \"topLevelDefault\";\nconst _v = \"value\";\nconst _zB = \"zeroByte\";\nconst _zD = \"zeroDouble\";\nconst _zF = \"zeroFloat\";\nconst _zI = \"zeroInteger\";\nconst _zL = \"zeroLong\";\nconst _zS = \"zeroShort\";\nconst n0 = \"smithy.framework\";\nconst n1 = \"smithy.protocoltests.rpcv2Cbor\";\nconst n2 = \"smithy.protocoltests.shared\";\n\n// smithy-typescript generated code\nimport { TypeRegistry } from \"@smithy/core/schema\";\nimport type {\n  StaticErrorSchema,\n  StaticListSchema,\n  StaticMapSchema,\n  StaticOperationSchema,\n  StaticStructureSchema,\n} from \"@smithy/types\";\n\nimport { ComplexError, InvalidGreeting, ValidationException } from \"../models/errors\";\nimport { RpcV2ProtocolServiceException } from \"../models/RpcV2ProtocolServiceException\";\n\n/* eslint no-var: 0 */\nconst _sC_registry = TypeRegistry.for(_sC);\nexport var RpcV2ProtocolServiceException$: StaticErrorSchema = [-3, _sC, \"RpcV2ProtocolServiceException\", 0, [], []];\n_sC_registry.registerError(RpcV2ProtocolServiceException$, RpcV2ProtocolServiceException);\nconst n0_registry = TypeRegistry.for(n0);\nconst n1_registry = TypeRegistry.for(n1);\nexport var ValidationException$: StaticErrorSchema = [-3, n0, _VE,\n  { [_e]: _c },\n  [_m, _fL],\n  [0, () => ValidationExceptionFieldList], 1\n];\nn0_registry.registerError(ValidationException$, ValidationException);\nexport var ComplexError$: StaticErrorSchema = [-3, n1, _CE,\n  { [_e]: _c },\n  [_TL, _N],\n  [0, () => ComplexNestedErrorData$]\n];\nn1_registry.registerError(ComplexError$, ComplexError);\nexport var InvalidGreeting$: StaticErrorSchema = [-3, n1, _IG,\n  { [_e]: _c },\n  [_M],\n  [0]\n];\nn1_registry.registerError(InvalidGreeting$, InvalidGreeting);\n/**\n * TypeRegistry instances containing modeled errors.\n * @internal\n *\n */\nexport const errorTypeRegistries = [\n  _sC_registry,\n  n0_registry,\n  n1_registry,\n]\nvar __Unit = \"unit\" as const;\nexport var ValidationExceptionField$: StaticStructureSchema = [3, n0, _VEF,\n  0,\n  [_p, _m],\n  [0, 0], 2\n];\nexport var ClientOptionalDefaults$: StaticStructureSchema = [3, n1, _COD,\n  0,\n  [_me],\n  [1]\n];\nexport var ComplexNestedErrorData$: StaticStructureSchema = [3, n1, _CNED,\n  0,\n  [_F],\n  [0]\n];\nexport var Defaults$: StaticStructureSchema = [3, n1, _D,\n  0,\n  [_dS, _dB, _dL, _dT, _dBe, _dBef, _dSe, _dI, _dLe, _dF, _dD, _dM, _dE, _dIE, _eS, _fB, _eB, _zB, _zS, _zI, _zL, _zF, _zD],\n  [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1]\n];\nexport var EmptyStructure$: StaticStructureSchema = [3, n1, _ES,\n  0,\n  [],\n  []\n];\nexport var Float16Output$: StaticStructureSchema = [3, n1, _FO,\n  0,\n  [_v],\n  [1]\n];\nexport var FractionalSecondsOutput$: StaticStructureSchema = [3, n1, _FSO,\n  0,\n  [_d],\n  [5]\n];\nexport var GreetingWithErrorsOutput$: StaticStructureSchema = [3, n1, _GWEO,\n  0,\n  [_g],\n  [0]\n];\nexport var OperationWithDefaultsInput$: StaticStructureSchema = [3, n1, _OWDI,\n  0,\n  [_de, _cOD, _tLD, _oTLD],\n  [() => Defaults$, () => ClientOptionalDefaults$, 0, 1]\n];\nexport var OperationWithDefaultsOutput$: StaticStructureSchema = [3, n1, _OWDO,\n  0,\n  [_dS, _dB, _dL, _dT, _dBe, _dBef, _dSe, _dI, _dLe, _dF, _dD, _dM, _dE, _dIE, _eS, _fB, _eB, _zB, _zS, _zI, _zL, _zF, _zD],\n  [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1]\n];\nexport var RecursiveShapesInputOutput$: StaticStructureSchema = [3, n1, _RSIO,\n  0,\n  [_n],\n  [() => RecursiveShapesInputOutputNested1$]\n];\nexport var RecursiveShapesInputOutputNested1$: StaticStructureSchema = [3, n1, _RSION,\n  0,\n  [_f, _n],\n  [0, () => RecursiveShapesInputOutputNested2$]\n];\nexport var RecursiveShapesInputOutputNested2$: StaticStructureSchema = [3, n1, _RSIONe,\n  0,\n  [_b, _rM],\n  [0, () => RecursiveShapesInputOutputNested1$]\n];\nexport var RpcV2CborDenseMapsInputOutput$: StaticStructureSchema = [3, n1, _RVCDMIO,\n  0,\n  [_dSM, _dNM, _dBM, _dSMe, _dSMen],\n  [() => DenseStructMap, 128 | 1, 128 | 2, 128 | 0, [2, n1, _DSM, 0, 0, 64 | 0]]\n];\nexport var RpcV2CborListInputOutput$: StaticStructureSchema = [3, n1, _RVCLIO,\n  0,\n  [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _sLt, _bLl],\n  [64 | 0, 64 | 0, 64 | 1, 64 | 2, 64 | 4, 64 | 0, 64 | 1, [1, n2, _NSL, 0, 64 | 0], () => StructureList, 64 | 21]\n];\nexport var RpcV2CborSparseMapsInputOutput$: StaticStructureSchema = [3, n1, _RVCSMIO,\n  0,\n  [_sSM, _sNM, _sBM, _sSMp, _sSMpa],\n  [[() => SparseStructMap, 0], [() => SparseNumberMap, 0], [() => SparseBooleanMap, 0], [() => SparseStringMap, 0], [() => SparseSetMap, 0]]\n];\nexport var SimpleScalarStructure$: StaticStructureSchema = [3, n1, _SSS,\n  0,\n  [_tBV, _fBV, _bV, _dV, _fV, _iV, _lV, _sV, _sVt, _bVl],\n  [2, 2, 1, 1, 1, 1, 1, 1, 0, 21]\n];\nexport var SimpleStructure$: StaticStructureSchema = [3, n1, _SS,\n  0,\n  [_v],\n  [0]\n];\nexport var SparseNullsOperationInputOutput$: StaticStructureSchema = [3, n1, _SNOIO,\n  0,\n  [_sSL, _sSMp],\n  [[() => SparseStringList, 0], [() => SparseStringMap, 0]]\n];\nexport var StructureListMember$: StaticStructureSchema = [3, n1, _SLM,\n  0,\n  [_a, _b_],\n  [0, 0]\n];\nexport var GreetingStruct$: StaticStructureSchema = [3, n2, _GS,\n  0,\n  [_h],\n  [0]\n];\nvar ValidationExceptionFieldList: StaticListSchema = [1, n0, _VEFL,\n  0, () => ValidationExceptionField$\n];\nvar StructureList: StaticListSchema = [1, n1, _SL,\n  0, () => StructureListMember$\n];\nvar TestStringList = 64 | 0;\nvar BlobList = 64 | 21;\nvar BooleanList = 64 | 2;\nvar FooEnumList = 64 | 0;\nvar IntegerEnumList = 64 | 1;\nvar IntegerList = 64 | 1;\nvar NestedStringList: StaticListSchema = [1, n2, _NSL,\n  0, 64 | 0\n];\nvar SparseStringList: StaticListSchema = [1, n2, _SSL,\n  { [_s]: 1 }, 0\n];\nvar StringList = 64 | 0;\nvar StringSet = 64 | 0;\nvar TimestampList = 64 | 4;\nvar DenseBooleanMap = 128 | 2;\nvar DenseNumberMap = 128 | 1;\nvar DenseSetMap: StaticMapSchema = [2, n1, _DSM,\n  0, 0, 64 | 0\n];\nvar DenseStringMap = 128 | 0;\nvar DenseStructMap: StaticMapSchema = [2, n1, _DSMe,\n  0, 0, () => GreetingStruct$\n];\nvar SparseBooleanMap: StaticMapSchema = [2, n1, _SBM,\n  { [_s]: 1 }, 0, 2\n];\nvar SparseNumberMap: StaticMapSchema = [2, n1, _SNM,\n  { [_s]: 1 }, 0, 1\n];\nvar SparseSetMap: StaticMapSchema = [2, n1, _SSM,\n  { [_s]: 1 }, 0, 64 | 0\n];\nvar SparseStructMap: StaticMapSchema = [2, n1, _SSMp,\n  { [_s]: 1 }, 0, () => GreetingStruct$\n];\nvar TestStringMap = 128 | 0;\nvar SparseStringMap: StaticMapSchema = [2, n2, _SSMpa,\n  { [_s]: 1 }, 0, 0\n];\nexport var EmptyInputOutput$: StaticOperationSchema = [9, n1, _EIO,\n  0, () => EmptyStructure$, () => EmptyStructure$\n];\nexport var Float16$: StaticOperationSchema = [9, n1, _Fl,\n  0, () => __Unit, () => Float16Output$\n];\nexport var FractionalSeconds$: StaticOperationSchema = [9, n1, _FS,\n  0, () => __Unit, () => FractionalSecondsOutput$\n];\nexport var GreetingWithErrors$: StaticOperationSchema = [9, n1, _GWE,\n  2, () => __Unit, () => GreetingWithErrorsOutput$\n];\nexport var NoInputOutput$: StaticOperationSchema = [9, n1, _NIO,\n  0, () => __Unit, () => __Unit\n];\nexport var OperationWithDefaults$: StaticOperationSchema = [9, n1, _OWD,\n  0, () => OperationWithDefaultsInput$, () => OperationWithDefaultsOutput$\n];\nexport var OptionalInputOutput$: StaticOperationSchema = [9, n1, _OIO,\n  0, () => SimpleStructure$, () => SimpleStructure$\n];\nexport var RecursiveShapes$: StaticOperationSchema = [9, n1, _RS,\n  0, () => RecursiveShapesInputOutput$, () => RecursiveShapesInputOutput$\n];\nexport var RpcV2CborDenseMaps$: StaticOperationSchema = [9, n1, _RVCDM,\n  0, () => RpcV2CborDenseMapsInputOutput$, () => RpcV2CborDenseMapsInputOutput$\n];\nexport var RpcV2CborLists$: StaticOperationSchema = [9, n1, _RVCL,\n  2, () => RpcV2CborListInputOutput$, () => RpcV2CborListInputOutput$\n];\nexport var RpcV2CborSparseMaps$: StaticOperationSchema = [9, n1, _RVCSM,\n  0, () => RpcV2CborSparseMapsInputOutput$, () => RpcV2CborSparseMapsInputOutput$\n];\nexport var SimpleScalarProperties$: StaticOperationSchema = [9, n1, _SSP,\n  0, () => SimpleScalarStructure$, () => SimpleScalarStructure$\n];\nexport var SparseNullsOperation$: StaticOperationSchema = [9, n1, _SNO,\n  0, () => SparseNullsOperationInputOutput$, () => SparseNullsOperationInputOutput$\n];\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/functional/rpcv2cbor.spec.ts",
    "content": "// smithy-typescript generated code\nimport { cbor } from \"@smithy/core/cbor\";\nimport { expect, test as it } from \"vitest\";\n\nimport { EmptyInputOutputCommand } from \"../../src/commands/EmptyInputOutputCommand\";\nimport { Float16Command } from \"../../src/commands/Float16Command\";\nimport { FractionalSecondsCommand } from \"../../src/commands/FractionalSecondsCommand\";\nimport { GreetingWithErrorsCommand } from \"../../src/commands/GreetingWithErrorsCommand\";\nimport { NoInputOutputCommand } from \"../../src/commands/NoInputOutputCommand\";\nimport { OperationWithDefaultsCommand } from \"../../src/commands/OperationWithDefaultsCommand\";\nimport { OptionalInputOutputCommand } from \"../../src/commands/OptionalInputOutputCommand\";\nimport { RecursiveShapesCommand } from \"../../src/commands/RecursiveShapesCommand\";\nimport { RpcV2CborDenseMapsCommand } from \"../../src/commands/RpcV2CborDenseMapsCommand\";\nimport { RpcV2CborListsCommand } from \"../../src/commands/RpcV2CborListsCommand\";\nimport { RpcV2CborSparseMapsCommand } from \"../../src/commands/RpcV2CborSparseMapsCommand\";\nimport { SimpleScalarPropertiesCommand } from \"../../src/commands/SimpleScalarPropertiesCommand\";\nimport { SparseNullsOperationCommand } from \"../../src/commands/SparseNullsOperationCommand\";\nimport { RpcV2ProtocolClient } from \"../../src/RpcV2ProtocolClient\";\nimport { Readable } from \"node:stream\";\nimport { HttpRequest, HttpResponse, type HttpHandler } from \"@smithy/core/protocols\";\nimport type { Endpoint, HeaderBag, HttpHandlerOptions } from \"@smithy/types\";\n\n/**\n * Throws an expected exception that contains the serialized request.\n */\nclass EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error {\n  constructor(readonly request: HttpRequest) {\n    super();\n  }\n}\n\n/**\n * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a\n * request. The thrown exception contains the serialized request.\n */\nclass RequestSerializationTestHandler implements HttpHandler {\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request));\n  }\n  updateHttpClientConfig(key: never, value: never): void {}\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\n/**\n * Returns a resolved Promise of the specified response contents.\n */\nclass ResponseDeserializationTestHandler implements HttpHandler {\n  isSuccess: boolean;\n  code: number;\n  headers: HeaderBag;\n  body: string | Uint8Array;\n  isBase64Body: boolean;\n\n  constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) {\n    this.isSuccess = isSuccess;\n    this.code = code;\n    if (headers === undefined) {\n      this.headers = {};\n    } else {\n      this.headers = headers;\n    }\n    if (body === undefined) {\n      body = \"\";\n    }\n    this.body = body;\n    this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), \"base64\").toString(\"base64\") === body;\n  }\n\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.resolve({\n      response: new HttpResponse({\n        statusCode: this.code,\n        headers: this.headers,\n        body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]),\n      }),\n    });\n  }\n\n  updateHttpClientConfig(key: never, value: never): void {}\n\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\ninterface comparableParts {\n  [key: string]: string;\n}\n\n/**\n * Generates a standard map of un-equal values given input parts.\n */\nconst compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => {\n  const unequalParts: any = {};\n  Object.keys(expectedParts).forEach((key) => {\n    if (generatedParts[key] === undefined) {\n      unequalParts[key] = { exp: expectedParts[key], gen: undefined };\n    } else if (!equivalentContents(expectedParts[key], generatedParts[key])) {\n      unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] };\n    }\n  });\n\n  Object.keys(generatedParts).forEach((key) => {\n    if (expectedParts[key] === undefined) {\n      unequalParts[key] = { exp: undefined, gen: generatedParts[key] };\n    }\n  });\n\n  if (Object.keys(unequalParts).length !== 0) {\n    return unequalParts;\n  }\n  return undefined;\n};\n\n/**\n * Compares all types for equivalent contents, doing nested\n * equality checks based on non-`$metadata`\n * properties that have defined values.\n */\nconst equivalentContents = (expected: any, generated: any): boolean => {\n  if (typeof (global as any).expect === \"function\") {\n    expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected));\n    return true;\n  }\n\n  let localExpected = expected;\n\n  // Short circuit on equality.\n  if (localExpected == generated) {\n    return true;\n  }\n\n  if (typeof expected !== \"object\") {\n    return expected === generated;\n  }\n\n  // If a test fails with an issue in the below 6 lines, it's likely\n  // due to an issue in the nestedness or existence of the property\n  // being compared.\n  delete localExpected[\"$metadata\"];\n  delete generated[\"$metadata\"];\n  Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]);\n  Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]);\n\n  const expectedProperties = Object.getOwnPropertyNames(localExpected);\n  const generatedProperties = Object.getOwnPropertyNames(generated);\n\n  // Short circuit on different property counts.\n  if (expectedProperties.length != generatedProperties.length) {\n    return false;\n  }\n\n  // Compare properties directly.\n  for (var index = 0; index < expectedProperties.length; index++) {\n    const propertyName = expectedProperties[index];\n    if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nconst clientParams = {\n  region: \"us-west-2\",\n  credentials: { accessKeyId: \"key\", secretAccessKey: \"secret\" },\n  apiKey: { apiKey: \"apiKey\" },\n  endpoint: {\n    url: new URL(\"https://localhost/\"),\n    headers: {\n      \"x-default-header\": [\"default-header-value\"],\n    },\n  },\n};\n\n/**\n * A wrapper function that shadows `fail` from jest-jasmine2\n * (jasmine2 was replaced with circus in > v27 as the default test runner)\n */\nconst fail = (error?: any): never => {\n  throw new Error(error);\n};\n\n/**\n * Hexadecimal to byteArray.\n */\nconst toBytes = (hex: string) => {\n  return Buffer.from(hex, \"base64\");\n};\n\nfunction normalizeByteArrayType(data: any) {\n  // normalize float32 errors\n  if (typeof data === \"number\") {\n    const u = new Uint8Array(4);\n    const dv = new DataView(u.buffer, u.byteOffset, u.byteLength);\n    dv.setFloat32(0, data);\n    return dv.getFloat32(0);\n  }\n  if (!data || typeof data !== \"object\") {\n    return data;\n  }\n  if (data instanceof Uint8Array) {\n    return Uint8Array.from(data);\n  }\n  if (data instanceof String || data instanceof Boolean || data instanceof Number) {\n    return data.valueOf();\n  }\n  const output = {} as any;\n  for (const key of Object.getOwnPropertyNames(data)) {\n    output[key] = normalizeByteArrayType(data[key]);\n  }\n  return output;\n}\n\n/**\n * When Input structure is empty we write CBOR equivalent of {}\n */\nit(\"empty_input:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new EmptyInputOutputCommand(\n    {\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/EmptyInputOutput\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(\n      r.headers[\"x-amz-target\"],\n      `Header key \"x-amz-target\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * When output structure is empty we write CBOR equivalent of {}\n */\nit(\"empty_output:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new EmptyInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * When output structure is empty the client should accept an empty body\n */\nit(\"empty_output_no_body:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      ``\n    ),\n  });\n\n  const params: any = {};\n  const command = new EmptyInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Ensures that clients can correctly parse float16 +Inf.\n */\nit(\"RpcV2CborFloat16Inf:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfl8AA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse float16 -Inf.\n */\nit(\"RpcV2CborFloat16NegInf:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfn8AA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: -Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse float16 NaN with high LSB.\n */\nit(\"RpcV2CborFloat16LSBNaN:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfl8AQ==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: NaN,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse float16 NaN with high MSB.\n */\nit(\"RpcV2CborFloat16MSBNaN:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1Zfl+AA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: NaN,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse a subnormal float16.\n */\nit(\"RpcV2CborFloat16Subnormal:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWV2YWx1ZfkAUA==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new Float16Command(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      value: 4.76837158203125E-6,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensures that clients can correctly parse timestamps with fractional seconds\n */\nit(\"RpcV2CborDateTimeWithFractionalSeconds:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2hkYXRldGltZcH7Qcw32zgPvnf/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new FractionalSecondsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      datetime: new Date(9.46845296123E8 * 1000),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Parses simple RpcV2 Cbor errors\n */\nit.skip(\"RpcV2CborInvalidGreetingError:Error:GreetingWithErrors\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      false,\n      400,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZfX3R5cGV4LnNtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNJbnZhbGlkR3JlZXRpbmdnTWVzc2FnZWJIaf8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new GreetingWithErrorsCommand(params);\n\n  try {\n    await client.send(command);\n  } catch (err) {\n    if (err.name !== \"InvalidGreeting\") {\n      console.log(err);\n      fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`);\n      return;\n    }\n    const r: any = err;\n    expect(r.$metadata.httpStatusCode).toBe(400);\n    const paramsToValidate: any = [\n      {\n        message: \"Hi\",\n      },\n    ][0];\n    Object.keys(paramsToValidate).forEach((param) => {\n      expect(\n        r[param],\n        `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n      ).toBeDefined();\n      expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n    });\n    return;\n  }\n  fail(\"Expected an exception to be thrown from response\");\n});\n\n/**\n * Parses a complex error with no message member\n */\nit.skip(\"RpcV2CborComplexError:Error:GreetingWithErrors\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      false,\n      400,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3JoVG9wTGV2ZWxpVG9wIGxldmVsZk5lc3RlZL9jRm9vY2Jhcv//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new GreetingWithErrorsCommand(params);\n\n  try {\n    await client.send(command);\n  } catch (err) {\n    if (err.name !== \"ComplexError\") {\n      console.log(err);\n      fail(`Expected a ComplexError to be thrown, got ${err.name} instead`);\n      return;\n    }\n    const r: any = err;\n    expect(r.$metadata.httpStatusCode).toBe(400);\n    const paramsToValidate: any = [\n      {\n        TopLevel: \"Top level\",\n        Nested: {\n          Foo: \"bar\",\n        },\n      },\n    ][0];\n    Object.keys(paramsToValidate).forEach((param) => {\n      expect(\n        r[param],\n        `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n      ).toBeDefined();\n      expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n    });\n    return;\n  }\n  fail(\"Expected an exception to be thrown from response\");\n});\n\nit.skip(\"RpcV2CborEmptyComplexError:Error:GreetingWithErrors\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      false,\n      400,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZfX3R5cGV4K3NtaXRoeS5wcm90b2NvbHRlc3RzLnJwY3YyQ2JvciNDb21wbGV4RXJyb3L/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new GreetingWithErrorsCommand(params);\n\n  try {\n    await client.send(command);\n  } catch (err) {\n    if (err.name !== \"ComplexError\") {\n      console.log(err);\n      fail(`Expected a ComplexError to be thrown, got ${err.name} instead`);\n      return;\n    }\n    const r: any = err;\n    expect(r.$metadata.httpStatusCode).toBe(400);\n    return;\n  }\n  fail(\"Expected an exception to be thrown from response\");\n});\n\n/**\n * Body is empty and no Content-Type header if no input\n */\nit(\"no_input:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new NoInputOutputCommand({});\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/NoInputOutput\");\n\n    expect(\n      r.headers[\"content-type\"],\n      `Header key \"content-type\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n    expect(\n      r.headers[\"x-amz-target\"],\n      `Header key \"x-amz-target\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(!r.body || r.body === `{}`).toBeTruthy();\n  }\n});\n\n/**\n * A `Content-Type` header should not be set if the response body is empty.\n */\nit(\"no_output:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n      },\n      ``\n    ),\n  });\n\n  const params: any = {};\n  const command = new NoInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Clients should accept a CBOR empty struct if there is no output.\n */\nit(\"NoOutputClientAllowsEmptyCbor:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new NoInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Clients should accept an empty body if there is no output and\n * should not raise an error if the `Content-Type` header is set.\n */\nit(\"NoOutputClientAllowsEmptyBody:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      ``\n    ),\n  });\n\n  const params: any = {};\n  const command = new NoInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Client populates default values in input.\n */\nit.skip(\"RpcV2CborClientPopulatesDefaultValuesInInput:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      defaults: {\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2hkZWZhdWx0c79tZGVmYXVsdFN0cmluZ2JoaW5kZWZhdWx0Qm9vbGVhbvVrZGVmYXVsdExpc3Sf/3BkZWZhdWx0VGltZXN0YW1wwQBrZGVmYXVsdEJsb2JDYWJja2RlZmF1bHRCeXRlAWxkZWZhdWx0U2hvcnQBbmRlZmF1bHRJbnRlZ2VyCmtkZWZhdWx0TG9uZxhkbGRlZmF1bHRGbG9hdPo/gAAAbWRlZmF1bHREb3VibGX6P4AAAGpkZWZhdWx0TWFwv/9rZGVmYXVsdEVudW1jRk9PbmRlZmF1bHRJbnRFbnVtAWtlbXB0eVN0cmluZ2BsZmFsc2VCb29sZWFu9GllbXB0eUJsb2JAaHplcm9CeXRlAGl6ZXJvU2hvcnQAa3plcm9JbnRlZ2VyAGh6ZXJvTG9uZwBpemVyb0Zsb2F0+gAAAABqemVyb0RvdWJsZfoAAAAA//8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Client skips top level default values in input.\n */\nit.skip(\"RpcV2CborClientSkipsTopLevelDefaultValuesInInput:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Client uses explicitly provided member values over defaults\n */\nit.skip(\"RpcV2CborClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      defaults: {\n        defaultString: \"bye\",\n        defaultBoolean: true,\n        defaultList: [\n          \"a\",\n        ],\n        defaultTimestamp: new Date(1000),\n        defaultBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n        defaultByte: 2,\n        defaultShort: 2,\n        defaultInteger: 20,\n        defaultLong: 200,\n        defaultFloat: 2.0,\n        defaultDouble: 2.0,\n        defaultMap: {\n          name: \"Jack\",\n        } as any,\n        defaultEnum: \"BAR\",\n        defaultIntEnum: 2,\n        emptyString: \"foo\",\n        falseBoolean: true,\n        emptyBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n        zeroByte: 1,\n        zeroShort: 1,\n        zeroInteger: 1,\n        zeroLong: 1,\n        zeroFloat: 1.0,\n        zeroDouble: 1.0,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2hkZWZhdWx0c7dtZGVmYXVsdFN0cmluZ2NieWVuZGVmYXVsdEJvb2xlYW71a2RlZmF1bHRMaXN0gWFhcGRlZmF1bHRUaW1lc3RhbXDB+z/wAAAAAAAAa2RlZmF1bHRCbG9iQmhpa2RlZmF1bHRCeXRlAmxkZWZhdWx0U2hvcnQCbmRlZmF1bHRJbnRlZ2VyFGtkZWZhdWx0TG9uZxjIbGRlZmF1bHRGbG9hdPpAAAAAbWRlZmF1bHREb3VibGX7QAAAAAAAAABqZGVmYXVsdE1hcKFkbmFtZWRKYWNra2RlZmF1bHRFbnVtY0JBUm5kZWZhdWx0SW50RW51bQJrZW1wdHlTdHJpbmdjZm9vbGZhbHNlQm9vbGVhbvVpZW1wdHlCbG9iQmhpaHplcm9CeXRlAWl6ZXJvU2hvcnQBa3plcm9JbnRlZ2VyAWh6ZXJvTG9uZwFpemVyb0Zsb2F0+j+AAABqemVyb0RvdWJsZfs/8AAAAAAAAP8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Any time a value is provided for a member in the top level of input, it is used, regardless of if its the default.\n */\nit.skip(\"RpcV2CborClientUsesExplicitlyProvidedValuesInTopLevel:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      topLevelDefault: \"hi\",\n      otherTopLevelDefault: 0,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v290b3BMZXZlbERlZmF1bHRiaGl0b3RoZXJUb3BMZXZlbERlZmF1bHQA/w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Typically, non top-level members would have defaults filled in, but if they have the clientOptional trait, the defaults should be ignored.\n */\nit.skip(\"RpcV2CborClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OperationWithDefaultsCommand(\n    {\n      clientOptionalDefaults: {\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OperationWithDefaults\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v3ZjbGllbnRPcHRpb25hbERlZmF1bHRzoP8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Client populates default values when missing in response.\n */\nit.skip(\"RpcV2CborClientPopulatesDefaultsValuesWhenMissingInResponse:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new OperationWithDefaultsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      defaultString: \"hi\",\n      defaultBoolean: true,\n      defaultList: [\n      ],\n      defaultTimestamp: new Date(0 * 1000),\n      defaultBlob: Uint8Array.from(\"abc\", (c) => c.charCodeAt(0)),\n      defaultByte: 1,\n      defaultShort: 1,\n      defaultInteger: 10,\n      defaultLong: 100,\n      defaultFloat: 1.0,\n      defaultDouble: 1.0,\n      defaultMap: {\n      },\n      defaultEnum: \"FOO\",\n      defaultIntEnum: 1,\n      emptyString: \"\",\n      falseBoolean: false,\n      emptyBlob: Uint8Array.from(\"\", (c) => c.charCodeAt(0)),\n      zeroByte: 0,\n      zeroShort: 0,\n      zeroInteger: 0,\n      zeroLong: 0,\n      zeroFloat: 0.0,\n      zeroDouble: 0.0,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Client ignores default values if member values are present in the response.\n */\nit.skip(\"RpcV2CborClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v21kZWZhdWx0U3RyaW5nY2J5ZW5kZWZhdWx0Qm9vbGVhbvRrZGVmYXVsdExpc3SBYWFwZGVmYXVsdFRpbWVzdGFtcMH7QAAAAAAAAABrZGVmYXVsdEJsb2JCaGlrZGVmYXVsdEJ5dGUCbGRlZmF1bHRTaG9ydAJuZGVmYXVsdEludGVnZXIUa2RlZmF1bHRMb25nGMhsZGVmYXVsdEZsb2F0+kAAAABtZGVmYXVsdERvdWJsZftAAAAAAAAAAGpkZWZhdWx0TWFwoWRuYW1lZEphY2trZGVmYXVsdEVudW1jQkFSbmRlZmF1bHRJbnRFbnVtAmtlbXB0eVN0cmluZ2Nmb29sZmFsc2VCb29sZWFu9WllbXB0eUJsb2JCaGloemVyb0J5dGUBaXplcm9TaG9ydAFremVyb0ludGVnZXIBaHplcm9Mb25nAWl6ZXJvRmxvYXT6P4AAAGp6ZXJvRG91Ymxl+z/wAAAAAAAA/w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new OperationWithDefaultsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      defaultString: \"bye\",\n      defaultBoolean: false,\n      defaultList: [\n        \"a\",\n      ],\n      defaultTimestamp: new Date(2 * 1000),\n      defaultBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n      defaultByte: 2,\n      defaultShort: 2,\n      defaultInteger: 20,\n      defaultLong: 200,\n      defaultFloat: 2.0,\n      defaultDouble: 2.0,\n      defaultMap: {\n        name: \"Jack\",\n      },\n      defaultEnum: \"BAR\",\n      defaultIntEnum: 2,\n      emptyString: \"foo\",\n      falseBoolean: true,\n      emptyBlob: Uint8Array.from(\"hi\", (c) => c.charCodeAt(0)),\n      zeroByte: 1,\n      zeroShort: 1,\n      zeroInteger: 1,\n      zeroLong: 1,\n      zeroFloat: 1.0,\n      zeroDouble: 1.0,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * When input is empty we write CBOR equivalent of {}\n */\nit(\"optional_input:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new OptionalInputOutputCommand(\n    {\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/OptionalInputOutput\");\n\n    expect(\n      r.headers[\"x-amz-target\"],\n      `Header key \"x-amz-target\" should have been undefined in ${JSON.stringify(r.headers)}`\n    ).toBeUndefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * When output is empty we write CBOR equivalent of {}\n */\nit(\"optional_output:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v/8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new OptionalInputOutputCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Serializes recursive structures\n */\nit(\"RpcV2CborRecursiveShapes:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RecursiveShapesCommand(\n    {\n      nested: {\n        foo: \"Foo1\",\n        nested: {\n          bar: \"Bar1\",\n          recursiveMember: {\n            foo: \"Foo2\",\n            nested: {\n              bar: \"Bar2\",\n            } as any,\n          } as any,\n        } as any,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RecursiveShapes\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes recursive structures\n */\nit(\"RpcV2CborRecursiveShapes:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RecursiveShapesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      nested: {\n        foo: \"Foo1\",\n        nested: {\n          bar: \"Bar1\",\n          recursiveMember: {\n            foo: \"Foo2\",\n            nested: {\n              bar: \"Bar2\",\n            },\n          },\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes recursive structures encoded using a map with definite length\n */\nit(\"RpcV2CborRecursiveShapesUsingDefiniteLength:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWZuZXN0ZWSiY2Zvb2RGb28xZm5lc3RlZKJjYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyomNmb29kRm9vMmZuZXN0ZWShY2JhcmRCYXIy`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RecursiveShapesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      nested: {\n        foo: \"Foo1\",\n        nested: {\n          bar: \"Bar1\",\n          recursiveMember: {\n            foo: \"Foo2\",\n            nested: {\n              bar: \"Bar2\",\n            },\n          },\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes maps\n */\nit(\"RpcV2CborMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborDenseMapsCommand(\n    {\n      denseStructMap: {\n        foo: {\n          hi: \"there\",\n        } as any,\n        baz: {\n          hi: \"bye\",\n        } as any,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborSerializesZeroValuesInMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborDenseMapsCommand(\n    {\n      denseNumberMap: {\n        x: 0,\n      } as any,\n      denseBooleanMap: {\n        x: false,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * A request that contains a dense map of sets.\n */\nit(\"RpcV2CborSerializesDenseSetMap:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborDenseMapsCommand(\n    {\n      denseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Deserializes maps\n */\nit(\"RpcV2CborMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborDenseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      denseStructMap: {\n        foo: {\n          hi: \"there\",\n        },\n        baz: {\n          hi: \"bye\",\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborDeserializesZeroValuesInMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborDenseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      denseNumberMap: {\n        x: 0,\n      },\n      denseBooleanMap: {\n        x: false,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * A response that contains a dense map of sets\n */\nit(\"RpcV2CborDeserializesDenseSetMap:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborDenseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      denseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes RpcV2 Cbor lists\n */\nit(\"RpcV2CborLists:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborListsCommand(\n    {\n      stringList: [\n        \"foo\",\n        \"bar\",\n      ],\n      stringSet: [\n        \"foo\",\n        \"bar\",\n      ],\n      integerList: [\n        1,\n        2,\n      ],\n      booleanList: [\n        true,\n        false,\n      ],\n      timestampList: [\n        new Date(1398796238000),\n        new Date(1398796238000),\n      ],\n      enumList: [\n        \"Foo\",\n        \"0\",\n      ],\n      intEnumList: [\n        1,\n        2,\n      ],\n      nestedStringList: [\n        [\n          \"foo\",\n          \"bar\",\n        ],\n        [\n          \"baz\",\n          \"qux\",\n        ],\n      ],\n      structureList: [\n        {\n          a: \"1\",\n          b: \"2\",\n        } as any,\n        {\n          a: \"3\",\n          b: \"4\",\n        } as any,\n      ],\n      blobList: [\n        Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n        Uint8Array.from(\"bar\", (c) => c.charCodeAt(0)),\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborLists\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2pzdHJpbmdMaXN0gmNmb29jYmFyaXN0cmluZ1NldIJjZm9vY2JhcmtpbnRlZ2VyTGlzdIIBAmtib29sZWFuTGlzdIL19G10aW1lc3RhbXBMaXN0gsH7QdTX+/OAAADB+0HU1/vzgAAAaGVudW1MaXN0gmNGb29hMGtpbnRFbnVtTGlzdIIBAnBuZXN0ZWRTdHJpbmdMaXN0goJjZm9vY2JhcoJjYmF6Y3F1eG1zdHJ1Y3R1cmVMaXN0gqJhYWExYWJhMqJhYWEzYWJhNGhibG9iTGlzdIJDZm9vQ2Jhcv8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes empty JSON lists\n */\nit(\"RpcV2CborListsEmpty:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborListsCommand(\n    {\n      stringList: [\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborLists\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2pzdHJpbmdMaXN0n///`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes empty JSON definite length lists\n */\nit(\"RpcV2CborListsEmptyUsingDefiniteLength:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborListsCommand(\n    {\n      stringList: [\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborLists\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `oWpzdHJpbmdMaXN0gA==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes RpcV2 Cbor lists\n */\nit(\"RpcV2CborLists:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2pzdHJpbmdMaXN0n2Nmb29jYmFy/2lzdHJpbmdTZXSfY2Zvb2NiYXL/a2ludGVnZXJMaXN0nwEC/2tib29sZWFuTGlzdJ/19P9tdGltZXN0YW1wTGlzdJ/B+0HU1/vzgAAAwftB1Nf784AAAP9oZW51bUxpc3SfY0Zvb2Ew/2tpbnRFbnVtTGlzdJ8BAv9wbmVzdGVkU3RyaW5nTGlzdJ+fY2Zvb2NiYXL/n2NiYXpjcXV4//9tc3RydWN0dXJlTGlzdJ+/YWFhMWFiYTL/v2FhYTNhYmE0//9oYmxvYkxpc3SfQ2Zvb0NiYXL//w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n        \"foo\",\n        \"bar\",\n      ],\n      stringSet: [\n        \"foo\",\n        \"bar\",\n      ],\n      integerList: [\n        1,\n        2,\n      ],\n      booleanList: [\n        true,\n        false,\n      ],\n      timestampList: [\n        new Date(1398796238 * 1000),\n        new Date(1398796238 * 1000),\n      ],\n      enumList: [\n        \"Foo\",\n        \"0\",\n      ],\n      intEnumList: [\n        1,\n        2,\n      ],\n      nestedStringList: [\n        [\n          \"foo\",\n          \"bar\",\n        ],\n        [\n          \"baz\",\n          \"qux\",\n        ],\n      ],\n      structureList: [\n        {\n          a: \"1\",\n          b: \"2\",\n        },\n        {\n          a: \"3\",\n          b: \"4\",\n        },\n      ],\n      blobList: [\n        Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n        Uint8Array.from(\"bar\", (c) => c.charCodeAt(0)),\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes empty RpcV2 Cbor lists\n */\nit(\"RpcV2CborListsEmpty:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2pzdHJpbmdMaXN0n///`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Can deserialize indefinite length text strings inside an indefinite length list\n */\nit(\"RpcV2CborIndefiniteStringInsideIndefiniteListCanDeserialize:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2pzdHJpbmdMaXN0n394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n//8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n        \"An example indefinite string, which will be chunked, on each comma\",\n        \"Another example indefinite string with only one chunk\",\n        \"This is a plain string\",\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Can deserialize indefinite length text strings inside a definite length list\n */\nit(\"RpcV2CborIndefiniteStringInsideDefiniteListCanDeserialize:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `oWpzdHJpbmdMaXN0g394HUFuIGV4YW1wbGUgaW5kZWZpbml0ZSBzdHJpbmcsdyB3aGljaCB3aWxsIGJlIGNodW5rZWQsbiBvbiBlYWNoIGNvbW1h/394NUFub3RoZXIgZXhhbXBsZSBpbmRlZmluaXRlIHN0cmluZyB3aXRoIG9ubHkgb25lIGNodW5r/3ZUaGlzIGlzIGEgcGxhaW4gc3RyaW5n`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborListsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      stringList: [\n        \"An example indefinite string, which will be chunked, on each comma\",\n        \"Another example indefinite string with only one chunk\",\n        \"This is a plain string\",\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes sparse maps\n */\nit(\"RpcV2CborSparseMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseStructMap: {\n        foo: {\n          hi: \"there\",\n        } as any,\n        baz: {\n          hi: \"bye\",\n        } as any,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes null map values in sparse maps\n */\nit(\"RpcV2CborSerializesNullMapValues:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseBooleanMap: {\n        x: null,\n      } as any,\n      sparseNumberMap: {\n        x: null,\n      } as any,\n      sparseStringMap: {\n        x: null,\n      } as any,\n      sparseStructMap: {\n        x: null,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * A request that contains a sparse map of sets\n */\nit(\"RpcV2CborSerializesSparseSetMap:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL///8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * A request that contains a sparse map of sets.\n */\nit(\"RpcV2CborSerializesSparseSetMapAndRetainsNull:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n        z: null,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborSerializesZeroValuesInSparseMaps:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new RpcV2CborSparseMapsCommand(\n    {\n      sparseNumberMap: {\n        x: 0,\n      } as any,\n      sparseBooleanMap: {\n        x: false,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Deserializes sparse maps\n */\nit(\"RpcV2CborSparseJsonMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseStructMap: {\n        foo: {\n          hi: \"there\",\n        },\n        baz: {\n          hi: \"bye\",\n        },\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes null map values\n */\nit(\"RpcV2CborDeserializesNullMapValues:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseBooleanMap: {\n        x: null,\n      },\n      sparseNumberMap: {\n        x: null,\n      },\n      sparseStringMap: {\n        x: null,\n      },\n      sparseStructMap: {\n        x: null,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * A response that contains a sparse map of sets\n */\nit(\"RpcV2CborDeserializesSparseSetMap:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2xzcGFyc2VTZXRNYXC/YXmfYWFhYv9heJ////8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * A response that contains a sparse map of sets with a null\n */\nit(\"RpcV2CborDeserializesSparseSetMapAndRetainsNull:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseSetMap: {\n        x: [\n        ],\n        y: [\n          \"a\",\n          \"b\",\n        ],\n        z: null,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Ensure that 0 and false are sent over the wire in all maps and lists\n */\nit(\"RpcV2CborDeserializesZeroValuesInSparseMaps:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new RpcV2CborSparseMapsCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseNumberMap: {\n        x: 0,\n      },\n      sparseBooleanMap: {\n        x: false,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes simple scalar properties\n */\nit(\"RpcV2CborSimpleScalarProperties:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      byteValue: 5,\n      doubleValue: 1.889,\n      falseBooleanValue: false,\n      floatValue: 7.625,\n      integerValue: 256,\n      longValue: 9873,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      trueBooleanValue: true,\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * RpcV2 Cbor should not serialize null structure values\n */\nit(\"RpcV2CborClientDoesntSerializeNullStructureValues:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      stringValue: null,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v/8=`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Supports handling NaN float values.\n */\nit(\"RpcV2CborSupportsNaNFloatInputs:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      doubleValue: NaN,\n      floatValue: NaN,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Supports handling Infinity float values.\n */\nit(\"RpcV2CborSupportsInfinityFloatInputs:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      doubleValue: Infinity,\n      floatValue: Infinity,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Supports handling Infinity float values.\n */\nit(\"RpcV2CborSupportsNegativeInfinityFloatInputs:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SimpleScalarPropertiesCommand(\n    {\n      doubleValue: -Infinity,\n      floatValue: -Infinity,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SimpleScalarProperties\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes simple scalar properties\n */\nit(\"RpcV2CborSimpleScalarProperties:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v3B0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb2//`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      trueBooleanValue: true,\n      falseBooleanValue: false,\n      byteValue: 5,\n      doubleValue: 1.889,\n      floatValue: 7.625,\n      integerValue: 256,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes simple scalar properties encoded using a map with definite length\n */\nit(\"RpcV2CborSimpleScalarPropertiesUsingDefiniteLength:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `qXB0cnVlQm9vbGVhblZhbHVl9XFmYWxzZUJvb2xlYW5WYWx1ZfRpYnl0ZVZhbHVlBWtkb3VibGVWYWx1Zfs//jlYEGJN02pmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAanNob3J0VmFsdWUZJqprc3RyaW5nVmFsdWVmc2ltcGxlaWJsb2JWYWx1ZUNmb28=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      trueBooleanValue: true,\n      falseBooleanValue: false,\n      byteValue: 5,\n      doubleValue: 1.889,\n      floatValue: 7.625,\n      integerValue: 256,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * RpcV2 Cbor should not deserialize null structure values\n */\nit(\"RpcV2CborClientDoesntDeserializeNullStructureValues:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tzdHJpbmdWYWx1Zfb/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n});\n\n/**\n * Supports handling NaN float values.\n */\nit(\"RpcV2CborSupportsNaNFloatOutputs:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: NaN,\n      floatValue: NaN,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Supports handling Infinity float values.\n */\nit(\"RpcV2CborSupportsInfinityFloatOutputs:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: Infinity,\n      floatValue: Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Supports handling Negative Infinity float values.\n */\nit(\"RpcV2CborSupportsNegativeInfinityFloatOutputs:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: -Infinity,\n      floatValue: -Infinity,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Supports upcasting from a smaller byte representation of the same data type.\n */\nit(\"RpcV2CborSupportsUpcastingDataOnDeserialize:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2tkb3VibGVWYWx1Zfk+AGpmbG9hdFZhbHVl+UegbGludGVnZXJWYWx1ZRg4aWxvbmdWYWx1ZRkBAGpzaG9ydFZhbHVlCv8=`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      doubleValue: 1.5,\n      floatValue: 7.625,\n      integerValue: 56,\n      longValue: 256,\n      shortValue: 10,\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * The client should skip over additional fields that are not part of the structure. This allows a\n * client generated against an older Smithy model to be able to communicate with a server that is\n * generated against a newer Smithy model.\n */\nit(\"RpcV2CborExtraFieldsInTheBodyShouldBeSkippedByClients:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABrZXh0cmFPYmplY3S/c2luZGVmaW5pdGVMZW5ndGhNYXC/a3dpdGhBbkFycmF5nwECA///cWRlZmluaXRlTGVuZ3RoTWFwo3J3aXRoQURlZmluaXRlQXJyYXmDAQIDeB1hbmRTb21lSW5kZWZpbml0ZUxlbmd0aFN0cmluZ3gfdGhhdCBoYXMsIGJlZW4gY2h1bmtlZCBvbiBjb21tYWxub3JtYWxTdHJpbmdjZm9vanNob3J0VmFsdWUZJw9uc29tZU90aGVyRmllbGR2dGhpcyBzaG91bGQgYmUgc2tpcHBlZP9saW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SimpleScalarPropertiesCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      byteValue: 5,\n      doubleValue: 1.889,\n      falseBooleanValue: false,\n      floatValue: 7.625,\n      integerValue: 256,\n      longValue: 9873,\n      shortValue: 9898,\n      stringValue: \"simple\",\n      trueBooleanValue: true,\n      blobValue: Uint8Array.from(\"foo\", (c) => c.charCodeAt(0)),\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Serializes null values in maps\n */\nit(\"RpcV2CborSparseMapsSerializeNullValues:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SparseNullsOperationCommand(\n    {\n      sparseStringMap: {\n        foo: null,\n      } as any,\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SparseNullsOperation\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Serializes null values in lists\n */\nit(\"RpcV2CborSparseListsSerializeNull:Request\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new RequestSerializationTestHandler(),\n  });\n\n  const command = new SparseNullsOperationCommand(\n    {\n      sparseStringList: [\n        null,\n      ],\n    } as any,\n  );\n  try {\n    await client.send(command);\n    fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n    return;\n  } catch (err) {\n    if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n      fail(err);\n      return;\n    }\n    const r = err.request;\n    expect(r.method).toBe(\"POST\");\n    expect(r.path).toBe(\"/service/RpcV2Protocol/operation/SparseNullsOperation\");\n    expect(\n      r.headers[\"content-length\"],\n      `Header key \"content-length\" should have been defined in ${JSON.stringify(r.headers)}`\n    ).toBeDefined();\n\n    expect(r.headers[\"accept\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"content-type\"]).toBe(\"application/cbor\");\n    expect(r.headers[\"smithy-protocol\"]).toBe(\"rpc-v2-cbor\");\n\n    expect(r.body, `Body was undefined.`).toBeDefined();\n    const bodyString = `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==`;\n    const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body);\n    expect(unequalParts).toBeUndefined();\n  }\n});\n\n/**\n * Deserializes null values in maps\n */\nit(\"RpcV2CborSparseMapsDeserializeNullValues:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SparseNullsOperationCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseStringMap: {\n        foo: null,\n      },\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\n/**\n * Deserializes null values in lists\n */\nit(\"RpcV2CborSparseListsDeserializeNull:Response\", async () => {\n  const client = new RpcV2ProtocolClient({\n    ...clientParams,\n    requestHandler: new ResponseDeserializationTestHandler(\n      true,\n      200,\n      {\n        \"smithy-protocol\": \"rpc-v2-cbor\",\n        \"content-type\": \"application/cbor\",\n      },\n      `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==`\n    ),\n  });\n\n  const params: any = {};\n  const command = new SparseNullsOperationCommand(params);\n\n  let r: any;\n  try {\n    r = await client.send(command);\n  } catch (err) {\n    fail(\"Expected a valid response to be returned, got \" + err);\n    return;\n  }\n  expect(r.$metadata.httpStatusCode).toBe(200);\n  const paramsToValidate: any = [\n    {\n      sparseStringList: [\n        null,\n      ],\n    },\n  ][0];\n  Object.keys(paramsToValidate).forEach((param) => {\n    expect(\n      r[param],\n      `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}`\n    ).toBeDefined();\n    expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\n  });\n});\n\nconst compareEquivalentCborBodies = (expectedBody: string, generatedBody: string | Uint8Array): undefined => {\n  expect(\n    normalizeByteArrayType(cbor.deserialize(typeof generatedBody === \"string\" ? toBytes(generatedBody) : generatedBody))\n  ).toEqual(normalizeByteArrayType(cbor.deserialize(toBytes(expectedBody))));\n  return undefined;\n};\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs",
    "content": "import {\n  ClientOptionalDefaults$,\n  ComplexError,\n  ComplexError$,\n  ComplexNestedErrorData$,\n  Defaults$,\n  EmptyInputOutput$,\n  EmptyInputOutputCommand,\n  EmptyStructure$,\n  Float16$,\n  Float16Command,\n  Float16Output$,\n  FooEnum,\n  FractionalSeconds$,\n  FractionalSecondsCommand,\n  FractionalSecondsOutput$,\n  GreetingStruct$,\n  GreetingWithErrors$,\n  GreetingWithErrorsCommand,\n  GreetingWithErrorsOutput$,\n  IntegerEnum,\n  InvalidGreeting,\n  InvalidGreeting$,\n  NoInputOutput$,\n  NoInputOutputCommand,\n  OperationWithDefaults$,\n  OperationWithDefaultsCommand,\n  OperationWithDefaultsInput$,\n  OperationWithDefaultsOutput$,\n  OptionalInputOutput$,\n  OptionalInputOutputCommand,\n  RecursiveShapes$,\n  RecursiveShapesCommand,\n  RecursiveShapesInputOutput$,\n  RecursiveShapesInputOutputNested1$,\n  RecursiveShapesInputOutputNested2$,\n  RpcV2CborDenseMaps$,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborDenseMapsInputOutput$,\n  RpcV2CborListInputOutput$,\n  RpcV2CborLists$,\n  RpcV2CborListsCommand,\n  RpcV2CborSparseMaps$,\n  RpcV2CborSparseMapsCommand,\n  RpcV2CborSparseMapsInputOutput$,\n  RpcV2Protocol,\n  RpcV2ProtocolClient,\n  RpcV2ProtocolServiceException,\n  SimpleScalarProperties$,\n  SimpleScalarPropertiesCommand,\n  SimpleScalarStructure$,\n  SimpleStructure$,\n  SparseNullsOperation$,\n  SparseNullsOperationCommand,\n  SparseNullsOperationInputOutput$,\n  StructureListMember$,\n  TestEnum,\n  TestIntEnum,\n  ValidationException,\n  ValidationException$,\n  ValidationExceptionField$,\n} from \"../dist-cjs/index.js\";\nimport assert from \"node:assert\";\n// clients\nassert(typeof RpcV2ProtocolClient === \"function\");\nassert(typeof RpcV2Protocol === \"function\");\n// commands\nassert(typeof EmptyInputOutputCommand === \"function\");\nassert(typeof EmptyInputOutput$ === \"object\");\nassert(typeof Float16Command === \"function\");\nassert(typeof Float16$ === \"object\");\nassert(typeof FractionalSecondsCommand === \"function\");\nassert(typeof FractionalSeconds$ === \"object\");\nassert(typeof GreetingWithErrorsCommand === \"function\");\nassert(typeof GreetingWithErrors$ === \"object\");\nassert(typeof NoInputOutputCommand === \"function\");\nassert(typeof NoInputOutput$ === \"object\");\nassert(typeof OperationWithDefaultsCommand === \"function\");\nassert(typeof OperationWithDefaults$ === \"object\");\nassert(typeof OptionalInputOutputCommand === \"function\");\nassert(typeof OptionalInputOutput$ === \"object\");\nassert(typeof RecursiveShapesCommand === \"function\");\nassert(typeof RecursiveShapes$ === \"object\");\nassert(typeof RpcV2CborDenseMapsCommand === \"function\");\nassert(typeof RpcV2CborDenseMaps$ === \"object\");\nassert(typeof RpcV2CborListsCommand === \"function\");\nassert(typeof RpcV2CborLists$ === \"object\");\nassert(typeof RpcV2CborSparseMapsCommand === \"function\");\nassert(typeof RpcV2CborSparseMaps$ === \"object\");\nassert(typeof SimpleScalarPropertiesCommand === \"function\");\nassert(typeof SimpleScalarProperties$ === \"object\");\nassert(typeof SparseNullsOperationCommand === \"function\");\nassert(typeof SparseNullsOperation$ === \"object\");\n// structural schemas\nassert(typeof ValidationExceptionField$ === \"object\");\nassert(typeof ClientOptionalDefaults$ === \"object\");\nassert(typeof ComplexNestedErrorData$ === \"object\");\nassert(typeof Defaults$ === \"object\");\nassert(typeof EmptyStructure$ === \"object\");\nassert(typeof Float16Output$ === \"object\");\nassert(typeof FractionalSecondsOutput$ === \"object\");\nassert(typeof GreetingWithErrorsOutput$ === \"object\");\nassert(typeof OperationWithDefaultsInput$ === \"object\");\nassert(typeof OperationWithDefaultsOutput$ === \"object\");\nassert(typeof RecursiveShapesInputOutput$ === \"object\");\nassert(typeof RecursiveShapesInputOutputNested1$ === \"object\");\nassert(typeof RecursiveShapesInputOutputNested2$ === \"object\");\nassert(typeof RpcV2CborDenseMapsInputOutput$ === \"object\");\nassert(typeof RpcV2CborListInputOutput$ === \"object\");\nassert(typeof RpcV2CborSparseMapsInputOutput$ === \"object\");\nassert(typeof SimpleScalarStructure$ === \"object\");\nassert(typeof SimpleStructure$ === \"object\");\nassert(typeof SparseNullsOperationInputOutput$ === \"object\");\nassert(typeof StructureListMember$ === \"object\");\nassert(typeof GreetingStruct$ === \"object\");\n// enums\nassert(typeof TestEnum === \"object\");\nassert(typeof TestIntEnum === \"object\");\nassert(typeof FooEnum === \"object\");\nassert(typeof IntegerEnum === \"object\");\n// errors\nassert(ValidationException.prototype instanceof RpcV2ProtocolServiceException);\nassert(typeof ValidationException$ === \"object\");\nassert(ComplexError.prototype instanceof RpcV2ProtocolServiceException);\nassert(typeof ComplexError$ === \"object\");\nassert(InvalidGreeting.prototype instanceof RpcV2ProtocolServiceException);\nassert(typeof InvalidGreeting$ === \"object\");\nassert(RpcV2ProtocolServiceException.prototype instanceof Error);\nconsole.log(`RpcV2Protocol index test passed.`);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/index-types.ts",
    "content": "// smithy-typescript generated code\nexport type {\n  RpcV2ProtocolClient,\n  RpcV2Protocol,\n  EmptyInputOutputCommand,\n  EmptyInputOutputCommandInput,\n  EmptyInputOutputCommandOutput,\n  Float16Command,\n  Float16CommandInput,\n  Float16CommandOutput,\n  FractionalSecondsCommand,\n  FractionalSecondsCommandInput,\n  FractionalSecondsCommandOutput,\n  GreetingWithErrorsCommand,\n  GreetingWithErrorsCommandInput,\n  GreetingWithErrorsCommandOutput,\n  NoInputOutputCommand,\n  NoInputOutputCommandInput,\n  NoInputOutputCommandOutput,\n  OperationWithDefaultsCommand,\n  OperationWithDefaultsCommandInput,\n  OperationWithDefaultsCommandOutput,\n  OptionalInputOutputCommand,\n  OptionalInputOutputCommandInput,\n  OptionalInputOutputCommandOutput,\n  RecursiveShapesCommand,\n  RecursiveShapesCommandInput,\n  RecursiveShapesCommandOutput,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborDenseMapsCommandInput,\n  RpcV2CborDenseMapsCommandOutput,\n  RpcV2CborListsCommand,\n  RpcV2CborListsCommandInput,\n  RpcV2CborListsCommandOutput,\n  RpcV2CborSparseMapsCommand,\n  RpcV2CborSparseMapsCommandInput,\n  RpcV2CborSparseMapsCommandOutput,\n  SimpleScalarPropertiesCommand,\n  SimpleScalarPropertiesCommandInput,\n  SimpleScalarPropertiesCommandOutput,\n  SparseNullsOperationCommand,\n  SparseNullsOperationCommandInput,\n  SparseNullsOperationCommandOutput,\n  TestEnum,\n  TestIntEnum,\n  FooEnum,\n  IntegerEnum,\n  ValidationExceptionField,\n  ClientOptionalDefaults,\n  ComplexNestedErrorData,\n  Defaults,\n  EmptyStructure,\n  Float16Output,\n  FractionalSecondsOutput,\n  GreetingWithErrorsOutput,\n  OperationWithDefaultsInput,\n  OperationWithDefaultsOutput,\n  RecursiveShapesInputOutput,\n  RecursiveShapesInputOutputNested1,\n  RecursiveShapesInputOutputNested2,\n  RpcV2CborDenseMapsInputOutput,\n  RpcV2CborListInputOutput,\n  RpcV2CborSparseMapsInputOutput,\n  SimpleScalarStructure,\n  SimpleStructure,\n  SparseNullsOperationInputOutput,\n  StructureListMember,\n  GreetingStruct,\n  ValidationException,\n  ComplexError,\n  InvalidGreeting,\n  RpcV2ProtocolServiceException,\n} from \"../dist-types/index.d\";\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/EmptyInputOutput.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/EmptyInputOutput\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 1\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/Float16.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/Float16\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/FractionalSeconds.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/FractionalSeconds\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/GreetingWithErrors.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/GreetingWithErrors\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/NoInputOutput.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/NoInputOutput\n\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[no body]\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/OperationWithDefaults.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/OperationWithDefaults\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 549\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"defaults\": {\n    \"defaultString\": \"__defaultString__\",\n    \"defaultBoolean\": false,\n    \"defaultList\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"defaultTimestamp\": {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    },\n    \"defaultBlob\": {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    \"defaultByte\": 0,\n    \"defaultShort\": 0,\n    \"defaultInteger\": 0,\n    \"defaultLong\": 0,\n    \"defaultFloat\": 0,\n    \"defaultDouble\": 0,\n    \"defaultMap\": {\n      \"key1\": \"__value__\",\n      \"key2\": \"__value__\",\n      \"key3\": \"__value__\"\n    },\n    \"defaultEnum\": \"__defaultEnum__\",\n    \"defaultIntEnum\": 0,\n    \"emptyString\": \"__emptyString__\",\n    \"falseBoolean\": false,\n    \"emptyBlob\": {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    \"zeroByte\": 0,\n    \"zeroShort\": 0,\n    \"zeroInteger\": 0,\n    \"zeroLong\": 0,\n    \"zeroFloat\": 0,\n    \"zeroDouble\": 0\n  },\n  \"clientOptionalDefaults\": {\n    \"member\": 0\n  },\n  \"topLevelDefault\": \"__topLevelDefault__\",\n  \"otherTopLevelDefault\": 0\n}\n\n[actual bytes]\n164, 104, 100, 101, 102, 97, 117, 108, 116, 115, 183, 109, 100, 101, 102, 97, 117, 108, 116, 83, 116, 114, 105, 110,\n103, 113, 95, 95, 100, 101, 102, 97, 117, 108, 116, 83, 116, 114, 105, 110, 103, 95, 95, 110, 100, 101, 102, 97,\n117, 108, 116, 66, 111, 111, 108, 101, 97, 110, 244, 107, 100, 101, 102, 97, 117, 108, 116, 76, 105, 115, 116, 131,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 112, 100, 101, 102, 97, 117, 108, 116, 84, 105, 109, 101, 115, 116, 97,\n109, 112, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59, 107, 100, 101, 102, 97, 117, 108, 116, 66, 108, 111, 98,\n68, 1, 0, 0, 1, 107, 100, 101, 102, 97, 117, 108, 116, 66, 121, 116, 101, 0, 108, 100, 101, 102, 97, 117,\n108, 116, 83, 104, 111, 114, 116, 0, 110, 100, 101, 102, 97, 117, 108, 116, 73, 110, 116, 101, 103, 101, 114, 0,\n107, 100, 101, 102, 97, 117, 108, 116, 76, 111, 110, 103, 0, 108, 100, 101, 102, 97, 117, 108, 116, 70, 108, 111,\n97, 116, 0, 109, 100, 101, 102, 97, 117, 108, 116, 68, 111, 117, 98, 108, 101, 0, 106, 100, 101, 102, 97, 117,\n108, 116, 77, 97, 112, 163, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101,\n121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117,\n101, 95, 95, 107, 100, 101, 102, 97, 117, 108, 116, 69, 110, 117, 109, 111, 95, 95, 100, 101, 102, 97, 117, 108,\n116, 69, 110, 117, 109, 95, 95, 110, 100, 101, 102, 97, 117, 108, 116, 73, 110, 116, 69, 110, 117, 109, 0, 107,\n101, 109, 112, 116, 121, 83, 116, 114, 105, 110, 103, 111, 95, 95, 101, 109, 112, 116, 121, 83, 116, 114, 105, 110,\n103, 95, 95, 108, 102, 97, 108, 115, 101, 66, 111, 111, 108, 101, 97, 110, 244, 105, 101, 109, 112, 116, 121, 66,\n108, 111, 98, 68, 1, 0, 0, 1, 104, 122, 101, 114, 111, 66, 121, 116, 101, 0, 105, 122, 101, 114, 111, 83,\n104, 111, 114, 116, 0, 107, 122, 101, 114, 111, 73, 110, 116, 101, 103, 101, 114, 0, 104, 122, 101, 114, 111, 76,\n111, 110, 103, 0, 105, 122, 101, 114, 111, 70, 108, 111, 97, 116, 0, 106, 122, 101, 114, 111, 68, 111, 117, 98,\n108, 101, 0, 118, 99, 108, 105, 101, 110, 116, 79, 112, 116, 105, 111, 110, 97, 108, 68, 101, 102, 97, 117, 108,\n116, 115, 161, 102, 109, 101, 109, 98, 101, 114, 0, 111, 116, 111, 112, 76, 101, 118, 101, 108, 68, 101, 102, 97,\n117, 108, 116, 115, 95, 95, 116, 111, 112, 76, 101, 118, 101, 108, 68, 101, 102, 97, 117, 108, 116, 95, 95, 116,\n111, 116, 104, 101, 114, 84, 111, 112, 76, 101, 118, 101, 108, 68, 101, 102, 97, 117, 108, 116, 0\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/OptionalInputOutput.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/OptionalInputOutput\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 17\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"value\": \"__value__\"\n}\n\n[actual bytes]\n161, 101, 118, 97, 108, 117, 101, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/RecursiveShapes.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/RecursiveShapes\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 107\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"nested\": {\n    \"foo\": \"__foo__\",\n    \"nested\": {\n      \"bar\": \"__bar__\",\n      \"recursiveMember\": {\n        \"foo\": \"__foo__\",\n        \"nested\": {\n          \"bar\": \"__bar__\",\n          \"recursiveMember\": {}\n        }\n      }\n    }\n  }\n}\n\n[actual bytes]\n161, 102, 110, 101, 115, 116, 101, 100, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110, 101,\n115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114, 115,\n105, 118, 101, 77, 101, 109, 98, 101, 114, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110,\n101, 115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114,\n115, 105, 118, 101, 77, 101, 109, 98, 101, 114, 160\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/RpcV2CborDenseMaps.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/RpcV2CborDenseMaps\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 325\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"denseStructMap\": {\n    \"key1\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key2\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key3\": {\n      \"hi\": \"__hi__\"\n    }\n  },\n  \"denseNumberMap\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0\n  },\n  \"denseBooleanMap\": {\n    \"key1\": false,\n    \"key2\": false,\n    \"key3\": false\n  },\n  \"denseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\"\n  },\n  \"denseSetMap\": {\n    \"key1\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key2\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key3\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ]\n  }\n}\n\n[actual bytes]\n165, 110, 100, 101, 110, 115, 101, 83, 116, 114, 117, 99, 116, 77, 97, 112, 163, 100, 107, 101, 121, 49, 161, 98,\n104, 105, 102, 95, 95, 104, 105, 95, 95, 100, 107, 101, 121, 50, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95,\n95, 100, 107, 101, 121, 51, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 110, 100, 101, 110, 115, 101, 78,\n117, 109, 98, 101, 114, 77, 97, 112, 163, 100, 107, 101, 121, 49, 0, 100, 107, 101, 121, 50, 0, 100, 107, 101,\n121, 51, 0, 111, 100, 101, 110, 115, 101, 66, 111, 111, 108, 101, 97, 110, 77, 97, 112, 163, 100, 107, 101, 121,\n49, 244, 100, 107, 101, 121, 50, 244, 100, 107, 101, 121, 51, 244, 110, 100, 101, 110, 115, 101, 83, 116, 114, 105,\n110, 103, 77, 97, 112, 163, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101,\n121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117,\n101, 95, 95, 107, 100, 101, 110, 115, 101, 83, 101, 116, 77, 97, 112, 163, 100, 107, 101, 121, 49, 131, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109,\n101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121, 50, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107,\n101, 121, 51, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/RpcV2CborLists.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/RpcV2CborLists\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 437\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"stringList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"stringSet\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"integerList\": [\n    0,\n    0,\n    0\n  ],\n  \"booleanList\": [\n    false,\n    false,\n    false\n  ],\n  \"timestampList\": [\n    {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    },\n    {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    },\n    {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    }\n  ],\n  \"enumList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"intEnumList\": [\n    0,\n    0,\n    0\n  ],\n  \"nestedStringList\": [\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ]\n  ],\n  \"structureList\": [\n    {\n      \"a\": \"__a__\",\n      \"b\": \"__b__\"\n    },\n    {\n      \"a\": \"__a__\",\n      \"b\": \"__b__\"\n    },\n    {\n      \"a\": \"__a__\",\n      \"b\": \"__b__\"\n    }\n  ],\n  \"blobList\": [\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    }\n  ]\n}\n\n[actual bytes]\n170, 106, 115, 116, 114, 105, 110, 103, 76, 105, 115, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 105, 115,\n116, 114, 105, 110, 103, 83, 101, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109,\n101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 107, 105, 110, 116, 101, 103,\n101, 114, 76, 105, 115, 116, 131, 0, 0, 0, 107, 98, 111, 111, 108, 101, 97, 110, 76, 105, 115, 116, 131, 244,\n244, 244, 109, 116, 105, 109, 101, 115, 116, 97, 109, 112, 76, 105, 115, 116, 131, 193, 251, 65, 204, 54, 196, 231,\n255, 223, 59, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59, 104,\n101, 110, 117, 109, 76, 105, 115, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109,\n101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 107, 105, 110, 116, 69, 110,\n117, 109, 76, 105, 115, 116, 131, 0, 0, 0, 112, 110, 101, 115, 116, 101, 100, 83, 116, 114, 105, 110, 103, 76,\n105, 115, 116, 131, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101,\n114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106,\n95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 109, 115, 116, 114, 117, 99, 116, 117, 114, 101, 76, 105, 115, 116,\n131, 162, 97, 97, 101, 95, 95, 97, 95, 95, 97, 98, 101, 95, 95, 98, 95, 95, 162, 97, 97, 101, 95, 95,\n97, 95, 95, 97, 98, 101, 95, 95, 98, 95, 95, 162, 97, 97, 101, 95, 95, 97, 95, 95, 97, 98, 101, 95,\n95, 98, 95, 95, 104, 98, 108, 111, 98, 76, 105, 115, 116, 131, 68, 1, 0, 0, 1, 68, 1, 0, 0, 1,\n68, 1, 0, 0, 1\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/RpcV2CborSparseMaps.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/RpcV2CborSparseMaps\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 370\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStructMap\": {\n    \"key1\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key2\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key3\": {\n      \"hi\": \"__hi__\"\n    },\n    \"sparse\": null\n  },\n  \"sparseNumberMap\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0,\n    \"sparse\": null\n  },\n  \"sparseBooleanMap\": {\n    \"key1\": false,\n    \"key2\": false,\n    \"key3\": false,\n    \"sparse\": null\n  },\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  },\n  \"sparseSetMap\": {\n    \"key1\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key2\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key3\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n165, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 117, 99, 116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 161,\n98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 100, 107, 101, 121, 50, 161, 98, 104, 105, 102, 95, 95, 104, 105,\n95, 95, 100, 107, 101, 121, 51, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 102, 115, 112, 97, 114, 115,\n101, 246, 111, 115, 112, 97, 114, 115, 101, 78, 117, 109, 98, 101, 114, 77, 97, 112, 164, 100, 107, 101, 121, 49,\n0, 100, 107, 101, 121, 50, 0, 100, 107, 101, 121, 51, 0, 102, 115, 112, 97, 114, 115, 101, 246, 112, 115, 112,\n97, 114, 115, 101, 66, 111, 111, 108, 101, 97, 110, 77, 97, 112, 164, 100, 107, 101, 121, 49, 244, 100, 107, 101,\n121, 50, 244, 100, 107, 101, 121, 51, 244, 102, 115, 112, 97, 114, 115, 101, 246, 111, 115, 112, 97, 114, 115, 101,\n83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95,\n95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95,\n118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114, 115, 101, 246, 108, 115, 112, 97, 114, 115, 101, 83, 101,\n116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121,\n50, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121, 51, 131, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 102, 115, 112, 97, 114, 115, 101, 246\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/SimpleScalarProperties.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/SimpleScalarProperties\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 154\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"trueBooleanValue\": false,\n  \"falseBooleanValue\": false,\n  \"byteValue\": 0,\n  \"doubleValue\": 0,\n  \"floatValue\": 0,\n  \"integerValue\": 0,\n  \"longValue\": 0,\n  \"shortValue\": 0,\n  \"stringValue\": \"__stringValue__\",\n  \"blobValue\": {\n    \"type\": \"Buffer\",\n    \"data\": [\n      1,\n      0,\n      0,\n      1\n    ]\n  }\n}\n\n[actual bytes]\n170, 112, 116, 114, 117, 101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 113, 102, 97, 108, 115,\n101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 105, 98, 121, 116, 101, 86, 97, 108, 117, 101,\n0, 107, 100, 111, 117, 98, 108, 101, 86, 97, 108, 117, 101, 0, 106, 102, 108, 111, 97, 116, 86, 97, 108, 117,\n101, 0, 108, 105, 110, 116, 101, 103, 101, 114, 86, 97, 108, 117, 101, 0, 105, 108, 111, 110, 103, 86, 97, 108,\n117, 101, 0, 106, 115, 104, 111, 114, 116, 86, 97, 108, 117, 101, 0, 107, 115, 116, 114, 105, 110, 103, 86, 97,\n108, 117, 101, 111, 95, 95, 115, 116, 114, 105, 110, 103, 86, 97, 108, 117, 101, 95, 95, 105, 98, 108, 111, 98,\n86, 97, 108, 117, 101, 68, 1, 0, 0, 1\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/req/SparseNullsOperation.txt",
    "content": "POST https://localhost \n/mock-required-endpoint/service/RpcV2Protocol/operation/SparseNullsOperation\n\ncontent-type: application/cbor\nsmithy-protocol: rpc-v2-cbor\naccept: application/cbor\ncontent-length: 123\namz-sdk-invocation-id: 1111abcd-uuid-uuid-uuid-000000001111\namz-sdk-request: attempt=1; max=3\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStringList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\",\n    null\n  ],\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n162, 112, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 76, 105, 115, 116, 132, 106, 95, 95, 109, 101,\n109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 246, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107,\n101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108,\n117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114,\n115, 101, 246\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/EmptyInputOutput.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/Float16.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"value\": 0\n}\n\n[actual bytes]\n161, 101, 118, 97, 108, 117, 101, 0\n\n\n--- [output object] ---\n{\n  value: (number) 0,\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/FractionalSeconds.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"datetime\": {\n    \"tag\": 1,\n    \"value\": 946702799.999\n  }\n}\n\n[actual bytes]\n161, 104, 100, 97, 116, 101, 116, 105, 109, 101, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59\n\n\n--- [output object] ---\n{\n  datetime: (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time,\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/GreetingWithErrors.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"greeting\": \"__greeting__\"\n}\n\n[actual bytes]\n161, 104, 103, 114, 101, 101, 116, 105, 110, 103, 108, 95, 95, 103, 114, 101, 101, 116, 105, 110, 103, 95, 95\n\n\n--- [output object] ---\n{\n  greeting: \"__greeting__\",\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/NoInputOutput.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/OperationWithDefaults.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"defaultString\": \"__defaultString__\",\n  \"defaultBoolean\": false,\n  \"defaultList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"defaultTimestamp\": {\n    \"tag\": 1,\n    \"value\": 946702799.999\n  },\n  \"defaultBlob\": {\n    \"type\": \"Buffer\",\n    \"data\": [\n      1,\n      0,\n      0,\n      1\n    ]\n  },\n  \"defaultByte\": 0,\n  \"defaultShort\": 0,\n  \"defaultInteger\": 0,\n  \"defaultLong\": 0,\n  \"defaultFloat\": 0,\n  \"defaultDouble\": 0,\n  \"defaultMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\"\n  },\n  \"defaultEnum\": \"__defaultEnum__\",\n  \"defaultIntEnum\": 0,\n  \"emptyString\": \"__emptyString__\",\n  \"falseBoolean\": false,\n  \"emptyBlob\": {\n    \"type\": \"Buffer\",\n    \"data\": [\n      1,\n      0,\n      0,\n      1\n    ]\n  },\n  \"zeroByte\": 0,\n  \"zeroShort\": 0,\n  \"zeroInteger\": 0,\n  \"zeroLong\": 0,\n  \"zeroFloat\": 0,\n  \"zeroDouble\": 0\n}\n\n[actual bytes]\n183, 109, 100, 101, 102, 97, 117, 108, 116, 83, 116, 114, 105, 110, 103, 113, 95, 95, 100, 101, 102, 97, 117, 108,\n116, 83, 116, 114, 105, 110, 103, 95, 95, 110, 100, 101, 102, 97, 117, 108, 116, 66, 111, 111, 108, 101, 97, 110,\n244, 107, 100, 101, 102, 97, 117, 108, 116, 76, 105, 115, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95,\n95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 112,\n100, 101, 102, 97, 117, 108, 116, 84, 105, 109, 101, 115, 116, 97, 109, 112, 193, 251, 65, 204, 54, 196, 231, 255,\n223, 59, 107, 100, 101, 102, 97, 117, 108, 116, 66, 108, 111, 98, 68, 1, 0, 0, 1, 107, 100, 101, 102, 97,\n117, 108, 116, 66, 121, 116, 101, 0, 108, 100, 101, 102, 97, 117, 108, 116, 83, 104, 111, 114, 116, 0, 110, 100,\n101, 102, 97, 117, 108, 116, 73, 110, 116, 101, 103, 101, 114, 0, 107, 100, 101, 102, 97, 117, 108, 116, 76, 111,\n110, 103, 0, 108, 100, 101, 102, 97, 117, 108, 116, 70, 108, 111, 97, 116, 0, 109, 100, 101, 102, 97, 117, 108,\n116, 68, 111, 117, 98, 108, 101, 0, 106, 100, 101, 102, 97, 117, 108, 116, 77, 97, 112, 163, 100, 107, 101, 121,\n49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108, 117, 101,\n95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 107, 100, 101, 102, 97, 117, 108,\n116, 69, 110, 117, 109, 111, 95, 95, 100, 101, 102, 97, 117, 108, 116, 69, 110, 117, 109, 95, 95, 110, 100, 101,\n102, 97, 117, 108, 116, 73, 110, 116, 69, 110, 117, 109, 0, 107, 101, 109, 112, 116, 121, 83, 116, 114, 105, 110,\n103, 111, 95, 95, 101, 109, 112, 116, 121, 83, 116, 114, 105, 110, 103, 95, 95, 108, 102, 97, 108, 115, 101, 66,\n111, 111, 108, 101, 97, 110, 244, 105, 101, 109, 112, 116, 121, 66, 108, 111, 98, 68, 1, 0, 0, 1, 104, 122,\n101, 114, 111, 66, 121, 116, 101, 0, 105, 122, 101, 114, 111, 83, 104, 111, 114, 116, 0, 107, 122, 101, 114, 111,\n73, 110, 116, 101, 103, 101, 114, 0, 104, 122, 101, 114, 111, 76, 111, 110, 103, 0, 105, 122, 101, 114, 111, 70,\n108, 111, 97, 116, 0, 106, 122, 101, 114, 111, 68, 111, 117, 98, 108, 101, 0\n\n\n--- [output object] ---\n{\n  defaultString: \"__defaultString__\",\n  defaultBoolean: (boolean) false,\n  defaultList: [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  defaultTimestamp: (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time,\n  defaultBlob: (Uint8Array) bytes[1, 0, 0, 1],\n  defaultByte: (number) 0,\n  defaultShort: (number) 0,\n  defaultInteger: (number) 0,\n  defaultLong: (number) 0,\n  defaultFloat: (number) 0,\n  defaultDouble: (number) 0,\n  defaultMap: {\n    key1: \"__value__\",\n    key2: \"__value__\",\n    key3: \"__value__\"\n  },\n  defaultEnum: \"__defaultEnum__\",\n  defaultIntEnum: (number) 0,\n  emptyString: \"__emptyString__\",\n  falseBoolean: (boolean) false,\n  emptyBlob: (Uint8Array) bytes[1, 0, 0, 1],\n  zeroByte: (number) 0,\n  zeroShort: (number) 0,\n  zeroInteger: (number) 0,\n  zeroLong: (number) 0,\n  zeroFloat: (number) 0,\n  zeroDouble: (number) 0,\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/OptionalInputOutput.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"value\": \"__value__\"\n}\n\n[actual bytes]\n161, 101, 118, 97, 108, 117, 101, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95\n\n\n--- [output object] ---\n{\n  value: \"__value__\",\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/RecursiveShapes.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"nested\": {\n    \"foo\": \"__foo__\",\n    \"nested\": {\n      \"bar\": \"__bar__\",\n      \"recursiveMember\": {\n        \"foo\": \"__foo__\",\n        \"nested\": {\n          \"bar\": \"__bar__\",\n          \"recursiveMember\": {}\n        }\n      }\n    }\n  }\n}\n\n[actual bytes]\n161, 102, 110, 101, 115, 116, 101, 100, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110, 101,\n115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114, 115,\n105, 118, 101, 77, 101, 109, 98, 101, 114, 162, 99, 102, 111, 111, 103, 95, 95, 102, 111, 111, 95, 95, 102, 110,\n101, 115, 116, 101, 100, 162, 99, 98, 97, 114, 103, 95, 95, 98, 97, 114, 95, 95, 111, 114, 101, 99, 117, 114,\n115, 105, 118, 101, 77, 101, 109, 98, 101, 114, 160\n\n\n--- [output object] ---\n{\n  nested: {\n    foo: \"__foo__\",\n    nested: {\n      bar: \"__bar__\",\n      recursiveMember: {\n        foo: \"__foo__\",\n        nested: {\n          bar: \"__bar__\",\n          recursiveMember: {}\n        }\n      }\n    }\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/RpcV2CborDenseMaps.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"denseStructMap\": {\n    \"key1\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key2\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key3\": {\n      \"hi\": \"__hi__\"\n    }\n  },\n  \"denseNumberMap\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0\n  },\n  \"denseBooleanMap\": {\n    \"key1\": false,\n    \"key2\": false,\n    \"key3\": false\n  },\n  \"denseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\"\n  },\n  \"denseSetMap\": {\n    \"key1\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key2\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key3\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ]\n  }\n}\n\n[actual bytes]\n165, 110, 100, 101, 110, 115, 101, 83, 116, 114, 117, 99, 116, 77, 97, 112, 163, 100, 107, 101, 121, 49, 161, 98,\n104, 105, 102, 95, 95, 104, 105, 95, 95, 100, 107, 101, 121, 50, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95,\n95, 100, 107, 101, 121, 51, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 110, 100, 101, 110, 115, 101, 78,\n117, 109, 98, 101, 114, 77, 97, 112, 163, 100, 107, 101, 121, 49, 0, 100, 107, 101, 121, 50, 0, 100, 107, 101,\n121, 51, 0, 111, 100, 101, 110, 115, 101, 66, 111, 111, 108, 101, 97, 110, 77, 97, 112, 163, 100, 107, 101, 121,\n49, 244, 100, 107, 101, 121, 50, 244, 100, 107, 101, 121, 51, 244, 110, 100, 101, 110, 115, 101, 83, 116, 114, 105,\n110, 103, 77, 97, 112, 163, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101,\n121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117,\n101, 95, 95, 107, 100, 101, 110, 115, 101, 83, 101, 116, 77, 97, 112, 163, 100, 107, 101, 121, 49, 131, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109,\n101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121, 50, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107,\n101, 121, 51, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95\n\n\n--- [output object] ---\n{\n  denseStructMap: {\n    key1: {\n      hi: \"__hi__\"\n    },\n    key2: {\n      hi: \"__hi__\"\n    },\n    key3: {\n      hi: \"__hi__\"\n    }\n  },\n  denseNumberMap: {\n    key1: (number) 0,\n    key2: (number) 0,\n    key3: (number) 0\n  },\n  denseBooleanMap: {\n    key1: (boolean) false,\n    key2: (boolean) false,\n    key3: (boolean) false\n  },\n  denseStringMap: {\n    key1: \"__value__\",\n    key2: \"__value__\",\n    key3: \"__value__\"\n  },\n  denseSetMap: {\n    key1: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    key2: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    key3: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ]\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/RpcV2CborLists.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"stringList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"stringSet\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"integerList\": [\n    0,\n    0,\n    0\n  ],\n  \"booleanList\": [\n    false,\n    false,\n    false\n  ],\n  \"timestampList\": [\n    {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    },\n    {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    },\n    {\n      \"tag\": 1,\n      \"value\": 946702799.999\n    }\n  ],\n  \"enumList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  \"intEnumList\": [\n    0,\n    0,\n    0\n  ],\n  \"nestedStringList\": [\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ]\n  ],\n  \"structureList\": [\n    {\n      \"a\": \"__a__\",\n      \"b\": \"__b__\"\n    },\n    {\n      \"a\": \"__a__\",\n      \"b\": \"__b__\"\n    },\n    {\n      \"a\": \"__a__\",\n      \"b\": \"__b__\"\n    }\n  ],\n  \"blobList\": [\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    },\n    {\n      \"type\": \"Buffer\",\n      \"data\": [\n        1,\n        0,\n        0,\n        1\n      ]\n    }\n  ]\n}\n\n[actual bytes]\n170, 106, 115, 116, 114, 105, 110, 103, 76, 105, 115, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 105, 115,\n116, 114, 105, 110, 103, 83, 101, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109,\n101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 107, 105, 110, 116, 101, 103,\n101, 114, 76, 105, 115, 116, 131, 0, 0, 0, 107, 98, 111, 111, 108, 101, 97, 110, 76, 105, 115, 116, 131, 244,\n244, 244, 109, 116, 105, 109, 101, 115, 116, 97, 109, 112, 76, 105, 115, 116, 131, 193, 251, 65, 204, 54, 196, 231,\n255, 223, 59, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59, 193, 251, 65, 204, 54, 196, 231, 255, 223, 59, 104,\n101, 110, 117, 109, 76, 105, 115, 116, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109,\n101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 107, 105, 110, 116, 69, 110,\n117, 109, 76, 105, 115, 116, 131, 0, 0, 0, 112, 110, 101, 115, 116, 101, 100, 83, 116, 114, 105, 110, 103, 76,\n105, 115, 116, 131, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101,\n114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106,\n95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 109, 115, 116, 114, 117, 99, 116, 117, 114, 101, 76, 105, 115, 116,\n131, 162, 97, 97, 101, 95, 95, 97, 95, 95, 97, 98, 101, 95, 95, 98, 95, 95, 162, 97, 97, 101, 95, 95,\n97, 95, 95, 97, 98, 101, 95, 95, 98, 95, 95, 162, 97, 97, 101, 95, 95, 97, 95, 95, 97, 98, 101, 95,\n95, 98, 95, 95, 104, 98, 108, 111, 98, 76, 105, 115, 116, 131, 68, 1, 0, 0, 1, 68, 1, 0, 0, 1,\n68, 1, 0, 0, 1\n\n\n--- [output object] ---\n{\n  stringList: [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  stringSet: [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  integerList: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  booleanList: [\n    (boolean) false,\n    (boolean) false,\n    (boolean) false\n  ],\n  timestampList: [\n    (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time,\n    (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time,\n    (Date) Fri, Dec 31, 1999, 20:59:59 Pacific Standard Time\n  ],\n  enumList: [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\"\n  ],\n  intEnumList: [\n    (number) 0,\n    (number) 0,\n    (number) 0\n  ],\n  nestedStringList: [\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ]\n  ],\n  structureList: [\n    {\n      a: \"__a__\",\n      b: \"__b__\"\n    },\n    {\n      a: \"__a__\",\n      b: \"__b__\"\n    },\n    {\n      a: \"__a__\",\n      b: \"__b__\"\n    }\n  ],\n  blobList: [\n    (Uint8Array) bytes[1, 0, 0, 1],\n    (Uint8Array) bytes[1, 0, 0, 1],\n    (Uint8Array) bytes[1, 0, 0, 1]\n  ],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/RpcV2CborSparseMaps.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStructMap\": {\n    \"key1\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key2\": {\n      \"hi\": \"__hi__\"\n    },\n    \"key3\": {\n      \"hi\": \"__hi__\"\n    },\n    \"sparse\": null\n  },\n  \"sparseNumberMap\": {\n    \"key1\": 0,\n    \"key2\": 0,\n    \"key3\": 0,\n    \"sparse\": null\n  },\n  \"sparseBooleanMap\": {\n    \"key1\": false,\n    \"key2\": false,\n    \"key3\": false,\n    \"sparse\": null\n  },\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  },\n  \"sparseSetMap\": {\n    \"key1\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key2\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"key3\": [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n165, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 117, 99, 116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 161,\n98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 100, 107, 101, 121, 50, 161, 98, 104, 105, 102, 95, 95, 104, 105,\n95, 95, 100, 107, 101, 121, 51, 161, 98, 104, 105, 102, 95, 95, 104, 105, 95, 95, 102, 115, 112, 97, 114, 115,\n101, 246, 111, 115, 112, 97, 114, 115, 101, 78, 117, 109, 98, 101, 114, 77, 97, 112, 164, 100, 107, 101, 121, 49,\n0, 100, 107, 101, 121, 50, 0, 100, 107, 101, 121, 51, 0, 102, 115, 112, 97, 114, 115, 101, 246, 112, 115, 112,\n97, 114, 115, 101, 66, 111, 111, 108, 101, 97, 110, 77, 97, 112, 164, 100, 107, 101, 121, 49, 244, 100, 107, 101,\n121, 50, 244, 100, 107, 101, 121, 51, 244, 102, 115, 112, 97, 114, 115, 101, 246, 111, 115, 112, 97, 114, 115, 101,\n83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107, 101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95,\n95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95,\n118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114, 115, 101, 246, 108, 115, 112, 97, 114, 115, 101, 83, 101,\n116, 77, 97, 112, 164, 100, 107, 101, 121, 49, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95,\n95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121,\n50, 131, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95,\n106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 100, 107, 101, 121, 51, 131, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114,\n95, 95, 102, 115, 112, 97, 114, 115, 101, 246\n\n\n--- [output object] ---\n{\n  sparseStructMap: {\n    key1: {\n      hi: \"__hi__\"\n    },\n    key2: {\n      hi: \"__hi__\"\n    },\n    key3: {\n      hi: \"__hi__\"\n    },\n    sparse: (null)\n  },\n  sparseNumberMap: {\n    key1: (number) 0,\n    key2: (number) 0,\n    key3: (number) 0,\n    sparse: (null)\n  },\n  sparseBooleanMap: {\n    key1: (boolean) false,\n    key2: (boolean) false,\n    key3: (boolean) false,\n    sparse: (null)\n  },\n  sparseStringMap: {\n    key1: \"__value__\",\n    key2: \"__value__\",\n    key3: \"__value__\",\n    sparse: (null)\n  },\n  sparseSetMap: {\n    key1: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    key2: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    key3: [\n      \"__member__\",\n      \"__member__\",\n      \"__member__\"\n    ],\n    sparse: (null)\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/SimpleScalarProperties.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"trueBooleanValue\": false,\n  \"falseBooleanValue\": false,\n  \"byteValue\": 0,\n  \"doubleValue\": 0,\n  \"floatValue\": 0,\n  \"integerValue\": 0,\n  \"longValue\": 0,\n  \"shortValue\": 0,\n  \"stringValue\": \"__stringValue__\",\n  \"blobValue\": {\n    \"type\": \"Buffer\",\n    \"data\": [\n      1,\n      0,\n      0,\n      1\n    ]\n  }\n}\n\n[actual bytes]\n170, 112, 116, 114, 117, 101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 113, 102, 97, 108, 115,\n101, 66, 111, 111, 108, 101, 97, 110, 86, 97, 108, 117, 101, 244, 105, 98, 121, 116, 101, 86, 97, 108, 117, 101,\n0, 107, 100, 111, 117, 98, 108, 101, 86, 97, 108, 117, 101, 0, 106, 102, 108, 111, 97, 116, 86, 97, 108, 117,\n101, 0, 108, 105, 110, 116, 101, 103, 101, 114, 86, 97, 108, 117, 101, 0, 105, 108, 111, 110, 103, 86, 97, 108,\n117, 101, 0, 106, 115, 104, 111, 114, 116, 86, 97, 108, 117, 101, 0, 107, 115, 116, 114, 105, 110, 103, 86, 97,\n108, 117, 101, 111, 95, 95, 115, 116, 114, 105, 110, 103, 86, 97, 108, 117, 101, 95, 95, 105, 98, 108, 111, 98,\n86, 97, 108, 117, 101, 68, 1, 0, 0, 1\n\n\n--- [output object] ---\n{\n  trueBooleanValue: (boolean) false,\n  falseBooleanValue: (boolean) false,\n  byteValue: (number) 0,\n  doubleValue: (number) 0,\n  floatValue: (number) 0,\n  integerValue: (number) 0,\n  longValue: (number) 0,\n  shortValue: (number) 0,\n  stringValue: \"__stringValue__\",\n  blobValue: (Uint8Array) bytes[1, 0, 0, 1],\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res/SparseNullsOperation.txt",
    "content": "======================== minimal response ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{}\n\n[actual bytes]\n160\n\n\n--- [output object] ---\n{\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n======================== w/ optional fields ========================\n[status] 200\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"sparseStringList\": [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\",\n    null\n  ],\n  \"sparseStringMap\": {\n    \"key1\": \"__value__\",\n    \"key2\": \"__value__\",\n    \"key3\": \"__value__\",\n    \"sparse\": null\n  }\n}\n\n[actual bytes]\n162, 112, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 76, 105, 115, 116, 132, 106, 95, 95, 109, 101,\n109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98, 101, 114, 95, 95, 106, 95, 95, 109, 101, 109, 98,\n101, 114, 95, 95, 246, 111, 115, 112, 97, 114, 115, 101, 83, 116, 114, 105, 110, 103, 77, 97, 112, 164, 100, 107,\n101, 121, 49, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 100, 107, 101, 121, 50, 105, 95, 95, 118, 97, 108,\n117, 101, 95, 95, 100, 107, 101, 121, 51, 105, 95, 95, 118, 97, 108, 117, 101, 95, 95, 102, 115, 112, 97, 114,\n115, 101, 246\n\n\n--- [output object] ---\n{\n  sparseStringList: [\n    \"__member__\",\n    \"__member__\",\n    \"__member__\",\n    (null)\n  ],\n  sparseStringMap: {\n    key1: \"__value__\",\n    key2: \"__value__\",\n    key3: \"__value__\",\n    sparse: (null)\n  },\n  $metadata: {\n    httpStatusCode: (number) 200,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  }\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res-err/ComplexError.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#ComplexError\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 43, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 67, 111, 109, 112, 108, 101, 120,\n69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nComplexError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ComplexError\",\n  TopLevel: (undefined),\n  Nested: (undefined),\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"TopLevel\": \"__TopLevel__\",\n  \"Nested\": {\n    \"Foo\": \"__Foo__\"\n  },\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#ComplexError\"\n}\n\n[actual bytes]\n163, 104, 84, 111, 112, 76, 101, 118, 101, 108, 108, 95, 95, 84, 111, 112, 76, 101, 118, 101, 108, 95, 95, 102,\n78, 101, 115, 116, 101, 100, 161, 99, 70, 111, 111, 103, 95, 95, 70, 111, 111, 95, 95, 102, 95, 95, 116, 121,\n112, 101, 120, 43, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111, 108, 116, 101, 115, 116, 115,\n46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 67, 111, 109, 112, 108, 101, 120, 69, 114, 114, 111, 114\n\n\n--- [error name & message] ---\nComplexError: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ComplexError\",\n  TopLevel: \"__TopLevel__\",\n  Nested: {\n    Foo: \"__Foo__\"\n  },\n  message: \"Unknown\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res-err/InvalidGreeting.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#InvalidGreeting\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 46, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 73, 110, 118, 97, 108, 105, 100,\n71, 114, 101, 101, 116, 105, 110, 103\n\n\n--- [error name & message] ---\nInvalidGreeting: Unknown\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"InvalidGreeting\",\n  Message: (undefined),\n  message: \"Unknown\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"Message\": \"__Message__\",\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#InvalidGreeting\"\n}\n\n[actual bytes]\n162, 103, 77, 101, 115, 115, 97, 103, 101, 107, 95, 95, 77, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 120, 46, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111, 108, 116, 101, 115,\n116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 73, 110, 118, 97, 108, 105, 100, 71, 114, 101, 101,\n116, 105, 110, 103\n\n\n--- [error name & message] ---\nInvalidGreeting: __Message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"InvalidGreeting\",\n  Message: \"__Message__\",\n  message: \"__Message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res-err/UnmodeledServiceException.txt",
    "content": "======================== minimal response ========================\n[status] 500\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\"\n}\n\n[actual bytes]\n161, 102, 95, 95, 116, 121, 112, 101, 120, 56, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111,\n108, 116, 101, 115, 116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 85, 110, 109, 111, 100, 101, 108,\n101, 100, 83, 101, 114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nUnmodeledServiceException: \n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"UnmodeledServiceException\",\n  __type: \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\"\n}\n\n======================== w/ optional fields ========================\n[status] 500\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"Message\": \"__Message__\",\n  \"__type\": \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\"\n}\n\n[actual bytes]\n162, 103, 77, 101, 115, 115, 97, 103, 101, 107, 95, 95, 77, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95,\n116, 121, 112, 101, 120, 56, 115, 109, 105, 116, 104, 121, 46, 112, 114, 111, 116, 111, 99, 111, 108, 116, 101, 115,\n116, 115, 46, 114, 112, 99, 118, 50, 67, 98, 111, 114, 35, 85, 110, 109, 111, 100, 101, 108, 101, 100, 83, 101,\n114, 118, 105, 99, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nUnmodeledServiceException: __Message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"UnmodeledServiceException\",\n  Message: \"__Message__\",\n  __type: \"smithy.protocoltests.rpcv2Cbor#UnmodeledServiceException\",\n  message: \"__Message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots/res-err/ValidationException.txt",
    "content": "======================== minimal response ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"message\": \"__message__\",\n  \"fieldList\": [\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    }\n  ],\n  \"__type\": \"smithy.framework#ValidationException\"\n}\n\n[actual bytes]\n163, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 105, 102, 105,\n101, 108, 100, 76, 105, 115, 116, 131, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103,\n109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116,\n104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115,\n115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101,\n115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95, 116, 121, 112, 101,\n120, 36, 115, 109, 105, 116, 104, 121, 46, 102, 114, 97, 109, 101, 119, 111, 114, 107, 35, 86, 97, 108, 105, 100,\n97, 116, 105, 111, 110, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nValidationException: __message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ValidationException\",\n  fieldList: [\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    }\n  ],\n  message: \"__message__\"\n}\n\n======================== w/ optional fields ========================\n[status] 400\n  \nsmithy-protocol: rpc-v2-cbor\ncontent-type: application/cbor\n\n[Uint8Array (cbor object view)]\n{\n  \"message\": \"__message__\",\n  \"fieldList\": [\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    },\n    {\n      \"path\": \"__path__\",\n      \"message\": \"__message__\"\n    }\n  ],\n  \"__type\": \"smithy.framework#ValidationException\"\n}\n\n[actual bytes]\n163, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 105, 102, 105,\n101, 108, 100, 76, 105, 115, 116, 131, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103,\n109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116,\n104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101, 115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115,\n115, 97, 103, 101, 95, 95, 162, 100, 112, 97, 116, 104, 104, 95, 95, 112, 97, 116, 104, 95, 95, 103, 109, 101,\n115, 115, 97, 103, 101, 107, 95, 95, 109, 101, 115, 115, 97, 103, 101, 95, 95, 102, 95, 95, 116, 121, 112, 101,\n120, 36, 115, 109, 105, 116, 104, 121, 46, 102, 114, 97, 109, 101, 119, 111, 114, 107, 35, 86, 97, 108, 105, 100,\n97, 116, 105, 111, 110, 69, 120, 99, 101, 112, 116, 105, 111, 110\n\n\n--- [error name & message] ---\nValidationException: __message__\n\n--- [error object] ---\n{\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 400,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"ValidationException\",\n  fieldList: [\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    },\n    {\n      path: \"__path__\",\n      message: \"__message__\"\n    }\n  ],\n  message: \"__message__\"\n}\n\n======================== frontend error ========================\n[status] 500\n  \ncontent-type: text/html\n\n[Uint8Array (text)]\nAn unmodeled error occurred in a front end layer.\n\n\n--- [error name & message] ---\nUnknown: \n\n--- [error object] ---\n{\n  0: (number) 110,\n  $fault: \"client\",\n  $retryable: (undefined),\n  $metadata: {\n    httpStatusCode: (number) 500,\n    requestId: (undefined),\n    extendedRequestId: (undefined),\n    cfId: (undefined),\n    attempts: (number) 1,\n    totalRetryDelay: (number) 0\n  },\n  name: \"Unknown\"\n}\n\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/test/snapshots.integ.spec.ts",
    "content": "// smithy-typescript generated code\nimport { SnapshotRunner } from \"@smithy/snapshot-testing\";\nimport { join } from \"node:path\";\nimport { describe, expect, test as it, vi } from \"vitest\";\n\nimport {\n  ComplexError$,\n  EmptyInputOutput$,\n  EmptyInputOutputCommand,\n  Float16$,\n  Float16Command,\n  FractionalSeconds$,\n  FractionalSecondsCommand,\n  GreetingWithErrors$,\n  GreetingWithErrorsCommand,\n  InvalidGreeting$,\n  NoInputOutput$,\n  NoInputOutputCommand,\n  OperationWithDefaults$,\n  OperationWithDefaultsCommand,\n  OptionalInputOutput$,\n  OptionalInputOutputCommand,\n  RecursiveShapes$,\n  RecursiveShapesCommand,\n  RpcV2CborDenseMaps$,\n  RpcV2CborDenseMapsCommand,\n  RpcV2CborLists$,\n  RpcV2CborListsCommand,\n  RpcV2CborSparseMaps$,\n  RpcV2CborSparseMapsCommand,\n  RpcV2ProtocolClient,\n  SimpleScalarProperties$,\n  SimpleScalarPropertiesCommand,\n  SparseNullsOperation$,\n  SparseNullsOperationCommand,\n  ValidationException$,\n} from \"../src\";\n\nvi.setSystemTime(new Date(946702799999));\nconst Client = RpcV2ProtocolClient;\n\nconst mode = (process.env.SNAPSHOT_MODE as \"write\" | \"compare\") ?? \"write\";\n\ndescribe(\"RpcV2ProtocolClient\" + ` (${mode})`, () => {\n  const runner = new SnapshotRunner({\n    snapshotDirPath: join(__dirname, \"snapshots\"),\n    Client,\n    mode,\n    testCase(caseName: string, run: () => Promise<void>) {\n      it(caseName, run);\n    },\n    assertions(caseName: string, expected: string, actual: string): Promise<void> {\n      expect(actual).toEqual(expected);\n      return Promise.resolve();\n    },\n    schemas: new Map<any, any>([\n      [EmptyInputOutput$, EmptyInputOutputCommand],\n      [Float16$, Float16Command],\n      [FractionalSeconds$, FractionalSecondsCommand],\n      [GreetingWithErrors$, GreetingWithErrorsCommand],\n      [NoInputOutput$, NoInputOutputCommand],\n      [OperationWithDefaults$, OperationWithDefaultsCommand],\n      [OptionalInputOutput$, OptionalInputOutputCommand],\n      [RecursiveShapes$, RecursiveShapesCommand],\n      [RpcV2CborDenseMaps$, RpcV2CborDenseMapsCommand],\n      [RpcV2CborLists$, RpcV2CborListsCommand],\n      [RpcV2CborSparseMaps$, RpcV2CborSparseMapsCommand],\n      [SimpleScalarProperties$, SimpleScalarPropertiesCommand],\n      [SparseNullsOperation$, SparseNullsOperationCommand],\n    ]),\n    errors: [\n      ValidationException$,\n      ComplexError$,\n      InvalidGreeting$,\n    ],\n  });\n  runner.run();\n}, 30_000);\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist-cjs\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"lib\": [\"dom\"],\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"outDir\": \"dist-es\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/tsconfig.json",
    "content": "{\n  \"extends\": \"@tsconfig/node20/tsconfig.json\",\n  \"compilerOptions\": {\n    \"downlevelIteration\": true,\n    \"importHelpers\": true,\n    \"incremental\": true,\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"rootDir\": \"src\",\n    \"useUnknownInCatchVariables\": false\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist-types\",\n    \"emitDeclarationOnly\": true,\n    \"noCheck\": false\n  }\n}\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "private/smithy-rpcv2-cbor-schema/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    globals: true,\n  },\n});\n"
  },
  {
    "path": "private/util-test/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\n"
  },
  {
    "path": "private/util-test/CHANGELOG.md",
    "content": "# @smithy/util-test\n\n## 0.2.8\n\n### Patch Changes\n\n- Updated dependencies [cf9257e]\n  - @smithy/types@3.4.1\n  - @smithy/protocol-http@4.1.2\n\n## 0.2.7\n\n### Patch Changes\n\n- Updated dependencies [2dad138]\n- Updated dependencies [9f3f2f5]\n  - @smithy/types@3.4.0\n  - @smithy/protocol-http@4.1.1\n\n## 0.2.6\n\n### Patch Changes\n\n- Updated dependencies [86862ea]\n  - @smithy/protocol-http@4.1.0\n\n## 0.2.5\n\n### Patch Changes\n\n- Updated dependencies [796567d]\n  - @smithy/protocol-http@4.0.4\n\n## 0.2.4\n\n### Patch Changes\n\n- Updated dependencies [4784fb9]\n  - @smithy/types@3.3.0\n  - @smithy/protocol-http@4.0.3\n\n## 0.2.3\n\n### Patch Changes\n\n- Updated dependencies [c16e014]\n- Updated dependencies [c2a5595]\n  - @smithy/types@3.2.0\n  - @smithy/protocol-http@4.0.2\n\n## 0.2.2\n\n### Patch Changes\n\n- Updated dependencies [38da9009]\n  - @smithy/types@3.1.0\n  - @smithy/protocol-http@4.0.1\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies [7a7c84d3]\n- Updated dependencies [671aa704]\n  - @smithy/types@3.0.0\n  - @smithy/protocol-http@4.0.0\n\n## 0.2.0\n\n### Minor Changes\n\n- 38f9a61f: Update package dependencies\n\n### Patch Changes\n\n- Updated dependencies [38f9a61f]\n- Updated dependencies [661f1d60]\n  - @smithy/protocol-http@3.3.0\n  - @smithy/types@2.12.0\n\n## 0.1.17\n\n### Patch Changes\n\n- Updated dependencies [43f3e1e2]\n  - @smithy/types@2.11.0\n  - @smithy/protocol-http@3.2.2\n\n## 0.1.16\n\n### Patch Changes\n\n- Updated dependencies [dd0d9b4b]\n  - @smithy/types@2.10.1\n  - @smithy/protocol-http@3.2.1\n\n## 0.1.15\n\n### Patch Changes\n\n- Updated dependencies [d70a00ac]\n- Updated dependencies [1e23f967]\n- Updated dependencies [929801bc]\n  - @smithy/types@2.10.0\n  - @smithy/protocol-http@3.2.0\n\n## 0.1.14\n\n### Patch Changes\n\n- 2b1bf055: generate dist-cjs with runtime list of export names for esm\n- Updated dependencies [2b1bf055]\n  - @smithy/protocol-http@3.1.1\n  - @smithy/types@2.9.1\n\n## 0.1.13\n\n### Patch Changes\n\n- Updated dependencies [9939f823]\n  - @smithy/protocol-http@3.1.0\n  - @smithy/types@2.9.0\n\n## 0.1.12\n\n### Patch Changes\n\n- Updated dependencies [590af6b7]\n  - @smithy/types@2.8.0\n  - @smithy/protocol-http@3.0.12\n\n## 0.1.11\n\n### Patch Changes\n\n- Updated dependencies [340634a5]\n  - @smithy/types@2.7.0\n  - @smithy/protocol-http@3.0.11\n\n## 0.1.10\n\n### Patch Changes\n\n- Updated dependencies [9bfc64ed]\n- Updated dependencies [9579a9a0]\n  - @smithy/types@2.6.0\n  - @smithy/protocol-http@3.0.10\n\n## 0.1.9\n\n### Patch Changes\n\n- Updated dependencies [8044a814]\n  - @smithy/types@2.5.0\n  - @smithy/protocol-http@3.0.9\n\n## 0.1.8\n\n### Patch Changes\n\n- Updated dependencies [5e9fd6ce]\n- Updated dependencies [05f5d42c]\n  - @smithy/types@2.4.0\n  - @smithy/protocol-http@3.0.8\n\n## 0.1.7\n\n### Patch Changes\n\n- Updated dependencies [d6b4c090]\n  - @smithy/types@2.3.5\n  - @smithy/protocol-http@3.0.7\n\n## 0.1.6\n\n### Patch Changes\n\n- Updated dependencies [2f70f105]\n- Updated dependencies [9a562d37]\n  - @smithy/types@2.3.4\n  - @smithy/protocol-http@3.0.6\n\n## 0.1.5\n\n### Patch Changes\n\n- Updated dependencies [ea0635d6]\n  - @smithy/types@2.3.3\n  - @smithy/protocol-http@3.0.5\n\n## 0.1.4\n\n### Patch Changes\n\n- Updated dependencies [fbfeebee]\n- Updated dependencies [c0b17a13]\n  - @smithy/types@2.3.2\n  - @smithy/protocol-http@3.0.4\n\n## 0.1.3\n\n### Patch Changes\n\n- Updated dependencies [b9265813]\n- Updated dependencies [6d1c2fb1]\n  - @smithy/types@2.3.1\n  - @smithy/protocol-http@3.0.3\n\n## 0.1.2\n\n### Patch Changes\n\n- Updated dependencies [5b3fec37]\n  - @smithy/protocol-http@3.0.2\n\n## 0.1.1\n\n### Patch Changes\n\n- Updated dependencies [5db648a6]\n  - @smithy/protocol-http@3.0.1\n\n## 0.1.0\n\n### Minor Changes\n\n- a03026e3: Add http client component to runtime extension\n\n### Patch Changes\n\n- Updated dependencies [88bcec3d]\n- Updated dependencies [a03026e3]\n  - @smithy/types@2.3.0\n  - @smithy/protocol-http@3.0.0\n\n## null\n\n### Patch Changes\n\n- Updated dependencies [b753dd4c]\n- Updated dependencies [6c8ffa27]\n  - @smithy/types@2.2.2\n  - @smithy/protocol-http@2.0.5\n"
  },
  {
    "path": "private/util-test/package.json",
    "content": "{\n  \"name\": \"@smithy/util-test\",\n  \"version\": \"0.2.8\",\n  \"private\": true,\n  \"main\": \"./dist-cjs/index.js\",\n  \"module\": \"./dist-es/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"downlevel-dts dist-types dist-types/ts3.4\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\"\n  },\n  \"dependencies\": {\n    \"@smithy/core\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^2.6.2\"\n  },\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typedoc\": \"0.23.23\",\n    \"typescript\": \"~5.8.3\"\n  }\n}\n"
  },
  {
    "path": "private/util-test/src/index.ts",
    "content": "export * from \"./test-http-handler\";\n"
  },
  {
    "path": "private/util-test/src/test-http-handler.ts",
    "content": "import type { HttpHandler, HttpRequest, HttpResponse } from \"@smithy/core/protocols\";\nimport type { Client, HttpHandlerOptions, RequestHandler, RequestHandlerOutput } from \"@smithy/types\";\nimport { expect } from \"vitest\";\n\n/**\n * Instructs {@link TestHttpHandler} how to match the handled request and the expected request.\n * @internal\n */\nexport type Matcher = string | number | boolean | RegExp | null | undefined | ((value: any) => void);\n\n/**\n * @internal\n */\nexport type HttpRequestMatcher = {\n  // endpoint\n  protocol?: Matcher;\n  hostname?: Matcher;\n  port?: Matcher;\n  path?: Matcher;\n  query?: Record<string, Matcher> | Map<RegExp | string, Matcher>;\n\n  // message\n  headers?: Record<string, Matcher> | Map<RegExp | string, Matcher>;\n  body?: Matcher;\n  method?: Matcher;\n\n  // debug option\n  log?: boolean;\n};\n\n/**\n * Supplied to test clients to assert correct requests.\n * @internal\n */\nexport class TestHttpHandler implements HttpHandler {\n  private static WATCHER = Symbol(\"TestHttpHandler_WATCHER\");\n\n  public readonly matchers: HttpRequestMatcher[];\n\n  private originalSend?: Function;\n  private originalRequestHandler?: RequestHandler<any, any, any>;\n  private client?: Client<any, any, any>;\n  private responseQueue: HttpResponse[] = [];\n  private assertions = 0;\n\n  public constructor(...matchers: HttpRequestMatcher[]) {\n    this.matchers = matchers;\n    const RESERVED_ENVIRONMENT_VARIABLES = {\n      AWS_DEFAULT_REGION: 1,\n      AWS_REGION: 1,\n      AWS_PROFILE: 1,\n      AWS_ACCESS_KEY_ID: 1,\n      AWS_SECRET_ACCESS_KEY: 1,\n      AWS_SESSION_TOKEN: 1,\n      AWS_CREDENTIAL_EXPIRATION: 1,\n      AWS_CREDENTIAL_SCOPE: 1,\n      AWS_EC2_METADATA_DISABLED: 1,\n      AWS_WEB_IDENTITY_TOKEN_FILE: 1,\n      AWS_ROLE_ARN: 1,\n      AWS_CONTAINER_CREDENTIALS_FULL_URI: 1,\n      AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: 1,\n      AWS_CONTAINER_AUTHORIZATION_TOKEN: 1,\n      AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE: 1,\n    };\n    for (const key in RESERVED_ENVIRONMENT_VARIABLES) {\n      delete process.env[key];\n    }\n    process.env.AWS_ACCESS_KEY_ID = \"INTEGRATION_TEST_MOCK\";\n    process.env.AWS_SECRET_ACCESS_KEY = \"INTEGRATION_TEST_MOCK\";\n  }\n\n  /**\n   * @param client - to watch for requests.\n   * @param matchers - optional override of this instance's matchers.\n   *\n   * Temporarily hooks the client.send call to check the outgoing request.\n   */\n  public watch(client: Client<any, any, any>): TestHttpHandler {\n    this.client = client;\n    this.originalRequestHandler = client.config.requestHandler;\n\n    client.config.requestHandler = this;\n    if (!(client as any)[TestHttpHandler.WATCHER]) {\n      (client as any)[TestHttpHandler.WATCHER] = true;\n      const originalSend = (this.originalSend = client.send as any);\n      client.send = async function (...args: any[]) {\n        return originalSend.apply(client, args).catch((e: unknown) => {\n          if ((e as any).id === TestHttpHandlerSuccess.ID) {\n          } else {\n            throw e;\n          }\n        });\n      };\n    }\n\n    return this;\n  }\n\n  /**\n   * @param httpResponses - to enqueue for mock responses.\n   */\n  public respondWith(...httpResponses: HttpResponse[]): TestHttpHandler {\n    this.responseQueue.push(...httpResponses);\n    return this;\n  }\n\n  /**\n   * @throws TestHttpHandlerSuccess to indicate success (only way to control it).\n   * @throws Error any other exception to indicate failure.\n   */\n  public async handle(\n    request: HttpRequest,\n    handlerOptions?: HttpHandlerOptions\n  ): Promise<RequestHandlerOutput<HttpResponse>> {\n    const m = this.matchers.length > 1 ? this.matchers.shift()! : this.matchers[0];\n\n    if (m.log) {\n      console.log(request);\n    }\n\n    this.check(m.protocol, request.protocol);\n    this.check(m.hostname, request.hostname);\n    this.check(m.port, request.port);\n    this.check(m.path, request.path);\n    this.checkAll(m.query ?? {}, request.query, \"query\");\n\n    this.checkAll(m.headers ?? {}, request.headers, \"header\");\n    this.check(m.body, request.body);\n    this.check(m.method, request.method);\n\n    if (this.assertions === 0) {\n      throw new Error(\"Request handled with no assertions, empty matcher?\");\n    }\n\n    if (this.responseQueue.length > 1) {\n      return {\n        response: this.responseQueue.shift()!,\n      };\n    } else {\n      if (this.responseQueue.length === 1) {\n        return {\n          response: this.responseQueue[0],\n        };\n      }\n    }\n\n    throw new TestHttpHandlerSuccess();\n  }\n\n  public async destroy(): Promise<void> {\n    (this.client as any).config.requestHandler = this.originalRequestHandler;\n    (this.client as any).send = this.originalSend as any;\n  }\n\n  updateHttpClientConfig(key: never, value: never): void {}\n\n  httpHandlerConfigs() {\n    return {};\n  }\n\n  private check(matcher?: Matcher, observed?: any) {\n    if (matcher === undefined) {\n      return;\n    }\n    switch (typeof matcher) {\n      case \"string\":\n        if (matcher.startsWith(\"/\") && matcher.endsWith(\"/\")) {\n          expect(String(observed)).toMatch(new RegExp(matcher));\n        } else {\n          expect(observed).toEqual(matcher);\n        }\n        break;\n      case \"number\":\n      case \"bigint\":\n      case \"boolean\":\n        expect(observed).toEqual(matcher);\n        break;\n      case \"object\":\n        if (matcher instanceof RegExp) {\n          expect(String(observed)).toMatch(matcher);\n        }\n        break;\n      case \"function\":\n        matcher(observed);\n        break;\n      default:\n        throw new Error(\"Matcher did not create assertion\");\n    }\n    this.assertions++;\n  }\n\n  private checkAll(\n    matchers: Record<string, Matcher> | Map<RegExp | string, Matcher>,\n    observed: any,\n    type: \"header\" | \"query\"\n  ) {\n    if (matchers == null) {\n      return;\n    }\n    let key: string | RegExp;\n\n    for (const [_key, matcher] of matchers instanceof Map ? matchers : Object.entries(matchers)) {\n      key = _key;\n      if (typeof key === \"string\") {\n        if (key.startsWith(\"/\") && key.endsWith(\"/\")) {\n          key = new RegExp(key);\n        } else {\n          const matchingValue =\n            type === \"header\"\n              ? observed[Object.keys(observed).find((k) => k.toLowerCase() === String(key).toLowerCase()) ?? \"\"]\n              : observed[key];\n          this.check(matcher, matchingValue);\n        }\n      }\n      if (key instanceof RegExp) {\n        for (const [observedKey, observedValue] of Object.entries(observed)) {\n          if (key.test(observedKey)) {\n            this.check(matcher, observedValue);\n          }\n        }\n      }\n    }\n  }\n}\n\n/**\n * This is used as an interrupt signal for success.\n * It does not indicate a true error.\n *\n * @internal\n */\nexport class TestHttpHandlerSuccess extends Error {\n  public static readonly ID = Symbol(\"TestHttpHandlerSuccess\");\n  public readonly id = TestHttpHandlerSuccess.ID;\n}\n\n/**\n * @internal\n */\nexport const requireRequestsFrom = (client: Client<any, any, any>) => {\n  return {\n    toMatch(...matchers: HttpRequestMatcher[]) {\n      return new TestHttpHandler(...matchers).watch(client);\n    },\n  };\n};\n"
  },
  {
    "path": "private/util-test/tsconfig.cjs.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"outDir\": \"dist-cjs\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true,\n    \"skipLibCheck\": true\n  },\n  \"extends\": \"../../tsconfig.cjs.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "private/util-test/tsconfig.es.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"lib\": [],\n    \"outDir\": \"dist-es\",\n    \"rootDir\": \"src\",\n    \"stripInternal\": true,\n    \"skipLibCheck\": true\n  },\n  \"extends\": \"../../tsconfig.es.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "private/util-test/tsconfig.types.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"declarationDir\": \"dist-types\",\n    \"rootDir\": \"src\",\n    \"skipLibCheck\": true\n  },\n  \"extends\": \"../../tsconfig.types.json\",\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "scripts/build-generated-test-packages.js",
    "content": "/**\n *\n * This script builds the generated weather and weather-ssdk test packages\n * and copies them into node_modules for use by integration tests.\n */\n\nconst path = require(\"node:path\");\nconst fs = require(\"node:fs\");\n\nconst { spawnProcess } = require(\"./utils/spawn-process\");\n\nconst root = path.join(__dirname, \"..\");\n\nconst testProjectDir = path.join(root, \"smithy-typescript-codegen-test\");\n\nconst codegenTestDir = path.join(testProjectDir, \"build\", \"smithyprojections\", \"smithy-typescript-codegen-test\");\n\nconst weatherClientDir = path.join(codegenTestDir, \"source\", \"typescript-client-codegen\");\n\n// Build generic legacy auth client for integration tests\nconst weatherLegacyAuthClientDir = path.join(codegenTestDir, \"client-legacy-auth\", \"typescript-client-codegen\");\n\nconst weatherSsdkDir = path.join(codegenTestDir, \"ssdk-test\", \"typescript-server-codegen\");\n\n// Build `@httpApiKeyAuth` client for integration tests\nconst httpApiKeyAuthClientDir = path.join(\n  codegenTestDir,\n  \"identity-and-auth-http-api-key-auth\",\n  \"typescript-client-codegen\"\n);\n\n// Build `@httpBearerAuth` client for integration tests\nconst httpBearerAuthClientDir = path.join(\n  codegenTestDir,\n  \"identity-and-auth-http-bearer-auth\",\n  \"typescript-client-codegen\"\n);\n\nconst nodeModulesDir = path.join(root, \"node_modules\");\n\nconst buildAndCopyToNodeModules = async (packageName, codegenDir, nodeModulesDir) => {\n  try {\n    console.log(`Building and copying package \\`${packageName}\\` in \\`${codegenDir}\\` to \\`${nodeModulesDir}\\``);\n    // Yarn detects that the generated TypeScript package is nested beneath the\n    // top-level package.json. Adding an empty lock file allows it to be treated\n    // as its own package.\n    await spawnProcess(\"touch\", [\"yarn.lock\"], { cwd: codegenDir });\n    await spawnProcess(\"yarn\", { cwd: codegenDir });\n    const smithyPackages = path.join(__dirname, \"..\", \"packages\");\n    const node_modules = path.join(codegenDir, \"node_modules\");\n    const localSmithyPkgs = fs.readdirSync(smithyPackages);\n\n    for (const smithyPkg of localSmithyPkgs) {\n      if (!fs.existsSync(path.join(smithyPackages, smithyPkg, \"dist-cjs\"))) {\n        continue;\n      }\n      await Promise.all(\n        [\"dist-cjs\", \"dist-types\", \"dist-es\", \"package.json\"].map((folder) =>\n          spawnProcess(\"cp\", [\n            \"-r\",\n            path.join(smithyPackages, smithyPkg, folder),\n            path.join(node_modules, \"@smithy\", smithyPkg),\n          ])\n        )\n      );\n    }\n\n    await spawnProcess(\"yarn\", [\"build\"], { cwd: codegenDir });\n\n    // Optionally, after building the package, it's packed and copied to node_modules so that\n    // it can be used in integration tests by other packages within the monorepo.\n    if (nodeModulesDir != undefined) {\n      await spawnProcess(\"yarn\", [\"pack\"], { cwd: codegenDir });\n      await spawnProcess(\"rm\", [\"-rf\", packageName], { cwd: nodeModulesDir });\n      await spawnProcess(\"mkdir\", [\"-p\", packageName], { cwd: nodeModulesDir });\n      const targetPackageDir = path.join(nodeModulesDir, packageName);\n      await spawnProcess(\"tar\", [\"-xf\", \"package.tgz\", \"-C\", targetPackageDir, \"--strip-components\", \"1\"], {\n        cwd: codegenDir,\n      });\n    }\n  } catch (e) {\n    console.log(\n      `Building and copying package \\`${packageName}\\` in \\`${codegenDir}\\` to \\`${nodeModulesDir}\\` failed:`\n    );\n    console.log(e);\n    process.exit(1);\n  }\n};\n\n(async () => {\n  await buildAndCopyToNodeModules(\"weather\", weatherClientDir, nodeModulesDir);\n  await buildAndCopyToNodeModules(\"weather-ssdk\", weatherSsdkDir, nodeModulesDir);\n  await buildAndCopyToNodeModules(\"@smithy/weather-legacy-auth\", weatherLegacyAuthClientDir, nodeModulesDir);\n  await buildAndCopyToNodeModules(\n    \"@smithy/identity-and-auth-http-api-key-auth-service\",\n    httpApiKeyAuthClientDir,\n    nodeModulesDir\n  );\n  await buildAndCopyToNodeModules(\n    \"@smithy/identity-and-auth-http-bearer-auth-service\",\n    httpBearerAuthClientDir,\n    nodeModulesDir\n  );\n\n  // TODO(released-version-test): Test released version of smithy-typescript codegenerators, but currently is not working\n  /*\n  const releasedClientDir = path.join(\n    testProjectDir,\n    \"released-version-test\",\n    \"build\",\n    \"smithyprojections\",\n    \"released-version-test\",\n    \"source\",\n    \"typescript-codegen\"\n  );\n  */\n  // await buildAndCopyToNodeModules(\"released\", releasedClientDir, undefined);\n})();\n"
  },
  {
    "path": "scripts/check-dependencies.js",
    "content": "/**\n * Checks devDependency declarations for runtime packages.\n * They should be moved to the dependencies section even if only imported for types.\n */\n\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nconst root = path.join(__dirname, \"..\");\nconst packages = path.join(root, \"packages\");\nconst walk = require(\"./utils/walk\");\nconst pkgJsonEnforcement = require(\"./package-json-enforcement\");\n\nconst node_libraries = [\n  \"buffer\",\n  \"child_process\",\n  \"crypto\",\n  \"dns\",\n  \"dns/promises\",\n  \"events\",\n  \"fs\",\n  \"fs/promises\",\n  \"http\",\n  \"http2\",\n  \"https\",\n  \"net\",\n  \"os\",\n  \"path\",\n  \"path/posix\",\n  \"path/win32\",\n  \"process\",\n  \"stream\",\n  \"stream/consumers\",\n  \"stream/promises\",\n  \"stream/web\",\n  \"tls\",\n  \"url\",\n  \"util\",\n  \"zlib\",\n];\n\n(async () => {\n  const errors = [];\n  for (const packageFolder of fs.readdirSync(packages)) {\n    const pkgJsonPath = path.join(packages, packageFolder, \"package.json\");\n    errors.push(...pkgJsonEnforcement(pkgJsonPath, true));\n    const srcPath = path.join(packages, packageFolder, \"src\");\n    const pkgJson = require(pkgJsonPath);\n\n    for await (const file of walk(srcPath, [\"node_modules\"])) {\n      const contents = fs.readFileSync(file);\n\n      if (file.endsWith(\".spec.ts\")) {\n        continue;\n      }\n\n      if (!file.endsWith(\".ts\")) {\n        continue;\n      }\n\n      const importedDependencies = [];\n      importedDependencies.push(\n        ...new Set(\n          [...(contents.toString().match(/(from |import\\()\"(.*?)\";/g) || [])]\n            .map((_) => _.replace(/from \"/g, \"\").replace(/\";$/, \"\"))\n            .filter((_) => !_.startsWith(\".\") && !node_libraries.includes(_) && !_.startsWith(\"node:\"))\n        )\n      );\n\n      for (const dependency of importedDependencies) {\n        const dependencyPackageName = dependency.startsWith(\"@\")\n          ? dependency.split(\"/\").slice(0, 2).join(\"/\")\n          : dependency.split(\"/\")[0];\n\n        if (\n          !(dependencyPackageName in (pkgJson.dependencies ?? {})) &&\n          !(dependencyPackageName in (pkgJson.peerDependencies ?? {})) &&\n          dependencyPackageName !== pkgJson.name\n        ) {\n          errors.push(`${dependency} undeclared but imported in ${pkgJson.name} ${file}}`);\n        }\n      }\n\n      for (const [dep, version] of Object.entries(pkgJson.devDependencies ?? {})) {\n        if ((dep.startsWith(\"@smithy\") || dep.startsWith(\"@aws-sdk\")) && contents.includes(`from \"${dep}\";`)) {\n          errors.push(`${dep} incorrectly declared in devDependencies of ${packageFolder}`);\n          delete pkgJson.devDependencies[dep];\n          if (!pkgJson.dependencies) {\n            pkgJson.dependencies = {};\n          }\n          pkgJson.dependencies[dep] = version;\n\n          fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + \"\\n\");\n        }\n      }\n    }\n  }\n  if (errors.length) {\n    throw new Error(errors.join(\"\\n\"));\n  }\n})();\n"
  },
  {
    "path": "scripts/cli-dispatcher/index.js",
    "content": "#!/usr/bin/env node\n\nconst path = require(\"path\");\nconst readline = require(\"readline\");\n\nconst findFolders = require(\"./lib/findFolders\");\nconst findScripts = require(\"./lib/findScripts\");\nconst Package = require(\"./lib/Package\");\nconst { listFolders } = require(\"../utils/list-folders\");\n\n/**\n * This script takes your command line arguments and infers the\n * package in which to execute them.\n *\n * It is supposed to save time moving among packages/private folders\n * for building and running other test commands.\n */\nasync function main() {\n  console.log(\"CLI dispatcher\");\n\n  const root = path.join(__dirname, \"..\", \"..\");\n  const argv = process.argv;\n\n  const packages = listFolders(path.join(root, \"packages\"));\n  const _private = listFolders(path.join(root, \"private\"));\n\n  const allPackages = [\n    ...packages.map((p) => new Package(p, path.join(root, \"packages\", p))),\n    ..._private.map((p) => new Package(p, path.join(root, \"private\", p))),\n  ];\n\n  const [node, dispatcher, ...rest] = argv;\n  const flags = rest.filter((f) => f.startsWith(\"--\"));\n  const options = {\n    help: flags.includes(\"--help\") || rest.length === 0,\n  };\n\n  if (options.help) {\n    console.info(`\n    Usage:\n      b [package query words] - [command query words]\n      b cor - build,test\n\n      matches to:\n      (cd packages/core && yarn build && yarn test)\n\n      Query words are substrings that match against the package name and npm scripts.\n      The substrings must appear in order for a match.\n      Match priority goes to whole-word matching and initial matching.\n`);\n    return 0;\n  }\n\n  const nonFlags = rest.filter((_) => !_.startsWith(\"--\"));\n  const separatorIndex = rest.indexOf(\"-\") !== -1 ? rest.indexOf(\"-\") : rest.length;\n  const query = nonFlags.slice(0, separatorIndex);\n  const commands = nonFlags.slice(separatorIndex + 1);\n  const multiCommands = commands\n    .join(\" \")\n    .split(/,\\s?/)\n    .map((c) => c.split(\" \"));\n\n  const matchedPackages = findFolders(allPackages, ...query);\n\n  if (matchedPackages.length === 0) {\n    console.error(\"No matching packages for query:\", query);\n    return 0;\n  }\n\n  console.log(\"query:\", ...query);\n  console.log(\n    \"matches:\",\n    matchedPackages.map((_) => _.name)\n  );\n\n  const [target] = matchedPackages;\n  const targetPkgJson = require(path.join(target.location, \"package.json\"));\n\n  for (const commands of multiCommands) {\n    const matchedScripts = findScripts(Object.keys(targetPkgJson.scripts || {}), ...commands);\n\n    if (commands.length === 0) {\n      console.info(\"No commands entered\");\n      return 0;\n    }\n\n    if (matchedScripts.length === 0) {\n      console.error(\"No matching scripts for command query:\", commands);\n      return 0;\n    }\n\n    console.log(\"commands:\", ...commands);\n    console.log(\"matched commands:\", matchedScripts);\n  }\n\n  for (const commands of multiCommands) {\n    const matchedScripts = findScripts(Object.keys(targetPkgJson.scripts || {}), ...commands);\n    const [script] = matchedScripts;\n\n    const execute = async () => {\n      const { spawnProcess } = require(\"../utils/spawn-process\");\n      console.info(\"Running:\", \"yarn\", script);\n      console.info(\"Location:\", target.location);\n      await spawnProcess(\"yarn\", [script], {\n        cwd: target.location,\n        stdio: \"inherit\",\n      });\n    };\n\n    await execute();\n  }\n\n  return 0;\n}\n\nmain().catch(console.error);\n"
  },
  {
    "path": "scripts/cli-dispatcher/lib/Package.js",
    "content": "module.exports = class Package {\n  constructor(name, location) {\n    this.name = name;\n    this.location = location;\n  }\n};\n"
  },
  {
    "path": "scripts/cli-dispatcher/lib/findFolders.js",
    "content": "const matcher = require(\"./matcher\");\nconst matchSorter = require(\"./matchSorter\");\n\n/**\n * @param allPackages {Package[]} - list of all packages.\n * @param query {string} - query for the package list.\n * @returns the folders matching the args.\n */\nmodule.exports = function findFolders(allPackages, ...query) {\n  const folders = [];\n  for (const pkg of allPackages) {\n    const { name } = pkg;\n    const isMatch = matcher(name, ...query);\n    if (isMatch) {\n      folders.push(pkg);\n    }\n  }\n  return matchSorter(folders, ...query);\n};\n"
  },
  {
    "path": "scripts/cli-dispatcher/lib/findScripts.js",
    "content": "const matcher = require(\"./matcher\");\nconst matchSorter = require(\"./matchSorter\");\n\n/**\n * @param scripts {string[]} - scripts entry from a package.json file.\n * @param query {string} - query for the script names.\n * @returns the scripts matching the args.\n */\nmodule.exports = function findScripts(scripts, ...query) {\n  const matches = [];\n  for (const script of scripts) {\n    const isMatch = matcher(script, ...query);\n    if (isMatch) {\n      matches.push(script);\n    }\n  }\n  return matchSorter(matches, ...query);\n};\n"
  },
  {
    "path": "scripts/cli-dispatcher/lib/matchSorter.js",
    "content": "/**\n * @param {string[]} matches - unordered list of matches.\n * @param  {...string} query - original query that generated matches\n * @returns {string[]} matches sorted by estimated priority.\n *\n * matches that start with the first query component are prioritized.\n * @example\n *  ([\"build:types\", \"test\"], \"t\") -> [\"test\", \"build:types\"]\n *\n * Matches that contain a full word match with the query are prioritized.\n * @example\n *  ([\"presigner\", \"signer\"], \"signer\") -> [\"signer\", \"presigner\"]\n *\n * Shorter matches are prioritized.\n */\nmodule.exports = function matchSorter(matches, ...query) {\n  return matches.sort((a, b) => {\n    a = a.name || a;\n    b = b.name || b;\n\n    let score = 0;\n\n    if (wholeWordMatch(a, ...query)) {\n      score -= 100;\n    }\n    if (wholeWordMatch(b, ...query)) {\n      score += 100;\n    }\n    if (wordInitialMatch(a, ...query)) {\n      score -= 10;\n    }\n    if (wordInitialMatch(b, ...query)) {\n      score += 10;\n    }\n    if (a.length < b.length) {\n      score -= 1;\n    }\n    if (a.length > b.length) {\n      score += 1;\n    }\n    return score;\n  });\n};\n\n/**\n * @returns {boolean} subject has a word that starts with a query component.\n */\nfunction wordInitialMatch(subject, ...query) {\n  const _words = words(subject);\n  return _words.filter((w) => undefined !== query.find((q) => w.startsWith(q))).length > 0;\n}\n\n/**\n * @returns {boolean} subject has a whole word match with part of the query.\n */\nfunction wholeWordMatch(subject, ...query) {\n  const _words = words(subject);\n  return _words.filter((w) => query.includes(w)).length > 0;\n}\n\n/**\n * Splits the search subject into words.\n */\nfunction words(subject) {\n  return subject.split(/:|\\s+|-|_/);\n}\n"
  },
  {
    "path": "scripts/cli-dispatcher/lib/matcher.js",
    "content": "/**\n * @param {string} subject - the string to test.\n * @param {string} query - the query.\n * @returns {boolean} whether all elements of query appear in-order in the subject string.\n *\n * @example\n * (\"client-s3-control\", \"c s3 c\") -> true\n */\nmodule.exports = function matcher(subject, ...query) {\n  let cursor = undefined;\n\n  for (const q of query) {\n    const searchString = subject.slice(cursor + 1);\n    const index = searchString.indexOf(q);\n    if (index === -1) {\n      return false;\n    }\n    cursor = index;\n  }\n\n  return true;\n};\n"
  },
  {
    "path": "scripts/cli-dispatcher/readme.md",
    "content": "## CLI dispatcher\n\nThese scripts provide CLI helpers to send shorthand commands to a matching package.\n\n### Usage\n\nFirst, alias the script entry point. An example is provided in `./set-alias.sh`.\n\nThen, run the script with the new alias `b` with no arguments to see the help message detailing usage.\n"
  },
  {
    "path": "scripts/cli-dispatcher/set-alias.sh",
    "content": "#!/bin/bash\n\n# Set a command line alias to make running the dispatcher easier.\n\nalias b=\"node ./scripts/cli-dispatcher/index.js\"\nalias r=\"node ./scripts/cli-dispatcher/workspace.js\""
  },
  {
    "path": "scripts/cli-dispatcher/workspace.js",
    "content": "#!/usr/bin/env node\n\n/**\n * This script runs files by filename in the root/workspace (unversioned) directory.\n *\n * @example\n * r dyn test\n *\n * would match to a file in /workspace/dynamodb/test.ts and execute it with esbuild runner.\n *\n * @example\n * r ssec\n *\n * would run \"node /workspace/s3/ssec.mjs\"\n *\n * The workspace directory is meant as a place to test short scripts\n * that make use of the packages built in the root monorepo workspace.\n */\n\nconst path = require(\"path\");\nconst walk = require(\"../utils/walk\");\n\nconst matcher = require(\"./lib/matcher\");\nconst matchSorter = require(\"./lib/matchSorter\");\n\nconst root = path.join(__dirname, \"..\", \"..\");\nconst workspaceFolder = path.join(root, \"workspace\");\n\nconst USE_NODE = 1;\nconst USE_TYPESCRIPT = 2;\nconst runnable = { \".js\": USE_NODE, \".ts\": USE_TYPESCRIPT, \".cjs\": USE_NODE, \".mjs\": USE_NODE };\n\nconst execute = async (cwd, exe, commands) => {\n  const { spawnProcess } = require(\"../utils/spawn-process\");\n  await spawnProcess(exe, [...commands], {\n    cwd,\n    stdio: \"inherit\",\n  });\n  return;\n};\n\nconst [node, dispatcher, ...query] = process.argv;\n\n(async () => {\n  if (query.length === 0) {\n    console.log(\"No query given, use `r [substring words]`.\");\n    return;\n  }\n\n  const matches = [];\n\n  for await (const f of walk(workspaceFolder, [\"node_modules\", \".yarn\", \".git\"])) {\n    const ext = path.extname(f);\n    if (ext in runnable) {\n      if (matcher(f, ...query)) {\n        matches.push(f);\n      }\n    }\n  }\n\n  if (matches.length === 0) {\n    console.log(\"No matching workspace scripts.\");\n    return;\n  }\n\n  const selection = matchSorter(matches, ...query)[0];\n  const ext = path.extname(selection);\n\n  console.log(\"Exec script:\", selection);\n\n  if (runnable[ext] === USE_NODE) {\n    await execute(path.dirname(selection), \"node\", [selection]);\n  }\n  if (runnable[ext] === USE_TYPESCRIPT) {\n    await execute(path.dirname(selection), \"npx\", [\"esbuild-runner\", selection]);\n  }\n})();\n"
  },
  {
    "path": "scripts/compilation/Inliner.js",
    "content": "const fs = require(\"node:fs\");\nconst path = require(\"node:path\");\nconst { spawnProcess } = require(\"./../utils/spawn-process\");\nconst walk = require(\"./../utils/walk\");\nconst rollup = require(\"rollup\");\nconst { nodeResolve } = require(\"@rollup/plugin-node-resolve\");\nconst json = require(\"@rollup/plugin-json\");\n\nconst root = path.join(__dirname, \"..\", \"..\");\n\n/**\n *\n * Inline a package as one dist file, preserves other files as re-export stubs,\n * preserves files with react-native variants as externals.\n *\n */\nmodule.exports = class Inliner {\n  constructor(pkg) {\n    this.package = pkg;\n    this.platform = \"node\";\n    this.submodulePackages = [\"core\"];\n    this.hasSubmodules = this.submodulePackages.includes(pkg);\n    this.subfolder = \"packages\";\n    this.verbose = process.env.DEBUG || process.argv.includes(\"--debug\");\n\n    this.packageDirectory = path.join(root, this.subfolder, pkg);\n\n    this.outfile = path.join(root, this.subfolder, pkg, \"dist-cjs\", \"index.js\");\n\n    this.pkgJson = require(path.join(root, this.subfolder, this.package, \"package.json\"));\n    /**\n     * If the react entrypoint is another file entirely, then bail out of inlining.\n     */\n    this.bailout = typeof this.pkgJson[\"react-native\"] === \"string\";\n  }\n\n  /**\n   * step 0: delete the dist-cjs folder.\n   */\n  async clean() {\n    await spawnProcess(\"yarn\", [\"premove\", \"./dist-cjs\", \"tsconfig.cjs.tsbuildinfo\"], { cwd: this.packageDirectory });\n    if (this.verbose) {\n      console.log(\"Deleted ./dist-cjs in \" + this.package);\n    }\n    return this;\n  }\n\n  /**\n   * step 1: build the default tsc dist-cjs output with dispersed files.\n   * we will need the files to be in place for stubbing.\n   */\n  async tsc() {\n    await spawnProcess(\"yarn\", [\"g:tsc\", \"-p\", \"tsconfig.cjs.json\"], { cwd: this.packageDirectory });\n    if (this.verbose) {\n      console.log(\"Finished recompiling ./dist-cjs in \" + this.package);\n    }\n    this.canonicalExports = Object.keys(require(this.outfile));\n    return this;\n  }\n\n  /**\n   * step 2: detect all variant files.\n   * For submodule packages, we collect variant mappings per submodule to produce\n   * fully-inlined browser/native bundles.\n   * For non-submodule packages, we collect variant externals as before.\n   */\n  async discoverVariants() {\n    if (this.bailout) {\n      console.log(\"Inliner bailout.\");\n      return this;\n    }\n\n    if (this.hasSubmodules) {\n      // Submodule variant indexes are source files (index.browser.ts, index.native.ts).\n      // No variant externals needed.\n      this.variantExternals = [];\n      this.variantMap = {};\n      return this;\n    }\n\n    // Non-submodule packages: original behavior.\n    this.variantEntries = Object.entries(this.pkgJson[\"react-native\"] ?? {});\n\n    for await (const file of walk(path.join(this.packageDirectory, \"dist-cjs\"))) {\n      if (file.endsWith(\".js\") && fs.existsSync(file.replace(/\\.js$/, \".native.js\"))) {\n        console.log(\"detected undeclared auto-variant\", file);\n        const canonical = file.replace(/(.*?)dist-cjs\\//, \"./dist-cjs/\").replace(/\\.js$/, \"\");\n        const variant = canonical.replace(/(.*?)(\\.js)?$/, \"$1.native$2\");\n        this.variantEntries.push([canonical, variant]);\n      }\n      if (\n        file.endsWith(\".js\") &&\n        !file.endsWith(\".browser.js\") &&\n        fs.existsSync(file.replace(/\\.js$/, \".browser.js\"))\n      ) {\n        const canonical = file.replace(/(.*?)dist-cjs\\//, \"./dist-cjs/\").replace(/\\.js$/, \"\");\n        const variant = canonical.replace(/(.*?)(\\.js)?$/, \"$1.browser$2\");\n        this.variantEntries.push([canonical, variant]);\n      }\n    }\n\n    this.transitiveVariants = [];\n\n    for (const [k, v] of this.variantEntries) {\n      for (const variantFile of [k, String(v)]) {\n        if (!variantFile.includes(\"dist-cjs/\")) {\n          continue;\n        }\n        const keyFile = path.join(\n          this.packageDirectory,\n          \"dist-cjs\",\n          variantFile.replace(/(.*?)dist-cjs\\//, \"\") + (variantFile.endsWith(\".js\") ? \"\" : \".js\")\n        );\n        const keyFileContents = fs.readFileSync(keyFile, \"utf-8\");\n        const requireStatements = keyFileContents.matchAll(/require\\(\"(.*?)\"\\)/g);\n        for (const requireStatement of requireStatements) {\n          if (requireStatement[1]?.startsWith(\".\")) {\n            const key = path\n              .normalize(path.join(path.dirname(keyFile), requireStatement[1]))\n              .replace(/(.*?)dist-cjs\\//, \"./dist-cjs/\");\n            if (this.verbose) {\n              console.log(\"Transitive variant file:\", key);\n            }\n            const transitiveVariant = key.replace(/(.*?)dist-cjs\\//, \"\").replace(/(\\.js)?$/, \"\");\n            if (!this.transitiveVariants.includes(transitiveVariant)) {\n              this.variantEntries.push([key, key]);\n              this.transitiveVariants.push(transitiveVariant);\n            }\n          }\n        }\n      }\n    }\n\n    this.variantExternals = [];\n    this.variantMap = {};\n\n    for (const [k, v] of this.variantEntries) {\n      const prefix = \"dist-cjs/\";\n      const keyPrefixIndex = k.indexOf(prefix);\n      if (keyPrefixIndex === -1) {\n        continue;\n      }\n      const keyRelativePath = k.slice(keyPrefixIndex + prefix.length);\n      const valuePrefixIndex = String(v).indexOf(prefix);\n\n      const addJsExtension = (file) => (file.endsWith(\".js\") ? file : file + \".js\");\n\n      if (valuePrefixIndex !== -1) {\n        const valueRelativePath = String(v).slice(valuePrefixIndex + prefix.length);\n        this.variantExternals.push(...[keyRelativePath, valueRelativePath].map(addJsExtension));\n        this.variantMap[keyRelativePath] = valueRelativePath;\n      } else {\n        this.variantExternals.push(addJsExtension(keyRelativePath));\n        this.variantMap[keyRelativePath] = v;\n      }\n    }\n\n    this.variantExternals = [...new Set(this.variantExternals)];\n\n    return this;\n  }\n\n  /**\n   * step 3: bundle the package index into dist-cjs/index.js except for node_modules\n   * and also excluding any local files that have variants for react-native.\n   *\n   * For submodule packages, produces fully-inlined bundles per submodule:\n   * - index.js (node/default)\n   * - index.browser.js (with browser variants resolved)\n   * - index.native.js (with native variants resolved, only if native variants exist)\n   */\n  async bundle() {\n    if (this.bailout) {\n      return this;\n    }\n\n    const variantExternalsForRollup = this.variantExternals.map((variant) => variant.replace(/.js$/, \"\"));\n\n    const entryPoint = path.join(root, this.subfolder, this.package, \"dist-es\", \"index.js\");\n\n    const makeInputOptions = (entry, externals, plugins = []) => {\n      const externalityAssessments = {};\n      return {\n        input: [entry],\n        plugins: [...plugins, nodeResolve(), json()],\n        onwarn(warning) {\n          /*\n          Circular imports are not an error in the language spec,\n          but reasoning about the program and bundling becomes easier.\n          For that reason let's avoid them.\n           */\n          if (warning.code === \"CIRCULAR_DEPENDENCY\") {\n            throw Error(warning.message);\n          }\n        },\n        external: (id) => {\n          if (undefined !== externalityAssessments[id]) {\n            return externalityAssessments[id];\n          }\n\n          const relative = !!id.match(/^\\.?\\.?\\//);\n          if (!relative) {\n            if (this.verbose) {\n              console.log(\"EXTERN (pkg)\", id);\n            }\n            return (externalityAssessments[id] = true);\n          }\n\n          if (id === entry) {\n            return (externalityAssessments[id] = false);\n          }\n\n          const local =\n            id.includes(`/dist-es/`) &&\n            ((id.includes(`/packages/`) && !id.includes(`packages/${this.package}/`)) ||\n              (id.includes(`/packages-internal/`) && !id.includes(`packages-internal/${this.package}/`)));\n          if (local) {\n            if (this.verbose) {\n              console.log(\"EXTERN (local)\", id);\n            }\n            return (externalityAssessments[id] = true);\n          }\n\n          for (const file of externals) {\n            const idWithoutExtension = id.replace(/\\.[tj]s$/, \"\");\n            const idBasename = path.basename(idWithoutExtension);\n            if (idBasename === path.basename(file)) {\n              if (this.verbose) {\n                console.log(\"EXTERN (variant)\", id);\n              }\n              return (externalityAssessments[id] = true);\n            }\n          }\n\n          return (externalityAssessments[id] = false);\n        },\n      };\n    };\n\n    const outputOptions = (dir) => ({\n      dir,\n      format: \"cjs\",\n      exports: \"named\",\n      preserveModules: false,\n      externalLiveBindings: false,\n    });\n\n    // Bundle main index.js (no variants externalized for submodule packages).\n    const mainExternals = this.hasSubmodules ? [] : variantExternalsForRollup;\n    const bundle = await rollup.rollup(makeInputOptions(entryPoint, mainExternals));\n    await bundle.write(outputOptions(path.dirname(this.outfile)));\n    await bundle.close();\n\n    if (this.hasSubmodules) {\n      const submodulesDir = path.join(root, this.subfolder, this.package, \"src\", \"submodules\");\n      const submodules = fs\n        .readdirSync(submodulesDir)\n        .filter((d) => fs.lstatSync(path.join(submodulesDir, d)).isDirectory());\n\n      for (const submodule of submodules) {\n        const distEsSubmoduleDir = path.join(root, this.subfolder, this.package, \"dist-es\", \"submodules\", submodule);\n        const submoduleOutDir = path.join(root, this.subfolder, this.package, \"dist-cjs\", \"submodules\", submodule);\n\n        // Remove all tsc-generated files in this submodule's dist-cjs folder.\n        if (fs.existsSync(submoduleOutDir)) {\n          fs.rmSync(submoduleOutDir, { recursive: true });\n        }\n        fs.mkdirSync(submoduleOutDir, { recursive: true });\n\n        // Bundle index.js (node/default).\n        const nodeBundle = await rollup.rollup(makeInputOptions(path.join(distEsSubmoduleDir, \"index.js\"), []));\n        await nodeBundle.write(outputOptions(submoduleOutDir));\n        await nodeBundle.close();\n\n        // Bundle index.browser.js if the source file exists.\n        const browserEntry = path.join(distEsSubmoduleDir, \"index.browser.js\");\n        if (fs.existsSync(browserEntry)) {\n          const browserBundle = await rollup.rollup(makeInputOptions(browserEntry, []));\n          await browserBundle.write({\n            ...outputOptions(submoduleOutDir),\n            entryFileNames: \"index.browser.js\",\n          });\n          await browserBundle.close();\n        }\n\n        // Bundle index.native.js if the source file exists.\n        const nativeEntry = path.join(distEsSubmoduleDir, \"index.native.js\");\n        if (fs.existsSync(nativeEntry)) {\n          const nativeBundle = await rollup.rollup(makeInputOptions(nativeEntry, []));\n          await nativeBundle.write({\n            ...outputOptions(submoduleOutDir),\n            entryFileNames: \"index.native.js\",\n          });\n          await nativeBundle.close();\n        }\n      }\n    }\n\n    return this;\n  }\n\n  /**\n   * step 4: delete all existing dist-cjs files except the index.js file\n   * and variant externals. These files were inlined into the bundle.\n   */\n  async cleanupInlinedFiles() {\n    if (this.bailout || this.hasSubmodules) {\n      return this;\n    }\n\n    for await (const file of walk(path.join(this.packageDirectory, \"dist-cjs\"))) {\n      const relativePath = file.replace(path.join(this.packageDirectory, \"dist-cjs\"), \"\").slice(1);\n\n      if (relativePath.includes(\"submodules\")) {\n        continue;\n      }\n\n      if (!file.endsWith(\".js\")) {\n        continue;\n      }\n\n      if (relativePath === \"index.js\") {\n        continue;\n      }\n\n      if (this.variantExternals.find((external) => relativePath.endsWith(external))) {\n        continue;\n      }\n\n      if (fs.readFileSync(file, \"utf-8\").includes(`Object.defineProperty(exports, \"__esModule\", { value: true });`)) {\n        fs.rmSync(file);\n      }\n      const files = fs.readdirSync(path.dirname(file));\n      if (files.length === 0) {\n        fs.rmdirSync(path.dirname(file));\n      }\n    }\n\n    return this;\n  }\n\n  /**\n   * step 5: rewrite variant external imports to correct path.\n   * For submodule packages, this is a no-op since all variants are fully inlined.\n   */\n  async fixVariantImportPaths() {\n    if (this.bailout || this.hasSubmodules) {\n      return this;\n    }\n    this.indexContents = fs.readFileSync(this.outfile, \"utf-8\");\n    const fixImportsForFile = (contents, remove = \"\") => {\n      for (const variant of Object.keys(this.variantMap)) {\n        const basename = path.basename(variant).replace(/.js$/, \"\");\n        const dirname = path.dirname(variant);\n\n        const find = new RegExp(`require\\\\(\"\\\\.(.*?)/${basename}\"\\\\)`, \"g\");\n        const replace = `require(\"./${dirname}/${basename}\")`.replace(remove, \"\");\n\n        contents = contents.replace(find, replace);\n\n        if (this.verbose) {\n          console.log(\"Replacing\", find, \"with\", replace, \"removed=\", remove);\n        }\n      }\n      return contents;\n    };\n    if (this.verbose) {\n      console.log(\"Fixing imports for main file\", path.dirname(this.outfile));\n    }\n    this.indexContents = fixImportsForFile(this.indexContents);\n    fs.writeFileSync(this.outfile, this.indexContents, \"utf-8\");\n    return this;\n  }\n\n  /**\n   * step 6: validate the output.\n   * For submodule packages, validates that each submodule index.js is requireable\n   * and that variant bundles exist where expected.\n   */\n  async validate() {\n    if (this.bailout) {\n      return this;\n    }\n\n    if (this.hasSubmodules) {\n      const submodulesDir = path.join(this.packageDirectory, \"dist-cjs\", \"submodules\");\n      const submodules = fs.readdirSync(submodulesDir);\n\n      for (const submodule of submodules) {\n        const submoduleDir = path.join(submodulesDir, submodule);\n        for (const file of fs.readdirSync(submoduleDir)) {\n          if (!file.endsWith(\".js\")) continue;\n          const filePath = path.join(submoduleDir, file);\n          try {\n            require(filePath);\n          } catch (e) {\n            console.error(`File ${filePath} has import errors.`);\n            throw e;\n          }\n        }\n      }\n\n      // Validate main index.js is requireable.\n      try {\n        require(this.outfile);\n      } catch (e) {\n        console.error(`File ${this.outfile} has import errors.`);\n        throw e;\n      }\n\n      return this;\n    }\n\n    // Non-submodule validation (original behavior).\n    this.indexContents = fs.readFileSync(this.outfile, \"utf-8\");\n\n    const externalsToCheck = new Set(\n      Object.keys(this.variantMap)\n        .filter((variant) => !this.transitiveVariants.includes(variant) && !variant.endsWith(\"index\"))\n        .map((variant) => path.basename(variant).replace(/.js$/, \"\"))\n    );\n\n    const inspect = (contents) => {\n      for (const line of contents.split(\"\\n\")) {\n        if (line.includes(\"require(\")) {\n          const checkOrder = [...externalsToCheck].sort().reverse();\n          for (const external of checkOrder) {\n            if (line.includes(external)) {\n              if (this.verbose) {\n                console.log(\"Inline index confirmed require() for variant external:\", external);\n              }\n              externalsToCheck.delete(external);\n            }\n          }\n        }\n      }\n    };\n\n    inspect(this.indexContents);\n\n    if (externalsToCheck.size) {\n      throw new Error(\n        \"require() statements for the following variant externals: \" +\n          [...externalsToCheck].join(\", \") +\n          \" were not found in the index.\"\n      );\n    }\n\n    // check ESM compat.\n    const tmpFileContents =\n      `import assert from \"node:assert\";\\n      \\n      const namingExceptions = [\\n        \"paginateOperation\", // name for all paginators.\\n        \"blobReader\" // name collision between chunked-blob-reader and chunked-blob-reader-native.\\n      ];\\n      ` +\n      this.canonicalExports\n        .filter((sym) => !sym.includes(\":\"))\n        .map((sym) => {\n          if (\n            [\n              \"getDefaultClientConfiguration\", // renamed as an alias\n              \"generateIdempotencyToken\", // sometimes called v4\n              \"expectInt\", // aliased to expectLong\n              \"handleFloat\", // aliased to limitedParseDouble\n              \"limitedParseFloat\", // aliased to limitedParseDouble\n              \"strictParseFloat\", // aliased to strictParseDouble\n              \"strictParseInt\", // aliased to strictParseLong\n              \"randomUUID\", // bound function from crypto.randomUUID.bind(crypto)\n              \"blobReaderNative\", // re-exported alias of blobReader from chunked-blob-reader-native\n              \"blobReader\", // name collision in bundle between chunked-blob-reader variants\n            ].includes(sym)\n          ) {\n            return `import { ${sym} } from \"${this.pkgJson.name}\";`;\n          }\n          return `import { ${sym} } from \"${this.pkgJson.name}\";\\nif (typeof ${sym} === \"function\") {\\n  if (${sym}.name !== \"${sym}\" && !namingExceptions.includes(${sym}.name)) {\\n    throw new Error(${sym}.name + \" does not equal expected ${sym}.\")\\n  }\\n} \\n        `;\n        })\n        .join(\"\\n\");\n    fs.writeFileSync(path.join(__dirname, \"tmp\", this.package + \".mjs\"), tmpFileContents, \"utf-8\");\n    await spawnProcess(\"node\", [path.join(__dirname, \"tmp\", this.package + \".mjs\")]);\n    if (this.verbose) {\n      console.log(\"ESM compatibility verified.\");\n    }\n    fs.rmSync(path.join(__dirname, \"tmp\", this.package + \".mjs\"));\n\n    return this;\n  }\n};\n"
  },
  {
    "path": "scripts/compilation/tmp/.gitignore",
    "content": "*.mjs"
  },
  {
    "path": "scripts/example.js",
    "content": "/**\n * Example script for iterating packages.\n */\n\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nconst root = path.join(__dirname, \"..\");\nconst packages = path.join(root, \"packages\");\n\nfor (const folder of fs.readdirSync(packages)) {\n  const pkgJson = require(path.join(packages, folder, \"package.json\"));\n}\n"
  },
  {
    "path": "scripts/inline.js",
    "content": "/**\n *\n * Inline a package as one dist file.\n *\n */\n\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst Inliner = require(\"./compilation/Inliner\");\n\nconst root = path.join(__dirname, \"..\");\n\nconst package = process.argv[2];\n\nif (!package) {\n  /**\n   * If no package is selected, this script sets all build:cjs scripts to\n   * use this inliner script instead of only tsc.\n   */\n  const packages = fs.readdirSync(path.join(root, \"packages\"));\n  for (const pkg of packages) {\n    const pkgJsonFilePath = path.join(root, \"packages\", pkg, \"package.json\");\n    const pkgJson = require(pkgJsonFilePath);\n\n    delete pkgJson.scripts[\"build:cjs\"];\n    delete pkgJson.scripts[\"build:es\"];\n    pkgJson.scripts[\"build:es:cjs\"] = `yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline ${pkg}`;\n    pkgJson.scripts.build = `concurrently 'yarn:build:types' 'yarn:build:es:cjs'`;\n\n    const scripts = {};\n    const keys = Object.keys(pkgJson.scripts);\n    for (const key of keys.sort()) {\n      scripts[key] = pkgJson.scripts[key];\n    }\n    pkgJson.scripts = scripts;\n\n    fs.writeFileSync(pkgJsonFilePath, JSON.stringify(pkgJson, null, 2));\n  }\n} else {\n  (async () => {\n    const inliner = new Inliner(package);\n    await inliner.clean();\n    await inliner.tsc();\n    await inliner.discoverVariants();\n    await inliner.bundle();\n    await inliner.cleanupInlinedFiles();\n    await inliner.fixVariantImportPaths();\n    await inliner.validate();\n  })();\n}\n"
  },
  {
    "path": "scripts/package-json-enforcement.js",
    "content": "const { error } = require(\"console\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\n\n/**\n * This enforcement is not here to prevent adoption of newer\n * package standards such as \"exports\". It is to ensure consistency in the\n * monorepo until the time comes for those changes.\n * ----\n *\n * The script will enforce several things on a package json object:\n *\n * - main and module must be defined.\n *   In the future this may change. Browser is more standard than module, and\n *   exports may be used for ESM (.mjs) support.\n *\n * - If a react-native entry exists, browser and react native entries must be of the\n *   same type (object replacement directives or string entry point).\n *   If either is not defined, both must not be defined.\n *\n * - when react-native has file replacement directives, it must include both\n *   CJS and ESM dist replacements.\n *\n * - exports must not be defined unless the package name is core.\n */\nmodule.exports = function (pkgJsonFilePath, overwrite = false) {\n  const errors = [];\n\n  const pkgJson = require(pkgJsonFilePath);\n  if (!pkgJson.name.endsWith(\"/core\")) {\n    if (\"exports\" in pkgJson) {\n      errors.push(`${pkgJson.name} must not have an 'exports' field.`);\n      if (overwrite) {\n        delete pkgJson.exports;\n      }\n    }\n  }\n\n  for (const requiredField of [\"main\", \"module\"]) {\n    if (!(requiredField in pkgJson)) {\n      errors.push(`${requiredField} field missing in ${pkgJson.name}`);\n      if (overwrite) {\n        switch (requiredField) {\n          case \"main\":\n            pkgJson[requiredField] = \"./dist-cjs/index.js\";\n            break;\n          case \"module\":\n            pkgJson[requiredField] = pkgJson.main.replace(\"dist-cjs\", \"dist-es\");\n            break;\n        }\n      }\n    }\n  }\n\n  if (typeof pkgJson.browser !== typeof pkgJson[\"react-native\"]) {\n    errors.push(`browser and react-native fields are different in ${pkgJson.name}`);\n  }\n\n  if (!pkgJson.files) {\n    errors.push(`no files entry in ${pkgJson.name}`);\n  }\n\n  if (typeof pkgJson.browser === \"object\" && typeof pkgJson[\"react-native\"] === \"object\") {\n    // Skip canonicalization for packages with submodules — they manage their own fields.\n    const pkgDirEarly = path.dirname(pkgJsonFilePath);\n    const hasSubmodulesEarly = fs.existsSync(path.join(pkgDirEarly, \"src\", \"submodules\"));\n    if (!hasSubmodulesEarly) {\n      const browserCanonical = Object.entries(pkgJson.browser).reduce((acc, [k, v]) => {\n        if (!k.includes(\"dist-cjs/\") || typeof v === \"boolean\") {\n          acc[k] = v;\n        }\n        return acc;\n      }, {});\n\n      if (Object.keys(browserCanonical).length !== Object.keys(pkgJson.browser).length) {\n        errors.push(`${pkgJson.name} browser field is incomplete.`);\n        if (overwrite) {\n          pkgJson.browser = browserCanonical;\n        }\n      }\n\n      const reactNativeCanonical = [\n        ...new Set([\n          ...Object.entries(pkgJson[\"react-native\"]).map(([k, v]) => [\n            k.replace(\"dist-cjs\", \"dist-es\"),\n            typeof v === \"string\" ? v.replace(\"dist-cjs\", \"dist-es\") : v,\n          ]),\n          ...Object.entries(pkgJson[\"react-native\"]).map(([k, v]) => [\n            k.replace(\"dist-es\", \"dist-cjs\"),\n            typeof v === \"string\" ? v.replace(\"dist-es\", \"dist-cjs\") : v,\n          ]),\n        ]),\n      ].reduce((acc, [k, v]) => {\n        acc[k] = v;\n        return acc;\n      }, {});\n\n      if (Object.keys(reactNativeCanonical).length !== Object.keys(pkgJson[\"react-native\"]).length) {\n        errors.push(`${pkgJson.name} react-native field is incomplete.`);\n        if (overwrite) {\n          pkgJson[\"react-native\"] = reactNativeCanonical;\n        }\n      }\n    } else {\n      // For submodule packages, validate that index.browser.ts/index.native.ts are declared.\n      const submodulesDir = path.join(pkgDirEarly, \"src\", \"submodules\");\n      const browserField = pkgJson.browser || {};\n      const reactNativeField = pkgJson[\"react-native\"] || {};\n      let didModify = false;\n\n      for (const sub of fs.readdirSync(submodulesDir)) {\n        const subPath = path.join(submodulesDir, sub);\n        if (!fs.lstatSync(subPath).isDirectory()) {\n          continue;\n        }\n\n        const esIndex = `./dist-es/submodules/${sub}/index.js`;\n        const cjsIndex = `./dist-cjs/submodules/${sub}/index.js`;\n\n        if (fs.existsSync(path.join(subPath, \"index.browser.ts\"))) {\n          const esBrowserExpected = `./dist-es/submodules/${sub}/index.browser.js`;\n\n          // browser field: re-path dist-es only.\n          if (browserField[esIndex] !== esBrowserExpected) {\n            errors.push(`${pkgJson.name} browser[\"${esIndex}\"] should be \"${esBrowserExpected}\"`);\n            if (overwrite) {\n              browserField[esIndex] = esBrowserExpected;\n              didModify = true;\n            }\n          }\n\n          // Conditional exports must have \"browser\" condition pointing to dist-es.\n          const exportEntry = pkgJson.exports?.[`./${sub}`];\n          if (exportEntry) {\n            const esBrowser = esBrowserExpected;\n            const cjsBrowser = esBrowser.replace(\"dist-es\", \"dist-cjs\");\n            const expectedBrowser = { import: esBrowser, require: cjsBrowser };\n            if (JSON.stringify(exportEntry.browser) !== JSON.stringify(expectedBrowser)) {\n              errors.push(`${pkgJson.name} exports[\"./${sub}\"].browser should be ${JSON.stringify(expectedBrowser)}`);\n              if (overwrite) {\n                exportEntry.browser = expectedBrowser;\n              }\n            }\n            // react-native condition: native variant if exists, otherwise browser fallback.\n            const hasNative = fs.existsSync(path.join(subPath, \"index.native.ts\"));\n            const esRn = hasNative\n              ? `./dist-es/submodules/${sub}/index.native.js`\n              : esBrowser;\n            const cjsRn = esRn.replace(\"dist-es\", \"dist-cjs\");\n            const expectedRn = { import: esRn, require: cjsRn };\n            if (JSON.stringify(exportEntry[\"react-native\"]) !== JSON.stringify(expectedRn)) {\n              errors.push(`${pkgJson.name} exports[\"./${sub}\"][\"react-native\"] should be ${JSON.stringify(expectedRn)}`);\n              if (overwrite) {\n                exportEntry[\"react-native\"] = expectedRn;\n              }\n            }\n          }\n        }\n\n        if (fs.existsSync(path.join(subPath, \"index.native.ts\"))) {\n          const esNativeExpected = `./dist-es/submodules/${sub}/index.native.js`;\n          const cjsNativeExpected = `./dist-cjs/submodules/${sub}/index.native.js`;\n\n          // react-native field: re-path both dist-es and dist-cjs.\n          if (reactNativeField[esIndex] !== esNativeExpected) {\n            errors.push(`${pkgJson.name} react-native[\"${esIndex}\"] should be \"${esNativeExpected}\"`);\n            if (overwrite) {\n              reactNativeField[esIndex] = esNativeExpected;\n              didModify = true;\n            }\n          }\n          if (reactNativeField[cjsIndex] !== cjsNativeExpected) {\n            errors.push(`${pkgJson.name} react-native[\"${cjsIndex}\"] should be \"${cjsNativeExpected}\"`);\n            if (overwrite) {\n              reactNativeField[cjsIndex] = cjsNativeExpected;\n              didModify = true;\n            }\n          }\n        } else if (fs.existsSync(path.join(subPath, \"index.browser.ts\"))) {\n          // No native variant — react-native falls back to browser for both dist-es and dist-cjs.\n          const esBrowserExpected = `./dist-es/submodules/${sub}/index.browser.js`;\n          const cjsBrowserExpected = `./dist-cjs/submodules/${sub}/index.browser.js`;\n\n          if (reactNativeField[esIndex] !== esBrowserExpected) {\n            errors.push(`${pkgJson.name} react-native[\"${esIndex}\"] should be \"${esBrowserExpected}\" (fallback to browser)`);\n            if (overwrite) {\n              reactNativeField[esIndex] = esBrowserExpected;\n              didModify = true;\n            }\n          }\n          if (reactNativeField[cjsIndex] !== cjsBrowserExpected) {\n            errors.push(`${pkgJson.name} react-native[\"${cjsIndex}\"] should be \"${cjsBrowserExpected}\" (fallback to browser)`);\n            if (overwrite) {\n              reactNativeField[cjsIndex] = cjsBrowserExpected;\n              didModify = true;\n            }\n          }\n        }\n      }\n\n      // Enforce condition key ordering in exports.\n      const expectedOrder = [\"types\", \"react-native\", \"browser\", \"module\", \"node\", \"import\", \"require\", \"default\"];\n      for (const [exportPath, exportEntry] of Object.entries(pkgJson.exports)) {\n        if (typeof exportEntry !== \"object\" || exportEntry === null) {\n          continue;\n        }\n        const keys = Object.keys(exportEntry);\n        const ordered = keys.slice().sort((a, b) => {\n          const ai = expectedOrder.indexOf(a);\n          const bi = expectedOrder.indexOf(b);\n          return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi);\n        });\n        if (JSON.stringify(keys) !== JSON.stringify(ordered)) {\n          errors.push(`${pkgJson.name} exports[\"${exportPath}\"] keys should be ordered: ${ordered.join(\", \")}`);\n          if (overwrite) {\n            const reordered = {};\n            for (const k of ordered) {\n              reordered[k] = exportEntry[k];\n            }\n            pkgJson.exports[exportPath] = reordered;\n          }\n        }\n      }\n\n      if (didModify) {\n        pkgJson.browser = browserField;\n        pkgJson[\"react-native\"] = reactNativeField;\n      }\n    }\n  }\n\n  // Validate variant replacement directives match source files.\n  // Skip for packages with submodules — they use index-level variant files instead.\n  const pkgDir = path.dirname(pkgJsonFilePath);\n  const srcDir = path.join(pkgDir, \"src\");\n  const hasSubmodules = fs.existsSync(path.join(srcDir, \"submodules\"));\n  if (fs.existsSync(srcDir) && !hasSubmodules) {\n    const browserField = pkgJson.browser || {};\n    const reactNativeField = pkgJson[\"react-native\"] || {};\n    let didModify = false;\n\n    // Check that every .browser.ts / .native.ts source file has directives.\n    const walkSync = (dir) => {\n      const results = [];\n      for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n        const fullPath = path.join(dir, entry.name);\n        if (entry.isDirectory()) {\n          results.push(...walkSync(fullPath));\n        } else {\n          results.push(fullPath);\n        }\n      }\n      return results;\n    };\n\n    for (const file of walkSync(srcDir)) {\n      if (file.match(/\\.(browser|native)\\.ts$/) && !file.match(/\\.spec\\.|\\.integ\\./)) {\n        const relativePath = file.replace(srcDir, \"\").replace(/\\.ts$/, \"\");\n        const canonicalPath = relativePath.replace(/\\.(browser|native)$/, \"\");\n        const variant = relativePath.match(/\\.(browser|native)$/)[1];\n\n        const esCanonical = `./dist-es${canonicalPath}`;\n        const esVariant = `./dist-es${relativePath}`;\n        const cjsCanonical = `./dist-cjs${canonicalPath}`;\n        const cjsVariant = `./dist-cjs${relativePath}`;\n\n        // For react-native, .native takes precedence over .browser.\n        const hasNativeVariant = variant === \"browser\" && fs.existsSync(file.replace(/\\.browser\\.ts$/, \".native.ts\"));\n\n        if (variant === \"browser\") {\n          if (browserField[esCanonical] !== esVariant) {\n            errors.push(`${pkgJson.name} browser[\"${esCanonical}\"] should be \"${esVariant}\"`);\n            if (overwrite) {\n              browserField[esCanonical] = esVariant;\n              didModify = true;\n            }\n          }\n          if (!hasNativeVariant) {\n            if (reactNativeField[esCanonical] !== esVariant) {\n              errors.push(`${pkgJson.name} react-native[\"${esCanonical}\"] should be \"${esVariant}\"`);\n              if (overwrite) {\n                reactNativeField[esCanonical] = esVariant;\n                didModify = true;\n              }\n            }\n            if (reactNativeField[cjsCanonical] !== cjsVariant) {\n              errors.push(`${pkgJson.name} react-native[\"${cjsCanonical}\"] should be \"${cjsVariant}\"`);\n              if (overwrite) {\n                reactNativeField[cjsCanonical] = cjsVariant;\n                didModify = true;\n              }\n            }\n          }\n        } else if (variant === \"native\") {\n          if (reactNativeField[esCanonical] !== esVariant) {\n            errors.push(`${pkgJson.name} react-native[\"${esCanonical}\"] should be \"${esVariant}\"`);\n            if (overwrite) {\n              reactNativeField[esCanonical] = esVariant;\n              didModify = true;\n            }\n          }\n          if (reactNativeField[cjsCanonical] !== cjsVariant) {\n            errors.push(`${pkgJson.name} react-native[\"${cjsCanonical}\"] should be \"${cjsVariant}\"`);\n            if (overwrite) {\n              reactNativeField[cjsCanonical] = cjsVariant;\n              didModify = true;\n            }\n          }\n        }\n      }\n    }\n\n    if (didModify) {\n      if (Object.keys(browserField).length) {\n        pkgJson.browser = browserField;\n      }\n      if (Object.keys(reactNativeField).length) {\n        pkgJson[\"react-native\"] = reactNativeField;\n      }\n    }\n\n    // Verify each existing directive points to an actual source file.\n    for (const [field, directives] of [\n      [\"browser\", pkgJson.browser],\n      [\"react-native\", pkgJson[\"react-native\"]],\n    ]) {\n      if (typeof directives !== \"object\" || directives === null) {\n        continue;\n      }\n      for (const [canonical, variant] of Object.entries(directives)) {\n        if (typeof variant === \"boolean\") {\n          continue;\n        }\n        if (!variant.startsWith(\"./\")) {\n          continue;\n        }\n        const variantSrcFile = path.join(\n          pkgDir,\n          variant.replace(/^\\.\\/dist-(es|cjs)/, \"src\").replace(/(\\.js)?$/, \".ts\")\n        );\n        if (!fs.existsSync(variantSrcFile)) {\n          errors.push(\n            `${pkgJson.name} ${field}[\"${canonical}\"] -> \"${variant}\" has no corresponding source file (expected ${variantSrcFile})`\n          );\n        }\n      }\n    }\n  }\n\n  if (overwrite && errors.length) {\n    fs.writeFileSync(pkgJsonFilePath, JSON.stringify(pkgJson, null, 2) + \"\\n\");\n  }\n\n  return errors;\n};\n"
  },
  {
    "path": "scripts/post-protocol-test-codegen.js",
    "content": "/**\n *\n * Script to be run after protocol test codegen to set the smithy dependencies\n * to workspace:^\n *\n */\n\nconst path = require(\"node:path\");\nconst fs = require(\"node:fs\");\n\nconst root = path.join(__dirname, \"..\");\n\nconst private = path.join(root, \"private\");\n\nconst privatePackages = fs.readdirSync(private);\n\nfor (const dir of privatePackages) {\n  const pkgJsonPath = path.join(private, dir, \"package.json\");\n  if (fs.existsSync(pkgJsonPath)) {\n    const pkgJson = require(pkgJsonPath);\n    for (const dep in pkgJson.dependencies ?? {}) {\n      if (dep.startsWith(\"@smithy/\")) {\n        pkgJson.dependencies[dep] = \"workspace:^\";\n      }\n    }\n    for (const dep in pkgJson.devDependencies ?? {}) {\n      if (dep.startsWith(\"@smithy/\")) {\n        pkgJson.devDependencies[dep] = \"workspace:^\";\n      }\n    }\n    fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + \"\\n\");\n  }\n}\n"
  },
  {
    "path": "scripts/retry.js",
    "content": "#!/usr/bin/env node\n\nconst path = require(\"node:path\");\nconst { spawnProcess } = require(\"./utils/spawn-process\");\n\nconst [command, ...args] = process.argv.slice(process.argv.indexOf(\"--\") + 1);\n\n(async () => {\n  const maxAttempts = 3;\n  let attempt = 1;\n\n  while (attempt++ <= maxAttempts) {\n    try {\n      await spawnProcess(command, args, {\n        stdio: \"inherit\",\n        cwd: path.join(__dirname, \"..\"),\n      });\n      return;\n    } catch (e) {\n      console.error(\"Command exited non-zero:\", command, ...args);\n      console.error(e);\n      console.log(`Starting attempt: ${attempt}`);\n    }\n  }\n\n  process.exit(1);\n})();\n"
  },
  {
    "path": "scripts/runtime-dep-version-check.js",
    "content": "#!/usr/bin/env node\n\n/**\n * This script checks the declared dependencies throughout the entire repo\n * and throws an error if there is are more than one version of a dependency.\n *\n * @example\n * ```\n * There is more than one version of a declared dependency\n * @smithy/middleware-endpoint {\n *   '^1.0.2': '350 locations',\n *   '^1.0.1': [\n *     '@aws-sdk/lib-storage',\n *     '@aws-sdk/middleware-sdk-ec2',\n *     '@aws-sdk/middleware-sdk-rds',\n *     '@aws-sdk/s3-presigned-post',\n *     '@aws-sdk/s3-request-presigner'\n *   ]\n * }\n * ```\n */\n\nconst fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst root = path.join(__dirname, \"..\");\n\nconst packages = fs.readdirSync(path.join(root, \"packages\"));\n\nconst nonClientPackages = [...packages.map((p) => path.join(root, \"packages\", p))];\n\nconst deps = {\n  /* @namespace/name: {\n    [version]: [location, location]\n  } */\n};\n\nreadPackages(nonClientPackages);\ncheckVersions();\n\nfunction checkVersions() {\n  const errors = [];\n\n  for (const [pkg, versions] of Object.entries(deps)) {\n    const versionCount = Object.keys(versions).length;\n    if (versionCount > 1) {\n      console.error(\"There is more than one version of a declared dependency.\");\n      console.error(\n        pkg,\n        Object.entries(versions).reduce((acc, [version, locations]) => {\n          acc[version] = locations.length > 20 ? `${locations.length} locations` : locations;\n          return acc;\n        }, {})\n      );\n      errors.push(pkg);\n    }\n  }\n\n  if (errors.length) {\n    const violations = errors.join(\", \");\n    throw new Error(violations + \" have inconsistent declared versions.\");\n  }\n}\n\nfunction readPackages(packages) {\n  for (const pkg of packages) {\n    const pkgJson = require(path.join(pkg, \"package.json\"));\n    const { dependencies = {}, devDependencies = {} } = pkgJson;\n    for (const [name, version] of Object.entries(dependencies)) {\n      if (version.startsWith(\"file:\")) {\n        continue;\n      }\n      deps[name] = deps[name] ?? {};\n      deps[name][version] = deps[name][version] ?? [];\n      deps[name][version].push(pkgJson.name);\n    }\n\n    for (const [name, version] of Object.entries(devDependencies)) {\n      if (version.startsWith(\"file:\")) {\n        continue;\n      }\n      deps[name] = deps[name] ?? {};\n      deps[name][version] = deps[name][version] ?? [];\n      deps[name][version].push(pkgJson.name);\n    }\n  }\n}\n"
  },
  {
    "path": "scripts/set-engines.js",
    "content": "const fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nconst packages = fs.readdirSync(path.join(__dirname, \"..\", \"packages\"));\n\nfor (const pkgFolder of packages) {\n  const pkgJsonPath = path.join(__dirname, \"..\", \"packages\", pkgFolder, \"package.json\");\n  const pkgJson = require(pkgJsonPath);\n  pkgJson[\"engines\"] = {\n    node: \">=18.0.0\",\n  };\n  fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + \"\\n\");\n}\n"
  },
  {
    "path": "scripts/utils/list-folders.js",
    "content": "const fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\n/**\n * @param dir - directory.\n * @param basenameOnly - if true, return only the basename of the subdirectories\n * @returns {string[]} list of full-paths of subdirectories (not files) in the given directory.\n */\nfunction listFolders(dir, basenameOnly = true) {\n  const folders = [];\n  for (const fileSystemEntry of fs.readdirSync(dir, { withFileTypes: true })) {\n    if (fileSystemEntry.isDirectory()) {\n      if (basenameOnly) {\n        folders.push(fileSystemEntry.name);\n      } else {\n        folders.push(path.join(dir, fileSystemEntry.name));\n      }\n    }\n  }\n  return folders;\n}\n\nmodule.exports = {\n  listFolders,\n};\n"
  },
  {
    "path": "scripts/utils/spawn-process.js",
    "content": "// @ts-check\nconst { spawn } = require(\"child_process\");\n\nconst spawnProcess = async (command, args = [], options = {}) => {\n  const childProcess = spawn(command, args, options);\n\n  childProcess.stdout?.pipe(process.stdout);\n  childProcess.stderr?.pipe(process.stderr);\n\n  return new Promise((resolve, reject) => {\n    childProcess.on(\"error\", reject);\n    childProcess.on(\"exit\", (code, signal) =>\n      code === 0 ? resolve(0) : reject(`${command} failed with { code: ${code}, signal: ${signal} }`)\n    );\n  });\n};\n\nmodule.exports = { spawnProcess };\n"
  },
  {
    "path": "scripts/utils/walk.js",
    "content": "const fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nmodule.exports = async function* walk(dir, ignore = []) {\n  for await (const d of await fs.promises.opendir(dir)) {\n    const entry = path.join(dir, d.name);\n    if (ignore.find((ignored) => entry.includes(ignored))) {\n      continue;\n    }\n    if (d.isDirectory()) {\n      yield* walk(entry, ignore);\n    } else if (d.isFile()) {\n      yield entry;\n    }\n  }\n};\n"
  },
  {
    "path": "scripts/validation/api-snapshot-validation.js",
    "content": "#!/usr/bin/env node\n\n/**\nThis script uses the JSON file api-snapshot/api.json to validate that previously present symbols\nare still exported by the packages within the assessed group.\n\nData may only be deleted from api.json in an intentional backwards-incompatible change.\n */\n\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\nconst ts = require(\"typescript\");\n\nconst root = path.join(__dirname, \"..\", \"..\");\nconst dataPath = path.join(root, \"api-snapshot\", \"api.json\");\nconst api = require(dataPath);\n\napi.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\nconst packageDirs = fs.readdirSync(path.join(root, \"packages\")).map((f) => path.join(root, \"packages\", f));\nconst errors = [];\n\n// Collect all .d.ts entry points upfront.\nconst dtsEntries = []; // { dtsPath, name, version, cjsPath, exportConfig? }\n\nfor (const packageRoot of packageDirs) {\n  const pkgJsonPath = path.join(packageRoot, \"package.json\");\n  const cjsPath = path.join(packageRoot, \"dist-cjs\", \"index.js\");\n\n  if (fs.existsSync(pkgJsonPath) && fs.existsSync(cjsPath)) {\n    const packageJson = require(pkgJsonPath);\n    const { name, version } = packageJson;\n\n    const dtsPath = path.join(packageRoot, packageJson.types || \"dist-types/index.d.ts\");\n    if (fs.existsSync(dtsPath)) {\n      dtsEntries.push({ dtsPath, name, version, cjsPath });\n    }\n\n    if (packageJson.exports) {\n      for (const [exportPath, exportConfig] of Object.entries(packageJson.exports)) {\n        if (exportPath === \".\" || exportPath === \"./package.json\") continue;\n        const subCjsPath = path.join(packageRoot, exportConfig.require || exportConfig.node);\n        const subDtsPath = path.join(packageRoot, exportConfig.types || \"\");\n        if (fs.existsSync(subCjsPath) && fs.existsSync(subDtsPath)) {\n          const subName = `${name}/${exportPath.replace(\"./\", \"\")}`;\n          dtsEntries.push({ dtsPath: subDtsPath, name: subName, version, cjsPath: subCjsPath });\n        }\n      }\n    }\n  }\n}\n\n// Create a single TypeScript program with all entry points.\nconst submodulesDir = path.join(root, \"packages\", \"core\", \"src\", \"submodules\");\nconst submodulePaths = {};\nfor (const dir of fs.readdirSync(submodulesDir, { withFileTypes: true })) {\n  if (dir.isDirectory()) {\n    submodulePaths[`@smithy/core/${dir.name}`] = [`packages/core/dist-types/submodules/${dir.name}/index.d.ts`];\n  }\n}\n\nconst allDtsPaths = dtsEntries.map((e) => e.dtsPath);\nconst program = ts.createProgram(allDtsPaths, {\n  moduleResolution: ts.ModuleResolutionKind.NodeJs,\n  baseUrl: root,\n  paths: {\n    ...submodulePaths,\n    \"@smithy/*\": [\"packages/*/dist-types\"],\n  },\n});\nconst checker = program.getTypeChecker();\n\n/**\n * Extract type-only exports from a .d.ts entry point using the shared program.\n */\nfunction getTypeExports(dtsPath) {\n  const typeExports = new Map();\n  const sourceFile = program.getSourceFile(dtsPath);\n  if (!sourceFile) return typeExports;\n\n  const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n  if (!moduleSymbol) return typeExports;\n\n  const exports = checker.getExportsOfModule(moduleSymbol);\n  for (const sym of exports) {\n    let resolved = sym;\n    if (resolved.flags & ts.SymbolFlags.Alias) {\n      resolved = checker.getAliasedSymbol(resolved);\n    }\n    const flags = resolved.flags;\n    const isTypeOnly =\n      !!(flags & ts.SymbolFlags.Interface) ||\n      !!(flags & ts.SymbolFlags.TypeAlias) ||\n      (!!(flags & ts.SymbolFlags.Enum) && !(flags & ts.SymbolFlags.RegularEnum));\n    if (isTypeOnly) {\n      let kind = \"type\";\n      if (flags & ts.SymbolFlags.Interface) {\n        kind = \"type(interface)\";\n      } else if (flags & ts.SymbolFlags.TypeAlias) {\n        const type = checker.getDeclaredTypeOfSymbol(resolved);\n        if (type.isUnion()) kind = \"type(union)\";\n        else if (type.isIntersection()) kind = \"type(intersection)\";\n        else if (type.flags & ts.TypeFlags.String) kind = \"type(string)\";\n        else if (type.flags & ts.TypeFlags.Number) kind = \"type(number)\";\n        else if (type.flags & ts.TypeFlags.Boolean) kind = \"type(boolean)\";\n        else if (type.flags & ts.TypeFlags.Object) kind = \"type(object)\";\n        else kind = \"type(alias)\";\n      } else {\n        kind = \"type(?)\";\n      }\n      typeExports.set(sym.getName(), kind);\n    }\n  }\n  return typeExports;\n}\n\n// Process each entry.\nfor (const { dtsPath, name, version, cjsPath } of dtsEntries) {\n  const module = require(cjsPath);\n  const typeExports = getTypeExports(dtsPath);\n  checkModule(name, version, module, typeExports);\n}\n\nfunction checkModule(name, version, module, typeExports) {\n  for (const key of Object.keys(module)) {\n    if (module[key] === undefined) {\n      console.warn(`symbol ${key} in ${name}@${version} has a value of undefined.`);\n    }\n  }\n\n  // Merge runtime keys and type-only keys into a combined snapshot.\n  const allSymbols = new Set([...Object.keys(module), ...typeExports.keys()]);\n\n  if (!api[name]) {\n    api[name] = {};\n    for (const key of allSymbols) {\n      api[name][key] = key in module ? typeof module[key] : typeExports.get(key);\n    }\n  } else {\n    for (const symbol of [...new Set([...Object.keys(api[name]), ...allSymbols])]) {\n      const inRuntime = symbol in module;\n      const inTypes = typeExports.has(symbol);\n      const inSnapshot = symbol in api[name];\n      const inCurrent = inRuntime || inTypes;\n\n      if (inCurrent && !inSnapshot) {\n        const kind = inRuntime ? typeof module[symbol] : typeExports.get(symbol);\n        errors.push(`You must commit changes in api.json adding ${symbol} (${kind}) to ${name}.`);\n        api[name][symbol] = kind;\n      }\n      if (!inCurrent && inSnapshot) {\n        errors.push(`Symbol [${symbol}] is missing from ${name}, (${api[name][symbol]}).`);\n      }\n      if (inCurrent && inSnapshot) {\n        const expectedKind = api[name][symbol];\n        const actualKind = inRuntime ? typeof module[symbol] : typeExports.get(symbol);\n        const baseExpectedKind = expectedKind.replace(\"(node-only)\", \"\");\n        if (baseExpectedKind !== actualKind) {\n          errors.push(\n            `Symbol [${symbol}] has a different type than expected in ${name}, actual=${actualKind} expected=${expectedKind}.`\n          );\n        }\n      }\n    }\n  }\n}\n\n// Validate submodule variant indexes export the same symbols as the node canonical.\nconst coreDir = path.join(root, \"packages\", \"core\");\n\n// Create separate TS programs for browser and native variant type checking.\nfunction createVariantProgram(variant) {\n  const variantDtsPaths = [];\n  for (const dir of fs.readdirSync(submodulesDir, { withFileTypes: true })) {\n    if (!dir.isDirectory()) continue;\n    const variantDts = path.join(coreDir, \"dist-types\", \"submodules\", dir.name, `index.${variant}.d.ts`);\n    const nodeDts = path.join(coreDir, \"dist-types\", \"submodules\", dir.name, \"index.d.ts\");\n    variantDtsPaths.push(fs.existsSync(variantDts) ? variantDts : nodeDts);\n  }\n  return ts.createProgram(variantDtsPaths, {\n    moduleResolution: ts.ModuleResolutionKind.NodeJs,\n    baseUrl: root,\n    paths: {\n      ...submodulePaths,\n      \"@smithy/*\": [\"packages/*/dist-types\"],\n    },\n  });\n}\n\nconst variantPrograms = {\n  browser: createVariantProgram(\"browser\"),\n  native: createVariantProgram(\"native\"),\n};\n\nfor (const dir of fs.readdirSync(submodulesDir, { withFileTypes: true })) {\n  if (!dir.isDirectory()) continue;\n  const sub = dir.name;\n  const nodeIndex = path.join(coreDir, \"dist-cjs\", \"submodules\", sub, \"index.js\");\n  if (!fs.existsSync(nodeIndex)) continue;\n\n  const nodeModule = require(nodeIndex);\n  const snapshotName = `@smithy/core/${sub}`;\n  const nodeTypeExports = getTypeExports(path.join(coreDir, \"dist-types\", \"submodules\", sub, \"index.d.ts\"));\n\n  for (const variant of [\"browser\", \"native\"]) {\n    const variantIndex = path.join(coreDir, \"dist-cjs\", \"submodules\", sub, `index.${variant}.js`);\n    if (!fs.existsSync(variantIndex)) continue;\n\n    const variantModule = require(variantIndex);\n\n    // Check runtime exports match 1:1.\n    for (const key of Object.keys(nodeModule)) {\n      if (!(key in variantModule)) {\n        errors.push(`Symbol [${key}] is missing from ${snapshotName} index.${variant}.js`);\n      }\n    }\n    for (const key of Object.keys(variantModule)) {\n      if (!(key in nodeModule)) {\n        errors.push(`Symbol [${key}] in ${snapshotName} index.${variant}.js is not in the node index`);\n      }\n    }\n\n    // Check type exports match 1:1.\n    const variantDts = path.join(coreDir, \"dist-types\", \"submodules\", sub, `index.${variant}.d.ts`);\n    if (fs.existsSync(variantDts)) {\n      const variantChecker = variantPrograms[variant].getTypeChecker();\n      const variantSourceFile = variantPrograms[variant].getSourceFile(variantDts);\n      if (variantSourceFile) {\n        const variantModuleSymbol = variantChecker.getSymbolAtLocation(variantSourceFile);\n        const variantTypeNames = new Set(\n          variantModuleSymbol ? variantChecker.getExportsOfModule(variantModuleSymbol).map((s) => s.getName()) : []\n        );\n        for (const [typeName] of nodeTypeExports) {\n          if (!variantTypeNames.has(typeName)) {\n            errors.push(`Type [${typeName}] is missing from ${snapshotName} index.${variant}.d.ts`);\n          }\n        }\n        for (const typeName of variantTypeNames) {\n          if (!nodeTypeExports.has(typeName) && !(typeName in nodeModule)) {\n            errors.push(`Type [${typeName}] in ${snapshotName} index.${variant}.d.ts is not in the node index`);\n          }\n        }\n      }\n    }\n\n    // Mark node-only symbols (Symbol.for(\"node-only\") in variant) in the snapshot.\n    const nodeOnlySymbol = Symbol.for(\"node-only\");\n    for (const key of Object.keys(variantModule)) {\n      if (variantModule[key] === nodeOnlySymbol && nodeModule[key] != null && api[snapshotName]) {\n        const baseKind = typeof nodeModule[key];\n        const nodeOnlyKind = `${baseKind}(node-only)`;\n        api[snapshotName][key] = nodeOnlyKind;\n      }\n    }\n  }\n}\n\nconst sorted = Object.fromEntries(\n  Object.entries(api)\n    .sort(([a], [b]) => a.localeCompare(b))\n    .map(([k, v]) =>\n      [k, typeof v === \"object\" && v !== null ? Object.fromEntries(Object.entries(v).sort(([a], [b]) => a.localeCompare(b))) : v]\n    )\n);\n\nfs.writeFileSync(dataPath, JSON.stringify(sorted, null, 2));\n\nif (errors.length) {\n  throw new Error(errors.join(\"\\n\"));\n} else {\n  console.log(`✅ API snapshot test passed.`);\n}\n"
  },
  {
    "path": "scripts/validation/no-generic-byte-arrays.js",
    "content": "#!/usr/bin/env node\n\n/**\n * Runs after a full build to assert that Uint8Array was not generated with a type parameter\n * by TypeScript, which is only compatible with TypeScript 5.7.\n */\n\nconst walk = require(\"../utils/walk\");\nconst fs = require(\"node:fs\");\nconst path = require(\"node:path\");\n\nconst root = path.join(__dirname, \"..\", \"..\");\n\nconst packages = path.join(root, \"packages\");\n\n(async () => {\n  const errors = [];\n  for (const folder of fs.readdirSync(packages)) {\n    const packagePath = path.join(packages, folder);\n    const distTypes = path.join(packagePath, \"dist-types\");\n    if (fs.existsSync(distTypes)) {\n      for await (const file of walk(distTypes)) {\n        const contents = fs.readFileSync(file, \"utf-8\");\n        if (contents.includes(\"Uint8Array<\")) {\n          errors.push(file);\n        }\n      }\n    }\n  }\n  if (errors.length > 0) {\n    throw new Error(\n      `The following files used Uint8Array in a generic way, only compatible with TypeScript 5.7:\\n\\t${errors.join(\n        \"\\n\\t\"\n      )}`\n    );\n  } else {\n    console.log(`✅ No Uint8Arrays with type parameters.`);\n  }\n})();\n"
  },
  {
    "path": "settings.gradle.kts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport java.io.FileInputStream\nimport java.nio.charset.StandardCharsets.UTF_8\n\nrootProject.name = \"smithy-typescript\"\ninclude(\":smithy-typescript-codegen\")\ninclude(\":smithy-typescript-codegen-test\")\ninclude(\":smithy-typescript-protocol-test-codegen\")\ninclude(\":smithy-typescript-codegen-test:example-weather-customizations\")\ninclude(\":smithy-typescript-codegen-test:released-version-test\")\ninclude(\":smithy-typescript-ssdk-codegen-test-utils\")\n\nfile(\n    java.nio.file.Paths\n        .get(rootProject.projectDir.absolutePath, \"local.properties\"),\n).takeIf { it.isFile }\n    ?.let { f ->\n        java.util.Properties().apply { load(java.io.InputStreamReader(FileInputStream(f), UTF_8)) }\n    }?.run {\n        listOf(\"smithy\")\n            .map { it to getProperty(it) }\n            .filterNot { it.second.isNullOrEmpty() }\n            .onEach { println(\"Found property `${it.first}`: ${it.second}\") }\n            .map { file(it.second) }\n            .filter { it.isDirectory }\n            .forEach { includeBuild(it.absolutePath) }\n    }\n\npluginManagement {\n    val smithyGradleVersion: String by settings\n    plugins {\n        id(\"software.amazon.smithy.gradle.smithy-jar\").version(smithyGradleVersion)\n        id(\"software.amazon.smithy.gradle.smithy-base\").version(smithyGradleVersion)\n    }\n\n    repositories {\n        mavenLocal()\n        mavenCentral()\n        gradlePluginPortal()\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/build.gradle.kts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport software.amazon.smithy.model.node.Node\n\ndescription = \"Generates TypeScript code from Smithy models\"\nextra[\"displayName\"] = \"Smithy :: Typescript :: Codegen\"\nextra[\"moduleName\"] = \"software.amazon.smithy.typescript.codegen\"\n\nval smithyVersion: String by project\n\nbuildscript {\n    val smithyVersion: String by project\n\n    repositories {\n        mavenCentral()\n    }\n\n    dependencies {\n        classpath(\"software.amazon.smithy:smithy-model:$smithyVersion\")\n    }\n}\n\ndependencies {\n    val smithyVersion: String by project\n\n    // Smithy generic dependencies\n    api(\"software.amazon.smithy:smithy-codegen-core:$smithyVersion\")\n    api(\"software.amazon.smithy:smithy-model:$smithyVersion\")\n    api(\"software.amazon.smithy:smithy-protocol-traits:$smithyVersion\")\n    api(\"software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion\")\n    api(\"software.amazon.smithy:smithy-rules-engine:$smithyVersion\")\n    api(\"software.amazon.smithy:smithy-waiters:$smithyVersion\")\n}\n\nsourceSets {\n    main {\n        resources {\n            setSrcDirs(\n                listOf(\n                    \"src/main/resources\",\n                    layout.buildDirectory\n                        .dir(\"generated/resources\")\n                        .get()\n                        .asFile,\n                ),\n            )\n        }\n    }\n}\n\nabstract class SetDependencyVersionsTask : DefaultTask() {\n    @get:InputDirectory\n    abstract val packagesDir: DirectoryProperty\n\n    @get:InputDirectory\n    abstract val smithyTsSsdkLibs: DirectoryProperty\n\n    @get:OutputFile\n    abstract val versionsFile: RegularFileProperty\n\n    @TaskAction\n    fun execute() {\n        val outputFile = versionsFile.get().asFile\n        outputFile.parentFile.mkdirs()\n        outputFile.printWriter().close()\n\n        val roots =\n            packagesDir\n                .get()\n                .asFile\n                .listFiles()\n                .toMutableList() +\n                smithyTsSsdkLibs\n                    .get()\n                    .asFile\n                    .listFiles()\n                    .toList()\n        roots.forEach { packageDir ->\n            val packageJsonFile = File(packageDir, \"package.json\")\n            if (packageJsonFile.isFile()) {\n                val packageJson = Node.parse(packageJsonFile.readText()).expectObjectNode()\n                val packageName = packageJson.expectStringMember(\"name\").getValue()\n                val packageVersion = packageJson.expectStringMember(\"version\").getValue()\n                val isPrivate = packageJson.getBooleanMemberOrDefault(\"private\", false)\n                if (!isPrivate) {\n                    outputFile.appendText(\"$packageName=$packageVersion\\n\")\n                }\n            }\n        }\n    }\n}\n\ntasks.register<SetDependencyVersionsTask>(\"set-dependency-versions\") {\n    packagesDir.set(project.file(\"../packages\"))\n    smithyTsSsdkLibs.set(project.file(\"../smithy-typescript-ssdk-libs\"))\n    versionsFile.set(\n        layout.buildDirectory.file(\"generated/resources/software/amazon/smithy/typescript/codegen/dependencyVersions.properties\"),\n    )\n}\n\ntasks[\"processResources\"].dependsOn(tasks[\"set-dependency-versions\"])\ntasks[\"sourcesJar\"].dependsOn(tasks[\"set-dependency-versions\"])\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ApplicationProtocol.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.Objects;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Represents the resolves {@link Symbol}s and references for an\n * application protocol (e.g., \"http\", \"mqtt\", etc).\n */\n@SmithyUnstableApi\npublic final class ApplicationProtocol {\n\n    private final String name;\n    private final SymbolReference optionsType;\n    private final SymbolReference requestType;\n    private final SymbolReference responseType;\n\n    /**\n     * Creates a resolved application protocol.\n     *\n     * @param name The protocol name (e.g., http, mqtt, etc).\n     * @param optionsType The type used to provide options to clients and commands.\n     * @param requestType The type used to represent request messages for the protocol.\n     * @param responseType The type used to represent response messages for the protocol.\n     */\n    public ApplicationProtocol(\n        String name,\n        SymbolReference optionsType,\n        SymbolReference requestType,\n        SymbolReference responseType\n    ) {\n        this.name = name;\n        this.optionsType = optionsType;\n        this.requestType = requestType;\n        this.responseType = responseType;\n    }\n\n    /**\n     * Creates a default HTTP application protocol.\n     *\n     * @return Returns the created application protocol.\n     */\n    public static ApplicationProtocol createDefaultHttpApplicationProtocol() {\n        return new ApplicationProtocol(\n            \"http\",\n            SymbolReference.builder()\n                .symbol(createHttpSymbol(TypeScriptDependency.SMITHY_TYPES, \"HttpHandlerOptions\", true))\n                .alias(\"__HttpHandlerOptions\")\n                .build(),\n            SymbolReference.builder()\n                .symbol(\n                    createHttpSymbol(TypeScriptDependency.SMITHY_CORE, \"@smithy/core/protocols\", \"HttpRequest\", true)\n                )\n                .alias(\"__HttpRequest\")\n                .build(),\n            SymbolReference.builder()\n                .symbol(\n                    createHttpSymbol(TypeScriptDependency.SMITHY_CORE, \"@smithy/core/protocols\", \"HttpResponse\", true)\n                )\n                .alias(\"__HttpResponse\")\n                .build()\n        );\n    }\n\n    private static Symbol createHttpSymbol(TypeScriptDependency dependency, String symbolName, boolean typeOnly) {\n        return createHttpSymbol(dependency, dependency.packageName, symbolName, typeOnly);\n    }\n\n    private static Symbol createHttpSymbol(\n        TypeScriptDependency dependency,\n        String namespace,\n        String symbolName,\n        boolean typeOnly\n    ) {\n        Symbol.Builder builder = Symbol.builder()\n            .namespace(namespace, \"/\")\n            .name(symbolName)\n            .addDependency(dependency)\n            .addDependency(TypeScriptDependency.AWS_SDK_FETCH_HTTP_HANDLER)\n            .addDependency(TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER);\n        if (typeOnly) {\n            builder.putProperty(\"typeOnly\", true);\n        }\n        return builder.build();\n    }\n\n    /**\n     * Gets the protocol name.\n     *\n     * <p>All HTTP protocols should start with \"http\".\n     * All MQTT protocols should start with \"mqtt\".\n     *\n     * @return Returns the protocol name.\n     */\n    public String getName() {\n        return name;\n    }\n\n    /**\n     * Checks if the protocol is an HTTP based protocol.\n     *\n     * @return Returns true if it is HTTP based.\n     */\n    public boolean isHttpProtocol() {\n        return getName().startsWith(\"http\");\n    }\n\n    /**\n     * Checks if the protocol is an MQTT based protocol.\n     *\n     * @return Returns true if it is MQTT based.\n     */\n    public boolean isMqttProtocol() {\n        return getName().startsWith(\"mqtt\");\n    }\n\n    /**\n     * Gets the symbol used to refer to options for this protocol.\n     *\n     * @return Returns the protocol options.\n     */\n    public SymbolReference getOptionsType() {\n        return optionsType;\n    }\n\n    /**\n     * Gets the symbol used to refer to the request type for this protocol.\n     *\n     * @return Returns the protocol request type.\n     */\n    public SymbolReference getRequestType() {\n        return requestType;\n    }\n\n    /**\n     * Gets the symbol used to refer to the response type for this protocol.\n     *\n     * @return Returns the protocol response type.\n     */\n    public SymbolReference getResponseType() {\n        return responseType;\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) {\n            return true;\n        } else if (!(o instanceof ApplicationProtocol)) {\n            return false;\n        }\n\n        ApplicationProtocol that = (ApplicationProtocol) o;\n        return (optionsType.equals(that.optionsType) &&\n            requestType.equals(that.requestType)\n            &&\n            responseType.equals(that.responseType));\n    }\n\n    @Override\n    public int hashCode() {\n        return Objects.hash(optionsType, requestType, responseType);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.EventStreamIndex;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.HttpPayloadTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.typescript.codegen.integration.AddSdkStreamMixinDependency;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Utility methods needed across Java packages.\n */\n@SmithyUnstableApi\npublic final class CodegenUtils {\n\n    public static final String SOURCE_FOLDER = \"src\";\n    public static final String TEST_FOLDER = \"test\";\n\n    private CodegenUtils() {}\n\n    /**\n     * Detects if an annotated mediatype indicates JSON contents.\n     *\n     * @param mediaType The media type to inspect.\n     * @return If the media type indicates JSON contents.\n     */\n    public static boolean isJsonMediaType(String mediaType) {\n        return mediaType.equals(\"application/json\") || mediaType.endsWith(\"+json\");\n    }\n\n    /**\n     * Get context type for command serializer functions.\n     * @param writer The code writer.\n     * @param model The model for the service containing the given command.\n     * @param operation The operation shape for given command.\n     * @return The TypeScript type for the serializer context\n     */\n    public static String getOperationSerializerContextType(\n        TypeScriptWriter writer,\n        Model model,\n        OperationShape operation\n    ) {\n        // Get default SerdeContext.\n        List<String> contextInterfaceList = getDefaultOperationSerdeContextTypes(writer);\n        // If event stream trait exists, add corresponding serde context type to the intersection type.\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        if (eventStreamIndex.getInputInfo(operation).isPresent()) {\n            writer.addTypeImport(\n                \"EventStreamSerdeContext\",\n                \"__EventStreamSerdeContext\",\n                TypeScriptDependency.SMITHY_TYPES\n            );\n            contextInterfaceList.add(\"__EventStreamSerdeContext\");\n        }\n        return String.join(\" & \", contextInterfaceList);\n    }\n\n    /**\n     * Get context type for command deserializer function.\n     * @param settings The TypeScript settings\n     * @param writer The code writer.\n     * @param model The model for the service containing the given command.\n     * @param operation The operation shape for given command.\n     * @return The TypeScript type for the deserializer context\n     */\n    public static String getOperationDeserializerContextType(\n        TypeScriptSettings settings,\n        TypeScriptWriter writer,\n        Model model,\n        OperationShape operation\n    ) {\n        // Get default SerdeContext.\n        List<String> contextInterfaceList = getDefaultOperationSerdeContextTypes(writer);\n        // If event stream trait exists, add corresponding serde context type to the intersection type.\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        if (eventStreamIndex.getOutputInfo(operation).isPresent()) {\n            writer.addTypeImport(\n                \"EventStreamSerdeContext\",\n                \"__EventStreamSerdeContext\",\n                TypeScriptDependency.SMITHY_TYPES\n            );\n            contextInterfaceList.add(\"__EventStreamSerdeContext\");\n        }\n        if (AddSdkStreamMixinDependency.hasStreamingBlobDeser(settings, model, operation)) {\n            writer.addTypeImport(\"SdkStreamSerdeContext\", \"__SdkStreamSerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n            contextInterfaceList.add(\"__SdkStreamSerdeContext\");\n        }\n        return String.join(\" & \", contextInterfaceList);\n    }\n\n    private static List<String> getDefaultOperationSerdeContextTypes(TypeScriptWriter writer) {\n        List<String> contextInterfaceList = new ArrayList<>();\n        // Get default SerdeContext.\n        writer.addTypeImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        contextInterfaceList.add(\"__SerdeContext\");\n        return contextInterfaceList;\n    }\n\n    static List<MemberShape> getBlobStreamingMembers(Model model, StructureShape shape) {\n        return shape\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(memberShape -> {\n                // Streaming blobs need to have their types modified\n                // See `writeClientCommandStreamingInputType`\n                Shape target = model.expectShape(memberShape.getTarget());\n                return target.isBlobShape() && target.hasTrait(StreamingTrait.class);\n            })\n            .collect(Collectors.toList());\n    }\n\n    /**\n     * Generate the type of the command input of the client sdk given the streaming blob\n     * member of the shape. The generated type eases the streaming member requirement so that users don't need to\n     * construct a stream every time.\n     * This type decoration is allowed in Smithy because it makes, for the same member, the type to be serialized is\n     * more permissive than the type to be deserialized.\n     * Refer here for more rationales: https://github.com/aws/aws-sdk-js-v3/issues/843\n     */\n    static void writeClientCommandStreamingInputType(\n        TypeScriptWriter writer,\n        Symbol containerSymbol,\n        String typeName,\n        MemberShape streamingMember,\n        String commandName\n    ) {\n        writer.addTypeImport(\"StreamingBlobPayloadInputTypes\", null, TypeScriptDependency.SMITHY_TYPES);\n        String memberName = streamingMember.getMemberName();\n        String optionalSuffix = streamingMember.isRequired() ? \"\" : \"?\";\n\n        writer.writeDocs(\"@public\\n\\nThe input for {@link \" + commandName + \"}.\");\n        writer.write(\n            \"\"\"\n            export interface $L extends Omit<$T, $S> {\n              $L$L: StreamingBlobPayloadInputTypes;\n            }\n            \"\"\",\n            typeName,\n            containerSymbol,\n            memberName,\n            memberName,\n            optionalSuffix\n        );\n    }\n\n    /**\n     * Generate the type of the command output of the client sdk given the streaming blob\n     * member of the shape. The type marks the streaming blob member to contain the utility methods to transform the\n     * stream to string, buffer or WHATWG stream API.\n     */\n    static void writeClientCommandStreamingOutputType(\n        TypeScriptWriter writer,\n        Symbol containerSymbol,\n        String typeName,\n        MemberShape streamingMember,\n        String commandName\n    ) {\n        String memberName = streamingMember.getMemberName();\n        String optionalSuffix = streamingMember.isRequired() ? \"\" : \"?\";\n        writer.addTypeImport(\"MetadataBearer\", \"__MetadataBearer\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addTypeImport(\"StreamingBlobPayloadOutputTypes\", null, TypeScriptDependency.SMITHY_TYPES);\n\n        writer.writeDocs(\"@public\\n\\nThe output of {@link \" + commandName + \"}.\");\n        writer.write(\n            \"\"\"\n            export interface $L extends Omit<$T, $S>, __MetadataBearer {\n              $L$L: StreamingBlobPayloadOutputTypes;\n            }\n            \"\"\",\n            typeName,\n            containerSymbol,\n            memberName,\n            memberName,\n            optionalSuffix\n        );\n    }\n\n    static List<MemberShape> getBlobPayloadMembers(Model model, StructureShape shape) {\n        return shape\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(memberShape -> {\n                Shape target = model.expectShape(memberShape.getTarget());\n                return (target.isBlobShape() &&\n                    memberShape.hasTrait(HttpPayloadTrait.class)\n                    &&\n                    !target.hasTrait(StreamingTrait.class));\n            })\n            .collect(Collectors.toList());\n    }\n\n    static void writeClientCommandBlobPayloadInputType(\n        TypeScriptWriter writer,\n        Symbol containerSymbol,\n        String typeName,\n        MemberShape payloadMember,\n        String commandName\n    ) {\n        String memberName = payloadMember.getMemberName();\n        String optionalSuffix = payloadMember.isRequired() ? \"\" : \"?\";\n\n        writer.addTypeImport(\"BlobPayloadInputTypes\", null, TypeScriptDependency.SMITHY_TYPES);\n\n        writer.writeDocs(\"@public\");\n        writer.write(\n            \"\"\"\n            export type $LType = Omit<$T, $S> & {\n              $L: BlobPayloadInputTypes;\n            };\n            \"\"\",\n            typeName,\n            containerSymbol,\n            memberName,\n            memberName + optionalSuffix\n        );\n\n        writer.writeDocs(\"@public\\n\\nThe input for {@link \" + commandName + \"}.\");\n        writer.write(\"export interface $1L extends $1LType {}\", typeName);\n    }\n\n    static void writeClientCommandBlobPayloadOutputType(\n        TypeScriptWriter writer,\n        Symbol containerSymbol,\n        String typeName,\n        MemberShape payloadMember,\n        String commandName\n    ) {\n        String memberName = payloadMember.getMemberName();\n        String optionalSuffix = payloadMember.isRequired() ? \"\" : \"?\";\n\n        writer.addImportSubmodule(\n            \"Uint8ArrayBlobAdapter\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.SERDE\n        );\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n\n        writer.writeDocs(\"@public\");\n        writer.write(\n            \"\"\"\n            export type $LType = Omit<$T, $S> & {\n              $L: Uint8ArrayBlobAdapter;\n            };\n            \"\"\",\n            typeName,\n            containerSymbol,\n            memberName,\n            memberName + optionalSuffix\n        );\n\n        writer.writeDocs(\"@public\\n\\nThe output of {@link \" + commandName + \"}.\");\n        writer.write(\"export interface $1L extends $1LType, __MetadataBearer {}\", typeName);\n    }\n\n    /**\n     * Returns the list of function parameter key-value pairs to be written for\n     * provided parameters map.\n     *\n     * @param paramsMap Map of parameters to generate a parameters string for.\n     * @return The list of parameters to be written.\n     */\n    static List<String> getFunctionParametersList(Map<String, Object> paramsMap) {\n        List<String> functionParametersList = new ArrayList<String>();\n        List<Map.Entry<String, Object>> sortedParamsMap = paramsMap\n            .entrySet()\n            .stream()\n            .sorted(Map.Entry.comparingByKey())\n            .toList();\n\n        if (!sortedParamsMap.isEmpty()) {\n            for (Map.Entry<String, Object> param : sortedParamsMap) {\n                String key = param.getKey();\n                Object value = param.getValue();\n                if (value instanceof Symbol) {\n                    String symbolName = ((Symbol) value).getName();\n                    if (key.equals(symbolName)) {\n                        functionParametersList.add(String.format(\"$%s:T\", symbolName));\n                    } else {\n                        functionParametersList.add(String.format(\"%s: $%s:T\", key, key));\n                    }\n                } else if (value instanceof String) {\n                    functionParametersList.add(String.format(\"%s: '%s'\", key, value));\n                } else if (value instanceof Boolean) {\n                    functionParametersList.add(String.format(\"%s: %s\", key, value));\n                } else if (value instanceof List) {\n                    List<?> valueList = (List<?>) value;\n                    if (!valueList.isEmpty() && !(valueList.get(0) instanceof String)) {\n                        throw new CodegenException(\"Plugin function parameters list must be List<String>\");\n                    }\n                    List<String> valueStringList = valueList\n                        .stream()\n                        .map(item -> String.format(\"'%s'\", item))\n                        .collect(Collectors.toList());\n                    functionParametersList.add(\n                        String.format(\n                            \"'%s': [%s]\",\n                            key,\n                            valueStringList.stream().collect(Collectors.joining(\", \"))\n                        )\n                    );\n                } else if (value instanceof Map) {\n                    Map<?, ?> valueMap = (Map<?, ?>) value;\n                    if (\n                        !valueMap.isEmpty() &&\n                            valueMap\n                                .keySet()\n                                .stream()\n                                .anyMatch(k -> !(k instanceof String))\n                            &&\n                            valueMap\n                                .values()\n                                .stream()\n                                .anyMatch(v -> !(v instanceof String))\n                    ) {\n                        throw new CodegenException(\"Plugin function parameters map must be Map<String, String>\");\n                    }\n                    List<String> valueStringList = valueMap\n                        .entrySet()\n                        .stream()\n                        .map(entry -> String.format(\"'%s': '%s'\", entry.getKey(), entry.getValue()))\n                        .collect(Collectors.toList());\n                    functionParametersList.add(\n                        String.format(\"%s: {%s}\", key, valueStringList.stream().collect(Collectors.joining(\", \")))\n                    );\n                } else {\n                    // Future support for param type should be added in else if.\n                    throw new CodegenException(\"Plugin function parameters not supported for type \" + value.getClass());\n                }\n            }\n        }\n\n        return functionParametersList;\n    }\n\n    /**\n     * Ease the input streaming member restriction so that users don't need to construct a stream every time.\n     * This is used for inline type declarations (such as parameters) that need to take more permissive inputs\n     * Refer here for more rationales: https://github.com/aws/aws-sdk-js-v3/issues/843\n     */\n    static void writeInlineStreamingMemberType(\n        TypeScriptWriter writer,\n        Symbol containerSymbol,\n        MemberShape streamingMember\n    ) {\n        String memberName = streamingMember.getMemberName();\n        String optionalSuffix = streamingMember.isRequired() ? \"\" : \"?\";\n        writer.writeInline(\n            \"Omit<$1T, $2S> & { $2L$3L: $1T[$2S]|string|Uint8Array|Buffer }\",\n            containerSymbol,\n            memberName,\n            optionalSuffix\n        );\n    }\n\n    public static String getServiceName(TypeScriptSettings settings, Model model, SymbolProvider symbolProvider) {\n        ServiceShape service = settings.getService(model);\n        return symbolProvider.toSymbol(service).getName().replaceAll(\"(Client)$\", \"\");\n    }\n\n    /**\n     * The alternative should be used because the base exception may have been renamed\n     * due to a collision in the model.\n     *\n     * @deprecated use {@link #getSyntheticBaseExceptionName}.\n     */\n    @Deprecated\n    public static String getServiceExceptionName(String serviceName) {\n        return serviceName + \"ServiceException\";\n    }\n\n    /**\n     * If the service unfortunately defines a ServiceNameBaseException error,\n     * we still generate a synthetic base error for uniformity, but it must be renamed.\n     */\n    public static String getSyntheticBaseExceptionName(String serviceName, Model model) {\n        String serviceExceptionName = getServiceExceptionName(serviceName);\n        while (true) {\n            String finalServiceExceptionName = serviceExceptionName;\n            boolean namingCollision = model\n                .getStructureShapes()\n                .stream()\n                .anyMatch(structureShape -> structureShape.getId().getName().equals(finalServiceExceptionName));\n\n            if (namingCollision) {\n                serviceExceptionName = serviceExceptionName.replaceAll(\n                    \"ServiceException$\",\n                    \"SyntheticServiceException\"\n                );\n            } else {\n                break;\n            }\n        }\n        return serviceExceptionName;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.getBlobPayloadMembers;\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.getBlobStreamingMembers;\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.writeClientCommandBlobPayloadInputType;\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.writeClientCommandBlobPayloadOutputType;\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.writeClientCommandStreamingInputType;\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.writeClientCommandStreamingOutputType;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.OperationIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.DeprecatedTrait;\nimport software.amazon.smithy.model.traits.DocumentationTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.ExamplesTrait;\nimport software.amazon.smithy.model.traits.InternalTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.typescript.codegen.documentation.DocumentationExampleGenerator;\nimport software.amazon.smithy.typescript.codegen.documentation.StructureExampleGenerator;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.RuleSetParameterFinder;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist;\nimport software.amazon.smithy.typescript.codegen.sections.CommandBodyExtraCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.CommandConstructorCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.CommandPropertiesCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.PreCommandClassCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.SmithyContextCodeSection;\nimport software.amazon.smithy.typescript.codegen.util.CommandWriterConsumer;\nimport software.amazon.smithy.typescript.codegen.util.PropertyAccessor;\nimport software.amazon.smithy.typescript.codegen.validation.SensitiveDataFinder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates a client command using plugins.\n */\n@SmithyInternalApi\nfinal class CommandGenerator implements Runnable {\n\n    static final String COMMANDS_FOLDER = \"commands\";\n    static final String SCHEMAS_FOLDER = \"schemas\";\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptWriter writer;\n    private final Symbol symbol;\n    private final List<RuntimeClientPlugin> runtimePlugins;\n    private final OperationIndex operationIndex;\n    private final Symbol inputType;\n    private final Symbol outputType;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n    private final SensitiveDataFinder sensitiveDataFinder;\n    private final ServiceClosure closure;\n\n    CommandGenerator(\n        TypeScriptSettings settings,\n        Model model,\n        OperationShape operation,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        List<RuntimeClientPlugin> runtimePlugins,\n        ProtocolGenerator protocolGenerator,\n        ApplicationProtocol applicationProtocol\n    ) {\n        this.settings = settings;\n        this.model = model;\n        this.service = settings.getService(model);\n        this.operation = operation;\n        this.symbolProvider = symbolProvider;\n        this.writer = writer;\n        this.runtimePlugins = runtimePlugins\n            .stream()\n            .filter(plugin -> plugin.matchesOperation(model, service, operation))\n            .collect(Collectors.toList());\n        this.protocolGenerator = protocolGenerator;\n        this.applicationProtocol = applicationProtocol;\n        this.closure = ServiceClosure.of(model, service);\n        sensitiveDataFinder = new SensitiveDataFinder(model);\n\n        symbol = symbolProvider.toSymbol(operation);\n        operationIndex = OperationIndex.of(model);\n        inputType = symbol.expectProperty(\"inputType\", Symbol.class);\n        outputType = symbol.expectProperty(\"outputType\", Symbol.class);\n    }\n\n    @Override\n    public void run() {\n        addInputAndOutputTypes();\n        generateClientCommand();\n    }\n\n    private void generateClientCommand() {\n        Symbol serviceSymbol = symbolProvider.toSymbol(service);\n        String configType = ServiceBareBonesClientGenerator.getResolvedConfigTypeName(serviceSymbol);\n\n        // Add required imports.\n        Path servicePath = Paths.get(\".\", serviceSymbol.getNamespace());\n        writer.addRelativeTypeImport(configType, null, servicePath);\n        writer.addRelativeTypeImport(\"ServiceInputTypes\", null, servicePath);\n        writer.addRelativeTypeImport(\"ServiceOutputTypes\", null, servicePath);\n        writer.addImportSubmodule(\"Command\", \"$Command\", TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n\n        String name = symbol.getName();\n\n        StringBuilder additionalDocs = new StringBuilder()\n            .append(\"\\n\")\n            .append(\n                getCommandExample(\n                    serviceSymbol\n                        .getName(),\n                    configType,\n                    name,\n                    inputType.getName(),\n                    outputType.getName()\n                )\n            )\n            .append(\"\\n\")\n            .append(getThrownExceptions())\n            .append(\"\\n\")\n            .append(getCuratedExamples(name));\n\n        boolean operationHasDocumentation = operation.hasTrait(DocumentationTrait.class);\n\n        if (operationHasDocumentation) {\n            writer.writeShapeDocs(operation, shapeDoc -> shapeDoc + additionalDocs);\n        } else {\n            boolean isPublic = !operation.hasTrait(InternalTrait.class);\n            boolean isDeprecated = operation.hasTrait(DeprecatedTrait.class);\n\n            String deprecatedTag = \"\";\n            if (isDeprecated) {\n                DeprecatedTrait deprecatedTrait = operation.expectTrait(DeprecatedTrait.class);\n                deprecatedTag = TypeScriptWriter.buildDeprecationAnnotation(deprecatedTrait) + \"\\n\";\n            }\n\n            writer.writeDocs(\n                (isPublic ? \"@public\\n\" : \"@internal\\n\") + deprecatedTag + additionalDocs\n            );\n        }\n\n        // Section of items like TypeScript @ts-ignore\n        writer.injectSection(\n            PreCommandClassCodeSection.builder()\n                .settings(settings)\n                .model(model)\n                .service(service)\n                .operation(operation)\n                .symbolProvider(symbolProvider)\n                .runtimeClientPlugins(runtimePlugins)\n                .protocolGenerator(protocolGenerator)\n                .applicationProtocol(applicationProtocol)\n                .build()\n        );\n        writer.openBlock(\"\"\"\n                         export class $L extends $$Command\n                           .classBuilder<\n                             $T,\n                             $T,\n                             $L,\n                             ServiceInputTypes,\n                             ServiceOutputTypes\n                           >()\"\"\", \"  .build() {\", name, inputType, outputType, configType, () -> { // class open bracket.\n            generateEndpointParameterInstructionProvider();\n            generateCommandMiddlewareResolver(configType);\n            writeSerde();\n        });\n        // Ctor section.\n        writer.injectSection(\n            CommandConstructorCodeSection.builder()\n                .settings(settings)\n                .model(model)\n                .service(service)\n                .operation(operation)\n                .symbolProvider(symbolProvider)\n                .runtimeClientPlugins(runtimePlugins)\n                .protocolGenerator(protocolGenerator)\n                .applicationProtocol(applicationProtocol)\n                .build()\n        );\n        // Section for adding custom command properties.\n        writer.injectSection(\n            CommandPropertiesCodeSection.builder()\n                .settings(settings)\n                .model(model)\n                .service(service)\n                .operation(operation)\n                .symbolProvider(symbolProvider)\n                .runtimeClientPlugins(runtimePlugins)\n                .protocolGenerator(protocolGenerator)\n                .applicationProtocol(applicationProtocol)\n                .build()\n        );\n        // Hook for adding more methods to the command.\n        writer.injectSection(\n            CommandBodyExtraCodeSection.builder()\n                .settings(settings)\n                .model(model)\n                .service(service)\n                .operation(operation)\n                .symbolProvider(symbolProvider)\n                .runtimeClientPlugins(runtimePlugins)\n                .protocolGenerator(protocolGenerator)\n                .applicationProtocol(applicationProtocol)\n                .build()\n        );\n\n        {\n            // This block places the most commonly sought type definitions\n            // closer to the command definition, for navigation assistance\n            // in IDEs.\n            Shape operationInputShape = model.expectShape(operation.getInputShape());\n            Symbol baseInput = symbolProvider.toSymbol(operationInputShape);\n\n            Shape operationOutputShape = model.expectShape(operation.getOutputShape());\n            Symbol baseOutput = symbolProvider.toSymbol(operationOutputShape);\n\n            if (!operationInputShape.getAllMembers().isEmpty()) {\n                writer.addRelativeTypeImport(baseInput.getName(), null, Path.of(baseInput.getNamespace()));\n            }\n            if (!operationOutputShape.getAllMembers().isEmpty()) {\n                writer.addRelativeTypeImport(baseOutput.getName(), null, Path.of(baseOutput.getNamespace()));\n            }\n\n            writer.indent();\n            writer.write(\"/** @internal type navigation helper, not in runtime. */\");\n            writer.openBlock(\"protected declare static __types: {\", \"};\", () -> {\n                String baseInputStr = operationInputShape.getAllMembers().isEmpty() ? \"{}\" : baseInput.getName();\n                String baseOutputStr = operationOutputShape.getAllMembers().isEmpty() ? \"{}\" : baseOutput.getName();\n                writer.write(\n                    \"\"\"\n                    api: {\n                      input: $L;\n                      output: $L;\n                    };\"\"\",\n                    baseInputStr,\n                    baseOutputStr\n                );\n                writer.write(\n                    \"\"\"\n                    sdk: {\n                      input: $T;\n                      output: $T;\n                    };\"\"\",\n                    inputType,\n                    outputType\n                );\n            });\n            writer.dedent();\n        }\n\n        writer.write(\"}\"); // class close bracket.\n    }\n\n    private String getCommandExample(\n        String serviceName,\n        String configName,\n        String commandName,\n        String commandInput,\n        String commandOutput\n    ) {\n        String packageName = settings.getPackageName();\n        String exampleDoc =\n            \"@example\\n\" +\n                \"Use a bare-bones client and the command you need to make an API call.\\n\" +\n                \"```javascript\\n\" +\n                String.format(\n                    \"import { %s, %s } from \\\"%s\\\"; // ES Modules import%n\",\n                    serviceName,\n                    commandName,\n                    packageName\n                )\n                +\n                String.format(\n                    \"// const { %s, %s } = require(\\\"%s\\\"); // CommonJS import%n\",\n                    serviceName,\n                    commandName,\n                    packageName\n                )\n                +\n                String.format(\"// import type { %sConfig } from \\\"%s\\\";%n\", serviceName, packageName) +\n                String.format(\"const config = {}; // type is %sConfig%n\", serviceName) +\n                String.format(\"const client = new %s(config);%n\", serviceName) +\n                String.format(\n                    \"const input = %s%n\",\n                    StructureExampleGenerator.generateStructuralHintDocumentation(\n                        model.getShape(operation.getInputShape()).get(),\n                        model,\n                        false,\n                        true\n                    )\n                )\n                +\n                String.format(\"const command = new %s(input);%n\", commandName) +\n                \"const response = await client.send(command);\" +\n                getStreamingBlobOutputAddendum() +\n                \"\\n\" +\n                String.format(\n                    \"%s%n\",\n                    StructureExampleGenerator.generateStructuralHintDocumentation(\n                        model.getShape(operation.getOutputShape()).get(),\n                        model,\n                        true,\n                        false\n                    )\n                )\n                +\n                \"\\n```\\n\" +\n                \"\\n\" +\n                String.format(\"@param %s - {@link %s}%n\", commandInput, commandInput) +\n                String.format(\"@returns {@link %s}%n\", commandOutput) +\n                String.format(\"@see {@link %s} for command's `input` shape.%n\", commandInput) +\n                String.format(\"@see {@link %s} for command's `response` shape.%n\", commandOutput) +\n                String.format(\"@see {@link %s | config} for %s's `config` shape.%n\", configName, serviceName);\n\n        return exampleDoc;\n    }\n\n    /**\n     * Handwritten examples from the operation ExamplesTrait.\n     */\n    private String getCuratedExamples(String commandName) {\n        String exampleDoc = \"\";\n        if (operation.getTrait(ExamplesTrait.class).isPresent()) {\n            List<ExamplesTrait.Example> examples = operation.getTrait(ExamplesTrait.class).get().getExamples();\n            StringBuilder buffer = new StringBuilder();\n\n            for (ExamplesTrait.Example example : examples) {\n                ObjectNode input = example.getInput();\n                Optional<ObjectNode> output = example.getOutput();\n                buffer\n                    .append(\"\\n\")\n                    .append(String.format(\"@example %s%n\", example.getTitle()))\n                    .append(\"```javascript\\n\")\n                    .append(String.format(\"// %s%n\", example.getDocumentation().orElse(\"\")))\n                    .append(\n                        \"\"\"\n                        const input = %s;\n                        const command = new %s(input);\n                        const response = await client.send(command);%s\n                        /* response is\n                        %s\n                        */\n                        \"\"\".formatted(\n                            DocumentationExampleGenerator.inputToJavaScriptObject(input),\n                            commandName,\n                            getStreamingBlobOutputAddendum(),\n                            DocumentationExampleGenerator.outputToJavaScriptObject(output.orElse(null))\n                        )\n                    )\n                    .append(\"```\")\n                    .append(\"\\n\");\n            }\n\n            exampleDoc += buffer.toString();\n        }\n        return exampleDoc;\n    }\n\n    /**\n     * @param operation - to query.\n     * @return member name of the streaming blob http payload, or empty string.\n     */\n    private String getStreamingBlobOutputMember(OperationShape operation) {\n        return (model.expectShape(operation.getOutputShape())).getAllMembers()\n            .values()\n            .stream()\n            .filter(memberShape -> {\n                Shape target = model.expectShape(memberShape.getTarget());\n                return (target.isBlobShape() &&\n                    (target.hasTrait(StreamingTrait.class) || memberShape.hasTrait(StreamingTrait.class)));\n            })\n            .map(MemberShape::getMemberName)\n            .findFirst()\n            .orElse(\"\");\n    }\n\n    /**\n     * @return e.g. appendable \"const bytes = await response.Body.transformToByteArray();\".\n     */\n    private String getStreamingBlobOutputAddendum() {\n        String streamingBlobAddendum = \"\";\n        String streamingBlobMemberName = getStreamingBlobOutputMember(operation);\n        if (!streamingBlobMemberName.isEmpty()) {\n            String propAccess = PropertyAccessor.getFrom(\"response\", streamingBlobMemberName);\n            streamingBlobAddendum = \"\"\"\n                                    \\n// consume or destroy the stream to free the socket.\n                                    const bytes = await %s.transformToByteArray();\n                                    // const str = await %s.transformToString();\n                                    // %s.destroy(); // only applicable to Node.js Readable streams.\n                                    \"\"\".formatted(propAccess, propAccess, propAccess);\n        }\n        return streamingBlobAddendum;\n    }\n\n    private String getThrownExceptions() {\n        List<ShapeId> errors = operation.getErrors();\n        StringBuilder buffer = new StringBuilder();\n        for (ShapeId error : errors) {\n            Shape errorShape = model.getShape(error).get();\n            Optional<DocumentationTrait> doc = errorShape.getTrait(DocumentationTrait.class);\n            ErrorTrait errorTrait = errorShape.getTrait(ErrorTrait.class).get();\n\n            if (doc.isPresent()) {\n                buffer.append(\n                    String.format(\n                        \"@throws {@link %s} (%s fault)%n %s\",\n                        error.getName(),\n                        errorTrait.getValue(),\n                        doc.get().getValue()\n                    )\n                );\n            } else {\n                buffer.append(String.format(\"@throws {@link %s} (%s fault)\", error.getName(), errorTrait.getValue()));\n            }\n            buffer.append(\"\\n\\n\");\n        }\n\n        String name = CodegenUtils.getServiceName(settings, model, symbolProvider);\n        buffer.append(String.format(\"@throws {@link %s}%n\", CodegenUtils.getSyntheticBaseExceptionName(name, model)));\n        buffer.append(String.format(\"<p>Base exception class for all service exceptions from %s service.</p>%n\", name));\n\n        return buffer.toString();\n    }\n\n    private void generateEndpointParameterInstructionProvider() {\n        writer.addImport(\n            \"commonParams\",\n            null,\n            Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"endpoint/EndpointParameters\").toString()\n        );\n\n        RuleSetParameterFinder parameterFinder = new RuleSetParameterFinder(service);\n        Map<String, String> staticContextParamValues = parameterFinder.getStaticContextParamValues(operation);\n        Map<String, String> contextParams = parameterFinder.getContextParams(\n            model.getShape(operation.getInputShape()).get()\n        );\n        Map<String, String> operationContextParamValues = parameterFinder.getOperationContextParamValues(operation);\n\n        if (staticContextParamValues.isEmpty() && contextParams.isEmpty() && operationContextParamValues.isEmpty()) {\n            writer.write(\".ep(commonParams)\");\n            return;\n        }\n\n        writer.write(\".ep({\").indent();\n        {\n            writer.write(\"...commonParams,\");\n            Set<String> paramNames = new HashSet<>();\n\n            staticContextParamValues.forEach((name, value) -> {\n                paramNames.add(name);\n                writer.write(\"$L: { type: \\\"staticContextParams\\\", value: $L },\", name, value);\n            });\n\n            contextParams.forEach((name, memberName) -> {\n                if (!paramNames.contains(name)) {\n                    writer.write(\"$L: { type: \\\"contextParams\\\", name: \\\"$L\\\" },\", name, memberName);\n                }\n                paramNames.add(name);\n            });\n\n            operationContextParamValues.forEach((name, jmesPathForInputInJs) -> {\n                writer.write(\n                    \"\"\"\n                    $L: { type: \"operationContextParams\", get: (input?: any) => $L },\n                    \"\"\",\n                    name,\n                    jmesPathForInputInJs\n                );\n            });\n        }\n        writer.dedent().write(\"})\");\n    }\n\n    private void generateCommandMiddlewareResolver(String configType) {\n        Symbol serde = Symbol.builder()\n            .namespace(TypeScriptDependency.SMITHY_CORE.packageName + SmithyCoreSubmodules.SERDE, \"/\")\n            .name(\"getSerdePlugin\")\n            .addDependency(TypeScriptDependency.SMITHY_CORE)\n            .build();\n        boolean schemaMode = SchemaGenerationAllowlist.allows(service.getId(), settings);\n\n        Function<StructureShape, String> getFilterFunctionName = input -> {\n            if (sensitiveDataFinder.findsSensitiveDataIn(input) && !schemaMode) {\n                Symbol inputSymbol = symbolProvider.toSymbol(input);\n                String filterFunctionName = inputSymbol.getName() + \"FilterSensitiveLog\";\n                writer.addRelativeImport(filterFunctionName, null, Paths.get(\".\", inputSymbol.getNamespace()));\n                return filterFunctionName;\n            }\n            return \"void 0\";\n        };\n        String inputFilterFn = operationIndex.getInput(operation).map(getFilterFunctionName).orElse(\"void 0\");\n\n        String outputFilterFn = operationIndex.getOutput(operation).map(getFilterFunctionName).orElse(\"void 0\");\n\n        writer\n            .pushState()\n            .putContext(\"client\", symbolProvider.toSymbol(service).getName())\n            .putContext(\"command\", symbolProvider.toSymbol(operation).getName())\n            .putContext(\"service\", service.toShapeId().getName())\n            .putContext(\"operation\", operation.toShapeId().getName())\n            .putContext(\"inputFilter\", inputFilterFn)\n            .putContext(\"outputFilter\", outputFilterFn)\n            .putContext(\"configType\", configType)\n            .putContext(\"optionsType\", applicationProtocol.getOptionsType())\n            .putContext(\"inputType\", inputType)\n            .putContext(\"outputType\", outputType);\n\n        writer.writeInline(\n            \"\"\"\n            .m(function (this: any, Command: any, cs: any, config: $configType:L, o: any) {\n              return [\"\"\"\n        );\n        {\n            boolean multiplePlugins =\n                !schemaMode ||\n                    runtimePlugins.stream()\n                        .map(RuntimeClientPlugin::getPluginFunction)\n                        .anyMatch(Optional::isPresent);\n\n            writer.addImportSubmodule(\n                \"getEndpointPlugin\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.ENDPOINTS\n            );\n\n            if (multiplePlugins) {\n                writer.write(\"\");\n                writer.indent();\n                // Add serialization and deserialization plugin.\n                if (!schemaMode) {\n                    writer.indent();\n                    writer.write(\"$T(config, this.serialize, this.deserialize),\", serde);\n                    writer.dedent();\n                }\n\n                writer\n                    .indent()\n                    .write(\n                        \"\"\"\n                        getEndpointPlugin(config, Command.getEndpointParameterInstructions()),\"\"\"\n                    );\n                // Add customizations.\n                addCommandSpecificPlugins();\n                writer.dedent();\n                writer.write(\"];\"); // end middleware list.\n                writer.dedent();\n            } else {\n                writer.writeInline(\n                    \"\"\"\n                    getEndpointPlugin(config, Command.getEndpointParameterInstructions())\"\"\"\n                );\n                writer.write(\"];\"); // end middleware list.\n            }\n        }\n        writer.write(\"})\"); // end middleware block.\n\n        String filters = schemaMode ? \"\" : \".f($inputFilter:L, $outputFilter:L)\";\n\n        // context, filters\n        writer\n            .writeInline(\n                \"\"\"\n                .s($service:S, $operation:S, {\"\"\"\n            )\n            .pushState(\n                SmithyContextCodeSection.builder()\n                    .settings(settings)\n                    .model(model)\n                    .service(service)\n                    .operation(operation)\n                    .symbolProvider(symbolProvider)\n                    .runtimeClientPlugins(runtimePlugins)\n                    .protocolGenerator(protocolGenerator)\n                    .applicationProtocol(applicationProtocol)\n                    .build()\n            )\n            .popState()\n            .write(\"})\")\n            .write(\n                \"\"\"\n                .n($client:S, $command:S)\"\"\"\n            );\n        if (!filters.isEmpty()) {\n            writer.write(filters);\n        }\n    }\n\n    private void addInputAndOutputTypes() {\n        writer.writeDocs(\"@public\");\n        writer.write(\"export type { __MetadataBearer };\");\n        writer.write(\"export { $$Command };\");\n\n        writeInputType(inputType.getName(), operationIndex.getInput(operation), symbol.getName());\n        writeOutputType(outputType.getName(), operationIndex.getOutput(operation), symbol.getName());\n        writer.write(\"\");\n    }\n\n    private void writeInputType(String typeName, Optional<StructureShape> inputShape, String commandName) {\n        if (inputShape.isPresent()) {\n            StructureShape input = inputShape.get();\n            List<MemberShape> blobStreamingMembers = getBlobStreamingMembers(model, input);\n            List<MemberShape> blobPayloadMembers = getBlobPayloadMembers(model, input);\n\n            if (!blobStreamingMembers.isEmpty()) {\n                writeClientCommandStreamingInputType(\n                    writer,\n                    symbolProvider.toSymbol(input),\n                    typeName,\n                    blobStreamingMembers.get(0),\n                    commandName\n                );\n            } else if (!blobPayloadMembers.isEmpty()) {\n                writeClientCommandBlobPayloadInputType(\n                    writer,\n                    symbolProvider.toSymbol(input),\n                    typeName,\n                    blobPayloadMembers.get(0),\n                    commandName\n                );\n            } else {\n                writer.writeDocs(\"@public\\n\\nThe input for {@link \" + commandName + \"}.\");\n                Symbol inputSymbol = symbolProvider.toSymbol(input);\n                writer.addRelativeTypeImport(inputSymbol.getName(), null, Path.of(inputSymbol.getNamespace()));\n                writer.write(\"export interface $L extends $L {}\", typeName, inputSymbol.getName());\n            }\n        } else {\n            // If the input is non-existent, then use an empty object.\n            writer.writeDocs(\"@public\\n\\nThe input for {@link \" + commandName + \"}.\");\n            writer.write(\"export interface $L {}\", typeName);\n        }\n    }\n\n    private void writeOutputType(String typeName, Optional<StructureShape> outputShape, String commandName) {\n        // Output types should always be MetadataBearers, possibly in addition\n        // to a defined output shape.\n        writer.addTypeImport(\"MetadataBearer\", \"__MetadataBearer\", TypeScriptDependency.SMITHY_TYPES);\n        if (outputShape.isPresent()) {\n            StructureShape output = outputShape.get();\n            List<MemberShape> blobStreamingMembers = getBlobStreamingMembers(model, output);\n            List<MemberShape> blobPayloadMembers = getBlobPayloadMembers(model, output);\n\n            if (!blobStreamingMembers.isEmpty()) {\n                writeClientCommandStreamingOutputType(\n                    writer,\n                    symbolProvider.toSymbol(output),\n                    typeName,\n                    blobStreamingMembers.get(0),\n                    commandName\n                );\n            } else if (!blobPayloadMembers.isEmpty()) {\n                writeClientCommandBlobPayloadOutputType(\n                    writer,\n                    symbolProvider.toSymbol(output),\n                    typeName,\n                    blobPayloadMembers.get(0),\n                    commandName\n                );\n            } else {\n                writer.writeDocs(\"@public\\n\\nThe output of {@link \" + commandName + \"}.\");\n                Symbol outputSymbol = symbolProvider.toSymbol(output);\n                writer.addRelativeTypeImport(outputSymbol.getName(), null, Path.of(outputSymbol.getNamespace()));\n                writer.write(\"export interface $L extends $L, __MetadataBearer {}\", typeName, outputSymbol.getName());\n            }\n        } else {\n            writer.writeDocs(\"@public\\n\\nThe output of {@link \" + commandName + \"}.\");\n            writer.write(\"export interface $L extends __MetadataBearer {}\", typeName);\n        }\n    }\n\n    private void addCommandSpecificPlugins() {\n        // Some plugins might only apply to specific commands. They are added to the\n        // command's middleware stack here. Plugins that apply to all commands are\n        // applied automatically when the Command's middleware stack is copied from\n        // the service's middleware stack.\n        for (RuntimeClientPlugin plugin : runtimePlugins) {\n            plugin\n                .getPluginFunction()\n                .ifPresent(pluginSymbol -> {\n                    // Construct additional parameters string\n                    Map<String, Object> paramsMap = plugin.getAdditionalPluginFunctionParameters(\n                        model,\n                        service,\n                        operation\n                    );\n\n                    // Construct writer context\n                    Map<String, Object> symbolMap = new HashMap<>();\n                    symbolMap.put(\"pluginFn\", pluginSymbol);\n                    for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {\n                        if (entry.getValue() instanceof Symbol) {\n                            symbolMap.put(entry.getKey(), entry.getValue());\n                        }\n                    }\n                    writer.pushState();\n                    writer.putContext(symbolMap);\n\n                    List<String> additionalParameters = CodegenUtils.getFunctionParametersList(paramsMap);\n                    Map<String, CommandWriterConsumer> clientAddParamsWriterConsumers =\n                        plugin.getOperationAddParamsWriterConsumers();\n                    boolean hasAddParams =\n                        !additionalParameters.isEmpty() || !clientAddParamsWriterConsumers.isEmpty();\n\n                    if (!hasAddParams) {\n                        writer.write(\"$pluginFn:T(config),\");\n                    } else {\n                        writer.openBlock(\"$pluginFn:T(config, {\", \"}),\", () -> {\n                            if (!additionalParameters.isEmpty()) {\n                                // caution: using String.join instead of templating\n                                // because additionalParameters may contain Smithy syntax.\n                                writer.write(String.join(\",\\n\", additionalParameters) + \",\");\n                            }\n                            clientAddParamsWriterConsumers.forEach((key, consumer) -> {\n                                writer.write(\n                                    \"$L: $C,\",\n                                    key,\n                                    (Consumer<TypeScriptWriter>) (w -> {\n                                        consumer.accept(\n                                            w,\n                                            CommandConstructorCodeSection.builder()\n                                                .settings(settings)\n                                                .model(model)\n                                                .service(service)\n                                                .symbolProvider(symbolProvider)\n                                                .runtimeClientPlugins(runtimePlugins)\n                                                .applicationProtocol(applicationProtocol)\n                                                .build()\n                                        );\n                                    })\n                                );\n                            });\n                        });\n                    }\n                    writer.popState();\n                });\n        }\n    }\n\n    private void writeSchemaSerde() {\n        String operationSchema = closure.getShapeSchemaVariableName(operation, null);\n        writer.addRelativeImport(\n            operationSchema,\n            null,\n            Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, SCHEMAS_FOLDER, \"schemas_0\")\n        );\n        writer.write(\n            \"\"\"\n            .sc($L)\"\"\",\n            operationSchema\n        );\n    }\n\n    private void writeSerde() {\n        if (SchemaGenerationAllowlist.allows(service.getId(), settings)) {\n            writeSchemaSerde();\n        } else {\n            writer.write(\".ser($L)\", getSerdeDispatcher(true)).write(\".de($L)\", getSerdeDispatcher(false));\n        }\n    }\n\n    private String getSerdeDispatcher(boolean isInput) {\n        if (protocolGenerator == null) {\n            return \"() => { throw new Error(\\\"No supported protocol was found\\\"); }\";\n        } else {\n            String serdeFunctionName = isInput\n                ? ProtocolGenerator.getSerFunctionShortName(symbol)\n                : ProtocolGenerator.getDeserFunctionShortName(symbol);\n            writer.addRelativeImport(\n                serdeFunctionName,\n                null,\n                Paths.get(\n                    \".\",\n                    CodegenUtils.SOURCE_FOLDER,\n                    ProtocolGenerator.PROTOCOLS_FOLDER,\n                    ProtocolGenerator.getSanitizedName(protocolGenerator.getName())\n                )\n            );\n            return serdeFunctionName;\n        }\n    }\n\n    static void writeIndex(\n        Model model,\n        ServiceShape service,\n        SymbolProvider symbolProvider,\n        FileManifest fileManifest\n    ) {\n        TypeScriptWriter writer = new TypeScriptWriter(\"\");\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            Comparator.comparing(opShape -> symbolProvider.toSymbol(opShape).getName())\n        );\n        containedOperations.addAll(\n            topDownIndex.getContainedOperations(service)\n        );\n\n        if (containedOperations.isEmpty()) {\n            writer.write(\"export {};\");\n        } else {\n            for (OperationShape operation : containedOperations) {\n                writer.write(\"export * from \\\"./$L\\\";\", symbolProvider.toSymbol(operation).getName());\n            }\n        }\n\n        fileManifest.writeFile(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, CommandGenerator.COMMANDS_FOLDER, \"index.ts\").toString(),\n            writer.toString()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/Dependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport software.amazon.smithy.codegen.core.SymbolDependencyContainer;\n\npublic interface Dependency extends PackageContainer, SymbolDependencyContainer {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/DirectedTypeScriptCodegen.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.function.BiConsumer;\nimport java.util.function.Consumer;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.directed.CreateContextDirective;\nimport software.amazon.smithy.codegen.core.directed.CreateSymbolProviderDirective;\nimport software.amazon.smithy.codegen.core.directed.CustomizeDirective;\nimport software.amazon.smithy.codegen.core.directed.DirectedCodegen;\nimport software.amazon.smithy.codegen.core.directed.GenerateEnumDirective;\nimport software.amazon.smithy.codegen.core.directed.GenerateErrorDirective;\nimport software.amazon.smithy.codegen.core.directed.GenerateIntEnumDirective;\nimport software.amazon.smithy.codegen.core.directed.GenerateServiceDirective;\nimport software.amazon.smithy.codegen.core.directed.GenerateStructureDirective;\nimport software.amazon.smithy.codegen.core.directed.GenerateUnionDirective;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.OperationIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.PaginatedTrait;\nimport software.amazon.smithy.model.validation.ValidationEvent;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthSchemeProviderGenerator;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.EndpointsV2Generator;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerator;\nimport software.amazon.smithy.typescript.codegen.validation.LongValidator;\nimport software.amazon.smithy.typescript.codegen.validation.ReplaceLast;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.waiters.WaitableTrait;\nimport software.amazon.smithy.waiters.Waiter;\n\n@SmithyUnstableApi\nfinal class DirectedTypeScriptCodegen\n    implements DirectedCodegen<TypeScriptCodegenContext, TypeScriptSettings, TypeScriptIntegration> {\n    static {\n        // too many redundant logs like dozens of lines of\n        // \"Reserved word: Error is a reserved word for a name. Converting to _Error\"\n        Logger.getLogger(\"software.amazon.smithy.codegen.core.ReservedWordSymbolProvider\").setLevel(Level.SEVERE);\n\n        // TypeScriptIntegration::matchesSettings causes too many logs from toposort.\n        Logger.getLogger(\"software.amazon.smithy.codegen.core.IntegrationTopologicalSort\").setLevel(Level.SEVERE);\n    }\n\n    private static final Logger LOGGER = Logger.getLogger(DirectedTypeScriptCodegen.class.getName());\n\n    /**\n     * A mapping of static resource files to copy over to a new filename.\n     */\n    private static final Map<String, String> STATIC_FILE_COPIES = MapUtils.of(\n        \"tsconfig.json\",\n        \"tsconfig.json\",\n        \"tsconfig.cjs.json\",\n        \"tsconfig.cjs.json\",\n        \"tsconfig.es.json\",\n        \"tsconfig.es.json\",\n        \"tsconfig.types.json\",\n        \"tsconfig.types.json\"\n    );\n    private static final ShapeId VALIDATION_EXCEPTION_SHAPE = ShapeId.fromParts(\n        \"smithy.framework\",\n        \"ValidationException\"\n    );\n\n    @Override\n    public SymbolProvider createSymbolProvider(CreateSymbolProviderDirective<TypeScriptSettings> directive) {\n        return directive.settings().getArtifactType().createSymbolProvider(directive.model(), directive.settings());\n    }\n\n    @Override\n    public TypeScriptCodegenContext createContext(\n        CreateContextDirective<TypeScriptSettings, TypeScriptIntegration> directive\n    ) {\n        List<RuntimeClientPlugin> runtimePlugins = new ArrayList<>();\n        directive\n            .integrations()\n            .forEach(integration -> {\n                LOGGER.fine(() -> \"Adding TypeScriptIntegration: \" + integration.getClass().getName());\n                integration\n                    .getClientPlugins()\n                    .forEach(runtimePlugin -> {\n                        if (\n                            runtimePlugin.matchesSettings(\n                                directive.model(),\n                                directive.service(),\n                                directive.settings()\n                            )\n                        ) {\n                            LOGGER.fine(() -> \"Adding TypeScript runtime plugin: \" + runtimePlugin);\n                            runtimePlugins.add(runtimePlugin);\n                        } else {\n                            LOGGER.fine(\n                                () -> \"Skipping TypeScript runtime plugin based on settings: \"\n                                    + runtimePlugin\n                            );\n                        }\n                    });\n            });\n\n        directive\n            .integrations()\n            .forEach(integration -> {\n                LOGGER.fine(() -> \"Mutating plugins from TypeScriptIntegration: \" + integration.name());\n                integration.mutateClientPlugins(runtimePlugins);\n            });\n\n        ProtocolGenerator protocolGenerator = resolveProtocolGenerator(\n            directive.integrations(),\n            directive.model(),\n            directive.service(),\n            directive.settings()\n        );\n\n        ApplicationProtocol applicationProtocol = protocolGenerator == null\n            ? ApplicationProtocol.createDefaultHttpApplicationProtocol()\n            : protocolGenerator.getApplicationProtocol();\n\n        if (null != protocolGenerator) {\n            directive.settings().setProtocol(protocolGenerator.getProtocol());\n        }\n\n        return TypeScriptCodegenContext.builder()\n            .model(directive.model())\n            .settings(directive.settings())\n            .symbolProvider(directive.symbolProvider())\n            .fileManifest(directive.fileManifest())\n            .integrations(directive.integrations())\n            .runtimePlugins(runtimePlugins)\n            .protocolGenerator(protocolGenerator)\n            .applicationProtocol(applicationProtocol)\n            .writerDelegator(new TypeScriptDelegator(directive.fileManifest(), directive.symbolProvider()))\n            .build();\n    }\n\n    private ProtocolGenerator resolveProtocolGenerator(\n        Collection<TypeScriptIntegration> integrations,\n        Model model,\n        ServiceShape service,\n        TypeScriptSettings settings\n    ) {\n        // Collect all the supported protocol generators.\n        // Preserve insertion order as default priority order.\n        Map<ShapeId, ProtocolGenerator> generators = new LinkedHashMap<>();\n\n        for (TypeScriptIntegration integration : integrations) {\n            for (ProtocolGenerator generator : integration.getProtocolGenerators()) {\n                // allow overrides of the same protocol ShapeId to change the order.\n                generators.remove(generator.getProtocol());\n                generators.put(generator.getProtocol(), generator);\n            }\n        }\n\n        ShapeId protocolName;\n        try {\n            protocolName = settings.resolveServiceProtocol(model, service, generators.keySet());\n        } catch (UnresolvableProtocolException e) {\n            LOGGER.warning(\"Unable to find a protocol generator for \" + service.getId() + \": \" + e.getMessage());\n            protocolName = null;\n        }\n\n        return protocolName != null ? generators.get(protocolName) : null;\n    }\n\n    @Override\n    public void generateService(GenerateServiceDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        TypeScriptSettings settings = directive.settings();\n        Model model = directive.model();\n        ServiceShape service = directive.shape();\n        TypeScriptDelegator delegator = directive.context().writerDelegator();\n\n        if (settings.generateServerSdk()) {\n            checkValidationSettings(settings, model, service);\n\n            LongValidator validator = new LongValidator(settings);\n            List<ValidationEvent> events = validator.validate(model);\n            System.err.println(\n                \"Model contained SSDK-specific validation events: \\n\" +\n                    events.stream().map(ValidationEvent::toString).sorted().collect(Collectors.joining(\"\\n\"))\n            );\n        }\n\n        if (settings.generateClient()) {\n            generateClient(directive);\n        }\n        if (settings.generateClient() || settings.generateServerSdk()) {\n            generateCommands(directive);\n            generateEndpointV2(directive);\n        }\n\n        if (settings.generateServerSdk()) {\n            generateServiceInterface(directive);\n        }\n\n        ProtocolGenerator protocolGenerator = directive.context().protocolGenerator();\n        SymbolProvider symbolProvider = directive.symbolProvider();\n        if (protocolGenerator != null) {\n            if (SchemaGenerationAllowlist.allows(service.getId(), settings)) {\n                return;\n            }\n            LOGGER.info(\"Generating serde for protocol \" + protocolGenerator.getName() + \" on \" + service.getId());\n            String fileName = Paths.get(\n                CodegenUtils.SOURCE_FOLDER,\n                ProtocolGenerator.PROTOCOLS_FOLDER,\n                ProtocolGenerator.getSanitizedName(protocolGenerator.getName()) + \".ts\"\n            ).toString();\n            delegator.useFileWriter(fileName, writer -> {\n                ProtocolGenerator.GenerationContext context = new ProtocolGenerator.GenerationContext();\n                context.setProtocolName(protocolGenerator.getName());\n                context.setModel(model);\n                context.setService(service);\n                context.setSettings(settings);\n                context.setSymbolProvider(symbolProvider);\n                context.setWriter(writer);\n                if (context.getSettings().generateClient()) {\n                    protocolGenerator.generateRequestSerializers(context);\n                    protocolGenerator.generateResponseDeserializers(context);\n                }\n                if (context.getSettings().generateServerSdk()) {\n                    protocolGenerator.generateRequestDeserializers(context);\n                    protocolGenerator.generateResponseSerializers(context);\n                    protocolGenerator.generateFrameworkErrorSerializer(context);\n                    delegator.useShapeWriter(service, w -> {\n                        protocolGenerator.generateServiceHandlerFactory(context.withWriter(w));\n                    });\n                    for (OperationShape operation : TopDownIndex.of(model).getContainedOperations(service)) {\n                        delegator.useShapeWriter(operation, w -> {\n                            protocolGenerator.generateOperationHandlerFactory(context.withWriter(w), operation);\n                        });\n                    }\n                }\n                protocolGenerator.generateSharedComponents(context);\n            });\n        }\n\n        if (settings.generateServerSdk()) {\n            for (OperationShape operation : directive.operations()) {\n                delegator.useShapeWriter(operation, w -> {\n                    ServerGenerator.generateOperationHandler(symbolProvider, service, operation, w);\n                });\n            }\n        }\n    }\n\n    @Override\n    public void generateStructure(GenerateStructureDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        directive\n            .context()\n            .writerDelegator()\n            .useShapeWriter(directive.shape(), writer -> {\n                StructureGenerator generator = new StructureGenerator(\n                    directive.model(),\n                    directive.settings(),\n                    directive.symbolProvider(),\n                    writer,\n                    directive.shape(),\n                    directive.settings().generateServerSdk(),\n                    directive.settings().getRequiredMemberMode(),\n                    SchemaGenerationAllowlist.allows(directive.settings().getService(), directive.settings())\n                );\n                generator.run();\n            });\n    }\n\n    @Override\n    public void generateError(GenerateErrorDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        directive\n            .context()\n            .writerDelegator()\n            .useShapeWriter(directive.shape(), writer -> {\n                StructureGenerator generator = new StructureGenerator(\n                    directive.model(),\n                    directive.settings(),\n                    directive.symbolProvider(),\n                    writer,\n                    directive.shape(),\n                    directive.settings().generateServerSdk(),\n                    directive.settings().getRequiredMemberMode(),\n                    SchemaGenerationAllowlist.allows(directive.settings().getService(), directive.settings())\n                );\n                generator.run();\n            });\n    }\n\n    @Override\n    public void generateUnion(GenerateUnionDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        directive\n            .context()\n            .writerDelegator()\n            .useShapeWriter(directive.shape(), writer -> {\n                UnionGenerator generator = new UnionGenerator(\n                    directive.model(),\n                    directive.settings(),\n                    directive.symbolProvider(),\n                    writer,\n                    directive.shape(),\n                    directive.settings().generateServerSdk(),\n                    SchemaGenerationAllowlist.allows(directive.settings().getService(), directive.settings())\n                );\n                generator.run();\n            });\n    }\n\n    @Override\n    public void generateEnumShape(GenerateEnumDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        directive\n            .context()\n            .writerDelegator()\n            .useShapeWriter(directive.shape(), writer -> {\n                EnumGenerator generator = new EnumGenerator(\n                    directive.shape().asStringShape().get(),\n                    directive.symbolProvider().toSymbol(directive.shape()),\n                    writer\n                );\n                generator.run();\n            });\n    }\n\n    @Override\n    public void generateIntEnumShape(GenerateIntEnumDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        directive\n            .context()\n            .writerDelegator()\n            .useShapeWriter(directive.shape(), writer -> {\n                IntEnumGenerator generator = new IntEnumGenerator(\n                    directive.shape().asIntEnumShape().get(),\n                    directive.symbolProvider().toSymbol(directive.shape()),\n                    writer\n                );\n                generator.run();\n            });\n    }\n\n    @Override\n    public void customizeBeforeIntegrations(\n        CustomizeDirective<TypeScriptCodegenContext, TypeScriptSettings> directive\n    ) {\n        // Write shared / static content.\n        STATIC_FILE_COPIES.forEach((from, to) -> {\n            LOGGER.fine(() -> \"Writing contents of `\" + from + \"` to `\" + to + \"`\");\n            directive.fileManifest().writeFile(from, getClass(), to);\n        });\n\n        TypeScriptWriter modelIndexer = SymbolVisitor.modelIndexer(\n            directive.connectedShapes().values(),\n            directive.symbolProvider()\n        );\n\n        // Generate the client Node and Browser configuration files. These\n        // files are switched between in package.json based on the targeted\n        // environment.\n        if (directive.settings().generateClient()) {\n            // For now these are only generated for clients.\n            // TODO: generate ssdk config\n            RuntimeConfigGenerator configGenerator = new RuntimeConfigGenerator(\n                directive.settings(),\n                directive.model(),\n                directive.symbolProvider(),\n                directive.context().writerDelegator(),\n                directive.context().integrations(),\n                directive.context().applicationProtocol()\n            );\n            for (LanguageTarget target : LanguageTarget.values()) {\n                LOGGER.fine(\"Generating \" + target + \" runtime configuration\");\n                configGenerator.generate(target);\n            }\n            new ExtensionConfigurationGenerator(\n                directive.model(),\n                directive.settings(),\n                directive.service(),\n                directive.symbolProvider(),\n                directive.context().writerDelegator(),\n                directive.context().integrations()\n            ).generate();\n            new RuntimeExtensionsGenerator(\n                directive.model(),\n                directive.settings(),\n                directive.service(),\n                directive.symbolProvider(),\n                directive.context().writerDelegator(),\n                directive.context().integrations()\n            ).generate();\n        }\n\n        // Generate index for client.\n        BiConsumer<String, Consumer<TypeScriptWriter>> writerFactory = directive\n            .context()\n            .writerDelegator()::useFileWriter;\n\n        writerFactory.accept(Paths.get(CodegenUtils.SOURCE_FOLDER, \"index.ts\").toString(), writer -> {\n            IndexGenerator.writeIndex(\n                directive.settings(),\n                directive.model(),\n                directive.symbolProvider(),\n                directive.context().protocolGenerator(),\n                writer,\n                modelIndexer\n            );\n        });\n\n        if (directive.settings().generateClient() && directive.settings().generateIndexTests()) {\n            writerFactory.accept(Paths.get(CodegenUtils.TEST_FOLDER, \"index-types.ts\").toString(), writer -> {\n                new PackageApiValidationGenerator(\n                    writer,\n                    directive.settings(),\n                    directive.model(),\n                    directive.symbolProvider()\n                ).writeTypeIndexTest();\n            });\n            writerFactory.accept(Paths.get(CodegenUtils.TEST_FOLDER, \"index-objects.spec.mjs\").toString(), writer -> {\n                new PackageApiValidationGenerator(\n                    writer,\n                    directive.settings(),\n                    directive.model(),\n                    directive.symbolProvider()\n                ).writeRuntimeIndexTest();\n            });\n        }\n\n        // snapshot tests require schema mode and client codegen.\n        if (\n            directive.settings().generateClient()\n                && directive.settings().generateSnapshotTests()\n                && SchemaGenerationAllowlist.allows(\n                    directive.settings().getService(),\n                    directive.settings()\n                )\n        ) {\n            writerFactory.accept(Paths.get(CodegenUtils.TEST_FOLDER, \"snapshots.integ.spec.ts\").toString(), writer -> {\n                new PackageApiValidationGenerator(\n                    writer,\n                    directive.settings(),\n                    directive.model(),\n                    directive.symbolProvider()\n                ).writeSnapshotTest();\n            });\n        }\n\n        if (directive.settings().generateServerSdk()) {\n            // Generate index for server\n            IndexGenerator.writeServerIndex(\n                directive.settings(),\n                directive.model(),\n                directive.symbolProvider(),\n                directive.fileManifest()\n            );\n        }\n\n        // Generate protocol tests IFF found in the model.\n        ProtocolGenerator protocolGenerator = directive.context().protocolGenerator();\n        if (protocolGenerator != null) {\n            ProtocolGenerator.GenerationContext context = new ProtocolGenerator.GenerationContext();\n            context.setProtocolName(protocolGenerator.getName());\n            context.setModel(directive.model());\n            context.setService(directive.service());\n            context.setSettings(directive.settings());\n            context.setSymbolProvider(directive.symbolProvider());\n            context.setWriterDelegator(directive.context().writerDelegator());\n            protocolGenerator.generateProtocolTests(context);\n        }\n    }\n\n    @Override\n    public void customizeAfterIntegrations(CustomizeDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        LOGGER.fine(\"Generating package.json files\");\n        PackageJsonGenerator.writePackageJson(\n            directive.settings(),\n            directive.fileManifest(),\n            SymbolDependency.gatherDependencies(directive.context().writerDelegator().getDependencies().stream())\n        );\n    }\n\n    private void checkValidationSettings(TypeScriptSettings settings, Model model, ServiceShape service) {\n        if (settings.isDisableDefaultValidation()) {\n            return;\n        }\n\n        final OperationIndex operationIndex = OperationIndex.of(model);\n\n        List<String> unvalidatedOperations = TopDownIndex.of(model)\n            .getContainedOperations(service)\n            .stream()\n            .filter(\n                o -> operationIndex\n                    .getErrors(o, service)\n                    .stream()\n                    .noneMatch(e -> e.getId().equals(VALIDATION_EXCEPTION_SHAPE))\n            )\n            .map(s -> s.getId().toString())\n            .sorted()\n            .collect(Collectors.toList());\n\n        if (!unvalidatedOperations.isEmpty()) {\n            throw new CodegenException(\n                String.format(\n                    \"Every operation must have the %s error attached unless %s is set \" +\n                        \"to 'true' in the plugin settings. Operations without %s \" +\n                        \"errors attached: %s\",\n                    VALIDATION_EXCEPTION_SHAPE,\n                    TypeScriptSettings.DISABLE_DEFAULT_VALIDATION,\n                    VALIDATION_EXCEPTION_SHAPE,\n                    unvalidatedOperations\n                )\n            );\n        }\n    }\n\n    private void generateClient(GenerateServiceDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        TypeScriptDelegator delegator = directive.context().writerDelegator();\n        TypeScriptSettings settings = directive.settings();\n        ServiceShape service = directive.shape();\n        Model model = directive.model();\n        SymbolProvider symbolProvider = directive.symbolProvider();\n        FileManifest fileManifest = directive.fileManifest();\n        List<TypeScriptIntegration> integrations = directive.context().integrations();\n        List<RuntimeClientPlugin> runtimePlugins = directive.context().runtimePlugins();\n        ApplicationProtocol applicationProtocol = directive.context().applicationProtocol();\n\n        // Generate the bare-bones service client.\n        delegator.useShapeWriter(\n            service,\n            writer -> new ServiceBareBonesClientGenerator(\n                settings,\n                model,\n                symbolProvider,\n                writer,\n                integrations,\n                runtimePlugins,\n                applicationProtocol\n            ).run()\n        );\n\n        if (!directive.settings().useLegacyAuth()) {\n            new HttpAuthSchemeProviderGenerator(\n                delegator,\n                settings,\n                model,\n                symbolProvider,\n                directive.context().integrations()\n            ).run();\n        }\n\n        // Generate the aggregated service client.\n        Symbol serviceSymbol = symbolProvider.toSymbol(service);\n        String aggregatedClientName = ReplaceLast.in(serviceSymbol.getName(), \"Client\", \"\");\n        String filename = ReplaceLast.in(serviceSymbol.getDefinitionFile(), \"Client\", \"\");\n        delegator.useFileWriter(\n            filename,\n            writer -> new ServiceAggregatedClientGenerator(\n                settings,\n                model,\n                symbolProvider,\n                aggregatedClientName,\n                writer,\n                applicationProtocol\n            ).run()\n        );\n\n        // Generate each operation for the service.\n        Set<OperationShape> containedOperations = directive.operations();\n        for (OperationShape operation : containedOperations) {\n            if (operation.hasTrait(PaginatedTrait.ID)) {\n                String outputFilename = PaginationGenerator.getOutputFileLocation(operation);\n                delegator.useFileWriter(\n                    outputFilename,\n                    paginationWriter -> new PaginationGenerator(\n                        model,\n                        service,\n                        operation,\n                        symbolProvider,\n                        paginationWriter,\n                        aggregatedClientName\n                    ).run()\n                );\n            }\n            if (operation.hasTrait(WaitableTrait.ID)) {\n                WaitableTrait waitableTrait = operation.expectTrait(WaitableTrait.class);\n                waitableTrait\n                    .getWaiters()\n                    .forEach((String waiterName, Waiter waiter) -> {\n                        String outputFilename = WaiterGenerator.getOutputFileLocation(waiterName);\n                        delegator.useFileWriter(\n                            outputFilename,\n                            waiterWriter -> new WaiterGenerator(\n                                waiterName,\n                                waiter,\n                                service,\n                                operation,\n                                waiterWriter,\n                                symbolProvider,\n                                settings,\n                                model\n                            ).run()\n                        );\n                    });\n            }\n        }\n\n        new SchemaGenerator(model, fileManifest, settings, symbolProvider).run();\n\n        if (containedOperations.stream().anyMatch(operation -> operation.hasTrait(PaginatedTrait.ID))) {\n            PaginationGenerator.writeIndex(model, service, fileManifest);\n            delegator.useFileWriter(\n                PaginationGenerator.PAGINATION_INTERFACE_FILE,\n                paginationWriter -> PaginationGenerator.generateServicePaginationInterfaces(\n                    aggregatedClientName,\n                    serviceSymbol,\n                    paginationWriter\n                )\n            );\n        }\n\n        if (containedOperations.stream().anyMatch(operation -> operation.hasTrait(WaitableTrait.ID))) {\n            WaiterGenerator.writeIndex(model, service, fileManifest);\n        }\n    }\n\n    private void generateCommands(GenerateServiceDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        TypeScriptDelegator delegator = directive.context().writerDelegator();\n        TypeScriptSettings settings = directive.settings();\n        ServiceShape service = directive.shape();\n        Model model = directive.model();\n        SymbolProvider symbolProvider = directive.symbolProvider();\n        FileManifest fileManifest = directive.fileManifest();\n        List<RuntimeClientPlugin> runtimePlugins = directive.context().runtimePlugins();\n        ProtocolGenerator protocolGenerator = directive.context().protocolGenerator();\n        ApplicationProtocol applicationProtocol = directive.context().applicationProtocol();\n\n        // Write operation index files\n        if (settings.generateClient()) {\n            CommandGenerator.writeIndex(model, service, symbolProvider, fileManifest);\n        }\n        if (settings.generateServerSdk()) {\n            ServerCommandGenerator.writeIndex(model, service, symbolProvider, fileManifest);\n        }\n\n        // Generate each operation for the service.\n        for (OperationShape operation : directive.operations()) {\n            // Right now this only generates stubs\n            if (settings.generateClient()) {\n                delegator.useShapeWriter(\n                    operation,\n                    commandWriter -> new CommandGenerator(\n                        settings,\n                        model,\n                        operation,\n                        symbolProvider,\n                        commandWriter,\n                        runtimePlugins,\n                        protocolGenerator,\n                        applicationProtocol\n                    ).run()\n                );\n            }\n\n            if (settings.generateServerSdk()) {\n                delegator.useShapeWriter(\n                    operation,\n                    commandWriter -> new ServerCommandGenerator(\n                        settings,\n                        model,\n                        operation,\n                        symbolProvider,\n                        commandWriter,\n                        protocolGenerator,\n                        applicationProtocol\n                    ).run()\n                );\n            }\n        }\n    }\n\n    private void generateEndpointV2(GenerateServiceDirective<TypeScriptCodegenContext, TypeScriptSettings> directive) {\n        new EndpointsV2Generator(directive.context().writerDelegator(), directive.settings(), directive.model()).run();\n    }\n\n    private void generateServiceInterface(\n        GenerateServiceDirective<TypeScriptCodegenContext, TypeScriptSettings> directive\n    ) {\n        ServiceShape service = directive.shape();\n        SymbolProvider symbolProvider = directive.symbolProvider();\n        Set<OperationShape> operations = directive.operations();\n\n        directive\n            .context()\n            .writerDelegator()\n            .useShapeWriter(service, writer -> {\n                ServerGenerator.generateOperationsType(symbolProvider, service, operations, writer);\n                ServerGenerator.generateServerInterfaces(symbolProvider, service, operations, writer);\n                ServerGenerator.generateServiceHandler(symbolProvider, service, operations, writer);\n            });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/EnumGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.Comparator;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.traits.EnumDefinition;\nimport software.amazon.smithy.model.traits.EnumTrait;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates an appropriate TypeScript type from a Smithy enum string.\n *\n * <p>For example, given the following Smithy model:\n *\n * <pre>{@code\n * @enum(\"YES\": {name: \"YEP\"}, \"NO\": {name: \"NOPE\"})\n * string TypedYesNo\n * }</pre>\n *\n * <p>We will generate the following:\n *\n * <pre>{@code\n * export const TypedYesNo = {\n *   YES: \"YEP\",\n *   NO: \"NOPE\",\n * } as const;\n * type TypedYesNo = typeof TypedYesNo[keyof typeof TypedYesNo];\n * }</pre>\n *\n * <p>Shapes that refer to this string as a member will use the following\n * generated code:\n *\n * <pre>{@code\n * import { TypedYesNo } from \"./TypedYesNo\";\n *\n * interface MyStructure {\n *   \"yesNo\": TypedYesNo;\n * }\n * }</pre>\n */\n@SmithyInternalApi\nfinal class EnumGenerator implements Runnable {\n\n    private final Symbol symbol;\n    private final StringShape shape;\n    private final TypeScriptWriter writer;\n    private final EnumTrait enumTrait;\n\n    EnumGenerator(StringShape shape, Symbol symbol, TypeScriptWriter writer) {\n        assert shape.getTrait(EnumTrait.class).isPresent();\n\n        this.shape = shape;\n        this.symbol = symbol;\n        this.writer = writer;\n        enumTrait = shape.getTrait(EnumTrait.class).get();\n    }\n\n    @Override\n    public void run() {\n        if (!enumTrait.hasNames()) {\n            generateUnnamedEnum();\n        } else {\n            generateNamedEnum();\n        }\n    }\n\n    // Unnamed enums generate a union of string literals.\n    private void generateUnnamedEnum() {\n        String variants = TypeScriptUtils.getEnumVariants(enumTrait.getEnumDefinitionValues());\n        writer.writeDocs(\"@public\").write(\"export type $L = $L\", symbol.getName(), variants);\n    }\n\n    // Named enums generate an actual enum type.\n    private void generateNamedEnum() {\n        writer\n            .writeDocs(\"@public\\n@enum\")\n            .openBlock(\"export const $L = {\", \"} as const;\", symbol.getName(), () -> {\n                // Sort the named values to ensure a stable order and sane diffs.\n                // TODO: Should we just sort these in the trait itself?\n                enumTrait\n                    .getValues()\n                    .stream()\n                    .sorted(Comparator.comparing(e -> e.getName().get()))\n                    .forEach(this::writeNamedEnumConstant);\n            });\n\n        String inline = \"\"\"\n                        export type %s = (typeof %s)[keyof typeof %s];\"\"\".formatted(\n            symbol.getName(),\n            symbol.getName(),\n            symbol.getName()\n        );\n        String breakline = inline.replace(\"= \", \"=\\n  \");\n\n        writer\n            .writeDocs(\"@public\")\n            .write(\n                inline.length() <= TypeScriptWriter.LINE_WIDTH ? inline : breakline\n            );\n    }\n\n    private void writeNamedEnumConstant(EnumDefinition body) {\n        assert body.getName().isPresent();\n\n        String name = body.getName().get();\n        body.getDocumentation().ifPresent(writer::writeDocs);\n        writer.write(\"$L: $S,\", TypeScriptUtils.sanitizePropertyName(name), body.getValue());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ExtensionConfigurationGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.typescript.codegen.validation.ReplaceLast;\n\npublic class ExtensionConfigurationGenerator {\n\n    private static final String CLIENT_CONFIGURATION_TEMPLATE = \"extensionConfiguration.template\";\n    private static final String FILENAME = \"extensionConfiguration.ts\";\n\n    private final Model model;\n    private final TypeScriptSettings settings;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptDelegator delegator;\n    private final List<TypeScriptIntegration> integrations;\n\n    public ExtensionConfigurationGenerator(\n        Model model,\n        TypeScriptSettings settings,\n        ServiceShape service,\n        SymbolProvider symbolProvider,\n        TypeScriptDelegator delegator,\n        List<TypeScriptIntegration> integrations\n    ) {\n        this.model = model;\n        this.settings = settings;\n        this.service = service;\n        this.symbolProvider = symbolProvider;\n        this.delegator = delegator;\n        this.integrations = integrations;\n    }\n\n    void generate() {\n        Map<String, Dependency> interfaces = new HashMap<>();\n        Map<String, String> submodules = new HashMap<>();\n\n        for (TypeScriptIntegration integration : integrations) {\n            integration\n                .getExtensionConfigurationInterfaces(model, settings)\n                .forEach(configurationInterface -> {\n                    interfaces.put(configurationInterface.name().left, configurationInterface.name().right);\n                    if (configurationInterface.submodule() != null) {\n                        submodules.put(configurationInterface.name().left, configurationInterface.submodule());\n                    }\n                });\n        }\n\n        String clientName = ReplaceLast.in(\n            ReplaceLast.in(symbolProvider.toSymbol(service).getName(), \"Client\", \"\"),\n            \"client\",\n            \"\"\n        );\n\n        String clientConfigurationContent = TypeScriptUtils.loadResourceAsString(CLIENT_CONFIGURATION_TEMPLATE)\n            .replace(\"${extensionConfigName}\", clientName + \"ExtensionConfiguration\")\n            .replace(\"${extensionConfigInterfaces}\", String.join(\",\\n    \", interfaces.keySet()));\n\n        delegator.useFileWriter(Paths.get(CodegenUtils.SOURCE_FOLDER, FILENAME).toString(), writer -> {\n            interfaces\n                .entrySet()\n                .forEach(entry -> {\n                    writer.addDependency(entry.getValue());\n                    if (\n                        submodules.containsKey(entry.getKey())\n                            && entry.getValue().getPackageName().equals(\"@smithy/core\")\n                    ) {\n                        writer.addTypeImportSubmodule(\n                            entry.getKey(),\n                            null,\n                            entry.getValue(),\n                            submodules.get(entry.getKey())\n                        );\n                    } else {\n                        writer.addTypeImport(entry.getKey(), null, entry.getValue());\n                    }\n                });\n            writer.write(clientConfigurationContent);\n        });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/FrameworkErrorModel.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic enum FrameworkErrorModel {\n    INSTANCE;\n\n    private final Model model = Model.assembler()\n        .addImport(FrameworkErrorModel.class.getResource(\"framework-errors.smithy\"))\n        .assemble()\n        .unwrap();\n\n    public Model getModel() {\n        return model;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static java.lang.String.format;\n\nimport java.io.UnsupportedEncodingException;\nimport java.net.URLDecoder;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Paths;\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.util.logging.Logger;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.HttpBinding;\nimport software.amazon.smithy.model.knowledge.HttpBinding.Location;\nimport software.amazon.smithy.model.knowledge.HttpBindingIndex;\nimport software.amazon.smithy.model.knowledge.OperationIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.BooleanNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.NodeVisitor;\nimport software.amazon.smithy.model.node.NullNode;\nimport software.amazon.smithy.model.node.NumberNode;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.HttpLabelTrait;\nimport software.amazon.smithy.model.traits.HttpPrefixHeadersTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.protocoltests.traits.AppliesTo;\nimport software.amazon.smithy.protocoltests.traits.HttpMalformedRequestTestCase;\nimport software.amazon.smithy.protocoltests.traits.HttpMalformedRequestTestsTrait;\nimport software.amazon.smithy.protocoltests.traits.HttpMalformedResponseDefinition;\nimport software.amazon.smithy.protocoltests.traits.HttpMessageTestCase;\nimport software.amazon.smithy.protocoltests.traits.HttpRequestTestCase;\nimport software.amazon.smithy.protocoltests.traits.HttpRequestTestsTrait;\nimport software.amazon.smithy.protocoltests.traits.HttpResponseTestCase;\nimport software.amazon.smithy.protocoltests.traits.HttpResponseTestsTrait;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.util.PropertyAccessor;\nimport software.amazon.smithy.utils.IoUtils;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.Pair;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates HTTP protocol test cases to be run using Vitest.\n *\n * <p>Protocol tests are defined for HTTP protocols using the\n * {@code smithy.test#httpRequestTests}, {@code smithy.test#httpResponseTests}\n * and {@code smithy.test#httpMalformedRequestTests} traits. When found on\n * operations or errors attached to operations, a protocol test case will be\n * generated that asserts that the protocol serialization and deserialization\n * code creates the correct HTTP requests and responses for a specific set of\n * parameters.\n *\n * TODO: try/catch and if/else are still cumbersome with TypeScriptWriter.\n */\n@SmithyInternalApi\npublic final class HttpProtocolTestGenerator implements Runnable {\n\n    private static final Logger LOGGER = Logger.getLogger(HttpProtocolTestGenerator.class.getName());\n    private static final String TEST_CASE_FILE_TEMPLATE = \"test/functional/%s.spec.ts\";\n    private static final String SERDE_BENCHMARK_TAG = \"serde-benchmark\";\n    private static final String WARMUP_ITERATIONS = \"10_000\";\n    private static final String BENCHMARK_ITERATIONS = \"10_000\";\n    private static final String BENCHMARK_TIMEOUT = \"60_000\";\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ShapeId protocol;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final Symbol serviceSymbol;\n    private final Set<String> additionalStubs = new TreeSet<>();\n    private final ProtocolGenerator protocolGenerator;\n    private final TestFilter testFilter;\n    private final MalformedRequestTestFilter malformedRequestTestFilter;\n    private final GenerationContext context;\n    private final ServiceClosure closure;\n\n    private TypeScriptWriter writer;\n\n    public HttpProtocolTestGenerator(\n        GenerationContext context,\n        ProtocolGenerator protocolGenerator,\n        TestFilter testFilter,\n        MalformedRequestTestFilter malformedRequestTestFilter\n    ) {\n        this.settings = context.getSettings();\n        this.model = context.getModel();\n        this.protocol = protocolGenerator.getProtocol();\n        this.service = settings.getService(model);\n        this.symbolProvider = context.getSymbolProvider();\n        this.protocolGenerator = protocolGenerator;\n        serviceSymbol = symbolProvider.toSymbol(service).toBuilder().putProperty(\"typeOnly\", false).build();\n        this.testFilter = testFilter;\n        this.malformedRequestTestFilter = malformedRequestTestFilter;\n        this.context = context;\n        this.closure = ServiceClosure.of(model, settings.getService(model));\n    }\n\n    @Override\n    public void run() {\n        OperationIndex operationIndex = OperationIndex.of(model);\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n\n        boolean hasSerdeBenchmarks = closure.getOperationShapes()\n            .stream()\n            .anyMatch(o -> {\n                if (o.hasTag(\"server-only\")) {\n                    return false;\n                }\n                return o.getTrait(HttpRequestTestsTrait.class)\n                    .map(\n                        r -> r.getTestCases()\n                            .stream()\n                            .anyMatch(c -> c.hasTag(SERDE_BENCHMARK_TAG))\n                    )\n                    .orElse(false)\n                    || o.getTrait(HttpRequestTestsTrait.class)\n                        .map(r -> r.getTestCases().stream().anyMatch(c -> c.hasTag(SERDE_BENCHMARK_TAG)))\n                        .orElse(false);\n            });\n        if (hasSerdeBenchmarks) {\n            initializeWriterIfNeeded();\n            writer.write(\n                \"\"\"\n                const WARMUP_ITERATIONS = $L;\n                const BENCHMARK_ITERATIONS = $L;\n                const BENCHMARK_TIMEOUT = $L;\n\n                /**\n                 * Test name to benchmark data.\n                 */\n                const benchmarks = {} as Record<\n                  string,\n                  {\n                    n: string;\n                    p50: string;\n                    p90: string;\n                    p95: string;\n                    p99: string;\n                    mean: string;\n                    stdDev: string;\n                  }\n                >;\n\n                function logBenchmarks() {\n                  console.table(benchmarks);\n                }\n\n                function logBenchmark(name: string, timings: number[]) {\n                  const n = timings.length;\n                  const p50 = timings[(n - 1) * 0.50 | 0] | 0;\n                  const p90 = timings[(n - 1) * 0.90 | 0] | 0;\n                  const p95 = timings[(n - 1) * 0.95 | 0] | 0;\n                  const p99 = timings[(n - 1) * 0.99 | 0] | 0;\n                  const mean = timings.reduce((a, b) => a + b, 0) / timings.length | 0;\n                  const stdDev = Math.sqrt(timings.reduce((a, b) => a + (b - mean) ** 2, 0) / timings.length) | 0;\n\n                  const fmt = (n: number) => String(n.toLocaleString()).padStart(10, ' ');\n                  benchmarks[name] = {\n                    n: fmt(n),\n                    p50: fmt(p50),\n                    p90: fmt(p90),\n                    p95: fmt(p95),\n                    p99: fmt(p99),\n                    mean: fmt(mean),\n                    stdDev: fmt(stdDev),\n                  };\n                  return {\n                    name, p95, n, timings\n                  };\n                }\n\n                function vizBenchmark({ name, p95, n, timings }: { name: string, p95: number, n: number, timings: number[] }) {\n                  const decile = p95 / 10;\n                  let d = 1;\n                  const centIndex = (n / 100) | 0;\n                  let line = \"\";\n\n                  console.info(name);\n                  console.info(\"=\".repeat(31), \"Distribution Viz\", \"=\".repeat(31));\n                  for (let i = 0; i < n; i += centIndex) {\n                    const t = timings[i];\n                    if (t < decile * d) {\n                      line += \".\";\n                    } else {\n                      line += ` <= $${(decile * d) | 0}`;\n                      console.info(line);\n                      d += 1;\n                      line = \".\";\n                    }\n                  }\n                  console.info(line + ` > $${(decile * (d - 1)) | 0}`);\n                  console.info(\"=\".repeat(80));\n                }\n                \"\"\",\n                WARMUP_ITERATIONS,\n                BENCHMARK_ITERATIONS,\n                BENCHMARK_TIMEOUT\n            );\n        }\n\n        // Use a TreeSet to have a fixed ordering of tests.\n        for (OperationShape operation : new TreeSet<>(topDownIndex.getContainedOperations(service))) {\n            if (settings.generateClient()) {\n                generateClientOperationTests(operation, operationIndex);\n            }\n            if (settings.generateServerSdk()) {\n                generateServerOperationTests(operation, operationIndex);\n            }\n        }\n\n        // Include any additional stubs required.\n        for (String additionalStub : additionalStubs) {\n            writer.write(IoUtils.readUtf8Resource(getClass(), additionalStub));\n        }\n\n        if (hasSerdeBenchmarks) {\n            writer.addImport(\"afterAll\", null, TypeScriptDependency.VITEST);\n            writer.write(\"\"\"\n                         afterAll(() => {\n                           logBenchmarks();\n                         });\n                         \"\"\");\n        }\n    }\n\n    private void generateClientOperationTests(OperationShape operation, OperationIndex operationIndex) {\n        if (!operation.hasTag(\"server-only\")) {\n            // 1. Generate test cases for each request.\n            operation\n                .getTrait(HttpRequestTestsTrait.class)\n                .ifPresent(trait -> {\n                    for (HttpRequestTestCase testCase : trait.getTestCasesFor(AppliesTo.CLIENT)) {\n                        onlyIfProtocolMatches(testCase, () -> {\n                            if (testCase.hasTag(SERDE_BENCHMARK_TAG)) {\n                                generateClientRequestBenchmark(operation, testCase);\n                            } else {\n                                generateClientRequestTest(operation, testCase);\n                            }\n                        });\n                    }\n                });\n            // 2. Generate test cases for each response.\n            operation\n                .getTrait(HttpResponseTestsTrait.class)\n                .ifPresent(trait -> {\n                    for (HttpResponseTestCase testCase : trait.getTestCasesFor(AppliesTo.CLIENT)) {\n                        onlyIfProtocolMatches(testCase, () -> {\n                            if (testCase.hasTag(SERDE_BENCHMARK_TAG)) {\n                                generateResponseBenchmark(operation, testCase);\n                            } else {\n                                generateResponseTest(operation, testCase);\n                            }\n                        });\n                    }\n                });\n            // 3. Generate test cases for each error on each operation.\n            for (StructureShape error : operationIndex.getErrors(operation, service)) {\n                if (!error.hasTag(\"server-only\")) {\n                    error\n                        .getTrait(HttpResponseTestsTrait.class)\n                        .ifPresent(trait -> {\n                            for (HttpResponseTestCase testCase : trait.getTestCasesFor(AppliesTo.CLIENT)) {\n                                onlyIfProtocolMatches(\n                                    testCase,\n                                    () -> generateErrorResponseTest(operation, error, testCase)\n                                );\n                            }\n                        });\n                }\n            }\n        }\n    }\n\n    private void generateServerOperationTests(OperationShape operation, OperationIndex operationIndex) {\n        if (!operation.hasTag(\"client-only\")) {\n            // 1. Generate test cases for each request.\n            operation\n                .getTrait(HttpRequestTestsTrait.class)\n                .ifPresent(trait -> {\n                    for (HttpRequestTestCase testCase : trait.getTestCasesFor(AppliesTo.SERVER)) {\n                        onlyIfProtocolMatches(testCase, () -> generateServerRequestTest(operation, testCase));\n                    }\n                });\n            // 2. Generate test cases for each response.\n            operation\n                .getTrait(HttpResponseTestsTrait.class)\n                .ifPresent(trait -> {\n                    for (HttpResponseTestCase testCase : trait.getTestCasesFor(AppliesTo.SERVER)) {\n                        onlyIfProtocolMatches(testCase, () -> generateServerResponseTest(operation, testCase));\n                    }\n                });\n            // 3. Generate malformed request test cases\n            operation\n                .getTrait(HttpMalformedRequestTestsTrait.class)\n                .ifPresent(trait -> {\n                    for (HttpMalformedRequestTestCase testCase : trait.getTestCases()) {\n                        onlyIfProtocolMatches(testCase, () -> generateMalformedRequestTest(operation, testCase));\n                    }\n                });\n            // 3. Generate test cases for each error on each operation.\n            for (StructureShape error : operationIndex.getErrors(operation, service)) {\n                if (!error.hasTag(\"client-only\")) {\n                    error\n                        .getTrait(HttpResponseTestsTrait.class)\n                        .ifPresent(trait -> {\n                            for (HttpResponseTestCase testCase : trait.getTestCasesFor(AppliesTo.SERVER)) {\n                                onlyIfProtocolMatches(\n                                    testCase,\n                                    () -> generateServerErrorResponseTest(operation, error, testCase)\n                                );\n                            }\n                        });\n                }\n            }\n        }\n    }\n\n    // Only generate test cases when its protocol matches the target protocol.\n    private <T extends HttpMessageTestCase> void onlyIfProtocolMatches(T testCase, Runnable runnable) {\n        if (testCase.getProtocol().equals(protocol)) {\n            LOGGER.fine(() -> format(\"Generating protocol test case for %s.%s\", service.getId(), testCase.getId()));\n            initializeWriterIfNeeded();\n            runnable.run();\n        }\n    }\n\n    // Only generate test cases when its protocol matches the target protocol.\n    private void onlyIfProtocolMatches(HttpMalformedRequestTestCase testCase, Runnable runnable) {\n        if (testCase.getProtocol().equals(protocol)) {\n            LOGGER.fine(\n                () -> format(\n                    \"Generating malformed request test case for %s.%s\",\n                    service.getId(),\n                    testCase.getId()\n                )\n            );\n            initializeWriterIfNeeded();\n            runnable.run();\n        }\n    }\n\n    private void initializeWriterIfNeeded() {\n        if (writer == null) {\n            context.getWriterDelegator().useFileWriter(createTestCaseFilename(), writer -> this.writer = writer);\n            writer.addDependency(TypeScriptDependency.SMITHY_TYPES);\n            writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n            // Add the template to each generated test.\n            writer.write(IoUtils.readUtf8Resource(getClass(), \"protocol-test-stub.ts\"));\n            writer.addImport(\"test\", \"it\", TypeScriptDependency.VITEST);\n            writer.addImport(\"expect\", null, TypeScriptDependency.VITEST);\n        }\n    }\n\n    private String createTestCaseFilename() {\n        String baseName = protocol.getName().toLowerCase(Locale.US).replace(\"-\", \"_\").replace(\".\", \"_\");\n        return TEST_CASE_FILE_TEMPLATE.replace(\"%s\", baseName);\n    }\n\n    private void generateClientRequestTest(OperationShape operation, HttpRequestTestCase testCase) {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n\n        String testName = testCase.getId() + \":Request\";\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        openTestBlock(operation, testCase, testName, () -> {\n            // Create a client with a custom request handler that intercepts requests.\n            writer.openBlock(\"const client = new $T({\", \"});\\n\", serviceSymbol, () -> {\n                writer.write(\"...clientParams,\");\n                testCase\n                    .getHost()\n                    .ifPresent(host -> {\n                        writer.write(\"endpoint: \\\"https://$L\\\",\", host);\n                    });\n                writer.write(\"requestHandler: new RequestSerializationTestHandler(),\");\n            });\n\n            // Run the parameters through a visitor to adjust for TS specific inputs.\n            ObjectNode params = testCase.getParams();\n            Optional<ShapeId> inputOptional = operation.getInput();\n            if (inputOptional.isPresent()) {\n                StructureShape inputShape = model.expectShape(inputOptional.get(), StructureShape.class);\n                writer\n                    .write(\"const command = new $T(\", operationSymbol)\n                    .indent()\n                    .call(() -> params.accept(new CommandInputNodeVisitor(inputShape)))\n                    .dedent()\n                    .write(\");\");\n            } else {\n                writer.write(\"const command = new $T({});\", operationSymbol);\n            }\n\n            // Send the request and look for the expected exception to then perform assertions.\n            writer\n                .write(\n                    \"\"\"\n                    try {\n                      await client.send(command);\n                      fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n                      return;\n                    } catch (err) {\n                      if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n                        fail(err);\n                        return;\n                      }\n                      const r = err.request;\"\"\"\n                )\n                .indent()\n                .call(() -> writeHttpRequestAssertions(testCase))\n                .dedent()\n                .write(\"}\");\n        });\n    }\n\n    private void generateServerRequestTest(OperationShape operation, HttpRequestTestCase testCase) {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n\n        // Lowercase all the headers we're expecting as this is what we'll get.\n        Map<String, String> headers = testCase\n            .getHeaders()\n            .entrySet()\n            .stream()\n            .map(entry -> new Pair<>(entry.getKey().toLowerCase(Locale.US), entry.getValue()))\n            .collect(MapUtils.toUnmodifiableMap(Pair::getLeft, Pair::getRight));\n        String queryParameters = Node.prettyPrintJson(buildQueryBag(testCase.getQueryParams()));\n        String headerParameters = Node.prettyPrintJson(ObjectNode.fromStringMap(headers));\n        String body = testCase.getBody().orElse(null);\n\n        String testName = testCase.getId() + \":ServerRequest\";\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        openTestBlock(operation, testCase, testName, () -> {\n            Symbol serviceSymbol = symbolProvider.toSymbol(service);\n            Symbol handlerSymbol = serviceSymbol.expectProperty(\"handler\", Symbol.class);\n\n            // Create a mock function to set in place of the server operation function so we can capture\n            // input and other information.\n            writer.write(\"const testFunction = vi.fn();\");\n            writer.write(\"testFunction.mockReturnValue(Promise.resolve({}));\");\n\n            boolean usesDefaultValidation = !context.getSettings().isDisableDefaultValidation();\n            setupStubService(operationSymbol, serviceSymbol, handlerSymbol, usesDefaultValidation);\n\n            // Construct a new http request according to the test case definition.\n            writer.openBlock(\"const request = new HttpRequest({\", \"});\", () -> {\n                writer.write(\"method: $S,\", testCase.getMethod());\n                writer.write(\"hostname: $S,\", testCase.getHost().orElse(\"foo.example.com\"));\n                writer.write(\"path: $S,\", testCase.getUri());\n                writer.write(\"query: $L,\", queryParameters);\n                writer.write(\"headers: $L,\", headerParameters);\n                if (body != null) {\n                    writer.write(\"body: Readable.from([$S]),\", body);\n                }\n            });\n            writer.write(\"await handler.handle(request, {});\").write(\"\");\n\n            // Assert that the function has been called exactly once.\n            writer.write(\"expect(testFunction.mock.calls.length).toBe(1);\");\n\n            // Capture the input. We need to cast this to any so we can index into it.\n            writer.write(\"let r: any = testFunction.mock.calls[0][0];\").write(\"\");\n            writeRequestParamAssertions(operation, testCase);\n        });\n    }\n\n    private void generateMalformedRequestTest(OperationShape operation, HttpMalformedRequestTestCase testCase) {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n\n        Map<String, String> requestHeaders = testCase\n            .getRequest()\n            .getHeaders()\n            .entrySet()\n            .stream()\n            .map(entry -> new Pair<>(entry.getKey().toLowerCase(Locale.US), entry.getValue()))\n            .collect(MapUtils.toUnmodifiableMap(Pair::getLeft, Pair::getRight));\n        String queryParameters = Node.prettyPrintJson(buildQueryBag(testCase.getRequest().getQueryParams()));\n        String requestHeaderParameters = Node.prettyPrintJson(ObjectNode.fromStringMap(requestHeaders));\n        String requestBody = testCase.getRequest().getBody().orElse(null);\n\n        String testName = testCase.getId() + \":MalformedRequest\";\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        openTestBlock(operation, testCase, testName, () -> {\n            Symbol serviceSymbol = symbolProvider.toSymbol(service);\n            Symbol handlerSymbol = serviceSymbol.expectProperty(\"handler\", Symbol.class);\n\n            // Create a mock function to set in place of the server operation function so we can capture\n            // input and other information.\n            writer.write(\"const testFunction = vi.fn();\");\n            writer.openBlock(\"testFunction.mockImplementation(() => {\", \"});\", () -> {\n                writer.write(\"throw new Error($S);\", \"This request should have been rejected.\");\n            });\n\n            boolean usesDefaultValidation = !context.getSettings().isDisableDefaultValidation();\n            setupStubService(operationSymbol, serviceSymbol, handlerSymbol, usesDefaultValidation);\n\n            // Construct a new http request according to the test case definition.\n            writer.openBlock(\"const request = new HttpRequest({\", \"});\", () -> {\n                writer.write(\"method: $S,\", testCase.getRequest().getMethod());\n                writer.write(\"hostname: $S,\", testCase.getRequest().getHost().orElse(\"foo.example.com\"));\n                writer.write(\"path: $S,\", testCase.getRequest().getUri());\n                writer.write(\"query: $L,\", queryParameters);\n                writer.write(\"headers: $L,\", requestHeaderParameters);\n                if (requestBody != null) {\n                    writer.write(\"body: Readable.from([$S]),\", requestBody);\n                }\n            });\n            writer.write(\"const r = await handler.handle(request, {});\").write(\"\");\n\n            writer.write(\"expect(testFunction.mock.calls.length).toBe(0);\");\n\n            writeHttpResponseAssertions(testCase.getResponse());\n        });\n    }\n\n    private void setupStubService(\n        Symbol operationSymbol,\n        Symbol serviceSymbol,\n        Symbol handlerSymbol,\n        boolean usesDefaultValidation\n    ) {\n        // We use a partial here so that we don't have to define the entire service, but still get the advantages\n        // the type checker, including excess property checking. Later on we'll use `as` to cast this to the\n        // full service so that we can actually use it.\n        writer.openBlock(\"const testService: Partial<$T<{}>> = {\", \"};\", serviceSymbol, () -> {\n            writer.write(\"$L: testFunction as $T<{}>,\", operationSymbol.getName(), operationSymbol);\n        });\n\n        String getHandlerName = \"get\" + handlerSymbol.getName();\n        writer.addRelativeImport(\n            getHandlerName,\n            null,\n            Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, ServerSymbolVisitor.SERVER_FOLDER)\n        );\n\n        if (!usesDefaultValidation) {\n            writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n\n            // Cast the service as any so TS will ignore the fact that the type being passed in is incomplete.\n            writer.openBlock(\n                \"const handler = $L(testService as $T<{}>, (ctx: {}, failures: __ValidationFailure[]) => {\",\n                \"});\",\n                getHandlerName,\n                serviceSymbol,\n                () -> writer.write(\"if (failures) { throw failures; } return undefined;\")\n            );\n        } else {\n            writer.write(\"const handler = $L(testService as $T<{}>);\", getHandlerName, serviceSymbol);\n        }\n    }\n\n    private ObjectNode buildQueryBag(List<String> queryParams) {\n        // The query params in the test definition is a list of strings that looks like\n        // \"Foo=Bar\", so we need to split the keys from the values.\n        Map<String, List<String>> query = queryParams\n            .stream()\n            .map(pair -> {\n                String[] split = pair.split(\"=\");\n                String key;\n                String value = \"\";\n                try {\n                    // The strings we're given are url encoded, so we need to decode them. In an actual implementation\n                    // the request we're given will have already decoded these.\n                    key = URLDecoder.decode(split[0], StandardCharsets.UTF_8.toString());\n                    if (split.length > 1) {\n                        value = URLDecoder.decode(split[1], StandardCharsets.UTF_8.toString());\n                    }\n                } catch (UnsupportedEncodingException e) {\n                    throw new RuntimeException(e);\n                }\n                return Pair.of(key, value);\n            })\n            // Query lists/sets will just use the same key repeatedly, so here we collect all the values that\n            // share a key.\n            .collect(Collectors.groupingBy(Pair::getKey, Collectors.mapping(Pair::getValue, Collectors.toList())));\n\n        ObjectNode.Builder nodeBuilder = ObjectNode.objectNodeBuilder();\n        for (Map.Entry<String, List<String>> entry : query.entrySet()) {\n            nodeBuilder.withMember(entry.getKey(), ArrayNode.fromStrings(entry.getValue()));\n        }\n        return nodeBuilder.build();\n    }\n\n    // Ensure that the serialized request matches the expected request.\n    private void writeHttpRequestAssertions(HttpRequestTestCase testCase) {\n        writer.write(\"expect(r.method).toBe($S);\", testCase.getMethod());\n        writer.write(\"expect(r.path).toBe($S);\", testCase.getUri());\n\n        writeHttpHeaderAssertions(testCase);\n        writeHttpQueryAssertions(testCase);\n        writeHttpHostAssertion(testCase);\n        testCase\n            .getBody()\n            .ifPresent(body -> {\n                writeHttpBodyAssertions(body, testCase.getBodyMediaType().orElse(\"UNKNOWN\"), true);\n            });\n    }\n\n    private void writeHttpResponseAssertions(HttpResponseTestCase testCase) {\n        writer.write(\"expect(r.statusCode).toBe($L);\", testCase.getCode());\n        writeHttpHeaderAssertions(testCase);\n        testCase\n            .getBody()\n            .ifPresent(body -> {\n                writeHttpBodyAssertions(body, testCase.getBodyMediaType().orElse(\"UNKNOWN\"), false);\n            });\n    }\n\n    private void writeHttpResponseAssertions(HttpMalformedResponseDefinition responseDefinition) {\n        writer.write(\"expect(r.statusCode).toBe($L);\", responseDefinition.getCode());\n        responseDefinition\n            .getHeaders()\n            .forEach((header, value) -> {\n                header = header.toLowerCase();\n                writer.write(\"expect(r.headers[$S]).toBe($S);\", header, value);\n            });\n        writer.write(\"\");\n        responseDefinition\n            .getBody()\n            .ifPresent(body -> {\n                // only one of messageRegex or contents can be present, as it's modeled as a union\n                // so only one of these will execute in practice\n                body\n                    .getMessageRegex()\n                    .ifPresent(regex -> {\n                        writeHttpBodyMessageAssertion(regex, body.getMediaType());\n                    });\n                body\n                    .getContents()\n                    .ifPresent(contents -> {\n                        writeHttpBodyAssertions(contents, body.getMediaType(), false);\n                    });\n            });\n    }\n\n    private void writeHttpQueryAssertions(HttpRequestTestCase testCase) {\n        testCase\n            .getRequireQueryParams()\n            .forEach(\n                requiredQueryParam -> writer.write(\n                    \"\"\"\n                    expect(\n                      r.query[$1S],\n                      `Query key $1S should have been defined in $${JSON.stringify(r.query)}`\n                    ).toBeDefined();\"\"\",\n                    requiredQueryParam\n                )\n            );\n        writer.write(\"\");\n\n        testCase\n            .getForbidQueryParams()\n            .forEach(\n                forbidQueryParam -> writer.write(\n                    \"\"\"\n                    expect(\n                      r.query[$1S],\n                      `Query key $1S should have been undefined in $${JSON.stringify(r.query)}`\n                    ).toBeUndefined();\"\"\",\n                    forbidQueryParam\n                )\n            );\n        writer.write(\"\");\n\n        List<String> explicitQueryValues = testCase.getQueryParams();\n        if (!explicitQueryValues.isEmpty()) {\n            // Use buildQueryString like the fetch handler will.\n            writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n            writer.addImportSubmodule(\n                \"buildQueryString\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.PROTOCOLS\n            );\n\n            writer.write(\"const queryString = buildQueryString(r.query);\");\n            explicitQueryValues.forEach(\n                explicitQueryValue -> writer.write(\"expect(queryString).toContain($S);\", explicitQueryValue)\n            );\n        }\n        writer.write(\"\");\n    }\n\n    private void writeHttpHeaderAssertions(HttpMessageTestCase testCase) {\n        testCase\n            .getRequireHeaders()\n            .forEach(requiredHeader -> {\n                writer.write(\n                    \"\"\"\n                    expect(\n                      r.headers[$1S],\n                      `Header key $1S should have been defined in $${JSON.stringify(r.headers)}`\n                    ).toBeDefined();\"\"\",\n                    requiredHeader.toLowerCase()\n                );\n            });\n        writer.write(\"\");\n\n        testCase\n            .getForbidHeaders()\n            .forEach(\n                forbidHeader -> writer.write(\n                    \"\"\"\n                    expect(\n                      r.headers[$1S],\n                      `Header key $1S should have been undefined in $${JSON.stringify(r.headers)}`\n                    ).toBeUndefined();\"\"\",\n                    forbidHeader.toLowerCase()\n                )\n            );\n        writer.write(\"\");\n\n        testCase\n            .getHeaders()\n            .forEach((header, value) -> {\n                header = header.toLowerCase();\n                writer.write(\"expect(r.headers[$S]).toBe($S);\", header, value);\n            });\n        writer.write(\"\");\n    }\n\n    private void writeHttpHostAssertion(HttpRequestTestCase testCase) {\n        testCase\n            .getResolvedHost()\n            .ifPresent(resolvedHost -> {\n                writer.write(\"expect(r.headers[\\\"host\\\"]).toBe($S);\", resolvedHost);\n                writer.write(\"\");\n            });\n    }\n\n    private void writeHttpBodyAssertions(String body, String mediaType, boolean isClientTest) {\n        if (body.isEmpty()) {\n            // If we expect an empty body, expect it to be falsy.\n            // Or, for JSON an empty object represents an empty body.\n            // mediaType is often UNKNOWN here.\n            writer.write(\"expect(!r.body || r.body === `{}`).toBeTruthy();\");\n            return;\n        }\n\n        // Fast fail if we don't have a body.\n        writer.write(\"expect(r.body, `Body was undefined.`).toBeDefined();\");\n\n        // Otherwise load a media type specific comparator and do a comparison.\n        String comparatorInvoke = registerBodyComparatorStub(mediaType);\n\n        // If this is a request case then we know we're generating a client test,\n        // because a request case for servers would be comparing parsed objects. We\n        // need to know which is which here to be able to grab the utf8Encoder from\n        // the right place.\n        if (!mediaType.equals(\"application/cbor\")) {\n            if (isClientTest) {\n                writer.write(\"const utf8Encoder = client.config.utf8Encoder;\");\n            } else {\n                writer.addImportSubmodule(\n                    \"toUtf8\",\n                    \"__utf8Encoder\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.SERDE\n                );\n                writer.write(\"const utf8Encoder = __utf8Encoder;\");\n            }\n        }\n\n        // Handle escaping strings with quotes inside them.\n        writer.write(\"const bodyString = `$L`;\", body.replace(\"\\\"\", \"\\\\\\\"\"));\n        writer.write(\"const unequalParts: any = $L;\", comparatorInvoke);\n        writer.write(\"expect(unequalParts).toBeUndefined();\");\n    }\n\n    private void writeHttpBodyMessageAssertion(String messageRegex, String mediaType) {\n        // Fast fail if we don't have a body.\n        writer.write(\"expect(r.body, `Body was undefined`).toBeDefined();\");\n\n        // Otherwise load a media type specific matcher\n        String comparatorInvoke = registerMessageRegexStub(mediaType);\n\n        writer.writeInline(\"expect(\").writeInline(comparatorInvoke, messageRegex).write(\").toEqual(true);\");\n    }\n\n    private String registerBodyComparatorStub(String mediaType) {\n        // Load an additional stub to handle body comparisons for the\n        // set of bodyMediaType values we know of.\n        switch (mediaType) {\n            case \"application/x-www-form-urlencoded\":\n                additionalStubs.add(\"protocol-test-form-urlencoded-stub.ts\");\n                return \"compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString())\";\n            case \"application/json\":\n                additionalStubs.add(\"protocol-test-json-stub.ts\");\n                return \"compareEquivalentJsonBodies(bodyString, r.body.toString())\";\n            case \"application/xml\":\n                writer.addDependency(TypeScriptDependency.XML_PARSER);\n                writer.addDependency(TypeScriptDependency.HTML_ENTITIES);\n                writer.addImport(\"XMLParser\", null, TypeScriptDependency.XML_PARSER);\n                writer.addImport(\"decodeHTML\", null, TypeScriptDependency.HTML_ENTITIES);\n                additionalStubs.add(\"protocol-test-xml-stub.ts\");\n                return \"compareEquivalentXmlBodies(bodyString, r.body.toString())\";\n            case \"application/octet-stream\":\n                writer.addTypeImport(\"Encoder\", \"__Encoder\", TypeScriptDependency.SMITHY_TYPES);\n                additionalStubs.add(\"protocol-test-octet-stream-stub.ts\");\n                return \"compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body)\";\n            case \"text/plain\":\n                additionalStubs.add(\"protocol-test-text-stub.ts\");\n                return \"compareEquivalentTextBodies(bodyString, r.body)\";\n            case \"application/cbor\":\n                writer.addImportSubmodule(\"cbor\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CBOR);\n                additionalStubs.add(\"protocol-test-cbor-stub.ts\");\n                return \"compareEquivalentCborBodies(bodyString, r.body)\";\n            default:\n                LOGGER.warning(\n                    \"Unable to compare bodies with unknown media type `\" +\n                        mediaType +\n                        \"`, defaulting to direct comparison.\"\n                );\n                writer.addTypeImport(\"Encoder\", \"__Encoder\", TypeScriptDependency.SMITHY_TYPES);\n                additionalStubs.add(\"protocol-test-unknown-type-stub.ts\");\n                return \"compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body)\";\n        }\n    }\n\n    private String registerMessageRegexStub(String mediaType) {\n        // Load an additional stub to handle body comparisons for the\n        // set of bodyMediaType values we know of.\n        switch (mediaType) {\n            case \"application/json\":\n                additionalStubs.add(\"malformed-request-test-regex-json-stub.ts\");\n                return \"matchMessageInJsonBody(r.body.toString(), $S)\";\n            default:\n                throw new IllegalArgumentException(\"Unsupported media type for message body regex check: \" + mediaType);\n        }\n    }\n\n    public void generateServerResponseTest(OperationShape operation, HttpResponseTestCase testCase) {\n        Symbol serviceSymbol = symbolProvider.toSymbol(service);\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        String testName = testCase.getId() + \":ServerResponse\";\n        openTestBlock(operation, testCase, testName, () -> {\n            Symbol outputType = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n            writer.openBlock(\"class TestService implements Partial<$T<{}>> {\", \"}\", serviceSymbol, () -> {\n                writer.openBlock(\n                    \"$L(input: any, ctx: {}): Promise<$T> {\",\n                    \"}\",\n                    operationSymbol.getName(),\n                    outputType,\n                    () -> {\n                        Optional<ShapeId> outputOptional = operation.getOutput();\n                        if (outputOptional.isPresent()) {\n                            StructureShape outputShape =\n                                model.expectShape(outputOptional.get(), StructureShape.class);\n                            writer.writeInline(\"let response = \");\n                            testCase.getParams().accept(new CommandInputNodeVisitor(outputShape, true));\n                            writer.write(\"return Promise.resolve({ ...response, '$$metadata': {} });\");\n                        } else {\n                            writer.write(\"return Promise.resolve({ '$$metadata': {} });\");\n                        }\n                    }\n                );\n            });\n            writeServerResponseTest(operation, testCase);\n        });\n    }\n\n    private void generateResponseTest(OperationShape operation, HttpResponseTestCase testCase) {\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        String testName = testCase.getId() + \":Response\";\n        openTestBlock(operation, testCase, testName, () -> {\n            writeResponseTestSetup(operation, testCase, true);\n\n            // Invoke the handler and look for the expected response to then perform assertions.\n            writer.write(\"let r: any;\");\n            writer.write(\n                \"\"\"\n                try {\n                  r = await client.send(command);\n                } catch (err) {\n                  fail(\"Expected a valid response to be returned, got \" + err);\n                  return;\n                }\"\"\"\n            );\n            writeResponseAssertions(operation, testCase);\n        });\n    }\n\n    private void generateClientRequestBenchmark(OperationShape operation, HttpRequestTestCase testCase) {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n\n        String testName = testCase.getId() + \":SerdeBenchmark:Request\";\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n\n        openTestBlock(operation, testCase, testName, () -> {\n            writer.openBlock(\"const client = new $T({\", \"});\\n\", serviceSymbol, () -> {\n                writer.write(\"...clientParams,\");\n                testCase\n                    .getHost()\n                    .ifPresent(host -> {\n                        writer.write(\"endpoint: \\\"https://$L\\\",\", host);\n                    });\n                writer.write(\"requestHandler: new RequestSerializationTestHandler(),\");\n            });\n\n            ObjectNode params = testCase.getParams();\n            Optional<ShapeId> inputOptional = operation.getInput();\n            if (inputOptional.isPresent()) {\n                StructureShape inputShape = model.expectShape(inputOptional.get(), StructureShape.class);\n                writer\n                    .write(\"const command = new $T(\", operationSymbol)\n                    .indent()\n                    .call(() -> params.accept(new CommandInputNodeVisitor(inputShape)))\n                    .dedent()\n                    .write(\");\");\n            } else {\n                writer.write(\"const command = new $T({});\", operationSymbol);\n            }\n\n            // Send the request and look for the expected exception to then perform assertions.\n            writer\n                .write(\n                    \"\"\"\n                    const name = $S;\n                    const timings = [] as number[];\n                    const testStart = performance.now();\n                    const numeric = (a: number, b: number) => a - b;\n                    let i = 0;\n\n                    while (++i) {\n                      const preSerialize = performance.now();\n                      try {\n                        await client.send(command);\n                        fail(\"Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown\");\n                        return;\n                      } catch (err) {\n                        if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {\n                          fail(err);\n                          return;\n                        }\n                        const r = err.request;\n                      };\n                      const postSerialize = performance.now();\n                      if (i >= WARMUP_ITERATIONS) {\n                        // allow warmup\n                        timings.push(postSerialize * 1_000_000 - preSerialize  * 1_000_000);\n                      }\n\n                      if (timings.length >= BENCHMARK_ITERATIONS) {\n                        timings.length = BENCHMARK_ITERATIONS;\n                        break;\n                      } else if (testStart + 30_000 < preSerialize) {\n                        break;\n                      }\n                    }\n\n                    timings.sort(numeric);\n\n                    vizBenchmark(logBenchmark(name, timings));\n                    \"\"\",\n                    testName\n                );\n        });\n    }\n\n    private void generateResponseBenchmark(OperationShape operation, HttpResponseTestCase testCase) {\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n\n        String testName = testCase.getId() + \":SerdeBenchmark:Response\";\n\n        openTestBlock(operation, testCase, testName, () -> {\n            writeResponseTestSetup(operation, testCase, true);\n\n            writer.write(\n                \"\"\"\n                const name = $S;\n                const timings = [] as number[];\n                const numeric = (a: number, b: number) => a - b;\n                let i = 0;\n\n                client.middlewareStack.addRelativeTo(\n                    (next: any) => async (args: any) => {\n                      const preDeserialize = performance.now();\n                      const r = await next(args);\n                      const postDeserialize = performance.now();\n                      if (i >= WARMUP_ITERATIONS) {\n                        timings.push(postDeserialize * 1_000_000 - preDeserialize * 1_000_000);\n                      }\n                      return r;\n                    },\n                    {\n                      name: \"deserializerBenchmarkMiddleware\",\n                      toMiddleware: \"deserializerMiddleware\",\n                      relation: \"before\",\n                      override: true,\n                    }\n                );\n\n                const benchmarkStart = performance.now();\n\n                while (++i) {\n                  let r: any;\n                  try {\n                    r = await client.send(command);\n                  } catch (err) {\n                    fail(\"Expected a valid response to be returned, got \" + err);\n                    return;\n                  }\n                  if (i >= WARMUP_ITERATIONS + BENCHMARK_ITERATIONS) {\n                    break;\n                  } else if (benchmarkStart + 30_000 < performance.now()) {\n                    break;\n                  }\n                }\n\n                timings.sort(numeric);\n                timings.length = Math.min(timings.length, BENCHMARK_ITERATIONS);\n\n                vizBenchmark(logBenchmark(name, timings));\n                \"\"\",\n                testName\n            );\n        });\n    }\n\n    private void generateServerErrorResponseTest(\n        OperationShape operation,\n        StructureShape error,\n        HttpResponseTestCase testCase\n    ) {\n        Symbol serviceSymbol = symbolProvider.toSymbol(service);\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        Symbol outputType = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n        Symbol errorSymbol = symbolProvider.toSymbol(error);\n        ErrorTrait errorTrait = error.expectTrait(ErrorTrait.class);\n\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        String testName = testCase.getId() + \":ServerErrorResponse\";\n        openTestBlock(operation, testCase, testName, () -> {\n            // Generates a Partial implementation of the service type that only includes\n            // the specific operation under test. Later we'll have to \"cast\" this with an \"as\",\n            // but using the partial in the meantime will give us proper type checking on the\n            // operation we want.\n            writer.openBlock(\"class TestService implements Partial<$T<{}>> {\", \"}\", serviceSymbol, () -> {\n                writer.openBlock(\n                    \"$L(input: any, ctx: {}): Promise<$T> {\",\n                    \"}\",\n                    operationSymbol.getName(),\n                    outputType,\n                    () -> {\n                        // Write out an object according to what's defined in the test case.\n                        writer.writeInline(\"const response = \");\n                        testCase.getParams().accept(new CommandInputNodeVisitor(error, true));\n\n                        // Add in the necessary wrapping information to make the error satisfy its interface.\n                        // TODO: having proper constructors for these errors would be really nice so we don't\n                        // have to do this.\n                        writer.openBlock(\"const error: $T = {\", \"};\", errorSymbol, () -> {\n                            writer.write(\"...response,\");\n                            writer.write(\"name: $S,\", error.getId().getName());\n                            writer.write(\"$$fault: $S,\", errorTrait.isClientError() ? \"client\" : \"server\");\n                            writer.write(\"$$metadata: {},\");\n                        });\n                        writer.write(\"throw error;\");\n                    }\n                );\n            });\n            writeServerResponseTest(operation, testCase);\n        });\n    }\n\n    private void writeServerResponseTest(OperationShape operation, HttpResponseTestCase testCase) {\n        Symbol serviceSymbol = symbolProvider.toSymbol(service);\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        Symbol handlerSymbol = serviceSymbol.expectProperty(\"handler\", Symbol.class);\n        Symbol serializerSymbol = operationSymbol.expectProperty(\"serializerType\", Symbol.class);\n        Symbol serviceOperationsSymbol = serviceSymbol.expectProperty(\"operations\", Symbol.class);\n        writer.write(\"const service: any = new TestService()\");\n\n        // There's a lot of setup here, including creating our own mux, serializers list, and ultimately\n        // our own service handler. This is largely in service of avoiding having to go through the\n        // request deserializer\n        writer.addImport(\"httpbinding\", null, TypeScriptDependency.SERVER_COMMON);\n        writer.openBlock(\n            \"const testMux = new httpbinding.HttpBindingMux<$S, keyof $T<{}>>([\",\n            \"]);\",\n            service.getId().getName(),\n            serviceSymbol,\n            () -> {\n                writer.openBlock(\n                    \"new httpbinding.UriSpec<$S, $S>('POST', [], [], {\",\n                    \"}),\",\n                    service.getId().getName(),\n                    operation.getId().getName(),\n                    () -> {\n                        writer.write(\"service: $S,\", service.getId().getName());\n                        writer.write(\"operation: $S,\", operation.getId().getName());\n                    }\n                );\n            }\n        );\n\n        // Extend the existing serializer and replace the deserialize with a noop so we don't have to\n        // worry about trying to construct something that matches.\n        writer.openBlock(\"class TestSerializer extends $T {\", \"}\", serializerSymbol, () -> {\n            writer.openBlock(\"deserialize = (output: any, context: any): Promise<any> => {\", \"};\", () -> {\n                writer.write(\"return Promise.resolve({});\");\n            });\n        });\n\n        // Since we aren't going through the deserializer, we don't have to put much in the fake request.\n        // Just enough to get it through our test mux.\n        writer.write(\"const request = new HttpRequest({method: 'POST', hostname: 'example.com'});\");\n\n        // Create a new serializer factory that always returns our test serializer.\n        writer.addImport(\"ServiceException\", \"__ServiceException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"OperationSerializer\", \"__OperationSerializer\", TypeScriptDependency.SERVER_COMMON);\n        writer.openBlock(\n            \"const serFn: (op: $1T) => __OperationSerializer<$2T<{}>, $1T, __ServiceException> = (op) =>\" +\n                \" { return new TestSerializer(); };\",\n            serviceOperationsSymbol,\n            serviceSymbol\n        );\n\n        writer.addRelativeImport(\n            \"serializeFrameworkException\",\n            null,\n            Paths.get(\n                \".\",\n                CodegenUtils.SOURCE_FOLDER,\n                ProtocolGenerator.PROTOCOLS_FOLDER,\n                ProtocolGenerator.getSanitizedName(protocolGenerator.getName())\n            )\n        );\n        writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n        writer.write(\n            \"const handler = new $T(service, testMux, serFn, serializeFrameworkException, \" +\n                \"(ctx: {}, f: __ValidationFailure[]) => { if (f) { throw f; } return undefined;});\",\n            handlerSymbol\n        );\n        writer.write(\"let r = await handler.handle(request, {})\").write(\"\");\n        writeHttpResponseAssertions(testCase);\n    }\n\n    private void generateErrorResponseTest(\n        OperationShape operation,\n        StructureShape error,\n        HttpResponseTestCase testCase\n    ) {\n        // Use a compound test_case name so we generate unique tests\n        // for each error on each operation safely. This is useful in validating\n        // that operation parsers are all correctly identifying errors and that\n        // we can test for any operation specific values properly.\n        String testName = testCase.getId() + \":Error:\" + operation.getId().getName();\n        testCase.getDocumentation().ifPresent(writer::writeDocs);\n        openTestBlock(operation, testCase, testName, () -> {\n            writeResponseTestSetup(operation, testCase, false);\n\n            // Invoke the handler and look for the expected exception to then perform assertions.\n            writer\n                .write(\n                    \"\"\"\n                    try {\n                      await client.send(command);\n                    } catch (err) {\n                      if (err.name !== \"$1L\") {\n                        console.log(err);\n                        fail(`Expected a $1L to be thrown, got $${err.name} instead`);\n                        return;\n                      }\n                      const r: any = err;\"\"\",\n                    error.getId().getName()\n                )\n                .indent()\n                .call(() -> writeResponseAssertions(error, testCase))\n                .write(\"return;\")\n                .dedent()\n                .write(\"}\");\n            writer.write(\"fail(\\\"Expected an exception to be thrown from response\\\");\");\n        });\n    }\n\n    private void writeResponseTestSetup(OperationShape operation, HttpResponseTestCase testCase, boolean isSuccess) {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n\n        // Lowercase all the headers we're expecting as this is what we'll get.\n        Map<String, String> headers = testCase\n            .getHeaders()\n            .entrySet()\n            .stream()\n            .map(entry -> new Pair<>(entry.getKey().toLowerCase(Locale.US), entry.getValue()))\n            .collect(MapUtils.toUnmodifiableMap(Pair::getLeft, Pair::getRight));\n        String body = testCase.getBody().orElse(null);\n\n        // Create a client with a custom request handler that intercepts requests.\n        writer.openBlock(\"const client = new $T({\", \"});\\n\", serviceSymbol, () -> {\n            writer.write(\"...clientParams,\");\n            writer.openBlock(\"requestHandler: new ResponseDeserializationTestHandler(\", \"),\", () -> {\n                writer.write(\"$L,\", isSuccess);\n                writer.write(\"$L,\", testCase.getCode());\n                if (headers.isEmpty()) {\n                    writer.write(\"undefined,\");\n                } else {\n                    writer.openBlock(\"{\", \"},\", () -> {\n                        for (Map.Entry<String, String> entry : headers.entrySet()) {\n                            String key = entry.getKey().toLowerCase(Locale.US);\n                            String value = entry.getValue();\n                            writer.write(\"$L: $S,\", PropertyAccessor.inlineKey(key), value);\n                        }\n                    });\n                }\n                if (body != null) {\n                    writer.write(\"`$L`,\", body);\n                }\n                writer.unwrite(\",\\n\").write(\"\");\n            });\n        });\n\n        Collection<MemberShape> httpLabelMembers = model.expectShape(operation.getInputShape())\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(m -> m.hasTrait(HttpLabelTrait.ID))\n            .toList();\n\n        // HTTP bindings are validated client-side in HttpBindingProtocol, but not RpcProtocol.\n        // They do not apply for non-http binding protocols, but it doesn't harm\n        // anything to generate the placeholder.\n        writer.openCollapsibleBlock(\"const params: any = {\", \"};\", !httpLabelMembers.isEmpty(), () -> {\n            for (MemberShape httpLabelMember : httpLabelMembers) {\n                writer.write(\n                    \"\"\"\n                    $L: \"placeholder\",\"\"\",\n                    PropertyAccessor.inlineKey(httpLabelMember.getMemberName())\n                );\n            }\n        });\n        writer.write(\"const command = new $T(params);\\n\", operationSymbol);\n    }\n\n    // Ensure that the serialized response matches the expected response.\n    private void writeResponseAssertions(Shape operationOrError, HttpResponseTestCase testCase) {\n        writer.write(\"expect(r.$$metadata.httpStatusCode).toBe($L);\", testCase.getCode());\n\n        writeResponseParamAssertions(operationOrError, testCase);\n    }\n\n    private void writeRequestParamAssertions(OperationShape operation, HttpRequestTestCase testCase) {\n        ObjectNode params = testCase.getParams();\n        if (!params.isEmpty()) {\n            StructureShape testInputShape = model.expectShape(\n                operation.getInput().orElseThrow(() -> new CodegenException(\"Foo\")),\n                StructureShape.class\n            );\n\n            // Use this trick wrapper to not need more complex trailing comma handling.\n            writer\n                .write(\"const paramsToValidate: any = [\")\n                .indent()\n                .call(() -> params.accept(new CommandOutputNodeVisitor(testInputShape)))\n                .dedent()\n                .write(\"][0];\");\n\n            // Extract a payload binding if present.\n            Optional<HttpBinding> pb = Optional.empty();\n            HttpBindingIndex index = HttpBindingIndex.of(model);\n            List<HttpBinding> payloadBindings = index.getRequestBindings(operation, Location.PAYLOAD);\n            if (!payloadBindings.isEmpty()) {\n                pb = Optional.of(payloadBindings.get(0));\n            }\n            final Optional<HttpBinding> payloadBinding = pb;\n\n            writeParamAssertions(writer, payloadBinding, () -> {\n                // TODO: replace this with a collector from the server config once it's available\n                writer.addImport(\n                    \"streamCollector\",\n                    \"__streamCollector\",\n                    TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER\n                );\n                writer.write(\n                    \"const comparableBlob = await __streamCollector(r[$S]);\",\n                    payloadBinding.get().getMemberName()\n                );\n            });\n        }\n    }\n\n    private void writeResponseParamAssertions(Shape operationOrError, HttpResponseTestCase testCase) {\n        ObjectNode params = testCase.getParams();\n        if (!params.isEmpty()) {\n            StructureShape testOutputShape;\n            if (operationOrError.isStructureShape()) {\n                testOutputShape = operationOrError.asStructureShape().get();\n            } else {\n                testOutputShape = model.expectShape(\n                    operationOrError\n                        .asOperationShape()\n                        .get()\n                        .getOutput()\n                        .orElseThrow(() -> new CodegenException(\"Foo\")),\n                    StructureShape.class\n                );\n            }\n\n            // Use this trick wrapper to not need more complex trailing comma handling.\n            writer\n                .write(\"const paramsToValidate: any = [\")\n                .indent()\n                .call(() -> params.accept(new CommandOutputNodeVisitor(testOutputShape)))\n                .dedent()\n                .write(\"][0];\");\n\n            // Extract a payload binding if present.\n            Optional<HttpBinding> payloadBinding = operationOrError\n                .asOperationShape()\n                .map(operationShape -> {\n                    HttpBindingIndex index = HttpBindingIndex.of(model);\n                    List<HttpBinding> payloadBindings =\n                        index.getResponseBindings(operationOrError, Location.PAYLOAD);\n                    if (!payloadBindings.isEmpty()) {\n                        return payloadBindings.get(0);\n                    }\n                    return null;\n                });\n\n            writeParamAssertions(writer, payloadBinding, () -> {\n                writer.write(\n                    \"const comparableBlob = await client.config.streamCollector(r[$S]);\",\n                    payloadBinding.get().getMemberName()\n                );\n            });\n        }\n    }\n\n    private void writeParamAssertions(\n        TypeScriptWriter writer,\n        Optional<HttpBinding> payloadBinding,\n        Runnable writeComparableBlob\n    ) {\n        // If we have a streaming payload blob, we need to collect it to something that\n        // can be compared with the test contents. This emulates the customer experience.\n        boolean hasStreamingPayloadBlob = payloadBinding\n            .map(\n                binding -> model\n                    .getShape(binding.getMember().getTarget())\n                    .filter(Shape::isBlobShape)\n                    .filter(s -> s.hasTrait(StreamingTrait.ID))\n                    .isPresent()\n            )\n            .orElse(false);\n\n        if (hasStreamingPayloadBlob) {\n            writeComparableBlob.run();\n        }\n\n        // Perform parameter comparisons.\n        writer.openBlock(\"Object.keys(paramsToValidate).forEach((param) => {\", \"});\", () -> {\n            writer.write(\n                \"\"\"\n                expect(\n                  r[param],\n                  `The output field $${param} should have been defined in $${JSON.stringify(r, null, 2)}`\n                ).toBeDefined();\"\"\"\n            );\n            if (hasStreamingPayloadBlob) {\n                writer.openBlock(\n                    \"if (param === $S) {\",\n                    \"} else {\",\n                    payloadBinding.get().getMemberName(),\n                    () -> writer.write(\n                        \"\"\"\n                        expect(equivalentContents(paramsToValidate[param], \\\n                        comparableBlob)).toBe(true);\n                        \"\"\"\n                    )\n                );\n                writer.indent();\n            }\n\n            writer.write(\"expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true);\");\n\n            if (hasStreamingPayloadBlob) {\n                writer.dedent();\n                writer.write(\"}\");\n            }\n        });\n    }\n\n    private void openTestBlock(OperationShape operation, HttpMessageTestCase testCase, String testName, Runnable f) {\n        String timeout = testCase.hasTag(SERDE_BENCHMARK_TAG) ? \", BENCHMARK_TIMEOUT\" : \"\";\n\n        // Skipped tests are still generated, just not run.\n        if (testFilter.skip(service, operation, testCase, settings)) {\n            writer.openBlock(\"it.skip($S, async () => {\", testName);\n        } else {\n            writer.openBlock(\"it($S, async () => {\", testName);\n        }\n        f.run();\n        writer.closeBlock(\"}$L);\\n\", timeout);\n    }\n\n    private void openTestBlock(\n        OperationShape operation,\n        HttpMalformedRequestTestCase testCase,\n        String testName,\n        Runnable f\n    ) {\n        String timeout = testCase.hasTag(SERDE_BENCHMARK_TAG) ? \", BENCHMARK_TIMEOUT\" : \"\";\n\n        // Skipped tests are still generated, just not run.\n        if (malformedRequestTestFilter.skip(service, operation, testCase, settings)) {\n            writer.openBlock(\"it.skip($S, async () => {\", testName);\n        } else {\n            writer.openBlock(\"it($S, async () => {\", testName);\n        }\n        f.run();\n        writer.closeBlock(\"}$L);\\n\", timeout);\n    }\n\n    /**\n     * Supports writing out TS specific input types in the generated code\n     * through visiting the target shape at the same time as the node. If\n     * instead we just printed out the node, many values would not match on\n     * type signatures.\n     *\n     * This handles properly generating Set types for Set shapes, Date types\n     * for numbers that are Timestamp shapes, \"undefined\" for nulls, boolean\n     * values, and auto-filling idempotency token Structure members.\n     */\n    private final class CommandInputNodeVisitor implements NodeVisitor<Void> {\n\n        private final StructureShape inputShape;\n        private Shape workingShape;\n        private boolean appendSemicolon;\n\n        private CommandInputNodeVisitor(StructureShape inputShape) {\n            this(inputShape, false);\n        }\n\n        private CommandInputNodeVisitor(StructureShape inputShape, boolean appendSemicolon) {\n            this.inputShape = inputShape;\n            this.workingShape = inputShape;\n            this.appendSemicolon = appendSemicolon;\n        }\n\n        @Override\n        public Void arrayNode(ArrayNode node) {\n            String openElement = \"[\";\n            String closeElement = \"]\";\n\n            // Write the value out directly.\n            writer.openBlock(\"$L\", closeElement + \",\", openElement, () -> {\n                Shape wrapperShape = this.workingShape;\n                node\n                    .getElements()\n                    .forEach(element -> {\n                        // Swap the working shape to the member of the collection.\n                        // This isn't necessary if the shape is a document.\n                        if (wrapperShape instanceof CollectionShape) {\n                            this.workingShape = model.expectShape(\n                                ((CollectionShape) wrapperShape).getMember().getTarget()\n                            );\n                        }\n                        writer.call(() -> element.accept(this));\n                    });\n                this.workingShape = wrapperShape;\n            });\n            return null;\n        }\n\n        @Override\n        public Void booleanNode(BooleanNode node) {\n            // Handle needing to write the boolean's value properly.\n            writer.write(node.getValue() ? \"true,\" : \"false,\");\n            return null;\n        }\n\n        @Override\n        public Void nullNode(NullNode node) {\n            writer.write(\"null,\");\n            return null;\n        }\n\n        @Override\n        public Void numberNode(NumberNode node) {\n            // Handle timestamps needing to be converted from numbers to their input type of Date.\n            // Also handle that a Date in TS takes milliseconds, so add 000 to the end.\n            if (workingShape.isTimestampShape()) {\n                writer.write(\"new Date($L000),\", node.getValue());\n            } else {\n                writer.write(\"$L,\", node.getValue().toString());\n            }\n            return null;\n        }\n\n        @Override\n        public Void objectNode(ObjectNode node) {\n            // Short circuit document types, as the direct value is what we want.\n            if (workingShape.isDocumentShape()) {\n                writer.writeInline(Node.prettyPrintJson(node)).writeInline(\",\");\n                return null;\n            }\n\n            // Both objects and maps can use a majority of the same logic.\n            // Use \"as any\" to have TS complain less about undefined entries.\n            String suffix = \"} as any\";\n\n            // When generating a server response test, we need the top level structure to have a semicolon\n            // rather than a comma.\n            if (appendSemicolon) {\n                suffix += \";\";\n                appendSemicolon = false;\n            } else {\n                suffix += \",\";\n            }\n\n            writer.openBlock(\"{\", suffix, () -> {\n                Shape wrapperShape = this.workingShape;\n                node\n                    .getMembers()\n                    .forEach((keyNode, valueNode) -> {\n                        writer.writeInline(\"$L: \", PropertyAccessor.inlineKey(keyNode.getValue()));\n\n                        // Grab the correct member related to the node member we have.\n                        MemberShape memberShape;\n                        if (wrapperShape.isStructureShape()) {\n                            memberShape = wrapperShape.asStructureShape().get().getMember(keyNode.getValue()).get();\n                        } else if (wrapperShape.isUnionShape()) {\n                            memberShape = wrapperShape.asUnionShape().get().getMember(keyNode.getValue()).get();\n                        } else if (wrapperShape.isMapShape()) {\n                            memberShape = wrapperShape.asMapShape().get().getValue();\n                        } else {\n                            throw new CodegenException(\n                                \"Unknown shape type for object node when \" +\n                                    \"generating protocol test input: \" +\n                                    wrapperShape.getType()\n                            );\n                        }\n\n                        // Handle auto-filling idempotency token values to the explicit value.\n                        if (isIdempotencyTokenWithoutValue(memberShape, valueNode)) {\n                            writer.write(\"\\\"00000000-0000-4000-8000-000000000000\\\",\");\n                        } else {\n                            this.workingShape = model.expectShape(memberShape.getTarget());\n                            writer.call(() -> valueNode.accept(this));\n                        }\n                    });\n                // Check for setting a potentially unspecified member value for the\n                // idempotency token.\n                if (node.getMembers().isEmpty() && wrapperShape.isStructureShape()) {\n                    StructureShape structureShape = wrapperShape.asStructureShape().get();\n                    for (Map.Entry<String, MemberShape> entry : structureShape.getAllMembers().entrySet()) {\n                        if (entry.getValue().hasTrait(IdempotencyTokenTrait.class)) {\n                            writer.write(\"$L: \\\"00000000-0000-4000-8000-000000000000\\\",\", entry.getKey());\n                        }\n                    }\n                }\n                this.workingShape = wrapperShape;\n            });\n            return null;\n        }\n\n        private boolean isIdempotencyTokenWithoutValue(MemberShape memberShape, Node valueNode) {\n            // Short circuit non-tokens.\n            if (!memberShape.hasTrait(IdempotencyTokenTrait.class)) {\n                return false;\n            }\n\n            // Return if the token has a test-specific value.\n            return valueNode.expectStringNode().getValue().isEmpty();\n        }\n\n        @Override\n        public Void stringNode(StringNode node) {\n            // Handle blobs needing to be converted from strings to their input type of UInt8Array.\n            if (workingShape.isBlobShape()) {\n                writer.write(\"Uint8Array.from($S, (c) => c.charCodeAt(0)),\", node.getValue());\n            } else if (workingShape.isFloatShape() || workingShape.isDoubleShape()) {\n                switch (node.getValue()) {\n                    case \"NaN\":\n                        writer.write(\"NaN,\");\n                        break;\n                    case \"Infinity\":\n                        writer.write(\"Infinity,\");\n                        break;\n                    case \"-Infinity\":\n                        writer.write(\"-Infinity,\");\n                        break;\n                    default:\n                        throw new CodegenException(\n                            String.format(\n                                \"Unexpected string value for `%s`: \\\"%s\\\"\",\n                                workingShape.getId(),\n                                node.getValue()\n                            )\n                        );\n                }\n            } else {\n                writer.write(\"$S,\", node.getValue());\n            }\n            return null;\n        }\n    }\n\n    /**\n     * Functional interface for skipping tests.\n     */\n    @FunctionalInterface\n    public interface TestFilter {\n        /**\n         * A function that determines whether or not to skip a test.\n         *\n         * <p>A test might be temporarily skipped if it's a known failure that\n         * will be addressed later, or if the test in question asserts a\n         * serialized message that can have multiple valid forms.\n         *\n         * @param service The service for which tests are being generated.\n         * @param operation The operation for which tests are being generated.\n         * @param testCase The test case in question.\n         * @param settings The settings being used to generate the test service.\n         * @return True if the test should be skipped, false otherwise.\n         */\n        boolean skip(\n            ServiceShape service,\n            OperationShape operation,\n            HttpMessageTestCase testCase,\n            TypeScriptSettings settings\n        );\n    }\n\n    /**\n     * Functional interface for skipping malformed request tests.\n     */\n    @FunctionalInterface\n    public interface MalformedRequestTestFilter {\n        /**\n         * A function that determines whether or not to skip a malformed request test.\n         *\n         * <p>A test might be temporarily skipped if it's a known failure that\n         * will be addressed later, or if the test in question asserts a\n         * serialized message that can have multiple valid forms.\n         *\n         * @param service The service for which tests are being generated.\n         * @param operation The operation for which tests are being generated.\n         * @param testCase The malformed request test case in question.\n         * @param settings The settings being used to generate the test service.\n         * @return True if the test should be skipped, false otherwise.\n         */\n        boolean skip(\n            ServiceShape service,\n            OperationShape operation,\n            HttpMalformedRequestTestCase testCase,\n            TypeScriptSettings settings\n        );\n    }\n\n    /**\n     * Supports writing out TS specific output types in the generated code\n     * through visiting the target shape at the same time as the node. If\n     * instead we just printed out the node, many values would not match on\n     * type signatures.\n     *\n     * This handles properly generating Date types for numbers that are\n     * Timestamp shapes, downcasing prefix headers, boolean values, Uint8Array\n     * types for blobs, and error Message field standardization.\n     */\n    private final class CommandOutputNodeVisitor implements NodeVisitor<Void> {\n\n        private final StructureShape outputShape;\n        private Shape workingShape;\n\n        private CommandOutputNodeVisitor(StructureShape outputShape) {\n            this.outputShape = outputShape;\n            this.workingShape = outputShape;\n        }\n\n        @Override\n        public Void arrayNode(ArrayNode node) {\n            String openElement = \"[\";\n            String closeElement = \"]\";\n\n            // Write the value out directly.\n            writer.openBlock(\"$L\", closeElement + \",\", openElement, () -> {\n                Shape wrapperShape = this.workingShape;\n                node\n                    .getElements()\n                    .forEach(element -> {\n                        // Swap the working shape to the member of the collection.\n                        // This isn't necessary if the shape is a document.\n                        if (wrapperShape instanceof CollectionShape) {\n                            this.workingShape = model.expectShape(\n                                ((CollectionShape) wrapperShape).getMember().getTarget()\n                            );\n                        }\n                        writer.call(() -> element.accept(this));\n                    });\n                this.workingShape = wrapperShape;\n            });\n            return null;\n        }\n\n        @Override\n        public Void booleanNode(BooleanNode node) {\n            // Handle needing to write the boolean's value properly.\n            writer.write(node.getValue() ? \"true,\" : \"false,\");\n            return null;\n        }\n\n        @Override\n        public Void nullNode(NullNode node) {\n            // Nulls on the wire are nulls in parsed content.\n            writer.write(\"null,\");\n            return null;\n        }\n\n        @Override\n        public Void numberNode(NumberNode node) {\n            // Handle timestamps needing to be converted from numbers to their input type of Date.\n            // Also handle that a Date in TS takes milliseconds, so add * 1000 to the end.\n            if (workingShape.isTimestampShape()) {\n                writer.write(\"new Date($L * 1000),\", node.getValue());\n            } else {\n                writer.write(\"$L,\", node.getValue().toString());\n            }\n            return null;\n        }\n\n        @Override\n        public Void objectNode(ObjectNode node) {\n            // Short circuit document types, as the direct value is what we want.\n            if (workingShape.isDocumentShape()) {\n                writer.writeInline(Node.prettyPrintJson(node)).writeInline(\",\");\n                return null;\n            }\n\n            // Both objects and maps can use a majority of the same logic.\n            // Use \"as any\" to have TS complain less about undefined entries.\n            writer.openBlock(\"{\", \"},\", () -> {\n                Shape wrapperShape = this.workingShape;\n                node\n                    .getMembers()\n                    .forEach((keyNode, valueNode) -> {\n                        // Grab the correct member related to the node member we have.\n                        MemberShape memberShape;\n                        if (wrapperShape.isStructureShape()) {\n                            memberShape = wrapperShape.asStructureShape().get().getMember(keyNode.getValue()).get();\n                        } else if (wrapperShape.isUnionShape()) {\n                            memberShape = wrapperShape.asUnionShape().get().getMember(keyNode.getValue()).get();\n                        } else if (wrapperShape.isMapShape()) {\n                            memberShape = wrapperShape.asMapShape().get().getValue();\n                        } else {\n                            throw new CodegenException(\n                                \"Unknown shape type for object node when \" +\n                                    \"generating protocol test output: \" +\n                                    wrapperShape.getType()\n                            );\n                        }\n\n                        // Handle error standardization to the down-cased \"message\".\n                        String validationName = keyNode.getValue();\n                        if (wrapperShape.hasTrait(ErrorTrait.class) && validationName.equals(\"Message\")) {\n                            validationName = \"message\";\n                        }\n                        writer.writeInline(\"$L: \", PropertyAccessor.inlineKey(validationName));\n\n                        this.workingShape = model.expectShape(memberShape.getTarget());\n                        // Alter valueNode to downcase keys if it's a map for prefixHeaders.\n                        // This is an enforced behavior of the fetch handler.\n                        Node renderNode = memberShape.hasTrait(HttpPrefixHeadersTrait.class)\n                            ? downcaseNodeKeys(valueNode.expectObjectNode())\n                            : valueNode;\n                        writer.call(() -> renderNode.accept(this));\n                    });\n                this.workingShape = wrapperShape;\n            });\n            return null;\n        }\n\n        private ObjectNode downcaseNodeKeys(ObjectNode startingNode) {\n            ObjectNode downcasedNode = Node.objectNode();\n            for (Map.Entry<StringNode, Node> entry : startingNode.getMembers().entrySet()) {\n                downcasedNode = downcasedNode.withMember(\n                    entry.getKey().getValue().toLowerCase(Locale.US),\n                    entry.getValue()\n                );\n            }\n            return downcasedNode;\n        }\n\n        @Override\n        public Void stringNode(StringNode node) {\n            // Handle blobs needing to be converted from strings to their input type of UInt8Array.\n            if (workingShape.isBlobShape()) {\n                writer.write(\"Uint8Array.from($S, (c) => c.charCodeAt(0)),\", node.getValue());\n            } else if (workingShape.isFloatShape() || workingShape.isDoubleShape()) {\n                switch (node.getValue()) {\n                    case \"NaN\":\n                        writer.write(\"NaN,\");\n                        break;\n                    case \"Infinity\":\n                        writer.write(\"Infinity,\");\n                        break;\n                    case \"-Infinity\":\n                        writer.write(\"-Infinity,\");\n                        break;\n                    default:\n                        throw new CodegenException(\n                            String.format(\n                                \"Unexpected string value for `%s`: \\\"%s\\\"\",\n                                workingShape.getId(),\n                                node.getValue()\n                            )\n                        );\n                }\n            } else {\n                writer.write(\"$S,\", node.getValue());\n            }\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ImportDeclarations.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.io.File;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.TreeSet;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.ImportContainer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.utils.Pair;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Internal class used for aggregating imports of a file.\n */\n@SmithyInternalApi\nfinal class ImportDeclarations implements ImportContainer {\n\n    /**\n     * External package first, relative last, otherwise by case-insensitive alphabetical ordering.\n     */\n    private static final Comparator<String> MODULES_ORDERING = (a, b) -> {\n        if (a.startsWith(\".\") && !b.startsWith(\".\")) {\n            return 1;\n        }\n        if (!a.startsWith(\".\") && b.startsWith(\".\")) {\n            return -1;\n        }\n        if (a.equalsIgnoreCase(b)) {\n            return a.compareTo(b);\n        }\n        return a.toLowerCase().compareTo(b.toLowerCase());\n    };\n\n    /**\n     * Type imports first, otherwise by symbol name, case-insensitively, ignoring alias.\n     */\n    private static final Comparator<String> IMPORTS_ORDERING = (a, b) -> {\n        boolean aType = a.startsWith(\"type \");\n        boolean bType = b.startsWith(\"type \");\n        if (aType && !bType) {\n            return -1;\n        }\n        if (!aType && bType) {\n            return 1;\n        }\n        String normalA = a.replaceAll(\"(^type )|( as (.*?)$)\", \"\").toLowerCase();\n        String normalB = b.replaceAll(\"(^type )|( as (.*?)$)\", \"\").toLowerCase();\n        if (normalA.equals(normalB)) {\n            return a.compareTo(b);\n        }\n        return normalA.compareTo(normalB);\n    };\n\n    private final String moduleNameString;\n    private final String relativize;\n    private final Map<String, Pair<String, Ignore>> defaultImports = new TreeMap<>();\n    private final Map<String, Map<String, String>> namedImports = new TreeMap<>();\n    private final Map<String, Map<String, String>> namedTypeImports = new TreeMap<>();\n\n    ImportDeclarations(String relativize) {\n        relativize = relativize.replace(File.separatorChar, '/');\n        if (!relativize.startsWith(\"./\")) {\n            relativize = \"./\" + relativize;\n        }\n        this.moduleNameString = relativize;\n\n        // Strip off the filename of what's being relativized since it isn't needed.\n        Path relativizePath = Paths.get(relativize).getParent();\n        if (relativizePath == null) {\n            this.relativize = null;\n        } else {\n            this.relativize = relativizePath.toString().replace(File.separatorChar, '/');\n        }\n    }\n\n    ImportDeclarations addDefaultImport(String name, String module) {\n        return addDefaultImport(name, module, Ignore.notIgnored());\n    }\n\n    ImportDeclarations addIgnoredDefaultImport(String name, String module, String reason) {\n        return addDefaultImport(name, module, Ignore.ignored(reason));\n    }\n\n    private ImportDeclarations addDefaultImport(String name, String module, Ignore ignore) {\n        module = getRelativizedModule(relativize, module);\n\n        if (!module.isEmpty() && (relativize == null || !module.equals(relativize.toString()))) {\n            defaultImports.put(module, new Pair<>(name, ignore));\n        }\n\n        return this;\n    }\n\n    ImportDeclarations addImport(String name, String alias, String module) {\n        if (alias == null || alias.isEmpty()) {\n            alias = name;\n        }\n        module = getRelativizedModule(relativize, module);\n        if (!module.isEmpty() && (relativize == null || !module.equals(relativize.toString()))) {\n            namedImports.computeIfAbsent(module, m -> new TreeMap<>()).put(alias, name);\n        }\n        return this;\n    }\n\n    ImportDeclarations addTypeImport(String name, String alias, String module) {\n        if (alias == null || alias.isEmpty()) {\n            alias = name;\n        }\n        module = getRelativizedModule(relativize, module);\n        if (!module.isEmpty() && (relativize == null || !module.equals(relativize.toString()))) {\n            namedTypeImports.computeIfAbsent(module, m -> new TreeMap<>()).put(alias, name);\n        }\n        return this;\n    }\n\n    @Override\n    public void importSymbol(Symbol symbol, String alias) {\n        if (!symbol.getNamespace().isEmpty() && !symbol.getNamespace().equals(moduleNameString)) {\n            if (\n                symbol\n                    .getProperty(\"typeOnly\")\n                    .map(o -> (Boolean) o)\n                    .orElse(false)\n            ) {\n                addTypeImport(symbol.getName(), alias, symbol.getNamespace());\n            } else {\n                addImport(symbol.getName(), alias, symbol.getNamespace());\n            }\n        }\n    }\n\n    @Override\n    public String toString() {\n        StringBuilder result = new StringBuilder();\n\n        if (!defaultImports.isEmpty()) {\n            for (Map.Entry<String, Pair<String, Ignore>> importEntry : defaultImports.entrySet()) {\n                boolean ignore = importEntry.getValue().getRight().ignore;\n                if (ignore) {\n                    result.append(\"// @ts-ignore: \").append(importEntry.getValue().getRight().reason).append(\"\\n\");\n                }\n                result\n                    .append(\"import \")\n                    .append(importEntry.getValue().getLeft())\n                    .append(\" from \\\"\")\n                    .append(importEntry.getKey())\n                    .append(\"\\\";\");\n                if (ignore) {\n                    result.append(\" // eslint-disable-line\");\n                }\n                result.append('\\n');\n            }\n            result.append('\\n');\n        }\n\n        createImports(namedImports, namedTypeImports, result);\n\n        return result.toString();\n    }\n\n    private static void createImports(\n        Map<String, Map<String, String>> namedImports,\n        Map<String, Map<String, String>> namedTypeImports,\n        StringBuilder buffer\n    ) {\n        TreeSet<String> mergedModuleKeys = new TreeSet<>(MODULES_ORDERING);\n        mergedModuleKeys.addAll(namedImports.keySet());\n        mergedModuleKeys.addAll(namedTypeImports.keySet());\n\n        // separate non-relative and relative imports.\n        long separatorIndex = mergedModuleKeys\n            .stream()\n            .filter(k -> !k.startsWith(\".\"))\n            .count();\n        int i = 0;\n        boolean needsSeparator = separatorIndex > 0 && separatorIndex < mergedModuleKeys.size();\n\n        for (String module : mergedModuleKeys) {\n            if (i++ == separatorIndex && needsSeparator) {\n                buffer.append(\"\\n\");\n            }\n            Map<String, String> moduleImports = namedImports.getOrDefault(module, Collections.emptyMap());\n            Map<String, String> typeImports = namedTypeImports.getOrDefault(module, Collections.emptyMap());\n\n            TreeSet<String> mergedSymbolKeys = new TreeSet<>();\n            mergedSymbolKeys.addAll(moduleImports.keySet());\n            mergedSymbolKeys.addAll(typeImports.keySet());\n\n            Set<String> imports = new TreeSet<>(IMPORTS_ORDERING);\n\n            for (String alias : mergedSymbolKeys) {\n                String runtimeSymbol = moduleImports.get(alias);\n                String typeSymbol = typeImports.get(alias);\n\n                // \"*\" imports are not supported https://github.com/smithy-lang/smithy-typescript/issues/211\n                if (\"*\".equals(runtimeSymbol) || \"*\".equals(typeSymbol)) {\n                    throw new CodegenException(\n                        \"Star imports are not supported, attempted for \" + module\n                            + \". Use default import instead.\"\n                    );\n                }\n\n                if (runtimeSymbol != null) {\n                    if (!alias.equals(runtimeSymbol)) {\n                        imports.add(\"%s as %s\".formatted(runtimeSymbol, alias));\n                    } else {\n                        imports.add(runtimeSymbol);\n                    }\n                } else if (typeSymbol != null) {\n                    if (!alias.equals(typeSymbol)) {\n                        imports.add(\"type %s as %s\".formatted(typeSymbol, alias));\n                    } else {\n                        imports.add(\"type \" + typeSymbol);\n                    }\n                }\n            }\n\n            if (!imports.isEmpty()) {\n                String inline;\n                String multiline;\n\n                String head;\n                String symbols;\n                String tail = \"\\\";\\n\";\n                boolean allImportsAreTypes = imports.stream().allMatch(s -> s.startsWith(\"type \"));\n                {\n                    head = \"import { \";\n                    symbols = String.join(\", \", imports);\n                    String source = \" } from \\\"\" + module;\n                    if (allImportsAreTypes) {\n                        head = head.replace(\"import \", \"import type \");\n                        symbols = symbols.replaceAll(\"type \", \"\");\n                    }\n                    inline = head + symbols + source + tail;\n                }\n                {\n                    head = \"import {\\n  \";\n                    symbols = String.join(\",\\n  \", imports);\n                    String source = \",\\n} from \\\"\" + module;\n                    if (allImportsAreTypes) {\n                        head = head.replace(\"import \", \"import type \");\n                        symbols = symbols.replaceAll(\"type \", \"\");\n                    }\n                    multiline = head + symbols + source + tail;\n                }\n                if (inline.trim().length() <= TypeScriptWriter.LINE_WIDTH) {\n                    buffer.append(inline);\n                } else {\n                    buffer.append(multiline);\n                }\n            }\n        }\n        if (!namedImports.isEmpty() || !namedTypeImports.isEmpty()) {\n            buffer.append(\"\\n\");\n        }\n    }\n\n    private static String getRelativizedModule(String relativize, String module) {\n        if (relativize != null && module.startsWith(\".\")) {\n            // A relative import is resolved against the current file.\n            Path relativizePath = Paths.get(relativize);\n            module = relativizePath.relativize(Paths.get(module)).toString().replace(File.separatorChar, '/');\n            if (!module.startsWith(\".\")) {\n                module = \"./\" + module;\n            }\n        }\n        return module;\n    }\n\n    private static final class Ignore {\n\n        final boolean ignore;\n        final String reason;\n\n        private Ignore(boolean ignore, String reason) {\n            this.ignore = ignore;\n            this.reason = reason;\n        }\n\n        static Ignore notIgnored() {\n            return new Ignore(false, null);\n        }\n\n        static Ignore ignored(String reason) {\n            return new Ignore(true, reason);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/IndexGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.List;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.DocumentationTrait;\nimport software.amazon.smithy.model.traits.PaginatedTrait;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist;\nimport software.amazon.smithy.typescript.codegen.validation.ReplaceLast;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.waiters.WaitableTrait;\n\n/**\n * Generates an index to export the service client and each command.\n */\n@SmithyInternalApi\nfinal class IndexGenerator {\n\n    private IndexGenerator() {}\n\n    static void writeIndex(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        ProtocolGenerator protocolGenerator,\n        TypeScriptWriter writer,\n        TypeScriptWriter modelIndexer\n    ) {\n        writer.write(\"/* eslint-disable */\");\n        settings\n            .getService(model)\n            .getTrait(DocumentationTrait.class)\n            .ifPresent(trait -> writer.writeDocs(trait.getValue() + \"\\n\\n\" + \"@packageDocumentation\"));\n\n        if (settings.generateClient()) {\n            writeClientExports(settings, model, symbolProvider, writer);\n        }\n\n        if (settings.generateServerSdk() && protocolGenerator != null) {\n            writeProtocolExports(protocolGenerator, writer);\n            writer.write(\"export * from \\\"./server/index\\\";\");\n        }\n\n        // write export statement for models\n        writer.write(\n            // the header comment is already present in the upper writer.\n            modelIndexer.toString().replace(\"// smithy-typescript generated code\", \"\")\n        );\n    }\n\n    private static void writeProtocolExports(ProtocolGenerator protocolGenerator, TypeScriptWriter writer) {\n        String protocolName = ProtocolGenerator.getSanitizedName(protocolGenerator.getName());\n        writer.write(\"export * as $L from \\\"./protocols/$L\\\";\", protocolName, protocolName);\n    }\n\n    static void writeServerIndex(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        FileManifest fileManifest\n    ) {\n        TypeScriptWriter writer = new TypeScriptWriter(\"\");\n        ServiceShape service = settings.getService(model);\n        Symbol symbol = symbolProvider.toSymbol(service);\n\n        // Write export statement for operations.\n        writer.write(\"export * from \\\"./operations\\\";\");\n\n        writer.write(\"export * from \\\"./$L\\\"\", symbol.getName());\n        fileManifest.writeFile(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, ServerSymbolVisitor.SERVER_FOLDER, \"index.ts\").toString(),\n            writer.toString()\n        );\n    }\n\n    private static void writeClientExports(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        ServiceShape service = settings.getService(model);\n        Symbol symbol = symbolProvider.toSymbol(service);\n        // Normalizes client name, e.g. WeatherClient => Weather\n        String normalizedClientName = ReplaceLast.in(symbol.getName(), \"Client\", \"\");\n\n        // Write export statement for bare-bones client.\n        writer.write(\"export * from \\\"./$L\\\";\", symbol.getName());\n\n        // Write export statement for aggregated client.\n        writer.write(\"export * from \\\"./$L\\\";\", normalizedClientName);\n\n        // export endpoints config interface\n        writer.write(\"export type { ClientInputEndpointParameters } from \\\"./endpoint/EndpointParameters\\\";\");\n\n        // Export Runtime Extension and Client ExtensionConfiguration interfaces\n        writer.write(\"export type { RuntimeExtension } from \\\"./runtimeExtensions\\\";\");\n        writer.write(\n            \"export type { $LExtensionConfiguration } from \\\"./extensionConfiguration\\\";\",\n            normalizedClientName\n        );\n\n        // Write export statement for commands.\n        writer.write(\n            \"\"\"\n            export * from \"./commands\";\"\"\"\n        );\n        if (SchemaGenerationAllowlist.allows(service.getId(), settings)) {\n            writer.write(\n                \"\"\"\n                export * from \"./schemas/schemas_0\";\"\"\"\n            );\n        }\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        List<OperationShape> operations = new ArrayList<OperationShape>();\n        operations.addAll(topDownIndex.getContainedOperations(service));\n\n        // Export pagination, if present.\n        if (operations.stream().anyMatch(operation -> operation.hasTrait(PaginatedTrait.ID))) {\n            writer.write(\"export * from \\\"./pagination\\\";\");\n        }\n\n        // Export waiters, if present.\n        if (operations.stream().anyMatch(operation -> operation.hasTrait(WaitableTrait.ID))) {\n            writer.write(\"export * from \\\"./waiters\\\";\");\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/IntEnumGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.Comparator;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.shapes.IntEnumShape;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates an appropriate TypeScript type from a Smithy intEnum shape.\n *\n * <p>For example, given the following Smithy model:</p>\n *\n * <pre>{@code\n * intEnum FaceCard {\n *     JACK = 1\n *     QUEEN = 2\n *     KING = 3\n * }\n * }</pre>\n *\n * <p>We will generate the following:\n *\n * <pre>{@code\n * export enum FaceCard {\n *   JACK = 1,\n *   QUEEN = 2,\n *   KING = 3,\n * }\n * }</pre>\n *\n * <p>Shapes that refer to this intEnum as a member will use the following\n * generated code:\n *\n * <pre>{@code\n * import { FaceCard } from \"./FaceCard\";\n *\n * interface MyStructure {\n *   \"facecard\": FaceCard;\n * }\n * }</pre>\n */\n@SmithyInternalApi\nfinal class IntEnumGenerator implements Runnable {\n\n    private final Symbol symbol;\n    private final IntEnumShape shape;\n    private final TypeScriptWriter writer;\n\n    IntEnumGenerator(IntEnumShape shape, Symbol symbol, TypeScriptWriter writer) {\n        this.shape = shape;\n        this.symbol = symbol;\n        this.writer = writer;\n    }\n\n    @Override\n    public void run() {\n        generateIntEnum();\n    }\n\n    private void generateIntEnum() {\n        writer.openBlock(\"export enum $L {\", \"}\", symbol.getName(), () -> {\n            // Sort by the values to ensure a stable order and sane diffs.\n            shape\n                .getEnumValues()\n                .entrySet()\n                .stream()\n                .sorted(Comparator.comparing(e -> e.getValue()))\n                .forEach(this::writeIntEnumEntry);\n        });\n    }\n\n    private void writeIntEnumEntry(Map.Entry<String, Integer> entry) {\n        writer.write(\"$L = $L,\", TypeScriptUtils.sanitizePropertyName(entry.getKey()), entry.getValue());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/LanguageTarget.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Represents a possible language target that can be generated.\n */\n@SmithyUnstableApi\npublic enum LanguageTarget {\n    /**\n     * Node-specific language target.\n     */\n    NODE {\n        @Override\n        String getTemplateFileName() {\n            return \"runtimeConfig.ts.template\";\n        }\n    },\n\n    /**\n     * Browser-specific language target.\n     */\n    BROWSER {\n        @Override\n        String getTemplateFileName() {\n            return \"runtimeConfig.browser.ts.template\";\n        }\n    },\n\n    /**\n     * ReactNative-specific language target.\n     * Note: ReactNative target extends from Browser target. You only need to add\n     * ReactNative dependencies if they are different to Browser dependencies.\n     */\n    REACT_NATIVE {\n        @Override\n        String getTemplateFileName() {\n            return \"runtimeConfig.native.ts.template\";\n        }\n    },\n\n    /**\n     * A language target that shares configuration that is shared across all\n     * runtimes.\n     */\n    SHARED {\n        @Override\n        String getTemplateFileName() {\n            return \"runtimeConfig.shared.ts.template\";\n        }\n    };\n\n    abstract String getTemplateFileName();\n\n    String getTargetFilename() {\n        return Paths.get(CodegenUtils.SOURCE_FOLDER, getTemplateFileName().replace(\".template\", \"\")).toString();\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageApiValidationGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.traits.EnumTrait;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * This class generates a runnable pair of test files\n * that demonstrates the exportable components of the generated client\n * are accounted for.\n */\n@SmithyInternalApi\npublic final class PackageApiValidationGenerator {\n\n    private final TypeScriptWriter writer;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final ServiceClosure closure;\n\n    public PackageApiValidationGenerator(\n        TypeScriptWriter writer,\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider\n    ) {\n        this.writer = writer;\n        this.settings = settings;\n        this.model = model;\n        this.symbolProvider = symbolProvider;\n        closure = ServiceClosure.of(model, settings.getService(model));\n    }\n\n    /**\n     * Code written by this method is types-only TypeScript.\n     */\n    public void writeTypeIndexTest() {\n        writer.openBlock(\"\"\"\n                         export type {\"\"\", \"\"\"\n                                           } from \"../dist-types/index.d\";\"\"\", () -> {\n            // exportable types include:\n\n            // the barebones client\n            String aggregateClientName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n            writer.write(\"$L\", aggregateClientName + \"Client,\");\n\n            // the aggregate client\n            writer.write(aggregateClientName + \",\");\n\n            // all commands\n            Set<OperationShape> containedOperations = TopDownIndex.of(model)\n                .getContainedOperations(\n                    settings.getService()\n                );\n            for (OperationShape operation : containedOperations) {\n                String commandName = symbolProvider.toSymbol(operation).getName();\n                writer.write(\"$L,\", commandName);\n                writer.write(\"$LInput,\", commandName);\n                writer.write(\"$LOutput,\", commandName);\n            }\n\n            // enums\n            TreeSet<Shape> enumShapes = closure.getEnums();\n            for (Shape enumShape : enumShapes) {\n                writer.write(\"$L,\", symbolProvider.toSymbol(enumShape).getName());\n            }\n\n            // structure & union types & modeled errors\n            TreeSet<Shape> structuralShapes = closure.getStructuralNonErrorShapes();\n            for (Shape structuralShape : structuralShapes) {\n                writer.write(\"$L,\", symbolProvider.toSymbol(structuralShape).getName());\n            }\n\n            TreeSet<Shape> errorShapes = closure.getErrorShapes();\n            for (Shape errorShape : errorShapes) {\n                writer.write(\"$L,\", symbolProvider.toSymbol(errorShape).getName());\n            }\n\n            // synthetic base exception\n            String baseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(aggregateClientName, model);\n            writer.write(\"$L,\", baseExceptionName);\n\n            // waiters\n            closure\n                .getWaiterNames()\n                .forEach(waiter -> {\n                    writer.write(\"$L,\", waiter);\n                });\n            // paginators\n            closure\n                .getPaginatorNames()\n                .forEach(paginator -> {\n                    writer.write(\"$L,\", paginator);\n                });\n        });\n    }\n\n    /**\n     * Code written by this method is pure JavaScript (CJS).\n     */\n    public void writeRuntimeIndexTest() {\n        boolean schemaMode = SchemaGenerationAllowlist.allows(settings.getService(), settings);\n\n        writer.write(\n            \"\"\"\n            import assert from \"node:assert\";\"\"\"\n        );\n        // runtime components include:\n\n        Path cjsIndex = Paths.get(\"./dist-cjs/index.js\");\n\n        // the barebones client\n        String aggregateClientName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n        writer.addRelativeImport(aggregateClientName + \"Client\", null, cjsIndex);\n        writer.addRelativeImport(aggregateClientName, null, cjsIndex);\n\n        // the aggregate client\n        writer.write(\"// clients\");\n        writer.write(\n            \"\"\"\n            assert(typeof $L === \"function\");\"\"\",\n            aggregateClientName + \"Client\"\n        );\n        writer.write(\n            \"\"\"\n            assert(typeof $L === \"function\");\"\"\",\n            aggregateClientName\n        );\n\n        // all commands\n        writer.write(\"// commands\");\n        Set<OperationShape> containedOperations = TopDownIndex.of(model).getContainedOperations(settings.getService());\n        for (OperationShape operation : containedOperations) {\n            Symbol operationSymbol = symbolProvider.toSymbol(operation);\n            writer.addRelativeImport(operationSymbol.getName(), null, cjsIndex);\n            writer.write(\n                \"\"\"\n                assert(typeof $L === \"function\");\"\"\",\n                operationSymbol.getName()\n            );\n            if (schemaMode) {\n                String schemaVarName = closure.getShapeSchemaVariableName(operation, null);\n                writer.addRelativeImport(schemaVarName, null, cjsIndex);\n                writer.write(\n                    \"\"\"\n                    assert(typeof $L === \"object\");\"\"\",\n                    schemaVarName\n                );\n            }\n        }\n\n        // structure & union types & modeled errors\n        writer.write(\"// structural schemas\");\n        TreeSet<Shape> structuralShapes = closure.getStructuralNonErrorShapes();\n        for (Shape structuralShape : structuralShapes) {\n            if (schemaMode) {\n                String schemaVarName = closure.getShapeSchemaVariableName(structuralShape, null);\n                writer.addRelativeImport(schemaVarName, null, cjsIndex);\n                writer.write(\n                    \"\"\"\n                    assert(typeof $L === \"object\");\"\"\",\n                    schemaVarName\n                );\n            }\n        }\n\n        // enums\n\n        // string shapes with enum trait do not generate anything if\n        // any enum value does not have a name.\n        TreeSet<Shape> enumShapes = closure\n            .getEnums()\n            .stream()\n            .filter(shape -> shape.getTrait(EnumTrait.class).map(EnumTrait::hasNames).orElse(true))\n            .collect(TreeSet::new, Set::add, Set::addAll);\n\n        if (!enumShapes.isEmpty()) {\n            writer.write(\"// enums\");\n        }\n        for (Shape enumShape : enumShapes) {\n            Symbol enumSymbol = symbolProvider.toSymbol(enumShape);\n            writer.addRelativeImport(enumSymbol.getName(), null, cjsIndex);\n            writer.write(\n                \"\"\"\n                assert(typeof $L === \"object\");\"\"\",\n                enumSymbol.getName()\n            );\n        }\n\n        String baseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(aggregateClientName, model);\n\n        // modeled errors and synthetic base error\n        writer.write(\"// errors\");\n        TreeSet<Shape> errors = closure.getErrorShapes();\n        for (Shape error : errors) {\n            Symbol errorSymbol = symbolProvider.toSymbol(error);\n            writer.addRelativeImport(errorSymbol.getName(), null, cjsIndex);\n            writer.write(\"assert($L.prototype instanceof $L);\", errorSymbol.getName(), baseExceptionName);\n            if (schemaMode) {\n                String schemaVarName = closure.getShapeSchemaVariableName(error, null);\n                writer.addRelativeImport(schemaVarName, null, cjsIndex);\n                writer.write(\n                    \"\"\"\n                    assert(typeof $L === \"object\");\"\"\",\n                    schemaVarName\n                );\n            }\n        }\n        writer.addRelativeImport(baseExceptionName, null, cjsIndex);\n        writer.write(\"assert($L.prototype instanceof Error);\", baseExceptionName);\n\n        // waiters & paginators\n        TreeSet<String> waiterNames = closure.getWaiterNames();\n        if (!waiterNames.isEmpty()) {\n            writer.write(\"// waiters\");\n        }\n        waiterNames.forEach(waiter -> {\n            writer.addRelativeImport(waiter, null, cjsIndex);\n            writer.write(\n                \"\"\"\n                assert(typeof $L === \"function\");\"\"\",\n                waiter\n            );\n        });\n        TreeSet<String> paginatorNames = closure.getPaginatorNames();\n        if (!paginatorNames.isEmpty()) {\n            writer.write(\"// paginators\");\n        }\n        paginatorNames.forEach(paginator -> {\n            writer.addRelativeImport(paginator, null, cjsIndex);\n            writer.write(\n                \"\"\"\n                assert(typeof $L === \"function\");\"\"\",\n                paginator\n            );\n        });\n\n        writer.write(\"console.log(`$L index test passed.`);\", aggregateClientName);\n    }\n\n    /**\n     * Creates a vitest framework snapshot test for an SDK client.\n     */\n    @SmithyInternalApi\n    public void writeSnapshotTest() {\n        writer.addImport(\"SnapshotRunner\", null, TypeScriptDependency.SNAPSHOTS);\n        writer.addImport(\"describe\", null, TypeScriptDependency.VITEST);\n        writer.addImport(\"vi\", null, TypeScriptDependency.VITEST);\n        writer.addImport(\"test\", \"it\", TypeScriptDependency.VITEST);\n        writer.addImport(\"expect\", null, TypeScriptDependency.VITEST);\n        writer.addImport(\"join\", null, \"node:path\");\n\n        String aggregateClientName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n        String clientName = aggregateClientName + \"Client\";\n\n        Path srcIndex = Paths.get(\".\", CodegenUtils.SOURCE_FOLDER);\n        writer.addRelativeImport(\n            clientName,\n            null,\n            srcIndex\n        );\n\n        writer.write(\"\"\"\n                     vi.setSystemTime(new Date(946702799999));\n                     const Client = $L;\n                     \"\"\", clientName);\n\n        writer.openBlock(\n            \"\"\"\n            const mode = (process.env.SNAPSHOT_MODE as \"write\" | \"compare\") ?? \"write\";\n\n            describe($S + ` ($${mode})`, () => {\n              const runner = new SnapshotRunner({\n                snapshotDirPath: join(__dirname, \"snapshots\"),\n                Client,\n                mode,\n                testCase(caseName: string, run: () => Promise<void>) {\n                  it(caseName, run);\n                },\n                assertions(caseName: string, expected: string, actual: string): Promise<void> {\n                  expect(actual).toEqual(expected);\n                  return Promise.resolve();\n                },\"\"\",\n            \"\"\"\n              });\n              runner.run();\n            }, 30_000);\n            \"\"\",\n            clientName,\n            () -> {\n                writer.indent();\n                writer.openBlock(\n                    \"\"\"\n                    schemas: new Map<any, any>([\"\"\",\n                    \"\"\"\n                    ]),\"\"\",\n                    () -> {\n                        for (OperationShape operationShape : closure.getOperationShapes()) {\n                            String operationSchema = closure.getShapeSchemaVariableName(operationShape, null);\n                            writer.addRelativeImport(\n                                operationSchema,\n                                null,\n                                srcIndex\n                            );\n                            String commandName =\n                                StringUtils.capitalize(operationShape.toShapeId().getName(settings.getService(model)))\n                                    + \"Command\";\n                            writer.addRelativeImport(\n                                commandName,\n                                null,\n                                srcIndex\n                            );\n                            writer.write(\n                                \"\"\"\n                                [$L, $L],\"\"\",\n                                operationSchema,\n                                commandName\n                            );\n                        }\n                    }\n                );\n                writer.openBlock(\n                    \"\"\"\n                    errors: [\"\"\",\n                    \"\"\"\n                    ],\"\"\",\n                    () -> {\n\n                        for (Shape errorShape : closure.getErrorShapes()) {\n                            String schemaName = closure.getShapeSchemaVariableName(errorShape, null);\n                            writer.addRelativeImport(\n                                schemaName,\n                                null,\n                                srcIndex\n                            );\n                            writer.write(\n                                \"\"\"\n                                $L,\"\"\",\n                                schemaName\n                            );\n                        }\n\n                    }\n                );\n                writer.dedent();\n            }\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageContainer.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\n/**\n * A container for packages.\n */\npublic interface PackageContainer {\n    /**\n     * Gets the name of the contained package.\n     *\n     * @return Returns the name of the package.\n     */\n    String getPackageName();\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageJsonGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.io.InputStream;\nimport java.util.Map;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.utils.IoUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Private class used to generates a package.json file for the project.\n */\n@SmithyInternalApi\nfinal class PackageJsonGenerator {\n\n    public static final String PACKAGE_JSON_FILENAME = \"package.json\";\n    public static final String TYPEDOC_FILE_NAME = \"typedoc.json\";\n    public static final String VITEST_CONFIG_FILENAME = \"vitest.config.mts\";\n    public static final String VITEST_CONFIG_INTEG_FILENAME = \"vitest.config.integ.mts\";\n\n    private PackageJsonGenerator() {}\n\n    static void writePackageJson(\n        TypeScriptSettings settings,\n        FileManifest manifest,\n        Map<String, Map<String, SymbolDependency>> dependencies\n    ) {\n        // Write the package.json file.\n        InputStream resource = PackageJsonGenerator.class.getResourceAsStream(\"base-package.json\");\n\n        ObjectNode userSuppliedPackageJson = settings.getPackageJson();\n        ObjectNode defaultPackageJson = Node.parse(IoUtils.toUtf8String(resource)).expectObjectNode();\n\n        ObjectNode mergedScripts = defaultPackageJson\n            .expectObjectMember(\"scripts\")\n            .merge(userSuppliedPackageJson.getObjectMember(\"scripts\").orElse(ObjectNode.builder().build()));\n\n        ObjectNode node = defaultPackageJson.merge(userSuppliedPackageJson).withMember(\"scripts\", mergedScripts);\n\n        // Merge TypeScript dependencies into the package.json file.\n        for (Map.Entry<String, Map<String, SymbolDependency>> depEntry : dependencies.entrySet()) {\n            ObjectNode currentValue = node.getObjectMember(depEntry.getKey()).orElse(Node.objectNode());\n            ObjectNode.Builder builder = currentValue.toBuilder();\n            for (Map.Entry<String, SymbolDependency> entry : depEntry.getValue().entrySet()) {\n                builder.withMember(entry.getKey(), entry.getValue().getVersion());\n            }\n            node = node.withMember(depEntry.getKey(), builder.build());\n        }\n\n        // Add test script and vitest.config.mts if specs and their devDependency on vitest has been generated.\n        ObjectNode devDeps = node.getObjectMember(\"devDependencies\").orElse(Node.objectNode());\n        if (devDeps.containsMember(TypeScriptDependency.VITEST.packageName)) {\n            ObjectNode scripts = node.getObjectMember(\"scripts\").orElse(Node.objectNode());\n            String pkgManagerExec = settings.getPackageManager().getExecCommand();\n            scripts = scripts\n                .withMember(\"test\", \"%s vitest run --passWithNoTests\".formatted(pkgManagerExec))\n                .withMember(\"test:watch\", \"%s vitest watch --passWithNoTests\".formatted(pkgManagerExec))\n                .withMember(\n                    \"test:integration\",\n                    \"%s vitest run --passWithNoTests -c vitest.config.integ.mts\".formatted(pkgManagerExec)\n                )\n                .withMember(\n                    \"test:integration:watch\",\n                    \"%s vitest watch --passWithNoTests -c vitest.config.integ.mts\".formatted(pkgManagerExec)\n                );\n            node = node.withMember(\"scripts\", scripts);\n\n            manifest.writeFile(\n                VITEST_CONFIG_FILENAME,\n                IoUtils.toUtf8String(PackageJsonGenerator.class.getResourceAsStream(VITEST_CONFIG_FILENAME))\n            );\n            manifest.writeFile(\n                VITEST_CONFIG_INTEG_FILENAME,\n                IoUtils.toUtf8String(PackageJsonGenerator.class.getResourceAsStream(VITEST_CONFIG_INTEG_FILENAME))\n            );\n        }\n\n        if (settings.generateTypeDoc()) {\n            // Add typedoc to the \"devDependencies\" if not present\n            if (devDeps.getMember(TypeScriptDependency.TYPEDOC.packageName).isEmpty()) {\n                devDeps = devDeps.withMember(\n                    TypeScriptDependency.TYPEDOC.packageName,\n                    TypeScriptDependency.TYPEDOC.version\n                );\n                node = node.withMember(\"devDependencies\", devDeps);\n            }\n\n            // Add @smithy/service-client-documentation-generator to the \"devDependencies\" if not present\n            if (devDeps.getMember(TypeScriptDependency.AWS_SDK_CLIENT_DOCGEN.packageName).isEmpty()) {\n                devDeps = devDeps.withMember(\n                    TypeScriptDependency.AWS_SDK_CLIENT_DOCGEN.packageName,\n                    TypeScriptDependency.AWS_SDK_CLIENT_DOCGEN.version\n                );\n                node = node.withMember(\"devDependencies\", devDeps);\n            }\n\n            // Add build:docs script\n            ObjectNode scripts = node.getObjectMember(\"scripts\").orElse(Node.objectNode());\n            scripts = scripts.withMember(\"build:docs\", \"typedoc\");\n            node = node.withMember(\"scripts\", scripts);\n\n            // Write typedoc.json\n            manifest.writeFile(TYPEDOC_FILE_NAME, PackageJsonGenerator.class, TYPEDOC_FILE_NAME);\n        }\n\n        // These are currently only generated for clients, but they may be needed for ssdk as well.\n        if (settings.generateClient()) {\n            // Add the Node vs Browser hook.\n            node = node.withMember(\n                \"browser\",\n                node\n                    .getObjectMember(\"browser\")\n                    .orElse(Node.objectNode())\n                    .withMember(\"./dist-es/runtimeConfig\", \"./dist-es/runtimeConfig.browser\")\n            );\n            // Add the ReactNative hook.\n            node = node.withMember(\n                \"react-native\",\n                node\n                    .getObjectMember(\"react-native\")\n                    .orElse(Node.objectNode())\n                    .withMember(\"./dist-es/runtimeConfig\", \"./dist-es/runtimeConfig.native\")\n            );\n        }\n\n        // Set the package to private if required.\n        if (settings.isPrivate()) {\n            node = node.withMember(\"private\", true);\n        }\n\n        if (!settings.generateIndexTests()) {\n            node = node.withMember(\"scripts\", node.getObjectMember(\"scripts\").get().withoutMember(\"test:index\"));\n        }\n\n        // Expand template parameters.\n        String template = Node.prettyPrintJson(node);\n        template = template.replace(\"${package}\", settings.getPackageName());\n        template = template.replace(\"${packageDescription}\", settings.getPackageDescription());\n\n        if (settings.getVersioningScheme().equals(\"@smithy/core\")) {\n            settings.setPackageVersion(TypeScriptDependency.getSmithyCoreVersion());\n        }\n        if (settings.getVersioningScheme().equals(\"@aws-sdk/client\")) {\n            settings.setPackageVersion(TypeScriptDependency.getAwsSdkLeadingClientVersion());\n        }\n\n        template = template.replace(\"${packageVersion}\", settings.getPackageVersion());\n        template = template.replace(\"${packageManager}\", settings.getPackageManager().getCommand());\n        manifest.writeFile(PACKAGE_JSON_FILENAME, template);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PaginationGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.PaginatedIndex;\nimport software.amazon.smithy.model.knowledge.PaginationInfo;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.PaginatedTrait;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\nfinal class PaginationGenerator implements Runnable {\n\n    static final String PAGINATION_FOLDER = \"pagination\";\n    static final String PAGINATION_INTERFACE_FILE = Paths.get(\n        CodegenUtils.SOURCE_FOLDER,\n        PAGINATION_FOLDER,\n        \"Interfaces.ts\"\n    ).toString();\n\n    private final TypeScriptWriter writer;\n    private final String aggregatedClientName;\n    private final PaginationInfo paginatedInfo;\n\n    private final Symbol serviceSymbol;\n    private final Symbol operationSymbol;\n    private final Symbol inputSymbol;\n    private final Symbol outputSymbol;\n\n    private final String operationName;\n    private final String paginationType;\n\n    PaginationGenerator(\n        Model model,\n        ServiceShape service,\n        OperationShape operation,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        String aggregatedClientName\n    ) {\n        this.writer = writer;\n        this.aggregatedClientName = aggregatedClientName;\n\n        this.serviceSymbol = symbolProvider.toSymbol(service);\n        this.operationSymbol = symbolProvider.toSymbol(operation);\n        this.inputSymbol = symbolProvider.toSymbol(operation).expectProperty(\"inputType\", Symbol.class);\n        this.outputSymbol = symbolProvider.toSymbol(operation).expectProperty(\"outputType\", Symbol.class);\n\n        this.operationName = operation.getId().getName();\n\n        this.paginationType = aggregatedClientName + \"PaginationConfiguration\";\n\n        PaginatedIndex paginatedIndex = PaginatedIndex.of(model);\n        Optional<PaginationInfo> paginationInfo = paginatedIndex.getPaginationInfo(service, operation);\n        this.paginatedInfo = paginationInfo.orElseThrow(() -> {\n            return new CodegenException(\"Expected Paginator to have pagination information.\");\n        });\n    }\n\n    @Override\n    public void run() {\n        // Import Service Types\n        writer.addRelativeImport(\n            operationSymbol.getName(),\n            operationSymbol.getName(),\n            Paths.get(\".\", operationSymbol.getNamespace())\n        );\n        writer.addRelativeImport(\n            inputSymbol.getName(),\n            inputSymbol.getName(),\n            Paths.get(\".\", inputSymbol.getNamespace())\n        );\n        writer.addRelativeImport(\n            outputSymbol.getName(),\n            outputSymbol.getName(),\n            Paths.get(\".\", outputSymbol.getNamespace())\n        );\n        writer.addRelativeImport(\n            serviceSymbol.getName(),\n            serviceSymbol.getName(),\n            Paths.get(\".\", serviceSymbol.getNamespace())\n        );\n\n        // Import Pagination types\n        writer.addTypeImport(\"Paginator\", null, TypeScriptDependency.SMITHY_TYPES);\n        writer.addRelativeTypeImport(\n            paginationType,\n            paginationType,\n            Paths.get(\".\", PAGINATION_INTERFACE_FILE.replace(\".ts\", \"\"))\n        );\n\n        writePager();\n    }\n\n    static String getOutputFileLocation(OperationShape operation) {\n        return Paths.get(\n            CodegenUtils.SOURCE_FOLDER,\n            PAGINATION_FOLDER,\n            operation.getId().getName() + \"Paginator.ts\"\n        ).toString();\n    }\n\n    static void generateServicePaginationInterfaces(\n        String aggregatedClientName,\n        Symbol service,\n        TypeScriptWriter writer\n    ) {\n        writer.addTypeImport(\"PaginationConfiguration\", null, TypeScriptDependency.SMITHY_TYPES);\n        writer.addRelativeImport(service.getName(), service.getName(), Paths.get(\".\", service.getNamespace()));\n        writer\n            .writeDocs(\"@public\")\n            .openBlock(\n                \"export interface $LPaginationConfiguration extends PaginationConfiguration {\",\n                \"}\",\n                aggregatedClientName,\n                () -> {\n                    writer.write(\"client: $L;\", service.getName());\n                }\n            );\n    }\n\n    private static String getModulePath(String fileLocation) {\n        return fileLocation.substring(fileLocation.lastIndexOf(\"/\") + 1, fileLocation.length()).replace(\".ts\", \"\");\n    }\n\n    static void writeIndex(Model model, ServiceShape service, FileManifest fileManifest) {\n        TypeScriptWriter writer = new TypeScriptWriter(\"\");\n        writer.write(\"export * from \\\"./$L\\\";\", getModulePath(PAGINATION_INTERFACE_FILE));\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> containedOperations = new TreeSet<>(topDownIndex.getContainedOperations(service));\n        for (OperationShape operation : containedOperations) {\n            if (operation.hasTrait(PaginatedTrait.ID)) {\n                String outputFilepath = PaginationGenerator.getOutputFileLocation(operation);\n                writer.write(\"export * from \\\"./$L\\\";\", getModulePath(outputFilepath));\n            }\n        }\n\n        fileManifest.writeFile(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, PAGINATION_FOLDER, \"index.ts\").toString(),\n            writer.toString()\n        );\n    }\n\n    private void writePager() {\n        String serviceTypeName = serviceSymbol.getName();\n        String inputTypeName = inputSymbol.getName();\n        String outputTypeName = outputSymbol.getName();\n\n        String inputTokenName = paginatedInfo.getPaginatedTrait().getInputToken().get();\n        String outputTokenName = paginatedInfo.getPaginatedTrait().getOutputToken().get();\n\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n        writer.addImport(\"createPaginator\", null, TypeScriptDependency.SMITHY_CORE);\n\n        writer.writeDocs(\"@public\");\n\n        writer\n            .pushState()\n            .putContext(\"operation\", operationName)\n            .putContext(\"aggClient\", aggregatedClientName)\n            .putContext(\"inputType\", inputTypeName)\n            .putContext(\"outputType\", outputTypeName)\n            .putContext(\"paginationType\", paginationType)\n            .putContext(\"serviceTypeName\", serviceTypeName)\n            .putContext(\"operationName\", operationSymbol.getName())\n            .putContext(\"inputToken\", inputTokenName)\n            .putContext(\"outputToken\", outputTokenName)\n            .putContext(\n                \"pageSizeMember\",\n                paginatedInfo.getPageSizeMember().map(MemberShape::getMemberName).orElse(\"\")\n            )\n            .write(\n                \"\"\"\n                export const paginate${operation:L}: (\n                  config: ${aggClient:L}PaginationConfiguration,\n                  input: ${inputType:L},\n                  ...rest: any[]\n                ) => Paginator<${outputType:L}> = createPaginator<\n                  ${paginationType:L},\n                  ${inputType:L},\n                  ${outputType:L}\n                >(${serviceTypeName:L}, ${operationName:L}, ${inputToken:S}, ${outputToken:S}, ${pageSizeMember:S});\n                \"\"\"\n            )\n            .popState();\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/RuntimeConfigGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.TreeMap;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.build.SmithyBuildException;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.auth.AuthUtils;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.typescript.codegen.auth.http.SupportedHttpAuthSchemesIndex;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates runtime configuration files, files that are used to\n * supply different default values based on the targeted language\n * environment of the SDK (e.g., Node vs Browser).\n */\n@SmithyInternalApi\nfinal class RuntimeConfigGenerator {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptDelegator delegator;\n    private final List<TypeScriptIntegration> integrations;\n    private final ApplicationProtocol applicationProtocol;\n    private final Map<String, Consumer<TypeScriptWriter>> nodeRuntimeConfigDefaults = MapUtils.of(\n        \"requestHandler\",\n        writer -> {\n            writer.addImport(\"NodeHttpHandler\", \"RequestHandler\", TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER);\n            writer.write(\"RequestHandler.create(config?.requestHandler ?? defaultConfigProvider)\");\n        },\n        \"sha256\",\n        writer -> {\n            writer.addImportSubmodule(\"Hash\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n            writer.write(\"Hash.bind(null, \\\"sha256\\\")\");\n        },\n        \"bodyLengthChecker\",\n        writer -> {\n            writer.addImportSubmodule(\n                \"calculateBodyLength\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n            writer.write(\"calculateBodyLength\");\n        },\n        \"streamCollector\",\n        writer -> {\n            writer.addImport(\"streamCollector\", null, TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER);\n            writer.write(\"streamCollector\");\n        }\n    );\n    private final Map<String, Consumer<TypeScriptWriter>> browserRuntimeConfigDefaults = MapUtils.of(\n        \"requestHandler\",\n        writer -> {\n            writer.addImport(\"FetchHttpHandler\", \"RequestHandler\", TypeScriptDependency.AWS_SDK_FETCH_HTTP_HANDLER);\n            writer.write(\"RequestHandler.create(config?.requestHandler ?? defaultConfigProvider)\");\n        },\n        \"sha256\",\n        writer -> {\n            writer.addImport(\"Sha256\", null, TypeScriptDependency.AWS_CRYPTO_SHA256_BROWSER);\n            writer.write(\"Sha256\");\n        },\n        \"bodyLengthChecker\",\n        writer -> {\n            writer.addImportSubmodule(\n                \"calculateBodyLength\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n            writer.write(\"calculateBodyLength\");\n        },\n        \"streamCollector\",\n        writer -> {\n            writer.addImport(\"streamCollector\", null, TypeScriptDependency.AWS_SDK_FETCH_HTTP_HANDLER);\n            writer.write(\"streamCollector\");\n        }\n    );\n    private final Map<String, Consumer<TypeScriptWriter>> reactNativeRuntimeConfigDefaults = MapUtils.of(\n        \"sha256\",\n        writer -> {\n            writer.addImport(\"Sha256\", null, TypeScriptDependency.AWS_CRYPTO_SHA256_JS);\n            writer.write(\"Sha256\");\n        }\n    );\n    private final Map<String, Consumer<TypeScriptWriter>> sharedRuntimeConfigDefaults = MapUtils.of(\n        \"base64Decoder\",\n        writer -> {\n            writer.addImportSubmodule(\"fromBase64\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n            writer.write(\"fromBase64\");\n        },\n        \"base64Encoder\",\n        writer -> {\n            writer.addImportSubmodule(\"toBase64\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n            writer.write(\"toBase64\");\n        },\n        \"disableHostPrefix\",\n        writer -> {\n            writer.write(\"false\");\n        },\n        \"urlParser\",\n        writer -> {\n            writer\n                .addImportSubmodule(\"parseUrl\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.PROTOCOLS);\n            writer.write(\"parseUrl\");\n        },\n        \"utf8Decoder\",\n        writer -> {\n            writer.addImportSubmodule(\"fromUtf8\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n            writer.write(\"fromUtf8\");\n        },\n        \"utf8Encoder\",\n        writer -> {\n            writer.addImportSubmodule(\"toUtf8\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n            writer.write(\"toUtf8\");\n        },\n        \"extensions\",\n        writer -> {\n            writer.write(\"[]\");\n        }\n    );\n    private final Map<String, String> runtimeConfigDefaultValuePrefixes = MapUtils.of(\"requestHandler\", \"\");\n\n    RuntimeConfigGenerator(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptDelegator delegator,\n        List<TypeScriptIntegration> integrations,\n        ApplicationProtocol applicationProtocol\n    ) {\n        this.settings = settings;\n        this.model = model;\n        this.service = settings.getService(model);\n        this.symbolProvider = symbolProvider;\n        this.delegator = delegator;\n        this.integrations = integrations;\n        this.applicationProtocol = applicationProtocol;\n    }\n\n    void generate(LanguageTarget target) {\n        String clientConfigName = symbolProvider.toSymbol(service).getName() + \"Config\";\n        String clientModuleName = symbolProvider\n            .toSymbol(service)\n            .getNamespace()\n            .replaceFirst(CodegenUtils.SOURCE_FOLDER + \"/\", \"\");\n\n        String template = TypeScriptUtils.loadResourceAsString(target.getTemplateFileName());\n        String contents = template\n            .replace(\"${clientConfigName}\", clientConfigName)\n            .replace(\"${apiVersion}\", service.getVersion())\n            .replace(\"${\", \"$${\") // sanitize template place holders.\n            .replace(\"$${customizations}\", \"${L@customizations}\")\n            .replace(\"$${prepareCustomizations}\", \"${L@prepareCustomizations}\");\n\n        delegator.useFileWriter(target.getTargetFilename(), writer -> {\n            writer.trimBlankLines(0);\n\n            // Inject customizations into the ~template.\n            writer.onSection(\"prepareCustomizations\", original -> {\n                for (TypeScriptIntegration integration : integrations) {\n                    integration.prepareCustomizations(writer, target, settings, model);\n                }\n            });\n            writer\n                .indent()\n                .onSection(\"customizations\", original -> {\n                    // Start with defaults, use a TreeMap for keeping entries sorted.\n                    Map<String, Consumer<TypeScriptWriter>> configs =\n                        new TreeMap<>(getDefaultRuntimeConfigs(target));\n\n                    // Add any integration supplied runtime config writers.\n                    for (TypeScriptIntegration integration : integrations) {\n                        configs.putAll(\n                            integration.getRuntimeConfigWriters(settings, model, symbolProvider, target)\n                        );\n                    }\n                    // Needs a separate integration point since not all the information is accessible in\n                    // {@link TypeScriptIntegration#getRuntimeConfigWriters()}\n                    if (applicationProtocol.isHttpProtocol() && !settings.useLegacyAuth()) {\n                        generateHttpAuthSchemeConfig(configs, writer, target);\n                    }\n                    configs.forEach((key, value) -> {\n                        String valuePrefix = runtimeConfigDefaultValuePrefixes.getOrDefault(key, \"config?.$1L ?? \");\n                        if (key.equals(\"retryMode\") && target.equals(LanguageTarget.NODE)) {\n                            valuePrefix = \"\"\"\n                                          \\n  config?.retryMode ??\n                                          \"\"\";\n                        }\n                        writer.indent(2).writeInline(\"$1L: \" + valuePrefix, key);\n                        value.accept(writer);\n                        writer.unwrite(\"\\n\");\n                        writer.dedent(2);\n                        writer.write(\",\");\n                    });\n                });\n            writer.dedent();\n\n            writer.addRelativeTypeImport(\n                clientConfigName,\n                null,\n                Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, clientModuleName)\n            );\n\n            switch (target) {\n                case NODE:\n                case BROWSER:\n                    writer.addRelativeImport(\n                        \"getRuntimeConfig\",\n                        \"getSharedRuntimeConfig\",\n                        Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"runtimeConfig.shared\")\n                    );\n                    writer.addImportSubmodule(\n                        \"loadConfigsForDefaultMode\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    break;\n                default:\n                    break;\n            }\n\n            switch (target) {\n                case NODE -> {\n                    writer.addImportSubmodule(\n                        \"emitWarningIfUnsupportedVersion\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    writer.addImportSubmodule(\n                        \"resolveDefaultsModeConfig\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CONFIG\n                    );\n                }\n                case BROWSER -> {\n                    writer.addImportSubmodule(\n                        \"resolveDefaultsModeConfig\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CONFIG\n                    );\n                }\n                case REACT_NATIVE -> {\n                    writer.addRelativeImport(\n                        \"getRuntimeConfig\",\n                        \"getBrowserRuntimeConfig\",\n                        Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"runtimeConfig.browser\")\n                    );\n                }\n                default -> {\n                    // checkstyle\n                }\n            }\n\n            writer.write(contents, \"\", \"\");\n        });\n    }\n\n    private void generateHttpAuthSchemeConfig(\n        Map<String, Consumer<TypeScriptWriter>> configs,\n        TypeScriptWriter writer,\n        LanguageTarget target\n    ) {\n        SupportedHttpAuthSchemesIndex authIndex = new SupportedHttpAuthSchemesIndex(integrations, model, settings);\n\n        if (target.equals(LanguageTarget.SHARED)) {\n            configs.put(\"httpAuthSchemeProvider\", w -> {\n                w.write(\n                    \"$T\",\n                    Symbol.builder()\n                        .name(\n                            \"default\" +\n                                CodegenUtils.getServiceName(settings, model, symbolProvider) +\n                                \"HttpAuthSchemeProvider\"\n                        )\n                        .namespace(AuthUtils.AUTH_HTTP_PROVIDER_DEPENDENCY.getPackageName(), \"/\")\n                        .build()\n                );\n            });\n        }\n\n        ServiceIndex serviceIndex = ServiceIndex.of(model);\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Map<ShapeId, HttpAuthScheme> allEffectiveHttpAuthSchemes = AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(\n            service,\n            serviceIndex,\n            authIndex,\n            topDownIndex\n        );\n        List<HttpAuthSchemeTarget> targetAuthSchemes = getHttpAuthSchemeTargets(target, allEffectiveHttpAuthSchemes);\n\n        // Generate only if the \"inherited\" target is different from the current target\n        List<HttpAuthSchemeTarget> inheritedAuthSchemes = Collections.emptyList();\n        // Always generated the SHARED target\n        if (target.equals(LanguageTarget.SHARED)) {\n            // no-op\n            // NODE and BROWSER inherit from SHARED\n        } else if (target.equals(LanguageTarget.NODE) || target.equals(LanguageTarget.BROWSER)) {\n            inheritedAuthSchemes = getHttpAuthSchemeTargets(LanguageTarget.SHARED, allEffectiveHttpAuthSchemes);\n            // REACT_NATIVE inherits from BROWSER\n        } else if (target.equals(LanguageTarget.REACT_NATIVE)) {\n            inheritedAuthSchemes = getHttpAuthSchemeTargets(LanguageTarget.BROWSER, allEffectiveHttpAuthSchemes);\n        } else {\n            throw new CodegenException(\"Unhandled Language Target: \" + target);\n        }\n\n        // If target and inherited auth schemes are equal, then don't generate target auth schemes.\n        if (targetAuthSchemes.equals(inheritedAuthSchemes)) {\n            return;\n        }\n\n        configs.put(\"httpAuthSchemes\", w -> {\n            w.addTypeImport(\"IdentityProviderConfig\", null, TypeScriptDependency.SMITHY_TYPES);\n\n            w.writeInline(\"[\");\n            Iterator<HttpAuthSchemeTarget> iter = targetAuthSchemes.iterator();\n            if (iter.hasNext()) {\n                w.write(\"\");\n            }\n            while (iter.hasNext()) {\n                HttpAuthSchemeTarget entry = iter.next();\n                w.indent();\n                if (entry.identityProvider == null) {\n                    w.writeInline(\n                        \"\"\"\n                        {\n                          schemeId: $S,\n                          identityProvider: (ipc: IdentityProviderConfig) =>\n                            ipc.getIdentityProvider($S),\n                          signer: $C,\n                        }\"\"\",\n                        entry.httpAuthScheme.getSchemeId(),\n                        entry.httpAuthScheme.getSchemeId(),\n                        entry.signer\n                    );\n                } else {\n                    w.writeInline(\n                        \"\"\"\n                        {\n                          schemeId: $S,\n                          identityProvider: (ipc: IdentityProviderConfig) =>\n                            ipc.getIdentityProvider($S) || ($C),\n                          signer: $C,\n                        }\"\"\",\n                        entry.httpAuthScheme.getSchemeId(),\n                        entry.httpAuthScheme.getSchemeId(),\n                        entry.identityProvider,\n                        entry.signer\n                    );\n                }\n                w.write(\",\");\n                w.dedent();\n            }\n            w.write(\"]\");\n        });\n    }\n\n    private static class HttpAuthSchemeTarget {\n\n        public HttpAuthScheme httpAuthScheme;\n        public Consumer<TypeScriptWriter> identityProvider;\n        public Consumer<TypeScriptWriter> signer;\n\n        HttpAuthSchemeTarget(\n            HttpAuthScheme httpAuthScheme,\n            Consumer<TypeScriptWriter> identityProvider,\n            Consumer<TypeScriptWriter> signer\n        ) {\n            this.httpAuthScheme = httpAuthScheme;\n            this.identityProvider = identityProvider;\n            this.signer = signer;\n        }\n\n        @Override\n        public boolean equals(Object other) {\n            if (!(other instanceof HttpAuthSchemeTarget)) {\n                return false;\n            }\n            HttpAuthSchemeTarget o = (HttpAuthSchemeTarget) other;\n            return (Objects.equals(httpAuthScheme, o.httpAuthScheme) &&\n                Objects.equals(identityProvider, o.identityProvider)\n                &&\n                Objects.equals(signer, o.signer));\n        }\n\n        @Override\n        public int hashCode() {\n            return super.hashCode();\n        }\n    }\n\n    private List<HttpAuthSchemeTarget> getHttpAuthSchemeTargets(\n        LanguageTarget target,\n        Map<ShapeId, HttpAuthScheme> httpAuthSchemes\n    ) {\n        return getPartialHttpAuthSchemeTargets(target, httpAuthSchemes)\n            .values()\n            .stream()\n            .filter(httpAuthSchemeTarget -> httpAuthSchemeTarget.signer != null)\n            .toList();\n    }\n\n    private Map<ShapeId, HttpAuthSchemeTarget> getPartialHttpAuthSchemeTargets(\n        LanguageTarget target,\n        Map<ShapeId, HttpAuthScheme> httpAuthSchemes\n    ) {\n        LanguageTarget inherited;\n        if (target.equals(LanguageTarget.SHARED)) {\n            // SHARED doesn't inherit any target, so inherited is null\n            inherited = null;\n        } else if (target.equals(LanguageTarget.NODE) || target.equals(LanguageTarget.BROWSER)) {\n            inherited = LanguageTarget.SHARED;\n        } else if (target.equals(LanguageTarget.REACT_NATIVE)) {\n            inherited = LanguageTarget.BROWSER;\n        } else {\n            throw new CodegenException(\"Unsupported Language Target: \" + target);\n        }\n\n        Map<ShapeId, HttpAuthSchemeTarget> httpAuthSchemeTargets = inherited == null\n            ? // SHARED inherits no HttpAuthSchemeTargets\n            new TreeMap<>()\n            : // Otherwise, get inherited HttpAuthSchemeTargets\n            getPartialHttpAuthSchemeTargets(inherited, httpAuthSchemes);\n\n        for (HttpAuthScheme httpAuthScheme : httpAuthSchemes.values()) {\n            // If HttpAuthScheme is not registered, skip code generation\n            if (httpAuthScheme == null) {\n                continue;\n            }\n\n            // Get identity provider and signer for the current target\n            Consumer<TypeScriptWriter> identityProvider = httpAuthScheme.getDefaultIdentityProviders().get(target);\n            Consumer<TypeScriptWriter> signer = httpAuthScheme.getDefaultSigners().get(target);\n\n            HttpAuthSchemeTarget existingEntry = httpAuthSchemeTargets.get(httpAuthScheme.getSchemeId());\n\n            // If HttpAuthScheme is not added yet, add the entry\n            if (existingEntry == null) {\n                httpAuthSchemeTargets.put(\n                    httpAuthScheme.getSchemeId(),\n                    new HttpAuthSchemeTarget(httpAuthScheme, identityProvider, signer)\n                );\n                continue;\n            }\n\n            // Mutate existing entry for identity provider and signer if available\n            if (identityProvider != null) {\n                existingEntry.identityProvider = identityProvider;\n            }\n            if (signer != null) {\n                existingEntry.signer = signer;\n            }\n        }\n        return httpAuthSchemeTargets;\n    }\n\n    private Map<String, Consumer<TypeScriptWriter>> getDefaultRuntimeConfigs(LanguageTarget target) {\n        switch (target) {\n            case NODE:\n                return nodeRuntimeConfigDefaults;\n            case BROWSER:\n                return browserRuntimeConfigDefaults;\n            case REACT_NATIVE:\n                return reactNativeRuntimeConfigDefaults;\n            case SHARED:\n                return sharedRuntimeConfigDefaults;\n            default:\n                throw new SmithyBuildException(\"Unknown target: \" + target);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/RuntimeExtensionsGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.List;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.typescript.codegen.validation.ReplaceLast;\n\npublic class RuntimeExtensionsGenerator {\n\n    private static final String TEMPLATE_1 = \"resolveRuntimeExtensions1.template\";\n    private static final String TEMPLATE_2 = \"resolveRuntimeExtensions2.template\";\n    private static final String FILENAME = \"runtimeExtensions.ts\";\n\n    private final Model model;\n    private final TypeScriptSettings settings;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptDelegator delegator;\n    private final List<TypeScriptIntegration> integrations;\n\n    public RuntimeExtensionsGenerator(\n        Model model,\n        TypeScriptSettings settings,\n        ServiceShape service,\n        SymbolProvider symbolProvider,\n        TypeScriptDelegator delegator,\n        List<TypeScriptIntegration> integrations\n    ) {\n        this.model = model;\n        this.settings = settings;\n        this.service = service;\n        this.symbolProvider = symbolProvider;\n        this.delegator = delegator;\n        this.integrations = integrations;\n    }\n\n    void generate() {\n        String clientName = ReplaceLast.in(\n            ReplaceLast.in(symbolProvider.toSymbol(service).getName(), \"Client\", \"\"),\n            \"client\",\n            \"\"\n        );\n\n        String template1Contents = TypeScriptUtils.loadResourceAsString(TEMPLATE_1)\n            .replace(\"${extensionConfigName}\", clientName + \"ExtensionConfiguration\")\n            .replace(\"$\", \"$$\") // sanitize template place holders.\n            .replace(\"$${getPartialExtensionConfigurations}\", \"${L@getPartialExtensionConfigurations}\");\n\n        String template2Contents = TypeScriptUtils.loadResourceAsString(TEMPLATE_2)\n            .replace(\"$\", \"$$\") // sanitize template place holders.\n            .replace(\"$${resolvePartialRuntimeConfigs}\", \"${L@resolvePartialRuntimeConfigs}\");\n\n        delegator.useFileWriter(Paths.get(CodegenUtils.SOURCE_FOLDER, FILENAME).toString(), writer -> {\n            for (TypeScriptIntegration integration : integrations) {\n                integration\n                    .getExtensionConfigurationInterfaces(model, settings)\n                    .forEach(configurationInterface -> {\n                        writer.addDependency(configurationInterface.getExtensionConfigurationFn().right);\n                        writer.addDependency(configurationInterface.resolveRuntimeConfigFn().right);\n\n                        if (configurationInterface.submodule() != null) {\n                            writer.addImportSubmodule(\n                                configurationInterface.getExtensionConfigurationFn().left,\n                                null,\n                                configurationInterface.getExtensionConfigurationFn().right,\n                                configurationInterface.submodule()\n                            );\n                            writer.addImportSubmodule(\n                                configurationInterface.resolveRuntimeConfigFn().left,\n                                null,\n                                configurationInterface.resolveRuntimeConfigFn().right,\n                                configurationInterface.submodule()\n                            );\n                        } else {\n                            writer.addImport(\n                                configurationInterface.getExtensionConfigurationFn().left,\n                                null,\n                                configurationInterface.getExtensionConfigurationFn().right\n                            );\n                            writer.addImport(\n                                configurationInterface.resolveRuntimeConfigFn().left,\n                                null,\n                                configurationInterface.resolveRuntimeConfigFn().right\n                            );\n                        }\n                    });\n            }\n\n            writer\n                .indent()\n                .onSection(\"getPartialExtensionConfigurations\", original -> {\n                    for (TypeScriptIntegration integration : integrations) {\n                        integration\n                            .getExtensionConfigurationInterfaces(model, settings)\n                            .forEach(configurationInterface -> {\n                                writer\n                                    .indent(2)\n                                    .write(\n                                        \"$L(runtimeConfig),\",\n                                        configurationInterface.getExtensionConfigurationFn().left\n                                    );\n                                writer.dedent(2);\n                            });\n                    }\n                    writer.unwrite(\",\\n\").write(\"\");\n                });\n            writer.dedent().write(template1Contents, \"\");\n\n            writer\n                .indent()\n                .onSection(\"resolvePartialRuntimeConfigs\", original -> {\n                    for (TypeScriptIntegration integration : integrations) {\n                        integration\n                            .getExtensionConfigurationInterfaces(model, settings)\n                            .forEach(configurationInterface -> {\n                                writer\n                                    .indent(2)\n                                    .write(\n                                        \"$L(extensionConfiguration),\",\n                                        configurationInterface.resolveRuntimeConfigFn().left\n                                    );\n                                writer.dedent(2);\n                            });\n                    }\n                    writer.unwrite(\",\\n\").write(\"\");\n                });\n            writer.dedent().write(template2Contents, \"\");\n        });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerCommandGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.OperationIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates server operation types.\n */\n@SmithyInternalApi\nfinal class ServerCommandGenerator implements Runnable {\n\n    static final String COMMANDS_FOLDER = \"operations\";\n    private static final String NO_PROTOCOL_FOUND_SERDE_FUNCTION =\n        \"(async (...args: any[]) => { throw new Error(\\\"No supported protocol was found\\\"); })\";\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptWriter writer;\n    private final OperationIndex operationIndex;\n    private final Symbol inputType;\n    private final Symbol outputType;\n    private final Symbol errorsType;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n    private final List<StructureShape> errors;\n\n    ServerCommandGenerator(\n        TypeScriptSettings settings,\n        Model model,\n        OperationShape operation,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        ProtocolGenerator protocolGenerator,\n        ApplicationProtocol applicationProtocol\n    ) {\n        this.settings = settings;\n        this.model = model;\n        this.operation = operation;\n        this.symbolProvider = symbolProvider;\n        this.writer = writer;\n        this.protocolGenerator = protocolGenerator;\n        this.applicationProtocol = applicationProtocol;\n\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        operationIndex = OperationIndex.of(model);\n        inputType = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n        outputType = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n        errorsType = operationSymbol.expectProperty(\"errorsType\", Symbol.class);\n        errors = Collections.unmodifiableList(operationIndex.getErrors(operation, settings.getService()));\n    }\n\n    @Override\n    public void run() {\n        writeOperationType();\n        addInputAndOutputTypes();\n        writeErrorType();\n        writeOperationSerializer();\n    }\n\n    private void addInputAndOutputTypes() {\n        writeInputType(inputType.getName(), operationIndex.getInput(operation));\n        writeOutputType(outputType.getName(), operationIndex.getOutput(operation));\n        writer.write(\"\");\n    }\n\n    private void writeInputType(String typeName, Optional<StructureShape> inputShape) {\n        if (inputShape.isPresent()) {\n            StructureShape input = inputShape.get();\n            writer.write(\"export interface $L extends $T {}\", typeName, symbolProvider.toSymbol(inputShape.get()));\n            renderNamespace(typeName, input);\n        } else {\n            // If the input is non-existent, then use an empty object.\n            writer.write(\"export interface $L {}\", typeName);\n            writer.openBlock(\"export namespace $L {\", \"}\", typeName, () -> {\n                writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n                writer.writeDocs(\"@internal\");\n                writer.write(\"export const validate: () => __ValidationFailure[] = () => [];\");\n            });\n        }\n    }\n\n    private void renderNamespace(String typeName, StructureShape input) {\n        Symbol symbol = symbolProvider.toSymbol(input);\n        writer.openBlock(\"export namespace $L {\", \"}\", typeName, () -> {\n            writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n            writer.writeDocs(\"@internal\");\n            // Streaming makes the type of the object being validated weird on occasion.\n            // Using `Parameters` here means we don't have to try to derive the weird type twice\n            writer.write(\n                \"export const validate: (obj: Parameters<typeof $1T.validate>[0]) => \" +\n                    \"__ValidationFailure[] = $1T.validate;\",\n                symbol\n            );\n        });\n    }\n\n    private void writeOutputType(String typeName, Optional<StructureShape> outputShape) {\n        if (outputShape.isPresent()) {\n            writer.write(\"export interface $L extends $T {}\", typeName, symbolProvider.toSymbol(outputShape.get()));\n        } else {\n            writer.write(\"export interface $L {}\", typeName);\n        }\n    }\n\n    private void writeErrorType() {\n        if (errors.isEmpty()) {\n            writer.write(\"export type $L = never;\", errorsType.getName());\n        } else {\n            writer.writeInline(\"export type $L = \", errorsType.getName());\n            for (Iterator<StructureShape> iter = errors.iterator(); iter.hasNext();) {\n                writer.writeInline(\"$T\", symbolProvider.toSymbol(iter.next()));\n                if (iter.hasNext()) {\n                    writer.writeInline(\" | \");\n                }\n            }\n            writer.write(\"\");\n        }\n        writer.write(\"\");\n    }\n\n    private void writeOperationType() {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        writer.addImport(\"Operation\", \"__Operation\", TypeScriptDependency.SERVER_COMMON);\n        writer.write(\n            \"export type $L<Context> = __Operation<$T, $T, Context>\",\n            operationSymbol.getName(),\n            inputType,\n            outputType\n        );\n        writer.write(\"\");\n    }\n\n    private void writeOperationSerializer() {\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        String serializerName = operationSymbol.expectProperty(\"serializerType\", Symbol.class).getName();\n        Symbol serverSymbol = symbolProvider.toSymbol(model.expectShape(settings.getService()));\n\n        writer.addImport(\"OperationSerializer\", \"__OperationSerializer\", TypeScriptDependency.SERVER_COMMON);\n        writer.openBlock(\n            \"export class $L implements __OperationSerializer<$T<any>, $S, $T> {\",\n            \"}\",\n            serializerName,\n            serverSymbol,\n            operationSymbol.getName(),\n            errorsType,\n            () -> {\n                if (protocolGenerator == null) {\n                    writer.write(\"serialize = $L as any;\", NO_PROTOCOL_FOUND_SERDE_FUNCTION);\n                    writer.write(\"deserialize = $L as any;\", NO_PROTOCOL_FOUND_SERDE_FUNCTION);\n                } else {\n                    String serializerFunction =\n                        ProtocolGenerator.getGenericSerFunctionName(operationSymbol) + \"Response\";\n                    writer.addRelativeImport(\n                        serializerFunction,\n                        null,\n                        Paths.get(\n                            \".\",\n                            CodegenUtils.SOURCE_FOLDER,\n                            ProtocolGenerator.PROTOCOLS_FOLDER,\n                            ProtocolGenerator.getSanitizedName(protocolGenerator.getName())\n                        )\n                    );\n                    writer.write(\"serialize = $L;\", serializerFunction);\n                    String deserializerFunction =\n                        ProtocolGenerator.getGenericDeserFunctionName(operationSymbol) + \"Request\";\n                    writer.addRelativeImport(\n                        deserializerFunction,\n                        null,\n                        Paths.get(\n                            \".\",\n                            CodegenUtils.SOURCE_FOLDER,\n                            ProtocolGenerator.PROTOCOLS_FOLDER,\n                            ProtocolGenerator.getSanitizedName(protocolGenerator.getName())\n                        )\n                    );\n                    writer.write(\"deserialize = $L;\", deserializerFunction);\n                }\n                writer.write(\"\");\n                writeErrorChecker();\n                writeErrorHandler();\n            }\n        );\n        writer.write(\"\");\n    }\n\n    private void writeErrorChecker() {\n        writer.openBlock(\"isOperationError(error: any): error is $T {\", \"};\", errorsType, () -> {\n            if (errors.isEmpty()) {\n                writer.write(\"return false;\");\n            } else {\n                writer.writeInline(\"const names: $T['name'][] = [\", errorsType);\n                for (Iterator<StructureShape> iter = errors.iterator(); iter.hasNext();) {\n                    writer.writeInline(\"$S\", iter.next().getId().getName());\n                    if (iter.hasNext()) {\n                        writer.writeInline(\", \");\n                    }\n                }\n                writer.write(\"];\");\n                writer.write(\"return names.includes(error.name);\");\n            }\n        });\n        writer.write(\"\");\n    }\n\n    private void writeErrorHandler() {\n        writer.addImport(\"ServerSerdeContext\", null, TypeScriptDependency.SERVER_COMMON);\n        writer.openBlock(\n            \"serializeError(error: $T, ctx: ServerSerdeContext): Promise<$T> {\",\n            \"}\",\n            errorsType,\n            applicationProtocol.getResponseType(),\n            () -> {\n                if (errors.isEmpty()) {\n                    writer.write(\"throw error;\");\n                } else {\n                    writer.openBlock(\"switch (error.name) {\", \"}\", () -> {\n                        for (StructureShape error : errors) {\n                            writeErrorHandlerCase(error);\n                        }\n                        writer.openBlock(\"default: {\", \"}\", () -> writer.write(\"throw error;\"));\n                    });\n                }\n            }\n        );\n        writer.write(\"\");\n    }\n\n    private void writeErrorHandlerCase(StructureShape error) {\n        Symbol errorSymbol = symbolProvider.toSymbol(error);\n        writer.openBlock(\"case $S: {\", \"}\", error.getId().getName(), () -> {\n            if (protocolGenerator == null) {\n                writer.write(\"return $L(error, ctx);\", NO_PROTOCOL_FOUND_SERDE_FUNCTION);\n            } else {\n                String serializerFunction = ProtocolGenerator.getGenericSerFunctionName(errorSymbol) + \"Error\";\n                writer.addRelativeImport(\n                    serializerFunction,\n                    null,\n                    Paths.get(\n                        \".\",\n                        CodegenUtils.SOURCE_FOLDER,\n                        ProtocolGenerator.PROTOCOLS_FOLDER,\n                        ProtocolGenerator.getSanitizedName(protocolGenerator.getName())\n                    )\n                );\n                writer.write(\"return $L(error, ctx);\", serializerFunction);\n            }\n        });\n    }\n\n    static void writeIndex(\n        Model model,\n        ServiceShape service,\n        SymbolProvider symbolProvider,\n        FileManifest fileManifest\n    ) {\n        TypeScriptWriter writer = new TypeScriptWriter(\"\");\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> containedOperations = new TreeSet<>(topDownIndex.getContainedOperations(service));\n        if (containedOperations.isEmpty()) {\n            writer.write(\"export {};\");\n        } else {\n            for (OperationShape operation : containedOperations) {\n                writer.write(\"export * from \\\"./$L\\\";\", symbolProvider.toSymbol(operation).getName());\n            }\n        }\n\n        fileManifest.writeFile(\n            Paths.get(\n                CodegenUtils.SOURCE_FOLDER,\n                ServerSymbolVisitor.SERVER_FOLDER,\n                COMMANDS_FOLDER,\n                \"index.ts\"\n            ).toString(),\n            writer.toString()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.Iterator;\nimport java.util.Set;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\nfinal class ServerGenerator {\n\n    private ServerGenerator() {}\n\n    static void generateOperationsType(\n        SymbolProvider symbolProvider,\n        Shape serviceShape,\n        Set<OperationShape> operations,\n        TypeScriptWriter writer\n    ) {\n        Symbol serviceSymbol = symbolProvider.toSymbol(serviceShape);\n        writer.writeInline(\"export type $L = \", serviceSymbol.expectProperty(\"operations\", Symbol.class).getName());\n        for (Iterator<OperationShape> iter = operations.iterator(); iter.hasNext();) {\n            writer.writeInline(\"$S\", symbolProvider.toSymbol(iter.next()).getName());\n            if (iter.hasNext()) {\n                writer.writeInline(\" | \");\n            }\n        }\n        writer.write(\";\");\n    }\n\n    static void generateServiceHandler(\n        SymbolProvider symbolProvider,\n        Shape serviceShape,\n        Set<OperationShape> operations,\n        TypeScriptWriter writer\n    ) {\n        addCommonHandlerImports(writer);\n        writer.addImport(\n            \"UnknownOperationException\",\n            \"__UnknownOperationException\",\n            TypeScriptDependency.SERVER_COMMON\n        );\n\n        Symbol serviceSymbol = symbolProvider.toSymbol(serviceShape);\n        Symbol handlerSymbol = serviceSymbol.expectProperty(\"handler\", Symbol.class);\n        Symbol operationsType = serviceSymbol.expectProperty(\"operations\", Symbol.class);\n\n        writeSerdeContextBase(writer);\n        writeHandleFunction(writer);\n\n        String classDeclaration = \"export class $L<Context> implements __ServiceHandler<Context> {\";\n        writer.openBlock(classDeclaration, \"}\", handlerSymbol.getName(), () -> {\n            writer.write(\"private readonly service: $T<Context>;\", serviceSymbol);\n            writer.write(\"private readonly mux: __Mux<$S, $T>;\", serviceShape.getId().getName(), operationsType);\n            writer.write(\n                \"private readonly serializerFactory: <T extends $T>(operation: T) => \" +\n                    \"__OperationSerializer<$T<Context>, T, __ServiceException>;\",\n                operationsType,\n                serviceSymbol\n            );\n            writer.write(\n                \"private readonly serializeFrameworkException: (e: __SmithyFrameworkException, \" +\n                    \"ctx: __ServerSerdeContext) => Promise<__HttpResponse>;\"\n            );\n            writer.write(\"private readonly validationCustomizer: __ValidationCustomizer<$T>;\", operationsType);\n            writer.writeDocs(() -> {\n                writer.write(\"Construct a $T handler.\", serviceSymbol);\n                writer.write(\n                    \"@param service The {@link $1T} implementation that supplies the business logic for $1T\",\n                    serviceSymbol\n                );\n                writer.writeInline(\"@param mux The {@link __Mux} that determines which service and operation are \");\n                writer.write(\"being invoked by a given {@link __HttpRequest}\");\n                writer.writeInline(\"@param serializerFactory A factory for an {@link __OperationSerializer} for each \");\n                writer.write(\"operation in $T that \", serviceSymbol);\n                writer\n                    .writeInline(\"                         \")\n                    .write(\"handles deserialization of requests and serialization of responses\");\n                writer.write(\n                    \"@param serializeFrameworkException A function that can serialize \" +\n                        \"{@link __SmithyFrameworkException}s\"\n                );\n                writer.write(\n                    \"@param validationCustomizer A {@link __ValidationCustomizer} for turning validation \" +\n                        \"failures into {@link __SmithyFrameworkException}s\"\n                );\n            });\n            writer.openBlock(\"constructor(\", \") {\", () -> {\n                writer.write(\"service: $T<Context>,\", serviceSymbol);\n                writer.write(\"mux: __Mux<$S, $T>,\", serviceShape.getId().getName(), operationsType);\n                writer.write(\n                    \"serializerFactory:<T extends $T>(op: T) => \" +\n                        \"__OperationSerializer<$T<Context>, T, __ServiceException>,\",\n                    operationsType,\n                    serviceSymbol\n                );\n                writer.write(\n                    \"serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) \" +\n                        \"=> Promise<__HttpResponse>,\"\n                );\n                writer.write(\"validationCustomizer: __ValidationCustomizer<$T>\", operationsType);\n            });\n            writer.indent();\n            writer.write(\"this.service = service;\");\n            writer.write(\"this.mux = mux;\");\n            writer.write(\"this.serializerFactory = serializerFactory;\");\n            writer.write(\"this.serializeFrameworkException = serializeFrameworkException;\");\n            writer.write(\"this.validationCustomizer = validationCustomizer;\");\n            writer.closeBlock(\"}\");\n            String handleDecl = \"async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> {\";\n            writer.openBlock(handleDecl, \"}\", () -> {\n                writer.write(\"const target = this.mux.match(request);\");\n                writer.openBlock(\"if (target === undefined) {\", \"}\", () -> {\n                    writer.write(\n                        \"return this.serializeFrameworkException(new __UnknownOperationException(), \" +\n                            \"serdeContextBase);\"\n                    );\n                });\n                writer.openBlock(\"switch (target.operation) {\", \"}\", () -> {\n                    for (OperationShape operation : operations) {\n                        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n                        Symbol inputSymbol = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n                        writer.openBlock(\"case $S : {\", \"}\", operationSymbol.getName(), () -> {\n                            writer.write(\n                                \"return handle(request, context, $1S, this.serializerFactory($1S), \" +\n                                    \"this.service.$1L, this.serializeFrameworkException, $2T.validate, \" +\n                                    \"this.validationCustomizer);\",\n                                operationSymbol.getName(),\n                                inputSymbol\n                            );\n                        });\n                    }\n                });\n            });\n        });\n    }\n\n    static void generateOperationHandler(\n        SymbolProvider symbolProvider,\n        Shape serviceShape,\n        OperationShape operation,\n        TypeScriptWriter writer\n    ) {\n        addCommonHandlerImports(writer);\n\n        writeSerdeContextBase(writer);\n        writeHandleFunction(writer);\n\n        Symbol serviceSymbol = symbolProvider.toSymbol(serviceShape);\n        Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        String operationName = operationSymbol.getName();\n\n        Symbol inputSymbol = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n        Symbol outputSymbol = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n        Symbol handlerSymbol = operationSymbol.expectProperty(\"handler\", Symbol.class);\n        Symbol errorsSymbol = operationSymbol.expectProperty(\"errorsType\", Symbol.class);\n\n        String declaration = \"export class $L<Context> implements __ServiceHandler<Context> {\";\n        writer.openBlock(declaration, \"}\", handlerSymbol.getName(), () -> {\n            writer.write(\"private readonly operation: __Operation<$T, $T, Context>;\", inputSymbol, outputSymbol);\n            writer.write(\"private readonly mux: __Mux<$S, $S>;\", serviceShape.getId().getName(), operationName);\n            writer.write(\n                \"private readonly serializer: __OperationSerializer<$T<Context>, $S, $T>;\",\n                serviceSymbol,\n                operationName,\n                errorsSymbol\n            );\n            writer.write(\n                \"private readonly serializeFrameworkException: (e: __SmithyFrameworkException, \" +\n                    \"ctx: __ServerSerdeContext) => Promise<__HttpResponse>;\"\n            );\n            writer.write(\"private readonly validationCustomizer: __ValidationCustomizer<$S>;\", operationName);\n            writer.writeDocs(() -> {\n                writer.write(\"Construct a $T handler.\", operationSymbol);\n                writer.write(\n                    \"@param operation The {@link __Operation} implementation that supplies the business \" +\n                        \"logic for $1T\",\n                    operationSymbol\n                );\n                writer.writeInline(\"@param mux The {@link __Mux} that verifies which service and operation are being \");\n                writer.write(\"invoked by a given {@link __HttpRequest}\");\n                writer.write(\"@param serializer An {@link __OperationSerializer} for $T that \", operationSymbol);\n                writer\n                    .writeInline(\"                  \")\n                    .write(\"handles deserialization of requests and serialization of responses\");\n                writer.write(\n                    \"@param serializeFrameworkException A function that can serialize \" +\n                        \"{@link __SmithyFrameworkException}s\"\n                );\n                writer.write(\n                    \"@param validationCustomizer A {@link __ValidationCustomizer} for turning validation \" +\n                        \"failures into {@link __SmithyFrameworkException}s\"\n                );\n            });\n            writer.openBlock(\"constructor(\", \") {\", () -> {\n                writer.write(\"operation: __Operation<$T, $T, Context>,\", inputSymbol, outputSymbol);\n                writer.write(\"mux: __Mux<$S, $S>,\", serviceShape.getId().getName(), operationName);\n                writer.write(\n                    \"serializer: __OperationSerializer<$T<Context>, $S, $T>,\",\n                    serviceSymbol,\n                    operationName,\n                    errorsSymbol\n                );\n                writer.write(\n                    \"serializeFrameworkException: (e: __SmithyFrameworkException, ctx: __ServerSerdeContext) \" +\n                        \"=> Promise<__HttpResponse>,\"\n                );\n                writer.write(\"validationCustomizer: __ValidationCustomizer<$S>\", operationName);\n            });\n            writer.indent();\n            writer.write(\"this.operation = operation;\");\n            writer.write(\"this.mux = mux;\");\n            writer.write(\"this.serializer = serializer;\");\n            writer.write(\"this.serializeFrameworkException = serializeFrameworkException;\");\n            writer.write(\"this.validationCustomizer = validationCustomizer;\");\n            writer.closeBlock(\"}\");\n            writer.openBlock(\n                \"async handle(request: __HttpRequest, context: Context): Promise<__HttpResponse> {\",\n                \"}\",\n                () -> {\n                    writer.write(\"const target = this.mux.match(request);\");\n                    writer.openBlock(\"if (target === undefined) {\", \"}\", () -> {\n                        writer.write(\n                            \"console.log('Received a request that did not match $L.$L. This indicates a \" +\n                                \"misconfiguration.');\",\n                            serviceShape.getId(),\n                            operation.getId().getName()\n                        );\n                        writer.write(\n                            \"return this.serializeFrameworkException(new __InternalFailureException(), \" +\n                                \"serdeContextBase);\"\n                        );\n                    });\n                    writer.write(\n                        \"return handle(request, context, $S, this.serializer, this.operation, \" +\n                            \"this.serializeFrameworkException, $T.validate, this.validationCustomizer);\",\n                        operationName,\n                        inputSymbol\n                    );\n                }\n            );\n        });\n    }\n\n    private static void addCommonHandlerImports(TypeScriptWriter writer) {\n        writer.addImport(\"Operation\", \"__Operation\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"ServiceHandler\", \"__ServiceHandler\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"Mux\", \"__Mux\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"OperationSerializer\", \"__OperationSerializer\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"InternalFailureException\", \"__InternalFailureException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"SerializationException\", \"__SerializationException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"SmithyFrameworkException\", \"__SmithyFrameworkException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImportSubmodule(\n            \"HttpRequest\",\n            \"__HttpRequest\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n        writer.addImportSubmodule(\n            \"HttpResponse\",\n            \"__HttpResponse\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n        writer.addImport(\"ServiceException\", \"__ServiceException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"ValidationCustomizer\", \"__ValidationCustomizer\", TypeScriptDependency.SERVER_COMMON);\n    }\n\n    private static void writeHandleFunction(TypeScriptWriter writer) {\n        writer.addImport(\"Operation\", \"__Operation\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"OperationInput\", \"__OperationInput\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"OperationOutput\", \"__OperationOutput\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"ValidationCustomizer\", \"__ValidationCustomizer\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"isFrameworkException\", \"__isFrameworkException\", TypeScriptDependency.SERVER_COMMON);\n\n        writer.openBlock(\n            \"async function handle<S, O extends keyof S & string, Context>(\",\n            \"): Promise<__HttpResponse> {\",\n            () -> {\n                writer.write(\"request: __HttpRequest,\");\n                writer.write(\"context: Context,\");\n                writer.write(\"operationName: O,\");\n                writer.write(\"serializer: __OperationSerializer<S, O, __ServiceException>,\");\n                writer.write(\"operation: __Operation<__OperationInput<S[O]>, __OperationOutput<S[O]>, Context>,\");\n                writer.write(\n                    \"serializeFrameworkException: (e: __SmithyFrameworkException, \" +\n                        \"ctx: __ServerSerdeContext) => Promise<__HttpResponse>,\"\n                );\n                writer.write(\"validationFn: (input: __OperationInput<S[O]>) => __ValidationFailure[],\");\n                writer.write(\"validationCustomizer: __ValidationCustomizer<O>\");\n            }\n        );\n        writer.indent();\n        writer.write(\"let input;\");\n        writer.openBlock(\"try {\", \"} catch (error: unknown) {\", () -> {\n            writer.openBlock(\"input = await serializer.deserialize(request, {\", \"});\", () -> {\n                writer.write(\"endpoint: () => Promise.resolve(request), ...serdeContextBase\");\n            });\n        });\n        writer.indent();\n        writer.openBlock(\"if (__isFrameworkException(error)) {\", \"};\", () -> {\n            writer.write(\"return serializeFrameworkException(error, serdeContextBase);\");\n        });\n        writer.write(\"return serializeFrameworkException(new __SerializationException(), \" + \"serdeContextBase);\");\n        writer.closeBlock(\"}\");\n        writer.openBlock(\"try {\", \"} catch(error: unknown) {\", () -> {\n            writer.write(\"let validationFailures = validationFn(input);\");\n            writer.openBlock(\"if (validationFailures && validationFailures.length > 0) {\", \"}\", () -> {\n                writer.write(\n                    \"let validationException = validationCustomizer({ operation: operationName }, \" +\n                        \"validationFailures);\"\n                );\n                writer.openBlock(\"if (validationException) {\", \"}\", () -> {\n                    writer.write(\"return serializer.serializeError(validationException, serdeContextBase);\");\n                });\n            });\n            writer.write(\"let output = await operation(input, context);\");\n            writer.write(\"return serializer.serialize(output, serdeContextBase);\");\n        });\n        writer.indent();\n        writer.openBlock(\"if (serializer.isOperationError(error)) {\", \"}\", () -> {\n            writer.write(\"return serializer.serializeError(error, serdeContextBase);\");\n        });\n        writer.write(\"console.log('Received an unexpected error', error);\");\n        writer.write(\"return serializeFrameworkException(new __InternalFailureException(), \" + \"serdeContextBase);\");\n        writer.closeBlock(\"}\");\n        writer.closeBlock(\"}\");\n    }\n\n    private static void writeSerdeContextBase(TypeScriptWriter writer) {\n        writer.addImport(\"ServerSerdeContext\", \"__ServerSerdeContext\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"NodeHttpHandler\", null, TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER);\n        writer.addImport(\"streamCollector\", null, TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER);\n        writer.addImportSubmodule(\"fromBase64\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n        writer.addImportSubmodule(\"toBase64\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n        writer.addImportSubmodule(\"fromUtf8\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n        writer.addImportSubmodule(\"toUtf8\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.SERDE);\n\n        writer.openBlock(\"const serdeContextBase = {\", \"};\", () -> {\n            writer.write(\"base64Encoder: toBase64,\");\n            writer.write(\"base64Decoder: fromBase64,\");\n            writer.write(\"utf8Encoder: toUtf8,\");\n            writer.write(\"utf8Decoder: fromUtf8,\");\n            writer.write(\"streamCollector: streamCollector,\");\n            writer.write(\"requestHandler: new NodeHttpHandler(),\");\n            writer.write(\"disableHostPrefix: true\");\n        });\n    }\n\n    static void generateServerInterfaces(\n        SymbolProvider symbolProvider,\n        ServiceShape service,\n        Set<OperationShape> operations,\n        TypeScriptWriter writer\n    ) {\n        writer.addImport(\"Operation\", \"__Operation\", TypeScriptDependency.SERVER_COMMON);\n\n        String serviceInterfaceName = symbolProvider.toSymbol(service).getName();\n\n        writer.openCollapsibleBlock(\n            \"export interface $L<Context> {\",\n            \"}\",\n            !operations.isEmpty(),\n            serviceInterfaceName,\n            () -> {\n                for (OperationShape operation : operations) {\n                    Symbol symbol = symbolProvider.toSymbol(operation);\n                    writer.write(\"$L: $T<Context>\", symbol.getName(), symbol);\n                }\n            }\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerSymbolVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static software.amazon.smithy.typescript.codegen.TypeScriptDependency.SERVER_COMMON;\n\nimport java.nio.file.Paths;\nimport java.util.logging.Logger;\nimport software.amazon.smithy.codegen.core.ReservedWordSymbolProvider;\nimport software.amazon.smithy.codegen.core.ReservedWords;\nimport software.amazon.smithy.codegen.core.ReservedWordsBuilder;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeType;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.model.shapes.ToShapeId;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * Wraps a client SymbolProvider and generates substitute shapes for server-specific symbols.\n */\n@SmithyInternalApi\nfinal class ServerSymbolVisitor extends ShapeVisitor.Default<Symbol> implements SymbolProvider {\n\n    static final String SERVER_FOLDER = \"server\";\n    private static final Logger LOGGER = Logger.getLogger(ServerSymbolVisitor.class.getName());\n\n    private final Model model;\n    private final SymbolProvider delegate;\n    private final ReservedWordSymbolProvider.Escaper escaper;\n    private final ModuleNameDelegator moduleNameDelegator;\n\n    ServerSymbolVisitor(Model model, SymbolProvider delegate) {\n        this.model = model;\n        this.delegate = delegate;\n\n        // Load reserved words from a new-line delimited file.\n        ReservedWords reservedWords = new ReservedWordsBuilder()\n            .loadWords(TypeScriptCodegenPlugin.class.getResource(\"reserved-words.txt\"))\n            .build();\n\n        escaper = ReservedWordSymbolProvider.builder()\n            .nameReservedWords(reservedWords)\n            // Only escape words when the symbol has a definition file to\n            // prevent escaping intentional references to built-in types.\n            .escapePredicate((shape, symbol) -> !StringUtils.isEmpty(symbol.getDefinitionFile()))\n            .buildEscaper();\n\n        moduleNameDelegator = new ModuleNameDelegator();\n    }\n\n    @Override\n    public Symbol toSymbol(Shape shape) {\n        if (shape.getType() == ShapeType.SERVICE || shape.getType() == ShapeType.OPERATION) {\n            Symbol symbol = shape.accept(this);\n            LOGGER.fine(() -> \"Creating symbol from \" + shape + \": \" + symbol);\n            return escaper.escapeSymbol(shape, symbol);\n        }\n        return delegate.toSymbol(shape);\n    }\n\n    @Override\n    public Symbol operationShape(OperationShape shape) {\n        String shapeName = flattenShapeName(shape);\n        String moduleName = moduleNameDelegator.formatModuleName(shape, shapeName);\n\n        Symbol intermediate = createGeneratedSymbolBuilder(shape, shapeName, moduleName).build();\n        Symbol.Builder builder = intermediate.toBuilder();\n        //TODO: these names suck but otherwise they clash with the names in models\n        builder.putProperty(\"inputType\", intermediate.toBuilder().name(shapeName + \"ServerInput\").build());\n        builder.putProperty(\"outputType\", intermediate.toBuilder().name(shapeName + \"ServerOutput\").build());\n        builder.putProperty(\"errorsType\", intermediate.toBuilder().name(shapeName + \"Errors\").build());\n        builder.putProperty(\"serializerType\", intermediate.toBuilder().name(shapeName + \"Serializer\").build());\n        builder.putProperty(\"handler\", intermediate.toBuilder().name(shapeName + \"Handler\").build());\n        return builder.build();\n    }\n\n    @Override\n    public Symbol serviceShape(ServiceShape shape) {\n        String baseName = flattenShapeName(shape);\n        String serviceName = baseName + \"Service\";\n        String moduleName = moduleNameDelegator.formatModuleName(shape, serviceName);\n\n        Symbol intermediate = createGeneratedSymbolBuilder(shape, serviceName, moduleName).build();\n        Symbol.Builder builder = intermediate.toBuilder().addDependency(SERVER_COMMON);\n        builder.putProperty(\"operations\", intermediate.toBuilder().name(serviceName + \"Operations\").build());\n        builder.putProperty(\"handler\", intermediate.toBuilder().name(serviceName + \"Handler\").build());\n        return builder.build();\n    }\n\n    @Override\n    protected Symbol getDefault(Shape shape) {\n        return delegate.toSymbol(shape);\n    }\n\n    // TODO: Can probably share these statically with SymbolVisitor\n    private String flattenShapeName(ToShapeId id) {\n        return StringUtils.capitalize(id.toShapeId().getName());\n    }\n\n    private Symbol.Builder createGeneratedSymbolBuilder(Shape shape, String typeName, String namespace) {\n        String prefixedNamespace = Paths.get(\n            \".\",\n            CodegenUtils.SOURCE_FOLDER,\n            (namespace.startsWith(\".\") ? namespace.substring(1) : namespace)\n        ).toString();\n        return createSymbolBuilder(shape, typeName, prefixedNamespace).definitionFile(toFilename(prefixedNamespace));\n    }\n\n    private Symbol.Builder createSymbolBuilder(Shape shape, String typeName, String namespace) {\n        return Symbol.builder().putProperty(\"shape\", shape).name(typeName).namespace(namespace, \"/\");\n    }\n\n    private String toFilename(String namespace) {\n        return namespace + \".ts\";\n    }\n\n    static final class ModuleNameDelegator {\n\n        public String formatModuleName(Shape shape, String name) {\n            if (shape.getType() == ShapeType.SERVICE) {\n                return Paths.get(SERVER_FOLDER, name).toString();\n            } else if (shape.getType() == ShapeType.OPERATION) {\n                return Paths.get(SERVER_FOLDER, ServerCommandGenerator.COMMANDS_FOLDER, name).toString();\n            }\n\n            throw new IllegalArgumentException(\"Unsupported shape type: \" + shape.getType());\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceAggregatedClientGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.PaginatedTrait;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\nimport software.amazon.smithy.waiters.WaitableTrait;\nimport software.amazon.smithy.waiters.Waiter;\n\n/**\n * Generates aggregated client for service.\n *\n * <p>This client extends from the bare-bones client and provides named methods\n * for every operation in the service. Using this client means that all\n * operations of a service are considered referenced, meaning they will\n * not be removed by tree-shaking.\n */\n@SmithyInternalApi\nfinal class ServiceAggregatedClientGenerator implements Runnable {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptWriter writer;\n    private final String aggregateClientName;\n    private final Symbol serviceSymbol;\n    private final ApplicationProtocol applicationProtocol;\n    private final ServiceClosure closure;\n\n    ServiceAggregatedClientGenerator(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        String aggregateClientName,\n        TypeScriptWriter writer,\n        ApplicationProtocol applicationProtocol\n    ) {\n        this.settings = settings;\n        this.model = model;\n        this.service = settings.getService(model);\n        this.symbolProvider = symbolProvider;\n        this.writer = writer;\n        this.aggregateClientName = aggregateClientName;\n        this.applicationProtocol = applicationProtocol;\n        serviceSymbol = symbolProvider.toSymbol(service).toBuilder().putProperty(\"typeOnly\", false).build();\n        closure = ServiceClosure.of(model, settings.getService(model));\n    }\n\n    @Override\n    public void run() {\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        final Set<OperationShape> containedOperations = new TreeSet<>(topDownIndex.getContainedOperations(service));\n\n        boolean hasPaginators = !closure.getPaginatedOperationShapes().isEmpty();\n        boolean hasWaiters = !closure.getWaitableOperationShapes().isEmpty();\n\n        writer.openBlock(\"const commands = {\");\n        for (OperationShape operation : containedOperations) {\n            Symbol operationSymbol = symbolProvider\n                .toSymbol(operation)\n                .toBuilder()\n                .putProperty(\"typeOnly\", false)\n                .build();\n            writer.write(\"$T,\", operationSymbol);\n            if (operation.hasTrait(PaginatedTrait.ID)) {\n                hasPaginators = true;\n            }\n            if (operation.hasTrait(WaitableTrait.ID)) {\n                hasWaiters = true;\n            }\n        }\n        writer.closeBlock(\"};\");\n\n        if (hasPaginators) {\n            writer.openBlock(\"const paginators = {\");\n            for (OperationShape operation : closure.getPaginatedOperationShapes()) {\n                String paginatorFnName = \"paginate\" + operation.getId().getName();\n                String paginatorLocalName = \"paginate\" + StringUtils.capitalize(operation.getId().getName());\n                writer.addRelativeImport(\n                    paginatorFnName,\n                    paginatorLocalName,\n                    Paths.get(\n                        \".\",\n                        CodegenUtils.SOURCE_FOLDER,\n                        PaginationGenerator.getOutputFileLocation(operation)\n                            .replaceFirst(\"(.*?)pagination(.*?)\\\\.ts$\", \"pagination$2\")\n                    )\n                );\n                writer.write(\"$L,\", paginatorLocalName);\n            }\n            writer.closeBlock(\"};\");\n        }\n\n        if (hasWaiters) {\n            writer.openBlock(\"const waiters = {\");\n            for (OperationShape operation : closure.getWaitableOperationShapes()) {\n                WaitableTrait waitableTrait = operation.expectTrait(WaitableTrait.class);\n                waitableTrait\n                    .getWaiters()\n                    .forEach((String waiterName, Waiter waiter) -> {\n                        String waiterFnName = \"waitUntil\" + waiterName;\n                        // note: this should never differ since smithy validation requires TitleCase waiter names.\n                        String waiterLocalName = \"waitUntil\" + StringUtils.capitalize(waiterName);\n\n                        writer.addRelativeImport(\n                            waiterFnName,\n                            waiterLocalName,\n                            Paths.get(\n                                \".\",\n                                CodegenUtils.SOURCE_FOLDER,\n                                WaiterGenerator.getOutputFileLocation(waiterName)\n                                    .replaceFirst(\"(.*?)waiters(.*?)\\\\.ts$\", \"waiters$2\")\n                            )\n                        );\n                        writer.write(\"$L,\", waiterLocalName);\n                    });\n            }\n            writer.closeBlock(\"};\");\n        }\n\n        writer.write(\"\");\n\n        // Generate an aggregated client interface.\n        writer.openBlock(\"export interface $L {\", \"}\", aggregateClientName, () -> {\n            for (OperationShape operation : containedOperations) {\n                Symbol operationSymbol = symbolProvider.toSymbol(operation);\n                Symbol input = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n                Symbol output = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n                writer.addUseImports(operationSymbol);\n                String methodName = StringUtils.uncapitalize(operationSymbol.getName().replaceAll(\"Command$\", \"\"));\n\n                // Generate a multiple overloaded methods for each command.\n                writer.writeDocs(\"@see {@link \" + operationSymbol.getName() + \"}\");\n                boolean inputOptional = model\n                    .getShape(operation.getInputShape())\n                    .map(shape -> shape.getAllMembers().values().stream().noneMatch(MemberShape::isRequired))\n                    .orElse(true);\n                if (inputOptional) {\n                    writer.write(\"$L(): Promise<$T>;\", methodName, output);\n                }\n                writer.write(\n                    \"\"\"\n                    $1L(\n                      args: $2T,\n                      options?: $3T\n                    ): Promise<$4T>;\n                    $1L(\n                      args: $2T,\n                      cb: (err: any, data?: $4T) => void\n                    ): void;\n                    $1L(\n                      args: $2T,\n                      options: $3T,\n                      cb: (err: any, data?: $4T) => void\n                    ): void;\"\"\",\n                    methodName,\n                    input,\n                    applicationProtocol.getOptionsType(),\n                    output\n                );\n                writer.write(\"\");\n            }\n\n            for (OperationShape operation : closure.getPaginatedOperationShapes()) {\n                if (operation.hasTrait(PaginatedTrait.ID)) {\n                    String paginatorLocalName = \"paginate\" + StringUtils.capitalize(operation.getId().getName());\n\n                    Symbol operationSymbol = symbolProvider.toSymbol(operation);\n                    Symbol input = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n                    Symbol output = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n\n                    writer.addTypeImport(\"Paginator\", null, TypeScriptDependency.SMITHY_TYPES);\n                    writer.addTypeImport(\"PaginationConfiguration\", null, TypeScriptDependency.SMITHY_TYPES);\n\n                    boolean inputOptional = model\n                        .getShape(operation.getInputShape())\n                        .map(shape -> shape.getAllMembers().values().stream().noneMatch(MemberShape::isRequired))\n                        .orElse(true);\n\n                    String inputOptionality = inputOptional ? \"?\" : \"\";\n\n                    writer.writeDocs(\n                        \"\"\"\n                        @see {@link %s}\n                        @param args - command input.\n                        @param paginationConfig - optional pagination config.\n                        @returns AsyncIterable of {@link %s}.\"\"\".formatted(operationSymbol.getName(), output.getName())\n                    );\n                    writer.write(\n                        \"\"\"\n                        $1L(\n                          args$5L: $2T,\n                          paginationConfig?: Omit<$3L, \"client\">\n                        ): Paginator<$4T>;\n                        \"\"\",\n                        paginatorLocalName,\n                        input,\n                        \"PaginationConfiguration\",\n                        output,\n                        inputOptionality\n                    );\n                }\n            }\n\n            for (OperationShape operation : closure.getWaitableOperationShapes()) {\n                if (operation.hasTrait(WaitableTrait.ID)) {\n                    WaitableTrait waitableTrait = operation.expectTrait(WaitableTrait.class);\n\n                    Symbol operationSymbol = symbolProvider.toSymbol(operation);\n                    Symbol input = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n                    Symbol output = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n\n                    String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n                    String syntheticBaseExceptionName =\n                        CodegenUtils.getSyntheticBaseExceptionName(serviceName, model);\n                    writer.addRelativeTypeImport(\n                        syntheticBaseExceptionName,\n                        null,\n                        Paths.get(\n                            \".\",\n                            CodegenUtils.SOURCE_FOLDER,\n                            \"models\",\n                            syntheticBaseExceptionName\n                        )\n                    );\n                    String waiterResultType = output.getName() + \" | \" + syntheticBaseExceptionName;\n\n                    waitableTrait\n                        .getWaiters()\n                        .forEach((String waiterName, Waiter waiter) -> {\n                            String waiterLocalName = \"waitUntil\" + StringUtils.capitalize(waiterName);\n\n                            writer.addTypeImport(\"WaiterConfiguration\", null, TypeScriptDependency.SMITHY_TYPES);\n                            writer.addTypeImportSubmodule(\n                                \"WaiterResult\",\n                                null,\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.CLIENT\n                            );\n\n                            String waitUntilResultType = WaiterGenerator.computeWaitUntilResultType(\n                                waiter,\n                                output.getName(),\n                                syntheticBaseExceptionName,\n                                settings,\n                                model,\n                                symbolProvider,\n                                writer\n                            );\n\n                            writer.writeDocs(\n                                \"\"\"\n                                @see {@link %s}\n                                @param args - command input.\n                                @param waiterConfig - `maxWaitTime` in seconds or waiter config object.\"\"\"\n                                    .formatted(operationSymbol.getName())\n                            );\n                            writer.write(\n                                \"\"\"\n                                $1L(\n                                  args: $2T,\n                                  waiterConfig: number | Omit<$3L, \"client\">\n                                ): Promise<WaiterResult<$4L>>;\n                                \"\"\",\n                                waiterLocalName,\n                                input,\n                                \"WaiterConfiguration<\" + aggregateClientName + \">\",\n                                waitUntilResultType\n                            );\n                        });\n                }\n            }\n\n            writer.unwrite(\"\\n\");\n        });\n\n        writer.write(\"\");\n\n        // Generate the client and extend from the bare-bones client.\n        writer.writeShapeDocs(service);\n        writer.write(\n            \"export class $L extends $T implements $L {}\",\n            aggregateClientName,\n            serviceSymbol,\n            aggregateClientName\n        );\n\n        writer.addImportSubmodule(\n            \"createAggregatedClient\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n\n        if (hasPaginators && hasWaiters) {\n            writer.write(\"createAggregatedClient(commands, $L, { paginators, waiters });\", aggregateClientName);\n        } else if (hasPaginators) {\n            writer.write(\"createAggregatedClient(commands, $L, { paginators });\", aggregateClientName);\n        } else if (hasWaiters) {\n            writer.write(\"createAggregatedClient(commands, $L, { waiters });\", aggregateClientName);\n        } else {\n            writer.write(\"createAggregatedClient(commands, $L);\", aggregateClientName);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.EndpointsV2Generator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist;\nimport software.amazon.smithy.typescript.codegen.sections.ClientBodyExtraCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.ClientConfigCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.ClientConstructorCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.ClientDestroyCodeSection;\nimport software.amazon.smithy.typescript.codegen.sections.ClientPropertiesCodeSection;\nimport software.amazon.smithy.typescript.codegen.util.ClientWriterConsumer;\nimport software.amazon.smithy.utils.OptionalUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates a bare-bones client and configuration for service using plugins.\n */\n@SmithyInternalApi\npublic final class ServiceBareBonesClientGenerator implements Runnable {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptWriter writer;\n    private final Symbol symbol;\n    private final String configType;\n    private final String resolvedConfigType;\n    private final List<TypeScriptIntegration> integrations;\n    private final List<RuntimeClientPlugin> runtimePlugins;\n    private final ApplicationProtocol applicationProtocol;\n\n    ServiceBareBonesClientGenerator(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        List<TypeScriptIntegration> integrations,\n        List<RuntimeClientPlugin> runtimePlugins,\n        ApplicationProtocol applicationProtocol\n    ) {\n        this.settings = settings;\n        this.model = model;\n        this.service = settings.getService(model);\n        this.symbolProvider = symbolProvider;\n        this.writer = writer;\n        this.integrations = integrations;\n        this.runtimePlugins = runtimePlugins\n            .stream()\n            // Only apply plugins that target the entire client.\n            .filter(plugin -> plugin.matchesService(model, service))\n            .collect(Collectors.toList());\n        this.applicationProtocol = applicationProtocol;\n\n        symbol = symbolProvider.toSymbol(service);\n        configType = getConfigTypeName(symbol);\n        resolvedConfigType = getResolvedConfigTypeName(symbol);\n    }\n\n    public static String getConfigTypeName(Symbol symbol) {\n        return symbol.getName() + \"Config\";\n    }\n\n    public static String getResolvedConfigTypeName(Symbol symbol) {\n        return symbol.getName() + \"ResolvedConfig\";\n    }\n\n    @Override\n    public void run() {\n        writer.addImportSubmodule(\"Client\", \"__Client\", TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        writer.write(\"export { __Client };\\n\");\n        writer.addRelativeImport(\n            \"getRuntimeConfig\",\n            \"__getRuntimeConfig\",\n            Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"runtimeConfig\")\n        );\n\n        // Normalize the input and output types of the command to account for\n        // things like an operation adding input where there once wasn't any\n        // input, adding output, naming differences between services, etc.\n        writeInputOutputTypeUnion(\n            \"ServiceInputTypes\",\n            writer,\n            operationSymbol -> operationSymbol.getProperty(\"inputType\", Symbol.class),\n            writer -> {\n                // Use an empty object if an operation doesn't define input.\n                writer.write(\"| {}\");\n            }\n        );\n        writeInputOutputTypeUnion(\n            \"ServiceOutputTypes\",\n            writer,\n            operationSymbol -> operationSymbol.getProperty(\"outputType\", Symbol.class),\n            writer -> {\n                // Use a MetadataBearer if an operation doesn't define output.\n                writer.addTypeImport(\"MetadataBearer\", \"__MetadataBearer\", TypeScriptDependency.SMITHY_TYPES);\n                writer.write(\"| __MetadataBearer\");\n            }\n        );\n\n        generateConfig();\n        writer.write(\"\");\n        generateService();\n    }\n\n    private void writeInputOutputTypeUnion(\n        String typeName,\n        TypeScriptWriter writer,\n        Function<Symbol, Optional<Symbol>> mapper,\n        Consumer<TypeScriptWriter> defaultTypeGenerator\n    ) {\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> containedOperations = topDownIndex.getContainedOperations(service);\n\n        List<Symbol> symbols = containedOperations\n            .stream()\n            .map(symbolProvider::toSymbol)\n            .flatMap(operation -> OptionalUtils.stream(mapper.apply(operation)))\n            .sorted(Comparator.comparing(Symbol::getName))\n            .collect(Collectors.toList());\n\n        writer.writeDocs(\"@public\");\n        writer.write(\"export type $L = \", typeName);\n        writer.indent();\n        // If we have less symbols than operations, at least one doesn't have a type, so add the default.\n        if (containedOperations.size() != symbols.size() || containedOperations.isEmpty()) {\n            defaultTypeGenerator.accept(writer);\n        }\n        for (int i = 0; i < symbols.size(); i++) {\n            Symbol symbol = symbols.get(i);\n            writer.write(\"| $T$L\", symbol, i == symbols.size() - 1 ? \";\" : \"\");\n        }\n        writer.dedent();\n        writer.write(\"\");\n    }\n\n    private void generateConfig() {\n        writer.addRelativeTypeImport(\n            \"RuntimeExtensionsConfig\",\n            null,\n            Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"runtimeExtensions\")\n        );\n        writer.addTypeImportSubmodule(\n            \"SmithyConfiguration\",\n            \"__SmithyConfiguration\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n        writer.addTypeImportSubmodule(\n            \"SmithyResolvedConfiguration\",\n            \"__SmithyResolvedConfiguration\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n\n        // Hook for intercepting the client configuration.\n        writer.pushState(\n            ClientConfigCodeSection.builder()\n                .settings(settings)\n                .model(model)\n                .service(service)\n                .symbolProvider(symbolProvider)\n                .integrations(integrations)\n                .runtimeClientPlugins(runtimePlugins)\n                .applicationProtocol(applicationProtocol)\n                .build()\n        );\n\n        generateClientDefaults();\n\n        writer.writeDocs(\"@public\");\n        // The default configuration type is always just the base-level\n        // Smithy configuration requirements.\n        writer.write(\n            \"export type $LType = Partial<__SmithyConfiguration<$T>> &\",\n            configType,\n            applicationProtocol.getOptionsType()\n        );\n        writer.indent();\n        writer.write(\"ClientDefaults &\");\n\n        // Get the configuration symbol types to reference in code. These are\n        // all \"&\"'d together to create a big configuration type that aggregates\n        // more modular configuration types.\n        List<SymbolReference> inputTypes = runtimePlugins\n            .stream()\n            .flatMap(p -> OptionalUtils.stream(p.getInputConfig()))\n            .collect(Collectors.toList());\n\n        if (!inputTypes.isEmpty()) {\n            for (SymbolReference symbolReference : inputTypes) {\n                if (symbolReference.getAlias().equals(\"EndpointInputConfig\")) {\n                    writer.addTypeImport(\n                        \"EndpointParameters\",\n                        null,\n                        EndpointsV2Generator.ENDPOINT_PARAMETERS_DEPENDENCY\n                    );\n                    writer.write(\"$T<$L> &\", symbolReference, \"EndpointParameters\");\n                } else {\n                    writer.write(\"$T &\", symbolReference);\n                }\n            }\n            writer.addTypeImport(\n                \"ClientInputEndpointParameters\",\n                null,\n                EndpointsV2Generator.ENDPOINT_PARAMETERS_DEPENDENCY\n            );\n            writer.write(\"ClientInputEndpointParameters;\");\n            writer.dedent();\n        }\n\n        writer.writeDocs(\n            String.format(\n                \"%s The configuration interface of %s class constructor that set the region, \" +\n                    \"credentials and other options.\",\n                \"@public\\n\\n\",\n                symbol.getName()\n            )\n        );\n        writer.write(\"export interface $1L extends $1LType {}\", configType);\n\n        // Generate the corresponding \"Resolved\" configuration type to account for\n        // each \"Input\" configuration type.\n        writer.write(\"\");\n        writer.writeDocs(\"@public\");\n        writer.write(\n            \"export type $LType = __SmithyResolvedConfiguration<$T> &\",\n            resolvedConfigType,\n            applicationProtocol.getOptionsType()\n        );\n        writer.indent();\n        writer.write(\"Required<ClientDefaults> &\");\n        writer.write(\"RuntimeExtensionsConfig &\");\n\n        if (!inputTypes.isEmpty()) {\n            runtimePlugins\n                .stream()\n                .flatMap(p -> OptionalUtils.stream(p.getResolvedConfig()))\n                .forEach(symbol -> {\n                    if (symbol.getAlias().equals(\"EndpointResolvedConfig\")) {\n                        writer.addTypeImport(\n                            \"EndpointParameters\",\n                            null,\n                            EndpointsV2Generator.ENDPOINT_PARAMETERS_DEPENDENCY\n                        );\n                        writer.write(\"$T<$L> &\", symbol, \"EndpointParameters\");\n                    } else {\n                        writer.write(\"$T &\", symbol);\n                    }\n                });\n            writer.addTypeImport(\n                \"ClientResolvedEndpointParameters\",\n                null,\n                EndpointsV2Generator.ENDPOINT_PARAMETERS_DEPENDENCY\n            );\n            writer.write(\"ClientResolvedEndpointParameters;\");\n            writer.dedent();\n        }\n\n        writer.writeDocs(\n            String.format(\n                \"%s The resolved configuration interface of %s class. This is resolved and\" +\n                    \" normalized from the {@link %s | constructor configuration interface}.\",\n                \"@public\\n\\n\",\n                symbol.getName(),\n                configType\n            )\n        );\n        writer.write(\"export interface $1L extends $1LType {}\", resolvedConfigType);\n\n        writer.popState();\n    }\n\n    private void generateClientDefaults() {\n        if (!applicationProtocol.isHttpProtocol()) {\n            throw new UnsupportedOperationException(\n                \"Protocols other than HTTP are not yet implemented: \" + applicationProtocol\n            );\n        }\n\n        Runnable innerContent = () -> {\n            writer.addTypeImportSubmodule(\n                \"HttpHandlerUserInput\",\n                \"__HttpHandlerUserInput\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.PROTOCOLS\n            );\n            writer.writeDocs(\n                \"The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.\"\n            );\n            writer.write(\"requestHandler?: __HttpHandlerUserInput;\\n\");\n\n            writer.addTypeImport(\"HashConstructor\", \"__HashConstructor\", TypeScriptDependency.SMITHY_TYPES);\n            writer.addTypeImport(\"ChecksumConstructor\", \"__ChecksumConstructor\", TypeScriptDependency.SMITHY_TYPES);\n            writer.writeDocs(\n                \"\"\"\n                A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface\n                that computes the SHA-256 HMAC or checksum of a string or binary buffer.\n                @internal\"\"\"\n            );\n            writer.write(\"sha256?: __ChecksumConstructor | __HashConstructor;\\n\");\n\n            writer.addTypeImport(\"UrlParser\", \"__UrlParser\", TypeScriptDependency.SMITHY_TYPES);\n            writer.writeDocs(\"The function that will be used to convert strings into HTTP endpoints.\\n\" + \"@internal\");\n            writer.write(\"urlParser?: __UrlParser;\\n\");\n\n            writer.addTypeImport(\"BodyLengthCalculator\", \"__BodyLengthCalculator\", TypeScriptDependency.SMITHY_TYPES);\n            writer.writeDocs(\"A function that can calculate the length of a request body.\\n\" + \"@internal\");\n            writer.write(\"bodyLengthChecker?: __BodyLengthCalculator;\\n\");\n\n            writer.addTypeImport(\"StreamCollector\", \"__StreamCollector\", TypeScriptDependency.SMITHY_TYPES);\n            writer.writeDocs(\"A function that converts a stream into an array of bytes.\\n\" + \"@internal\");\n            writer.write(\"streamCollector?: __StreamCollector;\\n\");\n\n            // Note: Encoder and Decoder are both used for base64 and UTF.\n            writer.addTypeImport(\"Encoder\", \"__Encoder\", TypeScriptDependency.SMITHY_TYPES);\n            writer.addTypeImport(\"Decoder\", \"__Decoder\", TypeScriptDependency.SMITHY_TYPES);\n\n            writer.writeDocs(\n                \"The function that will be used to convert a base64-encoded string to a byte array.\\n\"\n                    + \"@internal\"\n            );\n            writer.write(\"base64Decoder?: __Decoder;\\n\");\n\n            writer.writeDocs(\n                \"The function that will be used to convert binary data to a base64-encoded string.\\n\"\n                    + \"@internal\"\n            );\n            writer.write(\"base64Encoder?: __Encoder;\\n\");\n\n            writer.writeDocs(\n                \"The function that will be used to convert a UTF8-encoded string to a byte array.\\n\" + \"@internal\"\n            );\n            writer.write(\"utf8Decoder?: __Decoder;\\n\");\n\n            writer.writeDocs(\n                \"The function that will be used to convert binary data to a UTF-8 encoded string.\\n\" + \"@internal\"\n            );\n            writer.write(\"utf8Encoder?: __Encoder;\\n\");\n\n            writer.writeDocs(\"The runtime environment.\\n\" + \"@internal\");\n            writer.write(\"runtime?: string;\\n\");\n\n            writer.writeDocs(\n                \"Disable dynamically changing the endpoint of the client based on the hostPrefix \\n\" +\n                    \"trait of an operation.\"\n            );\n            writer.write(\"disableHostPrefix?: boolean;\\n\");\n\n            // Write custom configuration dependencies.\n            for (TypeScriptIntegration integration : integrations) {\n                integration.addConfigInterfaceFields(settings, model, symbolProvider, writer);\n            }\n        };\n        writer\n            .writeDocs(\"@public\")\n            .openBlock(\n                \"export interface ClientDefaults extends Partial<__SmithyConfiguration<$T>> {\",\n                \"}\\n\",\n                applicationProtocol.getOptionsType(),\n                innerContent\n            );\n    }\n\n    private void generateService() {\n        // Write out the service.\n        writer.writeShapeDocs(service);\n        writer\n            .openBlock(\"\"\"\n                       export class $L extends __Client<\n                         $T,\n                         ServiceInputTypes,\n                         ServiceOutputTypes,\n                         $L\n                       > {\"\"\", \"}\", symbol.getName(), applicationProtocol.getOptionsType(), resolvedConfigType, () -> {\n                generateClientProperties();\n                generateConstructor();\n                writer.write(\"\");\n                generateDestroyMethod();\n                // Hook for adding more methods to the client.\n                writer.injectSection(\n                    ClientBodyExtraCodeSection.builder()\n                        .settings(settings)\n                        .model(model)\n                        .service(service)\n                        .symbolProvider(symbolProvider)\n                        .integrations(integrations)\n                        .runtimeClientPlugins(runtimePlugins)\n                        .applicationProtocol(applicationProtocol)\n                        .build()\n                );\n            });\n    }\n\n    private void generateClientProperties() {\n        // Hook for adding/changing client properties.\n        writer.pushState(\n            ClientPropertiesCodeSection.builder()\n                .settings(settings)\n                .model(model)\n                .service(service)\n                .symbolProvider(symbolProvider)\n                .integrations(integrations)\n                .applicationProtocol(applicationProtocol)\n                .build()\n        );\n        writer.writeDocs(\n            String.format(\n                \"The resolved configuration of %s class. This is resolved and normalized from \" +\n                    \"the {@link %s | constructor configuration interface}.\",\n                symbol.getName(),\n                configType\n            )\n        );\n        writer.write(\"readonly config: $L;\\n\", resolvedConfigType);\n        writer.popState();\n    }\n\n    private void generateConstructor() {\n        writer.addTypeImport(\n            \"CheckOptionalClientConfig\",\n            \"__CheckOptionalClientConfig\",\n            TypeScriptDependency.SMITHY_TYPES\n        );\n        writer.openBlock(\"constructor(...[configuration]: __CheckOptionalClientConfig<$L>) {\", \"}\", configType, () -> {\n            // Hook for adding/changing the client constructor.\n            writer.pushState(\n                ClientConstructorCodeSection.builder()\n                    .service(service)\n                    .runtimeClientPlugins(runtimePlugins)\n                    .model(model)\n                    .build()\n            );\n\n            int configVariable = 0;\n            String initialConfigVar = generateConfigVariable(configVariable);\n            writer.write(\"const $L = __getRuntimeConfig(configuration || {});\", initialConfigVar);\n            writer.write(\"super($L as any);\", initialConfigVar);\n            writer.write(\"this.initConfig = $L;\", initialConfigVar);\n\n            configVariable++;\n            writer.addImport(\n                \"resolveClientEndpointParameters\",\n                null,\n                EndpointsV2Generator.ENDPOINT_PARAMETERS_DEPENDENCY\n            );\n            writer.write(\n                \"const $L = $L($L);\",\n                generateConfigVariable(configVariable),\n                \"resolveClientEndpointParameters\",\n                generateConfigVariable(configVariable - 1)\n            );\n\n            // Add runtime plugin \"resolve\" method calls. These are invoked one\n            // after the other until all the runtime plugins have been called.\n            // Only plugins that have configuration are called. Each time the\n            // configuration is updated, the configuration variable is incremented\n            // (e.g., _config_0, _config_1, etc.).\n            for (RuntimeClientPlugin plugin : runtimePlugins) {\n                if (plugin.getResolveFunction().isPresent()) {\n                    configVariable++;\n                    // Construct additional parameters string\n                    Map<String, Object> paramsMap = plugin.getAdditionalResolveFunctionParameters(model, service, null);\n                    List<String> additionalParameters = CodegenUtils.getFunctionParametersList(paramsMap);\n                    String additionalParamsString = additionalParameters.isEmpty()\n                        ? \"\"\n                        : \", { \" + String.join(\", \", additionalParameters) + \" }\";\n\n                    // Construct writer context\n                    Map<String, Object> symbolMap = new HashMap<>();\n                    symbolMap.put(\"newConfig\", generateConfigVariable(configVariable));\n                    symbolMap.put(\"resolveFn\", plugin.getResolveFunction().get());\n                    symbolMap.put(\"oldConfig\", generateConfigVariable(configVariable - 1));\n                    for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {\n                        if (entry.getValue() instanceof Symbol) {\n                            symbolMap.put(entry.getKey(), entry.getValue());\n                        }\n                    }\n                    writer.pushState();\n                    writer.putContext(symbolMap);\n                    writer.write(\"const $newConfig:L = $resolveFn:T($oldConfig:L\" + additionalParamsString + \");\");\n                    writer.popState();\n                }\n            }\n\n            writer.addRelativeImport(\n                \"resolveRuntimeExtensions\",\n                null,\n                Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"runtimeExtensions\")\n            );\n\n            configVariable++;\n            writer.write(\n                \"const $L = resolveRuntimeExtensions($L, configuration?.extensions || []);\",\n                generateConfigVariable(configVariable),\n                generateConfigVariable(configVariable - 1)\n            );\n\n            writer.write(\"this.config = $L;\", generateConfigVariable(configVariable));\n\n            if (SchemaGenerationAllowlist.allows(service.getId(), settings)) {\n                writer.addImportSubmodule(\"getSchemaSerdePlugin\", null, TypeScriptDependency.SMITHY_CORE, \"/schema\");\n                writer.write(\n                    \"\"\"\n                    this.middlewareStack.use(getSchemaSerdePlugin(this.config));\"\"\"\n                );\n            }\n\n            // Add runtime plugins that contain middleware to the middleware stack\n            // of the client.\n            for (RuntimeClientPlugin plugin : runtimePlugins) {\n                plugin\n                    .getPluginFunction()\n                    .ifPresent(pluginSymbol -> {\n                        // Construct additional parameters string\n                        Map<String, Object> paramsMap = plugin.getAdditionalPluginFunctionParameters(\n                            model,\n                            service,\n                            null\n                        );\n\n                        // Construct writer context\n                        Map<String, Object> symbolMap = new HashMap<>();\n                        symbolMap.put(\"pluginFn\", pluginSymbol);\n                        for (Map.Entry<String, Object> entry : paramsMap.entrySet()) {\n                            if (entry.getValue() instanceof Symbol) {\n                                symbolMap.put(entry.getKey(), entry.getValue());\n                            }\n                        }\n                        writer.pushState();\n                        writer.putContext(symbolMap);\n\n                        boolean isAuthSchemeEndpointRuleSetPlugin = pluginSymbol\n                            .getAlias()\n                            .equals(\"getHttpAuthSchemeEndpointRuleSetPlugin\");\n\n                        if (isAuthSchemeEndpointRuleSetPlugin) {\n                            writer.openBlock(\"this.middlewareStack.use(\");\n                            writer.ensureNewline();\n                            writer.writeInline(\"$pluginFn:T(this.config\");\n                        } else {\n                            writer.writeInline(\"this.middlewareStack.use($pluginFn:T(this.config\");\n                        }\n\n                        List<String> additionalParameters = CodegenUtils.getFunctionParametersList(paramsMap);\n                        Map<String, ClientWriterConsumer> clientAddParamsWriterConsumers =\n                            plugin.getClientAddParamsWriterConsumers();\n\n                        boolean noAdditionalParams =\n                            additionalParameters.isEmpty() && clientAddParamsWriterConsumers.isEmpty();\n                        if (!noAdditionalParams) {\n                            writer.writeInline(\", \");\n\n                            boolean hasInnerContent =\n                                !clientAddParamsWriterConsumers.isEmpty() || !additionalParameters.isEmpty();\n\n                            if (!hasInnerContent) {\n                                writer.writeInline(\"{}\");\n                            } else {\n                                writer.write(\"{\").indent();\n                                // caution: using String.join instead of templating\n                                // because additionalParameters may contain Smithy syntax.\n                                if (!additionalParameters.isEmpty()) {\n                                    writer.writeInline(String.join(\", \", additionalParameters) + \", \");\n                                }\n                                clientAddParamsWriterConsumers.forEach((key, consumer) -> {\n                                    writer.write(\n                                        \"$L: $C,\",\n                                        key,\n                                        (Consumer<TypeScriptWriter>) (w2 -> {\n                                            consumer.accept(\n                                                w2,\n                                                ClientBodyExtraCodeSection.builder()\n                                                    .settings(settings)\n                                                    .model(model)\n                                                    .service(service)\n                                                    .symbolProvider(symbolProvider)\n                                                    .integrations(integrations)\n                                                    .runtimeClientPlugins(runtimePlugins)\n                                                    .applicationProtocol(applicationProtocol)\n                                                    .build()\n                                            );\n                                        })\n                                    );\n                                });\n                                writer.dedent();\n                                writer.writeInline(\"}\");\n                            }\n                        }\n                        if (isAuthSchemeEndpointRuleSetPlugin) {\n                            writer.write(\")\");\n                            writer.closeBlock(\");\");\n                        } else {\n                            writer.write(\"));\");\n                        }\n                        writer.popState();\n                    });\n            }\n            writer.popState();\n        });\n    }\n\n    private String generateConfigVariable(int number) {\n        return \"_config_\" + number;\n    }\n\n    private void generateDestroyMethod() {\n        // Generates the destroy() method, and calls the destroy() method of\n        // any runtime plugin that claims to have a destroy method.\n        if (applicationProtocol.isHttpProtocol()) {\n            writer.writeDocs(\n                \"Destroy underlying resources, like sockets. It's usually not necessary to do this.\\n\" +\n                    \"However in Node.js, it's best to explicitly shut down the client's agent when it is no longer \"\n                    +\n                    \"needed.\\nOtherwise, sockets might stay open for quite a long time before the server terminates \"\n                    +\n                    \"them.\"\n            );\n        }\n        writer.openBlock(\"destroy(): void {\", \"}\", () -> {\n            writer.pushState(ClientDestroyCodeSection.builder().runtimeClientPlugins(runtimePlugins).build());\n            for (RuntimeClientPlugin plugin : runtimePlugins) {\n                plugin\n                    .getDestroyFunction()\n                    .ifPresent(destroy -> {\n                        writer.write(\"$T(this.config);\", destroy);\n                    });\n            }\n            writer.popState();\n            // Always call destroy() in SmithyClient class. By default, it's optional.\n            writer.write(\"super.destroy();\");\n        });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SmithyCoreSubmodules.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\n/**\n * This is an enum-like submodule list to be used with\n *\n * TypeScriptWriter::addImportSubmodule(\n *   Dependency == \"cbor\",\n *   null (no alias),\n *   PackageContainer == \"@smithy/core\",\n *   SmithyCoreSubmodules.CBOR == \"/cbor\"\n * );\n *\n * The intended result is e.g.\n * ```ts\n * import { cbor } from \"@smithy/core/cbor\";\n * ```\n */\npublic final class SmithyCoreSubmodules {\n\n    public static final String CBOR = \"/cbor\";\n    public static final String CHECKSUM = \"/checksum\";\n    public static final String CLIENT = \"/client\";\n    public static final String CONFIG = \"/config\";\n    public static final String ENDPOINTS = \"/endpoints\";\n    public static final String EVENT_STREAMS = \"/event-streams\";\n    public static final String RETRY = \"/retry\";\n    public static final String PROTOCOLS = \"/protocols\";\n    public static final String SERDE = \"/serde\";\n\n    private SmithyCoreSubmodules() {}\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructureGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.getBlobStreamingMembers;\nimport static software.amazon.smithy.typescript.codegen.CodegenUtils.writeInlineStreamingMemberType;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings.RequiredMemberMode;\nimport software.amazon.smithy.typescript.codegen.integration.HttpProtocolGeneratorUtils;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.validation.SensitiveDataFinder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates normal structures and error structures.\n *\n * Renders structures as interfaces.\n *\n * <p>\n * A namespace is created with the same name as the structure to\n * provide helper functionality for checking if a given value is\n * known to be of the same type as the structure. This will be\n * even more useful if/when inheritance is added to Smithy.\n *\n * <p>\n * Note that the {@code required} trait on structures is used to\n * determine whether or not a generated TypeScript interface uses\n * required members. This is typically not recommended in other languages\n * since it's documented as backward-compatible for a model to migrate a\n * required property to optional. This becomes an issue when an older\n * client consumes a service that has relaxed a member to become optional.\n * In the case of sending data from the client to the server, the client\n * likely either is still operating under the assumption that the property\n * is required, or the client can set a property explicitly to\n * {@code undefined} to fix any TypeScript compilation errors. In the\n * case of deserializing a value from a service to the client, the\n * deserializers will need to set previously required properties to\n * undefined too.\n *\n * <p>\n * The generator will explicitly state that a required property can\n * be set to {@code undefined}. This makes it clear that undefined checks\n * need to be made when using {@code --strictNullChecks}, but has no\n * effect otherwise.\n */\n@SmithyInternalApi\nfinal class StructureGenerator implements Runnable {\n\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptWriter writer;\n    private final StructureShape shape;\n    private final boolean includeValidation;\n    private final RequiredMemberMode requiredMemberMode;\n    private final SensitiveDataFinder sensitiveDataFinder;\n    private final boolean schemaMode;\n    private final ServiceClosure closure;\n\n    /**\n     * sets 'includeValidation' to 'false' and requiredMemberMode\n     * to {@link RequiredMemberMode#NULLABLE}.\n     */\n    StructureGenerator(\n        Model model,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        StructureShape shape\n    ) {\n        this(model, settings, symbolProvider, writer, shape, false, RequiredMemberMode.NULLABLE, false);\n    }\n\n    StructureGenerator(\n        Model model,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        StructureShape shape,\n        boolean includeValidation,\n        RequiredMemberMode requiredMemberMode,\n        boolean schemaMode\n    ) {\n        this.model = model;\n        this.symbolProvider = symbolProvider;\n        this.writer = writer;\n        this.shape = shape;\n        this.includeValidation = includeValidation;\n        this.requiredMemberMode = requiredMemberMode;\n        sensitiveDataFinder = new SensitiveDataFinder(model);\n        this.schemaMode = schemaMode;\n        closure = ServiceClosure.of(model, settings.getService(model));\n    }\n\n    @Override\n    public void run() {\n        if (shape.hasTrait(ErrorTrait.class)) {\n            renderErrorStructure();\n        } else {\n            renderNonErrorStructure();\n        }\n    }\n\n    /**\n     * Renders a normal, non-error structure.\n     *\n     * <p>\n     * For example, given the following Smithy model:\n     *\n     * <pre>\n     * {@code\n     * namespace smithy.example\n     *\n     * structure Person {\n     *     &#64;required\n     *     name: String,\n     *     &#64;range(min: 1)\n     *     age: Integer,\n     * }\n     * }\n     * </pre>\n     *\n     * <p>\n     * The following TypeScript is rendered:\n     *\n     * <pre>{@code\n     * export interface Person {\n     *   name: string | undefined;\n     *   age?: number | null;\n     * }\n     *\n     * export const PersonFilterSensitiveLog = (obj: Person): any => ({...obj});\n     * }</pre>\n     *\n     * <p>\n     * If validation is enabled, it generates the following:\n     *\n     * <pre>{@code\n     * export interface Person {\n     *   name: string | undefined;\n     *   age?: number | null;\n     * }\n     *\n     * export const PersonFilterSensitiveLog = (obj: Person): any => ({...obj});\n     *\n     * export namespace Person {\n     *   export const validate = (obj: Person): ValidationFailure[] => {\n     *       // validation\n     *   }\n     * }\n     *\n     * }</pre>\n     */\n    private void renderNonErrorStructure() {\n        Symbol symbol = symbolProvider.toSymbol(shape);\n        writer.writeShapeDocs(shape);\n\n        // Find symbol references with the \"extends\" property.\n        String extendsFrom = symbol\n            .getReferences()\n            .stream()\n            .filter(ref -> ref.getProperty(SymbolVisitor.IMPLEMENTS_INTERFACE_PROPERTY).isPresent())\n            .map(SymbolReference::getAlias)\n            .collect(Collectors.joining(\", \"));\n\n        StructuredMemberWriter config = new StructuredMemberWriter(\n            model,\n            closure,\n            symbolProvider,\n            shape.getAllMembers().values(),\n            this.requiredMemberMode,\n            sensitiveDataFinder\n        );\n\n        if (config.members.isEmpty()) {\n            writer.write(\"export interface $L {}\", symbol.getName());\n        } else {\n            if (extendsFrom.isEmpty()) {\n                writer.openBlock(\"export interface $L {\", symbol.getName());\n            } else {\n                writer.openBlock(\"export interface $L extends $L {\", symbol.getName(), extendsFrom);\n            }\n            config.writeMembers(writer, shape);\n            writer.closeBlock(\"}\");\n        }\n\n        writer.write(\"\");\n        renderStructureNamespace(config, includeValidation);\n    }\n\n    private void renderStructureNamespace(StructuredMemberWriter structuredMemberWriter, boolean includeValidation) {\n        Symbol symbol = symbolProvider.toSymbol(shape);\n        String objectParam = \"obj\";\n\n        if (sensitiveDataFinder.findsSensitiveDataIn(shape) && !schemaMode) {\n            writer.writeDocs(\"@internal\");\n            writer.openBlock(\n                \"export const $LFilterSensitiveLog = ($L: $L): any => ({\",\n                \"})\",\n                symbol.getName(),\n                objectParam,\n                symbol.getName(),\n                () -> {\n                    structuredMemberWriter.writeFilterSensitiveLog(writer, objectParam);\n                }\n            );\n        }\n\n        if (!includeValidation) {\n            return;\n        }\n\n        writer.openBlock(\"export namespace $L {\", \"}\", symbol.getName(), () -> {\n            structuredMemberWriter.writeMemberValidatorCache(writer, \"memberValidators\");\n\n            writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n            writer.writeDocs(\"@internal\");\n            List<MemberShape> blobStreamingMembers = getBlobStreamingMembers(model, shape);\n            writer.writeInline(\"export const validate = ($L: \", objectParam);\n            if (blobStreamingMembers.isEmpty()) {\n                writer.writeInline(\"$L\", symbol.getName());\n            } else {\n                writeInlineStreamingMemberType(writer, symbol, blobStreamingMembers.get(0));\n            }\n            writer.openBlock(\", path: string = \\\"\\\"): __ValidationFailure[] => {\", \"}\", () -> {\n                structuredMemberWriter.writeMemberValidatorFactory(writer, \"memberValidators\");\n                structuredMemberWriter.writeValidateMethodContents(writer, objectParam);\n            });\n        });\n    }\n\n    /**\n     * Error structures generate classes that extend from service base exception\n     * (ServiceException in case of server SDK), and add the appropriate fault\n     * property.\n     *\n     * <p>\n     * Given the following Smithy structure:\n     *\n     * <pre>\n     * {@code\n     * namespace smithy.example\n     *\n     * &#64;error(\"client\")\n     * structure NoSuchResource {\n     *     &#64;required\n     *     resourceType: String\n     * }\n     * }\n     * </pre>\n     *\n     * <p>\n     * The following TypeScript is generated:\n     *\n     * <pre>{@code\n     * import { ExceptionOptionType as __ExceptionOptionType } from \"@smithy/smithy-client\";\n     * import { FooServiceException as __BaseException } from \"./FooServiceException\";\n     * // In server SDK:\n     * // import { ServiceException as __BaseException } from \"@aws-smithy/server-common\";\n     *\n     * export class NoSuchResource extends __BaseException {\n     *   name: \"NoSuchResource\";\n     *   $fault: \"client\";\n     *   resourceType: string | undefined;\n     *   // @internal\n     *   constructor(opts: __ExceptionOptionType<NoSuchResource, __BaseException>) {\n     *     super({\n     *       name: \"NoSuchResource\",\n     *       $fault: \"client\",\n     *       ...opts\n     *     });\n     *     Object.setPrototypeOf(this, NoSuchResource.prototype);\n     *     this.resourceType = opts.resourceType;\n     *   }\n     * }\n     * }</pre>\n     */\n    private void renderErrorStructure() {\n        ErrorTrait errorTrait = shape.getTrait(ErrorTrait.class).orElseThrow(IllegalStateException::new);\n        Symbol symbol = symbolProvider.toSymbol(shape);\n        writer.writeShapeDocs(shape);\n        boolean isServerSdk = this.includeValidation;\n        writer.openBlock(\"export class $T extends $L {\", symbol, \"__BaseException\");\n        writer.write(\"readonly name = $1S as const;\", shape.getId().getName());\n        writer.write(\"readonly $$fault = $1S as const;\", errorTrait.getValue());\n        if (!isServerSdk) {\n            HttpProtocolGeneratorUtils.writeRetryableTrait(writer, shape, \";\");\n        }\n        StructuredMemberWriter structuredMemberWriter = new StructuredMemberWriter(\n            model,\n            closure,\n            symbolProvider,\n            shape.getAllMembers().values(),\n            this.requiredMemberMode,\n            sensitiveDataFinder\n        );\n        // since any error interface must extend from JavaScript Error interface,\n        // message member is already\n        // required in the JavaScript Error interface\n        structuredMemberWriter.skipMembers.add(\"message\");\n        structuredMemberWriter.writeMembers(writer, shape);\n        structuredMemberWriter.writeErrorConstructor(writer, shape, isServerSdk);\n        writer.closeBlock(\"}\");\n        writer.write(\"\");\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructuredMemberWriter.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.HashSet;\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.Set;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.IntEnumShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.SimpleShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.EnumDefinition;\nimport software.amazon.smithy.model.traits.EnumTrait;\nimport software.amazon.smithy.model.traits.EnumValueTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.InternalTrait;\nimport software.amazon.smithy.model.traits.LengthTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.PatternTrait;\nimport software.amazon.smithy.model.traits.RangeTrait;\nimport software.amazon.smithy.model.traits.RequiredTrait;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.model.traits.UniqueItemsTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings.RequiredMemberMode;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.validation.SensitiveDataFinder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates objects, interfaces, enums, etc.\n */\n@SmithyInternalApi\nfinal class StructuredMemberWriter {\n\n    Model model;\n    SymbolProvider symbolProvider;\n    Collection<MemberShape> members;\n    String memberPrefix = \"\";\n    boolean noDocs;\n    RequiredMemberMode requiredMemberMode;\n    final Set<String> skipMembers = new HashSet<>();\n    private final SensitiveDataFinder sensitiveDataFinder;\n    private final ServiceClosure closure;\n\n    StructuredMemberWriter(\n        Model model,\n        ServiceClosure closure,\n        SymbolProvider symbolProvider,\n        Collection<MemberShape> members\n    ) {\n        this(model, closure, symbolProvider, members, RequiredMemberMode.NULLABLE);\n    }\n\n    StructuredMemberWriter(\n        Model model,\n        ServiceClosure closure,\n        SymbolProvider symbolProvider,\n        Collection<MemberShape> members,\n        RequiredMemberMode requiredMemberMode\n    ) {\n        this(model, closure, symbolProvider, members, requiredMemberMode, new SensitiveDataFinder(model));\n    }\n\n    StructuredMemberWriter(\n        Model model,\n        ServiceClosure closure,\n        SymbolProvider symbolProvider,\n        Collection<MemberShape> members,\n        RequiredMemberMode requiredMemberMode,\n        SensitiveDataFinder sensitiveDataFinder\n    ) {\n        this.model = model;\n        this.symbolProvider = symbolProvider;\n        this.members = new LinkedHashSet<>(members);\n        this.requiredMemberMode = requiredMemberMode;\n        this.sensitiveDataFinder = sensitiveDataFinder;\n        this.closure = closure;\n    }\n\n    void writeMembers(TypeScriptWriter writer, Shape shape) {\n        int position = -1;\n        for (MemberShape member : members) {\n            if (skipMembers.contains(member.getMemberName())) {\n                continue;\n            }\n\n            position++;\n            boolean wroteDocs = !noDocs && writer.writeMemberDocs(model, member);\n            String memberName = getSanitizedMemberName(member);\n            String optionalSuffix = shape.isUnionShape() || !closure.isMemberRequiredInClient(member) ? \"?\" : \"\";\n            String typeSuffix =\n                requiredMemberMode == RequiredMemberMode.NULLABLE && closure.isMemberRequiredInClient(member)\n                    ? \" | undefined\"\n                    : \"\";\n            if (optionalSuffix.equals(\"?\")) {\n                typeSuffix = \" | undefined\"; // support exactOptionalPropertyTypes.\n            }\n            writer.write(\n                \"${L}${L}${L}: ${T}${L};\",\n                memberPrefix,\n                memberName,\n                optionalSuffix,\n                symbolProvider.toSymbol(member).toBuilder().putProperty(\"typeOnly\", true).build(),\n                typeSuffix\n            );\n\n            if (wroteDocs && position < members.size() - 1) {\n                writer.write(\"\");\n            }\n        }\n    }\n\n    void writeFilterSensitiveLog(TypeScriptWriter writer, String objectParam) {\n        writer.write(\"...$L,\", objectParam);\n        for (MemberShape member : members) {\n            if (isMemberOverwriteRequired(member, new HashSet<String>())) {\n                String memberName = getSanitizedMemberName(member);\n                writer.openBlock(\"...($1L.$2L && { $2L: \", \"}),\", objectParam, memberName, () -> {\n                    String memberParam = String.format(\"%s.%s\", objectParam, memberName);\n                    writeMemberFilterSensitiveLog(writer, member, memberParam);\n                });\n            }\n        }\n    }\n\n    void writeMemberFilterSensitiveLog(TypeScriptWriter writer, MemberShape member, String memberParam) {\n        Shape memberTarget = model.expectShape(member.getTarget());\n        if (member.getMemberTrait(model, SensitiveTrait.class).isPresent()) {\n            writeSensitiveString(writer);\n        } else if (memberTarget instanceof SimpleShape) {\n            writer.write(memberParam);\n        } else if (memberTarget.isStructureShape() || memberTarget.isUnionShape()) {\n            writeStructureFilterSensitiveLog(writer, memberTarget, memberParam);\n        } else if (memberTarget instanceof CollectionShape) {\n            MemberShape collectionMember = ((CollectionShape) memberTarget).getMember();\n            writeCollectionFilterSensitiveLog(writer, collectionMember, memberParam);\n        } else if (memberTarget instanceof MapShape) {\n            MemberShape mapMember = ((MapShape) memberTarget).getValue();\n            writeMapFilterSensitiveLog(writer, mapMember, memberParam);\n        } else {\n            throw new CodegenException(\n                String.format(\"MemberFilterSensitiveLog attempted for %s\", memberTarget.getType())\n            );\n        }\n    }\n\n    /**\n     * Writes constructor of SDK exception classes.\n     */\n    void writeErrorConstructor(TypeScriptWriter writer, Shape shape, boolean isServerSdk) {\n        ErrorTrait errorTrait = shape.getTrait(ErrorTrait.class).orElseThrow(IllegalStateException::new);\n        Symbol symbol = symbolProvider.toSymbol(shape);\n        if (!isServerSdk) {\n            writer.writeDocs(\"@internal\");\n        }\n        writer.addTypeImportSubmodule(\n            \"ExceptionOptionType\",\n            \"__ExceptionOptionType\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n        writer.openBlock(\"constructor(opts: __ExceptionOptionType<$L, __BaseException>) {\", symbol.getName());\n        writer.openBlock(\"super({\", \"});\", () -> {\n            writer.write(\"name: $S,\", shape.getId().getName());\n            writer.write(\"$$fault: $S,\", errorTrait.getValue());\n            writer.write(\"...opts,\");\n        });\n        writer.write(\"Object.setPrototypeOf(this, $L.prototype);\", symbol.getName());\n        for (MemberShape member : members) {\n            if (skipMembers.contains(member.getMemberName())) {\n                continue;\n            }\n            writer.write(\"this.${1L} = opts.${1L};\", getSanitizedMemberName(member));\n        }\n        writer.closeBlock(\"}\");\n    }\n\n    /**\n     * Writes SENSITIVE_STRING to hide the value of sensitive members.\n     */\n    private void writeSensitiveString(TypeScriptWriter writer) {\n        writer.addImportSubmodule(\n            \"SENSITIVE_STRING\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n        writer.write(\"SENSITIVE_STRING\");\n    }\n\n    /**\n     * Recursively writes filterSensitiveLog for StructureShape.\n     */\n    private void writeStructureFilterSensitiveLog(\n        TypeScriptWriter writer,\n        Shape structureTarget,\n        String structureParam\n    ) {\n        if (structureTarget.hasTrait(SensitiveTrait.class)) {\n            writeSensitiveString(writer);\n        } else if (structureTarget.hasTrait(StreamingTrait.class) && structureTarget.isUnionShape()) {\n            // disable logging for StreamingTrait\n            writer.write(\"'STREAMING_CONTENT'\");\n        } else if (structureTarget.hasTrait(ErrorTrait.class)) {\n            // Sensitive logs are not filtered from errors.\n            writer.write(\"$L\", structureParam);\n        } else {\n            if (sensitiveDataFinder.findsSensitiveDataIn(structureTarget)) {\n                // Call filterSensitiveLog on Structure.\n                Symbol symbol = symbolProvider.toSymbol(structureTarget);\n                String filterFunctionName = symbol.getName() + \"FilterSensitiveLog\";\n                if (!symbol.getNamespace().contains(writer.getModuleName())) {\n                    writer.addRelativeImport(filterFunctionName, null, Paths.get(\".\", symbol.getNamespace()));\n                }\n                writer.write(\"$L($L)\", filterFunctionName, structureParam);\n            } else {\n                writer.write(\"$L\", structureParam);\n            }\n        }\n    }\n\n    /**\n     * Recursively writes filterSensitiveLog for CollectionShape.\n     */\n    private void writeCollectionFilterSensitiveLog(\n        TypeScriptWriter writer,\n        MemberShape collectionMember,\n        String collectionParam\n    ) {\n        if (collectionMember.getMemberTrait(model, SensitiveTrait.class).isPresent()) {\n            writeSensitiveString(writer);\n        } else if (model.expectShape(collectionMember.getTarget()) instanceof SimpleShape) {\n            writer.write(collectionParam);\n        } else {\n            writer.openBlock(\"$L.map(\", \")\", collectionParam, () -> {\n                String itemParam = \"item\";\n                writer.write(\"$L => \", itemParam);\n                writeMemberFilterSensitiveLog(writer, collectionMember, itemParam);\n            });\n        }\n    }\n\n    /**\n     * Recursively writes filterSensitiveLog for MapShape.\n     */\n    private void writeMapFilterSensitiveLog(TypeScriptWriter writer, MemberShape mapMember, String mapParam) {\n        if (mapMember.getMemberTrait(model, SensitiveTrait.class).isPresent()) {\n            writeSensitiveString(writer);\n        } else if (model.expectShape(mapMember.getTarget()) instanceof SimpleShape) {\n            writer.write(mapParam);\n        } else {\n            String accParam = \"acc\"; // accumulator for the reducer\n            String keyParam = \"key\"; // key of the Object.entries() key-value pair\n            String valueParam = \"value\"; // value of the Object.entries() key-value pair\n\n            // Reducer is common to all shapes.\n            writer.openBlock(\n                \"Object.entries($L).reduce(($L: any, [$L, $L]: [string, $T]) => (\",\n                \"), {})\",\n                mapParam,\n                accParam,\n                keyParam,\n                valueParam,\n                symbolProvider.toSymbol(mapMember),\n                () -> {\n                    writer.openBlock(\"$L[$L] =\", \"\", accParam, keyParam, () -> {\n                        writeMemberFilterSensitiveLog(writer, mapMember, valueParam);\n                        writer.writeInline(\",\");\n                    });\n                    writer.write(accParam);\n                }\n            );\n        }\n    }\n\n    /**\n     * Identifies if member needs to be overwritten in filterSensitiveLog.\n     *\n     * @param member  a {@link MemberShape} to check if overwrite is required.\n     * @param parents a set of membernames which are parents of existing member to\n     *                avoid unending recursion.\n     * @return Returns true if the overwrite is required on member.\n     */\n    private boolean isMemberOverwriteRequired(MemberShape member, Set<String> parents) {\n        if (member.getMemberTrait(model, SensitiveTrait.class).isPresent()) {\n            return true;\n        }\n\n        Shape memberTarget = model.expectShape(member.getTarget());\n        if (memberTarget.isUnionShape()) {\n            // always call filterSensitiveLog for UnionShape\n            return true;\n        } else if (memberTarget.isStructureShape()) {\n            if (!parents.contains(symbolProvider.toMemberName(member))) {\n                parents.add(symbolProvider.toMemberName(member));\n                Collection<MemberShape> structureMemberList = ((StructureShape) memberTarget).getAllMembers().values();\n                for (MemberShape structureMember : structureMemberList) {\n                    if (\n                        !parents.contains(symbolProvider.toMemberName(structureMember)) &&\n                            isMemberOverwriteRequired(structureMember, parents)\n                    ) {\n                        return true;\n                    }\n                }\n            }\n        } else if (memberTarget instanceof CollectionShape) {\n            MemberShape collectionMember = ((CollectionShape) memberTarget).getMember();\n            return isMemberOverwriteRequired(collectionMember, parents);\n        } else if (memberTarget instanceof MapShape) {\n            MemberShape mapMember = ((MapShape) memberTarget).getValue();\n            return isMemberOverwriteRequired(mapMember, parents);\n        }\n        return false;\n    }\n\n    /**\n     * Returns the member name to be used in generation.\n     *\n     * @param member a {@link MemberShape} to be sanitized.\n     * @return Returns the member name to be used in generation.\n     */\n    private String getSanitizedMemberName(MemberShape member) {\n        return TypeScriptUtils.sanitizePropertyName(symbolProvider.toMemberName(member));\n    }\n\n    /**\n     * Writes an empty cache into the namespace for use by the member validator\n     * factory.\n     *\n     * Due to the fact that validation references can be circular, we need to defer\n     * retrieval of validators\n     * to runtime, but we do not want to reinstantiate each validator every time it\n     * is needed.\n     *\n     * @param writer    the writer for the type, currently positioned in the type's\n     *                  exported namespace\n     * @param cacheName the name of the in-scope cache for the validators\n     */\n    void writeMemberValidatorCache(TypeScriptWriter writer, String cacheName) {\n        writer.openBlock(\"const $L : {\", \"} = {};\", cacheName, () -> {\n            for (MemberShape member : members) {\n                writer.addImport(\n                    \"MultiConstraintValidator\",\n                    \"__MultiConstraintValidator\",\n                    TypeScriptDependency.SERVER_COMMON\n                );\n                final Shape targetShape = model.expectShape(member.getTarget());\n                writer.writeInline(\"$L?: \", getSanitizedMemberName(member));\n                writer.writeInline(\"__MultiConstraintValidator<\");\n                writeConstraintValidatorType(writer, targetShape);\n                writer.write(\">,\");\n            }\n        });\n    }\n\n    /**\n     * Writes a member validator factory method that will reuse cached validators,\n     * or create new ones if this is\n     * the first instance of validation.\n     *\n     * @param writer    the writer for the type, currently positioned in the type's\n     *                  validate method\n     * @param cacheName the name of the in-scope cache for the validators\n     */\n    void writeMemberValidatorFactory(TypeScriptWriter writer, String cacheName) {\n        writer.openBlock(\n            \"function getMemberValidator<T extends keyof typeof $1L>(member: T): \" + \"NonNullable<typeof $1L[T]> {\",\n            \"}\",\n            cacheName,\n            () -> {\n                writer.openBlock(\"if ($L[member] === undefined) {\", \"}\", cacheName, () -> {\n                    writer.openBlock(\"switch (member) {\", \"}\", () -> {\n                        for (MemberShape member : members) {\n                            final Shape targetShape = model.expectShape(member.getTarget());\n                            Collection<Trait> constraintTraits = getConstraintTraits(member);\n                            writer.openBlock(\"case $S: {\", \"}\", getSanitizedMemberName(member), () -> {\n                                writer.writeInline(\"$L[$S] = \", cacheName, getSanitizedMemberName(member));\n                                if (member.getMemberTrait(model, SensitiveTrait.class).isPresent()) {\n                                    writeSensitiveWrappedMemberValidator(writer, targetShape, constraintTraits);\n                                } else {\n                                    writeMemberValidator(writer, targetShape, constraintTraits, \";\");\n                                }\n                                writer.write(\"break;\");\n                            });\n                        }\n                    });\n                });\n                writer.write(\"return $L[member]!!;\", cacheName);\n            }\n        );\n    }\n\n    /**\n     * Writes the validate method contents.\n     *\n     * @param writer the writer, positioned within the validate method\n     * @param param  the parameter name of the object being validated\n     */\n    void writeValidateMethodContents(TypeScriptWriter writer, String param) {\n        writer.openBlock(\"return [\", \"];\", () -> {\n            for (MemberShape member : members) {\n                String optionalSuffix = \"\";\n                if (\n                    member.getMemberTrait(model, MediaTypeTrait.class).isPresent() &&\n                        model.expectShape(member.getTarget()) instanceof StringShape\n                ) {\n                    // lazy JSON wrapper validation should be done based on the serialized form of\n                    // the object\n                    optionalSuffix = \"?.toString()\";\n                }\n                Shape memberTarget = model.expectShape(member.getTarget());\n                if (memberTarget.isUnionShape() && memberTarget.hasTrait(StreamingTrait.class)) {\n                    // todo: validating event streams in unsupported.\n                    writer.write(\"// unsupported event stream validation\");\n                    writer.write(\n                        \"// ...getMemberValidator($1S).validate($2L.$1L$4L, `$${path}/$3L`),\",\n                        getSanitizedMemberName(member),\n                        param,\n                        member.getMemberName(),\n                        optionalSuffix\n                    );\n                } else {\n                    writer.write(\n                        \"...getMemberValidator($1S).validate($2L.$1L$4L, `$${path}/$3L`),\",\n                        getSanitizedMemberName(member),\n                        param,\n                        member.getMemberName(),\n                        optionalSuffix\n                    );\n                }\n            }\n        });\n    }\n\n    /**\n     * Writes a SensitiveConstraintValidator enclosing the shape validator for a\n     * sensitive member.\n     */\n    private void writeSensitiveWrappedMemberValidator(\n        TypeScriptWriter writer,\n        Shape targetShape,\n        Collection<Trait> constraintTraits\n    ) {\n        writer.addImport(\n            \"SensitiveConstraintValidator\",\n            \"__SensitiveConstraintValidator\",\n            TypeScriptDependency.SERVER_COMMON\n        );\n        writer.writeInline(\"new __SensitiveConstraintValidator<\");\n        writeConstraintValidatorType(writer, targetShape);\n        writer.openBlock(\">(\", \");\", () -> writeMemberValidator(writer, targetShape, constraintTraits, \"\"));\n    }\n\n    /**\n     * Writes the validator for the member of a structure or union.\n     *\n     * @param writer           the writer\n     * @param shape            the shape targeted by the member\n     * @param constraintTraits the traits applied to the targeted shape and the\n     *                         member\n     * @param trailer          what to append to the output (such as a comma or\n     *                         semicolon)\n     */\n    private void writeMemberValidator(\n        TypeScriptWriter writer,\n        Shape shape,\n        Collection<Trait> constraintTraits,\n        String trailer\n    ) {\n        if (shape instanceof SimpleShape) {\n            writeShapeValidator(writer, shape, constraintTraits, trailer);\n            return;\n        }\n\n        boolean sparse = shape.hasTrait(SparseTrait.ID);\n\n        if (shape.isStructureShape() || shape.isUnionShape()) {\n            writer.addImport(\n                \"CompositeStructureValidator\",\n                \"__CompositeStructureValidator\",\n                TypeScriptDependency.SERVER_COMMON\n            );\n            writer.openBlock(\n                \"new __CompositeStructureValidator<$T>(\",\n                \")\" + trailer,\n                getValidatorValueType(shape),\n                () -> {\n                    writeShapeValidator(writer, shape, constraintTraits, \",\");\n                    if (!shape.hasTrait(ErrorTrait.class)) {\n                        writer.write(\"$T.validate\", symbolProvider.toSymbol(shape));\n                    } else {\n                        // todo: unsupported\n                        // Error classes have no static validator.\n                        writer.write(\n                            \"\"\"\n                            () => [/*Error validator unsupported*/]\"\"\"\n                        );\n                    }\n                }\n            );\n        } else if (shape.isListShape() || shape.isSetShape()) {\n            writer.addImport(\n                \"CompositeCollectionValidator\",\n                \"__CompositeCollectionValidator\",\n                TypeScriptDependency.SERVER_COMMON\n            );\n            MemberShape collectionMemberShape = ((CollectionShape) shape).getMember();\n            Shape collectionMemberTargetShape = model.expectShape(collectionMemberShape.getTarget());\n            writer.openBlock(\n                \"new __CompositeCollectionValidator<$T\" + (sparse ? \" | null>(\" : \">(\"),\n                \")\" + trailer,\n                getValidatorValueType(shape),\n                () -> {\n                    writeShapeValidator(writer, shape, constraintTraits, \",\");\n                    writeMemberValidator(\n                        writer,\n                        collectionMemberTargetShape,\n                        getConstraintTraits(collectionMemberShape),\n                        \"\"\n                    );\n                }\n            );\n        } else if (shape.isMapShape()) {\n            writer.addImport(\"CompositeMapValidator\", \"__CompositeMapValidator\", TypeScriptDependency.SERVER_COMMON);\n\n            MapShape mapShape = (MapShape) shape;\n            final MemberShape keyShape = mapShape.getKey();\n            final MemberShape valueShape = mapShape.getValue();\n            writer.openBlock(\n                \"new __CompositeMapValidator<$T\" + (sparse ? \" | null>(\" : \">(\"),\n                \")\" + trailer,\n                getValidatorValueType(shape),\n                () -> {\n                    writeShapeValidator(writer, mapShape, constraintTraits, \",\");\n                    writeMemberValidator(\n                        writer,\n                        model.expectShape(keyShape.getTarget()),\n                        getConstraintTraits(keyShape),\n                        \",\"\n                    );\n                    writeMemberValidator(\n                        writer,\n                        model.expectShape(valueShape.getTarget()),\n                        getConstraintTraits(valueShape),\n                        \"\"\n                    );\n                }\n            );\n        } else {\n            throw new IllegalArgumentException(\n                String.format(\"Unsupported shape found when generating validator: %s\", shape)\n            );\n        }\n    }\n\n    /**\n     * Writes a validator for a shape, aggregating all of the constraints applied to\n     * it. This shape could be a member\n     * target, or the target of a shape (such as the member of a list or the value\n     * of a map).\n     *\n     * @param writer      the writer\n     * @param shape       the shape being validated\n     * @param constraints the constraints relevant to this shape (includes member\n     *                    traits for member targets)\n     * @param trailer     what to append to the output (for instance, a comma or\n     *                    semicolon)\n     */\n    private void writeShapeValidator(\n        TypeScriptWriter writer,\n        Shape shape,\n        Collection<Trait> constraints,\n        String trailer\n    ) {\n        boolean shouldWriteIntEnumValidator = shape.isIntEnumShape();\n\n        if (constraints.isEmpty() && !shouldWriteIntEnumValidator) {\n            writer.addImport(\"NoOpValidator\", \"__NoOpValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.write(\"new __NoOpValidator()\" + trailer);\n            return;\n        }\n\n        writer.addImport(\"CompositeValidator\", \"__CompositeValidator\", TypeScriptDependency.SERVER_COMMON);\n        writer.openBlock(\"new __CompositeValidator<$T>([\", \"])\" + trailer, getSymbolForValidatedType(shape), () -> {\n            if (shouldWriteIntEnumValidator) {\n                writer.addImport(\"IntegerEnumValidator\", \"__IntegerEnumValidator\", TypeScriptDependency.SERVER_COMMON);\n                writer.openBlock(\"new __IntegerEnumValidator([\", \"]),\", () -> {\n                    for (int i : ((IntEnumShape) shape).getEnumValues().values()) {\n                        writer.write(\"$L,\", i);\n                    }\n                });\n            }\n\n            if (shape.isEnumShape()) {\n                writer.addImport(\"EnumValidator\", \"__EnumValidator\", TypeScriptDependency.SERVER_COMMON);\n                Collection<MemberShape> enumValues = shape.asEnumShape().get().getAllMembers().values();\n                writer.openBlock(\"new __EnumValidator([\", \"]),\", () -> {\n                    for (MemberShape member : enumValues) {\n                        writer.write(\"$S,\", member.expectTrait(EnumValueTrait.class).expectStringValue());\n                    }\n                    writer.write(\"], [\");\n                    for (MemberShape member : shape.asEnumShape().get().getAllMembers().values()) {\n                        if (!member.hasTrait((InternalTrait.class))) {\n                            writer.write(\"$S,\", member.expectTrait(EnumValueTrait.class).expectStringValue());\n                        }\n                    }\n                });\n            }\n\n            for (Trait t : constraints) {\n                writeSingleConstraintValidator(writer, t);\n            }\n        });\n    }\n\n    /**\n     * Writes a validator for one constraint of one member.\n     */\n    private void writeSingleConstraintValidator(TypeScriptWriter writer, Trait trait) {\n        if (trait instanceof RequiredTrait) {\n            writer.addImport(\"RequiredValidator\", \"__RequiredValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.write(\"new __RequiredValidator(),\");\n        } else if (trait instanceof EnumTrait && !trait.isSynthetic()) {\n            writer.addImport(\"EnumValidator\", \"__EnumValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.openBlock(\"new __EnumValidator([\", \"]),\", () -> {\n                for (String e : ((EnumTrait) trait).getEnumDefinitionValues()) {\n                    writer.write(\"$S,\", e);\n                }\n                writer.write(\"], [\");\n                for (EnumDefinition enumDefinition : ((EnumTrait) trait).getValues()) {\n                    if (!enumDefinition.hasTag(\"internal\")) {\n                        writer.write(\"$S, \", enumDefinition.getValue());\n                    }\n                }\n            });\n        } else if (trait instanceof LengthTrait) {\n            LengthTrait lengthTrait = (LengthTrait) trait;\n            writer.addImport(\"LengthValidator\", \"__LengthValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.write(\n                \"new __LengthValidator($L, $L),\",\n                lengthTrait.getMin().map(Object::toString).orElse(\"undefined\"),\n                lengthTrait.getMax().map(Object::toString).orElse(\"undefined\")\n            );\n        } else if (trait instanceof PatternTrait) {\n            writer.addImport(\"PatternValidator\", \"__PatternValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.write(\"new __PatternValidator($S),\", ((PatternTrait) trait).getValue());\n        } else if (trait instanceof RangeTrait) {\n            RangeTrait rangeTrait = (RangeTrait) trait;\n            writer.addImport(\"RangeValidator\", \"__RangeValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.write(\n                \"new __RangeValidator($L, $L),\",\n                rangeTrait.getMin().map(Object::toString).orElse(\"undefined\"),\n                rangeTrait.getMax().map(Object::toString).orElse(\"undefined\")\n            );\n        } else if (trait instanceof UniqueItemsTrait) {\n            writer.addImport(\"UniqueItemsValidator\", \"__UniqueItemsValidator\", TypeScriptDependency.SERVER_COMMON);\n            writer.write(\"new __UniqueItemsValidator(),\");\n        }\n    }\n\n    /**\n     * Writes the type that is being validated (the TS type corresponding to the\n     * target shape) that is used as a\n     * type arg for MultiConstraintValidator.\n     */\n    private void writeConstraintValidatorType(TypeScriptWriter writer, Shape shape) {\n        boolean sparse = shape.hasTrait(SparseTrait.ID);\n\n        if (shape.isStructureShape() || shape.isUnionShape()) {\n            writer.writeInline(\"$T\", symbolProvider.toSymbol(shape));\n        } else if (shape.isListShape() || shape.isSetShape()) {\n            MemberShape collectionMemberShape = ((CollectionShape) shape).getMember();\n            Shape collectionMemberTargetShape = model.expectShape(collectionMemberShape.getTarget());\n            writer.writeInline(\n                \"Iterable<$T\" + (sparse ? \" | null>\" : \">\"),\n                getSymbolForValidatedType(collectionMemberTargetShape)\n            );\n        } else if (shape.isMapShape()) {\n            MapShape mapShape = shape.asMapShape().get();\n            String keyType = getSymbolForValidatedType(mapShape.getKey()).toString();\n\n            if (keyType.equals(\"string\")) {\n                writer.writeInline(\n                    \"Record<$T, $T\" + (sparse ? \" | null>\" : \">\"),\n                    getSymbolForValidatedType(mapShape.getKey()),\n                    getSymbolForValidatedType(mapShape.getValue())\n                );\n            } else {\n                writer.writeInline(\n                    \"Partial<Record<$T, $T\" + (sparse ? \" | null>>\" : \">>\"),\n                    getSymbolForValidatedType(mapShape.getKey()),\n                    getSymbolForValidatedType(mapShape.getValue())\n                );\n            }\n        } else if (shape instanceof SimpleShape) {\n            writer.writeInline(\"$T\", getSymbolForValidatedType(shape));\n        } else {\n            throw new IllegalArgumentException(\n                String.format(\"Unsupported shape found when generating validator: %s\", shape)\n            );\n        }\n    }\n\n    /**\n     * @return returns the value type for a validator. For maps, this is the type of\n     *         the value; for lists, this is\n     *         the member type. This type is loosened by\n     *         {@link #getSymbolForValidatedType(Shape)}\n     */\n    private Symbol getValidatorValueType(Shape shape) {\n        if (shape.isStructureShape() || shape.isUnionShape()) {\n            return symbolProvider.toSymbol(shape);\n        } else if (shape.isListShape() || shape.isSetShape()) {\n            MemberShape collectionMemberShape = ((CollectionShape) shape).getMember();\n            Shape collectionMemberTargetShape = model.expectShape(collectionMemberShape.getTarget());\n            return getSymbolForValidatedType(collectionMemberTargetShape);\n        } else if (shape.isMapShape()) {\n            return getSymbolForValidatedType(((MapShape) shape).getValue());\n        } else if (shape instanceof SimpleShape) {\n            return getSymbolForValidatedType(shape);\n        } else {\n            throw new IllegalArgumentException(\n                String.format(\"Unsupported shape found when generating validator: %s\", shape)\n            );\n        }\n    }\n\n    /**\n     * If we return the direct symbol for the validated type, then TypeScript will\n     * not pass type checks when we pass\n     * raw deserialized values into our validators. This is particularly problematic\n     * for enums.\n     *\n     * @return a looser supertype of the modeled value type (generally, string\n     *         instead of a subtype of string)\n     */\n    private Symbol getSymbolForValidatedType(Shape shape) {\n        if (shape instanceof StringShape) {\n            return symbolProvider.toSymbol(model.expectShape(ShapeId.from(\"smithy.api#String\")));\n        } else if (shape instanceof IntEnumShape) {\n            return symbolProvider.toSymbol(model.expectShape(ShapeId.from(\"smithy.api#Integer\")));\n        }\n\n        // Streaming blob inputs can also take string, Uint8Array and Buffer, so we\n        // widen the symbol\n        if (shape.isBlobShape() && shape.hasTrait(StreamingTrait.class)) {\n            return symbolProvider\n                .toSymbol(shape)\n                .toBuilder()\n                .addReference(Symbol.builder().name(\"Readable\").namespace(\"stream\", \"/\").build())\n                .name(\"Readable | ReadableStream | Blob | string | Uint8Array | Buffer\")\n                .build();\n        }\n\n        return symbolProvider.toSymbol(shape);\n    }\n\n    private Collection<Trait> getConstraintTraits(MemberShape member) {\n        List<Trait> traits = new ArrayList<>();\n        member.getTrait(RequiredTrait.class).ifPresent(traits::add);\n        member.getMemberTrait(model, EnumTrait.class).ifPresent(traits::add);\n        member.getMemberTrait(model, LengthTrait.class).ifPresent(traits::add);\n        member.getMemberTrait(model, PatternTrait.class).ifPresent(traits::add);\n        member.getMemberTrait(model, RangeTrait.class).ifPresent(traits::add);\n        member.getMemberTrait(model, UniqueItemsTrait.class).ifPresent(traits::add);\n        return traits;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SymbolVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static java.lang.String.format;\n\nimport java.util.Collection;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.TreeSet;\nimport java.util.logging.Logger;\nimport java.util.regex.Matcher;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.ReservedWordSymbolProvider;\nimport software.amazon.smithy.codegen.core.ReservedWords;\nimport software.amazon.smithy.codegen.core.ReservedWordsBuilder;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.OperationIndex;\nimport software.amazon.smithy.model.shapes.BigDecimalShape;\nimport software.amazon.smithy.model.shapes.BigIntegerShape;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.BooleanShape;\nimport software.amazon.smithy.model.shapes.ByteShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.EnumShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.IntEnumShape;\nimport software.amazon.smithy.model.shapes.IntegerShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.LongShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeType;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.model.shapes.ShortShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.shapes.ToShapeId;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.EnumTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.UnitTypeTrait;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * This class is responsible for type mapping and file/identifier formatting.\n *\n * <p>Reserved words for TypeScript are automatically escaped so that they are\n * prefixed with \"_\". See \"reserved-words.txt\" for the list of words.\n */\n@SmithyInternalApi\nfinal class SymbolVisitor implements SymbolProvider, ShapeVisitor<Symbol> {\n\n    static final String IMPLEMENTS_INTERFACE_PROPERTY = \"implementsInterface\";\n    private static final Logger LOGGER = Logger.getLogger(SymbolVisitor.class.getName());\n\n    private final Model model;\n    private final TypeScriptSettings settings;\n    private final ReservedWordSymbolProvider.Escaper escaper;\n    private final Set<StructureShape> errorShapes = new HashSet<>();\n    private final ModuleNameDelegator moduleNameDelegator;\n    private final boolean createTypeOnlySymbols;\n\n    SymbolVisitor(Model model, TypeScriptSettings settings) {\n        this(model, settings, ModuleNameDelegator.DEFAULT_CHUNK_SIZE);\n    }\n\n    SymbolVisitor(Model model, TypeScriptSettings settings, int shapeChunkSize) {\n        this.model = model;\n        this.settings = settings;\n        createTypeOnlySymbols = settings.generateClient();\n\n        // Load reserved words from a new-line delimited file.\n        ReservedWords reservedWords = new ReservedWordsBuilder()\n            .loadWords(TypeScriptCodegenPlugin.class.getResource(\"reserved-words.txt\"))\n            .build();\n        ReservedWords memberReservedWords = new ReservedWordsBuilder()\n            .loadWords(TypeScriptCodegenPlugin.class.getResource(\"reserved-words-members.txt\"))\n            .build();\n\n        escaper = ReservedWordSymbolProvider.builder()\n            .nameReservedWords(reservedWords)\n            .memberReservedWords(memberReservedWords)\n            // Only escape words when the symbol has a definition file to\n            // prevent escaping intentional references to built-in types.\n            .escapePredicate((shape, symbol) -> !StringUtils.isEmpty(symbol.getDefinitionFile()))\n            .buildEscaper();\n\n        // Get each structure that's used an error.\n        OperationIndex operationIndex = OperationIndex.of(model);\n        model\n            .shapes(OperationShape.class)\n            .forEach(operationShape -> {\n                errorShapes.addAll(operationIndex.getErrors(operationShape, settings.getService()));\n            });\n\n        moduleNameDelegator = new ModuleNameDelegator(shapeChunkSize);\n    }\n\n    static TypeScriptWriter modelIndexer(Collection<Shape> shapes, SymbolProvider symbolProvider) {\n        return ModuleNameDelegator.modelIndexer(shapes, symbolProvider);\n    }\n\n    @Override\n    public Symbol toSymbol(Shape shape) {\n        boolean typeOnly = createTypeOnlySymbols;\n        boolean isError = shape.asStructureShape().isPresent() && shape.hasTrait(ErrorTrait.class);\n        if (shape.isOperationShape() || shape.isResourceShape() || isError || shape.isServiceShape()) {\n            typeOnly = false;\n        }\n        Symbol symbol = shape.accept(this).toBuilder().putProperty(\"typeOnly\", typeOnly).build();\n        LOGGER.fine(() -> \"Creating symbol from \" + shape + \": \" + symbol);\n        return escaper.escapeSymbol(shape, symbol);\n    }\n\n    @Override\n    public String toMemberName(MemberShape shape) {\n        return escaper.escapeMemberName(shape.getMemberName());\n    }\n\n    @Override\n    public Symbol blobShape(BlobShape shape) {\n        if (shape.hasTrait(StreamingTrait.class)) {\n            // Note: `Readable` needs an import and a dependency.\n            return createSymbolBuilder(shape, \"StreamingBlobTypes\", null)\n                .addReference(\n                    Symbol.builder()\n                        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n                        .name(\"StreamingBlobTypes\")\n                        .namespace(\"@smithy/types\", \"/\")\n                        .putProperty(\"typeOnly\", createTypeOnlySymbols)\n                        .build()\n                )\n                .build();\n        }\n\n        return createSymbolBuilder(shape, \"Uint8Array\").build();\n    }\n\n    @Override\n    public Symbol booleanShape(BooleanShape shape) {\n        return createSymbolBuilder(shape, \"boolean\").build();\n    }\n\n    @Override\n    public Symbol listShape(ListShape shape) {\n        boolean sparse = shape.hasTrait(SparseTrait.ID);\n        Symbol reference = toSymbol(shape.getMember());\n        String valueType = (sparse ? \"(\" : \"\") + reference.getName() + (sparse ? \" | null)\" : \"\");\n\n        return createSymbolBuilder(shape, format(\"%s[]\", valueType), null)\n            .addReference(reference)\n            .putProperty(\"typeOnly\", createTypeOnlySymbols)\n            .build();\n    }\n\n    @Override\n    public Symbol setShape(SetShape shape) {\n        Symbol reference = toSymbol(shape.getMember());\n        return createSymbolBuilder(shape, format(\"%s[]\", reference.getName()), null)\n            .addReference(reference)\n            .putProperty(\"typeOnly\", createTypeOnlySymbols)\n            .build();\n    }\n\n    /**\n     * Maps get generated as an inline interface with a fixed value type.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * interface MyStructureShape {\n     *   memberPointingToMap: Record<string, string>;\n     * }\n     * }</pre>\n     *\n     * @inheritDoc\n     */\n    @Override\n    public Symbol mapShape(MapShape shape) {\n        Symbol key = toSymbol(shape.getKey());\n        Symbol value = toSymbol(shape.getValue());\n\n        boolean stringKey = key.toString().equals(\"string\");\n\n        boolean sparse = shape.hasTrait(SparseTrait.ID);\n        String valueType = value.getName() + (sparse ? \" | null\" : \"\");\n\n        return createSymbolBuilder(\n            shape,\n            format(stringKey ? \"Record<%s, %s>\" : \"Partial<Record<%s, %s>>\", key.getName(), valueType),\n            null\n        )\n            .addReference(key)\n            .addReference(value)\n            .putProperty(\"typeOnly\", createTypeOnlySymbols)\n            .build();\n    }\n\n    @Override\n    public Symbol byteShape(ByteShape shape) {\n        return createNumber(shape);\n    }\n\n    @Override\n    public Symbol shortShape(ShortShape shape) {\n        return createNumber(shape);\n    }\n\n    @Override\n    public Symbol integerShape(IntegerShape shape) {\n        return createNumber(shape);\n    }\n\n    @Override\n    public Symbol longShape(LongShape shape) {\n        return createNumber(shape);\n    }\n\n    @Override\n    public Symbol floatShape(FloatShape shape) {\n        return createNumber(shape);\n    }\n\n    @Override\n    public Symbol doubleShape(DoubleShape shape) {\n        return createNumber(shape);\n    }\n\n    private Symbol createNumber(Shape shape) {\n        return createSymbolBuilder(shape, \"number\").build();\n    }\n\n    @Override\n    public Symbol bigIntegerShape(BigIntegerShape shape) {\n        if (\"native\".equals(settings.getBigNumberMode())) {\n            return createSymbolBuilder(shape, \"bigint\").build();\n        }\n        return createBigJsSymbol(shape);\n    }\n\n    @Override\n    public Symbol bigDecimalShape(BigDecimalShape shape) {\n        if (\"native\".equals(settings.getBigNumberMode())) {\n            return createSymbolBuilder(shape, \"NumericValue\", null)\n                .addReference(\n                    Symbol.builder()\n                        .addDependency(TypeScriptDependency.SMITHY_CORE)\n                        .name(\"NumericValue\")\n                        .putProperty(\"typeOnly\", createTypeOnlySymbols)\n                        .namespace(\"@smithy/core/serde\", \"/\")\n                        .build()\n                )\n                .build();\n        }\n        return createBigJsSymbol(shape);\n    }\n\n    private Symbol createBigJsSymbol(Shape shape) {\n        return createSymbolBuilder(shape, \"Big\", TypeScriptDependency.BIG_JS.packageName)\n            .addDependency(TypeScriptDependency.TYPES_BIG_JS)\n            .addDependency(TypeScriptDependency.BIG_JS)\n            .build();\n    }\n\n    @Override\n    public Symbol documentShape(DocumentShape shape) {\n        Symbol.Builder builder = createSymbolBuilder(shape, \"__DocumentType\");\n        Symbol importSymbol = Symbol.builder()\n            .name(\"DocumentType\")\n            .namespace(TypeScriptDependency.SMITHY_TYPES.packageName, \"/\")\n            .putProperty(\"typeOnly\", createTypeOnlySymbols)\n            .build();\n        SymbolReference reference = SymbolReference.builder()\n            .symbol(importSymbol)\n            .alias(\"__DocumentType\")\n            .options(SymbolReference.ContextOption.USE)\n            .putProperty(\"typeOnly\", createTypeOnlySymbols)\n            .build();\n        return builder.addReference(reference).build();\n    }\n\n    @Override\n    public Symbol operationShape(OperationShape shape) {\n        String commandName = flattenShapeName(shape) + \"Command\";\n        String moduleName = moduleNameDelegator.formatModuleName(shape, commandName);\n        Symbol intermediate = createGeneratedSymbolBuilder(shape, commandName, moduleName).build();\n        Symbol.Builder builder = intermediate.toBuilder().putProperty(\"typeOnly\", false);\n        // Add input and output type symbols (XCommandInput / XCommandOutput).\n        builder.putProperty(\n            \"inputType\",\n            intermediate.toBuilder().putProperty(\"typeOnly\", createTypeOnlySymbols).name(commandName + \"Input\").build()\n        );\n        builder.putProperty(\n            \"outputType\",\n            intermediate.toBuilder().putProperty(\"typeOnly\", createTypeOnlySymbols).name(commandName + \"Output\").build()\n        );\n        return builder.build();\n    }\n\n    @Override\n    public Symbol stringShape(StringShape shape) {\n        // Enums that provide a name for each variant create an actual enum type.\n        Optional<EnumTrait> enumTrait = shape.getTrait(EnumTrait.class);\n        if (enumTrait.isPresent()) {\n            return createEnumSymbol(shape, enumTrait.get());\n        }\n\n        // Handle media type generation, defaulting to a string.\n        Optional<MediaTypeTrait> mediaTypeTrait = shape.getTrait(MediaTypeTrait.class);\n        if (mediaTypeTrait.isPresent()) {\n            String mediaType = mediaTypeTrait.get().getValue();\n            if (CodegenUtils.isJsonMediaType(mediaType)) {\n                Symbol.Builder builder = createSymbolBuilder(shape, \"__AutomaticJsonStringConversion | string\");\n                return addSmithyUseImport(\n                    builder,\n                    \"AutomaticJsonStringConversion\",\n                    \"__AutomaticJsonStringConversion\"\n                ).build();\n            } else {\n                LOGGER.warning(() -> \"Found unsupported mediatype \" + mediaType + \" on String shape: \" + shape);\n            }\n        }\n\n        return createSymbolBuilder(shape, \"string\").build();\n    }\n\n    @Override\n    public Symbol enumShape(EnumShape shape) {\n        return stringShape(shape).toBuilder().putProperty(\"typeOnly\", true).build();\n    }\n\n    @Override\n    public Symbol intEnumShape(IntEnumShape shape) {\n        return createObjectSymbolBuilder(shape).putProperty(\"typeOnly\", true).build();\n    }\n\n    private Symbol createEnumSymbol(StringShape shape, EnumTrait enumTrait) {\n        return createObjectSymbolBuilder(shape)\n            .putProperty(EnumTrait.class.getName(), enumTrait)\n            .putProperty(\"typeOnly\", true)\n            .build();\n    }\n\n    @Override\n    public Symbol resourceShape(ResourceShape shape) {\n        return createObjectSymbolBuilder(shape).build();\n    }\n\n    @Override\n    public Symbol serviceShape(ServiceShape shape) {\n        String name = StringUtils.capitalize(shape.getId().getName(shape)) + \"Client\";\n        String moduleName = moduleNameDelegator.formatModuleName(shape, name);\n        return createGeneratedSymbolBuilder(shape, name, moduleName).putProperty(\"typeOnly\", false).build();\n    }\n\n    @Override\n    public Symbol structureShape(StructureShape shape) {\n        return createObjectSymbolBuilder(shape).build();\n    }\n\n    private Symbol.Builder addSmithyUseImport(Symbol.Builder builder, String name, String as) {\n        Symbol importSymbol = Symbol.builder().name(name).namespace(\"@smithy/core/serde\", \"/\").build();\n        SymbolReference reference = SymbolReference.builder()\n            .symbol(importSymbol)\n            .alias(as)\n            .options(SymbolReference.ContextOption.USE)\n            .build();\n        return builder.addReference(reference);\n    }\n\n    @Override\n    public Symbol unionShape(UnionShape shape) {\n        return createObjectSymbolBuilder(shape).build();\n    }\n\n    @Override\n    public Symbol memberShape(MemberShape shape) {\n        Shape targetShape = model\n            .getShape(shape.getTarget())\n            .orElseThrow(() -> new CodegenException(\"Shape not found: \" + shape.getTarget()));\n        Symbol targetSymbol = toSymbol(targetShape);\n\n        if (targetSymbol.getProperties().containsKey(EnumTrait.class.getName()) || targetShape.isIntEnumShape()) {\n            return createMemberSymbolWithEnumTarget(targetSymbol);\n        }\n\n        // While unions are targeted with the streaming trait to make them event streams,\n        // we don't want to generate a unique type for event streams but instead make\n        // member references to them AsyncIterable of the union we generate.\n        if (targetShape.hasTrait(StreamingTrait.class) && targetShape.isUnionShape()) {\n            return createMemberSymbolWithEventStream(targetSymbol);\n        }\n\n        return targetSymbol;\n    }\n\n    // Enums were considered \"open\" with the union `| string` or `| number`, meaning it was a backwards\n    // compatible change to add new members. This behavior was later removed to improve the helpfulness\n    // of closed enumerated union types.\n    // For overrides, users should use available type system overrides such as \"as any\" or\n    // pragma comments.\n    private Symbol createMemberSymbolWithEnumTarget(Symbol targetSymbol) {\n        return targetSymbol\n            .toBuilder()\n            .namespace(null, \"/\")\n            .name(targetSymbol.getName())\n            .addReference(targetSymbol)\n            .build();\n    }\n\n    private Symbol createMemberSymbolWithEventStream(Symbol targetSymbol) {\n        return targetSymbol\n            .toBuilder()\n            .putProperty(\"typeOnly\", createTypeOnlySymbols)\n            .namespace(null, \"/\")\n            .name(String.format(\"AsyncIterable<%s>\", targetSymbol.getName()))\n            .addReference(targetSymbol)\n            .build();\n    }\n\n    @Override\n    public Symbol timestampShape(TimestampShape shape) {\n        return createSymbolBuilder(shape, \"Date\").build();\n    }\n\n    private String flattenShapeName(ToShapeId id) {\n        ServiceShape serviceShape = model.expectShape(settings.getService(), ServiceShape.class);\n        return StringUtils.capitalize(id.toShapeId().getName(serviceShape));\n    }\n\n    private Symbol.Builder createObjectSymbolBuilder(Shape shape) {\n        String name = flattenShapeName(shape);\n        String moduleName = moduleNameDelegator.formatModuleName(shape, name);\n        return createGeneratedSymbolBuilder(shape, name, moduleName);\n    }\n\n    private Symbol.Builder createSymbolBuilder(Shape shape, String typeName) {\n        return Symbol.builder().putProperty(\"shape\", shape).name(typeName);\n    }\n\n    private Symbol.Builder createSymbolBuilder(Shape shape, String typeName, String namespace) {\n        return Symbol.builder().putProperty(\"shape\", shape).name(typeName).namespace(namespace, \"/\");\n    }\n\n    private Symbol.Builder createGeneratedSymbolBuilder(Shape shape, String typeName, String namespace) {\n        String trimmedNamespace = namespace.startsWith(\"./\") ? namespace.substring(2) : namespace;\n        String prefixedNamespace = String.join(\"/\", \".\", CodegenUtils.SOURCE_FOLDER, trimmedNamespace);\n        return createSymbolBuilder(shape, typeName, prefixedNamespace).definitionFile(toFilename(prefixedNamespace));\n    }\n\n    private String toFilename(String namespace) {\n        return namespace + \".ts\";\n    }\n\n    /**\n     * Utility class to locate which path should the symbol be generated into.\n     * It will break the models into multiple files to prevent it getting too big.\n     */\n    static final class ModuleNameDelegator {\n\n        static final int DEFAULT_CHUNK_SIZE = 300;\n        static final String SHAPE_NAMESPACE_PREFIX = \"models\";\n\n        private final Map<Shape, String> visitedModels = new HashMap<>();\n        private int bucketCount = 0;\n        private int currentBucketSize = 0;\n        private final int chunkSize;\n\n        ModuleNameDelegator(int shapeChunkSize) {\n            chunkSize = shapeChunkSize;\n        }\n\n        public String formatModuleName(Shape shape, String name) {\n            // All shapes except for the service and operations are stored in models.\n            if (shape.getType() == ShapeType.SERVICE) {\n                return String.join(\"/\", \".\", name);\n            } else if (shape.getType() == ShapeType.OPERATION) {\n                return String.join(\"/\", \".\", CommandGenerator.COMMANDS_FOLDER, name);\n            } else if (visitedModels.containsKey(shape)) {\n                return visitedModels.get(shape);\n            }\n\n            String path;\n            if (shape.isEnumShape() || shape.isIntEnumShape() || shape.hasTrait(EnumTrait.class)) {\n                path = String.join(\"/\", \".\", SHAPE_NAMESPACE_PREFIX, \"enums\");\n            } else if (shape.isStructureShape() && shape.hasTrait(ErrorTrait.class)) {\n                path = String.join(\"/\", \".\", SHAPE_NAMESPACE_PREFIX, \"errors\");\n            } else if (shape.getId().equals(UnitTypeTrait.UNIT) || shape.isResourceShape()) {\n                // Unit or Resource shapes should only be put in the zero bucket, since they do not\n                // generate anything. They also do not contribute to bucket size.\n                path = String.join(\"/\", \".\", SHAPE_NAMESPACE_PREFIX, \"models_0\");\n            } else {\n                path = String.join(\"/\", \".\", SHAPE_NAMESPACE_PREFIX, \"models_\" + bucketCount);\n                currentBucketSize++;\n                if (currentBucketSize == chunkSize) {\n                    bucketCount++;\n                    currentBucketSize = 0;\n                }\n            }\n            visitedModels.put(shape, path);\n            return path;\n        }\n\n        static TypeScriptWriter modelIndexer(Collection<Shape> shapes, SymbolProvider symbolProvider) {\n            TypeScriptWriter writer = new TypeScriptWriter(\"\");\n            String modelPrefix = String.join(\"/\", \".\", CodegenUtils.SOURCE_FOLDER, SHAPE_NAMESPACE_PREFIX);\n            List<String> collectedModelNamespaces = shapes\n                .stream()\n                .map(shape -> symbolProvider.toSymbol(shape).getNamespace())\n                .filter(namespace -> namespace.startsWith(modelPrefix))\n                .distinct()\n                .sorted(Comparator.naturalOrder())\n                .map(\n                    namespace -> namespace.replaceFirst(\n                        Matcher.quoteReplacement(modelPrefix),\n                        String.join(\"/\", \".\", SHAPE_NAMESPACE_PREFIX)\n                    )\n                )\n                .toList();\n\n            // Export empty model index if no other files are present.\n            if (collectedModelNamespaces.isEmpty()) {\n                writer.write(\"export {};\");\n            } else {\n                for (String namespace : collectedModelNamespaces) {\n                    boolean typesOnly = namespace.contains(\"models_\");\n                    if (!typesOnly) {\n                        writer.write(\"export * from $S;\", namespace);\n                    }\n                }\n            }\n\n            // export types by name only\n            Map<String, TreeSet<String>> namespaceToShapes = new TreeMap<>();\n\n            for (Shape shape : shapes) {\n                if (shape.isStructureShape() && !shape.hasTrait(ErrorTrait.class)) {\n                    Symbol symbol = symbolProvider.toSymbol(shape);\n                    String namespace = symbol\n                        .getNamespace()\n                        .replaceFirst(\n                            Matcher.quoteReplacement(String.join(\"/\", \".\", CodegenUtils.SOURCE_FOLDER)),\n                            \".\"\n                        );\n                    namespaceToShapes.computeIfAbsent(namespace, k -> new TreeSet<>());\n                    namespaceToShapes.get(namespace).add(symbol.getName());\n                }\n            }\n\n            for (Map.Entry<String, TreeSet<String>> entry : namespaceToShapes.entrySet()) {\n                String namespace = entry.getKey();\n                // server models have runtime components and should therefore be\n                // exported as is, rather than types-only.\n                writer.write(\n                    \"\"\"\n                    export * from $S;\"\"\",\n                    namespace\n                );\n            }\n\n            return writer;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptClientCodegenPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ServiceLoader;\nimport java.util.ServiceLoader.Provider;\nimport java.util.logging.Logger;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.build.SmithyBuildPlugin;\nimport software.amazon.smithy.codegen.core.directed.CodegenDirector;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Plugin to trigger TypeScript client code generation.\n */\n@SmithyInternalApi\npublic class TypeScriptClientCodegenPlugin implements SmithyBuildPlugin {\n\n    private static final Logger LOGGER = Logger.getLogger(TypeScriptClientCodegenPlugin.class.getName());\n\n    @Override\n    public String getName() {\n        return \"typescript-client-codegen\";\n    }\n\n    @Override\n    public void execute(PluginContext context) {\n        CodegenDirector<TypeScriptWriter, TypeScriptIntegration, TypeScriptCodegenContext, TypeScriptSettings> runner =\n            new CodegenDirector<>();\n\n        runner.directedCodegen(new DirectedTypeScriptCodegen());\n\n        // Set the SmithyIntegration class to look for and apply using SPI.\n        runner.integrationClass(TypeScriptIntegration.class);\n\n        // Set the FileManifest and Model from the plugin.\n        runner.fileManifest(context.getFileManifest());\n        runner.model(context.getModel());\n\n        // Create the TypeScriptSettings object from the plugin settings.\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            context.getModel(),\n            context.getSettings(),\n            TypeScriptSettings.ArtifactType.CLIENT\n        );\n        runner.settings(settings);\n\n        // Only add integrations if the integrations match the settings\n        // This uses {@link TypeScriptIntegration#matchesSettings}, which is a\n        // Smithy internal API. This may be removed at any point.\n        runner.integrationFinder(\n            () -> () -> ServiceLoader.load(TypeScriptIntegration.class, CodegenDirector.class.getClassLoader())\n                .stream()\n                .map(Provider::get)\n                .filter(integration -> {\n                    boolean matchesSettings = integration.matchesSettings(settings);\n                    if (!matchesSettings) {\n                        LOGGER.fine(\n                            () -> \"Skipping TypeScript integration based on settings: \"\n                                + integration.name()\n                        );\n                    }\n                    return matchesSettings;\n                })\n                .iterator()\n        );\n\n        runner.service(settings.getService());\n\n        // Configure the director to perform some common model transforms.\n        runner.performDefaultCodegenTransforms();\n\n        // TODO: Not using below because it would break existing AWS SDKs. Maybe it should be configurable\n        // so generic SDKs call this by default, but AWS SDKs can opt-out of it via a setting.\n        // runner.createDedicatedInputsAndOutputs();\n\n        // Run it!\n        runner.run();\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptCodegenContext.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.CodegenContext;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Holds context related to code generation.\n */\n@SmithyUnstableApi\npublic final class TypeScriptCodegenContext\n    implements CodegenContext<TypeScriptSettings, TypeScriptWriter, TypeScriptIntegration> {\n\n    private final Model model;\n    private final TypeScriptSettings settings;\n    private final SymbolProvider symbolProvider;\n    private final FileManifest fileManifest;\n    private final TypeScriptDelegator writerDelegator;\n    private final List<TypeScriptIntegration> integrations;\n    private final List<RuntimeClientPlugin> runtimePlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private TypeScriptCodegenContext(Builder builder) {\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        fileManifest = SmithyBuilder.requiredState(\"fileManifest\", builder.fileManifest);\n        writerDelegator = SmithyBuilder.requiredState(\"writerDelegator\", builder.writerDelegator);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        runtimePlugins = SmithyBuilder.requiredState(\"runtimePlugins\", builder.runtimePlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    @Override\n    public Model model() {\n        return model;\n    }\n\n    @Override\n    public TypeScriptSettings settings() {\n        return settings;\n    }\n\n    @Override\n    public SymbolProvider symbolProvider() {\n        return symbolProvider;\n    }\n\n    @Override\n    public FileManifest fileManifest() {\n        return fileManifest;\n    }\n\n    @Override\n    public TypeScriptDelegator writerDelegator() {\n        return writerDelegator;\n    }\n\n    @Override\n    public List<TypeScriptIntegration> integrations() {\n        return integrations;\n    }\n\n    public List<RuntimeClientPlugin> runtimePlugins() {\n        return runtimePlugins;\n    }\n\n    public ProtocolGenerator protocolGenerator() {\n        return protocolGenerator;\n    }\n\n    public ApplicationProtocol applicationProtocol() {\n        return applicationProtocol;\n    }\n\n    /**\n     * @return Returns a builder.\n     */\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    /**\n     * Builds {@link TypeScriptCodegenContext}s.\n     */\n    public static final class Builder implements SmithyBuilder<TypeScriptCodegenContext> {\n\n        private Model model;\n        private TypeScriptSettings settings;\n        private SymbolProvider symbolProvider;\n        private FileManifest fileManifest;\n        private TypeScriptDelegator writerDelegator;\n        private List<TypeScriptIntegration> integrations = new ArrayList<>();\n        private List<RuntimeClientPlugin> runtimePlugins = new ArrayList<>();\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public TypeScriptCodegenContext build() {\n            return new TypeScriptCodegenContext(this);\n        }\n\n        /**\n         * @param model The model being generated.\n         * @return Returns the builder.\n         */\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        /**\n         * @param settings The resolved settings for the generator.\n         * @return Returns the builder.\n         */\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        /**\n         * @param symbolProvider The finalized symbol provider for the generator.\n         * @return Returns the builder.\n         */\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        /**\n         * @param fileManifest The file manifest being used in the generator.\n         * @return Returns the builder.\n         */\n        public Builder fileManifest(FileManifest fileManifest) {\n            this.fileManifest = fileManifest;\n            return this;\n        }\n\n        /**\n         * @param writerDelegator The writer delegator to use in the generator.\n         * @return Returns the builder.\n         */\n        public Builder writerDelegator(TypeScriptDelegator writerDelegator) {\n            this.writerDelegator = writerDelegator;\n            return this;\n        }\n\n        /**\n         * @param integrations The integrations to use in the generator.\n         * @return Returns the builder.\n         */\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations.clear();\n            this.integrations.addAll(integrations);\n            return this;\n        }\n\n        /**\n         * @param runtimePlugins The runtime plugins to use in the generator.\n         * @return Returns the builder.\n         */\n        public Builder runtimePlugins(List<RuntimeClientPlugin> runtimePlugins) {\n            this.runtimePlugins.clear();\n            this.runtimePlugins.addAll(runtimePlugins);\n            return this;\n        }\n\n        /**\n         * @param protocolGenerator The protocol generator to use in the generator.\n         * @return Returns the builder.\n         */\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        /**\n         * @param applicationProtocol The application protocol to use in the generator.\n         * @return Returns the builder.\n         */\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptCodegenPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Plugin to trigger TypeScript code generation.\n * @deprecated Use {@link TypeScriptClientCodegenPlugin} instead.\n */\n@SmithyInternalApi\n@Deprecated\npublic final class TypeScriptCodegenPlugin extends TypeScriptClientCodegenPlugin {\n\n    @Override\n    public String getName() {\n        return \"typescript-codegen\";\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDelegator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.WriterDelegator;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class TypeScriptDelegator extends WriterDelegator<TypeScriptWriter> {\n\n    TypeScriptDelegator(FileManifest fileManifest, SymbolProvider symbolProvider) {\n        super(fileManifest, symbolProvider, new TypeScriptWriter.TypeScriptWriterFactory());\n    }\n\n    /**\n     * Gets all of the dependencies that have been registered in writers owned by the delegator, along with any\n     * unconditional dependencies.\n     *\n     * @return Returns all the dependencies.\n     */\n    @Override\n    public List<SymbolDependency> getDependencies() {\n        // Always add unconditional dependencies.\n        List<SymbolDependency> resolved = new ArrayList<>(TypeScriptDependency.getUnconditionalDependencies());\n        resolved.addAll(super.getDependencies());\n        return resolved;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.Reader;\nimport java.net.URL;\nimport java.nio.charset.StandardCharsets;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Properties;\nimport java.util.logging.Logger;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * An enum of all of the built-in dependencies managed by this package.\n */\n@SmithyUnstableApi\npublic enum TypeScriptDependency implements Dependency {\n    SMITHY_TYPES(\"dependencies\", \"@smithy/types\", true),\n    SMITHY_CORE(\"dependencies\", \"@smithy/core\", false),\n\n    AWS_CRYPTO_SHA256_BROWSER(\"dependencies\", \"@aws-crypto/sha256-browser\", \"5.2.0\", true),\n    AWS_CRYPTO_SHA256_JS(\"dependencies\", \"@aws-crypto/sha256-js\", \"5.2.0\", true),\n    AWS_SDK_CLIENT_DOCGEN(\"devDependencies\", \"@smithy/service-client-documentation-generator\", false),\n    AWS_SDK_FETCH_HTTP_HANDLER(\"dependencies\", \"@smithy/fetch-http-handler\", false),\n    AWS_SDK_NODE_HTTP_HANDLER(\"dependencies\", \"@smithy/node-http-handler\", false),\n    BIG_JS(\"dependencies\", \"big.js\", \"^6.0.0\", false),\n    BODY_CHECKSUM(\"dependencies\", \"@smithy/middleware-apply-body-checksum\", false),\n    HTML_ENTITIES(\"dependencies\", \"entities\", \"2.2.0\", false),\n    MIDDLEWARE_COMPRESSION(\"dependencies\", \"@smithy/middleware-compression\", false),\n    SIGNATURE_V4(\"dependencies\", \"@smithy/signature-v4\", false),\n    TYPES_BIG_JS(\"devDependencies\", \"@types/big.js\", \"^6.0.0\", false),\n    TYPES_NODE(\"devDependencies\", \"@types/node\", \"^20.14.8\", true),\n    XML_PARSER(\"dependencies\", \"fast-xml-parser\", \"5.7.1\", false),\n\n    // todo: core/endpoints\n    @Deprecated\n    MIDDLEWARE_ENDPOINTS_V2(\"dependencies\", \"@smithy/middleware-endpoint\", \"0.0.0\", false),\n    @Deprecated\n    UTIL_ENDPOINTS(\"dependencies\", \"@smithy/util-endpoints\", \"0.0.0\", false),\n\n    // todo: core/retry\n    @Deprecated\n    MIDDLEWARE_RETRY(\"dependencies\", \"@smithy/middleware-retry\", \"0.0.0\", false),\n    @Deprecated\n    UTIL_RETRY(\"dependencies\", \"@smithy/util-retry\", \"0.0.0\", false),\n\n    // devtools\n    @Deprecated\n    EXPERIMENTAL_IDENTITY_AND_AUTH(\"dependencies\", \"@smithy/experimental-identity-and-auth\", false),\n    SERVER_COMMON(\"dependencies\", \"@aws-smithy/server-common\", false),\n    SNAPSHOTS(\"devDependencies\", \"@smithy/snapshot-testing\", false),\n    TYPEDOC(\"devDependencies\", \"typedoc\", \"0.23.23\", false),\n    VITEST(\"devDependencies\", \"vitest\", \"^4.0.17\", false),\n\n    // Deprecated: consolidated into @smithy/core submodules.\n    // Retained for backward compatibility with downstream codegen.\n    @Deprecated\n    AWS_SDK_HASH_NODE(\"dependencies\", \"@smithy/hash-node\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_QUERYSTRING_BUILDER(\"dependencies\", \"@smithy/querystring-builder\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_TYPES(\"dependencies\", \"@aws-sdk/types\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_URL_PARSER(\"dependencies\", \"@smithy/url-parser\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_BODY_LENGTH_BROWSER(\"dependencies\", \"@smithy/util-body-length-browser\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_BODY_LENGTH_NODE(\"dependencies\", \"@smithy/util-body-length-node\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_DEFAULTS_MODE_BROWSER(\"dependencies\", \"@smithy/util-defaults-mode-browser\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_DEFAULTS_MODE_NODE(\"dependencies\", \"@smithy/util-defaults-mode-node\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_ENDPOINTS(\"dependencies\", \"@aws-sdk/util-endpoints\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_MIDDLEWARE(\"dependencies\", \"@smithy/util-middleware\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_UTIL_WAITERS(\"dependencies\", \"@smithy/util-waiter\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SMITHY_CLIENT(\"dependencies\", \"@smithy/smithy-client\", \"0.0.0\", false),\n    @Deprecated\n    CONFIG_RESOLVER(\"dependencies\", \"@smithy/config-resolver\", \"0.0.0\", false),\n    @Deprecated\n    INVALID_DEPENDENCY(\"dependencies\", \"@smithy/invalid-dependency\", \"0.0.0\", false),\n    @Deprecated\n    MD5_BROWSER(\"dependencies\", \"@smithy/md5-js\", \"0.0.0\", false),\n    @Deprecated\n    MIDDLEWARE_CONTENT_LENGTH(\"dependencies\", \"@smithy/middleware-content-length\", \"0.0.0\", false),\n    @Deprecated\n    MIDDLEWARE_SERDE(\"dependencies\", \"@smithy/middleware-serde\", \"0.0.0\", false),\n    @Deprecated\n    MIDDLEWARE_STACK(\"dependencies\", \"@smithy/middleware-stack\", \"0.0.0\", false),\n    @Deprecated\n    NODE_CONFIG_PROVIDER(\"dependencies\", \"@smithy/node-config-provider\", \"0.0.0\", false),\n    @Deprecated\n    PROTOCOL_HTTP(\"dependencies\", \"@smithy/protocol-http\", \"0.0.0\", false),\n    @Deprecated\n    SMITHY_UUID(\"dependencies\", \"@smithy/uuid\", \"0.0.0\", false),\n    @Deprecated\n    STREAM_HASHER_BROWSER(\"dependencies\", \"@smithy/hash-blob-browser\", \"0.0.0\", false),\n    @Deprecated\n    STREAM_HASHER_NODE(\"dependencies\", \"@smithy/hash-stream-node\", \"0.0.0\", false),\n    @Deprecated\n    UTIL_MIDDLEWARE(\"dependencies\", \"@smithy/util-middleware\", \"0.0.0\", false),\n    @Deprecated\n    UTIL_STREAM(\"dependencies\", \"@smithy/util-stream\", \"0.0.0\", false),\n    @Deprecated\n    UTIL_STREAM_BROWSER(\"dependencies\", \"@smithy/util-stream-browser\", \"0.0.0\", false),\n    @Deprecated\n    UTIL_STREAM_NODE(\"dependencies\", \"@smithy/util-stream-node\", \"0.0.0\", false),\n    @Deprecated\n    UUID(\"dependencies\", \"uuid\", \"0.0.0\", false),\n    @Deprecated\n    UUID_TYPES(\"dependencies\", \"@types/uuid\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_EVENTSTREAM_CODEC(\"dependencies\", \"@smithy/eventstream-codec\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_EVENTSTREAM_SERDE_BROWSER(\"dependencies\", \"@smithy/eventstream-serde-browser\", \"0.0.0\", false),\n    @Deprecated\n    AWS_SDK_EVENTSTREAM_SERDE_CONFIG_RESOLVER(\n        \"dependencies\",\n        \"@smithy/eventstream-serde-config-resolver\",\n        \"0.0.0\",\n        false\n    ),\n    @Deprecated\n    AWS_SDK_EVENTSTREAM_SERDE_NODE(\"dependencies\", \"@smithy/eventstream-serde-node\", \"0.0.0\", false);\n\n    public static final String NORMAL_DEPENDENCY = \"dependencies\";\n    public static final String DEV_DEPENDENCY = \"devDependencies\";\n    public static final String PEER_DEPENDENCY = \"peerDependencies\";\n    public static final String BUNDLED_DEPENDENCY = \"bundledDependencies\";\n    public static final String OPTIONAL_DEPENDENCY = \"optionalDependencies\";\n\n    public final String packageName;\n    public final String version;\n    public final SymbolDependency dependency;\n\n    TypeScriptDependency(String type, String name, boolean unconditional) {\n        String version;\n        if (name.startsWith(\"@aws-sdk/\")) {\n            version = SdkVersion.getVersion(name);\n        } else {\n            version = DependencyVersion.getVersion(name);\n        }\n\n        if (version == null) {\n            version = \"latest\";\n        }\n\n        if (name.startsWith(\"@smithy/\") || name.startsWith(\"@aws-sdk/\")) {\n            if (!version.startsWith(\"^\") && version.matches(\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\")) {\n                version = \"^\" + version;\n            }\n        }\n\n        this.dependency = SymbolDependency.builder()\n            .dependencyType(type)\n            .packageName(name)\n            .version(version)\n            .putProperty(\"unconditional\", unconditional)\n            .build();\n        this.packageName = name;\n        this.version = version;\n    }\n\n    TypeScriptDependency(String type, String name, String version, boolean unconditional) {\n        this.dependency = SymbolDependency.builder()\n            .dependencyType(type)\n            .packageName(name)\n            .version(version)\n            .putProperty(\"unconditional\", unconditional)\n            .build();\n        this.packageName = name;\n        this.version = version;\n    }\n\n    /**\n     * Get all dependencies that are always added to the generated\n     * package.json file.\n     *\n     * @return Returns all of the unconditional dependencies.\n     */\n    public static List<SymbolDependency> getUnconditionalDependencies() {\n        List<SymbolDependency> resolved = new ArrayList<>();\n\n        for (TypeScriptDependency dependency : TypeScriptDependency.values()) {\n            if (dependency.isUnconditional()) {\n                resolved.add(dependency.dependency);\n            }\n        }\n\n        return resolved;\n    }\n\n    /**\n     * @return the smithy core version, used in @smithy/core versioning scheme.\n     */\n    public static String getSmithyCoreVersion() {\n        return DependencyVersion.VERSIONS.get(\"@smithy/core\");\n    }\n\n    /**\n     * Note: if AWS SDK codegen is not loaded, then this will not work correctly.\n     *\n     * @return the leading AWS SDK client version, used in @aws-sdk/ckient versioning scheme.\n     */\n    public static String getAwsSdkLeadingClientVersion() {\n        return SdkVersion.getLeadingAwsSdkClientVersion();\n    }\n\n    @Override\n    public List<SymbolDependency> getDependencies() {\n        return Collections.singletonList(dependency);\n    }\n\n    @Override\n    public String getPackageName() {\n        return this.packageName;\n    }\n\n    /**\n     * Creates a Symbol from the dependency of the enum, using the package\n     * name and version of the dependency and the provided {@code name}.\n     *\n     * <p>The created Symbol will have a dependency on the enum's\n     * dependency.\n     *\n     * @param name Name to attach to the symbol.\n     * @return Returns the created Symbol.\n     */\n    public Symbol createSymbol(String name) {\n        return Symbol.builder()\n            .namespace(dependency.getPackageName(), \"/\")\n            .name(name)\n            .addDependency(dependency)\n            .build();\n    }\n\n    private boolean isUnconditional() {\n        return dependency.expectProperty(\"unconditional\", Boolean.class);\n    }\n\n    /**\n     * Reads the versions of AWS-published libraries from smithy-aws-typescript-codegen, if it's available\n     * on the classpath.\n     */\n    private static final class SdkVersion {\n\n        private static final Logger LOGGER = Logger.getLogger(SdkVersion.class.getName());\n        private static final String PROPERTIES_PATH =\n            \"/software/amazon/smithy/aws/typescript/codegen/sdkVersions.properties\";\n        private static final Map<String, String> VERSIONS;\n\n        static {\n            Map<String, String> tmpVersions;\n            try {\n                URL versionsUrl = SdkVersion.class.getResource(PROPERTIES_PATH);\n                if (versionsUrl == null) {\n                    throw new IOException();\n                }\n                Properties p = new Properties();\n                try (\n                    Reader r = new BufferedReader(\n                        new InputStreamReader(versionsUrl.openStream(), StandardCharsets.UTF_8)\n                    )\n                ) {\n                    p.load(r);\n                }\n                final Map<String, String> versions = new HashMap<>(p.size());\n                p.forEach((k, v) -> {\n                    if (versions.put(k.toString(), v.toString()) != null) {\n                        throw new IllegalArgumentException(String.format(\"Multiple versions defined for %s\", k));\n                    }\n                });\n                tmpVersions = Collections.unmodifiableMap(versions);\n            } catch (IOException e) {\n                LOGGER.fine(\n                    \"Could not read AWS dependency versions from smithy-aws-typescript-codegen, \" +\n                        \"will use 'latest' for AWS dependencies\"\n                );\n                tmpVersions = Collections.emptyMap();\n            }\n            VERSIONS = tmpVersions;\n        }\n\n        /**\n         * @return highest client version in the sdkVersions.properties file.\n         */\n        public static String getLeadingAwsSdkClientVersion() {\n            int major = 0;\n            int minor = 0;\n            int patch = 0;\n\n            for (Map.Entry<String, String> entry : VERSIONS.entrySet()) {\n                String packageName = entry.getKey();\n                String version = entry.getValue();\n\n                boolean isClient = packageName.startsWith(\"@aws-sdk/client-\");\n                if (isClient) {\n                    boolean isSemverTrinumeric = version.matches(\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\");\n                    if (isSemverTrinumeric) {\n                        String[] semver = version.split(\"\\\\.\");\n                        major = Math.max(Integer.parseInt(semver[0]), major);\n                        minor = Math.max(Integer.parseInt(semver[1]), minor);\n                        patch = Math.max(Integer.parseInt(semver[2]), patch);\n                    }\n                }\n            }\n            return \"%s.%s.%s\".formatted(major, minor, patch);\n        }\n\n        private static String getVersion(String packageName) {\n            return VERSIONS.getOrDefault(packageName, \"latest\");\n        }\n    }\n\n    /**\n     * Reads the version of smithy-typescript published libraries.\n     */\n    private static final class DependencyVersion {\n\n        private static final Logger LOGGER = Logger.getLogger(DependencyVersion.class.getName());\n        private static final Map<String, String> VERSIONS;\n\n        static {\n            Map<String, String> tmpVersions;\n            try {\n                URL versionsUrl = DependencyVersion.class.getResource(\"dependencyVersions.properties\");\n                if (versionsUrl == null) {\n                    throw new IOException();\n                }\n                Properties p = new Properties();\n                try (\n                    Reader r = new BufferedReader(\n                        new InputStreamReader(versionsUrl.openStream(), StandardCharsets.UTF_8)\n                    )\n                ) {\n                    p.load(r);\n                }\n                final Map<String, String> versions = new HashMap<>(p.size());\n                p.forEach((k, v) -> {\n                    if (versions.put(k.toString(), v.toString()) != null) {\n                        throw new IllegalArgumentException(String.format(\"Multiple versions defined for %s\", k));\n                    }\n                });\n                tmpVersions = Collections.unmodifiableMap(versions);\n            } catch (IOException e) {\n                LOGGER.warning(\"Could not read dependency versions from smithy-typescript-codegen\");\n                tmpVersions = Collections.emptyMap();\n            }\n            VERSIONS = tmpVersions;\n        }\n\n        private static String getVersion(String packageName) {\n            return VERSIONS.get(packageName);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptJmesPathVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.jmespath.ExpressionVisitor;\nimport software.amazon.smithy.jmespath.JmespathExpression;\nimport software.amazon.smithy.jmespath.ast.AndExpression;\nimport software.amazon.smithy.jmespath.ast.ComparatorExpression;\nimport software.amazon.smithy.jmespath.ast.CurrentExpression;\nimport software.amazon.smithy.jmespath.ast.ExpressionTypeExpression;\nimport software.amazon.smithy.jmespath.ast.FieldExpression;\nimport software.amazon.smithy.jmespath.ast.FilterProjectionExpression;\nimport software.amazon.smithy.jmespath.ast.FlattenExpression;\nimport software.amazon.smithy.jmespath.ast.FunctionExpression;\nimport software.amazon.smithy.jmespath.ast.IndexExpression;\nimport software.amazon.smithy.jmespath.ast.LiteralExpression;\nimport software.amazon.smithy.jmespath.ast.MultiSelectHashExpression;\nimport software.amazon.smithy.jmespath.ast.MultiSelectListExpression;\nimport software.amazon.smithy.jmespath.ast.NotExpression;\nimport software.amazon.smithy.jmespath.ast.ObjectProjectionExpression;\nimport software.amazon.smithy.jmespath.ast.OrExpression;\nimport software.amazon.smithy.jmespath.ast.ProjectionExpression;\nimport software.amazon.smithy.jmespath.ast.SliceExpression;\nimport software.amazon.smithy.jmespath.ast.Subexpression;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\nclass TypeScriptJmesPathVisitor implements ExpressionVisitor<Void> {\n\n    // Execution context is the current \"head\" of the execution. This is scope on which the expression\n    // is currently operating across. It is imperative that this is kept up to date on expression.accept and return.\n    private String executionContext;\n\n    private int scopeCount;\n    private String accessor;\n    private TypeScriptWriter writer;\n    private JmespathExpression jmesExpression;\n\n    TypeScriptJmesPathVisitor(TypeScriptWriter writer, String accessor, JmespathExpression expression) {\n        this.writer = writer;\n        this.accessor = accessor;\n        executionContext = accessor;\n        jmesExpression = expression;\n        scopeCount = 0;\n    }\n\n    public void run() {\n        writer.openBlock(\"const returnComparator = () => {\", \"}\", () -> {\n            executionContext = accessor;\n            jmesExpression.accept(this);\n            writer.write(\"return $L;\", executionContext);\n        });\n        executionContext = \"returnComparator()\";\n    }\n\n    @Override\n    public Void visitComparator(ComparatorExpression expression) {\n        String executionContextInital = executionContext;\n        String comparator = expression.getComparator().toString();\n\n        expression.getLeft().accept(this);\n        String leftContext = executionContext;\n\n        executionContext = executionContextInital;\n\n        expression.getRight().accept(this);\n        String rightContext = executionContext;\n\n        executionContext = String.format(\"(%s %s %s)\", leftContext, comparator, rightContext);\n        return null;\n    }\n\n    @Override\n    public Void visitCurrentNode(CurrentExpression expression) {\n        // Fall through as visitCurrentNode is saying that there is a noop here. Execution context does not change.\n        return null;\n    }\n\n    @Override\n    public Void visitExpressionType(ExpressionTypeExpression expression) {\n        throw new CodegenException(\"TypeScriptJmesPath visitor not implemented ExpressionTypeExpression\");\n    }\n\n    @Override\n    public Void visitFlatten(FlattenExpression expression) {\n        expression.getExpression().accept(this);\n        String flatScope = makeNewScope(\"flat_\");\n        writer.write(\"let $L: any[] = [].concat(...$L);\", flatScope, executionContext);\n        executionContext = flatScope;\n        return null;\n    }\n\n    @Override\n    public Void visitFunction(FunctionExpression expression) {\n        ArrayList<String> executionContexts = new ArrayList<>();\n\n        String orginalExecutionContext = this.executionContext;\n        expression.arguments.forEach((JmespathExpression argExpression) -> {\n            argExpression.accept(this);\n            switch (expression.getName()) {\n                case \"length\":\n                    executionContext = executionContext + \".length\";\n                    break;\n                case \"contains\":\n                    executionContexts.add(executionContext);\n                    this.executionContext = orginalExecutionContext;\n                    break;\n                default:\n                    throw new CodegenException(\n                        \"TypeScriptJmesPath visitor has not implemented function: \" + expression.getName()\n                    );\n            }\n        });\n\n        if (expression.getName().equals(\"contains\")) {\n            executionContext = String.join(\".includes(\", executionContexts) + \")\";\n        }\n        return null;\n    }\n\n    @Override\n    public Void visitField(FieldExpression expression) {\n        executionContext += \".\";\n        executionContext += expression.getName();\n        return null;\n    }\n\n    @Override\n    public Void visitIndex(IndexExpression expression) {\n        if (expression.getIndex() >= 0) {\n            executionContext += (\"[\" + expression.getIndex() + \"]\");\n        } else {\n            executionContext += \"[\" + executionContext + \".length\";\n            executionContext += \" - \" + Math.abs(expression.getIndex()) + \"]\";\n        }\n        return null;\n    }\n\n    @Override\n    public Void visitLiteral(LiteralExpression expression) {\n        switch (expression.getType()) {\n            case STRING:\n                executionContext = \"\\\"\" + expression.getValue().toString() + \"\\\"\";\n                break;\n            case OBJECT:\n                executionContext = serializeObject(expression.expectObjectValue());\n                break;\n            case ARRAY:\n                executionContext = serializeArray(expression.expectArrayValue());\n                break;\n            default:\n                // All other options are already valid js literials.\n                // (BOOLEAN, ANY, NULL, NUMBER, EXPRESSION)\n                executionContext = expression.getValue().toString();\n                break;\n        }\n        return null;\n    }\n\n    @Override\n    public Void visitMultiSelectList(MultiSelectListExpression expression) {\n        ArrayList<String> evaluators = new ArrayList<String>();\n\n        String executionContextInital = executionContext;\n\n        expression\n            .getExpressions()\n            .forEach((JmespathExpression exp) -> {\n                exp.accept(this);\n                evaluators.add(executionContext);\n                executionContext = executionContextInital;\n            });\n\n        String resultScope = makeNewScope(\"result_\");\n        writer.write(\"let $L = [];\", resultScope);\n        for (String evaluator : evaluators) {\n            writer.write(\"$L.push($L);\", resultScope, evaluator);\n        }\n        writer.write(\"$L = $L;\", executionContext, resultScope);\n\n        return null;\n    }\n\n    @Override\n    public Void visitMultiSelectHash(MultiSelectHashExpression expression) {\n        throw new CodegenException(\"TypeScriptJmesPath visitor not implemented MultiSelectHashExpression\");\n    }\n\n    @Override\n    public Void visitAnd(AndExpression expression) {\n        String initialContext = executionContext;\n\n        expression.getLeft().accept(this);\n        String leftContext = executionContext;\n        executionContext = initialContext;\n\n        expression.getRight().accept(this);\n        String rightContext = executionContext;\n\n        executionContext = String.format(\"(%s && %s)\", leftContext, rightContext);\n        return null;\n    }\n\n    @Override\n    public Void visitOr(OrExpression expression) {\n        String initialContext = executionContext;\n\n        expression.getLeft().accept(this);\n        String leftContext = executionContext;\n        executionContext = initialContext;\n\n        expression.getRight().accept(this);\n        String rightContext = executionContext;\n\n        executionContext = String.format(\n            \"((%s || %s) && (%s || %s)) \",\n            leftContext,\n            rightContext,\n            rightContext,\n            leftContext\n        );\n\n        return null;\n    }\n\n    @Override\n    public Void visitNot(NotExpression expression) {\n        expression.getExpression().accept(this);\n        executionContext = String.format(\"(!%s)\", executionContext);\n        return null;\n    }\n\n    @Override\n    public Void visitObjectProjection(ObjectProjectionExpression expression) {\n        expression.getLeft().accept(this);\n\n        String element = makeNewScope(\"element_\");\n        String result = makeNewScope(\"objectProjection_\");\n        writer.openBlock(\n            \"let $L = Object.values($L).map(($L: any) => {\",\n            \"});\",\n            result,\n            executionContext,\n            element,\n            () -> {\n                executionContext = element;\n                expression.getRight().accept(this);\n                writer.write(\"return $L;\", executionContext);\n            }\n        );\n        executionContext = result;\n        return null;\n    }\n\n    @Override\n    public Void visitProjection(ProjectionExpression expression) {\n        expression.getLeft().accept(this);\n\n        if (!(expression.getRight() instanceof CurrentExpression)) {\n            String element = makeNewScope(\"element_\");\n            String result = makeNewScope(\"projection_\");\n            writer.openBlock(\"let $L = $L.map(($L: any) => {\", \"});\", result, executionContext, element, () -> {\n                executionContext = element;\n                expression.getRight().accept(this);\n                writer.write(\"return $L;\", executionContext);\n            });\n            executionContext = result;\n        }\n        return null;\n    }\n\n    @Override\n    public Void visitFilterProjection(FilterProjectionExpression expression) {\n        expression.getLeft().accept(this);\n\n        expression.getRight().accept(this);\n\n        String elementScope = makeNewScope(\"element_\");\n        String resultScope = makeNewScope(\"filterRes_\");\n        writer.openBlock(\n            \"let $L = $L.filter(($L: any) => {\",\n            \"});\",\n            resultScope,\n            executionContext,\n            elementScope,\n            () -> {\n                executionContext = elementScope;\n                expression.getComparison().accept(this);\n                writer.write(\"return $L;\", executionContext);\n            }\n        );\n\n        executionContext = resultScope;\n        return null;\n    }\n\n    @Override\n    public Void visitSlice(SliceExpression expression) {\n        throw new CodegenException(\"TypeScriptJmesPath visitor not implemented SliceExpression\");\n    }\n\n    @Override\n    public Void visitSubexpression(Subexpression expression) {\n        expression.getLeft().accept(this);\n        expression.getRight().accept(this);\n        return null;\n    }\n\n    void writeBooleanExpectation(String expectedValue, String returnValue) {\n        writer.openBlock(\"if ($L == $L) {\", \"}\", executionContext, expectedValue, () -> {\n            writer.write(\"return $L;\", returnValue);\n        });\n    }\n\n    void writeAnyStringEqualsExpectation(String expectedValue, String returnValue) {\n        String element = makeNewScope(\"anyStringEq_\");\n        writer.openBlock(\"for (let $L of $L) {\", \"}\", element, executionContext, () -> {\n            writer.openBlock(\"if ($L == $S) {\", \"}\", element, expectedValue, () -> {\n                writer.write(\"return $L;\", returnValue);\n            });\n        });\n    }\n\n    void writeAllStringEqualsExpectation(String expectedValue, String returnValue) {\n        String element = makeNewScope(\"element_\");\n        String result = makeNewScope(\"allStringEq_\");\n        writer.write(\"let $L = ($L.length > 0);\", result, executionContext);\n        writer.openBlock(\"for (let $L of $L) {\", \"}\", element, executionContext, () -> {\n            writer.write(\"$L = $L && ($L == $S)\", result, result, element, expectedValue);\n        });\n        writer.openBlock(\"if ($L) {\", \"}\", result, () -> {\n            writer.write(\"return $L;\", returnValue);\n        });\n    }\n\n    void writeStringExpectation(String expectedValue, String returnValue) {\n        writer.openBlock(\"if ($L === $S) {\", \"}\", executionContext, expectedValue, () -> {\n            writer.write(\"return $L;\", returnValue);\n        });\n    }\n\n    private String makeNewScope(String prefix) {\n        scopeCount += 1;\n        return prefix + scopeCount;\n    }\n\n    private String serializeObject(Map<String, Object> obj) {\n        return (\"{\" +\n            obj\n                .entrySet()\n                .stream()\n                .map(entry -> \"\\\"\" + entry.getKey() + \"\\\":\" + serializeValue(entry.getValue()))\n                .collect(Collectors.joining(\",\"))\n            +\n            \"}\");\n    }\n\n    private String serializeArray(List<Object> array) {\n        return \"[\" + array.stream().map(this::serializeValue).collect(Collectors.joining(\",\")) + \"]\";\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private String serializeValue(Object value) {\n        if (value == null) {\n            return \"null\";\n        } else if (value instanceof String) {\n            return \"\\\"\" + value + \"\\\"\";\n        } else if (value instanceof Number || value instanceof Boolean) {\n            return value.toString();\n        } else if (value instanceof Map) {\n            return serializeObject((Map<String, Object>) value);\n        } else if (value instanceof ArrayList) {\n            return serializeArray((List<Object>) value);\n        }\n        throw new CodegenException(\"Unsupported literal type: \" + value.getClass());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSSDKCodegenPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Plugin to trigger TypeScript SSDK code generation.\n * @deprecated Use {@link TypeScriptServerCodegenPlugin} instead.\n */\n@SmithyInternalApi\n@Deprecated\n@SuppressWarnings(\"AbbreviationAsWordInName\")\npublic class TypeScriptSSDKCodegenPlugin extends TypeScriptServerCodegenPlugin {\n\n    @Override\n    public String getName() {\n        return \"typescript-ssdk-codegen\";\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptServerCodegenPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ServiceLoader;\nimport java.util.ServiceLoader.Provider;\nimport java.util.logging.Logger;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.build.SmithyBuildPlugin;\nimport software.amazon.smithy.codegen.core.directed.CodegenDirector;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Plugin to trigger TypeScript SSDK code generation.\n */\n@SmithyInternalApi\npublic class TypeScriptServerCodegenPlugin implements SmithyBuildPlugin {\n\n    private static final Logger LOGGER = Logger.getLogger(TypeScriptServerCodegenPlugin.class.getName());\n\n    @Override\n    public String getName() {\n        return \"typescript-server-codegen\";\n    }\n\n    @Override\n    public void execute(PluginContext context) {\n        CodegenDirector<TypeScriptWriter, TypeScriptIntegration, TypeScriptCodegenContext, TypeScriptSettings> runner =\n            new CodegenDirector<>();\n\n        runner.directedCodegen(new DirectedTypeScriptCodegen());\n\n        // Set the SmithyIntegration class to look for and apply using SPI.\n        runner.integrationClass(TypeScriptIntegration.class);\n\n        // Set the FileManifest and Model from the plugin.\n        runner.fileManifest(context.getFileManifest());\n        runner.model(context.getModel());\n\n        // Create the TypeScriptSettings object from the plugin settings.\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            context.getModel(),\n            context.getSettings(),\n            TypeScriptSettings.ArtifactType.SSDK\n        );\n        runner.settings(settings);\n\n        // Only add integrations if the integrations match the settings\n        // This uses {@link TypeScriptIntegration#matchesSettings}, which is a\n        // Smithy internal API. This may be removed at any point.\n        runner.integrationFinder(\n            () -> () -> ServiceLoader.load(TypeScriptIntegration.class, CodegenDirector.class.getClassLoader())\n                .stream()\n                .map(Provider::get)\n                .filter(integration -> {\n                    boolean matchesSettings = integration.matchesSettings(settings);\n                    if (!matchesSettings) {\n                        LOGGER.fine(\n                            () -> \"Skipping TypeScript integration based on settings: \"\n                                + integration.name()\n                        );\n                    }\n                    return matchesSettings;\n                })\n                .iterator()\n        );\n\n        runner.service(settings.getService());\n\n        // Configure the director to perform some common model transforms.\n        runner.performDefaultCodegenTransforms();\n\n        // TODO: Not using below because it would break existing AWS SDKs. Maybe it should be configurable\n        // so generic SDKs call this by default, but AWS SDKs can opt-out of it via a setting.\n        // runner.createDedicatedInputsAndOutputs();\n\n        // Run it!\n        runner.run();\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptSettings.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.function.BiFunction;\nimport java.util.logging.Logger;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.BooleanNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.DefaultTrait;\nimport software.amazon.smithy.model.traits.RequiredTrait;\nimport software.amazon.smithy.typescript.codegen.protocols.ProtocolPriorityConfig;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Settings used by {@link TypeScriptCodegenPlugin}.\n */\n@SmithyUnstableApi\npublic final class TypeScriptSettings {\n\n    static final String DISABLE_DEFAULT_VALIDATION = \"disableDefaultValidation\";\n    static final String REQUIRED_MEMBER_MODE = \"requiredMemberMode\";\n    private static final Logger LOGGER = Logger.getLogger(TypeScriptSettings.class.getName());\n\n    private static final String PACKAGE = \"package\";\n    private static final String PACKAGE_DESCRIPTION = \"packageDescription\";\n    private static final String PACKAGE_VERSION = \"packageVersion\";\n    private static final String PACKAGE_JSON = \"packageJson\";\n    private static final String SERVICE = \"service\";\n    private static final String PROTOCOL = \"protocol\";\n    private static final String PRIVATE = \"private\";\n    private static final String PACKAGE_MANAGER = \"packageManager\";\n    private static final String CREATE_DEFAULT_README = \"createDefaultReadme\";\n    private static final String USE_LEGACY_AUTH = \"useLegacyAuth\";\n    private static final String GENERATE_TYPEDOC = \"generateTypeDoc\";\n    private static final String GENERATE_INDEX_TESTS = \"generateIndexTests\";\n    private static final String GENERATE_SNAPSHOT_TESTS = \"generateSnapshotTests\";\n    private static final String SERVICE_PROTOCOL_PRIORITY = \"serviceProtocolPriority\";\n    private static final String DEFAULT_PROTOCOL_PRIORITY = \"defaultProtocolPriority\";\n    private static final String BIG_NUMBER_MODE = \"bigNumberMode\";\n    private static final String GENERATE_SCHEMAS = \"generateSchemas\";\n    private static final String GENERATE_ENDPOINT_BDD = \"generateEndpointBdd\";\n    private static final String VERSIONING_SCHEME = \"versioningScheme\";\n\n    private String packageName;\n    private String packageDescription = \"\";\n    private String packageVersion;\n    private ObjectNode packageJson = Node.objectNode();\n    private ShapeId service;\n    private ObjectNode pluginSettings = Node.objectNode();\n    private ShapeId protocol;\n    private String defaultSigningName = \"\";\n    private boolean isPrivate;\n    private ArtifactType artifactType = ArtifactType.CLIENT;\n    private boolean disableDefaultValidation = false;\n    private RequiredMemberMode requiredMemberMode = RequiredMemberMode.NULLABLE;\n    private PackageManager packageManager = PackageManager.YARN;\n    private boolean createDefaultReadme = false;\n    private boolean useLegacyAuth = false;\n    private boolean generateTypeDoc = false;\n    private ProtocolPriorityConfig protocolPriorityConfig = new ProtocolPriorityConfig(null, null);\n    private String bigNumberMode = \"native\";\n    private boolean generateSchemas = true;\n    private boolean generateEndpointBdd = true;\n    private boolean generateIndexTests = false;\n    private boolean generateSnapshotTests = false;\n    private String versioningScheme = \"\";\n\n    @Deprecated\n    public static TypeScriptSettings from(Model model, ObjectNode config) {\n        return from(model, config, ArtifactType.CLIENT);\n    }\n\n    /**\n     * Create a settings object from a configuration object node.\n     *\n     * @param model Model to infer the service to generate if not explicitly provided.\n     * @param config Config object to load.\n     * @param artifactType The type of artifact being generated.\n     * @return Returns the extracted settings.\n     */\n    public static TypeScriptSettings from(Model model, ObjectNode config, ArtifactType artifactType) {\n        TypeScriptSettings settings = new TypeScriptSettings();\n        settings.setArtifactType(artifactType);\n        config.warnIfAdditionalProperties(artifactType.configProperties);\n\n        // Get the service from the settings or infer one from the given model.\n        settings.setService(\n            config\n                .getStringMember(SERVICE)\n                .map(StringNode::expectShapeId)\n                .orElseGet(() -> inferService(model))\n        );\n\n        settings.setPackageName(config.expectStringMember(PACKAGE).getValue());\n        settings.setPackageVersion(config.expectStringMember(PACKAGE_VERSION).getValue());\n        settings.setPackageDescription(\n            config.getStringMemberOrDefault(PACKAGE_DESCRIPTION, settings.getDefaultDescription())\n        );\n        settings.packageJson = config.getObjectMember(PACKAGE_JSON).orElse(Node.objectNode());\n        config.getStringMember(PROTOCOL).map(StringNode::getValue).map(ShapeId::from).ifPresent(settings::setProtocol);\n        settings.setPrivate(config.getBooleanMember(PRIVATE).map(BooleanNode::getValue).orElse(false));\n        settings.setCreateDefaultReadme(\n            config.getBooleanMember(CREATE_DEFAULT_README).map(BooleanNode::getValue).orElse(false)\n        );\n        settings.useLegacyAuth(config.getBooleanMemberOrDefault(USE_LEGACY_AUTH, false));\n        settings.setGenerateTypeDoc(config.getBooleanMember(GENERATE_TYPEDOC).map(BooleanNode::getValue).orElse(false));\n        settings.setPackageManager(\n            config\n                .getStringMember(PACKAGE_MANAGER)\n                .map(s -> PackageManager.fromString(s.getValue()))\n                .orElse(PackageManager.YARN)\n        );\n\n        if (artifactType == ArtifactType.SSDK) {\n            settings.setDisableDefaultValidation(config.getBooleanMemberOrDefault(DISABLE_DEFAULT_VALIDATION));\n        }\n        settings.setRequiredMemberMode(\n            config\n                .getStringMember(REQUIRED_MEMBER_MODE)\n                .map(s -> RequiredMemberMode.fromString(s.getValue()))\n                .orElse(RequiredMemberMode.NULLABLE)\n        );\n\n        settings.setPluginSettings(config);\n        settings.readProtocolPriorityConfiguration(config);\n        settings.setBigNumberMode(config.getStringMemberOrDefault(BIG_NUMBER_MODE, \"native\"));\n\n        // Internal undocumented configuration used to control rollout of schemas.\n        // `true` will eventually be the only available option, and this should not be set by users.\n        settings.setGenerateSchemas(config.getBooleanMemberOrDefault(GENERATE_SCHEMAS, true));\n\n        // Internal undocumented configuration used to control rollout of endpoint BDD.\n        // `true` will eventually be the only available option, and this should not be set by users.\n        settings.setGenerateEndpointBdd(config.getBooleanMemberOrDefault(GENERATE_ENDPOINT_BDD, true));\n\n        settings.setGenerateIndexTests(config.getBooleanMemberOrDefault(GENERATE_INDEX_TESTS, false));\n        settings.setGenerateSnapshotTests(config.getBooleanMemberOrDefault(GENERATE_SNAPSHOT_TESTS, false));\n        settings.setVersioningScheme(config.getStringMemberOrDefault(VERSIONING_SCHEME, \"\"));\n\n        return settings;\n    }\n\n    private String getDefaultDescription() {\n        String description = getPackageName();\n        switch (artifactType) {\n            case CLIENT:\n                description += \" client\";\n                break;\n            case SSDK:\n                description += \" server\";\n                break;\n            default:\n        }\n        return description;\n    }\n\n    // TODO: this seems reusable across generators.\n    private static ShapeId inferService(Model model) {\n        List<ShapeId> services = model\n            .shapes(ServiceShape.class)\n            .map(Shape::getId)\n            .sorted()\n            .collect(Collectors.toList());\n\n        if (services.isEmpty()) {\n            throw new CodegenException(\n                \"Cannot infer a service to generate because the model does not \" + \"contain any service shapes\"\n            );\n        } else if (services.size() > 1) {\n            throw new CodegenException(\n                \"Cannot infer a service to generate because the model contains \" +\n                    \"multiple service shapes: \" +\n                    services\n            );\n        } else {\n            LOGGER.fine(\"Inferring service to generate as \" + services.get(0));\n            return services.get(0);\n        }\n    }\n\n    /**\n     * Gets the required package name that is going to be generated.\n     *\n     * @return Returns the package name.\n     * @throws NullPointerException if the service has not been set.\n     */\n    public String getPackageName() {\n        return Objects.requireNonNull(packageName, PACKAGE + \" not set\");\n    }\n\n    public void setPackageName(String packageName) {\n        this.packageName = packageName;\n    }\n\n    /**\n     * Gets the description of the package that will be placed in the\n     * \"description\" field of the generated package.json.\n     *\n     * @return Returns the description or an empty string if not set.\n     */\n    public String getPackageDescription() {\n        return packageDescription;\n    }\n\n    public void setPackageDescription(String packageDescription) {\n        this.packageDescription = Objects.requireNonNull(packageDescription);\n    }\n\n    /**\n     * Gets the version of the generated package that will be used with the\n     * generated package.json file.\n     *\n     * @return Returns the package version.\n     */\n    public String getPackageVersion() {\n        return packageVersion;\n    }\n\n    public void setPackageVersion(String packageVersion) {\n        this.packageVersion = packageVersion;\n    }\n\n    /**\n     * @return whether to use native (BigInt + NumericValue) or big.js for BigInteger/BigDecimal.\n     */\n    public String getBigNumberMode() {\n        return bigNumberMode;\n    }\n\n    public void setBigNumberMode(String mode) {\n        if (!mode.equals(\"big.js\") && !mode.equals(\"native\")) {\n            throw new IllegalArgumentException(\n                \"\"\"\n                bigNumberMode must be one of [\"native\", \"big.js\"]\"\"\"\n            );\n        }\n        this.bigNumberMode = mode;\n    }\n\n    /**\n     * Internal API, do not use.\n     */\n    @SmithyInternalApi\n    public void setGenerateSchemas(boolean generateSchemas) {\n        this.generateSchemas = generateSchemas;\n    }\n\n    /**\n     * Internal API, do not use.\n     */\n    @SmithyInternalApi\n    public boolean generateSchemas() {\n        return generateSchemas;\n    }\n\n    @SmithyInternalApi\n    public void setGenerateEndpointBdd(boolean generateEndpointBdd) {\n        this.generateEndpointBdd = generateEndpointBdd;\n    }\n\n    @SmithyInternalApi\n    public boolean generateEndpointBdd() {\n        return generateEndpointBdd;\n    }\n\n    public void setGenerateIndexTests(boolean generateIndexTests) {\n        this.generateIndexTests = generateIndexTests;\n    }\n\n    public boolean generateIndexTests() {\n        return generateIndexTests;\n    }\n\n    public void setGenerateSnapshotTests(boolean generateSnapshotTests) {\n        this.generateSnapshotTests = generateSnapshotTests;\n    }\n\n    public boolean generateSnapshotTests() {\n        return generateSnapshotTests;\n    }\n\n    public void setVersioningScheme(String scheme) {\n        this.versioningScheme = scheme;\n    }\n\n    public String getVersioningScheme() {\n        return this.versioningScheme;\n    }\n\n    /**\n     * Gets a chunk of custom properties to merge into the generated\n     * package.json file.\n     *\n     * <p>This JSON is used to provide any property present in the\n     * package.json file that isn't captured by any other settings.\n     * This value will never be {@code null}.\n     *\n     * @return Returns the custom package JSON.\n     */\n    public ObjectNode getPackageJson() {\n        return packageJson;\n    }\n\n    /**\n     * Sets the custom package.json properties.\n     *\n     * @param packageJson package.json properties to merge in.\n     */\n    public void setPackageJson(ObjectNode packageJson) {\n        this.packageJson = Objects.requireNonNull(packageJson);\n    }\n\n    /**\n     * Gets the optional name of the service that is being generated.\n     *\n     * @return Returns the package name.\n     * @throws NullPointerException if the service has not been set.\n     */\n    public ShapeId getService() {\n        return Objects.requireNonNull(service, SERVICE + \" not set\");\n    }\n\n    public void setService(ShapeId service) {\n        this.service = Objects.requireNonNull(service);\n    }\n\n    /**\n     * Gets additional plugin settings.\n     *\n     * <p>This value will never throw or return {@code null}.\n     *\n     * @return Returns the entire settings object.\n     */\n    public ObjectNode getPluginSettings() {\n        return pluginSettings;\n    }\n\n    public void setPluginSettings(ObjectNode pluginSettings) {\n        this.pluginSettings = Objects.requireNonNull(pluginSettings);\n    }\n\n    /**\n     * Returns if the generated package will be made private.\n     *\n     * @return If the package will be private.\n     */\n    public boolean isPrivate() {\n        return isPrivate;\n    }\n\n    public void setPrivate(boolean isPrivate) {\n        this.isPrivate = isPrivate;\n    }\n\n    public boolean createDefaultReadme() {\n        return createDefaultReadme;\n    }\n\n    public void setCreateDefaultReadme(boolean createDefaultReadme) {\n        this.createDefaultReadme = createDefaultReadme;\n    }\n\n    /**\n     * Returns if the generated package will be a client.\n     *\n     * @return If the package will include a client.\n     */\n    public boolean generateClient() {\n        return artifactType.equals(ArtifactType.CLIENT);\n    }\n\n    /**\n     * Returns if the generated package will be a server sdk.\n     *\n     * @return If the package will include a server sdk.\n     */\n    public boolean generateServerSdk() {\n        return artifactType.equals(ArtifactType.SSDK);\n    }\n\n    /**\n     * Returns the type of artifact being generated, such as a client or ssdk.\n     *\n     * @return The artifact type.\n     */\n    public ArtifactType getArtifactType() {\n        return artifactType;\n    }\n\n    public void setArtifactType(ArtifactType artifactType) {\n        this.artifactType = artifactType;\n    }\n\n    /**\n     * Returns whether or not default validation is disabled. This setting is only relevant for the SSDK.\n     *\n     * @return true if default validation is disabled. Default: false\n     */\n    public boolean isDisableDefaultValidation() {\n        return disableDefaultValidation;\n    }\n\n    public void setDisableDefaultValidation(boolean disableDefaultValidation) {\n        this.disableDefaultValidation = disableDefaultValidation;\n    }\n\n    /**\n     * Returns the code generation mode for required members.\n     *\n     * @return the configured mode for required members.\n     * Defaults to {@link RequiredMemberMode#NULLABLE}\n     */\n    public RequiredMemberMode getRequiredMemberMode() {\n        return requiredMemberMode;\n    }\n\n    public void setRequiredMemberMode(RequiredMemberMode requiredMemberMode) {\n        if (requiredMemberMode != RequiredMemberMode.NULLABLE) {\n            LOGGER.warning(\n                String.format(\n                    \"By setting the required member mode to '%s', a\" +\n                        \" member that has the '@required' trait applied CANNOT be 'undefined'.\" +\n                        \" It will be considered a BACKWARDS INCOMPATIBLE change for\" +\n                        \" Smithy services even when the required constraint is dropped from a member.\",\n                    requiredMemberMode.mode,\n                    RequiredMemberMode.NULLABLE.mode\n                )\n            );\n        }\n        this.requiredMemberMode = requiredMemberMode;\n    }\n\n    /**\n     * Returns the package manager used by the generated package.\n     *\n     * @return the configured package manager. Defaults to {@link PackageManager#YARN}\n     */\n    public PackageManager getPackageManager() {\n        return packageManager;\n    }\n\n    public void setPackageManager(PackageManager packageManager) {\n        this.packageManager = packageManager;\n    }\n\n    /**\n     * Returns whether to use legacy auth integrations.\n     *\n     * @return if legacy auth should used. Default: false\n     */\n    public boolean useLegacyAuth() {\n        return useLegacyAuth;\n    }\n\n    /**\n     * Sets whether legacy auth should be used.\n     *\n     * @param useLegacyAuth whether legacy auth should be used.\n     */\n    public void useLegacyAuth(boolean useLegacyAuth) {\n        if (useLegacyAuth) {\n            LOGGER.warning(\n                \"\"\"\n                Legacy auth is considered deprecated and is no longer in development,\n                and should only be used for backward compatibility concerns. Consider\n                migrating to the default identity and auth behavior.\"\"\"\n            );\n        }\n        this.useLegacyAuth = useLegacyAuth;\n    }\n\n    /**\n     * Returns whether to generate typedoc support.\n     *\n     * @return whether to generate typedoc support. Default: false\n     */\n    public boolean generateTypeDoc() {\n        return generateTypeDoc;\n    }\n\n    /**\n     * Sets whether to generate typedoc support.\n     *\n     * @param generateTypeDoc whether to generate typedoc support\n     */\n    public void setGenerateTypeDoc(boolean generateTypeDoc) {\n        this.generateTypeDoc = generateTypeDoc;\n    }\n\n    /**\n     * Gets the corresponding {@link ServiceShape} from a model.\n     *\n     * @param model Model to search for the service shape by ID.\n     * @return Returns the found {@code Service}.\n     * @throws NullPointerException if the service has not been set.\n     * @throws CodegenException if the service is invalid or not found.\n     */\n    public ServiceShape getService(Model model) {\n        return model\n            .getShape(getService())\n            .orElseThrow(() -> new CodegenException(\"Service shape not found: \" + getService()))\n            .asServiceShape()\n            .orElseThrow(() -> new CodegenException(\"Shape is not a Service: \" + getService()));\n    }\n\n    /**\n     * Gets the configured protocol to generate.\n     *\n     * @return Returns the configured protocol.\n     */\n    public ShapeId getProtocol() {\n        return protocol;\n    }\n\n    /**\n     * Resolves the highest priority protocol from a service shape that is\n     * supported by the generator.\n     *\n     * @param model Model to enable finding protocols on the service.\n     * @param service Service to get the protocols from if \"protocols\" is not set.\n     * @param supportedProtocols The set of protocol names supported by the generator.\n     * @return Returns the resolved protocol name.\n     * @throws UnresolvableProtocolException if no protocol could be resolved.\n     */\n    public ShapeId resolveServiceProtocol(Model model, ServiceShape service, Set<ShapeId> supportedProtocols) {\n        if (protocol != null) {\n            return protocol;\n        }\n\n        ServiceIndex serviceIndex = ServiceIndex.of(model);\n        Set<ShapeId> resolvedProtocols = serviceIndex.getProtocols(service).keySet();\n        if (resolvedProtocols.isEmpty()) {\n            throw new UnresolvableProtocolException(\n                \"Unable to derive the protocol setting of the service `\" +\n                    service.getId() +\n                    \"` because no \" +\n                    \"protocol definition traits were present. You need to set an explicit `protocol` to \" +\n                    \"generate in smithy-build.json to generate this service.\"\n            );\n        }\n\n        List<ShapeId> protocolPriority = this.protocolPriorityConfig.getProtocolPriority(service.toShapeId());\n        List<ShapeId> protocolPriorityList = protocolPriority != null && !protocolPriority.isEmpty()\n            ? protocolPriority\n            : new ArrayList<>(supportedProtocols);\n\n        return protocolPriorityList\n            .stream()\n            .filter(resolvedProtocols::contains)\n            .findFirst()\n            .orElseThrow(\n                () -> new UnresolvableProtocolException(\n                    String.format(\n                        \"The %s service supports the following unsupported protocols %s. The following protocol \"\n                            +\n                            \"generators were found on the class path: %s\",\n                        service.getId(),\n                        resolvedProtocols,\n                        supportedProtocols\n                    )\n                )\n            );\n    }\n\n    /**\n     * Sets the protocol to generate.\n     *\n     * @param protocol Protocols to generate.\n     */\n    public void setProtocol(ShapeId protocol) {\n        this.protocol = Objects.requireNonNull(protocol);\n    }\n\n    /**\n     * @param name - used as the signing service name when no explicit value from endpoints AuthScheme is present.\n     */\n    public void setDefaultSigningName(String name) {\n        defaultSigningName = name;\n    }\n\n    /**\n     * @return signing service name when no explicit value from endpoints AuthScheme is present.\n     */\n    public String getDefaultSigningName() {\n        return defaultSigningName;\n    }\n\n    /**\n     * @return config container for service and/or default protocol selection priority overrides.\n     */\n    public ProtocolPriorityConfig getProtocolPriority() {\n        return protocolPriorityConfig;\n    }\n\n    public void setProtocolPriority(ProtocolPriorityConfig protocolPriorityConfig) {\n        this.protocolPriorityConfig = protocolPriorityConfig;\n    }\n\n    /**\n     * An enum indicating the type of artifact the code generator will produce.\n     */\n    public enum ArtifactType {\n        CLIENT(\n            SymbolVisitor::new,\n            Arrays.asList(\n                PACKAGE,\n                PACKAGE_DESCRIPTION,\n                PACKAGE_JSON,\n                PACKAGE_VERSION,\n                PACKAGE_MANAGER,\n                SERVICE,\n                PROTOCOL,\n                PRIVATE,\n                REQUIRED_MEMBER_MODE,\n                CREATE_DEFAULT_README,\n                USE_LEGACY_AUTH,\n                GENERATE_TYPEDOC,\n                GENERATE_INDEX_TESTS,\n                GENERATE_SNAPSHOT_TESTS,\n                BIG_NUMBER_MODE,\n                GENERATE_SCHEMAS,\n                GENERATE_ENDPOINT_BDD,\n                VERSIONING_SCHEME\n            )\n        ),\n        SSDK(\n            (m, s) -> new ServerSymbolVisitor(m, new SymbolVisitor(m, s)),\n            Arrays.asList(\n                PACKAGE,\n                PACKAGE_DESCRIPTION,\n                PACKAGE_JSON,\n                PACKAGE_VERSION,\n                PACKAGE_MANAGER,\n                SERVICE,\n                PROTOCOL,\n                PRIVATE,\n                REQUIRED_MEMBER_MODE,\n                DISABLE_DEFAULT_VALIDATION,\n                CREATE_DEFAULT_README,\n                GENERATE_TYPEDOC,\n                GENERATE_INDEX_TESTS,\n                GENERATE_SNAPSHOT_TESTS,\n                BIG_NUMBER_MODE,\n                GENERATE_SCHEMAS,\n                GENERATE_ENDPOINT_BDD,\n                VERSIONING_SCHEME\n            )\n        );\n\n        private final BiFunction<Model, TypeScriptSettings, SymbolProvider> symbolProviderFactory;\n        private final List<String> configProperties;\n\n        ArtifactType(\n            BiFunction<Model, TypeScriptSettings, SymbolProvider> symbolProviderFactory,\n            List<String> configProperties\n        ) {\n            this.symbolProviderFactory = symbolProviderFactory;\n            this.configProperties = Collections.unmodifiableList(configProperties);\n        }\n\n        /**\n         * Creates a TypeScript symbol provider suited to the artifact type.\n         *\n         * @param model Model to generate symbols for.\n         * @param settings Settings used by the symbol provider.\n         * @return Returns the created provider.\n         */\n        public SymbolProvider createSymbolProvider(Model model, TypeScriptSettings settings) {\n            return symbolProviderFactory.apply(model, settings);\n        }\n    }\n\n    /**\n     * An enum indicating the code generation mode for required members.\n     */\n    public enum RequiredMemberMode {\n        /**\n         * This is the current behavior and it will be the default. When set,\n         * it allows a member that has the {@link RequiredTrait} applied to be {@code undefined}.\n         * By doing so it can still be considered a backwards compatible change fo\n         * Smithy services even when the required constraint is dropped from a member.\n         */\n        NULLABLE(\"nullable\"),\n\n        /**\n         * This will disallow members marked as {@link RequiredTrait} to be {@code undefined}.\n         * Use this mode with CAUTION because it comes with certain risks. When a server drops\n         * {@link RequiredTrait} from an output shape (and it is replaced with {@link DefaultTrait}\n         * as defined by the spec), if the server does not always serialize a value,\n         * customer code consuming the client and trying to access this member, may get a\n         * NullPointerException. Smithy spec says: \"Authoritative model consumers like servers\n         * SHOULD always serialize default values to remove any ambiguity about the value of\n         * the most up to default value.\" So one should use this mode on the client, only if\n         * the server is following the approach proposed by the spec.\n         */\n        STRICT(\"strict\");\n\n        private final String mode;\n\n        RequiredMemberMode(String mode) {\n            this.mode = mode;\n        }\n\n        public String getMode() {\n            return mode;\n        }\n\n        public static RequiredMemberMode fromString(String s) {\n            if (\"nullable\".equals(s)) {\n                return NULLABLE;\n            }\n            if (\"strict\".equals(s)) {\n                return STRICT;\n            }\n            throw new CodegenException(String.format(\"Unsupported required member mode: %s\", s));\n        }\n    }\n\n    public enum PackageManager {\n        YARN(\"yarn\", \"yarn dlx\"),\n        NPM(\"npm\", \"npx\"),\n        PNPM(\"pnpm\", \"pnpm dlx\");\n\n        private final String command;\n        private final String execCommand;\n\n        PackageManager(String command, String execCommand) {\n            this.command = command;\n            this.execCommand = execCommand;\n        }\n\n        public String getCommand() {\n            return command;\n        }\n\n        public String getExecCommand() {\n            return execCommand;\n        }\n\n        public static PackageManager fromString(String s) {\n            if (\"yarn\".equals(s)) {\n                return YARN;\n            }\n            if (\"npm\".equals(s)) {\n                return NPM;\n            }\n            if (\"pnpm\".equals(s)) {\n                return PNPM;\n            }\n            throw new CodegenException(String.format(\"Unsupported package manager: %s\", s));\n        }\n    }\n\n    /**\n     * Reads serviceProtocolPriority and defaultProtocolPriority configuration fields.\n     * {\n     *     serviceProtocolPriority: {\n     *         \"namespace#Service\": [\"namespace#Protocol1\", \"namespace#Protocol2\"]\n     *     },\n     *     defaultProtocolPriority: [\"namespace#Protocol\"]\n     * }\n     */\n    private void readProtocolPriorityConfiguration(ObjectNode config) {\n        Map<ShapeId, List<ShapeId>> serviceProtocolPriorityCustomizations = new HashMap<>();\n        List<ShapeId> customDefaultPriority = new LinkedList<>();\n        try {\n            Optional<ObjectNode> protocolPriorityNode = config.getObjectMember(SERVICE_PROTOCOL_PRIORITY);\n            if (protocolPriorityNode.isPresent()) {\n                ObjectNode objectNode = protocolPriorityNode.get();\n                objectNode\n                    .getMembers()\n                    .forEach((StringNode k, Node v) -> {\n                        ShapeId serviceShapeId = ShapeId.from(k.getValue());\n                        List<ShapeId> protocolList = v\n                            .asArrayNode()\n                            .get()\n                            .getElementsAs(e -> ShapeId.from(e.asStringNode().get().getValue()));\n                        serviceProtocolPriorityCustomizations.put(serviceShapeId, protocolList);\n                    });\n            }\n            Optional<ArrayNode> defaultProtocolPriorityOpt = config.getArrayMember(DEFAULT_PROTOCOL_PRIORITY);\n            if (defaultProtocolPriorityOpt.isPresent()) {\n                ArrayNode defaultProtocolPriorityStringArr = defaultProtocolPriorityOpt.get();\n                customDefaultPriority.addAll(\n                    defaultProtocolPriorityStringArr\n                        .getElementsAs(e -> ShapeId.from(e.asStringNode().get().getValue()))\n                );\n            }\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\n                \"Error while parsing serviceProtocolPriority or defaultProtocolPriority configuration fields\",\n                e\n            );\n        }\n        protocolPriorityConfig = new ProtocolPriorityConfig(\n            serviceProtocolPriorityCustomizations,\n            customDefaultPriority.isEmpty() ? null : customDefaultPriority\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptUtils.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.UncheckedIOException;\nimport java.util.Collection;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.utils.IoUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * Utility methods for TypeScript / JavaScript.\n */\n@SmithyInternalApi\nfinal class TypeScriptUtils {\n\n    private static final Pattern PROPERTY_NAME_REGEX = Pattern.compile(\"^(?![0-9])[a-zA-Z0-9$_]+$\");\n\n    private TypeScriptUtils() {}\n\n    /**\n     * Adds quotes to the given string if quotes are needed to make it a\n     * valid JavaScript property name.\n     *\n     * @param memberName Member name to check.\n     * @return Returns the sanitized member name.\n     */\n    static String sanitizePropertyName(String memberName) {\n        return isValidPropertyName(memberName) ? memberName : StringUtils.escapeJavaString(memberName, \"\");\n    }\n\n    /**\n     * Checks if the given string is a valid JavaScript property name.\n     *\n     * <p>This check is pretty simplistic, and the rules around property names\n     * are much more complex than this according to ECMA-262, but the primary\n     * purpose of this method is to make the generated code syntactically\n     * valid.\n     *\n     * @param value Value to check.\n     * @return Returns true if the value is ok to be an unquoted property.\n     */\n    private static boolean isValidPropertyName(String value) {\n        return PROPERTY_NAME_REGEX.matcher(value).matches();\n    }\n\n    /**\n     * Creates a list of sorted, pipe separated enum variants as a union.\n     *\n     * <p>For example, `\"foo\" | \"baz\"`. Note: special characters\n     * and quotes are escaped as needed.\n     *\n     * @param values Values to create into a union.\n     * @return Returns the union of string literals.\n     */\n    static String getEnumVariants(Collection<String> values) {\n        return values\n            .stream()\n            .sorted()\n            .map(value -> StringUtils.escapeJavaString(value, \"\"))\n            .collect(Collectors.joining(\" | \"));\n    }\n\n    /**\n     * Loads the contents of a resource into a string.\n     *\n     * @param name Relative path of the resource to load.\n     * @return Returns the loaded contents.\n     * TODO: this should be a shared feature in smithy-utils\n     */\n    static String loadResourceAsString(String name) {\n        try (InputStream is = TypeScriptUtils.class.getResourceAsStream(name)) {\n            return IoUtils.toUtf8String(is);\n        } catch (IOException e) {\n            throw new UncheckedIOException(e);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptWriter.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Path;\nimport java.util.function.BiFunction;\nimport java.util.function.UnaryOperator;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.codegen.core.SymbolWriter;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.loader.Prelude;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.traits.DeprecatedTrait;\nimport software.amazon.smithy.model.traits.DocumentationTrait;\nimport software.amazon.smithy.model.traits.InternalTrait;\nimport software.amazon.smithy.typescript.codegen.validation.ImportFrom;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * Specialized code writer for managing TypeScript dependencies.\n *\n * <p>Use the {@code $T} formatter to refer to {@link Symbol}s. These symbols\n * are automatically imported into the writer and relativized if necessary.\n *\n * <p>When adding imports, start the module name with \"./\" to resolve relative\n * module paths against the moduleName of the writer. Module names that\n * start with anything other than \".\" (e.g., \"@\", \"/\", etc.) are never\n * relativized.\n *\n * <p>Dependencies introduced via a TypeScriptWriter are added to the package.json\n * file if the writer is a part of the {@link TypeScriptDelegator} of the {@link DirectedTypeScriptCodegen}.\n */\n@SmithyUnstableApi\npublic final class TypeScriptWriter extends SymbolWriter<TypeScriptWriter, ImportDeclarations> {\n\n    public static final String CODEGEN_INDICATOR = \"// smithy-typescript generated code\\n\";\n    public static final int LINE_WIDTH = 120;\n\n    private final String moduleName;\n    private final boolean withAttribution;\n\n    public TypeScriptWriter(String moduleName) {\n        this(moduleName, true);\n    }\n\n    private TypeScriptWriter(String moduleName, boolean withAttribution) {\n        super(new ImportDeclarations(moduleName));\n        this.moduleName = moduleName;\n\n        setIndentText(\"  \");\n        trimTrailingSpaces(true);\n        trimBlankLines();\n        putFormatter('T', new TypeScriptSymbolFormatter());\n\n        this.withAttribution = withAttribution;\n    }\n\n    public static final class TypeScriptWriterFactory implements SymbolWriter.Factory<TypeScriptWriter> {\n\n        @Override\n        public TypeScriptWriter apply(String filename, String namespace) {\n            boolean withAttribution = filename.endsWith(\".ts\");\n            String moduleName = filename.endsWith(\".ts\") ? filename.substring(0, filename.length() - 3) : filename;\n            return new TypeScriptWriter(moduleName, withAttribution);\n        }\n    }\n\n    /**\n     * Get the module name that is generated by the writer.\n     *\n     * @return Returns the module name.\n     */\n    public String getModuleName() {\n        return moduleName;\n    }\n\n    /**\n     * default import from a module, annotated with @ts-ignore.\n     *\n     * @param name Name of default import.\n     * @param from Module to default import from.\n     * @param reason The reason for ignoring the import\n     * @return Returns the writer.\n     */\n    public TypeScriptWriter addIgnoredDefaultImport(String name, String from, String reason) {\n        getImportContainer().addIgnoredDefaultImport(name, from, reason);\n        return this;\n    }\n\n    /**\n     * Imports a type using an alias from a module only if necessary.\n     *\n     * @param name Type to import.\n     * @param as Alias to refer to the type as.\n     * @param from Module to import the type from.\n     *\n     * @return Returns the writer.\n     *\n     * @deprecated Use {@link TypeScriptWriter#addImport(String, String, TypeScriptDependency)} addImport}\n     */\n    @Deprecated\n    public TypeScriptWriter addImport(String name, String as, String from) {\n        ImportFrom importFrom = new ImportFrom(from);\n        checkImport(importFrom, from);\n\n        getImportContainer().addImport(name, as, from);\n        return this;\n    }\n\n    /**\n     * Imports a type using an alias from a module only if necessary.\n     * Adds the dependency.\n     *\n     * @param name Type to import.\n     * @param as Alias to refer to the type as.\n     * @param from PackageContainer to import the type from.\n     * @return Returns the writer.\n     */\n    public TypeScriptWriter addImport(String name, String as, PackageContainer from) {\n        if (from instanceof Dependency) {\n            addDependency((Dependency) from);\n        }\n        return this.addImport(name, as, from.getPackageName());\n    }\n\n    /**\n     * Type-only version of {@link #addImport}.\n     */\n    public TypeScriptWriter addTypeImport(String name, String as, Dependency from) {\n        addDependency(from);\n        return addTypeImport(name, as, from.getPackageName());\n    }\n\n    /**\n     * Same as {@link #addImport(String, String, PackageContainer)} but appends a\n     * submodule path, for example \"@smithy/core/cbor\".\n     */\n    public TypeScriptWriter addImportSubmodule(String name, String as, PackageContainer from, String submodule) {\n        if (from instanceof Dependency dependency) {\n            addDependency(dependency);\n        }\n        return this.addImport(name, as, from.getPackageName() + submodule);\n    }\n\n    /**\n     * Type-only version of {@link #addImportSubmodule}.\n     */\n    public TypeScriptWriter addTypeImportSubmodule(String name, String as, PackageContainer from, String submodule) {\n        if (from instanceof Dependency dependency) {\n            addDependency(dependency);\n        }\n        return this.addTypeImport(name, as, from.getPackageName() + submodule);\n    }\n\n    /**\n     * Imports a type using an alias from a relative Path.\n     *\n     * @param name Type to import.\n     * @param as Alias to refer to the type as.\n     * @param from Path to import the type from.\n     * @return Returns the writer.\n     */\n    public TypeScriptWriter addRelativeImport(String name, String as, Path from) {\n        return this.addImport(name, as, from.toString());\n    }\n\n    /**\n     * Type-only version of {@link #addRelativeImport}.\n     */\n    public TypeScriptWriter addRelativeTypeImport(String name, String as, Path from) {\n        return this.addTypeImport(name, as, from.toString());\n    }\n\n    /**\n     * Writes documentation comments.\n     *\n     * @param runnable Runnable that handles actually writing docs with the writer.\n     * @return Returns the writer.\n     */\n    public TypeScriptWriter writeDocs(Runnable runnable) {\n        pushState(\"docs\");\n        write(\"/**\");\n        setNewlinePrefix(\" * \");\n        runnable.run();\n        setNewlinePrefix(\"\");\n        write(\" */\");\n        popState();\n        return this;\n    }\n\n    /**\n     * Writes documentation comments from a string.\n     *\n     * <p>This function escapes \"$\" characters so formatters are not run.\n     *\n     * @param docs Documentation to write.\n     * @return Returns the writer.\n     */\n    public TypeScriptWriter writeDocs(String docs) {\n        // Docs can have valid $ characters that shouldn't run through formatters.\n        // Escapes multi-line comment closings.\n        writeDocs(() -> write(docs.replace(\"$\", \"$$\").replace(\"*/\", \"*\\\\/\")));\n        return this;\n    }\n\n    /**\n     * As openBlock, but collapses all space between open and close strings\n     * if the condition is not met.\n     */\n    public TypeScriptWriter openCollapsibleBlock(\n        String open,\n        String close,\n        boolean condition,\n        Object[] args,\n        Runnable runnable\n    ) {\n        if (condition) {\n            openBlock(open, close, args, runnable);\n        } else {\n            write(open + close, args);\n        }\n        return this;\n    }\n\n    public TypeScriptWriter openCollapsibleBlock(String open, String close, boolean condition, Runnable runnable) {\n        return openCollapsibleBlock(open, close, condition, new Object[] {}, runnable);\n    }\n\n    public TypeScriptWriter openCollapsibleBlock(\n        String open,\n        String close,\n        boolean condition,\n        Object arg1,\n        Runnable runnable\n    ) {\n        return openCollapsibleBlock(open, close, condition, new Object[] {arg1}, runnable);\n    }\n\n    public TypeScriptWriter openCollapsibleBlock(\n        String open,\n        String close,\n        boolean condition,\n        Object arg1,\n        Object arg2,\n        Runnable runnable\n    ) {\n        return openCollapsibleBlock(open, close, condition, new Object[] {arg1, arg2}, runnable);\n    }\n\n    public TypeScriptWriter openCollapsibleBlock(\n        String open,\n        String close,\n        boolean condition,\n        Object arg1,\n        Object arg2,\n        Object arg3,\n        Runnable runnable\n    ) {\n        return openCollapsibleBlock(open, close, condition, new Object[] {arg1, arg2, arg3}, runnable);\n    }\n\n    /**\n     * Modifies and writes shape documentation comments if docs are present.\n     *\n     * @param shape Shape to write the documentation of.\n     * @param preprocessor UnaryOperator that takes documentation and returns modified one.\n     * @return Returns true if docs were written.\n     */\n    boolean writeShapeDocs(Shape shape, UnaryOperator<String> preprocessor) {\n        boolean hasDocumentation = shape.getTrait(DocumentationTrait.class).isPresent();\n        boolean hasDeprecation = shape.getTrait(DeprecatedTrait.class).isPresent();\n\n        if (hasDocumentation || hasDeprecation) {\n            String docs =\n                hasDocumentation ? shape.getTrait(DocumentationTrait.class).get().getValue() : \"\";\n            docs = docs.replace(\"{\", \"\\\\{\").replace(\"}\", \"\\\\}\");\n\n            if (hasDeprecation) {\n                DeprecatedTrait deprecatedTrait = shape.expectTrait(DeprecatedTrait.class);\n                String deprecationAnnotation = buildDeprecationAnnotation(deprecatedTrait);\n                if (hasDocumentation) {\n                    docs = punctuate(docs) + \"\\n\\n\" + deprecationAnnotation;\n                } else {\n                    docs = deprecationAnnotation;\n                }\n            }\n\n            docs = preprocessor.apply(docs);\n            docs = addReleaseTag(shape, docs);\n            writeDocs(docs);\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Writes shape documentation comments if docs are present.\n     *\n     * @param shape Shape to write the documentation of.\n     * @return Returns true if docs were written.\n     */\n    boolean writeShapeDocs(Shape shape) {\n        boolean didWrite = writeShapeDocs(shape, docs -> docs);\n        if (!didWrite) {\n            writeDocs(\"@public\");\n        }\n        return didWrite;\n    }\n\n    /**\n     * Writes member shape documentation comments if docs are present.\n     *\n     * @param model Model used to dereference targets.\n     * @param member Shape to write the documentation of.\n     * @return Returns true if docs were written.\n     */\n    boolean writeMemberDocs(Model model, MemberShape member) {\n        boolean hasDocumentation = member.getMemberTrait(model, DocumentationTrait.class).isPresent();\n        boolean hasDeprecation =\n            member.getTrait(DeprecatedTrait.class).isPresent() || isTargetDeprecated(model, member);\n\n        if (hasDocumentation || hasDeprecation) {\n            String docs =\n                hasDocumentation ? member.getMemberTrait(model, DocumentationTrait.class).get().getValue() : \"\";\n            docs = docs.replace(\"{\", \"\\\\{\").replace(\"}\", \"\\\\}\");\n\n            if (hasDeprecation) {\n                DeprecatedTrait deprecatedTrait = member\n                    .getTrait(DeprecatedTrait.class)\n                    .or(() -> model.expectShape(member.getTarget()).getTrait(DeprecatedTrait.class))\n                    .orElseThrow();\n                String deprecationAnnotation = buildDeprecationAnnotation(deprecatedTrait);\n                if (hasDocumentation) {\n                    docs = punctuate(docs) + \"\\n\\n\" + deprecationAnnotation;\n                } else {\n                    docs = deprecationAnnotation;\n                }\n            }\n\n            docs = addReleaseTag(member, docs);\n            writeDocs(docs);\n            return true;\n        }\n\n        return false;\n    }\n\n    private boolean isTargetDeprecated(Model model, MemberShape member) {\n        return (model.expectShape(member.getTarget()).getTrait(DeprecatedTrait.class).isPresent() &&\n        // don't consider deprecated prelude shapes (like PrimitiveBoolean)\n            !Prelude.isPreludeShape(member.getTarget()));\n    }\n\n    /**\n     * Builds a JSDoc {@code @deprecated} annotation from a {@link DeprecatedTrait},\n     * synthesizing the {@code message} and {@code since} fields into the deprecation text.\n     */\n    static String buildDeprecationAnnotation(DeprecatedTrait trait) {\n        StringBuilder annotation = new StringBuilder(\"@deprecated\");\n        String message = trait.getMessage().orElse(null);\n        String since = trait.getSince().orElse(null);\n\n        if (message != null && since != null) {\n            annotation\n                .append(\" (since %s) \".formatted(since))\n                .append(message);\n        } else if (message != null) {\n            annotation.append(\" \").append(message);\n        } else if (since != null) {\n            annotation.append(\" since %s\".formatted(since));\n        } else {\n            annotation.append(\" deprecated\");\n        }\n\n        return punctuate(annotation.toString());\n    }\n\n    /**\n     * Adds a period to the end of the string if no punctuation is present.\n     * It doesn't matter if it's not a grammatical sentence, since the period\n     * serves as a visual separator in code comments.\n     */\n    static String punctuate(String s) {\n        String state = s.trim();\n        if (state.matches(\"(.*?)\\\\w$\")) {\n            return state + \".\";\n        }\n        return s;\n    }\n\n    private String addReleaseTag(Shape shape, String docs) {\n        if (shape.getTrait(InternalTrait.class).isPresent()) {\n            docs = docs + \"\\n@internal\";\n        } else {\n            docs = docs + \"\\n@public\";\n        }\n        return docs;\n    }\n\n    /**\n     * This is private because the string-value [from] signature is\n     * deprecated for the corresponding addImport() signature. Importing a string\n     * makes it difficult to ensure the package is added to the dependency manifest,\n     * so package imports should be by package object, and relative imports by path object.\n     */\n    private TypeScriptWriter addTypeImport(String name, String as, String from) {\n        ImportFrom importFrom = new ImportFrom(from);\n        checkImport(importFrom, from);\n        getImportContainer().addTypeImport(name, as, from);\n        return this;\n    }\n\n    /**\n     * Check that the import source string has been registered with the dependency manifest\n     * if it is a package, not a node package, and not a relative path.\n     */\n    private void checkImport(ImportFrom importFrom, String from) {\n        if (importFrom.isDeclarablePackageImport()) {\n            String packageName = importFrom.getPackageName();\n            if (getDependencies().stream().map(SymbolDependency::getPackageName).noneMatch(packageName::equals)) {\n                throw new CodegenException(\n                    \"\"\"\n                    The import %s does not correspond to a registered dependency.\n                    TypeScriptWriter::addDependency() is required before ::addImport().\n                    \"\"\".formatted(from)\n                );\n            }\n        }\n    }\n\n    @Override\n    public String toString() {\n        String contents = super.toString();\n        String importString = getImportContainer().toString();\n        String strippedContents = StringUtils.stripStart(contents, null);\n        String strippedImportString = StringUtils.strip(importString, null);\n        String attribution = withAttribution ? CODEGEN_INDICATOR : \"\";\n\n        // Don't add an additional new line between explicit imports and managed imports.\n        if (!strippedImportString.isEmpty() && strippedContents.startsWith(\"import \")) {\n            return attribution + strippedImportString + \"\\n\" + strippedContents;\n        }\n\n        return attribution + importString + contents;\n    }\n\n    /**\n     * Adds TypeScript symbols for the \"$T\" formatter.\n     */\n    private final class TypeScriptSymbolFormatter implements BiFunction<Object, String, String> {\n\n        @Override\n        public String apply(Object type, String indent) {\n            if (type instanceof Symbol) {\n                Symbol typeSymbol = (Symbol) type;\n                addUseImports(typeSymbol);\n                return typeSymbol.getName();\n            } else if (type instanceof SymbolReference) {\n                SymbolReference typeSymbol = (SymbolReference) type;\n                addImport(typeSymbol.getSymbol(), typeSymbol.getAlias(), SymbolReference.ContextOption.USE);\n                return typeSymbol.getAlias();\n            } else {\n                throw new CodegenException(\n                    \"Invalid type provided to $T. Expected a Symbol or SymbolReference, but found `\" + type + \"`\"\n                );\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/UnionGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.util.Map;\nimport java.util.TreeMap;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings.RequiredMemberMode;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.validation.SensitiveDataFinder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * Renders a TypeScript union.\n *\n * <p>\n * Smithy tagged unions are rendered as a set of TypeScript interfaces\n * and functionality used to visit each variant. Only a single member\n * can be set at any given time. A member that contains unknown variants\n * is automatically added to each tagged union. If set, it contains the\n * name of the property that was set and its value stored as an\n * {@code any}.\n *\n * <p>\n * A {@code Visitor} interface and a method used to dispatch to the\n * visitor is generated for each tagged union. This allows for working\n * with tagged unions functionally and account for each variant in a\n * typed way.\n *\n * <p>\n * For example, given the following Smithy model:\n *\n * <pre>{@code\n * union Attacker {\n *     lion: Lion,\n *     tiger: Tiger,\n *     bear: Bear,\n * }\n * }</pre>\n *\n * <p>\n * The following code is generated:\n *\n * <pre>{@code\n * export type Attacker =\n *   | Attacker.LionMember\n *   | Attacker.TigerMember\n *   | Attacker.BearMember\n *   | Attacker.$UnknownMember;\n *\n * export namespace Attacker {\n *\n *   export interface LionMember {\n *     lion: Lion;\n *     tiger?: never;\n *     bear?: never;\n *     $unknown?: never;\n *   }\n *\n *   export interface TigerMember {\n *     lion?: never;\n *     tiger?: Tiger;\n *     bear?: never;\n *     $unknown?: never;\n *   }\n *\n *   export interface BearMember {\n *     lion?: never;\n *     tiger?: never;\n *     bear: Bear;\n *     $unknown: never;\n *   }\n *\n *   export interface $UnknownMember {\n *     lion?: never;\n *     tiger?: never;\n *     bear?: never;\n *     $unknown: [string, any];\n *   }\n *\n *   export interface Visitor<T> {\n *     lion: (value: Lion) => T;\n *     tiger: (value: Tiger) => T;\n *     bear: (value: Bear) => T;\n *     _: (name: string, value: any) => T;\n *   }\n *\n *   export const visit = <T>(\n *     value: Attacker,\n *     visitor: Visitor<T>\n *   ): T => {\n *     if (value.lion !== undefined) return visitor.lion(value.lion);\n *     if (value.tiger !== undefined) return visitor.tiger(value.tiger);\n *     if (value.bear !== undefined) return visitor.bear(value.bear);\n *     return visitor._(value.$unknown[0], value.$unknown[1]);\n *   }\n * }\n *\n * export const AttackerFilterSensitiveLog = (obj: Attacker) => {\n *   if (obj.lion !== undefined)\n *     return { lion: Lion.filterSensitiveLog(obj.lion) };\n *   if (obj.tiger !== undefined)\n *     return { tiger: Tiger.filterSensitiveLog(obj.tiger) };\n *   if (obj.bear !== undefined)\n *     return { bear: Bear.filterSensitiveLog(obj.bear) };\n *   if (obj.$unknown !== undefined)\n *     return { [obj.$unknown[0]]: 'UNKNOWN' };\n * }\n *\n * }</pre>\n *\n * <p>\n * Important: Tagged unions in TypeScript are intentionally designed\n * so that it is forward-compatible to change a structure with optional\n * and mutually exclusive members to a tagged union.\n */\n@SmithyInternalApi\nfinal class UnionGenerator implements Runnable {\n\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final TypeScriptWriter writer;\n    private final Symbol symbol;\n    private final UnionShape shape;\n    private final Map<String, String> variantMap;\n    private final boolean includeValidation;\n    private final SensitiveDataFinder sensitiveDataFinder;\n    private final boolean schemaMode;\n    private final ServiceClosure closure;\n\n    /**\n     * sets 'includeValidation' to 'false' for backwards compatibility.\n     */\n    UnionGenerator(\n        Model model,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        UnionShape shape\n    ) {\n        this(model, settings, symbolProvider, writer, shape, false, false);\n    }\n\n    UnionGenerator(\n        Model model,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer,\n        UnionShape shape,\n        boolean includeValidation,\n        boolean schemaMode\n    ) {\n        this.shape = shape;\n        this.symbol = symbolProvider.toSymbol(shape);\n        this.model = model;\n        this.symbolProvider = symbolProvider;\n        this.writer = writer;\n        this.includeValidation = includeValidation;\n        sensitiveDataFinder = new SensitiveDataFinder(model);\n\n        variantMap = new TreeMap<>();\n        for (MemberShape member : shape.getAllMembers().values()) {\n            String variant = StringUtils.capitalize(symbolProvider.toMemberName(member)) + \"Member\";\n            variantMap.put(member.getMemberName(), variant);\n        }\n        this.schemaMode = schemaMode;\n        this.closure = ServiceClosure.of(model, settings.getService(model));\n    }\n\n    @Override\n    public void run() {\n        // Write out the union type of all variants.\n        writer.writeShapeDocs(shape);\n\n        writer.openBlock(\"export type $L = \", \"\", symbol.getName(), () -> {\n            for (String variant : variantMap.values()) {\n                writer.write(\"| $L.$L\", symbol.getName(), variant);\n            }\n            writer.write(\"| $L.$$UnknownMember;\", symbol.getName());\n        });\n\n        // Write out the namespace that contains each variant and visitor.\n        writer\n            .writeDocs(\"@public\")\n            .openBlock(\"export namespace $L {\", \"}\", symbol.getName(), () -> {\n                writeUnionMemberInterfaces();\n                writeVisitorType();\n                writeVisitorFunction();\n                if (includeValidation) {\n                    writeValidate();\n                }\n                writer.unwrite(\"\\n\");\n            });\n        writeFilterSensitiveLog(symbol.getName());\n    }\n\n    private void writeUnionMemberInterfaces() {\n        for (MemberShape member : shape.getAllMembers().values()) {\n            String name = variantMap.get(member.getMemberName());\n            writer.writeMemberDocs(model, member);\n            writer.openBlock(\"export interface $L {\", \"}\", name, () -> {\n                for (MemberShape variantMember : shape.getAllMembers().values()) {\n                    if (variantMember.getMemberName().equals(member.getMemberName())) {\n                        writer.write(\n                            \"$L: $T;\",\n                            symbolProvider.toMemberName(variantMember),\n                            symbolProvider.toSymbol(variantMember)\n                        );\n                    } else {\n                        writer.write(\"$L?: never;\", symbolProvider.toMemberName(variantMember));\n                    }\n                }\n                writer.write(\"$$unknown?: never;\");\n            });\n            writer.write(\"\");\n        }\n\n        // Write out the unknown variant.\n        writer.writeDocs(\"@public\");\n        writer.openBlock(\"export interface $$UnknownMember {\", \"}\", () -> {\n            for (MemberShape member : shape.getAllMembers().values()) {\n                writer.write(\"$L?: never;\", symbolProvider.toMemberName(member));\n            }\n            writer.write(\"$$unknown: [string, any];\");\n        });\n        writer.write(\"\");\n    }\n\n    private void writeVisitorType() {\n        if (schemaMode) {\n            writer.writeDocs(\n                \"\"\"\n                @deprecated unused in schema-serde mode.\n                \"\"\"\n            );\n        }\n        writer.openBlock(\"export interface Visitor<T> {\", \"}\", () -> {\n            for (MemberShape member : shape.getAllMembers().values()) {\n                writer.write(\n                    \"$L: (value: $T) => T;\",\n                    symbolProvider.toMemberName(member),\n                    symbolProvider.toSymbol(member)\n                );\n            }\n            writer.write(\"_: (name: string, value: any) => T;\");\n        });\n        writer.write(\"\");\n    }\n\n    private void writeVisitorFunction() {\n        if (!schemaMode) {\n            // Create the visitor dispatcher for the union.\n            writer.writeInline(\"export const visit = <T>(\");\n            writer.writeInline(\"value: $L, \", symbol.getName());\n            writer.writeInline(\"visitor: Visitor<T>\");\n            writer.write(\"): T => {\").indent();\n            for (MemberShape member : shape.getAllMembers().values()) {\n                String memberName = symbolProvider.toMemberName(member);\n                writer.write(\"if (value.${1L} !== undefined) return visitor.$1L(value.${1L});\", memberName);\n            }\n            writer.write(\"return visitor._(value.$$unknown[0], value.$$unknown[1]);\");\n            writer.dedent().write(\"};\");\n            writer.write(\"\");\n        }\n    }\n\n    private void writeFilterSensitiveLog(String namespace) {\n        if (sensitiveDataFinder.findsSensitiveDataIn(shape) && !schemaMode) {\n            String objectParam = \"obj\";\n            writer.writeDocs(\"@internal\");\n            writer.openBlock(\n                \"export const $LFilterSensitiveLog = ($L: $L): any => {\",\n                \"}\",\n                namespace,\n                objectParam,\n                symbol.getName(),\n                () -> {\n                    for (MemberShape member : shape.getAllMembers().values()) {\n                        String memberName = symbolProvider.toMemberName(member);\n                        StructuredMemberWriter structuredMemberWriter = new StructuredMemberWriter(\n                            model,\n                            closure,\n                            symbolProvider,\n                            shape.getAllMembers().values(),\n                            RequiredMemberMode.NULLABLE,\n                            sensitiveDataFinder\n                        );\n\n                        writer.writeInline(\n                            \"\"\"\n                            if (${1L}.${2L} !== undefined) {\n                              return {\n                                ${2L}:\\s\"\"\",\n                            objectParam,\n                            memberName\n                        );\n                        String memberParam = String.format(\"%s.%s\", objectParam, memberName);\n                        writer.indent(2);\n                        structuredMemberWriter.writeMemberFilterSensitiveLog(writer, member, memberParam);\n                        writer.dedent(1);\n                        writer.write(\"};\");\n                        writer.dedent(1);\n                        writer.write(\"}\");\n                    }\n                    writer.write(\n                        \"if (${1L}.$$unknown !== undefined) return { [${1L}.$$unknown[0]]: \\\"UNKNOWN\\\" };\",\n                        objectParam\n                    );\n                }\n            );\n        }\n    }\n\n    private void writeValidate() {\n        StructuredMemberWriter structuredMemberWriter = new StructuredMemberWriter(\n            model,\n            closure,\n            symbolProvider,\n            shape.getAllMembers().values(),\n            RequiredMemberMode.NULLABLE,\n            sensitiveDataFinder\n        );\n\n        structuredMemberWriter.writeMemberValidatorCache(writer, \"memberValidators\");\n\n        writer.addImport(\"ValidationFailure\", \"__ValidationFailure\", TypeScriptDependency.SERVER_COMMON);\n        writer.writeDocs(\"@internal\");\n        writer.openBlock(\n            \"export const validate = ($L: $L, path: string = \\\"\\\"): __ValidationFailure[] => {\",\n            \"}\",\n            \"obj\",\n            symbol.getName(),\n            () -> {\n                structuredMemberWriter.writeMemberValidatorFactory(writer, \"memberValidators\");\n                structuredMemberWriter.writeValidateMethodContents(writer, \"obj\");\n            }\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/UnresolvableProtocolException.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic class UnresolvableProtocolException extends CodegenException {\n\n    public UnresolvableProtocolException(String message) {\n        super(message);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/WaiterGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.jmespath.JmespathExpression;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.waiters.Acceptor;\nimport software.amazon.smithy.waiters.AcceptorState;\nimport software.amazon.smithy.waiters.Matcher;\nimport software.amazon.smithy.waiters.PathMatcher;\nimport software.amazon.smithy.waiters.WaitableTrait;\nimport software.amazon.smithy.waiters.Waiter;\n\n@SmithyInternalApi\nclass WaiterGenerator implements Runnable {\n\n    static final String WAITERS_FOLDER = \"waiters\";\n    static final String WAITER_SUBMODULE = SmithyCoreSubmodules.CLIENT;\n\n    private final String waiterName;\n    private final Waiter waiter;\n    private final TypeScriptWriter writer;\n\n    private final Symbol serviceSymbol;\n    private final Symbol operationSymbol;\n    private final Symbol inputSymbol;\n    private final Symbol outputSymbol;\n    private final String waiterResultType;\n    private final String waitUntilResultType;\n\n    WaiterGenerator(\n        String waiterName,\n        Waiter waiter,\n        ServiceShape service,\n        OperationShape operation,\n        TypeScriptWriter writer,\n        SymbolProvider symbolProvider,\n        TypeScriptSettings settings,\n        Model model\n    ) {\n        this.waiterName = waiterName;\n        this.waiter = waiter;\n        this.writer = writer;\n\n        this.operationSymbol = symbolProvider.toSymbol(operation);\n        this.serviceSymbol = symbolProvider.toSymbol(service)\n            .toBuilder()\n            .putProperty(\"typeOnly\", true)\n            .build();\n        this.inputSymbol = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n        this.outputSymbol = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n\n        String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n        String syntheticBaseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model);\n        writer.addRelativeTypeImport(\n            syntheticBaseExceptionName,\n            null,\n            Path.of(\".\", \"src\", \"models\", syntheticBaseExceptionName)\n        );\n        waiterResultType = outputSymbol.getName() + \" | \" + syntheticBaseExceptionName;\n        waitUntilResultType = computeWaitUntilResultType(\n            waiter,\n            outputSymbol.getName(),\n            syntheticBaseExceptionName,\n            settings,\n            model,\n            symbolProvider,\n            writer\n        );\n    }\n\n    @Override\n    public void run() {\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n        this.generateAcceptors();\n        this.generateWaiter();\n    }\n\n    public static String getOutputFileLocation(String waiterName) {\n        return Paths.get(CodegenUtils.SOURCE_FOLDER, WAITERS_FOLDER, \"waitFor\" + waiterName + \".ts\").toString();\n    }\n\n    private void generateWaiter() {\n        writer.addImportSubmodule(\"createWaiter\", null, TypeScriptDependency.SMITHY_CORE, WAITER_SUBMODULE);\n        writer.addTypeImportSubmodule(\"WaiterResult\", null, TypeScriptDependency.SMITHY_CORE, WAITER_SUBMODULE);\n        writer.addImportSubmodule(\"WaiterState\", null, TypeScriptDependency.SMITHY_CORE, WAITER_SUBMODULE);\n        writer.addImportSubmodule(\"checkExceptions\", null, TypeScriptDependency.SMITHY_CORE, WAITER_SUBMODULE);\n        writer.addTypeImportSubmodule(\"WaiterConfiguration\", null, TypeScriptDependency.SMITHY_CORE, WAITER_SUBMODULE);\n\n        // generates (deprecated) WaitFor....\n        writer.writeDocs(\n            waiter.getDocumentation().orElse(\"\") +\n                \" \\n\" +\n                \" @deprecated Use waitUntil\" +\n                waiterName +\n                \" instead. \" +\n                \"waitFor\" +\n                waiterName +\n                \" does not throw error in non-success cases.\"\n        );\n        writer.openBlock(\n            \"\"\"\n            export const waitFor$L = async (\n              params: WaiterConfiguration<$T>,\n              input: $T\n            ): Promise<WaiterResult<$L>> => {\"\"\",\n            \"};\",\n            waiterName,\n            serviceSymbol,\n            inputSymbol,\n            waiterResultType,\n            () -> {\n                writer.write(\n                    \"const serviceDefaults = { minDelay: $L, maxDelay: $L };\",\n                    waiter.getMinDelay(),\n                    waiter.getMaxDelay()\n                );\n                writer.write(\"return createWaiter({ ...serviceDefaults, ...params }, input, checkState);\");\n            }\n        );\n\n        // generates WaitUtil....\n        writer.writeDocs(\n            waiter.getDocumentation().orElse(\"\") +\n                \" \\n\" +\n                \" @param params - Waiter configuration options.\\n\" +\n                \" @param input - The input to \" +\n                operationSymbol.getName() +\n                \" for polling.\"\n        );\n        writer.openBlock(\n            \"\"\"\n            export const waitUntil$L = async (\n              params: WaiterConfiguration<$T>,\n              input: $T\n            ): Promise<WaiterResult<$L>> => {\"\"\",\n            \"};\",\n            waiterName,\n            serviceSymbol,\n            inputSymbol,\n            waitUntilResultType,\n            () -> {\n                writer.write(\n                    \"const serviceDefaults = { minDelay: $L, maxDelay: $L };\",\n                    waiter.getMinDelay(),\n                    waiter.getMaxDelay()\n                );\n                writer.write(\n                    \"const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);\"\n                );\n                // as WaiterResult<Narrowed> is needed because createWaiter is the union type\n                // whereas checkExceptions narrows to only the success type.\n                writer.write(\"return checkExceptions(result) as WaiterResult<$L>;\", waitUntilResultType);\n            }\n        );\n    }\n\n    private void generateAcceptors() {\n        writer.openBlock(\n            \"const checkState = async (client: $T, input: $T): Promise<WaiterResult<$L>> => {\",\n            \"};\",\n            serviceSymbol,\n            inputSymbol,\n            waiterResultType,\n            () -> {\n                writer.write(\"let reason;\");\n\n                writer.write(\"try {\").indent();\n                {\n                    writer.write(\n                        \"let result: $T & any = await client.send(new $T(input));\",\n                        outputSymbol,\n                        operationSymbol\n                    );\n                    writer.write(\"reason = result;\");\n                    writeAcceptors(\"result\", false);\n                }\n                writer.dedent().write(\"} catch (exception) {\").indent();\n                {\n                    writer.write(\"reason = exception;\");\n                    writeAcceptors(\"exception\", true);\n                }\n                writer.dedent().write(\"}\");\n\n                writer.write(\"return $L;\", makeWaiterResult(AcceptorState.RETRY));\n            }\n        );\n    }\n\n    private void writeAcceptors(String accessor, boolean isException) {\n        waiter\n            .getAcceptors()\n            .forEach((Acceptor acceptor) -> {\n                if (acceptor.getMatcher() instanceof Matcher.SuccessMember) {\n                    Matcher.SuccessMember successMember = (Matcher.SuccessMember) acceptor.getMatcher();\n                    if (successMember.getValue() != isException) {\n                        generateSuccessMatcher(successMember, acceptor.getState());\n                    }\n                } else if (acceptor.getMatcher() instanceof Matcher.ErrorTypeMember) {\n                    if (isException) {\n                        generateErrorMatcher(\n                            accessor,\n                            (Matcher.ErrorTypeMember) acceptor.getMatcher(),\n                            acceptor.getState()\n                        );\n                    }\n                } else if (acceptor.getMatcher() instanceof Matcher.InputOutputMember) {\n                    if (!isException) {\n                        Matcher.InputOutputMember member = (Matcher.InputOutputMember) acceptor.getMatcher();\n                        generatePathMatcher(accessor, member.getValue(), acceptor.getState());\n                        generatePathMatcher(\"input\", member.getValue(), acceptor.getState());\n                    }\n                } else if (acceptor.getMatcher() instanceof Matcher.OutputMember) {\n                    if (!isException) {\n                        Matcher.OutputMember member = (Matcher.OutputMember) acceptor.getMatcher();\n                        generatePathMatcher(accessor, member.getValue(), acceptor.getState());\n                    }\n                } else {\n                    throw new CodegenException(\n                        \"Unknown matcher member name: \" + acceptor.getMatcher().getMemberName()\n                    );\n                }\n            });\n    }\n\n    private void generateSuccessMatcher(Matcher.SuccessMember member, AcceptorState state) {\n        writer.write(\"return $L;\", makeWaiterResult(state));\n    }\n\n    private void generateErrorMatcher(String accessor, Matcher.ErrorTypeMember member, AcceptorState state) {\n        writer.openBlock(\"if ($L.name === $S) {\", \"}\", accessor, member.getValue(), () -> {\n            writer.write(\"return $L;\", makeWaiterResult(state));\n        });\n    }\n\n    private void generatePathMatcher(String accessor, PathMatcher pathMatcher, AcceptorState state) {\n        writer.openBlock(\"try {\", \"} catch (e) {}\", () -> {\n            JmespathExpression expression = JmespathExpression.parse(pathMatcher.getPath());\n            TypeScriptJmesPathVisitor expressionVisitor = new TypeScriptJmesPathVisitor(writer, accessor, expression);\n            String expectedState = makeWaiterResult(state);\n            expressionVisitor.run();\n\n            switch (pathMatcher.getComparator()) {\n                case ALL_STRING_EQUALS:\n                    expressionVisitor.writeAllStringEqualsExpectation(pathMatcher.getExpected(), expectedState);\n                    break;\n                case ANY_STRING_EQUALS:\n                    expressionVisitor.writeAnyStringEqualsExpectation(pathMatcher.getExpected(), expectedState);\n                    break;\n                case STRING_EQUALS:\n                    expressionVisitor.writeStringExpectation(pathMatcher.getExpected(), expectedState);\n                    break;\n                case BOOLEAN_EQUALS:\n                    expressionVisitor.writeBooleanExpectation(pathMatcher.getExpected(), expectedState);\n                    break;\n                default:\n                    throw new CodegenException(\"Invalid Matcher Comparator\");\n            }\n        });\n    }\n\n    private String makeWaiterResult(AcceptorState resultantState) {\n        if (resultantState == AcceptorState.SUCCESS) {\n            return \"{ state: WaiterState.SUCCESS, reason }\";\n        } else if (resultantState == AcceptorState.FAILURE) {\n            return \"{ state: WaiterState.FAILURE, reason }\";\n        } else if (resultantState == AcceptorState.RETRY) {\n            return \"{ state: WaiterState.RETRY, reason }\";\n        }\n        throw new CodegenException(\"Hit an invalid acceptor state to codegen \" + resultantState.toString());\n    }\n\n    private static String getModulePath(String fileLocation) {\n        return fileLocation.substring(fileLocation.lastIndexOf(\"/\") + 1, fileLocation.length()).replace(\".ts\", \"\");\n    }\n\n    /**\n     * Determines the narrowest result type for waitUntil based on which acceptors\n     * produce a SUCCESS state.\n     *\n     * - If success only comes from successful responses: OutputType only.\n     * - If success only comes from errors: the specific modeled exception if there\n     *   is exactly one ErrorType success acceptor matching a modeled error, otherwise\n     *   the synthetic base exception.\n     * - If success can come from both: OutputType | exception type.\n     */\n    static String computeWaitUntilResultType(\n        Waiter waiter,\n        String outputTypeName,\n        String exceptionTypeName,\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        boolean waiterSuccessTerminalOnSuccessfulResponse = false;\n        boolean waiterSuccessTerminalOnErrorResponse = false;\n        Set<String> successErrorTypeNames = new TreeSet<>();\n\n        for (Acceptor acceptor : waiter.getAcceptors()) {\n            if (acceptor.getState() != AcceptorState.SUCCESS) {\n                continue;\n            }\n            Matcher<?> matcher = acceptor.getMatcher();\n            if (matcher instanceof Matcher.SuccessMember successMember) {\n                if (successMember.getValue()) {\n                    waiterSuccessTerminalOnSuccessfulResponse = true;\n                } else {\n                    waiterSuccessTerminalOnErrorResponse = true;\n                }\n            } else if (matcher instanceof Matcher.ErrorTypeMember errorTypeMember) {\n                waiterSuccessTerminalOnErrorResponse = true;\n                successErrorTypeNames.add(errorTypeMember.getValue());\n            } else if (\n                matcher instanceof Matcher.OutputMember\n                    || matcher instanceof Matcher.InputOutputMember\n            ) {\n                waiterSuccessTerminalOnSuccessfulResponse = true;\n            }\n        }\n\n        String resolvedExceptionType = exceptionTypeName;\n        if (successErrorTypeNames.size() == 1) {\n            String errorName = successErrorTypeNames.iterator().next();\n            boolean errorTypeQualifiedName = errorName.contains(\"#\");\n\n            // Check if this error is a modeled error shape on the operation.\n            resolvedExceptionType = ServiceClosure.of(model, settings.getService(model))\n                .getErrorShapes()\n                .stream()\n                .filter(\n                    shape -> errorTypeQualifiedName ? ShapeId.from(errorName).equals(shape.getId())\n                        : shape.getId().getName().equals(errorName)\n                )\n                .findFirst()\n                .map(shape -> {\n                    String typeName = symbolProvider.toSymbol(shape).getName();\n                    writer.addRelativeTypeImport(\n                        typeName,\n                        null,\n                        Path.of(\".\", \"src\", \"models\", \"errors\")\n                    );\n                    return typeName;\n                })\n                .orElse(exceptionTypeName);\n        }\n\n        if (waiterSuccessTerminalOnSuccessfulResponse && waiterSuccessTerminalOnErrorResponse) {\n            return outputTypeName + \" | \" + resolvedExceptionType;\n        } else if (waiterSuccessTerminalOnErrorResponse) {\n            return resolvedExceptionType;\n        }\n        return outputTypeName;\n    }\n\n    static void writeIndex(Model model, ServiceShape service, FileManifest fileManifest) {\n        TypeScriptWriter writer = new TypeScriptWriter(\"\");\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> containedOperations = new TreeSet<>(topDownIndex.getContainedOperations(service));\n        for (OperationShape operation : containedOperations) {\n            if (operation.hasTrait(WaitableTrait.ID)) {\n                WaitableTrait waitableTrait = operation.expectTrait(WaitableTrait.class);\n                waitableTrait\n                    .getWaiters()\n                    .forEach((String waiterName, Waiter waiter) -> {\n                        String outputFilepath = WaiterGenerator.getOutputFileLocation(waiterName);\n                        writer.write(\"export * from \\\"./$L\\\";\", getModulePath(outputFilepath));\n                    });\n            }\n        }\n\n        fileManifest.writeFile(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, WAITERS_FOLDER, \"index.ts\").toString(),\n            writer.toString()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/AuthUtils.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth;\n\nimport java.nio.file.Paths;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.TreeMap;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.knowledge.ServiceIndex.AuthSchemeMode;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.Dependency;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthSchemeParameter;\nimport software.amazon.smithy.typescript.codegen.auth.http.ResolveConfigFunction;\nimport software.amazon.smithy.typescript.codegen.auth.http.SupportedHttpAuthSchemesIndex;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Auth utility methods needed across Java packages.\n */\n@SmithyInternalApi\npublic final class AuthUtils {\n\n    public static final String HTTP_AUTH_FOLDER = \"auth\";\n\n    public static final String HTTP_AUTH_SCHEME_PROVIDER_MODULE = Paths.get(\n        \".\",\n        CodegenUtils.SOURCE_FOLDER,\n        HTTP_AUTH_FOLDER,\n        \"httpAuthSchemeProvider\"\n    ).toString();\n\n    public static final String HTTP_AUTH_SCHEME_PROVIDER_PATH = HTTP_AUTH_SCHEME_PROVIDER_MODULE + \".ts\";\n\n    public static final Dependency AUTH_HTTP_PROVIDER_DEPENDENCY = new Dependency() {\n        @Override\n        public String getPackageName() {\n            return HTTP_AUTH_SCHEME_PROVIDER_MODULE;\n        }\n\n        @Override\n        public List<SymbolDependency> getDependencies() {\n            return Collections.emptyList();\n        }\n    };\n\n    public static final String HTTP_AUTH_SCHEME_EXTENSION_MODULE = Paths.get(\n        \".\",\n        CodegenUtils.SOURCE_FOLDER,\n        HTTP_AUTH_FOLDER,\n        \"httpAuthExtensionConfiguration\"\n    ).toString();\n\n    public static final String HTTP_AUTH_SCHEME_EXTENSION_PATH = HTTP_AUTH_SCHEME_EXTENSION_MODULE + \".ts\";\n\n    public static final Dependency AUTH_HTTP_EXTENSION_DEPENDENCY = new Dependency() {\n        @Override\n        public String getPackageName() {\n            return HTTP_AUTH_SCHEME_EXTENSION_MODULE;\n        }\n\n        @Override\n        public List<SymbolDependency> getDependencies() {\n            return Collections.emptyList();\n        }\n    };\n\n    private AuthUtils() {}\n\n    public static Map<ShapeId, HttpAuthScheme> getAllEffectiveNoAuthAwareAuthSchemes(\n        ServiceShape serviceShape,\n        ServiceIndex serviceIndex,\n        SupportedHttpAuthSchemesIndex authIndex,\n        TopDownIndex topDownIndex\n    ) {\n        Map<ShapeId, HttpAuthScheme> effectiveAuthSchemes = new TreeMap<>();\n        var serviceEffectiveAuthSchemes = serviceIndex.getEffectiveAuthSchemes(\n            serviceShape,\n            AuthSchemeMode.NO_AUTH_AWARE\n        );\n        for (ShapeId shapeId : serviceEffectiveAuthSchemes.keySet()) {\n            effectiveAuthSchemes.put(shapeId, authIndex.getHttpAuthScheme(shapeId));\n        }\n        for (var operation : topDownIndex.getContainedOperations(serviceShape)) {\n            var operationEffectiveAuthSchemes = serviceIndex.getEffectiveAuthSchemes(\n                serviceShape,\n                operation,\n                AuthSchemeMode.NO_AUTH_AWARE\n            );\n            for (ShapeId shapeId : operationEffectiveAuthSchemes.keySet()) {\n                effectiveAuthSchemes.put(shapeId, authIndex.getHttpAuthScheme(shapeId));\n            }\n        }\n        // TODO(experimentalIdentityAndAuth): remove after @aws.auth#sigv4a is fully supported\n        // BEGIN\n        HttpAuthScheme effectiveSigv4Scheme = effectiveAuthSchemes.get(ShapeId.from(\"aws.auth#sigv4\"));\n        HttpAuthScheme effectiveSigv4aScheme = effectiveAuthSchemes.get(ShapeId.from(\"aws.auth#sigv4a\"));\n        HttpAuthScheme supportedSigv4aScheme = authIndex.getHttpAuthScheme(ShapeId.from(\"aws.auth#sigv4a\"));\n        if (effectiveSigv4Scheme != null && effectiveSigv4aScheme == null && supportedSigv4aScheme != null) {\n            effectiveAuthSchemes.put(supportedSigv4aScheme.getSchemeId(), supportedSigv4aScheme);\n        }\n        // END\n        return effectiveAuthSchemes;\n    }\n\n    public static Map<String, ConfigField> collectConfigFields(Collection<HttpAuthScheme> httpAuthSchemes) {\n        Map<String, ConfigField> configFields = new HashMap<>();\n        for (HttpAuthScheme authScheme : httpAuthSchemes) {\n            if (authScheme == null) {\n                continue;\n            }\n            for (ConfigField configField : authScheme.getConfigFields()) {\n                if (configFields.containsKey(configField.name())) {\n                    ConfigField existingConfigField = configFields.get(configField.name());\n                    if (!configField.equals(existingConfigField)) {\n                        throw new CodegenException(\n                            \"Contradicting `ConfigField` definitions for `\" +\n                                configField.name() +\n                                \"`; existing: \" +\n                                existingConfigField +\n                                \", conflict: \" +\n                                configField\n                        );\n                    }\n                } else {\n                    configFields.put(configField.name(), configField);\n                }\n            }\n        }\n        return configFields;\n    }\n\n    public static Map<Symbol, ResolveConfigFunction> collectResolveConfigFunctions(\n        Collection<HttpAuthScheme> httpAuthSchemes\n    ) {\n        Map<Symbol, ResolveConfigFunction> resolveConfigFunctions = new HashMap<>();\n        for (HttpAuthScheme authScheme : httpAuthSchemes) {\n            if (authScheme == null) {\n                continue;\n            }\n            for (ResolveConfigFunction fn : authScheme.getResolveConfigFunctions()) {\n                if (resolveConfigFunctions.containsKey(fn.resolveConfigFunction())) {\n                    ResolveConfigFunction existingFn = resolveConfigFunctions.get(fn.resolveConfigFunction());\n                    if (!fn.equals(existingFn)) {\n                        throw new CodegenException(\n                            \"Contradicting `ResolveConfigFunction` definitions for `\" +\n                                fn.resolveConfigFunction() +\n                                \"`; existing: \" +\n                                existingFn +\n                                \", conflict: \" +\n                                fn\n                        );\n                    }\n                } else {\n                    resolveConfigFunctions.put(fn.resolveConfigFunction(), fn);\n                }\n            }\n        }\n        return resolveConfigFunctions;\n    }\n\n    public static Map<String, HttpAuthSchemeParameter> collectHttpAuthSchemeParameters(\n        Collection<HttpAuthScheme> httpAuthSchemes\n    ) {\n        Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters = new HashMap<>();\n        for (HttpAuthScheme authScheme : httpAuthSchemes) {\n            if (authScheme == null) {\n                continue;\n            }\n            for (HttpAuthSchemeParameter param : authScheme.getHttpAuthSchemeParameters()) {\n                if (httpAuthSchemeParameters.containsKey(param.name())) {\n                    HttpAuthSchemeParameter existingParam = httpAuthSchemeParameters.get(param.name());\n                    if (!param.equals(existingParam)) {\n                        throw new CodegenException(\n                            \"Contradicting `HttpAuthSchemeParameter` definitions for `\" +\n                                param.name() +\n                                \"`; existing: \" +\n                                existingParam +\n                                \", conflict: \" +\n                                param\n                        );\n                    }\n                } else {\n                    httpAuthSchemeParameters.put(param.name(), param);\n                }\n            }\n        }\n        return httpAuthSchemeParameters;\n    }\n\n    public static boolean areHttpAuthSchemesEqual(\n        Map<ShapeId, Trait> httpAuthSchemes1,\n        Map<ShapeId, Trait> httpAuthSchemes2\n    ) {\n        if (httpAuthSchemes1.size() != httpAuthSchemes2.size()) {\n            return false;\n        }\n        var iter1 = httpAuthSchemes1.entrySet().iterator();\n        var iter2 = httpAuthSchemes2.entrySet().iterator();\n        while (iter1.hasNext() && iter2.hasNext()) {\n            var entry1 = iter1.next();\n            var entry2 = iter2.next();\n            if (!entry1.equals(entry2)) {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/ConfigField.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.util.Optional;\nimport java.util.function.BiConsumer;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.ToSmithyBuilder;\n\n/**\n * Definition of a Config field.\n *\n * Currently used to populate the ClientDefaults interface.\n *\n * @param name name of the config field\n * @param type whether the config field is main or auxiliary\n * @param inputType writer for the input type of the config field\n * @param resolvedType writer for the resolved type of the config field\n * @param docs writer for the docs of the config field\n */\n@SmithyUnstableApi\npublic record ConfigField(\n    String name,\n    Type type,\n    Symbol inputType,\n    Symbol resolvedType,\n    Optional<BiConsumer<TypeScriptWriter, ConfigField>> configFieldWriter,\n    Optional<Consumer<TypeScriptWriter>> docs\n) implements ToSmithyBuilder<ConfigField> {\n    /**\n     * Defines the type of the config field.\n     */\n    @SmithyUnstableApi\n    public enum Type {\n        /**\n         * Specifies the property is important, e.g. {@code apiKey} for {@code @httpApiKeyAuth}\n         */\n        MAIN,\n        /**\n         * Specifies the property is auxiliary, e.g. {@code region} for {@code @aws.auth#sigv4}\n         */\n        AUXILIARY,\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    @Override\n    public Builder toBuilder() {\n        return builder()\n            .name(name)\n            .type(type)\n            .inputType(inputType)\n            .resolvedType(resolvedType)\n            .configFieldWriter(configFieldWriter.orElse(null))\n            .docs(docs.orElse(null));\n    }\n\n    public static final class Builder implements SmithyBuilder<ConfigField> {\n\n        private String name;\n        private Type type;\n        private Symbol inputType;\n        private Symbol resolvedType;\n        private Consumer<TypeScriptWriter> docs;\n        private BiConsumer<TypeScriptWriter, ConfigField> configFieldWriter;\n\n        @Override\n        public ConfigField build() {\n            return new ConfigField(\n                SmithyBuilder.requiredState(\"name\", name),\n                SmithyBuilder.requiredState(\"type\", type),\n                SmithyBuilder.requiredState(\"inputType\", inputType),\n                SmithyBuilder.requiredState(\"resolvedType\", resolvedType),\n                Optional.ofNullable(configFieldWriter),\n                Optional.ofNullable(docs)\n            );\n        }\n\n        public Builder name(String name) {\n            this.name = name;\n            return this;\n        }\n\n        public Builder type(Type type) {\n            this.type = type;\n            return this;\n        }\n\n        public Builder inputType(Symbol inputType) {\n            this.inputType = inputType;\n            return this;\n        }\n\n        public Builder resolvedType(Symbol resolvedType) {\n            this.resolvedType = resolvedType;\n            return this;\n        }\n\n        public Builder docs(Consumer<TypeScriptWriter> docs) {\n            this.docs = docs;\n            return this;\n        }\n\n        public Builder configFieldWriter(BiConsumer<TypeScriptWriter, ConfigField> configFieldWriter) {\n            this.configFieldWriter = configFieldWriter;\n            return this;\n        }\n    }\n\n    @SmithyInternalApi\n    public static void defaultMainConfigFieldWriter(TypeScriptWriter w, ConfigField configField) {\n        w.addDependency(TypeScriptDependency.SMITHY_CORE);\n        w.addImport(\"memoizeIdentityProvider\", null, TypeScriptDependency.SMITHY_CORE);\n        w.addImport(\"isIdentityExpired\", null, TypeScriptDependency.SMITHY_CORE);\n        w.addImport(\"doesIdentityRequireRefresh\", null, TypeScriptDependency.SMITHY_CORE);\n        w.write(\n            \"\"\"\n            const $L = memoizeIdentityProvider(config.$L, isIdentityExpired, \\\n            doesIdentityRequireRefresh);\"\"\",\n            configField.name(),\n            configField.name()\n        );\n    }\n\n    @SmithyInternalApi\n    public static void defaultAuxiliaryConfigFieldWriter(TypeScriptWriter w, ConfigField configField) {\n        w.addDependency(TypeScriptDependency.SMITHY_CORE);\n        w.addImportSubmodule(\"normalizeProvider\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        w.write(\n            \"const $L = config.$L ? normalizeProvider(config.$L) : undefined;\",\n            configField.name(),\n            configField.name(),\n            configField.name()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/HttpAuthOptionProperty.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.ToSmithyBuilder;\n\n/**\n * Definition of an HttpAuthOptionProperty.\n *\n * @param name name of the auth option property\n * @param type the type of {@link Type}\n * @param source a function that provides the auth trait to a writer, and writes\n *  properties from the trait or from {@code authParameters}.\n */\n@SmithyUnstableApi\npublic record HttpAuthOptionProperty(\n    String name,\n    Type type,\n    Function<Source, Consumer<TypeScriptWriter>> source\n) implements ToSmithyBuilder<HttpAuthOptionProperty> {\n    /**\n     * Defines the type of the auth option property.\n     */\n    public enum Type {\n        /**\n         * Specifies the property should be included in {@code identityProperties}.\n         */\n        IDENTITY,\n        /**\n         * Specifies the property should be included in {@code signingProperties}.\n         */\n        SIGNING,\n    }\n\n    public record Source(HttpAuthScheme httpAuthScheme, Trait trait) implements ToSmithyBuilder<Source> {\n        public static Builder builder() {\n            return new Builder();\n        }\n\n        @Override\n        public Builder toBuilder() {\n            return builder().httpAuthScheme(httpAuthScheme).trait(trait);\n        }\n\n        public static final class Builder implements SmithyBuilder<Source> {\n\n            HttpAuthScheme httpAuthScheme;\n            Trait trait;\n\n            @Override\n            public Source build() {\n                return new Source(\n                    SmithyBuilder.requiredState(\"httpAuthScheme\", httpAuthScheme),\n                    SmithyBuilder.requiredState(\"trait\", trait)\n                );\n            }\n\n            public Builder httpAuthScheme(HttpAuthScheme httpAuthScheme) {\n                this.httpAuthScheme = httpAuthScheme;\n                return this;\n            }\n\n            public Builder trait(Trait trait) {\n                this.trait = trait;\n                return this;\n            }\n        }\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    @Override\n    public Builder toBuilder() {\n        return builder().name(name).type(type).source(source);\n    }\n\n    public static final class Builder implements SmithyBuilder<HttpAuthOptionProperty> {\n\n        private String name;\n        private Type type;\n        private Function<Source, Consumer<TypeScriptWriter>> source;\n\n        @Override\n        public HttpAuthOptionProperty build() {\n            return new HttpAuthOptionProperty(\n                SmithyBuilder.requiredState(\"name\", name),\n                SmithyBuilder.requiredState(\"type\", type),\n                SmithyBuilder.requiredState(\"source\", source)\n            );\n        }\n\n        public Builder name(String name) {\n            this.name = name;\n            return this;\n        }\n\n        public Builder type(Type type) {\n            this.type = type;\n            return this;\n        }\n\n        public Builder source(Function<Source, Consumer<TypeScriptWriter>> source) {\n            this.source = source;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/HttpAuthScheme.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthOptionProperty.Type;\nimport software.amazon.smithy.utils.BuilderRef;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.ToSmithyBuilder;\n\n/**\n * Defines an HttpAuthScheme used in code generation.\n *\n * HttpAuthScheme defines everything needed to generate an HttpAuthSchemeProvider,\n * HttpAuthOptions, and registered HttpAuthSchemes in the IdentityProviderConfiguration.\n */\n@SmithyUnstableApi\npublic final class HttpAuthScheme implements ToSmithyBuilder<HttpAuthScheme> {\n\n    private final ShapeId schemeId;\n    private final ShapeId traitId;\n    private final ApplicationProtocol applicationProtocol;\n    private final Map<LanguageTarget, Consumer<TypeScriptWriter>> defaultIdentityProviders;\n    private final Map<LanguageTarget, Consumer<TypeScriptWriter>> defaultSigners;\n    private final List<ConfigField> configFields;\n    private final List<ResolveConfigFunction> resolveConfigFunctions;\n    private final List<HttpAuthSchemeParameter> httpAuthSchemeParameters;\n    private final List<HttpAuthOptionProperty> httpAuthOptionProperties;\n    private final Function<Symbol, Consumer<TypeScriptWriter>> propertiesExtractor;\n\n    private HttpAuthScheme(Builder builder) {\n        this.schemeId = SmithyBuilder.requiredState(\"schemeId\", builder.schemeId);\n        this.traitId = builder.traitId != null ? builder.traitId : schemeId;\n        this.applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n        this.defaultIdentityProviders = SmithyBuilder.requiredState(\n            \"defaultIdentityProviders\",\n            builder.defaultIdentityProviders.copy()\n        );\n        this.defaultSigners = SmithyBuilder.requiredState(\"defaultSigners\", builder.defaultSigners.copy());\n        this.configFields = SmithyBuilder.requiredState(\"configFields\", builder.configFields.copy());\n        this.resolveConfigFunctions = SmithyBuilder.requiredState(\n            \"resolveConfigFunctions\",\n            builder.resolveConfigFunctions.copy()\n        );\n        this.httpAuthSchemeParameters = SmithyBuilder.requiredState(\n            \"httpAuthSchemeParameters\",\n            builder.httpAuthSchemeParameters.copy()\n        );\n        this.httpAuthOptionProperties = SmithyBuilder.requiredState(\n            \"httpAuthOptionProperties\",\n            builder.httpAuthOptionProperties.copy()\n        );\n        this.propertiesExtractor = builder.propertiesExtractor;\n    }\n\n    /**\n     * Gets the scheme ID.\n     * @return schemeId\n     */\n    public ShapeId getSchemeId() {\n        return schemeId;\n    }\n\n    /**\n     * Gets the trait ID.\n     * @return traitId\n     */\n    public ShapeId getTraitId() {\n        return traitId;\n    }\n\n    /**\n     * Gets the application protocol.\n     * @return applicationProtocol\n     */\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    /**\n     * Gets the map of default {@code IdentityProvider}s for an auth scheme.\n     * @return defaultIdentityProviders\n     */\n    public Map<LanguageTarget, Consumer<TypeScriptWriter>> getDefaultIdentityProviders() {\n        return defaultIdentityProviders;\n    }\n\n    /**\n     * Gets the map of default {@code HttpSigner}s for an auth scheme.\n     * @return defaultSigners\n     */\n    public Map<LanguageTarget, Consumer<TypeScriptWriter>> getDefaultSigners() {\n        return defaultSigners;\n    }\n\n    /**\n     * Gets the list of config fields for an auth scheme.\n     * @return configFields\n     */\n    public List<ConfigField> getConfigFields() {\n        return configFields;\n    }\n\n    public List<ResolveConfigFunction> getResolveConfigFunctions() {\n        return resolveConfigFunctions;\n    }\n\n    /**\n     * Gets the list of auth scheme parameters for an auth scheme.\n     * @return httpAuthSchemeParameters\n     */\n    public List<HttpAuthSchemeParameter> getHttpAuthSchemeParameters() {\n        return httpAuthSchemeParameters;\n    }\n\n    /**\n     * Gets the list of auth option properties for an auth scheme.\n     * @return httpAuthOptionProperties\n     */\n    public List<HttpAuthOptionProperty> getHttpAuthOptionProperties() {\n        return httpAuthOptionProperties;\n    }\n\n    /**\n     * Gets the list of auth option properties by type for an auth scheme.\n     * @param type type of auth option property\n     * @return httpAuthOptionProperties filtered by type\n     */\n    public List<HttpAuthOptionProperty> getHttpAuthSchemeOptionParametersByType(Type type) {\n        return httpAuthOptionProperties\n            .stream()\n            .filter(p -> p.type().equals(type))\n            .toList();\n    }\n\n    /**\n     * Gets the writer for the config properties extractor.\n     * @return optional of config properties extractor\n     */\n    public Optional<Function<Symbol, Consumer<TypeScriptWriter>>> getPropertiesExtractor() {\n        return Optional.ofNullable(propertiesExtractor);\n    }\n\n    /**\n     * Creates a {@link Builder}.\n     * @return a builder\n     */\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    /**\n     * Converts an HttpAuthScheme to a {@link Builder}.\n     * @return a builder\n     */\n    @Override\n    public Builder toBuilder() {\n        return builder()\n            .schemeId(schemeId)\n            .traitId(traitId)\n            .applicationProtocol(applicationProtocol)\n            .defaultIdentityProviders(defaultIdentityProviders)\n            .defaultSigners(defaultSigners)\n            .configFields(configFields)\n            .resolveConfigFunctions(resolveConfigFunctions)\n            .httpAuthSchemeParameters(httpAuthSchemeParameters)\n            .httpAuthOptionProperties(httpAuthOptionProperties)\n            .propertiesExtractor(propertiesExtractor);\n    }\n\n    /**\n     * Builder for {@link HttpAuthScheme}.\n     */\n    public static final class Builder implements SmithyBuilder<HttpAuthScheme> {\n\n        private ShapeId schemeId;\n        private ShapeId traitId;\n        private ApplicationProtocol applicationProtocol;\n        private BuilderRef<Map<LanguageTarget, Consumer<TypeScriptWriter>>> defaultIdentityProviders =\n            BuilderRef.forOrderedMap();\n        private BuilderRef<Map<LanguageTarget, Consumer<TypeScriptWriter>>> defaultSigners = BuilderRef.forOrderedMap();\n        private BuilderRef<List<ConfigField>> configFields = BuilderRef.forList();\n        private BuilderRef<List<ResolveConfigFunction>> resolveConfigFunctions = BuilderRef.forList();\n        private BuilderRef<List<HttpAuthSchemeParameter>> httpAuthSchemeParameters = BuilderRef.forList();\n        private BuilderRef<List<HttpAuthOptionProperty>> httpAuthOptionProperties = BuilderRef.forList();\n        private Function<Symbol, Consumer<TypeScriptWriter>> propertiesExtractor;\n\n        private Builder() {}\n\n        @Override\n        public HttpAuthScheme build() {\n            return new HttpAuthScheme(this);\n        }\n\n        /**\n         * Sets the schemeId.\n         * @param schemeId scheme ID to set\n         * @return the builder\n         */\n        public Builder schemeId(ShapeId schemeId) {\n            this.schemeId = schemeId;\n            return this;\n        }\n\n        /**\n         * Sets the traitId.\n         * @param traitId trait ID to set\n         * @return the builder\n         */\n        public Builder traitId(ShapeId traitId) {\n            this.traitId = traitId;\n            return this;\n        }\n\n        /**\n         * Sets the applicationProtocol.\n         * @param applicationProtocol application protocol to set\n         * @return the builder\n         */\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n\n        /**\n         * Sets the defaultIdentityProviders.\n         * @param defaultIdentityProviders IdentityProviders to set\n         * @return the builder\n         */\n        public Builder defaultIdentityProviders(\n            Map<LanguageTarget, Consumer<TypeScriptWriter>> defaultIdentityProviders\n        ) {\n            this.defaultIdentityProviders.clear();\n            this.defaultIdentityProviders.get().putAll(defaultIdentityProviders);\n            return this;\n        }\n\n        /**\n         * Puts a single default identityProvider for a language target.\n         * @param languageTarget target to add identityProvider to\n         * @param identityProvider identityProvider to add\n         * @return the builder\n         */\n        public Builder putDefaultIdentityProvider(\n            LanguageTarget languageTarget,\n            Consumer<TypeScriptWriter> identityProvider\n        ) {\n            this.defaultIdentityProviders.get().put(languageTarget, identityProvider);\n            return this;\n        }\n\n        /**\n         * Removes a single default identityProvider for a language target.\n         * @param languageTarget target to remove the identityProvider from\n         * @return the builder\n         */\n        public Builder removeDefaultIdentityProvider(LanguageTarget languageTarget) {\n            this.defaultIdentityProviders.get().remove(languageTarget);\n            return this;\n        }\n\n        /**\n         * Sets the defaultSigners.\n         * @param defaultSigners HttpSigners to set\n         * @return the builder\n         */\n        public Builder defaultSigners(Map<LanguageTarget, Consumer<TypeScriptWriter>> defaultSigners) {\n            this.defaultSigners.clear();\n            this.defaultSigners.get().putAll(defaultSigners);\n            return this;\n        }\n\n        /**\n         * Puts a single default signer for a language target.\n         * @param languageTarget target to add signer to\n         * @param signer signer to add\n         * @return the builder\n         */\n        public Builder putDefaultSigner(LanguageTarget languageTarget, Consumer<TypeScriptWriter> signer) {\n            this.defaultSigners.get().put(languageTarget, signer);\n            return this;\n        }\n\n        /**\n         * Removes a single default signer for a language target.\n         * @param languageTarget target to remove the signer from\n         * @return the builder\n         */\n        public Builder removeDefaultSigner(LanguageTarget languageTarget) {\n            this.defaultSigners.get().remove(languageTarget);\n            return this;\n        }\n\n        /**\n         * Sets the configFields.\n         * @param configFields config fields to set\n         * @return the builder\n         */\n        public Builder configFields(List<ConfigField> configFields) {\n            this.configFields.clear();\n            this.configFields.get().addAll(configFields);\n            return this;\n        }\n\n        /**\n         * Adds a config field.\n         * @param configField config field to add\n         * @return the builder\n         */\n        public Builder addConfigField(ConfigField configField) {\n            this.configFields.get().add(configField);\n            return this;\n        }\n\n        /**\n         * Removes a config field by name.\n         * @param configField name of the config field to remove\n         * @return the builder\n         */\n        public Builder removeConfigField(String configField) {\n            this.configFields.get().removeIf(c -> c.name().equals(configField));\n            return this;\n        }\n\n        public Builder resolveConfigFunctions(List<ResolveConfigFunction> resolveConfigFunctions) {\n            this.resolveConfigFunctions.clear();\n            this.resolveConfigFunctions.get().addAll(resolveConfigFunctions);\n            return this;\n        }\n\n        public Builder addResolveConfigFunction(ResolveConfigFunction resolveConfigFunction) {\n            this.resolveConfigFunctions.get().add(resolveConfigFunction);\n            return this;\n        }\n\n        public Builder removeResolveConfigFunction(Symbol resolveConfigFunction) {\n            this.resolveConfigFunctions.get().removeIf(c -> c.resolveConfigFunction().equals(resolveConfigFunction));\n            return this;\n        }\n\n        /**\n         * Sets the httpAuthSchemeParameters.\n         * @param httpAuthSchemeParameters auth scheme parameters to set\n         * @return the builder\n         */\n        public Builder httpAuthSchemeParameters(List<HttpAuthSchemeParameter> httpAuthSchemeParameters) {\n            this.httpAuthSchemeParameters.clear();\n            this.httpAuthSchemeParameters.get().addAll(httpAuthSchemeParameters);\n            return this;\n        }\n\n        /**\n         * Adds an auth scheme parameter.\n         * @param httpAuthSchemeParameter parameter to add\n         * @return the builder\n         */\n        public Builder addHttpAuthSchemeParameter(HttpAuthSchemeParameter httpAuthSchemeParameter) {\n            this.httpAuthSchemeParameters.get().add(httpAuthSchemeParameter);\n            return this;\n        }\n\n        /**\n         * Removes an auth scheme parameter by name.\n         * @param httpAuthSchemeParameter name of the auth scheme parameter to remove\n         * @return the builder\n         */\n        public Builder removeHttpAuthSchemeParameter(String httpAuthSchemeParameter) {\n            this.httpAuthSchemeParameters.get().removeIf(p -> p.name().equals(httpAuthSchemeParameter));\n            return this;\n        }\n\n        /**\n         * Sets the httpAuthOptionProperties.\n         * @param httpAuthOptionProperties properties to set\n         * @return the builder\n         */\n        public Builder httpAuthOptionProperties(List<HttpAuthOptionProperty> httpAuthOptionProperties) {\n            this.httpAuthOptionProperties.clear();\n            this.httpAuthOptionProperties.get().addAll(httpAuthOptionProperties);\n            return this;\n        }\n\n        /**\n         * Adds an auth option property.\n         * @param httpAuthOptionProperty property to add\n         * @return the builder\n         */\n        public Builder addHttpAuthOptionProperty(HttpAuthOptionProperty httpAuthOptionProperty) {\n            this.httpAuthOptionProperties.get().add(httpAuthOptionProperty);\n            return this;\n        }\n\n        /**\n         * Removes an auth option property.\n         * @param httpAuthOptionProperty name of the auth option property to remove\n         * @return the builder\n         */\n        public Builder removeHttpAuthOptionProperty(String httpAuthOptionProperty) {\n            this.httpAuthOptionProperties.get().removeIf(p -> p.name().equals(httpAuthOptionProperty));\n            return this;\n        }\n\n        /**\n         * Sets the propertiesExtractor.\n         * @param propertiesExtractor writer for properties extractor\n         * @return the builder\n         */\n        public Builder propertiesExtractor(Function<Symbol, Consumer<TypeScriptWriter>> propertiesExtractor) {\n            this.propertiesExtractor = propertiesExtractor;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/HttpAuthSchemeParameter.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.util.function.Consumer;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.ToSmithyBuilder;\n\n/**\n * Definition of an HttpAuthSchemeParameter.\n *\n * Currently this is used to generate the the HttpAuthSchemeParameters interface.\n *\n * @param name name of the auth scheme parameter\n * @param type writer for the type of the auth scheme parameter\n * @param source writer for the value of the auth scheme parameter, typically from {@code context} or {@code config}\n */\n@SmithyUnstableApi\npublic record HttpAuthSchemeParameter(\n    String name,\n    Consumer<TypeScriptWriter> type,\n    Consumer<TypeScriptWriter> source\n) implements ToSmithyBuilder<HttpAuthSchemeParameter> {\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    @Override\n    public SmithyBuilder<HttpAuthSchemeParameter> toBuilder() {\n        return builder().name(name).type(type).source(source);\n    }\n\n    public static final class Builder implements SmithyBuilder<HttpAuthSchemeParameter> {\n\n        private String name;\n        private Consumer<TypeScriptWriter> type;\n        private Consumer<TypeScriptWriter> source;\n\n        @Override\n        public HttpAuthSchemeParameter build() {\n            return new HttpAuthSchemeParameter(\n                SmithyBuilder.requiredState(\"name\", name),\n                SmithyBuilder.requiredState(\"type\", type),\n                SmithyBuilder.requiredState(\"source\", source)\n            );\n        }\n\n        public Builder name(String name) {\n            this.name = name;\n            return this;\n        }\n\n        public Builder type(Consumer<TypeScriptWriter> type) {\n            this.type = type;\n            return this;\n        }\n\n        public Builder source(Consumer<TypeScriptWriter> source) {\n            this.source = source;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/HttpAuthSchemeProviderGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.nio.file.Paths;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.knowledge.ServiceIndex.AuthSchemeMode;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.ServiceBareBonesClientGenerator;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDelegator;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.AuthUtils;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthOptionProperty.Type;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.DefaultHttpAuthSchemeParametersProviderFunctionCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.DefaultHttpAuthSchemeProviderFunctionCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthOptionFunctionCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthOptionFunctionsCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthSchemeParametersInterfaceCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthSchemeParametersProviderInterfaceCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthSchemeProviderInterfaceCodeSection;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * Generator for {@code HttpAuthSchemeProvider} and corresponding interfaces.\n *\n * Code generated includes:\n *\n * - {@code $ServiceHttpAuthSchemeParameters}\n * - {@code default$ServiceHttpAuthSchemeParametersProvider}\n * - {@code create$AuthSchemeIdHttpAuthOption}\n * - {@code $ServiceHttpAuthSchemeProvider}\n * - {@code default$ServiceHttpAuthSchemeProvider}\n */\n@SmithyInternalApi\npublic class HttpAuthSchemeProviderGenerator implements Runnable {\n\n    private final TypeScriptDelegator delegator;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n\n    private final SupportedHttpAuthSchemesIndex authIndex;\n    private final ServiceIndex serviceIndex;\n    private final TopDownIndex topDownIndex;\n    private final ServiceShape serviceShape;\n    private final Symbol serviceSymbol;\n    private final String serviceName;\n    private final Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes;\n    private final Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters;\n\n    /**\n     * Create an HttpAuthSchemeProviderGenerator.\n     * @param delegator delegator\n     * @param settings settings\n     * @param model model\n     * @param symbolProvider symbolProvider\n     * @param integrations integrations\n     */\n    public HttpAuthSchemeProviderGenerator(\n        TypeScriptDelegator delegator,\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        List<TypeScriptIntegration> integrations\n    ) {\n        this.delegator = delegator;\n        this.settings = settings;\n        this.model = model;\n        this.symbolProvider = symbolProvider;\n        this.integrations = integrations;\n\n        this.authIndex = new SupportedHttpAuthSchemesIndex(integrations, model, settings);\n        this.serviceIndex = ServiceIndex.of(model);\n        this.topDownIndex = TopDownIndex.of(model);\n        this.serviceShape = settings.getService(model);\n        this.serviceSymbol = symbolProvider.toSymbol(serviceShape);\n        this.serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n        this.effectiveHttpAuthSchemes = AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(\n            serviceShape,\n            serviceIndex,\n            authIndex,\n            topDownIndex\n        );\n        this.httpAuthSchemeParameters = AuthUtils.collectHttpAuthSchemeParameters(effectiveHttpAuthSchemes.values());\n    }\n\n    @Override\n    public void run() {\n        generateHttpAuthSchemeParametersInterface();\n        generateHttpAuthSchemeParametersProviderInterface();\n        generateDefaultHttpAuthSchemeParametersProviderFunction();\n        generateHttpAuthOptionFunctions();\n        generateHttpAuthSchemeProviderInterface();\n        generateDefaultHttpAuthSchemeProviderFunction();\n    }\n\n    /*\n    import { HttpAuthSchemeParameters } from \"@smithy/types\";\n    \n    // ...\n    \n    export interface WeatherHttpAuthSchemeParameters extends HttpAuthSchemeParameters {\n    }\n    */\n    private void generateHttpAuthSchemeParametersInterface() {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n            w.pushState(\n                HttpAuthSchemeParametersInterfaceCodeSection.builder()\n                    .service(serviceShape)\n                    .settings(settings)\n                    .model(model)\n                    .symbolProvider(symbolProvider)\n                    .httpAuthSchemeParameters(httpAuthSchemeParameters)\n                    .build()\n            );\n            w.addTypeImport(\"HttpAuthSchemeParameters\", null, TypeScriptDependency.SMITHY_TYPES);\n\n            w.openCollapsibleBlock(\n                \"\"\"\n                /**\n                 * @internal\n                 */\n                export interface $LHttpAuthSchemeParameters extends HttpAuthSchemeParameters {\"\"\",\n                \"}\",\n                !httpAuthSchemeParameters.isEmpty(),\n                serviceName,\n                () -> {\n                    for (HttpAuthSchemeParameter parameter : httpAuthSchemeParameters.values()) {\n                        w.write(\"$L?: $C;\", parameter.name(), parameter.type());\n                    }\n                }\n            );\n            w.popState();\n        });\n    }\n\n    /*\n    import { HttpAuthSchemeParametersProvider } from \"@smithy/types\";\n    import { WeatherClientResolvedConfig } from \"../WeatherClient\";\n    \n    // ...\n    \n    export interface WeatherHttpAuthSchemeParametersProvider extends HttpAuthSchemeParametersProvider<\n      WeatherClientResolvedConfig,\n      HandlerExecutionContext,\n      WeatherHttpAuthSchemeParameters,\n      object\n    > {}\n    */\n    private void generateHttpAuthSchemeParametersProviderInterface() {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n            w.pushState(\n                HttpAuthSchemeParametersProviderInterfaceCodeSection.builder()\n                    .service(serviceShape)\n                    .settings(settings)\n                    .model(model)\n                    .symbolProvider(symbolProvider)\n                    .build()\n            );\n            w.addRelativeTypeImport(\n                serviceSymbol.getName() + \"ResolvedConfig\",\n                null,\n                Paths.get(\".\", serviceSymbol.getNamespace())\n            );\n            w.addTypeImport(\"HttpAuthSchemeParametersProvider\", null, TypeScriptDependency.SMITHY_TYPES);\n            w.addTypeImport(\"HandlerExecutionContext\", null, TypeScriptDependency.SMITHY_TYPES);\n            w.write(\n                \"\"\"\n                /**\n                 * @internal\n                 */\n                export interface $LHttpAuthSchemeParametersProvider\n                  extends HttpAuthSchemeParametersProvider<\n                    $LResolvedConfig,\n                    HandlerExecutionContext,\n                    $LHttpAuthSchemeParameters,\n                    object\n                  > {}\"\"\",\n                serviceName,\n                serviceSymbol.getName(),\n                serviceName\n            );\n            w.popState();\n        });\n    }\n\n    /*\n    export const defaultWeatherHttpAuthSchemeParametersProvider =\n    async (config: WeatherClientResolvedConfig, context: HandlerExecutionContext, input: object):\n    Promise<WeatherHttpAuthSchemeParameters> => {\n      return {\n        operation: getSmithyContext(context).operation as string,\n      };\n    };\n    */\n    private void generateDefaultHttpAuthSchemeParametersProviderFunction() {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n            w.pushState(\n                DefaultHttpAuthSchemeParametersProviderFunctionCodeSection.builder()\n                    .service(serviceShape)\n                    .settings(settings)\n                    .model(model)\n                    .symbolProvider(symbolProvider)\n                    .httpAuthSchemeParameters(httpAuthSchemeParameters)\n                    .build()\n            );\n            w.addRelativeTypeImport(\n                serviceSymbol.getName() + \"ResolvedConfig\",\n                null,\n                Paths.get(\".\", serviceSymbol.getNamespace())\n            );\n            w.addTypeImport(\"HandlerExecutionContext\", null, TypeScriptDependency.SMITHY_TYPES);\n            w.addDependency(TypeScriptDependency.SMITHY_CORE);\n            w.addImportSubmodule(\n                \"getSmithyContext\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CLIENT\n            );\n            w.openBlock(\n                \"\"\"\n                /**\n                 * @internal\n                 */\n                export const default$LHttpAuthSchemeParametersProvider = async (\n                  config: $LResolvedConfig,\n                  context: HandlerExecutionContext,\n                  input: object\n                ): Promise<$LHttpAuthSchemeParameters> => {\"\"\",\n                \"};\",\n                serviceName,\n                serviceSymbol.getName(),\n                serviceName,\n                () -> {\n                    w.openBlock(\"return {\", \"};\", () -> {\n                        w.write(\"operation: getSmithyContext(context).operation as string,\");\n                        for (HttpAuthSchemeParameter parameter : httpAuthSchemeParameters.values()) {\n                            w.write(\"$L: $C,\", parameter.name(), parameter.source());\n                        }\n                    });\n                }\n            );\n            w.popState();\n        });\n    }\n\n    private void generateHttpAuthOptionFunctions() {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n            w.pushState(\n                HttpAuthOptionFunctionsCodeSection.builder()\n                    .service(serviceShape)\n                    .settings(settings)\n                    .model(model)\n                    .symbolProvider(symbolProvider)\n                    .effectiveHttpAuthSchemes(effectiveHttpAuthSchemes)\n                    .build()\n            );\n            for (Entry<ShapeId, HttpAuthScheme> entry : effectiveHttpAuthSchemes.entrySet()) {\n                generateHttpAuthOptionFunction(\n                    w,\n                    HttpAuthOptionFunctionCodeSection.builder()\n                        .service(serviceShape)\n                        .settings(settings)\n                        .model(model)\n                        .symbolProvider(symbolProvider)\n                        .effectiveHttpAuthSchemes(effectiveHttpAuthSchemes)\n                        .schemeId(entry.getKey())\n                        .httpAuthScheme(entry.getValue())\n                        .build()\n                );\n            }\n            w.popState();\n        });\n    }\n\n    /*\n    import { HttpAuthOption } from \"@smithy/types\";\n    \n    // ...\n    \n    function createSmithyApiHttpApiKeyAuthHttpAuthOption(authParameters: WeatherHttpAuthSchemeParameters):\n    HttpAuthOption[] {\n        return {\n            schemeId: \"smithy.api#httpApiKeyAuth\",\n            signingProperties: {\n                name: \"Authorization\",\n                in: HttpApiKeyAuthLocation.HEADER,\n                scheme: \"\",\n            },\n        };\n    };\n    */\n    private void generateHttpAuthOptionFunction(TypeScriptWriter w, HttpAuthOptionFunctionCodeSection s) {\n        w.pushState(s);\n        ShapeId schemeId = s.getSchemeId();\n        String normalizedAuthSchemeName = normalizeAuthSchemeName(schemeId);\n        Optional<HttpAuthScheme> authSchemeOptional = s.getHttpAuthScheme();\n        w.addTypeImport(\"HttpAuthOption\", null, TypeScriptDependency.SMITHY_TYPES);\n        w.openBlock(\"\"\"\n                    function create$LHttpAuthOption(authParameters: $LHttpAuthSchemeParameters): \\\n                    HttpAuthOption {\"\"\", \"}\\n\", normalizedAuthSchemeName, serviceName, () -> {\n            w.openBlock(\"return {\", \"};\", () -> {\n                w.write(\"schemeId: $S,\", schemeId.toString());\n                // If no HttpAuthScheme is registered, there are no HttpAuthOptionProperties available.\n                if (authSchemeOptional.isEmpty()) {\n                    return;\n                }\n                HttpAuthScheme authScheme = authSchemeOptional.get();\n                Trait trait = serviceShape.findTrait(authScheme.getTraitId()).orElse(null);\n                List<HttpAuthOptionProperty> identityProperties = authScheme.getHttpAuthSchemeOptionParametersByType(\n                    Type.IDENTITY\n                );\n                if (!identityProperties.isEmpty()) {\n                    w.openBlock(\"identityProperties: {\", \"},\", () -> {\n                        for (HttpAuthOptionProperty parameter : identityProperties) {\n                            w.write(\n                                \"$L: $C,\",\n                                parameter.name(),\n                                parameter\n                                    .source()\n                                    .apply(\n                                        HttpAuthOptionProperty.Source.builder()\n                                            .httpAuthScheme(authScheme)\n                                            .trait(trait)\n                                            .build()\n                                    )\n                            );\n                        }\n                    });\n                }\n                List<HttpAuthOptionProperty> signingProperties = authScheme.getHttpAuthSchemeOptionParametersByType(\n                    Type.SIGNING\n                );\n                if (!signingProperties.isEmpty()) {\n                    w.openBlock(\"signingProperties: {\", \"},\", () -> {\n                        for (HttpAuthOptionProperty parameter : signingProperties) {\n                            w.write(\n                                \"$L: $C,\",\n                                parameter.name(),\n                                parameter\n                                    .source()\n                                    .apply(\n                                        HttpAuthOptionProperty.Source.builder()\n                                            .httpAuthScheme(authScheme)\n                                            .trait(trait)\n                                            .build()\n                                    )\n                            );\n                        }\n                    });\n                }\n                authScheme\n                    .getPropertiesExtractor()\n                    .ifPresent(\n                        extractor -> w.write(\n                            \"propertiesExtractor: $C\",\n                            extractor.apply(\n                                serviceSymbol\n                                    .toBuilder()\n                                    .name(ServiceBareBonesClientGenerator.getConfigTypeName(serviceSymbol))\n                                    .build()\n                            )\n                        )\n                    );\n            });\n        });\n        w.popState();\n    }\n\n    public static String normalizeAuthSchemeName(ShapeId shapeId) {\n        return String.join(\n            \"\",\n            Arrays.asList(shapeId.toString().split(\"[.#]\")).stream().map(StringUtils::capitalize).toList()\n        );\n    }\n\n    /*\n    import { HttpAuthSchemeProvider } from \"@smithy/types\";\n    \n    // ...\n    \n    export interface WeatherHttpAuthSchemeProvider extends HttpAuthSchemeProvider<WeatherHttpAuthSchemeParameters> {}\n    */\n    private void generateHttpAuthSchemeProviderInterface() {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n            w.pushState(\n                HttpAuthSchemeProviderInterfaceCodeSection.builder()\n                    .service(serviceShape)\n                    .settings(settings)\n                    .model(model)\n                    .symbolProvider(symbolProvider)\n                    .build()\n            );\n            w.addTypeImport(\"HttpAuthSchemeProvider\", null, TypeScriptDependency.SMITHY_TYPES);\n            w.writeDocs(\"@internal\");\n\n            String candidate =\n                \"export interface %sHttpAuthSchemeProvider extends\".formatted(serviceName) +\n                    \" HttpAuthSchemeProvider<%sHttpAuthSchemeParameters> {}\".formatted(serviceName);\n\n            if (candidate.length() <= TypeScriptWriter.LINE_WIDTH) {\n                w.write(candidate);\n            } else {\n                w.write(\n                    \"\"\"\n                    export interface $LHttpAuthSchemeProvider\n                      extends HttpAuthSchemeProvider<$LHttpAuthSchemeParameters> {}\n                    \"\"\",\n                    serviceName,\n                    serviceName\n                );\n            }\n            w.popState();\n        });\n    }\n\n    /*\n    export const defaultWeatherHttpAuthSchemeProvider: WeatherHttpAuthSchemeProvider =\n    (authParameters) => {\n        const options: HttpAuthOption[] = [];\n        switch (authParameters.operation) {\n            default: {\n                options.push(createSmithyApiHttpApiKeyAuthHttpAuthOption(authParameters));\n            };\n        };\n        return options;\n    };\n    */\n    private void generateDefaultHttpAuthSchemeProviderFunction() {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n            w.pushState(\n                DefaultHttpAuthSchemeProviderFunctionCodeSection.builder()\n                    .service(serviceShape)\n                    .settings(settings)\n                    .model(model)\n                    .symbolProvider(symbolProvider)\n                    .build()\n            );\n            w.openBlock(\"\"\"\n                        /**\n                         * @internal\n                         */\n                        export const default$LHttpAuthSchemeProvider: $LHttpAuthSchemeProvider = \\\n                        (authParameters) => {\"\"\", \"};\", serviceName, serviceName, () -> {\n                w.write(\"const options: HttpAuthOption[] = [];\");\n                w.openBlock(\"switch (authParameters.operation) {\", \"}\", () -> {\n                    var serviceAuthSchemes = serviceIndex.getEffectiveAuthSchemes(\n                        serviceShape,\n                        AuthSchemeMode.NO_AUTH_AWARE\n                    );\n                    for (OperationShape operationShape : topDownIndex.getContainedOperations(serviceShape)) {\n                        ShapeId operationShapeId = operationShape.getId();\n                        var operationAuthSchemes = serviceIndex.getEffectiveAuthSchemes(\n                            serviceShape,\n                            operationShapeId,\n                            AuthSchemeMode.NO_AUTH_AWARE\n                        );\n                        // Skip operation generation if operation auth schemes are equivalent to the default service\n                        // auth schemes.\n                        if (AuthUtils.areHttpAuthSchemesEqual(serviceAuthSchemes, operationAuthSchemes)) {\n                            continue;\n                        }\n                        w.openBlock(\"case $S: {\", \"};\", operationShapeId.getName(), () -> {\n                            operationAuthSchemes\n                                .keySet()\n                                .forEach(shapeId -> {\n                                    w.write(\n                                        \"options.push(create$LHttpAuthOption(authParameters));\",\n                                        normalizeAuthSchemeName(shapeId)\n                                    );\n                                });\n                            w.write(\"break;\");\n                        });\n                    }\n                    w.openBlock(\"default: {\", \"}\", () -> {\n                        serviceAuthSchemes\n                            .keySet()\n                            .forEach(shapeId -> {\n                                w.write(\n                                    \"options.push(create$LHttpAuthOption(authParameters));\",\n                                    normalizeAuthSchemeName(shapeId)\n                                );\n                            });\n                    });\n                });\n                w.write(\"return options;\");\n            });\n            w.popState();\n        });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/ResolveConfigFunction.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.ToSmithyBuilder;\n\n/**\n * ResolveConfigFunction.\n */\n@SmithyUnstableApi\npublic record ResolveConfigFunction(\n    Symbol resolveConfigFunction,\n    Symbol inputConfig,\n    Symbol resolvedConfig,\n    List<String> addArgs,\n    Optional<Symbol> previouslyResolved\n) implements ToSmithyBuilder<ResolveConfigFunction> {\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    @Override\n    public Builder toBuilder() {\n        return builder()\n            .resolveConfigFunction(resolveConfigFunction)\n            .inputConfig(inputConfig)\n            .resolvedConfig(resolvedConfig)\n            .addArgs(addArgs)\n            .previouslyResolved(previouslyResolved.orElse(null));\n    }\n\n    public static final class Builder implements SmithyBuilder<ResolveConfigFunction> {\n\n        private Symbol resolveConfigFunction;\n        private Symbol inputConfig;\n        private Symbol resolvedConfig;\n        private List<String> addArgs = new ArrayList<>();\n        private Symbol previouslyResolved;\n\n        @Override\n        public ResolveConfigFunction build() {\n            return new ResolveConfigFunction(\n                SmithyBuilder.requiredState(\"resolveConfigFunction\", resolveConfigFunction),\n                SmithyBuilder.requiredState(\"inputConfig\", inputConfig),\n                SmithyBuilder.requiredState(\"resolvedConfig\", resolvedConfig),\n                SmithyBuilder.requiredState(\"addArgs\", addArgs),\n                Optional.ofNullable(previouslyResolved)\n            );\n        }\n\n        public Builder resolveConfigFunction(Symbol resolveConfigFunction) {\n            this.resolveConfigFunction = resolveConfigFunction;\n            return this;\n        }\n\n        public Builder inputConfig(Symbol inputConfig) {\n            this.inputConfig = inputConfig;\n            return this;\n        }\n\n        public Builder resolvedConfig(Symbol resolvedConfig) {\n            this.resolvedConfig = resolvedConfig;\n            return this;\n        }\n\n        public Builder addArgs(List<String> args) {\n            this.addArgs = args;\n            return this;\n        }\n\n        public Builder previouslyResolved(Symbol previouslyResolved) {\n            this.previouslyResolved = previouslyResolved;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/SupportedHttpAuthSchemesIndex.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.integration.HttpAuthTypeScriptIntegration;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Index of AuthSchemes supported in code generation through integrations.\n *\n * Integrations may mutate this index to customize {@link HttpAuthScheme}\n * implementations.\n */\n@SmithyInternalApi\npublic final class SupportedHttpAuthSchemesIndex {\n\n    private final Map<ShapeId, HttpAuthScheme> supportedHttpAuthSchemes = new HashMap<>();\n\n    /**\n     * Creates an index from registered {@link HttpAuthScheme}s in {@link TypeScriptIntegration}s.\n     * @param integrations list of integrations to register HttpAuthSchemes\n     */\n    public SupportedHttpAuthSchemesIndex(\n        List<TypeScriptIntegration> integrations,\n        Model model,\n        TypeScriptSettings settings\n    ) {\n        for (TypeScriptIntegration integration : integrations) {\n            if (!(integration instanceof HttpAuthTypeScriptIntegration)) {\n                continue;\n            }\n            HttpAuthTypeScriptIntegration httpAuthIntegration = (HttpAuthTypeScriptIntegration) integration;\n            if (httpAuthIntegration.getHttpAuthScheme().isPresent()) {\n                HttpAuthScheme authScheme = httpAuthIntegration.getHttpAuthScheme().get();\n                this.putHttpAuthScheme(authScheme.getSchemeId(), authScheme);\n            }\n            httpAuthIntegration.customizeSupportedHttpAuthSchemes(this, model, settings);\n        }\n    }\n\n    /**\n     * Registers an {@link HttpAuthScheme}.\n     * @param schemeId schemeId of authScheme\n     * @param authScheme auth scheme to put\n     * @return the auth scheme that was there previously or null\n     */\n    public HttpAuthScheme putHttpAuthScheme(ShapeId schemeId, HttpAuthScheme authScheme) {\n        return supportedHttpAuthSchemes.put(schemeId, authScheme);\n    }\n\n    /**\n     * Gets an {@link HttpAuthScheme}.\n     * @param schemeId schemeId of auth scheme to get\n     * @return the auth scheme or null if not found\n     */\n    public HttpAuthScheme getHttpAuthScheme(ShapeId schemeId) {\n        return supportedHttpAuthSchemes.get(schemeId);\n    }\n\n    /**\n     * Removes an {@link HttpAuthScheme}.\n     * @param schemeId schemeId of auth scheme to remove\n     * @return the removed auth scheme or null if nothing was previously put\n     */\n    public HttpAuthScheme removeHttpAuthScheme(ShapeId schemeId) {\n        return supportedHttpAuthSchemes.remove(schemeId);\n    }\n\n    /**\n     * Gets the map of supported {@link HttpAuthScheme}s.\n     * @return supportedHttpAuthSchemes\n     */\n    public Map<ShapeId, HttpAuthScheme> getSupportedHttpAuthSchemes() {\n        return supportedHttpAuthSchemes;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.AuthUtils;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.typescript.codegen.auth.http.ResolveConfigFunction;\nimport software.amazon.smithy.typescript.codegen.auth.http.SupportedHttpAuthSchemesIndex;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthSchemeInputConfigInterfaceCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.HttpAuthSchemeResolvedConfigInterfaceCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.ResolveHttpAuthSchemeConfigFunctionCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection;\nimport software.amazon.smithy.typescript.codegen.auth.http.sections.ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin.Convention;\nimport software.amazon.smithy.typescript.codegen.sections.ClientBodyExtraCodeSection;\nimport software.amazon.smithy.typescript.codegen.util.ClientWriterConsumer;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Add config and middleware for {@code httpAuthSchemeMiddleware}.\n */\n@SmithyInternalApi\npublic final class AddHttpAuthSchemePlugin implements HttpAuthTypeScriptIntegration {\n\n    /**\n     * Integration should be skipped if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        Map<String, ClientWriterConsumer> httpAuthSchemeParametersProvider = Map.of(\n            \"httpAuthSchemeParametersProvider\",\n            AddHttpAuthSchemePlugin::httpAuthSchemeParametersProvider,\n            \"identityProviderConfigProvider\",\n            AddHttpAuthSchemePlugin::identityProviderConfigProvider\n        );\n        return List.of(\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    TypeScriptDependency.SMITHY_CORE.dependency,\n                    \"HttpAuthSchemeEndpointRuleSet\",\n                    Convention.HAS_MIDDLEWARE\n                )\n                .withAdditionalClientParams(httpAuthSchemeParametersProvider)\n                .build(),\n            RuntimeClientPlugin.builder()\n                .inputConfig(\n                    Symbol.builder()\n                        .namespace(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_MODULE, \"/\")\n                        .name(\"HttpAuthSchemeInputConfig\")\n                        .putProperty(\"typeOnly\", true)\n                        .build()\n                )\n                .resolvedConfig(\n                    Symbol.builder()\n                        .namespace(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_MODULE, \"/\")\n                        .name(\"HttpAuthSchemeResolvedConfig\")\n                        .putProperty(\"typeOnly\", true)\n                        .build()\n                )\n                .resolveFunction(\n                    Symbol.builder()\n                        .namespace(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_MODULE, \"/\")\n                        .name(\"resolveHttpAuthSchemeConfig\")\n                        .build()\n                )\n                .build()\n        );\n    }\n\n    @Override\n    public void customize(TypeScriptCodegenContext codegenContext) {\n        if (\n            !codegenContext.settings().generateClient() ||\n                codegenContext.settings().useLegacyAuth()\n                ||\n                !codegenContext.applicationProtocol().isHttpProtocol()\n        ) {\n            return;\n        }\n\n        codegenContext\n            .writerDelegator()\n            .useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_PATH, w -> {\n                SupportedHttpAuthSchemesIndex authIndex = new SupportedHttpAuthSchemesIndex(\n                    codegenContext.integrations(),\n                    codegenContext.model(),\n                    codegenContext.settings()\n                );\n                ServiceShape serviceShape = codegenContext.settings().getService(codegenContext.model());\n                ServiceIndex serviceIndex = ServiceIndex.of(codegenContext.model());\n                TopDownIndex topDownIndex = TopDownIndex.of(codegenContext.model());\n                Map<ShapeId, HttpAuthScheme> httpAuthSchemes = AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(\n                    serviceShape,\n                    serviceIndex,\n                    authIndex,\n                    topDownIndex\n                );\n                Map<String, ConfigField> configFields = AuthUtils.collectConfigFields(httpAuthSchemes.values());\n                Map<Symbol, ResolveConfigFunction> resolveConfigFunctions = AuthUtils.collectResolveConfigFunctions(\n                    httpAuthSchemes.values()\n                );\n\n                generateHttpAuthSchemeInputConfigInterface(\n                    w,\n                    HttpAuthSchemeInputConfigInterfaceCodeSection.builder()\n                        .service(serviceShape)\n                        .settings(codegenContext.settings())\n                        .model(codegenContext.model())\n                        .symbolProvider(codegenContext.symbolProvider())\n                        .integrations(codegenContext.integrations())\n                        .configFields(configFields)\n                        .resolveConfigFunctions(resolveConfigFunctions)\n                        .build()\n                );\n                generateHttpAuthSchemeResolvedConfigInterface(\n                    w,\n                    HttpAuthSchemeResolvedConfigInterfaceCodeSection.builder()\n                        .service(serviceShape)\n                        .settings(codegenContext.settings())\n                        .model(codegenContext.model())\n                        .symbolProvider(codegenContext.symbolProvider())\n                        .integrations(codegenContext.integrations())\n                        .configFields(configFields)\n                        .resolveConfigFunctions(resolveConfigFunctions)\n                        .build()\n                );\n                generateResolveHttpAuthSchemeConfigFunction(\n                    w,\n                    ResolveHttpAuthSchemeConfigFunctionCodeSection.builder()\n                        .service(serviceShape)\n                        .settings(codegenContext.settings())\n                        .model(codegenContext.model())\n                        .symbolProvider(codegenContext.symbolProvider())\n                        .integrations(codegenContext.integrations())\n                        .configFields(configFields)\n                        .resolveConfigFunctions(resolveConfigFunctions)\n                        .build()\n                );\n            });\n    }\n\n    /**\n     * Writes the httpAuthSchemeParametersProvider for input to middleware additional parameters.\n     * Example:\n     * ```typescript\n     * defaultWeatherHttpAuthSchemeParametersProvider;\n     * ```\n     */\n    private static void httpAuthSchemeParametersProvider(\n        TypeScriptWriter w,\n        ClientBodyExtraCodeSection clientBodySection\n    ) {\n        String httpAuthSchemeParametersProviderName =\n            \"default\" +\n                CodegenUtils.getServiceName(\n                    clientBodySection.getSettings(),\n                    clientBodySection.getModel(),\n                    clientBodySection.getSymbolProvider()\n                )\n                +\n                \"HttpAuthSchemeParametersProvider\";\n        w.addImport(httpAuthSchemeParametersProviderName, null, AuthUtils.AUTH_HTTP_PROVIDER_DEPENDENCY);\n        w.writeInline(httpAuthSchemeParametersProviderName);\n    }\n\n    /**\n     * Writes the identityProviderConfigProvider for input to middleware additional parameters.\n     * Example:\n     * ```typescript\n     * async (config: WeatherClientResolvedConfig) => new DefaultIdentityProviderConfig({\n     *   \"aws.auth#sigv4\": config.credentials,\n     *   \"smithy.api#httpApiKeyAuth\": config.apiKey,\n     *   \"smithy.api#httpBearerAuth\": config.token,\n     * })\n     * ```\n     */\n    private static void identityProviderConfigProvider(TypeScriptWriter w, ClientBodyExtraCodeSection s) {\n        w.addDependency(TypeScriptDependency.SMITHY_CORE);\n        w.addImport(\"DefaultIdentityProviderConfig\", null, TypeScriptDependency.SMITHY_CORE);\n\n        SupportedHttpAuthSchemesIndex authIndex = new SupportedHttpAuthSchemesIndex(\n            s.getIntegrations(),\n            s.getModel(),\n            s.getSettings()\n        );\n        ServiceIndex serviceIndex = ServiceIndex.of(s.getModel());\n        TopDownIndex topDownIndex = TopDownIndex.of(s.getModel());\n        Map<ShapeId, HttpAuthScheme> httpAuthSchemes = AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(\n            s.getService(),\n            serviceIndex,\n            authIndex,\n            topDownIndex\n        );\n\n        w.openBlock(\n            \"\"\"\n            async (config: $LResolvedConfig) =>\"\"\",\n            s.getSymbolProvider().toSymbol(s.getService()).getName()\n        );\n        w.openCollapsibleBlock(\n            \"\"\"\n            new DefaultIdentityProviderConfig({\"\"\",\n            \"})\",\n            httpAuthSchemes\n                .values()\n                .stream()\n                .filter(Objects::nonNull)\n                .anyMatch(\n                    scheme -> scheme\n                        .getConfigFields()\n                        .stream()\n                        .anyMatch(field -> field.type().equals(ConfigField.Type.MAIN))\n                ),\n            () -> {\n                for (HttpAuthScheme scheme : httpAuthSchemes.values()) {\n                    if (scheme == null) {\n                        continue;\n                    }\n                    for (ConfigField configField : scheme.getConfigFields()) {\n                        if (configField.type().equals(ConfigField.Type.MAIN)) {\n                            w.write(\"$S: config.$L,\", scheme.getSchemeId().toString(), configField.name());\n                        }\n                    }\n                }\n            }\n        );\n        // no closeBlock needed here, the caller will write the comma\n        // inline with the close of `new DefaultIdentityProviderConfig({})`\n        w.dedent();\n    }\n\n    /*\n    export interface HttpAuthSchemeInputConfig {\n      httpAuthSchemes?: HttpAuthScheme[];\n    \n      httpAuthSchemeProvider?: WeatherHttpAuthSchemeProvider;\n    \n      apiKey?: ApiKeyIdentity | ApiKeyIdentityProvider;\n    \n      token?: TokenIdentity | TokenIdentityProvider;\n    \n      region?: string | __Provider<string>;\n    \n      credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider;\n    }\n    */\n    private void generateHttpAuthSchemeInputConfigInterface(\n        TypeScriptWriter w,\n        HttpAuthSchemeInputConfigInterfaceCodeSection s\n    ) {\n        w.pushState(s);\n        Map<String, ConfigField> configFields = s.getConfigFields();\n        Map<Symbol, ResolveConfigFunction> resolveConfigFunctions = s.getResolveConfigFunctions();\n        String serviceName = CodegenUtils.getServiceName(s.getSettings(), s.getModel(), s.getSymbolProvider());\n        w.writeDocs(\"@public\");\n        w.writeInline(\"export interface HttpAuthSchemeInputConfig\");\n        if (!resolveConfigFunctions.isEmpty()) {\n            w.writeInline(\" extends \");\n            Iterator<ResolveConfigFunction> iter = resolveConfigFunctions.values().iterator();\n            while (iter.hasNext()) {\n                ResolveConfigFunction entry = iter.next();\n                w.writeInline(\"$T\", entry.inputConfig());\n                if (iter.hasNext()) {\n                    w.writeInline(\", \");\n                }\n            }\n        }\n        w.write(\" {\");\n        w.indent();\n\n        w.addTypeImport(\"Provider\", null, TypeScriptDependency.SMITHY_TYPES);\n        w.writeDocs(\n            \"\"\"\n            A comma-separated list of case-sensitive auth scheme names.\n            An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n            For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n            @public\"\"\"\n        );\n        w.write(\"authSchemePreference?: string[] | Provider<string[]>;\");\n        w.write(\"\");\n\n        w.addTypeImport(\"HttpAuthScheme\", null, TypeScriptDependency.SMITHY_TYPES);\n        w.writeDocs(\n            \"\"\"\n            Configuration of HttpAuthSchemes for a client which provides \\\n            default identity providers and signers per auth scheme.\n            @internal\"\"\"\n        );\n        w.write(\"httpAuthSchemes?: HttpAuthScheme[];\");\n        w.write(\"\");\n\n        String httpAuthSchemeProviderName = serviceName + \"HttpAuthSchemeProvider\";\n        w.writeDocs(\n            \"\"\"\n            Configuration of an HttpAuthSchemeProvider for a client which \\\n            resolves which HttpAuthScheme to use.\n            @internal\"\"\"\n        );\n        w.write(\"httpAuthSchemeProvider?: $L;\", httpAuthSchemeProviderName);\n\n        for (ConfigField configField : configFields.values()) {\n            if (configField.configFieldWriter().isPresent()) {\n                configField.docs().ifPresent(docs -> w.writeDocs(() -> w.write(\"$C\", docs)));\n                w.write(\"$L?: $T;\", configField.name(), configField.inputType());\n            }\n        }\n        w.dedent();\n        w.write(\"}\");\n        w.write(\"\");\n        w.popState();\n    }\n\n    /*\n    export interface HttpAuthSchemeResolvedConfig {\n      readonly httpAuthSchemes: HttpAuthScheme[];\n    \n      readonly httpAuthSchemeProvider: WeatherHttpAuthSchemeProvider;\n    \n      readonly apiKey?: ApiKeyIdentityProvider;\n    \n      readonly token?: TokenIdentityProvider;\n    \n      readonly region?: __Provider<string>;\n    \n      readonly credentials?: AwsCredentialIdentityProvider;\n    }\n    */\n    private void generateHttpAuthSchemeResolvedConfigInterface(\n        TypeScriptWriter w,\n        HttpAuthSchemeResolvedConfigInterfaceCodeSection s\n    ) {\n        w.pushState(s);\n        Map<String, ConfigField> configFields = s.getConfigFields();\n        Map<Symbol, ResolveConfigFunction> resolveConfigFunctions = s.getResolveConfigFunctions();\n        String serviceName = CodegenUtils.getServiceName(s.getSettings(), s.getModel(), s.getSymbolProvider());\n        w.writeDocs(\"@internal\");\n        w.writeInline(\"export interface HttpAuthSchemeResolvedConfig\");\n        if (!resolveConfigFunctions.isEmpty()) {\n            w.writeInline(\" extends \");\n            Iterator<ResolveConfigFunction> iter = resolveConfigFunctions.values().iterator();\n            while (iter.hasNext()) {\n                ResolveConfigFunction entry = iter.next();\n                w.writeInline(\"$T\", entry.resolvedConfig());\n                if (iter.hasNext()) {\n                    w.writeInline(\", \");\n                }\n            }\n        }\n        w.write(\" {\");\n        w.indent();\n\n        w.addTypeImport(\"Provider\", null, TypeScriptDependency.SMITHY_TYPES);\n        w.writeDocs(\n            \"\"\"\n            A comma-separated list of case-sensitive auth scheme names.\n            An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.\n            For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.\n            @public\"\"\"\n        );\n        w.write(\"readonly authSchemePreference: Provider<string[]>;\\n\");\n\n        w.addTypeImport(\"HttpAuthScheme\", null, TypeScriptDependency.SMITHY_TYPES);\n        w.writeDocs(\n            \"\"\"\n            Configuration of HttpAuthSchemes for a client which provides \\\n            default identity providers and signers per auth scheme.\n            @internal\"\"\"\n        );\n        w.write(\"readonly httpAuthSchemes: HttpAuthScheme[];\\n\");\n\n        String httpAuthSchemeProviderName = serviceName + \"HttpAuthSchemeProvider\";\n        w.writeDocs(\n            \"\"\"\n            Configuration of an HttpAuthSchemeProvider for a client which \\\n            resolves which HttpAuthScheme to use.\n            @internal\"\"\"\n        );\n        w.write(\"readonly httpAuthSchemeProvider: $L;\", httpAuthSchemeProviderName);\n        for (ConfigField configField : configFields.values()) {\n            if (configField.configFieldWriter().isPresent()) {\n                configField.docs().ifPresent(docs -> w.writeDocs(() -> w.write(\"$C\", docs)));\n                w.write(\"readonly $L?: $T;\", configField.name(), configField.resolvedType());\n            }\n        }\n        w.dedent();\n        w.write(\"}\");\n        w.write(\"\");\n        w.popState();\n    }\n\n    /*\n    export const resolveHttpAuthSchemeConfig = (config: HttpAuthSchemeInputConfig): HttpAuthSchemeResolvedConfig => {\n      const credentials = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh);\n      const region = config.region ? normalizeProvider(config.region) : undefined;\n      const apiKey = memoizeIdentityProvider(config.apiKey, isIdentityExpired, doesIdentityRequireRefresh);\n      const token = memoizeIdentityProvider(config.token, isIdentityExpired, doesIdentityRequireRefresh);\n      return Object.assign(config, {\n        credentials,\n        region,\n        apiKey,\n        token,\n      }) as HttpAuthSchemeResolvedConfig;\n    };\n    */\n    private void generateResolveHttpAuthSchemeConfigFunction(\n        TypeScriptWriter w,\n        ResolveHttpAuthSchemeConfigFunctionCodeSection s\n    ) {\n        w.pushState(s);\n        Map<String, ConfigField> configFields = s.getConfigFields();\n        Map<Symbol, ResolveConfigFunction> resolveConfigFunctions = s.getResolveConfigFunctions();\n        Map<Symbol, ResolveConfigFunction> previousResolvedFunctions = resolveConfigFunctions\n            .entrySet()\n            .stream()\n            .filter(e -> e.getValue().previouslyResolved().isPresent())\n            .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));\n        w.writeDocs(\"@internal\");\n        w.writeInline(\n            \"\"\"\n            export const resolveHttpAuthSchemeConfig = <T>(\n              config: T & HttpAuthSchemeInputConfig\"\"\"\n        );\n        if (!previousResolvedFunctions.isEmpty()) {\n            w.writeInline(\" & \");\n            Iterator<ResolveConfigFunction> iter = previousResolvedFunctions.values().iterator();\n            while (iter.hasNext()) {\n                ResolveConfigFunction entry = iter.next();\n                w.writeInline(\"$T\", entry.previouslyResolved().get());\n                if (iter.hasNext()) {\n                    w.writeInline(\" & \");\n                }\n            }\n        }\n        w.write(\"\");\n        w.write(\n            \"\"\"\n            ): T & HttpAuthSchemeResolvedConfig => {\"\"\"\n        );\n        w.indent();\n        w.pushState(\n            ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection.builder()\n                .service(s.getService())\n                .settings(s.getSettings())\n                .model(s.getModel())\n                .symbolProvider(s.getSymbolProvider())\n                .integrations(s.getIntegrations())\n                .configFields(configFields)\n                .build()\n        );\n        w.addDependency(TypeScriptDependency.SMITHY_CORE);\n        for (ConfigField configField : configFields.values()) {\n            configField.configFieldWriter().ifPresent(cfw -> cfw.accept(w, configField));\n        }\n        w.popState();\n        w.pushState(\n            ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection.builder()\n                .service(s.getService())\n                .settings(s.getSettings())\n                .model(s.getModel())\n                .symbolProvider(s.getSymbolProvider())\n                .integrations(s.getIntegrations())\n                .configFields(configFields)\n                .build()\n        );\n        Integer i = 0;\n        String configName = \"config\";\n        for (ResolveConfigFunction resolveConfigFunction : resolveConfigFunctions.values()) {\n            w.openCollapsibleBlock(\n                \"const config_$L = $T($L\",\n                \");\",\n                !resolveConfigFunction.addArgs().isEmpty(),\n                i,\n                resolveConfigFunction.resolveConfigFunction(),\n                configName,\n                () -> {\n                    for (String addArg : resolveConfigFunction.addArgs()) {\n                        w.writeInline(\", $L\", addArg);\n                    }\n                }\n            );\n            configName = \"config_\" + i;\n            i++;\n        }\n        w.write(\"return Object.assign($L, {\", configName).indent();\n        w.addImportSubmodule(\"normalizeProvider\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        w.write(\"authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),\");\n        for (ConfigField configField : configFields.values()) {\n            if (configField.configFieldWriter().isPresent()) {\n                w.write(\"$L,\", configField.name());\n            }\n        }\n        w.dedent().write(\"}) as T & HttpAuthSchemeResolvedConfig;\");\n        w.popState();\n        w.dedent();\n        w.write(\"};\");\n        w.popState();\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpSigningPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport static software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin.Convention.HAS_MIDDLEWARE;\n\nimport java.util.List;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Add middleware for {@code httpSigningMiddleware}.\n */\n@SmithyInternalApi\npublic class AddHttpSigningPlugin implements TypeScriptIntegration {\n\n    /**\n     * Integration should be skipped if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        return List.of(\n            RuntimeClientPlugin.builder()\n                .withConventions(TypeScriptDependency.SMITHY_CORE.dependency, \"HttpSigning\", HAS_MIDDLEWARE)\n                .build()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/HttpAuthExtensionConfigurationInterface.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport software.amazon.smithy.typescript.codegen.Dependency;\nimport software.amazon.smithy.typescript.codegen.auth.AuthUtils;\nimport software.amazon.smithy.typescript.codegen.extensions.ExtensionConfigurationInterface;\nimport software.amazon.smithy.utils.Pair;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds the corresponding interface and functions for {@code HttpAuthExtensionConfiguration}.\n */\n@SmithyInternalApi\npublic class HttpAuthExtensionConfigurationInterface implements ExtensionConfigurationInterface {\n\n    @Override\n    public Pair<String, Dependency> name() {\n        return Pair.of(\"HttpAuthExtensionConfiguration\", AuthUtils.AUTH_HTTP_EXTENSION_DEPENDENCY);\n    }\n\n    @Override\n    public Pair<String, Dependency> getExtensionConfigurationFn() {\n        return Pair.of(\"getHttpAuthExtensionConfiguration\", AuthUtils.AUTH_HTTP_EXTENSION_DEPENDENCY);\n    }\n\n    @Override\n    public Pair<String, Dependency> resolveRuntimeConfigFn() {\n        return Pair.of(\"resolveHttpAuthRuntimeConfig\", AuthUtils.AUTH_HTTP_EXTENSION_DEPENDENCY);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/HttpAuthRuntimeExtensionIntegration.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDelegator;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.AuthUtils;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.typescript.codegen.auth.http.SupportedHttpAuthSchemesIndex;\nimport software.amazon.smithy.typescript.codegen.extensions.ExtensionConfigurationInterface;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n/**\n * Adds {@link HttpAuthExtensionConfigurationInterface} to a client.\n */\n@SmithyInternalApi\npublic class HttpAuthRuntimeExtensionIntegration implements TypeScriptIntegration {\n\n    /**\n     * Integration should be skipped if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public List<ExtensionConfigurationInterface> getExtensionConfigurationInterfaces(\n        Model model,\n        TypeScriptSettings settings\n    ) {\n        return List.of(new HttpAuthExtensionConfigurationInterface());\n    }\n\n    @Override\n    public void customize(TypeScriptCodegenContext codegenContext) {\n        if (!codegenContext.settings().generateClient()) {\n            return;\n        }\n        TypeScriptDelegator delegator = codegenContext.writerDelegator();\n        SupportedHttpAuthSchemesIndex authIndex = new SupportedHttpAuthSchemesIndex(\n            codegenContext.integrations(),\n            codegenContext.model(),\n            codegenContext.settings()\n        );\n        ServiceIndex serviceIndex = ServiceIndex.of(codegenContext.model());\n        TopDownIndex topDownIndex = TopDownIndex.of(codegenContext.model());\n        String serviceName = CodegenUtils.getServiceName(\n            codegenContext.settings(),\n            codegenContext.model(),\n            codegenContext.symbolProvider()\n        );\n        ServiceShape serviceShape = codegenContext.settings().getService(codegenContext.model());\n        Map<ShapeId, HttpAuthScheme> effectiveAuthSchemes = AuthUtils.getAllEffectiveNoAuthAwareAuthSchemes(\n            serviceShape,\n            serviceIndex,\n            authIndex,\n            topDownIndex\n        );\n        Map<String, ConfigField> configFields = AuthUtils.collectConfigFields(effectiveAuthSchemes.values());\n\n        generateHttpAuthExtensionConfigurationInterface(delegator, configFields, serviceName);\n        generateHttpAuthExtensionRuntimeConfigType(delegator, configFields, serviceName);\n        generateGetHttpAuthExtensionConfigurationFunction(delegator, configFields, serviceName);\n        generateResolveHttpAuthRuntimeConfigFunction(delegator, configFields, serviceName);\n    }\n\n    /*\n    import {\n      ApiKeyIdentity,\n      ApiKeyIdentityProvider,\n      AwsCredentialsIdentity,\n      AwsCredentialIdentityProvider,\n      HttpAuthScheme,\n      TokenIdentity,\n      TokenIdentityProvider\n    } from \"@smithy/types\";\n    \n    import {\n      WeatherHttpAuthSchemeProvider\n    } from \"./httpAuthSchemeProvider\";\n    \n    // ...\n    \n    export interface HttpAuthExtensionConfiguration {\n      setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;\n      httpAuthSchemes(): HttpAuthScheme[];\n    \n      setHttpAuthSchemeProvider(httpAuthSchemeProvider: WeatherHttpAuthSchemeProvider): void;\n      httpAuthSchemeProvider(): WeatherHttpAuthSchemeProvider;\n    \n      // @aws.auth#sigv4\n      setCredentials(credentials: AwsCredentialsIdentity | AwsCredentialIdentityProvider): void;\n      credentials(): AwsCredentialsIdentity | AwsCredentialIdentityProvider | undefined;\n    \n      // @httpApiKeyAuth\n      setApiKey(apiKey: ApiKeyIdentity | ApiKeyIdentityProvider): void;\n      apiKey(): ApiKeyIdentity | ApiKeyIdentityProvider | undefined;\n    \n      // @httpBearerAuth\n      setToken(token: TokenIdentity| TokenIdentityProvider): void;\n      token(): TokenIdentity | TokenIdentityProvider | undefined;\n    }\n    */\n    private void generateHttpAuthExtensionConfigurationInterface(\n        TypeScriptDelegator delegator,\n        Map<String, ConfigField> configFields,\n        String serviceName\n    ) {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_EXTENSION_PATH, w -> {\n            w.openBlock(\"\"\"\n                        /**\n                         * @internal\n                         */\n                        export interface HttpAuthExtensionConfiguration {\"\"\", \"}\", () -> {\n                w.addTypeImport(\"HttpAuthScheme\", null, TypeScriptDependency.SMITHY_TYPES);\n                w.write(\"setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;\");\n                w.write(\"httpAuthSchemes(): HttpAuthScheme[];\");\n\n                w.addTypeImport(serviceName + \"HttpAuthSchemeProvider\", null, AuthUtils.AUTH_HTTP_PROVIDER_DEPENDENCY);\n                w.write(\n                    \"setHttpAuthSchemeProvider(httpAuthSchemeProvider: $LHttpAuthSchemeProvider): void;\",\n                    serviceName\n                );\n                w.write(\"httpAuthSchemeProvider(): $LHttpAuthSchemeProvider;\", serviceName);\n\n                List<ConfigField> mainConfigFields = configFields\n                    .values()\n                    .stream()\n                    .filter(c -> c.type().equals(ConfigField.Type.MAIN))\n                    .toList();\n                for (ConfigField configField : mainConfigFields) {\n                    String capitalizedName = StringUtils.capitalize(configField.name());\n                    w.write(\"set$L($L: $T): void;\", capitalizedName, configField.name(), configField.inputType());\n                    w.write(\"$L(): $T | undefined;\", configField.name(), configField.inputType());\n                }\n            });\n        });\n    }\n\n    /*\n    import {\n      ApiKeyIdentity,\n      ApiKeyIdentityProvider,\n      AwsCredentialsIdentity,\n      AwsCredentialIdentityProvider,\n      HttpAuthScheme,\n      TokenIdentity,\n      TokenIdentityProvider\n    } from \"@smithy/types\";\n    \n    import {\n      WeatherHttpAuthSchemeProvider\n    } from \"./httpAuthSchemeProvider\";\n    \n    // ...\n    \n    export type HttpAuthRuntimeConfig = Partial<{\n      httpAuthSchemes: HttpAuthScheme[];\n      httpAuthSchemeProvider: WeatherHttpAuthSchemeProvider;\n      // @aws.auth#sigv4\n      credentials: AwsCredentialsIdentity | AwsCredentialIdentityProvider;\n      // @httpApiKeyAuth\n      apiKey: ApiKeyIdentity | ApiKeyIdentityProvider;\n      // @httpBearerAuth\n      token: TokenIdentity | TokenIdentityProvider;\n    }>;\n    */\n    private void generateHttpAuthExtensionRuntimeConfigType(\n        TypeScriptDelegator delegator,\n        Map<String, ConfigField> configFields,\n        String serviceName\n    ) {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_EXTENSION_PATH, w -> {\n            w.openBlock(\"\"\"\n                        /**\n                         * @internal\n                         */\n                        export type HttpAuthRuntimeConfig = Partial<{\"\"\", \"}>;\", () -> {\n                w.addTypeImport(\"HttpAuthScheme\", null, TypeScriptDependency.SMITHY_TYPES);\n                w.write(\"httpAuthSchemes: HttpAuthScheme[];\");\n                w.addTypeImport(serviceName + \"HttpAuthSchemeProvider\", null, AuthUtils.AUTH_HTTP_PROVIDER_DEPENDENCY);\n                w.write(\"httpAuthSchemeProvider: $LHttpAuthSchemeProvider;\", serviceName);\n                List<ConfigField> mainConfigFields = configFields\n                    .values()\n                    .stream()\n                    .filter(c -> c.type().equals(ConfigField.Type.MAIN))\n                    .toList();\n                for (ConfigField configField : mainConfigFields) {\n                    w.write(\"$L: $T;\", configField.name(), configField.inputType());\n                }\n            });\n        });\n    }\n\n    /*\n    import {\n      ApiKeyIdentity,\n      ApiKeyIdentityProvider,\n      AwsCredentialsIdentity,\n      AwsCredentialIdentityProvider,\n      HttpAuthScheme,\n      TokenIdentity,\n      TokenIdentityProvider\n    } from \"@smithy/types\";\n    \n    import {\n      WeatherHttpAuthSchemeProvider\n    } from \"./httpAuthSchemeProvider\";\n    \n    // ...\n    \n    export const getHttpAuthExtensionConfiguration =\n      (runtimeConfig: HttpAuthRuntimeConfig): HttpAuthExtensionConfiguration => {\n      let _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;\n      let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;\n      let _credentials = runtimeConfig.credentials;\n      let _apiKey = runtimeConfig.apiKey;\n      let _token = runtimeConfig.token;\n      return {\n        setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {\n          const index = _httpAuthSchemes.findIndex(scheme => scheme.schemeId === httpAuthScheme.schemeId);\n          if (index === -1) {\n            _httpAuthSchemes.push(httpAuthScheme);\n          } else {\n            _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n          }\n        },\n        httpAuthSchemes(): HttpAuthScheme[] {\n          return _httpAuthSchemes;\n        },\n        setHttpAuthSchemeProvider(httpAuthSchemeProvider: WeatherHttpAuthSchemeProvider): void {\n          _httpAuthSchemeProvider = httpAuthSchemeProvider;\n        },\n        httpAuthSchemeProvider(): WeatherHttpAuthSchemeProvider {\n          return _httpAuthSchemeProvider;\n        },\n        // Dependent on auth traits\n        setCredentials(credentials: AwsCredentialsIdentity | AwsCredentialIdentityProvider): void {\n          _credentials = credentials;\n        },\n        credentials(): AwsCredentialsIdentity | AwsCredentialIdentityProvider | undefined {\n          return _credentials;\n        },\n        setApiKey(apiKey: ApiKeyIdentity | ApiKeyIdentityProvider): void {\n          _apiKey = apiKey;\n        },\n        apiKey(): ApiKeyIdentity | ApiKeyIdentityProvider | undefined {\n          return _apiKey;\n        },\n        setToken(token: TokenIdentity | TokenIdentityProvider): void {\n          _token = token;\n        },\n        token(): TokenIdentity | TokenIdentityProvider | undefined {\n          return _token;\n        },\n      };\n    };\n    */\n    private void generateGetHttpAuthExtensionConfigurationFunction(\n        TypeScriptDelegator delegator,\n        Map<String, ConfigField> configFields,\n        String serviceName\n    ) {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_EXTENSION_PATH, w -> {\n            w.openBlock(\"\"\"\n                        /**\n                         * @internal\n                         */\n                        export const getHttpAuthExtensionConfiguration = (\n                          runtimeConfig: HttpAuthRuntimeConfig\n                        ): HttpAuthExtensionConfiguration => {\"\"\", \"};\", () -> {\n                w.addTypeImport(\"HttpAuthScheme\", null, TypeScriptDependency.SMITHY_TYPES);\n                w.write(\"const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;\");\n                w.addTypeImport(serviceName + \"HttpAuthSchemeProvider\", null, AuthUtils.AUTH_HTTP_PROVIDER_DEPENDENCY);\n                w.write(\"let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;\");\n                List<ConfigField> mainConfigFields = configFields\n                    .values()\n                    .stream()\n                    .filter(c -> c.type().equals(ConfigField.Type.MAIN))\n                    .toList();\n                for (ConfigField configField : mainConfigFields) {\n                    w.write(\"let _$L = runtimeConfig.$L;\", configField.name(), configField.name());\n                }\n\n                w.openBlock(\"return {\", \"};\", () -> {\n                    w.write(\n                        \"\"\"\n                        setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {\n                          const index = _httpAuthSchemes.findIndex((scheme) => \\\n                        scheme.schemeId === httpAuthScheme.schemeId);\n                          if (index === -1) {\n                            _httpAuthSchemes.push(httpAuthScheme);\n                          } else {\n                            _httpAuthSchemes.splice(index, 1, httpAuthScheme);\n                          }\n                        },\n                        httpAuthSchemes(): HttpAuthScheme[] {\n                          return _httpAuthSchemes;\n                        },\"\"\"\n                    );\n                    w.write(\n                        \"\"\"\n                        setHttpAuthSchemeProvider(httpAuthSchemeProvider: $LHttpAuthSchemeProvider): void {\n                          _httpAuthSchemeProvider = httpAuthSchemeProvider;\n                        },\n                        httpAuthSchemeProvider(): $LHttpAuthSchemeProvider {\n                          return _httpAuthSchemeProvider;\n                        },\"\"\",\n                        serviceName,\n                        serviceName\n                    );\n                    for (ConfigField configField : mainConfigFields) {\n                        String capitalizedName = StringUtils.capitalize(configField.name());\n                        w.write(\n                            \"\"\"\n                            set$L($L: $T): void {\n                              _$L = $L;\n                            },\n                            $L(): $T | undefined {\n                              return _$L;\n                            },\"\"\",\n                            capitalizedName,\n                            configField.name(),\n                            configField.inputType(),\n                            configField.name(),\n                            configField.name(),\n                            configField.name(),\n                            configField.inputType(),\n                            configField.name()\n                        );\n                    }\n                });\n            });\n        });\n    }\n\n    /*\n    export const resolveHttpAuthRuntimeConfig =\n      (config: HttpAuthExtensionConfiguration): HttpAuthRuntimeConfig => {\n      return {\n        httpAuthSchemes: config.httpAuthSchemes(),\n        httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\n        // Dependent on auth traits\n        credentials: config.credentials(),\n        apiKey: config.apiKey(),\n        token: config.token(),\n      };\n    };\n    */\n    private void generateResolveHttpAuthRuntimeConfigFunction(\n        TypeScriptDelegator delegator,\n        Map<String, ConfigField> configFields,\n        String serviceName\n    ) {\n        delegator.useFileWriter(AuthUtils.HTTP_AUTH_SCHEME_EXTENSION_PATH, w -> {\n            w.openBlock(\"\"\"\n                        /**\n                         * @internal\n                         */\n                        export const resolveHttpAuthRuntimeConfig = (config: HttpAuthExtensionConfiguration): \\\n                        HttpAuthRuntimeConfig => {\"\"\", \"};\", () -> {\n                w.openBlock(\"return {\", \"};\", () -> {\n                    w.write(\"httpAuthSchemes: config.httpAuthSchemes(),\");\n                    w.write(\"httpAuthSchemeProvider: config.httpAuthSchemeProvider(),\");\n                    for (ConfigField configField : configFields.values()) {\n                        if (configField.type().equals(ConfigField.Type.MAIN)) {\n                            w.write(\"$L: config.$L(),\", configField.name(), configField.name());\n                        }\n                    }\n                });\n            });\n        });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/HttpAuthTypeScriptIntegration.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport java.util.Optional;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.typescript.codegen.auth.http.SupportedHttpAuthSchemesIndex;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Java SPI for customizing TypeScript code generation for Identity and Authentication.\n */\n@SmithyInternalApi\npublic interface HttpAuthTypeScriptIntegration extends TypeScriptIntegration {\n    /**\n     * Register an {@link HttpAuthScheme} that is used to generate the {@code HttpAuthSchemeProvider}\n     * and corresponding config field and runtime config values.\n     * @return an empty optional.\n     */\n    default Optional<HttpAuthScheme> getHttpAuthScheme() {\n        return Optional.empty();\n    }\n\n    /**\n     * Mutate an {@link SupportedHttpAuthSchemesIndex} to mutate registered {@link HttpAuthScheme}s,\n     * e.g. default {@code IdentityProvider}s and {@code HttpSigner}s.\n     * @param supportedHttpAuthSchemesIndex index to mutate.\n     * @param model model\n     * @param settings settings\n     */\n    default void customizeSupportedHttpAuthSchemes(\n        SupportedHttpAuthSchemesIndex supportedHttpAuthSchemesIndex,\n        Model model,\n        TypeScriptSettings settings\n    ) {\n        // pass\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/SupportHttpApiKeyAuth.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport java.util.Optional;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.traits.HttpApiKeyAuthTrait;\nimport software.amazon.smithy.model.traits.HttpApiKeyAuthTrait.Location;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthOptionProperty;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Support for @httpApiKeyAuth.\n */\n@SmithyInternalApi\npublic class SupportHttpApiKeyAuth implements HttpAuthTypeScriptIntegration {\n\n    private static final Consumer<TypeScriptWriter> HTTP_API_KEY_AUTH_SIGNER = w -> w.write(\n        \"new $T()\",\n        Symbol.builder()\n            .name(\"HttpApiKeyAuthSigner\")\n            .namespace(TypeScriptDependency.SMITHY_CORE.getPackageName(), \"/\")\n            .addDependency(TypeScriptDependency.SMITHY_CORE)\n            .build()\n    );\n    private static final Symbol API_KEY_IDENTITY = Symbol.builder()\n        .name(\"ApiKeyIdentity\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .putProperty(\"typeOnly\", true)\n        .build();\n    private static final Symbol API_KEY_IDENTITY_PROVIDER = Symbol.builder()\n        .name(\"ApiKeyIdentityProvider\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .putProperty(\"typeOnly\", true)\n        .build();\n    private static final Symbol HTTP_API_KEY_LOCATION = Symbol.builder()\n        .name(\"HttpApiKeyAuthLocation\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .build();\n\n    /**\n     * Integration should be skipped if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public Optional<HttpAuthScheme> getHttpAuthScheme() {\n        return Optional.of(\n            HttpAuthScheme.builder()\n                .schemeId(HttpApiKeyAuthTrait.ID)\n                .applicationProtocol(ApplicationProtocol.createDefaultHttpApplicationProtocol())\n                .addConfigField(\n                    ConfigField.builder()\n                        .name(\"apiKey\")\n                        .type(ConfigField.Type.MAIN)\n                        .docs(w -> w.write(\"The API key to use when making requests.\"))\n                        .inputType(\n                            Symbol.builder()\n                                .name(\"ApiKeyIdentity | ApiKeyIdentityProvider\")\n                                .addReference(API_KEY_IDENTITY)\n                                .addReference(API_KEY_IDENTITY_PROVIDER)\n                                .build()\n                        )\n                        .resolvedType(\n                            Symbol.builder()\n                                .name(\"ApiKeyIdentityProvider\")\n                                .addReference(API_KEY_IDENTITY_PROVIDER)\n                                .build()\n                        )\n                        .configFieldWriter(ConfigField::defaultMainConfigFieldWriter)\n                        .build()\n                )\n                .addHttpAuthOptionProperty(\n                    HttpAuthOptionProperty.builder()\n                        .name(\"name\")\n                        .type(HttpAuthOptionProperty.Type.SIGNING)\n                        .source(s -> w -> w.write(\"$S\", ((HttpApiKeyAuthTrait) s.trait()).getName()))\n                        .build()\n                )\n                .addHttpAuthOptionProperty(\n                    HttpAuthOptionProperty.builder()\n                        .name(\"in\")\n                        .type(HttpAuthOptionProperty.Type.SIGNING)\n                        .source(\n                            s -> w -> {\n                                Location in = ((HttpApiKeyAuthTrait) s.trait()).getIn();\n                                switch (in) {\n                                    case HEADER: {\n                                        w.write(\"$T.HEADER\", HTTP_API_KEY_LOCATION);\n                                        break;\n                                    }\n                                    case QUERY: {\n                                        w.write(\"$T.QUERY\", HTTP_API_KEY_LOCATION);\n                                        break;\n                                    }\n                                    default: {\n                                        throw new CodegenException(\n                                            \"Encountered unsupported `in` property on \"\n                                                + \"`@httpApiKeyAuth`: \" + in\n                                        );\n                                    }\n                                }\n                            }\n                        )\n                        .build()\n                )\n                .addHttpAuthOptionProperty(\n                    HttpAuthOptionProperty.builder()\n                        .name(\"scheme\")\n                        .type(HttpAuthOptionProperty.Type.SIGNING)\n                        .source(\n                            s -> w -> ((HttpApiKeyAuthTrait) s.trait()).getScheme()\n                                .ifPresentOrElse(\n                                    scheme -> w.write(\"$S\", scheme),\n                                    () -> w.write(\"undefined\")\n                                )\n                        )\n                        .build()\n                )\n                .putDefaultSigner(LanguageTarget.SHARED, HTTP_API_KEY_AUTH_SIGNER)\n                .build()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/SupportHttpBearerAuth.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport java.util.Optional;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.traits.HttpBearerAuthTrait;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField.Type;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Support for @httpBearerAuth.\n */\n@SmithyInternalApi\npublic final class SupportHttpBearerAuth implements HttpAuthTypeScriptIntegration {\n\n    private static final Consumer<TypeScriptWriter> HTTP_BEARER_AUTH_SIGNER = w -> w.write(\n        \"new $T()\",\n        Symbol.builder()\n            .name(\"HttpBearerAuthSigner\")\n            .namespace(TypeScriptDependency.SMITHY_CORE.getPackageName(), \"/\")\n            .addDependency(TypeScriptDependency.SMITHY_CORE)\n            .build()\n    );\n    private static final Symbol TOKEN_IDENTITY = Symbol.builder()\n        .name(\"TokenIdentity\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .build();\n    private static final Symbol TOKEN_IDENTITY_PROVIDER = Symbol.builder()\n        .name(\"TokenIdentityProvider\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .build();\n\n    /**\n     * Integration should be skipped if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public Optional<HttpAuthScheme> getHttpAuthScheme() {\n        return Optional.of(\n            HttpAuthScheme.builder()\n                .schemeId(HttpBearerAuthTrait.ID)\n                .applicationProtocol(ApplicationProtocol.createDefaultHttpApplicationProtocol())\n                .addConfigField(\n                    ConfigField.builder()\n                        .name(\"token\")\n                        .type(Type.MAIN)\n                        .docs(w -> w.write(\"The token used to authenticate requests.\"))\n                        .inputType(\n                            Symbol.builder()\n                                .name(\"TokenIdentity | TokenIdentityProvider\")\n                                .addReference(TOKEN_IDENTITY)\n                                .addReference(TOKEN_IDENTITY_PROVIDER)\n                                .build()\n                        )\n                        .resolvedType(\n                            Symbol.builder()\n                                .name(\"TokenIdentityProvider\")\n                                .addReference(TOKEN_IDENTITY_PROVIDER)\n                                .build()\n                        )\n                        .configFieldWriter(ConfigField::defaultMainConfigFieldWriter)\n                        .build()\n                )\n                .putDefaultSigner(LanguageTarget.SHARED, HTTP_BEARER_AUTH_SIGNER)\n                .build()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/SupportNoAuth.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.integration;\n\nimport java.util.Optional;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.traits.synthetic.NoAuthTrait;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Add config and middleware to support the synthetic @noAuth auth scheme.\n */\n@SmithyInternalApi\npublic final class SupportNoAuth implements HttpAuthTypeScriptIntegration {\n\n    private static final Consumer<TypeScriptWriter> NO_AUTH_IDENTITY_PROVIDER_WRITER = w -> w.write(\"async () => ({})\");\n    private static final Consumer<TypeScriptWriter> NO_AUTH_SIGNER_WRITER = w -> w.write(\n        \"new $T()\",\n        Symbol.builder()\n            .name(\"NoAuthSigner\")\n            .namespace(TypeScriptDependency.SMITHY_CORE.getPackageName(), \"/\")\n            .addDependency(TypeScriptDependency.SMITHY_CORE)\n            .build()\n    );\n\n    /**\n     * Integration should be skipped if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public Optional<HttpAuthScheme> getHttpAuthScheme() {\n        return Optional.of(\n            HttpAuthScheme.builder()\n                .schemeId(NoAuthTrait.ID)\n                .applicationProtocol(ApplicationProtocol.createDefaultHttpApplicationProtocol())\n                .putDefaultIdentityProvider(LanguageTarget.SHARED, NO_AUTH_IDENTITY_PROVIDER_WRITER)\n                .putDefaultSigner(LanguageTarget.SHARED, NO_AUTH_SIGNER_WRITER)\n                .build()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/DefaultHttpAuthSchemeParametersProviderFunctionCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthSchemeParameter;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class DefaultHttpAuthSchemeParametersProviderFunctionCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters;\n\n    private DefaultHttpAuthSchemeParametersProviderFunctionCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        httpAuthSchemeParameters = SmithyBuilder.requiredState(\n            \"httpAuthSchemeParameters\",\n            builder.httpAuthSchemeParameters\n        );\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public Map<String, HttpAuthSchemeParameter> getHttpAuthSchemeParameters() {\n        return httpAuthSchemeParameters;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<DefaultHttpAuthSchemeParametersProviderFunctionCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters;\n\n        @Override\n        public DefaultHttpAuthSchemeParametersProviderFunctionCodeSection build() {\n            return new DefaultHttpAuthSchemeParametersProviderFunctionCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder httpAuthSchemeParameters(Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters) {\n            this.httpAuthSchemeParameters = httpAuthSchemeParameters;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/DefaultHttpAuthSchemeProviderFunctionCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class DefaultHttpAuthSchemeProviderFunctionCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n\n    private DefaultHttpAuthSchemeProviderFunctionCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<DefaultHttpAuthSchemeProviderFunctionCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n\n        @Override\n        public DefaultHttpAuthSchemeProviderFunctionCodeSection build() {\n            return new DefaultHttpAuthSchemeProviderFunctionCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthOptionFunctionCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.Map;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthOptionFunctionCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes;\n    private final ShapeId schemeId;\n    private final HttpAuthScheme httpAuthScheme;\n\n    private HttpAuthOptionFunctionCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        effectiveHttpAuthSchemes = SmithyBuilder.requiredState(\n            \"effectiveHttpAuthSchemes\",\n            builder.effectiveHttpAuthSchemes\n        );\n        schemeId = SmithyBuilder.requiredState(\"schemeId\", builder.schemeId);\n        httpAuthScheme = builder.httpAuthScheme;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public Map<ShapeId, HttpAuthScheme> getEffectiveHttpAuthSchemes() {\n        return effectiveHttpAuthSchemes;\n    }\n\n    public ShapeId getSchemeId() {\n        return schemeId;\n    }\n\n    public Optional<HttpAuthScheme> getHttpAuthScheme() {\n        return Optional.ofNullable(httpAuthScheme);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthOptionFunctionCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes;\n        private ShapeId schemeId;\n        private HttpAuthScheme httpAuthScheme;\n\n        @Override\n        public HttpAuthOptionFunctionCodeSection build() {\n            return new HttpAuthOptionFunctionCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder effectiveHttpAuthSchemes(Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes) {\n            this.effectiveHttpAuthSchemes = effectiveHttpAuthSchemes;\n            return this;\n        }\n\n        public Builder schemeId(ShapeId schemeId) {\n            this.schemeId = schemeId;\n            return this;\n        }\n\n        public Builder httpAuthScheme(HttpAuthScheme httpAuthScheme) {\n            this.httpAuthScheme = httpAuthScheme;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthOptionFunctionsCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthOptionFunctionsCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes;\n\n    private HttpAuthOptionFunctionsCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        effectiveHttpAuthSchemes = SmithyBuilder.requiredState(\n            \"effectiveHttpAuthSchemes\",\n            builder.effectiveHttpAuthSchemes\n        );\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public Map<ShapeId, HttpAuthScheme> getEffectiveHttpAuthSchemes() {\n        return effectiveHttpAuthSchemes;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthOptionFunctionsCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes;\n\n        @Override\n        public HttpAuthOptionFunctionsCodeSection build() {\n            return new HttpAuthOptionFunctionsCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder effectiveHttpAuthSchemes(Map<ShapeId, HttpAuthScheme> effectiveHttpAuthSchemes) {\n            this.effectiveHttpAuthSchemes = effectiveHttpAuthSchemes;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthSchemeInputConfigInterfaceCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.ResolveConfigFunction;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthSchemeInputConfigInterfaceCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final Map<String, ConfigField> configFields;\n    private final Map<Symbol, ResolveConfigFunction> resolveConfigFunctions;\n\n    private HttpAuthSchemeInputConfigInterfaceCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        configFields = SmithyBuilder.requiredState(\"configFields\", builder.configFields);\n        resolveConfigFunctions = SmithyBuilder.requiredState(\"resolveConfigFunctions\", builder.resolveConfigFunctions);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public Map<String, ConfigField> getConfigFields() {\n        return configFields;\n    }\n\n    public Map<Symbol, ResolveConfigFunction> getResolveConfigFunctions() {\n        return resolveConfigFunctions;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthSchemeInputConfigInterfaceCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private Map<String, ConfigField> configFields;\n        private Map<Symbol, ResolveConfigFunction> resolveConfigFunctions;\n\n        @Override\n        public HttpAuthSchemeInputConfigInterfaceCodeSection build() {\n            return new HttpAuthSchemeInputConfigInterfaceCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder configFields(Map<String, ConfigField> configFields) {\n            this.configFields = configFields;\n            return this;\n        }\n\n        public Builder resolveConfigFunctions(Map<Symbol, ResolveConfigFunction> resolveConfigFunctions) {\n            this.resolveConfigFunctions = resolveConfigFunctions;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthSchemeParametersInterfaceCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthSchemeParameter;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthSchemeParametersInterfaceCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters;\n\n    private HttpAuthSchemeParametersInterfaceCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        httpAuthSchemeParameters = SmithyBuilder.requiredState(\n            \"httpAuthSchemeParameters\",\n            builder.httpAuthSchemeParameters\n        );\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public Map<String, HttpAuthSchemeParameter> getHttpAuthSchemeParameters() {\n        return httpAuthSchemeParameters;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthSchemeParametersInterfaceCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters;\n\n        @Override\n        public HttpAuthSchemeParametersInterfaceCodeSection build() {\n            return new HttpAuthSchemeParametersInterfaceCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder httpAuthSchemeParameters(Map<String, HttpAuthSchemeParameter> httpAuthSchemeParameters) {\n            this.httpAuthSchemeParameters = httpAuthSchemeParameters;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthSchemeParametersProviderInterfaceCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthSchemeParametersProviderInterfaceCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n\n    private HttpAuthSchemeParametersProviderInterfaceCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthSchemeParametersProviderInterfaceCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n\n        @Override\n        public HttpAuthSchemeParametersProviderInterfaceCodeSection build() {\n            return new HttpAuthSchemeParametersProviderInterfaceCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthSchemeProviderInterfaceCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthSchemeProviderInterfaceCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n\n    private HttpAuthSchemeProviderInterfaceCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthSchemeProviderInterfaceCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n\n        @Override\n        public HttpAuthSchemeProviderInterfaceCodeSection build() {\n            return new HttpAuthSchemeProviderInterfaceCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/HttpAuthSchemeResolvedConfigInterfaceCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.ResolveConfigFunction;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class HttpAuthSchemeResolvedConfigInterfaceCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final Map<String, ConfigField> configFields;\n    private final Map<Symbol, ResolveConfigFunction> resolveConfigFunctions;\n\n    private HttpAuthSchemeResolvedConfigInterfaceCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        configFields = SmithyBuilder.requiredState(\"configFields\", builder.configFields);\n        resolveConfigFunctions = SmithyBuilder.requiredState(\"resolveConfigFunctions\", builder.resolveConfigFunctions);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public Map<String, ConfigField> getConfigFields() {\n        return configFields;\n    }\n\n    public Map<Symbol, ResolveConfigFunction> getResolveConfigFunctions() {\n        return resolveConfigFunctions;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<HttpAuthSchemeResolvedConfigInterfaceCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private Map<String, ConfigField> configFields;\n        private Map<Symbol, ResolveConfigFunction> resolveConfigFunctions;\n\n        @Override\n        public HttpAuthSchemeResolvedConfigInterfaceCodeSection build() {\n            return new HttpAuthSchemeResolvedConfigInterfaceCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder configFields(Map<String, ConfigField> configFields) {\n            this.configFields = configFields;\n            return this;\n        }\n\n        public Builder resolveConfigFunctions(Map<Symbol, ResolveConfigFunction> resolveConfigFunctions) {\n            this.resolveConfigFunctions = resolveConfigFunctions;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/ResolveHttpAuthSchemeConfigFunctionCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.ResolveConfigFunction;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class ResolveHttpAuthSchemeConfigFunctionCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final Map<String, ConfigField> configFields;\n    private final Map<Symbol, ResolveConfigFunction> resolveConfigFunctions;\n\n    private ResolveHttpAuthSchemeConfigFunctionCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        configFields = SmithyBuilder.requiredState(\"configFields\", builder.configFields);\n        resolveConfigFunctions = SmithyBuilder.requiredState(\"resolveConfigFunctions\", builder.resolveConfigFunctions);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public Map<String, ConfigField> getConfigFields() {\n        return configFields;\n    }\n\n    public Map<Symbol, ResolveConfigFunction> getResolveConfigFunctions() {\n        return resolveConfigFunctions;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<ResolveHttpAuthSchemeConfigFunctionCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private Map<String, ConfigField> configFields;\n        private Map<Symbol, ResolveConfigFunction> resolveConfigFunctions;\n\n        @Override\n        public ResolveHttpAuthSchemeConfigFunctionCodeSection build() {\n            return new ResolveHttpAuthSchemeConfigFunctionCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder configFields(Map<String, ConfigField> configFields) {\n            this.configFields = configFields;\n            return this;\n        }\n\n        public Builder resolveConfigFunctions(Map<Symbol, ResolveConfigFunction> resolveConfigFunctions) {\n            this.resolveConfigFunctions = resolveConfigFunctions;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final Map<String, ConfigField> configFields;\n\n    private ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        configFields = SmithyBuilder.requiredState(\"configFields\", builder.configFields);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public Map<String, ConfigField> getConfigFields() {\n        return configFields;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private Map<String, ConfigField> configFields;\n\n        @Override\n        public ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection build() {\n            return new ResolveHttpAuthSchemeConfigFunctionConfigFieldsCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder configFields(Map<String, ConfigField> configFields) {\n            this.configFields = configFields;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/sections/ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.auth.http.sections;\n\nimport java.util.List;\nimport java.util.Map;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final Map<String, ConfigField> configFields;\n\n    private ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        configFields = SmithyBuilder.requiredState(\"configFields\", builder.configFields);\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public Map<String, ConfigField> getConfigFields() {\n        return configFields;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public static class Builder implements SmithyBuilder<ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection> {\n\n        private ServiceShape service;\n        private TypeScriptSettings settings;\n        private Model model;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private Map<String, ConfigField> configFields;\n\n        @Override\n        public ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection build() {\n            return new ResolveHttpAuthSchemeConfigFunctionReturnBlockCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder configFields(Map<String, ConfigField> configFields) {\n            this.configFields = configFields;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/documentation/DocumentationExampleGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.documentation;\n\nimport java.util.Comparator;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.BooleanNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.NullNode;\nimport software.amazon.smithy.model.node.NumberNode;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class DocumentationExampleGenerator {\n\n    private DocumentationExampleGenerator() {}\n\n    /**\n     * @return the ObjectNode from the curated example written as a JavaScript object literal.\n     */\n    public static String inputToJavaScriptObject(ObjectNode node) {\n        if (node == null) {\n            return \"{ /* empty */ }\";\n        }\n        return write(node, 0);\n    }\n\n    public static String outputToJavaScriptObject(ObjectNode node) {\n        if (node == null) {\n            return \"{ /* metadata only */ }\";\n        }\n        return write(node, 0);\n    }\n\n    private static String write(Node node, int indent) {\n        StringBuilder buffer = new StringBuilder();\n        String indentation = \" \".repeat(indent);\n\n        switch (node.getType()) {\n            case OBJECT -> {\n                ObjectNode objectNode = node.expectObjectNode();\n                if (objectNode.getMembers().isEmpty()) {\n                    return indentation + \"{ /* empty */ }\";\n                }\n                String membersJoined = objectNode\n                    .getMembers()\n                    .entrySet()\n                    .stream()\n                    .sorted(Comparator.comparing(entry -> entry.getKey().getValue()))\n                    .map(\n                        entry -> indentation + \"  \" + entry.getKey().getValue() + \": \"\n                            + write(entry.getValue(), indent + 2)\n                    )\n                    .collect(Collectors.joining(\",\\n\"));\n\n                return buffer\n                    .append(\"{\\n\")\n                    .append(membersJoined)\n                    .append(\"\\n\")\n                    .append(indentation)\n                    .append(\"}\")\n                    .toString();\n            }\n            case ARRAY -> {\n                ArrayNode arrayNode = node.expectArrayNode();\n                if (arrayNode.getElements().isEmpty()) {\n                    return indentation + \"[]\";\n                }\n                String membersJoined = arrayNode\n                    .getElements()\n                    .stream()\n                    .map(elementNode -> indentation + \"  \" + write(elementNode, indent + 2))\n                    .collect(Collectors.joining(\",\\n\"));\n\n                return buffer\n                    .append(\"[\\n\")\n                    .append(membersJoined)\n                    .append(\"\\n\")\n                    .append(indentation)\n                    .append(\"]\")\n                    .toString();\n            }\n            case STRING -> {\n                StringNode stringNode = node.expectStringNode();\n                if (stringNode.getValue().contains(\"\\\"\")) {\n                    return \"`\" + stringNode.getValue() + \"`\";\n                }\n                return \"\\\"\" + stringNode.getValue() + \"\\\"\";\n            }\n            case NUMBER -> {\n                NumberNode numberNode = node.expectNumberNode();\n                return numberNode.getValue().toString();\n            }\n            case BOOLEAN -> {\n                BooleanNode booleanNode = node.expectBooleanNode();\n                return booleanNode.toString();\n            }\n            case NULL -> {\n                NullNode nullNode = node.expectNullNode();\n                return nullNode.toString();\n            }\n            default -> throw new IllegalStateException(\"Unexpected value: \" + node.getType());\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/documentation/StructureExampleGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.documentation;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.EnumShape;\nimport software.amazon.smithy.model.shapes.IntEnumShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.RequiredTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\n\n/**\n * Generates a structural hint for a shape used in command documentation.\n */\npublic abstract class StructureExampleGenerator {\n\n    /**\n     * Generates an example structure for API documentation, as an\n     * automated gap filler for operations that do not have\n     * handwritten examples.\n     *\n     * Example for Athena::createPreparedStatement\n     * ```js\n     * const input = {\n     * // QueryStatement: 'STRING_VALUE', // required\n     * // StatementName: 'STRING_VALUE', // required\n     * // WorkGroup: 'STRING_VALUE', // required\n     * // Description: 'STRING_VALUE'\n     * };\n     * ```\n     */\n    public static String generateStructuralHintDocumentation(\n        Shape shape,\n        Model model,\n        boolean isComment,\n        boolean isInput\n    ) {\n        StringBuilder buffer = new StringBuilder();\n        shape(shape, buffer, model, 0, new ShapeTracker(), isInput);\n\n        // replace non-leading whitespace with single space.\n        String s = Arrays.stream(buffer.toString().split(\"\\n\"))\n            .map(line -> line.replaceAll(\"([\\\\w\\\\\\\",:\\\\[\\\\{] )\\\\s+\", \"$1\").replaceAll(\"\\\\s+$\", \"\"))\n            .collect(Collectors.joining((isComment) ? \"\\n// \" : \"\\n\"));\n\n        return ((isComment) ? \"// \" : \"\") + s.replaceAll(\",$\", \";\");\n    }\n\n    private static void structure(\n        StructureShape structureShape,\n        StringBuilder buffer,\n        Model model,\n        int indentation,\n        ShapeTracker shapeTracker,\n        boolean isInput\n    ) {\n        if (structureShape.getAllMembers().isEmpty()) {\n            append(indentation, buffer, \"{},\");\n            checkRequired(indentation, buffer, structureShape);\n        } else {\n            append(\n                indentation,\n                buffer,\n                \"{\" +\n                    (shapeTracker.getOccurrenceCount(structureShape) == 1\n                        ? \" // \" + structureShape.getId().getName()\n                        : \"\")\n            );\n            checkRequired(indentation, buffer, structureShape);\n            structureShape\n                .getAllMembers()\n                .values()\n                .forEach(member -> {\n                    append(indentation + 2, buffer, member.getMemberName() + \": \");\n                    shape(member, buffer, model, indentation + 2, shapeTracker, isInput);\n                });\n            append(indentation, buffer, \"},\\n\");\n        }\n    }\n\n    private static void union(\n        UnionShape unionShape,\n        StringBuilder buffer,\n        Model model,\n        int indentation,\n        ShapeTracker shapeTracker,\n        boolean isInput\n    ) {\n        append(\n            indentation,\n            buffer,\n            \"{\" +\n                (shapeTracker.getOccurrenceCount(unionShape) == 1 ? \" // \" + unionShape.getId().getName()\n                    : \"// \")\n                +\n                \" Union: only one key present\"\n        );\n        checkRequired(indentation, buffer, unionShape);\n        unionShape\n            .getAllMembers()\n            .values()\n            .forEach(member -> {\n                append(indentation + 2, buffer, member.getMemberName() + \": \");\n                shape(member, buffer, model, indentation + 2, shapeTracker, isInput);\n            });\n        append(indentation, buffer, \"},\\n\");\n    }\n\n    private static void shape(\n        Shape shape,\n        StringBuilder buffer,\n        Model model,\n        int indentation,\n        ShapeTracker shapeTracker,\n        boolean isInput\n    ) {\n        Shape target;\n        if (shape instanceof MemberShape) {\n            target = model.getShape(((MemberShape) shape).getTarget()).get();\n        } else {\n            target = shape;\n        }\n\n        shapeTracker.mark(target, indentation);\n        if (shapeTracker.shouldTruncate(target)) {\n            append(indentation, buffer, \"\\\"<\" + target.getId().getName() + \">\\\",\");\n            checkRequired(indentation, buffer, shape);\n        } else {\n            switch (target.getType()) {\n                case BIG_DECIMAL:\n                    append(indentation, buffer, \"Number(\\\"bigdecimal\\\"),\");\n                    break;\n                case BIG_INTEGER:\n                    append(indentation, buffer, \"Number(\\\"bigint\\\"),\");\n                    break;\n                case BLOB:\n                    if (isInput) {\n                        if (target.hasTrait(StreamingTrait.class)) {\n                            append(\n                                indentation,\n                                buffer,\n                                \"\\\"MULTIPLE_TYPES_ACCEPTED\\\", // see \\\\@smithy/types -> StreamingBlobPayloadInputTypes\"\n                            );\n                        } else {\n                            append(\n                                indentation,\n                                buffer,\n                                \"\"\"\n                                new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\"\"\"\n                            );\n                        }\n                    } else {\n                        if (target.hasTrait(StreamingTrait.class)) {\n                            append(\n                                indentation,\n                                buffer,\n                                \"\\\"<SdkStream>\\\", // see \\\\@smithy/types -> StreamingBlobPayloadOutputTypes\"\n                            );\n                        } else {\n                            append(indentation, buffer, \"new Uint8Array(),\");\n                        }\n                    }\n                    break;\n                case BOOLEAN:\n                    append(indentation, buffer, \"true || false,\");\n                    break;\n                case BYTE:\n                    append(indentation, buffer, \"0, // BYTE_VALUE\");\n                    break;\n                case DOCUMENT:\n                    append(indentation, buffer, \"\\\"DOCUMENT_VALUE\\\",\");\n                    break;\n                case DOUBLE:\n                    append(indentation, buffer, \"Number(\\\"double\\\"),\");\n                    break;\n                case FLOAT:\n                    append(indentation, buffer, \"Number(\\\"float\\\"),\");\n                    break;\n                case INTEGER:\n                    append(indentation, buffer, \"Number(\\\"int\\\"),\");\n                    break;\n                case LONG:\n                    append(indentation, buffer, \"Number(\\\"long\\\"),\");\n                    break;\n                case SHORT:\n                    append(indentation, buffer, \"Number(\\\"short\\\"),\");\n                    break;\n                case STRING:\n                    append(indentation, buffer, \"\\\"STRING_VALUE\\\",\");\n                    break;\n                case TIMESTAMP:\n                    append(indentation, buffer, \"new Date(\\\"TIMESTAMP\\\"),\");\n                    break;\n                case SET:\n                case LIST:\n                    append(\n                        indentation,\n                        buffer,\n                        \"[\" + (shapeTracker.getOccurrenceCount(target) == 1 ? \" // \" + target.getId().getName()\n                            : \"\")\n                    );\n                    checkRequired(indentation, buffer, shape);\n                    ListShape list = (ListShape) target;\n                    shape(list.getMember(), buffer, model, indentation + 2, shapeTracker, isInput);\n                    append(indentation, buffer, \"],\\n\");\n                    break;\n                case MAP:\n                    append(\n                        indentation,\n                        buffer,\n                        \"{\" + (shapeTracker.getOccurrenceCount(target) == 1 ? \" // \" + target.getId().getName()\n                            : \"\")\n                    );\n                    checkRequired(indentation, buffer, shape);\n                    append(indentation + 2, buffer, \"\\\"<keys>\\\": \");\n                    MapShape map = (MapShape) target;\n                    shape(\n                        model.getShape(map.getValue().getTarget()).get(),\n                        buffer,\n                        model,\n                        indentation + 2,\n                        shapeTracker,\n                        isInput\n                    );\n                    append(indentation, buffer, \"},\\n\");\n                    break;\n                case STRUCTURE:\n                    StructureShape structure = (StructureShape) target;\n                    structure(structure, buffer, model, indentation, shapeTracker, isInput);\n                    break;\n                case UNION:\n                    UnionShape union = (UnionShape) target;\n                    union(union, buffer, model, indentation, shapeTracker, isInput);\n                    break;\n                case ENUM:\n                    EnumShape enumShape = (EnumShape) target;\n                    String enumeration = enumShape\n                        .getEnumValues()\n                        .values()\n                        .stream()\n                        .map(s -> \"\\\"\" + s + \"\\\"\")\n                        .collect(Collectors.joining(\" || \"));\n                    append(indentation, buffer, enumeration + \",\");\n                    break;\n                case INT_ENUM:\n                    IntEnumShape intEnumShape = (IntEnumShape) target;\n                    String intEnumeration = intEnumShape\n                        .getEnumValues()\n                        .values()\n                        .stream()\n                        .map(i -> Integer.toString(i))\n                        .collect(Collectors.joining(\" || \"));\n                    append(indentation, buffer, intEnumeration + \",\");\n                    break;\n                case OPERATION:\n                case RESOURCE:\n                case SERVICE:\n                case MEMBER:\n                default:\n                    append(indentation, buffer, \"\\\"...\\\",\");\n                    break;\n            }\n\n            switch (target.getType()) {\n                case STRUCTURE:\n                case UNION:\n                case LIST:\n                case SET:\n                case MAP:\n                    break;\n                case BIG_DECIMAL:\n                case BIG_INTEGER:\n                case BLOB:\n                case BOOLEAN:\n                case BYTE:\n                case DOCUMENT:\n                case DOUBLE:\n                case ENUM:\n                case FLOAT:\n                case INTEGER:\n                case INT_ENUM:\n                case LONG:\n                case MEMBER:\n                case OPERATION:\n                case RESOURCE:\n                case SERVICE:\n                case SHORT:\n                case STRING:\n                case TIMESTAMP:\n                default:\n                    checkRequired(indentation, buffer, shape);\n                    break;\n            }\n        }\n    }\n\n    private static void checkRequired(int indentation, StringBuilder buffer, Shape shape) {\n        if (shape.hasTrait(RequiredTrait.class)) {\n            append(indentation, buffer, \" // required\\n\");\n        } else {\n            append(indentation, buffer, \"\\n\");\n        }\n    }\n\n    private static void append(int indentation, StringBuilder buffer, String tail) {\n        while (indentation-- > 0) {\n            buffer.append(\" \");\n        }\n        buffer.append(tail);\n    }\n\n    /**\n     * Tracks the depths at which a shape appears in the tree.\n     * If a shape appears at too many depths it is truncated.\n     * This handles the case of recursive shapes.\n     */\n    private static final class ShapeTracker {\n\n        private final Map<Shape, Set<Integer>> depths = new HashMap<>();\n        private final Map<Shape, Integer> occurrences = new HashMap<>();\n\n        /**\n         * Mark that a shape is observed at depth.\n         */\n        public void mark(Shape shape, int depth) {\n            if (!depths.containsKey(shape)) {\n                depths.put(shape, new HashSet<>());\n            }\n            depths.get(shape).add(depth);\n            occurrences.put(shape, occurrences.getOrDefault(shape, 0) + 1);\n        }\n\n        /**\n         * @return whether the shape should be truncated.\n         */\n        public boolean shouldTruncate(Shape shape) {\n            return ((shape instanceof MapShape ||\n                shape instanceof UnionShape\n                ||\n                shape instanceof StructureShape\n                ||\n                shape instanceof ListShape\n                ||\n                shape instanceof SetShape) &&\n                (getOccurrenceCount(shape) > 5 || getOccurrenceDepths(shape) > 2));\n        }\n\n        /**\n         * @return the number of distinct depths in which the shape appears.\n         */\n        public int getOccurrenceDepths(Shape shape) {\n            return depths.getOrDefault(shape, Collections.emptySet()).size();\n        }\n\n        /**\n         * @return total appearances of the shape.\n         */\n        public int getOccurrenceCount(Shape shape) {\n            return occurrences.getOrDefault(shape, 0);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/AddDefaultEndpointRuleSet.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport static software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin.Convention.HAS_CONFIG;\n\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.AddBuiltinPlugins;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * This class normalizes models without endpointRuleSet traits to use the same code paths as those with ruleSet,\n * to make reasoning about models easier and less variable.\n */\n@SmithyInternalApi\npublic class AddDefaultEndpointRuleSet implements TypeScriptIntegration {\n\n    public static final EndpointRuleSetTrait DEFAULT_RULESET = EndpointRuleSetTrait.builder()\n        .ruleSet(\n            Node.parse(\n                \"\"\"\n                {\n                  \"version\": \"1.0\",\n                  \"parameters\": {\n                    \"endpoint\": {\n                      \"type\": \"string\",\n                      \"builtIn\": \"SDK::Endpoint\",\n                      \"documentation\": \"Endpoint used for making requests. Should be formatted as a URI.\"\n                    }\n                  },\n                  \"rules\": [\n                    {\n                      \"conditions\": [\n                        {\n                          \"fn\": \"isSet\",\n                          \"argv\": [\n                            {\n                              \"ref\": \"endpoint\"\n                            }\n                          ]\n                        }\n                      ],\n                      \"endpoint\": {\n                        \"url\": {\n                          \"ref\": \"endpoint\"\n                        }\n                      },\n                      \"type\": \"endpoint\"\n                    },\n                    {\n                      \"conditions\": [],\n                      \"error\": \"(default endpointRuleSet) endpoint is not set - you must configure an endpoint.\",\n                      \"type\": \"error\"\n                    }\n                  ]\n                }\n                \"\"\"\n            )\n        )\n        .build();\n\n    private boolean usesDefaultEndpointRuleset = false;\n\n    @Override\n    public List<String> runAfter() {\n        return List.of(AddBuiltinPlugins.class.getCanonicalName());\n    }\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        RuntimeClientPlugin endpointConfigResolver = RuntimeClientPlugin.builder()\n            .withConventions(\n                \"@smithy/core/endpoints\",\n                TypeScriptDependency.SMITHY_CORE.dependency.getVersion(),\n                \"Endpoint\",\n                HAS_CONFIG\n            )\n            .build();\n\n        if (usesDefaultEndpointRuleset) {\n            return List.of(\n                endpointConfigResolver,\n                RuntimeClientPlugin.builder()\n                    .withConventions(\n                        \"@smithy/core/endpoints\",\n                        TypeScriptDependency.SMITHY_CORE.dependency.getVersion(),\n                        \"EndpointRequired\",\n                        HAS_CONFIG\n                    )\n                    .build()\n            );\n        }\n        return List.of(endpointConfigResolver);\n    }\n\n    @Override\n    public Model preprocessModel(Model model, TypeScriptSettings settings) {\n        Model.Builder modelBuilder = model.toBuilder();\n\n        ServiceShape serviceShape = settings.getService(model);\n        if (!serviceShape.hasTrait(EndpointRuleSetTrait.class)) {\n            usesDefaultEndpointRuleset = true;\n            modelBuilder.removeShape(serviceShape.toShapeId());\n            modelBuilder.addShape(serviceShape.toBuilder().addTrait(DEFAULT_RULESET).build());\n        }\n\n        return modelBuilder.build();\n    }\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        if (!settings.generateClient()) {\n            return Collections.emptyMap();\n        }\n        if (target == LanguageTarget.SHARED) {\n            return MapUtils.of(\"endpointProvider\", writer -> {\n                writer.addImport(\n                    \"defaultEndpointResolver\",\n                    null,\n                    Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"endpoint/endpointResolver\").toString()\n                );\n                writer.write(\"defaultEndpointResolver\");\n            });\n        }\n        return Collections.emptyMap();\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/ClientConfigKeys.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.concurrent.ConcurrentHashMap;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Manages known client configuration keys that should not be placed in\n * clientContextParams.\n */\n@SmithyInternalApi\npublic final class ClientConfigKeys {\n    private static final Set<String> KNOWN_CONFIG_KEYS = ConcurrentHashMap.newKeySet();\n\n    static {\n        // Initialize with common client config keys\n        KNOWN_CONFIG_KEYS.add(\"profile\");\n        KNOWN_CONFIG_KEYS.add(\"apiKey\");\n        KNOWN_CONFIG_KEYS.add(\"region\");\n        KNOWN_CONFIG_KEYS.add(\"credentials\");\n        KNOWN_CONFIG_KEYS.add(\"endpoint\");\n        KNOWN_CONFIG_KEYS.add(\"cacheMiddleware\");\n        KNOWN_CONFIG_KEYS.add(\"requestHandler\");\n        KNOWN_CONFIG_KEYS.add(\"retryStrategy\");\n        KNOWN_CONFIG_KEYS.add(\"retryMode\");\n        KNOWN_CONFIG_KEYS.add(\"maxAttempts\");\n        KNOWN_CONFIG_KEYS.add(\"logger\");\n        KNOWN_CONFIG_KEYS.add(\"signer\");\n        KNOWN_CONFIG_KEYS.add(\"useDualstackEndpoint\");\n        KNOWN_CONFIG_KEYS.add(\"useFipsEndpoint\");\n        KNOWN_CONFIG_KEYS.add(\"customUserAgent\");\n        KNOWN_CONFIG_KEYS.add(\"extensions\");\n        KNOWN_CONFIG_KEYS.add(\"tls\");\n        KNOWN_CONFIG_KEYS.add(\"disableHostPrefix\");\n        KNOWN_CONFIG_KEYS.add(\"signingRegion\");\n        KNOWN_CONFIG_KEYS.add(\"sigv4aSigningRegionSet\");\n        KNOWN_CONFIG_KEYS.add(\"authSchemePreference\");\n        KNOWN_CONFIG_KEYS.add(\"userAgentAppId\");\n        KNOWN_CONFIG_KEYS.add(\"protocol\");\n        KNOWN_CONFIG_KEYS.add(\"apiVersion\");\n        KNOWN_CONFIG_KEYS.add(\"serviceId\");\n        KNOWN_CONFIG_KEYS.add(\"runtime\");\n        KNOWN_CONFIG_KEYS.add(\"systemClockOffset\");\n        KNOWN_CONFIG_KEYS.add(\"signerConstructor\");\n        KNOWN_CONFIG_KEYS.add(\"endpointProvider\");\n        KNOWN_CONFIG_KEYS.add(\"urlParser\");\n        KNOWN_CONFIG_KEYS.add(\"base64Decoder\");\n        KNOWN_CONFIG_KEYS.add(\"base64Encoder\");\n        KNOWN_CONFIG_KEYS.add(\"defaultsMode\");\n        KNOWN_CONFIG_KEYS.add(\"bodyLengthChecker\");\n        KNOWN_CONFIG_KEYS.add(\"credentialDefaultProvider\");\n        KNOWN_CONFIG_KEYS.add(\"defaultUserAgentProvider\");\n        KNOWN_CONFIG_KEYS.add(\"eventStreamSerdeProvider\");\n        KNOWN_CONFIG_KEYS.add(\"getAwsChunkedEncodingStream\");\n        KNOWN_CONFIG_KEYS.add(\"md5\");\n        KNOWN_CONFIG_KEYS.add(\"sdkStreamMixin\");\n        KNOWN_CONFIG_KEYS.add(\"sha1\");\n        KNOWN_CONFIG_KEYS.add(\"sha256\");\n        KNOWN_CONFIG_KEYS.add(\"streamCollector\");\n        KNOWN_CONFIG_KEYS.add(\"streamHasher\");\n        KNOWN_CONFIG_KEYS.add(\"utf8Decoder\");\n        KNOWN_CONFIG_KEYS.add(\"utf8Encoder\");\n        KNOWN_CONFIG_KEYS.add(\"httpAuthSchemes\");\n        KNOWN_CONFIG_KEYS.add(\"httpAuthSchemeProvider\");\n        KNOWN_CONFIG_KEYS.add(\"serviceConfiguredEndpoint\");\n    }\n\n    private ClientConfigKeys() {\n        // Utility class\n    }\n\n    /**\n     * Add a configuration key to the known set.\n     *\n     * @param key the configuration key to add\n     */\n    public static void addConfigKey(String key) {\n        KNOWN_CONFIG_KEYS.add(key);\n    }\n\n    /**\n     * Check if a key is a known configuration key.\n     *\n     * @param key the configuration key to check\n     * @return true if the key is known\n     */\n    public static boolean isKnownConfigKey(String key) {\n        return KNOWN_CONFIG_KEYS.contains(key);\n    }\n\n    /**\n     * Get custom context parameters by filtering out built-in and known config\n     * keys.\n     *\n     * @param clientContextParams all client context parameters\n     * @param builtInParams       built-in parameters\n     * @return filtered custom context parameters\n     */\n    public static Map<String, String> getCustomContextParams(\n        Map<String, String> clientContextParams,\n        Map<String, String> builtInParams\n    ) {\n        Map<String, String> customContextParams = new java.util.HashMap<>();\n        for (Map.Entry<String, String> entry : clientContextParams.entrySet()) {\n            if (\n                !builtInParams.containsKey(entry.getKey())\n                    && !KNOWN_CONFIG_KEYS.contains(entry.getKey())\n            ) {\n                customContextParams.put(entry.getKey(), entry.getValue());\n            }\n        }\n        return customContextParams;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/ConditionSerializer.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.Optional;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Condition;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic class ConditionSerializer {\n    private final Condition condition;\n\n    public ConditionSerializer(Condition condition) {\n        this.condition = condition;\n    }\n\n    public ArrayNode toArrayNode() {\n        ObjectNode node = condition.toNode().expectObjectNode();\n\n        StringNode fn = node.expectStringMember(\"fn\");\n        ArrayNode argv = node.expectArrayMember(\"argv\");\n        Optional<StringNode> assign = node.getStringMember(\"assign\");\n\n        return assign.map(stringNode -> ArrayNode.fromNodes(fn, argv, stringNode))\n            .orElse(ArrayNode.fromNodes(fn, argv));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/ConvertBdd.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.rulesengine.language.EndpointRuleSet;\nimport software.amazon.smithy.rulesengine.logic.bdd.CostOptimization;\nimport software.amazon.smithy.rulesengine.logic.bdd.NodeReversal;\nimport software.amazon.smithy.rulesengine.logic.bdd.SiftingOptimization;\nimport software.amazon.smithy.rulesengine.logic.cfg.Cfg;\nimport software.amazon.smithy.rulesengine.traits.EndpointBddTrait;\nimport software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * We use this to convert the endpointRuleSet into BDD only when the\n * model does not have the trait already, and the available transforms were not applied.\n */\n@SmithyUnstableApi\n@SmithyInternalApi\npublic final class ConvertBdd {\n    private ConvertBdd() {}\n\n    public static EndpointBddTrait convert(Model model, TypeScriptSettings settings) {\n        ServiceShape service = settings.getService(model);\n        EndpointRuleSetTrait ruleSetTrait = service.expectTrait(EndpointRuleSetTrait.class);\n        EndpointRuleSet ruleSet = ruleSetTrait.getEndpointRuleSet();\n\n        Cfg cfg = Cfg.from(ruleSet);\n        EndpointBddTrait bddTrait = EndpointBddTrait.from(cfg);\n        bddTrait = SiftingOptimization.builder().cfg(cfg).build().apply(bddTrait);\n        bddTrait = CostOptimization.builder().cfg(cfg).build().apply(bddTrait);\n        bddTrait = new NodeReversal().apply(bddTrait);\n\n        return bddTrait;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsParamNameMap.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * Map of EndpointsV2 canonical ruleset param name to generated code param names.\n * This allows continuity for parameter names that were decided prior to EndpointsV2\n * and differ from their EndpointsV2 name.\n */\npublic final class EndpointsParamNameMap {\n\n    private static final Map<String, String> MAPPING = new HashMap<>();\n\n    private EndpointsParamNameMap() {}\n\n    public static void setNameMapping(Map<String, String> parameterNameMap) {\n        EndpointsParamNameMap.MAPPING.clear();\n        MAPPING.putAll(parameterNameMap);\n    }\n\n    public static void addNameMapping(Map<String, String> parameterNameMap) {\n        MAPPING.putAll(parameterNameMap);\n    }\n\n    public static String getLocalName(String endpointsV2ParamName) {\n        boolean isTitleCase = false;\n        if (endpointsV2ParamName.length() >= 2) {\n            String char1 = endpointsV2ParamName.substring(0, 1);\n            String char2 = endpointsV2ParamName.substring(1, 2);\n            if (char1.toUpperCase().equals(char1) && char2.toLowerCase().equals(char2)) {\n                isTitleCase = true;\n            }\n        }\n\n        String suggestedName = endpointsV2ParamName;\n        if (isTitleCase) {\n            suggestedName = endpointsV2ParamName.substring(0, 1).toLowerCase() + endpointsV2ParamName.substring(1);\n        }\n\n        return MAPPING.getOrDefault(endpointsV2ParamName, suggestedName);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2Generator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Condition;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Rule;\nimport software.amazon.smithy.rulesengine.logic.bdd.Bdd;\nimport software.amazon.smithy.rulesengine.traits.EndpointBddTrait;\nimport software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.Dependency;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDelegator;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.util.PatternDetectionCompression;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates a service endpoint resolver.\n */\n@SmithyInternalApi\npublic final class EndpointsV2Generator implements Runnable {\n\n    public static final String ENDPOINT_FOLDER = \"endpoint\";\n    public static final String ENDPOINT_PARAMETERS_MODULE_NAME = \"EndpointParameters\";\n    public static final String ENDPOINT_RESOLVER_MODULE_NAME = \"endpointResolver\";\n    public static final String ENDPOINT_PARAMETERS_MODULE = Paths.get(\n        \".\",\n        CodegenUtils.SOURCE_FOLDER,\n        EndpointsV2Generator.ENDPOINT_FOLDER,\n        EndpointsV2Generator.ENDPOINT_PARAMETERS_MODULE_NAME\n    ).toString();\n    public static final Dependency ENDPOINT_PARAMETERS_DEPENDENCY = new Dependency() {\n        @Override\n        public String getPackageName() {\n            return ENDPOINT_PARAMETERS_MODULE;\n        }\n\n        @Override\n        public List<SymbolDependency> getDependencies() {\n            return Collections.emptyList();\n        }\n    };\n    public static final String ENDPOINT_RESOLVER_MODULE = Paths.get(\n        \".\",\n        CodegenUtils.SOURCE_FOLDER,\n        EndpointsV2Generator.ENDPOINT_FOLDER,\n        EndpointsV2Generator.ENDPOINT_RESOLVER_MODULE_NAME\n    ).toString();\n    public static final Dependency ENDPOINT_RESOLVER_DEPENDENCY = new Dependency() {\n        @Override\n        public String getPackageName() {\n            return ENDPOINT_RESOLVER_MODULE;\n        }\n\n        @Override\n        public List<SymbolDependency> getDependencies() {\n            return Collections.emptyList();\n        }\n    };\n\n    static final String ENDPOINT_PARAMETERS_FILE = ENDPOINT_PARAMETERS_MODULE_NAME + \".ts\";\n    static final String ENDPOINT_RESOLVER_FILE = ENDPOINT_RESOLVER_MODULE_NAME + \".ts\";\n    static final String ENDPOINT_RULESET_FILE = \"ruleset.ts\";\n    static final String ENDPOINT_BDD_FILE = \"bdd.ts\";\n\n    private final TypeScriptDelegator delegator;\n    private final EndpointRuleSetTrait endpointRuleSetTrait;\n    private final EndpointBddTrait endpointBddTrait;\n    private final ServiceShape service;\n    private final TypeScriptSettings settings;\n    private final RuleSetParameterFinder ruleSetParameterFinder;\n\n    public EndpointsV2Generator(TypeScriptDelegator delegator, TypeScriptSettings settings, Model model) {\n        this.delegator = delegator;\n        service = settings.getService(model);\n        this.settings = settings;\n        endpointRuleSetTrait = service\n            .getTrait(EndpointRuleSetTrait.class)\n            .orElseThrow(() -> new RuntimeException(\"service or model preprocessor missing EndpointRuleSetTrait\"));\n        endpointBddTrait = service.getTrait(EndpointBddTrait.class).orElse(ConvertBdd.convert(model, settings));\n        ruleSetParameterFinder = new RuleSetParameterFinder(service);\n    }\n\n    @Override\n    public void run() {\n        generateEndpointParameters();\n        generateEndpointResolver();\n        if (settings.generateEndpointBdd()) {\n            generateEndpointBdd();\n        } else {\n            generateEndpointRuleset();\n        }\n    }\n\n    /**\n     * Generate the EndpointParameters interface file specific to this service.\n     */\n    private void generateEndpointParameters() {\n        this.delegator.useFileWriter(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, ENDPOINT_FOLDER, ENDPOINT_PARAMETERS_FILE).toString(),\n            writer -> {\n                writer.addTypeImport(\"EndpointParameters\", \"__EndpointParameters\", TypeScriptDependency.SMITHY_TYPES);\n                writer.addTypeImport(\"Provider\", null, TypeScriptDependency.SMITHY_TYPES);\n                Map<String, String> clientContextParams =\n                    ruleSetParameterFinder.getClientContextParams();\n                Map<String, String> builtInParams = ruleSetParameterFinder.getBuiltInParams();\n                builtInParams.keySet().removeIf(OmitEndpointParams::isOmitted);\n                Map<String, String> customContextParams = ClientConfigKeys.getCustomContextParams(\n                    clientContextParams,\n                    builtInParams\n                );\n\n                writer.writeDocs(\"@public\");\n                writer.openBlock(\n                    \"export interface ClientInputEndpointParameters {\",\n                    \"}\",\n                    () -> {\n                        // Only include client context params that are NOT built-ins\n                        Map<String, String> clientContextParamsExcludingBuiltIns = new HashMap<>(clientContextParams);\n                        clientContextParamsExcludingBuiltIns.keySet().removeAll(builtInParams.keySet());\n                        if (!clientContextParamsExcludingBuiltIns.isEmpty()) {\n                            writer.write(\"clientContextParams?: {\");\n                            writer.indent();\n                            ObjectNode ruleSet = endpointRuleSetTrait.getRuleSet().expectObjectNode();\n                            ruleSet.getObjectMember(\"parameters\").ifPresent(parameters -> {\n                                parameters.accept(\n                                    new RuleSetParametersVisitor(\n                                        writer,\n                                        clientContextParamsExcludingBuiltIns,\n                                        true\n                                    )\n                                );\n                            });\n                            writer.dedent();\n                            writer.write(\"};\");\n                        }\n                        // Add direct params (built-ins + custom context params, excluding conflicting)\n                        Map<String, String> directParams = new HashMap<>();\n                        // Add all built-ins (they should always be at root level, even if conflicting)\n                        directParams.putAll(builtInParams);\n                        // Add custom context params excluding conflicting ones\n                        customContextParams.entrySet().forEach(entry -> {\n                            String paramName = entry.getKey();\n                            String localName = EndpointsParamNameMap\n                                .getLocalName(paramName);\n                            if (\n                                !ClientConfigKeys.isKnownConfigKey(paramName)\n                                    && !ClientConfigKeys.isKnownConfigKey(localName)\n                            ) {\n                                directParams.put(paramName, entry.getValue());\n                            }\n                        });\n                        ObjectNode ruleSet = endpointRuleSetTrait.getRuleSet().expectObjectNode();\n                        ruleSet.getObjectMember(\"parameters\").ifPresent(parameters -> {\n                            parameters.accept(new RuleSetParametersVisitor(writer, directParams, true));\n                        });\n                    }\n                );\n\n                writer.write(\"\");\n                writer.writeDocs(\"@public\");\n                writer.write(\n                    \"\"\"\n                    export type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, \"endpoint\"> & {\n                      defaultSigningName: string;\n                    };\"\"\"\n                );\n                if (ruleSetParameterFinder.hasCustomClientContextParams()) {\n                    ruleSetParameterFinder.writeNestedClientContextParamDefaults(writer);\n                }\n                writer.write(\"\");\n\n                writer.writeDocs(\"@internal\");\n                writer.openBlock(\"\"\"\n                                 export const resolveClientEndpointParameters = <T>(\n                                   options: T & ClientInputEndpointParameters\n                                 ): T & ClientResolvedEndpointParameters => {\"\"\", \"};\", () -> {\n                    writer.openBlock(\"return Object.assign(options, {\", \"});\", () -> {\n                        ObjectNode ruleSet = endpointRuleSetTrait.getRuleSet().expectObjectNode();\n                        ruleSet\n                            .getObjectMember(\"parameters\")\n                            .ifPresent(parameters -> {\n                                parameters.accept(new RuleSetParametersVisitor(writer, true));\n                            });\n                        writer.write(\n                            \"defaultSigningName: \\\"$L\\\",\",\n                            settings.getDefaultSigningName()\n                        );\n                        if (ruleSetParameterFinder.hasCustomClientContextParams()) {\n                            ruleSetParameterFinder.writeConfigResolverNestedClientContextParams(writer);\n                        }\n                    });\n                }\n                );\n\n                writer.write(\"\");\n\n                writer.writeDocs(\"@internal\");\n                writer.openBlock(\"export const commonParams = {\", \"} as const;\", () -> {\n                    Set<String> paramNames = new HashSet<>();\n\n                    ruleSetParameterFinder\n                        .getClientContextParams()\n                        .forEach((name, type) -> {\n                            if (!paramNames.contains(name)) {\n                                writer.write(\n                                    \"$L: { type: \\\"clientContextParams\\\", name: \\\"$L\\\" },\",\n                                    name,\n                                    EndpointsParamNameMap.getLocalName(name)\n                                );\n                            }\n                            paramNames.add(name);\n                        });\n\n                    ruleSetParameterFinder\n                        .getBuiltInParams()\n                        .forEach((name, type) -> {\n                            if (!paramNames.contains(name)) {\n                                writer.write(\n                                    \"$L: { type: \\\"builtInParams\\\", name: \\\"$L\\\" },\",\n                                    name,\n                                    EndpointsParamNameMap.getLocalName(name)\n                                );\n                            }\n                            paramNames.add(name);\n                        });\n                });\n\n                writer.write(\"\");\n                writer.writeDocs(\"@internal\");\n                writer.openBlock(\"export interface EndpointParameters extends __EndpointParameters {\", \"}\", () -> {\n                    ObjectNode ruleSet = endpointRuleSetTrait.getRuleSet().expectObjectNode();\n                    ruleSet\n                        .getObjectMember(\"parameters\")\n                        .ifPresent(parameters -> {\n                            parameters.accept(new RuleSetParametersVisitor(writer));\n                        });\n                });\n            }\n        );\n    }\n\n    /**\n     * Generate the resolver function for this service.\n     */\n    private void generateEndpointResolver() {\n        this.delegator.useFileWriter(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, ENDPOINT_FOLDER, ENDPOINT_RESOLVER_FILE).toString(),\n            writer -> {\n                writer.addTypeImport(\"EndpointV2\", null, TypeScriptDependency.SMITHY_TYPES);\n                writer.addTypeImport(\"Logger\", null, TypeScriptDependency.SMITHY_TYPES);\n\n                writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                writer.addTypeImportSubmodule(\n                    \"EndpointParams\",\n                    null,\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.ENDPOINTS\n                );\n                if (settings.generateEndpointBdd()) {\n                    writer.addImportSubmodule(\n                        \"decideEndpoint\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.ENDPOINTS\n                    );\n                    writer.addRelativeImport(\n                        \"bdd\",\n                        null,\n                        Paths.get(\n                            \".\",\n                            CodegenUtils.SOURCE_FOLDER,\n                            ENDPOINT_FOLDER,\n                            ENDPOINT_BDD_FILE.replace(\".ts\", \"\")\n                        )\n                    );\n                } else {\n                    writer.addImportSubmodule(\n                        \"resolveEndpoint\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.ENDPOINTS\n                    );\n                    writer.addRelativeImport(\n                        \"ruleSet\",\n                        null,\n                        Paths.get(\n                            \".\",\n                            CodegenUtils.SOURCE_FOLDER,\n                            ENDPOINT_FOLDER,\n                            ENDPOINT_RULESET_FILE.replace(\".ts\", \"\")\n                        )\n                    );\n                }\n                writer.addRelativeTypeImport(\n                    \"EndpointParameters\",\n                    null,\n                    Paths.get(\n                        \".\",\n                        CodegenUtils.SOURCE_FOLDER,\n                        ENDPOINT_FOLDER,\n                        ENDPOINT_PARAMETERS_FILE.replace(\".ts\", \"\")\n                    )\n                );\n\n                writer.addImportSubmodule(\n                    \"EndpointCache\",\n                    null,\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.ENDPOINTS\n                );\n\n                List<String> effectiveParams = ruleSetParameterFinder.getEffectiveParams();\n                boolean longList = effectiveParams.size() >= 8;\n\n                if (longList) {\n                    writer.openBlock(\"const cache = new EndpointCache({\", \"});\", () -> {\n                        writer.write(\"size: 50,\");\n                        writer.openBlock(\"params: [\", \"],\", () -> {\n                            effectiveParams\n                                .forEach(param -> {\n                                    writer.write(\"$S,\", param);\n                                });\n                        });\n                    });\n                    writer.write(\"\");\n                } else {\n                    writer.write(\n                        \"\"\"\n                        const cache = new EndpointCache({\n                          size: 50,\n                          params: [$L],\n                        });\n                        \"\"\",\n                        effectiveParams\n                            .stream()\n                            .collect(Collectors.joining(\"\\\", \\\"\", \"\\\"\", \"\\\"\"))\n                    );\n                }\n                writer.writeDocs(\"@internal\");\n                writer.write(\n                    \"\"\"\n                    export const defaultEndpointResolver = (\n                      endpointParams: EndpointParameters,\n                      context: { logger?: Logger } = {}\n                    ): EndpointV2 => {\n                      return cache.get(endpointParams as EndpointParams, () =>\n                        $L, {\n                          endpointParams: endpointParams as EndpointParams,\n                          logger: context.logger,\n                        })\n                      );\n                    };\n                    \"\"\",\n                    settings.generateEndpointBdd() ? \"decideEndpoint(bdd\" : \"resolveEndpoint(ruleSet\"\n                );\n            }\n        );\n    }\n\n    /**\n     * Generate the ruleset (dynamic resolution only).\n     */\n    private void generateEndpointRuleset() {\n        this.delegator.useFileWriter(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, ENDPOINT_FOLDER, ENDPOINT_RULESET_FILE).toString(),\n            writer -> {\n                writer.addTypeImport(\"RuleSetObject\", null, TypeScriptDependency.SMITHY_TYPES);\n\n                writer.writeInline(\"export const ruleSet: RuleSetObject = \");\n                new RuleSetSerializer(endpointRuleSetTrait.getRuleSet(), writer).generate();\n            }\n        );\n    }\n\n    private void generateEndpointBdd() {\n        if (endpointBddTrait == null) {\n            throw new RuntimeException(\"generateEndpointBdd() called but endpointBddTrait is null.\");\n        }\n\n        this.delegator.useFileWriter(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, ENDPOINT_FOLDER, ENDPOINT_BDD_FILE).toString(),\n            writer -> {\n                ObjectNode conditionsAndResults = ObjectNode.fromStringMap(Collections.emptyMap());\n\n                List<Condition> conditions = endpointBddTrait.getConditions();\n                conditionsAndResults = conditionsAndResults.withMember(\n                    \"conditions\",\n                    ArrayNode.fromNodes(\n                        conditions.stream().map(c -> new ConditionSerializer(c).toArrayNode()).toList()\n                    )\n                );\n\n                List<Rule> results = endpointBddTrait.getResults();\n                conditionsAndResults = conditionsAndResults.withMember(\n                    \"results\",\n                    ArrayNode.fromNodes(\n                        results.stream().map(r -> new RuleSerializer(r).toArrayNode()).toList()\n                    )\n                );\n\n                writer.write(\n                    new PatternDetectionCompression(conditionsAndResults).compress()\n                );\n\n                Bdd bdd = endpointBddTrait.getBdd();\n\n                writer.write(\n                    \"\"\"\n                    const root = $L;\n                    const r = 100_000_000;\n                    const nodes = new Int32Array([\"\"\",\n                    endpointBddTrait.getBdd().getRootRef()\n                ).indent();\n\n                bdd.getNodes((i, hi, lo) -> {\n                    writer.write(\n                        \"\"\"\n                        $L, $L, $L,\"\"\",\n                        shortestJsLiteral(i),\n                        shortestJsLiteral(hi),\n                        shortestJsLiteral(lo)\n                    );\n                });\n\n                writer.dedent().write(\"\"\"\n                                      ]);\"\"\");\n                writer.addImportSubmodule(\n                    \"BinaryDecisionDiagram\",\n                    null,\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.ENDPOINTS\n                );\n                writer.write(\"\"\"\n                             export const bdd = BinaryDecisionDiagram.from(\n                               nodes, root, _data.conditions, _data.results\n                             );\"\"\");\n            }\n        );\n    }\n\n    private static String shortestJsLiteral(int value) {\n        String decimal = Integer.toString(value);\n        String hex = \"0x\" + Integer.toHexString(value).toUpperCase();\n        String octal = \"0o\" + Integer.toOctalString(value);\n        String binary = \"0b\" + Integer.toBinaryString(value);\n\n        String shortest = decimal;\n        if (hex.length() < shortest.length()) {\n            shortest = hex;\n        }\n        if (octal.length() < shortest.length()) {\n            shortest = octal;\n        }\n        if (binary.length() < shortest.length()) {\n            shortest = binary;\n        }\n\n        if (shortest.equals(decimal) && value >= 100000000) {\n            return \"r + \" + (value - 100000000);\n        }\n\n        return shortest;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/OmitEndpointParams.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * Manages a collection of endpoint parameter names to be omitted from a specific interface.\n * While this could be extensible in the future, as of right now,\n * this collection is maintaining endpoint params to be omitted from the `ClientInputEndpointParameters` interface.\n */\npublic final class OmitEndpointParams {\n\n    private static final Set<String> OMITTED_PARAMS = new HashSet<>();\n\n    private OmitEndpointParams() {}\n\n    public static void addOmittedParams(Set<String> paramNames) {\n        OMITTED_PARAMS.addAll(paramNames);\n    }\n\n    public static boolean isOmitted(String paramName) {\n        return OMITTED_PARAMS.contains(paramName);\n    }\n\n    public static Set<String> getOmittedParams() {\n        return Collections.unmodifiableSet(OMITTED_PARAMS);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/ParameterGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.AbstractMap;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.node.BooleanNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\n\n/**\n * Owner for a parameter object node in the EndpointRuleSet.\n */\npublic class ParameterGenerator {\n\n    private final String parameterName;\n    private final Node param;\n    private boolean required = false;\n    private boolean isInputKey;\n    private String tsParamType = \"string\";\n\n    /**\n     * @param key - the param name.\n     * @param param - the param value.\n     * @param isInputKey - whether the key is a client input key. This is\n     *                     distinct from canonical endpoint param name\n     *                     because it has been transformed to match\n     *                     pre-existing keys in published clients.\n     */\n    public ParameterGenerator(String key, Node param, boolean isInputKey) {\n        parameterName = key;\n        this.param = param;\n        this.isInputKey = isInputKey;\n\n        ObjectNode paramNode = param\n            .asObjectNode()\n            .orElseThrow(() -> new RuntimeException(\"param node is not object node.\"));\n\n        Optional<BooleanNode> requiredNode = paramNode.getBooleanMember(\"required\");\n        requiredNode.ifPresent(booleanNode -> required = booleanNode.getValue());\n\n        Optional<StringNode> type = paramNode.getStringMember(\"type\");\n\n        if (type.isPresent()) {\n            switch (type.get().getValue()) {\n                case \"String\":\n                case \"string\":\n                    tsParamType = \"string\";\n                    break;\n                case \"Boolean\":\n                case \"boolean\":\n                    tsParamType = \"boolean\";\n                    break;\n                case \"stringArray\":\n                    tsParamType = \"string[]\";\n                    break;\n                default:\n                    // required by linter\n            }\n        }\n    }\n\n    public ParameterGenerator(String key, Node param) {\n        this(key, param, false);\n    }\n\n    public boolean isBuiltIn() {\n        return param.expectObjectNode().containsMember(\"builtIn\");\n    }\n\n    public boolean hasDefault() {\n        return param.expectObjectNode().containsMember(\"default\");\n    }\n\n    public String defaultAsCodeString() {\n        if (!hasDefault()) {\n            return \"\";\n        }\n        String buffer = \"\";\n        buffer += parameterName;\n        buffer += \": \";\n        buffer += \"options.\" + parameterName + \" ?? \";\n        ObjectNode paramNode = param.expectObjectNode();\n        StringNode type = paramNode.expectStringMember(\"type\");\n\n        switch (type.getValue()) {\n            case \"String\":\n            case \"string\":\n                buffer += \"\\\"\" + paramNode.expectStringMember(\"default\").getValue() + \"\\\"\";\n                break;\n            case \"Boolean\":\n            case \"boolean\":\n                buffer += paramNode.expectBooleanMember(\"default\").getValue() ? \"true\" : \"false\";\n                break;\n            case \"stringArray\":\n                buffer += paramNode\n                    .expectArrayMember(\"default\")\n                    .getElements()\n                    .stream()\n                    .map(element -> element.expectStringNode().getValue())\n                    .collect(Collectors.joining(\"`, `\", \"[`\", \"`]\"));\n                break;\n            default:\n                throw new RuntimeException(\"Unhandled endpoint param type: \" + type.getValue());\n        }\n\n        buffer += \",\";\n        return buffer;\n    }\n\n    public Map.Entry<String, String> getNameAndType() {\n        return new AbstractMap.SimpleEntry<>(parameterName, tsParamType);\n    }\n\n    /**\n     * Used to generate interface line for EndpointParameters.ts.\n     */\n    public String toCodeString(boolean isClientContextParam) {\n        String buffer = \"\";\n        buffer += parameterName;\n        boolean optional = !required || hasDefault() || isClientContextParam;\n        if (optional) {\n            buffer += \"?\";\n        }\n        buffer += \": \";\n\n        if (parameterName.equals(\"endpoint\") && isInputKey) {\n            buffer += \"string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\";\n        } else {\n            if (optional) {\n                if (isClientContextParam) {\n                    buffer += (tsParamType + \" | undefined | Provider<\" + tsParamType + \" | undefined>\") + \";\";\n                } else {\n                    buffer += tsParamType + \" | undefined;\";\n                }\n            } else {\n                buffer += tsParamType + \";\";\n            }\n        }\n        return buffer;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSerializer.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.List;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.NumberNode;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Condition;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.EndpointRule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.ErrorRule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.NoMatchRule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Rule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.TreeRule;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic class RuleSerializer {\n    /**\n     * Note: the rules will not contain conditions, nor TreeRules.\n     */\n    private final Rule rule;\n\n    public RuleSerializer(Rule rule) {\n        this.rule = rule;\n\n        List<Condition> conditions = rule.getConditions();\n        if (conditions != null && !conditions.isEmpty()) {\n            throw new IllegalArgumentException(\"Endpoint rules for BDD must not contain conditions.\");\n        }\n    }\n\n    public ArrayNode toArrayNode() {\n        ArrayNode array = ArrayNode.fromNodes();\n        if (rule instanceof EndpointRule endpointRule) {\n            ObjectNode epNode = endpointRule.getEndpoint().toNode().expectObjectNode();\n\n            Node url = epNode.expectMember(\"url\");\n            ObjectNode propertiesNode = epNode.expectObjectMember(\"properties\");\n            ObjectNode headersNode = epNode.expectObjectMember(\"headers\");\n\n            array = headersNode.isEmpty() ? array\n                .withValue(url)\n                .withValue(propertiesNode)\n                : array\n                    .withValue(url)\n                    .withValue(propertiesNode)\n                    .withValue(headersNode);\n        } else if (rule instanceof ErrorRule errorRule) {\n            array = array\n                .withValue(NumberNode.from(-1))\n                .withValue(errorRule.getError().toNode());\n        } else if (rule instanceof NoMatchRule) {\n            array = array.withValue(NumberNode.from(-1));\n        } else if (rule instanceof TreeRule) {\n            throw new IllegalArgumentException(\"BDD should not have TreeRule objects.\");\n        } else {\n            throw new IllegalArgumentException(\"Unrecognized rule type: \" + rule.getClass().getName());\n        }\n\n        return array;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinder.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.ArrayDeque;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.Queue;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.NodeVisitor;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeType;\nimport software.amazon.smithy.rulesengine.language.Endpoint;\nimport software.amazon.smithy.rulesengine.language.EndpointRuleSet;\nimport software.amazon.smithy.rulesengine.language.syntax.expressions.Expression;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Condition;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.EndpointRule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.ErrorRule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.Rule;\nimport software.amazon.smithy.rulesengine.language.syntax.rule.TreeRule;\nimport software.amazon.smithy.rulesengine.traits.ClientContextParamsTrait;\nimport software.amazon.smithy.rulesengine.traits.ContextParamTrait;\nimport software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait;\nimport software.amazon.smithy.rulesengine.traits.OperationContextParamsTrait;\nimport software.amazon.smithy.rulesengine.traits.StaticContextParamsTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic class RuleSetParameterFinder {\n\n    public static final Pattern URL_PARAMETERS = Pattern.compile(\"\\\\{(\\\\w+)[}#]\");\n\n    private final ServiceShape service;\n    private final EndpointRuleSetTrait ruleset;\n\n    public RuleSetParameterFinder(ServiceShape service) {\n        this.service = service;\n        this.ruleset = service\n            .getTrait(EndpointRuleSetTrait.class)\n            .orElseThrow(() -> new RuntimeException(\"Service does not have EndpointRuleSetTrait.\"));\n    }\n\n    /**\n     * It's possible for a parameter to pass validation, i.e. exist in the modeled shapes\n     * and be used in endpoint tests, but have no actual effect on endpoint resolution.\n     *\n     * @return the list of endpoint parameters that are actually used in endpoint resolution.\n     */\n    public List<String> getEffectiveParams() {\n        Set<String> effectiveParams = new TreeSet<>();\n        EndpointRuleSet endpointRuleSet = ruleset.getEndpointRuleSet();\n        Set<String> initialParams = new HashSet<>();\n\n        endpointRuleSet\n            .getParameters()\n            .forEach(parameter -> {\n                initialParams.add(parameter.getName().getName().getValue());\n            });\n\n        Queue<Rule> ruleQueue = new ArrayDeque<>(endpointRuleSet.getRules());\n        Queue<Condition> conditionQueue = new ArrayDeque<>();\n        Queue<Node> argQueue = new ArrayDeque<>();\n\n        while (!ruleQueue.isEmpty() || !conditionQueue.isEmpty() || !argQueue.isEmpty()) {\n            while (!argQueue.isEmpty()) {\n                Node arg = argQueue.poll();\n                if (arg.isObjectNode()) {\n                    Optional<Node> ref = arg.expectObjectNode().getMember(\"ref\");\n                    if (ref.isPresent()) {\n                        String refName = ref.get().expectStringNode().getValue();\n                        if (initialParams.contains(refName)) {\n                            effectiveParams.add(refName);\n                        }\n                    }\n                    Optional<Node> argv = arg.expectObjectNode().getMember(\"argv\");\n                    if (argv.isPresent()) {\n                        ArrayNode nestedArgv = argv.get().expectArrayNode();\n                        for (Node nestedArg : nestedArgv) {\n                            if (nestedArg.isObjectNode()) {\n                                argQueue.add(nestedArg.expectObjectNode());\n                            }\n                        }\n                    }\n                } else if (arg.isStringNode()) {\n                    String argString = arg.expectStringNode().getValue();\n                    URL_PARAMETERS.matcher(argString)\n                        .results()\n                        .forEach(matchResult -> {\n                            if (matchResult.groupCount() >= 1) {\n                                if (initialParams.contains(matchResult.group(1))) {\n                                    effectiveParams.add(matchResult.group(1));\n                                }\n                            }\n                        });\n                }\n            }\n\n            while (!conditionQueue.isEmpty()) {\n                Condition condition = conditionQueue.poll();\n                ArrayNode argv = condition.toNode().expectObjectNode().expectArrayMember(\"argv\");\n                for (Node arg : argv) {\n                    argQueue.add(arg);\n                }\n            }\n\n            Rule rule = ruleQueue.poll();\n            if (null == rule) {\n                continue;\n            }\n            List<Condition> conditions = rule.getConditions();\n            conditionQueue.addAll(conditions);\n            if (rule instanceof TreeRule treeRule) {\n                ruleQueue.addAll(treeRule.getRules());\n            } else if (rule instanceof EndpointRule endpointRule) {\n                Endpoint endpoint = endpointRule.getEndpoint();\n                Expression url = endpoint.getUrl();\n                String urlString = url.toString();\n\n                URL_PARAMETERS.matcher(urlString)\n                    .results()\n                    .forEach(matchResult -> {\n                        if (matchResult.groupCount() >= 1) {\n                            if (initialParams.contains(matchResult.group(1))) {\n                                effectiveParams.add(matchResult.group(1));\n                            }\n                        }\n                    });\n            } else if (rule instanceof ErrorRule errorRule) {\n                // no additional use of endpoint parameters in error rules.\n            }\n        }\n\n        return new ArrayList<>(effectiveParams);\n    }\n\n    /**\n     * TODO(endpointsv2) From definitions in EndpointRuleSet.parameters, or\n     * TODO(endpointsv2) are they from the closed set?\n     */\n    public Map<String, String> getBuiltInParams() {\n        Map<String, String> map = new HashMap<>();\n        ObjectNode ruleSet = ruleset.getRuleSet().expectObjectNode();\n        ruleSet\n            .getObjectMember(\"parameters\")\n            .ifPresent(parameters -> {\n                parameters.accept(new RuleSetParameterFinderVisitor(map));\n            });\n        return map;\n    }\n\n    /**\n     * Check if there are custom client context parameters.\n     */\n    public boolean hasCustomClientContextParams() {\n        Map<String, String> clientContextParams = getClientContextParams();\n        Map<String, String> builtInParams = getBuiltInParams();\n        builtInParams.keySet().removeIf(OmitEndpointParams::isOmitted);\n        Map<String, String> customContextParams = ClientConfigKeys.getCustomContextParams(\n            clientContextParams,\n            builtInParams\n        );\n        return !customContextParams.isEmpty();\n    }\n\n    /**\n     * Write custom client context parameters to TypeScript writer.\n     */\n    public void writeInputConfigCustomClientContextParams(TypeScriptWriter writer) {\n        Map<String, String> clientContextParams = getClientContextParams();\n        Map<String, String> builtInParams = getBuiltInParams();\n        builtInParams.keySet().removeIf(OmitEndpointParams::isOmitted);\n        Map<String, String> customContextParams = ClientConfigKeys.getCustomContextParams(\n            clientContextParams,\n            builtInParams\n        );\n        ObjectNode ruleSet = ruleset.getRuleSet().expectObjectNode();\n        ruleSet.getObjectMember(\"parameters\").ifPresent(parameters -> {\n            parameters.accept(new RuleSetParametersVisitor(writer, customContextParams, true));\n        });\n    }\n\n    /**\n     * Write nested client context parameter defaults to TypeScript writer.\n     * Only includes conflicting parameters with default values.\n     */\n    public void writeNestedClientContextParamDefaults(TypeScriptWriter writer) {\n        Map<String, String> clientContextParams = getClientContextParams();\n        Map<String, String> builtInParams = getBuiltInParams();\n        builtInParams.keySet().removeIf(OmitEndpointParams::isOmitted);\n        ObjectNode ruleSet = ruleset.getRuleSet().expectObjectNode();\n        if (ruleSet.getObjectMember(\"parameters\").isPresent()) {\n            ObjectNode parameters = ruleSet.getObjectMember(\"parameters\").get().expectObjectNode();\n            writer.write(\"\");\n            writer.writeDocs(\"@internal\");\n            writer.openCollapsibleBlock(\n                \"const clientContextParamDefaults = {\",\n                \"} as const;\",\n                clientContextParams.keySet()\n                    .stream()\n                    .anyMatch(k -> {\n                        return ClientConfigKeys.isKnownConfigKey(k) && !builtInParams.containsKey(k)\n                            &&\n                            parameters.getObjectMember(k).stream().anyMatch(n -> n.containsMember(\"default\"));\n                    }),\n                () -> {\n                    // Write defaults only for conflicting parameters\n                    for (String paramName : clientContextParams.keySet()) {\n                        // Check if this is a conflicting parameter (exists in both clientContextParams and knownConfigKeys)\n                        if (ClientConfigKeys.isKnownConfigKey(paramName) && !builtInParams.containsKey(paramName)) {\n                            ObjectNode paramNode = parameters.getObjectMember(paramName).orElse(null);\n                            if (paramNode != null && paramNode.containsMember(\"default\")) {\n                                Node defaultValue = paramNode.getMember(\"default\").get();\n                                if (defaultValue.isStringNode()) {\n                                    writer.write(\"$L: \\\"$L\\\",\", paramName, defaultValue.expectStringNode().getValue());\n                                } else if (defaultValue.isBooleanNode()) {\n                                    writer.write(\"$L: $L,\", paramName, defaultValue.expectBooleanNode().getValue());\n                                }\n                            }\n                        }\n                    }\n                }\n            );\n        }\n    }\n\n    /**\n     * Write config resolver nested client context parameters to TypeScript writer.\n     */\n    public void writeConfigResolverNestedClientContextParams(TypeScriptWriter writer) {\n        Map<String, String> clientContextParams = getClientContextParams();\n        Map<String, String> builtInParams = getBuiltInParams();\n        builtInParams.keySet().removeIf(OmitEndpointParams::isOmitted);\n        Map<String, String> customContextParams = ClientConfigKeys.getCustomContextParams(\n            clientContextParams,\n            builtInParams\n        );\n        ObjectNode ruleSet = ruleset.getRuleSet().expectObjectNode();\n        boolean hasDefaultsForResolve = false;\n        if (ruleSet.getObjectMember(\"parameters\").isPresent()) {\n            ObjectNode parameters = ruleSet.getObjectMember(\"parameters\").get().expectObjectNode();\n            hasDefaultsForResolve = customContextParams.entrySet()\n                .stream()\n                .anyMatch(entry -> {\n                    ObjectNode paramNode = parameters.getObjectMember(entry.getKey()).orElse(null);\n                    return paramNode != null && paramNode.containsMember(\"default\");\n                });\n        }\n        if (hasDefaultsForResolve) {\n            writer.write(\n                \"clientContextParams: Object.assign(clientContextParamDefaults, \"\n                    + \"options.clientContextParams),\"\n            );\n        } else {\n            writer.write(\n                \"clientContextParams: options.clientContextParams ?? {},\"\n            );\n        }\n    }\n\n    /**\n     * Defined on the service shape as smithy.rules#clientContextParams traits.\n     */\n    public Map<String, String> getClientContextParams() {\n        Map<String, String> map = new HashMap<>();\n        Optional<ClientContextParamsTrait> trait = service.getTrait(ClientContextParamsTrait.class);\n        if (trait.isPresent()) {\n            ClientContextParamsTrait clientContextParamsTrait = trait.get();\n            clientContextParamsTrait\n                .getParameters()\n                .forEach((name, definition) -> {\n                    ShapeType shapeType = definition.getType();\n                    if (shapeType.isShapeType(ShapeType.STRING) || shapeType.isShapeType(ShapeType.BOOLEAN)) {\n                        map.put(\n                            name,\n                            // \"boolean\" and \"string\" are directly usable in TS.\n                            definition.getType().toString().toLowerCase()\n                        );\n                    } else if (shapeType.isShapeType(ShapeType.LIST)) {\n                        map.put(\n                            name,\n                            \"string[]\" // Only string lists are supported.\n                        );\n                    } else {\n                        throw new RuntimeException(\n                            \"unexpected type \" + definition.getType().toString()\n                                + \" received as clientContextParam.\"\n                        );\n                    }\n                });\n        }\n        return map;\n    }\n\n    /**\n     * Get map of params to actual values instead of the value type.\n     */\n    public Map<String, String> getStaticContextParamValues(OperationShape operation) {\n        Map<String, String> map = new HashMap<>();\n\n        Optional<StaticContextParamsTrait> trait = operation.getTrait(StaticContextParamsTrait.class);\n        if (trait.isPresent()) {\n            StaticContextParamsTrait staticContextParamsTrait = trait.get();\n            staticContextParamsTrait\n                .getParameters()\n                .forEach((name, definition) -> {\n                    String value;\n                    if (definition.getValue().isStringNode()) {\n                        value = \"`\" + definition.getValue().expectStringNode().toString() + \"`\";\n                    } else if (definition.getValue().isBooleanNode()) {\n                        value = definition.getValue().expectBooleanNode().toString();\n                    } else if (definition.getValue().isArrayNode()) {\n                        ArrayNode arrayNode = definition.getValue().expectArrayNode();\n                        value = arrayNode\n                            .getElements()\n                            .stream()\n                            .map(element -> element.expectStringNode().getValue())\n                            .collect(Collectors.joining(\"`, `\", \"[`\", \"`]\"));\n                    } else {\n                        throw new RuntimeException(\n                            \"unexpected type \" +\n                                definition.getValue().getType().toString() +\n                                \" received as staticContextParam.\"\n                        );\n                    }\n                    map.put(name, value);\n                });\n        }\n\n        return map;\n    }\n\n    /**\n     * The contextParam trait allows for binding a structure's member value to a context\n     * parameter name. This trait MUST target a member shape on an operation's input structure.\n     * The targeted endpoint parameter MUST be a type that is compatible with member's\n     * shape targeted by the trait.\n     */\n    public Map<String, String> getContextParams(Shape operationInput) {\n        Map<String, String> map = new HashMap<>();\n\n        if (operationInput.isStructureShape()) {\n            operationInput\n                .getAllMembers()\n                .forEach((String memberName, MemberShape member) -> {\n                    Optional<ContextParamTrait> trait = member.getTrait(ContextParamTrait.class);\n                    if (trait.isPresent()) {\n                        ContextParamTrait contextParamTrait = trait.get();\n                        String name = contextParamTrait.getName();\n                        map.put(name, member.getMemberName());\n                    }\n                });\n        }\n\n        return map;\n    }\n\n    /**\n     * Get map of params to JavaScript equivalent of provided JMESPath expressions.\n     */\n    public Map<String, String> getOperationContextParamValues(OperationShape operation) {\n        Map<String, String> map = new HashMap<>();\n\n        Optional<OperationContextParamsTrait> trait = operation.getTrait(OperationContextParamsTrait.class);\n        if (trait.isPresent()) {\n            trait\n                .get()\n                .getParameters()\n                .forEach((name, definition) -> {\n                    String separator = \"?.\";\n                    String value = \"input\";\n                    String path = definition.getPath();\n                    value = getJmesPathExpression(separator, value, path);\n\n                    // Remove no-op map, if it exists.\n                    final String noOpMap = \"map((obj: any) => obj\";\n                    if (value.endsWith(separator + noOpMap)) {\n                        value = value.substring(0, value.length() - noOpMap.length() - separator.length());\n                    }\n\n                    // Close all open brackets.\n                    value += \")\".repeat(\n                        (int) (value\n                            .chars()\n                            .filter(ch -> ch == '(')\n                            .count() -\n                            value\n                                .chars()\n                                .filter(ch -> ch == ')')\n                                .count())\n                    );\n\n                    map.put(name, value);\n                });\n        }\n\n        return map;\n    }\n\n    String getJmesPathExpression(String separator, String value, String path) {\n        // Split JMESPath expression string on separator and add JavaScript equivalent.\n        while (path.length() > 0) {\n            if (path.startsWith(\"[\") && !path.startsWith(\"[*]\")) {\n                // Process MultiSelect List https://jmespath.org/specification.html#multiselect-list\n                if (value.endsWith(\"obj\")) {\n                    value = value.substring(0, value.length() - 3);\n                }\n\n                value += \"[\";\n                path = path.substring(1);\n\n                while (true) {\n                    int commaIndex = path.indexOf(\",\");\n                    int sepIndex = (commaIndex == -1) ? path.indexOf(\"]\") : commaIndex;\n                    String part = path.substring(0, sepIndex);\n                    path = path.substring(sepIndex + 1).trim();\n                    value += getJmesPathExpression(separator, \"obj\", part) + \",\";\n                    if (commaIndex == -1) {\n                        // Remove trailing comma and close bracket.\n                        value = value.substring(0, value.length() - 1) + \"].filter((i) => i))\";\n                        break;\n                    }\n                }\n\n                // Process Flatten operator https://jmespath.org/specification.html#flatten-operator\n                if (path.startsWith(\"[]\")) {\n                    value += \".flat()\";\n                    path = path.substring(2);\n                }\n                continue;\n            }\n\n            int dotIndex = path.indexOf(\".\");\n            String part = dotIndex == -1 ? path : path.substring(0, dotIndex);\n            path = dotIndex == -1 ? \"\" : path.substring(dotIndex + 1);\n            value = getJmesPathExpressionSection(separator, value, part);\n        }\n        return value;\n    }\n\n    private String getJmesPathExpressionSection(String separator, String value, String part) {\n        if (value.endsWith(\")\")) {\n            // The value is an object, which needs to run on map.\n            value += \".map((obj: any) => obj\";\n        }\n\n        // Process keys https://jmespath.org/specification.html#keys\n        if (part.startsWith(\"keys(\")) {\n            // Get provided object for which keys are to be extracted.\n            String object = part.substring(5, part.length() - 1);\n            value = \"Object.keys(\" + value + separator + object + \" ?? {})\";\n            return value;\n        }\n\n        // Process list wildcard expression https://jmespath.org/specification.html#wildcard-expressions\n        if (part.equals(\"*\") || part.equals(\"[*]\")) {\n            value = \"Object.values(\" + value + \" ?? {})\";\n            return value;\n        }\n\n        // Process hash wildcard expression https://jmespath.org/specification.html#wildcard-expressions\n        if (part.endsWith(\"[*]\")) {\n            // Get key to run hash wildcard on.\n            String key = part.substring(0, part.length() - 3);\n            value = value + separator + key + separator + \"map((obj: any) => obj\";\n            return value;\n        }\n\n        // Process Flatten operator https://jmespath.org/specification.html#flatten-operator\n        if (part.endsWith(\"[]\")) {\n            // Get key to run hash wildcard on.\n            String key = part.substring(0, part.length() - 2);\n\n            // If key is on list item\n            if (key.endsWith(\"[*]\")) {\n                value = value + separator + key.substring(0, key.length() - 3) + \".flat()\";\n            } else {\n                // key is on object\n                value = value + separator + key + \").flat()\";\n            }\n            return value;\n        }\n\n        // Treat remaining part as identifier without spaces https://jmespath.org/specification.html#identifiers\n        value += separator + part;\n        return value;\n    }\n\n    private static class RuleSetParameterFinderVisitor extends NodeVisitor.Default<Void> {\n\n        private final Map<String, String> map;\n\n        RuleSetParameterFinderVisitor(Map<String, String> map) {\n            this.map = map;\n        }\n\n        @Override\n        public Void objectNode(ObjectNode node) {\n            Map<StringNode, Node> members = node.getMembers();\n            for (Map.Entry<StringNode, Node> entry : members.entrySet()) {\n                String key = entry.getKey().getValue();\n                Node param = entry.getValue();\n\n                ParameterGenerator parameterGenerator = new ParameterGenerator(key, param);\n\n                if (parameterGenerator.isBuiltIn()) {\n                    Map.Entry<String, String> nameAndType = parameterGenerator.getNameAndType();\n                    map.put(nameAndType.getKey(), nameAndType.getValue());\n                }\n            }\n            return null;\n        }\n\n        @Override\n        protected Void getDefault(Node node) {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParametersVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.NodeVisitor;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.node.StringNode;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\n\n/**\n * Writes endpoint ruleset params into a client-specific config resolver step, applying defaults as needed.\n */\npublic class RuleSetParametersVisitor extends NodeVisitor.Default<Void> {\n\n    private final TypeScriptWriter writer;\n    private final Map<String, String> clientContextParams;\n    private boolean useLocalNames = false;\n    private boolean writeDefaults = false;\n\n    public RuleSetParametersVisitor(TypeScriptWriter writer) {\n        this.writer = writer;\n        this.clientContextParams = new HashMap<>();\n    }\n\n    public RuleSetParametersVisitor(\n        TypeScriptWriter writer,\n        Map<String, String> clientContextParams,\n        boolean useLocalNames\n    ) {\n        this.writer = writer;\n        this.clientContextParams = clientContextParams;\n        this.useLocalNames = useLocalNames;\n    }\n\n    public RuleSetParametersVisitor(TypeScriptWriter writer, boolean writeDefaults) {\n        this(writer);\n        this.writeDefaults = writeDefaults;\n        this.useLocalNames = true;\n    }\n\n    @Override\n    public Void objectNode(ObjectNode node) {\n        Map<StringNode, Node> members = node.getMembers();\n        for (Map.Entry<StringNode, Node> entry : members.entrySet()) {\n            String key = entry.getKey().getValue();\n            String localKey = key;\n            Node param = entry.getValue();\n            if (useLocalNames) {\n                localKey = EndpointsParamNameMap.getLocalName(key);\n            }\n\n            ParameterGenerator parameterGenerator = new ParameterGenerator(localKey, param, useLocalNames);\n\n            if (localKey.equals(\"endpoint\")) {\n                writer.addTypeImport(\"Endpoint\", null, TypeScriptDependency.SMITHY_TYPES);\n                writer.addTypeImport(\"EndpointV2\", null, TypeScriptDependency.SMITHY_TYPES);\n                writer.addTypeImport(\"Provider\", null, TypeScriptDependency.SMITHY_TYPES);\n            }\n\n            if (writeDefaults) {\n                if (parameterGenerator.hasDefault()) {\n                    // Don't write root-level defaults for conflicting parameters\n                    if (!ClientConfigKeys.isKnownConfigKey(key)) {\n                        writer.write(parameterGenerator.defaultAsCodeString());\n                    }\n                }\n            } else if (clientContextParams.isEmpty() || clientContextParams.containsKey(key)) {\n                boolean isClientContextParams = !clientContextParams.isEmpty();\n                writer.write(parameterGenerator.toCodeString(isClientContextParams));\n            }\n        }\n        return null;\n    }\n\n    @Override\n    protected Void getDefault(Node node) {\n        return null;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetSerializer.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.util.PropertyAccessor;\n\npublic class RuleSetSerializer {\n\n    private final Node ruleSet;\n    private final TypeScriptWriter writer;\n\n    public RuleSetSerializer(Node ruleSet, TypeScriptWriter writer) {\n        this.ruleSet = ruleSet;\n        this.writer = writer;\n    }\n\n    /**\n     * Write the ruleset as a TS object.\n     */\n    public void generate() {\n        ObjectNode objectNode = ruleSet.expectObjectNode();\n        writer.openCollapsibleBlock(\"{\", \"};\", !objectNode.getMembers().isEmpty(), () -> {\n            objectNode\n                .getMembers()\n                .forEach((k, v) -> {\n                    writer.writeInline(PropertyAccessor.inlineKey(k.toString()) + \": \");\n                    traverse(v);\n                });\n        });\n    }\n\n    private void traverse(Node node) {\n        if (node.isObjectNode()) {\n            ObjectNode objectNode = node.expectObjectNode();\n\n            writer.openCollapsibleBlock(\"{\", \"},\", !objectNode.getMembers().isEmpty(), () -> {\n                objectNode\n                    .getMembers()\n                    .forEach((k, v) -> {\n                        writer.writeInline(PropertyAccessor.inlineKey(k.toString()) + \": \");\n                        traverse(v);\n                    });\n            });\n        } else if (node.isArrayNode()) {\n            ArrayNode arrayNode = node.expectArrayNode();\n            writer.openCollapsibleBlock(\"[\", \"],\", !arrayNode.getElements().isEmpty(), () -> {\n                arrayNode.getElements().forEach(this::traverse);\n            });\n        } else if (node.isBooleanNode()) {\n            writer.write(\"$L,\", node.expectBooleanNode().getValue());\n        } else if (node.isNumberNode()) {\n            Number number = node.expectNumberNode().getValue();\n\n            float floatValue = number.floatValue();\n            int intValue = number.intValue();\n\n            if (floatValue == Math.floor(floatValue)) {\n                writer.write(\"$L,\", intValue);\n            } else {\n                writer.write(\"$L,\", floatValue);\n            }\n        } else if (node.isStringNode()) {\n            String stringValue = node.expectStringNode().getValue();\n            if (stringValue.contains(\"\\\"\")) {\n                writer.write(\"`$L`,\", stringValue.replaceAll(\"`\", \"\\\\\\\\`\"));\n            } else {\n                writer.write(\"\\\"$L\\\",\", stringValue);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/DefaultExtensionConfigurationInterface.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.extensions;\n\nimport software.amazon.smithy.typescript.codegen.Dependency;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.utils.Pair;\n\npublic class DefaultExtensionConfigurationInterface implements ExtensionConfigurationInterface {\n\n    @Override\n    public Pair<String, Dependency> name() {\n        return Pair.of(\"DefaultExtensionConfiguration\", TypeScriptDependency.SMITHY_TYPES);\n    }\n\n    @Override\n    public Pair<String, Dependency> getExtensionConfigurationFn() {\n        return Pair.of(\"getDefaultExtensionConfiguration\", TypeScriptDependency.SMITHY_CORE);\n    }\n\n    @Override\n    public Pair<String, Dependency> resolveRuntimeConfigFn() {\n        return Pair.of(\"resolveDefaultRuntimeConfig\", TypeScriptDependency.SMITHY_CORE);\n    }\n\n    @Override\n    public String submodule() {\n        return SmithyCoreSubmodules.CLIENT;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/ExtensionConfigurationInterface.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.extensions;\n\nimport software.amazon.smithy.typescript.codegen.Dependency;\nimport software.amazon.smithy.utils.Pair;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * An interface class for defining the service client configuration.\n */\n@SmithyInternalApi\npublic interface ExtensionConfigurationInterface {\n    /**\n     * Define the interface name.\n     *\n     * @return Returns the interface name and the corresponding dependency package\n     */\n    Pair<String, Dependency> name();\n\n    /**\n     * Define a function that returns an object instance that implements the interface.\n     *\n     * <pre>{@code\n     * interface TimeoutClientConfiguration {\n     *   setTimeout(timeout: number): void;\n     *   timeout(): timeout;\n     * }\n     *\n     * const getTimeoutClientConfigurationFn = (runtimeConfig: any) => {\n     *     let timeout: number = 100;\n     *     if (runtimeConfig.timeout !== undefined) {\n     *         timeout = runtimeConfig.timeout;\n     *     }\n     *\n     *     const clientConfiguration: TimeoutClientConfiguration = {\n     *         _timeout: timeout,\n     *         setTimeout: function(timeout: number): void {\n     *             this._timeout = timeout;\n     *         },\n     *         timeout: function(): number {\n     *             return this._timeout;\n     *         }\n     *     }\n     *\n     *     return clientConfiguration;\n     * }\n     *\n     * }</pre>\n     *\n     * @return Returns a typescript function name\n     */\n    Pair<String, Dependency> getExtensionConfigurationFn();\n\n    /**\n     * Define a function that returns an object instance that implements the interface.\n     *\n     * <pre>{@code\n     * interface TimeoutClientConfiguration {\n     *   setTimeout(timeout: number): void;\n     *   timeout(): timeout;\n     * }\n     *\n     * export const resolveTimeoutRuntimeConfigFn = (clientConfig: TimeoutClientConfiguration) => {\n     *     const runtimeConfig: any = {\n     *        timeout: clientConfig.timeout()\n     *     };\n     *\n     *     return runtimeConfig;\n     * }\n     *\n     * }</pre>\n     *\n     * @return Returns a typescript function name\n     */\n    Pair<String, Dependency> resolveRuntimeConfigFn();\n\n    /**\n     * Optional submodule path for imports (e.g. \"/protocols\" for @smithy/core/protocols).\n     * When non-null, consumers should use addImportSubmodule instead of addImport.\n     *\n     * @return Returns the submodule path, or null if not applicable.\n     */\n    default String submodule() {\n        return null;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/HttpHandlerExtensionConfigurationInterface.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.extensions;\n\nimport software.amazon.smithy.typescript.codegen.Dependency;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.utils.Pair;\n\npublic class HttpHandlerExtensionConfigurationInterface implements ExtensionConfigurationInterface {\n\n    @Override\n    public Pair<String, Dependency> name() {\n        return Pair.of(\"HttpHandlerExtensionConfiguration\", TypeScriptDependency.SMITHY_CORE);\n    }\n\n    @Override\n    public String submodule() {\n        return SmithyCoreSubmodules.PROTOCOLS;\n    }\n\n    @Override\n    public Pair<String, Dependency> getExtensionConfigurationFn() {\n        return Pair.of(\"getHttpHandlerExtensionConfiguration\", TypeScriptDependency.SMITHY_CORE);\n    }\n\n    @Override\n    public Pair<String, Dependency> resolveRuntimeConfigFn() {\n        return Pair.of(\"resolveHttpHandlerRuntimeConfig\", TypeScriptDependency.SMITHY_CORE);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddBaseServiceExceptionClass.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.nio.file.Paths;\nimport java.util.function.BiConsumer;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generate the base ServiceException class.\n */\n@SmithyInternalApi\npublic final class AddBaseServiceExceptionClass implements TypeScriptIntegration {\n\n    @Override\n    public void customize(TypeScriptCodegenContext codegenContext) {\n        TypeScriptSettings settings = codegenContext.settings();\n        Model model = codegenContext.model();\n        SymbolProvider symbolProvider = codegenContext.symbolProvider();\n        BiConsumer<String, Consumer<TypeScriptWriter>> writerFactory = codegenContext.writerDelegator()::useFileWriter;\n\n        writeAdditionalFiles(settings, model, symbolProvider, writerFactory);\n\n        writerFactory.accept(Paths.get(CodegenUtils.SOURCE_FOLDER, \"index.ts\").toString(), writer -> {\n            writeAdditionalExports(settings, model, symbolProvider, writer);\n        });\n    }\n\n    private void writeAdditionalFiles(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        BiConsumer<String, Consumer<TypeScriptWriter>> writerFactory\n    ) {\n        boolean isClientSdk = settings.generateClient();\n        if (isClientSdk) {\n            String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n            String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model);\n            writerFactory.accept(\n                Paths.get(CodegenUtils.SOURCE_FOLDER, \"models\", serviceExceptionName + \".ts\").toString(),\n                writer -> {\n                    writer.addImportSubmodule(\n                        \"ServiceException\",\n                        \"__ServiceException\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    writer.addTypeImportSubmodule(\n                        \"ServiceExceptionOptions\",\n                        \"__ServiceExceptionOptions\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    // Export ServiceException information to allow\n                    //      documentation inheritance to consume their types\n                    writer.write(\"export type { __ServiceExceptionOptions };\\n\");\n                    writer.write(\"export { __ServiceException };\\n\");\n                    writer.writeDocs(\n                        \"@public\\n\\nBase exception class for all service exceptions from \" + serviceName\n                            + \" service.\"\n                    );\n                    writer.openBlock(\"export class $L extends __ServiceException {\", serviceExceptionName);\n                    writer.writeDocs(\"@internal\");\n                    writer.openBlock(\"constructor(options: __ServiceExceptionOptions) {\");\n                    writer.write(\"super(options);\");\n                    writer.write(\"Object.setPrototypeOf(this, $L.prototype);\", serviceExceptionName);\n                    writer.closeBlock(\"}\"); // constructor\n                    writer.closeBlock(\"}\"); // class\n                }\n            );\n        }\n    }\n\n    private void writeAdditionalExports(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        boolean isClientSdk = settings.generateClient();\n        if (isClientSdk) {\n            String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n            String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model);\n            writer.write(\"export { $1L } from \\\"./models/$1L\\\";\", serviceExceptionName);\n        }\n    }\n\n    /**\n     * For any error shape, add the reference of the base error class to the\n     * error symbol's references. In client SDK, the base error class is the\n     * service-specific service exception class. In server SDK, the base error\n     * class is the ServiceException class from server-common package.\n     */\n    @Override\n    public SymbolProvider decorateSymbolProvider(\n        Model model,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider\n    ) {\n        return shape -> {\n            Symbol symbol = symbolProvider.toSymbol(shape);\n            if (shape.hasTrait(ErrorTrait.class)) {\n                String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n                String baseExceptionAlias = \"__BaseException\";\n                SymbolReference reference;\n                if (settings.generateClient()) {\n                    String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model);\n                    String namespace = Paths.get(\".\", \"src\", \"models\", serviceExceptionName).toString();\n                    Symbol serviceExceptionSymbol = Symbol.builder()\n                        .name(serviceExceptionName)\n                        .namespace(namespace, \"/\")\n                        .definitionFile(namespace + \".ts\")\n                        .build();\n                    reference = SymbolReference.builder()\n                        .options(SymbolReference.ContextOption.USE)\n                        .alias(baseExceptionAlias)\n                        .symbol(serviceExceptionSymbol)\n                        .build();\n                } else {\n                    reference = SymbolReference.builder()\n                        .options(SymbolReference.ContextOption.USE)\n                        .alias(baseExceptionAlias)\n                        .symbol(TypeScriptDependency.SERVER_COMMON.createSymbol(\"ServiceException\"))\n                        .build();\n                }\n                return symbol.toBuilder().addReference(reference).build();\n            }\n            return symbol;\n        };\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddBuiltinPlugins.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin.Convention.HAS_MIDDLEWARE;\n\nimport java.util.List;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds all built-in runtime client plugins to clients.\n */\n@SmithyInternalApi\npublic class AddBuiltinPlugins implements TypeScriptIntegration {\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        // Note that order is significant because configurations might\n        // rely on previously resolved values.\n        return List.of(\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    \"@smithy/core/retry\",\n                    TypeScriptDependency.SMITHY_CORE.dependency.getVersion(),\n                    \"Retry\"\n                )\n                .build(),\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    \"@smithy/core/protocols\",\n                    TypeScriptDependency.SMITHY_CORE.dependency.getVersion(),\n                    \"ContentLength\",\n                    HAS_MIDDLEWARE\n                )\n                .build()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddChecksumRequiredDependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin.Convention.HAS_MIDDLEWARE;\n\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.HttpChecksumRequiredTrait;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds md5 checksum dependencies if needed.\n */\n@SmithyInternalApi\npublic final class AddChecksumRequiredDependency implements TypeScriptIntegration {\n\n    @Override\n    public void addConfigInterfaceFields(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        if (!hasMd5Dependency(model, settings.getService(model))) {\n            return;\n        }\n\n        writer.addImport(\"Readable\", null, \"stream\");\n        writer.addTypeImport(\"StreamHasher\", \"__StreamHasher\", TypeScriptDependency.SMITHY_TYPES);\n        writer.writeDocs(\n            \"A function that, given a hash constructor and a stream, calculates the \\n\" +\n                \"hash of the streamed value.\\n\" +\n                \"@internal\"\n        );\n        writer.write(\"streamHasher?: __StreamHasher<Readable> | __StreamHasher<Blob>;\\n\");\n\n        writer.addTypeImport(\"HashConstructor\", \"__HashConstructor\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addTypeImport(\"Checksum\", \"__Checksum\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addTypeImport(\"ChecksumConstructor\", \"__ChecksumConstructor\", TypeScriptDependency.SMITHY_TYPES);\n        writer.writeDocs(\n            \"\"\"\n            A constructor for a class implementing the {@link __Checksum} interface\n            that computes MD5 hashes.\n            @internal\"\"\"\n        );\n        writer.write(\"md5?: __ChecksumConstructor | __HashConstructor;\\n\");\n    }\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        if (!hasMd5Dependency(model, settings.getService(model))) {\n            return Collections.emptyMap();\n        }\n\n        switch (target) {\n            case NODE:\n                return MapUtils.of(\n                    \"streamHasher\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"fileStreamHasher\",\n                            \"streamHasher\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CHECKSUM\n                        );\n                        writer.write(\"streamHasher\");\n                    },\n                    \"md5\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"Hash\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.SERDE\n                        );\n                        writer.write(\"Hash.bind(null, \\\"md5\\\")\");\n                    }\n                );\n            case BROWSER:\n                return MapUtils.of(\n                    \"streamHasher\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"blobHasher\",\n                            \"streamHasher\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CHECKSUM\n                        );\n                        writer.write(\"streamHasher\");\n                    },\n                    \"md5\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"Md5\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CHECKSUM\n                        );\n                        writer.write(\"Md5\");\n                    }\n                );\n            default:\n                return Collections.emptyMap();\n        }\n    }\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        return ListUtils.of(\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    TypeScriptDependency.BODY_CHECKSUM.dependency,\n                    \"ApplyMd5BodyChecksum\",\n                    HAS_MIDDLEWARE\n                )\n                .operationPredicate((m, s, o) -> hasChecksumRequiredTrait(m, s, o))\n                .build()\n        );\n    }\n\n    // return true if operation shape is decorated with `httpChecksumRequired` trait.\n    private static boolean hasChecksumRequiredTrait(Model model, ServiceShape service, OperationShape operation) {\n        return operation.hasTrait(HttpChecksumRequiredTrait.class);\n    }\n\n    private static boolean hasMd5Dependency(Model model, ServiceShape service) {\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> operations = topDownIndex.getContainedOperations(service);\n        for (OperationShape operation : operations) {\n            if (hasChecksumRequiredTrait(model, service, operation)) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddClientRuntimeConfig.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.extensions.DefaultExtensionConfigurationInterface;\nimport software.amazon.smithy.typescript.codegen.extensions.ExtensionConfigurationInterface;\nimport software.amazon.smithy.typescript.codegen.extensions.HttpHandlerExtensionConfigurationInterface;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * All clients need to know the max attempt to retry a request and logger\n * instance to print the log.\n *\n * <p>This plugin adds the following config interface fields:\n *\n * <ul>\n *     <li>maxAttempts: Provides value for how many times a request will be\n *     made at most in case of retry.</li>\n *     <li>retryMode: Specifies which retry algorithm to use.</li>\n *     <li>logger: Optional logger for logging debug/info/warn/error.</li>\n * </ul>\n *\n * <p>This plugin adds the following Node runtime specific values:\n *\n * <ul>\n *     <li>maxAttempts: Uses the default maxAttempts provider that checks things\n *     like environment variables and the AWS config file.</li>\n *     <li>retryMode: Specifies which retry algorithm to use.</li>\n *     <li>logger: Sets to empty as logger is passed in client configuration.</li>\n * </ul>\n *\n * <p>This plugin adds the following Browser runtime specific values:\n *\n * <ul>\n *     <li>maxAttempts: Returns default value of 3.</li>\n *     <li>retryMode: Provider which returns DEFAULT_RETRY_MODE.</li>\n *     <li>logger: Sets to empty as logger is passed in client configuration.</li>\n * </ul>\n */\n@SmithyInternalApi\npublic final class AddClientRuntimeConfig implements TypeScriptIntegration {\n\n    @Override\n    public void addConfigInterfaceFields(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        writer.addTypeImport(\"Provider\", \"__Provider\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addTypeImport(\"Logger\", \"__Logger\", TypeScriptDependency.SMITHY_TYPES);\n\n        writer\n            .writeDocs(\"Value for how many times a request will be made at most in case of retry.\")\n            .write(\"maxAttempts?: number | __Provider<number>;\\n\");\n        writer\n            .writeDocs(\n                \"\"\"\n                Specifies which retry algorithm to use.\n                @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/\n                \"\"\"\n            )\n            .write(\"retryMode?: string | __Provider<string>;\\n\");\n        writer.writeDocs(\"Optional logger for logging debug/info/warn/error.\").write(\"logger?: __Logger;\\n\");\n        writer.addRelativeTypeImport(\n            \"RuntimeExtension\",\n            null,\n            Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"runtimeExtensions\")\n        );\n        writer.writeDocs(\"Optional extensions\").write(\"extensions?: RuntimeExtension[];\\n\");\n    }\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        switch (target) {\n            case SHARED:\n                return MapUtils.of(\"logger\", writer -> {\n                    writer.addImportSubmodule(\n                        \"NoOpLogger\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    writer.write(\"new NoOpLogger()\");\n                });\n            case BROWSER:\n                return MapUtils.of(\n                    \"maxAttempts\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"DEFAULT_MAX_ATTEMPTS\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.RETRY\n                        );\n                        writer.write(\"DEFAULT_MAX_ATTEMPTS\");\n                    },\n                    \"retryMode\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"DEFAULT_RETRY_MODE\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.RETRY\n                        );\n                        writer.write(\n                            \"(async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE)\"\n                        );\n                    }\n                );\n            case NODE:\n                return MapUtils.of(\n                    \"maxAttempts\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"loadConfig\",\n                            \"loadNodeConfig\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CONFIG\n                        );\n                        writer.addImportSubmodule(\n                            \"NODE_MAX_ATTEMPT_CONFIG_OPTIONS\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.RETRY\n                        );\n                        writer.write(\"loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config)\");\n                    },\n                    \"retryMode\",\n                    writer -> {\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"loadConfig\",\n                            \"loadNodeConfig\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CONFIG\n                        );\n                        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                        writer.addImportSubmodule(\n                            \"NODE_RETRY_MODE_CONFIG_OPTIONS\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.RETRY\n                        );\n                        writer.addImportSubmodule(\n                            \"DEFAULT_RETRY_MODE\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.RETRY\n                        );\n                        writer.indent();\n                        writer.writeInline(\n                            \"\"\"\n                            loadNodeConfig(\n                              {\n                                ...NODE_RETRY_MODE_CONFIG_OPTIONS,\n                                default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,\n                              },\n                              config\n                            )\"\"\"\n                        );\n                        writer.dedent();\n                    }\n                );\n            default:\n                return Collections.emptyMap();\n        }\n    }\n\n    @Override\n    public List<ExtensionConfigurationInterface> getExtensionConfigurationInterfaces(\n        Model model,\n        TypeScriptSettings settings\n    ) {\n        return List.of(new DefaultExtensionConfigurationInterface(), new HttpHandlerExtensionConfigurationInterface());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddCompressionDependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.function.Consumer;\nimport java.util.logging.Logger;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.RequestCompressionTrait;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds compression dependencies if needed.\n */\n@SmithyInternalApi\npublic final class AddCompressionDependency implements TypeScriptIntegration {\n\n    private static final Logger LOGGER = Logger.getLogger(AddCompressionDependency.class.getName());\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        if (!hasRequestCompressionTrait(model, settings.getService(model))) {\n            return Collections.emptyMap();\n        }\n\n        switch (target) {\n            case NODE:\n                return MapUtils.of(\n                    \"disableRequestCompression\",\n                    writer -> {\n                        writer.addImportSubmodule(\n                            \"loadConfig\",\n                            \"loadNodeConfig\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CONFIG\n                        );\n                        writer.addImport(\n                            \"NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS\",\n                            null,\n                            TypeScriptDependency.MIDDLEWARE_COMPRESSION\n                        );\n                        writer.write(\"loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config)\");\n                    },\n                    \"requestMinCompressionSizeBytes\",\n                    writer -> {\n                        writer.addImportSubmodule(\n                            \"loadConfig\",\n                            \"loadNodeConfig\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CONFIG\n                        );\n                        writer.addImport(\n                            \"NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS\",\n                            null,\n                            TypeScriptDependency.MIDDLEWARE_COMPRESSION\n                        );\n                        writer.write(\n                            \"loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config)\"\n                        );\n                    }\n                );\n            case BROWSER:\n                return MapUtils.of(\n                    \"disableRequestCompression\",\n                    writer -> {\n                        writer.addImport(\n                            \"DEFAULT_DISABLE_REQUEST_COMPRESSION\",\n                            null,\n                            TypeScriptDependency.MIDDLEWARE_COMPRESSION\n                        );\n                        writer.write(\"DEFAULT_DISABLE_REQUEST_COMPRESSION\");\n                    },\n                    \"requestMinCompressionSizeBytes\",\n                    writer -> {\n                        writer.addImport(\n                            \"DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES\",\n                            null,\n                            TypeScriptDependency.MIDDLEWARE_COMPRESSION\n                        );\n                        writer.write(\"DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES\");\n                    }\n                );\n            default:\n                return Collections.emptyMap();\n        }\n    }\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        return ListUtils.of(\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    TypeScriptDependency.MIDDLEWARE_COMPRESSION.dependency,\n                    \"Compression\",\n                    RuntimeClientPlugin.Convention.HAS_CONFIG\n                )\n                .servicePredicate((m, s) -> hasRequestCompressionTrait(m, s))\n                .build(),\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    TypeScriptDependency.MIDDLEWARE_COMPRESSION.dependency,\n                    \"Compression\",\n                    RuntimeClientPlugin.Convention.HAS_MIDDLEWARE\n                )\n                .additionalPluginFunctionParamsSupplier((m, s, o) -> getPluginFunctionParams(m, s, o))\n                .operationPredicate((m, s, o) -> hasRequestCompressionTrait(o))\n                .build()\n        );\n    }\n\n    private static Map<String, Object> getPluginFunctionParams(\n        Model model,\n        ServiceShape service,\n        OperationShape operation\n    ) {\n        Map<String, Object> params = new TreeMap<String, Object>();\n\n        // Populate encodings from requestCompression trait\n        RequestCompressionTrait requestCompressionTrait = operation.expectTrait(RequestCompressionTrait.class);\n        params.put(\"encodings\", requestCompressionTrait.getEncodings());\n\n        return params;\n    }\n\n    // return true if operation shape is decorated with `requestCompression` trait.\n    private static boolean hasRequestCompressionTrait(OperationShape operation) {\n        return operation.hasTrait(RequestCompressionTrait.class);\n    }\n\n    private static boolean hasRequestCompressionTrait(Model model, ServiceShape service) {\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> operations = topDownIndex.getContainedOperations(service);\n        for (OperationShape operation : operations) {\n            if (hasRequestCompressionTrait(operation)) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddDefaultsModeDependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds defaults mode dependencies if needed.\n */\n@SmithyInternalApi\npublic class AddDefaultsModeDependency implements TypeScriptIntegration {\n\n    @Override\n    public void addConfigInterfaceFields(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        // Dependencies used in the default runtime config template.\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n        writer.addTypeImportSubmodule(\n            \"DefaultsMode\",\n            \"__DefaultsMode\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n        writer.addTypeImport(\"Provider\", \"__Provider\", TypeScriptDependency.SMITHY_TYPES);\n        writer.writeDocs(\n            \"The {@link @smithy/smithy-client#DefaultsMode} that \" +\n                \"will be used to determine how certain default configuration \" +\n                \"options are resolved in the SDK.\"\n        );\n        writer.write(\"defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;\");\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddEventStreamDependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.EventStreamIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.sections.SmithyContextCodeSection;\nimport software.amazon.smithy.utils.CodeInterceptor;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds event streams if needed.\n */\n@SmithyInternalApi\npublic final class AddEventStreamDependency implements TypeScriptIntegration {\n\n    @Override\n    public List<String> runAfter() {\n        return List.of(new AddBuiltinPlugins().name());\n    }\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        return ListUtils.of(\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    \"@smithy/core/event-streams\",\n                    TypeScriptDependency.SMITHY_CORE.dependency.getVersion(),\n                    \"EventStreamSerde\",\n                    RuntimeClientPlugin.Convention.HAS_CONFIG\n                )\n                .servicePredicate(AddEventStreamDependency::hasEventStream)\n                .build()\n        );\n    }\n\n    @Override\n    public void addConfigInterfaceFields(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        if (!hasEventStream(model, settings.getService(model))) {\n            return;\n        }\n\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n        writer.addTypeImport(\n            \"EventStreamSerdeProvider\",\n            \"__EventStreamSerdeProvider\",\n            TypeScriptDependency.SMITHY_TYPES\n        );\n        writer.writeDocs(\"The function that provides necessary utilities for generating and parsing event stream\");\n        writer.write(\"eventStreamSerdeProvider?: __EventStreamSerdeProvider;\\n\");\n    }\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        if (!hasEventStream(model, settings.getService(model))) {\n            return Collections.emptyMap();\n        }\n        switch (target) {\n            case NODE:\n                return MapUtils.of(\"eventStreamSerdeProvider\", writer -> {\n                    writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                    writer.addImportSubmodule(\n                        \"eventStreamSerdeProvider\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.EVENT_STREAMS\n                    );\n                    writer.write(\"eventStreamSerdeProvider\");\n                });\n            case BROWSER:\n                return MapUtils.of(\"eventStreamSerdeProvider\", writer -> {\n                    writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                    writer.addImportSubmodule(\n                        \"eventStreamSerdeProvider\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.EVENT_STREAMS\n                    );\n                    writer.write(\"eventStreamSerdeProvider\");\n                });\n            default:\n                return Collections.emptyMap();\n        }\n    }\n\n    @Override\n    public List<? extends CodeInterceptor<? extends CodeSection, TypeScriptWriter>> interceptors(\n        TypeScriptCodegenContext codegenContext\n    ) {\n        return List.of(\n            CodeInterceptor.appender(SmithyContextCodeSection.class, (w, s) -> {\n                EventStreamIndex eventStreamIndex = EventStreamIndex.of(s.getModel());\n                boolean input = eventStreamIndex.getInputInfo(s.getOperation()).isPresent();\n                boolean output = eventStreamIndex.getOutputInfo(s.getOperation()).isPresent();\n                // If not event streaming for I/O, don't write anything\n                if (!input && !output) {\n                    return;\n                }\n                // Otherwise, write present input and output streaming\n                w.write(\"\").indent();\n                w.writeDocs(\"@internal\");\n                w.openBlock(\"eventStream: {\", \"},\", () -> {\n                    if (input) {\n                        w.write(\"input: true,\");\n                    }\n                    if (output) {\n                        w.write(\"output: true,\");\n                    }\n                });\n                w.dedent();\n            })\n        );\n    }\n\n    private static boolean hasEventStream(Model model, ServiceShape service) {\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> operations = topDownIndex.getContainedOperations(service);\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        for (OperationShape operation : operations) {\n            if (\n                eventStreamIndex.getInputInfo(operation).isPresent() ||\n                    eventStreamIndex.getOutputInfo(operation).isPresent()\n            ) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.nio.file.Paths;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.function.BiConsumer;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.HttpApiKeyAuthTrait;\nimport software.amazon.smithy.model.traits.OptionalAuthTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.IoUtils;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Add config and middleware to support a service with the @httpApiKeyAuth trait.\n *\n * This is legacy auth behavior, and is no longer in development.\n */\n@SmithyInternalApi\npublic final class AddHttpApiKeyAuthPlugin implements TypeScriptIntegration {\n\n    public static final String INTEGRATION_NAME = \"HttpApiKeyAuth\";\n\n    /**\n     * Integration should be used only if the `useLegacyAuth` flag is true.\n     */\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return settings.useLegacyAuth();\n    }\n\n    /**\n     * Plug into code generation for the client.\n     *\n     * This adds the configuration items to the client config and plugs in the\n     * middleware to operations that need it.\n     *\n     * The middleware will inject the client's configured API key into the\n     * request as defined by the @httpApiKeyAuth trait. If the trait says to\n     * put the API key into a named header, that header will be used, optionally\n     * prefixed with a scheme. If the trait says to put the API key into a named\n     * query parameter, that query parameter will be used.\n     */\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        return ListUtils.of(\n            // Add the config if the service uses HTTP API key authorization.\n            RuntimeClientPlugin.builder()\n                .inputConfig(\n                    Symbol.builder()\n                        .namespace(\n                            \"./\" + CodegenUtils.SOURCE_FOLDER + \"/middleware/\" + INTEGRATION_NAME,\n                            \"/\"\n                        )\n                        .name(\"HttpApiKeyAuthInputConfig\")\n                        .build()\n                )\n                .resolvedConfig(\n                    Symbol.builder()\n                        .namespace(\n                            \"./\" + CodegenUtils.SOURCE_FOLDER + \"/middleware/\" + INTEGRATION_NAME,\n                            \"/\"\n                        )\n                        .name(\"HttpApiKeyAuthResolvedConfig\")\n                        .build()\n                )\n                .resolveFunction(\n                    Symbol.builder()\n                        .namespace(\n                            \"./\" + CodegenUtils.SOURCE_FOLDER + \"/middleware/\" + INTEGRATION_NAME,\n                            \"/\"\n                        )\n                        .name(\"resolveHttpApiKeyAuthConfig\")\n                        .build()\n                )\n                .servicePredicate((m, s) -> hasEffectiveHttpApiKeyAuthTrait(m, s))\n                .build(),\n            // Add the middleware to operations that use HTTP API key authorization.\n            RuntimeClientPlugin.builder()\n                .pluginFunction(\n                    Symbol.builder()\n                        .namespace(\n                            \"./\" + CodegenUtils.SOURCE_FOLDER + \"/middleware/\" + INTEGRATION_NAME,\n                            \"/\"\n                        )\n                        .name(\"getHttpApiKeyAuthPlugin\")\n                        .build()\n                )\n                .additionalPluginFunctionParamsSupplier((m, s, o) -> new HashMap<String, Object>() {\n                    {\n                        // It's safe to do expectTrait() because the operation predicate ensures that the trait\n                        // exists `in` and `name` are required attributes of the trait, `scheme` is optional.\n                        put(\"in\", s.expectTrait(HttpApiKeyAuthTrait.class).getIn().toString());\n                        put(\"name\", s.expectTrait(HttpApiKeyAuthTrait.class).getName());\n                        s\n                            .expectTrait(HttpApiKeyAuthTrait.class)\n                            .getScheme()\n                            .ifPresent(scheme -> put(\"scheme\", scheme));\n                    }\n                })\n                .operationPredicate((m, s, o) -> hasEffectiveHttpApiKeyAuthTrait(m, s, o))\n                .build()\n        );\n    }\n\n    @Override\n    public void customize(TypeScriptCodegenContext codegenContext) {\n        TypeScriptSettings settings = codegenContext.settings();\n        Model model = codegenContext.model();\n        BiConsumer<String, Consumer<TypeScriptWriter>> writerFactory = codegenContext.writerDelegator()::useFileWriter;\n\n        writeAdditionalFiles(settings, model, writerFactory);\n\n        writerFactory.accept(Paths.get(CodegenUtils.SOURCE_FOLDER, \"index.ts\").toString(), writer -> {\n            writeAdditionalExports(settings, model, writer);\n        });\n    }\n\n    private void writeAdditionalFiles(\n        TypeScriptSettings settings,\n        Model model,\n        BiConsumer<String, Consumer<TypeScriptWriter>> writerFactory\n    ) {\n        ServiceShape service = settings.getService(model);\n\n        // If the service doesn't use HTTP API keys, we don't need to do anything and the generated\n        // code doesn't need any additional files.\n        if (!hasEffectiveHttpApiKeyAuthTrait(model, service)) {\n            return;\n        }\n\n        String noTouchNoticePrefix =\n            \"// Please do not touch this file. It's generated from a template in:\\n\" +\n                \"// https://github.com/smithy-lang/smithy-typescript/blob/main/smithy-typescript-codegen/\" +\n                \"src/main/resources/software/amazon/smithy/aws/typescript/codegen/integration/\";\n\n        // Write the middleware source.\n        writerFactory.accept(\n            Paths.get(CodegenUtils.SOURCE_FOLDER, \"middleware\", INTEGRATION_NAME, \"index.ts\").toString(),\n            writer -> {\n                writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                String source = IoUtils.readUtf8Resource(getClass(), \"http-api-key-auth.ts\");\n                writer.write(\"$L$L\", noTouchNoticePrefix, \"http-api-key-auth.ts\");\n                writer.write(\"$L\", source);\n            }\n        );\n    }\n\n    private void writeAdditionalExports(TypeScriptSettings settings, Model model, TypeScriptWriter writer) {\n        boolean isClientSdk = settings.generateClient();\n        ServiceShape service = settings.getService(model);\n        if (isClientSdk && hasEffectiveHttpApiKeyAuthTrait(model, service)) {\n            writer.write(\"export * from \\\"./middleware/$1L\\\";\", INTEGRATION_NAME);\n        }\n    }\n\n    // If no operations use it, then the service doesn't use it\n    private static boolean hasEffectiveHttpApiKeyAuthTrait(Model model, ServiceShape service) {\n        ServiceIndex serviceIndex = ServiceIndex.of(model);\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        for (OperationShape operation : topDownIndex.getContainedOperations(service)) {\n            if (operation.hasTrait(OptionalAuthTrait.ID)) {\n                continue;\n            }\n            if (serviceIndex.getEffectiveAuthSchemes(service, operation).containsKey(HttpApiKeyAuthTrait.ID)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private static boolean hasEffectiveHttpApiKeyAuthTrait(\n        Model model,\n        ServiceShape service,\n        OperationShape operation\n    ) {\n        if (operation.hasTrait(OptionalAuthTrait.class)) {\n            return false;\n        }\n        return ServiceIndex.of(model).getEffectiveAuthSchemes(service, operation).containsKey(HttpApiKeyAuthTrait.ID);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddProtocolConfig.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static software.amazon.smithy.typescript.codegen.schema.SchemaGenerator.SCHEMAS_FOLDER;\n\nimport java.nio.file.Paths;\nimport java.util.Collections;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.protocol.traits.Rpcv2CborTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaGenerationAllowlist;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds a protocol implementation to the runtime config.\n */\n@SmithyInternalApi\npublic final class AddProtocolConfig implements TypeScriptIntegration {\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        if (!SchemaGenerationAllowlist.allows(settings.getService(), settings)) {\n            return Collections.emptyMap();\n        }\n\n        String namespace = settings.getService().getNamespace();\n\n        switch (target) {\n            case SHARED:\n                if (Objects.equals(settings.getProtocol(), Rpcv2CborTrait.ID)) {\n                    return MapUtils.of(\n                        \"protocol\",\n                        writer -> {\n                            writer.addImportSubmodule(\n                                \"SmithyRpcV2CborProtocol\",\n                                null,\n                                TypeScriptDependency.SMITHY_CORE,\n                                \"/cbor\"\n                            );\n                            writer.write(\"SmithyRpcV2CborProtocol\");\n                        },\n                        \"protocolSettings\",\n                        writer -> {\n                            writer.addRelativeImport(\n                                \"errorTypeRegistries\",\n                                null,\n                                Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, SCHEMAS_FOLDER, \"schemas_0\")\n                            );\n                            writer.write(\n                                \"\"\"\n                                {\n                                  defaultNamespace: $S,\n                                  errorTypeRegistries,\n                                }\"\"\",\n                                namespace\n                            );\n                        }\n                    );\n                }\n            case BROWSER:\n            case NODE:\n            default:\n                return Collections.emptyMap();\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddSdkStreamMixinDependency.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Collections;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.utils.MapUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Add runtime config for injecting utility functions to consume the JavaScript\n * runtime-specific stream implementations.\n */\n@SmithyInternalApi\npublic final class AddSdkStreamMixinDependency implements TypeScriptIntegration {\n\n    @Override\n    public void addConfigInterfaceFields(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        if (!hasStreamingBlobDeser(settings, model)) {\n            return;\n        }\n\n        writer.addTypeImport(\"SdkStreamMixinInjector\", \"__SdkStreamMixinInjector\", TypeScriptDependency.SMITHY_TYPES);\n        writer.writeDocs(\n            \"The internal function that inject utilities to runtime-specific stream to help users\" +\n                \" consume the data\\n@internal\"\n        );\n        writer.write(\"sdkStreamMixin?: __SdkStreamMixinInjector;\\n\");\n    }\n\n    @Override\n    public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        if (!hasStreamingBlobDeser(settings, model)) {\n            return Collections.emptyMap();\n        }\n\n        if (target == LanguageTarget.SHARED) {\n            return MapUtils.of(\"sdkStreamMixin\", writer -> {\n                writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                writer.addImportSubmodule(\n                    \"sdkStreamMixin\",\n                    null,\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.SERDE\n                );\n                writer.write(\"sdkStreamMixin\");\n            });\n        } else {\n            return Collections.emptyMap();\n        }\n    }\n\n    private static boolean hasStreamingBlobDeser(TypeScriptSettings settings, Model model) {\n        ServiceShape serviceShape = settings.getService(model);\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> operations = topDownIndex.getContainedOperations(serviceShape);\n        for (OperationShape operation : operations) {\n            if (hasStreamingBlobDeser(settings, model, operation)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public static boolean hasStreamingBlobDeser(TypeScriptSettings settings, Model model, OperationShape operation) {\n        StructureShape ioShapeToDeser = (settings.generateServerSdk())\n            ? model.expectShape(operation.getInputShape()).asStructureShape().get()\n            : model.expectShape(operation.getOutputShape()).asStructureShape().get();\n        for (MemberShape member : ioShapeToDeser.members()) {\n            Shape shape = model.expectShape(member.getTarget());\n            if (shape instanceof BlobShape && shape.hasTrait(StreamingTrait.class)) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DefaultReadmeGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Arrays;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.traits.DocumentationTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.IoUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.StringUtils;\n\n@SmithyInternalApi\npublic final class DefaultReadmeGenerator implements TypeScriptIntegration {\n\n    public static final String README_FILENAME = \"README.md\";\n    public static final String DEFAULT_CLIENT_README_TEMPLATE = \"default_readme_client.md.template\";\n    public static final String DEFAULT_SERVER_README_TEMPLATE = \"default_readme_server.md.template\";\n\n    @Override\n    public void customize(TypeScriptCodegenContext codegenContext) {\n        TypeScriptSettings settings = codegenContext.settings();\n\n        if (!settings.createDefaultReadme()) {\n            return;\n        }\n\n        String file = settings.generateClient() ? DEFAULT_CLIENT_README_TEMPLATE : DEFAULT_SERVER_README_TEMPLATE;\n\n        Model model = codegenContext.model();\n\n        codegenContext\n            .writerDelegator()\n            .useFileWriter(README_FILENAME, \"\", writer -> {\n                ServiceShape service = settings.getService(model);\n                String resource = IoUtils.readUtf8Resource(getClass(), file);\n                resource = resource.replaceAll(Pattern.quote(\"${packageName}\"), settings.getPackageName());\n\n                String clientName = StringUtils.capitalize(service.getId().getName(service));\n\n                resource = resource.replaceAll(Pattern.quote(\"${serviceId}\"), clientName);\n\n                String rawDocumentation = service\n                    .getTrait(DocumentationTrait.class)\n                    .map(DocumentationTrait::getValue)\n                    .orElse(\"\");\n                String documentation = Arrays.asList(rawDocumentation.split(\"\\n\"))\n                    .stream()\n                    .map(StringUtils::trim)\n                    .collect(Collectors.joining(\"\\n\"));\n                resource = resource.replaceAll(\n                    Pattern.quote(\"${documentation}\"),\n                    Matcher.quoteReplacement(documentation)\n                );\n\n                TopDownIndex topDownIndex = TopDownIndex.of(model);\n                OperationShape firstOperation = topDownIndex.getContainedOperations(service).iterator().next();\n                String operationName = firstOperation.getId().getName(service);\n                resource = resource.replaceAll(Pattern.quote(\"${commandName}\"), operationName);\n\n                // The $ character is escaped using $$\n                writer.write(resource.replaceAll(Pattern.quote(\"$\"), Matcher.quoteReplacement(\"$$\")));\n            });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberDeserVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.knowledge.HttpBinding.Location;\nimport software.amazon.smithy.model.knowledge.HttpBindingIndex;\nimport software.amazon.smithy.model.shapes.BigDecimalShape;\nimport software.amazon.smithy.model.shapes.BigIntegerShape;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.BooleanShape;\nimport software.amazon.smithy.model.shapes.ByteShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.IntegerShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.LongShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.model.shapes.ShortShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Visitor to generate member values for aggregate types deserialized from documents.\n *\n * The standard implementations are as follows; these implementations may be\n * overridden unless otherwise specified.\n *\n * <ul>\n *   <li>Blob: base64 decoded.</li>\n *   <li>BigInteger: converted to JS BigInt.</li>\n *   <li>BigDecimal: converted to Big via {@code big.js}.</li>\n *   <li>Timestamp: converted to JS Date.</li>\n *   <li>Service, Operation, Resource, Member: not deserializable from documents. <b>Not overridable.</b></li>\n *   <li>Document, List, Map, Set, Structure, Union: delegated to a deserialization function.\n *     <b>Not overridable.</b></li>\n *   <li>All other types: unmodified.</li>\n * </ul>\n */\n@SmithyUnstableApi\npublic class DocumentMemberDeserVisitor implements ShapeVisitor<String> {\n\n    protected boolean serdeElisionEnabled;\n    private final GenerationContext context;\n    private final String dataSource;\n    private final Format defaultTimestampFormat;\n    private final SerdeElisionIndex serdeElisionIndex;\n\n    /**\n     * Constructor.\n     *\n     * @param context The generation context.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @param defaultTimestampFormat The default timestamp format used in absence\n     *                               of a TimestampFormat trait.\n     */\n    public DocumentMemberDeserVisitor(GenerationContext context, String dataSource, Format defaultTimestampFormat) {\n        this.context = context;\n        this.dataSource = dataSource;\n        this.defaultTimestampFormat = defaultTimestampFormat;\n        this.serdeElisionEnabled = false;\n        this.serdeElisionIndex = SerdeElisionIndex.of(context.getModel());\n    }\n\n    /**\n     * @return the member this visitor is being run against. Used to discover member-applied\n     * traits, such as @timestampFormat. Can be, and defaults, to, null.\n     */\n    protected MemberShape getMemberShape() {\n        return null;\n    }\n\n    /**\n     * @return true if string-formatted epoch seconds in payloads are disallowed. Defaults to false.\n     */\n    protected boolean requiresNumericEpochSecondsInPayload() {\n        return false;\n    }\n\n    /**\n     * Gets the generation context.\n     *\n     * @return The generation context.\n     */\n    protected final GenerationContext getContext() {\n        return context;\n    }\n\n    /**\n     * Gets the in-code location of the data to provide an output of\n     * ({@code output.foo}, {@code entry}, etc.).\n     *\n     * @return The data source.\n     */\n    protected final String getDataSource() {\n        return dataSource;\n    }\n\n    /**\n     * Gets the default timestamp format used in absence of a TimestampFormat trait.\n     *\n     * @return The default timestamp format.\n     */\n    protected final Format getDefaultTimestampFormat() {\n        return defaultTimestampFormat;\n    }\n\n    @Override\n    public String blobShape(BlobShape shape) {\n        return \"context.base64Decoder(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String booleanShape(BooleanShape shape) {\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectBoolean\",\n                \"__expectBoolean\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__expectBoolean(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String byteShape(ByteShape shape) {\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectByte\",\n                \"__expectByte\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__expectByte(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String shortShape(ShortShape shape) {\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectShort\",\n                \"__expectShort\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__expectShort(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String integerShape(IntegerShape shape) {\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectInt32\",\n                \"__expectInt32\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__expectInt32(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String longShape(LongShape shape) {\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectLong\",\n                \"__expectLong\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__expectLong(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String floatShape(FloatShape shape) {\n        context\n            .getWriter()\n            .addImportSubmodule(\n                \"limitedParseFloat32\",\n                \"__limitedParseFloat32\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__limitedParseFloat32(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String doubleShape(DoubleShape shape) {\n        context\n            .getWriter()\n            .addImportSubmodule(\n                \"limitedParseDouble\",\n                \"__limitedParseDouble\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__limitedParseDouble(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String stringShape(StringShape shape) {\n        return HttpProtocolGeneratorUtils.getStringOutputParam(context, shape, dataSource);\n    }\n\n    @Override\n    public String bigIntegerShape(BigIntegerShape shape) {\n        // BigInt is not supported across all environments, use big.js instead.\n        return deserializeToBigJs();\n    }\n\n    @Override\n    public String bigDecimalShape(BigDecimalShape shape) {\n        return deserializeToBigJs();\n    }\n\n    private String deserializeToBigJs() {\n        context.getWriter().addImport(\"Big\", \"__Big\", TypeScriptDependency.BIG_JS);\n        return \"__Big(\" + dataSource + \")\";\n    }\n\n    @Override\n    public final String operationShape(OperationShape shape) {\n        throw new CodegenException(\"Operation shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final String resourceShape(ResourceShape shape) {\n        throw new CodegenException(\"Resource shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final String serviceShape(ServiceShape shape) {\n        throw new CodegenException(\"Service shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final String memberShape(MemberShape shape) {\n        throw new CodegenException(\"Member shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public String timestampShape(TimestampShape shape) {\n        HttpBindingIndex httpIndex = HttpBindingIndex.of(context.getModel());\n        Format format;\n        if (getMemberShape() == null) {\n            format = httpIndex.determineTimestampFormat(shape, Location.DOCUMENT, defaultTimestampFormat);\n        } else {\n            if (!shape.getId().equals(getMemberShape().getTarget())) {\n                throw new IllegalArgumentException(\n                    String.format(\n                        \"Encountered timestamp shape %s that was not the target of member shape %s\",\n                        shape.getId(),\n                        getMemberShape().getId()\n                    )\n                );\n            }\n            format = httpIndex.determineTimestampFormat(getMemberShape(), Location.DOCUMENT, defaultTimestampFormat);\n        }\n\n        return HttpProtocolGeneratorUtils.getTimestampOutputParam(\n            context.getWriter(),\n            dataSource,\n            Location.DOCUMENT,\n            shape,\n            format,\n            requiresNumericEpochSecondsInPayload(),\n            context.getSettings().generateClient()\n        );\n    }\n\n    @Override\n    public final String documentShape(DocumentShape shape) {\n        return getDelegateDeserializer(shape);\n    }\n\n    @Override\n    public final String listShape(ListShape shape) {\n        return getDelegateDeserializer(shape);\n    }\n\n    @Override\n    public final String mapShape(MapShape shape) {\n        return getDelegateDeserializer(shape);\n    }\n\n    @Override\n    public final String setShape(SetShape shape) {\n        return getDelegateDeserializer(shape);\n    }\n\n    @Override\n    public final String structureShape(StructureShape shape) {\n        return getDelegateDeserializer(shape);\n    }\n\n    @Override\n    public String unionShape(UnionShape shape) {\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectUnion\",\n                \"__expectUnion\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return getDelegateDeserializer(shape, \"__expectUnion(\" + dataSource + \")\");\n    }\n\n    private String getDelegateDeserializer(Shape shape) {\n        return getDelegateDeserializer(shape, dataSource);\n    }\n\n    private String getDelegateDeserializer(Shape shape, String customDataSource) {\n        // Use the shape for the function name.\n        Symbol symbol = context.getSymbolProvider().toSymbol(shape);\n\n        if (serdeElisionEnabled && serdeElisionIndex.mayElide(shape)) {\n            context.getWriter()\n                .addImportSubmodule(\"_json\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n            return \"_json(\" + customDataSource + \")\";\n        }\n\n        return ProtocolGenerator.getDeserFunctionShortName(symbol) + \"(\" + customDataSource + \", context)\";\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberSerVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.knowledge.HttpBinding.Location;\nimport software.amazon.smithy.model.knowledge.HttpBindingIndex;\nimport software.amazon.smithy.model.shapes.BigDecimalShape;\nimport software.amazon.smithy.model.shapes.BigIntegerShape;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.BooleanShape;\nimport software.amazon.smithy.model.shapes.ByteShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.IntegerShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.LongShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.model.shapes.ShortShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Visitor to generate member values for aggregate types serialized in documents.\n *\n * The standard implementations are as follows; these implementations may be\n * overridden unless otherwise specified.\n *\n * <ul>\n *   <li>Blob: base64 encoded.</li>\n *   <li>BigInteger, BigDecimal: converted to strings to maintain precision.</li>\n *   <li>Timestamp: converted to a representation based on the specified format.</li>\n *   <li>Service, Operation, Resource, Member: not serializable in documents. <b>Not overridable.</b></li>\n *   <li>Document, List, Map, Set, Structure, Union: delegated to a serialization function.\n *     <b>Not overridable.</b></li>\n *   <li>All other types: unmodified.</li>\n * </ul>\n */\n@SmithyUnstableApi\npublic class DocumentMemberSerVisitor implements ShapeVisitor<String> {\n\n    protected boolean serdeElisionEnabled;\n    private final GenerationContext context;\n    private final String dataSource;\n    private final Format defaultTimestampFormat;\n    private final SerdeElisionIndex serdeElisionIndex;\n\n    /**\n     * Constructor.\n     *\n     * @param context The generation context.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param defaultTimestampFormat The default timestamp format used in absence\n     *                               of a TimestampFormat trait.\n     */\n    public DocumentMemberSerVisitor(GenerationContext context, String dataSource, Format defaultTimestampFormat) {\n        this.context = context;\n        this.dataSource = dataSource;\n        this.defaultTimestampFormat = defaultTimestampFormat;\n        this.serdeElisionEnabled = false;\n        this.serdeElisionIndex = SerdeElisionIndex.of(context.getModel());\n    }\n\n    /**\n     * @return the member this visitor is being run against. Used to discover member-applied\n     * traits, such as @xmlName. Can be, and defaults, to, null.\n     */\n    protected MemberShape getMemberShape() {\n        return null;\n    }\n\n    /**\n     * Gets the generation context.\n     *\n     * @return The generation context.\n     */\n    protected final GenerationContext getContext() {\n        return context;\n    }\n\n    /**\n     * Gets the in-code location of the data to provide an input of\n     * ({@code input.foo}, {@code entry}, etc.).\n     *\n     * @return The data source.\n     */\n    protected final String getDataSource() {\n        return dataSource;\n    }\n\n    /**\n     * Gets the default timestamp format used in absence of a TimestampFormat trait.\n     *\n     * @return The default timestamp format.\n     */\n    protected final Format getDefaultTimestampFormat() {\n        return defaultTimestampFormat;\n    }\n\n    @Override\n    public String blobShape(BlobShape shape) {\n        return \"context.base64Encoder(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String booleanShape(BooleanShape shape) {\n        return serializeUnmodified();\n    }\n\n    @Override\n    public String byteShape(ByteShape shape) {\n        return serializeUnmodified();\n    }\n\n    @Override\n    public String shortShape(ShortShape shape) {\n        return serializeUnmodified();\n    }\n\n    @Override\n    public String integerShape(IntegerShape shape) {\n        return serializeUnmodified();\n    }\n\n    @Override\n    public String longShape(LongShape shape) {\n        return serializeUnmodified();\n    }\n\n    @Override\n    public String floatShape(FloatShape shape) {\n        return handleFloat();\n    }\n\n    @Override\n    public String doubleShape(DoubleShape shape) {\n        return handleFloat();\n    }\n\n    private String handleFloat() {\n        context.getWriter()\n            .addImportSubmodule(\n                \"serializeFloat\",\n                \"__serializeFloat\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CLIENT\n            );\n        return \"__serializeFloat(\" + dataSource + \")\";\n    }\n\n    @Override\n    public String stringShape(StringShape shape) {\n        return HttpProtocolGeneratorUtils.getStringInputParam(context, shape, serializeUnmodified());\n    }\n\n    private String serializeUnmodified() {\n        return dataSource;\n    }\n\n    /**\n     * This should not be called, since big number serde is handled by format\n     * specific visitors.\n     */\n    @Override\n    public String bigIntegerShape(BigIntegerShape shape) {\n        if (context.getSettings() != null && context.getSettings().getBigNumberMode().equals(\"big.js\")) {\n            return serializeFromBigJs();\n        }\n        return \"String(\" + dataSource + \")\";\n    }\n\n    /**\n     * This should not be called, since big number serde is handled by format\n     * specific visitors.\n     */\n    @Override\n    public String bigDecimalShape(BigDecimalShape shape) {\n        if (context.getSettings() != null && context.getSettings().getBigNumberMode().equals(\"big.js\")) {\n            return serializeFromBigJs();\n        }\n        return \"String(\" + dataSource + \")\";\n    }\n\n    private String serializeFromBigJs() {\n        return dataSource + \".toJSON()\";\n    }\n\n    @Override\n    public final String operationShape(OperationShape shape) {\n        throw new CodegenException(\"Operation shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final String resourceShape(ResourceShape shape) {\n        throw new CodegenException(\"Resource shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final String serviceShape(ServiceShape shape) {\n        throw new CodegenException(\"Service shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final String memberShape(MemberShape shape) {\n        throw new CodegenException(\"Member shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public String timestampShape(TimestampShape shape) {\n        HttpBindingIndex httpIndex = HttpBindingIndex.of(context.getModel());\n        Format format = httpIndex.determineTimestampFormat(shape, Location.DOCUMENT, defaultTimestampFormat);\n        return HttpProtocolGeneratorUtils.getTimestampInputParam(context, dataSource, shape, format);\n    }\n\n    @Override\n    public final String documentShape(DocumentShape shape) {\n        return getDelegateSerializer(shape);\n    }\n\n    @Override\n    public final String listShape(ListShape shape) {\n        return getDelegateSerializer(shape);\n    }\n\n    @Override\n    public final String mapShape(MapShape shape) {\n        return getDelegateSerializer(shape);\n    }\n\n    @Override\n    public final String setShape(SetShape shape) {\n        return getDelegateSerializer(shape);\n    }\n\n    @Override\n    public final String structureShape(StructureShape shape) {\n        return getDelegateSerializer(shape);\n    }\n\n    @Override\n    public final String unionShape(UnionShape shape) {\n        return getDelegateSerializer(shape);\n    }\n\n    private String getDelegateSerializer(Shape shape) {\n        // Use the shape for the function name.\n        Symbol symbol = context.getSymbolProvider().toSymbol(shape);\n\n        if (serdeElisionEnabled && serdeElisionIndex.mayElide(shape)) {\n            context.getWriter()\n                .addImportSubmodule(\"_json\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n            return \"_json(\" + dataSource + \")\";\n        }\n\n        return ProtocolGenerator.getSerFunctionShortName(symbol) + \"(\" + dataSource + \", context)\";\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentShapeDeserVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Set;\nimport java.util.function.BiConsumer;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Visitor to generate deserialization functions for shapes in protocol document bodies.\n *\n * Visitor methods for aggregate types are final and will generate functions that dispatch\n * their loading from the body to the matching abstract method. The {@link DocumentMemberDeserVisitor}\n * is provided to reduce the effort of this implementation by providing the default strategies\n * for deserializing content from aggregate type members.\n *\n * Visitor methods for all other types will default to not generating deserialization\n * functions. This may be overwritten by downstream implementations if the protocol requires\n * more complex deserialization strategies for those types.\n *\n * This class reduces the effort necessary to build protocol implementations, specifically when\n * implementing {@link HttpBindingProtocolGenerator#generateDocumentBodyShapeDeserializers(GenerationContext, Set)}.\n *\n * Implementations of this class independent of protocol documents are also possible.\n *\n * The standard implementation is as follows; no assumptions are made about the protocol\n * being generated for.\n *\n * <ul>\n *   <li>Service, Operation, Resource: no function generated. <b>Not overridable.</b></li>\n *   <li>Document, List, Map, Set, Structure, Union: generates a deserialization function.\n *     <b>Not overridable.</b></li>\n *   <li>All other types: no function generated. <b>May be overridden.</b></li>\n * </ul>\n */\n@SmithyUnstableApi\npublic abstract class DocumentShapeDeserVisitor extends ShapeVisitor.Default<Void> {\n\n    protected boolean serdeElisionEnabled;\n    private final GenerationContext context;\n\n    public DocumentShapeDeserVisitor(GenerationContext context) {\n        this.context = context;\n        this.serdeElisionEnabled = false;\n    }\n\n    /**\n     * Gets the generation context.\n     *\n     * @return The generation context.\n     */\n    protected final GenerationContext getContext() {\n        return context;\n    }\n\n    @Override\n    protected Void getDefault(Shape shape) {\n        return null;\n    }\n\n    /**\n     * Writes the code needed to deserialize a collection in the document of a response.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns the type generated for the CollectionShape {@code shape} parameter from an input\n     * deserialized by {@code deserializeOutputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * list ParameterList {\n     *     member: Parameter\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code output: any}: a value for the CollectionShape shape parameter deserialized from the document.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies an {@code Array&lt;Parameter&gt;} return type.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * return (output || []).map((entry: any) =>\n     *   deserializeAws_restJson1_1Parameter(entry, context)\n     * );\n     * }</pre>\n     *\n     * <p>{@code Set} types will be generated appropriately for signatures when given.\n     *\n     * @param context The generation context.\n     * @param shape The collection shape being generated.\n     */\n    protected abstract void deserializeCollection(GenerationContext context, CollectionShape shape);\n\n    /**\n     * Writes the code needed to deserialize a document in the document of a response.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns the type generated for the DocumentShape {@code shape} parameter from an input\n     * deserialized by {@code deserializeDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * document FooDocument\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code output: any}: a value for the DocumentShape shape parameter deserialized from the document.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies a {@code FooDocument} return type.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * return JSON.parse(output);\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The document shape being generated.\n     */\n    protected abstract void deserializeDocument(GenerationContext context, DocumentShape shape);\n\n    /**\n     * Writes the code needed to deserialize a map in the document of a response.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns the type generated for the MapShape {@code shape} parameter from an input\n     * deserialized by {@code deserializeOutputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * map FieldMap {\n     *     key: String,\n     *     value: Field\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code output: any}: a value for the MapShape shape parameter deserialized from the document.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies a {@code Record<string, Field>} return type.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * let mapParams: any = {};\n     * Object.keys(output).forEach(key => {\n     *   mapParams[key] = deserializeAws_restJson1_1Field(output[key], context);\n     * });\n     * return mapParams;\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The map shape being generated.\n     */\n    protected abstract void deserializeMap(GenerationContext context, MapShape shape);\n\n    /**\n     * Writes the code needed to deserialize a structure in the document of a response.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns the type generated for the StructureShape {@code shape} parameter from an input\n     * deserialized by {@code deserializeOutputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * structure Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code output: any}: a value for the StructureShape shape parameter deserialized from the document.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies a {@code Field} return.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * let contents: any = {\n     *   fooValue: undefined,\n     *   barValue: undefined,\n     * };\n     * if (output.fooValue !== undefined) {\n     *   contents.fooValue = deserializeAws_restJson1_1Foo(output.fooValue, context);\n     * }\n     * if (output.barValue !== undefined) {\n     *   contents.barValue = output.barValue;\n     * }\n     * return contents;\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The structure shape being generated.\n     */\n    protected abstract void deserializeStructure(GenerationContext context, StructureShape shape);\n\n    /**\n     * Writes the code needed to deserialize a union in the document of a response.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns the type generated for the UnionShape {@code shape} parameter from an input\n     * deserialized by {@code deserializeOutputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * union Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code output: any}: a value for the UnionShape shape parameter deserialized from the document.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies a {@code Field} return type.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * if (output.fooValue !== undefined) {\n     *   return {\n     *     fooValue: deserializeAws_restJson1_1Foo(output.fooValue, context)\n     *   };\n     * }\n     * if (output.barValue !== undefined) {\n     *   return {\n     *     barValue: output.barValue\n     *   };\n     * }\n     * return { $unknown: output[Object.keys(output)[0]] };\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The union shape being generated.\n     */\n    protected abstract void deserializeUnion(GenerationContext context, UnionShape shape);\n\n    /**\n     * Generates a function for serializing the input shape, dispatching the body generation\n     * to the supplied function.\n     *\n     * @param shape The shape to generate a serializer for.\n     * @param functionBody An implementation that will generate a function body to\n     *                     serialize the shape.\n     */\n    protected final void generateDeserFunction(Shape shape, BiConsumer<GenerationContext, Shape> functionBody) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        TypeScriptWriter writer = context.getWriter();\n\n        Symbol symbol = symbolProvider.toSymbol(shape);\n        // Use the shape name for the function name.\n        String methodName = ProtocolGenerator.getDeserFunctionShortName(symbol);\n        String methodLongName = ProtocolGenerator.getDeserFunctionName(symbol, context.getProtocolName());\n\n        boolean mayElide = serdeElisionEnabled && SerdeElisionIndex.of(context.getModel()).mayElide(shape);\n        if (mayElide) {\n            writer.write(\"// \" + methodName + \" omitted.\");\n            writer.write(\"\");\n        } else {\n            writer.addImport(symbol, symbol.getName());\n            writer.writeDocs(methodLongName);\n            writer.openBlock(\n                \"const $L = (\\n\" + \"  output: any,\\n\" + \"  context: __SerdeContext\\n\" + \"): $T => {\",\n                \"}\",\n                methodName,\n                symbol,\n                () -> functionBody.accept(context, shape)\n            );\n            writer.write(\"\");\n        }\n    }\n\n    @Override\n    public final Void operationShape(OperationShape shape) {\n        throw new CodegenException(\"Operation shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final Void resourceShape(ResourceShape shape) {\n        throw new CodegenException(\"Resource shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final Void serviceShape(ServiceShape shape) {\n        throw new CodegenException(\"Service shapes cannot be bound to documents.\");\n    }\n\n    /**\n     * Dispatches to create the body of map shape deserialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * document FooDocument\n     * }</pre>\n     *\n     * <p>The following code is generated for a deserializer</p>\n     *\n     * <pre>{@code\n     * const deserializeAws_restJson1_1FooDocument = (\n     *   output: any,\n     *   context: SerdeContext\n     * ): FooDocument => {\n     *   return JSON.parse(output);\n     * }\n     * }</pre>\n     * @param shape The map shape to generate deserialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void documentShape(DocumentShape shape) {\n        generateDeserFunction(shape, (c, s) -> deserializeDocument(c, s.asDocumentShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of list shape deserialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * list ParameterList {\n     *     member: Parameter\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a deserializer</p>\n     *\n     * <pre>{@code\n     * const deserializeAws_restJson1_1ParameterList = (\n     *   output: any,\n     *   context: SerdeContext\n     * ): Parameter[] => {\n     *   return (output || []).map((entry: any) =>\n     *     deserializeAws_restJson1_1Parameter(entry, context)\n     *   );\n     * }\n     * }</pre>\n     *\n     * @param shape The list shape to generate deserialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void listShape(ListShape shape) {\n        generateDeserFunction(shape, (c, s) -> deserializeCollection(c, s.asListShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of map shape deserialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * map FieldMap {\n     *     key: String,\n     *     value: Field\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a deserializer</p>\n     *\n     * <pre>{@code\n     * const deserializeAws_restJson1_1FieldMap = (\n     *   output: any,\n     *   context: SerdeContext\n     * ): Record<string, Field> => {\n     *   let mapParams: any = {};\n     *   Object.keys(output).forEach(key => {\n     *     mapParams[key] = deserializeAws_restJson1_1Field(output[key], context);\n     *   });\n     *   return mapParams;\n     * }\n     * }</pre>\n     * @param shape The map shape to generate deserialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void mapShape(MapShape shape) {\n        generateDeserFunction(shape, (c, s) -> deserializeMap(c, s.asMapShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of set shape deserialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * set ParameterSet {\n     *     member: Parameter\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a deserializer</p>\n     *\n     * <pre>{@code\n     * const deserializeAws_restJson1_1ParameterSet = (\n     *   output: any,\n     *   context: SerdeContext\n     * ): Parameter[] => {\n     *   return (output || []).map((entry: any) =>\n     *     deserializeAws_restJson1_1Parameter(entry, context)\n     *   );\n     * }\n     * }</pre>\n     *\n     * @param shape The set shape to generate deserialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void setShape(SetShape shape) {\n        generateDeserFunction(shape, (c, s) -> deserializeCollection(c, s.asSetShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of structure shape deserialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * structure Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a deserializer</p>\n     *\n     * <pre>{@code\n     * const deserializeAws_restJson1_1Field = (\n     *   output: any,\n     *   context: SerdeContext\n     * ): Field => {\n     *   let field: any = {\n     *     fooValue: undefined,\n     *     barValue: undefined,\n     *   };\n     *   if (output.fooValue !== undefined) {\n     *     field.fooValue = deserializeAws_restJson1_1Foo(output.fooValue, context);\n     *   }\n     *   if (output.barValue !== undefined) {\n     *     field.barValue = output.barValue;\n     *   }\n     *   return field;\n     * }\n     * }</pre>\n     *\n     * @param shape The structure shape to generate deserialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void structureShape(StructureShape shape) {\n        generateDeserFunction(shape, (c, s) -> deserializeStructure(c, s.asStructureShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of union shape deserialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * union Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a deserializer</p>\n     *\n     * <pre>{@code\n     * const deserializeAws_restJson1_1Field = (\n     *   output: any,\n     *   context: SerdeContext\n     * ): Field => {\n     *   if (output.fooValue !== undefined) {\n     *     return {\n     *       fooValue: deserializeAws_restJson1_1Foo(output.fooValue, context)\n     *     };\n     *   }\n     *   if (output.barValue !== undefined) {\n     *     return {\n     *       barValue: output.barValue\n     *     };\n     *   }\n     *   return { $unknown: output[Object.keys(output)[0]] };\n     * }\n     * }</pre>\n     *\n     * @param shape The union shape to generate deserialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void unionShape(UnionShape shape) {\n        generateDeserFunction(shape, (c, s) -> deserializeUnion(c, s.asUnionShape().get()));\n        return null;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentShapeSerVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Set;\nimport java.util.function.BiConsumer;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Visitor to generate serialization functions for shapes in protocol document bodies.\n *\n * Visitor methods for aggregate types are final and will generate functions that dispatch\n * their body generation to the matching abstract method. The {@link DocumentMemberSerVisitor}\n * is provided to reduce the effort of this implementation by providing the default strategies\n * for serializing content from aggregate type members.\n *\n * Visitor methods for all other types will default to not generating serialization functions.\n * This may be overwritten by downstream implementations if the protocol requires more\n * complex serialization strategies for those types.\n *\n * This class reduces the effort necessary to build protocol implementations, specifically when\n * implementing {@link HttpBindingProtocolGenerator#generateDocumentBodyShapeSerializers(GenerationContext, Set)}.\n *\n * Implementations of this class independent of protocol documents are also possible.\n *\n * The standard implementation is as follows; no assumptions are made about the protocol\n * being generated for.\n *\n * <ul>\n *   <li>Service, Operation, Resource: no function generated. <b>Not overridable.</b></li>\n *   <li>Document, List, Map, Set, Structure, Union: generates a serialization function.\n *     <b>Not overridable.</b></li>\n *   <li>All other types: no function generated. <b>May be overridden.</b></li>\n * </ul>\n */\n@SmithyUnstableApi\npublic abstract class DocumentShapeSerVisitor extends ShapeVisitor.Default<Void> {\n\n    protected boolean serdeElisionEnabled;\n    private final GenerationContext context;\n\n    public DocumentShapeSerVisitor(GenerationContext context) {\n        this.context = context;\n        this.serdeElisionEnabled = false;\n    }\n\n    /**\n     * Gets the generation context.\n     *\n     * @return The generation context.\n     */\n    protected final GenerationContext getContext() {\n        return context;\n    }\n\n    @Override\n    protected Void getDefault(Shape shape) {\n        return null;\n    }\n\n    /**\n     * Writes the code needed to serialize a collection in the document of a request.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns a value representing the CollectionShape {@code shape} parameter that is\n     * serializable by {@code serializeInputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * list ParameterList {\n     *     member: Parameter\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code input: Array&lt;Parameter&gt;}: the type generated for the CollectionShape shape parameter.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies an {@code any} return type; the function body\n     * should return a value serializable by {@code serializeInputDocument}.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * return (input || []).map(entry =>\n     *   serializeAws_restJson1_1Parameter(entry, context)\n     * );\n     * }</pre>\n     *\n     * <p>{@code Set} types will be generated appropriately for signatures when given.\n     *\n     * @param context The generation context.\n     * @param shape The collection shape being generated.\n     */\n    protected abstract void serializeCollection(GenerationContext context, CollectionShape shape);\n\n    /**\n     * Writes the code needed to serialize a document in the document of a request.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns a value representing the DocumentShape {@code shape} parameter that is\n     * serializable by {@code serializeInputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * document FooDocument\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code input: FooDocument}: the type generated for the DocumentShape shape parameter.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies an {@code any} return type; the function body\n     * should return a value serializable by {@code serializeInputDocument}.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * return JSON.stringify(input);\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The document shape being generated.\n     */\n    protected abstract void serializeDocument(GenerationContext context, DocumentShape shape);\n\n    /**\n     * Writes the code needed to serialize a map in the document of a request.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns a value representing the MapShape {@code shape} parameter that is\n     * serializable by {@code serializeInputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * map FieldMap {\n     *     key: String,\n     *     value: Field\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code input: Record<string, Field>}: the type generated for the MapShape shape parameter.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies an {@code any} return type; the function body\n     * should return a value serializable by {@code serializeInputDocument}.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * let mapParams: any = {};\n     * Object.keys(input).forEach(key => {\n     *   mapParams[key] = serializeAws_restJson1_1Field(input[key], context);\n     * });\n     * return mapParams;\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The map shape being generated.\n     */\n    protected abstract void serializeMap(GenerationContext context, MapShape shape);\n\n    /**\n     * Writes the code needed to serialize a structure in the document of a request.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns a value representing the StructureShape {@code shape} parameter that is\n     * serializable by {@code serializeInputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * structure Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code input: Field}: the type generated for the StructureShape shape parameter.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies an {@code any} return type; the function body\n     * should return a value serializable by {@code serializeInputDocument}.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * let bodyParams: any = {}\n     * if (input.fooValue !== undefined) {\n     *   bodyParams['fooValue'] = serializeAws_restJson1_1Foo(input.fooValue, context);\n     * }\n     * if (input.barValue !== undefined) {\n     *   bodyParams['barValue'] = input.barValue;\n     * }\n     * return bodyParams;\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The structure shape being generated.\n     */\n    protected abstract void serializeStructure(GenerationContext context, StructureShape shape);\n\n    /**\n     * Writes the code needed to serialize a union in the document of a request.\n     *\n     * <p>Implementations of this method are expected to generate a function body that\n     * returns a value representing the UnionShape {@code shape} parameter that is\n     * serializable by {@code serializeInputDocument}.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * union Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The function signature for this body will have two parameters available in scope:\n     * <ul>\n     *   <li>{@code input: Field}: the type generated for the UnionShape shape parameter.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>The function signature specifies an {@code any} return type; the function body\n     * should return a value serializable by {@code serializeInputDocument}.\n     *\n     * <p>This function would generate the following:\n     *\n     * <pre>{@code\n     * return Field.visit(input, {\n     *   fooValue: value => serializeAws_restJson1_1Foo(value, context),\n     *   barValue: value => value,\n     *   _: value => value\n     * });\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param shape The union shape being generated.\n     */\n    protected abstract void serializeUnion(GenerationContext context, UnionShape shape);\n\n    /**\n     * Generates a function for serializing the input shape, dispatching the body generation\n     * to the supplied function.\n     *\n     * @param shape The shape to generate a serializer for.\n     * @param functionBody An implementation that will generate a function body to\n     *                     serialize the shape.\n     */\n    private void generateSerFunction(Shape shape, BiConsumer<GenerationContext, Shape> functionBody) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        TypeScriptWriter writer = context.getWriter();\n\n        Symbol symbol = symbolProvider.toSymbol(shape);\n        // Use the shape name for the function name.\n        String methodName = ProtocolGenerator.getSerFunctionShortName(symbol);\n        String methodLongName = ProtocolGenerator.getSerFunctionName(symbol, context.getProtocolName());\n\n        writer.addImport(symbol, symbol.getName());\n\n        boolean mayElide = serdeElisionEnabled && SerdeElisionIndex.of(context.getModel()).mayElide(shape);\n        if (mayElide) {\n            writer.write(\"// \" + methodName + \" omitted.\");\n            writer.write(\"\");\n        } else {\n            writer.writeDocs(methodLongName);\n            writer.openBlock(\n                \"const $L = (\\n\" + \"  input: $T,\\n\" + \"  context: __SerdeContext\\n\" + \"): any => {\",\n                \"}\",\n                methodName,\n                symbol,\n                () -> functionBody.accept(context, shape)\n            );\n            writer.write(\"\");\n        }\n    }\n\n    @Override\n    public final Void operationShape(OperationShape shape) {\n        throw new CodegenException(\"Operation shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final Void resourceShape(ResourceShape shape) {\n        throw new CodegenException(\"Resource shapes cannot be bound to documents.\");\n    }\n\n    @Override\n    public final Void serviceShape(ServiceShape shape) {\n        throw new CodegenException(\"Service shapes cannot be bound to documents.\");\n    }\n\n    /**\n     * Dispatches to create the body of document shape serialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * document FooDocument\n     * }</pre>\n     *\n     * <p>The following code is generated for a serializer:\n     *\n     * <pre>{@code\n     * const serializeAws_restJson1_1FooDocument = (\n     *   input: FooDocument,\n     *   context: SerdeContext\n     * ): any => {\n     *   return JSON.stringify(input);\n     * }\n     * }</pre>\n     *\n     * @param shape The document shape to generate serialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void documentShape(DocumentShape shape) {\n        generateSerFunction(shape, (c, s) -> serializeDocument(c, s.asDocumentShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of list shape serialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * list ParameterList {\n     *     member: Parameter\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a serializer:\n     *\n     * <pre>{@code\n     * const serializeAws_restJson1_1ParametersList = (\n     *   input: Parameter[],\n     *   context: SerdeContext\n     * ): any => {\n     *   return (input || []).map(entry =>\n     *     serializeAws_restJson1_1Parameter(entry, context)\n     *   );\n     * }\n     * }</pre>\n     *\n     * @param shape The list shape to generate serialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void listShape(ListShape shape) {\n        generateSerFunction(shape, (c, s) -> serializeCollection(c, s.asListShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of map shape serialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * map FieldMap {\n     *     key: String,\n     *     value: Field\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a serializer:\n     *\n     * <pre>{@code\n     * const serializeAws_restJson1_1FieldMap = (\n     *   input: Record<string, Field>,\n     *   context: SerdeContext\n     * ): any => {\n     *   let mapParams: any = {};\n     *   Object.keys(input).forEach(key => {\n     *     mapParams[key] = serializeAws_restJson1_1Field(input[key], context);\n     *   });\n     *   return mapParams;\n     * }\n     * }</pre>\n     *\n     * @param shape The map shape to generate serialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void mapShape(MapShape shape) {\n        generateSerFunction(shape, (c, s) -> serializeMap(c, s.asMapShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of set shape serialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * set ParameterSet {\n     *     member: Parameter\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a serializer:\n     *\n     * <pre>{@code\n     * const serializeAws_restJson1_1ParametersSet = (\n     *   input: Parameter[],\n     *   context: SerdeContext\n     * ): any => {\n     *   return (input || []).map(entry =>\n     *     serializeAws_restJson1_1Parameter(entry, context)\n     *   );\n     * }\n     * }</pre>\n     *\n     * @param shape The set shape to generate serialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void setShape(SetShape shape) {\n        generateSerFunction(shape, (c, s) -> serializeCollection(c, s.asSetShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of structure shape serialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * structure Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a serializer:\n     *\n     * <pre>{@code\n     * const serializeAws_restJson1_1Field = (\n     *   input: Field,\n     *   context: SerdeContext\n     * ): any => {\n     *   let bodyParams: any = {}\n     *   if (input.fooValue !== undefined) {\n     *     bodyParams['fooValue'] = serializeAws_restJson1_1Foo(input.fooValue, context);\n     *   }\n     *   if (input.barValue !== undefined) {\n     *     bodyParams['barValue'] = input.barValue;\n     *   }\n     *   return bodyParams;\n     * }\n     * }</pre>\n     *\n     * @param shape The structure shape to generate serialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void structureShape(StructureShape shape) {\n        generateSerFunction(shape, (c, s) -> serializeStructure(c, s.asStructureShape().get()));\n        return null;\n    }\n\n    /**\n     * Dispatches to create the body of union shape serialization functions.\n     * The function signature will be generated.\n     *\n     * <p>For example, given the following Smithy model:\n     *\n     * <pre>{@code\n     * union Field {\n     *     fooValue: Foo,\n     *     barValue: String,\n     * }\n     * }</pre>\n     *\n     * <p>The following code is generated for a serializer:\n     *\n     * <pre>{@code\n     * const serializeAws_restJson1_1Field = (\n     *   input: Field,\n     *   context: SerdeContext\n     * ): any => {\n     *   return Field.visit(input, {\n     *     fooValue: value => serializeAws_restJson1_1Foo(value, context),\n     *     barValue: value => value,\n     *     _: value => value\n     *   });\n     * }\n     * }</pre>\n     *\n     * @param shape The union shape to generate serialization for.\n     * @return Null.\n     */\n    @Override\n    public final Void unionShape(UnionShape shape) {\n        generateSerFunction(shape, (c, s) -> serializeUnion(c, s.asUnionShape().get()));\n        return null;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/EventStreamGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.EventStreamIndex;\nimport software.amazon.smithy.model.knowledge.EventStreamInfo;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.EventHeaderTrait;\nimport software.amazon.smithy.model.traits.EventPayloadTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.Pair;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Evnetstream code generator.\n */\n@SmithyUnstableApi\npublic class EventStreamGenerator {\n\n    public static boolean isEventStreamShape(Shape shape) {\n        return shape instanceof UnionShape && shape.hasTrait(StreamingTrait.class);\n    }\n\n    public static boolean hasEventStreamInput(GenerationContext context, OperationShape operation) {\n        Model model = context.getModel();\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        return eventStreamIndex.getInputInfo(operation).isPresent();\n    }\n\n    public static UnionShape getEventStreamInputShape(GenerationContext context, OperationShape operation) {\n        Model model = context.getModel();\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        EventStreamInfo eventStreamInfo = eventStreamIndex.getInputInfo(operation).get();\n        return eventStreamInfo.getEventStreamTarget().asUnionShape().get();\n    }\n\n    public static boolean hasEventStreamOutput(GenerationContext context, OperationShape operation) {\n        Model model = context.getModel();\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        return eventStreamIndex.getOutputInfo(operation).isPresent();\n    }\n\n    public static UnionShape getEventStreamOutputShape(GenerationContext context, OperationShape operation) {\n        Model model = context.getModel();\n        EventStreamIndex eventStreamIndex = EventStreamIndex.of(model);\n        EventStreamInfo eventStreamInfo = eventStreamIndex.getOutputInfo(operation).get();\n        return eventStreamInfo.getEventStreamTarget().asUnionShape().get();\n    }\n\n    public static MemberShape getEventStreamMember(GenerationContext context, StructureShape struct) {\n        List<MemberShape> eventStreamMembers = struct\n            .members()\n            .stream()\n            .filter(shape -> {\n                Shape target = context.getModel().expectShape(shape.getTarget());\n                boolean targetStreaming = target.hasTrait(StreamingTrait.class);\n                boolean targetUnion = target.isUnionShape();\n                return targetUnion && targetStreaming;\n            })\n            .toList();\n\n        if (eventStreamMembers.isEmpty()) {\n            throw new CodegenException(\"No event stream member found in \" + struct.getId().toString());\n        } else if (eventStreamMembers.size() > 1) {\n            throw new CodegenException(\"More than one event stream member in \" + struct.getId().toString());\n        }\n        return eventStreamMembers.get(0);\n    }\n\n    /**\n     * Generate eventstream serializers, and related serializers for events.\n     * @param context Code generation context instance.\n     * @param service The service shape.\n     * @param documentContentType The default content-type value of current protocol.\n     * @param serializeInputEventDocumentPayload Function writes the code needed to serialize an event payload as a\n     *                                          protocol-specific document.\n     * @param documentShapesToSerialize The set of shapes that needs to be serialized as document payload.\n     *                                  Shapes that referred by event will be added.\n     */\n    public void generateEventStreamSerializers(\n        GenerationContext context,\n        ServiceShape service,\n        String documentContentType,\n        Runnable serializeInputEventDocumentPayload,\n        Set<Shape> documentShapesToSerialize\n    ) {\n        Model model = context.getModel();\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> operations = topDownIndex.getContainedOperations(service);\n        TreeSet<UnionShape> eventUnionsToSerialize = new TreeSet<>();\n        TreeSet<Pair<String, StructureShape>> eventShapesToMarshall =\n            new TreeSet<>((a, b) -> Objects.compare(a.getRight(), b.getRight(), StructureShape::compareTo));\n\n        for (OperationShape operation : operations) {\n            if (hasEventStreamInput(context, operation)) {\n                UnionShape eventsUnion = getEventStreamInputShape(context, operation);\n                eventUnionsToSerialize.add(eventsUnion);\n                eventsUnion\n                    .members()\n                    .forEach(member -> {\n                        eventShapesToMarshall.add(\n                            Pair.of(\n                                member.getMemberName(),\n                                model.expectShape(member.getTarget()).asStructureShape().get()\n                            )\n                        );\n                    });\n            }\n        }\n\n        eventUnionsToSerialize.forEach(eventsUnion -> {\n            generateEventStreamSerializer(context, eventsUnion);\n        });\n        SerdeElisionIndex serdeElisionIndex = SerdeElisionIndex.of(model);\n        eventShapesToMarshall.forEach(memberNameAndEvent -> {\n            generateEventMarshaller(\n                context,\n                memberNameAndEvent.getLeft(),\n                memberNameAndEvent.getRight(),\n                documentContentType,\n                serializeInputEventDocumentPayload,\n                documentShapesToSerialize,\n                serdeElisionIndex\n            );\n        });\n    }\n\n    /**\n     * Generate eventstream deserializers, and related deserializers for events.\n     * @param context Code generation context instance.\n     * @param service The service shape.\n     * @param errorShapesToDeserialize A set of error shapes referred by events will be added to this set.\n     * @param eventShapesToDeserialize A set of event shapes that needs to be treated as regular structure shapes will\n     *                                  be added to this set.\n     * @param isErrorCodeInBody A boolean that indicates if the error code for the implementing protocol is located in\n     *                          the error response body, meaning this generator will parse the body before attempting to\n     *                          load an error code.\n     */\n    public void generateEventStreamDeserializers(\n        GenerationContext context,\n        ServiceShape service,\n        Set<StructureShape> errorShapesToDeserialize,\n        Set<Shape> eventShapesToDeserialize,\n        boolean isErrorCodeInBody,\n        boolean serdeElisionEnabled,\n        SerdeElisionIndex serdeElisionIndex\n    ) {\n        Model model = context.getModel();\n\n        TopDownIndex topDownIndex = TopDownIndex.of(model);\n        Set<OperationShape> operations = topDownIndex.getContainedOperations(service);\n        TreeSet<UnionShape> eventUnionsToDeserialize = new TreeSet<>();\n        TreeSet<StructureShape> eventShapesToUnmarshall = new TreeSet<>();\n\n        for (OperationShape operation : operations) {\n            if (hasEventStreamOutput(context, operation)) {\n                UnionShape eventsUnion = getEventStreamOutputShape(context, operation);\n                eventUnionsToDeserialize.add(eventsUnion);\n                Set<StructureShape> eventShapes = eventsUnion\n                    .members()\n                    .stream()\n                    .map(member -> model.expectShape(member.getTarget()).asStructureShape().get())\n                    .collect(Collectors.toSet());\n                eventShapes.forEach(eventShapesToUnmarshall::add);\n            }\n        }\n\n        eventUnionsToDeserialize.forEach(eventsUnion -> {\n            generateEventStreamDeserializer(context, eventsUnion);\n        });\n        eventShapesToUnmarshall.forEach(event -> {\n            generateEventUnmarshaller(\n                context,\n                event,\n                errorShapesToDeserialize,\n                eventShapesToDeserialize,\n                isErrorCodeInBody,\n                serdeElisionEnabled,\n                serdeElisionIndex\n            );\n        });\n    }\n\n    private void generateEventStreamSerializer(GenerationContext context, UnionShape eventsUnion) {\n        String methodName = getSerFunctionName(context, eventsUnion);\n        String methodLongName = ProtocolGenerator.getSerFunctionName(\n            getSymbol(context, eventsUnion),\n            context.getProtocolName()\n        );\n        Symbol eventsUnionSymbol = getSymbol(context, eventsUnion);\n        TypeScriptWriter writer = context.getWriter();\n        Model model = context.getModel();\n        writer.addTypeImport(\"Message\", \"__Message\", TypeScriptDependency.SMITHY_TYPES);\n\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\"\"\"\n                         const $L = (\n                           input: any,\n                           context: $L\n                         ): any => {\"\"\", \"}\", methodName, getEventStreamSerdeContextType(context, eventsUnion), () -> {\n            Symbol materializedSymbol = eventsUnionSymbol.toBuilder().putProperty(\"typeOnly\", false).build();\n            writer.openBlock(\n                \"const eventMarshallingVisitor = (event: any): __Message => $T.visit(event, {\",\n                \"});\",\n                materializedSymbol,\n                () -> {\n                    eventsUnion\n                        .getAllMembers()\n                        .forEach((memberName, memberShape) -> {\n                            StructureShape target =\n                                model.expectShape(memberShape.getTarget(), StructureShape.class);\n                            String eventSerMethodName = getEventSerFunctionName(context, target);\n                            writer.write(\"$L: value => $L(value, context),\", memberName, eventSerMethodName);\n                        });\n                    writer.write(\"_: value => value as any\");\n                }\n            );\n            writer.write(\"return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);\");\n        });\n    }\n\n    private String getSerFunctionName(GenerationContext context, Shape shape) {\n        Symbol symbol = getSymbol(context, shape);\n        return ProtocolGenerator.getSerFunctionShortName(symbol);\n    }\n\n    public String getEventSerFunctionName(GenerationContext context, Shape shape) {\n        return getSerFunctionName(context, shape) + \"_event\";\n    }\n\n    private String getEventStreamSerdeContextType(GenerationContext context, UnionShape eventsUnion) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.addTypeImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        String contextType = \"__SerdeContext\";\n        if (eventsUnion.hasTrait(StreamingTrait.class)) {\n            writer.addTypeImport(\n                \"EventStreamSerdeContext\",\n                \"__EventStreamSerdeContext\",\n                TypeScriptDependency.SMITHY_TYPES\n            );\n            contextType += \" & __EventStreamSerdeContext\";\n        }\n        return contextType;\n    }\n\n    private Symbol getSymbol(GenerationContext context, Shape shape) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        return symbolProvider.toSymbol(shape);\n    }\n\n    public void generateEventMarshaller(\n        GenerationContext context,\n        String memberName,\n        StructureShape event,\n        String documentContentType,\n        Runnable serializeInputEventDocumentPayload,\n        Set<Shape> documentShapesToSerialize,\n        SerdeElisionIndex serdeElisionIndex\n    ) {\n        String methodName = getEventSerFunctionName(context, event);\n        Symbol symbol = getSymbol(context, event);\n        TypeScriptWriter writer = context.getWriter();\n        writer.addTypeImport(\"MessageHeaders\", \"__MessageHeaders\", TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\n            \"const $L = (\\n\" + \"  input: $T,\\n\" + \"  context: __SerdeContext\\n\" + \"): __Message => {\",\n            \"}\",\n            methodName,\n            symbol,\n            () -> {\n                writer.openBlock(\"const headers: __MessageHeaders = {\", \"}\", () -> {\n                    //fix headers required by event stream\n                    writer.write(\"\\\":event-type\\\": { type: \\\"string\\\", value: $S },\", memberName);\n                    writer.write(\"\\\":message-type\\\": { type: \\\"string\\\", value: \\\"event\\\" },\");\n                    writeEventContentTypeHeader(context, event, documentContentType);\n                });\n                writeEventHeaders(context, event);\n                writeEventBody(\n                    context,\n                    event,\n                    serializeInputEventDocumentPayload,\n                    documentShapesToSerialize,\n                    serdeElisionIndex\n                );\n                writer.openBlock(\"return { headers, body };\");\n            }\n        );\n    }\n\n    private void writeEventContentTypeHeader(\n        GenerationContext context,\n        StructureShape event,\n        String documentContentType\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        Optional<MemberShape> payloadMemberOptional = getEventPayloadMember(event);\n        Shape payloadShape = payloadMemberOptional\n            .map(member -> {\n                return context.getModel().expectShape(member.getTarget());\n            })\n            .orElse(event);\n        if (payloadShape instanceof BlobShape) {\n            writer.write(\"\\\":content-type\\\": { type: \\\"string\\\", value: \\\"application/octet-stream\\\" },\");\n        } else if (payloadShape instanceof StringShape) {\n            writer.write(\"\\\":content-type\\\": { type: \\\"string\\\", value: \\\"text/plain\\\" },\");\n        } else if (payloadShape instanceof StructureShape || payloadShape instanceof UnionShape) {\n            writer.write(\"\\\":content-type\\\": { type: \\\"string\\\", value: $S },\", documentContentType);\n        } else {\n            throw new CodegenException(\n                String.format(\"Unexpected shape type bound to event payload: `%s`\", payloadShape.getType())\n            );\n        }\n    }\n\n    private Optional<MemberShape> getEventPayloadMember(StructureShape event) {\n        List<MemberShape> payloadMembers = event\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(member -> member.hasTrait(EventPayloadTrait.class))\n            .collect(Collectors.toList());\n        return payloadMembers.isEmpty()\n            ? Optional.empty() // implicit payload\n            : Optional.of(payloadMembers.get(0));\n    }\n\n    private void writeEventHeaders(GenerationContext context, StructureShape event) {\n        TypeScriptWriter writer = context.getWriter();\n        Model model = context.getModel();\n        List<MemberShape> headerMembers = event\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(member -> member.hasTrait(EventHeaderTrait.class))\n            .collect(Collectors.toList());\n        for (MemberShape headerMember : headerMembers) {\n            String memberName = headerMember.getMemberName();\n            Shape target = model.expectShape(headerMember.getTarget());\n            writer.openBlock(\"if (input.$L != null) {\", \"}\", memberName, () -> {\n                if (target.isLongShape()) {\n                    writer.addImportSubmodule(\n                        \"Int64\",\n                        \"__Int64\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.EVENT_STREAMS\n                    );\n                    writer.write(\n                        \"headers[$1S] = { type: $2S, value: __Int64.fromNumber(input.$1L) }\",\n                        memberName,\n                        getEventHeaderType(target)\n                    );\n                } else {\n                    writer.write(\n                        \"headers[$1S] = { type: $2S, value: input.$1L }\",\n                        memberName,\n                        getEventHeaderType(target)\n                    );\n                }\n            });\n        }\n    }\n\n    /**\n     * The value of event header 'type' property of given shape.\n     */\n    private String getEventHeaderType(Shape shape) {\n        switch (shape.getType()) {\n            case BOOLEAN:\n            case BYTE:\n            case SHORT:\n            case INTEGER:\n            case LONG:\n            case STRING:\n            case TIMESTAMP:\n                return shape.getType().toString();\n            case BLOB:\n                return \"binary\";\n            default:\n                throw new IllegalArgumentException(\"Unsupported event header shape type: \" + shape.getType());\n        }\n    }\n\n    /**\n     * If the event has a member that has an explicit eventPayload trait, return the member.\n     */\n    private MemberShape getExplicitEventPayloadMember(StructureShape event) {\n        return event\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(member -> member.hasTrait(EventPayloadTrait.class))\n            .collect(Collectors.toList())\n            .get(0);\n    }\n\n    private void writeEventBody(\n        GenerationContext context,\n        StructureShape event,\n        Runnable serializeInputEventDocumentPayload,\n        Set<Shape> documentShapesToSerialize,\n        SerdeElisionIndex serdeElisionIndex\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        Optional<MemberShape> payloadMemberOptional = getEventPayloadMember(event);\n        writer.write(\"let body = new Uint8Array();\");\n        if (payloadMemberOptional.isPresent()) {\n            Shape payloadShape = context.getModel().expectShape(payloadMemberOptional.get().getTarget());\n            String payloadMemberName = payloadMemberOptional.get().getMemberName();\n            writer.openBlock(\"if (input.$L != null) {\", \"}\", payloadMemberName, () -> {\n                if (payloadShape instanceof BlobShape) {\n                    writer.write(\"body = input.$L;\", payloadMemberName);\n                } else if (payloadShape instanceof StringShape) {\n                    writer.write(\"body = context.utf8Decoder(input.$L);\", payloadMemberName);\n                } else if (payloadShape instanceof StructureShape || payloadShape instanceof UnionShape) {\n                    Symbol symbol = getSymbol(context, payloadShape);\n                    String serFunctionName = ProtocolGenerator.getSerFunctionShortName(symbol);\n                    boolean mayElide = serdeElisionIndex.mayElide(payloadShape);\n                    documentShapesToSerialize.add(payloadShape);\n                    if (mayElide) {\n                        writer.addImportSubmodule(\n                            \"_json\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CLIENT\n                        );\n                        writer.write(\"body = $L(input.$L);\", \"_json\", payloadMemberName);\n                    } else {\n                        writer.write(\"body = $L(input.$L, context);\", serFunctionName, payloadMemberName);\n                    }\n                    serializeInputEventDocumentPayload.run();\n                } else {\n                    throw new CodegenException(\n                        String.format(\n                            \"Unexpected shape type bound to event payload: `%s`\",\n                            payloadShape.getType()\n                        )\n                    );\n                }\n            });\n        } else {\n            // remove the input parameters that already serialized into event headers\n            for (MemberShape memberShape : event.members()) {\n                if (memberShape.hasTrait(EventHeaderTrait.class)) {\n                    writer.write(\"delete input[$S]\", memberShape.getMemberName());\n                }\n            }\n            Symbol symbol = getSymbol(context, event);\n            String serFunctionName = ProtocolGenerator.getSerFunctionShortName(symbol);\n            documentShapesToSerialize.add(event);\n            boolean mayElide = serdeElisionIndex.mayElide(event);\n            if (mayElide) {\n                writer.addImportSubmodule(\"_json\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n                writer.write(\"body = $L(input);\", \"_json\");\n            } else {\n                writer.write(\"body = $L(input, context);\", serFunctionName);\n            }\n            serializeInputEventDocumentPayload.run();\n        }\n    }\n\n    private void generateEventStreamDeserializer(GenerationContext context, UnionShape eventsUnion) {\n        String methodName = getDeserFunctionName(context, eventsUnion);\n        String methodLongName = ProtocolGenerator.getDeserFunctionName(\n            getSymbol(context, eventsUnion),\n            context.getProtocolName()\n        );\n        Symbol eventsUnionSymbol = getSymbol(context, eventsUnion);\n        TypeScriptWriter writer = context.getWriter();\n        Model model = context.getModel();\n        String contextType = getEventStreamSerdeContextType(context, eventsUnion);\n\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\n            \"const $L = (\\n\" + \"  output: any,\\n\" + \"  context: $L\\n\" + \"): AsyncIterable<$T> => {\",\n            \"}\",\n            methodName,\n            contextType,\n            eventsUnionSymbol,\n            () -> {\n                writer.openBlock(\"return context.eventStreamMarshaller.deserialize(\", \");\", () -> {\n                    writer.write(\"output,\");\n                    writer.openBlock(\"async event => {\", \"}\", () -> {\n                        eventsUnion\n                            .getAllMembers()\n                            .forEach((name, member) -> {\n                                StructureShape event =\n                                    model.expectShape(member.getTarget(), StructureShape.class);\n                                writer.openBlock(\"if (event[$S] != null) {\", \"}\", name, () -> {\n                                    writer.openBlock(\"return {\", \"};\", () -> {\n                                        String eventDeserMethodName = getEventDeserFunctionName(context, event);\n                                        writer.write(\n                                            \"$1L: await $2L(event[$1S], context),\",\n                                            name,\n                                            eventDeserMethodName\n                                        );\n                                    });\n                                });\n                            });\n                        writer.write(\"return {$$unknown: event as any};\");\n                    });\n                });\n            }\n        );\n    }\n\n    private String getDeserFunctionName(GenerationContext context, Shape shape) {\n        Symbol symbol = getSymbol(context, shape);\n        return ProtocolGenerator.getDeserFunctionShortName(symbol);\n    }\n\n    public String getEventDeserFunctionName(GenerationContext context, Shape shape) {\n        return getDeserFunctionName(context, shape) + \"_event\";\n    }\n\n    public void generateEventUnmarshaller(\n        GenerationContext context,\n        StructureShape event,\n        Set<StructureShape> errorShapesToDeserialize,\n        Set<Shape> eventShapesToDeserialize,\n        boolean isErrorCodeInBody,\n        boolean serdeElisionEnabled,\n        SerdeElisionIndex serdeElisionIndex\n    ) {\n        String methodName = getEventDeserFunctionName(context, event);\n        Symbol symbol = getSymbol(context, event);\n        TypeScriptWriter writer = context.getWriter();\n        writer.openBlock(\n            \"const $L = async (\\n\" + \"  output: any,\\n\" + \"  context: __SerdeContext\\n\" + \"): Promise<$T> => {\",\n            \"}\",\n            methodName,\n            symbol,\n            () -> {\n                if (event.hasTrait(ErrorTrait.class)) {\n                    generateErrorEventUnmarshaller(context, event, errorShapesToDeserialize, isErrorCodeInBody);\n                } else {\n                    writer.write(\"const contents: $L = {} as any;\", symbol.getName());\n                    readEventHeaders(context, event);\n                    readEventBody(context, event, eventShapesToDeserialize, serdeElisionEnabled, serdeElisionIndex);\n                    writer.write(\"return contents;\");\n                }\n            }\n        );\n    }\n\n    // Writes function content that unmarshall error event with error deserializer\n    private void generateErrorEventUnmarshaller(\n        GenerationContext context,\n        StructureShape event,\n        Set<StructureShape> errorShapesToDeserialize,\n        boolean isErrorCodeInBody\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        // If this is an error event, we need to generate the error deserializer.\n        errorShapesToDeserialize.add(event);\n        String errorDeserMethodName = getDeserFunctionName(context, event) + \"Res\";\n        if (isErrorCodeInBody) {\n            // If error code is in body, parseBody() won't be called inside error deser. So we parse body here.\n            // It's ok to parse body here because body won't be streaming if 'isErrorCodeInBody' is set.\n            writer.openBlock(\"const parsedOutput: any = {\", \"};\", () -> {\n                writer.write(\"...output,\");\n                writer.write(\"body: await parseBody(output.body, context)\");\n            });\n            writer.write(\"return $L(parsedOutput, context);\", errorDeserMethodName);\n        } else {\n            writer.write(\"return $L(output, context);\", errorDeserMethodName);\n        }\n    }\n\n    // Parse members from event headers.\n    private void readEventHeaders(GenerationContext context, StructureShape event) {\n        TypeScriptWriter writer = context.getWriter();\n        List<MemberShape> headerMembers = event\n            .getAllMembers()\n            .values()\n            .stream()\n            .filter(member -> member.hasTrait(EventHeaderTrait.class))\n            .toList();\n        for (MemberShape headerMember : headerMembers) {\n            String memberName = headerMember.getMemberName();\n            String varName = context.getStringStore().var(memberName);\n\n            writer.write(\n                \"\"\"\n                if (output.headers[$1L] !== undefined) {\n                    contents[$1L] = output.headers[$1L].value;\n                }\n                \"\"\",\n                varName\n            );\n        }\n    }\n\n    private void readEventBody(\n        GenerationContext context,\n        StructureShape event,\n        Set<Shape> eventShapesToDeserialize,\n        boolean serdeElisionEnabled,\n        SerdeElisionIndex serdeElisionIndex\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        Optional<MemberShape> payloadmemberOptional = getEventPayloadMember(event);\n        if (payloadmemberOptional.isPresent()) {\n            Shape payloadShape = context.getModel().expectShape(payloadmemberOptional.get().getTarget());\n            String payloadMemberName = payloadmemberOptional.get().getMemberName();\n            if (payloadShape instanceof BlobShape) {\n                writer.write(\"contents.$L = output.body;\", payloadMemberName);\n            } else if (payloadShape instanceof StringShape) {\n                writer.write(\"contents.$L = await collectBodyString(output.body, context);\", payloadMemberName);\n            } else if (payloadShape instanceof StructureShape || payloadShape instanceof UnionShape) {\n                writer.write(\"const data: any = await parseBody(output.body, context);\");\n                Symbol symbol = getSymbol(context, payloadShape);\n                String deserFunctionName = ProtocolGenerator.getDeserFunctionShortName(symbol);\n                boolean mayElide = serdeElisionEnabled && serdeElisionIndex.mayElide(payloadShape);\n                if (mayElide) {\n                    writer.addImportSubmodule(\n                        \"_json\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    writer.write(\"contents.$L = $L(data);\", payloadMemberName, \"_json\");\n                } else {\n                    writer.write(\"contents.$L = $L(data, context);\", payloadMemberName, deserFunctionName);\n                }\n                eventShapesToDeserialize.add(payloadShape);\n            }\n        } else {\n            writer.write(\"const data: any = await parseBody(output.body, context);\");\n            Symbol symbol = getSymbol(context, event);\n            String deserFunctionName = ProtocolGenerator.getDeserFunctionShortName(symbol);\n            boolean mayElide = serdeElisionEnabled && serdeElisionIndex.mayElide(event);\n            if (mayElide) {\n                writer.addImportSubmodule(\"_json\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n                writer.write(\"Object.assign(contents, $L(data));\", \"_json\");\n            } else {\n                writer.write(\"Object.assign(contents, $L(data, context));\", deserFunctionName);\n            }\n            eventShapesToDeserialize.add(event);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.nio.file.Paths;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.HashSet;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.util.function.Consumer;\nimport java.util.logging.Logger;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.HttpBinding;\nimport software.amazon.smithy.model.knowledge.HttpBinding.Location;\nimport software.amazon.smithy.model.knowledge.HttpBindingIndex;\nimport software.amazon.smithy.model.knowledge.OperationIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.pattern.SmithyPattern.Segment;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.BooleanShape;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.NumberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.HostLabelTrait;\nimport software.amazon.smithy.model.traits.HttpErrorTrait;\nimport software.amazon.smithy.model.traits.HttpQueryTrait;\nimport software.amazon.smithy.model.traits.HttpTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.FrameworkErrorModel;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.RuleSetParameterFinder;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.OptionalUtils;\nimport software.amazon.smithy.utils.SetUtils;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Abstract implementation useful for all protocols that use HTTP bindings.\n */\n@SmithyUnstableApi\npublic abstract class HttpBindingProtocolGenerator implements ProtocolGenerator {\n\n    private static final Logger LOGGER = Logger.getLogger(HttpBindingProtocolGenerator.class.getName());\n    private static final Set<Character> REGEX_CHARS = SetUtils.of(\n        '.',\n        '*',\n        '+',\n        '?',\n        '^',\n        '$',\n        '{',\n        '}',\n        '(',\n        ')',\n        '|',\n        '[',\n        ']',\n        '\\\\'\n    );\n    private static final ApplicationProtocol APPLICATION_PROTOCOL =\n        ApplicationProtocol.createDefaultHttpApplicationProtocol();\n    private final Set<Shape> serializingDocumentShapes = new TreeSet<>();\n    private final Set<Shape> deserializingDocumentShapes = new TreeSet<>();\n    private final Set<StructureShape> serializingErrorShapes = new TreeSet<>();\n    private final Set<StructureShape> deserializingErrorShapes = new TreeSet<>();\n    private final boolean isErrorCodeInBody;\n    private final EventStreamGenerator eventStreamGenerator = new EventStreamGenerator();\n    private final LinkedHashMap<String, String> headerBuffer = new LinkedHashMap<>();\n    private Set<String> contextParamDeduplicationParamControlSet = new HashSet<>();\n\n    /**\n     * Creates a Http binding protocol generator.\n     *\n     * @param isErrorCodeInBody A boolean that indicates if the error code for the implementing protocol is located in\n     *   the error response body, meaning this generator will parse the body before attempting to load an error code.\n     */\n    public HttpBindingProtocolGenerator(boolean isErrorCodeInBody) {\n        this.isErrorCodeInBody = isErrorCodeInBody;\n    }\n\n    /**\n     * Indicate that param names in the set should be de-duplicated when appearing in\n     * both contextParams (endpoint ruleset related) and HTTP URI segments / labels.\n     */\n    public void setContextParamDeduplicationParamControlSet(Set<String> contextParamDeduplicationParamControlSet) {\n        this.contextParamDeduplicationParamControlSet = contextParamDeduplicationParamControlSet;\n    }\n\n    @Override\n    public final ApplicationProtocol getApplicationProtocol() {\n        return APPLICATION_PROTOCOL;\n    }\n\n    /**\n     * Gets the default serde format for timestamps.\n     *\n     * @return Returns the default format.\n     */\n    protected abstract Format getDocumentTimestampFormat();\n\n    /**\n     * Gets the default content-type when a document is synthesized in the body.\n     *\n     * @return Returns the default content-type.\n     */\n    protected abstract String getDocumentContentType();\n\n    /**\n     * Generates serialization functions for shapes in the passed set. These functions\n     * should return a value that can then be serialized by the implementation of\n     * {@link HttpBindingProtocolGenerator#serializeInputDocumentBody}. The {@link DocumentShapeSerVisitor} and\n     * {@link DocumentMemberSerVisitor} are provided to reduce the effort of this implementation.\n     *\n     * @param context The generation context.\n     * @param shapes The shapes to generate serialization for.\n     */\n    protected abstract void generateDocumentBodyShapeSerializers(GenerationContext context, Set<Shape> shapes);\n\n    /**\n     * Generates deserialization functions for shapes in the passed set. These functions\n     * should return a value that can then be deserialized by the implementation of\n     * {@link HttpBindingProtocolGenerator#deserializeInputDocumentBody}. The {@link DocumentShapeDeserVisitor} and\n     * {@link DocumentMemberDeserVisitor} are provided to reduce the effort of this implementation.\n     *\n     * @param context The generation context.\n     * @param shapes The shapes to generate deserialization for.\n     */\n    protected abstract void generateDocumentBodyShapeDeserializers(GenerationContext context, Set<Shape> shapes);\n\n    @Override\n    public void generateSharedComponents(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.addImportSubmodule(\"map\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n\n        if (context.getSettings().generateClient()) {\n            writer.addImportSubmodule(\n                \"withBaseException\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CLIENT\n            );\n            SymbolReference exception = HttpProtocolGeneratorUtils.getClientBaseException(context);\n            writer.write(\"const throwDefaultError = withBaseException($T);\", exception);\n        }\n\n        deserializingErrorShapes.forEach(error -> generateErrorDeserializer(context, error));\n        serializingErrorShapes.forEach(error -> generateErrorSerializer(context, error));\n        ServiceShape service = context.getService();\n        eventStreamGenerator.generateEventStreamSerializers(\n            context,\n            service,\n            getDocumentContentType(),\n            () -> {\n                this.serializeInputEventDocumentPayload(context);\n            },\n            serializingDocumentShapes\n        );\n        SerdeElisionIndex serdeElisionIndex = SerdeElisionIndex.of(context.getModel());\n        // Error shapes that only referred in the error event of an eventstream\n        Set<StructureShape> errorEventShapes = new TreeSet<>();\n        eventStreamGenerator.generateEventStreamDeserializers(\n            context,\n            service,\n            errorEventShapes,\n            deserializingDocumentShapes,\n            isErrorCodeInBody,\n            enableSerdeElision(),\n            serdeElisionIndex\n        );\n        errorEventShapes.removeIf(deserializingErrorShapes::contains);\n        errorEventShapes.forEach(error -> generateErrorDeserializer(context, error));\n        generateDocumentBodyShapeSerializers(context, serializingDocumentShapes);\n        generateDocumentBodyShapeDeserializers(context, deserializingDocumentShapes);\n        HttpProtocolGeneratorUtils.generateMetadataDeserializer(context, getApplicationProtocol().getResponseType());\n        HttpProtocolGeneratorUtils.generateCollectBodyString(context);\n\n        writer.write(context.getStringStore().flushVariableDeclarationCode());\n\n        writer.addImportSubmodule(\n            \"HttpRequest\",\n            \"__HttpRequest\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n        writer.addImportSubmodule(\n            \"HttpResponse\",\n            \"__HttpResponse\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n    }\n\n    @Override\n    public void generateRequestSerializers(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            topDownIndex.getContainedOperations(context.getService())\n        );\n        for (OperationShape operation : containedOperations) {\n            OptionalUtils.ifPresentOrElse(\n                operation.getTrait(HttpTrait.class),\n                httpTrait -> generateOperationRequestSerializer(context, operation, httpTrait),\n                () -> LOGGER.warning(\n                    String.format(\n                        \"Unable to generate %s protocol request bindings for %s because it does not have an \"\n                            +\n                            \"http binding trait\",\n                        getName(),\n                        operation.getId()\n                    )\n                )\n            );\n        }\n    }\n\n    @Override\n    public void generateRequestDeserializers(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            topDownIndex.getContainedOperations(context.getService())\n        );\n        for (OperationShape operation : containedOperations) {\n            OptionalUtils.ifPresentOrElse(\n                operation.getTrait(HttpTrait.class),\n                httpTrait -> generateOperationRequestDeserializer(context, operation, httpTrait),\n                () -> LOGGER.warning(\n                    String.format(\n                        \"Unable to generate %s protocol request bindings for %s because it does not have an \"\n                            +\n                            \"http binding trait\",\n                        getName(),\n                        operation.getId()\n                    )\n                )\n            );\n        }\n    }\n\n    @Override\n    public void generateResponseSerializers(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            topDownIndex.getContainedOperations(context.getService())\n        );\n        for (OperationShape operation : containedOperations) {\n            OptionalUtils.ifPresentOrElse(\n                operation.getTrait(HttpTrait.class),\n                httpTrait -> generateOperationResponseSerializer(context, operation, httpTrait),\n                () -> LOGGER.warning(\n                    String.format(\n                        \"Unable to generate %s protocol response bindings for %s because it does not have an \"\n                            +\n                            \"http binding trait\",\n                        getName(),\n                        operation.getId()\n                    )\n                )\n            );\n        }\n    }\n\n    @Override\n    public void generateFrameworkErrorSerializer(GenerationContext inputContext) {\n        final GenerationContext context = inputContext.copy();\n        context.setModel(FrameworkErrorModel.INSTANCE.getModel());\n\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addImport(\"SmithyFrameworkException\", \"__SmithyFrameworkException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addUseImports(responseType);\n        writer.addImport(\"ServerSerdeContext\", null, TypeScriptDependency.SERVER_COMMON);\n\n        writer.openBlock(\n            \"export const serializeFrameworkException = async (\\n\" +\n                \"  input: __SmithyFrameworkException,\\n\" +\n                \"  ctx: ServerSerdeContext\\n\" +\n                \"): Promise<$T> => {\",\n            \"}\",\n            responseType,\n            () -> {\n                writeEmptyEndpoint(context);\n\n                writer.openBlock(\"switch (input.name) {\", \"}\", () -> {\n                    for (\n                        final Shape shape : new TreeSet<>(\n                            context.getModel().getShapesWithTrait(HttpErrorTrait.class)\n                        )\n                    ) {\n                        StructureShape errorShape =\n                            shape.asStructureShape().orElseThrow(IllegalArgumentException::new);\n                        writer.openBlock(\"case $S: {\", \"}\", errorShape.getId().getName(), () -> {\n                            generateErrorSerializationImplementation(\n                                context,\n                                errorShape,\n                                responseType,\n                                bindingIndex\n                            );\n                        });\n                    }\n                });\n            }\n        );\n        writer.write(\"\");\n    }\n\n    private void generateServiceMux(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addImport(\"httpbinding\", null, TypeScriptDependency.SERVER_COMMON);\n\n        Symbol serviceSymbol = context.getSymbolProvider().toSymbol(context.getService());\n\n        writer.openBlock(\n            \"const mux = new httpbinding.HttpBindingMux<$S, keyof $T<Context>>([\",\n            \"]);\",\n            context.getService().getId().getName(),\n            serviceSymbol,\n            () -> {\n                for (OperationShape operation : topDownIndex.getContainedOperations(context.getService())) {\n                    OptionalUtils.ifPresentOrElse(\n                        operation.getTrait(HttpTrait.class),\n                        httpTrait -> generateUriSpec(context, operation, httpTrait),\n                        () -> LOGGER.warning(\n                            String.format(\n                                \"Unable to generate %s uri spec for %s because it does not have an \" +\n                                    \"http binding trait\",\n                                getName(),\n                                operation.getId()\n                            )\n                        )\n                    );\n                }\n            }\n        );\n    }\n\n    private void generateOperationMux(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addImport(\"httpbinding\", null, TypeScriptDependency.SERVER_COMMON);\n\n        writer.openBlock(\n            \"const mux = new httpbinding.HttpBindingMux<$S, $S>([\",\n            \"]);\",\n            context.getService().getId().getName(),\n            context.getSymbolProvider().toSymbol(operation).getName(),\n            () -> {\n                HttpTrait httpTrait = operation.expectTrait(HttpTrait.class);\n                generateUriSpec(context, operation, httpTrait);\n            }\n        );\n    }\n\n    private void generateUriSpec(GenerationContext context, OperationShape operation, HttpTrait httpTrait) {\n        TypeScriptWriter writer = context.getWriter();\n\n        String serviceName = context.getService().getId().getName();\n        String operationName = context.getSymbolProvider().toSymbol(operation).getName();\n\n        writer.openBlock(\"new httpbinding.UriSpec<$S, $S>(\", \"),\", serviceName, operationName, () -> {\n            writer.write(\"'$L',\", httpTrait.getMethod());\n            writer.openBlock(\"[\", \"],\", () -> {\n                for (Segment s : httpTrait.getUri().getSegments()) {\n                    if (s.isGreedyLabel()) {\n                        writer.write(\"{ type: 'greedy' },\");\n                    } else if (s.isLabel()) {\n                        writer.write(\"{ type: 'path' },\");\n                    } else {\n                        writer.write(\"{ type: 'path_literal', value: $S },\", s.getContent());\n                    }\n                }\n            });\n            writer.openBlock(\"[\", \"],\", () -> {\n                for (Map.Entry<String, String> e : httpTrait.getUri().getQueryLiterals().entrySet()) {\n                    if (e.getValue() == null) {\n                        writer.write(\"{ type: 'query_literal', key: $S },\", e.getKey());\n                    } else {\n                        writer.write(\"{ type: 'query_literal', key: $S, value: $S },\", e.getKey(), e.getValue());\n                    }\n                }\n                operation\n                    .getInput()\n                    .ifPresent(inputId -> {\n                        StructureShape inputShape = context.getModel().expectShape(inputId, StructureShape.class);\n                        for (MemberShape ms : inputShape.members()) {\n                            if (ms.isRequired() && ms.hasTrait(HttpQueryTrait.class)) {\n                                HttpQueryTrait queryTrait = ms.expectTrait(HttpQueryTrait.class);\n                                writer.write(\"{ type: 'query', key: $S },\", queryTrait.getValue());\n                            }\n                        }\n                    });\n            });\n            writer.writeInline(\"{ service: $S, operation: $S }\", serviceName, operationName);\n        });\n    }\n\n    @Override\n    public void generateServiceHandlerFactory(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        TopDownIndex index = TopDownIndex.of(context.getModel());\n        Set<OperationShape> operations = index.getContainedOperations(context.getService());\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        writer.addRelativeImport(\n            \"serializeFrameworkException\",\n            null,\n            Paths.get(\n                \".\",\n                CodegenUtils.SOURCE_FOLDER,\n                PROTOCOLS_FOLDER,\n                ProtocolGenerator.getSanitizedName(getName())\n            )\n        );\n        writer.addImport(\"ValidationCustomizer\", \"__ValidationCustomizer\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImportSubmodule(\n            \"HttpRequest\",\n            \"__HttpRequest\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n        writer.addImportSubmodule(\n            \"HttpResponse\",\n            \"__HttpResponse\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n\n        Symbol serviceSymbol = symbolProvider.toSymbol(context.getService());\n        Symbol handlerSymbol = serviceSymbol.expectProperty(\"handler\", Symbol.class);\n        Symbol operationsSymbol = serviceSymbol.expectProperty(\"operations\", Symbol.class);\n\n        if (context.getSettings().isDisableDefaultValidation()) {\n            writer.write(\n                \"export const get$L = <Context>(service: $T<Context>, \" +\n                    \"customizer: __ValidationCustomizer<$T>): \" +\n                    \"__ServiceHandler<Context, __HttpRequest, __HttpResponse> => {\",\n                handlerSymbol.getName(),\n                serviceSymbol,\n                operationsSymbol\n            );\n        } else {\n            writer.write(\n                \"export const get$L = <Context>(service: $T<Context>): \" +\n                    \"__ServiceHandler<Context, __HttpRequest, __HttpResponse> => {\",\n                handlerSymbol.getName(),\n                serviceSymbol\n            );\n        }\n        writer.indent();\n\n        generateServiceMux(context);\n        writer.addImport(\"ServiceException\", \"__ServiceException\", TypeScriptDependency.SERVER_COMMON);\n        writer.openBlock(\n            \"const serFn: (op: $1T) => __OperationSerializer<$2T<Context>, $1T, __ServiceException> = \"\n                + \"(op) => {\",\n            \"};\",\n            operationsSymbol,\n            serviceSymbol,\n            () -> {\n                writer.openBlock(\"switch (op) {\", \"}\", () -> {\n                    operations\n                        .stream()\n                        .filter(o -> o.getTrait(HttpTrait.class).isPresent())\n                        .forEach(writeOperationCase(writer, symbolProvider));\n                });\n            }\n        );\n\n        if (!context.getSettings().isDisableDefaultValidation()) {\n            writer.addImport(\n                \"generateValidationSummary\",\n                \"__generateValidationSummary\",\n                TypeScriptDependency.SERVER_COMMON\n            );\n            writer.addImport(\n                \"generateValidationMessage\",\n                \"__generateValidationMessage\",\n                TypeScriptDependency.SERVER_COMMON\n            );\n            writer.openBlock(\n                \"const customizer: __ValidationCustomizer<$T> = (ctx, failures) => {\",\n                \"};\",\n                operationsSymbol,\n                () -> {\n                    writeDefaultValidationCustomizer(writer);\n                }\n            );\n        }\n\n        writer.write(\"return new $T(service, mux, serFn, serializeFrameworkException, customizer);\", handlerSymbol);\n\n        writer.dedent().write(\"}\");\n    }\n\n    @Override\n    public void generateOperationHandlerFactory(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        writer.addImport(\n            \"serializeFrameworkException\",\n            null,\n            Paths.get(\n                \".\",\n                CodegenUtils.SOURCE_FOLDER,\n                PROTOCOLS_FOLDER,\n                ProtocolGenerator.getSanitizedName(getName())\n            ).toString()\n        );\n        writer.addImportSubmodule(\n            \"HttpRequest\",\n            \"__HttpRequest\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n        writer.addImportSubmodule(\n            \"HttpResponse\",\n            \"__HttpResponse\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n\n        final Symbol operationSymbol = symbolProvider.toSymbol(operation);\n        final Symbol inputType = operationSymbol.expectProperty(\"inputType\", Symbol.class);\n        final Symbol outputType = operationSymbol.expectProperty(\"outputType\", Symbol.class);\n        final Symbol serializerType = operationSymbol.expectProperty(\"serializerType\", Symbol.class);\n        final Symbol operationHandlerSymbol = operationSymbol.expectProperty(\"handler\", Symbol.class);\n\n        if (context.getSettings().isDisableDefaultValidation()) {\n            writer.write(\n                \"export const get$L = <Context>(operation: __Operation<$T, $T, Context>, \" +\n                    \"customizer: __ValidationCustomizer<$S>): \" +\n                    \"__ServiceHandler<Context, __HttpRequest, __HttpResponse> => {\",\n                operationHandlerSymbol.getName(),\n                inputType,\n                outputType,\n                operationSymbol.getName()\n            );\n        } else {\n            writer.write(\n                \"export const get$L = <Context>(operation: __Operation<$T, $T, Context>): \" +\n                    \"__ServiceHandler<Context, __HttpRequest, __HttpResponse> => {\",\n                operationHandlerSymbol.getName(),\n                inputType,\n                outputType\n            );\n        }\n        writer.indent();\n\n        generateOperationMux(context, operation);\n\n        if (!context.getSettings().isDisableDefaultValidation()) {\n            writer.addImport(\n                \"generateValidationSummary\",\n                \"__generateValidationSummary\",\n                TypeScriptDependency.SERVER_COMMON\n            );\n            writer.addImport(\n                \"generateValidationMessage\",\n                \"__generateValidationMessage\",\n                TypeScriptDependency.SERVER_COMMON\n            );\n            writer.openBlock(\n                \"const customizer: __ValidationCustomizer<$S> = (ctx, failures) => {\",\n                \"};\",\n                operationSymbol.getName(),\n                () -> {\n                    writeDefaultValidationCustomizer(writer);\n                }\n            );\n        }\n        writer.write(\n            \"return new $T(operation, mux, new $T(), serializeFrameworkException, customizer);\",\n            operationHandlerSymbol,\n            serializerType\n        );\n\n        writer.dedent().write(\"}\");\n    }\n\n    private void writeDefaultValidationCustomizer(TypeScriptWriter writer) {\n        writer.openBlock(\"if (!failures) {\", \"}\", () -> {\n            writer.write(\"return undefined;\");\n        });\n\n        writer.openBlock(\"return {\", \"};\", () -> {\n            writer.write(\"name: \\\"ValidationException\\\",\");\n            writer.write(\"$$fault: \\\"client\\\",\");\n            writer.write(\"message: __generateValidationSummary(failures),\");\n            writer.openBlock(\"fieldList: failures.map(failure => ({\", \"}))\", () -> {\n                writer.write(\"path: failure.path,\");\n                writer.write(\"message: __generateValidationMessage(failure)\");\n            });\n        });\n    }\n\n    private Consumer<OperationShape> writeOperationCase(TypeScriptWriter writer, SymbolProvider symbolProvider) {\n        return operation -> {\n            Symbol operationSymbol = symbolProvider.toSymbol(operation);\n            Symbol symbol = operationSymbol.expectProperty(\"serializerType\", Symbol.class);\n            writer.write(\"case $S: return new $T();\", operationSymbol.getName(), symbol);\n        };\n    }\n\n    @Override\n    public void generateResponseDeserializers(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            topDownIndex.getContainedOperations(context.getService())\n        );\n\n        for (OperationShape operation : containedOperations) {\n            OptionalUtils.ifPresentOrElse(\n                operation.getTrait(HttpTrait.class),\n                httpTrait -> generateOperationResponseDeserializer(context, operation, httpTrait),\n                () -> LOGGER.warning(\n                    String.format(\n                        \"Unable to generate %s protocol response bindings for %s because it does not have an \"\n                            +\n                            \"http binding trait\",\n                        getName(),\n                        operation.getId()\n                    )\n                )\n            );\n        }\n\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        Set<StructureShape> errorShapes = HttpProtocolGeneratorUtils.generateUnifiedErrorDispatcher(\n            context,\n            containedOperations.stream().toList(),\n            responseType,\n            this::writeErrorCodeParser,\n            isErrorCodeInBody,\n            this::getErrorBodyLocation,\n            this::getOperationErrors,\n            getErrorAliases(context, containedOperations)\n        );\n        deserializingErrorShapes.addAll(errorShapes);\n    }\n\n    private void generateOperationResponseSerializer(\n        GenerationContext context,\n        OperationShape operation,\n        HttpTrait trait\n    ) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addUseImports(responseType);\n        String methodName = ProtocolGenerator.getGenericSerFunctionName(symbol) + \"Response\";\n        Symbol outputType = symbol.expectProperty(\"outputType\", Symbol.class);\n        writer.addImport(\"ServerSerdeContext\", null, TypeScriptDependency.SERVER_COMMON);\n\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  input: $T,\\n\" + \"  ctx: ServerSerdeContext\\n\"\n                + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            outputType,\n            responseType,\n            () -> {\n                writeEmptyEndpoint(context, operation);\n                writeOperationStatusCode(context, operation, bindingIndex, trait);\n                writeResponseHeaders(\n                    context,\n                    operation,\n                    bindingIndex,\n                    () -> writeDefaultOutputHeaders(context, operation)\n                );\n\n                List<HttpBinding> bodyBindings = writeResponseBody(context, operation, bindingIndex);\n                if (!bodyBindings.isEmpty()) {\n                    // Track all shapes bound to the body so their serializers may be generated.\n                    bodyBindings\n                        .stream()\n                        .map(HttpBinding::getMember)\n                        .map(member -> context.getModel().expectShape(member.getTarget()))\n                        .forEach(serializingDocumentShapes::add);\n                }\n\n                calculateContentLength(context);\n\n                writer.openBlock(\"return new $T({\", \"});\", responseType, () -> {\n                    writer.write(\"headers,\");\n                    writer.write(\"body,\");\n                    writer.write(\"statusCode,\");\n                });\n            }\n        );\n        writer.write(\"\");\n\n        serializingErrorShapes.addAll(OperationIndex.of(context.getModel()).getErrors(operation, context.getService()));\n    }\n\n    private void calculateContentLength(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n        writer.addImportSubmodule(\n            \"calculateBodyLength\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.SERDE\n        );\n        writer.openBlock(\n            \"if (body && Object.keys(headers).map((str) => str.toLowerCase())\"\n                + \".indexOf('content-length') === -1) {\",\n            \"}\",\n            () -> {\n                writer.write(\"const length = calculateBodyLength(body);\");\n                writer.openBlock(\"if (length !== undefined) {\", \"}\", () -> {\n                    writer.write(\"headers = { ...headers, 'content-length': String(length) };\");\n                });\n            }\n        );\n    }\n\n    private void generateErrorSerializer(GenerationContext context, StructureShape error) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(error);\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addUseImports(responseType);\n        String methodName = ProtocolGenerator.getGenericSerFunctionName(symbol) + \"Error\";\n        writer.addImport(\"ServerSerdeContext\", null, TypeScriptDependency.SERVER_COMMON);\n\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  input: $T,\\n\" + \"  ctx: ServerSerdeContext\\n\"\n                + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            symbol,\n            responseType,\n            () -> {\n                writeEmptyEndpoint(context);\n                generateErrorSerializationImplementation(context, error, responseType, bindingIndex);\n            }\n        );\n        writer.write(\"\");\n    }\n\n    private void generateErrorSerializationImplementation(\n        GenerationContext context,\n        StructureShape error,\n        SymbolReference responseType,\n        HttpBindingIndex bindingIndex\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        writeErrorStatusCode(context, error);\n        writeResponseHeaders(context, error, bindingIndex, () -> writeDefaultErrorHeaders(context, error));\n\n        List<HttpBinding> bodyBindings = writeResponseBody(context, error, bindingIndex);\n        if (!bodyBindings.isEmpty()) {\n            // Track all shapes bound to the body so their serializers may be generated.\n            bodyBindings\n                .stream()\n                .map(HttpBinding::getMember)\n                .map(member -> context.getModel().expectShape(member.getTarget()))\n                .forEach(serializingDocumentShapes::add);\n        }\n\n        writer.openBlock(\"return new $T({\", \"});\", responseType, () -> {\n            writer.write(\"headers,\");\n            writer.write(\"body,\");\n            writer.write(\"statusCode,\");\n        });\n    }\n\n    private void writeEmptyEndpoint(GenerationContext context) {\n        context\n            .getWriter()\n            .write(\n                \"\"\"\n                const context: __SerdeContext = {\n                  ...ctx,\n                  endpoint: () => Promise.resolve({\n                    protocol: '',\n                    hostname: '',\n                    path: '',\n                  }),\n                };\"\"\"\n            );\n    }\n\n    private void writeEmptyEndpoint(GenerationContext context, OperationShape operation) {\n        String contextType = \"__SerdeContext\";\n        boolean hasEventStreamResponse = EventStreamGenerator.hasEventStreamOutput(context, operation);\n        if (hasEventStreamResponse) {\n            // todo: unsupported SSDK feature.\n            contextType += \"& any /*event stream context unsupported in ssdk*/\";\n        }\n        context\n            .getWriter()\n            .write(\n                \"\"\"\n                const context: $L = {\n                  ...ctx,\n                  endpoint: () => Promise.resolve({\n                    protocol: '',\n                    hostname: '',\n                    path: '',\n                  }),\n                };\"\"\",\n                contextType\n            );\n    }\n\n    private void generateOperationRequestSerializer(\n        GenerationContext context,\n        OperationShape operation,\n        HttpTrait trait\n    ) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference requestType = getApplicationProtocol().getRequestType();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        TypeScriptWriter writer = context.getWriter();\n\n        // Ensure that the request type is imported.\n        writer.addUseImports(requestType);\n        writer.addTypeImport(\"Endpoint\", \"__Endpoint\", TypeScriptDependency.SMITHY_TYPES);\n\n        // e.g., se_ES\n        String methodName = ProtocolGenerator.getSerFunctionShortName(symbol);\n        // e.g., serializeAws_restJson1_1ExecuteStatement\n        String methodLongName = ProtocolGenerator.getSerFunctionName(symbol, getName());\n\n        // Add the normalized input type.\n        Symbol inputType = symbol.expectProperty(\"inputType\", Symbol.class);\n        String contextType = CodegenUtils.getOperationSerializerContextType(writer, context.getModel(), operation);\n\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  input: $T,\\n\" + \"  context: $L\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            inputType,\n            contextType,\n            requestType,\n            () -> {\n                // Get the hostname, path, port, and scheme from client's resolved endpoint.\n                // Then construct the request from them. The client's resolved endpoint can\n                // be default one or supplied by users.\n\n                writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n                writer.addImport(\"requestBuilder\", \"rb\", TypeScriptDependency.SMITHY_CORE);\n                writer.write(\"const b = rb(input, context);\");\n\n                writeRequestHeaders(context, operation, bindingIndex);\n                writeResolvedPath(context, operation, bindingIndex, trait);\n                boolean hasQueryComponents = writeRequestQueryString(context, operation, bindingIndex, trait);\n\n                List<HttpBinding> bodyBindings = writeRequestBody(context, operation, bindingIndex);\n                if (!bodyBindings.isEmpty()) {\n                    // Track all shapes bound to the body so their serializers may be generated.\n                    bodyBindings\n                        .stream()\n                        .map(HttpBinding::getMember)\n                        .map(member -> context.getModel().expectShape(member.getTarget()))\n                        .filter(shape -> !EventStreamGenerator.isEventStreamShape(shape))\n                        .forEach(serializingDocumentShapes::add);\n                }\n\n                boolean hasHostPrefix = operation.hasTrait(EndpointTrait.class);\n                if (hasHostPrefix) {\n                    HttpProtocolGeneratorUtils.writeHostPrefix(context, operation);\n                    writer.write(\"b.hn(resolvedHostname);\");\n                }\n                writer.write(\"b.m($S)\", trait.getMethod());\n                writer.write(\".h(headers)\");\n                if (hasQueryComponents) {\n                    writer.write(\".q(query)\");\n                }\n                // Always set the body,\n                writer.write(\".b(body);\");\n\n                writer.write(\"return b.build();\");\n            }\n        );\n\n        writer.write(\"\");\n    }\n\n    private void writeOperationStatusCode(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex,\n        HttpTrait trait\n    ) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        List<HttpBinding> bindings = bindingIndex.getResponseBindings(operation, Location.RESPONSE_CODE);\n        TypeScriptWriter writer = context.getWriter();\n        writer.write(\"let statusCode: number = $L\", trait.getCode());\n        if (!bindings.isEmpty()) {\n            HttpBinding binding = bindings.get(0);\n            // This can only be bound to an int so we don't need to do the same sort of complex finagling\n            // as we do with other http bindings.\n            String bindingMember = \"input.\" + symbolProvider.toMemberName(binding.getMember());\n            writer.openBlock(\"if ($L !== undefined) {\", \"}\", bindingMember, () -> {\n                writer.write(\"statusCode = $L\", bindingMember);\n            });\n        }\n    }\n\n    private void writeErrorStatusCode(GenerationContext context, StructureShape error) {\n        ErrorTrait trait = error.expectTrait(ErrorTrait.class);\n        int code = error\n            .getTrait(HttpErrorTrait.class)\n            .map(HttpErrorTrait::getCode)\n            .orElse(trait.getDefaultHttpStatusCode());\n        context.getWriter().write(\"const statusCode: number = $L\", code);\n    }\n\n    private void writeResolvedPath(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex,\n        HttpTrait trait\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        List<HttpBinding> labelBindings = bindingIndex.getRequestBindings(operation, Location.LABEL);\n\n        final Map<String, String> contextParams = new RuleSetParameterFinder(context.getService()).getContextParams(\n            context.getModel().getShape(operation.getInputShape()).get()\n        );\n\n        // Always write the bound path, but only the actual segments.\n        writer.write(\n            \"b.bp(\\\"$L\\\");\",\n            \"/\" +\n                trait\n                    .getUri()\n                    .getSegments()\n                    .stream()\n                    .filter(segment -> {\n                        String content = segment.getContent();\n                        boolean isContextParam = contextParams.containsKey(content);\n\n                        // If the endpoint also contains the uri segment, e.g. Bucket, we\n                        // do not want to include it in the operation URI to be resolved.\n                        // We use this logic plus a temporary control-list, since it is not yet known\n                        // how many services and param names will have this issue.\n                        return !(isContextParam\n                            && contextParamDeduplicationParamControlSet.contains(content));\n                    })\n                    .map(Segment::toString)\n                    .collect(Collectors.joining(\"/\"))\n        );\n\n        // Handle any label bindings.\n        if (!labelBindings.isEmpty()) {\n            writer.addImportSubmodule(\n                \"resolvedPath\",\n                \"__resolvedPath\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.PROTOCOLS\n            );\n\n            Model model = context.getModel();\n            List<Segment> uriLabels = trait.getUri().getLabels();\n            for (HttpBinding binding : labelBindings) {\n                String memberName = symbolProvider.toMemberName(binding.getMember());\n                Shape target = model.expectShape(binding.getMember().getTarget());\n\n                String labelValueProvider =\n                    \"() => \" +\n                        getInputValue(\n                            context,\n                            binding.getLocation(),\n                            \"input.\" + memberName + \"!\",\n                            binding.getMember(),\n                            target\n                        );\n\n                // Get the correct label to use.\n                Segment uriLabel = uriLabels\n                    .stream()\n                    .filter(s -> s.getContent().equals(memberName))\n                    .findFirst()\n                    .get();\n                writer.write(\n                    \"b.p('$L', $L, '$L', $L)\",\n                    memberName,\n                    labelValueProvider,\n                    uriLabel.toString(),\n                    uriLabel.isGreedyLabel() ? \"true\" : \"false\"\n                );\n            }\n        }\n    }\n\n    private boolean writeRequestQueryString(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex,\n        HttpTrait trait\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        List<HttpBinding> queryBindings = bindingIndex.getRequestBindings(operation, Location.QUERY);\n        List<HttpBinding> queryParamsBindings = bindingIndex.getRequestBindings(operation, Location.QUERY_PARAMS);\n\n        // Build the initial query bag.\n        Map<String, String> queryLiterals = trait.getUri().getQueryLiterals();\n        if (!queryLiterals.isEmpty() || !queryBindings.isEmpty() || !queryParamsBindings.isEmpty()) {\n            writer.openBlock(\"const query: any = map({\", \"});\", () -> {\n                if (!queryLiterals.isEmpty()) {\n                    // Write any query literals present in the uri.\n                    queryLiterals.forEach((k, v) -> writer.write(\"[$L]: [, $S],\", context.getStringStore().var(k), v));\n                }\n                // Handle any additional query params bindings.\n                // If query string parameter is also present in httpQuery, it would be overwritten.\n                // Serializing HTTP messages https://smithy.io/2.0/spec/http-bindings.html#serializing-http-messages\n                if (!queryParamsBindings.isEmpty()) {\n                    SymbolProvider symbolProvider = context.getSymbolProvider();\n                    String memberName = symbolProvider.toMemberName(queryParamsBindings.get(0).getMember());\n                    writer.addImportSubmodule(\n                        \"convertMap\",\n                        \"convertMap\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    writer.write(\"...convertMap(input.$L),\", memberName);\n                }\n                // Handle any additional query bindings.\n                if (!queryBindings.isEmpty()) {\n                    for (HttpBinding binding : queryBindings) {\n                        writeRequestQueryParam(context, binding);\n                    }\n                }\n            });\n        }\n\n        // Any binding or literal means we generated a query bag.\n        return !queryBindings.isEmpty() || !queryLiterals.isEmpty() || !queryParamsBindings.isEmpty();\n    }\n\n    private void writeRequestQueryParam(GenerationContext context, HttpBinding binding) {\n        Model model = context.getModel();\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        String memberName = symbolProvider.toMemberName(binding.getMember());\n        writer.addImportSubmodule(\n            \"extendedEncodeURIComponent\",\n            \"__extendedEncodeURIComponent\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n\n        Shape target = model.expectShape(binding.getMember().getTarget());\n\n        boolean isIdempotencyToken = binding.getMember().hasTrait(IdempotencyTokenTrait.class);\n        boolean isRequired = binding.getMember().isRequired();\n\n        String idempotencyComponent = \"\";\n        if (isIdempotencyToken && !isRequired) {\n            writer.addImportSubmodule(\n                \"v4\",\n                \"generateIdempotencyToken\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n            idempotencyComponent = \" ?? generateIdempotencyToken()\";\n        }\n        String memberAssertionComponent = (idempotencyComponent.isEmpty() ? \"!\" : \"\");\n\n        String queryValue = getInputValue(\n            context,\n            binding.getLocation(),\n            \"input[\" + context.getStringStore().var(memberName) + \"]\" + memberAssertionComponent,\n            binding.getMember(),\n            target\n        );\n\n        String simpleAccessExpression =\n            \"input[\" + context.getStringStore().var(memberName) + \"]\" + memberAssertionComponent;\n\n        boolean isSimpleAccessExpression = Objects.equals(simpleAccessExpression, queryValue);\n\n        writer.addImportSubmodule(\n            \"expectNonNull\",\n            \"__expectNonNull\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.SERDE\n        );\n\n        if (isSimpleAccessExpression) {\n            String value = isRequired ? \"__expectNonNull($L, `\" + memberName + \"`)\" : \"$L\";\n            // simple undefined check\n            writer.write(\n                \"[$L]: [,\" + value + idempotencyComponent + \"],\",\n                context.getStringStore().var(binding.getLocationName()),\n                queryValue\n            );\n        } else {\n            if (isRequired) {\n                // __expectNonNull is immediately invoked and not inside a function.\n                writer.write(\n                    \"[$L]: [__expectNonNull(input.$L, `$L`) != null, () => $L],\",\n                    context.getStringStore().var(binding.getLocationName()),\n                    memberName,\n                    memberName,\n                    queryValue // no idempotency token default for required members\n                );\n            } else {\n                // undefined check with lazy eval\n                writer.write(\n                    \"[$L]: [() => input.$L !== void 0, () => ($L)$L],\",\n                    context.getStringStore().var(binding.getLocationName()),\n                    memberName,\n                    queryValue,\n                    idempotencyComponent\n                );\n            }\n        }\n    }\n\n    private void flushHeadersBuffer(TypeScriptWriter writer) {\n        for (Map.Entry<String, String> entry : headerBuffer.entrySet()) {\n            writer.write(entry.getValue());\n        }\n        headerBuffer.clear();\n    }\n\n    private void writeRequestHeaders(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n\n        List<HttpBinding> headers = bindingIndex.getRequestBindings(operation, Location.HEADER);\n        List<HttpBinding> prefixHeaders = bindingIndex.getRequestBindings(operation, Location.PREFIX_HEADERS);\n        boolean inputPresent = operation.getInput().isPresent();\n\n        int normalHeaderCount = headers.size();\n        int prefixHeaderCount = prefixHeaders.size();\n\n        String opening;\n        String closing;\n        if (normalHeaderCount + prefixHeaderCount == 0) {\n            opening = \"const headers: any = {\";\n            closing = \"};\";\n        } else {\n            writer.addImportSubmodule(\n                \"isSerializableHeaderValue\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CLIENT\n            );\n            opening = normalHeaderCount > 0\n                ? \"const headers: any = map({}, isSerializableHeaderValue, {\"\n                : \"const headers: any = map({\";\n            closing = \"});\";\n        }\n\n        // Headers are always present either from the default document or the payload.\n        writer.write(opening);\n        writer.indent();\n        // Only set the content type if one can be determined.\n        writeContentTypeHeader(context, operation, true);\n        writeDefaultInputHeaders(context, operation);\n        if (inputPresent) {\n            // Handle assembling prefix headers.\n            for (HttpBinding binding : prefixHeaders) {\n                writePrefixHeaders(context, binding);\n            }\n        }\n\n        if (inputPresent) {\n            for (HttpBinding binding : headers) {\n                writeNormalHeader(context, binding);\n            }\n        }\n\n        flushHeadersBuffer(writer);\n        writer.dedent();\n        writer.write(closing);\n    }\n\n    private void writeNormalHeader(GenerationContext context, HttpBinding binding) {\n        String memberLocation =\n            \"input[\" +\n                context.getStringStore().var(context.getSymbolProvider().toMemberName(binding.getMember())) +\n                \"]\";\n        Shape target = context.getModel().expectShape(binding.getMember().getTarget());\n\n        String headerKey = binding.getLocationName().toLowerCase(Locale.US);\n        String headerValue = getInputValue(\n            context,\n            binding.getLocation(),\n            memberLocation + \"!\",\n            binding.getMember(),\n            target\n        );\n\n        boolean headerAssertion = headerValue.endsWith(\"!\");\n        String headerBaseValue = (headerAssertion ? headerValue.substring(0, headerValue.length() - 1) : headerValue);\n        boolean isIdempotencyToken = binding.getMember().hasTrait(IdempotencyTokenTrait.class);\n\n        if (!Objects.equals(memberLocation + \"!\", headerValue)) {\n            String defaultValue = \"\";\n            if (headerBuffer.containsKey(headerKey)) {\n                String s = headerBuffer.get(headerKey);\n                defaultValue = \" || \" + s.substring(s.indexOf(\": \") + 2, s.length() - 1);\n            } else if (isIdempotencyToken) {\n                context.getWriter()\n                    .addImportSubmodule(\n                        \"v4\",\n                        \"generateIdempotencyToken\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                defaultValue = \" ?? generateIdempotencyToken()\";\n            }\n\n            String headerValueExpression = headerAssertion && !defaultValue.isEmpty()\n                ? headerBaseValue + defaultValue\n                : headerValue + defaultValue;\n\n            // evaluated value has a function or method call attached\n            context.getWriter()\n                .addImportSubmodule(\n                    \"isSerializableHeaderValue\",\n                    null,\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.CLIENT\n                );\n            headerBuffer.put(\n                headerKey,\n                String.format(\n                    \"[%s]: [() => isSerializableHeaderValue(%s), () => %s],\",\n                    context.getStringStore().var(headerKey),\n                    memberLocation + defaultValue,\n                    headerValueExpression\n                )\n            );\n        } else {\n            String constructedHeaderValue = (headerAssertion ? headerBaseValue : headerValue);\n            if (headerBuffer.containsKey(headerKey)) {\n                String s = headerBuffer.get(headerKey);\n                constructedHeaderValue += \" || \" + s.substring(s.indexOf(\": \") + 2, s.length() - 1);\n            } else if (isIdempotencyToken) {\n                context.getWriter()\n                    .addImportSubmodule(\n                        \"v4\",\n                        \"generateIdempotencyToken\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                constructedHeaderValue += \" ?? generateIdempotencyToken()\";\n            } else {\n                constructedHeaderValue = headerValue;\n            }\n            headerBuffer.put(\n                headerKey,\n                String.format(\"[%s]: %s,\", context.getStringStore().var(headerKey), constructedHeaderValue)\n            );\n        }\n    }\n\n    private void writePrefixHeaders(GenerationContext context, HttpBinding binding) {\n        Model model = context.getModel();\n        TypeScriptWriter writer = context.getWriter();\n        String memberLocation = \"input.\" + context.getSymbolProvider().toMemberName(binding.getMember());\n        MapShape prefixMap = model.expectShape(binding.getMember().getTarget()).asMapShape().get();\n        Shape target = model.expectShape(prefixMap.getValue().getTarget());\n        // Iterate through each entry in the member.\n        writer.openBlock(\"...($1L !== undefined) && Object.keys($1L).reduce(\", \"),\", memberLocation, () -> {\n            writer.openBlock(\"(acc: any, suffix: string) => {\", \"}, {}\", () -> {\n                // Use a ! since we already validated the input member is defined above.\n                String headerValue = getInputValue(\n                    context,\n                    binding.getLocation(),\n                    memberLocation + \"![suffix]\",\n                    binding.getMember(),\n                    target\n                );\n                // Append the prefix to key.\n                writer.write(\n                    \"acc[`$L$${suffix.toLowerCase()}`] = $L;\",\n                    binding.getLocationName().toLowerCase(Locale.US),\n                    headerValue\n                );\n                writer.write(\"return acc;\");\n            });\n        });\n    }\n\n    private void writeResponseHeaders(\n        GenerationContext context,\n        Shape operationOrError,\n        HttpBindingIndex bindingIndex,\n        Runnable injectExtraHeaders\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n\n        // Headers are always present either from the default document or the payload.\n        writer.addImportSubmodule(\n            \"isSerializableHeaderValue\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CLIENT\n        );\n        writer.openBlock(\"let headers: any = map({}, isSerializableHeaderValue, {\", \"});\", () -> {\n            writeContentTypeHeader(context, operationOrError, false);\n            injectExtraHeaders.run();\n\n            // Handle assembling prefix headers.\n            for (HttpBinding binding : bindingIndex.getResponseBindings(operationOrError, Location.PREFIX_HEADERS)) {\n                writePrefixHeaders(context, binding);\n            }\n\n            for (HttpBinding binding : bindingIndex.getResponseBindings(operationOrError, Location.HEADER)) {\n                writeNormalHeader(context, binding);\n            }\n\n            flushHeadersBuffer(writer);\n        });\n    }\n\n    private void writeContentTypeHeader(GenerationContext context, Shape operationOrError, boolean isInput) {\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        Optional<String> optionalContentType;\n        if (isInput) {\n            optionalContentType = bindingIndex.determineRequestContentType(operationOrError, getDocumentContentType());\n        } else {\n            optionalContentType = bindingIndex.determineResponseContentType(operationOrError, getDocumentContentType());\n        }\n        // If we need to write a default body then it needs a content type.\n        if (optionalContentType.isEmpty() && shouldWriteDefaultBody(context, operationOrError, isInput)) {\n            optionalContentType = Optional.of(getDocumentContentType());\n        }\n        optionalContentType.ifPresent(contentType -> {\n            // context.getWriter().write(\"'content-type': $S,\", contentType)\n            headerBuffer.put(\"content-type\", \"'content-type': '\" + contentType + \"',\");\n        });\n    }\n\n    private List<HttpBinding> writeRequestBody(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex\n    ) {\n        List<HttpBinding> payloadBindings = bindingIndex.getRequestBindings(operation, Location.PAYLOAD);\n        List<HttpBinding> documentBindings = bindingIndex.getRequestBindings(operation, Location.DOCUMENT);\n        boolean shouldWriteDefaultBody = shouldWriteDefaultInputBody(context, operation);\n        return writeBody(context, operation, payloadBindings, documentBindings, shouldWriteDefaultBody, true);\n    }\n\n    private List<HttpBinding> writeResponseBody(\n        GenerationContext context,\n        Shape operationOrError,\n        HttpBindingIndex bindingIndex\n    ) {\n        // We just make one up here since it's not actually used by consumers.\n        List<HttpBinding> payloadBindings = bindingIndex.getResponseBindings(operationOrError, Location.PAYLOAD);\n        List<HttpBinding> documentBindings = bindingIndex.getResponseBindings(operationOrError, Location.DOCUMENT);\n        boolean shouldWriteDefaultBody = operationOrError\n            .asOperationShape()\n            .map(operation -> shouldWriteDefaultOutputBody(context, operation))\n            .orElseGet(() -> shouldWriteDefaultErrorBody(context, operationOrError.asStructureShape().get()));\n        return writeBody(context, operationOrError, payloadBindings, documentBindings, shouldWriteDefaultBody, false);\n    }\n\n    private boolean shouldWriteDefaultBody(GenerationContext context, Shape operationOrError, boolean isInput) {\n        if (isInput) {\n            return shouldWriteDefaultInputBody(context, operationOrError.asOperationShape().get());\n        } else if (operationOrError.isOperationShape()) {\n            return shouldWriteDefaultOutputBody(context, operationOrError.asOperationShape().get());\n        } else {\n            return shouldWriteDefaultErrorBody(context, operationOrError.asStructureShape().get());\n        }\n    }\n\n    /**\n     * Given a context and operation, should a default input body be written. By default, a body\n     * will be written if and only if there are payload members bound to the input.\n     *\n     * @param context The generation context.\n     * @param operation The operation whose input is being serialized.\n     *\n     * @return True if a default body should be generated.\n     */\n    protected boolean shouldWriteDefaultInputBody(GenerationContext context, OperationShape operation) {\n        return HttpBindingIndex.of(context.getModel()).hasRequestBody(operation);\n    }\n\n    /**\n     * Given a context and operation, should a default output body be written. By default no body will be written\n     * if there are no members bound to the output.\n     *\n     * @param context The generation context.\n     * @param operation The operation whose output is being serialized.\n     *\n     * @return True if a default body should be generated.\n     */\n    protected boolean shouldWriteDefaultOutputBody(GenerationContext context, OperationShape operation) {\n        return HttpBindingIndex.of(context.getModel()).getResponseBindings(operation).isEmpty();\n    }\n\n    /**\n     * Given a context and error, should a default body be written. By default no body will be written\n     * if there are no members bound to the error.\n     *\n     * @param context The generation context.\n     * @param error The error being serialized.\n     *\n     * @return True if a default body should be generated.\n     */\n    protected boolean shouldWriteDefaultErrorBody(GenerationContext context, StructureShape error) {\n        return HttpBindingIndex.of(context.getModel()).getResponseBindings(error).isEmpty();\n    }\n\n    private List<HttpBinding> writeBody(\n        GenerationContext context,\n        Shape operationOrError,\n        List<HttpBinding> payloadBindings,\n        List<HttpBinding> documentBindings,\n        boolean shouldWriteDefaultBody,\n        boolean isInput\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        // Write the default `body` property.\n        writer.write(\"let body: any;\");\n\n        // Handle a payload binding explicitly.\n        if (!payloadBindings.isEmpty()) {\n            // There can only be one payload binding.\n            HttpBinding payloadBinding = payloadBindings.get(0);\n            if (isInput) {\n                serializeInputPayload(context, operationOrError.asOperationShape().get(), payloadBinding);\n            } else if (operationOrError.isOperationShape()) {\n                serializeOutputPayload(context, operationOrError.asOperationShape().get(), payloadBinding);\n            } else {\n                serializeErrorPayload(context, operationOrError.asStructureShape().get(), payloadBinding);\n            }\n            return payloadBindings;\n        }\n\n        // If we have document bindings or need a defaulted request body,\n        // use the input document serialization.\n        if (!documentBindings.isEmpty() || shouldWriteDefaultBody) {\n            documentBindings.sort(Comparator.comparing(HttpBinding::getMemberName));\n            if (isInput) {\n                serializeInputDocumentBody(context, operationOrError.asOperationShape().get(), documentBindings);\n            } else if (operationOrError.isOperationShape()) {\n                serializeOutputDocumentBody(context, operationOrError.asOperationShape().get(), documentBindings);\n            } else {\n                serializeErrorDocumentBody(context, operationOrError.asStructureShape().get(), documentBindings);\n            }\n            return documentBindings;\n        }\n\n        // Otherwise, we have no bindings to add shapes from.\n        return ListUtils.of();\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * shape. This may use native types (like getting Date formats for timestamps,)\n     * converters (like a base64Encoder,) or invoke complex type serializers to\n     * manipulate the dataSource into the proper input content.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param member The member that points to the value being provided.\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the input value.\n     */\n    protected String getInputValue(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        MemberShape member,\n        Shape target\n    ) {\n        if (target instanceof StringShape) {\n            return getStringInputParam(context, bindingType, dataSource, target);\n        } else if (target instanceof FloatShape || target instanceof DoubleShape) {\n            // Handle decimal numbers needing to have .0 in their value when whole numbers.\n            return \"((\" + dataSource + \" % 1 == 0) ? \" + dataSource + \" + \\\".0\\\" : \" + dataSource + \".toString())\";\n        } else if (target instanceof BooleanShape || target instanceof NumberShape) {\n            return dataSource + \".toString()\";\n        } else if (target instanceof TimestampShape) {\n            return getTimestampInputParam(context, bindingType, dataSource, member);\n        } else if (target instanceof DocumentShape) {\n            return dataSource;\n        } else if (target instanceof BlobShape) {\n            return getBlobInputParam(bindingType, dataSource);\n        } else if (target instanceof CollectionShape) {\n            return getCollectionInputParam(context, bindingType, dataSource, (CollectionShape) target);\n        } else if (target instanceof StructureShape || target instanceof UnionShape) {\n            return getNamedMembersInputParam(context, bindingType, dataSource, target);\n        } else if (target instanceof MapShape) {\n            return getMapInputParam(context, bindingType, dataSource, (MapShape) target);\n        }\n\n        throw new CodegenException(\n            String.format(\n                \"Unsupported %s binding of %s to %s in %s using the %s protocol\",\n                bindingType,\n                member.getMemberName(),\n                target.getType(),\n                member.getContainer(),\n                getName()\n            )\n        );\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * string. By default, this base64 encodes content in headers if there is a\n     * mediaType applied to the string, and passes through for all other cases.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the input string.\n     */\n    private String getStringInputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        Shape target\n    ) {\n        String baseParam = HttpProtocolGeneratorUtils.getStringInputParam(context, target, dataSource);\n        switch (bindingType) {\n            case HEADER:\n                // Encode these to base64 if a MediaType is present.\n                if (target.hasTrait(MediaTypeTrait.ID)) {\n                    return \"context.base64Encoder(Buffer.from(\" + baseParam + \"))\";\n                }\n            default:\n                return baseParam;\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * blob. By default, this base64 encodes content in headers and query strings,\n     * and passes through for payloads.\n     *\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @return Returns a value or expression of the input blob.\n     */\n    private String getBlobInputParam(Location bindingType, String dataSource) {\n        switch (bindingType) {\n            case PAYLOAD:\n                return dataSource;\n            case HEADER:\n            case QUERY:\n                // Encode these to base64.\n                return \"context.base64Encoder(\" + dataSource + \")\";\n            default:\n                throw new CodegenException(\"Unexpected blob binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * collection. By default, this separates the list with commas in headers, and\n     * relies on the HTTP implementation for query strings.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the input collection.\n     */\n    private String getCollectionInputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        CollectionShape target\n    ) {\n        MemberShape targetMember = target.getMember();\n        Shape collectionTarget = context.getModel().expectShape(targetMember.getTarget());\n        // Use a basic array to serialize this more easily.\n        if (target.isSetShape()) {\n            dataSource = \"Array.from(\" + dataSource + \".values())\";\n        }\n        String collectionTargetValue = getInputValue(context, bindingType, \"_entry\", targetMember, collectionTarget);\n        String iteratedParam;\n        if (collectionTargetValue.equals(\"_entry\")) {\n            iteratedParam = \"(\" + dataSource + \" || [])\";\n        } else {\n            iteratedParam = \"(\" + dataSource + \" || []).map(_entry => \" + collectionTargetValue + \" as any)\";\n        }\n\n        switch (bindingType) {\n            case HEADER:\n                if (collectionTarget.isStringShape()) {\n                    context\n                        .getWriter()\n                        .addImportSubmodule(\n                            \"quoteHeader\",\n                            \"__quoteHeader\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.SERDE\n                        );\n                    return iteratedParam + \".map(__quoteHeader).join(', ')\";\n                }\n                return iteratedParam + \".join(', ')\";\n            case QUERY:\n            case QUERY_PARAMS:\n                return iteratedParam;\n            default:\n                throw new CodegenException(\"Unexpected collection binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * shape. This redirects to a serialization function for payloads,\n     * and fails otherwise.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the input shape.\n     */\n    private String getNamedMembersInputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        Shape target\n    ) {\n        switch (bindingType) {\n            case PAYLOAD:\n                Symbol symbol = context.getSymbolProvider().toSymbol(target);\n\n                boolean mayElideInput =\n                    SerdeElisionIndex.of(context.getModel()).mayElide(target) &&\n                        (enableSerdeElision() && !context.getSettings().generateServerSdk());\n\n                if (mayElideInput) {\n                    context.getWriter()\n                        .addImportSubmodule(\n                            \"_json\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CLIENT\n                        );\n                    return \"_json(\" + dataSource + \")\";\n                }\n\n                return ProtocolGenerator.getSerFunctionShortName(symbol) + \"(\" + dataSource + \", context)\";\n            default:\n                throw new CodegenException(\"Unexpected named member shape binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * map.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the input collection.\n     */\n    private String getMapInputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        MapShape target\n    ) {\n        Model model = context.getModel();\n        MemberShape mapMember = target.getValue();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        String valueString = getInputValue(\n            context,\n            bindingType,\n            \"value\",\n            mapMember,\n            model.expectShape(mapMember.getTarget())\n        );\n        return (\"Object.entries(\" +\n            dataSource +\n            \" || {}).reduce(\" +\n            \"(acc: any, [key, value]: [string, \" +\n            symbolProvider.toSymbol(mapMember) +\n            \"]) => {\" +\n            \"acc[key] = \" +\n            valueString +\n            \";\" +\n            \"return acc;\" +\n            \"}, {})\");\n    }\n\n    /**\n     * Given context and a source of data, generate an input value provider for the\n     * shape. This uses the format specified, converting to strings when in a header,\n     * label, or query string.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param member The member that points to the value being provided.\n     * @return Returns a value or expression of the input shape.\n     */\n    private String getTimestampInputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        MemberShape member\n    ) {\n        HttpBindingIndex httpIndex = HttpBindingIndex.of(context.getModel());\n        Format format;\n        switch (bindingType) {\n            case HEADER:\n                format = httpIndex.determineTimestampFormat(member, bindingType, Format.HTTP_DATE);\n                break;\n            case LABEL:\n                format = httpIndex.determineTimestampFormat(member, bindingType, getDocumentTimestampFormat());\n                break;\n            case QUERY:\n                format = httpIndex.determineTimestampFormat(member, bindingType, Format.DATE_TIME);\n                break;\n            default:\n                throw new CodegenException(\"Unexpected named member shape binding location `\" + bindingType + \"`\");\n        }\n\n        String baseParam = HttpProtocolGeneratorUtils.getTimestampInputParam(context, dataSource, member, format);\n        return baseParam + \".toString()\";\n    }\n\n    /**\n     * Writes any additional HTTP input headers required by the protocol implementation.\n     *\n     * <p>Two parameters will be available in scope:\n     * <ul>\n     *   <li>{@code input: <T>}: the type generated for the operation's input.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     *   \"foo\": \"This is a custom header\",\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param operation The operation whose input is being generated.\n     */\n    protected void writeDefaultInputHeaders(GenerationContext context, OperationShape operation) {}\n\n    /**\n     * Writes any additional HTTP output headers required by the protocol implementation.\n     *\n     * <p>Two parameters will be available in scope:\n     * <ul>\n     *   <li>{@code input: <T>}: the type generated for the operation's input.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     *   \"foo\": \"This is a custom header\",\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param operation The operation whose output is being generated.\n     */\n    protected void writeDefaultOutputHeaders(GenerationContext context, OperationShape operation) {}\n\n    /**\n     * Writes any additional HTTP error headers required by the protocol implementation.\n     *\n     * <p>Two parameters will be available in scope:\n     * <ul>\n     *   <li>{@code input: <T>}: the type generated for the operation's input.</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     *   \"foo\": \"This is a custom header\",\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param error The error which is being generated.\n     */\n    protected void writeDefaultErrorHeaders(GenerationContext context, StructureShape error) {}\n\n    /**\n     * Writes the code needed to serialize a protocol input document.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the request body.\n     * This variable will already be defined in scope.\n     *\n     * Implementations MUST properly fill the body parameter even if no\n     * document bindings are present.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const bodyParams: any = {};\n     * if (input.barValue !== undefined) {\n     *   bodyParams['barValue'] = input.barValue;\n     * }\n     * body = JSON.stringify(bodyParams);\n     * }</pre>\n     * @param context The generation context.\n     * @param operation The operation whose input is being generated.\n     * @param documentBindings The bindings to place in the document.\n     */\n    protected abstract void serializeInputDocumentBody(\n        GenerationContext context,\n        OperationShape operation,\n        List<HttpBinding> documentBindings\n    );\n\n    /**\n     * Writes the code needed to serialize an event payload as a protocol-specific document.\n     *\n     * <p>Implementations of this method are expected to set a value to the instantiated ${@code body} variable.\n     * The value set is expected to be a JavaScript ${@code Uint8Array} type and is to be encoded as the\n     * event payload.\n     *\n     * <p>Three parameters will be available in scope:\n     * <ul>\n     *   <li>{@code body}: The serialized event payload object that needs to be transformed to binary data</li>\n     *   <li>{@code context: SerdeContext}: a TypeScript type containing context and tools for type serde.</li>\n     * </ul>\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * body = context.utf8Decoder(JSON.stringify(body));\n     * }</pre>\n     * @param context The generation context.\n     */\n    protected abstract void serializeInputEventDocumentPayload(GenerationContext context);\n\n    /**\n     * Writes the code needed to serialize a protocol output document.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the request body.\n     * This variable will already be defined in scope.\n     *\n     * Implementations MUST properly fill the body parameter even if no\n     * document bindings are present.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const bodyParams: any = {};\n     * if (input.barValue !== undefined) {\n     *   bodyParams['barValue'] = input.barValue;\n     * }\n     * body = JSON.stringify(bodyParams);\n     * }</pre>\n     * @param context The generation context.\n     * @param operation The operation whose output is being generated.\n     * @param documentBindings The bindings to place in the document.\n     */\n    protected abstract void serializeOutputDocumentBody(\n        GenerationContext context,\n        OperationShape operation,\n        List<HttpBinding> documentBindings\n    );\n\n    /**\n     * Writes the code needed to serialize a protocol error document.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the request body.\n     * This variable will already be defined in scope.\n     *\n     * Implementations MUST properly fill the body parameter even if no\n     * document bindings are present.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const bodyParams: any = {};\n     * if (input.barValue !== undefined) {\n     *   bodyParams['barValue'] = input.barValue;\n     * }\n     * body = JSON.stringify(bodyParams);\n     * }</pre>\n     * @param context The generation context.\n     * @param error The error that is being generated.\n     * @param documentBindings The bindings to place in the document.\n     */\n    protected abstract void serializeErrorDocumentBody(\n        GenerationContext context,\n        StructureShape error,\n        List<HttpBinding> documentBindings\n    );\n\n    /**\n     * Writes the code needed to serialize the input payload of a request.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the request body.\n     * This variable will already be defined in scope.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * if (input.body !== undefined) {\n     *   body = context.base64Encoder(input.body);\n     * }\n     * }</pre>\n     * @param context The generation context.\n     * @param operation The operation whose input is being generated.\n     * @param payloadBinding The payload binding to serialize.\n     */\n    protected void serializeInputPayload(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBinding payloadBinding\n    ) {\n        genericSerializePayload(context, payloadBinding);\n    }\n\n    /**\n     * Writes the code needed to serialize the output payload of a response.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the response body.\n     * This variable will already be defined in scope.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * if (input.body !== undefined) {\n     *   body = context.base64Encoder(input.body);\n     * }\n     * }</pre>\n     * @param context The generation context.\n     * @param operation The operation whose output is being generated.\n     * @param payloadBinding The payload binding to serialize.\n     */\n    protected void serializeOutputPayload(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBinding payloadBinding\n    ) {\n        genericSerializePayload(context, payloadBinding);\n    }\n\n    /**\n     * Writes the code needed to serialize the error payload of a response.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the response body.\n     * This variable will already be defined in scope.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * if (input.body !== undefined) {\n     *   body = context.base64Encoder(input.body);\n     * }\n     * }</pre>\n     * @param context The generation context.\n     * @param error The error being generated.\n     * @param payloadBinding The payload binding to serialize.\n     */\n    protected void serializeErrorPayload(GenerationContext context, StructureShape error, HttpBinding payloadBinding) {\n        genericSerializePayload(context, payloadBinding);\n    }\n\n    private void genericSerializePayload(GenerationContext context, HttpBinding payloadBinding) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        String memberName = symbolProvider.toMemberName(payloadBinding.getMember());\n\n        writer.openBlock(\"if (input.$L !== undefined) {\", \"}\", memberName, () -> {\n            Shape target = context.getModel().expectShape(payloadBinding.getMember().getTarget());\n\n            // Because documents can be set to a null value, handle setting that as the body\n            // instead of using toString, as `null.toString()` will fail.\n            if (target.isDocumentShape()) {\n                writer.openBlock(\n                    \"if (input.$L === null) {\",\n                    \"} else {\",\n                    memberName,\n                    () -> writer.write(\"body = \\\"null\\\";\")\n                );\n                writer.indent();\n            }\n            writer.write(\n                \"body = $L;\",\n                getInputValue(\n                    context,\n                    Location.PAYLOAD,\n                    \"input.\" + memberName,\n                    payloadBinding.getMember(),\n                    target\n                )\n            );\n            if (target.isDocumentShape()) {\n                writer.dedent();\n                writer.write(\"}\");\n            }\n        });\n    }\n\n    private void generateOperationRequestDeserializer(\n        GenerationContext context,\n        OperationShape operation,\n        HttpTrait trait\n    ) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference requestType = getApplicationProtocol().getRequestType();\n        Model model = context.getModel();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(model);\n        TypeScriptWriter writer = context.getWriter();\n\n        // Ensure that the request type is imported.\n        writer.addUseImports(requestType);\n        writer.addTypeImport(\"Endpoint\", \"__Endpoint\", TypeScriptDependency.SMITHY_TYPES);\n        String methodName = ProtocolGenerator.getGenericDeserFunctionName(symbol) + \"Request\";\n        // Add the normalized input type.\n        Symbol inputType = symbol.expectProperty(\"inputType\", Symbol.class);\n        String contextType = CodegenUtils.getOperationSerializerContextType(writer, context.getModel(), operation);\n\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  output: $T,\\n\" + \"  context: $L\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            requestType,\n            contextType,\n            inputType,\n            () -> {\n                handleContentType(context, operation, bindingIndex);\n                handleAccept(context, operation, bindingIndex);\n                // Start deserializing the response.\n                writer.openBlock(\"const contents: any = map({\", \"});\", () -> {\n                    readRequestHeaders(context, operation, bindingIndex, \"output\");\n                });\n                readQueryString(context, operation, bindingIndex);\n                readPath(context, operation, bindingIndex, trait);\n                readHost(context, operation);\n                List<HttpBinding> documentBindings = readRequestBody(context, operation, bindingIndex);\n                // Track all shapes bound to the document so their deserializers may be generated.\n                documentBindings.forEach(binding -> {\n                    Shape target = model.expectShape(binding.getMember().getTarget());\n                    deserializingDocumentShapes.add(target);\n                });\n                writer.write(\"return contents;\");\n            }\n        );\n        writer.write(\"\");\n    }\n\n    /**\n     * Writes out handling for the content-type header. The following rules apply:\n     *\n     *  - The content-type header may always be omitted.\n     *  - If the input shape has a member with the httpPayload trait then the following apply:\n     *      - If the target is a shape with the mediaType trait, the value of the content-type header must\n     *        match if present.\n     *      - If the target is a blob shape without a media type, the content-type header may have any value.\n     *      - Otherwise the content-type header must match the implied content type of the target shape, e.g.\n     *        text/plain for a string.\n     *  - If the input shape has no members with the httpPayload trait, but does have members bound to\n     *    the document, the content-type header must match the default protocol document content type if\n     *    present.\n     *  - If the input shape has no members bound to the payload / document, the content-type header\n     *    must not be set.\n     */\n    private void handleContentType(GenerationContext context, OperationShape operation, HttpBindingIndex bindingIndex) {\n        // Don't enforce any restrictions on a blob bodies if they don't have a\n        // modeled media type. There are plenty of valid reasons for wanting to\n        // accept a range of media types in this case, like supporting multiple\n        // image/video formats.\n        if (bodyIsBlobWithoutMediaType(context, bindingIndex.getRequestBindings(operation).values())) {\n            return;\n        }\n\n        TypeScriptWriter writer = context.getWriter();\n        writer.addImport(\n            \"UnsupportedMediaTypeException\",\n            \"__UnsupportedMediaTypeException\",\n            TypeScriptDependency.SERVER_COMMON\n        );\n        Optional<String> optionalContentType = bindingIndex.determineRequestContentType(\n            operation,\n            getDocumentContentType()\n        );\n        writer.write(\n            \"const contentTypeHeaderKey: string | undefined = Object.keys(output.headers)\" +\n                \".find(key => key.toLowerCase() === 'content-type');\"\n        );\n        writer.openBlock(\"if (contentTypeHeaderKey != null) {\", \"};\", () -> {\n            writer.write(\"const contentType = output.headers[contentTypeHeaderKey];\");\n            if (optionalContentType.isPresent() || operation.getInput().isPresent()) {\n                String contentType = optionalContentType.orElse(getDocumentContentType());\n                // If the operation accepts a content type, it must be either unset or the expected value.\n                writer.openBlock(\"if (contentType !== undefined && contentType !== $S) {\", \"};\", contentType, () -> {\n                    writer.write(\"throw new __UnsupportedMediaTypeException();\");\n                });\n            } else {\n                // If the operation doesn't accept a content type, it must not be set.\n                writer.openBlock(\"if (contentType !== undefined) {\", \"};\", () -> {\n                    writer.write(\"throw new __UnsupportedMediaTypeException();\");\n                });\n            }\n        });\n    }\n\n    /**\n     * Writes out handling for the accept header. The following rules apply:\n     *\n     *  - The accept header may always be omitted.\n     *  - If the output shape has a member with the httpPayload trait then the following apply:\n     *      - If the target is a shape with the mediaType trait, the value of the accept header must\n     *        match if present.\n     *      - If the target is a blob shape without a media type, the accept header may have any value.\n     *      - Otherwise the accept header must match the implied content type of the target shape, e.g.\n     *        text/plain for a string.\n     *  - If the output shape has no members with the httpPayload trait, the accept header must match\n     *    the default protocol document content type if present.\n     *\n     *  Note: matching is performed based on the rules in https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2\n     *        and any match is considered acceptable, regardless of the supplied accept-params.\n     */\n    private void handleAccept(GenerationContext context, OperationShape operation, HttpBindingIndex bindingIndex) {\n        // Don't enforce any restrictions on a blob bodies if they don't have a\n        // modeled media type. There are plenty of valid reasons for wanting to\n        // accept a range of media types in this case, like supporting multiple\n        // image/video formats.\n        if (bodyIsBlobWithoutMediaType(context, bindingIndex.getResponseBindings(operation).values())) {\n            return;\n        }\n\n        TypeScriptWriter writer = context.getWriter();\n        Optional<String> optionalContentType = bindingIndex.determineResponseContentType(\n            operation,\n            getDocumentContentType()\n        );\n        writer.addImport(\"NotAcceptableException\", \"__NotAcceptableException\", TypeScriptDependency.SERVER_COMMON);\n        writer.addImport(\"acceptMatches\", \"__acceptMatches\", TypeScriptDependency.SERVER_COMMON);\n        writer.write(\n            \"const acceptHeaderKey: string | undefined = Object.keys(output.headers)\" +\n                \".find(key => key.toLowerCase() === 'accept');\"\n        );\n        writer.openBlock(\"if (acceptHeaderKey != null) {\", \"};\", () -> {\n            writer.write(\"const accept = output.headers[acceptHeaderKey];\");\n            String contentType = optionalContentType.orElse(getDocumentContentType());\n            // Validate that the content type matches the protocol default, or what's modeled if there's\n            // a modeled type.\n            writer.openBlock(\n                \"if (!__acceptMatches(accept, $S)) {\",\n                \"};\",\n                contentType,\n                () -> writer.write(\"throw new __NotAcceptableException();\")\n            );\n        });\n    }\n\n    private boolean bodyIsBlobWithoutMediaType(GenerationContext context, Collection<HttpBinding> bindings) {\n        for (HttpBinding binding : bindings) {\n            if (binding.getLocation() == Location.PAYLOAD) {\n                Shape target = context.getModel().expectShape(binding.getMember().getTarget());\n                return !target.hasTrait(MediaTypeTrait.class) && target.isBlobShape();\n            }\n        }\n        return false;\n    }\n\n    private void readQueryString(GenerationContext context, OperationShape operation, HttpBindingIndex bindingIndex) {\n        TypeScriptWriter writer = context.getWriter();\n        List<HttpBinding> directQueryBindings = bindingIndex.getRequestBindings(operation, Location.QUERY);\n        List<HttpBinding> mappedQueryBindings = bindingIndex.getRequestBindings(operation, Location.QUERY_PARAMS);\n        if (directQueryBindings.isEmpty() && mappedQueryBindings.isEmpty()) {\n            return;\n        }\n        writer.write(\"const query = output.query\");\n        writer.openBlock(\"if (query != null) {\", \"}\", () -> {\n            readDirectQueryBindings(context, directQueryBindings);\n            if (!mappedQueryBindings.isEmpty()) {\n                // There can only ever be one of these bindings on a given operation.\n                readMappedQueryBindings(context, mappedQueryBindings.get(0));\n            }\n        });\n    }\n\n    private void readDirectQueryBindings(GenerationContext context, List<HttpBinding> directQueryBindings) {\n        TypeScriptWriter writer = context.getWriter();\n        for (HttpBinding binding : directQueryBindings) {\n            String memberName = context.getSymbolProvider().toMemberName(binding.getMember());\n            writer.openBlock(\"if (query[$S] !== undefined) {\", \"}\", binding.getLocationName(), () -> {\n                Shape target = context.getModel().expectShape(binding.getMember().getTarget());\n                if (target instanceof CollectionShape) {\n                    writer.write(\n                        \"const queryValue = Array.isArray(query[$1S]) ? (query[$1S] as string[])\" +\n                            \" : [query[$1S] as string];\",\n                        binding.getLocationName()\n                    );\n                } else {\n                    writer.addImport(\n                        \"SerializationException\",\n                        \"__SerializationException\",\n                        TypeScriptDependency.SERVER_COMMON\n                    );\n                    writer.write(\"let queryValue: string;\");\n                    writer.openBlock(\"if (Array.isArray(query[$S])) {\", \"}\", binding.getLocationName(), () -> {\n                        writer.openBlock(\"if (query[$S].length === 1) {\", \"}\", binding.getLocationName(), () -> {\n                            writer.write(\"queryValue = query[$S][0];\", binding.getLocationName());\n                        });\n                        writer.openBlock(\"else {\", \"}\", () -> {\n                            writer.write(\"throw new __SerializationException();\");\n                        });\n                    });\n                    writer.openBlock(\"else {\", \"}\", () -> {\n                        writer.write(\"queryValue = query[$S] as string;\", binding.getLocationName());\n                    });\n                }\n                String queryValue = getOutputValue(\n                    context,\n                    binding.getLocation(),\n                    \"queryValue\",\n                    binding.getMember(),\n                    target\n                );\n                writer.write(\"contents.$L = $L;\", memberName, queryValue);\n            });\n        }\n    }\n\n    private void readMappedQueryBindings(GenerationContext context, HttpBinding mappedBinding) {\n        TypeScriptWriter writer = context.getWriter();\n        MapShape target = context.getModel().expectShape(mappedBinding.getMember().getTarget()).asMapShape().get();\n        Shape valueShape = context.getModel().expectShape(target.getValue().getTarget());\n        String valueType = \"string\";\n        if (valueShape instanceof CollectionShape) {\n            valueType = \"string[]\";\n        }\n        writer.write(\"let parsedQuery: Record<string, $L> = {}\", valueType);\n        writer.openBlock(\"for (const [key, value] of Object.entries(query)) {\", \"}\", () -> {\n            writer.write(\"let queryValue: string;\");\n            final String parsedValue;\n            if (valueShape instanceof CollectionShape) {\n                writer.write(\"const valueArray = Array.isArray(value) ? (value as string[]) : [value as string];\");\n                parsedValue = getOutputValue(\n                    context,\n                    mappedBinding.getLocation(),\n                    \"valueArray\",\n                    target.getValue(),\n                    valueShape\n                );\n            } else {\n                writer.addImport(\n                    \"SerializationException\",\n                    \"__SerializationException\",\n                    TypeScriptDependency.SERVER_COMMON\n                );\n                writer.openBlock(\"if (Array.isArray(value)) {\", \"}\", () -> {\n                    writer.openBlock(\"if (value.length === 1) {\", \"}\", () -> {\n                        writer.write(\"queryValue = value[0];\");\n                    });\n                    writer.openBlock(\"else {\", \"}\", () -> {\n                        writer.write(\"throw new __SerializationException();\");\n                    });\n                });\n                writer.openBlock(\"else {\", \"}\", () -> {\n                    writer.write(\"queryValue = value as string;\");\n                });\n                parsedValue = getOutputValue(\n                    context,\n                    mappedBinding.getLocation(),\n                    \"queryValue\",\n                    target.getValue(),\n                    valueShape\n                );\n            }\n            writer.write(\"parsedQuery[key] = $L;\", parsedValue);\n        });\n        String memberName = context.getSymbolProvider().toMemberName(mappedBinding.getMember());\n        writer.write(\"contents.$L = parsedQuery;\", memberName);\n    }\n\n    private void readPath(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex,\n        HttpTrait trait\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        List<HttpBinding> pathBindings = bindingIndex.getRequestBindings(operation, Location.LABEL);\n        if (pathBindings.isEmpty()) {\n            return;\n        }\n        StringBuilder pathRegexBuilder = new StringBuilder();\n        for (Segment segment : trait.getUri().getSegments()) {\n            pathRegexBuilder.append(\"/\");\n            if (segment.isLabel()) {\n                // Create a named capture group for the segment so we can grab it later without regard to order.\n                pathRegexBuilder.append(String.format(\"(?<%s>\", segment.getContent()));\n                if (segment.isGreedyLabel()) {\n                    pathRegexBuilder.append(\".+\");\n                } else {\n                    pathRegexBuilder.append(\"[^/]+\");\n                }\n                pathRegexBuilder.append(\")\");\n            } else {\n                segment\n                    .getContent()\n                    .chars()\n                    .forEach(c -> {\n                        if (REGEX_CHARS.contains((char) c)) {\n                            pathRegexBuilder.append('\\\\');\n                        }\n                        pathRegexBuilder.append((char) c);\n                    });\n            }\n        }\n        writer.write(\"const pathRegex = new RegExp($S);\", pathRegexBuilder.toString());\n        writer.write(\"const parsedPath = output.path.match(pathRegex);\");\n        writer.openBlock(\"if (parsedPath?.groups !== undefined) {\", \"}\", () -> {\n            for (HttpBinding binding : pathBindings) {\n                Shape target = context.getModel().expectShape(binding.getMember().getTarget());\n                String memberName = context.getSymbolProvider().toMemberName(binding.getMember());\n                // since this is in the path, we should decode early\n                String dataSource = String.format(\n                    \"decodeURIComponent(parsedPath.groups.%s)\",\n                    binding.getLocationName()\n                );\n                String labelValue = getOutputValue(\n                    context,\n                    binding.getLocation(),\n                    dataSource,\n                    binding.getMember(),\n                    target\n                );\n                writer.write(\"contents.$L = $L;\", memberName, labelValue);\n            }\n        });\n    }\n\n    private void readHost(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n        if (!operation.hasTrait(EndpointTrait.class)) {\n            return;\n        }\n        EndpointTrait endpointTrait = operation.expectTrait(EndpointTrait.class);\n        if (endpointTrait.getHostPrefix().getLabels().isEmpty()) {\n            return;\n        }\n        // Anchor to the beginning since we're looking at the host's prefix\n        StringBuilder endpointRegexBuilder = new StringBuilder(\"^\");\n        for (Segment segment : endpointTrait.getHostPrefix().getSegments()) {\n            if (segment.isLabel()) {\n                // Create a named capture group for the segment so we can grab it later without regard to order.\n                endpointRegexBuilder.append(String.format(\"(?<%s>.*)\", segment.getContent()));\n            } else {\n                endpointRegexBuilder.append(segment.getContent().replace(\".\", \"\\\\.\"));\n            }\n        }\n        writer.write(\"const hostRegex = new RegExp($S);\", endpointRegexBuilder.toString());\n        writer.write(\"const parsedHost = output.path.match(hostRegex);\");\n        Shape input = context.getModel().expectShape(operation.getInput().get());\n        writer.openBlock(\"if (parsedHost?.groups !== undefined) {\", \"}\", () -> {\n            for (MemberShape member : input.members()) {\n                if (member.hasTrait(HostLabelTrait.class)) {\n                    Shape target = context.getModel().expectShape(member.getTarget());\n                    String memberName = context.getSymbolProvider().toMemberName(member);\n                    String labelValue = getOutputValue(\n                        context,\n                        Location.LABEL,\n                        \"parsedHost.groups.\" + member.getMemberName(),\n                        member,\n                        target\n                    );\n                    writer.write(\"contents.$L = $L;\", memberName, labelValue);\n                }\n            }\n        });\n    }\n\n    private void generateOperationResponseDeserializer(\n        GenerationContext context,\n        OperationShape operation,\n        HttpTrait trait\n    ) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        Model model = context.getModel();\n        TypeScriptWriter writer = context.getWriter();\n\n        // Ensure that the response type is imported.\n        writer.addUseImports(responseType);\n        // e.g., deserializeAws_restJson1_1ExecuteStatement\n        String methodName = ProtocolGenerator.getDeserFunctionShortName(symbol);\n        String methodLongName = ProtocolGenerator.getDeserFunctionName(symbol, getName());\n        String errorMethodName = \"de_CommandError\";\n        // Add the normalized output type.\n        Symbol outputType = symbol.expectProperty(\"outputType\", Symbol.class);\n        String contextType = CodegenUtils.getOperationDeserializerContextType(\n            context.getSettings(),\n            writer,\n            context.getModel(),\n            operation\n        );\n\n        // Handle the general response.\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  output: $T,\\n\" + \"  context: $L\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            responseType,\n            contextType,\n            outputType,\n            () -> {\n                // Redirect error deserialization to the dispatcher if we receive an error range\n                // status code that's not the modeled code (300 or higher). This allows for\n                // returning other 2XX codes that don't match the defined value.\n                writer.openBlock(\n                    \"if (output.statusCode !== $L && output.statusCode >= 300) {\",\n                    \"}\",\n                    trait.getCode(),\n                    () -> writer.write(\"return $L(output, context);\", errorMethodName)\n                );\n\n                // Start deserializing the response.\n                writer.openBlock(\"const contents: any = map({\", \"});\", () -> {\n                    writer.write(\"$$metadata: deserializeMetadata(output),\");\n\n                    readResponseHeaders(context, operation, bindingIndex, \"output\");\n                });\n\n                List<HttpBinding> documentBindings = readResponseBody(context, operation, bindingIndex);\n                // Track all shapes bound to the document so their deserializers may be generated.\n                documentBindings.forEach(binding -> {\n                    Shape target = model.expectShape(binding.getMember().getTarget());\n                    if (!EventStreamGenerator.isEventStreamShape(target)) {\n                        deserializingDocumentShapes.add(target);\n                    }\n                });\n\n                writer.write(\"return contents;\");\n            }\n        );\n        writer.write(\"\");\n    }\n\n    private void generateErrorDeserializer(GenerationContext context, StructureShape error) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());\n        Model model = context.getModel();\n        Symbol errorSymbol = symbolProvider.toSymbol(error);\n        String errorDeserMethodName = ProtocolGenerator.getDeserFunctionShortName(errorSymbol) + \"Res\";\n        String errorDeserMethodLongName =\n            ProtocolGenerator.getDeserFunctionName(errorSymbol, context.getProtocolName()) + \"Res\";\n\n        String outputName = isErrorCodeInBody ? \"parsedOutput\" : \"output\";\n\n        writer.writeDocs(errorDeserMethodLongName);\n        writer.openBlock(\n            \"const $L = async (\\n\" + \"  $L: any,\\n\" + \"  context: __SerdeContext\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            errorDeserMethodName,\n            outputName,\n            errorSymbol,\n            () -> {\n                writer.openBlock(\"const contents: any = map({\", \"});\", () -> {\n                    readResponseHeaders(context, error, bindingIndex, outputName);\n                });\n\n                List<HttpBinding> documentBindings = readErrorResponseBody(context, error, bindingIndex);\n                // Track all shapes bound to the document so their deserializers may be generated.\n                documentBindings.forEach(binding -> {\n                    Shape target = model.expectShape(binding.getMember().getTarget());\n                    deserializingDocumentShapes.add(target);\n                });\n\n                // todo: unsupported ssdk feature.\n                String serverSdkInfix = context.getSettings().generateServerSdk()\n                    ? \": any /* $metadata unsupported on ssdk error */\"\n                    : \"\";\n\n                Symbol materializedErrorSymbol = errorSymbol.toBuilder().putProperty(\"typeOnly\", false).build();\n                writer.openBlock(\n                    \"const exception$L = new $T({\",\n                    \"});\",\n                    serverSdkInfix,\n                    materializedErrorSymbol,\n                    () -> {\n                        writer.write(\"$$metadata: deserializeMetadata($L),\", outputName);\n                        writer.write(\"...contents\");\n                    }\n                );\n                String errorLocation = this.getErrorBodyLocation(context, outputName + \".body\");\n                writer.addImportSubmodule(\n                    \"decorateServiceException\",\n                    \"__decorateServiceException\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.CLIENT\n                );\n                writer.write(\"return __decorateServiceException(exception, $L);\", errorLocation);\n            }\n        );\n\n        writer.write(\"\");\n    }\n\n    private List<HttpBinding> readErrorResponseBody(\n        GenerationContext context,\n        Shape error,\n        HttpBindingIndex bindingIndex\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        if (isErrorCodeInBody) {\n            // Body is already parsed in the error dispatcher, simply assign the body.\n            writer.write(\"const data: any = $L;\", getErrorBodyLocation(context, \"parsedOutput.body\"));\n            List<HttpBinding> responseBindings = bindingIndex.getResponseBindings(error, Location.DOCUMENT);\n            responseBindings.sort(Comparator.comparing(HttpBinding::getMemberName));\n            deserializeErrorDocumentBody(context, error.asStructureShape().get(), responseBindings);\n            return responseBindings;\n        } else {\n            // Deserialize response body just like in a normal response.\n            return readResponseBody(context, error, bindingIndex);\n        }\n    }\n\n    private void readResponseHeaders(\n        GenerationContext context,\n        Shape operationOrError,\n        HttpBindingIndex bindingIndex,\n        String outputName\n    ) {\n        List<HttpBinding> headerBindings = bindingIndex.getResponseBindings(operationOrError, Location.HEADER);\n        readNormalHeaders(context, headerBindings, outputName);\n\n        List<HttpBinding> prefixHeaderBindings = bindingIndex.getResponseBindings(\n            operationOrError,\n            Location.PREFIX_HEADERS\n        );\n        readPrefixHeaders(context, prefixHeaderBindings, outputName);\n    }\n\n    private void readRequestHeaders(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex,\n        String outputName\n    ) {\n        List<HttpBinding> headerBindings = bindingIndex.getRequestBindings(operation, Location.HEADER);\n        readNormalHeaders(context, headerBindings, outputName);\n\n        List<HttpBinding> prefixHeaderBindings = bindingIndex.getRequestBindings(operation, Location.PREFIX_HEADERS);\n        readPrefixHeaders(context, prefixHeaderBindings, outputName);\n    }\n\n    /**\n     * Reads headers that are 1-1 mapped to members via the @httpHeader trait.\n     *\n     * @param context the generation context.\n     * @param headerBindings a collection of header bindings.\n     * @param outputName the name of the output variable to read from.\n     */\n    private void readNormalHeaders(\n        GenerationContext context,\n        Collection<HttpBinding> headerBindings,\n        String outputName\n    ) {\n        for (HttpBinding binding : headerBindings) {\n            TypeScriptWriter writer = context.getWriter();\n            String memberName = context.getSymbolProvider().toMemberName(binding.getMember());\n            String headerName = binding.getLocationName().toLowerCase(Locale.US);\n            Shape target = context.getModel().expectShape(binding.getMember().getTarget());\n            String headerValue = getOutputValue(\n                context,\n                binding.getLocation(),\n                outputName + \".headers[\" + context.getStringStore().var(headerName) + \"]\",\n                binding.getMember(),\n                target\n            );\n            String checkedValue = outputName + \".headers[\" + context.getStringStore().var(headerName) + \"]\";\n\n            if (checkedValue.equals(headerValue)) {\n                writer.write(\"[$L]: [, $L],\", context.getStringStore().var(memberName), headerValue);\n            } else {\n                writer.write(\n                    \"[$L]: [() => void 0 !== $L, () => $L],\",\n                    context.getStringStore().var(memberName),\n                    checkedValue,\n                    headerValue\n                );\n            }\n        }\n    }\n\n    /**\n     * Reads headers are bound by the @httpPrefixHeaders trait.\n     *\n     * @param context the generation context.\n     * @param prefixHeaderBindings a collection of prefix header bindings.\n     * @param outputName the name of the output variable to read from.\n     */\n    private void readPrefixHeaders(\n        GenerationContext context,\n        Collection<HttpBinding> prefixHeaderBindings,\n        String outputName\n    ) {\n        if (prefixHeaderBindings.isEmpty()) {\n            return;\n        }\n\n        Model model = context.getModel();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        TypeScriptWriter writer = context.getWriter();\n\n        // Run through the headers one time, matching any prefix groups.\n        for (HttpBinding binding : prefixHeaderBindings) {\n            // Prepare a grab bag for these headers if necessary\n            String memberName = symbolProvider.toMemberName(binding.getMember());\n            writer.openBlock(\"$L: [, \", \"],\", memberName, () -> {\n                String headerLocation = binding.getLocationName().toLowerCase(Locale.US);\n                writer.write(\n                    \"Object.keys($L.headers).filter(header => header.startsWith('$L'))\",\n                    outputName,\n                    headerLocation\n                );\n                writer\n                    .indent()\n                    .openBlock(\".reduce((acc, header) => {\", \"}, {} as any)\", () -> {\n                        MapShape prefixMap = model.expectShape(binding.getMember().getTarget()).asMapShape().get();\n                        Shape target = model.expectShape(prefixMap.getValue().getTarget());\n                        String headerValue = getOutputValue(\n                            context,\n                            binding.getLocation(),\n                            outputName + \".headers[header]\",\n                            binding.getMember(),\n                            target\n                        );\n                        writer.write(\"acc[header.substring($L)] = $L;\", headerLocation.length(), headerValue);\n                        writer.write(\"return acc;\");\n                    });\n            });\n        }\n    }\n\n    private List<HttpBinding> readRequestBody(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBindingIndex bindingIndex\n    ) {\n        List<HttpBinding> documentBindings = bindingIndex.getRequestBindings(operation, Location.DOCUMENT);\n        documentBindings.sort(Comparator.comparing(HttpBinding::getMemberName));\n        List<HttpBinding> payloadBindings = bindingIndex.getRequestBindings(operation, Location.PAYLOAD);\n        return readBody(context, operation, documentBindings, payloadBindings, Collections.emptyList(), false);\n    }\n\n    private List<HttpBinding> readResponseBody(\n        GenerationContext context,\n        Shape operationOrError,\n        HttpBindingIndex bindingIndex\n    ) {\n        List<HttpBinding> documentBindings = bindingIndex.getResponseBindings(operationOrError, Location.DOCUMENT);\n        documentBindings.sort(Comparator.comparing(HttpBinding::getMemberName));\n        List<HttpBinding> payloadBindings = bindingIndex.getResponseBindings(operationOrError, Location.PAYLOAD);\n        List<HttpBinding> responseCodeBindings = bindingIndex.getResponseBindings(\n            operationOrError,\n            Location.RESPONSE_CODE\n        );\n        return readBody(context, operationOrError, documentBindings, payloadBindings, responseCodeBindings, true);\n    }\n\n    private List<HttpBinding> readBody(\n        GenerationContext context,\n        Shape operationOrError,\n        List<HttpBinding> documentBindings,\n        List<HttpBinding> payloadBindings,\n        List<HttpBinding> responseCodeBindings,\n        boolean isInput\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        if (!documentBindings.isEmpty()) {\n            // If the response has document bindings, the body can be parsed to a JavaScript object.\n            writer.addImportSubmodule(\n                \"expectObject\",\n                \"__expectObject\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n            writer.addImportSubmodule(\n                \"expectNonNull\",\n                \"__expectNonNull\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n            String bodyLocation = \"(__expectObject(await parseBody(output.body, context)))\";\n            // Use the protocol specific error location for retrieving contents.\n            if (operationOrError instanceof StructureShape) {\n                bodyLocation = getErrorBodyLocation(context, bodyLocation);\n            }\n            writer.write(\"const data: Record<string, any> = __expectNonNull($L, $S);\", bodyLocation, \"body\");\n\n            if (isInput) {\n                deserializeInputDocumentBody(context, operationOrError.asOperationShape().get(), documentBindings);\n            } else if (operationOrError.isOperationShape()) {\n                deserializeOutputDocumentBody(context, operationOrError.asOperationShape().get(), documentBindings);\n            } else {\n                deserializeErrorDocumentBody(context, operationOrError.asStructureShape().get(), documentBindings);\n            }\n        }\n        if (!payloadBindings.isEmpty()) {\n            HttpBinding payloadBinding = payloadBindings.get(0);\n            if (isInput) {\n                deserializeInputPayload(context, operationOrError.asOperationShape().get(), payloadBinding);\n            } else if (operationOrError.isOperationShape()) {\n                deserializeOutputPayload(context, operationOrError.asOperationShape().get(), payloadBinding);\n            } else {\n                deserializeErrorPayload(context, operationOrError.asStructureShape().get(), payloadBinding);\n            }\n            if (payloadBinding != null) {\n                documentBindings = ListUtils.of(payloadBinding);\n            }\n        }\n\n        // Handle any potential httpResponseCode binding overrides if the field\n        // isn't set in the body.\n        // These are only relevant when a payload is not present, as it cannot\n        // coexist with a payload.\n        if (!responseCodeBindings.isEmpty()) {\n            writer.openBlock(\"map(contents, {\", \"});\", () -> {\n                for (HttpBinding responseCodeBinding : responseCodeBindings) {\n                    // The name of the member to get from the input shape.\n                    String memberName = symbolProvider.toMemberName(responseCodeBinding.getMember());\n\n                    writer.write(\"$L: [, output.statusCode]\", memberName);\n                }\n            });\n        }\n\n        if (!documentBindings.isEmpty()) {\n            return documentBindings;\n        }\n\n        // If there are no payload or document bindings, the body still needs to be\n        // collected so the process can exit.\n        writer.write(\"await collectBody(output.body, context);\");\n        return ListUtils.of();\n    }\n\n    private HttpBinding readPayload(GenerationContext context, HttpBinding binding) {\n        TypeScriptWriter writer = context.getWriter();\n        boolean isClientSdk = context.getSettings().generateClient();\n\n        // There can only be one payload binding.\n        Shape target = context.getModel().expectShape(binding.getMember().getTarget());\n\n        boolean isStreaming = target.hasTrait(StreamingTrait.class);\n\n        // Handle streaming shapes differently.\n        if (isStreaming) {\n            writer.write(\"const data: any = output.body;\");\n            // If payload is streaming blob, return low-level stream with the stream utility functions mixin.\n            if (isClientSdk && target instanceof BlobShape) {\n                writer.write(\"context.sdkStreamMixin(data);\");\n            }\n        } else if (target instanceof BlobShape) {\n            // If payload is non-streaming Blob, only need to collect stream to binary data (Uint8Array).\n            writer.write(\"const data: any = await collectBody(output.body, context);\");\n        } else if (target instanceof StructureShape) {\n            // If payload is a Structure, then we need to parse the string into JavaScript object.\n            writer.addImportSubmodule(\n                \"expectObject\",\n                \"__expectObject\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n            writer.write(\n                \"const data: Record<string, any> | undefined \" +\n                    \"= __expectObject(await parseBody(output.body, context));\"\n            );\n        } else if (target instanceof UnionShape) {\n            // If payload is a Union, then we need to parse the string into JavaScript object.\n            writer.write(\"const data: Record<string, any> | undefined \" + \"= await parseBody(output.body, context);\");\n        } else if (target instanceof StringShape || target instanceof DocumentShape) {\n            // If payload is String or Document, we need to collect body and convert binary to string.\n            writer.write(\"const data: any = await collectBodyString(output.body, context);\");\n        } else {\n            throw new CodegenException(String.format(\"Unexpected shape type bound to payload: `%s`\", target.getType()));\n        }\n\n        if (!isStreaming && target instanceof UnionShape) {\n            writer.openBlock(\"if (Object.keys(data ?? {}).length) {\", \"}\", () -> {\n                importUnionDeserializer(writer);\n                writer.write(\n                    \"contents.$L = __expectUnion($L);\",\n                    binding.getMemberName(),\n                    getOutputValue(context, Location.PAYLOAD, \"data\", binding.getMember(), target)\n                );\n            });\n        } else {\n            writer.write(\n                \"contents.$L = $L;\",\n                binding.getMemberName(),\n                getOutputValue(context, Location.PAYLOAD, \"data\", binding.getMember(), target)\n            );\n        }\n\n        return binding;\n    }\n\n    protected void importUnionDeserializer(TypeScriptWriter writer) {\n        writer.addImportSubmodule(\n            \"expectUnion\",\n            \"__expectUnion\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.SERDE\n        );\n    }\n\n    /**\n     * Writes the code needed to deserialize the input payload of a request.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * bound member name of the {@code contents} variable after deserializing\n     * the response body. This variable will already be defined in scope.\n     *\n     * @param context The generation context.\n     * @param operation The operation whose input payload is being deserialized.\n     * @param binding The payload binding to deserialize.\n     * @return The deserialized payload binding.\n     */\n    protected HttpBinding deserializeInputPayload(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBinding binding\n    ) {\n        return readPayload(context, binding);\n    }\n\n    /**\n     * Writes the code needed to deserialize the output payload of a response.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * bound member name of the {@code contents} variable after deserializing\n     * the response body. This variable will already be defined in scope.\n     *\n     * @param context The generation context.\n     * @param operation The operation whose output payload is being deserialized.\n     * @param binding The payload binding to deserialize.\n     * @return The deserialized payload binding.\n     */\n    protected HttpBinding deserializeOutputPayload(\n        GenerationContext context,\n        OperationShape operation,\n        HttpBinding binding\n    ) {\n        return readPayload(context, binding);\n    }\n\n    /**\n     * Writes the code needed to deserialize the error payload of a response.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * bound member name of the {@code contents} variable after deserializing\n     * the response body. This variable will already be defined in scope.\n     *\n     * @param context The generation context.\n     * @param error The error whose payload is being deserialized.\n     * @param binding The payload binding to deserialize.\n     * @return The deserialized payload binding.\n     */\n    protected HttpBinding deserializeErrorPayload(\n        GenerationContext context,\n        StructureShape error,\n        HttpBinding binding\n    ) {\n        return readPayload(context, binding);\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * shape. This may use native types (like generating a Date for timestamps,)\n     * converters (like a base64Decoder,) or invoke complex type deserializers to\n     * manipulate the dataSource into the proper output content.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation output.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @param member The member that points to the value being provided.\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the output value.\n     */\n    private String getOutputValue(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        MemberShape member,\n        Shape target\n    ) {\n        if (target instanceof NumberShape) {\n            return getNumberOutputParam(context, bindingType, dataSource, target);\n        } else if (target instanceof BooleanShape) {\n            return getBooleanOutputParam(context, bindingType, dataSource);\n        } else if (target instanceof StringShape) {\n            return getStringOutputParam(context, bindingType, dataSource, target);\n        } else if (target instanceof DocumentShape) {\n            return dataSource;\n        } else if (target instanceof TimestampShape) {\n            HttpBindingIndex httpIndex = HttpBindingIndex.of(context.getModel());\n            Format format = httpIndex.determineTimestampFormat(member, bindingType, getDocumentTimestampFormat());\n            return HttpProtocolGeneratorUtils.getTimestampOutputParam(\n                context.getWriter(),\n                dataSource,\n                bindingType,\n                member,\n                format,\n                requiresNumericEpochSecondsInPayload(),\n                context.getSettings().generateClient()\n            );\n        } else if (target instanceof BlobShape) {\n            return getBlobOutputParam(bindingType, dataSource);\n        } else if (target instanceof CollectionShape) {\n            return getCollectionOutputParam(context, bindingType, dataSource, (CollectionShape) target);\n        } else if (target instanceof StructureShape || target instanceof UnionShape) {\n            return getNamedMembersOutputParam(context, bindingType, dataSource, target);\n        }\n\n        throw new CodegenException(\n            String.format(\n                \"Unsupported %s binding of %s to %s in %s using the %s protocol\",\n                bindingType,\n                member.getMemberName(),\n                target.getType(),\n                member.getContainer(),\n                getName()\n            )\n        );\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * boolean. By default, this checks strict equality to 'true' in headers and passes\n     * through for documents.\n     *\n     * @param bindingType How this value is bound to the operation output.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @return Returns a value or expression of the output boolean.\n     */\n    private String getBooleanOutputParam(GenerationContext context, Location bindingType, String dataSource) {\n        switch (bindingType) {\n            case QUERY:\n            case LABEL:\n            case HEADER:\n                context.getWriter()\n                    .addImportSubmodule(\n                        \"parseBoolean\",\n                        \"__parseBoolean\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                return String.format(\"__parseBoolean(%s)\", dataSource);\n            default:\n                throw new CodegenException(\"Unexpected boolean binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * string. By default, this base64 decodes content in headers if there is a\n     * mediaType applied to the string, and passes through for all other cases.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation input.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the input string.\n     */\n    private String getStringOutputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        Shape target\n    ) {\n        // Decode these to base64 if a MediaType is present.\n        if (bindingType == Location.HEADER && target.hasTrait(MediaTypeTrait.ID)) {\n            dataSource = \"Buffer.from(context.base64Decoder(\" + dataSource + \")).toString('utf8')\";\n        }\n\n        return HttpProtocolGeneratorUtils.getStringOutputParam(\n            context,\n            target,\n            dataSource,\n            !isGuaranteedString(bindingType)\n        );\n    }\n\n    private boolean isGuaranteedString(Location bindingType) {\n        return bindingType != Location.PAYLOAD && bindingType != Location.DOCUMENT;\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * blob. By default, this base64 decodes content in headers and passes through\n     * for payloads.\n     *\n     * @param bindingType How this value is bound to the operation output.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @return Returns a value or expression of the output blob.\n     */\n    private String getBlobOutputParam(Location bindingType, String dataSource) {\n        switch (bindingType) {\n            case PAYLOAD:\n                return dataSource;\n            case QUERY:\n            case LABEL:\n            case HEADER:\n                // Decode these from base64.\n                return \"context.base64Decoder(\" + dataSource + \")\";\n            default:\n                throw new CodegenException(\"Unexpected blob binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * collection. By default, this splits a comma separated string in headers.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation output.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the output collection.\n     */\n    private String getCollectionOutputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        CollectionShape target\n    ) {\n        MemberShape targetMember = target.getMember();\n        Shape collectionTarget = context.getModel().expectShape(targetMember.getTarget());\n        boolean trimParameterValue = bindingType != Location.QUERY && bindingType != Location.QUERY_PARAMS;\n        String outputValueDataSource = \"_entry\";\n        if (trimParameterValue) {\n            outputValueDataSource += \".trim()\";\n        }\n        String collectionTargetValue = getOutputValue(\n            context,\n            bindingType,\n            outputValueDataSource,\n            targetMember,\n            collectionTarget\n        );\n        String outputParam;\n        switch (bindingType) {\n            case QUERY_PARAMS:\n            case QUERY:\n                if (collectionTargetValue.equals(\"_entry\")) {\n                    return String.format(\"%1$s\", dataSource);\n                }\n                return String.format(\"%1$s.map(_entry => %2$s as any)\", dataSource, collectionTargetValue);\n            case LABEL:\n                dataSource = \"(\" + dataSource + \" || \\\"\\\")\";\n                // Split these values on slashes.\n                outputParam = \"\" + dataSource + \".split('/')\";\n\n                // Iterate over each entry and do deser work.\n                if (!collectionTargetValue.equals(\"_entry\")) {\n                    outputParam += \".map(_entry => \" + collectionTargetValue + \" as any)\";\n                }\n\n                return outputParam;\n            case HEADER:\n                dataSource = \"(\" + dataSource + \" || \\\"\\\")\";\n                // Split these values on commas.\n                context.getWriter()\n                    .addImportSubmodule(\n                        \"splitHeader\",\n                        \"__splitHeader\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                outputParam = \"__splitHeader(\" + dataSource + \")\";\n\n                // Headers that have HTTP_DATE formatted timestamps already contain a \",\"\n                // in their formatted entry, so split on every other \",\" instead.\n                if (collectionTarget.isTimestampShape()) {\n                    // Check if our member resolves to the HTTP_DATE format.\n                    HttpBindingIndex httpIndex = HttpBindingIndex.of(context.getModel());\n                    Format format = httpIndex.determineTimestampFormat(targetMember, bindingType, Format.HTTP_DATE);\n\n                    if (format == Format.HTTP_DATE) {\n                        TypeScriptWriter writer = context.getWriter();\n                        writer.addImportSubmodule(\n                            \"splitEvery\",\n                            \"__splitEvery\",\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.SERDE\n                        );\n                        outputParam = \"__splitEvery(\" + dataSource + \", ',', 2)\";\n                    }\n                }\n\n                // Iterate over each entry and do deser work.\n                if (!collectionTargetValue.equals(\"_entry\")) {\n                    outputParam += \".map(_entry => \" + collectionTargetValue + \" as any)\";\n                }\n\n                return outputParam;\n            default:\n                throw new CodegenException(\"Unexpected collection binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * shape. This redirects to a deserialization function for documents and payloads,\n     * and fails otherwise.\n     *\n     * @param context The generation context.\n     * @param bindingType How this value is bound to the operation output.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the output shape.\n     */\n    private String getNamedMembersOutputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        Shape target\n    ) {\n        switch (bindingType) {\n            case PAYLOAD:\n                // Redirect to a deserialization function.\n                Symbol symbol = context.getSymbolProvider().toSymbol(target);\n\n                boolean mayElideOutput =\n                    SerdeElisionIndex.of(context.getModel()).mayElide(target) &&\n                        (enableSerdeElision() && !context.getSettings().generateServerSdk());\n\n                if (mayElideOutput) {\n                    context.getWriter()\n                        .addImportSubmodule(\n                            \"_json\",\n                            null,\n                            TypeScriptDependency.SMITHY_CORE,\n                            SmithyCoreSubmodules.CLIENT\n                        );\n                    return \"_json(\" + dataSource + \")\";\n                }\n\n                return ProtocolGenerator.getDeserFunctionShortName(symbol) + \"(\" + dataSource + \", context)\";\n            default:\n                throw new CodegenException(\"Unexpected named member shape binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Given context and a source of data, generate an output value provider for the\n     * number. By default, invokes parseInt on byte/short/integer/long types in headers,\n     * invokes parseFloat on float/double types in headers, and fails otherwise.\n     *\n     * @param bindingType How this value is bound to the operation output.\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @param target The shape of the value being provided.\n     * @return Returns a value or expression of the output number.\n     */\n    private String getNumberOutputParam(\n        GenerationContext context,\n        Location bindingType,\n        String dataSource,\n        Shape target\n    ) {\n        switch (bindingType) {\n            case QUERY:\n            case LABEL:\n            case HEADER:\n                switch (target.getType()) {\n                    case DOUBLE:\n                        context\n                            .getWriter()\n                            .addImportSubmodule(\n                                \"strictParseDouble\",\n                                \"__strictParseDouble\",\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.SERDE\n                            );\n                        return \"__strictParseDouble(\" + dataSource + \")\";\n                    case FLOAT:\n                        context\n                            .getWriter()\n                            .addImportSubmodule(\n                                \"strictParseFloat\",\n                                \"__strictParseFloat\",\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.SERDE\n                            );\n                        return \"__strictParseFloat(\" + dataSource + \")\";\n                    case LONG:\n                        context\n                            .getWriter()\n                            .addImportSubmodule(\n                                \"strictParseLong\",\n                                \"__strictParseLong\",\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.SERDE\n                            );\n                        return \"__strictParseLong(\" + dataSource + \")\";\n                    case INT_ENUM:\n                    case INTEGER:\n                        context\n                            .getWriter()\n                            .addImportSubmodule(\n                                \"strictParseInt32\",\n                                \"__strictParseInt32\",\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.SERDE\n                            );\n                        return \"__strictParseInt32(\" + dataSource + \")\";\n                    case SHORT:\n                        context\n                            .getWriter()\n                            .addImportSubmodule(\n                                \"strictParseShort\",\n                                \"__strictParseShort\",\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.SERDE\n                            );\n                        return \"__strictParseShort(\" + dataSource + \")\";\n                    case BYTE:\n                        context\n                            .getWriter()\n                            .addImportSubmodule(\n                                \"strictParseByte\",\n                                \"__strictParseByte\",\n                                TypeScriptDependency.SMITHY_CORE,\n                                SmithyCoreSubmodules.SERDE\n                            );\n                        return \"__strictParseByte(\" + dataSource + \")\";\n                    default:\n                        throw new CodegenException(\"Unexpected number shape `\" + target.getType() + \"`\");\n                }\n            default:\n                throw new CodegenException(\"Unexpected number binding location `\" + bindingType + \"`\");\n        }\n    }\n\n    /**\n     * Writes the code that loads an optional {@code errorCode} String with the content used\n     * to dispatch errors to specific serializers. If an error code cannot be load, the code\n     * must return {@code undefined} so default value can be injected in default case.\n     *\n     * <p>Two variables will be in scope:\n     *   <ul>\n     *       <li>{@code output} or {@code parsedOutput}: a value of the HttpResponse type.\n     *          <ul>\n     *              <li>{@code output} is a raw HttpResponse, available when {@code isErrorCodeInBody} is set to\n     *              {@code false}</li>\n     *              <li>{@code parsedOutput} is a HttpResponse type with body parsed to JavaScript object, available\n     *              when {@code isErrorCodeInBody} is set to {@code true}</li>\n     *          </ul>\n     *       </li>\n     *       <li>{@code context}: the SerdeContext.</li>\n     *   </ul>\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const errorCode = output.headers[\"x-amzn-errortype\"].split(':')[0];\n     * }</pre>\n     *\n     * @param context The generation context.\n     */\n    protected abstract void writeErrorCodeParser(GenerationContext context);\n\n    /**\n     * Provides where within the passed output variable the actual error resides. This is useful\n     * for protocols that wrap the specific error in additional elements within the body.\n     *\n     * @param context The generation context.\n     * @param outputLocation The name of the variable containing the output body.\n     * @return A string of the variable containing the error body within the output.\n     */\n    protected String getErrorBodyLocation(GenerationContext context, String outputLocation) {\n        return outputLocation;\n    }\n\n    /**\n     * Writes the code needed to deserialize a protocol input document.\n     *\n     * <p>Implementations of this method are expected to set members in the\n     * {@code contents} variable that represents the type generated for the\n     * response. This variable will already be defined in scope.\n     *\n     * <p>The contents of the response body will be available in a {@code data} variable.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * if (data.fieldList !== undefined) {\n     *   contents.fieldList = deserializeAws_restJson1_1FieldList(data.fieldList, context);\n     * }\n     * }</pre>\n     * @param context The generation context.\n     * @param operation The operation whose input document is being deserialized.\n     * @param documentBindings The bindings to read from the document.\n     */\n    protected abstract void deserializeInputDocumentBody(\n        GenerationContext context,\n        OperationShape operation,\n        List<HttpBinding> documentBindings\n    );\n\n    /**\n     * Writes the code needed to deserialize a protocol output document.\n     *\n     * <p>Implementations of this method are expected to set members in the\n     * {@code contents} variable that represents the type generated for the\n     * response. This variable will already be defined in scope.\n     *\n     * <p>The contents of the response body will be available in a {@code data} variable.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * if (data.fieldList !== undefined) {\n     *   contents.fieldList = deserializeAws_restJson1_1FieldList(data.fieldList, context);\n     * }\n     * }</pre>\n     * @param context The generation context.\n     * @param operation The operation whose output document is being deserialized.\n     * @param documentBindings The bindings to read from the document.\n     */\n    protected abstract void deserializeOutputDocumentBody(\n        GenerationContext context,\n        OperationShape operation,\n        List<HttpBinding> documentBindings\n    );\n\n    /**\n     * Writes the code needed to deserialize a protocol error document.\n     *\n     * <p>Implementations of this method are expected to set members in the\n     * {@code contents} variable that represents the type generated for the\n     * response. This variable will already be defined in scope.\n     *\n     * <p>The contents of the response body will be available in a {@code data} variable.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * if (data.fieldList !== undefined) {\n     *   contents.fieldList = deserializeAws_restJson1_1FieldList(data.fieldList, context);\n     * }\n     * }</pre>\n     * @param context The generation context.\n     * @param error The error being deserialized.\n     * @param documentBindings The bindings to read from the document.\n     */\n    protected abstract void deserializeErrorDocumentBody(\n        GenerationContext context,\n        StructureShape error,\n        List<HttpBinding> documentBindings\n    );\n\n    /**\n     * @return true if this protocol disallows string epoch timestamps in payloads.\n     */\n    protected abstract boolean requiresNumericEpochSecondsInPayload();\n\n    /**\n     * Implement a return true if the protocol allows elision of serde functions.\n     *\n     * @return whether protocol implementation is compatible with serde elision.\n     */\n    protected boolean enableSerdeElision() {\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpProtocolGeneratorUtils.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.nio.file.Paths;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.TreeSet;\nimport java.util.function.BiFunction;\nimport java.util.function.Consumer;\nimport java.util.function.Function;\nimport java.util.logging.Logger;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.knowledge.HttpBinding.Location;\nimport software.amazon.smithy.model.pattern.SmithyPattern;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.RetryableTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Utility methods for generating HTTP protocols.\n */\n@SmithyUnstableApi\n@SmithyInternalApi\npublic final class HttpProtocolGeneratorUtils {\n\n    private static final Logger LOGGER = Logger.getLogger(HttpBindingProtocolGenerator.class.getName());\n\n    private HttpProtocolGeneratorUtils() {}\n\n    /**\n     * Given a format and a source of data, generate an input value provider for the\n     * timestamp.\n     *\n     * @param context The generation context.\n     * @param dataSource The in-code location of the data to provide an input of\n     *                   ({@code input.foo}, {@code entry}, etc.)\n     * @param shape The shape that represents the value being provided.\n     * @param format The timestamp format to provide.\n     * @return Returns a value or expression of the input timestamp.\n     */\n    public static String getTimestampInputParam(\n        GenerationContext context,\n        String dataSource,\n        Shape shape,\n        Format format\n    ) {\n        switch (format) {\n            case DATE_TIME:\n                context\n                    .getWriter()\n                    .addImportSubmodule(\n                        \"serializeDateTime\",\n                        \"__serializeDateTime\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                return \"__serializeDateTime(\" + dataSource + \")\";\n            case EPOCH_SECONDS:\n                return \"(\" + dataSource + \".getTime() / 1_000)\";\n            case HTTP_DATE:\n                context\n                    .getWriter()\n                    .addImportSubmodule(\n                        \"dateToUtcString\",\n                        \"__dateToUtcString\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                return \"__dateToUtcString(\" + dataSource + \")\";\n            default:\n                throw new CodegenException(\"Unexpected timestamp format `\" + format + \"` on \" + shape);\n        }\n    }\n\n    /**\n     * Given a format and a source of data, generate an output value provider for the\n     * timestamp.\n     *\n     * @param writer The current writer (so that imports may be added)\n     * @param dataSource The in-code location of the data to provide an output of\n     *                   ({@code output.foo}, {@code entry}, etc.)\n     * @param bindingType How this value is bound to the operation output.\n     * @param shape The shape that represents the value being received.\n     * @param format The timestamp format to provide.\n     * @param requireNumericEpochSecondsInPayload if true, paylaod epoch seconds are not allowed to be coerced\n     *                                            from strings.\n     * @param isClient true if generating a client.\n     * @return Returns a value or expression of the output timestamp.\n     */\n    public static String getTimestampOutputParam(\n        TypeScriptWriter writer,\n        String dataSource,\n        Location bindingType,\n        Shape shape,\n        Format format,\n        boolean requireNumericEpochSecondsInPayload,\n        boolean isClient\n    ) {\n        // This has always explicitly wrapped the dataSource in \"new Date(..)\", so it could never generate\n        // an expression that evaluates to null. Codegen relies on this.\n        writer.addImportSubmodule(\n            \"expectNonNull\",\n            \"__expectNonNull\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.SERDE\n        );\n        switch (format) {\n            case DATE_TIME:\n                // Clients should be able to handle offsets and normalize the datetime to an offset of zero.\n                if (isClient) {\n                    writer.addImportSubmodule(\n                        \"parseRfc3339DateTimeWithOffset\",\n                        \"__parseRfc3339DateTimeWithOffset\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                    return String.format(\"__expectNonNull(__parseRfc3339DateTimeWithOffset(%s))\", dataSource);\n                } else {\n                    writer.addImportSubmodule(\n                        \"parseRfc3339DateTime\",\n                        \"__parseRfc3339DateTime\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                    return String.format(\"__expectNonNull(__parseRfc3339DateTime(%s))\", dataSource);\n                }\n            case HTTP_DATE:\n                writer.addImportSubmodule(\n                    \"parseRfc7231DateTime\",\n                    \"__parseRfc7231DateTime\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.SERDE\n                );\n                return String.format(\"__expectNonNull(__parseRfc7231DateTime(%s))\", dataSource);\n            case EPOCH_SECONDS:\n                writer.addImportSubmodule(\n                    \"parseEpochTimestamp\",\n                    \"__parseEpochTimestamp\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.SERDE\n                );\n                String modifiedDataSource = dataSource;\n                if (\n                    requireNumericEpochSecondsInPayload &&\n                        (bindingType == Location.DOCUMENT || bindingType == Location.PAYLOAD)\n                ) {\n                    writer.addImportSubmodule(\n                        \"expectNumber\",\n                        \"__expectNumber\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                    modifiedDataSource = String.format(\"__expectNumber(%s)\", dataSource);\n                }\n                return String.format(\"__expectNonNull(__parseEpochTimestamp(%s))\", modifiedDataSource);\n            default:\n                throw new CodegenException(\"Unexpected timestamp format `\" + format.toString() + \"` on \" + shape);\n        }\n    }\n\n    /**\n     * Given a String input, determine its media type and generate an input value\n     * provider for it.\n     *\n     * <p>This currently only supports using the LazyJsonString for {@code \"application/json\"}.\n     *\n     * @param context The generation context.\n     * @param shape The shape that represents the value being provided.\n     * @param dataSource The in-code location of the data to provide an input of\n     *   ({@code input.foo}, {@code entry}, etc.)\n     * @return Returns a value or expression of the input string.\n     */\n    public static String getStringInputParam(GenerationContext context, Shape shape, String dataSource) {\n        // Handle media type generation, defaulting to the dataSource.\n        Optional<MediaTypeTrait> mediaTypeTrait = shape.getTrait(MediaTypeTrait.class);\n        if (mediaTypeTrait.isPresent()) {\n            String mediaType = mediaTypeTrait.get().getValue();\n            if (CodegenUtils.isJsonMediaType(mediaType)) {\n                TypeScriptWriter writer = context.getWriter();\n                writer.addImportSubmodule(\n                    \"LazyJsonString\",\n                    \"__LazyJsonString\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.SERDE\n                );\n                return \"__LazyJsonString.from(\" + dataSource + \")\";\n            } else {\n                LOGGER.warning(() -> \"Found unsupported mediatype \" + mediaType + \" on String shape: \" + shape);\n            }\n        }\n\n        return dataSource;\n    }\n\n    /**\n     * Given a String output, determine its media type and generate an output value\n     * provider for it.\n     *\n     * <p>This currently only supports using the LazyJsonString for {@code \"application/json\"}.\n     *\n     * @param context The generation context.\n     * @param shape The shape that represents the value being received.\n     * @param dataSource The in-code location of the data to provide an output of\n     *   ({@code output.foo}, {@code entry}, etc.)\n     * @param useExpect Whether or not to wrap the string in expectString. This should\n     *   only be false if the value is guaranteed to be a string already.\n     * @return Returns a value or expression of the output string.\n     */\n    public static String getStringOutputParam(\n        GenerationContext context,\n        Shape shape,\n        String dataSource,\n        boolean useExpect\n    ) {\n        // Handle media type generation, defaulting to a standard String.\n        Optional<MediaTypeTrait> mediaTypeTrait = shape.getTrait(MediaTypeTrait.class);\n        if (mediaTypeTrait.isPresent()) {\n            String mediaType = mediaTypeTrait.get().getValue();\n            if (CodegenUtils.isJsonMediaType(mediaType)) {\n                TypeScriptWriter writer = context.getWriter();\n                writer.addImportSubmodule(\n                    \"LazyJsonString\",\n                    \"__LazyJsonString\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.SERDE\n                );\n                return \"__LazyJsonString.from(\" + dataSource + \")\";\n            } else {\n                LOGGER.warning(() -> \"Found unsupported mediatype \" + mediaType + \" on String shape: \" + shape);\n            }\n        }\n\n        if (!useExpect) {\n            return dataSource;\n        }\n        context.getWriter()\n            .addImportSubmodule(\n                \"expectString\",\n                \"__expectString\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.SERDE\n            );\n        return \"__expectString(\" + dataSource + \")\";\n    }\n\n    /**\n     * Given a String output, determine its media type and generate an output value\n     * provider for it.\n     *\n     * <p>This currently only supports using the LazyJsonString for {@code \"application/json\"}.\n     *\n     * @param context The generation context.\n     * @param shape The shape that represents the value being received.\n     * @param dataSource The in-code location of the data to provide an output of\n     *   ({@code output.foo}, {@code entry}, etc.)\n     * @return Returns a value or expression of the output string.\n     */\n    public static String getStringOutputParam(GenerationContext context, Shape shape, String dataSource) {\n        return getStringOutputParam(context, shape, dataSource, true);\n    }\n\n    /**\n     * Writes a response metadata deserializer function for HTTP protocols. This\n     * will load things like the status code, headers, and more.\n     *\n     * @param context The generation context.\n     * @param responseType The response type for the HTTP protocol.\n     */\n    public static void generateMetadataDeserializer(GenerationContext context, SymbolReference responseType) {\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addTypeImport(\"ResponseMetadata\", \"__ResponseMetadata\", TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\n            \"const deserializeMetadata = (output: $T): __ResponseMetadata => ({\",\n            \"});\",\n            responseType,\n            () -> {\n                writer.write(\"httpStatusCode: output.statusCode,\");\n                writer.write(\n                    \"requestId: output.headers[\\\"x-amzn-requestid\\\"] ??\" +\n                        \" output.headers[\\\"x-amzn-request-id\\\"] ??\" +\n                        \" output.headers[\\\"x-amz-request-id\\\"],\"\n                );\n                writer.write(\"extendedRequestId: output.headers[\\\"x-amz-id-2\\\"],\");\n                writer.write(\"cfId: output.headers[\\\"x-amz-cf-id\\\"],\");\n            }\n        );\n        writer.write(\"\");\n    }\n\n    /**\n     * Writes a function converting the low-level response body stream to utf-8 encoded string. It depends on\n     * response body stream collector.\n     *\n     * @param context The generation context\n     */\n    public static void generateCollectBodyString(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        writer\n            .addImportSubmodule(\"collectBody\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.PROTOCOLS);\n        writer.addTypeImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        writer.write(\"// Encode Uint8Array data into string with utf-8.\");\n        writer.write(\n            \"const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> => \" +\n                \"collectBody(streamBody, context).then(body => context.utf8Encoder(body))\"\n        );\n        writer.write(\"\");\n    }\n\n    /**\n     * Writes $retryable key for error if it contains RetryableTrait.\n     *\n     * @param writer The code writer.\n     * @param error The error to write retryableTrait for.\n     * @param separator The string to be used after emitting key-value pair for retryableTrait.\n     */\n    public static void writeRetryableTrait(TypeScriptWriter writer, StructureShape error, String separator) {\n        Optional<RetryableTrait> retryableTrait = error.getTrait(RetryableTrait.class);\n        if (retryableTrait.isPresent()) {\n            String textAfterBlock = String.format(\"}%s\", separator);\n            writer.openCollapsibleBlock(\"$$retryable = {\", textAfterBlock, retryableTrait.get().getThrottling(), () -> {\n                if (retryableTrait.get().getThrottling()) {\n                    writer.write(\"throttling: true,\");\n                }\n            });\n        }\n    }\n\n    /**\n     * Writes a function used to dispatch to the proper error deserializer\n     * for each error that any operation can return. The generated function\n     * assumes a deserialization function is generated for the structures\n     * returned.\n     *\n     * @param context The generation context.\n     * @param responseType The response type for the HTTP protocol.\n     * @param errorCodeGenerator A consumer\n     * @param shouldParseErrorBody Flag indicating whether need to parse response body in this dispatcher function\n     * @param bodyErrorLocationModifier A function that returns the location of an error in a body given a data source.\n     * @param operationErrorsToShapes A map of error names to their {@link ShapeId}.\n     * @return A set of all error structure shapes for the operation that were dispatched to.\n     */\n    public static Set<StructureShape> generateUnifiedErrorDispatcher(\n        GenerationContext context,\n        List<OperationShape> operations,\n        SymbolReference responseType,\n        Consumer<GenerationContext> errorCodeGenerator,\n        boolean shouldParseErrorBody,\n        BiFunction<GenerationContext, String, String> bodyErrorLocationModifier,\n        BiFunction<GenerationContext, List<OperationShape>, Map<String, ShapeId>> operationErrorsToShapes,\n        Map<String, TreeSet<String>> errorAliases\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Set<StructureShape> errorShapes = new TreeSet<>();\n\n        String errorMethodName = \"de_CommandError\";\n        String errorMethodLongName =\n            \"deserialize_\" + ProtocolGenerator.getSanitizedName(context.getProtocolName()) + \"CommandError\";\n\n        writer.writeDocs(errorMethodLongName);\n        writer.openBlock(\n            \"const $L = async (\\n\" + \"  output: $T,\\n\" + \"  context: __SerdeContext,\\n\" + \"): Promise<never> => {\",\n            \"}\",\n            errorMethodName,\n            responseType,\n            () -> {\n                // Prepare error response for parsing error code. If error code needs to be parsed from response body\n                // then we collect body and parse it to JS object, otherwise leave the response body as is.\n                if (shouldParseErrorBody) {\n                    writer.openBlock(\"const parsedOutput: any = {\", \"};\", () -> {\n                        writer.write(\"...output,\");\n                        writer.write(\"body: await parseErrorBody(output.body, context)\");\n                    });\n                }\n\n                // Error responses must be at least BaseException interface\n                errorCodeGenerator.accept(context);\n\n                Runnable defaultErrorHandler = () -> {\n                    if (shouldParseErrorBody) {\n                        // Body is already parsed above\n                        writer.write(\"const parsedBody = parsedOutput.body;\");\n                    } else {\n                        // Body is not parsed above, so parse it here\n                        writer.write(\"const parsedBody = await parseBody(output.body, context);\");\n                    }\n\n                    // Get the protocol specific error location for retrieving contents.\n                    String errorLocation = bodyErrorLocationModifier.apply(context, \"parsedBody\");\n                    writer.openBlock(\"return throwDefaultError({\", \"}) as never;\", () -> {\n                        writer.write(\"output,\");\n                        if (errorLocation.equals(\"parsedBody\")) {\n                            writer.write(\"parsedBody,\");\n                        } else {\n                            writer.write(\"parsedBody: $L,\", errorLocation);\n                        }\n                        writer.write(\"errorCode\");\n                    });\n                };\n\n                Map<String, ShapeId> operationNamesToShapes = operationErrorsToShapes.apply(context, operations);\n\n                if (!operationNamesToShapes.isEmpty()) {\n                    writer.openBlock(\"switch (errorCode) {\", \"}\", () -> {\n                        // Generate the case statement for each error, invoking the specific deserializer.\n\n                        operationNamesToShapes.forEach((name, errorId) -> {\n                            StructureShape error = context.getModel().expectShape(errorId).asStructureShape().get();\n                            // Track errors bound to the operation so their deserializers may be generated.\n                            errorShapes.add(error);\n                            Symbol errorSymbol = symbolProvider.toSymbol(error);\n                            String errorDeserMethodName =\n                                ProtocolGenerator.getDeserFunctionShortName(errorSymbol) + \"Res\";\n                            // Dispatch to the error deserialization function.\n                            String outputParam = shouldParseErrorBody ? \"parsedOutput\" : \"output\";\n                            writer.write(\"case $S:\", name);\n                            writer.write(\"case $S:\", errorId.toString());\n                            for (String alias : errorAliases.getOrDefault(errorId.toString(), new TreeSet<>())) {\n                                if (!Objects.equals(name, alias) && !Objects.equals(errorId.toString(), alias)) {\n                                    writer.write(\"case $S:\", alias);\n                                }\n                            }\n                            writer\n                                .indent()\n                                .write(\"throw await $L($L, context);\", errorDeserMethodName, outputParam)\n                                .dedent();\n                        });\n\n                        // Build a generic error the best we can for ones we don't know about.\n                        writer.write(\"default:\").indent();\n                        defaultErrorHandler.run();\n                        writer.dedent();\n                    });\n                } else {\n                    defaultErrorHandler.run();\n                }\n            }\n        );\n        writer.write(\"\");\n\n        return errorShapes;\n    }\n\n    /**\n     * Writes resolved hostname, prepending existing hostname with hostPrefix and replacing each hostLabel with\n     * the corresponding top-level input member value.\n     *\n     * @param context The generation context.\n     * @param operation The operation to generate for.\n     */\n    public static void writeHostPrefix(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        EndpointTrait trait = operation.getTrait(EndpointTrait.class).get();\n        writer.write(\"let { hostname: resolvedHostname } = await context.endpoint();\");\n        // Check if disableHostPrefixInjection has been set to true at runtime\n        writer.openBlock(\"if (context.disableHostPrefix !== true) {\", \"}\", () -> {\n            writer.addImportSubmodule(\n                \"isValidHostname\",\n                \"__isValidHostname\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.PROTOCOLS\n            );\n            writer.write(\"resolvedHostname = $S + resolvedHostname;\", trait.getHostPrefix().toString());\n            if (operation.getInput().isPresent()) {\n                List<SmithyPattern.Segment> prefixLabels = trait.getHostPrefix().getLabels();\n                StructureShape inputShape = context\n                    .getModel()\n                    .expectShape(operation.getInput().get(), StructureShape.class);\n                for (SmithyPattern.Segment label : prefixLabels) {\n                    MemberShape member = inputShape.getMember(label.getContent()).get();\n                    String memberName = symbolProvider.toMemberName(member);\n                    writer.openBlock(\"if (input.$L === undefined) {\", \"}\", memberName, () -> {\n                        writer.write(\"throw new Error('Empty value provided for input host prefix: $L.');\", memberName);\n                    });\n                    writer.write(\n                        \"resolvedHostname = resolvedHostname.replace(\\\"{$L}\\\", input.$L!)\",\n                        label.getContent(),\n                        memberName\n                    );\n                }\n            }\n            writer.openBlock(\"if (!__isValidHostname(resolvedHostname)) {\", \"}\", () -> {\n                writer.write(\"throw new Error(\\\"ValidationError: prefixed hostname must be hostname compatible.\\\");\");\n            });\n        });\n    }\n\n    /**\n     * Construct a symbol reference of client's base exception class.\n     */\n    public static SymbolReference getClientBaseException(GenerationContext context) {\n        ServiceShape service = context.getService();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        String serviceName = symbolProvider.toSymbol(service).getName().replaceAll(\"(Client)$\", \"\");\n        String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, context.getModel());\n        String namespace = Paths.get(\".\", \"src\", \"models\", serviceExceptionName).toString();\n        Symbol serviceExceptionSymbol = Symbol.builder()\n            .name(serviceExceptionName)\n            .namespace(namespace, \"/\")\n            .definitionFile(namespace + \".ts\")\n            .build();\n        return SymbolReference.builder()\n            .options(SymbolReference.ContextOption.USE)\n            .alias(\"__BaseException\")\n            .symbol(serviceExceptionSymbol)\n            .build();\n    }\n\n    /**\n     * Returns a map of error names to their {@link ShapeId}.\n     *\n     * @param context   the generation context\n     * @param operation the operation shape to retrieve errors for\n     * @return map of error names to {@link ShapeId}\n     */\n    public static Map<String, ShapeId> getOperationErrors(GenerationContext context, OperationShape operation) {\n        return operation\n            .getErrors()\n            .stream()\n            .collect(\n                Collectors.toMap(\n                    shapeId -> shapeId.getName(context.getService()),\n                    Function.identity(),\n                    (x, y) -> {\n                        if (!x.equals(y)) {\n                            throw new CodegenException(\n                                String.format(\"conflicting error shape ids: %s, %s\", x, y)\n                            );\n                        }\n                        return x;\n                    },\n                    TreeMap::new\n                )\n            );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpRpcProtocolGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Set;\nimport java.util.TreeSet;\nimport java.util.logging.Logger;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.utils.OptionalUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Abstract implementation useful for all HTTP protocols without bindings.\n */\n@SmithyUnstableApi\npublic abstract class HttpRpcProtocolGenerator implements ProtocolGenerator {\n\n    public static final Logger LOGGER = Logger.getLogger(HttpRpcProtocolGenerator.class.getName());\n    private static final ApplicationProtocol APPLICATION_PROTOCOL =\n        ApplicationProtocol.createDefaultHttpApplicationProtocol();\n\n    protected final Set<Shape> serializingDocumentShapes = new TreeSet<>();\n    protected final Set<Shape> deserializingDocumentShapes = new TreeSet<>();\n    protected final Set<StructureShape> deserializingErrorShapes = new TreeSet<>();\n    protected final EventStreamGenerator eventStreamGenerator = new EventStreamGenerator();\n\n    private final boolean isErrorCodeInBody;\n\n    /**\n     * Creates a Http RPC protocol generator.\n     *\n     * @param isErrorCodeInBody A boolean that indicates if the error code for the implementing protocol is located in\n     *   the error response body, meaning this generator will parse the body before attempting to load an error code.\n     */\n    public HttpRpcProtocolGenerator(boolean isErrorCodeInBody) {\n        this.isErrorCodeInBody = isErrorCodeInBody;\n    }\n\n    @Override\n    public final ApplicationProtocol getApplicationProtocol() {\n        return APPLICATION_PROTOCOL;\n    }\n\n    /**\n     * Gets the content-type for a request body.\n     *\n     * @return Returns the default content-type.\n     */\n    protected abstract String getDocumentContentType();\n\n    /**\n     * Generates serialization functions for shapes in the passed set. These functions\n     * should return a value that can then be serialized by the implementation of\n     * {@code serializeInputDocument}. The {@link DocumentShapeSerVisitor} and\n     * {@link DocumentMemberSerVisitor} are provided to reduce the effort of this implementation.\n     *\n     * @param context The generation context.\n     * @param shapes The shapes to generate serialization for.\n     */\n    protected abstract void generateDocumentBodyShapeSerializers(GenerationContext context, Set<Shape> shapes);\n\n    /**\n     * Generates deserialization functions for shapes in the passed set. These functions\n     * should return a value that can then be deserialized by the implementation of\n     * {@code deserializeOutputDocument}. The {@link DocumentShapeDeserVisitor} and\n     * {@link DocumentMemberDeserVisitor} are provided to reduce the effort of this implementation.\n     *\n     * @param context The generation context.\n     * @param shapes The shapes to generate deserialization for.\n     */\n    protected abstract void generateDocumentBodyShapeDeserializers(GenerationContext context, Set<Shape> shapes);\n\n    @Override\n    public void generateSharedComponents(GenerationContext context) {\n        ServiceShape service = context.getService();\n        deserializingErrorShapes.forEach(error -> generateErrorDeserializer(context, error));\n        eventStreamGenerator.generateEventStreamSerializers(\n            context,\n            service,\n            getDocumentContentType(),\n            () -> {\n                TypeScriptWriter writer = context.getWriter();\n                serializeEventStreamBodyToBytes(writer);\n            },\n            serializingDocumentShapes\n        );\n        // Error shapes that only referred in the error event of an eventstream\n        Set<StructureShape> errorEventShapes = new TreeSet<>();\n        SerdeElisionIndex serdeElisionIndex = SerdeElisionIndex.of(context.getModel());\n        eventStreamGenerator.generateEventStreamDeserializers(\n            context,\n            service,\n            errorEventShapes,\n            deserializingDocumentShapes,\n            isErrorCodeInBody,\n            enableSerdeElision(),\n            serdeElisionIndex\n        );\n        errorEventShapes.removeIf(deserializingErrorShapes::contains);\n        errorEventShapes.forEach(error -> generateErrorDeserializer(context, error));\n        generateDocumentBodyShapeSerializers(context, serializingDocumentShapes);\n        generateDocumentBodyShapeDeserializers(context, deserializingDocumentShapes);\n        HttpProtocolGeneratorUtils.generateMetadataDeserializer(context, getApplicationProtocol().getResponseType());\n        HttpProtocolGeneratorUtils.generateCollectBodyString(context);\n\n        TypeScriptWriter writer = context.getWriter();\n\n        if (context.getSettings().generateClient()) {\n            writer.addImportSubmodule(\n                \"withBaseException\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CLIENT\n            );\n            SymbolReference exception = HttpProtocolGeneratorUtils.getClientBaseException(context);\n            writer.write(\"const throwDefaultError = withBaseException($T);\", exception);\n        }\n\n        // Write a function to generate HTTP requests since they're so similar.\n        SymbolReference requestType = getApplicationProtocol().getRequestType();\n        writer.addUseImports(requestType);\n        writer.addTypeImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addTypeImport(\"HeaderBag\", \"__HeaderBag\", TypeScriptDependency.SMITHY_TYPES);\n\n        Symbol requestSymbol = requestType.getSymbol().toBuilder().putProperty(\"typeOnly\", false).build();\n\n        writer.openBlock(\n            \"const buildHttpRpcRequest = async (\\n\" +\n                \"  context: __SerdeContext,\\n\" +\n                \"  headers: __HeaderBag,\\n\" +\n                \"  path: string,\\n\" +\n                \"  resolvedHostname: string | undefined,\\n\" +\n                \"  body: any,\\n\" +\n                \"): Promise<$T> => {\",\n            \"};\",\n            requestType,\n            () -> {\n                // Get the hostname, port, and scheme from client's resolved endpoint. Then construct the request from\n                // them. The client's resolved endpoint can be default one or supplied by users.\n                writer.write(\n                    \"const {hostname, protocol = \\\"https\\\", port, path: basePath} = await context.endpoint();\"\n                );\n                writer.openBlock(\"const contents: any = {\", \"};\", () -> {\n                    writer.write(\"protocol,\");\n                    writer.write(\"hostname,\");\n                    writer.write(\"port,\");\n                    writer.write(\"method: \\\"POST\\\",\");\n                    writer.write(\n                        \"path: basePath.endsWith(\\\"/\\\") ? basePath.slice(0, -1) + path : basePath + path,\"\n                    );\n                    writer.write(\"headers,\");\n                });\n                writer.openBlock(\"if (resolvedHostname !== undefined) {\", \"}\", () -> {\n                    writer.write(\"contents.hostname = resolvedHostname;\");\n                });\n                writer.openBlock(\"if (body !== undefined) {\", \"}\", () -> {\n                    writer.write(\"contents.body = body;\");\n                });\n                writer.write(\"return new $T(contents);\", requestSymbol);\n            }\n        );\n        // Write common request header to be shared by all requests\n        writeSharedRequestHeaders(context);\n        writer.write(\"\");\n\n        writer.write(context.getStringStore().flushVariableDeclarationCode());\n\n        writer.addImportSubmodule(\n            \"HttpRequest\",\n            \"__HttpRequest\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n        writer.addImportSubmodule(\n            \"HttpResponse\",\n            \"__HttpResponse\",\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.PROTOCOLS\n        );\n    }\n\n    @Override\n    public void generateRequestSerializers(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            topDownIndex.getContainedOperations(context.getService())\n        );\n        for (OperationShape operation : containedOperations) {\n            generateOperationSerializer(context, operation);\n        }\n    }\n\n    @Override\n    public void generateFrameworkErrorSerializer(GenerationContext serverContext) {\n        LOGGER.warning(\"Framework error serialization is not currently supported for RPC protocols.\");\n    }\n\n    @Override\n    public void generateRequestDeserializers(GenerationContext context) {\n        LOGGER.warning(\"Request deserialization is not currently supported for RPC protocols.\");\n    }\n\n    @Override\n    public void generateResponseSerializers(GenerationContext context) {\n        LOGGER.warning(\"Response serialization is not currently supported for RPC protocols.\");\n    }\n\n    @Override\n    public void generateServiceHandlerFactory(GenerationContext context) {\n        LOGGER.warning(\"Handler factory generation is not currently supported for RPC protocols.\");\n    }\n\n    @Override\n    public void generateOperationHandlerFactory(GenerationContext context, OperationShape operation) {\n        LOGGER.warning(\"Handler factory generation is not currently supported for RPC protocols.\");\n    }\n\n    @Override\n    public void generateResponseDeserializers(GenerationContext context) {\n        TopDownIndex topDownIndex = TopDownIndex.of(context.getModel());\n\n        Set<OperationShape> containedOperations = new TreeSet<>(\n            topDownIndex.getContainedOperations(context.getService())\n        );\n        for (OperationShape operation : containedOperations) {\n            generateOperationDeserializer(context, operation);\n        }\n\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        Set<StructureShape> errorShapes = HttpProtocolGeneratorUtils.generateUnifiedErrorDispatcher(\n            context,\n            containedOperations.stream().toList(),\n            responseType,\n            this::writeErrorCodeParser,\n            isErrorCodeInBody,\n            this::getErrorBodyLocation,\n            this::getOperationErrors,\n            getErrorAliases(context, containedOperations)\n        );\n        deserializingErrorShapes.addAll(errorShapes);\n    }\n\n    protected void generateOperationSerializer(GenerationContext context, OperationShape operation) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference requestType = getApplicationProtocol().getRequestType();\n        TypeScriptWriter writer = context.getWriter();\n\n        // Ensure that the request type is imported.\n        writer.addUseImports(requestType);\n        writer.addTypeImport(\"Endpoint\", \"__Endpoint\", TypeScriptDependency.SMITHY_TYPES);\n        // e.g., se_ES\n        String methodName = ProtocolGenerator.getSerFunctionShortName(symbol);\n        // e.g., serializeAws_restJson1_1ExecuteStatement\n        String methodLongName = ProtocolGenerator.getSerFunctionName(symbol, getName());\n        // Add the normalized input type.\n        Symbol inputType = symbol.expectProperty(\"inputType\", Symbol.class);\n        String serdeContextType = CodegenUtils.getOperationSerializerContextType(writer, context.getModel(), operation);\n\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  input: $T,\\n\" + \"  context: $L\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            inputType,\n            serdeContextType,\n            requestType,\n            () -> {\n                writeRequestHeaders(context, operation);\n                boolean hasRequestBody = writeRequestBody(context, operation);\n                boolean hasHostPrefix = operation.hasTrait(EndpointTrait.class);\n\n                if (hasHostPrefix) {\n                    HttpProtocolGeneratorUtils.writeHostPrefix(context, operation);\n                }\n\n                // Construct the request with the operation's path and optional hostname and body.\n                writer.write(\n                    \"return buildHttpRpcRequest(context, headers, $S, $L, $L);\",\n                    getOperationPath(context, operation),\n                    hasHostPrefix ? \"resolvedHostname\" : \"undefined\",\n                    hasRequestBody ? \"body\" : \"undefined\"\n                );\n            }\n        );\n\n        writer.write(\"\");\n    }\n\n    /**\n     * Writes HTTP request headers required by the protocol implementation.\n     *\n     * <p>By default, headers are configured to use {@code SHARED_HEADERS}. See {@link #writeSharedRequestHeaders}\n     *\n     * <pre>{@code\n     *   const headers: __HeaderBag = SHARED_HEADERS;\n     * }</pre>\n     *\n     * <p>This method can be overridden to customize headers generation. For example:\n     *\n     * <pre>{@code\n     *   const headers: __HeaderBag = {\n     *     \"foo\": \"This is a custom header\",\n     *     ...SHARED_HEADERS\n     *   };\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param operation The operation being generated.\n     */\n    protected void writeRequestHeaders(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.write(\"const headers: __HeaderBag = SHARED_HEADERS;\");\n    }\n\n    /**\n     * Writes headers to be shared for all HTTP requests by the protocol implementation.\n     *\n     * <p>To reduce generated code size, we should put all common headers into single location.\n     * <p>For example, most request headers contain {@code content-type}.\n     *\n     * <pre>{@code\n     * const SHARED_HEADERS: __HeaderBag = {\n     *   \"content-type\": \"application/x-www-form-urlencoded\",\n     * };\n     * }</pre>\n     *\n     * <p>{@code SHARED_HEADERS} can then be used as follows:\n     *\n     * <pre>{@code\n     * const headers: __HeaderBag = {\n     *   \"foo\": \"This is a custom header\",\n     *   ...SHARED_HEADERS\n     * };\n     * }</pre>\n     *\n     * <p>This method can be overridden for customization. For example:\n     *\n     * <pre>{@code\n     * function sharedHeaders(operationName): __HeaderBag = {\n     *   \"custom-header\": \"xyz-service:${operationName}\",\n     * };\n     *\n     * const headers: __HeaderBag = {\n     *   \"foo\": \"This is a custom header\",\n     *   ...sharedHeaders(operationName)\n     * };\n     * }</pre>\n     *\n     * @param context The generation context.\n     */\n    protected void writeSharedRequestHeaders(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.addTypeImport(\"HeaderBag\", \"__HeaderBag\", TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\"const SHARED_HEADERS: __HeaderBag = {\", \"};\", () -> {\n            writer.write(\"'content-type': $S,\", getDocumentContentType());\n        });\n    }\n\n    protected boolean writeRequestBody(GenerationContext context, OperationShape operation) {\n        if (operation.getInput().isPresent()) {\n            // If there's an input present, we know it's a structure.\n            StructureShape inputShape = context\n                .getModel()\n                .expectShape(operation.getInput().get())\n                .asStructureShape()\n                .get();\n            TypeScriptWriter writer = context.getWriter();\n            // Write the default `body` property.\n            writer.write(\"let body: any;\");\n            if (EventStreamGenerator.hasEventStreamInput(context, operation)) {\n                MemberShape eventStreamMember = EventStreamGenerator.getEventStreamMember(context, inputShape);\n                Shape target = context.getModel().expectShape(eventStreamMember.getTarget());\n                Symbol targetSymbol = context.getSymbolProvider().toSymbol(target);\n                String serFunctionName = ProtocolGenerator.getSerFunctionShortName(targetSymbol);\n                String memberName = eventStreamMember.getMemberName();\n                writer.write(\"body = $L(input.$L, context);\", serFunctionName, memberName);\n            } else {\n                // Track input shapes so their serializers may be generated.\n                serializingDocumentShapes.add(inputShape);\n                serializeInputDocument(context, operation, inputShape);\n            }\n            return true;\n        }\n\n        return writeUndefinedInputBody(context, operation);\n    }\n\n    /**\n     * Provides the request path for the operation.\n     *\n     * @param context The generation context.\n     * @param operation The operation being generated.\n     * @return The path to send HTTP requests to.\n     */\n    protected abstract String getOperationPath(GenerationContext context, OperationShape operation);\n\n    /**\n     * Writes the code needed to serialize the input document of a request.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the request body.\n     * This variable will already be defined in scope.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const wrappedBody: any = {\n     *   OperationRequest: serializeAws_json1_1OperationRequest(input, context),\n     * };\n     * body = JSON.stringify(wrappedBody);\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param operation The operation being generated.\n     * @param inputStructure The structure containing the operation input.\n     */\n    protected abstract void serializeInputDocument(\n        GenerationContext context,\n        OperationShape operation,\n        StructureShape inputStructure\n    );\n\n    /**\n     * Writes any default body contents when an operation has an undefined input.\n     *\n     * <p>Implementations of this method are expected to set a value to the\n     * {@code body} variable that will be serialized as the request body.\n     * This variable will NOT be defined in scope and should be defined by\n     * implementations if they wish to set it.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const body = \"{}\";\n     * }</pre>\n     *\n     * <p>Implementations should return true if they define a body variable, and\n     * false otherwise.\n     *\n     * @param context The generation context.\n     * @param operation The operation being generated.\n     * @return If a body variable was defined.\n     */\n    protected boolean writeUndefinedInputBody(GenerationContext context, OperationShape operation) {\n        // Pass\n        return false;\n    }\n\n    protected void generateOperationDeserializer(GenerationContext context, OperationShape operation) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        TypeScriptWriter writer = context.getWriter();\n\n        // Ensure that the response type is imported.\n        writer.addUseImports(responseType);\n        // e.g., deserializeAws_restJson1_1ExecuteStatement\n        String methodName = ProtocolGenerator.getDeserFunctionShortName(symbol);\n        String methodLongName = ProtocolGenerator.getDeserFunctionName(symbol, getName());\n        String errorMethodName = \"de_CommandError\";\n        String serdeContextType = CodegenUtils.getOperationDeserializerContextType(\n            context.getSettings(),\n            writer,\n            context.getModel(),\n            operation\n        );\n        // Add the normalized output type.\n        Symbol outputType = symbol.expectProperty(\"outputType\", Symbol.class);\n\n        // Handle the general response.\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\n            \"export const $L = async (\\n\" + \"  output: $T,\\n\" + \"  context: $L\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            methodName,\n            responseType,\n            serdeContextType,\n            outputType,\n            () -> {\n                // Redirect error deserialization to the dispatcher\n                writer.openBlock(\"if (output.statusCode >= 300) {\", \"}\", () -> {\n                    writer.write(\"return $L(output, context);\", errorMethodName);\n                });\n\n                // Start deserializing the response.\n                readResponseBody(context, operation);\n\n                // Build the response with typing and metadata.\n                writer.openBlock(\"const response: $T = {\", \"};\", outputType, () -> {\n                    writer.write(\"$$metadata: deserializeMetadata(output),\");\n                    operation\n                        .getOutput()\n                        .ifPresent(outputId -> {\n                            writer.write(\"...contents,\");\n                        });\n                });\n                writer.write(\"return response;\");\n            }\n        );\n        writer.write(\"\");\n    }\n\n    protected void generateErrorDeserializer(GenerationContext context, StructureShape error) {\n        TypeScriptWriter writer = context.getWriter();\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol errorSymbol = symbolProvider.toSymbol(error);\n        String errorDeserMethodName = ProtocolGenerator.getDeserFunctionShortName(errorSymbol) + \"Res\";\n        String errorDeserMethodLongName =\n            ProtocolGenerator.getDeserFunctionName(errorSymbol, context.getProtocolName()) + \"Res\";\n\n        // Add the error shape to the list to generate functions for, since we'll use that.\n        deserializingDocumentShapes.add(error);\n        String outputReference = isErrorCodeInBody ? \"parsedOutput\" : \"output\";\n\n        writer.writeDocs(errorDeserMethodLongName);\n        writer.openBlock(\n            \"const $L = async (\\n\" + \"  $L: any,\\n\" + \"  context: __SerdeContext\\n\" + \"): Promise<$T> => {\",\n            \"};\",\n            errorDeserMethodName,\n            outputReference,\n            errorSymbol,\n            () -> {\n                // First deserialize the body properly.\n                if (isErrorCodeInBody) {\n                    // Body is already parsed in the error dispatcher, simply assign the body.\n                    writer.write(\"const body = $L.body\", outputReference);\n                } else {\n                    // The dispatcher defers parsing the body in cases where protocols do not have\n                    // their error code in the body, so we handle that parsing before deserializing\n                    // the error shape here.\n                    writer.write(\"const body = parseBody($L.body, context);\", outputReference);\n                }\n\n                if (SerdeElisionIndex.of(context.getModel()).mayElide(error) && enableSerdeElision()) {\n                    writer.addImportSubmodule(\n                        \"_json\",\n                        null,\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.CLIENT\n                    );\n                    writer.write(\"const deserialized: any = _json($L);\", getErrorBodyLocation(context, \"body\"));\n                } else {\n                    writer.write(\n                        \"const deserialized: any = $L($L, context);\",\n                        ProtocolGenerator.getDeserFunctionShortName(errorSymbol),\n                        getErrorBodyLocation(context, \"body\")\n                    );\n                }\n\n                // Then load it into the object with additional error and response properties.\n                Symbol materializedError = errorSymbol.toBuilder().putProperty(\"typeOnly\", false).build();\n                writer.openBlock(\"const exception = new $T({\", \"});\", materializedError, () -> {\n                    writer.write(\"$$metadata: deserializeMetadata($L),\", outputReference);\n                    writer.write(\"...deserialized\");\n                });\n                writer.addImportSubmodule(\n                    \"decorateServiceException\",\n                    \"__decorateServiceException\",\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.CLIENT\n                );\n                writer.write(\"return __decorateServiceException(exception, body);\");\n            }\n        );\n\n        writer.write(\"\");\n    }\n\n    protected void readResponseBody(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n        OptionalUtils.ifPresentOrElse(\n            operation.getOutput(),\n            outputId -> {\n                // If there's an output present, we know it's a structure.\n                StructureShape outputShape = context.getModel().expectShape(outputId).asStructureShape().get();\n                if (EventStreamGenerator.hasEventStreamOutput(context, operation)) {\n                    MemberShape eventStreamMember = EventStreamGenerator.getEventStreamMember(context, outputShape);\n                    Shape target = context.getModel().expectShape(eventStreamMember.getTarget());\n                    Symbol targetSymbol = context.getSymbolProvider().toSymbol(target);\n                    writer.write(\n                        \"const contents = { $L: $L(output.body, context) };\",\n                        eventStreamMember.getMemberName(),\n                        ProtocolGenerator.getDeserFunctionShortName(targetSymbol)\n                    );\n                } else {\n                    // We only need to load the body and prepare a contents object if there is a response.\n                    writer.write(\"const data: any = await parseBody(output.body, context)\");\n                    writer.write(\"let contents: any = {};\");\n                    // Track output shapes so their deserializers may be generated.\n                    deserializingDocumentShapes.add(outputShape);\n\n                    deserializeOutputDocument(context, operation, outputShape);\n                }\n            },\n            () -> {\n                // If there is no output, the body still needs to be collected so the process can exit.\n                writer.write(\"await collectBody(output.body, context);\");\n            }\n        );\n    }\n\n    /**\n     * Writes the code that loads an optional {@code errorCode} String with the content used\n     * to dispatch errors to specific serializers. If an error code cannot be load, the code\n     * must return {@code undefined} so default value can be injected in default case.\n     *\n     * <p>Two variables will be in scope:\n     *   <ul>\n     *       <li>{@code output} or {@code parsedOutput}: a value of the HttpResponse type.\n     *          <ul>\n     *              <li>{@code output} is a raw HttpResponse, available when {@code isErrorCodeInBody} is set to\n     *              {@code false}</li>\n     *              <li>{@code parsedOutput} is a HttpResponse type with body parsed to JavaScript object, available\n     *              when {@code isErrorCodeInBody} is set to {@code true}</li>\n     *          </ul>\n     *       </li>\n     *       <li>{@code context}: the SerdeContext.</li>\n     *   </ul>\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * const errorCode = output.headers[\"x-amzn-errortype\"].split(':')[0];\n     * }</pre>\n     *\n     * @param context The generation context.\n     */\n    protected abstract void writeErrorCodeParser(GenerationContext context);\n\n    /**\n     * Provides where within the passed output variable the actual error resides. This is useful\n     * for protocols that wrap the specific error in additional elements within the body.\n     *\n     * @param context The generation context.\n     * @param outputLocation The name of the variable containing the output body.\n     * @return A string of the variable containing the error body within the output body.\n     */\n    protected String getErrorBodyLocation(GenerationContext context, String outputLocation) {\n        return outputLocation;\n    }\n\n    /**\n     * Allows RPC protocols to designate how to convert the body into bytes.\n     *\n     * @deprecated superseded by schema-serde.\n     */\n    @Deprecated\n    @SmithyInternalApi\n    protected void serializeEventStreamBodyToBytes(TypeScriptWriter writer) {\n        writer.write(\"body = context.utf8Decoder(JSON.stringify(body));\");\n    }\n\n    /**\n     * Writes the code needed to deserialize the output document of a response.\n     *\n     * <p>Implementations of this method are expected to set members in the\n     * {@code contents} variable that represents the type generated for the\n     * response. This variable will already be defined in scope.\n     *\n     * <p>The contents of the response body will be available in a {@code data} variable.\n     *\n     * <p>For example:\n     *\n     * <pre>{@code\n     * contents = deserializeAws_json1_1OperationResponse(data.OperationResponse, context);\n     * }</pre>\n     *\n     * @param context The generation context.\n     * @param operation The operation being generated.\n     * @param outputStructure The structure containing the operation output.\n     */\n    protected abstract void deserializeOutputDocument(\n        GenerationContext context,\n        OperationShape operation,\n        StructureShape outputStructure\n    );\n\n    /**\n     * See {@link SerdeElisionIndex}.\n     *\n     * @return whether protocol implementation is compatible with serde elision.\n     */\n    protected boolean enableSerdeElision() {\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/ProtocolGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.LinkedHashMap;\nimport java.util.Map;\nimport java.util.TreeSet;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDelegator;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\nimport software.amazon.smithy.utils.CaseUtils;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Smithy protocol code generators.\n */\n@SmithyUnstableApi\npublic interface ProtocolGenerator {\n    String PROTOCOLS_FOLDER = \"protocols\";\n\n    /**\n     * Sanitizes the name of the protocol so it can be used as a symbol\n     * in TypeScript.\n     *\n     * <p>For example, the default implementation converts \".\" to \"_\",\n     * and converts \"-\" to become camelCase separated words. This means\n     * that \"aws.rest-json-1.1\" becomes \"Aws_RestJson1_1\".\n     *\n     * @param name Name of the protocol to sanitize.\n     * @return Returns the sanitized name.\n     */\n    static String getSanitizedName(String name) {\n        String result = name.replace(\".\", \"_\");\n        return CaseUtils.toCamelCase(result, true, '-');\n    }\n\n    /**\n     * Gets the supported protocol {@link ShapeId}.\n     *\n     * @return Returns the protocol supported\n     */\n    ShapeId getProtocol();\n\n    /**\n     * Gets the name of the protocol.\n     *\n     * <p>The default implementation is the ShapeId name of the protocol trait in\n     * Smithy models (e.g., \"aws.protocols#restJson1\" would return \"restJson1\").\n     *\n     * @return Returns the protocol name.\n     */\n    default String getName() {\n        return getProtocol().getName();\n    }\n\n    /**\n     * Gets the application protocol for the generator.\n     *\n     * @return Returns the application protocol.\n     */\n    ApplicationProtocol getApplicationProtocol();\n\n    /**\n     * Determines if two protocol generators are compatible at the\n     * application protocol level, meaning they both use HTTP, or MQTT\n     * for example.\n     *\n     * <p>Two protocol implementations are considered compatible if the\n     * {@link ApplicationProtocol#equals} method of {@link #getApplicationProtocol}\n     * returns true when called with {@code other}. The default implementation\n     * should work for most interfaces, but may be overridden for more in-depth\n     * handling of things like minor version incompatibilities.\n     *\n     * <p>By default, if the application protocols are considered equal, then\n     * {@code other} is returned.\n     *\n     * @param service Service being generated.\n     * @param protocolGenerators Other protocol generators that are being generated.\n     * @param other Protocol generator to resolve against.\n     * @return Returns the resolved application protocol object.\n     */\n    default ApplicationProtocol resolveApplicationProtocol(\n        ServiceShape service,\n        Collection<ProtocolGenerator> protocolGenerators,\n        ApplicationProtocol other\n    ) {\n        if (!getApplicationProtocol().equals(other)) {\n            String protocolNames = protocolGenerators\n                .stream()\n                .map(ProtocolGenerator::getProtocol)\n                .map(ShapeId::getName)\n                .sorted()\n                .collect(Collectors.joining(\", \"));\n            throw new CodegenException(\n                String.format(\n                    \"All of the protocols generated for a service must be runtime compatible, but \" +\n                        \"protocol `%s` is incompatible with other application protocols: [%s]. Please pick a \"\n                        +\n                        \"set of compatible protocols using the `protocols` option when generating %s.\",\n                    getProtocol().getName(),\n                    protocolNames,\n                    service.getId()\n                )\n            );\n        }\n\n        return other;\n    }\n\n    /**\n     * Generates any standard code for service request/response serde.\n     *\n     * @param context Serde context.\n     */\n    default void generateSharedComponents(GenerationContext context) {}\n\n    /**\n     * Generates the code used to serialize the shapes of a service\n     * for requests.\n     *\n     * @param context Serialization context.\n     */\n    void generateRequestSerializers(GenerationContext context);\n\n    /**\n     * Generates the code used to deserialize the shapes of a service\n     * for requests.\n     *\n     * @param context Serialization context.\n     */\n    void generateRequestDeserializers(GenerationContext context);\n\n    /**\n     * Generates the code used to serialize the shapes of a service\n     * for responses.\n     *\n     * @param context Serialization context.\n     */\n    void generateResponseSerializers(GenerationContext context);\n\n    /**\n     * Generates the code used to serialize unmodeled errors for servers.\n     *\n     * @param serverContext Serialization context.\n     */\n    void generateFrameworkErrorSerializer(GenerationContext serverContext);\n\n    /**\n     * Generates a factory for the ServiceHandler implementation for this service.\n     *\n     * @param context Generation context.\n     */\n    void generateServiceHandlerFactory(GenerationContext context);\n\n    /**\n     * Generates the code used to handle a request for a specific operation in the given service. This allows the\n     * business logic for a service to be split among multiple deployment targets, for example, one Lambda function\n     * per operation.\n     *\n     * @param context Generation context.\n     * @param operation The operation to generate a handler factory for.\n     */\n    void generateOperationHandlerFactory(GenerationContext context, OperationShape operation);\n\n    /**\n     * Generates the code used to deserialize the shapes of a service\n     * for responses.\n     *\n     * @param context Deserialization context.\n     */\n    void generateResponseDeserializers(GenerationContext context);\n\n    /**\n     * Generates protocol tests to assert the protocol works properly.\n     *\n     * @param context Generation context.\n     */\n    void generateProtocolTests(GenerationContext context);\n\n    /**\n     * Generates the name of a serializer function for shapes of a service.\n     *\n     * @param symbol The symbol the serializer function is being generated for.\n     * @param protocol Name of the protocol being generated.\n     * @return Returns the generated function name.\n     */\n    static String getSerFunctionName(Symbol symbol, String protocol) {\n        // e.g., serializeAws_restJson1_1ExecuteStatement\n        String functionName = \"serialize\" + ProtocolGenerator.getSanitizedName(protocol);\n\n        // Update the function to have a component based on the symbol.\n        functionName += getSerdeFunctionSymbolComponent(symbol, symbol.expectProperty(\"shape\", Shape.class));\n\n        return functionName;\n    }\n\n    /**\n     * @param symbol The symbol the deserializer function is being generated for.\n     * @return Returns the generated function short name.\n     */\n    static String getSerFunctionShortName(Symbol symbol) {\n        // e.g., se_ES for ExecuteStatement\n        String functionName = \"se_\";\n        // Update the function to have a component based on the symbol.\n        functionName += ProtocolGenerator.getSerdeFunctionSymbolComponent(\n            symbol,\n            symbol.expectProperty(\"shape\", Shape.class)\n        );\n        return functionName;\n    }\n\n    /**\n     * Generates the name of a serializer function for shapes of a service that is not\n     * protocol-specific.\n     *\n     * @param symbol The symbol the serializer function is being generated for.\n     * @return Returns the generated function name.\n     */\n    static String getGenericSerFunctionName(Symbol symbol) {\n        // e.g., serializeExecuteStatement\n        return \"serialize\" + getSerdeFunctionSymbolComponent(symbol, symbol.expectProperty(\"shape\", Shape.class));\n    }\n\n    /**\n     * Generates the name of a deserializer function for shapes of a service.\n     *\n     * @param symbol The symbol the deserializer function is being generated for.\n     * @param protocol Name of the protocol being generated.\n     * @return Returns the generated function name.\n     */\n    static String getDeserFunctionName(Symbol symbol, String protocol) {\n        // e.g., deserializeAws_restJson1_1ExecuteStatement\n        String functionName = \"deserialize\" + ProtocolGenerator.getSanitizedName(protocol);\n\n        // Update the function to have a component based on the symbol.\n        functionName += getSerdeFunctionSymbolComponent(symbol, symbol.expectProperty(\"shape\", Shape.class));\n\n        return functionName;\n    }\n\n    /**\n     * @param symbol The symbol the deserializer function is being generated for.\n     * @return Returns the generated function short name.\n     */\n    static String getDeserFunctionShortName(Symbol symbol) {\n        // e.g., de_ES for ExecuteStatement\n        String functionName = \"de_\";\n        // Update the function to have a component based on the symbol.\n        functionName += ProtocolGenerator.getSerdeFunctionSymbolComponent(\n            symbol,\n            symbol.expectProperty(\"shape\", Shape.class)\n        );\n        return functionName;\n    }\n\n    /**\n     * Generates the name of a deserializer function for shapes of a service that is not protocol-specific.\n     *\n     * @param symbol The symbol the deserializer function is being generated for.\n     * @return Returns the generated function name.\n     */\n    static String getGenericDeserFunctionName(Symbol symbol) {\n        // e.g., deserializeExecuteStatement\n        return \"deserialize\" + getSerdeFunctionSymbolComponent(symbol, symbol.expectProperty(\"shape\", Shape.class));\n    }\n\n    static String getSerdeFunctionSymbolComponent(Symbol symbol, Shape shape) {\n        switch (shape.getType()) {\n            case LIST:\n            case SET:\n            case MAP:\n            case DOCUMENT:\n                // These need specialized serializers because they use complex but\n                // non-generated types, so generate a separate name.\n                return shape.getId().getName();\n            default:\n                return symbol.getName();\n        }\n    }\n\n    /**\n     * Returns a map of error names to their {@link ShapeId}.\n     *\n     * @param context the generation context\n     * @param operation the operation shape to retrieve errors for\n     * @return map of error names to {@link ShapeId}\n     */\n    default Map<String, ShapeId> getOperationErrors(GenerationContext context, OperationShape operation) {\n        return HttpProtocolGeneratorUtils.getOperationErrors(context, operation);\n    }\n\n    /**\n     * Returns a map of error names to their {@link ShapeId}.\n     *\n     * @param context the generation context\n     * @param operations the operation shapes to retrieve errors for\n     * @return map of error names to {@link ShapeId}\n     */\n    default Map<String, ShapeId> getOperationErrors(GenerationContext context, Collection<OperationShape> operations) {\n        Map<String, ShapeId> errors = new LinkedHashMap<>();\n        for (OperationShape operation : operations) {\n            errors.putAll(getOperationErrors(context, operation));\n        }\n        return errors;\n    }\n\n    /**\n     * @return map of fully qualified shape id to aliases and/or short names that should map to the same error.\n     */\n    default Map<String, TreeSet<String>> getErrorAliases(\n        GenerationContext context,\n        Collection<OperationShape> operations\n    ) {\n        return Collections.emptyMap();\n    }\n\n    /**\n     * Context object used for service serialization and deserialization.\n     */\n    class GenerationContext {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private SymbolProvider symbolProvider;\n        private TypeScriptDelegator writerDelegator;\n        private TypeScriptWriter writer;\n        private String protocolName;\n        private StringStore stringStore = new StringStore();\n\n        public TypeScriptSettings getSettings() {\n            return settings;\n        }\n\n        public void setSettings(TypeScriptSettings settings) {\n            this.settings = settings;\n        }\n\n        public Model getModel() {\n            return model;\n        }\n\n        public void setModel(Model model) {\n            this.model = model;\n        }\n\n        public ServiceShape getService() {\n            return service;\n        }\n\n        public void setService(ServiceShape service) {\n            this.service = service;\n        }\n\n        public SymbolProvider getSymbolProvider() {\n            return symbolProvider;\n        }\n\n        public void setSymbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n        }\n\n        // TODO: Potential refactoring.\n        // Consider whether to use a Builder pattern here (also with toBuilder instead of copy),\n        // where the constructor asserts that both writer/writerDelegator are not set, instead of unsetting the other.\n        // Or consider specialized GenerationContextWithWriter/GenerationContextWithWriterDelegator to use in\n        // corresponding ProtocolGenerator methods that need writer v/s writerDelegator.\n        // OR better refactor to add something like a `areProtocolTestsPresent()` so `generateProtocolTests` is called\n        // and `writer` created only if needed.\n        public TypeScriptDelegator getWriterDelegator() {\n            return writerDelegator;\n        }\n\n        public void setWriterDelegator(TypeScriptDelegator writerDelegator) {\n            this.writerDelegator = writerDelegator;\n            if (writerDelegator != null) {\n                this.writer = null;\n            }\n        }\n\n        public TypeScriptWriter getWriter() {\n            return writer;\n        }\n\n        public void setWriter(TypeScriptWriter writer) {\n            this.writer = writer;\n            if (writer != null) {\n                this.writerDelegator = null;\n            }\n        }\n\n        public String getProtocolName() {\n            return protocolName;\n        }\n\n        public void setProtocolName(String protocolName) {\n            this.protocolName = protocolName;\n        }\n\n        public GenerationContext copy() {\n            GenerationContext copy = new GenerationContext();\n            copy.setSettings(settings);\n            copy.setModel(model);\n            copy.setService(service);\n            copy.setSymbolProvider(symbolProvider);\n            copy.setWriterDelegator(writerDelegator);\n            copy.setWriter(writer);\n            copy.setProtocolName(protocolName);\n            return copy;\n        }\n\n        public GenerationContext withWriter(TypeScriptWriter newWriter) {\n            GenerationContext copyContext = copy();\n            copyContext.setWriter(newWriter);\n            return copyContext;\n        }\n\n        public StringStore getStringStore() {\n            return stringStore;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/RuntimeClientPlugin.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.function.BiPredicate;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.util.ClientWriterConsumer;\nimport software.amazon.smithy.typescript.codegen.util.CommandWriterConsumer;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\nimport software.amazon.smithy.utils.StringUtils;\nimport software.amazon.smithy.utils.ToSmithyBuilder;\n\n/**\n * Represents a runtime plugin for a client that hooks into various aspects\n * of TypeScript code generation, including adding configuration settings\n * to clients and middleware plugins to both clients and commands.\n *\n * <p>These runtime client plugins are registered through the\n * {@link TypeScriptIntegration} SPI and applied to the code generator at\n * build-time.\n */\n@SmithyUnstableApi\npublic final class RuntimeClientPlugin implements ToSmithyBuilder<RuntimeClientPlugin> {\n\n    private final SymbolReference inputConfig;\n    private final SymbolReference resolvedConfig;\n    private final SymbolReference resolveFunction;\n    private final FunctionParamsSupplier additionalResolveFunctionParamsSupplier;\n    private final SymbolReference pluginFunction;\n    private final FunctionParamsSupplier additionalPluginFunctionParamsSupplier;\n    private final SymbolReference destroyFunction;\n    private final BiPredicate<Model, ServiceShape> servicePredicate;\n    private final OperationPredicate operationPredicate;\n    private final SettingsPredicate settingsPredicate;\n    private final Map<String, ClientWriterConsumer> writeAdditionalClientParams;\n    private final Map<String, CommandWriterConsumer> writeAdditionalOperationParams;\n\n    private RuntimeClientPlugin(Builder builder) {\n        inputConfig = builder.inputConfig;\n        resolvedConfig = builder.resolvedConfig;\n        resolveFunction = builder.resolveFunction;\n        additionalResolveFunctionParamsSupplier = builder.additionalResolveFunctionParamsSupplier;\n        pluginFunction = builder.pluginFunction;\n        additionalPluginFunctionParamsSupplier = builder.additionalPluginFunctionParamsSupplier;\n        destroyFunction = builder.destroyFunction;\n        operationPredicate = builder.operationPredicate;\n        servicePredicate = builder.servicePredicate;\n        settingsPredicate = builder.settingsPredicate;\n        writeAdditionalClientParams = builder.writeAdditionalClientParams;\n        writeAdditionalOperationParams = builder.writeAdditionalOperationParams;\n\n        boolean allNull = (inputConfig == null) && (resolvedConfig == null) && (resolveFunction == null);\n        boolean allSet = (inputConfig != null) && (resolvedConfig != null) && (resolveFunction != null);\n        if (!(allNull || allSet)) {\n            throw new IllegalStateException(\n                \"If any of inputConfig, resolvedConfig, or resolveFunction are set, then all of \" +\n                    \"inputConfig, resolvedConfig, and resolveFunction must be set: inputConfig: \" +\n                    inputConfig +\n                    \", resolvedConfig: \" +\n                    resolvedConfig +\n                    \", resolveFunction: \" +\n                    resolveFunction\n            );\n        }\n\n        if (destroyFunction != null && resolvedConfig == null) {\n            throw new IllegalStateException(\"resolvedConfig must be set if destroyFunction is set\");\n        }\n    }\n\n    @FunctionalInterface\n    public interface OperationPredicate {\n        /**\n         * Tests if middleware is applied to an individual operation.\n         *\n         * @param model Model the operation belongs to.\n         * @param service Service the operation belongs to.\n         * @param operation Operation to test.\n         * @return Returns true if middleware should be applied to the operation.\n         */\n        boolean test(Model model, ServiceShape service, OperationShape operation);\n    }\n\n    @FunctionalInterface\n    public interface SettingsPredicate {\n        /**\n         * Tests if runtime client plugin should be applied based on settings.\n         *\n         * @param model Model the operation belongs to.\n         * @param service Service the operation belongs to.\n         * @param settings Settings from smithy-build configuration.\n         * @return Returns true if runtime client plugin should be applied.\n         */\n        boolean test(Model model, ServiceShape service, TypeScriptSettings settings);\n    }\n\n    @FunctionalInterface\n    public interface FunctionParamsSupplier {\n        /**\n         * Returns parameters to be passed to a function which can be computed dynamically.\n         *\n         * @param model Model the operation belongs to.\n         * @param service Service the operation belongs to.\n         * @param operation Operation to test.\n         * @return Returns the map of parameters to be passed to a function. The key is the key\n         * for a parameter, and value is the value for a parameter.\n         */\n        Map<String, Object> apply(Model model, ServiceShape service, OperationShape operation);\n    }\n\n    /**\n     * Gets the optionally present symbol reference that points to the\n     * <em>Input configuration interface</em> for the plugin.\n     *\n     * <p>If the plugin has input, then it also must define a\n     * <em>resolved interface</em>, and a <em>resolve function</em>.\n     *\n     * <pre>{@code\n     * export interface FooConfigInput {\n     *     // ...\n     * }\n     *\n     * export interface FooConfigResolved {\n     *     // ...\n     * }\n     *\n     * export function resolveFooConfig(config: FooConfigInput): FooConfigResolved {\n     *     return {\n     *         ...input,\n     *         // more properties...\n     *     };\n     * }\n     * }</pre>\n     *\n     * @return Returns the optionally present input interface symbol.\n     * @see #getResolvedConfig()\n     * @see #getResolveFunction()\n     */\n    public Optional<SymbolReference> getInputConfig() {\n        return Optional.ofNullable(inputConfig);\n    }\n\n    /**\n     * Gets the optionally present symbol reference that points to the\n     * <em>Resolved configuration interface</em> for the plugin.\n     *\n     * <p>If the plugin has a resolved config, then it also must define\n     * an <em>input interface</em>, and a <em>resolve function</em>.\n     *\n     * @return Returns the optionally present resolved interface symbol.\n     * @see #getInputConfig()\n     * @see #getResolveFunction()\n     */\n    public Optional<SymbolReference> getResolvedConfig() {\n        return Optional.ofNullable(resolvedConfig);\n    }\n\n    /**\n     * Gets the optionally present symbol reference that points to the\n     * function that converts the input configuration type into the\n     * resolved configuration type.\n     *\n     * <p>If the plugin has a resolve function, then it also must define a\n     * <em>resolved interface</em> and a <em>resolve function</em>.\n     * The referenced function must accept the input type of the plugin\n     * as the first positional argument and optional parameters as additional\n     * positional arguments, and return the resolved interface as the return\n     * value.\n     *\n     * @return Returns the optionally present resolve function.\n     * @see #getInputConfig()\n     * @see #getResolvedConfig()\n     */\n    public Optional<SymbolReference> getResolveFunction() {\n        return Optional.ofNullable(resolveFunction);\n    }\n\n    /**\n     * Gets a list of additional parameters to be supplied to the\n     * resolve function. These parameters are to be supplied to resolve\n     * function as second argument. The map is empty if there are\n     * no additional parameters.\n     *\n     * @param model Model the operation belongs to.\n     * @param service Service the operation belongs to.\n     * @param operation Operation to test against.\n     * @return Returns the optionally present map of parameters. The key is the key\n     * for a parameter, and value is the value for a parameter.\n     */\n    public Map<String, Object> getAdditionalResolveFunctionParameters(\n        Model model,\n        ServiceShape service,\n        OperationShape operation\n    ) {\n        if (additionalResolveFunctionParamsSupplier != null) {\n            return additionalResolveFunctionParamsSupplier.apply(model, service, operation);\n        }\n        return new HashMap<String, Object>();\n    }\n\n    /**\n     * Gets the optionally present symbol reference that points to the\n     * function that injects plugin middleware into the middleware stack\n     * of a client or command at runtime.\n     *\n     * <p>If the plugin has middleware, then the plugin must define a method\n     * that takes the plugin's Resolved configuration as the first argument\n     * and returns a {@code Pluggable<any, any>}.\n     *\n     * <pre>{@code\n     * export function getFooPlugin(\n     *   config: FooConfigResolved\n     * ): Pluggable<any, any> => ({\n     *   applyToStack: clientStack => {\n     *     // add or remove middleware from the stack.\n     *   }\n     * });\n     * }</pre>\n     *\n     * @return Returns the optionally present plugin function.\n     */\n    public Optional<SymbolReference> getPluginFunction() {\n        return Optional.ofNullable(pluginFunction);\n    }\n\n    /**\n     * Gets a list of additional parameters to be supplied to the\n     * plugin function. These parameters are to be supplied to plugin\n     * function as second argument. The map is empty if there are\n     * no additional parameters.\n     *\n     * @param model Model the operation belongs to.\n     * @param service Service the operation belongs to.\n     * @param operation Operation to test against.\n     * @return Returns the optionally present map of parameters. The key is the key\n     * for a parameter, and value is the value for a parameter.\n     */\n    public Map<String, Object> getAdditionalPluginFunctionParameters(\n        Model model,\n        ServiceShape service,\n        OperationShape operation\n    ) {\n        if (additionalPluginFunctionParamsSupplier != null) {\n            return additionalPluginFunctionParamsSupplier.apply(model, service, operation);\n        }\n        return new HashMap<>();\n    }\n\n    /**\n     * Gets a list of additional parameters to be supplied to the\n     * plugin function. These parameters are to be supplied to plugin\n     * function as second argument. The map is empty if there are\n     * no additional parameters.\n     *\n     * @param model Model the operation belongs to.\n     * @param service Service the operation belongs to.\n     * @param operation Operation to test against.\n     * @return Returns the optionally present map of parameters. The key is the key\n     * for a parameter, and value is the value for a parameter.\n     */\n    public Map<String, Object> getAdditionalPluginFunctionParameterWriterConsumers(\n        Model model,\n        ServiceShape service,\n        OperationShape operation\n    ) {\n        if (additionalPluginFunctionParamsSupplier != null) {\n            return additionalPluginFunctionParamsSupplier.apply(model, service, operation);\n        }\n        return new HashMap<>();\n    }\n\n    /**\n     * Gets the optionally present symbol reference that points to the\n     * function that is used to clean up any resources when a client is\n     * destroyed.\n     *\n     * <p>The referenced method is expected to take a resolved\n     * configuration interface and destroy any necessary values\n     * (for example, close open connections, deallocate resources, etc).\n     *\n     * <pre>{@code\n     * export function destroyFooConfig(config: FooConfigResolved): void {\n     *   // destroy configuration values here...\n     * }\n     * }</pre>\n     *\n     * @return Returns the optionally present destroy function.\n     */\n    public Optional<SymbolReference> getDestroyFunction() {\n        return Optional.ofNullable(destroyFunction);\n    }\n\n    /**\n     * Returns true if this plugin applies to the given service.\n     *\n     * <p>By default, a plugin applies to all services but not to specific\n     * commands. You an configure a plugin to apply only to a subset of\n     * services (for example, only apply to a known service or a service\n     * with specific traits) or to no services at all (for example, if\n     * the plugin is meant to by command-specific and not on every\n     * command executed by the service).\n     *\n     * @param model The model the service belongs to.\n     * @param service Service shape to test against.\n     * @return Returns true if the plugin is applied to the given service.\n     * @see #matchesOperation(Model, ServiceShape, OperationShape)\n     */\n    public boolean matchesService(Model model, ServiceShape service) {\n        return servicePredicate.test(model, service);\n    }\n\n    /**\n     * Returns true if this plugin applies to the given operation.\n     *\n     * @param model Model the operation belongs to.\n     * @param service Service the operation belongs to.\n     * @param operation Operation to test against.\n     * @return Returns true if the plugin is applied to the given operation.\n     * @see #matchesService(Model, ServiceShape)\n     */\n    public boolean matchesOperation(Model model, ServiceShape service, OperationShape operation) {\n        return operationPredicate.test(model, service, operation);\n    }\n\n    /**\n     * Returns true if this plugin applies given a smithy-build configuration.\n     *\n     * @param model Model the operation belongs to.\n     * @param service Service the operation belongs to.\n     * @param settings Settings from smithy-build configuration to test against.\n     * @return Returns true if the plugin is applied given a smithy-build configuration.\n     */\n    public boolean matchesSettings(Model model, ServiceShape service, TypeScriptSettings settings) {\n        return settingsPredicate.test(model, service, settings);\n    }\n\n    /**\n     * @return the map of additional client level plugin params and their writer consumers used\n     * to populate the param values.\n     */\n    public Map<String, ClientWriterConsumer> getClientAddParamsWriterConsumers() {\n        return this.writeAdditionalClientParams;\n    }\n\n    /**\n     * @return the map of additional operation level plugin params and their writer consumers used\n     * to populate the param values.\n     */\n    public Map<String, CommandWriterConsumer> getOperationAddParamsWriterConsumers() {\n        return this.writeAdditionalOperationParams;\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    @Override\n    public Builder toBuilder() {\n        Builder builder = builder()\n            .inputConfig(inputConfig)\n            .resolvedConfig(resolvedConfig)\n            .resolveFunction(resolveFunction)\n            .additionalResolveFunctionParamsSupplier(additionalResolveFunctionParamsSupplier)\n            .pluginFunction(pluginFunction)\n            .additionalPluginFunctionParamsSupplier(additionalPluginFunctionParamsSupplier)\n            .destroyFunction(destroyFunction);\n\n        // Set these directly since their setters have mutual side-effects.\n        builder.operationPredicate = operationPredicate;\n        builder.servicePredicate = servicePredicate;\n\n        return builder;\n    }\n\n    @Override\n    public String toString() {\n        return (\"RuntimeClientPlugin{\" +\n            \"inputConfig=\" +\n            inputConfig +\n            \", resolvedConfig=\" +\n            resolvedConfig +\n            \", resolveFunction=\" +\n            resolveFunction +\n            \", pluginFunction=\" +\n            pluginFunction +\n            \", destroyFunction=\" +\n            destroyFunction +\n            '}');\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) {\n            return true;\n        } else if (!(o instanceof RuntimeClientPlugin)) {\n            return false;\n        }\n\n        RuntimeClientPlugin that = (RuntimeClientPlugin) o;\n        return (Objects.equals(inputConfig, that.inputConfig) &&\n            Objects.equals(resolvedConfig, that.resolvedConfig)\n            &&\n            Objects.equals(resolveFunction, that.resolveFunction)\n            &&\n            Objects.equals(additionalResolveFunctionParamsSupplier, that.additionalResolveFunctionParamsSupplier)\n            &&\n            Objects.equals(pluginFunction, that.pluginFunction)\n            &&\n            Objects.equals(additionalPluginFunctionParamsSupplier, that.additionalPluginFunctionParamsSupplier)\n            &&\n            Objects.equals(destroyFunction, that.destroyFunction)\n            &&\n            servicePredicate.equals(that.servicePredicate)\n            &&\n            operationPredicate.equals(that.operationPredicate));\n    }\n\n    @Override\n    public int hashCode() {\n        return Objects.hash(inputConfig, resolvedConfig, resolveFunction, pluginFunction, destroyFunction);\n    }\n\n    /**\n     * Builds an {@code RuntimePlugin}.\n     */\n    public static final class Builder implements SmithyBuilder<RuntimeClientPlugin> {\n\n        private SymbolReference inputConfig;\n        private SymbolReference resolvedConfig;\n        private SymbolReference resolveFunction;\n        private FunctionParamsSupplier additionalResolveFunctionParamsSupplier;\n        private SymbolReference pluginFunction;\n        private FunctionParamsSupplier additionalPluginFunctionParamsSupplier;\n        private SymbolReference destroyFunction;\n        private BiPredicate<Model, ServiceShape> servicePredicate = (model, service) -> true;\n        private OperationPredicate operationPredicate = (model, service, operation) -> false;\n        private SettingsPredicate settingsPredicate = (model, service, settings) -> true;\n        private Map<String, ClientWriterConsumer> writeAdditionalClientParams = Collections.emptyMap();\n        private Map<String, CommandWriterConsumer> writeAdditionalOperationParams = Collections.emptyMap();\n\n        @Override\n        public RuntimeClientPlugin build() {\n            return new RuntimeClientPlugin(this);\n        }\n\n        /**\n         * Sets the symbol reference used to configure a client input configuration.\n         *\n         * <p>If this is set, then both {@link #resolvedConfig} and\n         * {@link #resolveFunction} must also be set.\n         *\n         * @param inputConfig Input configuration symbol to set.\n         * @return Returns the builder.\n         * @see #getInputConfig()\n         */\n        public Builder inputConfig(SymbolReference inputConfig) {\n            this.inputConfig = inputConfig;\n            return this;\n        }\n\n        /**\n         * Sets the symbol used to configure a client input configuration.\n         *\n         * <p>If this is set, then both {@link #resolvedConfig} and\n         * {@link #resolveFunction} must also be set.\n         *\n         * @param inputConfig Input configuration symbol to set.\n         * @return Returns the builder.\n         * @see #getInputConfig()\n         */\n        public Builder inputConfig(Symbol inputConfig) {\n            return inputConfig(SymbolReference.builder().symbol(inputConfig).build());\n        }\n\n        /**\n         * Sets the symbol refernece used to configure a client resolved configuration.\n         *\n         * <p>If this is set, then both {@link #resolveFunction} and\n         * {@link #inputConfig} must also be set.\n         *\n         * @param resolvedConfig Resolved configuration symbol to set.\n         * @return Returns the builder.\n         * @see #getResolvedConfig()\n         */\n        public Builder resolvedConfig(SymbolReference resolvedConfig) {\n            this.resolvedConfig = resolvedConfig;\n            return this;\n        }\n\n        /**\n         * Sets the symbol used to configure a client resolved configuration.\n         *\n         * <p>If this is set, then both {@link #resolveFunction} and\n         * {@link #inputConfig} must also be set.\n         *\n         * @param resolvedConfig Resolved configuration symbol to set.\n         * @return Returns the builder.\n         * @see #getResolvedConfig()\n         */\n        public Builder resolvedConfig(Symbol resolvedConfig) {\n            return resolvedConfig(SymbolReference.builder().symbol(resolvedConfig).build());\n        }\n\n        /**\n         * Sets the symbol reference that is invoked in order to convert the\n         * input symbol type to a resolved symbol type.\n         *\n         * <p>If this is set, then both {@link #resolvedConfig} and\n         * {@link #inputConfig} must also be set.\n         *\n         * @param resolveFunction Function used to convert input to resolved.\n         * @return Returns the builder.\n         * @see #getResolveFunction()\n         */\n        public Builder resolveFunction(SymbolReference resolveFunction) {\n            this.resolveFunction = resolveFunction;\n            return this;\n        }\n\n        /**\n         * Sets the symbol reference that is invoked in order to convert the\n         * input symbol type to a resolved symbol type.\n         *\n         * <p>If this is set, then both {@link #resolvedConfig} and\n         * {@link #inputConfig} must also be set.\n         *\n         * @param resolveFunction Function used to convert input to resolved.\n         * @param additionalResolveFunctionParamsSupplier Function which returns params to be passed\n         * as resolve function input.\n         * @return Returns the builder.\n         * @see #getResolveFunction()\n         */\n        public Builder resolveFunction(\n            SymbolReference resolveFunction,\n            FunctionParamsSupplier additionalResolveFunctionParamsSupplier\n        ) {\n            this.resolveFunction = resolveFunction;\n            this.additionalResolveFunctionParamsSupplier = additionalResolveFunctionParamsSupplier;\n            return this;\n        }\n\n        /**\n         * Sets the symbol that is invoked in order to convert the\n         * input symbol type to a resolved symbol type.\n         *\n         * <p>If this is set, then both {@link #resolvedConfig} and\n         * {@link #inputConfig} must also be set.\n         *\n         * @param resolveFunction Function used to convert input to resolved.\n         * @return Returns the builder.\n         * @see #getResolveFunction()\n         */\n        public Builder resolveFunction(Symbol resolveFunction) {\n            return resolveFunction(SymbolReference.builder().symbol(resolveFunction).build());\n        }\n\n        /**\n         * Sets the symbol that is invoked in order to convert the\n         * input symbol type to a resolved symbol type.\n         *\n         * <p>If this is set, then both {@link #resolvedConfig} and\n         * {@link #inputConfig} must also be set.\n         *\n         * @param resolveFunction Function used to convert input to resolved.\n         * @param additionalResolveFunctionParamsSupplier Function which returns params to be passed\n         * as resolve function input.\n         * @return Returns the builder.\n         * @see #getResolveFunction()\n         */\n        public Builder resolveFunction(\n            Symbol resolveFunction,\n            FunctionParamsSupplier additionalResolveFunctionParamsSupplier\n        ) {\n            return resolveFunction(\n                SymbolReference.builder().symbol(resolveFunction).build(),\n                additionalResolveFunctionParamsSupplier\n            );\n        }\n\n        /**\n         * Set function which returns input parameters to resolve function. Set\n         * function to return empty map to remove the current parameters.\n         *\n         * <p>If this is set, then all of {@link #resolveFunction},\n         * {@link #resolvedConfig} and {@link #inputConfig} must also be set.\n         *\n         * @param additionalResolveFunctionParamsSupplier Function which returns params to be passed\n         * as resolve function input.\n         * @return Returns the builder.\n         * @see #getResolveFunction()\n         */\n        public Builder additionalResolveFunctionParamsSupplier(\n            FunctionParamsSupplier additionalResolveFunctionParamsSupplier\n        ) {\n            this.additionalResolveFunctionParamsSupplier = additionalResolveFunctionParamsSupplier;\n            return this;\n        }\n\n        /**\n         * Sets a function symbol reference used to configure clients and\n         * commands to use a specific middleware function.\n         *\n         * @param pluginFunction Plugin function symbol to invoke.\n         * @return Returns the builder.\n         * @see #getPluginFunction()\n         */\n        public Builder pluginFunction(SymbolReference pluginFunction) {\n            this.pluginFunction = pluginFunction;\n            return this;\n        }\n\n        /**\n         * Sets a function symbol reference used to configure clients and\n         * commands to use a specific middleware function.\n         *\n         * @param pluginFunction Plugin function symbol to invoke.\n         * @param pluginFunctionParamsSupplier Function which returns params to be passed as plugin function input.\n         * @return Returns the builder.\n         * @see #getPluginFunction()\n         */\n        public Builder pluginFunction(\n            SymbolReference pluginFunction,\n            FunctionParamsSupplier pluginFunctionParamsSupplier\n        ) {\n            this.pluginFunction = pluginFunction;\n            this.additionalPluginFunctionParamsSupplier = pluginFunctionParamsSupplier;\n            return this;\n        }\n\n        /**\n         * Sets a function symbol used to configure clients and commands to\n         * use a specific middleware function.\n         *\n         * @param pluginFunction Plugin function symbol to invoke.\n         * @return Returns the builder.\n         * @see #getPluginFunction()\n         */\n        public Builder pluginFunction(Symbol pluginFunction) {\n            return pluginFunction(SymbolReference.builder().symbol(pluginFunction).build());\n        }\n\n        /**\n         * Sets a function symbol used to configure clients and commands to\n         * use a specific middleware function.\n         *\n         * @param pluginFunction Plugin function symbol to invoke.\n         * @param additionalPluginFunctionParamsSupplier Function which returns params to be passed\n         * as plugin function input.\n         * @return Returns the builder.\n         * @see #getPluginFunction()\n         */\n        public Builder pluginFunction(\n            Symbol pluginFunction,\n            FunctionParamsSupplier additionalPluginFunctionParamsSupplier\n        ) {\n            return pluginFunction(\n                SymbolReference.builder().symbol(pluginFunction).build(),\n                additionalPluginFunctionParamsSupplier\n            );\n        }\n\n        /**\n         * Set function which returns input parameters to plugin function. Set\n         * function to return empty map to remove the current parameters.\n         *\n         * @param additionalPluginFunctionParamsSupplier Function which returns params to be passed\n         * as plugin function input.\n         * @return Returns the builder.\n         * @see #getPluginFunction()\n         */\n        public Builder additionalPluginFunctionParamsSupplier(\n            FunctionParamsSupplier additionalPluginFunctionParamsSupplier\n        ) {\n            this.additionalPluginFunctionParamsSupplier = additionalPluginFunctionParamsSupplier;\n            return this;\n        }\n\n        /**\n         * Sets a function symbol reference to call from a client in the\n         * {@code destroy} function of a TypeScript client.\n         *\n         * <p>The referenced function takes the resolved configuration\n         * type as the first argument. {@link #resolvedConfig} must be\n         * configured if {@code destroyFunction} is set.\n         *\n         * @param destroyFunction Function to invoke from a client.\n         * @return Returns the builder.\n         * @see #getDestroyFunction()\n         */\n        public Builder destroyFunction(SymbolReference destroyFunction) {\n            this.destroyFunction = destroyFunction;\n            return this;\n        }\n\n        /**\n         * Sets a function symbol to call from a client in the {@code destroy}\n         * function of a TypeScript client.\n         *\n         * <p>The referenced function takes the resolved configuration\n         * type as the first argument. {@link #resolvedConfig} must be\n         * configured if {@code destroyFunction} is set.\n         *\n         * @param destroyFunction Function to invoke from a client.\n         * @return Returns the builder.\n         * @see #getDestroyFunction()\n         */\n        public Builder destroyFunction(Symbol destroyFunction) {\n            return destroyFunction(SymbolReference.builder().symbol(destroyFunction).build());\n        }\n\n        /**\n         * Sets a predicate that determines if the plugin applies to a\n         * specific operation.\n         *\n         * <p>When this method is called, the {@code servicePredicate} is\n         * automatically configured to return false for every service.\n         *\n         * <p>By default, a plugin applies globally to a service, which thereby\n         * applies to every operation when the middleware stack is copied.\n         *\n         * @param operationPredicate Operation matching predicate.\n         * @return Returns the builder.\n         * @see #servicePredicate(BiPredicate)\n         */\n        public Builder operationPredicate(OperationPredicate operationPredicate) {\n            this.operationPredicate = Objects.requireNonNull(operationPredicate);\n            servicePredicate = (model, service) -> false;\n            return this;\n        }\n\n        /**\n         * Configures a predicate that makes a plugin only apply to a set of\n         * operations that match one or more of the set of given shape names,\n         * and ensures that the plugin is not applied globally to services.\n         *\n         * <p>By default, a plugin applies globally to a service, which thereby\n         * applies to every operation when the middleware stack is copied.\n         *\n         * @param operationNames Set of operation names.\n         * @return Returns the builder.\n         */\n        public Builder appliesOnlyToOperations(Set<String> operationNames) {\n            operationPredicate((model, service, operation) -> operationNames.contains(operation.getId().getName()));\n            return servicePredicate((model, service) -> false);\n        }\n\n        /**\n         * Configures a predicate that applies the plugin to a service if the\n         * predicate matches a given model and service and settings.\n         *\n         * <p>Setting a custom settings predicate is useful for plugins\n         * that should only be applied based on certain smithy-build\n         * configurations.\n         *\n         * @param settingsPredicate Settings predicate.\n         * @return Returns the builder.\n         */\n        public Builder settingsPredicate(SettingsPredicate settingsPredicate) {\n            this.settingsPredicate = Objects.requireNonNull(settingsPredicate);\n            return this;\n        }\n\n        /**\n         * Configures a predicate that applies the plugin to a service if the\n         * predicate matches a given model and service.\n         *\n         * <p>When this method is called, the {@code operationPredicate} is\n         * automatically configured to return false for every operation,\n         * causing the plugin to only apply to services and not to individual\n         * operations.\n         *\n         * <p>By default, a plugin applies globally to a service, which\n         * thereby applies to every operation when the middleware stack is\n         * copied. Setting a custom service predicate is useful for plugins\n         * that should only be applied to specific services or only applied\n         * at the operation level.\n         *\n         * @param servicePredicate Service predicate.\n         * @return Returns the builder.\n         * @see #operationPredicate(OperationPredicate)\n         */\n        public Builder servicePredicate(BiPredicate<Model, ServiceShape> servicePredicate) {\n            this.servicePredicate = Objects.requireNonNull(servicePredicate);\n            operationPredicate = (model, service, operation) -> false;\n            return this;\n        }\n\n        /**\n         * Enables access to the writer for adding imports/dependencies.\n         */\n        public Builder withAdditionalClientParams(Map<String, ClientWriterConsumer> writeAdditionalClientParams) {\n            // enforce consistent sorting during codegen.\n            this.writeAdditionalClientParams = new TreeMap<>(writeAdditionalClientParams);\n            return this;\n        }\n\n        /**\n         * Enables access to the writer for adding imports/dependencies.\n         */\n        public Builder withAdditionalOperationParams(\n            Map<String, CommandWriterConsumer> writeAdditionalOperationParams\n        ) {\n            // enforce consistent sorting during codegen.\n            this.writeAdditionalOperationParams = new TreeMap<>(writeAdditionalOperationParams);\n            return this;\n        }\n\n        /**\n         * Configures various aspects of the builder based on naming conventions\n         * defined by the provided {@link Convention} values.\n         *\n         * <p>If no {@code conventions} are provided, a default value of\n         * {@link Convention#HAS_CONFIG} and {@link Convention#HAS_MIDDLEWARE}\n         * is used.\n         *\n         * @param dependency Dependency to pull the package name and version from.\n         * @param pluginName The name of the plugin that is used when generating\n         *   symbol names for each {@code convention}. (for example, \"Foo\").\n         * @param conventions Conventions to use when configuring the builder.\n         * @return Returns the builder.\n         */\n        public Builder withConventions(SymbolDependency dependency, String pluginName, Convention... conventions) {\n            return withConventions(dependency.getPackageName(), dependency.getVersion(), pluginName, conventions);\n        }\n\n        /**\n         * Configures various aspects of the builder based on naming conventions\n         * defined by the provided {@link Convention} values.\n         *\n         * <p>If no {@code conventions} are provided, a default value of\n         * {@link Convention#HAS_CONFIG} and {@link Convention#HAS_MIDDLEWARE}\n         * is used.\n         *\n         * @param packageName The name of the package to use as an import and\n         *   add as a dependency for each generated symbol\n         *   (for example, \"foo/baz\").\n         * @param version The version number to use in the symbol dependencies.\n         *   (for example, \"1.0.0\").\n         * @param pluginName The name of the plugin that is used when generating\n         *   symbol names for each {@code convention}. (for example, \"Foo\").\n         * @param conventions Conventions to use when configuring the builder.\n         * @return Returns the builder.\n         */\n        public Builder withConventions(\n            String packageName,\n            String version,\n            String pluginName,\n            Convention... conventions\n        ) {\n            pluginName = StringUtils.capitalize(pluginName);\n\n            if (conventions.length == 0) {\n                conventions = Convention.DEFAULT;\n            }\n\n            for (Convention convention : conventions) {\n                switch (convention) {\n                    case HAS_CONFIG:\n                        inputConfig(Convention.createTypeSymbol(packageName, version, pluginName + \"InputConfig\"));\n                        resolvedConfig(\n                            Convention.createTypeSymbol(packageName, version, pluginName + \"ResolvedConfig\")\n                        );\n                        resolveFunction(\n                            Convention.createSymbol(packageName, version, \"resolve\" + pluginName + \"Config\")\n                        );\n                        break;\n                    case HAS_MIDDLEWARE:\n                        pluginFunction(Convention.createSymbol(packageName, version, \"get\" + pluginName + \"Plugin\"));\n                        break;\n                    case HAS_DESTROY:\n                        destroyFunction(Convention.createSymbol(packageName, version, \"destroy\" + pluginName));\n                        break;\n                    default:\n                        throw new UnsupportedOperationException(\"Unexpected switch case: \" + convention);\n                }\n            }\n\n            return this;\n        }\n    }\n\n    /**\n     * Conventions used in {@link Builder#withConventions}.\n     */\n    public enum Convention {\n        /**\n         * Whether or not to generate a configuration Input type, Resolved type,\n         * and resolveConfig function.\n         *\n         * <p>Passing this enum to {@link Builder#withConventions} will cause\n         * the client to resolve configuration using a function named\n         * {@code \"resolve\" + pluginName + \"Config\"} (e.g., \"resolveFooConfig\"),\n         * use an input type named {@code pluginName + \"InputConfig\"}\n         * (e.g., \"FooInputConfig\"), and a resolved type named\n         * {@code pluginName + \"ResolvedConfig\"} (e.g., \"FooResolvedConfig\").\n         *\n         * @see #getInputConfig()\n         * @see #getResolvedConfig()\n         * @see #getResolveFunction()\n         */\n        HAS_CONFIG,\n\n        /**\n         * Whether or not the plugin applies middleware.\n         *\n         * <p>Passing this enum to {@link Builder#withConventions} will\n         * cause matching clients and commands to call a function name\n         * {@code \"get\" + pluginName + \"Plugin\"} to apply middleware\n         * (e.g., \"getFooPlugin\"). The referenced function is expected\n         * to accept a resolved configuration type and return a\n         * TypeScript {@code Pluggable}.\n         *\n         * @see #getPluginFunction()\n         */\n        HAS_MIDDLEWARE,\n\n        /**\n         * Whether or not the plugin has a destroy method.\n         *\n         * <p>Passing this enum to {@code withConventions} will cause matching\n         * clients to invoke a method named {@code \"destroy\" + pluginName}\n         * in the {@code destroy} method of the client (e.g., \"destroyFoo\").\n         * The referenced function is expected to accept the resolved\n         * configuration type of the plugin.\n         *\n         * @see #getDestroyFunction()\n         */\n        HAS_DESTROY;\n\n        private static final Convention[] DEFAULT = {HAS_CONFIG, HAS_MIDDLEWARE};\n\n        private static Symbol createSymbol(String packageName, String version, String name) {\n            return Symbol.builder()\n                .namespace(packageName, \"/\")\n                .name(name)\n                .addDependency(TypeScriptDependency.NORMAL_DEPENDENCY, basePackageName(packageName), version)\n                .build();\n        }\n\n        private static Symbol createTypeSymbol(String packageName, String version, String name) {\n            return Symbol.builder()\n                .namespace(packageName, \"/\")\n                .name(name)\n                .putProperty(\"typeOnly\", true)\n                .addDependency(TypeScriptDependency.NORMAL_DEPENDENCY, basePackageName(packageName), version)\n                .build();\n        }\n\n        /**\n         * Extracts the base npm package name from a potentially submodule-qualified path.\n         * e.g. \"@smithy/core/protocols\" -> \"@smithy/core\"\n         */\n        private static String basePackageName(String packageName) {\n            if (packageName.startsWith(\"@\")) {\n                // Scoped package: @scope/name or @scope/name/submodule\n                int secondSlash = packageName.indexOf('/', packageName.indexOf('/') + 1);\n                if (secondSlash > 0) {\n                    return packageName.substring(0, secondSlash);\n                }\n            }\n            return packageName;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/TypeScriptIntegration.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.SmithyIntegration;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.extensions.ExtensionConfigurationInterface;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n/**\n * Java SPI for customizing TypeScript code generation, registering\n * new protocol code generators, renaming shapes, modifying the model,\n * adding custom code, etc.\n */\n@SmithyUnstableApi\npublic interface TypeScriptIntegration\n    extends SmithyIntegration<TypeScriptSettings, TypeScriptWriter, TypeScriptCodegenContext> {\n    /**\n     * Filters the integration based on {@link TypeScriptSettings}.\n     *\n     * This is annotated as a Smithy Internal API, and may be removed at any point.\n     *\n     * @param settings settings to filter against\n     * @return whether the integration matches the settings or not.\n     */\n    @SmithyInternalApi\n    default boolean matchesSettings(TypeScriptSettings settings) {\n        return true;\n    }\n\n    /**\n     * Gets a list of plugins to apply to the generated client.\n     *\n     * @return Returns the list of RuntimePlugins to apply to the client.\n     */\n    default List<RuntimeClientPlugin> getClientPlugins() {\n        return Collections.emptyList();\n    }\n\n    /**\n     * Mutates in place the loaded list of plugins to apply to the generated client.\n     */\n    default void mutateClientPlugins(List<RuntimeClientPlugin> plugins) {\n        // defaults to no mutation\n    }\n\n    /**\n     * Gets a list of protocol generators to register.\n     *\n     * @return Returns the list of protocol generators to register.\n     */\n    default List<ProtocolGenerator> getProtocolGenerators() {\n        return Collections.emptyList();\n    }\n\n    /**\n     * Adds additional client config interface fields.\n     *\n     * <p>Implementations of this method are expected to add fields to the\n     * \"ClientDefaults\" interface of a generated client. This interface\n     * contains fields that are either statically generated from\n     * a model or are dependent on the runtime that a client is running in.\n     * Implementations are expected to write interface field names and\n     * their type signatures, each followed by a semicolon (;). Any number\n     * of fields can be added, and any {@link Symbol} or\n     * {@link SymbolReference} objects that are written to the writer are\n     * automatically imported, and any of their contained\n     * {@link SymbolDependency} values are automatically added to the\n     * generated {@code package.json} file.\n     *\n     * <p>For example, the following code adds two fields to a client:\n     *\n     * <pre>\n     * {@code\n     * public final class MyIntegration implements TypeScriptIntegration {\n     *     public void addConfigInterfaceFields(\n     *             TypeScriptSettings settings,\n     *             Model model,\n     *             SymbolProvider symbolProvider,\n     *             TypeScriptWriter writer\n     *     ) {\n     *         writer.writeDocs(\"The docs for foo...\");\n     *         writer.write(\"foo?: string;\"); // Note the trailing semicolon!\n     *\n     *         writer.writeDocs(\"The docs for bar...\");\n     *         writer.write(\"bar?: string;\");\n     *     }\n     * }\n     * }</pre>\n     *\n     * @param settings Settings used to generate.\n     * @param model Model to generate from.\n     * @param symbolProvider Symbol provider used for codegen.\n     * @param writer TypeScript writer to write to.\n     */\n    default void addConfigInterfaceFields(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        TypeScriptWriter writer\n    ) {\n        // pass\n    }\n\n    /**\n     * Adds additional runtime-specific or shared client config values.\n     *\n     * <p>Implementations of this method are expected to add values to\n     * a runtime-specific or shared configuration object that is used to\n     * provide values for a \"ClientDefaults\" interface. This method is\n     * invoked for every supported {@link LanguageTarget}. Implementations are\n     * expected to branch on the provided {@code LanguageTarget} and add\n     * the appropriate default values and imports, each followed by a\n     * (,). Any number of key-value pairs can be added, and any {@link Symbol}\n     * or {@link SymbolReference} objects that are written to the writer are\n     * automatically imported, and any of their contained\n     * {@link SymbolDependency} values are automatically added to the\n     * generated {@code package.json} file.\n     *\n     * <p>For example, the following code adds two values for both the\n     * node and browser targets and ignores the SHARED target:\n     *\n     * <pre>\n     * {@code\n     * public final class MyIntegration implements TypeScriptIntegration {\n     *\n     *     private static final Logger LOGGER = Logger.getLogger(MyIntegration.class.getName());\n     *\n     *     public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n     *             TypeScriptSettings settings,\n     *             Model model,\n     *             SymbolProvider symbolProvider,\n     *             LanguageTarget target\n     *     ) {\n     *         // This is a static value that is added to every generated\n     *         // runtimeConfig file.\n     *         Map<String, Consumer<TypeScriptWriter>> config = new HashMap<>();\n     *         config.put(\"foo\", writer -> {\n     *            writer.write(\"some static value\");\n     *         });\n     *\n     *         switch (target) {\n     *             case NODE:\n     *                 config.put(\"bar\", writer -> {\n     *                     writer.write(\"(() => someNodeValue)\"); // Note the parenthesis surrounding arrow functions\n     *                 });\n     *                 break;\n     *             case BROWSER:\n     *                 config.put(\"bar\", writer -> {\n     *                     writer.write(\"someBrowserValue\");\n     *                 });\n     *                 break;\n     *             case SHARED:\n     *                 break;\n     *             default:\n     *                 LOGGER.warn(\"Unknown target: \" + target);\n     *         }\n     *         return config;\n     *     }\n     * }\n     * }</pre>\n     *\n     * <p>The following code adds a value to the runtimeConfig.shared.ts file\n     * so that it used on all platforms. It pulls a trait value from the\n     * service being generated and adds it to the client configuration. Note\n     * that a corresponding entry needs to be added to\n     * {@link #addConfigInterfaceFields} to make TypeScript aware of the\n     * property.\n     *\n     * <pre>\n     * {@code\n     * public final class MyIntegration2 implements TypeScriptIntegration {\n     *     public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n     *             TypeScriptSettings settings,\n     *             Model model,\n     *             SymbolProvider symbolProvider,\n     *             LanguageTarget target\n     *     ) {\n     *         if (target == LanguageTarget.SHARED) {\n     *             return MapUtils.of(\"someTraitValue\", writer -> {\n     *                 String someTraitValue = settings.getModel(model).getTrait(SomeTrait.class)\n     *                             .map(SomeTrait::getValue)\n     *                             .orElse(\"\");\n     *                 writer.write(someTraitValue);\n     *             });\n     *         }\n     *     }\n     * }\n     * }</pre>\n     *\n     * @param settings Settings used to generate.\n     * @param model Model to generate from.\n     * @param symbolProvider Symbol provider used for codegen.\n     * @param target The TypeScript language target.\n     * @return Returns a map of config property name and a consumer function with TypeScriptWriter parameter.\n     */\n    default Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n        TypeScriptSettings settings,\n        Model model,\n        SymbolProvider symbolProvider,\n        LanguageTarget target\n    ) {\n        return Collections.emptyMap();\n    }\n\n    /**\n     * Define a list of client configuration interfaces\n     *\n     * A client configuration interface contains settings that modify a service client.\n     * The client configuration interface enables configuring timeouts, retry strategy, etc for the client.\n     *\n     * Multiple interfaces are used to define the client configuration. For example:\n     *\n     * <pre>{@code\n     * interface ChecksumConfig {\n     *   addChecksumAlgorithm(algo: ChecksumAlgorithm): void;\n     *   checksumAlgorithms(): ChecksumAlgorithm[];\n     * }\n     *\n     * interface RetryConfig {\n     *   setRetryStrategy(algo: RetryStrategy): void;\n     *   retryStrategy(): RetryStrategy;\n     * }\n     *\n     * interface ServiceClientConfiguration extends ChecksumConfig, RetryConfig {\n     * }\n     * }</pre>\n     *\n     * During code-generation, smithy-typescript will aggregate the interfaces and create a single client configuration.\n     *\n     * @return list of client configuration interface\n     */\n    default List<ExtensionConfigurationInterface> getExtensionConfigurationInterfaces(\n        Model model,\n        TypeScriptSettings settings\n    ) {\n        return Collections.emptyList();\n    }\n\n    /**\n     * Allows the customization to write arbitrary preparatory code prior to the returned config object.\n     */\n    @SmithyInternalApi\n    default void prepareCustomizations(\n        TypeScriptWriter writer,\n        LanguageTarget target,\n        TypeScriptSettings settings,\n        Model model\n    ) {\n        return;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/SerdeElisionIndex.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.knowledge;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.KnowledgeIndex;\nimport software.amazon.smithy.model.selector.Selector;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.ToShapeId;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.JsonNameTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.utils.MapUtils;\n\n/**\n * Index of ShapeIds to a boolean indicating whether a shape's serde function\n * may be omitted. If the shape is of a certain type, and has no downstream\n * incompatible shapes or traits that require additional handling, its serde\n * function may be emitted.\n */\npublic class SerdeElisionIndex implements KnowledgeIndex {\n\n    private final Map<ShapeId, Boolean> elisionBinding = new HashMap<>();\n    private final Map<String, ShapeId> mutatingTraits = MapUtils.of(\n        \"jsonName\",\n        JsonNameTrait.ID,\n        \"streaming\",\n        StreamingTrait.ID,\n        \"mediaType\",\n        MediaTypeTrait.ID,\n        \"sparse\",\n        SparseTrait.ID,\n        \"idempotencyToken\",\n        IdempotencyTokenTrait.ID\n    );\n\n    public SerdeElisionIndex(Model model) {\n        for (Shape shape : model.toSet()) {\n            elisionBinding.put(shape.toShapeId(), canBeElided(shape, model));\n        }\n    }\n\n    public static SerdeElisionIndex of(Model model) {\n        return model.getKnowledge(SerdeElisionIndex.class, SerdeElisionIndex::new);\n    }\n\n    public boolean mayElide(ToShapeId id) {\n        return elisionBinding.getOrDefault(id.toShapeId(), false);\n    }\n\n    private boolean canBeElided(Shape shape, Model model) {\n        if (hasIncompatibleTypes(shape, model, 0)) {\n            return false;\n        }\n        return !hasMutatingTraits(shape, model);\n    }\n\n    private boolean hasMutatingTraits(Shape shape, Model model) {\n        for (var entry : mutatingTraits.entrySet()) {\n            if (shape.hasTrait(entry.getValue())) {\n                return true;\n            }\n            if (shape instanceof MemberShape memberShape) {\n                if (model.expectShape(memberShape.getTarget()).hasTrait(entry.getValue())) {\n                    return true;\n                }\n            }\n            Selector selector = Selector.parse(\"[id = '\" + shape.getId() + \"']\" + \" ~> [trait|\" + entry.getKey() + \"]\");\n            if (!selector.select(model).isEmpty()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private boolean hasIncompatibleTypes(Shape shape, Model model, int depth) {\n        if (depth > 10) {\n            return true; // bailout for recursive types.\n        }\n\n        Shape target = shape;\n        if (shape.isMemberShape()) {\n            target = model.expectShape(shape.asMemberShape().get().getTarget());\n        }\n\n        switch (target.getType()) {\n            case LIST:\n                return hasIncompatibleTypes(target.asListShape().get().getMember(), model, depth + 1);\n            case SET:\n                return hasIncompatibleTypes(target.asSetShape().get().getMember(), model, depth + 1);\n            case STRUCTURE:\n                return target\n                    .asStructureShape()\n                    .get()\n                    .getAllMembers()\n                    .values()\n                    .stream()\n                    .anyMatch(s -> hasIncompatibleTypes(s, model, depth + 1));\n            case UNION:\n                return target\n                    .asUnionShape()\n                    .get()\n                    .getAllMembers()\n                    .values()\n                    .stream()\n                    .anyMatch(s -> hasIncompatibleTypes(s, model, depth + 1));\n            case MAP:\n                return hasIncompatibleTypes(\n                    model.getShape(target.asMapShape().get().getValue().getTarget()).get(),\n                    model,\n                    depth + 1\n                );\n            case BIG_DECIMAL:\n            case BIG_INTEGER:\n            case BLOB:\n            case DOCUMENT:\n            case TIMESTAMP:\n            case DOUBLE: // possible call to parseFloatString or serializeFloat.\n            case FLOAT: // possible call to parseFloatString or serializeFloat.\n                // types that generate parsers.\n                return true;\n            case MEMBER:\n            case OPERATION:\n            case RESOURCE:\n            case SERVICE:\n                // non-applicable types.\n                return false;\n            case BOOLEAN:\n            case BYTE:\n            case ENUM:\n            case INTEGER:\n            case INT_ENUM:\n            case LONG:\n            case SHORT:\n            case STRING:\n            default:\n                // compatible types with no special parser.\n                return false;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.knowledge;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.Objects;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.codegen.core.ReservedWords;\nimport software.amazon.smithy.codegen.core.ReservedWordsBuilder;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.KnowledgeIndex;\nimport software.amazon.smithy.model.knowledge.TopDownIndex;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.EnumTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.PaginatedTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;\nimport software.amazon.smithy.typescript.codegen.schema.SchemaReferenceIndex;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\nimport software.amazon.smithy.utils.SmithyInternalApi;\nimport software.amazon.smithy.waiters.WaitableTrait;\n\n/**\n * Retrieves shapes in the service operation closure.\n */\n@SmithyInternalApi\npublic final class ServiceClosure implements KnowledgeIndex {\n\n    public static final ReservedWords RESERVED_WORDS = new ReservedWordsBuilder()\n        .loadWords(Objects.requireNonNull(TypeScriptClientCodegenPlugin.class.getResource(\"reserved-words.txt\")))\n        .build();\n    private static final ShapeId UNIT = ShapeId.from(\"smithy.api#Unit\");\n    private final Model model;\n    private final ServiceShape service;\n\n    private final SchemaReferenceIndex elision;\n\n    /**\n     * For API testing & schemas.\n     */\n    private final TreeSet<OperationShape> operations = new TreeSet<>();\n    private final TreeSet<OperationShape> paginatedOperations = new TreeSet<>();\n    private final TreeSet<OperationShape> waitableOperations = new TreeSet<>();\n\n    /**\n     * Note: also contains unions.\n     * For API testing.\n     */\n    private final TreeSet<Shape> structuralInterfaces = new TreeSet<>();\n    /**\n     * For API testing.\n     */\n    private final TreeSet<Shape> errors = new TreeSet<>();\n    /**\n     * For API testing.\n     */\n    private final TreeSet<Shape> enums = new TreeSet<>();\n\n    /**\n     * For schemas.\n     */\n    private final TreeSet<StructureShape> structureShapes = new TreeSet<>();\n    /**\n     * For schemas.\n     */\n    private final TreeSet<CollectionShape> collectionShapes = new TreeSet<>();\n    /**\n     * For schemas.\n     */\n    private final TreeSet<MapShape> mapShapes = new TreeSet<>();\n    /**\n     * For schemas.\n     */\n    private final TreeSet<UnionShape> unionShapes = new TreeSet<>();\n    /**\n     * For schemas.\n     */\n    private final TreeSet<Shape> simpleShapes = new TreeSet<>();\n    /**\n     * Used to deconflict schema variable names.\n     * Iteration determinism is desired (ordered set).\n     */\n    private final TreeSet<Shape> existsAsSchema = new TreeSet<>();\n    /**\n     * For schemas.\n     */\n    private final Set<Shape> requiresNamingDeconfliction = new HashSet<>();\n\n    /**\n     * Used temporarily during initial traversal.\n     */\n    private final Set<ShapeId> scanned = new HashSet<>();\n\n    private ServiceClosure(Model model, ServiceShape service) {\n        this.model = model;\n        this.service = service;\n        elision = SchemaReferenceIndex.of(model);\n        TopDownIndex topDown = TopDownIndex.of(model);\n        Set<OperationShape> containedOperations = topDown.getContainedOperations(service);\n        operations.addAll(containedOperations);\n        scan(containedOperations);\n        scan(service);\n        scanned.clear();\n        deconflictSchemaVarNames();\n    }\n\n    public static ServiceClosure of(Model model, ServiceShape service) {\n        return model.getKnowledge(ServiceClosure.class, (Model m) -> new ServiceClosure(m, service));\n    }\n\n    public TreeSet<Shape> getStructuralNonErrorShapes() {\n        return structuralInterfaces;\n    }\n\n    public TreeSet<Shape> getErrorShapes() {\n        return errors;\n    }\n\n    public TreeSet<Shape> getEnums() {\n        return enums;\n    }\n\n    public TreeSet<String> getWaiterNames() {\n        TreeSet<String> waiters = new TreeSet<>();\n        for (OperationShape operation : getWaitableOperationShapes()) {\n            operation\n                .getTrait(WaitableTrait.class)\n                .ifPresent(trait -> {\n                    trait\n                        .getWaiters()\n                        .forEach((waiterName, waiter) -> {\n                            waiters.add(\"waitFor\" + waiterName);\n                            waiters.add(\"waitUntil\" + waiterName);\n                        });\n                });\n        }\n        return waiters;\n    }\n\n    public TreeSet<String> getPaginatorNames() {\n        TreeSet<String> paginators = new TreeSet<>();\n        for (OperationShape operation : getPaginatedOperationShapes()) {\n            operation\n                .getTrait(PaginatedTrait.class)\n                .ifPresent(trait -> {\n                    paginators.add(\"paginate\" + operation.getId().getName());\n                });\n        }\n        return paginators;\n    }\n\n    public Set<Shape> getRequiresNamingDeconfliction() {\n        return requiresNamingDeconfliction;\n    }\n\n    public TreeSet<Shape> getSimpleShapes() {\n        return simpleShapes;\n    }\n\n    public TreeSet<StructureShape> getStructureShapes() {\n        return structureShapes;\n    }\n\n    public TreeSet<UnionShape> getUnionShapes() {\n        return unionShapes;\n    }\n\n    public TreeSet<MapShape> getMapShapes() {\n        return mapShapes;\n    }\n\n    public TreeSet<CollectionShape> getCollectionShapes() {\n        return collectionShapes;\n    }\n\n    public TreeSet<OperationShape> getOperationShapes() {\n        return operations;\n    }\n\n    public TreeSet<OperationShape> getPaginatedOperationShapes() {\n        return paginatedOperations;\n    }\n\n    public TreeSet<OperationShape> getWaitableOperationShapes() {\n        return waitableOperations;\n    }\n\n    /**\n     * @return variable name of the shape's schema, with deconfliction for multiple namespaces with the same\n     * unqualified name.\n     */\n    public String getShapeSchemaVariableName(Shape shape, StringStore store) {\n        if (shape.getId().equals(ShapeId.from(\"smithy.api#Unit\"))) {\n            return \"__Unit\";\n        }\n        String symbolName = RESERVED_WORDS.escape(shape.getId().getName());\n        if (getRequiresNamingDeconfliction().contains(shape)) {\n            if (null == store) {\n                throw new RuntimeException(\n                    \"getShapeSchemaVariableName must be called with a StringStore because the shape \" +\n                        shape.getId().getName() +\n                        \"requires naming deconfliction.\"\n                );\n            }\n            symbolName += \"_\" + store.var(shape.getId().getNamespace(), \"n\");\n        }\n        /*\n         * Although exporting a type and value with the same name is allowed by TS, we\n         * do not want to do this because the structure's interface is not that\n         * of the schema object.\n         *\n         * The name transform deconflicts the interface and structure variable names.\n         * for export at the top level of the same package.\n         */\n        String suffix = \"\";\n        if (shape.isStructureShape() || shape.isUnionShape() || shape.isOperationShape()) {\n            suffix = \"$\";\n        }\n        return symbolName + suffix;\n    }\n\n    /**\n     * This is the existing definition migrated from StructuredMemberWriter, which\n     * writes e.g. `member?: Type | undefined` vs. `member: Type | undefined`, the canonical\n     * client-side modeled optionality.\n     * This differs from the structure member optionality specification in\n     * <a href=\"https://smithy.io/2.0/spec/aggregate-types.html#structure-member-optionality\">spec point 3.3.3</a>\n     */\n    public boolean isMemberRequiredInClient(MemberShape member) {\n        // Currently the client only generates a default for idempotency tokens.\n        // No default is generated for values with a default value trait.\n        boolean clientGeneratesValue = member.hasTrait(IdempotencyTokenTrait.class);\n        return member.isRequired() && !clientGeneratesValue;\n    }\n\n    /**\n     * Since we use the short names for schema objects, in rare cases there may be a\n     * naming conflict due to shapes with the same short name in different namespaces.\n     * These shapes will have their variable names deconflicted with a suffix.\n     */\n    private void deconflictSchemaVarNames() {\n        Set<String> observedShapeNames = new HashSet<>();\n        for (Shape shape : existsAsSchema) {\n            if (observedShapeNames.contains(shape.getId().getName())) {\n                requiresNamingDeconfliction.add(shape);\n            } else {\n                observedShapeNames.add(shape.getId().getName());\n            }\n        }\n    }\n\n    private void scan(Shape shape) {\n        scan(Collections.singletonList(shape));\n    }\n\n    private void scan(Set<OperationShape> shapes) {\n        scan(new ArrayList<>(shapes));\n    }\n\n    private void scan(Collection<Shape> shapes) {\n        for (Shape shape : shapes) {\n            if (scanned.contains(shape.getId())) {\n                continue;\n            }\n            scanned.add(shape.getId());\n\n            if (shape.isMemberShape()) {\n                MemberShape memberShape = (MemberShape) shape;\n                shape = model.expectShape(memberShape.getTarget());\n            }\n\n            switch (shape.getType()) {\n                case LIST -> {\n                    ListShape listShape = (ListShape) shape;\n                    collectionShapes.add(listShape);\n                    existsAsSchema.add(listShape);\n                    scan(listShape.getMember());\n                }\n                case SET -> {\n                    var setShape = shape.asSetShape().get();\n                    collectionShapes.add(setShape);\n                    existsAsSchema.add(setShape);\n                    scan(setShape.getMember());\n                }\n                case MAP -> {\n                    MapShape mapShape = (MapShape) shape;\n                    mapShapes.add(mapShape);\n                    existsAsSchema.add(mapShape);\n                    scan(mapShape.getKey());\n                    scan(mapShape.getValue());\n                }\n                case STRUCTURE, UNION -> {\n                    if (shape.isStructureShape()) {\n                        structureShapes.add(shape.asStructureShape().get());\n                    } else if (shape.isUnionShape()) {\n                        unionShapes.add(shape.asUnionShape().get());\n                    }\n                    existsAsSchema.add(shape);\n\n                    if (shape.hasTrait(ErrorTrait.class)) {\n                        errors.add(shape);\n                    } else if (!shape.getId().equals(UNIT)) {\n                        structuralInterfaces.add(shape);\n                    }\n\n                    if (shape instanceof StructureShape structureShape) {\n                        structureShape.getAllMembers().values().forEach(this::scan);\n                    } else if (shape instanceof UnionShape unionShape) {\n                        unionShape.getAllMembers().values().forEach(this::scan);\n                    }\n                }\n                case OPERATION -> {\n                    OperationShape operation = (OperationShape) shape;\n                    if (operation.hasTrait(WaitableTrait.ID)) {\n                        waitableOperations.add(operation);\n                    }\n                    if (operation.hasTrait(PaginatedTrait.ID)) {\n                        paginatedOperations.add(operation);\n                    }\n                    if (operation.getInput().isPresent()) {\n                        scan(model.expectShape(operation.getInputShape()));\n                    } else {\n                        scan(model.expectShape(UNIT));\n                    }\n                    if (operation.getOutput().isPresent()) {\n                        scan(model.expectShape(operation.getOutputShape()));\n                    } else {\n                        scan(model.expectShape(UNIT));\n                    }\n                    operation\n                        .getErrors(service)\n                        .forEach(error -> {\n                            scan(model.expectShape(error));\n                        });\n                    operations.add(operation);\n                    existsAsSchema.add(operation);\n                }\n                case SERVICE -> {\n                    ServiceShape serviceShape = (ServiceShape) shape;\n                    serviceShape\n                        .getErrorsSet()\n                        .forEach(errorShapeId -> {\n                            Shape errorShape = model.expectShape(errorShapeId);\n                            scan(errorShape);\n                        });\n                }\n                case\n                    BYTE,\n                    INT_ENUM,\n                    SHORT,\n                    INTEGER,\n                    LONG,\n                    FLOAT,\n                    DOUBLE,\n                    BIG_INTEGER,\n                    BIG_DECIMAL,\n                    BOOLEAN,\n                    STRING,\n                    TIMESTAMP,\n                    DOCUMENT,\n                    ENUM,\n                    BLOB -> {\n                    if (shape.isEnumShape() || shape.isIntEnumShape() || shape.hasTrait(EnumTrait.class)) {\n                        enums.add(shape);\n                    }\n\n                    if (elision.traits.hasSchemaTraits(shape)) {\n                        existsAsSchema.add(shape);\n                    }\n                    simpleShapes.add(shape);\n                }\n                default -> {\n                    // ...\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/AddProtocols.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols;\n\nimport java.util.List;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.typescript.codegen.protocols.cbor.SmithyRpcV2Cbor;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds Smithy protocols.\n */\n@SmithyInternalApi\npublic class AddProtocols implements TypeScriptIntegration {\n\n    @Override\n    public List<ProtocolGenerator> getProtocolGenerators() {\n        return ListUtils.of(new SmithyRpcV2Cbor());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/ProtocolPriorityConfig.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\nimport software.amazon.smithy.model.shapes.ShapeId;\n\n/**\n * Allows customization of protocol selection for specific services or a global default ordering.\n */\npublic final class ProtocolPriorityConfig {\n\n    private final Map<ShapeId, List<ShapeId>> serviceProtocolPriorityCustomizations;\n    private final List<ShapeId> customDefaultPriority;\n\n    public ProtocolPriorityConfig(\n        Map<ShapeId, List<ShapeId>> serviceProtocolPriorityCustomizations,\n        List<ShapeId> customDefaultPriority\n    ) {\n        this.serviceProtocolPriorityCustomizations = Objects.requireNonNullElseGet(\n            serviceProtocolPriorityCustomizations,\n            HashMap::new\n        );\n        this.customDefaultPriority = customDefaultPriority;\n    }\n\n    /**\n     * @param serviceShapeId - service scope.\n     * @return priority order of protocols or null if no override exists.\n     */\n    public List<ShapeId> getProtocolPriority(ShapeId serviceShapeId) {\n        return serviceProtocolPriorityCustomizations.getOrDefault(\n            serviceShapeId,\n            customDefaultPriority != null ? new ArrayList<>(customDefaultPriority) : null\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/SmithyProtocolUtils.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols;\n\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.model.knowledge.NeighborProviderIndex;\nimport software.amazon.smithy.model.neighbor.Walker;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeVisitor;\nimport software.amazon.smithy.protocoltests.traits.HttpMalformedRequestTestCase;\nimport software.amazon.smithy.protocoltests.traits.HttpMessageTestCase;\nimport software.amazon.smithy.typescript.codegen.HttpProtocolTestGenerator;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Utility methods for generating Smithy protocols.\n */\n@SmithyInternalApi\npublic final class SmithyProtocolUtils {\n\n    private SmithyProtocolUtils() {}\n\n    /**\n     * Writes a serde function for a set of shapes using the passed visitor.\n     * This will walk the input set of shapes and invoke the visitor for any\n     * members of aggregate shapes in the set.\n     *\n     * @see software.amazon.smithy.typescript.codegen.integration.DocumentShapeSerVisitor\n     * @see software.amazon.smithy.typescript.codegen.integration.DocumentShapeDeserVisitor\n     *\n     * @param context The generation context.\n     * @param shapes A list of shapes to generate serde for, including their members.\n     * @param visitor A ShapeVisitor that generates a serde function for shapes.\n     */\n    public static void generateDocumentBodyShapeSerde(\n        ProtocolGenerator.GenerationContext context,\n        Set<Shape> shapes,\n        ShapeVisitor<Void> visitor\n    ) {\n        Walker shapeWalker = new Walker(NeighborProviderIndex.of(context.getModel()).getProvider());\n        Set<Shape> shapesToGenerate = new TreeSet<>(shapes);\n        shapes.forEach(shape -> shapesToGenerate.addAll(shapeWalker.walkShapes(shape)));\n        shapesToGenerate.forEach(shape -> shape.accept(visitor));\n    }\n\n    public static void generateProtocolTests(ProtocolGenerator generator, ProtocolGenerator.GenerationContext context) {\n        new HttpProtocolTestGenerator(\n            context,\n            generator,\n            SmithyProtocolUtils::filterProtocolTests,\n            SmithyProtocolUtils::filterMalformedRequestTests\n        ).run();\n    }\n\n    private static boolean filterProtocolTests(\n        ServiceShape service,\n        OperationShape operation,\n        HttpMessageTestCase testCase,\n        TypeScriptSettings settings\n    ) {\n        if (testCase.getTags().contains(\"defaults\")) {\n            return true;\n        }\n\n        // TODO(cbor): enable test when it's working with vitest 3.x\n        if (\n            settings.generateSchemas() &&\n                (testCase.getId().equals(\"RpcV2CborInvalidGreetingError\") ||\n                    testCase.getId().equals(\"RpcV2CborComplexError\")\n                    ||\n                    testCase.getId().equals(\"RpcV2CborEmptyComplexError\"))\n        ) {\n            return true;\n        }\n\n        return false;\n    }\n\n    private static boolean filterMalformedRequestTests(\n        ServiceShape service,\n        OperationShape operation,\n        HttpMalformedRequestTestCase testCase,\n        TypeScriptSettings settings\n    ) {\n        // Handling overflow/underflow of longs in JS is extraordinarily tricky.\n        // Numbers are actually all 62-bit floats, and so any integral number is\n        // limited to 53 bits. In typical JS fashion, a value outside of this\n        // range just kinda silently bumbles on in some third state between valid\n        // and invalid. Infuriatingly, there doesn't seem to be a consistent way\n        // to detect this. We could *try* to do bounds checking, but the constants\n        // we use wouldn't necessarily work, so it could work in some environments\n        // but not others.\n        if (operation.getId().getName().equals(\"MalformedLong\") && testCase.hasTag(\"underflow/overflow\")) {\n            return true;\n        }\n\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborMemberDeserVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport software.amazon.smithy.model.knowledge.HttpBinding;\nimport software.amazon.smithy.model.shapes.BigDecimalShape;\nimport software.amazon.smithy.model.shapes.BigIntegerShape;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.integration.DocumentMemberDeserVisitor;\nimport software.amazon.smithy.typescript.codegen.integration.HttpProtocolGeneratorUtils;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\n\npublic class CborMemberDeserVisitor extends DocumentMemberDeserVisitor {\n\n    private final String dataSource;\n    private final ProtocolGenerator.GenerationContext context;\n\n    /**\n     * Constructor.\n     *\n     * @param context                The generation context.\n     * @param dataSource             The in-code location of the data to provide an output of\n     *                               ({@code output.foo}, {@code entry}, etc.)\n     */\n    public CborMemberDeserVisitor(ProtocolGenerator.GenerationContext context, String dataSource) {\n        super(context, dataSource, TimestampFormatTrait.Format.EPOCH_SECONDS);\n        this.context = context;\n        context.getWriter()\n            .addImportSubmodule(\"_json\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        this.serdeElisionEnabled = !context.getSettings().generateServerSdk();\n        this.dataSource = dataSource;\n    }\n\n    /**\n     * This differs from the base method in that CBOR does not need to wrap\n     * the blob value in `context.base64Decoder(...)`. The CBOR format deserializer\n     * already does this whereas e.g. JSON.parse does not.\n     */\n    @Override\n    public String blobShape(BlobShape shape) {\n        return dataSource;\n    }\n\n    /**\n     * Converted to bigint by the cbor codec.\n     */\n    @Override\n    public String bigIntegerShape(BigIntegerShape shape) {\n        if (context.getSettings().getBigNumberMode().equals(\"big.js\")) {\n            context.getWriter().addImport(\"Big\", \"__Big\", TypeScriptDependency.BIG_JS);\n            return \"__Big(String(\" + dataSource + \"))\";\n        }\n        return dataSource;\n    }\n\n    /**\n     * Converted to NumericValue by the cbor codec.\n     */\n    @Override\n    public String bigDecimalShape(BigDecimalShape shape) {\n        if (context.getSettings().getBigNumberMode().equals(\"big.js\")) {\n            context.getWriter().addImport(\"Big\", \"__Big\", TypeScriptDependency.BIG_JS);\n            return \"__Big(String(\" + dataSource + \"))\";\n        }\n        return dataSource;\n    }\n\n    /**\n     * Smithy RPCv2 CBOR only allows the epoch-seconds format, ignoring the model's\n     * timestamp trait.\n     */\n    @Override\n    public String timestampShape(TimestampShape shape) {\n        return HttpProtocolGeneratorUtils.getTimestampOutputParam(\n            context.getWriter(),\n            dataSource,\n            HttpBinding.Location.DOCUMENT,\n            shape,\n            TimestampFormatTrait.Format.EPOCH_SECONDS,\n            requiresNumericEpochSecondsInPayload(),\n            context.getSettings().generateClient()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborMemberSerVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport software.amazon.smithy.model.shapes.BigDecimalShape;\nimport software.amazon.smithy.model.shapes.BigIntegerShape;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.integration.DocumentMemberSerVisitor;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\n\npublic class CborMemberSerVisitor extends DocumentMemberSerVisitor {\n\n    private final String dataSource;\n    private final ProtocolGenerator.GenerationContext context;\n\n    /**\n     * Constructor.\n     *\n     * @param context                The generation context.\n     * @param dataSource             The in-code location of the data to provide an input of\n     *                               ({@code input.foo}, {@code entry}, etc.)\n     */\n    public CborMemberSerVisitor(ProtocolGenerator.GenerationContext context, String dataSource) {\n        super(context, dataSource, TimestampFormatTrait.Format.EPOCH_SECONDS);\n        this.context = context;\n        this.serdeElisionEnabled = true;\n        this.dataSource = dataSource;\n    }\n\n    /**\n     * This differs from the base method in that CBOR does not need to wrap\n     * the blob value in `context.base64Encoder(...)`. The CBOR format serializer\n     * already does this whereas e.g. JSON.stringify does not.\n     */\n    @Override\n    public String blobShape(BlobShape shape) {\n        return dataSource;\n    }\n\n    /**\n     * +/- Infinity and NaN have byte representations. No need to\n     * serialize those values with serializeFloat().\n     */\n    @Override\n    public String floatShape(FloatShape shape) {\n        return dataSource;\n    }\n\n    /**\n     * +/- Infinity and NaN have byte representations. No need to\n     * serialize those values with serializeFloat().\n     */\n    @Override\n    public String doubleShape(DoubleShape shape) {\n        return dataSource;\n    }\n\n    /**\n     * Use bigint from JS.\n     */\n    @Override\n    public String bigIntegerShape(BigIntegerShape shape) {\n        if (context.getSettings().getBigNumberMode().equals(\"big.js\")) {\n            return \"BigInt(\" + dataSource + \")\";\n        }\n        return dataSource;\n    }\n\n    /**\n     * Use NumericValue from \\@smithy/core/serde.\n     */\n    @Override\n    public String bigDecimalShape(BigDecimalShape shape) {\n        context.getWriter().addImportSubmodule(\"nv\", \"__nv\", TypeScriptDependency.SMITHY_CORE, \"/serde\");\n        return \"__nv(\" + dataSource + \")\";\n    }\n\n    /**\n     * CBOR serialization needs a JS object identifiable as a tag.\n     */\n    @Override\n    public String timestampShape(TimestampShape shape) {\n        context\n            .getWriter()\n            .addImportSubmodule(\n                \"dateToTag\",\n                \"__dateToTag\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CBOR\n            );\n        return \"__dateToTag(\" + dataSource + \")\";\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeDeserVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport java.util.Map;\nimport java.util.TreeMap;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.NumberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.DocumentShapeDeserVisitor;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.util.PropertyAccessor;\nimport software.amazon.smithy.typescript.codegen.validation.UnaryFunctionCall;\n\npublic class CborShapeDeserVisitor extends DocumentShapeDeserVisitor {\n\n    public CborShapeDeserVisitor(ProtocolGenerator.GenerationContext context) {\n        super(context);\n        this.serdeElisionEnabled = true;\n    }\n\n    @Override\n    protected void deserializeCollection(ProtocolGenerator.GenerationContext context, CollectionShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        Shape target = context.getModel().expectShape(shape.getMember().getTarget());\n\n        String potentialFilter = \"\";\n        if (!shape.hasTrait(SparseTrait.ID)) {\n            potentialFilter = \".filter((e: any) => e != null)\";\n        }\n        final String filterExpression = potentialFilter;\n\n        String returnExpression = target.accept(getMemberVisitor(\"entry\"));\n\n        if (returnExpression.equals(\"entry\")) {\n            writer.write(\"const collection = (output || [])$L\", filterExpression);\n        } else {\n            writer.openBlock(\n                \"const collection = (output || [])$L.map((entry: any) => {\",\n                \"});\",\n                filterExpression,\n                () -> {\n                    if (filterExpression.isEmpty()) {\n                        writer.openBlock(\"if (entry === null) {\", \"}\", () -> {\n                            if (!shape.hasTrait(SparseTrait.ID)) {\n                                writer.write(\n                                    \"throw new TypeError('All elements of the non-sparse list $S must be non-null.');\",\n                                    shape.getId()\n                                );\n                            } else {\n                                writer.write(\"return null as any;\");\n                            }\n                        });\n                    }\n\n                    writer.write(\n                        \"return $L$L;\",\n                        target.accept(getMemberVisitor(\"entry\")),\n                        usesExpect(target) ? \" as any\" : \"\"\n                    );\n                }\n            );\n        }\n\n        writer.write(\"return collection;\");\n    }\n\n    @Override\n    protected void deserializeDocument(ProtocolGenerator.GenerationContext context, DocumentShape shape) {\n        context\n            .getWriter()\n            .write(\n                \"\"\"\n                return output; // document.\n                \"\"\"\n            );\n    }\n\n    @Override\n    protected void deserializeMap(ProtocolGenerator.GenerationContext context, MapShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        Shape target = context.getModel().expectShape(shape.getValue().getTarget());\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        writer.openBlock(\n            \"return Object.entries(output).reduce((acc: $T, [key, value]: [string, any]) => {\",\n            \"\",\n            symbolProvider.toSymbol(shape),\n            () -> {\n                writer.openBlock(\"if (value !== null) {\", \"}\", () -> {\n                    writer.write(\n                        \"acc[key as $T] = $L$L\",\n                        symbolProvider.toSymbol(shape.getKey()),\n                        target.accept(getMemberVisitor(\"value\")),\n                        usesExpect(target) ? \" as any;\" : \";\"\n                    );\n                });\n\n                if (shape.hasTrait(SparseTrait.ID)) {\n                    writer.write(\"else {\").indent();\n                    writer.write(\"acc[key as $T] = null as any;\", symbolProvider.toSymbol(shape.getKey())).dedent();\n                    writer.write(\"}\");\n                }\n\n                writer.write(\"return acc;\");\n            }\n        );\n        writer.writeInline(\"}, {} as $T);\", symbolProvider.toSymbol(shape));\n    }\n\n    @Override\n    protected void deserializeStructure(ProtocolGenerator.GenerationContext context, StructureShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n\n        Map<String, MemberShape> members = new TreeMap<>(shape.getAllMembers());\n        writer.addImportSubmodule(\"take\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        writer.openBlock(\"return take(output, {\", \"}) as any;\", () -> {\n            members.forEach((memberName, memberShape) -> {\n                Shape target = context.getModel().expectShape(memberShape.getTarget());\n\n                String propertyAccess = PropertyAccessor.getFrom(\"output\", memberName);\n                String value = target.accept(getMemberVisitor(\"_\"));\n\n                if (usesExpect(target)) {\n                    if (UnaryFunctionCall.check(value)) {\n                        writer.write(\"'$L': $L,\", memberName, UnaryFunctionCall.toRef(value));\n                    } else {\n                        writer.write(\"'$L': $L,\", memberName, \"_ => \" + value);\n                    }\n                } else {\n                    String valueExpression = target.accept(getMemberVisitor(propertyAccess));\n\n                    if (valueExpression.equals(propertyAccess)) {\n                        writer.write(\"'$1L': [],\", memberName);\n                    } else {\n                        String functionExpression = value;\n                        boolean isUnaryCall = UnaryFunctionCall.check(functionExpression);\n                        if (isUnaryCall) {\n                            writer.write(\"'$1L': $2L,\", memberName, UnaryFunctionCall.toRef(functionExpression));\n                        } else {\n                            writer.write(\"'$1L': (_: any) => $2L,\", memberName, functionExpression);\n                        }\n                    }\n                }\n            });\n        });\n    }\n\n    @Override\n    protected void deserializeUnion(ProtocolGenerator.GenerationContext context, UnionShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        Model model = context.getModel();\n\n        Map<String, MemberShape> members = new TreeMap<>(shape.getAllMembers());\n\n        members.forEach((memberName, memberShape) -> {\n            Shape target = model.expectShape(memberShape.getTarget());\n\n            String memberValue = target.accept(getMemberVisitor(PropertyAccessor.getFrom(\"output\", memberName)));\n\n            if (usesExpect(target)) {\n                writer.openBlock(\"if ($L !== undefined) {\", \"}\", memberValue, () -> {\n                    writer.write(\"return { $L: $L as any }\", memberName, memberValue);\n                });\n            } else {\n                writer.openBlock(\"if ($1L != null) {\", \"}\", PropertyAccessor.getFrom(\"output\", memberName), () -> {\n                    writer.write(\n                        \"\"\"\n                        return {\n                          $L: $L\n                        }\n                        \"\"\",\n                        memberName,\n                        memberValue\n                    );\n                });\n            }\n        });\n        writer.write(\"return { $$unknown: Object.entries(output)[0] };\");\n    }\n\n    private CborMemberDeserVisitor getMemberVisitor(String dataSource) {\n        return new CborMemberDeserVisitor(getContext(), dataSource);\n    }\n\n    private boolean usesExpect(Shape shape) {\n        return (shape.isStringShape() ||\n            shape.isBooleanShape()\n            ||\n            (shape instanceof NumberShape && !shape.isBigDecimalShape() && !shape.isBigIntegerShape()));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeSerVisitor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport java.util.Map;\nimport java.util.TreeMap;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.DocumentMemberSerVisitor;\nimport software.amazon.smithy.typescript.codegen.integration.DocumentShapeSerVisitor;\nimport software.amazon.smithy.typescript.codegen.integration.HttpProtocolGeneratorUtils;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.validation.UnaryFunctionCall;\n\npublic class CborShapeSerVisitor extends DocumentShapeSerVisitor {\n\n    /**\n     * The service model's timestampFormat is ignored in RPCv2 CBOR protocol.\n     */\n    private static final TimestampFormatTrait.Format TIMESTAMP_FORMAT = TimestampFormatTrait.Format.EPOCH_SECONDS;\n\n    public CborShapeSerVisitor(ProtocolGenerator.GenerationContext context) {\n        super(context);\n        this.serdeElisionEnabled = true;\n    }\n\n    @Override\n    protected void serializeCollection(ProtocolGenerator.GenerationContext context, CollectionShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        Shape target = context.getModel().expectShape(shape.getMember().getTarget());\n\n        String potentialFilter = \"\";\n        boolean hasSparseTrait = shape.hasTrait(SparseTrait.ID);\n        if (!hasSparseTrait) {\n            potentialFilter = \".filter((e: any) => e != null)\";\n        }\n\n        String returnedExpression = target.accept(getMemberVisitor(\"entry\"));\n\n        if (returnedExpression.equals(\"entry\")) {\n            writer.write(\"return input$L;\", potentialFilter);\n        } else {\n            writer.openBlock(\"return input$L.map(entry => {\", \"});\", potentialFilter, () -> {\n                if (hasSparseTrait) {\n                    writer.write(\"if (entry === null) { return null as any; }\");\n                }\n                writer.write(\"return $L;\", target.accept(getMemberVisitor(\"entry\")));\n            });\n        }\n    }\n\n    @Override\n    protected void serializeDocument(ProtocolGenerator.GenerationContext context, DocumentShape shape) {\n        context\n            .getWriter()\n            .write(\n                \"\"\"\n                return input; // document.\n                \"\"\"\n            );\n    }\n\n    @Override\n    protected void serializeMap(ProtocolGenerator.GenerationContext context, MapShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        Shape target = context.getModel().expectShape(shape.getValue().getTarget());\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n\n        Symbol keySymbol = symbolProvider.toSymbol(shape.getKey());\n        String entryKeyType = keySymbol.toString().equals(\"string\")\n            ? \"string\"\n            : symbolProvider.toSymbol(shape.getKey()) + \"| string\";\n\n        writer.openBlock(\n            \"return Object.entries(input).reduce((acc: Record<string, any>, \" + \"[key, value]: [$1L, any]) => {\",\n            \"}, {});\",\n            entryKeyType,\n            () -> {\n                writer.write(\n                    \"\"\"\n                    if (value !== null) {\n                        acc[key] = $L;\n                    }\n                    \"\"\",\n                    target.accept(getMemberVisitor(\"value\"))\n                );\n\n                if (shape.hasTrait(SparseTrait.ID)) {\n                    writer.write(\n                        \"\"\"\n                        else {\n                            acc[key] = null as any;\n                        }\n                        \"\"\"\n                    );\n                }\n\n                writer.write(\"return acc;\");\n            }\n        );\n    }\n\n    @Override\n    protected void serializeStructure(ProtocolGenerator.GenerationContext context, StructureShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.addImportSubmodule(\"take\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        writer.openBlock(\"return take(input, {\", \"});\", () -> {\n            Map<String, MemberShape> members = new TreeMap<>(shape.getAllMembers());\n            members.forEach((memberName, memberShape) -> {\n                Shape target = context.getModel().expectShape(memberShape.getTarget());\n\n                String valueExpression = (memberShape.hasTrait(TimestampFormatTrait.class)\n                    ? HttpProtocolGeneratorUtils.getTimestampInputParam(context, \"_\", memberShape, TIMESTAMP_FORMAT)\n                    : target.accept(getMemberVisitor(\"_\")));\n\n                String valueProvider = \"_ => \" + valueExpression;\n                boolean isUnaryCall = UnaryFunctionCall.check(valueExpression);\n\n                if (memberShape.hasTrait(IdempotencyTokenTrait.class)) {\n                    writer.addImportSubmodule(\n                        \"v4\",\n                        \"generateIdempotencyToken\",\n                        TypeScriptDependency.SMITHY_CORE,\n                        SmithyCoreSubmodules.SERDE\n                    );\n                    writer.write(\"'$L': [true, _ => _ ?? generateIdempotencyToken()],\", memberName);\n                } else {\n                    if (valueProvider.equals(\"_ => _\")) {\n                        writer.write(\"'$1L': [],\", memberName);\n                    } else if (isUnaryCall) {\n                        writer.write(\"'$1L': $2L,\", memberName, UnaryFunctionCall.toRef(valueExpression));\n                    } else {\n                        writer.write(\"'$1L': $2L,\", memberName, valueProvider);\n                    }\n                }\n            });\n        });\n    }\n\n    @Override\n    protected void serializeUnion(ProtocolGenerator.GenerationContext context, UnionShape shape) {\n        TypeScriptWriter writer = context.getWriter();\n        Model model = context.getModel();\n        ServiceShape serviceShape = context.getService();\n\n        writer.openBlock(\"return $L.visit(input, {\", \"});\", shape.getId().getName(serviceShape), () -> {\n            Map<String, MemberShape> members = new TreeMap<>(shape.getAllMembers());\n            members.forEach((memberName, memberShape) -> {\n                Shape target = model.expectShape(memberShape.getTarget());\n                writer.write(\n                    \"$L: value => ({ $S: $L }),\",\n                    memberName,\n                    memberName,\n                    target.accept(getMemberVisitor(\"value\"))\n                );\n            });\n            writer.write(\"_: (name, value) => ({ [name]: value } as any)\");\n        });\n    }\n\n    private DocumentMemberSerVisitor getMemberVisitor(String dataSource) {\n        return new CborMemberSerVisitor(getContext(), dataSource);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.protocol.traits.Rpcv2CborTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.EventStreamGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.HttpProtocolGeneratorUtils;\nimport software.amazon.smithy.typescript.codegen.integration.HttpRpcProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndex;\nimport software.amazon.smithy.typescript.codegen.protocols.SmithyProtocolUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generator for Smithy RPCv2 CBOR.\n *\n * @see CborShapeSerVisitor\n * @see CborShapeDeserVisitor\n * @see CborMemberSerVisitor\n * @see CborMemberDeserVisitor\n * @see SmithyProtocolUtils\n */\n@SmithyInternalApi\npublic class SmithyRpcV2Cbor extends HttpRpcProtocolGenerator {\n\n    public SmithyRpcV2Cbor() {\n        super(true);\n    }\n\n    @Override\n    public void generateSharedComponents(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n\n        writer\n            .addImportSubmodule(\n                \"parseCborBody\",\n                \"parseBody\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CBOR\n            )\n            .addImportSubmodule(\n                \"parseCborErrorBody\",\n                \"parseErrorBody\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CBOR\n            )\n            .addImportSubmodule(\n                \"loadSmithyRpcV2CborErrorCode\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CBOR\n            );\n\n        ServiceShape service = context.getService();\n        deserializingErrorShapes.forEach(error -> generateErrorDeserializer(context, error));\n        eventStreamGenerator.generateEventStreamSerializers(\n            context,\n            service,\n            getDocumentContentType(),\n            () -> {\n                writer.addImportSubmodule(\n                    \"cbor\",\n                    null,\n                    TypeScriptDependency.SMITHY_CORE,\n                    SmithyCoreSubmodules.CBOR\n                );\n                writer.write(\"body = cbor.serialize(body);\");\n            },\n            serializingDocumentShapes\n        );\n        Set<StructureShape> errorEventShapes = new TreeSet<>();\n        SerdeElisionIndex serdeElisionIndex = SerdeElisionIndex.of(context.getModel());\n        eventStreamGenerator.generateEventStreamDeserializers(\n            context,\n            service,\n            errorEventShapes,\n            deserializingDocumentShapes,\n            true,\n            enableSerdeElision(),\n            serdeElisionIndex\n        );\n        errorEventShapes.removeIf(deserializingErrorShapes::contains);\n        errorEventShapes.forEach(error -> generateErrorDeserializer(context, error));\n        generateDocumentBodyShapeSerializers(context, serializingDocumentShapes);\n        generateDocumentBodyShapeDeserializers(context, deserializingDocumentShapes);\n\n        SymbolReference requestType = getApplicationProtocol().getRequestType();\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n\n        HttpProtocolGeneratorUtils.generateMetadataDeserializer(context, responseType);\n        writer\n            .addImportSubmodule(\"collectBody\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.PROTOCOLS);\n\n        if (context.getSettings().generateClient()) {\n            writer.addImportSubmodule(\n                \"withBaseException\",\n                null,\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CLIENT\n            );\n            SymbolReference exception = HttpProtocolGeneratorUtils.getClientBaseException(context);\n            writer.write(\"const throwDefaultError = withBaseException($T);\", exception);\n        }\n\n        writer.addUseImports(requestType);\n        writer.addTypeImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addTypeImport(\"HeaderBag\", \"__HeaderBag\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addImportSubmodule(\n            \"buildHttpRpcRequest\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CBOR\n        );\n        writeSharedRequestHeaders(context);\n        writer.write(\"\");\n\n        writer.write(context.getStringStore().flushVariableDeclarationCode());\n    }\n\n    @Override\n    public ShapeId getProtocol() {\n        return Rpcv2CborTrait.ID;\n    }\n\n    @Override\n    public void generateProtocolTests(GenerationContext generationContext) {\n        SmithyProtocolUtils.generateProtocolTests(this, generationContext);\n    }\n\n    @Override\n    protected String getDocumentContentType() {\n        return \"application/cbor\";\n    }\n\n    @Override\n    protected void generateDocumentBodyShapeSerializers(GenerationContext generationContext, Set<Shape> shapes) {\n        SmithyProtocolUtils.generateDocumentBodyShapeSerde(\n            generationContext,\n            shapes,\n            new CborShapeSerVisitor(generationContext)\n        );\n    }\n\n    @Override\n    protected void generateDocumentBodyShapeDeserializers(GenerationContext generationContext, Set<Shape> shapes) {\n        SmithyProtocolUtils.generateDocumentBodyShapeSerde(\n            generationContext,\n            shapes,\n            new CborShapeDeserVisitor(generationContext)\n        );\n    }\n\n    @Override\n    protected void generateOperationDeserializer(GenerationContext context, OperationShape operation) {\n        SymbolProvider symbolProvider = context.getSymbolProvider();\n        Symbol symbol = symbolProvider.toSymbol(operation);\n        SymbolReference responseType = getApplicationProtocol().getResponseType();\n        TypeScriptWriter writer = context.getWriter();\n\n        writer.addUseImports(responseType);\n        String methodName = ProtocolGenerator.getDeserFunctionShortName(symbol);\n        String methodLongName = ProtocolGenerator.getDeserFunctionName(symbol, getName());\n        String errorMethodName = \"de_CommandError\";\n        String serdeContextType = CodegenUtils.getOperationDeserializerContextType(\n            context.getSettings(),\n            writer,\n            context.getModel(),\n            operation\n        );\n        Symbol outputType = symbol.expectProperty(\"outputType\", Symbol.class);\n\n        writer.writeDocs(methodLongName);\n        writer.openBlock(\"\"\"\n                         export const $L = async (\n                           output: $T,\n                           context: $L\n                         ): Promise<$T> => {\"\"\", \"};\", methodName, responseType, serdeContextType, outputType, () -> {\n            writer.addImportSubmodule(\n                \"checkCborResponse\",\n                \"cr\",\n                TypeScriptDependency.SMITHY_CORE,\n                SmithyCoreSubmodules.CBOR\n            );\n            writer.write(\"cr(output);\");\n\n            writer.write(\n                \"\"\"\n                if (output.statusCode >= 300) {\n                  return $L(output, context);\n                }\n                \"\"\",\n                errorMethodName\n            );\n\n            readResponseBody(context, operation);\n\n            writer.write(\n                \"\"\"\n                const response: $T = {\n                  $$metadata: deserializeMetadata(output), $L\n                };\n                return response;\n                \"\"\",\n                outputType,\n                operation\n                    .getOutput()\n                    .map(o -> \"...contents,\")\n                    .orElse(\"\")\n            );\n        });\n        writer.write(\"\");\n    }\n\n    @Override\n    protected String getOperationPath(GenerationContext generationContext, OperationShape operationShape) {\n        TypeScriptSettings settings = generationContext.getSettings();\n        Model model = generationContext.getModel();\n        ServiceShape service = settings.getService(model);\n\n        String serviceName = service.getId().getName();\n        String operationName = operationShape.getId().getName();\n\n        return \"/service/%s/operation/%s\".formatted(serviceName, operationName);\n    }\n\n    @Override\n    protected void serializeInputDocument(\n        GenerationContext generationContext,\n        OperationShape operationShape,\n        StructureShape inputStructure\n    ) {\n        TypeScriptWriter writer = generationContext.getWriter();\n\n        writer.addImportSubmodule(\"cbor\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CBOR);\n        writer.write(\n            \"body = cbor.serialize($L);\",\n            inputStructure.accept(new CborMemberSerVisitor(generationContext, \"input\"))\n        );\n    }\n\n    @Override\n    protected void writeErrorCodeParser(GenerationContext generationContext) {\n        TypeScriptWriter writer = generationContext.getWriter();\n\n        writer.addImportSubmodule(\n            \"loadSmithyRpcV2CborErrorCode\",\n            null,\n            TypeScriptDependency.SMITHY_CORE,\n            SmithyCoreSubmodules.CBOR\n        );\n        writer.write(\"const errorCode = loadSmithyRpcV2CborErrorCode(output, parsedOutput.body);\");\n    }\n\n    @Override\n    protected void deserializeOutputDocument(\n        GenerationContext generationContext,\n        OperationShape operationShape,\n        StructureShape outputStructure\n    ) {\n        TypeScriptWriter writer = generationContext.getWriter();\n\n        writer.write(\"contents = $L;\", outputStructure.accept(new CborMemberDeserVisitor(generationContext, \"data\")));\n    }\n\n    @Override\n    protected void writeSharedRequestHeaders(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.addTypeImport(\"HeaderBag\", \"__HeaderBag\", TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\"const SHARED_HEADERS: __HeaderBag = {\", \"};\", () -> {\n            writer.write(\"'content-type': $S,\", getDocumentContentType());\n            writer.write(\n                \"\"\"\n                \"smithy-protocol\": \"rpc-v2-cbor\",\n                \"accept\": \"application/cbor\",\n                \"\"\"\n            );\n        });\n    }\n\n    @Override\n    protected boolean enableSerdeElision() {\n        return true;\n    }\n\n    @Override\n    protected void writeRequestHeaders(GenerationContext context, OperationShape operation) {\n        TypeScriptWriter writer = context.getWriter();\n\n        boolean hasEventStreamOutput = EventStreamGenerator.hasEventStreamOutput(context, operation);\n        boolean hasEventStreamInput = EventStreamGenerator.hasEventStreamInput(context, operation);\n        boolean inputIsEmpty = operation.getInput().isEmpty();\n\n        boolean mutatesDefaultHeader = hasEventStreamOutput | hasEventStreamInput | inputIsEmpty;\n\n        if (mutatesDefaultHeader) {\n            writer.write(\"const headers: __HeaderBag = { ...SHARED_HEADERS };\");\n        } else {\n            writer.write(\"const headers: __HeaderBag = SHARED_HEADERS;\");\n        }\n\n        if (hasEventStreamOutput) {\n            writer.write(\n                \"\"\"\n                headers.accept = \"application/vnd.amazon.eventstream\";\n                \"\"\"\n            );\n        }\n        if (hasEventStreamInput) {\n            writer.write(\n                \"\"\"\n                headers[\"content-type\"] = \"application/vnd.amazon.eventstream\";\n                \"\"\"\n            );\n        } else if (inputIsEmpty) {\n            writer.write(\n                \"\"\"\n                delete headers[\"content-type\"];\n                \"\"\"\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.Set;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.protocol.traits.Rpcv2CborTrait;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n *\n * Controls rollout of schema generation.\n *\n */\n@SmithyInternalApi\npublic abstract class SchemaGenerationAllowlist {\n\n    private static final Set<ShapeId> ALLOWED = Collections.synchronizedSet(new HashSet<>());\n    private static final Set<ShapeId> PROTOCOLS = Collections.synchronizedSet(new HashSet<>());\n\n    static {\n        ALLOWED.add(ShapeId.from(\"smithy.protocoltests.rpcv2Cbor#RpcV2Protocol\"));\n        ALLOWED.add(ShapeId.from(\"org.xyz.v1#XYZService\"));\n        PROTOCOLS.add(Rpcv2CborTrait.ID);\n    }\n\n    public static boolean allows(ShapeId serviceShapeId, TypeScriptSettings settings) {\n        boolean generateClient = settings.generateClient();\n        boolean allowedByProtocol = PROTOCOLS.contains(settings.getProtocol());\n        boolean allowedByName = ALLOWED.contains(serviceShapeId);\n        return settings.generateSchemas() && generateClient && (allowedByProtocol || allowedByName);\n    }\n\n    @Deprecated\n    public static void allow(String serviceShapeId) {\n        ALLOWED.add(ShapeId.from(serviceShapeId));\n    }\n\n    public static void allow(ShapeId serviceShapeId) {\n        ALLOWED.add(serviceShapeId);\n    }\n\n    public static void allowProtocol(ShapeId protocolShapeId) {\n        PROTOCOLS.add(protocolShapeId);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport java.nio.file.Paths;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.Optional;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.build.FileManifest;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.ShapeType;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.knowledge.ServiceClosure;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Generates schema objects used to define shape (de)serialization.\n */\n@SmithyInternalApi\npublic class SchemaGenerator implements Runnable {\n\n    public static final String SCHEMAS_FOLDER = \"schemas\";\n    private final SchemaReferenceIndex elision;\n    private final TypeScriptSettings settings;\n    private final SymbolProvider symbolProvider;\n    private final Model model;\n    private final FileManifest fileManifest;\n    private final StringStore store = new StringStore();\n    private final TypeScriptWriter writer = new TypeScriptWriter(\"\");\n    private final ServiceClosure closure;\n    private final Set<String> errorRegistries = new TreeSet<>();\n\n    public SchemaGenerator(\n        Model model,\n        FileManifest fileManifest,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider\n    ) {\n        this.model = model;\n        this.fileManifest = fileManifest;\n        closure = ServiceClosure.of(model, settings.getService(model));\n        elision = SchemaReferenceIndex.of(model);\n        this.settings = settings;\n        this.symbolProvider = symbolProvider;\n        writer.write(\n            \"\"\"\n            /* eslint no-var: 0 */\"\"\"\n        );\n    }\n\n    /**\n     * Writes all schemas for the model to a schemas.ts file.\n     */\n    @Override\n    public void run() {\n        for (ServiceShape service : model.getServiceShapes()) {\n            if (!SchemaGenerationAllowlist.allows(service.getId(), settings)) {\n                return;\n            }\n        }\n\n        writeBaseError();\n        writeErrors();\n        closure.getSimpleShapes().forEach(this::writeSimpleSchema);\n        closure.getStructureShapes().forEach(this::writeStructureSchema);\n        closure.getCollectionShapes().forEach(this::writeListSchema);\n        closure.getMapShapes().forEach(this::writeMapSchema);\n        closure.getUnionShapes().forEach(this::writeUnionSchema);\n        closure.getOperationShapes().forEach(this::writeOperationSchema);\n\n        String stringConstants = store.flushVariableDeclarationCode();\n\n        boolean hasContent = !writer.toString().matches(\"/\\\\* eslint no-var: 0 \\\\*/[\\\\s\\\\n]+$\");\n        if (hasContent) {\n            fileManifest.writeFile(\n                Paths.get(CodegenUtils.SOURCE_FOLDER, SCHEMAS_FOLDER, \"schemas_0.ts\").toString(),\n                stringConstants + \"\\n\" + writer\n            );\n        }\n    }\n\n    /**\n     * @return variable name of the shape's schema, with deconfliction for multiple namespaces with the same\n     * unqualified name.\n     */\n    private String getShapeVariableName(Shape shape) {\n        return closure.getShapeSchemaVariableName(shape, store);\n    }\n\n    /**\n     * Writes the schema declaration for a simple shape.\n     * If it has no runtime traits, e.g. a plain string, nothing will be written.\n     */\n    private void writeSimpleSchema(Shape shape) {\n        if (elision.traits.hasSchemaTraits(shape)) {\n            writer.addTypeImport(\"StaticSimpleSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n            writer.writeInline(\n                \"\"\"\n                var $L: StaticSimpleSchema = [0, $L, $L,\\s\"\"\",\n                getShapeVariableName(shape),\n                store.var(shape.getId().getNamespace(), \"n\"),\n                store.var(shape.getId().getName())\n            );\n            writeTraits(shape);\n            writer.writeInline(\", $L];\", resolveSimpleSchema(shape, shape));\n            writer.ensureNewline();\n        }\n    }\n\n    private void writeStructureSchema(StructureShape shape) {\n        checkedWriteSchema(shape, () -> {\n            if (!shape.hasTrait(ErrorTrait.class)) {\n                writer.addTypeImport(\"StaticStructureSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n                writer.openBlock(\n                    \"\"\"\n                    export var $L: StaticStructureSchema = [3, $L, $L,\"\"\",\n                    \"];\",\n                    getShapeVariableName(shape),\n                    store.var(shape.getId().getNamespace(), \"n\"),\n                    store.var(shape.getId().getName()),\n                    () -> doWithMembers(shape)\n                );\n            }\n        });\n    }\n\n    private void writeErrors() {\n        for (Shape shape : closure.getErrorShapes()) {\n            String ns = store.var(shape.getId().getNamespace(), \"n\");\n            String errorRegistryVarName = ns + \"_registry\";\n\n            if (!errorRegistries.contains(errorRegistryVarName)) {\n                writer.addImportSubmodule(\"TypeRegistry\", null, TypeScriptDependency.SMITHY_CORE, \"/schema\");\n                writer.write(\n                    \"\"\"\n                    const $L = TypeRegistry.for($L);\"\"\",\n                    errorRegistryVarName,\n                    ns\n                );\n                errorRegistries.add(errorRegistryVarName);\n            }\n        }\n\n        for (Shape shape : closure.getErrorShapes()) {\n            Optional<StructureShape> errorShapeOpt = shape.asStructureShape();\n            if (errorShapeOpt.isPresent()) {\n                String ns = store.var(shape.getId().getNamespace(), \"n\");\n                String errorRegistryVarName = ns + \"_registry\";\n                String exceptionCtorSymbolName = ServiceClosure.RESERVED_WORDS.escape(shape.getId().getName());\n\n                writer.addTypeImport(\"StaticErrorSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n                writer.addRelativeImport(exceptionCtorSymbolName, null, Paths.get(\"..\", \"models\", \"errors\"));\n                writer.openBlock(\n                    \"\"\"\n                    export var $L: StaticErrorSchema = [-3, $L, $L,\"\"\",\n                    \"];\",\n                    getShapeVariableName(shape),\n                    store.var(shape.getId().getNamespace(), \"n\"),\n                    store.var(shape.getId().getName()),\n                    () -> doWithMembers(shape)\n                );\n\n                StructureShape errorShape = errorShapeOpt.get();\n                errorShape.expectTrait(ErrorTrait.class);\n                writer.write(\n                    \"\"\"\n                    $L.registerError($L, $L);\"\"\",\n                    errorRegistryVarName,\n                    getShapeVariableName(shape),\n                    exceptionCtorSymbolName\n                );\n            }\n        }\n\n        writer.writeDocs(\"\"\"\n                         TypeRegistry instances containing modeled errors.\n                         @internal\n                         \"\"\");\n        writer.openBlock(\"export const errorTypeRegistries = [\", \"]\", () -> {\n            for (String errorRegistry : errorRegistries) {\n                writer.write(\"$L,\", errorRegistry);\n            }\n        });\n    }\n\n    /**\n     * Writes the synthetic base exception schema.\n     */\n    private void writeBaseError() {\n        String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider);\n        String syntheticBaseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model);\n        String schemaSymbolName = syntheticBaseExceptionName + \"$\";\n\n        String namespace = settings.getService(model).getId().getNamespace();\n\n        writer.addTypeImport(\"StaticErrorSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n        writer.addRelativeImport(\n            syntheticBaseExceptionName,\n            null,\n            Paths.get(\"..\", \"models\", syntheticBaseExceptionName)\n        );\n\n        String syntheticNamespace = store.var(\"smithy.ts.sdk.synthetic.\" + namespace);\n        String syntheticNamespaceTypeRegistry = syntheticNamespace + \"_registry\";\n        writer.addImportSubmodule(\"TypeRegistry\", null, TypeScriptDependency.SMITHY_CORE, \"/schema\");\n\n        writer.write(\n            \"\"\"\n            const $L = TypeRegistry.for($L);\"\"\",\n            syntheticNamespaceTypeRegistry,\n            syntheticNamespace\n        );\n        errorRegistries.add(syntheticNamespaceTypeRegistry);\n        writer.write(\n            \"\"\"\n            export var $L: StaticErrorSchema = [-3, $L, $S, 0, [], []];\"\"\",\n            schemaSymbolName,\n            syntheticNamespace,\n            syntheticBaseExceptionName\n        );\n        writer.write(\n            \"\"\"\n            $L.registerError($L, $L);\"\"\",\n            syntheticNamespaceTypeRegistry,\n            schemaSymbolName,\n            syntheticBaseExceptionName\n        );\n    }\n\n    private void writeUnionSchema(UnionShape shape) {\n        checkedWriteSchema(shape, () -> {\n            writer.addTypeImport(\"StaticUnionSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n            writer.openBlock(\n                \"\"\"\n                export var $L: StaticUnionSchema = [4, $L, $L,\"\"\",\n                \"];\",\n                getShapeVariableName(shape),\n                store.var(shape.getId().getNamespace(), \"n\"),\n                store.var(shape.getId().getName()),\n                () -> doWithMembers(shape)\n            );\n        });\n    }\n\n    /**\n     * Handles the member entries for unions/structures.\n     */\n    private void doWithMembers(Shape shape) {\n        writeTraits(shape);\n\n        long requiredMemberCount = 0;\n        List<String> orderedNames = new ArrayList<>();\n        List<MemberShape> orderedMembers = new ArrayList<>();\n\n        for (MemberShape m : shape.getAllMembers().values()) {\n            if (closure.isMemberRequiredInClient(m)) {\n                requiredMemberCount += 1;\n                orderedNames.add(m.getMemberName());\n                orderedMembers.add(m);\n            }\n        }\n        for (MemberShape m : shape.getAllMembers().values()) {\n            if (!closure.isMemberRequiredInClient(m)) {\n                orderedNames.add(m.getMemberName());\n                orderedMembers.add(m);\n            }\n        }\n\n        assert orderedNames.size() == orderedMembers.size();\n        assert orderedNames.size() == shape.getAllMembers().size();\n\n        // member names.\n        writer.write(\",\");\n        writer.writeInline(\"[\");\n        orderedNames\n            .forEach((memberName) -> {\n                writer.writeInline(\"$L, \", store.var(memberName));\n            });\n        writer.unwrite(\", \");\n        writer.write(\"],\");\n\n        // member schemas.\n        writer.writeInline(\"[\");\n        orderedMembers\n            .forEach((member) -> {\n                String ref = resolveSchema(shape, member);\n                if (elision.traits.hasSchemaTraits(member)) {\n                    writer.writeInline(\"[$L, \", ref);\n                    writeTraits(member);\n                    writer.writeInline(\"], \");\n                } else {\n                    writer.writeInline(\"$L, \", ref);\n                }\n            });\n        writer.unwrite(\", \");\n        if (requiredMemberCount > 0 && shape.isStructureShape()) {\n            writer.write(\"], $L\", Objects.toString(requiredMemberCount));\n        } else {\n            writer.write(\"]\");\n        }\n    }\n\n    private void writeListSchema(CollectionShape shape) {\n        checkedWriteSchema(shape, () -> {\n            writer.addTypeImport(\"StaticListSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n            writer.openBlock(\n                \"\"\"\n                var $L: StaticListSchema = [1, $L, $L,\"\"\",\n                \"];\",\n                getShapeVariableName(shape),\n                store.var(shape.getId().getNamespace(), \"n\"),\n                store.var(shape.getId().getName()),\n                () -> this.doWithMember(shape, shape.getMember())\n            );\n        });\n    }\n\n    private void writeMapSchema(MapShape shape) {\n        checkedWriteSchema(shape, () -> {\n            writer.addTypeImport(\"StaticMapSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n            writer.openBlock(\n                \"\"\"\n                var $L: StaticMapSchema = [2, $L, $L,\"\"\",\n                \"];\",\n                getShapeVariableName(shape),\n                store.var(shape.getId().getNamespace(), \"n\"),\n                store.var(shape.getId().getName()),\n                () -> this.doWithMember(shape, shape.getKey(), shape.getValue())\n            );\n        });\n    }\n\n    /**\n     * Write member schema insertion for lists.\n     */\n    private void doWithMember(Shape shape, MemberShape memberShape) {\n        writeTraits(shape);\n        String ref = resolveSchema(shape, memberShape);\n        if (elision.traits.hasSchemaTraits(memberShape)) {\n            writer.openBlock(\", [$L, \", \"]\", ref, () -> {\n                writeTraits(memberShape);\n            });\n        } else {\n            writer.write(\", $L\", ref);\n        }\n    }\n\n    /**\n     * Write member schema insertion for maps.\n     */\n    private void doWithMember(Shape shape, MemberShape keyShape, MemberShape memberShape) {\n        writeTraits(shape);\n        String keyRef = resolveSchema(shape, keyShape);\n        String valueRef = resolveSchema(shape, memberShape);\n        if (elision.traits.hasSchemaTraits(memberShape) || elision.traits.hasSchemaTraits(keyShape)) {\n            writer.openBlock(\", [$L, \", \"]\", keyRef, () -> {\n                writeTraits(keyShape);\n            });\n            writer.openBlock(\", [$L, \", \"]\", valueRef, () -> {\n                writeTraits(memberShape);\n            });\n        } else {\n            writer.write(\", $L, $L\", keyRef, valueRef);\n        }\n    }\n\n    private void writeOperationSchema(OperationShape shape) {\n        writer.addTypeImport(\"StaticOperationSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\n            \"\"\"\n            export var $L: StaticOperationSchema = [9, $L, $L,\"\"\",\n            \"];\",\n            getShapeVariableName(shape),\n            store.var(shape.getId().getNamespace(), \"n\"),\n            store.var(shape.getId().getName()),\n            () -> {\n                writeTraits(shape);\n                writer.write(\n                    \"\"\"\n                    , () => $L, () => $L\"\"\",\n                    getShapeVariableName(model.expectShape(shape.getInputShape())),\n                    getShapeVariableName(model.expectShape(shape.getOutputShape()))\n                );\n            }\n        );\n    }\n\n    private void writeTraits(Shape shape) {\n        String traitCode = new SchemaTraitWriter(shape, elision, store).toString();\n\n        writer.writeInline(traitCode.replace(\"$\", \"$$\"));\n    }\n\n    /**\n     * Checks whether ok to write minimized schema.\n     */\n    private void checkedWriteSchema(Shape shape, Runnable schemaWriteFn) {\n        if (shape.getId().getNamespace().equals(\"smithy.api\") && shape.getId().getName().equals(\"Unit\")) {\n            // special signal value for operation input/output.\n            writer.write(\n                \"\"\"\n                var __Unit = \"unit\" as const;\"\"\"\n            );\n        } else if (!elision.isReferenceSchema(shape) && !elision.traits.hasSchemaTraits(shape)) {\n            String sentinel = this.resolveSchema(model.expectShape(ShapeId.from(\"smithy.api#Unit\")), shape);\n\n            boolean exportable = shape.isStructureShape() || shape.isUnionShape() || shape.isOperationShape();\n\n            if (exportable) {\n                writer.write(\n                    \"\"\"\n                    export var $L = $L;\"\"\",\n                    getShapeVariableName(shape),\n                    sentinel\n                );\n            } else {\n                writer.write(\n                    \"\"\"\n                    var $L = $L;\"\"\",\n                    getShapeVariableName(shape),\n                    sentinel\n                );\n            }\n        } else {\n            schemaWriteFn.run();\n        }\n    }\n\n    /**\n     * @return generally the symbol name of the target shape, but sometimes a sentinel value for special types like\n     * blob and timestamp.\n     */\n    private String resolveSchema(Shape context, Shape shape) {\n        MemberShape memberShape = null;\n        if (shape instanceof MemberShape ms) {\n            memberShape = ms;\n            shape = model.expectShape(memberShape.getTarget());\n        }\n\n        boolean isReference = elision.isReferenceSchema(shape);\n        boolean hasTraits = elision.traits.hasSchemaTraits(shape);\n\n        if (!hasTraits) {\n            try {\n                return resolveSimpleSchema(context, memberShape != null ? memberShape : shape);\n            } catch (IllegalArgumentException ignored) {\n                //\n            }\n        }\n\n        return (isReference || hasTraits ? \"() => \" : \"\") + getShapeVariableName(shape);\n    }\n\n    /**\n     * @return a sentinel value representing a preconfigured schema type.\n     * @throws IllegalArgumentException when no sentinel value exists, e.g. a non-simple schema was passed in.\n     */\n    private String resolveSimpleSchema(Shape context, Shape shape) {\n        MemberShape memberShape = null;\n        if (shape instanceof MemberShape ms) {\n            memberShape = ms;\n            shape = model.expectShape(memberShape.getTarget());\n        }\n\n        ShapeType type = shape.getType();\n\n        switch (type) {\n            case BOOLEAN -> {\n                return \"2\";\n            }\n            case STRING, ENUM -> {\n                return \"0\";\n            }\n            case TIMESTAMP -> {\n                Optional<TimestampFormatTrait> trait = shape.getTrait(TimestampFormatTrait.class);\n                if (memberShape != null && memberShape.hasTrait(TimestampFormatTrait.class)) {\n                    trait = memberShape.getTrait(TimestampFormatTrait.class);\n                }\n                return trait\n                    .map(timestampFormatTrait -> switch (timestampFormatTrait.getValue()) {\n                        case \"date-time\" -> \"5\";\n                        case \"http-date\" -> \"6\";\n                        case \"epoch-seconds\" -> \"7\";\n                        default -> \"4\";\n                    })\n                    .orElse(\"4\");\n            }\n            case BLOB -> {\n                if (shape.hasTrait(StreamingTrait.class)) {\n                    return \"42\";\n                }\n                return \"21\";\n            }\n            case BYTE, SHORT, INTEGER, INT_ENUM, LONG, FLOAT, DOUBLE -> {\n                return \"1\";\n            }\n            case DOCUMENT -> {\n                return \"15\";\n            }\n            case BIG_INTEGER -> {\n                return \"17\";\n            }\n            case BIG_DECIMAL -> {\n                return \"19\";\n            }\n            case LIST, SET, MAP -> {\n                return resolveSimpleSchemaNestedContainer(context, shape);\n            }\n            default -> {\n                //\n            }\n        }\n        throw new IllegalArgumentException(\"shape is not simple\");\n    }\n\n    /**\n     * For example, the number 5 represents a timestamp (Date-Time) schema with no other traits.\n     * For lists, the bit modifier 64 is applied, giving 64 | 5 for a list of timestamps.\n     * For further nested containers, bit masks can no longer be used, necessitating the `sim` simple schema\n     * wrapper: `sim(\"namespace\", \"ListOfLists\", 64 | 5, {});`.\n     *\n     * @return the container bit modifier attached to the schema numeric value.\n     */\n    private String resolveSimpleSchemaNestedContainer(Shape context, Shape shape) {\n        Shape contained;\n        String staticTypePrefix;\n        String sentinel;\n        String keySchema = \"\";\n        switch (shape.getType()) {\n            case LIST -> {\n                contained = shape.asListShape().get().getMember();\n                staticTypePrefix = \"[1, \";\n                sentinel = \"64\";\n                writer.addTypeImport(\"StaticListSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n            }\n            case MAP -> {\n                contained = shape.asMapShape().get().getValue();\n                staticTypePrefix = \"[2, \";\n                keySchema = this.resolveSimpleSchema(context, shape.asMapShape().get().getKey()) + \", \";\n                sentinel = \"128\";\n                writer.addTypeImport(\"StaticMapSchema\", null, TypeScriptDependency.SMITHY_TYPES);\n            }\n            default -> {\n                throw new IllegalArgumentException(\n                    \"call to resolveSimpleSchemaNestedContainer with incompatible shape type.\"\n                );\n            }\n        }\n        if (contained.isMemberShape()) {\n            contained = model.expectShape(contained.asMemberShape().get().getTarget());\n        }\n\n        if (contained.isListShape() || contained.isMapShape()) {\n            String schemaVarName = store.var(shape.getId().getName());\n            return (staticTypePrefix +\n                store.var(shape.getId().getNamespace(), \"n\") +\n                \", \" +\n                schemaVarName +\n                \", 0, \" +\n                keySchema +\n                this.resolveSimpleSchema(context, contained) +\n                \"]\");\n        } else {\n            return sentinel + \" | \" + this.resolveSimpleSchema(context, contained);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaReferenceIndex.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.KnowledgeIndex;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeType;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Can determine whether a Schema can be defined by a sentinel value.\n */\n@SmithyInternalApi\npublic final class SchemaReferenceIndex implements KnowledgeIndex {\n\n    public final SchemaTraitFilterIndex traits;\n    private final Model model;\n\n    SchemaReferenceIndex(Model model) {\n        this.model = model;\n        traits = SchemaTraitFilterIndex.of(model);\n    }\n\n    public static SchemaReferenceIndex of(Model model) {\n        return model.getKnowledge(SchemaReferenceIndex.class, SchemaReferenceIndex::new);\n    }\n\n    /**\n     * A reference shape is a function pointer to a shape that doesn't have a constant numeric\n     * sentinel value.\n     * Simple non-aggregate types and lists/maps of those types are considered non-reference\n     * in TypeScript.\n     *\n     * @return whether shape is a reference shape.\n     */\n    public boolean isReferenceSchema(Shape shape) {\n        Shape targetShape = shape;\n        if (shape instanceof MemberShape member) {\n            targetShape = model.expectShape(member.getTarget());\n        }\n        ShapeType type = targetShape.getType();\n        switch (type) {\n            case\n                STRING,\n                BOOLEAN,\n                BYTE,\n                DOUBLE,\n                FLOAT,\n                SHORT,\n                INTEGER,\n                LONG,\n                ENUM,\n                INT_ENUM,\n                BIG_INTEGER,\n                BIG_DECIMAL,\n                TIMESTAMP,\n                BLOB,\n                DOCUMENT -> {\n                return false;\n            }\n            case LIST, SET, MAP -> {\n                if (shape instanceof CollectionShape collection) {\n                    return isReferenceSchema(collection.getMember());\n                } else if (shape instanceof MapShape map) {\n                    return isReferenceSchema(map.getValue());\n                }\n                return true;\n            }\n            default -> {\n                return true;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitExtension.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.Trait;\n\npublic final class SchemaTraitExtension {\n\n    public static final SchemaTraitExtension INSTANCE = new SchemaTraitExtension();\n\n    private final Map<ShapeId, TraitRenderer> customization = new HashMap<>();\n\n    private SchemaTraitExtension() {}\n\n    public void add(ShapeId traitShapeId, TraitRenderer traitRenderer) {\n        customization.put(traitShapeId, traitRenderer);\n    }\n\n    public String render(Trait trait) {\n        return customization.get(trait.toShapeId()).render(trait);\n    }\n\n    public boolean contains(Trait trait) {\n        return contains(trait.toShapeId());\n    }\n\n    public boolean contains(ShapeId trait) {\n        return customization.containsKey(trait);\n    }\n\n    public interface TraitRenderer {\n        String render(Trait trait);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitFilterIndex.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.TreeSet;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.KnowledgeIndex;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.AuthDefinitionTrait;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.EventHeaderTrait;\nimport software.amazon.smithy.model.traits.EventPayloadTrait;\nimport software.amazon.smithy.model.traits.HostLabelTrait;\nimport software.amazon.smithy.model.traits.HttpErrorTrait;\nimport software.amazon.smithy.model.traits.HttpHeaderTrait;\nimport software.amazon.smithy.model.traits.HttpLabelTrait;\nimport software.amazon.smithy.model.traits.HttpPayloadTrait;\nimport software.amazon.smithy.model.traits.HttpPrefixHeadersTrait;\nimport software.amazon.smithy.model.traits.HttpQueryParamsTrait;\nimport software.amazon.smithy.model.traits.HttpQueryTrait;\nimport software.amazon.smithy.model.traits.HttpResponseCodeTrait;\nimport software.amazon.smithy.model.traits.HttpTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.JsonNameTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.ProtocolDefinitionTrait;\nimport software.amazon.smithy.model.traits.RequiresLengthTrait;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.model.traits.XmlAttributeTrait;\nimport software.amazon.smithy.model.traits.XmlFlattenedTrait;\nimport software.amazon.smithy.model.traits.XmlNameTrait;\nimport software.amazon.smithy.model.traits.XmlNamespaceTrait;\nimport software.amazon.smithy.utils.SetUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class SchemaTraitFilterIndex implements KnowledgeIndex {\n\n    private static final Set<ShapeId> EXCLUDED_TRAITS = SetUtils.of(\n        // excluded due to special schema handling.\n        TimestampFormatTrait.ID\n    );\n\n    /**\n     * All of these are added by scanning the ProtocolDefinition and AuthDefinition meta traits.\n     * The hard coded initial list is shown as an example of what this set contains.\n     */\n    private final Set<ShapeId> includedTraits = new HashSet<>(\n        // (wrapped for mutability)\n        SetUtils.of(\n            SparseTrait.ID, // Shape serde\n            SensitiveTrait.ID,\n            IdempotencyTokenTrait.ID,\n            JsonNameTrait.ID, // Shape serde\n            MediaTypeTrait.ID, // JSON shape serde\n            XmlAttributeTrait.ID, // XML shape serde\n            XmlFlattenedTrait.ID, // XML shape serde\n            XmlNameTrait.ID, // XML shape serde\n            XmlNamespaceTrait.ID, // XML shape serde\n            StreamingTrait.ID, // HttpBindingProtocol handles streaming + payload members.\n            EndpointTrait.ID, // HttpProtocol\n            ErrorTrait.ID, // set by the ServiceException runtime classes.\n            RequiresLengthTrait.ID, // unhandled\n            EventHeaderTrait.ID, // @smithy/core/event-streams::EventStreamSerde\n            EventPayloadTrait.ID, // @smithy/core/event-streams::EventStreamSerde\n            // afaict, HttpErrorTrait is ignored by the client. The discriminator selects the error structure\n            // but the actual HTTP response status code is used with no particular comparison\n            // with the trait's error code.\n            HttpErrorTrait.ID,\n            // the following HTTP traits are handled by HTTP binding protocol base class.\n            HttpTrait.ID,\n            HttpHeaderTrait.ID,\n            HttpQueryTrait.ID,\n            HttpLabelTrait.ID,\n            HttpPayloadTrait.ID,\n            HttpPrefixHeadersTrait.ID,\n            HttpQueryParamsTrait.ID,\n            HttpResponseCodeTrait.ID,\n            HostLabelTrait.ID\n        )\n    );\n    private final Map<Shape, Boolean> cache = new HashMap<>();\n    private final Model model;\n\n    SchemaTraitFilterIndex(Model model) {\n        Set<Shape> protocolDefinitionTraits = model.getShapesWithTrait(ProtocolDefinitionTrait.class);\n        Set<Shape> authDefinitionTraits = model.getShapesWithTrait(AuthDefinitionTrait.class);\n        Set<Shape> definitionTraits = new TreeSet<>();\n        definitionTraits.addAll(protocolDefinitionTraits);\n        definitionTraits.addAll(authDefinitionTraits);\n\n        for (Shape shape : definitionTraits) {\n            shape\n                .getTrait(ProtocolDefinitionTrait.class)\n                .ifPresent(protocolDefinitionTrait -> {\n                    protocolDefinitionTrait\n                        .getTraits()\n                        .forEach(traitShapeId -> {\n                            if (!EXCLUDED_TRAITS.contains(traitShapeId)) {\n                                includedTraits.add(traitShapeId);\n                            }\n                        });\n                });\n        }\n\n        this.model = model;\n        for (Shape shape : model.toSet()) {\n            cache.put(shape, hasSchemaTraits(shape));\n        }\n    }\n\n    public static SchemaTraitFilterIndex of(Model model) {\n        return model.getKnowledge(SchemaTraitFilterIndex.class, SchemaTraitFilterIndex::new);\n    }\n\n    /**\n     * @param traitShapeId - query.\n     * @return whether trait should be included in schema generation.\n     */\n    public boolean includeTrait(ShapeId traitShapeId) {\n        return includedTraits.contains(traitShapeId) || SchemaTraitExtension.INSTANCE.contains(traitShapeId);\n    }\n\n    /**\n     * This operation is cached on call.\n     *\n     * @param shape - structure or member, usually.\n     * @return whether it has at least 1 trait that is needed in a schema.\n     */\n    public boolean hasSchemaTraits(Shape shape) {\n        return hasSchemaTraits(shape, 0);\n    }\n\n    private boolean hasSchemaTraits(Shape shape, int depth) {\n        if (cache.containsKey(shape)) {\n            return cache.get(shape);\n        }\n        if (depth > 20) {\n            return false;\n        }\n        boolean hasSchemaTraits = shape\n            .getAllTraits()\n            .values()\n            .stream()\n            .map(Trait::toShapeId)\n            .anyMatch(this::includeTrait);\n\n        if (hasSchemaTraits) {\n            cache.put(shape, true);\n            return true;\n        }\n\n        boolean membersHaveSchemaTraits = shape\n            .getAllMembers()\n            .values()\n            .stream()\n            .anyMatch(ms -> hasSchemaTraits(ms, depth + 1));\n        boolean targetHasSchemaTraits = shape\n            .asMemberShape()\n            .map(ms -> hasSchemaTraits(model.expectShape(ms.getTarget()), depth + 1))\n            .orElse(false);\n\n        cache.put(shape, membersHaveSchemaTraits || targetHasSchemaTraits);\n        return cache.get(shape);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitGenerator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport java.util.Objects;\nimport java.util.Set;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.AnnotationTrait;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.EventHeaderTrait;\nimport software.amazon.smithy.model.traits.EventPayloadTrait;\nimport software.amazon.smithy.model.traits.HostLabelTrait;\nimport software.amazon.smithy.model.traits.HttpChecksumRequiredTrait;\nimport software.amazon.smithy.model.traits.HttpErrorTrait;\nimport software.amazon.smithy.model.traits.HttpHeaderTrait;\nimport software.amazon.smithy.model.traits.HttpLabelTrait;\nimport software.amazon.smithy.model.traits.HttpPayloadTrait;\nimport software.amazon.smithy.model.traits.HttpPrefixHeadersTrait;\nimport software.amazon.smithy.model.traits.HttpQueryParamsTrait;\nimport software.amazon.smithy.model.traits.HttpQueryTrait;\nimport software.amazon.smithy.model.traits.HttpResponseCodeTrait;\nimport software.amazon.smithy.model.traits.HttpTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.JsonNameTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.RequiresLengthTrait;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.StringTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.model.traits.XmlAttributeTrait;\nimport software.amazon.smithy.model.traits.XmlFlattenedTrait;\nimport software.amazon.smithy.model.traits.XmlNameTrait;\nimport software.amazon.smithy.model.traits.XmlNamespaceTrait;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\nimport software.amazon.smithy.utils.SetUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Creates the string representing a trait's data.\n * For presence-based trait, essentially boolean, a 1 or 2 will be used.\n */\n@SmithyInternalApi\npublic class SchemaTraitGenerator {\n\n    private static final String ANNOTATION_TRAIT_VALUE = \"1\";\n    private static final Set<ShapeId> ANNOTATION_TRAITS = SetUtils.of(\n        XmlAttributeTrait.ID,\n        XmlFlattenedTrait.ID,\n        EventHeaderTrait.ID,\n        EventPayloadTrait.ID,\n        StreamingTrait.ID,\n        RequiresLengthTrait.ID,\n        HttpLabelTrait.ID,\n        HttpPayloadTrait.ID,\n        HttpQueryParamsTrait.ID,\n        HttpResponseCodeTrait.ID,\n        HttpChecksumRequiredTrait.ID,\n        HostLabelTrait.ID,\n        SparseTrait.ID,\n        SensitiveTrait.ID,\n        IdempotencyTokenTrait.ID\n    );\n\n    /**\n     * Data traits are traits with one or more fields of data.\n     * To allow for the possibility of the traits adding new fields,\n     * the generated schema object MUST be an array with consistent ordering and size\n     * for the fields' data.\n     */\n    private static final Set<ShapeId> DATA_TRAITS = SetUtils.of(\n        HttpErrorTrait.ID,\n        HttpTrait.ID,\n        EndpointTrait.ID,\n        XmlNamespaceTrait.ID\n    );\n\n    private static final Set<ShapeId> STRING_TRAITS = SetUtils.of(\n        TimestampFormatTrait.ID,\n        JsonNameTrait.ID,\n        MediaTypeTrait.ID,\n        XmlNameTrait.ID,\n        HttpHeaderTrait.ID,\n        HttpQueryTrait.ID,\n        HttpPrefixHeadersTrait.ID,\n        ErrorTrait.ID\n    );\n\n    public String serializeTraitData(Trait trait, StringStore stringStore) {\n        if (trait instanceof TimestampFormatTrait) {\n            // this is overridden by {@link SchemaGenerator::resolveSchema}\n            return \"\";\n        } else if (STRING_TRAITS.contains(trait.toShapeId()) && trait instanceof StringTrait strTrait) {\n            return stringStore.var(strTrait.getValue());\n        } else if (ANNOTATION_TRAITS.contains(trait.toShapeId()) && trait instanceof AnnotationTrait) {\n            return ANNOTATION_TRAIT_VALUE;\n        } else if (DATA_TRAITS.contains(trait.toShapeId())) {\n            if (trait instanceof EndpointTrait endpointTrait) {\n                return \"\"\"\n                       [\"%s\"]\"\"\".formatted(endpointTrait.getHostPrefix());\n            } else if (trait instanceof XmlNamespaceTrait xmlNamespaceTrait) {\n                return \"\"\"\n                       [%s, %s]\"\"\".formatted(\n                    stringStore.var(xmlNamespaceTrait.getPrefix().orElse(\"\")),\n                    stringStore.var(xmlNamespaceTrait.getUri())\n                );\n            } else if (trait instanceof HttpErrorTrait httpError) {\n                return Objects.toString(httpError.getCode());\n            } else if (trait instanceof HttpTrait httpTrait) {\n                return \"\"\"\n                       [\"%s\", \"%s\", %s]\"\"\".formatted(httpTrait.getMethod(), httpTrait.getUri(), httpTrait.getCode());\n            }\n        } else if (SchemaTraitExtension.INSTANCE.contains(trait)) {\n            return SchemaTraitExtension.INSTANCE.render(trait);\n        }\n\n        String name = \"\"\"\n                      `%s`\"\"\".formatted(trait.getClass().getSimpleName());\n\n        if (trait instanceof StringTrait stringTrait) {\n            return \"\"\"\n                   /* unhandled trait\\s\"\"\" + name + \" */ \" + stringStore.var(stringTrait.getValue());\n        } else if (trait instanceof AnnotationTrait) {\n            return \"\"\"\n                   /* unhandled trait\\s\"\"\" + name + \" */ \" + ANNOTATION_TRAIT_VALUE;\n        }\n        return \"\"\"\n               /* unhandled trait\\s\"\"\" + name + \" */ void 0\";\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitWriter.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.TreeMap;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.HttpLabelTrait;\nimport software.amazon.smithy.model.traits.HttpPayloadTrait;\nimport software.amazon.smithy.model.traits.HttpQueryParamsTrait;\nimport software.amazon.smithy.model.traits.HttpResponseCodeTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.IdempotentTrait;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\n\nclass SchemaTraitWriter {\n\n    private final Shape shape;\n    private final SchemaReferenceIndex elision;\n    private final StringStore stringStore;\n    private final StringBuilder buffer = new StringBuilder();\n    private final List<ShapeId> compressTraits = List.of(\n        HttpLabelTrait.ID,\n        IdempotentTrait.ID,\n        IdempotencyTokenTrait.ID,\n        SensitiveTrait.ID,\n        HttpPayloadTrait.ID,\n        HttpResponseCodeTrait.ID,\n        HttpQueryParamsTrait.ID\n    );\n    private final SchemaTraitGenerator traitGenerator = new SchemaTraitGenerator();\n\n    SchemaTraitWriter(Shape shape, SchemaReferenceIndex elision, StringStore stringStore) {\n        this.shape = shape;\n        this.elision = elision;\n        this.stringStore = stringStore;\n    }\n\n    /**\n     * @return either the numeric bitvector or object representation of\n     * the traits on the input shape.\n     */\n    @Override\n    public String toString() {\n        if (mayUseCompressedTraits()) {\n            writeTraitsBitVector();\n        } else {\n            writeTraitsObject();\n        }\n        return buffer.toString();\n    }\n\n    private boolean mayUseCompressedTraits() {\n        return shape\n            .getAllTraits()\n            .values()\n            .stream()\n            .map(Trait::toShapeId)\n            .filter(elision.traits::includeTrait)\n            .allMatch(compressTraits::contains);\n    }\n\n    private void writeTraitsBitVector() {\n        int bits = 0;\n        for (int i = 0; i < compressTraits.size(); ++i) {\n            if (shape.hasTrait(compressTraits.get(i))) {\n                bits |= (1 << i);\n            }\n        }\n        buffer.append(Objects.toString(bits));\n    }\n\n    private void writeTraitsObject() {\n        buffer.append(\"{ \");\n\n        new TreeMap<>(shape.getAllTraits())\n            .forEach((shapeId, trait) -> {\n                if (!elision.traits.includeTrait(trait.toShapeId())) {\n                    return;\n                }\n                buffer.append(\n                    \"\"\"\n                    [%s]: %s,\\s\"\"\".formatted(\n                        stringStore.var(shapeId.getName()),\n                        traitGenerator.serializeTraitData(trait, stringStore)\n                    )\n                );\n            });\n\n        buffer.deleteCharAt(buffer.length() - 1);\n        buffer.deleteCharAt(buffer.length() - 1);\n        buffer.append(\" }\");\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/ClientBodyExtraCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class ClientBodyExtraCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ApplicationProtocol applicationProtocol;\n\n    private ClientBodyExtraCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<ClientBodyExtraCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public ClientBodyExtraCodeSection build() {\n            return new ClientBodyExtraCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/ClientConfigCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class ClientConfigCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ApplicationProtocol applicationProtocol;\n\n    private ClientConfigCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<ClientConfigCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public ClientConfigCodeSection build() {\n            return new ClientConfigCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/ClientConstructorCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class ClientConstructorCodeSection implements CodeSection {\n\n    private final ServiceShape service;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final Model model;\n\n    private ClientConstructorCodeSection(Builder builder) {\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimePlugins\", builder.runtimeClientPlugins);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public static class Builder implements SmithyBuilder<ClientConstructorCodeSection> {\n\n        private ServiceShape service;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private Model model;\n\n        @Override\n        public ClientConstructorCodeSection build() {\n            return new ClientConstructorCodeSection(this);\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/ClientDestroyCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class ClientDestroyCodeSection implements CodeSection {\n\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n\n    private ClientDestroyCodeSection(Builder builder) {\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimePlugins\", builder.runtimeClientPlugins);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public static class Builder implements SmithyBuilder<ClientDestroyCodeSection> {\n\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n\n        @Override\n        public ClientDestroyCodeSection build() {\n            return new ClientDestroyCodeSection(this);\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/ClientPropertiesCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class ClientPropertiesCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final SymbolProvider symbolProvider;\n    private final List<TypeScriptIntegration> integrations;\n    private final ApplicationProtocol applicationProtocol;\n\n    private ClientPropertiesCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        integrations = SmithyBuilder.requiredState(\"integrations\", builder.integrations);\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<TypeScriptIntegration> getIntegrations() {\n        return integrations;\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<ClientPropertiesCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private SymbolProvider symbolProvider;\n        private List<TypeScriptIntegration> integrations;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public ClientPropertiesCodeSection build() {\n            return new ClientPropertiesCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder integrations(List<TypeScriptIntegration> integrations) {\n            this.integrations = integrations;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/CommandBodyExtraCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class CommandBodyExtraCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private CommandBodyExtraCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        operation = SmithyBuilder.requiredState(\"operation\", builder.operation);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public OperationShape getOperation() {\n        return operation;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Optional<ProtocolGenerator> getProtocolGenerator() {\n        return Optional.ofNullable(protocolGenerator);\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<CommandBodyExtraCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private OperationShape operation;\n        private SymbolProvider symbolProvider;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public CommandBodyExtraCodeSection build() {\n            return new CommandBodyExtraCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder operation(OperationShape operation) {\n            this.operation = operation;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/CommandConstructorCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class CommandConstructorCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private CommandConstructorCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        operation = SmithyBuilder.requiredState(\"operation\", builder.operation);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public OperationShape getOperation() {\n        return operation;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Optional<ProtocolGenerator> getProtocolGenerator() {\n        return Optional.ofNullable(protocolGenerator);\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<CommandConstructorCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private OperationShape operation;\n        private SymbolProvider symbolProvider;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public CommandConstructorCodeSection build() {\n            return new CommandConstructorCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder operation(OperationShape operation) {\n            this.operation = operation;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/CommandContextCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class CommandContextCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private CommandContextCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        operation = SmithyBuilder.requiredState(\"operation\", builder.operation);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public OperationShape getOperation() {\n        return operation;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Optional<ProtocolGenerator> getProtocolGenerator() {\n        return Optional.ofNullable(protocolGenerator);\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<CommandContextCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private OperationShape operation;\n        private SymbolProvider symbolProvider;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public CommandContextCodeSection build() {\n            return new CommandContextCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder operation(OperationShape operation) {\n            this.operation = operation;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/CommandPropertiesCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class CommandPropertiesCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private CommandPropertiesCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        operation = SmithyBuilder.requiredState(\"operation\", builder.operation);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public OperationShape getOperation() {\n        return operation;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Optional<ProtocolGenerator> getProtocolGenerator() {\n        return Optional.ofNullable(protocolGenerator);\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<CommandPropertiesCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private OperationShape operation;\n        private SymbolProvider symbolProvider;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public CommandPropertiesCodeSection build() {\n            return new CommandPropertiesCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder operation(OperationShape operation) {\n            this.operation = operation;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/PreCommandClassCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class PreCommandClassCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private PreCommandClassCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        operation = SmithyBuilder.requiredState(\"operation\", builder.operation);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public OperationShape getOperation() {\n        return operation;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Optional<ProtocolGenerator> getProtocolGenerator() {\n        return Optional.ofNullable(protocolGenerator);\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<PreCommandClassCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private OperationShape operation;\n        private SymbolProvider symbolProvider;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public PreCommandClassCodeSection build() {\n            return new PreCommandClassCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder operation(OperationShape operation) {\n            this.operation = operation;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/sections/SmithyContextCodeSection.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.sections;\n\nimport java.util.List;\nimport java.util.Optional;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.utils.CodeSection;\nimport software.amazon.smithy.utils.SmithyBuilder;\nimport software.amazon.smithy.utils.SmithyUnstableApi;\n\n@SmithyUnstableApi\npublic final class SmithyContextCodeSection implements CodeSection {\n\n    private final TypeScriptSettings settings;\n    private final Model model;\n    private final ServiceShape service;\n    private final OperationShape operation;\n    private final SymbolProvider symbolProvider;\n    private final List<RuntimeClientPlugin> runtimeClientPlugins;\n    private final ProtocolGenerator protocolGenerator;\n    private final ApplicationProtocol applicationProtocol;\n\n    private SmithyContextCodeSection(Builder builder) {\n        settings = SmithyBuilder.requiredState(\"settings\", builder.settings);\n        model = SmithyBuilder.requiredState(\"model\", builder.model);\n        service = SmithyBuilder.requiredState(\"service\", builder.service);\n        operation = SmithyBuilder.requiredState(\"operation\", builder.operation);\n        symbolProvider = SmithyBuilder.requiredState(\"symbolProvider\", builder.symbolProvider);\n        runtimeClientPlugins = SmithyBuilder.requiredState(\"runtimeClientPlugins\", builder.runtimeClientPlugins);\n        protocolGenerator = builder.protocolGenerator;\n        applicationProtocol = SmithyBuilder.requiredState(\"applicationProtocol\", builder.applicationProtocol);\n    }\n\n    public static Builder builder() {\n        return new Builder();\n    }\n\n    public TypeScriptSettings getSettings() {\n        return settings;\n    }\n\n    public Model getModel() {\n        return model;\n    }\n\n    public ServiceShape getService() {\n        return service;\n    }\n\n    public OperationShape getOperation() {\n        return operation;\n    }\n\n    public SymbolProvider getSymbolProvider() {\n        return symbolProvider;\n    }\n\n    public List<RuntimeClientPlugin> getRuntimeClientPlugins() {\n        return runtimeClientPlugins;\n    }\n\n    public Optional<ProtocolGenerator> getProtocolGenerator() {\n        return Optional.ofNullable(protocolGenerator);\n    }\n\n    public ApplicationProtocol getApplicationProtocol() {\n        return applicationProtocol;\n    }\n\n    public static class Builder implements SmithyBuilder<SmithyContextCodeSection> {\n\n        private TypeScriptSettings settings;\n        private Model model;\n        private ServiceShape service;\n        private OperationShape operation;\n        private SymbolProvider symbolProvider;\n        private List<RuntimeClientPlugin> runtimeClientPlugins;\n        private ProtocolGenerator protocolGenerator;\n        private ApplicationProtocol applicationProtocol;\n\n        @Override\n        public SmithyContextCodeSection build() {\n            return new SmithyContextCodeSection(this);\n        }\n\n        public Builder settings(TypeScriptSettings settings) {\n            this.settings = settings;\n            return this;\n        }\n\n        public Builder model(Model model) {\n            this.model = model;\n            return this;\n        }\n\n        public Builder service(ServiceShape service) {\n            this.service = service;\n            return this;\n        }\n\n        public Builder operation(OperationShape operation) {\n            this.operation = operation;\n            return this;\n        }\n\n        public Builder symbolProvider(SymbolProvider symbolProvider) {\n            this.symbolProvider = symbolProvider;\n            return this;\n        }\n\n        public Builder runtimeClientPlugins(List<RuntimeClientPlugin> runtimeClientPlugins) {\n            this.runtimeClientPlugins = runtimeClientPlugins;\n            return this;\n        }\n\n        public Builder protocolGenerator(ProtocolGenerator protocolGenerator) {\n            this.protocolGenerator = protocolGenerator;\n            return this;\n        }\n\n        public Builder applicationProtocol(ApplicationProtocol applicationProtocol) {\n            this.applicationProtocol = applicationProtocol;\n            return this;\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/util/ClientWriterConsumer.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.sections.ClientBodyExtraCodeSection;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * The writer consumer for a RuntimeClientPlugin. May be used to add imports and dependencies\n * used by the plugin at the client level.\n */\n@FunctionalInterface\n@SmithyInternalApi\npublic interface ClientWriterConsumer {\n    void accept(TypeScriptWriter writer, ClientBodyExtraCodeSection section);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/util/CommandWriterConsumer.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.sections.CommandConstructorCodeSection;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * The writer consumer for a RuntimeClientPlugin. May be used to add imports and dependencies\n * used by the plugin at the command level.\n */\n@FunctionalInterface\n@SmithyInternalApi\npublic interface CommandWriterConsumer {\n    void accept(TypeScriptWriter writer, CommandConstructorCodeSection section);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/util/JavaScriptObjectWriter.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Serializes Smithy {@link Node} values to JavaScript object/array literals.\n */\n@SmithyInternalApi\npublic final class JavaScriptObjectWriter {\n\n    private JavaScriptObjectWriter() {}\n\n    /**\n     * Generic JSON -> JS serializer.\n     */\n    public static String serialize(Node node) {\n        if (node.isObjectNode()) {\n            ObjectNode obj = node.expectObjectNode();\n            String members = obj.getMembers()\n                .entrySet()\n                .stream()\n                .map(e -> \"\\\"%s\\\": %s\".formatted(e.getKey().getValue(), serialize(e.getValue())))\n                .collect(Collectors.joining(\", \"));\n            return \"{\" + members + \"}\";\n        }\n        if (node.isArrayNode()) {\n            String elements = node.expectArrayNode()\n                .getElements()\n                .stream()\n                .map(JavaScriptObjectWriter::serialize)\n                .collect(Collectors.joining(\", \"));\n            return \"[\" + elements + \"]\";\n        }\n        if (node.isBooleanNode()) {\n            return String.valueOf(node.expectBooleanNode().getValue());\n        }\n        if (node.isStringNode()) {\n            String value = node.expectStringNode().getValue();\n            if (value.contains(\"\\\"\")) {\n                if (value.contains(\"`\")) {\n                    return \"\\\"%s\\\"\".formatted(value.replace(\"\\\"\", \"\\\\\\\"\"));\n                }\n                return \"`%s`\".formatted(value);\n            }\n            return \"\\\"%s\\\"\".formatted(value);\n        }\n        if (node.isNumberNode()) {\n            return node.expectNumberNode().getValue().toString();\n        }\n        return node.toString();\n    }\n\n    /**\n     * Serialize a Smithy Node to a JavaScript literal, with endpoint rules\n     * engine conventions: objects with a \"ref\" member become {@code [1, \"name\"]},\n     * objects with an \"fn\" member become {@code [0, \"fn\", [argv]]}.\n     */\n    public static String serializeEndpointNode(Node node) {\n        if (node.isObjectNode()) {\n            ObjectNode obj = node.expectObjectNode();\n            if (obj.getMember(\"ref\").isPresent()) {\n                return \"[1, \\\"%s\\\"]\".formatted(obj.expectStringMember(\"ref\").getValue());\n            }\n            if (obj.getMember(\"fn\").isPresent()) {\n                String fn = obj.expectStringMember(\"fn\").getValue();\n                String argv = serializeEndpointNode(obj.expectArrayMember(\"argv\"));\n                return \"[0, \\\"%s\\\", %s]\".formatted(fn, argv);\n            }\n            String members = obj.getMembers()\n                .entrySet()\n                .stream()\n                .map(e -> \"\\\"%s\\\": %s\".formatted(e.getKey().getValue(), serializeEndpointNode(e.getValue())))\n                .collect(Collectors.joining(\", \"));\n            return \"{\" + members + \"}\";\n        }\n        if (node.isArrayNode()) {\n            String elements = node.expectArrayNode()\n                .getElements()\n                .stream()\n                .map(JavaScriptObjectWriter::serializeEndpointNode)\n                .collect(Collectors.joining(\", \"));\n            return \"[\" + elements + \"]\";\n        }\n        return serialize(node);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/util/PatternDetectionCompression.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport java.util.ArrayList;\nimport java.util.LinkedHashMap;\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Java port of PatternDetection.js compression algorithm.\n *\n * Compresses a JSON ObjectNode by extracting repeated patterns into\n * reusable JavaScript variables, producing JS code that reconstitutes\n * the original object.\n */\n@SmithyInternalApi\npublic class PatternDetectionCompression {\n\n    /**\n     * Alphabet available to the variable name generator.\n     * omits \"r\" for other use.\n     */\n    private static final String ALPHABET =\n        \"abcdefghijklmnopqstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n    private static final Pattern WORD_ONLY_KEY = Pattern.compile(\"\\\"(\\\\w+)\\\":\");\n    private static final Pattern SSA_PATTERN = Pattern.compile(\"_ssa_(\\\\d{1,2})\");\n\n    private final ObjectNode objectNode;\n\n    /**\n     * Variable ID to code block string.\n     */\n    private final Map<Integer, String> varIdToBlock = new LinkedHashMap<>();\n\n    /**\n     * Reverse map of code block string to variable id.\n     */\n    private final Map<String, Integer> blockToVarId = new LinkedHashMap<>();\n\n    /**\n     * Number of times each variable has been detected in the JSON blob.\n     */\n    private final Map<Integer, Integer> varIdToCount = new LinkedHashMap<>();\n\n    /**\n     * Unique JSON path mapped to the variable that can replace it.\n     */\n    private final Map<String, Integer> pathToVarId = new LinkedHashMap<>();\n\n    /**\n     * Set of unique paths encountered in the JSON object.\n     */\n    private final Set<String> pathsSeen = new LinkedHashSet<>();\n\n    /**\n     * Set of variables that actually get used (as opposed to only marked).\n     * These will be assigned symbols for write output.\n     */\n    private final Set<Integer> variableIdsUsed = new LinkedHashSet<>();\n\n    /**\n     * Map of object key strings to their assigned variable id.\n     */\n    private final Map<String, Integer> keyToVarId = new LinkedHashMap<>();\n\n    /**\n     * Next available variable id. Increments when used.\n     */\n    private int variableId = 0;\n\n    /**\n     * Tracks the next available variable name, e.g.\n     * a, b, ... z, A ... Z, aa, ab, ac, ad ...\n     */\n    private int[] varName = {0};\n\n    /**\n     * 'read' or 'write' mode.\n     */\n    private String mode = \"read\";\n\n    private final Map<String, Integer> writeReplacements = new LinkedHashMap<>();\n\n    /**\n     * For SSA replacements, tracks the SSA number for each replaced path.\n     */\n    private final Map<String, String> writeReplacementSsaNum = new LinkedHashMap<>();\n\n    /**\n     * Maps a normalized SSA block (with _ssa_N replaced by _ssa_) to the set of\n     * actual SSA numbers seen, enabling template function generation.\n     */\n    private final Map<String, List<String>> ssaTemplateNumbers = new LinkedHashMap<>();\n\n    /**\n     * Maps original block strings to their SSA-normalized form.\n     */\n    private final Map<String, String> blockToSsaNormalized = new LinkedHashMap<>();\n\n    public PatternDetectionCompression(ObjectNode objectNode) {\n        this.objectNode = objectNode;\n    }\n\n    /**\n     * @return JS code that evaluates to an exact match of the original object.\n     */\n    public String compress() {\n        // First pass: read\n        traverse(objectNode, \"\", null);\n\n        // Second pass: write (collect replacements)\n        mode = \"write\";\n        traverse(objectNode, \"\", null);\n        mode = \"read\";\n\n        // Apply replacements and serialize\n        Node replaced = applyReplacements(objectNode, \"\");\n\n        // Serialize modified clone and strip quotes from word-only keys\n        String serialized = jsonStringify(replaced);\n        String buffer = \"const _data=\" + stripWordOnlyKeyQuotes(serialized) + \";\";\n\n        // Sort used variable IDs: numbers/strings first, then booleans, then objects, then arrays\n        List<Integer> orderedVariableIds = getOrderedVariableIds();\n\n        // Code blocks\n        List<String> codeBlockBuffer = new ArrayList<>();\n        for (int variableIdVal : orderedVariableIds) {\n            String symbol = nextVariableName();\n            String block = varIdToBlock.get(variableIdVal);\n\n            // Check if this is an SSA template\n            if (ssaTemplateNumbers.containsKey(block)) {\n                // Emit a template function: symbol=(n)=>\"prefix_ssa_\"+n+\"suffix\"\n                String inner = block.substring(1, block.length() - 1); // strip quotes\n                String[] parts = inner.split(\"_ssa_\", -1);\n                StringBuilder templateBody = new StringBuilder(\"\\\"\");\n                for (int i = 0; i < parts.length; ++i) {\n                    if (i > 0) {\n                        templateBody.append(\"_ssa_\\\"+n+\\\"\");\n                    }\n                    templateBody.append(parts[i]);\n                }\n                templateBody.append(\"\\\"\");\n                codeBlockBuffer.add(symbol + \"=(n: number)=>\" + templateBody);\n\n                // Replace SSA placeholders with function calls\n                Pattern ssaPlaceholder = Pattern.compile(\n                    \"\\\"__REPLACE__\" + variableIdVal + \"__SSA__(\\\\d{1,2})__REPLACE__\\\"\"\n                );\n                Matcher ssaM = ssaPlaceholder.matcher(buffer);\n                StringBuilder sb = new StringBuilder();\n                while (ssaM.find()) {\n                    ssaM.appendReplacement(sb, symbol + \"(\" + ssaM.group(1) + \")\");\n                }\n                ssaM.appendTail(sb);\n                buffer = sb.toString();\n            } else {\n                codeBlockBuffer.add(symbol + \"=\" + block);\n            }\n\n            // Replace non-SSA placeholders\n            buffer = buffer.replace(\n                \"\\\"__REPLACE__\" + variableIdVal + \"__REPLACE__\\\"\",\n                symbol\n            );\n        }\n\n        // Cross-reference code blocks\n        for (int i = 0; i < codeBlockBuffer.size(); ++i) {\n            int iIndex = codeBlockBuffer.get(i).indexOf(\"=\");\n            String iSymbol = codeBlockBuffer.get(i).substring(0, iIndex);\n            String iCode = codeBlockBuffer.get(i).substring(iIndex + 1);\n\n            for (int j = i + 1; j < codeBlockBuffer.size(); ++j) {\n                int jIndex = codeBlockBuffer.get(j).indexOf(\"=\");\n                String jCode = codeBlockBuffer.get(j).substring(jIndex + 1);\n\n                if (jCode.contains(iCode)) {\n                    if (iCode.charAt(0) != '\"' && iCode.length() < 6) {\n                        continue;\n                    }\n\n                    String escapedICode = Pattern.quote(iCode);\n                    String keyPattern = escapedICode + \":([^ ])\";\n                    codeBlockBuffer.set(\n                        j,\n                        codeBlockBuffer.get(j).replaceAll(keyPattern, \"[\" + iSymbol + \"]:$1\")\n                    );\n\n                    codeBlockBuffer.set(\n                        j,\n                        codeBlockBuffer.get(j).replace(iCode, iSymbol)\n                    );\n                }\n            }\n        }\n\n        if (!codeBlockBuffer.isEmpty()) {\n            buffer = \"const \" + String.join(\",\\n\", codeBlockBuffer) + \";\\n\" + buffer;\n        }\n\n        // Object keys\n        List<String> keyVarBuffer = new ArrayList<>();\n        for (String key : keyToVarId.keySet()) {\n            Pattern keyPattern = Pattern.compile(Pattern.quote(\"\\\"\" + key + \"\\\":\"));\n            Matcher matcher = keyPattern.matcher(buffer);\n            int count = 0;\n            while (matcher.find()) {\n                count += 1;\n            }\n\n            if (count > 1 && (long) key.length() * count > 8) {\n                String symbol = nextVariableName();\n                keyVarBuffer.add(symbol + \"=\\\"\" + key + \"\\\"\");\n                buffer = buffer.replaceAll(\n                    \"\\\"?\" + Pattern.quote(key) + \"\\\"?:([^ ])\",\n                    \"[\" + symbol + \"]:$1\"\n                );\n            }\n        }\n        if (!keyVarBuffer.isEmpty()) {\n            buffer = \"const \" + String.join(\",\\n\", keyVarBuffer) + \";\\n\" + buffer;\n        }\n\n        buffer = prettyPrintData(buffer);\n        buffer += \"\\n\";\n\n        return buffer;\n    }\n\n    /**\n     * Allocates the next unique variable id.\n     */\n    private int markVariableId() {\n        return variableId++;\n    }\n\n    /**\n     * Allocates the next required variable name for code output.\n     */\n    private String nextVariableName() {\n        StringBuilder out = new StringBuilder();\n        for (int i = varName.length - 1; i >= 0; --i) {\n            out.append(ALPHABET.charAt(varName[i]));\n        }\n\n        boolean carry = false;\n        for (int i = 0; i < varName.length; ++i) {\n            int n = varName[i];\n            if (n >= ALPHABET.length() - 1) {\n                varName[i] = 0;\n                carry = true;\n                continue;\n            }\n            if (carry) {\n                varName[i] += 1;\n                carry = false;\n            } else {\n                varName[i] += 1;\n                break;\n            }\n        }\n        if (carry) {\n            int[] newVarName = new int[varName.length + 1];\n            System.arraycopy(varName, 0, newVarName, 0, varName.length);\n            newVarName[varName.length] = 0;\n            varName = newVarName;\n        }\n        return out.toString();\n    }\n\n    private static String jsonStringify(Node node) {\n        return Node.printJson(node);\n    }\n\n    /**\n     * Recursive.\n     * @param node - the current node in traversal.\n     * @param path - the unique JSON path to the current node.\n     * @param key - the object key for this node, if available.\n     */\n    private void traverse(Node node, String path, String key) {\n        Integer optionalReplace = work(node, path, key);\n        if (optionalReplace != null) {\n            variableIdsUsed.add(optionalReplace);\n            writeReplacements.put(path, optionalReplace);\n            // If this is an SSA string, record which number it uses.\n            if (node.isStringNode()) {\n                String block = jsonStringify(node);\n                if (blockToSsaNormalized.containsKey(block)) {\n                    Matcher ssaM = SSA_PATTERN.matcher(block);\n                    if (ssaM.find()) {\n                        writeReplacementSsaNum.put(path, ssaM.group(1));\n                    }\n                }\n            }\n            return;\n        }\n\n        if (node.isArrayNode()) {\n            ArrayNode arrayNode = node.expectArrayNode();\n            List<Node> elements = arrayNode.getElements();\n            for (int i = 0; i < elements.size(); ++i) {\n                traverse(elements.get(i), path + \"[\" + i + \"]\", null);\n            }\n        } else if (node.isObjectNode()) {\n            ObjectNode objNode = node.expectObjectNode();\n            objNode.getMembers().forEach((k, v) -> {\n                String keyStr = k.getValue();\n                traverse(v, path + \"[`\" + keyStr + \"`]\", keyStr);\n            });\n        }\n    }\n\n    /**\n     * Actions on a node during traversal.\n     */\n    private Integer work(Node node, String path, String key) {\n        if (\"read\".equals(mode)) {\n            return read(node, path, key);\n        } else if (\"write\".equals(mode)) {\n            return write(node, path);\n        }\n        return null;\n    }\n\n    /**\n     * Scan the current node and note its unique JSON\n     * representation. Allocate variables to the JSON strings.\n     */\n    private Integer read(Node node, String path, String key) {\n        String block = jsonStringify(node);\n        if (pathsSeen.contains(path)) {\n            throw new RuntimeException(\"already seen: \" + path);\n        }\n        pathsSeen.add(path);\n\n        if (key != null) {\n            int varId = markVariableId();\n            keyToVarId.put(key, varId);\n            varIdToBlock.put(varId, key);\n        }\n\n        // For strings containing _ssa_N, normalize to group them together.\n        String lookupBlock = block;\n        if (node.isStringNode()) {\n            Matcher ssaM = SSA_PATTERN.matcher(block);\n            if (ssaM.find()) {\n                String normalized = SSA_PATTERN.matcher(block).replaceAll(\"_ssa_\");\n                lookupBlock = normalized;\n                blockToSsaNormalized.put(block, normalized);\n                String num = ssaM.group(1);\n                ssaTemplateNumbers.computeIfAbsent(normalized, k -> new ArrayList<>()).add(num);\n            }\n        }\n\n        if (blockToVarId.containsKey(lookupBlock)) {\n            int varId = blockToVarId.get(lookupBlock);\n            varIdToCount.put(varId, varIdToCount.get(varId) + 1);\n        } else {\n            int varId = markVariableId();\n            blockToVarId.put(lookupBlock, varId);\n            varIdToBlock.put(varId, lookupBlock);\n            varIdToCount.put(varId, 1);\n            pathToVarId.put(path, varId);\n        }\n        return null;\n    }\n\n    /**\n     * Check whether the node is worth replacing with\n     * a previously recorded variable id.\n     * @return variable id if replacement is desired, otherwise null.\n     */\n    private Integer write(Node node, String path) {\n        String block = jsonStringify(node);\n        String lookupBlock = blockToSsaNormalized.getOrDefault(block, block);\n\n        if (blockToVarId.containsKey(lookupBlock)) {\n            int variable = blockToVarId.get(lookupBlock);\n            int count = varIdToCount.get(variable);\n            if (count >= 2 && (long) lookupBlock.length() * count >= 10) {\n                return variable;\n            }\n        }\n        return null;\n    }\n\n    private Node applyReplacements(Node node, String path) {\n        if (writeReplacements.containsKey(path)) {\n            int varId = writeReplacements.get(path);\n            String ssaNum = writeReplacementSsaNum.get(path);\n            if (ssaNum != null) {\n                return Node.from(\"__REPLACE__\" + varId + \"__SSA__\" + ssaNum + \"__REPLACE__\");\n            }\n            return Node.from(\"__REPLACE__\" + varId + \"__REPLACE__\");\n        }\n\n        if (node.isArrayNode()) {\n            ArrayNode arrayNode = node.expectArrayNode();\n            List<Node> elements = arrayNode.getElements();\n            List<Node> newElements = new ArrayList<>();\n            for (int i = 0; i < elements.size(); ++i) {\n                newElements.add(applyReplacements(elements.get(i), path + \"[\" + i + \"]\"));\n            }\n            return ArrayNode.fromNodes(newElements);\n        } else if (node.isObjectNode()) {\n            ObjectNode objNode = node.expectObjectNode();\n            ObjectNode.Builder builder = ObjectNode.builder();\n            objNode.getMembers().forEach((k, v) -> {\n                String keyStr = k.getValue();\n                builder.withMember(keyStr, applyReplacements(v, path + \"[`\" + keyStr + \"`]\"));\n            });\n            return builder.build();\n        }\n        return node;\n    }\n\n    private List<Integer> getOrderedVariableIds() {\n        List<Integer> orderedVariableIds = new ArrayList<>(variableIdsUsed);\n        orderedVariableIds.sort((a, b) -> {\n            String boolStartChar = \"b\";\n            String aBlock = varIdToBlock.get(a);\n            String bBlock = varIdToBlock.get(b);\n            String aStartChar = String.valueOf(aBlock.charAt(0));\n            String bStartChar = String.valueOf(bBlock.charAt(0));\n\n            if (\"t\".equals(aStartChar) || \"f\".equals(aStartChar)) {\n                aStartChar = boolStartChar;\n            }\n            if (\"t\".equals(bStartChar) || \"f\".equals(bStartChar)) {\n                bStartChar = boolStartChar;\n            }\n\n            if (aStartChar.equals(bStartChar)) {\n                return 0;\n            }\n\n            for (String startChar : new String[] {\"[\", \"{\", \"\\\"\", boolStartChar}) {\n                if (aStartChar.equals(startChar)) {\n                    return 1;\n                } else if (bStartChar.equals(startChar)) {\n                    return -1;\n                }\n            }\n\n            throw new RuntimeException(\"unexpected start char: \" + aStartChar + \", \" + bStartChar);\n        });\n        return orderedVariableIds;\n    }\n\n    private static String stripWordOnlyKeyQuotes(String json) {\n        return WORD_ONLY_KEY.matcher(json).replaceAll(\"$1:\");\n    }\n\n    /**\n     * Reformats the _data={...}; portion of the buffer to add newlines and indentation\n     * for top-level object keys and individual array entries within those keys.\n     */\n    private static String prettyPrintData(String buffer) {\n        int dataStart = buffer.indexOf(\"const _data=\");\n\n        if (dataStart < 0) {\n            return buffer;\n        }\n\n        int objectLiteralStart = buffer.indexOf('{', dataStart);\n\n        // Find the matching closing brace at depth 0.\n        int depth = 0;\n        int objectLiteralEnd = -1;\n\n        for (int i = objectLiteralStart; i < buffer.length(); ++i) {\n            char c = buffer.charAt(i);\n            if (c == '\"') {\n                // skip string literals\n                i += 1;\n                while (i < buffer.length() && buffer.charAt(i) != '\"') {\n                    if (buffer.charAt(i) == '\\\\') {\n                        i += 1;\n                    }\n                    i += 1;\n                }\n            } else if (c == '{' || c == '[' || c == '(') {\n                depth += 1;\n            } else if (c == '}' || c == ']' || c == ')') {\n                depth -= 1;\n                if (depth == 0) {\n                    objectLiteralEnd = i;\n                    break;\n                }\n            }\n        }\n\n        if (objectLiteralEnd < 0) {\n            return buffer;\n        }\n\n        // Extract the content between the outer braces of _data={...}\n        String inner = buffer.substring(objectLiteralStart + 1, objectLiteralEnd);\n        StringBuilder b = new StringBuilder();\n        b.append(buffer, 0, objectLiteralStart);\n        b.append(\"{\\n\");\n\n        // Parse top-level key:value pairs (depth 0 commas separate them)\n        List<String> topEntries = splitAtDepthZero(inner);\n        for (int i = 0; i < topEntries.size(); ++i) {\n            String entry = topEntries.get(i);\n            // Find the colon separating key from value at depth 0\n            int colonPos = findDepthZeroColon(entry);\n            if (colonPos < 0) {\n                // No colon found, just indent it as-is\n                b.append(\"  \").append(entry.trim());\n            } else {\n                String key = entry.substring(0, colonPos + 1).trim();\n                String value = entry.substring(colonPos + 1).trim();\n                if (value.startsWith(\"[\")) {\n                    // Find matching \"]\" for this top-level array\n                    String arrayContent = value.substring(1, value.length() - 1);\n                    List<String> items = splitAtDepthZero(arrayContent);\n                    b.append(\"  \").append(key).append(\" [\\n\");\n                    for (int j = 0; j < items.size(); ++j) {\n                        b.append(\"    \").append(items.get(j).trim());\n                        if (j < items.size() - 1) {\n                            b.append(\",\");\n                        }\n                        b.append(\"\\n\");\n                    }\n                    b.append(\"  ]\");\n                } else {\n                    b.append(\"  \").append(key).append(\" \").append(value);\n                }\n            }\n            if (i < topEntries.size() - 1) {\n                b.append(\",\");\n            }\n            b.append(\"\\n\");\n        }\n\n        b.append(\"}\");\n        b.append(buffer, objectLiteralEnd + 1, buffer.length());\n        return b.toString();\n    }\n\n    /**\n     * Splits a string by a \",\" character, but only at bracket depth 0,\n     * respecting strings, brackets, and parentheses.\n     */\n    private static List<String> splitAtDepthZero(String s) {\n        List<String> parts = new ArrayList<>();\n        int depth = 0;\n        int start = 0;\n        for (int i = 0; i < s.length(); ++i) {\n            char c = s.charAt(i);\n            if (c == '\"') {\n                i += 1;\n                while (i < s.length() && s.charAt(i) != '\"') {\n                    if (s.charAt(i) == '\\\\') {\n                        i += 1;\n                    }\n                    i += 1;\n                }\n            } else if (c == '{' || c == '[' || c == '(') {\n                depth += 1;\n            } else if (c == '}' || c == ']' || c == ')') {\n                depth -= 1;\n            } else if (c == ',' && depth == 0) {\n                parts.add(s.substring(start, i));\n                start = i + 1;\n            }\n        }\n        if (start < s.length()) {\n            parts.add(s.substring(start));\n        }\n        return parts;\n    }\n\n    /**\n     * Finds the position of the first colon at bracket depth 0 in the string,\n     * which separates a key from its value in an object entry.\n     */\n    private static int findDepthZeroColon(String s) {\n        int depth = 0;\n        for (int i = 0; i < s.length(); ++i) {\n            char c = s.charAt(i);\n            if (c == '\"') {\n                i += 1;\n                while (i < s.length() && s.charAt(i) != '\"') {\n                    if (s.charAt(i) == '\\\\') {\n                        i += 1;\n                    }\n                    i += 1;\n                }\n            } else if (c == '{' || c == '[' || c == '(') {\n                depth += 1;\n            } else if (c == '}' || c == ']' || c == ')') {\n                depth -= 1;\n            } else if (c == ':' && depth == 0) {\n                return i;\n            }\n        }\n        return -1;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/util/PropertyAccessor.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport java.util.regex.Pattern;\n\npublic final class PropertyAccessor {\n\n    /**\n     * Starts with alpha or underscore, and contains only alphanumeric and underscores.\n     */\n    public static final Pattern VALID_JAVASCRIPT_PROPERTY_NAME = Pattern.compile(\"^(?![0-9])[a-zA-Z0-9$_]+$\");\n\n    private PropertyAccessor() {}\n\n    /**\n     * @param propertyName - property being accessed.\n     * @return brackets wrapping the name if it's not a valid JavaScript property name.\n     */\n    public static String getPropertyAccessor(String propertyName) {\n        if (VALID_JAVASCRIPT_PROPERTY_NAME.matcher(propertyName).matches()) {\n            return \".\" + propertyName;\n        }\n        if (propertyName.contains(\"\\\"\")) {\n            // This doesn't handle cases of the special characters being pre-escaped in the propertyName,\n            // but that case does not currently need to be addressed.\n            return \"[`\" + propertyName + \"`]\";\n        }\n        return \"[\\\"\" + propertyName + \"\\\"]\";\n    }\n\n    /**\n     * @param propertyName - property being accessed.\n     * @return brackets wrapping the name if it's not a valid JavaScript property name.\n     */\n    public static String inlineKey(String propertyName) {\n        if (VALID_JAVASCRIPT_PROPERTY_NAME.matcher(propertyName).matches()) {\n            return propertyName;\n        }\n        if (propertyName.contains(\"\\\"\")) {\n            return \"[`\" + propertyName.replace(\"`\", \"\\\\\\\\`\") + \"`]\";\n        }\n        return \"\\\"\" + propertyName.replace(\"`\", \"\\\\\\\\`\") + \"\\\"\";\n    }\n\n    /**\n     * @param variable - object host.\n     * @param propertyName - property being accessed.\n     * @return e.g. someObject.prop or someObject['property name'] or reluctantly someObject[`bad\"property\"name`].\n     */\n    public static String getFrom(String variable, String propertyName) {\n        return variable + getPropertyAccessor(propertyName);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/util/StringStore.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.LinkedList;\nimport java.util.Map;\nimport java.util.Objects;\nimport java.util.Queue;\nimport java.util.Set;\nimport java.util.TreeMap;\nimport java.util.function.Function;\nimport java.util.regex.Pattern;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Intended for use at the\n * {@link software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext}\n * level, this class allocates and tracks variables assigned to string literals, allowing a\n * form of compression on long protocol serde files.\n */\n@SmithyInternalApi\npublic class StringStore {\n\n    /**\n     * Words are the component strings found within `camelCaseWords` or `header-dashed-words`.\n     */\n    private static final Pattern FIND_WORDS = Pattern.compile(\"(x-amz)|(-\\\\w{3,})|(^[a-z]{3,})|([A-Z][a-z]{2,})\");\n\n    // order doesn't matter for this map.\n    private final Map<String, String> literalToVariable = new HashMap<>();\n\n    // this map should be ordered for consistent codegen output.\n    private final TreeMap<String, String> variableToLiteral = new TreeMap<>();\n\n    // controls incremental output.\n    private final Set<String> writeLog = new HashSet<>();\n\n    public StringStore() {}\n\n    /**\n     * @param literal - a literal string value.\n     * @return the variable name assigned for that string, which may have been encountered before.\n     */\n    public String var(String literal) {\n        Objects.requireNonNull(literal);\n        return literalToVariable.computeIfAbsent(literal, this::assignKey);\n    }\n\n    /**\n     * @param literal - a literal string value.\n     * @param preferredPrefix - a preferred rather than derived variable name.\n     * @return allocates the variable with the preferred prefix.\n     */\n    public String var(String literal, String preferredPrefix) {\n        Objects.requireNonNull(literal);\n        return literalToVariable.computeIfAbsent(literal, (String key) -> assignPreferredKey(key, preferredPrefix));\n    }\n\n    /**\n     * @param literal - query.\n     * @return whether the literal has already been assigned.\n     */\n    public boolean hasVar(String literal) {\n        return literalToVariable.containsKey(literal);\n    }\n\n    /**\n     * Outputs the generated code for any constants that have been\n     * allocated but not yet retrieved.\n     */\n    public String flushVariableDeclarationCode() {\n        StringBuilder sourceCode = new StringBuilder();\n\n        for (Map.Entry<String, String> entry : variableToLiteral.entrySet()) {\n            String variable = entry.getKey();\n            String literal = entry.getValue();\n            if (writeLog.add(variable)) {\n                sourceCode.append(String.format(\"const %s = \\\"%s\\\";%n\", variable, literal));\n            }\n        }\n        return sourceCode.toString();\n    }\n\n    /**\n     * Assigns a new variable for a given string literal.\n     * Avoid calling assignKey more than once for a given literal, for example with\n     * {@link HashMap#computeIfAbsent(Object, Function)}, since it would\n     * allocate two different variables.\n     */\n    private String assignKey(String literal) {\n        String variable = allocateVariable(literal);\n        variableToLiteral.put(variable, literal);\n        return variable;\n    }\n\n    /**\n     * Allocates a variable name for a given string literal.\n     */\n    private String assignPreferredKey(String literal, String preferredPrefix) {\n        int numericSuffix = 0;\n        String candidate = preferredPrefix + numericSuffix;\n        while (variableToLiteral.containsKey(candidate)) {\n            numericSuffix += 1;\n            candidate = preferredPrefix + numericSuffix;\n        }\n        variableToLiteral.put(candidate, literal);\n        return candidate;\n    }\n\n    /**\n     * Assigns a unique variable using the letters from the literal.\n     * Prefers the uppercase or word-starting letters.\n     */\n    private String allocateVariable(String literal) {\n        String[] sections = Arrays.stream(literal.split(\"[-_\\\\s]\"))\n            .filter(s -> !s.isEmpty())\n            .toArray(String[]::new);\n        StringBuilder v = new StringBuilder(\"_\");\n        Queue<Character> deconfliction = new LinkedList<>();\n        if (sections.length > 1) {\n            for (String s : sections) {\n                char c = s.charAt(0);\n                if (isAllowedChar(c)) {\n                    v.append(c);\n                }\n            }\n        } else {\n            for (int i = 0; i < literal.length(); i++) {\n                char c = literal.charAt(i);\n                if ((c >= 'A' && c <= 'Z') || (isNeutral(v.toString()) && isAllowedChar(c))) {\n                    v.append(c);\n                } else if (isAllowedChar(c)) {\n                    deconfliction.add(c);\n                }\n            }\n        }\n        if (v.isEmpty()) {\n            v.append(\"v\");\n        }\n        while (variableToLiteral.containsKey(v.toString())) {\n            if (!deconfliction.isEmpty()) {\n                v.append(deconfliction.poll());\n            } else {\n                v.append('_');\n            }\n        }\n        return v.toString();\n    }\n\n    /**\n     * @return true if char is in A-Za-z.\n     */\n    private boolean isAllowedChar(char c) {\n        return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');\n    }\n\n    /**\n     * @return true if the variable has only underscores.\n     */\n    private boolean isNeutral(String variable) {\n        for (int i = 0; i < variable.length(); i++) {\n            if (variable.charAt(i) != '_') {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/validation/ImportFrom.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport java.util.Set;\nimport software.amazon.smithy.utils.SetUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Interprets the string portion of an import statement.\n */\n@SmithyInternalApi\npublic class ImportFrom {\n\n    public static final Set<String> NODE_NATIVE_DEPENDENCIES = SetUtils.of(\n        \"buffer\",\n        \"child_process\",\n        \"crypto\",\n        \"dns\",\n        \"events\",\n        \"fs\",\n        \"http\",\n        \"http2\",\n        \"https\",\n        \"os\",\n        \"path\",\n        \"process\",\n        \"stream\",\n        \"tls\",\n        \"url\",\n        \"util\",\n        \"zlib\"\n    );\n\n    private final String from;\n\n    public ImportFrom(String importTargetExpression) {\n        this.from = importTargetExpression;\n    }\n\n    /**\n     * @return whether we recognize it as a Node.js native module. These\n     * do not need to be declared in package.json. This check\n     * is not exhaustive since the list of native modules varies\n     * by version.\n     */\n    public boolean isNodejsNative() {\n        String[] packageNameSegments = from.split(\"/\");\n        return from.startsWith(\"node:\") || NODE_NATIVE_DEPENDENCIES.contains(packageNameSegments[0]);\n    }\n\n    /**\n     * @return whether the import has an org or namespace prefix like \\@smithy/pkg.\n     */\n    public boolean isNamespaced() {\n        return from.startsWith(\"@\") && from.contains(\"/\");\n    }\n\n    /**\n     * @return whether the import starts with / or . indicating a relative import.\n     * These would not be added to package.json dependencies.\n     */\n    public boolean isRelative() {\n        return from.startsWith(\"/\") || from.startsWith(\".\");\n    }\n\n    /**\n     * @return whether the import should correspond to an entry in\n     * package.json.\n     */\n    public boolean isDeclarablePackageImport() {\n        return !isNodejsNative() && !isRelative();\n    }\n\n    /**\n     * @return the package name. This excludes sub-paths of packages.\n     *\n     * For example in \\@smithy/pkg/module the package name is \\@smithy/pkg.\n     */\n    public String getPackageName() {\n        String[] packageNameSegments = from.split(\"/\");\n        String packageName;\n        if (isNodejsNative()) {\n            packageName = packageNameSegments[0].substring(\"node:\".length());\n        } else if (isNamespaced()) {\n            packageName = packageNameSegments[0] + \"/\" + packageNameSegments[1];\n        } else {\n            packageName = packageNameSegments[0];\n        }\n        return packageName;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/validation/LongValidator.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport java.util.List;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.neighbor.Walker;\nimport software.amazon.smithy.model.shapes.LongShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.validation.AbstractValidator;\nimport software.amazon.smithy.model.validation.ValidationEvent;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.utils.OptionalUtils;\n\n/**\n * This emits a DANGER validation event for any Long shape in the model\n * connected to a service. This is because a long can't be properly supported\n * by the number type in JavaScript.\n *\n * This validator is deliberately not registered to be automatically run. It\n * is run explicitly for SSDK generation.\n */\npublic final class LongValidator extends AbstractValidator {\n\n    private TypeScriptSettings settings;\n\n    public LongValidator(TypeScriptSettings settings) {\n        this.settings = settings;\n    }\n\n    @Override\n    public List<ValidationEvent> validate(Model model) {\n        ServiceShape service = model.expectShape(settings.getService(), ServiceShape.class);\n        Set<LongShape> longs = new Walker(model)\n            .walkShapes(service)\n            .stream()\n            .flatMap(shape -> OptionalUtils.stream(shape.asLongShape()))\n            .collect(Collectors.toSet());\n\n        return longs\n            .stream()\n            .map(\n                shape -> warning(\n                    shape,\n                    \"JavaScript numbers are all IEEE-754 double-precision floats. As a \" +\n                        \"consequence of this, the maximum safe value for integral numbers is 2^53 - 1. Since a \"\n                        +\n                        \"long shape can have values up to 2^63 - 1, there is a significant range of values that \"\n                        +\n                        \"cannot be safely represented in JavaScript. If possible, use the int shape. If values \"\n                        +\n                        \"outside of the safe range of JavaScript integrals are needed, it is recommended to use a \"\n                        +\n                        \"string shape instead.\"\n                )\n            )\n            .collect(Collectors.toList());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/validation/ReplaceLast.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\npublic abstract class ReplaceLast {\n\n    /**\n     * @param original - source string.\n     * @param target - substring to be replaced.\n     * @param replacement - the replacement.\n     * @return original with the last occurrence of the target string replaced by the replacement string.\n     */\n    public static String in(String original, String target, String replacement) {\n        int lastPosition = original.lastIndexOf(target);\n        if (lastPosition >= 0) {\n            return (original.substring(0, lastPosition) + replacement\n                + original.substring(lastPosition + target.length()));\n        }\n        return original;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/validation/SensitiveDataFinder.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Set;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.selector.Selector;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\n\n/**\n * This validator tells you whether a shape contains sensitive data fields.\n * This is used to decide whether a sensitive log filter function needs to be\n * generated for\n * a given shape.\n */\npublic class SensitiveDataFinder {\n\n    private Map<Shape, Boolean> cache = new HashMap<>();\n    private final Model model;\n\n    /**\n     * @param model - model context for the {@link #findsSensitiveDataIn(Shape)}\n     *              queries.\n     */\n    public SensitiveDataFinder(Model model) {\n        this.model = model;\n    }\n\n    /**\n     * @param shape - the shape in question.\n     * @return whether a sensitive field exists in the shape and its downstream\n     *         shapes.\n     */\n    public boolean findsSensitiveDataIn(Shape shape) {\n        boolean found = findRecursive(shape);\n        cache.put(shape, found);\n        return found;\n    }\n\n    private boolean findRecursive(Shape shape) {\n        if (cache.containsKey(shape)) {\n            return cache.get(shape);\n        }\n\n        if (shape.hasTrait(SensitiveTrait.class) || shape.hasTrait(StreamingTrait.class)) {\n            cache.put(shape, true);\n            return true;\n        }\n\n        if (\n            shape.getMemberTrait(model, SensitiveTrait.class).isPresent() ||\n                shape.getMemberTrait(model, StreamingTrait.class).isPresent()\n        ) {\n            cache.put(shape, true);\n            return true;\n        }\n\n        Selector sensitiveSelector = Selector.parse(\"[id = '\" + shape.getId() + \"']\" + \" ~> [trait|sensitive]\");\n        Selector streamingSelector = Selector.parse(\"[id = '\" + shape.getId() + \"']\" + \" ~> [trait|streaming]\");\n        Set<Shape> matches = sensitiveSelector.select(model);\n        matches.addAll(streamingSelector.select(model));\n\n        boolean found = !matches.isEmpty();\n        if (found) {\n            cache.put(shape, true);\n            return true;\n        }\n\n        if (shape instanceof MapShape) {\n            MemberShape keyMember = ((MapShape) shape).getKey();\n            MemberShape valMember = ((MapShape) shape).getValue();\n            return findRecursive(keyMember) || findRecursive(valMember);\n        }\n\n        cache.put(shape, false);\n        return false;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/validation/UnaryFunctionCall.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport java.util.regex.Pattern;\n\n/**\n * For handling expressions that may be unary function calls.\n */\npublic final class UnaryFunctionCall {\n\n    private static final Pattern CHECK_PATTERN = Pattern.compile(\"^(?!new ).+\\\\(((?!,).)*\\\\)$\");\n    private static final Pattern TO_REF_PATTERN = Pattern.compile(\"(.*)\\\\(.*\\\\)$\");\n\n    private UnaryFunctionCall() {\n        // Private\n    }\n\n    /**\n     * @param expression - to be examined.\n     * @return whether the expression is a single-depth function call with a single parameter.\n     */\n    public static boolean check(String expression) {\n        if (expression.equals(\"_\")) {\n            // not a call per se, but this indicates a pass-through function.\n            return true;\n        }\n        return maxCallDepth(expression) == 1 && CHECK_PATTERN.matcher(expression).matches();\n    }\n\n    /**\n     * @param callExpression the call expression to be converted. Check that\n     *                       the expression is a unary call first.\n     * @return the unary function call converted to a function reference.\n     */\n    public static String toRef(String callExpression) {\n        return TO_REF_PATTERN.matcher(callExpression).replaceAll(\"$1\");\n    }\n\n    /**\n     * Estimates the call depth of a function call expression.\n     *\n     * @param expression A function call expression (e.g., \"call() == 1\", \"call(call()) == 2\", etc).\n     */\n    private static int maxCallDepth(String expression) {\n        int depth = 0;\n        int maxDepth = 0;\n        for (int i = 0; i < expression.length(); ++i) {\n            char c = expression.charAt(i);\n            if (c == '(') {\n                depth += 1;\n                if (depth > maxDepth) {\n                    maxDepth = depth;\n                }\n                continue;\n            }\n            if (c == ')') {\n                depth -= 1;\n            }\n        }\n        return maxDepth;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin",
    "content": "software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin\nsoftware.amazon.smithy.typescript.codegen.TypeScriptServerCodegenPlugin\nsoftware.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin\nsoftware.amazon.smithy.typescript.codegen.TypeScriptSSDKCodegenPlugin\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration",
    "content": "software.amazon.smithy.typescript.codegen.endpointsV2.AddDefaultEndpointRuleSet\nsoftware.amazon.smithy.typescript.codegen.integration.AddBuiltinPlugins\nsoftware.amazon.smithy.typescript.codegen.integration.AddClientRuntimeConfig\nsoftware.amazon.smithy.typescript.codegen.integration.AddProtocolConfig\nsoftware.amazon.smithy.typescript.codegen.integration.AddEventStreamDependency\nsoftware.amazon.smithy.typescript.codegen.integration.AddChecksumRequiredDependency\nsoftware.amazon.smithy.typescript.codegen.integration.AddDefaultsModeDependency\nsoftware.amazon.smithy.typescript.codegen.auth.http.integration.AddHttpAuthSchemePlugin\nsoftware.amazon.smithy.typescript.codegen.auth.http.integration.AddHttpSigningPlugin\nsoftware.amazon.smithy.typescript.codegen.auth.http.integration.HttpAuthRuntimeExtensionIntegration\nsoftware.amazon.smithy.typescript.codegen.auth.http.integration.SupportNoAuth\nsoftware.amazon.smithy.typescript.codegen.auth.http.integration.SupportHttpApiKeyAuth\nsoftware.amazon.smithy.typescript.codegen.auth.http.integration.SupportHttpBearerAuth\nsoftware.amazon.smithy.typescript.codegen.integration.AddHttpApiKeyAuthPlugin\nsoftware.amazon.smithy.typescript.codegen.integration.AddBaseServiceExceptionClass\nsoftware.amazon.smithy.typescript.codegen.integration.AddSdkStreamMixinDependency\nsoftware.amazon.smithy.typescript.codegen.integration.DefaultReadmeGenerator\nsoftware.amazon.smithy.typescript.codegen.integration.AddCompressionDependency\nsoftware.amazon.smithy.typescript.codegen.protocols.AddProtocols\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/base-package.json",
    "content": "{\n  \"name\": \"${package}\",\n  \"description\": \"${packageDescription}\",\n  \"version\": \"${packageVersion}\",\n  \"scripts\": {\n    \"build\": \"concurrently '${packageManager}:build:cjs' '${packageManager}:build:es' '${packageManager}:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"build:types:downlevel\": \"downlevel-dts dist-types dist-types/ts3.4\",\n    \"test:index\": \"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs\",\n    \"clean\": \"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo\",\n    \"prepack\": \"${packageManager} run clean && ${packageManager} run build\"\n  },\n  \"main\": \"./dist-cjs/index.js\",\n  \"types\": \"./dist-types/index.d.ts\",\n  \"module\": \"./dist-es/index.js\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"tslib\": \"^2.6.2\"\n  },\n  \"devDependencies\": {\n    \"@tsconfig/node20\": \"20.1.8\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"0.10.1\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\"\n  },\n  \"engines\": {\n    \"node\": \">=20.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.5\": {\n      \"dist-types/*\": [\"dist-types/ts3.4/*\"]\n    }\n  },\n  \"files\": [\"dist-*/**\"]\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/extensionConfiguration.template",
    "content": "/**\n * @internal\n */\nexport interface ${extensionConfigName}\n  extends ${extensionConfigInterfaces} {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/framework-errors.smithy",
    "content": "namespace smithy.framework\n\n@error(\"server\")\n@httpError(500)\nstructure InternalFailure {}\n\n@error(\"client\")\n@httpError(404)\nstructure UnknownOperationException {}\n\n@error(\"client\")\n@httpError(400)\nstructure SerializationException {}\n\n@error(\"client\")\n@httpError(415)\nstructure UnsupportedMediaTypeException {}\n\n@error(\"client\")\n@httpError(406)\nstructure NotAcceptableException {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/integration/default_readme_client.md.template",
    "content": "<!-- generated file, do not edit directly -->\n\n# ${packageName}\n\n## Description\n\nSDK for JavaScript ${serviceId} Client for Node.js, Browser and React Native.\n\n${documentation}\n\n## Installing\nTo install the this package, simply type add or install ${packageName}\nusing your favorite package manager:\n- `npm install ${packageName}`\n- `yarn add ${packageName}`\n- `pnpm add ${packageName}`\n\n## Getting Started\n\n### Import\n\nTo send a request, you only need to import the `${serviceId}Client` and\nthe commands you need, for example `${commandName}Command`:\n\n```js\n// CJS example\nconst { ${serviceId}Client, ${commandName}Command } = require(\"${packageName}\");\n```\n\n```ts\n// ES6+ example\nimport { ${serviceId}Client, ${commandName}Command } from \"${packageName}\";\n```\n\n### Usage\n\nTo send a request, you:\n\n- Initiate client with configuration.\n- Initiate command with input parameters.\n- Call `send` operation on client with command object as input.\n- If you are using a custom http handler, you may call `destroy()` to close open connections.\n\n```js\n// a client can be shared by different commands.\nconst client = new ${serviceId}Client();\n\nconst params = { /** input parameters */ };\nconst command = new ${commandName}Command(params);\n```\n\n#### Async/await\n\nWe recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)\noperator to wait for the promise returned by send operation as follows:\n\n```js\n// async/await.\ntry {\n  const data = await client.send(command);\n  // process data.\n} catch (error) {\n  // error handling.\n} finally {\n  // finally.\n}\n```\n\nAsync-await is clean, concise, intuitive, easy to debug and has better error handling\nas compared to using Promise chains or callbacks.\n\n#### Promises\n\nYou can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining)\nto execute send operation.\n\n```js\nclient.send(command).then(\n  (data) => {\n    // process data.\n  },\n  (error) => {\n    // error handling.\n  }\n);\n```\n\nPromises can also be called using `.catch()` and `.finally()` as follows:\n\n```js\nclient\n  .send(command)\n  .then((data) => {\n    // process data.\n  })\n  .catch((error) => {\n    // error handling.\n  })\n  .finally(() => {\n    // finally.\n  });\n```\n\n#### Callbacks\n\nWe do not recommend using callbacks because of [callback hell](http://callbackhell.com/),\nbut they are supported by the send operation.\n\n```js\n// callbacks.\nclient.send(command, (err, data) => {\n  // process err and data.\n});\n```\n\n### Troubleshooting\n\nWhen the service returns an exception, the error will include the exception information,\nas well as response metadata (e.g. request id).\n\n```js\ntry {\n  const data = await client.send(command);\n  // process data.\n} catch (error) {\n  const { requestId, httpStatusCode } = error.$$metadata;\n  console.log({ requestId, httpStatusCode });\n  /**\n   * The keys within exceptions are also parsed.\n   * You can access them by specifying exception names:\n   * if (error.name === 'SomeServiceException') {\n   *     const value = error.specialKeyInException;\n   * }\n   */\n}\n```\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/integration/default_readme_server.md.template",
    "content": "<!-- generated file, do not edit directly -->\n\n# ${packageName}\n\n## Description\n\nJavaScript Server SDK for ${serviceId}\n\n${documentation}\n\n## Installing\nTo install this package, simply type add or install ${packageName}\nusing your favorite package manager:\n- `npm install ${packageName}`\n- `yarn add ${packageName}`\n- `pnpm add ${packageName}`\n\n## Getting Started\n\nBelow is an example service handler created for the ${commandName} operation.\n\n```ts\nimport { createServer, IncomingMessage, ServerResponse } from \"http\";\nimport { HttpRequest } from \"@smithy/protocol-http\";\nimport {\n  ${serviceId}Service as __${serviceId}Service,\n  ${commandName}Input,\n  ${commandName}Output,\n  get${serviceId}ServiceHandler\n} from \"${packageName}\";\nimport { convertEvent, convertResponse } from \"@aws-smithy/server-node\";\n\nclass ${serviceId}Service implements __${serviceId}Service {\n  ${commandName}(input: ${commandName}Input, request: HttpRequest): ${commandName}Output {\n    // Populate your business logic\n  }\n}\n\nconst serviceHandler = get${serviceId}ServiceHandler(new ${serviceId}Service());\n\nconst server = createServer(async function (\n  req: IncomingMessage,\n  res: ServerResponse<IncomingMessage> & { req: IncomingMessage }\n) {\n  // Convert NodeJS's http request to an HttpRequest.\n  const httpRequest = convertRequest(req);\n\n  // Call the service handler, which will route the request to the GreetingService\n  // implementation and then serialize the response to an HttpResponse.\n  const httpResponse = await serviceHandler.handle(httpRequest);\n\n  // Write the HttpResponse to NodeJS http's response expected format.\n  return writeResponse(httpResponse, res);\n});\n\nserver.listen(3000);\n```\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth.ts",
    "content": "// derived from https://github.com/aws/aws-sdk-js-v3/blob/e35f78c97fa6710ff9c444351893f0f06755e771/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts\n\nimport { normalizeProvider } from \"@smithy/core/client\";\nimport { HttpRequest } from \"@smithy/core/protocols\";\nimport { BuildMiddleware, Pluggable, Provider, RelativeMiddlewareOptions } from \"@smithy/types\";\n\ninterface HttpApiKeyAuthMiddlewareConfig {\n  /**\n   * Where to put the API key.\n   *\n   * If the value is `header`, the API key will be transported in the named header,\n   * optionally prefixed with the provided scheme.\n   *\n   * If the value is `query`, the API key will be transported in the named query parameter.\n   */\n  in: \"header\" | \"query\";\n\n  /**\n   * The name of the header / query parameter to use for the transporting the API key.\n   */\n  name: string;\n\n  /**\n   * The scheme to use. Only supported when `in` is `header`.\n   */\n  scheme?: string;\n}\n\nexport interface HttpApiKeyAuthInputConfig {\n  /**\n   * The API key to use when making requests.\n   *\n   * This is optional because some operations may not require an API key.\n   */\n  apiKey?: string | Provider<string>;\n}\n\nexport interface ApiKeyPreviouslyResolved {}\n\nexport interface HttpApiKeyAuthResolvedConfig {\n  /**\n   * The API key to use when making requests.\n   *\n   * This is optional because some operations may not require an API key.\n   */\n  apiKey?: Provider<string>;\n}\n\n// We have to provide a resolve function when we have config, even if it doesn't\n// actually do anything to the input value. \"If any of inputConfig, resolvedConfig,\n// or resolveFunction are set, then all of inputConfig, resolvedConfig, and\n// resolveFunction must be set.\"\nexport function resolveHttpApiKeyAuthConfig<T>(\n  input: T & ApiKeyPreviouslyResolved & HttpApiKeyAuthInputConfig\n): T & HttpApiKeyAuthResolvedConfig {\n  return {\n    ...input,\n    apiKey: input.apiKey ? normalizeProvider(input.apiKey) : undefined,\n  };\n}\n\n/**\n * Middleware to inject the API key into the HTTP request.\n *\n * The middleware will inject the client's configured API key into the\n * request as defined by the `@httpApiKeyAuth` trait. If the trait says to\n * put the API key into a named header, that header will be used, optionally\n * prefixed with a scheme. If the trait says to put the API key into a named\n * query parameter, that query parameter will be used.\n *\n * @param pluginConfig the client configuration. Includes the function that will return the API key value.\n * @param middlewareConfig the plugin options (location of the parameter, name, and optional scheme)\n * @returns a function that processes the HTTP request and passes it on to the next handler\n */\nexport const httpApiKeyAuthMiddleware =\n  <Input extends object, Output extends object>(\n    pluginConfig: HttpApiKeyAuthResolvedConfig,\n    middlewareConfig: HttpApiKeyAuthMiddlewareConfig\n  ): BuildMiddleware<Input, Output> =>\n  (next) =>\n  async (args) => {\n    if (!HttpRequest.isInstance(args.request)) return next(args);\n\n    const apiKey = pluginConfig.apiKey && (await pluginConfig.apiKey());\n\n    // This middleware will not be injected if the operation has the @optionalAuth trait.\n    // We don't know if we're the only auth middleware, so let the service deal with the\n    // absence of the API key (or let other middleware do its job).\n    if (!apiKey) {\n      return next(args);\n    }\n\n    return next({\n      ...args,\n      request: {\n        ...args.request,\n        headers: {\n          ...args.request.headers,\n          ...(middlewareConfig.in === \"header\" && {\n            // Set the header, even if it's already been set.\n            [middlewareConfig.name.toLowerCase()]: middlewareConfig.scheme\n              ? `${middlewareConfig.scheme} ${apiKey}`\n              : apiKey,\n          }),\n        },\n        query: {\n          ...args.request.query,\n          // Set the query parameter, even if it's already been set.\n          ...(middlewareConfig.in === \"query\" && { [middlewareConfig.name]: apiKey }),\n        },\n      },\n    });\n  };\n\nexport const httpApiKeyAuthMiddlewareOptions: RelativeMiddlewareOptions = {\n  name: \"httpApiKeyAuthMiddleware\",\n  tags: [\"APIKEY\", \"AUTH\"],\n  relation: \"after\",\n  toMiddleware: \"retryMiddleware\",\n  override: true,\n};\n\nexport const getHttpApiKeyAuthPlugin = (\n  pluginConfig: HttpApiKeyAuthResolvedConfig,\n  middlewareConfig: HttpApiKeyAuthMiddlewareConfig\n): Pluggable<any, any> => ({\n  applyToStack: (clientStack) => {\n    clientStack.addRelativeTo(\n      httpApiKeyAuthMiddleware(pluginConfig, middlewareConfig),\n      httpApiKeyAuthMiddlewareOptions\n    );\n  },\n});\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/malformed-request-test-regex-json-stub.ts",
    "content": "/**\n * Returns 'true' if the 'message' field in the serialized JSON document matches the given regex.\n */\nconst matchMessageInJsonBody = (body: string, messageRegex: string): Object => {\n  const parsedBody = JSON.parse(body);\n  if (!parsedBody.hasOwnProperty(\"message\")) {\n    return false;\n  }\n  return new RegExp(messageRegex).test(parsedBody[\"message\"]);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-cbor-stub.ts",
    "content": "const compareEquivalentCborBodies = (expectedBody: string, generatedBody: string | Uint8Array): undefined => {\n  expect(\n    normalizeByteArrayType(cbor.deserialize(typeof generatedBody === \"string\" ? toBytes(generatedBody) : generatedBody))\n  ).toEqual(normalizeByteArrayType(cbor.deserialize(toBytes(expectedBody))));\n  return undefined;\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-form-urlencoded-stub.ts",
    "content": "/**\n * Returns a map of key names that were un-equal to value objects showing the\n * discrepancies between the components.\n */\nconst compareEquivalentFormUrlencodedBodies = (expectedBody: string, generatedBody: string): Object => {\n  const fromEntries = (components: string[][]): Record<string, string> => {\n    const parts: Record<string, string> = {};\n\n    components.forEach(component => {\n      parts[component[0]] = component[1];\n    });\n\n    return parts;\n  };\n\n  // Generate to k:v maps from query components\n  const expectedParts = fromEntries(expectedBody.split(\"&\").map(part => part.trim().split(\"=\")));\n  const generatedParts = fromEntries(generatedBody.split(\"&\").map(part => part.trim().split(\"=\")));\n\n  return compareParts(expectedParts, generatedParts);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-json-stub.ts",
    "content": "/**\n * Returns a map of key names that were un-equal to value objects showing the\n * discrepancies between the components.\n */\nconst compareEquivalentJsonBodies = (expectedBody: string, generatedBody: string): Object => {\n  const expectedParts = JSON.parse(expectedBody);\n  const generatedParts = JSON.parse(generatedBody);\n\n  return compareParts(expectedParts, generatedParts);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-octet-stream-stub.ts",
    "content": "/**\n * Returns a map of key names that were un-equal to value objects showing the\n * discrepancies between the components.\n */\nconst compareEquivalentOctetStreamBodies = (\n  utf8Encoder: __Encoder,\n  expectedBody: string,\n  generatedBody: Uint8Array\n): Object => {\n  const expectedParts = {Value: expectedBody};\n  const generatedParts = {Value: utf8Encoder(generatedBody)};\n\n  return compareParts(expectedParts, generatedParts);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-stub.ts",
    "content": "import { Readable } from \"node:stream\";\nimport { HttpRequest, HttpResponse, type HttpHandler } from \"@smithy/core/protocols\";\nimport type { Endpoint, HeaderBag, HttpHandlerOptions } from \"@smithy/types\";\n\n/**\n * Throws an expected exception that contains the serialized request.\n */\nclass EXPECTED_REQUEST_SERIALIZATION_ERROR extends Error {\n  constructor(readonly request: HttpRequest) {\n    super();\n  }\n}\n\n/**\n * Throws an EXPECTED_REQUEST_SERIALIZATION_ERROR error before sending a\n * request. The thrown exception contains the serialized request.\n */\nclass RequestSerializationTestHandler implements HttpHandler {\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.reject(new EXPECTED_REQUEST_SERIALIZATION_ERROR(request));\n  }\n  updateHttpClientConfig(key: never, value: never): void {}\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\n/**\n * Returns a resolved Promise of the specified response contents.\n */\nclass ResponseDeserializationTestHandler implements HttpHandler {\n  isSuccess: boolean;\n  code: number;\n  headers: HeaderBag;\n  body: string | Uint8Array;\n  isBase64Body: boolean;\n\n  constructor(isSuccess: boolean, code: number, headers?: HeaderBag, body?: string) {\n    this.isSuccess = isSuccess;\n    this.code = code;\n    if (headers === undefined) {\n      this.headers = {};\n    } else {\n      this.headers = headers;\n    }\n    if (body === undefined) {\n      body = \"\";\n    }\n    this.body = body;\n    this.isBase64Body = String(body).length > 0 && Buffer.from(String(body), \"base64\").toString(\"base64\") === body;\n  }\n\n  handle(request: HttpRequest, options?: HttpHandlerOptions): Promise<{ response: HttpResponse }> {\n    return Promise.resolve({\n      response: new HttpResponse({\n        statusCode: this.code,\n        headers: this.headers,\n        body: this.isBase64Body ? toBytes(this.body as string) : Readable.from([this.body]),\n      }),\n    });\n  }\n\n  updateHttpClientConfig(key: never, value: never): void {}\n\n  httpHandlerConfigs() {\n    return {};\n  }\n}\n\ninterface comparableParts {\n  [key: string]: string;\n}\n\n/**\n * Generates a standard map of un-equal values given input parts.\n */\nconst compareParts = (expectedParts: comparableParts, generatedParts: comparableParts) => {\n  const unequalParts: any = {};\n  Object.keys(expectedParts).forEach((key) => {\n    if (generatedParts[key] === undefined) {\n      unequalParts[key] = { exp: expectedParts[key], gen: undefined };\n    } else if (!equivalentContents(expectedParts[key], generatedParts[key])) {\n      unequalParts[key] = { exp: expectedParts[key], gen: generatedParts[key] };\n    }\n  });\n\n  Object.keys(generatedParts).forEach((key) => {\n    if (expectedParts[key] === undefined) {\n      unequalParts[key] = { exp: undefined, gen: generatedParts[key] };\n    }\n  });\n\n  if (Object.keys(unequalParts).length !== 0) {\n    return unequalParts;\n  }\n  return undefined;\n};\n\n/**\n * Compares all types for equivalent contents, doing nested\n * equality checks based on non-`$$metadata`\n * properties that have defined values.\n */\nconst equivalentContents = (expected: any, generated: any): boolean => {\n  if (typeof (global as any).expect === \"function\") {\n    expect(normalizeByteArrayType(generated)).toEqual(normalizeByteArrayType(expected));\n    return true;\n  }\n\n  let localExpected = expected;\n\n  // Short circuit on equality.\n  if (localExpected == generated) {\n    return true;\n  }\n\n  if (typeof expected !== \"object\") {\n    return expected === generated;\n  }\n\n  // If a test fails with an issue in the below 6 lines, it's likely\n  // due to an issue in the nestedness or existence of the property\n  // being compared.\n  delete localExpected[\"$$metadata\"];\n  delete generated[\"$$metadata\"];\n  Object.keys(localExpected).forEach((key) => localExpected[key] === undefined && delete localExpected[key]);\n  Object.keys(generated).forEach((key) => generated[key] === undefined && delete generated[key]);\n\n  const expectedProperties = Object.getOwnPropertyNames(localExpected);\n  const generatedProperties = Object.getOwnPropertyNames(generated);\n\n  // Short circuit on different property counts.\n  if (expectedProperties.length != generatedProperties.length) {\n    return false;\n  }\n\n  // Compare properties directly.\n  for (var index = 0; index < expectedProperties.length; index++) {\n    const propertyName = expectedProperties[index];\n    if (!equivalentContents(localExpected[propertyName], generated[propertyName])) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\nconst clientParams = {\n  region: \"us-west-2\",\n  credentials: { accessKeyId: \"key\", secretAccessKey: \"secret\" },\n  apiKey: { apiKey: \"apiKey\" },\n  endpoint: {\n    url: new URL(\"https://localhost/\"),\n    headers: {\n      \"x-default-header\": [\"default-header-value\"],\n    },\n  },\n};\n\n/**\n * A wrapper function that shadows `fail` from jest-jasmine2\n * (jasmine2 was replaced with circus in > v27 as the default test runner)\n */\nconst fail = (error?: any): never => {\n  throw new Error(error);\n};\n\n/**\n * Hexadecimal to byteArray.\n */\nconst toBytes = (hex: string) => {\n  return Buffer.from(hex, \"base64\");\n};\n\nfunction normalizeByteArrayType(data: any) {\n  // normalize float32 errors\n  if (typeof data === \"number\") {\n    const u = new Uint8Array(4);\n    const dv = new DataView(u.buffer, u.byteOffset, u.byteLength);\n    dv.setFloat32(0, data);\n    return dv.getFloat32(0);\n  }\n  if (!data || typeof data !== \"object\") {\n    return data;\n  }\n  if (data instanceof Uint8Array) {\n    return Uint8Array.from(data);\n  }\n  if (data instanceof String || data instanceof Boolean || data instanceof Number) {\n    return data.valueOf();\n  }\n  const output = {} as any;\n  for (const key of Object.getOwnPropertyNames(data)) {\n    output[key] = normalizeByteArrayType(data[key]);\n  }\n  return output;\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-text-stub.ts",
    "content": "/**\n * Returns a map of key names that were un-equal to value objects showing the\n * discrepancies between the components.\n */\nconst compareEquivalentTextBodies = (expectedBody: string, generatedBody: string): Object => {\n  const expectedParts = {Value: expectedBody};\n  const generatedParts = {Value: generatedBody};\n\n  return compareParts(expectedParts, generatedParts);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-unknown-type-stub.ts",
    "content": "/**\n * Returns a map of key names that were un-equal to value objects showing the\n * discrepancies between the components.\n */\nconst compareEquivalentUnknownTypeBodies = (\n  utf8Encoder: __Encoder,\n  expectedBody: string,\n  generatedBody: string | Uint8Array\n): Object => {\n  const expectedParts = {Value: expectedBody};\n  const generatedParts = {\n    Value: generatedBody instanceof Uint8Array ? utf8Encoder(generatedBody) : generatedBody\n  };\n\n  return compareParts(expectedParts, generatedParts);\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-xml-stub.ts",
    "content": "/**\n * Returns a map of key names that were un-equal to value objects showing the\n * discrepancies between the components.\n */\nconst compareEquivalentXmlBodies = (expectedBody: string, generatedBody: string): Object => {\n  const parseConfig = {\n    attributeNamePrefix: \"\",\n    processEntities: {\n      enabled: true,\n      maxTotalExpansions: Infinity,\n    },\n    htmlEntities: true,\n    ignoreAttributes: false,\n    ignoreDeclaration: true,\n    parseTagValue: false,\n    trimValues: false,\n    tagValueProcessor: (_: any, val: any) => (val.trim() === \"\" && val.includes(\"\\n\") ? \"\" : undefined),\n    maxNestedTags: Infinity,\n  };\n\n  const parseXmlBody = (body: string) => {\n    const parser = new XMLParser(parseConfig);\n    const parsedObj = parser.parse(body);\n    const textNodeName = \"#text\";\n    const key = Object.keys(parsedObj)[0];\n    const parsedObjToReturn = parsedObj[key];\n    if (parsedObjToReturn[textNodeName]) {\n      parsedObjToReturn[key] = parsedObjToReturn[textNodeName];\n      delete parsedObjToReturn[textNodeName];\n    }\n    return parsedObj;\n  };\n\n  const expectedParts = parseXmlBody(expectedBody);\n  const generatedParts = parseXmlBody(generatedBody);\n\n  return compareParts(expectedParts, generatedParts);\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/reserved-words-members.txt",
    "content": "# TypeScript reserved words for members.\n#\n# Smithy's rules around the names of types are already pretty strict and\n# mostly compatible with TypeScript's naming conventions. Furthermore, the\n# code generator will automatically uppercase every instance where a\n# TypeScript type is generated from a Smithy type. This makes the majority\n# of all of the reserved words in TypeScript something that will never be\n# encountered when generating code. However, it's possible that other\n# SymbolProvider implementations could be used that do emit reserved\n# words for identifiers, hence this code is useful as an extra layer of\n# protection.\n#\n# Adding new reserved words to this list could potentially result in a\n# breaking change to previously generated clients, so adding new reserved words\n# is discouraged. Ideally we could have just automatically added an alias for\n# built-in types that conflict with generated types, but, unfortunately, it's\n# not currently possible to alias a built-in TypeScript or JavaScript type.\n#\n# When a reserved word is encountered, this implementation will\n# continue to prefix the word with \"_\" until it's no longer considered\n# reserved.\n\n# Prevent prototype pollution\n__proto__\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/reserved-words.txt",
    "content": "# TypeScript reserved words.\n#\n# Smithy's rules around the names of types are already pretty strict and\n# mostly compatible with TypeScript's naming conventions. Furthermore, the\n# code generator will automatically uppercase every instance where a\n# TypeScript type is generated from a Smithy type. This makes the majority\n# of all of the reserved words in TypeScript something that will never be\n# encountered when generating code. However, it's possible that other\n# SymbolProvider implementations could be used that do emit reserved\n# words for identifiers, hence this code is useful as an extra layer of\n# protection.\n*\n# Various built-in types defined by JavaScript and/or TypeScript are\n# included in the set of reserved words (for example, Pick). This\n# should prevent most conflicts with built-in types based on the information\n# available as of today (September, 2019), however, the list of built-in\n# types available in TypeScript are likely to grow over time. Adding new\n# reserved words to this list when new TypeScript types are added could\n# potentially result in a breaking change to previously generated clients,\n# so adding new reserved words is discouraged. Ideally we could have just\n# automatically added an alias for built-in types that conflict with\n# generated types, but, unfortunately, it's not currently possible to\n# alias a built-in TypeScript or JavaScript type.\n#\n# When a reserved word is encountered, this implementation will\n# continue to prefix the word with \"_\" until it's no longer considered\n# reserved.\n#\n# See: https://github.com/Microsoft/TypeScript/blob/main/src/compiler/types.ts#L113\n\n# Reserved and cannot be used as identifiers\nbreak\ncase\ncatch\nclass\nconst\ncontinue\ndebugger\ndefault\ndelete\ndo\nelse\nenum\nexport\nextends\nfalse\nfinally\nfor\nfunction\nif\nimport\nin\ninstanceof\nnew\nnull\nreturn\nsuper\nswitch\nthis\nthrow\ntrue\ntry\ntypeof\nvar\nvoid\nwhile\nwith\n\n# Not valid for identifiers (strict mode reserved words)\nimplements\ninterface\nlet\npackage\nprivate\nprotected\npublic\nstatic\nyield\n\n# contextual keywords\nabstract\nas\nasserts\nassert\nany\nasync\nawait\nconstructor\ndeclare\nget\ninfer\nintrinsic\nis\nkeyof\nmodule\nnamespace\nnever\nreadonly\nrequire\ntype\nundefined\nunique\nunknown\nfrom\nglobal\noverride\nof\n\n# Not valid for user defined type names.\nany\nboolean\nnumber\nstring\nsymbol\n\n# Common types and interfaces that could potentially conflict with generated code.\nArray\nArrayBuffer\nArrayBufferView\nBlob\nBoolean\nConstructorParameters\nDate\nError\nExclude\nExtract\nInfinity\nInstanceType\nMath\nNaN\nNonNullable\nNumber\nObject\nOmit\nParameters\nPartial\nPick\nPromise\nPromiseLike\nReadable\nReadonly\nReadonlyArray\nRecord\nRegExp\nRequired\nReturnType\nSet\nString\nStream\nThisType\nWeakMap\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/resolveRuntimeExtensions1.template",
    "content": "import type { ${extensionConfigName} } from \"./extensionConfiguration\";\n\n/**\n * @public\n */\nexport interface RuntimeExtension {\n  configure(extensionConfiguration: ${extensionConfigName}): void;\n}\n\n/**\n * @public\n */\nexport interface RuntimeExtensionsConfig {\n  extensions: RuntimeExtension[];\n}\n\n/**\n * @internal\n */\nexport const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => {\n  const extensionConfiguration: ${extensionConfigName} = Object.assign(\n${getPartialExtensionConfigurations}\n  );\n\n  extensions.forEach((extension) => extension.configure(extensionConfiguration));\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/resolveRuntimeExtensions2.template",
    "content": "  return Object.assign(\n    runtimeConfig,\n${resolvePartialRuntimeConfigs}\n  );\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.browser.ts.template",
    "content": "/**\n * @internal\n */\nexport const getRuntimeConfig = (config: ${clientConfigName}) => {\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  ${prepareCustomizations}\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"browser\",\n    defaultsMode,\n${customizations}\n  };\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.native.ts.template",
    "content": "/**\n * @internal\n */\nexport const getRuntimeConfig = (config: ${clientConfigName}) => {\n  const browserDefaults = getBrowserRuntimeConfig(config);\n  ${prepareCustomizations}\n  return {\n    ...browserDefaults,\n    ...config,\n    runtime: \"react-native\",\n${customizations}\n  };\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.shared.ts.template",
    "content": "/**\n * @internal\n */\nexport const getRuntimeConfig = (config: ${clientConfigName}) => {\n  ${prepareCustomizations}\n  return {\n    apiVersion: \"${apiVersion}\",\n${customizations}\n  };\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.ts.template",
    "content": "/**\n * @internal\n */\nexport const getRuntimeConfig = (config: ${clientConfigName}) => {\n  emitWarningIfUnsupportedVersion(process.version);\n  const defaultsMode = resolveDefaultsModeConfig(config);\n  const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);\n  const clientSharedValues = getSharedRuntimeConfig(config);\n  ${prepareCustomizations}\n  return {\n    ...clientSharedValues,\n    ...config,\n    runtime: \"node\",\n    defaultsMode,\n${customizations}\n  };\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeExtensions1.template",
    "content": "import type { ${clientConfigName} } from \"./clientConfiguration\";\n\n/**\n * @public\n */\nexport interface RuntimeExtension {\n  configureClient(clientConfiguration: ${clientConfigName}): void;\n}\n\n/**\n * @public\n */\nexport interface RuntimeExtensionsConfig {\n  extensions: RuntimeExtension[]\n}\n\nconst asPartial = <T extends Partial<${clientConfigName}>>(t: T) => t;\n\n/**\n * @internal\n */\nexport const resolveRuntimeExtensions = (\n  runtimeConfig: any,\n  extensions: RuntimeExtension[]\n) => {\n  const clientConfiguration: ${clientConfigName} = {\n${getPartialClientConfigurations}\n  };\n\n  extensions.forEach(extension => extension.configureClient(clientConfiguration));\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeExtensions2.template",
    "content": "  return Object.assign(runtimeConfig,\n${resolvePartialRuntimeConfigs}\n  );\n};\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist-cjs\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"lib\": [\"dom\"],\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"outDir\": \"dist-es\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/tsconfig.json",
    "content": "{\n  \"extends\": \"@tsconfig/node20/tsconfig.json\",\n  \"compilerOptions\": {\n    \"downlevelIteration\": true,\n    \"importHelpers\": true,\n    \"incremental\": true,\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"rootDir\": \"src\",\n    \"useUnknownInCatchVariables\": false\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist-types\",\n    \"emitDeclarationOnly\": true,\n    \"noCheck\": false\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/typedoc.json",
    "content": "{\n  \"entryPoints\": [\"src/index.ts\"],\n  \"out\": \"docs\",\n  \"readme\": \"README.md\"\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    include: [\"**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"**/*.{integ}.spec.ts\"],\n    include: [\"**/*.spec.ts\"],\n    globals: true,\n  },\n});\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/ApplicationProtocolTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class ApplicationProtocolTest {\n\n    @Test\n    public void detectsHttpProtocols() {\n        Assertions.assertTrue(ApplicationProtocol.createDefaultHttpApplicationProtocol().isHttpProtocol());\n    }\n\n    @Test\n    public void detectsMqttProtocols() {\n        Assertions.assertFalse(ApplicationProtocol.createDefaultHttpApplicationProtocol().isMqttProtocol());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/CodegenUtilsTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\n\npublic class CodegenUtilsTest {\n\n    @Test\n    public void detectsJsonMediaTypes() {\n        Assertions.assertTrue(CodegenUtils.isJsonMediaType(\"application/json\"));\n        Assertions.assertTrue(CodegenUtils.isJsonMediaType(\"custom+json\"));\n        Assertions.assertFalse(CodegenUtils.isJsonMediaType(\"application/xml\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/CommandGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\n\nimport org.junit.jupiter.api.Disabled;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\n\npublic class CommandGeneratorTest {\n\n    // todo(schema) enable when on by default.\n    @Disabled\n    @Test\n    public void writesOperationSchemaRef() {\n        testCommandCodegen(\"output-structure.smithy\", new String[] {\".sc(\"});\n    }\n\n    @Test\n    public void writesOperationContextParamValues() {\n        testCommandCodegen(\n            \"endpointsV2/endpoints-operation-context-params.smithy\",\n            new String[] {\n                \"\"\"\n                opContextParamIdentifier: { type: \"operationContextParams\", get: (input?: any) => input?.fooString }\"\"\",\n                \"\"\"\n                opContextParamSubExpression: { type: \"operationContextParams\", get: (input?: any) => input?.fooObj?.bar }\"\"\",\n                \"\"\"\n                opContextParamWildcardExpressionList: { type: \"operationContextParams\", get: (input?: any) => input?.fooList }\"\"\",\n                \"\"\"\n                opContextParamWildcardExpressionListFlatten: { type: \"operationContextParams\", get: (input?: any) => input?.fooListList.flat() }\"\"\",\n                \"\"\"\n                opContextParamWildcardExpressionListObj: { type: \"operationContextParams\", get: (input?: any) => input?.fooListObj?.map((obj: any) => obj?.key) }\"\"\",\n                \"\"\"\n                opContextParamWildcardExpressionListObjListFlatten: { type: \"operationContextParams\", get: (input?: any) => input?.fooListObjList?.map((obj: any) => obj?.key).flat() }\"\"\",\n                \"\"\"\n                opContextParamWildcardExpressionHash: { type: \"operationContextParams\", get: (input?: any) => Object.values(input?.fooObjObj ?? {}).map((obj: any) => obj?.bar) }\"\"\",\n                \"\"\"\n                opContextParamMultiSelectList: { type: \"operationContextParams\", get: (input?: any) => input?.fooListObjObj?.map((obj: any) => [obj?.fooObject?.bar,obj?.fooString].filter((i) => i)) }\"\"\",\n                \"\"\"\n                opContextParamMultiSelectListFlatten: { type: \"operationContextParams\", get: (input?: any) => input?.fooListObjObj?.map((obj: any) => [obj?.fooList].filter((i) => i)).flat() }\"\"\",\n                \"\"\"\n                opContextParamKeys: { type: \"operationContextParams\", get: (input?: any) => Object.keys(input?.fooKeys ?? {}) }\"\"\",\n            }\n        );\n    }\n\n    private void testCommandCodegen(String filename, String[] expectedTypeArray) {\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .pluginClassLoader(getClass().getClassLoader())\n            .model(\n                Model.assembler()\n                    .addImport(getClass().getResource(filename))\n                    .discoverModels()\n                    .assemble()\n                    .unwrap()\n            )\n            .fileManifest(manifest)\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .build()\n            )\n            .build();\n\n        new TypeScriptCodegenPlugin().execute(context);\n        String contents = manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"//commands/GetFooCommand.ts\").get();\n\n        assertThat(contents, containsString(\"as __MetadataBearer\"));\n        for (String expectedType : expectedTypeArray) {\n            assertThat(contents, containsString(expectedType));\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/DefaultDefaultReadmeGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static software.amazon.smithy.typescript.codegen.integration.DefaultReadmeGenerator.README_FILENAME;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.typescript.codegen.integration.DefaultReadmeGenerator;\n\nclass DefaultDefaultReadmeGeneratorTest {\n\n    private TypeScriptSettings settings;\n    private TypeScriptCodegenContext context;\n    private MockManifest manifest;\n    private SymbolProvider symbolProvider;\n    private final Model model = Model.assembler()\n        .addImport(getClass().getResource(\"simple-service-with-operation.smithy\"))\n        .assemble()\n        .unwrap();\n\n    @BeforeEach\n    void setup() {\n        settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .withMember(\"createDefaultReadme\", Node.from(true))\n                .build()\n        );\n\n        manifest = new MockManifest();\n        symbolProvider = new SymbolVisitor(model, settings);\n    }\n\n    private TypeScriptCodegenContext createContext() {\n        return TypeScriptCodegenContext.builder()\n            .model(model)\n            .settings(settings)\n            .symbolProvider(symbolProvider)\n            .fileManifest(manifest)\n            .integrations(List.of(new DefaultReadmeGenerator()))\n            .runtimePlugins(new ArrayList<>())\n            .protocolGenerator(null)\n            .applicationProtocol(ApplicationProtocol.createDefaultHttpApplicationProtocol())\n            .writerDelegator(new TypeScriptDelegator(manifest, symbolProvider))\n            .build();\n    }\n\n    @Test\n    void expectDefaultFileWrittenForClientSDK() {\n        context = createContext();\n        new DefaultReadmeGenerator().customize(context);\n        context.writerDelegator().flushWriters();\n        Assertions.assertTrue(manifest.hasFile(\"/\" + README_FILENAME));\n        String readme = manifest.getFileString(\"/\" + README_FILENAME).get();\n        assertThat(readme, containsString(\"SDK for JavaScript Example Client\"));\n    }\n\n    @Test\n    void expectDefaultFileWrittenForServerSDK() {\n        settings.setArtifactType(TypeScriptSettings.ArtifactType.SSDK);\n        context = createContext();\n        new DefaultReadmeGenerator().customize(context);\n        context.writerDelegator().flushWriters();\n        Assertions.assertTrue(manifest.hasFile(\"/\" + README_FILENAME));\n        String readme = manifest.getFileString(\"/\" + README_FILENAME).get();\n        assertThat(readme, containsString(\"JavaScript Server SDK for Example\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/EnumGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.stringContainsInOrder;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.traits.EnumDefinition;\nimport software.amazon.smithy.model.traits.EnumTrait;\n\npublic class EnumGeneratorTest {\n\n    @Test\n    public void generatesNamedEnums() {\n        EnumTrait trait = EnumTrait.builder()\n            .addEnum(EnumDefinition.builder().value(\"FOO\").name(\"FOO\").build())\n            .addEnum(EnumDefinition.builder().value(\"BAR\").name(\"BAR\").build())\n            .build();\n        StringShape shape = StringShape.builder().id(\"com.foo#Baz\").addTrait(trait).build();\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        Model model = Model.assembler()\n            .addShape(shape)\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        Symbol symbol = new SymbolVisitor(model, settings).toSymbol(shape);\n        new EnumGenerator(shape, symbol, writer).run();\n\n        assertThat(writer.toString(), containsString(\"export const Baz = {\"));\n        assertThat(writer.toString(), stringContainsInOrder(\"BAR: \\\"BAR\\\",\", \"FOO: \\\"FOO\\\"\"));\n        assertThat(writer.toString(), containsString(\"export type Baz = (typeof Baz)[keyof typeof Baz];\"));\n    }\n\n    @Test\n    public void generatesUnnamedEnums() {\n        EnumTrait trait = EnumTrait.builder()\n            .addEnum(EnumDefinition.builder().value(\"FOO\").build())\n            .addEnum(EnumDefinition.builder().value(\"BAR\").build())\n            .build();\n        StringShape shape = StringShape.builder().id(\"com.foo#Baz\").addTrait(trait).build();\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        Model model = Model.assembler()\n            .addShape(shape)\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        Symbol symbol = new SymbolVisitor(model, settings).toSymbol(shape);\n        new EnumGenerator(shape, symbol, writer).run();\n\n        assertThat(writer.toString(), containsString(\"export type Baz = \\\"BAR\\\" | \\\"FOO\\\"\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/ImportDeclarationsTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.CodegenException;\n\npublic class ImportDeclarationsTest {\n\n    @Test\n    public void addsSingleNonAliasedImport() {\n        ImportDeclarations declarations = new ImportDeclarations(\"foo/bar\");\n        declarations.addImport(\"Big\", \"\", \"big.js\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Big } from \\\"big.js\\\";\"));\n    }\n\n    @Test\n    public void addsSingleAliasedImport() {\n        ImportDeclarations declarations = new ImportDeclarations(\"foo/bar\");\n        declarations.addImport(\"Big\", \"$Big\", \"big.js\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Big as $Big } from \\\"big.js\\\";\"));\n    }\n\n    @Test\n    public void addsMultipleImportsOfSameSymbol() {\n        ImportDeclarations declarations = new ImportDeclarations(\"foo/bar\");\n        declarations.addImport(\"Big\", \"Big\", \"big.js\");\n        declarations.addImport(\"Big\", \"$Big\", \"big.js\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Big, Big as $Big } from \\\"big.js\\\";\"));\n    }\n\n    @Test\n    public void relativizesImports() {\n        ImportDeclarations declarations = new ImportDeclarations(\"./foo/bar/index\");\n        declarations.addImport(\"Baz\", \"\", \"./foo/bar/bam\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Baz } from \\\"./bam\\\";\"));\n    }\n\n    @Test\n    public void relativizesImportsWithTrailingFilenameOnIndex() {\n        ImportDeclarations declarations = new ImportDeclarations(\"foo/bar/index\");\n        declarations.addImport(\"Baz\", \"\", \"./shared/shapeTypes\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Baz } from \\\"../../shared/shapeTypes\\\";\"));\n    }\n\n    @Test\n    public void relativizesImportsWithTrailingFilenameNotIndex() {\n        ImportDeclarations declarations = new ImportDeclarations(\"foo/bar/hello/index\");\n        declarations.addImport(\"Baz\", \"\", \"./shared/shapeTypes\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Baz } from \\\"../../../shared/shapeTypes\\\";\"));\n    }\n\n    @Test\n    public void automaticallyCorrectsBasePath() {\n        ImportDeclarations declarations = new ImportDeclarations(\"/foo/bar/index\");\n        declarations.addImport(\"Baz\", \"\", \"./foo/bar/bam/qux\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Baz } from \\\"./bam/qux\\\";\"));\n    }\n\n    @Test\n    public void doesNotRelativizeAbsolutePaths() {\n        ImportDeclarations declarations = new ImportDeclarations(\"/foo/bar\");\n        declarations.addImport(\"Baz\", \"\", \"@types/foo\");\n        declarations.addImport(\"Hello\", \"\", \"/abc/def\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Baz } from \\\"@types/foo\\\";\"));\n        assertThat(result, containsString(\"import { Hello } from \\\"/abc/def\\\";\"));\n    }\n\n    @Test\n    public void canImportFilesUpLevels() {\n        ImportDeclarations declarations = new ImportDeclarations(\"./foo/bar/index\");\n        declarations.addImport(\"SharedThing\", \"\", \"./shared/types\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { SharedThing } from \\\"../../shared/types\\\";\"));\n    }\n\n    @Test\n    public void throwsOnStarImport() {\n        ImportDeclarations declarations = new ImportDeclarations(\"/foo/bar\");\n        declarations.addImport(\"*\", \"_baz\", \"@types/foo\");\n        Assertions.assertThrows(CodegenException.class, () -> declarations.toString());\n    }\n\n    @Test\n    public void canImportDefaultImport() {\n        ImportDeclarations declarations = new ImportDeclarations(\"/foo/bar\");\n        declarations.addDefaultImport(\"foo\", \"@types/foo\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import foo from \\\"@types/foo\\\";\"));\n    }\n\n    @Test\n    public void canImportDefaultImportWithIgnore() {\n        ImportDeclarations declarations = new ImportDeclarations(\"/foo/bar\");\n        declarations.addIgnoredDefaultImport(\"foo\", \"@types/foo\", \"I want to\");\n        String result = declarations.toString();\n\n        assertThat(\n            result,\n            containsString(\"// @ts-ignore: I want to\\nimport foo from \\\"@types/foo\\\"; // eslint-disable-line\")\n        );\n    }\n\n    @Test\n    public void canImportDefaultImportWithNamedImport() {\n        ImportDeclarations declarations = new ImportDeclarations(\"/foo/bar\");\n        declarations.addDefaultImport(\"foo\", \"@types/foo\");\n        declarations.addImport(\"Bar\", \"Bar\", \"@types/foo\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import foo from \\\"@types/foo\\\";\"));\n        assertThat(result, containsString(\"import { Bar } from \\\"@types/foo\\\";\"));\n    }\n\n    @Test\n    public void canImportNestedFromRoot() {\n        ImportDeclarations declarations = new ImportDeclarations(\"\");\n        declarations.addImport(\"Foo\", \"\", \"./models/foo\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Foo } from \\\"./models/foo\\\";\"));\n    }\n\n    @Test\n    public void canImportNestedFromClient() {\n        ImportDeclarations declarations = new ImportDeclarations(\"./FooClient\");\n        declarations.addImport(\"Foo\", \"\", \"./models/hello/index\");\n        String result = declarations.toString();\n\n        assertThat(result, containsString(\"import { Foo } from \\\"./models/hello/index\\\";\"));\n    }\n\n    @Test\n    public void importOrdering() {\n        ImportDeclarations declarations = new ImportDeclarations(\"./FooClient\");\n\n        declarations.addTypeImport(\"ServiceOutputTypes\", null, \"../RpcV2ProtocolClient\");\n        declarations.addImport(\"FractionalSeconds\", null, \"../schemas/schemas_0\");\n        declarations.addTypeImport(\"RpcV2ProtocolClientResolvedConfig\", null, \"../RpcV2ProtocolClient\");\n        declarations.addTypeImport(\"FractionalSecondsOutput\", null, \"../models/models_0\");\n        declarations.addImport(\"commonParams\", null, \"../endpoint/EndpointParameters\");\n        declarations.addImport(\"Command\", \"$Command\", \"@smithy/smithy-client\");\n        declarations.addTypeImport(\"MetadataBearer\", \"__MetadataBearer\", \"@smithy/types\");\n        declarations.addImport(\"getEndpointPlugin\", null, \"@smithy/middleware-endpoint\");\n        declarations.addTypeImport(\"ServiceInputTypes\", null, \"../RpcV2ProtocolClient\");\n\n        // https://projects.haykranen.nl/java/\n        declarations.addTypeImport(\"DecoratorContainerSchemaListenerTransactionRepository\", null, \"../../java8\");\n        declarations.addTypeImport(\n            \"AuthenticationExpressionDecoratorContainerSchemaListenerTransactionRepository\",\n            null,\n            \"../../java11\"\n        );\n        declarations.addTypeImport(\n            \"ResolverVisitorAuthenticationExpressionDecoratorContainerSchemaListenerTransactions\",\n            null,\n            \"../../java15\"\n        );\n        // uses multiline format as line width 120 is breached.\n        declarations.addTypeImport(\n            \"ResolverVisitorAuthenticationExpressionDecoratorContainerSchemaListenersTransactions\",\n            null,\n            \"../../java18\"\n        );\n\n        String result = declarations.toString();\n\n        assertEquals(\n            \"\"\"\n            import { getEndpointPlugin } from \"@smithy/middleware-endpoint\";\n            import { Command as $Command } from \"@smithy/smithy-client\";\n            import type { MetadataBearer as __MetadataBearer } from \"@smithy/types\";\n\n            import type { AuthenticationExpressionDecoratorContainerSchemaListenerTransactionRepository } from \"../../java11\";\n            import type { ResolverVisitorAuthenticationExpressionDecoratorContainerSchemaListenerTransactions } from \"../../java15\";\n            import type {\n              ResolverVisitorAuthenticationExpressionDecoratorContainerSchemaListenersTransactions,\n            } from \"../../java18\";\n            import type { DecoratorContainerSchemaListenerTransactionRepository } from \"../../java8\";\n            import { commonParams } from \"../endpoint/EndpointParameters\";\n            import type { FractionalSecondsOutput } from \"../models/models_0\";\n            import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../RpcV2ProtocolClient\";\n            import { FractionalSeconds } from \"../schemas/schemas_0\";\n\n            \"\"\",\n            result\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/IndexGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\n\npublic class IndexGeneratorTest {\n\n    @Test\n    public void writesIndex() {\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service-with-operation.smithy\"))\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider symbolProvider = new SymbolVisitor(model, settings);\n        TypeScriptWriter writer = new TypeScriptWriter(\"\");\n\n        IndexGenerator.writeIndex(settings, model, symbolProvider, null, writer, writer);\n\n        String contents = writer.toString();\n        assertThat(contents, containsString(\"export * from \\\"./Example\\\";\"));\n        assertThat(contents, containsString(\"export * from \\\"./ExampleClient\\\";\"));\n        assertThat(contents, containsString(\"export * from \\\"./commands\\\";\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/IntEnumGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.stringContainsInOrder;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.IntEnumShape;\n\npublic class IntEnumGeneratorTest {\n\n    @Test\n    public void generatesIntEnums() {\n        IntEnumShape shape = IntEnumShape.builder().id(\"com.foo#Foo\").addMember(\"BAR\", 5).addMember(\"BAZ\", 2).build();\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        Model model = Model.assembler()\n            .addShape(shape)\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        Symbol symbol = new SymbolVisitor(model, settings).toSymbol(shape);\n        new IntEnumGenerator(shape, symbol, writer).run();\n\n        assertThat(writer.toString(), containsString(\"export enum Foo {\"));\n        assertThat(writer.toString(), stringContainsInOrder(\"BAZ = 2,\", \"BAR = 5,\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/PackageJsonGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.not;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.Arguments;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\n\nclass PackageJsonGeneratorTest {\n\n    @ParameterizedTest\n    @MethodSource(\"providePackageDescriptionTestCases\")\n    void expectPackageDescriptionUpdatedByArtifactType(\n        TypeScriptSettings.ArtifactType artifactType,\n        String expectedDescription\n    ) {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        MockManifest manifest = new MockManifest();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .build();\n\n        final TypeScriptSettings typeScriptSettings = TypeScriptSettings.from(model, settings, artifactType);\n\n        PackageJsonGenerator.writePackageJson(typeScriptSettings, manifest, new HashMap<>());\n\n        assertTrue(manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).isPresent());\n\n        String packageJson = manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).get();\n\n        assertThat(packageJson, containsString(String.format(\"\\\"description\\\": \\\"%s\\\"\", expectedDescription)));\n    }\n\n    @Test\n    void expectPackageBrowserFieldToBeMerged() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        MockManifest manifest = new MockManifest();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .withMember(\"packageDescription\", Node.from(\"example description\"))\n            .build();\n\n        final TypeScriptSettings typeScriptSettings = TypeScriptSettings.from(\n            model,\n            settings,\n            TypeScriptSettings.ArtifactType.CLIENT\n        );\n\n        var pjson = typeScriptSettings.getPackageJson();\n        pjson = pjson.withMember(\"browser\", Node.objectNode().withMember(\"example-browser\", Node.from(\"example\")));\n        pjson = pjson.withMember(\n            \"react-native\",\n            Node.objectNode().withMember(\"example-react-native\", Node.from(\"example\"))\n        );\n        typeScriptSettings.setPackageJson(pjson);\n\n        PackageJsonGenerator.writePackageJson(typeScriptSettings, manifest, new HashMap<>());\n\n        assertTrue(manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).isPresent());\n\n        String packageJson = manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).get();\n        ObjectNode packageJsonNode = Node.parse(packageJson).expectObjectNode();\n\n        Node expectedBrowserNode = Node.parse(\n            \"\"\"\n            {\n                \"example-browser\": \"example\",\n                \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.browser\"\n            }\n            \"\"\"\n        );\n        Node expectedReactNativeNode = Node.parse(\n            \"\"\"\n            {\n                  \"example-react-native\": \"example\",\n                  \"./dist-es/runtimeConfig\": \"./dist-es/runtimeConfig.native\"\n            }\n            \"\"\"\n        );\n\n        Node.assertEquals(packageJsonNode.expectObjectMember(\"browser\"), expectedBrowserNode);\n        Node.assertEquals(packageJsonNode.expectObjectMember(\"react-native\"), expectedReactNativeNode);\n    }\n\n    @Test\n    void expectTestScriptAndTestConfigToBeAdded() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        MockManifest manifest = new MockManifest();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .withMember(\"packageDescription\", Node.from(\"example description\"))\n            .withMember(\"packageManager\", Node.from(\"npm\"))\n            .build();\n\n        final TypeScriptSettings typeScriptSettings = TypeScriptSettings.from(\n            model,\n            settings,\n            TypeScriptSettings.ArtifactType.CLIENT\n        );\n\n        Map<String, Map<String, SymbolDependency>> deps = new HashMap<>();\n        Map<String, SymbolDependency> devDeps = new HashMap<>();\n\n        devDeps.put(\"vitest\", TypeScriptDependency.VITEST.dependency);\n        deps.put(\"devDependencies\", devDeps);\n\n        PackageJsonGenerator.writePackageJson(typeScriptSettings, manifest, deps);\n\n        assertTrue(manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).isPresent());\n        assertTrue(manifest.getFileString(PackageJsonGenerator.VITEST_CONFIG_FILENAME).isPresent());\n\n        String packageJson = manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).get();\n        String configString = manifest.getFileString(PackageJsonGenerator.VITEST_CONFIG_FILENAME).get();\n\n        assertThat(packageJson, containsString(\"\\\"test\\\": \\\"npx vitest run --passWithNoTests\\\"\"));\n        assertThat(configString, containsString(\"include: [\\\"**/*.spec.ts\\\"]\"));\n    }\n\n    @Test\n    void expectTypeDocToNotBeAdded() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        MockManifest manifest = new MockManifest();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .withMember(\"packageDescription\", Node.from(\"example description\"))\n            .build();\n\n        final TypeScriptSettings typeScriptSettings = TypeScriptSettings.from(\n            model,\n            settings,\n            TypeScriptSettings.ArtifactType.CLIENT\n        );\n\n        Map<String, Map<String, SymbolDependency>> deps = new HashMap<>();\n\n        PackageJsonGenerator.writePackageJson(typeScriptSettings, manifest, deps);\n\n        assertTrue(manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).isPresent());\n        assertTrue(manifest.getFileString(PackageJsonGenerator.TYPEDOC_FILE_NAME).isEmpty());\n\n        String packageJson = manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).get();\n\n        assertThat(packageJson, not(containsString(\"\\\"build:docs\\\": \\\"typedoc\\\"\")));\n        assertThat(packageJson, not(containsString(\"\\\"typedoc\\\": \\\"0.23.23\\\"\")));\n    }\n\n    @Test\n    void expectTypeDocToBeAddedWithGenerateTypeDoc() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        MockManifest manifest = new MockManifest();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .withMember(\"packageDescription\", Node.from(\"example description\"))\n            .withMember(\"generateTypeDoc\", true)\n            .build();\n\n        final TypeScriptSettings typeScriptSettings = TypeScriptSettings.from(\n            model,\n            settings,\n            TypeScriptSettings.ArtifactType.CLIENT\n        );\n\n        Map<String, Map<String, SymbolDependency>> deps = new HashMap<>();\n\n        PackageJsonGenerator.writePackageJson(typeScriptSettings, manifest, deps);\n\n        assertTrue(manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).isPresent());\n        assertTrue(manifest.getFileString(PackageJsonGenerator.TYPEDOC_FILE_NAME).isPresent());\n\n        String packageJson = manifest.getFileString(PackageJsonGenerator.PACKAGE_JSON_FILENAME).get();\n\n        assertThat(packageJson, containsString(\"\\\"build:docs\\\": \\\"typedoc\\\"\"));\n        assertThat(packageJson, containsString(\"\\\"typedoc\\\": \\\"0.23.23\\\"\"));\n    }\n\n    private static Stream<Arguments> providePackageDescriptionTestCases() {\n        return Stream.of(\n            Arguments.of(TypeScriptSettings.ArtifactType.SSDK, \"example server\"),\n            Arguments.of(TypeScriptSettings.ArtifactType.CLIENT, \"example client\")\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/RuntimeConfigGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.function.Consumer;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\n\npublic class RuntimeConfigGeneratorTest {\n\n    @Test\n    public void expandsRuntimeConfigFile() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        MockManifest manifest = new MockManifest();\n\n        List<TypeScriptIntegration> integrations = new ArrayList<>();\n        integrations.add(\n            new TypeScriptIntegration() {\n                @Override\n                public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n                    TypeScriptSettings settings,\n                    Model model,\n                    SymbolProvider symbolProvider,\n                    LanguageTarget target\n                ) {\n                    Map<String, Consumer<TypeScriptWriter>> config = new HashMap<>();\n                    config.put(\"syn\", writer -> {\n                        writer.write(\"syn: 'ack1',\");\n                    });\n                    config.put(\"foo\", writer -> {\n                        writer.write(\"foo: 'bar',\");\n                    });\n                    return config;\n                }\n            }\n        );\n\n        integrations.add(\n            new TypeScriptIntegration() {\n                @Override\n                public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(\n                    TypeScriptSettings settings,\n                    Model model,\n                    SymbolProvider symbolProvider,\n                    LanguageTarget target\n                ) {\n                    Map<String, Consumer<TypeScriptWriter>> config = new HashMap<>();\n                    config.put(\"syn\", writer -> {\n                        writer.write(\"syn: 'ack2',\");\n                    });\n                    return config;\n                }\n            }\n        );\n\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider symbolProvider = new SymbolVisitor(model, settings);\n        TypeScriptDelegator delegator = new TypeScriptDelegator(manifest, symbolProvider);\n        RuntimeConfigGenerator generator = new RuntimeConfigGenerator(\n            settings,\n            model,\n            symbolProvider,\n            delegator,\n            integrations,\n            ApplicationProtocol.createDefaultHttpApplicationProtocol()\n        );\n        generator.generate(LanguageTarget.NODE);\n        generator.generate(LanguageTarget.BROWSER);\n        generator.generate(LanguageTarget.REACT_NATIVE);\n        generator.generate(LanguageTarget.SHARED);\n        delegator.flushWriters();\n\n        Assertions.assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.ts\"));\n        Assertions.assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.browser.ts\"));\n        Assertions.assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.native.ts\"));\n        Assertions.assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.shared.ts\"));\n\n        // Does the runtimeConfig.shared.ts file expand the template properties properly?\n        String runtimeConfigSharedContents = manifest\n            .getFileString(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.shared.ts\")\n            .get();\n        assertThat(\n            runtimeConfigSharedContents,\n            containsString(\"export const getRuntimeConfig = (config: ExampleClientConfig) =>\")\n        );\n        assertThat(runtimeConfigSharedContents, containsString(\"apiVersion: \\\"1.0.0\\\",\"));\n        assertThat(runtimeConfigSharedContents, containsString(\"config?.syn ?? syn: 'ack2',\"));\n        assertThat(runtimeConfigSharedContents, containsString(\"config?.foo ?? foo: 'bar',\"));\n\n        // Does the runtimeConfig.ts file expand the template properties properly?\n        String runtimeConfigContents = manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.ts\").get();\n        assertThat(\n            runtimeConfigContents,\n            containsString(\"import type { ExampleClientConfig } from \\\"./ExampleClient\\\";\")\n        );\n        assertThat(\n            runtimeConfigSharedContents,\n            containsString(\"export const getRuntimeConfig = (config: ExampleClientConfig) =>\")\n        );\n        assertThat(runtimeConfigContents, containsString(\"config?.syn ?? syn: 'ack2',\"));\n        assertThat(runtimeConfigSharedContents, containsString(\"config?.foo ?? foo: 'bar',\"));\n\n        // Does the runtimeConfig.browser.ts file expand the template properties properly?\n        String runtimeConfigBrowserContents = manifest\n            .getFileString(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.browser.ts\")\n            .get();\n        assertThat(\n            runtimeConfigBrowserContents,\n            containsString(\"import type { ExampleClientConfig } from \\\"./ExampleClient\\\";\")\n        );\n        assertThat(\n            runtimeConfigSharedContents,\n            containsString(\"export const getRuntimeConfig = (config: ExampleClientConfig) =>\")\n        );\n        assertThat(runtimeConfigContents, containsString(\"config?.syn ?? syn: 'ack2',\"));\n        assertThat(runtimeConfigSharedContents, containsString(\"config?.foo ?? foo: 'bar',\"));\n\n        // Does the runtimeConfig.native.ts file expand the browser template properties properly?\n        String runtimeConfigNativeContents = manifest\n            .getFileString(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.native.ts\")\n            .get();\n        assertThat(\n            runtimeConfigNativeContents,\n            containsString(\"import type { ExampleClientConfig } from \\\"./ExampleClient\\\";\")\n        );\n        assertThat(\n            runtimeConfigNativeContents,\n            containsString(\n                \"import { getRuntimeConfig as getBrowserRuntimeConfig } from \\\"./runtimeConfig.browser\\\";\"\n            )\n        );\n        assertThat(\n            runtimeConfigSharedContents,\n            containsString(\"export const getRuntimeConfig = (config: ExampleClientConfig) =>\")\n        );\n        assertThat(runtimeConfigContents, containsString(\"config?.syn ?? syn: 'ack2',\"));\n        assertThat(runtimeConfigSharedContents, containsString(\"config?.foo ?? foo: 'bar',\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\n\npublic class ServiceBareBonesClientGeneratorTest {\n\n    @Test\n    public void hasHooksForService() {\n        // TODO\n    }\n\n    @Test\n    public void addsCustomIntegrationDependencyFields() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        TypeScriptWriter writer = new TypeScriptWriter(\"./foo\");\n        SymbolProvider symbolProvider = new SymbolVisitor(model, settings);\n        ApplicationProtocol applicationProtocol = ApplicationProtocol.createDefaultHttpApplicationProtocol();\n\n        List<TypeScriptIntegration> integrations = new ArrayList<>();\n        integrations.add(\n            new TypeScriptIntegration() {\n                @Override\n                public void addConfigInterfaceFields(\n                    TypeScriptSettings settings,\n                    Model model,\n                    SymbolProvider symbolProvider,\n                    TypeScriptWriter writer\n                ) {\n                    writer.writeDocs(\"Hello!\");\n                    writer.write(\"syn?: string;\");\n                }\n            }\n        );\n\n        new ServiceBareBonesClientGenerator(\n            settings,\n            model,\n            symbolProvider,\n            writer,\n            integrations,\n            Collections.emptyList(),\n            applicationProtocol\n        ).run();\n\n        assertThat(writer.toString(), containsString(\"  /**\\n\" + \"   * Hello!\\n\" + \"   */\\n\" + \"  syn?: string;\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/StructureGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.not;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.loader.ModelAssembler;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings.RequiredMemberMode;\n\npublic class StructureGeneratorTest {\n\n    @Test\n    public void properlyGeneratesEmptyMessageMemberOfException() {\n        testErrorStructureCodegen(\n            \"error-test-empty.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void properlyGeneratesOptionalMessageMemberOfException() {\n        testErrorStructureCodegen(\n            \"error-test-optional-message.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void properlyGeneratesRequiredMessageMemberOfException() {\n        testErrorStructureCodegen(\n            \"error-test-required-message.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void properlyGeneratesOptionalNonMessageMemberOfException() {\n        testErrorStructureCodegen(\n            \"error-test-optional-member-no-message.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              foo?: string | undefined;\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n                this.foo = opts.foo;\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void properlyGeneratesRequiredNonMessageMemberOfException() {\n        testErrorStructureCodegen(\n            \"error-test-required-member-no-message.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              foo: string | undefined;\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n                this.foo = opts.foo;\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void generatesEmptyRetryableTrait() {\n        testErrorStructureCodegen(\n            \"error-test-retryable.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              $retryable = {};\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void generatesRetryableTraitWithThrottling() {\n        testErrorStructureCodegen(\n            \"error-test-retryable-throttling.smithy\",\n            \"\"\"\n            export class Err extends __BaseException {\n              readonly name = \"Err\" as const;\n              readonly $fault = \"client\" as const;\n              $retryable = {\n                throttling: true,\n              };\n              /**\n               * @internal\n               */\n              constructor(opts: __ExceptionOptionType<Err, __BaseException>) {\n                super({\n                  name: \"Err\",\n                  $fault: \"client\",\n                  ...opts,\n                });\n                Object.setPrototypeOf(this, Err.prototype);\n              }\n            }\n            \"\"\"\n        );\n    }\n\n    @Test\n    public void properlyGeneratesRequiredMessageMemberNotBackwardCompatible() {\n        testStructureCodegenBase(\n            \"test-required-member.smithy\",\n            \"\"\"\n            export interface GetFooOutput {\n              someRequiredMember: string;\n            }\n            \"\"\",\n            RequiredMemberMode.STRICT,\n            true\n        );\n    }\n\n    private String testStructureCodegen(String file, String includedString) {\n        return testStructureCodegenBase(file, includedString, RequiredMemberMode.NULLABLE, true);\n    }\n\n    private String testStructureCodegenExcludes(String file, String excludedString) {\n        return testStructureCodegenBase(file, excludedString, RequiredMemberMode.NULLABLE, false);\n    }\n\n    private String testStructureCodegenBase(\n        String file,\n        String testString,\n        RequiredMemberMode requiredMemberMode,\n        boolean assertContains\n    ) {\n        Model model = Model.assembler().addImport(getClass().getResource(file)).assemble().unwrap();\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .model(model)\n            .fileManifest(manifest)\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .withMember(\"requiredMemberMode\", Node.from(requiredMemberMode.getMode()))\n                    .build()\n            )\n            .build();\n\n        new TypeScriptCodegenPlugin().execute(context);\n        String contents = \"\";\n        contents += manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"//models/models_0.ts\").orElse(\"\");\n        contents += manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"//models/enums.ts\").orElse(\"\");\n        contents += manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"//models/errors.ts\").orElse(\"\");\n\n        if (assertContains) {\n            assertThat(contents, containsString(testString));\n        } else {\n            assertThat(contents, not(containsString(testString)));\n        }\n\n        return contents;\n    }\n\n    private void testErrorStructureCodegen(String file, String expectedType) {\n        String contents = testStructureCodegen(file, expectedType);\n\n        assertThat(contents, containsString(\"as __BaseException\"));\n    }\n\n    @Test\n    public void generatesNonErrorStructures() {\n        StructureShape struct = createNonErrorStructure();\n        ModelAssembler assembler = Model.assembler()\n            .addShape(struct)\n            .addImport(getClass().getResource(\"simple-service.smithy\"));\n        struct.getAllMembers().values().forEach(assembler::addShape);\n        Model model = assembler.assemble().unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        TypeScriptWriter writer = new TypeScriptWriter(\"./foo\");\n        new StructureGenerator(model, settings, new SymbolVisitor(model, settings), writer, struct).run();\n        String output = writer.toString();\n\n        assertThat(output, containsString(\"export interface Bar {\"));\n        assertThat(output, containsString(\"foo?: string | undefined;\"));\n    }\n\n    private StructureShape createNonErrorStructure() {\n        return StructureShape.builder()\n            .id(\"com.foo#Bar\")\n            .addMember(MemberShape.builder().id(\"com.foo#Bar$foo\").target(\"smithy.api#String\").build())\n            .build();\n    }\n\n    @Test\n    public void generatesNonErrorStructuresThatExtendOtherInterfaces() {\n        StructureShape struct = createNonErrorStructure();\n        ModelAssembler assembler = Model.assembler()\n            .addShape(struct)\n            .addImport(getClass().getResource(\"simple-service.smithy\"));\n        struct.getAllMembers().values().forEach(assembler::addShape);\n        OperationShape operation = OperationShape.builder().id(\"com.foo#Operation\").output(struct).build();\n        assembler.addShape(operation);\n        Model model = assembler.assemble().unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        TypeScriptWriter writer = new TypeScriptWriter(\"./foo\");\n        new StructureGenerator(model, settings, new SymbolVisitor(model, settings), writer, struct).run();\n        String output = writer.toString();\n\n        assertThat(output, containsString(\"export interface Bar {\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/SymbolDecoratorIntegration.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\n\n/**\n * This SymbolProvider is used to test that TypeScriptCodegenPlugin actually decorates\n * the provided SymbolProvider using integrations found on the classpath. It is\n * enabled by setting \"__customServiceName\" in the provided settings object.\n */\npublic final class SymbolDecoratorIntegration implements TypeScriptIntegration {\n\n    @Override\n    public SymbolProvider decorateSymbolProvider(\n        Model model,\n        TypeScriptSettings settings,\n        SymbolProvider symbolProvider\n    ) {\n        String name = settings.getPluginSettings().getStringMemberOrDefault(\"__customServiceName\", null);\n\n        if (name == null) {\n            return symbolProvider;\n        }\n\n        return shape -> {\n            Symbol symbol = symbolProvider.toSymbol(shape);\n            if (shape.isServiceShape()) {\n                return symbol.toBuilder().name(name).definitionFile(name + \".ts\").build();\n            }\n\n            return symbol;\n        };\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/SymbolProviderTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.Arrays;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.IntEnumShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.EnumDefinition;\nimport software.amazon.smithy.model.traits.EnumTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\n\npublic class SymbolProviderTest {\n\n    @Test\n    public void createsSymbols() {\n        Shape shape = StructureShape.builder().id(\"com.foo.baz#Hello\").build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShape(shape)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol symbol = provider.toSymbol(shape);\n\n        assertThat(symbol.getName(), equalTo(\"Hello\"));\n        assertThat(symbol.getNamespace(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0\"));\n        assertThat(symbol.getNamespaceDelimiter(), equalTo(\"/\"));\n        assertThat(symbol.getDefinitionFile(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0.ts\"));\n    }\n\n    @Test\n    public void createsSymbolsIntoTargetNamespace() {\n        Shape shape1 = StructureShape.builder().id(\"com.foo#Hello\").build();\n        Shape shape2 = StructureShape.builder().id(\"com.foo.baz#Hello\").build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(shape1, shape2)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol symbol1 = provider.toSymbol(shape1);\n        Symbol symbol2 = provider.toSymbol(shape2);\n        SymbolVisitor.modelIndexer(Arrays.asList(shape1, shape2), provider);\n\n        assertThat(symbol1.getName(), equalTo(\"Hello\"));\n        assertThat(symbol1.getNamespace(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0\"));\n        assertThat(symbol1.getNamespaceDelimiter(), equalTo(\"/\"));\n        assertThat(symbol1.getDefinitionFile(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0.ts\"));\n\n        assertThat(symbol2.getName(), equalTo(\"Hello\"));\n        assertThat(symbol2.getNamespace(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0\"));\n        assertThat(symbol2.getNamespaceDelimiter(), equalTo(\"/\"));\n        assertThat(symbol2.getDefinitionFile(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0.ts\"));\n    }\n\n    @Test\n    public void escapesReservedWords() {\n        Shape shape = StructureShape.builder().id(\"com.foo.baz#Pick\").build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShape(shape)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol symbol = provider.toSymbol(shape);\n\n        assertThat(symbol.getName(), equalTo(\"_Pick\"));\n    }\n\n    @Test\n    public void doesNotEscapeBuiltins() {\n        MemberShape member = MemberShape.builder().id(\"foo.bar#Object$a\").target(\"smithy.api#String\").build();\n        StructureShape struct = StructureShape.builder().id(\"foo.bar#Object\").addMember(member).build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(struct, member)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n\n        Symbol structSymbol = provider.toSymbol(struct);\n        Symbol memberSymbol = provider.toSymbol(member);\n\n        // Normal structure with escaping.\n        assertThat(structSymbol.getName(), equalTo(\"_Object\"));\n        assertThat(structSymbol.getNamespace(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0\"));\n\n        // Reference to built-in type with no escaping.\n        assertThat(memberSymbol.getName(), equalTo(\"string\"));\n        assertThat(memberSymbol.getNamespace(), equalTo(\"\"));\n    }\n\n    @Test\n    public void escapesRecursiveSymbols() {\n        StructureShape record = StructureShape.builder().id(\"foo.bar#Record\").build();\n        MemberShape listMember = MemberShape.builder().id(\"foo.bar#Records$member\").target(record).build();\n        ListShape list = ListShape.builder().id(\"foo.bar#Records\").member(listMember).build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(list, listMember, record)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol listSymbol = provider.toSymbol(list);\n\n        assertThat(listSymbol.getName(), equalTo(\"_Record[]\"));\n    }\n\n    @Test\n    public void createsCommandModules() {\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"output-structure.smithy\"))\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        Shape command = model.expectShape(ShapeId.from(\"smithy.example#GetFoo\"));\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol commandSymbol = provider.toSymbol(command);\n\n        assertThat(commandSymbol.getName(), equalTo(\"GetFooCommand\"));\n        assertThat(\n            commandSymbol.getNamespace(),\n            equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/commands/GetFooCommand\")\n        );\n    }\n\n    @Test\n    public void usesLazyJsonStringForJsonMediaType() {\n        StringShape jsonString = StringShape.builder()\n            .id(\"foo.bar#jsonString\")\n            .addTrait(new MediaTypeTrait(\"application/json\"))\n            .build();\n        MemberShape member = MemberShape.builder().id(\"foo.bar#test$a\").target(jsonString).build();\n        StructureShape struct = StructureShape.builder().id(\"foo.bar#test\").addMember(member).build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(struct, member, jsonString)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol memberSymbol = provider.toSymbol(member);\n\n        assertThat(memberSymbol.getName(), equalTo(\"__AutomaticJsonStringConversion | string\"));\n    }\n\n    @Test\n    public void omitsUnknownStringEnumVariant() {\n        EnumTrait trait = EnumTrait.builder()\n            .addEnum(EnumDefinition.builder().value(\"FOO\").name(\"FOO\").build())\n            .addEnum(EnumDefinition.builder().value(\"BAR\").name(\"BAR\").build())\n            .build();\n        StringShape stringShape = StringShape.builder().id(\"foo.bar#enumString\").addTrait(trait).build();\n        MemberShape member = MemberShape.builder().id(\"foo.bar#test$a\").target(stringShape).build();\n        StructureShape struct = StructureShape.builder().id(\"foo.bar#test\").addMember(member).build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(struct, member, stringShape)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol memberSymbol = provider.toSymbol(member);\n\n        assertThat(memberSymbol.getName(), equalTo(\"EnumString\"));\n    }\n\n    @Test\n    public void omitsUnknownNumberIntEnumVariant() {\n        IntEnumShape shape = IntEnumShape.builder().id(\"com.foo#Foo\").addMember(\"BAR\", 2).addMember(\"BAZ\", 5).build();\n        MemberShape member = MemberShape.builder().id(\"foo.bar#test$a\").target(shape).build();\n        StructureShape struct = StructureShape.builder().id(\"foo.bar#test\").addMember(member).build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(struct, member, shape)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        SymbolProvider provider = new SymbolVisitor(model, settings);\n        Symbol memberSymbol = provider.toSymbol(member);\n\n        assertThat(memberSymbol.getName(), equalTo(\"Foo\"));\n    }\n\n    @Test\n    public void placesResourceShapeIntoInitialBucket() {\n        Shape shape1 = StructureShape.builder().id(\"com.foo#Hello\").build();\n        Shape shape2 = ResourceShape.builder().id(\"com.foo.baz#Hello\").build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(shape1, shape2)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider provider = new SymbolVisitor(model, settings, 1);\n        Symbol symbol1 = provider.toSymbol(shape1);\n        Symbol symbol2 = provider.toSymbol(shape2);\n        SymbolVisitor.modelIndexer(Arrays.asList(shape1, shape2), provider);\n\n        assertThat(symbol1.getNamespace(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0\"));\n        assertThat(symbol1.getDefinitionFile(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0.ts\"));\n        assertThat(symbol2.getNamespace(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0\"));\n        assertThat(symbol2.getDefinitionFile(), equalTo(\"./\" + CodegenUtils.SOURCE_FOLDER + \"/models/models_0.ts\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptCodegenPluginTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\n\npublic class TypeScriptCodegenPluginTest {\n\n    @Test\n    public void generatesRuntimeConfigFiles() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .model(model)\n            .fileManifest(manifest)\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .build()\n            )\n            .build();\n\n        new TypeScriptCodegenPlugin().execute(context);\n\n        // Did we generate the runtime config files?\n        // note that asserting the contents of runtime config files is handled in its own unit tests.\n        assertTrue(manifest.hasFile(\"package.json\"));\n        assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.browser.ts\"));\n        assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/runtimeConfig.ts\"));\n        assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/index.ts\"));\n\n        // Does the package.json file point to the runtime config?\n        String packageJsonContents = manifest.getFileString(\"package.json\").get();\n        ObjectNode packageJson = Node.parse(packageJsonContents).expectObjectNode();\n        assertThat(\n            packageJson.expectObjectMember(\"browser\").getStringMember(\"./dist-es/runtimeConfig\"),\n            equalTo(Optional.of(Node.from(\"./dist-es/runtimeConfig.browser\")))\n        );\n    }\n\n    @Test\n    public void decoratesSymbolProvider() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .model(model)\n            .fileManifest(manifest)\n            .pluginClassLoader(getClass().getClassLoader())\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .withMember(\"__customServiceName\", \"Foo\")\n                    .build()\n            )\n            .build();\n\n        new TypeScriptCodegenPlugin().execute(context);\n\n        assertTrue(manifest.hasFile(\"Foo.ts\"));\n        assertThat(manifest.getFileString(\"Foo.ts\").get(), containsString(\"export class Foo\"));\n    }\n\n    @Test\n    public void generatesServiceClients() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .model(model)\n            .fileManifest(manifest)\n            .pluginClassLoader(getClass().getClassLoader())\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .build()\n            )\n            .build();\n        new TypeScriptCodegenPlugin().execute(context);\n\n        assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/Example.ts\"));\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/Example.ts\").get(),\n            containsString(\"export class Example extends ExampleClient\")\n        );\n\n        assertTrue(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/ExampleClient.ts\"));\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/ExampleClient.ts\").get(),\n            containsString(\"export class ExampleClient\")\n        );\n    }\n\n    @Test\n    public void invokesOnWriterCustomizations() {\n        // TODO\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptDelegatorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\n\npublic class TypeScriptDelegatorTest {\n\n    @Test\n    public void addsBuiltinDependencies() {\n        SymbolProvider provider = shape -> null;\n        MockManifest manifest = new MockManifest();\n        TypeScriptDelegator delegator = new TypeScriptDelegator(manifest, provider);\n\n        assertThat(delegator.getDependencies(), equalTo(TypeScriptDependency.getUnconditionalDependencies()));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptDependencyTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.contains;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.hasItem;\nimport static org.hamcrest.Matchers.not;\nimport static org.hamcrest.Matchers.startsWith;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolDependency;\n\npublic class TypeScriptDependencyTest {\n\n    @Test\n    public void createsSymbols() {\n        Symbol foo = TypeScriptDependency.SMITHY_CORE.createSymbol(\"Foo\");\n\n        assertThat(foo.getNamespace(), equalTo(TypeScriptDependency.SMITHY_CORE.packageName));\n        assertThat(foo.getName(), equalTo(\"Foo\"));\n        assertThat(foo.getDependencies(), contains(TypeScriptDependency.SMITHY_CORE.dependency));\n    }\n\n    @Test\n    public void getsUnconditionalDependencies() {\n        assertThat(\n            TypeScriptDependency.getUnconditionalDependencies(),\n            hasItem(TypeScriptDependency.SMITHY_TYPES.dependency)\n        );\n    }\n\n    @Test\n    public void getsVendedDependencyVersions() {\n        List<SymbolDependency> smithyTypes = TypeScriptDependency.SMITHY_TYPES.getDependencies();\n        List<SymbolDependency> serverCommon = TypeScriptDependency.SERVER_COMMON.getDependencies();\n\n        assertThat(smithyTypes.size(), equalTo(1));\n        assertThat(smithyTypes.get(0).getVersion(), startsWith(\"^\"));\n        assertThat(smithyTypes.get(0).getPackageName(), equalTo(\"@smithy/types\"));\n\n        assertThat(serverCommon.size(), equalTo(1));\n        assertThat(serverCommon.get(0).getVersion(), not(startsWith(\"^\")));\n        assertThat(serverCommon.get(0).getPackageName(), equalTo(\"@aws-smithy/server-common\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptJmesPathVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static software.amazon.smithy.typescript.codegen.TypeScriptWriter.CODEGEN_INDICATOR;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.jmespath.JmespathExpression;\n\npublic class TypeScriptJmesPathVisitorTest {\n\n    private String generateTypescriptInterpretation(String path) {\n        TypeScriptWriter writer = new TypeScriptWriter(\"test\");\n\n        JmespathExpression expression = JmespathExpression.parse(path);\n        expression.parse(path);\n        TypeScriptJmesPathVisitor visitor = new TypeScriptJmesPathVisitor(writer, \"result\", expression);\n        visitor.run();\n        String result = writer.toString();\n        return result;\n    }\n\n    @Test\n    public void createsSimpleOneLevelIndex() {\n        String result = generateTypescriptInterpretation(\"foo\");\n        assertThat(result, equalTo(CODEGEN_INDICATOR + \"const returnComparator = () => {\\n  return result.foo;\\n}\\n\"));\n    }\n\n    @Test\n    public void createsSimpleTwoLevelIndex() {\n        String result = generateTypescriptInterpretation(\"foo.bar\");\n        assertThat(\n            result,\n            equalTo(CODEGEN_INDICATOR + \"const returnComparator = () => {\\n  return result.foo.bar;\\n}\\n\")\n        );\n    }\n\n    @Test\n    public void createsDeepIndex() {\n        String result = generateTypescriptInterpretation(\"foo.bar.car.gar.foo.bar.car\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR\n                    + \"const returnComparator = () => {\\n  return result.foo.bar.car.gar.foo.bar.car;\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createsListProfile() {\n        String result = generateTypescriptInterpretation(\"foo.bar[].car\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.foo.bar);\\n  let projection_3 = flat_1.map((element_2: any) => {\\n    return element_2.car;\\n  });\\n  return projection_3;\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createsLengthEqualityCheckProfile() {\n        String result = generateTypescriptInterpretation(\"length(items) == `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR\n                    + \"const returnComparator = () => {\\n  return (result.items.length == 0);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createsLengthLessCheckProfile() {\n        String result = generateTypescriptInterpretation(\"length(items) < `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR\n                    + \"const returnComparator = () => {\\n  return (result.items.length < 0);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createsLengthGreaterCheckProfile() {\n        String result = generateTypescriptInterpretation(\"length(items) > `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR\n                    + \"const returnComparator = () => {\\n  return (result.items.length > 0);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createsDeepLengthCheckProfile() {\n        String result = generateTypescriptInterpretation(\"length(items.foo.deep[]) == `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.items.foo.deep);\\n  return (flat_1.length == 0);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createsDoubleLengthChecksProfile() {\n        String result = generateTypescriptInterpretation(\n            \"length(set.items[].bar[].gar.foo.items[].item) == length(bar.foos[].foo)\"\n        );\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.set.items);\\n  let projection_3 = flat_1.map((element_2: any) => {\\n    return element_2.bar;\\n  });\\n  let flat_4: any[] = [].concat(...projection_3);\\n  let projection_6 = flat_4.map((element_5: any) => {\\n    return element_5.gar.foo.items;\\n  });\\n  let flat_7: any[] = [].concat(...projection_6);\\n  let projection_9 = flat_7.map((element_8: any) => {\\n    return element_8.item;\\n  });\\n  let flat_10: any[] = [].concat(...result.bar.foos);\\n  let projection_12 = flat_10.map((element_11: any) => {\\n    return element_11.foo;\\n  });\\n  return (projection_9.length == projection_12.length);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createWrapAroundProfile() {\n        String result = generateTypescriptInterpretation(\"length(items[-1]) == `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  return (result.items[result.items.length - 1].length == 0);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createContainsProfile() {\n        String result = generateTypescriptInterpretation(\"contains(items[].State, `false`)\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.items);\\n  let projection_3 = flat_1.map((element_2: any) => {\\n    return element_2.State;\\n  });\\n  return projection_3.includes(false);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createWildcardIndex() {\n        String result = generateTypescriptInterpretation(\"foo.*.bar\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let objectProjection_2 = Object.values(result.foo).map((element_1: any) => {\\n    return element_1.bar;\\n  });\\n  return objectProjection_2;\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createFilterIndex() {\n        String result = generateTypescriptInterpretation(\"items[?foo=='awesome'][]\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let filterRes_2 = result.items.filter((element_1: any) => {\\n    return (element_1.foo == \\\"awesome\\\");\\n  });\\n  let flat_3: any[] = [].concat(...filterRes_2);\\n  return flat_3;\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createMultiIndex() {\n        String result = generateTypescriptInterpretation(\"items[].[`4` > `0`, `1` == `0`][]\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.items);\\n  let projection_3 = flat_1.map((element_2: any) => {\\n    let result_4 = [];\\n    result_4.push((4 > 0));\\n    result_4.push((1 == 0));\\n    element_2 = result_4;\\n    return element_2;\\n  });\\n  let flat_5: any[] = [].concat(...projection_3);\\n  return flat_5;\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createLengthFilterInstancesIndex() {\n        String result = generateTypescriptInterpretation(\n            \"length(Instances[?LifecycleState==\\\"InService\\\"]) >= MinSize\"\n        );\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let filterRes_2 = result.Instances.filter((element_1: any) => {\\n    return (element_1.LifecycleState == element_1.InService);\\n  });\\n  return (filterRes_2.length >= result.MinSize);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createComplexLengthFilterContainsIndex() {\n        String result = generateTypescriptInterpretation(\n            \"contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)\"\n        );\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.AutoScalingGroups);\\n  let projection_3 = flat_1.map((element_2: any) => {\\n    let filterRes_5 = element_2.Instances.filter((element_4: any) => {\\n      return (element_4.LifecycleState == \\\"InService\\\");\\n    });\\n    let result_6 = [];\\n    result_6.push((filterRes_5.length >= element_2.MinSize));\\n    element_2 = result_6;\\n    return element_2;\\n  });\\n  let flat_7: any[] = [].concat(...projection_3);\\n  return flat_7.includes(false);\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createNotIndex() {\n        String result = generateTypescriptInterpretation(\"!(length(items) == `0`)\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR\n                    + \"const returnComparator = () => {\\n  return (!(result.items.length == 0));\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createOrIndex() {\n        String result = generateTypescriptInterpretation(\"length(items[]) == `0` || length(foo) > `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.items);\\n  return (((flat_1.length == 0) || (result.foo.length > 0)) && ((result.foo.length > 0) || (flat_1.length == 0))) ;\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createAndIndex() {\n        String result = generateTypescriptInterpretation(\"length(items[]) == `0` && length(foo) > `0`\");\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let flat_1: any[] = [].concat(...result.items);\\n  return ((flat_1.length == 0) && (result.foo.length > 0));\\n}\\n\"\n            )\n        );\n    }\n\n    @Test\n    public void createComplexAndNotIndex() {\n        String result = generateTypescriptInterpretation(\n            \"(length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0`)\"\n        );\n        assertThat(\n            result,\n            equalTo(\n                CODEGEN_INDICATOR +\n                    \"const returnComparator = () => {\\n  let filterRes_2 = result.services.filter((element_1: any) => {\\n    return (!((element_1.deployments.length == 1) && (element_1.runningCount == element_1.desiredCount)));\\n  });\\n  return (filterRes_2.length == 0);\\n}\\n\"\n            )\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptSettingsTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.when;\n\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.Arguments;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.ServiceIndex;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.protocols.ProtocolPriorityConfig;\nimport software.amazon.smithy.utils.MapUtils;\n\n@ExtendWith(MockitoExtension.class)\npublic class TypeScriptSettingsTest {\n\n    // these are mock protocol names.\n    ShapeId rpcv2Cbor = ShapeId.from(\"namespace#rpcv2Cbor\");\n    ShapeId json1_0 = ShapeId.from(\"namespace#json1_0\");\n    ShapeId json1_1 = ShapeId.from(\"namespace#json1_1\");\n    ShapeId restJson1 = ShapeId.from(\"namespace#restJson1\");\n    ShapeId restXml = ShapeId.from(\"namespace#restXml\");\n    ShapeId query = ShapeId.from(\"namespace#query\");\n    ShapeId serviceQuery = ShapeId.from(\"namespace#serviceQuery\");\n    LinkedHashSet<ShapeId> protocolShapeIds = new LinkedHashSet<>(\n        List.of(json1_0, json1_1, restJson1, rpcv2Cbor, restXml, query, serviceQuery)\n    );\n\n    @Test\n    public void resolvesDefaultService() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        assertThat(settings.getService(), equalTo(ShapeId.from(\"smithy.example#Example\")));\n    }\n\n    @Test\n    public void defaultsToYarn() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n\n        assertEquals(TypeScriptSettings.PackageManager.YARN, settings.getPackageManager());\n    }\n\n    @Test\n    public void canBeConfiguredToNpm() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .withMember(\"packageManager\", Node.from(\"npm\"))\n                .build()\n        );\n\n        assertEquals(TypeScriptSettings.PackageManager.NPM, settings.getPackageManager());\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"providePackageDescriptionTestCases\")\n    void expectPackageDescriptionUpdatedByArtifactType(\n        TypeScriptSettings.ArtifactType artifactType,\n        String expectedDescription\n    ) {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .build();\n\n        final TypeScriptSettings typeScriptSettings = TypeScriptSettings.from(model, settings, artifactType);\n\n        assertEquals(typeScriptSettings.getPackageDescription(), expectedDescription);\n    }\n\n    private static Stream<Arguments> providePackageDescriptionTestCases() {\n        return Stream.of(\n            Arguments.of(TypeScriptSettings.ArtifactType.SSDK, \"example server\"),\n            Arguments.of(TypeScriptSettings.ArtifactType.CLIENT, \"example client\")\n        );\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectJson(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // spec case 1.\n        when(serviceIndex.getProtocols(service)).thenReturn(MapUtils.of(rpcv2Cbor, null, json1_0, null));\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        // JS customization has JSON at higher default priority than CBOR.\n        assertEquals(json1_0, protocol);\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectOnlyOption(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // spec case 2.\n        when(serviceIndex.getProtocols(service)).thenReturn(MapUtils.of(rpcv2Cbor, null));\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        assertEquals(rpcv2Cbor, protocol);\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectJsonOverQueryAndCbor(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // spec case 3.\n        when(serviceIndex.getProtocols(service)).thenReturn(MapUtils.of(rpcv2Cbor, null, json1_0, null, query, null));\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        // JS customization has JSON at higher default priority than CBOR.\n        assertEquals(json1_0, protocol);\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectJsonOverQuery(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // spec case 4.\n        when(serviceIndex.getProtocols(service)).thenReturn(MapUtils.of(json1_0, null, query, null));\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        assertEquals(json1_0, protocol);\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectQueryWhenSingularOption(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // spec case 5.\n        when(serviceIndex.getProtocols(service)).thenReturn(MapUtils.of(query, null));\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        assertEquals(query, protocol);\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectServiceCustomPriority(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // service override, non-spec\n        when(serviceIndex.getProtocols(service)).thenReturn(\n            MapUtils.of(\n                json1_0,\n                null,\n                json1_1,\n                null,\n                restJson1,\n                null,\n                rpcv2Cbor,\n                null,\n                restXml,\n                null,\n                query,\n                null,\n                serviceQuery,\n                null\n            )\n        );\n        subject.setProtocolPriority(\n            new ProtocolPriorityConfig(\n                MapUtils.of(\n                    serviceShapeId,\n                    List.of(serviceQuery, rpcv2Cbor, json1_1, restJson1, restXml, query)\n                ),\n                null\n            )\n        );\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        assertEquals(serviceQuery, protocol);\n    }\n\n    @Test\n    public void resolveServiceProtocolSelectDefaultCustomPriority(\n        @Mock Model model,\n        @Mock ServiceShape service,\n        @Mock ServiceIndex serviceIndex\n    ) {\n        TypeScriptSettings subject = new TypeScriptSettings();\n        when(model.getKnowledge(any(), any())).thenReturn(serviceIndex);\n        ShapeId serviceShapeId = ShapeId.from(\"namespace#Service\");\n        when(service.toShapeId()).thenReturn(serviceShapeId);\n\n        // global default override\n        when(serviceIndex.getProtocols(service)).thenReturn(\n            MapUtils.of(\n                json1_0,\n                null,\n                json1_1,\n                null,\n                restJson1,\n                null,\n                rpcv2Cbor,\n                null,\n                restXml,\n                null,\n                query,\n                null,\n                serviceQuery,\n                null\n            )\n        );\n        subject.setProtocolPriority(\n            new ProtocolPriorityConfig(null, List.of(rpcv2Cbor, json1_1, restJson1, restXml, query))\n        );\n        ShapeId protocol = subject.resolveServiceProtocol(model, service, protocolShapeIds);\n        assertEquals(rpcv2Cbor, protocol);\n    }\n\n    @Test\n    public void parseProtocolPriorityJson() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"simple-service.smithy\")).assemble().unwrap();\n\n        ObjectNode settings = Node.objectNodeBuilder()\n            .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n            .withMember(\"package\", Node.from(\"example\"))\n            .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n            .withMember(\n                \"serviceProtocolPriority\",\n                Node.parse(\n                    \"\"\"\n                    {\n                      \"namespace#Service1\": [\"namespace#Protocol1\", \"namespace#Protocol2\"],\n                      \"namespace#Service2\": [\"namespace#Protocol2\", \"namespace#Protocol1\"]\n                    }\n                    \"\"\"\n                )\n            )\n            .withMember(\n                \"defaultProtocolPriority\",\n                Node.parse(\n                    \"\"\"\n                    [\"namespace#Protocol3\", \"namespace#Protocol4\"]\n                    \"\"\"\n                )\n            )\n            .build();\n\n        final TypeScriptSettings subject = TypeScriptSettings.from(model, settings);\n\n        assertEquals(\n            ShapeId.from(\"namespace#Protocol2\"),\n            subject.getProtocolPriority().getProtocolPriority(ShapeId.from(\"namespace#Service1\")).get(1)\n        );\n        assertEquals(\n            ShapeId.from(\"namespace#Protocol2\"),\n            subject.getProtocolPriority().getProtocolPriority(ShapeId.from(\"namespace#Service2\")).get(0)\n        );\n        assertEquals(\n            ShapeId.from(\"namespace#Protocol4\"),\n            subject.getProtocolPriority().getProtocolPriority(ShapeId.from(\"namespace#Service5\")).get(1)\n        );\n    }\n\n    @Test\n    public void resolvesSupportProtocols() {\n        // TODO\n    }\n\n    @Test\n    public void defaultsApplicationProtocolToHttp() {\n        // TODO\n    }\n\n    @Test\n    public void throwsWhenProtocolsAreNotCoherent() {\n        // TODO\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptUtilsTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.Arrays;\nimport org.junit.jupiter.api.Test;\n\npublic class TypeScriptUtilsTest {\n\n    @Test\n    public void sanitizesPropertyNames() {\n        assertThat(TypeScriptUtils.sanitizePropertyName(\"foo\"), equalTo(\"foo\"));\n        assertThat(TypeScriptUtils.sanitizePropertyName(\"$foo\"), equalTo(\"$foo\"));\n        assertThat(TypeScriptUtils.sanitizePropertyName(\"_Foo\"), equalTo(\"_Foo\"));\n        assertThat(TypeScriptUtils.sanitizePropertyName(\"_Foo.bar\"), equalTo(\"\\\"_Foo.bar\\\"\"));\n        assertThat(TypeScriptUtils.sanitizePropertyName(\"!foo\"), equalTo(\"\\\"!foo\\\"\"));\n        assertThat(TypeScriptUtils.sanitizePropertyName(\"foo?\"), equalTo(\"\\\"foo?\\\"\"));\n    }\n\n    @Test\n    public void createsEnumVariantsFromString() {\n        assertThat(TypeScriptUtils.getEnumVariants(Arrays.asList(\"foo\", \"bar\")), equalTo(\"\\\"bar\\\" | \\\"foo\\\"\"));\n        assertThat(TypeScriptUtils.getEnumVariants(Arrays.asList(\"foo!!\")), equalTo(\"\\\"foo!!\\\"\"));\n        assertThat(TypeScriptUtils.getEnumVariants(Arrays.asList(\"foo\\\"\", \"bar\")), equalTo(\"\\\"bar\\\" | \\\"foo\\\\\\\"\\\"\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/TypeScriptWriterTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.not;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static software.amazon.smithy.typescript.codegen.TypeScriptWriter.CODEGEN_INDICATOR;\n\nimport java.nio.file.Paths;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.traits.DeprecatedTrait;\nimport software.amazon.smithy.model.traits.DocumentationTrait;\n\npublic class TypeScriptWriterTest {\n\n    @Test\n    public void writesDocStrings() {\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.writeDocs(\"These are the docs.\\nMore.\");\n        String result = writer.toString();\n\n        assertThat(result, equalTo(CODEGEN_INDICATOR + \"/**\\n * These are the docs.\\n * More.\\n */\\n\"));\n    }\n\n    @Test\n    public void doesNotAddNewlineBetweenManagedAndExplicitImports() {\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.write(\"import { Foo } from \\\"baz\\\";\");\n        writer.addImport(\"Baz\", \"Baz\", \"./hello\");\n        writer.addImport(\"Bar\", \"__Bar\", TypeScriptDependency.SMITHY_TYPES);\n        writer.addRelativeImport(\"Qux\", \"__Qux\", Paths.get(\"./qux\"));\n        String result = writer.toString();\n\n        assertEquals(\n            \"\"\"\n            %simport { Bar as __Bar } from \"@smithy/types\";\n\n            import { Baz } from \"./hello\";\n            import { Qux as __Qux } from \"./qux\";\n            import { Foo } from \"baz\";\n            \"\"\".formatted(CODEGEN_INDICATOR),\n            result\n        );\n    }\n\n    @Test\n    public void escapesDollarInDocStrings() {\n        String docs = \"This is $ valid documentation.\";\n\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.writeDocs(docs);\n        String result = writer.toString();\n\n        assertThat(result, equalTo(CODEGEN_INDICATOR + \"/**\\n * \" + docs + \"\\n */\\n\"));\n    }\n\n    @Test\n    public void escapesMultiLineCloseInDocStrings() {\n        String docs = \"This is */ valid documentation.\";\n\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.writeDocs(docs);\n        String result = writer.toString();\n\n        assertThat(result, equalTo(CODEGEN_INDICATOR + \"/**\\n * This is *\\\\/ valid documentation.\\n */\\n\"));\n    }\n\n    @Test\n    public void addsFormatterForSymbols() {\n        // TODO\n    }\n\n    @Test\n    public void addsFormatterForSymbolReferences() {\n        // TODO\n    }\n\n    @Test\n    public void addImportSubmodule() {\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.addDependency(TypeScriptDependency.SMITHY_CORE);\n        writer.addImportSubmodule(\"symbol\", \"__symbol\", () -> \"@smithy/core\", \"/submodule\");\n        String result = writer.toString();\n\n        assertEquals(\n            \"\"\"\n            %simport { symbol as __symbol } from \"@smithy/core/submodule\";\n            \"\"\".formatted(CODEGEN_INDICATOR)\n                .trim(),\n            result.trim()\n        );\n    }\n\n    @Test\n    public void writeShapeDocsIncludesSinceFromDeprecatedTrait() {\n        StringShape shape = StringShape.builder()\n            .id(ShapeId.from(\"com.example#MyString\"))\n            .addTrait(new DocumentationTrait(\"Some docs.\"))\n            .addTrait(\n                DeprecatedTrait.builder()\n                    .message(\"Use MyStringV2 instead\")\n                    .since(\"2024-01-01\")\n                    .build()\n            )\n            .build();\n\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.writeShapeDocs(shape);\n        String result = writer.toString();\n\n        assertThat(result, containsString(\"@deprecated (since 2024-01-01) Use MyStringV2 instead.\"));\n    }\n\n    @Test\n    public void writeShapeDocsOmitsSinceWhenNotSet() {\n        StringShape shape = StringShape.builder()\n            .id(ShapeId.from(\"com.example#MyString\"))\n            .addTrait(new DocumentationTrait(\"Some docs.\"))\n            .addTrait(\n                DeprecatedTrait.builder()\n                    .message(\"Use MyStringV2 instead\")\n                    .build()\n            )\n            .build();\n\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        writer.writeShapeDocs(shape);\n        String result = writer.toString();\n\n        assertThat(result, containsString(\"@deprecated Use MyStringV2 instead.\"));\n        assertThat(result, not(containsString(\"since\")));\n    }\n\n    @Test\n    public void buildDeprecationAnnotationWithMessageOnly() {\n        DeprecatedTrait trait = DeprecatedTrait.builder()\n            .message(\"Use FooV2 instead\")\n            .build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated Use FooV2 instead.\", result);\n    }\n\n    @Test\n    public void buildDeprecationAnnotationWithSinceOnly() {\n        DeprecatedTrait trait = DeprecatedTrait.builder()\n            .since(\"2024-01-01\")\n            .build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated since 2024-01-01.\", result);\n    }\n\n    @Test\n    public void buildDeprecationAnnotationWithMessageAndSince() {\n        DeprecatedTrait trait = DeprecatedTrait.builder()\n            .message(\"Use FooV2 instead\")\n            .since(\"2024-01-01\")\n            .build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated (since 2024-01-01) Use FooV2 instead.\", result);\n    }\n\n    @Test\n    public void buildDeprecationAnnotationWithNoFields() {\n        DeprecatedTrait trait = DeprecatedTrait.builder().build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated deprecated.\", result);\n    }\n\n    @Test\n    public void buildIncredulousDeprecationAnnotation() {\n        DeprecatedTrait trait = DeprecatedTrait.builder()\n            .message(\"what??\")\n            .build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated what??\", result);\n    }\n\n    @Test\n    public void buildDramaticDeprecationAnnotation() {\n        DeprecatedTrait trait = DeprecatedTrait.builder()\n            .message(\"Noo!!!\")\n            .build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated Noo!!!\", result);\n    }\n\n    @Test\n    public void buildHtmlDeprecationAnnotation() {\n        DeprecatedTrait trait = DeprecatedTrait.builder()\n            .message(\"<p>Hello</p>\")\n            .build();\n        String result = TypeScriptWriter.buildDeprecationAnnotation(trait);\n        assertEquals(\"@deprecated <p>Hello</p>\", result);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/UnionGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\n\npublic class UnionGeneratorTest {\n\n    @Test\n    public void generatesTaggedUnions() {\n        MemberShape memberA = MemberShape.builder().id(\"com.foo#Example$A\").target(\"smithy.api#String\").build();\n        MemberShape memberB = MemberShape.builder().id(\"com.foo#Example$B\").target(\"smithy.api#Integer\").build();\n        MemberShape memberC = MemberShape.builder().id(\"com.foo#Example$C\").target(\"smithy.api#Boolean\").build();\n        UnionShape unionShape = UnionShape.builder()\n            .id(\"com.foo#Example\")\n            .addMember(memberA)\n            .addMember(memberB)\n            .addMember(memberC)\n            .build();\n        Model model = Model.assembler()\n            .addImport(getClass().getResource(\"simple-service.smithy\"))\n            .addShapes(unionShape, memberA, memberB, memberC)\n            .assemble()\n            .unwrap();\n        TypeScriptSettings settings = TypeScriptSettings.from(\n            model,\n            Node.objectNodeBuilder()\n                .withMember(\"package\", Node.from(\"example\"))\n                .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                .build()\n        );\n        SymbolProvider symbolProvider = new SymbolVisitor(model, settings);\n        TypeScriptWriter writer = new TypeScriptWriter(\"./Example\");\n        new UnionGenerator(model, settings, symbolProvider, writer, unionShape).run();\n        String output = writer.toString();\n\n        assertEquals(\n            \"\"\"\n            // smithy-typescript generated code\n            /**\n             * @public\n             */\n            export type Example =\n              | Example.AMember\n              | Example.BMember\n              | Example.CMember\n              | Example.$UnknownMember;\n\n            /**\n             * @public\n             */\n            export namespace Example {\n              export interface AMember {\n                A: string;\n                B?: never;\n                C?: never;\n                $unknown?: never;\n              }\n\n              export interface BMember {\n                A?: never;\n                B: number;\n                C?: never;\n                $unknown?: never;\n              }\n\n              export interface CMember {\n                A?: never;\n                B?: never;\n                C: boolean;\n                $unknown?: never;\n              }\n\n              /**\n               * @public\n               */\n              export interface $UnknownMember {\n                A?: never;\n                B?: never;\n                C?: never;\n                $unknown: [string, any];\n              }\n\n              export interface Visitor<T> {\n                A: (value: string) => T;\n                B: (value: number) => T;\n                C: (value: boolean) => T;\n                _: (name: string, value: any) => T;\n              }\n\n              export const visit = <T>(value: Example, visitor: Visitor<T>): T => {\n                if (value.A !== undefined) return visitor.A(value.A);\n                if (value.B !== undefined) return visitor.B(value.B);\n                if (value.C !== undefined) return visitor.C(value.C);\n                return visitor._(value.$unknown[0], value.$unknown[1]);\n              };\n            }\n            \"\"\",\n            output\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/documentation/DocumentationExampleGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.documentation;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.node.ObjectNode;\n\nclass DocumentationExampleGeneratorTest {\n\n    ObjectNode input = ObjectNode.builder()\n        .withMember(\"Key\", \"example-key\")\n        .withMember(\"Bucket\", \"example-key\")\n        .build();\n\n    ObjectNode output = ObjectNode.builder()\n        .withMember(\"Config\", ObjectNode.builder().withMember(\"Temperature\", 30).build())\n        .build();\n\n    @Test\n    void inputToJavaScriptObject() {\n        String example = DocumentationExampleGenerator.inputToJavaScriptObject(input);\n        assertEquals(\n            \"\"\"\n            {\n              Bucket: \"example-key\",\n              Key: \"example-key\"\n            }\"\"\",\n            example\n        );\n    }\n\n    @Test\n    void outputToJavaScriptObject() {\n        String example = DocumentationExampleGenerator.inputToJavaScriptObject(output);\n        assertEquals(\n            \"\"\"\n            {\n              Config: {\n                Temperature: 30\n              }\n            }\"\"\",\n            example\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/documentation/StructureExampleGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.documentation;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.StreamingTrait;\n\npublic class StructureExampleGeneratorTest {\n\n    StringShape string = StringShape.builder().id(\"foo.bar#string\").build();\n\n    BlobShape blob = BlobShape.builder().id(\"foo.bar#blob\").build();\n\n    BlobShape streamingBlob = BlobShape.builder()\n        .id(\"foo.bar#streamingBlob\")\n        .traits(List.of(new StreamingTrait()))\n        .build();\n\n    ListShape list = ListShape.builder().id(\"foo.bar#list\").member(string.getId()).build();\n\n    MapShape map = MapShape.builder()\n        .id(\"foo.bar#map\")\n        .key(MemberShape.builder().id(\"foo.bar#map$member\").target(string.getId()).build())\n        .value(MemberShape.builder().id(\"foo.bar#map$member\").target(string.getId()).build())\n        .build();\n\n    MemberShape memberForString = MemberShape.builder().id(\"foo.bar#structure$string\").target(string.getId()).build();\n\n    MemberShape memberForBlob = MemberShape.builder().id(\"foo.bar#blobStructure$blob\").target(blob.getId()).build();\n\n    MemberShape memberForStreamingBlob = MemberShape.builder()\n        .id(\"foo.bar#blobStructure$streamingBlob\")\n        .target(streamingBlob.getId())\n        .build();\n\n    MemberShape memberForList = MemberShape.builder().id(\"foo.bar#structure$list\").target(list.getId()).build();\n\n    MemberShape memberForMap = MemberShape.builder().id(\"foo.bar#structure$map\").target(map.getId()).build();\n\n    StructureShape structure = StructureShape.builder()\n        .id(\"foo.bar#structure\")\n        .members(\n            List.of(\n                memberForString,\n                memberForList,\n                memberForMap,\n                MemberShape.builder().id(\"foo.bar#structure$list2\").target(list.getId()).build(),\n                MemberShape.builder().id(\"foo.bar#structure$list3\").target(list.getId()).build(),\n                MemberShape.builder().id(\"foo.bar#structure$list4\").target(list.getId()).build(),\n                MemberShape.builder().id(\"foo.bar#structure$list5\").target(list.getId()).build(),\n                MemberShape.builder().id(\"foo.bar#structure$list6\").target(list.getId()).build(),\n                MemberShape.builder().id(\"foo.bar#structure$list7\").target(list.getId()).build(),\n                MemberShape.builder()\n                    .id(\"foo.bar#structure$structure\")\n                    .target(\"foo.bar#structure\")\n                    .build()\n            )\n        )\n        .build();\n\n    StructureShape blobStructure = StructureShape.builder()\n        .id(\"foo.bar#blobStructure\")\n        .members(List.of(memberForBlob, memberForStreamingBlob))\n        .build();\n\n    private Model model = Model.builder()\n        .addShapes(string, list, map, structure, memberForString, memberForList, memberForMap, blob, streamingBlob)\n        .build();\n\n    @Test\n    public void generatesStructuralHintDocumentation_map() {\n        assertThat(\n            StructureExampleGenerator.generateStructuralHintDocumentation(map, model, false, true),\n            equalTo(\n                \"\"\"\n                { // map\n                  \"<keys>\": \"STRING_VALUE\",\n                };\"\"\"\n            )\n        );\n    }\n\n    @Test\n    public void generatesStructuralHintDocumentation_structure() {\n        assertThat(\n            StructureExampleGenerator.generateStructuralHintDocumentation(structure, model, false, true),\n            equalTo(\n                \"\"\"\n                { // structure\n                  string: \"STRING_VALUE\",\n                  list: [ // list\n                    \"STRING_VALUE\",\n                  ],\n                  map: { // map\n                    \"<keys>\": \"STRING_VALUE\",\n                  },\n                  list2: [\n                    \"STRING_VALUE\",\n                  ],\n                  list3: [\n                    \"STRING_VALUE\",\n                  ],\n                  list4: [\n                    \"STRING_VALUE\",\n                  ],\n                  list5: [\n                    \"STRING_VALUE\",\n                  ],\n                  list6: \"<list>\",\n                  list7: \"<list>\",\n                  structure: {\n                    string: \"STRING_VALUE\",\n                    list: \"<list>\",\n                    map: {\n                      \"<keys>\": \"STRING_VALUE\",\n                    },\n                    list2: \"<list>\",\n                    list3: \"<list>\",\n                    list4: \"<list>\",\n                    list5: \"<list>\",\n                    list6: \"<list>\",\n                    list7: \"<list>\",\n                    structure: \"<structure>\",\n                  },\n                };\"\"\"\n            )\n        );\n    }\n\n    @Test\n    public void generatesStructuralHintDocumentation_structure_asComment() {\n        assertThat(\n            StructureExampleGenerator.generateStructuralHintDocumentation(structure, model, true, true),\n            equalTo(\n                \"\"\"\n                // { // structure\n                //   string: \"STRING_VALUE\",\n                //   list: [ // list\n                //     \"STRING_VALUE\",\n                //   ],\n                //   map: { // map\n                //     \"<keys>\": \"STRING_VALUE\",\n                //   },\n                //   list2: [\n                //     \"STRING_VALUE\",\n                //   ],\n                //   list3: [\n                //     \"STRING_VALUE\",\n                //   ],\n                //   list4: [\n                //     \"STRING_VALUE\",\n                //   ],\n                //   list5: [\n                //     \"STRING_VALUE\",\n                //   ],\n                //   list6: \"<list>\",\n                //   list7: \"<list>\",\n                //   structure: {\n                //     string: \"STRING_VALUE\",\n                //     list: \"<list>\",\n                //     map: {\n                //       \"<keys>\": \"STRING_VALUE\",\n                //     },\n                //     list2: \"<list>\",\n                //     list3: \"<list>\",\n                //     list4: \"<list>\",\n                //     list5: \"<list>\",\n                //     list6: \"<list>\",\n                //     list7: \"<list>\",\n                //     structure: \"<structure>\",\n                //   },\n                // };\"\"\"\n            )\n        );\n    }\n\n    @Test\n    public void generatesStructuralHintDocumentation_list() {\n        assertThat(\n            StructureExampleGenerator.generateStructuralHintDocumentation(list, model, false, true),\n            equalTo(\n                \"\"\"\n                [ // list\n                  \"STRING_VALUE\",\n                ];\"\"\"\n            )\n        );\n    }\n\n    @Test\n    public void generateStructuralHintDocumentation_blob() {\n        assertThat(\n            StructureExampleGenerator.generateStructuralHintDocumentation(blobStructure, model, false, true),\n            equalTo(\n                \"\"\"\n                { // blobStructure\n                  blob: new Uint8Array(), // e.g. Buffer.from(\"\") or new TextEncoder().encode(\"\")\n                  streamingBlob: \"MULTIPLE_TYPES_ACCEPTED\", // see \\\\@smithy/types -> StreamingBlobPayloadInputTypes\n                };\"\"\"\n            )\n        );\n        assertThat(\n            StructureExampleGenerator.generateStructuralHintDocumentation(blobStructure, model, false, false),\n            equalTo(\n                \"\"\"\n                { // blobStructure\n                  blob: new Uint8Array(),\n                  streamingBlob: \"<SdkStream>\", // see \\\\@smithy/types -> StreamingBlobPayloadOutputTypes\n                };\"\"\"\n            )\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/endpointsV2/EndpointsV2GeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.is;\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenPlugin;\n\npublic class EndpointsV2GeneratorTest {\n\n    @Test\n    public void containsTrailingSemicolon() {\n        MockManifest manifest = testEndpoints(\"endpoints.smithy\");\n\n        String ruleset = manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/endpoint/ruleset.ts\").get();\n\n        assertEquals(\n            \"\"\"\n            // smithy-typescript generated code\n            import type { RuleSetObject } from \"@smithy/types\";\n\n            export const ruleSet: RuleSetObject = {\n              version: \"1.3\",\n              parameters: {\n                Region: {\n                  type: \"String\",\n                  documentation: \"The region to dispatch this request, eg. `us-east-1`.\",\n                },\n                Stage: {\n                  type: \"String\",\n                  required: true,\n                  default: \"production\",\n                },\n                Endpoint: {\n                  builtIn: \"SDK::Endpoint\",\n                  type: \"String\",\n                  required: false,\n                  documentation: \"Override the endpoint used to send this request\",\n                },\n              },\n              rules: [\n                {\n                  conditions: [\n                    {\n                      fn: \"isSet\",\n                      argv: [\n                        {\n                          ref: \"Endpoint\",\n                        },\n                      ],\n                    },\n                    {\n                      fn: \"parseURL\",\n                      argv: [\n                        {\n                          ref: \"Endpoint\",\n                        },\n                      ],\n                      assign: \"url\",\n                    },\n                  ],\n                  endpoint: {\n                    url: {\n                      ref: \"Endpoint\",\n                    },\n                    properties: {},\n                    headers: {},\n                  },\n                  type: \"endpoint\",\n                },\n                {\n                  documentation: \"Template the region into the URI when region is set\",\n                  conditions: [\n                    {\n                      fn: \"isSet\",\n                      argv: [\n                        {\n                          ref: \"Region\",\n                        },\n                      ],\n                    },\n                  ],\n                  type: \"tree\",\n                  rules: [\n                    {\n                      conditions: [\n                        {\n                          fn: \"stringEquals\",\n                          argv: [\n                            {\n                              ref: \"Stage\",\n                            },\n                            \"staging\",\n                          ],\n                        },\n                      ],\n                      endpoint: {\n                        url: \"https://{Region}.staging.example.com/2023-01-01\",\n                        properties: {},\n                        headers: {},\n                      },\n                      type: \"endpoint\",\n                    },\n                    {\n                      conditions: [],\n                      endpoint: {\n                        url: \"https://{Region}.example.com/2023-01-01\",\n                        properties: {},\n                        headers: {},\n                      },\n                      type: \"endpoint\",\n                    },\n                  ],\n                },\n                {\n                  documentation: \"Fallback when region is unset\",\n                  conditions: [],\n                  error: \"Region must be set to resolve a valid endpoint\",\n                  type: \"error\",\n                },\n              ],\n            };\n            \"\"\",\n            ruleset\n        );\n    }\n\n    @Test\n    public void containsExtraContextParameter() {\n        MockManifest manifest = testEndpoints(\"endpoints.smithy\");\n\n        String ruleset = manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/endpoint/ruleset.ts\").get();\n\n        assertThat(\n            ruleset,\n            containsString(\n                \"\"\"\n                    },\n                    Stage: {\n                      type: \"String\",\n                      required: true,\n                      default: \"production\",\n                    },\n                \"\"\"\n            )\n        );\n\n        String endpointParameters = manifest\n            .getFileString(CodegenUtils.SOURCE_FOLDER + \"/endpoint/EndpointParameters.ts\")\n            .get();\n\n        assertThat(\n            endpointParameters,\n            containsString(\n                \"\"\"\n                  return Object.assign(options, {\n                    stage: options.stage ?? \"production\",\n                    defaultSigningName: \"\",\n                    clientContextParams: Object.assign(clientContextParamDefaults, options.clientContextParams),\n                  });\n                \"\"\"\n            )\n        );\n        assertThat(\n            endpointParameters,\n            containsString(\n                \"\"\"\n                export interface ClientInputEndpointParameters {\n                  clientContextParams?: {\n                    region?: string | undefined | Provider<string | undefined>;\n                    stage?: string | undefined | Provider<string | undefined>;\n                  };\n                  stage?: string | undefined | Provider<string | undefined>;\n                  endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;\n                }\"\"\"\n            )\n        );\n    }\n\n    private MockManifest testEndpoints(String filename) {\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .pluginClassLoader(getClass().getClassLoader())\n            .model(\n                Model.assembler()\n                    .addImport(getClass().getResource(filename))\n                    .discoverModels()\n                    .assemble()\n                    .unwrap()\n            )\n            .fileManifest(manifest)\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .withMember(\"generateEndpointBdd\", Node.from(false))\n                    .build()\n            )\n            .build();\n\n        new TypeScriptCodegenPlugin().execute(context);\n\n        assertThat(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/endpoint/EndpointParameters.ts\"), is(true));\n        assertThat(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/endpoint/endpointResolver.ts\"), is(true));\n\n        String contents = manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/endpoint/ruleset.ts\").get();\n\n        assertThat(contents, containsString(\"export const ruleSet: RuleSetObject\"));\n\n        return manifest;\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/endpointsV2/RuleSetParameterFinderTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.endpointsV2;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.mockito.Mockito.when;\n\nimport java.util.List;\nimport java.util.Optional;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.rulesengine.language.EndpointRuleSet;\nimport software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait;\n\n@ExtendWith(MockitoExtension.class)\nclass RuleSetParameterFinderTest {\n\n    RuleSetParameterFinder subject;\n\n    Node ruleSet = Node.parse(\n        \"\"\"\n        {\n          \"version\": \"1.0\",\n          \"parameters\": {\n            \"BasicParameter\": {\n              \"required\": false,\n              \"documentation\": \"...\",\n              \"type\": \"String\"\n            },\n            \"NestedParameter\": {\n              \"required\": true,\n              \"documentation\": \"...\",\n              \"type\": \"Boolean\"\n            },\n            \"UrlOnlyParameter\": {\n              \"required\": true,\n              \"documentation\": \"...\",\n              \"type\": \"String\"\n            },\n            \"UnusedParameter\": {\n              \"required\": false,\n              \"documentation\": \"...\",\n              \"type\": \"String\"\n            },\n            \"ShorthandParameter\": {\n              \"required\": true,\n              \"documentation\": \"...\",\n              \"type\": \"String\"\n            }\n          },\n          \"rules\": [\n            {\n              \"conditions\": [\n                {\n                  \"fn\": \"isSet\",\n                  \"argv\": [\n                    {\n                      \"ref\": \"BasicParameter\"\n                    }\n                  ]\n                }\n              ],\n              \"rules\": [\n                {\n                  \"conditions\": [\n                    {\n                      \"fn\": \"booleanEquals\",\n                      \"argv\": [\n                        {\n                          \"fn\": \"booleanEquals\",\n                          \"argv\": [\n                            {\n                              \"fn\": \"booleanEquals\",\n                              \"argv\": [\n                                {\n                                  \"fn\": \"booleanEquals\",\n                                  \"argv\": [\n                                    {\n                                      \"ref\": \"NestedParameter\"\n                                    },\n                                    true\n                                  ]\n                                },\n                                true\n                              ]\n                            },\n                            true\n                          ]\n                        },\n                        true\n                      ]\n                    },\n                    {\n                      \"fn\": \"stringEquals\",\n                      \"argv\": [\n                        \"literal\",\n                        \"{ShorthandParameter}\"\n                      ]\n                    }\n                  ],\n                  \"endpoint\": {\n                    \"url\": \"https://www.{BasicParameter}.{UrlOnlyParameter}.com\",\n                    \"properties\": {},\n                    \"headers\": {}\n                  },\n                  \"type\": \"endpoint\"\n                }\n              ],\n              \"type\": \"tree\"\n            }\n          ]\n        }\n        \"\"\"\n    );\n\n    @Test\n    void getEffectiveParams(@Mock ServiceShape serviceShape, @Mock EndpointRuleSetTrait endpointRuleSetTrait) {\n        EndpointRuleSet endpointRuleSet = EndpointRuleSet.fromNode(ruleSet);\n        when(serviceShape.getTrait(EndpointRuleSetTrait.class)).thenReturn(Optional.of(endpointRuleSetTrait));\n        when(endpointRuleSetTrait.getEndpointRuleSet()).thenReturn(endpointRuleSet);\n        subject = new RuleSetParameterFinder(serviceShape);\n\n        List<String> effectiveParams = subject.getEffectiveParams();\n\n        assertEquals(\n            List.of(\"BasicParameter\", \"NestedParameter\", \"ShorthandParameter\", \"UrlOnlyParameter\"),\n            effectiveParams\n        );\n    }\n\n    @Test\n    void getJmesPathExpression(@Mock ServiceShape serviceShape, @Mock EndpointRuleSetTrait endpointRuleSetTrait) {\n        when(serviceShape.getTrait(EndpointRuleSetTrait.class)).thenReturn(Optional.of(endpointRuleSetTrait));\n        subject = new RuleSetParameterFinder(serviceShape);\n\n        assertEquals(\n            \"\"\"\n            Object.keys(input?.RequestItems ?? {})\"\"\",\n            subject.getJmesPathExpression(\"?.\", \"input\", \"keys(RequestItems)\")\n        );\n\n        assertEquals(\n            \"\"\"\n            input?.TableCreationParameters?.TableName\"\"\",\n            subject.getJmesPathExpression(\"?.\", \"input\", \"TableCreationParameters.TableName\")\n        );\n\n        assertEquals(\n            \"\"\"\n            input?.TransactItems?.map((obj: any) => obj?.Get?.TableName\"\"\",\n            subject.getJmesPathExpression(\"?.\", \"input\", \"TransactItems[*].Get.TableName\")\n        );\n\n        assertEquals(\n            \"\"\"\n            input?.TransactItems?.map((obj: any) => [obj?.ConditionCheck?.TableName,obj?.Put?.TableName,obj?.Delete?.TableName,obj?.Update?.TableName].filter((i) => i)).flat()\"\"\",\n            subject.getJmesPathExpression(\n                \"?.\",\n                \"input\",\n                \"TransactItems[*].[ConditionCheck.TableName, Put.TableName, Delete.TableName, Update.TableName][]\"\n            )\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/AddHttpApiKeyAuthPluginTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\n\nimport java.util.Collection;\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.build.MockManifest;\nimport software.amazon.smithy.build.PluginContext;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.TypeScriptClientCodegenPlugin;\n\npublic class AddHttpApiKeyAuthPluginTest {\n\n    @Test\n    public void httpApiKeyAuthClientOnService() {\n        testInjects(\"http-api-key-auth-trait.smithy\", \"\"\"\n                                                      in: 'header',\n                                                      name: 'Authorization',\n                                                      scheme: 'ApiKey'\"\"\");\n    }\n\n    @Test\n    public void httpApiKeyAuthClientOnOperation() {\n        testInjects(\n            \"http-api-key-auth-trait-on-operation.smithy\",\n            \"\"\"\n            in: 'header',\n            name: 'Authorization',\n            scheme: 'ApiKey'\"\"\"\n        );\n    }\n\n    // This should be identical to the httpApiKeyAuthClient test except for the parameters provided\n    // to the middleware.\n    @Test\n    public void httpApiKeyAuthClientNoScheme() {\n        testInjects(\"http-api-key-auth-trait-no-scheme.smithy\", \"\"\"\n                                                                in: 'header',\n                                                                name: 'Authorization'\"\"\");\n    }\n\n    private void testInjects(String filename, String extra) {\n        MockManifest manifest = generate(filename);\n\n        // Ensure that the client imports the config properly and calls the resolve function.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/ExampleClient.ts\").get(),\n            containsString(\"from \\\"./middleware/HttpApiKeyAuth\\\"\")\n        );\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/ExampleClient.ts\").get(),\n            containsString(\"= resolveHttpApiKeyAuthConfig(\")\n        );\n\n        // Ensure that the GetFoo operation imports the middleware and uses it with all the options.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/commands/GetFooCommand.ts\").get(),\n            containsString(\"from \\\"../middleware/HttpApiKeyAuth\\\"\")\n        );\n\n        String generatedGetFooCommand = manifest\n            .getFileString(CodegenUtils.SOURCE_FOLDER + \"/commands/GetFooCommand.ts\")\n            .get();\n        assertThat(generatedGetFooCommand, containsString(\"getHttpApiKeyAuthPlugin(config\"));\n\n        Collection<String> lines = List.of(extra.split(\"\\n\"));\n        for (String line : lines) {\n            assertThat(generatedGetFooCommand, containsString(line));\n        }\n\n        // Ensure that the GetBar operation does not import the middleware or use it.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/commands/GetBarCommand.ts\").get(),\n            not(containsString(\"from \\\"../middleware/HttpApiKeyAuth\\\"\"))\n        );\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/commands/GetBarCommand.ts\").get(),\n            not(containsString(\"getHttpApiKeyAuthPlugin\"))\n        );\n\n        // Make sure that the middleware file was written and exports the plugin symbol.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/middleware/HttpApiKeyAuth/index.ts\").get(),\n            containsString(\"export const getHttpApiKeyAuthPlugin\")\n        );\n\n        // Ensure that the middleware was being exported in the index file.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/index.ts\").get(),\n            containsString(\"from \\\"./middleware/HttpApiKeyAuth\\\"\")\n        );\n    }\n\n    private MockManifest generate(String filename) {\n        MockManifest manifest = new MockManifest();\n        PluginContext context = PluginContext.builder()\n            .pluginClassLoader(getClass().getClassLoader())\n            .model(\n                Model.assembler()\n                    .addImport(getClass().getResource(filename))\n                    .discoverModels()\n                    .assemble()\n                    .unwrap()\n            )\n            .fileManifest(manifest)\n            .settings(\n                Node.objectNodeBuilder()\n                    .withMember(\"service\", Node.from(\"smithy.example#Example\"))\n                    .withMember(\"package\", Node.from(\"example\"))\n                    .withMember(\"packageVersion\", Node.from(\"1.0.0\"))\n                    .withMember(\"useLegacyAuth\", Node.from(true))\n                    .build()\n            )\n            .build();\n\n        new TypeScriptClientCodegenPlugin().execute(context);\n\n        return manifest;\n    }\n\n    @Test\n    public void notAnHttpApiKeyAuthClient() {\n        testDoesNotInject(\"endpoint-trait.smithy\");\n    }\n\n    @Test\n    public void httpApiKeyAuthClientWithAllOptionalAuthOperations() {\n        testDoesNotInject(\"http-api-key-auth-trait-all-optional.smithy\");\n    }\n\n    private void testDoesNotInject(String filename) {\n        MockManifest manifest = generate(filename);\n\n        // Make sure that the config and middleware were not added to the client.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/ExampleClient.ts\").get(),\n            not(containsString(\"= resolveHttpApiKeyAuthConfig(\"))\n        );\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/ExampleClient.ts\").get(),\n            not(containsString(\"from \\\"./middleware/HttpApiKeyAuth\\\"\"))\n        );\n\n        // Make sure that the import and middleware were not used in the operation.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/commands/GetFooCommand.ts\").get(),\n            not(containsString(\"from \\\"../middleware/HttpApiKeyAuth\\\"\"))\n        );\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/commands/GetFooCommand.ts\").get(),\n            not(containsString(\"getHttpApiKeyAuthPlugin(configuration\"))\n        );\n\n        // Make sure that the middleware file was not written.\n        assertThat(manifest.hasFile(CodegenUtils.SOURCE_FOLDER + \"/middleware/HttpApiKeyAuth/index.ts\"), is(false));\n\n        // Ensure that the middleware was not being exported in the index file.\n        assertThat(\n            manifest.getFileString(CodegenUtils.SOURCE_FOLDER + \"/index.ts\").get(),\n            not(containsString(\"from \\\"./middleware/HttpApiKeyAuth\\\"\"))\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberDeserVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.Collection;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.BooleanShape;\nimport software.amazon.smithy.model.shapes.ByteShape;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.IntegerShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.LongShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.ShortShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings.ArtifactType;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.utils.ListUtils;\n\npublic class DocumentMemberDeserVisitorTest {\n\n    private static final String DATA_SOURCE = \"dataSource\";\n    private static final String PROTOCOL = \"TestProtocol\";\n    private static final Format FORMAT = Format.EPOCH_SECONDS;\n    private static GenerationContext mockContext;\n    private static TypeScriptSettings mockSettings;\n    private static StringShape target = StringShape.builder().id(ShapeId.from(\"com.smithy.example#FooTarget\")).build();\n\n    static {\n        mockContext = new GenerationContext();\n        mockSettings = new TypeScriptSettings();\n        mockContext.setProtocolName(PROTOCOL);\n        mockContext.setSymbolProvider(new MockProvider());\n        mockContext.setWriter(new TypeScriptWriter(\"foo\"));\n        mockSettings.setArtifactType(ArtifactType.SSDK);\n        mockContext.setSettings(mockSettings);\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"validMemberTargetTypes\")\n    public void providesExpectedDefaults(Shape shape, String expected, MemberShape memberShape) {\n        Shape fakeStruct = StructureShape.builder().id(\"com.smithy.example#Enclosing\").addMember(memberShape).build();\n        mockContext.setModel(Model.builder().addShapes(shape, fakeStruct, target).build());\n        DocumentMemberDeserVisitor visitor = new DocumentMemberDeserVisitor(mockContext, DATA_SOURCE, FORMAT) {\n            @Override\n            protected MemberShape getMemberShape() {\n                return memberShape;\n            }\n        };\n        assertThat(shape.accept(visitor), equalTo(expected));\n    }\n\n    public static Collection<Object[]> validMemberTargetTypes() {\n        String id = \"com.smithy.example#Foo\";\n        String targetId = String.valueOf(target.getId());\n        MemberShape source = MemberShape.builder().id(\"com.smithy.example#Enclosing$sourceMember\").target(id).build();\n        MemberShape member = MemberShape.builder().id(id + \"$member\").target(targetId).build();\n        MemberShape key = MemberShape.builder().id(id + \"$key\").target(targetId).build();\n        MemberShape value = MemberShape.builder().id(id + \"$value\").target(targetId).build();\n        String delegate = \"de_Foo\" + \"(\" + DATA_SOURCE + \", context)\";\n\n        return ListUtils.of(\n            new Object[][] {\n                {BooleanShape.builder().id(id).build(), \"__expectBoolean(\" + DATA_SOURCE + \")\", source},\n                {ByteShape.builder().id(id).build(), \"__expectByte(\" + DATA_SOURCE + \")\", source},\n                {DoubleShape.builder().id(id).build(), \"__limitedParseDouble(\" + DATA_SOURCE + \")\", source},\n                {FloatShape.builder().id(id).build(), \"__limitedParseFloat32(\" + DATA_SOURCE + \")\", source},\n                {IntegerShape.builder().id(id).build(), \"__expectInt32(\" + DATA_SOURCE + \")\", source},\n                {LongShape.builder().id(id).build(), \"__expectLong(\" + DATA_SOURCE + \")\", source},\n                {ShortShape.builder().id(id).build(), \"__expectShort(\" + DATA_SOURCE + \")\", source},\n                {StringShape.builder().id(id).build(), \"__expectString(\" + DATA_SOURCE + \")\", source},\n                {\n                    StringShape.builder().id(id).addTrait(new MediaTypeTrait(\"foo+json\")).build(),\n                    \"__LazyJsonString.from(\" + DATA_SOURCE + \")\",\n                    source,\n                },\n                {BlobShape.builder().id(id).build(), \"context.base64Decoder(\" + DATA_SOURCE + \")\", source},\n                {DocumentShape.builder().id(id).build(), delegate, source},\n                {ListShape.builder().id(id).member(member).build(), delegate, source},\n                {SetShape.builder().id(id).member(member).build(), delegate, source},\n                {MapShape.builder().id(id).key(key).value(value).build(), delegate, source},\n                {StructureShape.builder().id(id).build(), delegate, source},\n                {\n                    TimestampShape.builder().id(id).build(),\n                    \"__expectNonNull(__parseEpochTimestamp(\" + DATA_SOURCE + \"))\",\n                    source,\n                },\n                {\n                    TimestampShape.builder().id(id).build(),\n                    \"__expectNonNull(__parseRfc3339DateTime(\" + DATA_SOURCE + \"))\",\n                    source.toBuilder()\n                        .addTrait(new TimestampFormatTrait(TimestampFormatTrait.DATE_TIME))\n                        .build(),\n                },\n                {\n                    TimestampShape.builder().id(id).build(),\n                    \"__expectNonNull(__parseRfc7231DateTime(\" + DATA_SOURCE + \"))\",\n                    source.toBuilder()\n                        .addTrait(new TimestampFormatTrait(TimestampFormatTrait.HTTP_DATE))\n                        .build(),\n                },\n                {\n                    UnionShape.builder().id(id).addMember(member).build(),\n                    \"de_Foo(__expectUnion(\" + DATA_SOURCE + \"), context)\",\n                    source,\n                },\n            }\n        );\n    }\n\n    @Test\n    public void throwsOnInvalidDocumentMembers() {\n        String id = \"com.smithy.example#Foo\";\n        DocumentMemberDeserVisitor visitor = new DocumentMemberDeserVisitor(mockContext, DATA_SOURCE, FORMAT);\n\n        Assertions.assertThrows(CodegenException.class, () -> {\n            ServiceShape.builder().version(\"1\").id(id).build().accept(visitor);\n        });\n        Assertions.assertThrows(CodegenException.class, () -> {\n            OperationShape.builder().id(id).build().accept(visitor);\n        });\n        Assertions.assertThrows(CodegenException.class, () -> {\n            ResourceShape.builder().addIdentifier(\"id\", id + \"Id\").id(id).build().accept(visitor);\n        });\n        Assertions.assertThrows(CodegenException.class, () -> {\n            MemberShape.builder().target(id + \"Target\").id(id + \"$member\").build().accept(visitor);\n        });\n    }\n\n    private static final class MockProvider implements SymbolProvider {\n\n        private final String id = \"com.smithy.example#Foo\";\n        private Symbol mock = Symbol.builder().name(\"Foo\").namespace(\"com.smithy.example\", \"/\").build();\n        private Symbol collectionMock = Symbol.builder().name(\"Foo[]\").namespace(\"com.smithy.example\", \"/\").build();\n\n        @Override\n        public Symbol toSymbol(Shape shape) {\n            if (shape instanceof CollectionShape) {\n                MemberShape member = MemberShape.builder().id(id + \"$member\").target(id + \"Target\").build();\n                return collectionMock\n                    .toBuilder()\n                    .putProperty(\"shape\", ListShape.builder().id(id).member(member).build())\n                    .build();\n            }\n            return mock.toBuilder().putProperty(\"shape\", StructureShape.builder().id(id).build()).build();\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberSerVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.Collection;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.params.ParameterizedTest;\nimport org.junit.jupiter.params.provider.MethodSource;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.BigDecimalShape;\nimport software.amazon.smithy.model.shapes.BigIntegerShape;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.BooleanShape;\nimport software.amazon.smithy.model.shapes.ByteShape;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.IntegerShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.LongShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ResourceShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShortShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\nimport software.amazon.smithy.utils.ListUtils;\n\npublic class DocumentMemberSerVisitorTest {\n\n    private static final String DATA_SOURCE = \"dataSource\";\n    private static final String PROTOCOL = \"TestProtocol\";\n    private static final Format FORMAT = Format.EPOCH_SECONDS;\n    private static GenerationContext mockContext;\n\n    static {\n        mockContext = new GenerationContext();\n        mockContext.setProtocolName(PROTOCOL);\n        mockContext.setSymbolProvider(new MockProvider());\n        mockContext.setWriter(new TypeScriptWriter(\"foo\"));\n        mockContext.setModel(Model.builder().build());\n    }\n\n    @ParameterizedTest\n    @MethodSource(\"validMemberTargetTypes\")\n    public void providesExpectedDefaults(Shape shape, String expected) {\n        DocumentMemberSerVisitor visitor = new DocumentMemberSerVisitor(mockContext, DATA_SOURCE, FORMAT);\n        assertThat(shape.accept(visitor), equalTo(expected));\n    }\n\n    public static Collection<Object[]> validMemberTargetTypes() {\n        String id = \"com.smithy.example#Foo\";\n        String targetId = id + \"Target\";\n        MemberShape member = MemberShape.builder().id(id + \"$member\").target(targetId).build();\n        MemberShape key = MemberShape.builder().id(id + \"$key\").target(targetId).build();\n        MemberShape value = MemberShape.builder().id(id + \"$value\").target(targetId).build();\n        String delegate = \"se_Foo(\" + DATA_SOURCE + \", context)\";\n\n        return ListUtils.of(\n            new Object[][] {\n                {BooleanShape.builder().id(id).build(), DATA_SOURCE},\n                {BigDecimalShape.builder().id(id).build(), \"String(\" + DATA_SOURCE + \")\"},\n                {BigIntegerShape.builder().id(id).build(), \"String(\" + DATA_SOURCE + \")\"},\n                {ByteShape.builder().id(id).build(), DATA_SOURCE},\n                {DoubleShape.builder().id(id).build(), \"__serializeFloat(\" + DATA_SOURCE + \")\"},\n                {FloatShape.builder().id(id).build(), \"__serializeFloat(\" + DATA_SOURCE + \")\"},\n                {IntegerShape.builder().id(id).build(), DATA_SOURCE},\n                {LongShape.builder().id(id).build(), DATA_SOURCE},\n                {ShortShape.builder().id(id).build(), DATA_SOURCE},\n                {StringShape.builder().id(id).build(), DATA_SOURCE},\n                {\n                    StringShape.builder().id(id).addTrait(new MediaTypeTrait(\"foo+json\")).build(),\n                    \"__LazyJsonString.from(\" + DATA_SOURCE + \")\",\n                },\n                {BlobShape.builder().id(id).build(), \"context.base64Encoder(\" + DATA_SOURCE + \")\"},\n                {DocumentShape.builder().id(id).build(), delegate},\n                {ListShape.builder().id(id).member(member).build(), delegate},\n                {SetShape.builder().id(id).member(member).build(), delegate},\n                {MapShape.builder().id(id).key(key).value(value).build(), delegate},\n                {StructureShape.builder().id(id).build(), delegate},\n                {UnionShape.builder().id(id).addMember(member).build(), delegate},\n            }\n        );\n    }\n\n    @Test\n    public void throwsOnInvalidDocumentMembers() {\n        String id = \"com.smithy.example#Foo\";\n        DocumentMemberSerVisitor visitor = new DocumentMemberSerVisitor(mockContext, DATA_SOURCE, FORMAT);\n\n        Assertions.assertThrows(CodegenException.class, () -> {\n            ServiceShape.builder().version(\"1\").id(id).build().accept(visitor);\n        });\n        Assertions.assertThrows(CodegenException.class, () -> {\n            OperationShape.builder().id(id).build().accept(visitor);\n        });\n        Assertions.assertThrows(CodegenException.class, () -> {\n            ResourceShape.builder().addIdentifier(\"id\", id + \"Id\").id(id).build().accept(visitor);\n        });\n        Assertions.assertThrows(CodegenException.class, () -> {\n            MemberShape.builder().target(id + \"Target\").id(id + \"$member\").build().accept(visitor);\n        });\n    }\n\n    private static final class MockProvider implements SymbolProvider {\n\n        private final String id = \"com.smithy.example#Foo\";\n        private Symbol mock = Symbol.builder().name(\"Foo\").namespace(\"com.smithy.example\", \"/\").build();\n        private Symbol collectionMock = Symbol.builder().name(\"Foo[]\").namespace(\"com.smithy.example\", \"/\").build();\n\n        @Override\n        public Symbol toSymbol(Shape shape) {\n            if (shape instanceof CollectionShape) {\n                MemberShape member = MemberShape.builder().id(id + \"$member\").target(id + \"Target\").build();\n                return collectionMock\n                    .toBuilder()\n                    .putProperty(\"shape\", ListShape.builder().id(id).member(member).build())\n                    .build();\n            }\n            return mock.toBuilder().putProperty(\"shape\", StructureShape.builder().id(id).build()).build();\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/EventStreamGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.Mockito.when;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.codegen.core.CodegenException;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.model.traits.StreamingTrait;\n\n@ExtendWith(MockitoExtension.class)\nclass EventStreamGeneratorTest {\n\n    @Test\n    void getEventStreamMember(\n        @Mock ProtocolGenerator.GenerationContext context,\n        @Mock Model model,\n        @Mock StructureShape struct,\n        @Mock MemberShape eventStreamMember1,\n        @Mock ShapeId streamingMember1ShapeId,\n        @Mock UnionShape streamingTarget1\n    ) {\n        when(struct.members()).thenReturn(List.of(eventStreamMember1));\n        when(eventStreamMember1.getTarget()).thenReturn(streamingMember1ShapeId);\n        when(context.getModel()).thenReturn(model);\n        when(model.expectShape(streamingMember1ShapeId)).thenReturn(streamingTarget1);\n\n        when(streamingTarget1.hasTrait(StreamingTrait.class)).thenReturn(true);\n        when(streamingTarget1.isUnionShape()).thenReturn(true);\n\n        MemberShape eventStreamMember = EventStreamGenerator.getEventStreamMember(context, struct);\n\n        assertEquals(eventStreamMember1, eventStreamMember);\n    }\n\n    @Test\n    void getEventStreamMemberTooFew(@Mock ProtocolGenerator.GenerationContext context, @Mock StructureShape struct) {\n        when(struct.members()).thenReturn(List.of());\n        when(struct.getId()).thenReturn(ShapeId.from(\"namespace#Shape\"));\n\n        try {\n            MemberShape eventStreamMember = EventStreamGenerator.getEventStreamMember(context, struct);\n        } catch (CodegenException e) {\n            assertEquals(\"No event stream member found in \" + struct.getId().toString(), e.getMessage());\n        }\n    }\n\n    @Test\n    void getEventStreamMemberTooMany(\n        @Mock ProtocolGenerator.GenerationContext context,\n        @Mock Model model,\n        @Mock StructureShape struct,\n        @Mock MemberShape eventStreamMember1,\n        @Mock ShapeId streamingMember1ShapeId,\n        @Mock UnionShape streamingTarget1,\n        @Mock MemberShape eventStreamMember2,\n        @Mock ShapeId streamingMember2ShapeId,\n        @Mock UnionShape streamingTarget2\n    ) {\n        when(struct.members()).thenReturn(List.of(eventStreamMember1, eventStreamMember2));\n        when(context.getModel()).thenReturn(model);\n        when(struct.getId()).thenReturn(ShapeId.from(\"namespace#Shape\"));\n\n        when(eventStreamMember1.getTarget()).thenReturn(streamingMember1ShapeId);\n        when(model.expectShape(streamingMember1ShapeId)).thenReturn(streamingTarget1);\n        when(streamingTarget1.hasTrait(StreamingTrait.class)).thenReturn(true);\n        when(streamingTarget1.isUnionShape()).thenReturn(true);\n\n        when(eventStreamMember2.getTarget()).thenReturn(streamingMember2ShapeId);\n        when(model.expectShape(streamingMember2ShapeId)).thenReturn(streamingTarget2);\n        when(streamingTarget2.hasTrait(StreamingTrait.class)).thenReturn(true);\n        when(streamingTarget2.isUnionShape()).thenReturn(true);\n\n        try {\n            MemberShape eventStreamMember = EventStreamGenerator.getEventStreamMember(context, struct);\n        } catch (CodegenException e) {\n            assertEquals(\"More than one event stream member in \" + struct.getId().toString(), e.getMessage());\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/HttpProtocolGeneratorUtilsTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.knowledge.HttpBinding.Location;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator.GenerationContext;\n\npublic class HttpProtocolGeneratorUtilsTest {\n\n    private static final String DATA_SOURCE = \"dataSource\";\n\n    @Test\n    public void givesCorrectTimestampSerialization() {\n        GenerationContext mockContext = new GenerationContext();\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        mockContext.setWriter(writer);\n        TimestampShape shape = TimestampShape.builder().id(\"com.smithy.example#Foo\").build();\n\n        assertThat(\n            \"__serializeDateTime(\" + DATA_SOURCE + \")\",\n            equalTo(\n                HttpProtocolGeneratorUtils\n                    .getTimestampInputParam(mockContext, DATA_SOURCE, shape, Format.DATE_TIME)\n            )\n        );\n        assertThat(\n            \"(\" + DATA_SOURCE + \".getTime() / 1_000)\",\n            equalTo(\n                HttpProtocolGeneratorUtils\n                    .getTimestampInputParam(mockContext, DATA_SOURCE, shape, Format.EPOCH_SECONDS)\n            )\n        );\n        assertThat(\n            \"__dateToUtcString(\" + DATA_SOURCE + \")\",\n            equalTo(\n                HttpProtocolGeneratorUtils\n                    .getTimestampInputParam(mockContext, DATA_SOURCE, shape, Format.HTTP_DATE)\n            )\n        );\n    }\n\n    @Test\n    public void givesCorrectTimestampDeserialization() {\n        TimestampShape shape = TimestampShape.builder().id(\"com.smithy.example#Foo\").build();\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n\n        assertThat(\n            \"__expectNonNull(__parseRfc3339DateTimeWithOffset(\" + DATA_SOURCE + \"))\",\n            equalTo(\n                HttpProtocolGeneratorUtils.getTimestampOutputParam(\n                    writer,\n                    DATA_SOURCE,\n                    Location.DOCUMENT,\n                    shape,\n                    Format.DATE_TIME,\n                    false,\n                    true\n                )\n            )\n        );\n        assertThat(\n            \"__expectNonNull(__parseRfc3339DateTime(\" + DATA_SOURCE + \"))\",\n            equalTo(\n                HttpProtocolGeneratorUtils.getTimestampOutputParam(\n                    writer,\n                    DATA_SOURCE,\n                    Location.DOCUMENT,\n                    shape,\n                    Format.DATE_TIME,\n                    false,\n                    false\n                )\n            )\n        );\n        assertThat(\n            \"__expectNonNull(__parseEpochTimestamp(__expectNumber(\" + DATA_SOURCE + \")))\",\n            equalTo(\n                HttpProtocolGeneratorUtils.getTimestampOutputParam(\n                    writer,\n                    DATA_SOURCE,\n                    Location.DOCUMENT,\n                    shape,\n                    Format.EPOCH_SECONDS,\n                    true,\n                    false\n                )\n            )\n        );\n        assertThat(\n            \"__expectNonNull(__parseEpochTimestamp(\" + DATA_SOURCE + \"))\",\n            equalTo(\n                HttpProtocolGeneratorUtils.getTimestampOutputParam(\n                    writer,\n                    DATA_SOURCE,\n                    Location.DOCUMENT,\n                    shape,\n                    Format.EPOCH_SECONDS,\n                    false,\n                    false\n                )\n            )\n        );\n        assertThat(\n            \"__expectNonNull(__parseRfc7231DateTime(\" + DATA_SOURCE + \"))\",\n            equalTo(\n                HttpProtocolGeneratorUtils.getTimestampOutputParam(\n                    writer,\n                    DATA_SOURCE,\n                    Location.DOCUMENT,\n                    shape,\n                    Format.HTTP_DATE,\n                    false,\n                    false\n                )\n            )\n        );\n    }\n\n    @Test\n    public void writesCorrectHostPrefix() {\n        GenerationContext mockContext = new GenerationContext();\n        mockContext.setSymbolProvider(new MockProvider());\n        TypeScriptWriter writer = new TypeScriptWriter(\"foo\");\n        mockContext.setWriter(writer);\n\n        Model model = Model.assembler().addImport(getClass().getResource(\"endpoint-trait.smithy\")).assemble().unwrap();\n\n        mockContext.setModel(model);\n\n        OperationShape operation = (OperationShape) model.expectShape(ShapeId.from(\"smithy.example#GetFoo\"));\n        HttpProtocolGeneratorUtils.writeHostPrefix(mockContext, operation);\n        assertThat(writer.toString(), containsString(\"let { hostname: resolvedHostname } = await context.endpoint();\"));\n        assertThat(writer.toString(), containsString(\"if (context.disableHostPrefix !== true) {\"));\n        assertThat(writer.toString(), containsString(\"resolvedHostname = \\\"{foo}.data.\\\" + resolvedHostname;\"));\n        assertThat(\n            writer.toString(),\n            containsString(\"resolvedHostname = resolvedHostname.replace(\\\"{foo}\\\", input.foo!)\")\n        );\n        assertThat(writer.toString(), containsString(\"if (!__isValidHostname(resolvedHostname)) {\"));\n        assertThat(\n            writer.toString(),\n            containsString(\"throw new Error(\\\"ValidationError: prefixed hostname must be hostname compatible.\")\n        );\n    }\n\n    private static final class MockProvider implements SymbolProvider {\n\n        private final String id = \"com.smithy.example#Foo\";\n        private Symbol mock = Symbol.builder().name(\"Foo\").namespace(\"com.smithy.example\", \"/\").build();\n\n        @Override\n        public Symbol toSymbol(Shape shape) {\n            return mock.toBuilder().putProperty(\"shape\", StructureShape.builder().id(id).build()).build();\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/ProtocolGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.StringShape;\n\npublic class ProtocolGeneratorTest {\n\n    @Test\n    public void sanitizesNames() {\n        assertThat(ProtocolGenerator.getSanitizedName(\"aws.rest-json.1.1\"), equalTo(\"Aws_restJson_1_1\"));\n    }\n\n    @Test\n    public void buildsSerFunctionName() {\n        StringShape shape = StringShape.builder().id(\"com.smithy.example#Foo\").build();\n        Symbol symbol = Symbol.builder()\n            .name(\"Foo\")\n            .namespace(\"com.smithy.example\", \".\")\n            .putProperty(\"shape\", shape)\n            .build();\n\n        assertThat(\n            ProtocolGenerator.getSerFunctionName(symbol, \"aws.rest-json.1.1\"),\n            equalTo(\"serializeAws_restJson_1_1Foo\")\n        );\n    }\n\n    @Test\n    public void buildsSerFunctionNameForCollection() {\n        MemberShape member = MemberShape.builder()\n            .id(\"com.smithy.example#FooList$member\")\n            .target(\"com.smithy.example#Foo\")\n            .build();\n        ListShape list = ListShape.builder().id(\"com.smithy.example#FooList\").member(member).build();\n        Symbol symbol = Symbol.builder()\n            .name(\"Foo[]\")\n            .namespace(\"com.smithy.example\", \".\")\n            .putProperty(\"shape\", list)\n            .build();\n\n        assertThat(\n            ProtocolGenerator.getSerFunctionName(symbol, \"aws.rest-json.1.1\"),\n            equalTo(\"serializeAws_restJson_1_1FooList\")\n        );\n    }\n\n    @Test\n    public void buildsDeserFunctionName() {\n        StringShape shape = StringShape.builder().id(\"com.smithy.example#Foo\").build();\n        Symbol symbol = Symbol.builder()\n            .name(\"Foo\")\n            .namespace(\"com.smithy.example\", \".\")\n            .putProperty(\"shape\", shape)\n            .build();\n\n        assertThat(\n            ProtocolGenerator.getDeserFunctionName(symbol, \"aws.rest-json.1.1\"),\n            equalTo(\"deserializeAws_restJson_1_1Foo\")\n        );\n    }\n\n    @Test\n    public void buildsDeserFunctionNameForCollection() {\n        MemberShape member = MemberShape.builder()\n            .id(\"com.smithy.example#FooList$member\")\n            .target(\"com.smithy.example#Foo\")\n            .build();\n        ListShape list = ListShape.builder().id(\"com.smithy.example#FooList\").member(member).build();\n        Symbol symbol = Symbol.builder()\n            .name(\"Foo[]\")\n            .namespace(\"com.smithy.example\", \".\")\n            .putProperty(\"shape\", list)\n            .build();\n\n        assertThat(\n            ProtocolGenerator.getDeserFunctionName(symbol, \"aws.rest-json.1.1\"),\n            equalTo(\"deserializeAws_restJson_1_1FooList\")\n        );\n    }\n\n    @Test\n    public void detectsCompatibleGenerators() {\n        // TODO\n    }\n\n    @Test\n    public void detectsIncompatibleGenerators() {\n        // TODO\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/integration/RuntimeClientPluginTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.integration;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.junit.jupiter.api.Assertions;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\n\npublic class RuntimeClientPluginTest {\n\n    @Test\n    public void allowsAllServicesByDefault() {\n        ServiceShape service = ServiceShape.builder().id(\"a.b#C\").version(\"123\").build();\n        OperationShape operation = OperationShape.builder().id(\"a.b#Operation\").build();\n        Model model = Model.assembler().addShapes(service, operation).assemble().unwrap();\n        RuntimeClientPlugin plugin = RuntimeClientPlugin.builder()\n            .servicePredicate((m, s) -> s.getId().getName().equals(\"C\"))\n            .build();\n\n        assertThat(plugin.matchesService(model, service), equalTo(true));\n        assertThat(plugin.matchesOperation(model, service, operation), equalTo(false));\n    }\n\n    @Test\n    public void allowsConfigurableOperationsPredicate() {\n        ServiceShape service = ServiceShape.builder().id(\"a.b#C\").version(\"123\").build();\n        OperationShape operation1 = OperationShape.builder().id(\"a.b#D\").build();\n        OperationShape operation2 = OperationShape.builder().id(\"a.b#E\").build();\n        Model model = Model.assembler().addShapes(service, operation1, operation2).assemble().unwrap();\n        RuntimeClientPlugin plugin = RuntimeClientPlugin.builder()\n            .operationPredicate((m, s, o) -> o.getId().getName().equals(\"D\"))\n            .build();\n\n        assertThat(plugin.matchesOperation(model, service, operation1), equalTo(true));\n        assertThat(plugin.matchesOperation(model, service, operation2), equalTo(false));\n        assertThat(plugin.matchesService(model, service), equalTo(false));\n    }\n\n    @Test\n    public void allowsConfigurableServicePredicate() {\n        ServiceShape service1 = ServiceShape.builder().id(\"a.b#C\").version(\"123\").build();\n        ServiceShape service2 = ServiceShape.builder().id(\"a.b#D\").version(\"123\").build();\n        OperationShape operation = OperationShape.builder().id(\"a.b#Operation\").build();\n        Model model = Model.assembler().addShapes(service1, service2, operation).assemble().unwrap();\n        RuntimeClientPlugin plugin = RuntimeClientPlugin.builder()\n            .servicePredicate((m, s) -> s.getId().getName().equals(\"C\"))\n            .build();\n\n        assertThat(plugin.matchesService(model, service1), equalTo(true));\n        assertThat(plugin.matchesService(model, service2), equalTo(false));\n        assertThat(plugin.matchesOperation(model, service1, operation), equalTo(false));\n        assertThat(plugin.matchesOperation(model, service2, operation), equalTo(false));\n    }\n\n    @Test\n    public void allowsConfigurableSettingsPredicate() {\n        ServiceShape service = ServiceShape.builder().id(\"a.b#C\").version(\"123\").build();\n        Model model = Model.assembler().addShapes(service).assemble().unwrap();\n        RuntimeClientPlugin createDefaultReadmeFlagPlugin = RuntimeClientPlugin.builder()\n            .settingsPredicate((m, s, settings) -> settings.createDefaultReadme())\n            .build();\n\n        TypeScriptSettings createDefaultReadmeTrueSettings = new TypeScriptSettings();\n        createDefaultReadmeTrueSettings.setCreateDefaultReadme(true);\n        assertThat(\n            createDefaultReadmeFlagPlugin.matchesSettings(model, service, createDefaultReadmeTrueSettings),\n            equalTo(true)\n        );\n\n        TypeScriptSettings createDefaultReadmeFalseSettings = new TypeScriptSettings();\n        assertThat(\n            createDefaultReadmeFlagPlugin.matchesSettings(model, service, createDefaultReadmeFalseSettings),\n            equalTo(false)\n        );\n    }\n\n    @Test\n    public void configuresWithDefaultConventions() {\n        Map<String, Object> resolveFunctionParams = new HashMap<String, Object>() {\n            {\n                put(\"resolveFunctionParam\", \"resolveFunctionParam\");\n            }\n        };\n        Map<String, Object> pluginFunctionParams = new HashMap<String, Object>() {\n            {\n                put(\"pluginFunctionParam\", \"pluginFunctionParam\");\n            }\n        };\n\n        RuntimeClientPlugin plugin = RuntimeClientPlugin.builder()\n            .withConventions(\"foo/baz\", \"1.0.0\", \"Foo\")\n            .additionalResolveFunctionParamsSupplier((m, s, o) -> resolveFunctionParams)\n            .additionalPluginFunctionParamsSupplier((m, s, o) -> pluginFunctionParams)\n            .build();\n\n        assertThat(plugin.getInputConfig().get().getSymbol().getNamespace(), equalTo(\"foo/baz\"));\n        assertThat(plugin.getInputConfig().get().getSymbol().getName(), equalTo(\"FooInputConfig\"));\n\n        assertThat(plugin.getResolvedConfig().get().getSymbol().getNamespace(), equalTo(\"foo/baz\"));\n        assertThat(plugin.getResolvedConfig().get().getSymbol().getName(), equalTo(\"FooResolvedConfig\"));\n\n        assertThat(plugin.getResolveFunction().get().getSymbol().getNamespace(), equalTo(\"foo/baz\"));\n        assertThat(plugin.getResolveFunction().get().getSymbol().getName(), equalTo(\"resolveFooConfig\"));\n\n        assertThat(plugin.getAdditionalResolveFunctionParameters(null, null, null), equalTo(resolveFunctionParams));\n\n        assertThat(plugin.getPluginFunction().get().getSymbol().getNamespace(), equalTo(\"foo/baz\"));\n        assertThat(plugin.getPluginFunction().get().getSymbol().getName(), equalTo(\"getFooPlugin\"));\n\n        assertThat(plugin.getAdditionalPluginFunctionParameters(null, null, null), equalTo(pluginFunctionParams));\n\n        assertThat(\n            plugin.getInputConfig().get().getSymbol().getDependencies().get(0).getPackageName(),\n            equalTo(\"foo/baz\")\n        );\n        assertThat(\n            plugin.getResolvedConfig().get().getSymbol().getDependencies().get(0).getPackageName(),\n            equalTo(\"foo/baz\")\n        );\n        assertThat(\n            plugin.getResolveFunction().get().getSymbol().getDependencies().get(0).getPackageName(),\n            equalTo(\"foo/baz\")\n        );\n        assertThat(\n            plugin.getPluginFunction().get().getSymbol().getDependencies().get(0).getPackageName(),\n            equalTo(\"foo/baz\")\n        );\n\n        assertThat(plugin.getInputConfig().get().getSymbol().getDependencies().get(0).getVersion(), equalTo(\"1.0.0\"));\n        assertThat(\n            plugin.getResolvedConfig().get().getSymbol().getDependencies().get(0).getVersion(),\n            equalTo(\"1.0.0\")\n        );\n        assertThat(\n            plugin.getResolveFunction().get().getSymbol().getDependencies().get(0).getVersion(),\n            equalTo(\"1.0.0\")\n        );\n        assertThat(\n            plugin.getPluginFunction().get().getSymbol().getDependencies().get(0).getVersion(),\n            equalTo(\"1.0.0\")\n        );\n    }\n\n    @Test\n    public void allConfigSymbolsMustBeSetIfAnyAreSet() {\n        Assertions.assertThrows(\n            IllegalStateException.class,\n            () -> RuntimeClientPlugin.builder()\n                .inputConfig(Symbol.builder().namespace(\"foo\", \"/\").name(\"abc\").build())\n                .build()\n        );\n    }\n\n    @Test\n    public void destroyFunctionRequiresResolvedConfig() {\n        Assertions.assertThrows(\n            IllegalStateException.class,\n            () -> RuntimeClientPlugin.builder()\n                .withConventions(\"foo/baz\", \"1.0.0\", \"Foo\", RuntimeClientPlugin.Convention.HAS_DESTROY)\n                .build()\n        );\n    }\n\n    @Test\n    public void convertsToBuilder() {\n        RuntimeClientPlugin plugin = RuntimeClientPlugin.builder().withConventions(\"foo/baz\", \"1.0.0\", \"Foo\").build();\n\n        assertThat(plugin.toBuilder().build(), equalTo(plugin));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/knowledge/SerdeElisionIndexTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.knowledge;\n\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport org.junit.jupiter.api.AfterAll;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.SetShape;\nimport software.amazon.smithy.model.shapes.ShapeId;\n\npublic class SerdeElisionIndexTest {\n\n    private static Model model;\n\n    @BeforeAll\n    public static void before() {\n        model = Model.assembler()\n            .addImport(SerdeElisionIndexTest.class.getResource(\"serde-elision.smithy\"))\n            .assemble()\n            .unwrap();\n    }\n\n    @AfterAll\n    public static void after() {\n        model = null;\n    }\n\n    @Test\n    public void mayElideSimpleObjects() {\n        SerdeElisionIndex index = SerdeElisionIndex.of(model);\n\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SimpleString\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SimpleList\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SimpleMap\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SimpleStruct\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Boolean\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Byte\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Enum\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Integer\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#IntEnum\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Long\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Short\")).get()));\n        assertTrue(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SimpleStruct\")).get()));\n    }\n\n    @Test\n    public void cannotElideUnsupportedTypes() {\n        SerdeElisionIndex index = SerdeElisionIndex.of(model);\n\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigDecimal\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigInteger\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Blob\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Document\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Timestamp\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Double\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#Float\")).get()));\n    }\n\n    @Test\n    public void cannotElideNestedUnsupportedTypes() {\n        model = model\n            .toBuilder()\n            .addShapes(\n                // Shim set shapes into 2.0 model.\n                SetShape.builder()\n                    .id(\"foo.bar#BigDecimalSet\")\n                    .member(ShapeId.from(\"foo.bar#BigDecimal\"))\n                    .build(),\n                SetShape.builder()\n                    .id(\"foo.bar#BigIntegerSet\")\n                    .member(ShapeId.from(\"foo.bar#BigInteger\"))\n                    .build(),\n                SetShape.builder().id(\"foo.bar#BlobSet\").member(ShapeId.from(\"foo.bar#Blob\")).build(),\n                SetShape.builder().id(\"foo.bar#DocumentSet\").member(ShapeId.from(\"foo.bar#Document\")).build(),\n                SetShape.builder().id(\"foo.bar#TimestampSet\").member(ShapeId.from(\"foo.bar#Timestamp\")).build(),\n                SetShape.builder().id(\"foo.bar#DoubleSet\").member(ShapeId.from(\"foo.bar#Double\")).build(),\n                SetShape.builder().id(\"foo.bar#FloatSet\").member(ShapeId.from(\"foo.bar#Float\")).build()\n            )\n            .build();\n        SerdeElisionIndex index = SerdeElisionIndex.of(model);\n\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigDecimalList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigIntegerList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BlobList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DocumentList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#TimestampList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DoubleList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#FloatList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigDecimalSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigIntegerSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BlobSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DocumentSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#TimestampSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DoubleSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#FloatSet\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigDecimalStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigIntegerStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BlobStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DocumentStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#TimestampStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DoubleStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#FloatStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigDecimalUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigIntegerUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BlobUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DocumentUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#TimestampUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DoubleUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#FloatUnion\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigDecimalMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BigIntegerMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#BlobMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DocumentMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#TimestampMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#DoubleMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#FloatMap\")).get()));\n    }\n\n    @Test\n    public void cannotElideWithMutatingTraits() {\n        SerdeElisionIndex index = SerdeElisionIndex.of(model);\n\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#NestedJsonName\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#JsonNameStructure\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#JsonNameStructure$foo\")).get()));\n\n        // Blobs are incompatible types, so we only need to check for @streaming traits on unions.\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#NestedEventStream\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#EventStreamUnion\")).get()));\n\n        // Blobs are incompatible types, so we only need to check for @mediaType traits on strings.\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#NestedMediaType\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#MediaTypeString\")).get()));\n\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#NestedSparseList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SparseList\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#NestedSparseMap\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#SparseMap\")).get()));\n\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#NestedIdempotencyToken\")).get()));\n        assertFalse(index.mayElide(model.getShape(ShapeId.from(\"foo.bar#IdempotencyTokenStructure\")).get()));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborMemberDeserVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.Mockito.when;\n\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\n\n@ExtendWith(MockitoExtension.class)\nclass CborMemberDeserVisitorTest {\n\n    private CborMemberDeserVisitor subject;\n\n    @BeforeEach\n    void setup(\n        @Mock ProtocolGenerator.GenerationContext context,\n        @Mock Model model,\n        @Mock TypeScriptWriter typeScriptWriter,\n        @Mock TypeScriptSettings settings\n    ) {\n        when(context.getModel()).thenReturn(model);\n        when(context.getWriter()).thenReturn(typeScriptWriter);\n        when(context.getSettings()).thenReturn(settings);\n\n        subject = new CborMemberDeserVisitor(context, \"data\");\n    }\n\n    @Test\n    void blobShape(@Mock BlobShape blobShape) {\n        // no decoder for blob in cbor.\n        assertEquals(\"data\", subject.blobShape(blobShape));\n    }\n\n    @Test\n    void timestampShape(@Mock TimestampShape timestampShape) {\n        // protocol always uses this timestamp format.\n        assertEquals(\"__expectNonNull(__parseEpochTimestamp(data))\", subject.timestampShape(timestampShape));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborMemberSerVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport static org.junit.jupiter.api.Assertions.*;\nimport static org.mockito.Mockito.lenient;\nimport static org.mockito.Mockito.when;\n\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.BlobShape;\nimport software.amazon.smithy.model.shapes.DoubleShape;\nimport software.amazon.smithy.model.shapes.FloatShape;\nimport software.amazon.smithy.model.shapes.TimestampShape;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\n\n@ExtendWith(MockitoExtension.class)\nclass CborMemberSerVisitorTest {\n\n    private CborMemberSerVisitor subject;\n\n    @BeforeEach\n    void setup(\n        @Mock ProtocolGenerator.GenerationContext context,\n        @Mock Model model,\n        @Mock TypeScriptWriter typeScriptWriter\n    ) {\n        when(context.getModel()).thenReturn(model);\n        lenient().when(context.getWriter()).thenReturn(typeScriptWriter);\n\n        subject = new CborMemberSerVisitor(context, \"data\");\n    }\n\n    @Test\n    void blobShape(@Mock BlobShape blob) {\n        // no encoder for blob in cbor.\n        assertEquals(\"data\", subject.blobShape(blob));\n    }\n\n    @Test\n    void floatShape(@Mock FloatShape floatShape) {\n        // no serializer function for float in cbor.\n        assertEquals(\"data\", subject.floatShape(floatShape));\n    }\n\n    @Test\n    void doubleShape(@Mock DoubleShape doubleShape) {\n        // no serializer function for double in cbor.\n        assertEquals(\"data\", subject.doubleShape(doubleShape));\n    }\n\n    @Test\n    void timestampShape(@Mock TimestampShape timestampShape) {\n        assertEquals(\"__dateToTag(data)\", subject.timestampShape(timestampShape));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeDeserVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.lenient;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.utils.MapUtils;\n\n@ExtendWith(MockitoExtension.class)\nclass CborShapeDeserVisitorTest {\n\n    @Mock\n    ProtocolGenerator.GenerationContext context;\n\n    @Mock\n    TypeScriptWriter writer;\n\n    CborShapeDeserVisitor subject;\n\n    @BeforeEach\n    void setUp(@Mock TypeScriptSettings typeScriptSettings) {\n        lenient().when(context.getWriter()).thenReturn(writer);\n        lenient().when(context.getSettings()).thenReturn(typeScriptSettings);\n        lenient().when(typeScriptSettings.generateServerSdk()).thenReturn(false);\n\n        subject = new CborShapeDeserVisitor(context);\n    }\n\n    @Test\n    void deserializeCollection(\n        @Mock CollectionShape collectionShape,\n        @Mock MemberShape memberShape,\n        @Mock ShapeId shapeId,\n        @Mock Shape target,\n        @Mock Model model\n    ) {\n        when(collectionShape.getMember()).thenReturn(memberShape);\n        when(memberShape.getTarget()).thenReturn(shapeId);\n        when(context.getModel()).thenReturn(model);\n        when(model.expectShape(any(ShapeId.class))).thenReturn(target);\n        when(target.accept(any())).thenReturn(\"entry\");\n\n        subject.deserializeCollection(context, collectionShape);\n\n        verify(writer).write(\"const collection = (output || [])$L\", \".filter((e: any) => e != null)\");\n    }\n\n    @Test\n    void deserializeDocument(@Mock DocumentShape documentShape) {\n        subject.deserializeDocument(context, documentShape);\n        verify(writer).write(\n            \"\"\"\n            return output; // document.\n            \"\"\"\n        );\n    }\n\n    @Test\n    void deserializeMap(\n        @Mock MapShape mapShape,\n        @Mock MemberShape valueShape,\n        @Mock ShapeId shapeId,\n        @Mock SymbolProvider symbolProvider,\n        @Mock Symbol symbol,\n        @Mock Shape target,\n        @Mock Model model\n    ) {\n        when(mapShape.getValue()).thenReturn(valueShape);\n        when(valueShape.getTarget()).thenReturn(shapeId);\n        when(context.getSymbolProvider()).thenReturn(symbolProvider);\n        when(context.getModel()).thenReturn(model);\n        when(model.expectShape(shapeId)).thenReturn(target);\n        when(symbolProvider.toSymbol(mapShape)).thenReturn(symbol);\n\n        subject.deserializeMap(context, mapShape);\n        verify(writer).openBlock(\n            eq(\"return Object.entries(output).reduce((acc: $T, [key, value]: [string, any]) => {\"),\n            eq(\"\"),\n            eq(symbol),\n            any()\n        );\n    }\n\n    @Test\n    void deserializeStructure(@Mock StructureShape structureShape) {\n        subject.deserializeStructure(context, structureShape);\n\n        verify(writer).addImportSubmodule(\"take\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        verify(writer).openBlock(eq(\"return take(output, {\"), eq(\"}) as any;\"), any());\n    }\n\n    @Test\n    void deserializeUnion(\n        @Mock UnionShape unionShape,\n        @Mock MemberShape mapMember,\n        @Mock ShapeId shapeId,\n        @Mock Shape target,\n        @Mock Model model\n    ) {\n        when(unionShape.getAllMembers()).thenReturn(MapUtils.of(\"member\", mapMember));\n\n        when(mapMember.getTarget()).thenReturn(shapeId);\n        when(context.getModel()).thenReturn(model);\n        when(model.expectShape(shapeId)).thenReturn(target);\n\n        subject.deserializeUnion(context, unionShape);\n\n        verify(writer).openBlock(eq(\"if ($1L != null) {\"), eq(\"}\"), eq(\"output.member\"), any());\n\n        verify(writer).write(\"return { $$unknown: Object.entries(output)[0] };\");\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/protocols/cbor/CborShapeSerVisitorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.protocols.cbor;\n\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.ArgumentMatchers.eq;\nimport static org.mockito.Mockito.lenient;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\n\nimport org.junit.jupiter.api.BeforeEach;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\nimport org.mockito.Mock;\nimport org.mockito.junit.jupiter.MockitoExtension;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolProvider;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.DocumentShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.ServiceShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.shapes.UnionShape;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\n\n@ExtendWith(MockitoExtension.class)\nclass CborShapeSerVisitorTest {\n\n    CborShapeSerVisitor subject;\n\n    @Mock\n    ProtocolGenerator.GenerationContext context;\n\n    @Mock\n    TypeScriptWriter writer;\n\n    @BeforeEach\n    void setUp(@Mock Model model, @Mock Shape shape, @Mock SymbolProvider symbolProvider, @Mock Symbol symbol) {\n        lenient().when(context.getWriter()).thenReturn(writer);\n        lenient().when(context.getSymbolProvider()).thenReturn(symbolProvider);\n        lenient().when(symbolProvider.toSymbol(any())).thenReturn(symbol);\n        lenient().when(symbol.toString()).thenReturn(\"string\");\n        lenient().when(context.getModel()).thenReturn(model);\n        lenient().when(model.expectShape(any(ShapeId.class))).thenReturn(shape);\n        lenient().when(shape.accept(any(CborMemberSerVisitor.class))).thenReturn(\"entry\");\n\n        subject = new CborShapeSerVisitor(context);\n    }\n\n    @Test\n    void serializeCollection(\n        @Mock CollectionShape collectionShape,\n        @Mock MemberShape memberShape,\n        @Mock ShapeId shapeId\n    ) {\n        when(collectionShape.getMember()).thenReturn(memberShape);\n        when(memberShape.getTarget()).thenReturn(shapeId);\n\n        subject.serializeCollection(context, collectionShape);\n        verify(writer).write(\"return input$L;\", \".filter((e: any) => e != null)\");\n    }\n\n    @Test\n    void serializeDocument(@Mock DocumentShape documentShape) {\n        subject.serializeDocument(context, documentShape);\n        verify(writer).write(\n            \"\"\"\n            return input; // document.\n            \"\"\"\n        );\n    }\n\n    @Test\n    void serializeMap(@Mock MapShape mapShape, @Mock MemberShape valueShape, @Mock ShapeId shapeId) {\n        when(mapShape.getValue()).thenReturn(valueShape);\n        when(valueShape.getTarget()).thenReturn(shapeId);\n\n        subject.serializeMap(context, mapShape);\n        verify(writer).openBlock(\n            eq(\"return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [$1L, any]) => {\"),\n            eq(\"}, {});\"),\n            eq(\"string\"),\n            any()\n        );\n    }\n\n    @Test\n    void serializeStructure(@Mock StructureShape structureShape) {\n        subject.serializeStructure(context, structureShape);\n        verify(writer).addImportSubmodule(\"take\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n        verify(writer).openBlock(eq(\"return take(input, {\"), eq(\"});\"), any());\n    }\n\n    @Test\n    void serializeUnion(@Mock UnionShape unionShape, @Mock ServiceShape service, @Mock ShapeId shapeId) {\n        when(context.getService()).thenReturn(service);\n        when(unionShape.getId()).thenReturn(shapeId);\n        when(shapeId.getName(service)).thenReturn(\"name\");\n\n        subject.serializeUnion(context, unionShape);\n\n        verify(writer).openBlock(eq(\"return $L.visit(input, {\"), eq(\"});\"), eq(\"name\"), any());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/schema/SchemaReferenceIndexTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport java.util.Set;\nimport java.util.function.Function;\nimport java.util.stream.Stream;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.SimpleShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndexTest;\n\nclass SchemaReferenceIndexTest {\n\n    private static Model model;\n    private static SchemaReferenceIndex subject;\n\n    @BeforeAll\n    public static void before() {\n        model = Model.assembler()\n            .addImport(SerdeElisionIndexTest.class.getResource(\"serde-elision.smithy\"))\n            .assemble()\n            .unwrap();\n        subject = new SchemaReferenceIndex(model);\n    }\n\n    @Test\n    void isReferenceSchema() {\n        Stream<? extends SimpleShape> simpleShapes = Stream.of(\n            model.getStringShapes().stream(),\n            model.getBooleanShapes().stream(),\n            model.getByteShapes().stream(),\n            model.getDoubleShapes().stream(),\n            model.getFloatShapes().stream(),\n            model.getShortShapes().stream(),\n            model.getIntegerShapes().stream(),\n            model.getLongShapes().stream(),\n            model.getEnumShapes().stream(),\n            model.getIntEnumShapes().stream(),\n            model.getBigIntegerShapes().stream(),\n            model.getBigDecimalShapes().stream(),\n            model.getTimestampShapes().stream(),\n            model.getBlobShapes().stream(),\n            model.getDocumentShapes().stream()\n        ).flatMap(Function.identity());\n        simpleShapes.forEach(booleanShape -> {\n            assertFalse(subject.isReferenceSchema(booleanShape));\n        });\n\n        Set<StructureShape> structureShapes = model.getStructureShapes();\n        structureShapes.forEach(structureShape -> {\n            assertTrue(subject.isReferenceSchema(structureShape));\n        });\n\n        Stream<? extends Shape> collectionShapes = Stream.of(\n            model.getSetShapes().stream(),\n            model.getListShapes().stream(),\n            model.getMapShapes().stream()\n        ).flatMap(Function.identity());\n        collectionShapes.forEach(shape -> {\n            boolean isRef;\n            if (shape instanceof CollectionShape collection) {\n                isRef = subject.isReferenceSchema(collection.getMember());\n            } else if (shape instanceof MapShape map) {\n                isRef = subject.isReferenceSchema(map.getValue());\n            } else {\n                throw new UnsupportedOperationException(\"Unexpected shape type\");\n            }\n            assertEquals(isRef, subject.isReferenceSchema(shape));\n        });\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitExtensionTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.traits.JsonNameTrait;\n\nclass SchemaTraitExtensionTest {\n\n    private static final SchemaTraitExtension subject = SchemaTraitExtension.INSTANCE;\n\n    @Test\n    void add() {\n        subject.add(JsonNameTrait.ID, Object::toString);\n    }\n\n    @Test\n    void contains() {\n        subject.add(JsonNameTrait.ID, Object::toString);\n        assertTrue(subject.contains(JsonNameTrait.ID));\n        JsonNameTrait trait = new JsonNameTrait(\"test\");\n        assertTrue(subject.contains(trait));\n    }\n\n    @Test\n    void render() {\n        JsonNameTrait trait = new JsonNameTrait(\"test\");\n        subject.add(JsonNameTrait.ID, _trait -> {\n            if (_trait instanceof JsonNameTrait jsonNameTrait) {\n                return jsonNameTrait.getValue() + \"__test\";\n            }\n            throw new UnsupportedOperationException(\"wrong trait type\");\n        });\n        assertEquals(\"test__test\", subject.render(trait));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitFilterIndexTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport java.util.Set;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.model.traits.ErrorTrait;\nimport software.amazon.smithy.model.traits.EventHeaderTrait;\nimport software.amazon.smithy.model.traits.EventPayloadTrait;\nimport software.amazon.smithy.model.traits.HostLabelTrait;\nimport software.amazon.smithy.model.traits.HttpErrorTrait;\nimport software.amazon.smithy.model.traits.HttpHeaderTrait;\nimport software.amazon.smithy.model.traits.HttpLabelTrait;\nimport software.amazon.smithy.model.traits.HttpPayloadTrait;\nimport software.amazon.smithy.model.traits.HttpPrefixHeadersTrait;\nimport software.amazon.smithy.model.traits.HttpQueryParamsTrait;\nimport software.amazon.smithy.model.traits.HttpQueryTrait;\nimport software.amazon.smithy.model.traits.HttpResponseCodeTrait;\nimport software.amazon.smithy.model.traits.HttpTrait;\nimport software.amazon.smithy.model.traits.IdempotencyTokenTrait;\nimport software.amazon.smithy.model.traits.JsonNameTrait;\nimport software.amazon.smithy.model.traits.MediaTypeTrait;\nimport software.amazon.smithy.model.traits.RequiresLengthTrait;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\nimport software.amazon.smithy.model.traits.SparseTrait;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.model.traits.XmlAttributeTrait;\nimport software.amazon.smithy.model.traits.XmlFlattenedTrait;\nimport software.amazon.smithy.model.traits.XmlNameTrait;\nimport software.amazon.smithy.model.traits.XmlNamespaceTrait;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndexTest;\nimport software.amazon.smithy.utils.SetUtils;\n\nclass SchemaTraitFilterIndexTest {\n\n    private static Model model;\n    private static SchemaTraitFilterIndex subject;\n\n    @BeforeAll\n    public static void before() {\n        model = Model.assembler()\n            .addImport(SerdeElisionIndexTest.class.getResource(\"serde-elision.smithy\"))\n            .assemble()\n            .unwrap();\n        subject = new SchemaTraitFilterIndex(model);\n    }\n\n    @Test\n    void hasSchemaTraits() {\n        Set<Shape> sparseShapes = model.getShapesWithTrait(SparseTrait.class);\n        assertFalse(sparseShapes.isEmpty());\n\n        for (Shape sparseShape : sparseShapes) {\n            assertTrue(subject.hasSchemaTraits(sparseShape));\n            assertTrue(subject.includeTrait(sparseShape.getTrait(SparseTrait.class).get().toShapeId()));\n        }\n    }\n\n    @Test\n    void includeTrait() {\n        Set<ShapeId> excludedShapes = SetUtils.of(TimestampFormatTrait.ID);\n        for (ShapeId excludedShape : excludedShapes) {\n            String presence = subject.includeTrait(excludedShape) ? \"should not be included\" : excludedShape.getName();\n            assertEquals(excludedShape.getName(), presence);\n        }\n        Set<ShapeId> includedTraits = SetUtils.of(\n            SparseTrait.ID,\n            SensitiveTrait.ID,\n            IdempotencyTokenTrait.ID,\n            JsonNameTrait.ID,\n            MediaTypeTrait.ID,\n            XmlAttributeTrait.ID,\n            XmlFlattenedTrait.ID,\n            XmlNameTrait.ID,\n            XmlNamespaceTrait.ID,\n            EventHeaderTrait.ID,\n            EventPayloadTrait.ID,\n            StreamingTrait.ID,\n            RequiresLengthTrait.ID,\n            EndpointTrait.ID,\n            HttpErrorTrait.ID,\n            HttpHeaderTrait.ID,\n            HttpQueryTrait.ID,\n            HttpLabelTrait.ID,\n            HttpPayloadTrait.ID,\n            HttpPrefixHeadersTrait.ID,\n            HttpQueryParamsTrait.ID,\n            HttpResponseCodeTrait.ID,\n            HostLabelTrait.ID,\n            ErrorTrait.ID,\n            HttpTrait.ID\n        );\n        for (ShapeId includedTrait : includedTraits) {\n            String presence = subject.includeTrait(includedTrait) ? includedTrait.getName() : \"is missing\";\n            assertEquals(includedTrait.getName(), presence);\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitGeneratorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.pattern.UriPattern;\nimport software.amazon.smithy.model.traits.EndpointTrait;\nimport software.amazon.smithy.model.traits.HttpErrorTrait;\nimport software.amazon.smithy.model.traits.HttpTrait;\nimport software.amazon.smithy.model.traits.JsonNameTrait;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait;\nimport software.amazon.smithy.model.traits.Trait;\nimport software.amazon.smithy.model.traits.XmlAttributeTrait;\nimport software.amazon.smithy.model.traits.XmlNamespaceTrait;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\n\nclass SchemaTraitGeneratorTest {\n\n    private static final SchemaTraitGenerator subject = new SchemaTraitGenerator();\n\n    private record TestPair(String expectedSerialization, Trait trait) {\n        public void test() {\n            assertEquals(expectedSerialization, subject.serializeTraitData(trait, new StringStore()));\n        }\n    }\n\n    private static final List<TestPair> testCases = List.of(\n        // timestamp\n        new TestPair(\"\", new TimestampFormatTrait(\"date-time\")),\n        // strings\n        new TestPair(\"_jN\", new JsonNameTrait(\"jsonName\")),\n        // annotations\n        new TestPair(\"1\", new XmlAttributeTrait()),\n        // data traits\n        new TestPair(\"[\\\"prefix\\\"]\", EndpointTrait.builder().hostPrefix(\"prefix\").build()),\n        new TestPair(\"[_p, _h]\", XmlNamespaceTrait.builder().prefix(\"prefix\").uri(\"https://localhost\").build()),\n        new TestPair(\"404\", new HttpErrorTrait(404)),\n        new TestPair(\n            \"[\\\"GET\\\", \\\"/uri-pattern\\\", 200]\",\n            HttpTrait.builder().method(\"GET\").uri(UriPattern.parse(\"/uri-pattern\")).code(200).build()\n        )\n    );\n\n    @Test\n    void serializeTraitData() {\n        for (TestPair testCase : testCases) {\n            testCase.test();\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/schema/SchemaTraitWriterTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.schema;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport java.util.Set;\nimport org.junit.jupiter.api.BeforeAll;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.traits.StreamingTrait;\nimport software.amazon.smithy.typescript.codegen.knowledge.SerdeElisionIndexTest;\nimport software.amazon.smithy.typescript.codegen.util.StringStore;\n\nclass SchemaTraitWriterTest {\n\n    private static Model model;\n    private static SchemaReferenceIndex schemaReferenceIndex;\n    private static SchemaTraitWriter subject;\n\n    @BeforeAll\n    public static void before() {\n        model = Model.assembler()\n            .addImport(SerdeElisionIndexTest.class.getResource(\"serde-elision.smithy\"))\n            .assemble()\n            .unwrap();\n        schemaReferenceIndex = new SchemaReferenceIndex(model);\n        subject = new SchemaTraitWriter(null, schemaReferenceIndex, new StringStore());\n    }\n\n    @Test\n    void testToString() {\n        Set<Shape> streamingShapes = model.getShapesWithTrait(StreamingTrait.class);\n        assertEquals(1, streamingShapes.size());\n        for (Shape streamingShape : streamingShapes) {\n            subject = new SchemaTraitWriter(streamingShape, schemaReferenceIndex, new StringStore());\n            String codeGeneration = subject.toString();\n            assertEquals(\n                \"\"\"\n                { [_s]: 1 }\"\"\",\n                codeGeneration\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/util/PatternDetectionCompressionTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\nimport static org.junit.jupiter.api.Assertions.assertFalse;\nimport static org.junit.jupiter.api.Assertions.assertTrue;\n\nimport java.util.Collections;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.node.ArrayNode;\nimport software.amazon.smithy.model.node.Node;\nimport software.amazon.smithy.model.node.ObjectNode;\nimport software.amazon.smithy.rulesengine.language.EndpointRuleSet;\nimport software.amazon.smithy.rulesengine.logic.bdd.CostOptimization;\nimport software.amazon.smithy.rulesengine.logic.bdd.NodeReversal;\nimport software.amazon.smithy.rulesengine.logic.bdd.SiftingOptimization;\nimport software.amazon.smithy.rulesengine.logic.cfg.Cfg;\nimport software.amazon.smithy.rulesengine.traits.EndpointBddTrait;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.ConditionSerializer;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.RuleSerializer;\n\nclass PatternDetectionCompressionTest {\n\n    private static String compress(String json) {\n        return new PatternDetectionCompression(Node.parse(json).expectObjectNode()).compress();\n    }\n\n    @Test\n    void compressesEmptyObject() {\n        assertEquals(\n            \"\"\"\n            const _data={\n            };\n            \"\"\",\n            compress(\"{}\")\n        );\n    }\n\n    @Test\n    void compressesFlatObjectWithoutDuplicates() {\n        assertEquals(\n            \"\"\"\n            const _data={\n              a: \"hello\",\n              b: 42,\n              c: true\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\"a\":\"hello\",\"b\":42,\"c\":true}\"\"\")\n        );\n    }\n\n    @Test\n    void extractsRepeatedSubtrees() {\n        assertEquals(\n            \"\"\"\n            const a={\"type\":\"string\",\"req\":true};\n            const _data={\n              f1: a,\n              f2: a,\n              f3: a\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\n                       \"f1\":{\"type\":\"string\",\"req\":true},\n                       \"f2\":{\"type\":\"string\",\"req\":true},\n                       \"f3\":{\"type\":\"string\",\"req\":true}\n                     }\"\"\")\n        );\n    }\n\n    @Test\n    void extractsRepeatedStrings() {\n        assertEquals(\n            \"\"\"\n            const a=\"longstring\";\n            const _data={\n              a: a,\n              b: a,\n              c: a\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\"a\":\"longstring\",\"b\":\"longstring\",\"c\":\"longstring\"}\"\"\")\n        );\n    }\n\n    @Test\n    void doesNotExtractShortOrRareValues() {\n        assertEquals(\n            \"\"\"\n            const _data={\n              x: \"ab\",\n              y: \"cd\"\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\"x\":\"ab\",\"y\":\"cd\"}\"\"\")\n        );\n    }\n\n    @Test\n    void handlesNestedObjects() {\n        assertEquals(\n            \"\"\"\n            const a={\"c\":{\"fn\":\"isSet\"}};\n            const _data={\n              r1: a,\n              r2: a,\n              r3: a\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\n                       \"r1\":{\"c\":{\"fn\":\"isSet\"}},\n                       \"r2\":{\"c\":{\"fn\":\"isSet\"}},\n                       \"r3\":{\"c\":{\"fn\":\"isSet\"}}\n                     }\"\"\")\n        );\n    }\n\n    @Test\n    void handlesArrays() {\n        assertEquals(\n            \"\"\"\n            const a={\"type\":\"endpoint\",\"url\":\"https://example.com\"};\n            const _data={\n              rules: [\n                a,\n                a,\n                a\n              ]\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\"rules\":[\n                       {\"type\":\"endpoint\",\"url\":\"https://example.com\"},\n                       {\"type\":\"endpoint\",\"url\":\"https://example.com\"},\n                       {\"type\":\"endpoint\",\"url\":\"https://example.com\"}\n                     ]}\"\"\")\n        );\n    }\n\n    @Test\n    void stripsQuotesFromWordOnlyKeys() {\n        String result = compress(\"\"\"\n                                 {\"simpleKey\":\"value\"}\"\"\");\n        assertTrue(result.contains(\"simpleKey:\"));\n        assertFalse(result.contains(\"\\\"simpleKey\\\":\"));\n    }\n\n    @Test\n    void outputEndsWithNewline() {\n        assertTrue(compress(\"\"\"\n                            {\"version\":\"1.0\"}\"\"\").endsWith(\"\\n\"));\n    }\n\n    @Test\n    void extractsSsaTemplateFunctions() {\n        assertEquals(\n            \"\"\"\n            const a=(n: number)=>\"https://bucket.s3express-zone_ssa_\"+n+\".region.example.com\";\n            const _data={\n              a: a(1),\n              b: a(2),\n              c: a(3)\n            };\n            \"\"\",\n            compress(\"\"\"\n                     {\n                       \"a\": \"https://bucket.s3express-zone_ssa_1.region.example.com\",\n                       \"b\": \"https://bucket.s3express-zone_ssa_2.region.example.com\",\n                       \"c\": \"https://bucket.s3express-zone_ssa_3.region.example.com\"\n                     }\"\"\")\n        );\n    }\n\n    @Test\n    void doesNotCorruptObjectKeysWhenReplacingWildcardStringValues() {\n        EndpointRuleSet ruleSet = EndpointRuleSet.fromNode(\n            Node.parse(\n                \"\"\"\n                {\n                  \"version\": \"1.3\",\n                  \"parameters\": {\n                    \"ParamA\": { \"required\": false, \"type\": \"String\" },\n                    \"ParamB\": { \"builtIn\": \"SDK::Endpoint\", \"required\": false, \"type\": \"String\" },\n                    \"ParamC\": { \"required\": true, \"type\": \"String\", \"builtIn\": \"AWS::Region\", \"default\": \"us-east-2\" }\n                  },\n                  \"rules\": [\n                    {\n                      \"type\": \"endpoint\",\n                      \"conditions\": [\n                        { \"fn\": \"isSet\", \"argv\": [{ \"ref\": \"ParamB\" }] },\n                        { \"fn\": \"stringEquals\", \"argv\": [{ \"ref\": \"ParamC\" }, \"*\"] }\n                      ],\n                      \"endpoint\": {\n                        \"url\": { \"ref\": \"ParamB\" },\n                        \"properties\": { \"authSchemes\": [{ \"name\": \"sigv4a\", \"signingRegionSet\": [\"*\"] }] }\n                      }\n                    },\n                    {\n                      \"type\": \"endpoint\",\n                      \"conditions\": [{ \"fn\": \"isSet\", \"argv\": [{ \"ref\": \"ParamB\" }] }],\n                      \"endpoint\": { \"url\": { \"ref\": \"ParamB\" } }\n                    },\n                    {\n                      \"type\": \"endpoint\",\n                      \"conditions\": [\n                        { \"fn\": \"isSet\", \"argv\": [{ \"ref\": \"ParamA\" }] },\n                        { \"fn\": \"stringEquals\", \"argv\": [{ \"ref\": \"ParamC\" }, \"*\"] }\n                      ],\n                      \"endpoint\": {\n                        \"url\": \"https://{ParamA}.global.example.com\",\n                        \"properties\": { \"authSchemes\": [{ \"name\": \"sigv4a\", \"signingRegionSet\": [\"*\"] }] }\n                      }\n                    },\n                    {\n                      \"type\": \"endpoint\",\n                      \"conditions\": [{ \"fn\": \"isSet\", \"argv\": [{ \"ref\": \"ParamA\" }] }],\n                      \"endpoint\": {\n                        \"url\": \"https://{ParamC}.{ParamA}.example.com\",\n                        \"properties\": { \"authSchemes\": [{ \"name\": \"sigv4\", \"signingRegion\": \"{ParamC}\" }] }\n                      }\n                    },\n                    {\n                      \"type\": \"endpoint\",\n                      \"conditions\": [{ \"fn\": \"stringEquals\", \"argv\": [{ \"ref\": \"ParamC\" }, \"*\"] }],\n                      \"endpoint\": {\n                        \"url\": \"https://prod.global.example.com\",\n                        \"properties\": { \"authSchemes\": [{ \"name\": \"sigv4a\", \"signingRegionSet\": [\"*\"] }] }\n                      }\n                    },\n                    {\n                      \"type\": \"endpoint\",\n                      \"conditions\": [],\n                      \"endpoint\": {\n                        \"url\": \"https://{ParamC}.prod.example.com\",\n                        \"properties\": { \"authSchemes\": [{ \"name\": \"sigv4\", \"signingRegion\": \"{ParamC}\" }] }\n                      }\n                    }\n                  ]\n                }\"\"\"\n            )\n        );\n\n        Cfg cfg = Cfg.from(ruleSet);\n        EndpointBddTrait bddTrait = EndpointBddTrait.from(cfg);\n        bddTrait = SiftingOptimization.builder().cfg(cfg).build().apply(bddTrait);\n        bddTrait = CostOptimization.builder().cfg(cfg).build().apply(bddTrait);\n        bddTrait = new NodeReversal().apply(bddTrait);\n\n        ObjectNode conditionsAndResults = ObjectNode.fromStringMap(Collections.emptyMap());\n        conditionsAndResults = conditionsAndResults.withMember(\n            \"conditions\",\n            ArrayNode.fromNodes(\n                bddTrait.getConditions().stream().map(c -> new ConditionSerializer(c).toArrayNode()).toList()\n            )\n        );\n        conditionsAndResults = conditionsAndResults.withMember(\n            \"results\",\n            ArrayNode.fromNodes(\n                bddTrait.getResults().stream().map(r -> new RuleSerializer(r).toArrayNode()).toList()\n            )\n        );\n\n        String result = new PatternDetectionCompression(conditionsAndResults).compress();\n\n        assertEquals(\n            \"\"\"\n            const f=\"authSchemes\";\n            const a=\"isSet\",\n            b=\"*\",\n            c={\"ref\":\"ParamB\"},\n            d={[f]:[{\"name\":\"sigv4a\",\"signingRegionSet\":[b]}]},\n            e={[f]:[{\"name\":\"sigv4\",\"signingRegion\":\"{ParamC}\"}]};\n            const _data={\n              conditions: [\n                [a,[c]],\n                [\"stringEquals\",[{ref:\"ParamC\"},b]],\n                [a,[{ref:\"ParamA\"}]]\n              ],\n              results: [\n                [-1],\n                [c,d],\n                [c,{}],\n                [\"https://{ParamA}.global.example.com\",d],\n                [\"https://{ParamC}.{ParamA}.example.com\",e],\n                [\"https://prod.global.example.com\",d],\n                [\"https://{ParamC}.prod.example.com\",e]\n              ]\n            };\n            \"\"\",\n            result\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/util/PropertyAccessorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport org.junit.jupiter.api.Test;\n\nclass PropertyAccessorTest {\n\n    @Test\n    void getFrom() {\n        assertEquals(\"output.fileSystemId\", PropertyAccessor.getFrom(\"output\", \"fileSystemId\"));\n        assertEquals(\"output.__fileSystemId\", PropertyAccessor.getFrom(\"output\", \"__fileSystemId\"));\n    }\n\n    @Test\n    void getFromQuoted() {\n        assertEquals(\"output[\\\"0fileSystemId\\\"]\", PropertyAccessor.getFrom(\"output\", \"0fileSystemId\"));\n        assertEquals(\"output[\\\"file-system-id\\\"]\", PropertyAccessor.getFrom(\"output\", \"file-system-id\"));\n    }\n\n    @Test\n    void getFromExtraQuoted() {\n        assertEquals(\"output[`file\\\"system\\\"id`]\", PropertyAccessor.getFrom(\"output\", \"file\\\"system\\\"id\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/util/StringStoreTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.util;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport java.util.Objects;\nimport org.junit.jupiter.api.Test;\n\nclass StringStoreTest {\n\n    @Test\n    void var() {\n        StringStore subject = new StringStore();\n        String sourceCode = \"\"\"\n                            const array = [\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s,\n                                %s\n                            ];\n                            \"\"\".formatted(\n            subject.var(\"SomeObject\"),\n            subject.var(\"some_object\"),\n            subject.var(\"SomeObject\"),\n            subject.var(\"some_object\"),\n            subject.var(\"_\"),\n            subject.var(\"__\"),\n            subject.var(\"___\"),\n            subject.var(\"_internal\"),\n            subject.var(\"__internal\"),\n            subject.var(\"___internal\"),\n            subject.var(\"_internal_\"),\n            subject.var(\"__internal__\"),\n            subject.var(\"___internal__\"),\n            subject.var(\"_two--words\"),\n            subject.var(\"__twoWords__\"),\n            subject.var(\"___TwoWords__\"),\n            subject.var(\"$Symbol\"),\n            subject.var(\"%Symbol\"),\n            subject.var(\"   !)(@*#&$^%   \"),\n            subject.var(\"   !)( @  )(@*#&$^* SmithyTypeScript# &)(@*#&$^  $^%   )(@*#&$^\"),\n            subject.var(\"**Ack**Ack**\"),\n            subject.var(\"Spaces Are Cool\"),\n            subject.var(\"__why Would &&& YouName $something this...\")\n        );\n\n        String[] expected = \"\"\"\n                            const _ = \"_\";\n                            const _AA = \"**Ack**Ack**\";\n                            const _S = \"$Symbol\";\n                            const _SAC = \"Spaces Are Cool\";\n                            const _SO = \"SomeObject\";\n                            const _S_ = \"   !)( @  )(@*#&$^* SmithyTypeScript# &)(@*#&$^  $^%   )(@*#&$^\";\n                            const _Sy = \"%Symbol\";\n                            const _TW = \"___TwoWords__\";\n                            const __ = \"__\";\n                            const ___ = \"___\";\n                            const ____ = \"   !)(@*#&$^%   \";\n                            const _i = \"_internal\";\n                            const _in = \"__internal\";\n                            const _int = \"___internal\";\n                            const _inte = \"_internal_\";\n                            const _inter = \"__internal__\";\n                            const _intern = \"___internal__\";\n                            const _so = \"some_object\";\n                            const _tW = \"__twoWords__\";\n                            const _tw = \"_two--words\";\n                            const _wWYt = \"__why Would &&& YouName $something this...\";\n\n                            const array = [\n                                _SO,\n                                _so,\n                                _SO,\n                                _so,\n                                _,\n                                __,\n                                ___,\n                                _i,\n                                _in,\n                                _int,\n                                _inte,\n                                _inter,\n                                _intern,\n                                _tw,\n                                _tW,\n                                _TW,\n                                _S,\n                                _Sy,\n                                ____,\n                                _S_,\n                                _AA,\n                                _SAC,\n                                _wWYt\n                            ];\n                            \"\"\".split(\"\\n\");\n        String[] actual = (subject.flushVariableDeclarationCode() + \"\\n\" + sourceCode).split(\"\\n\");\n\n        for (int i = 0; i < expected.length; ++i) {\n            assertEquals(\n                Objects.toString(i) + \": \" + expected[i].trim(),\n                Objects.toString(i) + \": \" + actual[i].trim()\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/validation/ImportFromTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport org.junit.jupiter.api.Test;\n\nclass ImportFromTest {\n\n    @Test\n    void isNodejsNative() {\n        assertTrue(new ImportFrom(\"node:buffer\").isNodejsNative());\n        assertTrue(new ImportFrom(\"stream\").isNodejsNative());\n        assertFalse(new ImportFrom(\"@smithy/util\").isNodejsNative());\n        assertFalse(new ImportFrom(\"../file\").isNodejsNative());\n    }\n\n    @Test\n    void isNamespaced() {\n        assertTrue(new ImportFrom(\"@smithy/util/submodule\").isNamespaced());\n        assertTrue(new ImportFrom(\"@smithy/util\").isNamespaced());\n        assertFalse(new ImportFrom(\"node:stream\").isNamespaced());\n        assertFalse(new ImportFrom(\"fs/promises\").isNamespaced());\n    }\n\n    @Test\n    void isRelative() {\n        assertTrue(new ImportFrom(\"/file/path\").isRelative());\n        assertTrue(new ImportFrom(\"./file/path\").isRelative());\n        assertTrue(new ImportFrom(\"../../../../file/path\").isRelative());\n        assertFalse(new ImportFrom(\"@smithy/util\").isRelative());\n        assertFalse(new ImportFrom(\"fs/promises\").isRelative());\n    }\n\n    @Test\n    void isDeclarablePackageImport() {\n        assertTrue(new ImportFrom(\"@smithy/util/submodule\").isDeclarablePackageImport());\n        assertTrue(new ImportFrom(\"@smithy/util\").isDeclarablePackageImport());\n        assertTrue(new ImportFrom(\"smithy_pkg\").isDeclarablePackageImport());\n        assertTrue(new ImportFrom(\"smithy_pkg/array\").isDeclarablePackageImport());\n        assertFalse(new ImportFrom(\"node:buffer\").isDeclarablePackageImport());\n        assertFalse(new ImportFrom(\"../pkg/pkg\").isDeclarablePackageImport());\n    }\n\n    @Test\n    void getPackageName() {\n        assertEquals(new ImportFrom(\"smithy_pkg/array\").getPackageName(), \"smithy_pkg\");\n        assertEquals(new ImportFrom(\"@smithy/util/submodule\").getPackageName(), \"@smithy/util\");\n        assertEquals(new ImportFrom(\"node:fs/promises\").getPackageName(), \"fs\");\n        assertEquals(new ImportFrom(\"smithy_pkg\").getPackageName(), \"smithy_pkg\");\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/validation/LongValidatorTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.List;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.validation.ValidationEvent;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\n\npublic class LongValidatorTest {\n\n    @Test\n    public void findsDoubles() {\n        Model model = Model.assembler().addImport(getClass().getResource(\"long-validation.smithy\")).assemble().unwrap();\n        TypeScriptSettings settings = new TypeScriptSettings();\n        settings.setService(ShapeId.from(\"smithy.example#Example\"));\n        LongValidator validator = new LongValidator(settings);\n        List<ValidationEvent> result = validator.validate(model);\n        assertThat(result.size(), equalTo(1));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/validation/ReplaceLastTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\nimport org.junit.jupiter.api.Test;\n\nclass ReplaceLastTest {\n\n    @Test\n    public void replaceLast() {\n        assertEquals(ReplaceLast.in(\"WorkspacesThinClientClient\", \"Client\", \"\"), \"WorkspacesThinClient\");\n        assertEquals(ReplaceLast.in(\"WorkspacesThinClientClientClient\", \"Client\", \"\"), \"WorkspacesThinClientClient\");\n\n        assertEquals(ReplaceLast.in(\"welcometothecity\", \"e\", \"is\"), \"welcometothiscity\");\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/validation/SensitiveDataFinderTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.Matchers.equalTo;\n\nimport java.util.Collections;\nimport org.junit.jupiter.api.Test;\nimport software.amazon.smithy.model.Model;\nimport software.amazon.smithy.model.shapes.CollectionShape;\nimport software.amazon.smithy.model.shapes.ListShape;\nimport software.amazon.smithy.model.shapes.MapShape;\nimport software.amazon.smithy.model.shapes.MemberShape;\nimport software.amazon.smithy.model.shapes.StringShape;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.SensitiveTrait;\n\npublic class SensitiveDataFinderTest {\n\n    StringShape sensitiveString = StringShape.builder()\n        .addTrait(new SensitiveTrait())\n        .id(\"foo.bar#sensitiveString\")\n        .build();\n\n    StringShape dullString = StringShape.builder().id(\"foo.bar#dullString\").build();\n\n    MemberShape memberWithSensitiveData = MemberShape.builder()\n        .id(\"foo.bar#sensitive$member\")\n        .target(sensitiveString.getId())\n        .build();\n\n    MemberShape memberWithDullData = MemberShape.builder().id(\"foo.bar#dull$member\").target(dullString.getId()).build();\n\n    MemberShape listMemberWithSensitiveData = MemberShape.builder()\n        .id(\"foo.bar#listSensitive$member\")\n        .target(sensitiveString.getId())\n        .build();\n\n    MemberShape listMemberWithDullData = MemberShape.builder()\n        .id(\"foo.bar#listDull$member\")\n        .target(dullString.getId())\n        .build();\n\n    MemberShape mapMemberWithSensitiveKeyData = MemberShape.builder()\n        .id(\"foo.bar#mapSensitiveKey$member\")\n        .target(sensitiveString.getId())\n        .build();\n\n    MemberShape mapMemberWithSensitiveValueData = MemberShape.builder()\n        .id(\"foo.bar#mapSensitiveValue$member\")\n        .target(sensitiveString.getId())\n        .build();\n\n    StructureShape structureShapeSensitive = StructureShape.builder()\n        .id(\"foo.bar#sensitive\")\n        .members(Collections.singleton(memberWithSensitiveData))\n        .build();\n\n    StructureShape structureShapeDull = StructureShape.builder()\n        .id(\"foo.bar#dull\")\n        .members(Collections.singleton(memberWithDullData))\n        .build();\n\n    CollectionShape collectionSensitive = ListShape.builder()\n        .id(\"foo.bar#listSensitive\")\n        .addMember(listMemberWithSensitiveData)\n        .build();\n\n    CollectionShape collectionDull = ListShape.builder()\n        .id(\"foo.bar#listDull\")\n        .addMember(listMemberWithDullData)\n        .build();\n\n    MapShape mapSensitiveKey = MapShape.builder()\n        .id(\"foo.bar#mapSensitiveKey\")\n        .key(mapMemberWithSensitiveKeyData)\n        .value(MemberShape.builder().id(\"foo.bar#mapSensitiveKey$key\").target(dullString.getId()).build())\n        .build();\n\n    MapShape mapSensitiveValue = MapShape.builder()\n        .id(\"foo.bar#mapSensitiveValue\")\n        .key(MemberShape.builder().id(\"foo.bar#mapSensitiveValue$key\").target(dullString.getId()).build())\n        .value(mapMemberWithSensitiveValueData)\n        .build();\n\n    MapShape mapDull = MapShape.builder()\n        .id(\"foo.bar#mapDull\")\n        .key(MemberShape.builder().id(\"foo.bar#mapDull$key\").target(dullString.getId()).build())\n        .value(MemberShape.builder().id(\"foo.bar#mapDull$value\").target(dullString.getId()).build())\n        .build();\n\n    MapShape nested2 = MapShape.builder()\n        .id(\"foo.bar#mapNested2\")\n        .key(MemberShape.builder().id(\"foo.bar#mapNested2$key\").target(dullString.getId()).build())\n        .value(MemberShape.builder().id(\"foo.bar#mapNested2$value\").target(mapSensitiveValue).build())\n        .build();\n\n    MapShape nested = MapShape.builder()\n        .id(\"foo.bar#mapNested\")\n        .key(MemberShape.builder().id(\"foo.bar#mapNested$key\").target(dullString.getId()).build())\n        .value(MemberShape.builder().id(\"foo.bar#mapNested$value\").target(nested2).build())\n        .build();\n\n    private Model model = Model.builder()\n        .addShapes(\n            sensitiveString,\n            dullString,\n            memberWithSensitiveData,\n            memberWithDullData,\n            structureShapeSensitive,\n            structureShapeDull,\n            collectionSensitive,\n            collectionDull,\n            mapSensitiveKey,\n            mapSensitiveValue,\n            mapDull,\n            nested,\n            nested2\n        )\n        .build();\n\n    private SensitiveDataFinder sensitiveDataFinder = new SensitiveDataFinder(model);\n\n    @Test\n    public void findsSensitiveData_inShapes() {\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(sensitiveString), equalTo(true));\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(dullString), equalTo(false));\n    }\n\n    @Test\n    public void findsSensitiveData_inTargetShapes() {\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(memberWithSensitiveData), equalTo(true));\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(memberWithDullData), equalTo(false));\n    }\n\n    @Test\n    public void findsSensitiveData_inStructures() {\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(structureShapeSensitive), equalTo(true));\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(structureShapeDull), equalTo(false));\n    }\n\n    @Test\n    public void findsSensitiveData_inCollections() {\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(collectionSensitive), equalTo(true));\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(collectionDull), equalTo(false));\n    }\n\n    @Test\n    public void findsSensitiveData_inMaps() {\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapSensitiveKey), equalTo(true));\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapSensitiveValue), equalTo(true));\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapDull), equalTo(false));\n    }\n\n    @Test\n    public void findsSensitiveData_deeplyNested() {\n        assertThat(sensitiveDataFinder.findsSensitiveDataIn(nested), equalTo(true));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/validation/UnaryFunctionCallTest.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\npackage software.amazon.smithy.typescript.codegen.validation;\n\nimport static org.junit.jupiter.api.Assertions.assertEquals;\n\nimport org.junit.jupiter.api.Test;\n\nclass UnaryFunctionCallTest {\n\n    @Test\n    void check() {\n        assertEquals(false, UnaryFunctionCall.check(\"\"));\n        assertEquals(false, UnaryFunctionCall.check(\"5\"));\n        assertEquals(false, UnaryFunctionCall.check(\"(param)\"));\n        assertEquals(false, UnaryFunctionCall.check(\"x[5]\"));\n        assertEquals(false, UnaryFunctionCall.check(\"new Date(timestamp)\"));\n        assertEquals(false, UnaryFunctionCall.check(\"x(y(_))\"));\n        assertEquals(false, UnaryFunctionCall.check(\"call(param).prop\"));\n        assertEquals(false, UnaryFunctionCall.check(\"call(param, param2)\"));\n\n        assertEquals(true, UnaryFunctionCall.check(\"_\"));\n        assertEquals(true, UnaryFunctionCall.check(\"x()\"));\n        assertEquals(true, UnaryFunctionCall.check(\"x(_)\"));\n        assertEquals(true, UnaryFunctionCall.check(\"long_function_name(long_parameter_name)\"));\n        assertEquals(true, UnaryFunctionCall.check(\"container.function(param)\"));\n        assertEquals(true, UnaryFunctionCall.check(\"factory(param)(param2)\"));\n    }\n\n    @Test\n    void toRef() {\n        assertEquals(\"_\", UnaryFunctionCall.toRef(\"_\"));\n        assertEquals(\"x\", UnaryFunctionCall.toRef(\"x()\"));\n        assertEquals(\"x\", UnaryFunctionCall.toRef(\"x(_)\"));\n        assertEquals(\"long_function_name\", UnaryFunctionCall.toRef(\"long_function_name(long_parameter_name)\"));\n        assertEquals(\"container.function\", UnaryFunctionCall.toRef(\"container.function(param)\"));\n        assertEquals(\"factory(param)\", UnaryFunctionCall.toRef(\"factory(param)(param2)\"));\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration",
    "content": "software.amazon.smithy.typescript.codegen.SymbolDecoratorIntegration\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/endpointsV2/endpoints-operation-context-params.smithy",
    "content": "$version: \"2.0\"\n\nnamespace smithy.example\n\n@smithy.rules#endpointRuleSet({\n    version: \"1.0\",\n    parameters: {\n        opContextParamIdentifier: {\n            type: \"string\",\n        },\n        opContextParamSubExpression: {\n            type: \"string\",\n        },\n        opContextParamWildcardExpressionList: {\n            type: \"stringArray\",\n        },\n        opContextParamWildcardExpressionListFlatten: {\n            type: \"stringArray\",\n        },\n        opContextParamWildcardExpressionListObj: {\n            type: \"stringArray\",\n        },\n        opContextParamWildcardExpressionListObjListFlatten: {\n            type: \"stringArray\",\n        },\n        opContextParamWildcardExpressionHash: {\n            type: \"stringArray\",\n        },\n        opContextParamMultiSelectList: {\n            type: \"stringArray\",\n        },\n        opContextParamMultiSelectListFlatten: {\n            type: \"stringArray\",\n        },\n        opContextParamKeys: {\n            type: \"stringArray\",\n        },\n    },\n    rules: []\n})\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\n@smithy.rules#operationContextParams(\n    \"opContextParamIdentifier\": { path: \"fooString\" }\n    \"opContextParamSubExpression\": { path: \"fooObj.bar\" }\n    \"opContextParamWildcardExpressionList\": { path: \"fooList[*]\" }\n    \"opContextParamWildcardExpressionListFlatten\": { path: \"fooListList[*][]\" }\n    \"opContextParamWildcardExpressionListObj\": { path: \"fooListObj[*].key\" }\n    \"opContextParamWildcardExpressionListObjListFlatten\": { path: \"fooListObjList[*].key[]\" }\n    \"opContextParamWildcardExpressionHash\": { path: \"fooObjObj.*.bar\" }\n    \"opContextParamMultiSelectList\": { path: \"fooListObjObj[*].[fooObject.bar, fooString]\" }\n    \"opContextParamMultiSelectListFlatten\": { path: \"fooListObjObj[*].[fooList][]\" }\n    \"opContextParamKeys\": { path: \"keys(fooKeys)\" }\n)\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput,\n    errors: [GetFooError]\n}\n\nstructure GetFooInput {\n    fooKeys: FooObject,\n    fooList: FooList,\n    fooListList: FooListList,\n    fooListObj: FooListObject,\n    fooListObjList: FooListObjectList,\n    fooListObjObj: FooListObjectObject,\n    fooObj: FooObject,\n    fooObjObj: FooObjectObject,\n    fooString: String,\n}\n\nstructure FooObject {\n    bar: String\n}\n\nlist FooListObjectObject {\n    member: FooMultiSelectObjectObject\n}\n\nstructure FooMultiSelectObjectObject {\n    fooList: FooList\n    fooObject: FooObject\n    fooString: String\n}\n\nstructure FooObjectObject {\n    baz: FooObject\n}\n\nlist FooListList {\n    member: FooList\n}\n\nlist FooList {\n    member: String\n}\n\nlist FooListObject {\n    member: FooListObjectMember\n}\n\nstructure FooListObjectMember {\n    key: String\n}\n\nlist FooListObjectList {\n    member: FooListObjectListMember\n}\n\nstructure FooListObjectListMember {\n    key: FooList\n}\n\nstructure GetFooOutput {}\n\n@error(\"client\")\nstructure GetFooError {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/endpointsV2/endpoints.smithy",
    "content": "$version: \"2.0\"\n\nnamespace smithy.example\n\n@smithy.rules#endpointRuleSet({\n  \"version\": \"1.3\"\n  \"parameters\": {\n    \"Region\": {\n      \"type\": \"String\",\n      \"documentation\": \"The region to dispatch this request, eg. `us-east-1`.\"\n    },\n    \"Stage\": {\n      \"type\": \"String\",\n      \"required\": true,\n      \"default\": \"production\"\n    },\n    \"Endpoint\": {\n      \"builtIn\": \"SDK::Endpoint\",\n      \"type\": \"String\",\n      \"required\": false,\n      \"documentation\": \"Override the endpoint used to send this request\"\n    }\n  },\n  \"rules\": [\n    {\n      \"conditions\": [\n        {\n          \"fn\": \"isSet\",\n          \"argv\": [\n            {\n              \"ref\": \"Endpoint\"\n            }\n          ]\n        },\n        {\n          \"fn\": \"parseURL\",\n          \"argv\": [\n            {\n              \"ref\": \"Endpoint\"\n            }\n          ],\n          \"assign\": \"url\"\n        }\n      ],\n      \"endpoint\": {\n        \"url\": {\n          \"ref\": \"Endpoint\"\n        },\n        \"properties\": {},\n        \"headers\": {}\n      },\n      \"type\": \"endpoint\"\n    },\n    {\n      \"documentation\": \"Template the region into the URI when region is set\",\n      \"conditions\": [\n        {\n          \"fn\": \"isSet\",\n          \"argv\": [\n            {\n              \"ref\": \"Region\"\n            }\n          ]\n        }\n      ],\n      \"type\": \"tree\",\n      \"rules\": [\n        {\n          \"conditions\": [\n            {\n              \"fn\": \"stringEquals\",\n              \"argv\": [\n                {\n                  \"ref\": \"Stage\"\n                },\n                \"staging\"\n              ]\n            }\n          ],\n          \"endpoint\": {\n            \"url\": \"https://{Region}.staging.example.com/2023-01-01\",\n            \"properties\": {},\n            \"headers\": {}\n          },\n          \"type\": \"endpoint\"\n        },\n        {\n          \"conditions\": [],\n          \"endpoint\": {\n            \"url\": \"https://{Region}.example.com/2023-01-01\",\n            \"properties\": {},\n            \"headers\": {}\n          },\n          \"type\": \"endpoint\"\n        }\n      ]\n    },\n    {\n      \"documentation\": \"Fallback when region is unset\",\n      \"conditions\": [],\n      \"error\": \"Region must be set to resolve a valid endpoint\",\n      \"type\": \"error\"\n    }\n  ]\n})\n@smithy.rules#clientContextParams(\n  Stage: {type: \"string\", documentation: \"The endpoint stage used to construct the hostname.\"}\n  Region: {type: \"string\", documentation: \"The region to dispatch this request, eg. `us-east-1`.\"}\n)\nservice Example {\n    version: \"2023-01-01\"\n    operations: [GetFoo]\n}\n\n@readonly\noperation GetFoo {\n    input: GetFooInput\n    output: GetFooOutput\n}\n\nstructure GetFooInput {\n    @required\n    @hostLabel\n    foo: String\n}\nstructure GetFooOutput {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-empty.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething{\n    errors: [Err]\n}\n\n@error(\"client\")\nstructure Err {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-optional-member-no-message.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething {\n    errors: [Err]\n}\n\n@error(\"client\")\nstructure Err {\n    foo: String,\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-optional-message.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething {\n    errors: [Err]\n}\n\n@error(\"client\")\nstructure Err {\n    message: String,\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-required-member-no-message.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething {\n    errors: [Err]\n}\n\n@error(\"client\")\nstructure Err {\n    @required\n    foo: String,\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-required-message.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething {\n    errors: [Err]\n}\n\n@error(\"client\")\nstructure Err {\n    @required\n    message: String,\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-retryable-throttling.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething {\n    errors: [Err]\n}\n\n@error(\"client\")\n@retryable(throttling: true)\nstructure Err {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/error-test-retryable.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [DoSomething]\n}\n\noperation DoSomething {\n    errors: [Err]\n}\n\n@error(\"client\")\n@retryable\nstructure Err {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/integration/endpoint-trait.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\n@readonly\n@endpoint(hostPrefix: \"{foo}.data.\")\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput\n}\n\nstructure GetFooInput {\n    @required\n    @hostLabel\n    foo: String\n}\nstructure GetFooOutput {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth-trait-all-optional.smithy",
    "content": "namespace smithy.example\n\n// This test input is used to validate that the generated client properly injects\n// the HTTP API key authentication middleware with the correct options.\n//\n// In this case the operations all have the `@optionalAuth` trait, so the middleware\n// should not be injected at all.\n\n@httpApiKeyAuth(in: \"header\", name: \"Authorization\", scheme: \"ApiKey\")\nservice Example {\n    version: \"2019-10-15\",\n    operations: [GetFoo, GetBar]\n}\n\n@optionalAuth\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput,\n    errors: [GetFooError]\n}\n\nstructure GetFooInput {}\nstructure GetFooOutput {}\n\n@error(\"client\")\nstructure GetFooError {}\n\n@optionalAuth\noperation GetBar {\n    input: GetBarInput,\n    output: GetBarOutput,\n    errors: [GetBarError]\n}\n\nstructure GetBarInput {}\nstructure GetBarOutput {}\n\n@error(\"client\")\nstructure GetBarError {}\n\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth-trait-no-scheme.smithy",
    "content": "namespace smithy.example\n\n// This test input is used to validate that the generated client properly injects\n// the HTTP API key authentication middleware with the correct options.\n//\n// In this case the options should not include the `scheme` attribute.\n\n@httpApiKeyAuth(in: \"header\", name: \"Authorization\")\n@auth([httpApiKeyAuth])\nservice Example {\n    version: \"2019-10-15\",\n    operations: [GetFoo, GetBar]\n}\n\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput,\n    errors: [GetFooError]\n}\n\nstructure GetFooInput {}\nstructure GetFooOutput {}\n\n@error(\"client\")\nstructure GetFooError {}\n\n@optionalAuth\noperation GetBar {\n    input: GetBarInput,\n    output: GetBarOutput,\n    errors: [GetBarError]\n}\n\nstructure GetBarInput {}\nstructure GetBarOutput {}\n\n@error(\"client\")\nstructure GetBarError {}\n\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth-trait-on-operation.smithy",
    "content": "namespace smithy.example\n\n// This test input is used to validate that the generated client properly injects\n// the HTTP API key authentication middleware with the correct options.\n//\n// In this scenario the `@auth` trait is on the operation rather than the service.\n\n@httpApiKeyAuth(in: \"header\", name: \"Authorization\", scheme: \"ApiKey\")\nservice Example {\n    version: \"2019-10-15\",\n    operations: [GetFoo, GetBar]\n}\n\n@auth([httpApiKeyAuth])\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput,\n    errors: [GetFooError]\n}\n\nstructure GetFooInput {}\nstructure GetFooOutput {}\n\n@error(\"client\")\nstructure GetFooError {}\n\n@optionalAuth\noperation GetBar {\n    input: GetBarInput,\n    output: GetBarOutput,\n    errors: [GetBarError]\n}\n\nstructure GetBarInput {}\nstructure GetBarOutput {}\n\n@error(\"client\")\nstructure GetBarError {}\n\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/integration/http-api-key-auth-trait.smithy",
    "content": "namespace smithy.example\n\n// This test input is used to validate that the generated client properly injects\n// the HTTP API key authentication middleware with the correct options.\n//\n// In this scenario the `@auth` trait is on the service and therefore applies to\n// all operations except operations with the `@optionalAuth` trait.\n\n@httpApiKeyAuth(in: \"header\", name: \"Authorization\", scheme: \"ApiKey\")\n@auth([httpApiKeyAuth])\nservice Example {\n    version: \"2019-10-15\",\n    operations: [GetFoo, GetBar]\n}\n\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput,\n    errors: [GetFooError]\n}\n\nstructure GetFooInput {}\nstructure GetFooOutput {}\n\n@error(\"client\")\nstructure GetFooError {}\n\n@optionalAuth\noperation GetBar {\n    input: GetBarInput,\n    output: GetBarOutput,\n    errors: [GetBarError]\n}\n\nstructure GetBarInput {}\nstructure GetBarOutput {}\n\n@error(\"client\")\nstructure GetBarError {}\n\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/knowledge/serde-elision.smithy",
    "content": "$version: \"2.0\"\n\nnamespace foo.bar\n\nstring SimpleString\n\nlist SimpleList {\n    member: A\n}\n\nmap SimpleMap {\n    key: A\n    value: A\n}\n\nstructure SimpleStruct {\n    a: A\n}\n\nboolean Boolean\n\nbyte Byte\n\nenum Enum {\n    A\n}\n\ninteger Integer\n\nintEnum IntEnum {\n    A = 1\n}\n\nlong Long\n\nshort Short\n\nbigDecimal BigDecimal\n\nbigInteger BigInteger\n\nblob Blob\n\ntimestamp Timestamp\n\ndocument Document\n\ndouble Double\n\nfloat Float\n\nlist BigDecimalList {\n    member: BigDecimal\n}\n\nlist BigIntegerList {\n    member: BigInteger\n}\n\nlist BlobList {\n    member: Blob\n}\n\nlist DocumentList {\n    member: Document\n}\n\nlist TimestampList {\n    member: Timestamp\n}\n\nlist DoubleList {\n    member: Double\n}\n\nlist FloatList {\n    member: Float\n}\n\nstructure BigDecimalStructure {\n    member: BigDecimal\n}\n\nstructure BigIntegerStructure {\n    member: BigInteger\n}\n\nstructure BlobStructure {\n    member: Blob\n}\n\nstructure DocumentStructure {\n    member: Document\n}\n\nstructure TimestampStructure {\n    member: Timestamp\n}\n\nstructure DoubleStructure {\n    member: Double\n}\n\nstructure FloatStructure {\n    member: Float\n}\n\nunion BigDecimalUnion {\n    member: BigDecimal\n}\n\nunion BigIntegerUnion {\n    member: BigInteger\n}\n\nunion BlobUnion {\n    member: Blob\n}\n\nunion DocumentUnion {\n    member: Document\n}\n\nunion TimestampUnion {\n    member: Timestamp\n}\n\nunion DoubleUnion {\n    member: Double\n}\n\nunion FloatUnion {\n    member: Float\n}\n\nmap BigDecimalMap {\n    key: String\n    value: BigDecimal\n}\n\nmap BigIntegerMap {\n    key: String\n    value: BigInteger\n}\n\nmap BlobMap {\n    key: String\n    value: Blob\n}\n\nmap DocumentMap {\n    key: String\n    value: Document\n}\n\nmap TimestampMap {\n    key: String\n    value: Timestamp\n}\n\nmap DoubleMap {\n    key: String\n    value: Double\n}\n\nmap FloatMap {\n    key: String\n    value: Float\n}\n\nstructure NestedJsonName {\n    bar: JsonNameStructure\n}\n\nstructure JsonNameStructure {\n    @jsonName(\"foo\")\n    foo: A\n}\n\nstructure NestedEventStream {\n    eventStream: EventStreamUnion\n}\n\n@streaming\nunion EventStreamUnion {\n    message: Event\n}\n\nstructure Event {}\n\nstructure NestedMediaType {\n    foo: MediaTypeString\n}\n\n@mediaType(\"video/quicktime\")\nstring MediaTypeString\n\nstructure NestedSparseList {\n    foo: SparseList\n}\n\n@sparse\nlist SparseList {\n    member: String\n}\n\nstructure NestedSparseMap {\n    foo: SparseMap\n}\n\n@sparse\nmap SparseMap {\n    key: String\n    value: String\n}\n\nstructure NestedIdempotencyToken {\n    foo: IdempotencyTokenStructure\n}\n\nstructure IdempotencyTokenStructure {\n    @idempotencyToken\n    foo: String\n}\n\nstring A\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/output-structure.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput,\n    errors: [GetFooError]\n}\n\nstructure GetFooInput {}\nstructure GetFooOutput {}\n\n@error(\"client\")\nstructure GetFooError {}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/simple-service-with-operation.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {}\n\n\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/simple-service.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\"\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-insensitive-list.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: NamesList\n}\n\nlist NamesList {\n    member: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-insensitive-map.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: NamesMap\n}\n\nmap NamesMap {\n    key: String,\n    value: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-insensitive-simple-shape.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    firstname: String,\n    lastname: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-list-with-sensitive-member.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: PhoneNumbersList\n}\n\nlist PhoneNumbersList {\n    member: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-list-with-structure-with-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: UserList\n}\n\nlist UserList {\n    member: User\n}\n\nstructure User {\n    username: String,\n\n    password: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-list-with-union-with-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: UserList\n}\n\nlist UserList {\n    member: TestUnion\n}\n\nunion TestUnion {\n    bar: String,\n\n    sensitiveBar: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-map-with-sensitive-member.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: PhoneNumbersMap\n}\n\nmap PhoneNumbersMap {\n    key: String,\n    \n    value: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-map-with-structure-with-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: UserMap\n}\n\nmap UserMap {\n    key: String,\n    value: User\n}\n\nstructure User {\n    username: String,\n\n    password: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-map-with-union-with-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: UserMap\n}\n\nmap UserMap {\n    key: String,\n    value: TestUnion\n}\n\nunion TestUnion {\n    bar: String,\n\n    sensitiveBar: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-recursive-shapes.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: User\n}\n\nstructure User {\n    recursiveUser: User,\n    recursiveList: UsersList,\n    recursiveMap: UsersMap\n}\n\nlist UsersList {\n    member: User\n}\n\nmap UsersMap {\n    key: String,\n    value: User\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-required-member.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput,\n    output: GetFooOutput\n}\n\nstructure GetFooInput {}\nstructure GetFooOutput {\n    @required\n    someRequiredMember: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-sensitive-list.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: SecretNamesList\n}\n\n@sensitive\nlist SecretNamesList {\n    member: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-sensitive-map.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: SecretNamesMap\n}\n\n@sensitive\nmap SecretNamesMap {\n    key: String,\n    value: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-sensitive-simple-shape.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    username: String,\n\n    password: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-sensitive-structure.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: SecretUser\n}\n\n@sensitive\nstructure SecretUser {\n    firstname: String,\n    lastname: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-sensitive-union.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: SecretUnion\n}\n\n@sensitive\nunion SecretUnion {\n    fooString: String,\n    barString: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-streaming-union.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: StreamingUnion\n}\n\n@streaming\nunion StreamingUnion {\n    message: Message\n}\n\nstructure Message {\n    message: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-structure-with-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: User\n}\n\nstructure User {\n    username: String,\n\n    password: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-structure-without-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: User\n}\n\nstructure User {\n    firstname: String,\n    lastname: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-union-with-list.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: TestUnion\n}\n\nunion TestUnion {\n    list: NamesList\n}\n\nlist NamesList {\n    member: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-union-with-map.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: TestUnion\n}\n\nunion TestUnion {\n    map: NamesMap\n}\n\nmap NamesMap {\n    key: String,\n    value: String\n}"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-union-with-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: TestUnion\n}\n\nunion TestUnion {\n    bar: String,\n\n    sensitiveBar: SensitiveString\n}\n\n@sensitive\nstring SensitiveString"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-union-with-structure.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: TestUnion\n}\n\nunion TestUnion {\n    fooUser: User\n}\n\nstructure User {\n    firstname: String,\n    lastname: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/test-union-without-sensitive-data.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [GetFoo]\n}\n\noperation GetFoo {\n    input: GetFooInput\n}\n\nstructure GetFooInput {\n    foo: TestUnion\n}\n\nunion TestUnion {\n    fooString: String,\n    barString: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/testmodel.smithy",
    "content": "namespace smithy.example\n\nstructure Foo {\n    @required\n    foo: String,\n}\n"
  },
  {
    "path": "smithy-typescript-codegen/src/test/resources/software/amazon/smithy/typescript/codegen/validation/long-validation.smithy",
    "content": "namespace smithy.example\n\nservice Example {\n    version: \"1.0.0\",\n    operations: [ExampleOperation]\n}\n\noperation ExampleOperation {\n    input: ExampleOperationInput\n}\n\nstructure ExampleOperationInput {\n    longInput: Long\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/build.gradle.kts",
    "content": "/*\n * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 * A copy of the License is located at\n *\n *  http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\nextra[\"displayName\"] = \"Smithy :: Typescript :: Codegen :: Test\"\nextra[\"moduleName\"] = \"software.amazon.smithy.typescript.codegen.test\"\n\n\nplugins {\n    `java-library`\n    id(\"software.amazon.smithy.gradle.smithy-jar\")\n}\n\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n\ndependencies {\n    val smithyVersion: String by project\n\n    // Put plugins and integrations on the smithy build classpath\n    smithyBuild(project(\":smithy-typescript-codegen\"))\n    smithyBuild(project(\":smithy-typescript-codegen-test:example-weather-customizations\"))\n    smithyBuild(project(\":smithy-typescript-ssdk-codegen-test-utils\"))\n\n    implementation(\"software.amazon.smithy:smithy-rules-engine:$smithyVersion\")\n    implementation(\"software.amazon.smithy:smithy-waiters:$smithyVersion\")\n    implementation(\"software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion\")\n    implementation(\"software.amazon.smithy:smithy-aws-traits:$smithyVersion\")\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/example-weather-customizations/build.gradle.kts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nplugins {\n    `java-library`\n}\n\njava {\n    sourceCompatibility = JavaVersion.VERSION_17\n    targetCompatibility = JavaVersion.VERSION_17\n}\n\ntasks.withType<JavaCompile> {\n    options.encoding = \"UTF-8\"\n}\n\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n\ndependencies {\n    implementation(project(\":smithy-typescript-codegen\"))\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/example-weather-customizations/src/main/java/example/weather/ExampleWeatherCustomEndpointsRuntimeConfig.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: MIT-0\n */\n\npackage example.weather;\n\nimport java.nio.file.Paths;\nimport java.util.List;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.ToShapeId;\nimport software.amazon.smithy.rulesengine.traits.EndpointRuleSetTrait;\nimport software.amazon.smithy.typescript.codegen.CodegenUtils;\nimport software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.endpointsV2.EndpointsV2Generator;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;\nimport software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin.Convention;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class ExampleWeatherCustomEndpointsRuntimeConfig implements TypeScriptIntegration {\n\n    public static final String GENERIC_TEST_DIR = Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, \"generic\").toString();\n    public static final String INDEX_MODULE = GENERIC_TEST_DIR + \"/index\";\n    public static final String INDEX_FILE = INDEX_MODULE + \".ts\";\n    public static final String ADD_CUSTOM_ENDPOINTS_FILE = GENERIC_TEST_DIR + \"/customEndpoints\" + \".ts\";\n\n    public static final String getClientFile(ShapeId service) {\n        return Paths.get(\".\", CodegenUtils.SOURCE_FOLDER, service.getName() + \"Client.ts\").toString();\n    }\n\n    public static final ShapeId EXAMPLE_WEATHER_SERVICE_ID = ShapeId.from(\"example.weather#Weather\");\n\n    @Override\n    public List<RuntimeClientPlugin> getClientPlugins() {\n        return List.of(\n            RuntimeClientPlugin.builder()\n                .inputConfig(\n                    Symbol.builder().namespace(INDEX_MODULE, \"/\").name(\"GenericCustomEndpointsInputConfig\").build()\n                )\n                .resolvedConfig(\n                    Symbol.builder().namespace(INDEX_MODULE, \"/\").name(\"GenericCustomEndpointsResolvedConfig\").build()\n                )\n                .resolveFunction(\n                    Symbol.builder().namespace(INDEX_MODULE, \"/\").name(\"resolveGenericCustomEndpointsConfig\").build()\n                )\n                .servicePredicate((m, s) -> isExampleWeatherService(s))\n                .build(),\n            RuntimeClientPlugin.builder()\n                .withConventions(\n                    \"@smithy/core/endpoints\",\n                    TypeScriptDependency.SMITHY_CORE.dependency.getVersion(),\n                    \"Endpoint\",\n                    Convention.HAS_CONFIG\n                )\n                .servicePredicate((m, s) -> isExampleWeatherService(s))\n                .build()\n        );\n    }\n\n    @Override\n    public void customize(TypeScriptCodegenContext codegenContext) {\n        if (!codegenContext.settings().generateClient()) {\n            return;\n        }\n\n        if (!isExampleWeatherService(codegenContext.settings().getService())) {\n            return;\n        }\n\n        codegenContext\n            .writerDelegator()\n            .useFileWriter(INDEX_FILE, w -> {\n                w.write(\"export * from \\\"./customEndpoints\\\";\");\n            });\n\n        codegenContext\n            .writerDelegator()\n            .useFileWriter(ADD_CUSTOM_ENDPOINTS_FILE, w -> {\n                w.addTypeImport(\"Provider\", \"__Provider\", TypeScriptDependency.SMITHY_TYPES);\n                w.addImportSubmodule(\"normalizeProvider\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n                w.write(\n                    \"\"\"\n                    export interface GenericCustomEndpointsInputConfig {\n                      region?: string | __Provider<string>;\n                      endpointProvider?: any;\n                    }\n\n                    export interface GenericCustomEndpointsResolvedConfig {\n                      region: __Provider<string>;\n                      endpointProvider: any;\n                    }\n\n                    export const resolveGenericCustomEndpointsConfig = <T>(config: T & GenericCustomEndpointsInputConfig): \\\n                    T & GenericCustomEndpointsResolvedConfig => {\n                      return {\n                        ...config,\n                        endpointProvider: normalizeProvider(config.endpointProvider || \"www.amazon.com\"),\n                        region: normalizeProvider(config.region || \"us-west-2\"),\n                      };\n                    }\n                    \"\"\"\n                );\n            });\n    }\n\n    private static boolean isExampleWeatherService(ToShapeId toShapeId) {\n        return toShapeId.toShapeId().equals(EXAMPLE_WEATHER_SERVICE_ID);\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/example-weather-customizations/src/main/java/example/weather/SupportWeatherSigV4Auth.java",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\npackage example.weather;\n\nimport java.util.Optional;\nimport java.util.function.Consumer;\nimport software.amazon.smithy.codegen.core.Symbol;\nimport software.amazon.smithy.codegen.core.SymbolReference;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.typescript.codegen.ApplicationProtocol;\nimport software.amazon.smithy.typescript.codegen.LanguageTarget;\nimport software.amazon.smithy.typescript.codegen.SmithyCoreSubmodules;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptSettings;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.auth.http.ConfigField;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthOptionProperty;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthScheme;\nimport software.amazon.smithy.typescript.codegen.auth.http.HttpAuthSchemeParameter;\nimport software.amazon.smithy.typescript.codegen.auth.http.integration.HttpAuthTypeScriptIntegration;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n@SmithyInternalApi\npublic final class SupportWeatherSigV4Auth implements HttpAuthTypeScriptIntegration {\n\n    static final Symbol AWS_CREDENTIAL_IDENTITY = Symbol.builder()\n        .name(\"AwsCredentialIdentity\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .build();\n    static final Symbol AWS_CREDENTIAL_IDENTITY_PROVIDER = Symbol.builder()\n        .name(\"AwsCredentialIdentityProvider\")\n        .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n        .addDependency(TypeScriptDependency.SMITHY_TYPES)\n        .build();\n    static final ConfigField CREDENTIALS_CONFIG_FIELD = ConfigField.builder()\n        .name(\"credentials\")\n        .type(ConfigField.Type.MAIN)\n        .docs(w -> w.write(\"The credentials used to sign requests.\"))\n        .inputType(\n            Symbol.builder()\n                .name(\"AwsCredentialIdentity | AwsCredentialIdentityProvider\")\n                .addReference(AWS_CREDENTIAL_IDENTITY)\n                .addReference(AWS_CREDENTIAL_IDENTITY_PROVIDER)\n                .build()\n        )\n        .resolvedType(\n            Symbol.builder()\n                .name(\"AwsCredentialIdentityProvider\")\n                .addReference(AWS_CREDENTIAL_IDENTITY)\n                .addReference(AWS_CREDENTIAL_IDENTITY_PROVIDER)\n                .build()\n        )\n        .configFieldWriter(ConfigField::defaultMainConfigFieldWriter)\n        .build();\n    private static final Consumer<TypeScriptWriter> AWS_SIGV4_AUTH_SIGNER = w -> {\n        w.addDependency(TypeScriptDependency.EXPERIMENTAL_IDENTITY_AND_AUTH);\n        w.addImport(\"SigV4Signer\", null, TypeScriptDependency.EXPERIMENTAL_IDENTITY_AND_AUTH);\n        w.write(\"new SigV4Signer()\");\n    };\n    private static final SymbolReference PROVIDER = SymbolReference.builder()\n        .symbol(\n            Symbol.builder()\n                .name(\"Provider\")\n                .namespace(TypeScriptDependency.SMITHY_TYPES.getPackageName(), \"/\")\n                .addDependency(TypeScriptDependency.SMITHY_TYPES)\n                .build()\n        )\n        .alias(\"__Provider\")\n        .build();\n\n    @Override\n    public boolean matchesSettings(TypeScriptSettings settings) {\n        return !settings.useLegacyAuth();\n    }\n\n    @Override\n    public Optional<HttpAuthScheme> getHttpAuthScheme() {\n        return Optional.of(\n            HttpAuthScheme.builder()\n                .schemeId(ShapeId.from(\"aws.auth#sigv4\"))\n                .applicationProtocol(ApplicationProtocol.createDefaultHttpApplicationProtocol())\n                .putDefaultSigner(LanguageTarget.SHARED, AWS_SIGV4_AUTH_SIGNER)\n                .addConfigField(CREDENTIALS_CONFIG_FIELD)\n                .addConfigField(\n                    ConfigField.builder()\n                        .name(\"region\")\n                        .type(ConfigField.Type.AUXILIARY)\n                        .docs(w -> w.write(\"The AWS region to which this client will send requests.\"))\n                        .inputType(Symbol.builder().name(\"string | __Provider<string>\").addReference(PROVIDER).build())\n                        .resolvedType(Symbol.builder().name(\"__Provider<string>\").addReference(PROVIDER).build())\n                        .configFieldWriter(ConfigField::defaultAuxiliaryConfigFieldWriter)\n                        .build()\n                )\n                .addHttpAuthSchemeParameter(\n                    HttpAuthSchemeParameter.builder()\n                        .name(\"region\")\n                        .type(w -> w.write(\"string\"))\n                        .source(w -> {\n                            w.addDependency(TypeScriptDependency.SMITHY_CORE);\n                            w.addImportSubmodule(\"normalizeProvider\", null, TypeScriptDependency.SMITHY_CORE, SmithyCoreSubmodules.CLIENT);\n                            w.openBlock(\"await normalizeProvider(config.region)() || (() => {\", \"})()\", () -> {\n                                w.write(\n                                    \"throw new Error(\\\"expected `region` to be configured for `aws.auth#sigv4`\\\");\"\n                                );\n                            });\n                        })\n                        .build()\n                )\n                .addHttpAuthOptionProperty(\n                    HttpAuthOptionProperty.builder()\n                        .name(\"name\")\n                        .type(HttpAuthOptionProperty.Type.SIGNING)\n                        .source(\n                            s ->\n                                w -> {\n                                    w.write(\"$S\", s.trait().toNode().expectObjectNode().getMember(\"name\"));\n                                }\n                        )\n                        .build()\n                )\n                .addHttpAuthOptionProperty(\n                    HttpAuthOptionProperty.builder()\n                        .name(\"region\")\n                        .type(HttpAuthOptionProperty.Type.SIGNING)\n                        .source(\n                            t ->\n                                w -> {\n                                    w.write(\"authParameters.region\");\n                                }\n                        )\n                        .build()\n                )\n                .propertiesExtractor(\n                    s ->\n                        w ->\n                            w.write(\n                                \"\"\"\n                                (config, context) => {\n                                  return {\n                                    /**\n                                     * @internal\n                                     */\n                                    signingProperties: {\n                                      ...config,\n                                      ...context,\n                                    },\n                                  };\n                                },\"\"\"\n                            )\n                )\n                .build()\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/example-weather-customizations/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration",
    "content": "example.weather.ExampleWeatherCustomEndpointsRuntimeConfig\nexample.weather.SupportWeatherSigV4Auth\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/common/fakeAuth.smithy",
    "content": "$version: \"2.0\"\n\nnamespace common\n\n@trait\n@authDefinition\nstructure fakeAuth {}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/common/fakeProtocol.smithy",
    "content": "$version: \"2.0\"\n\nnamespace common\n\n@trait\n@protocolDefinition\nstructure fakeProtocol {}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/identity-and-auth/httpApiKeyAuth/HttpApiKeyAuthService.smithy",
    "content": "$version: \"2.0\"\n\nnamespace identity.auth.httpApiKeyAuth\n\nuse common#fakeProtocol\n\n@fakeProtocol\n@httpApiKeyAuth(scheme: \"ApiKey\", name: \"Authorization\", in: \"header\")\nservice HttpApiKeyAuthService {\n    operations: [\n        OnlyHttpApiKeyAuth\n        OnlyHttpApiKeyAuthOptional\n        SameAsService\n    ]\n}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpApiKeyAuth\")\n@auth([httpApiKeyAuth])\noperation OnlyHttpApiKeyAuth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpApiKeyAuthOptional\")\n@auth([httpApiKeyAuth])\n@optionalAuth\noperation OnlyHttpApiKeyAuthOptional {}\n\n@readonly\n@http(method: \"GET\", uri: \"/SameAsService\")\noperation SameAsService {}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/identity-and-auth/httpBearerAuth/HttpBearerAuthService.smithy",
    "content": "$version: \"2.0\"\n\nnamespace identity.auth.httpBearerAuth\n\nuse common#fakeProtocol\n\n@fakeProtocol\n@httpBearerAuth\nservice HttpBearerAuthService {\n    operations: [\n        OnlyHttpBearerAuth\n        OnlyHttpBearerAuthOptional\n        SameAsService\n    ]\n}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpBearerAuth\")\n@auth([httpBearerAuth])\noperation OnlyHttpBearerAuth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpBearerAuthOptional\")\n@auth([httpBearerAuth])\n@optionalAuth\noperation OnlyHttpBearerAuthOptional {}\n\n@readonly\n@http(method: \"GET\", uri: \"/SameAsService\")\noperation SameAsService {}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/weather/main.smithy",
    "content": "$version: \"2.0\"\n\nmetadata suppressions = [\n    {\n        id: \"UnstableTrait.smithy\"\n        namespace: \"example.weather\"\n        reason: \"Unstable traits are expected in test model, do not emit warning on them.\"\n    }\n]\n\nnamespace example.weather\n\nuse aws.auth#sigv4\nuse common#fakeAuth\nuse common#fakeProtocol\nuse smithy.test#httpRequestTests\nuse smithy.test#httpResponseTests\nuse smithy.waiters#waitable\n\n/// Provides weather forecasts.\n@fakeProtocol\n@httpApiKeyAuth(name: \"X-Api-Key\", in: \"header\")\n@httpBearerAuth\n@sigv4(name: \"weather\")\n@fakeAuth\n@auth([sigv4])\n@paginated(inputToken: \"nextToken\", outputToken: \"nextToken\", pageSize: \"pageSize\")\nservice Weather {\n    version: \"2006-03-01\"\n    resources: [\n        City\n    ]\n    operations: [\n        GetCurrentTime\n        // util-stream.integ.spec.ts\n        Invoke\n        // Identity and Auth\n        OnlyHttpApiKeyAuth\n        OnlyHttpApiKeyAuthOptional\n        OnlyHttpBearerAuth\n        OnlyHttpBearerAuthOptional\n        OnlyHttpApiKeyAndBearerAuth\n        OnlyHttpApiKeyAndBearerAuthReversed\n        OnlySigv4Auth\n        OnlySigv4AuthOptional\n        OnlyFakeAuth\n        OnlyFakeAuthOptional\n        SameAsService\n    ]\n}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpApiKeyAuth\")\n@auth([httpApiKeyAuth])\noperation OnlyHttpApiKeyAuth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpBearerAuth\")\n@auth([httpBearerAuth])\noperation OnlyHttpBearerAuth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlySigv4Auth\")\n@auth([sigv4])\noperation OnlySigv4Auth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpApiKeyAndBearerAuth\")\n@auth([httpApiKeyAuth, httpBearerAuth])\noperation OnlyHttpApiKeyAndBearerAuth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpApiKeyAndBearerAuthReversed\")\n@auth([httpBearerAuth, httpApiKeyAuth])\noperation OnlyHttpApiKeyAndBearerAuthReversed {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpApiKeyAuthOptional\")\n@auth([httpApiKeyAuth])\n@optionalAuth\noperation OnlyHttpApiKeyAuthOptional {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyHttpBearerAuthOptional\")\n@auth([httpBearerAuth])\n@optionalAuth\noperation OnlyHttpBearerAuthOptional {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlySigv4AuthOptional\")\n@auth([sigv4])\n@optionalAuth\noperation OnlySigv4AuthOptional {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyFakeAuth\")\n@auth([fakeAuth])\noperation OnlyFakeAuth {}\n\n@readonly\n@http(method: \"GET\", uri: \"/OnlyFakeAuthOptional\")\n@auth([fakeAuth])\n@optionalAuth\noperation OnlyFakeAuthOptional {}\n\n@readonly\n@http(method: \"GET\", uri: \"/SameAsService\")\noperation SameAsService {}\n\nresource City {\n    identifiers: {\n        cityId: CityId\n    }\n    create: CreateCity\n    read: GetCity\n    list: ListCities\n    resources: [\n        Forecast\n        CityImage\n    ]\n    operations: [\n        GetCityAnnouncements\n    ]\n}\n\nresource Forecast {\n    identifiers: {\n        cityId: CityId\n    }\n    read: GetForecast\n}\n\nresource CityImage {\n    identifiers: {\n        cityId: CityId\n    }\n    read: GetCityImage\n}\n\n// \"pattern\" is a trait.\n@pattern(\"^[A-Za-z0-9 ]+$\")\nstring CityId\n\n@readonly\n@http(method: \"GET\", uri: \"/cities/{cityId}\")\n@httpChecksumRequired\noperation GetCity {\n    input: GetCityInput\n    output: GetCityOutput\n    errors: [\n        NoSuchResource\n    ]\n}\n\n// Tests that HTTP protocol tests are generated.\napply GetCity @httpRequestTests([\n    {\n        id: \"WriteGetCityAssertions\"\n        documentation: \"Does something\"\n        protocol: \"common#fakeProtocol\"\n        method: \"GET\"\n        uri: \"/cities/123\"\n        body: \"\"\n        params: { cityId: \"123\" }\n    }\n])\n\napply GetCity @httpResponseTests([\n    {\n        id: \"WriteGetCityResponseAssertions\"\n        documentation: \"Does something\"\n        protocol: \"common#fakeProtocol\"\n        code: 200\n        body: \"\"\"\n            {\n            \"name\": \"Seattle\",\n            \"coordinates\": {\n            \"latitude\": 12.34,\n            \"longitude\": -56.78\n            },\n            \"city\": {\n            \"cityId\": \"123\",\n            \"name\": \"Seattle\",\n            \"number\": \"One\",\n            \"case\": \"Upper\"\n            }\n            }\"\"\"\n        bodyMediaType: \"application/json\"\n        params: {\n            name: \"Seattle\"\n            coordinates: { latitude: 12.34, longitude: -56.78 }\n            city: { cityId: \"123\", name: \"Seattle\", number: \"One\", case: \"Upper\" }\n        }\n    }\n])\n\n/// The input used to get a city.\nstructure GetCityInput {\n    // \"cityId\" provides the identifier for the resource and\n    // has to be marked as required.\n    @required\n    @httpLabel\n    cityId: CityId\n}\n\nstructure GetCityOutput {\n    // \"required\" is used on output to indicate if the service\n    // will always provide a value for the member.\n    @required\n    name: String\n\n    @required\n    coordinates: CityCoordinates\n\n    city: CitySummary\n}\n\n@idempotent\n@http(method: \"PUT\", uri: \"/city\")\noperation CreateCity {\n    input: CreateCityInput\n    output: CreateCityOutput\n}\n\nstructure CreateCityInput {\n    @required\n    name: String\n\n    @required\n    coordinates: CityCoordinates\n\n    city: CitySummary\n}\n\nstructure CreateCityOutput {\n    @required\n    cityId: CityId\n}\n\n// This structure is nested within GetCityOutput.\nstructure CityCoordinates {\n    @required\n    latitude: Float\n\n    @required\n    longitude: Float\n}\n\n/// Error encountered when no resource could be found.\n@error(\"client\")\n@httpError(404)\nstructure NoSuchResource {\n    /// The type of resource that was not found.\n    @required\n    resourceType: String\n\n    message: String\n}\n\napply NoSuchResource @httpResponseTests([\n    {\n        id: \"WriteNoSuchResourceAssertions\"\n        documentation: \"Does something\"\n        protocol: \"common#fakeProtocol\"\n        code: 404\n        body: \"\"\"\n            {\n            \"resourceType\": \"City\",\n            \"message\": \"Your custom message\"\n            }\"\"\"\n        bodyMediaType: \"application/json\"\n        params: { resourceType: \"City\", message: \"Your custom message\" }\n    }\n])\n\n// The paginated trait indicates that the operation may\n// return truncated results.\n@readonly\n@paginated(items: \"items\")\n@http(method: \"GET\", uri: \"/cities\")\n@waitable(\n    CitiesExist: {\n        acceptors: [\n            {\n                state: \"success\"\n                matcher: {\n                    output: { path: \"length(items[]) > `0`\", comparator: \"booleanEquals\", expected: \"true\" }\n                }\n            }\n            {\n                state: \"failure\"\n                matcher: { errorType: \"NoSuchResource\" }\n            }\n        ]\n    }\n)\noperation ListCities {\n    input: ListCitiesInput\n    output: ListCitiesOutput\n    errors: [\n        NoSuchResource\n    ]\n}\n\napply ListCities @httpRequestTests([\n    {\n        id: \"WriteListCitiesAssertions\"\n        documentation: \"Does something\"\n        protocol: \"common#fakeProtocol\"\n        method: \"GET\"\n        uri: \"/cities\"\n        body: \"\"\n        queryParams: [\"pageSize=50\"]\n        forbidQueryParams: [\"nextToken\"]\n        params: { pageSize: 50 }\n    }\n])\n\nstructure ListCitiesInput {\n    @httpQuery(\"nextToken\")\n    nextToken: String\n\n    @httpQuery(\"pageSize\")\n    pageSize: Integer\n}\n\nstructure ListCitiesOutput {\n    nextToken: String\n\n    @required\n    items: CitySummaries\n}\n\n// CitySummaries is a list of CitySummary structures.\nlist CitySummaries {\n    member: CitySummary\n}\n\n// CitySummary contains a reference to a City.\n@references([\n    {\n        resource: City\n    }\n])\nstructure CitySummary {\n    @required\n    cityId: CityId\n\n    @required\n    name: String\n\n    number: String\n\n    case: String\n}\n\n@readonly\n@http(method: \"GET\", uri: \"/current-time\")\noperation GetCurrentTime {\n    output: GetCurrentTimeOutput\n}\n\nstructure GetCurrentTimeOutput {\n    @required\n    time: Timestamp\n}\n\n@http(method: \"POST\", uri: \"/invoke\", code: 200)\noperation Invoke {\n    input: InvokeInput\n    output: InvokeOutput\n}\n\nstructure InvokeInput {\n    @httpPayload\n    payload: Blob\n}\n\nstructure InvokeOutput {\n    @httpPayload\n    payload: Blob\n}\n\n@readonly\n@http(method: \"GET\", uri: \"/cities/{cityId}/forecast\")\noperation GetForecast {\n    input: GetForecastInput\n    output: GetForecastOutput\n}\n\n// \"cityId\" provides the only identifier for the resource since\n// a Forecast doesn't have its own.\nstructure GetForecastInput {\n    @required\n    @httpLabel\n    cityId: CityId\n}\n\nstructure GetForecastOutput {\n    chanceOfRain: Float\n    precipitation: Precipitation\n}\n\nunion Precipitation {\n    rain: PrimitiveBoolean\n    sleet: PrimitiveBoolean\n    hail: StringMap\n    snow: SimpleYesNo\n    mixed: TypedYesNo\n    other: OtherStructure\n    blob: Blob\n    foo: example.weather.nested#Foo\n    baz: example.weather.nested.more#Baz\n}\n\nstructure OtherStructure {}\n\nenum SimpleYesNo {\n    YES\n    NO\n}\n\nenum TypedYesNo {\n    YES = \"YES\"\n    NO = \"NO\"\n}\n\nmap StringMap {\n    key: String\n    value: String\n}\n\n@readonly\n@http(method: \"GET\", uri: \"/cities/{cityId}/image\")\noperation GetCityImage {\n    input: GetCityImageInput\n    output: GetCityImageOutput\n    errors: [\n        NoSuchResource\n    ]\n}\n\nstructure GetCityImageInput {\n    @required\n    @httpLabel\n    cityId: CityId\n}\n\nstructure GetCityImageOutput {\n    @httpPayload\n    @required\n    image: CityImageData\n}\n\n@streaming\nblob CityImageData\n\n@readonly\n@http(method: \"GET\", uri: \"/cities/{cityId}/announcements\")\n@tags([\"client-only\"])\noperation GetCityAnnouncements {\n    input: GetCityAnnouncementsInput\n    output: GetCityAnnouncementsOutput\n    errors: [\n        NoSuchResource\n    ]\n}\n\nstructure GetCityAnnouncementsInput {\n    @required\n    @httpLabel\n    cityId: CityId\n}\n\nstructure GetCityAnnouncementsOutput {\n    @httpHeader(\"x-last-updated\")\n    lastUpdated: Timestamp\n\n    @httpPayload\n    announcements: Announcements\n}\n\n@streaming\nunion Announcements {\n    police: Message\n    fire: Message\n    health: Message\n}\n\nstructure Message {\n    message: String\n    author: String\n}\n\napply Weather @smithy.rules#endpointRuleSet({\n    version: \"1.3\"\n    parameters: {\n        Region: { required: true, type: \"String\", documentation: \"docs\" }\n        endpoint: { required: false, type: \"String\", documentation: \"docs\" }\n    }\n    rules: [\n        {\n            conditions: [\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"endpoint\"\n                        }\n                    ]\n                }\n            ]\n            endpoint: {\n                url: { ref: \"endpoint\" }\n            }\n            type: \"endpoint\"\n        }\n        {\n            conditions: []\n            error: \"(default endpointRuleSet) endpoint is not set - you must configure an endpoint.\"\n            type: \"error\"\n        }\n    ]\n})\n\napply Weather @smithy.rules#clientContextParams(\n    Region: { type: \"string\", documentation: \"docs\" }\n    endpoint: { type: \"string\", documentation: \"docs\" }\n)\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/weather/more-nesting.smithy",
    "content": "$version: \"2.0\"\n\nnamespace example.weather.nested.more\n\nstructure Baz {\n    baz: String\n    bar: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/model/weather/nested.smithy",
    "content": "$version: \"2.0\"\n\nnamespace example.weather.nested\n\nstructure Foo {\n    baz: String\n    bar: String\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/released-version-test/build.gradle.kts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// TODO(released-version-test): Test released version of smithy-typescript codegenerators, but currently is extremely flaky\n/*\nplugins {\n    java\n    id(\"software.amazon.smithy.gradle.smithy-base\")\n}\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    val smithyVersion: String by project\n\n    smithyBuild(\"software.amazon.smithy.typescript:smithy-typescript-codegen:0.20.1!!\")\n    smithyBuild(\"software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.20.1!!\")\n    smithyBuild(project(\":smithy-typescript-codegen-test:example-weather-customizations\"))\n\n    // Explicitly configure for CLI version\n    smithyBuild(\"software.amazon.smithy:smithy-model:$smithyVersion\")\n\n    // Includes example model so must be runtime dependency\n    implementation(project(\":smithy-typescript-codegen-test\"))\n}\n\ntasks[\"jar\"].enabled = false\n*/"
  },
  {
    "path": "smithy-typescript-codegen-test/released-version-test/smithy-build.json",
    "content": "{\n    \"version\": \"1.0\",\n    \"plugins\": {\n        \"typescript-codegen\": {\n            \"service\": \"example.weather#Weather\",\n            \"package\": \"weather\",\n            \"packageVersion\": \"0.0.1\",\n            \"packageJson\": {\n                \"license\": \"Apache-2.0\",\n                \"private\": true\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-codegen-test/smithy-build.json",
    "content": "{\n    \"version\": \"1.0\",\n    \"projections\": {\n        \"ssdk-test\": {\n            \"transforms\": [\n                {\n                    \"name\": \"excludeShapesByTag\",\n                    \"args\": {\n                        \"tags\": [\"client-only\"]\n                    }\n                },\n                {\n                    \"name\": \"includeServices\",\n                    \"args\": {\n                        \"services\": [\"example.weather#Weather\"]\n                    }\n                }\n            ],\n            \"plugins\": {\n                \"typescript-server-codegen\": {\n                    \"service\": \"example.weather#Weather\",\n                    \"package\": \"weather-ssdk\",\n                    \"packageVersion\": \"0.0.1\",\n                    \"packageJson\": {\n                        \"license\": \"Apache-2.0\",\n                        \"private\": true\n                    },\n                    \"disableDefaultValidation\": true\n                }\n            }\n        },\n        \"client-identity-and-auth\": {\n            \"transforms\": [\n                {\n                    \"name\": \"includeServices\",\n                    \"args\": {\n                        \"services\": [\"example.weather#Weather\"]\n                    }\n                }\n            ],\n            \"plugins\": {\n                \"typescript-client-codegen\": {\n                    \"service\": \"example.weather#Weather\",\n                    \"package\": \"weather\",\n                    \"packageVersion\": \"0.0.1\",\n                    \"packageJson\": {\n                        \"license\": \"Apache-2.0\",\n                        \"private\": true\n                    }\n                }\n            }\n        },\n        \"client-legacy-auth\": {\n            \"transforms\": [\n                {\n                    \"name\": \"includeServices\",\n                    \"args\": {\n                        \"services\": [\"example.weather#Weather\"]\n                    }\n                }\n            ],\n            \"plugins\": {\n                \"typescript-client-codegen\": {\n                    \"service\": \"example.weather#Weather\",\n                    \"package\": \"@smithy/weather-legacy-auth\",\n                    \"packageVersion\": \"0.0.1\",\n                    \"packageJson\": {\n                        \"license\": \"Apache-2.0\",\n                        \"private\": true\n                    },\n                    \"useLegacyAuth\": true\n                }\n            }\n        },\n        \"identity-and-auth-http-api-key-auth\": {\n            \"transforms\": [\n                {\n                    \"name\": \"includeServices\",\n                    \"args\": {\n                        \"services\": [\"identity.auth.httpApiKeyAuth#HttpApiKeyAuthService\"]\n                    }\n                }\n            ],\n            \"plugins\": {\n                \"typescript-client-codegen\": {\n                    \"service\": \"identity.auth.httpApiKeyAuth#HttpApiKeyAuthService\",\n                    \"package\": \"@smithy/identity-and-auth-http-api-key-auth-service\",\n                    \"packageVersion\": \"0.0.1\",\n                    \"packageJson\": {\n                        \"license\": \"Apache-2.0\",\n                        \"private\": true\n                    }\n                }\n            }\n        },\n        \"identity-and-auth-http-bearer-auth\": {\n            \"transforms\": [\n                {\n                    \"name\": \"includeServices\",\n                    \"args\": {\n                        \"services\": [\"identity.auth.httpBearerAuth#HttpBearerAuthService\"]\n                    }\n                }\n            ],\n            \"plugins\": {\n                \"typescript-client-codegen\": {\n                    \"service\": \"identity.auth.httpBearerAuth#HttpBearerAuthService\",\n                    \"package\": \"@smithy/identity-and-auth-http-bearer-auth-service\",\n                    \"packageVersion\": \"0.0.1\",\n                    \"packageJson\": {\n                        \"license\": \"Apache-2.0\",\n                        \"private\": true\n                    }\n                }\n            }\n        }\n    },\n    \"plugins\": {\n        \"typescript-client-codegen\": {\n            \"service\": \"example.weather#Weather\",\n            \"package\": \"weather\",\n            \"packageVersion\": \"0.0.1\",\n            \"packageJson\": {\n                \"license\": \"Apache-2.0\",\n                \"private\": true\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-protocol-test-codegen/build.gradle.kts",
    "content": "import software.amazon.smithy.gradle.tasks.SmithyBuildTask\n\nval smithyVersion: String by project\n\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n\nbuildscript {\n    val smithyVersion: String by project\n    dependencies {\n        classpath(\"software.amazon.smithy:smithy-cli:$smithyVersion\")\n    }\n}\n\nplugins {\n    `java-library`\n\n    val smithyGradleVersion: String by project\n    id(\"software.amazon.smithy.gradle.smithy-base\").version(smithyGradleVersion)\n}\n\ndependencies {\n    implementation(\"software.amazon.smithy:smithy-protocol-tests:$smithyVersion\")\n    implementation(project(\":smithy-typescript-codegen\"))\n}\n\nval buildSdk = tasks.register<SmithyBuildTask>(\"buildSdk\") {\n    models.set(files(\"model/\"))\n    smithyBuildConfigs.set(files(\"smithy-build.json\"))\n}\n\n// Run the `buildSdk` automatically.\ntasks[\"build\"].finalizedBy(buildSdk)\n\ntasks.register<Sync>(\"copyOutput\") {\n    into(layout.buildDirectory.dir(\"model\"))\n    from(buildSdk.map { it.getPluginProjectionDirectory(\"source\", \"model\") })\n}"
  },
  {
    "path": "smithy-typescript-protocol-test-codegen/model/my-local-model/HttpLabelCommand.smithy",
    "content": "$version: \"2.0\"\n\nnamespace org.xyz.secondary\n\nuse smithy.protocols#rpcv2Cbor\nuse smithy.test#httpResponseTests\n\n@httpResponseTests([\n    {\n        id: \"HttpLabelCommandExample\"\n        protocol: rpcv2Cbor\n        code: 200\n        headers: { \"smithy-protocol\": \"rpc-v2-cbor\" }\n    }\n])\n@http(method: \"POST\", uri: \"/{LabelDoesNotApplyToRpcProtocol}\", code: 200)\noperation HttpLabelCommand {\n    input := {\n        @httpLabel\n        @required\n        LabelDoesNotApplyToRpcProtocol: String\n    }\n\n    output := {}\n}\n"
  },
  {
    "path": "smithy-typescript-protocol-test-codegen/model/my-local-model/main.smithy",
    "content": "$version: \"2.0\"\n\nmetadata suppressions = [\n    {\n        id: \"UnstableTrait\"\n        namespace: \"*\"\n        reason: \"noisy\"\n    }\n]\n"
  },
  {
    "path": "smithy-typescript-protocol-test-codegen/model/my-local-model/my-local-model.smithy",
    "content": "$version: \"2.0\"\n\nnamespace org.xyz.v1\n\nuse org.xyz.secondary#HttpLabelCommand\nuse smithy.protocols#rpcv2Cbor\nuse smithy.rules#clientContextParams\nuse smithy.rules#contextParam\nuse smithy.rules#endpointRuleSet\nuse smithy.test#httpRequestTests\nuse smithy.test#httpResponseTests\nuse smithy.waiters#waitable\n\n@rpcv2Cbor\n@documentation(\"xyz interfaces\")\n@httpApiKeyAuth(name: \"X-Api-Key\", in: \"header\")\n@clientContextParams(\n    customParam: { type: \"string\", documentation: \"Custom parameter\" }\n    region: { type: \"string\", documentation: \"Conflicting with built-in region\" }\n    enableFeature: { type: \"boolean\", documentation: \"Feature toggle flag\" }\n    debugMode: { type: \"boolean\", documentation: \"Debug mode flag\" }\n    nonConflictingParam: { type: \"string\", documentation: \"Non-conflicting parameter\" }\n    logger: { type: \"string\", documentation: \"Conflicting logger parameter\" }\n    ApiKey: { type: \"string\", documentation: \"ApiKey\" }\n)\n@endpointRuleSet({\n    version: \"1.0\"\n    parameters: {\n        endpoint: { builtIn: \"SDK::Endpoint\", documentation: \"The endpoint used to send the request.\", type: \"string\" }\n        ApiKey: { required: false, documentation: \"ApiKey\", type: \"string\" }\n        region: { type: \"string\", required: false, documentation: \"AWS region\" }\n        customParam: { type: \"string\", required: true, default: \"default-custom-value\", documentation: \"Custom parameter for testing\" }\n        enableFeature: { type: \"boolean\", required: true, default: true, documentation: \"Feature toggle with default\" }\n        debugMode: { type: \"boolean\", required: true, default: false, documentation: \"Debug mode with default\" }\n        nonConflictingParam: { type: \"string\", required: true, default: \"non-conflict-default\", documentation: \"Non-conflicting with default\" }\n        logger: { type: \"string\", required: true, default: \"default-logger\", documentation: \"Conflicting logger with default\" }\n        CustomHeaderValue: { type: \"string\", required: false, documentation: \"Value to send as x-custom-header\" }\n    }\n    rules: [\n        {\n            conditions: [\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"endpoint\"\n                        }\n                    ]\n                }\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"ApiKey\"\n                        }\n                    ]\n                }\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"CustomHeaderValue\"\n                        }\n                    ]\n                }\n            ]\n            endpoint: {\n                url: \"{endpoint}\"\n                properties: {}\n                headers: {\n                    \"x-api-key\": [\"{ApiKey}\"]\n                    \"x-custom-header\": [\"{CustomHeaderValue}\"]\n                }\n            }\n            type: \"endpoint\"\n        }\n        {\n            conditions: [\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"endpoint\"\n                        }\n                    ]\n                }\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"ApiKey\"\n                        }\n                    ]\n                }\n            ]\n            endpoint: {\n                url: \"{endpoint}\"\n                properties: {}\n                headers: {\n                    \"x-api-key\": [\"{ApiKey}\"]\n                }\n            }\n            type: \"endpoint\"\n        }\n        {\n            conditions: [\n                {\n                    fn: \"isSet\"\n                    argv: [\n                        {\n                            ref: \"endpoint\"\n                        }\n                    ]\n                }\n            ]\n            endpoint: {\n                url: \"{endpoint}\"\n                properties: {}\n                headers: {}\n            }\n            type: \"endpoint\"\n        }\n        {\n            conditions: []\n            error: \"endpoint is not set - you must configure an endpoint.\"\n            type: \"error\"\n        }\n    ]\n})\nservice XYZService {\n    version: \"1.0\"\n    operations: [\n        GetNumbers\n        TradeEventStream\n        camelCaseOperation\n        HttpLabelCommand\n    ]\n    errors: [\n        MainServiceLinkedError\n    ]\n}\n\n@error(\"client\")\n@httpError(400)\nstructure MainServiceLinkedError {}\n\n@waitable(\n    NumbersAligned: {\n        documentation: \"wait until the numbers align\"\n        acceptors: [\n            {\n                state: \"success\"\n                matcher: { success: true }\n            }\n            {\n                state: \"retry\"\n                matcher: { errorType: \"MysteryThrottlingError\" }\n            }\n            {\n                state: \"failure\"\n                matcher: { errorType: \"HaltError\" }\n            }\n        ]\n    }\n    NumbersMisaligned: {\n        documentation: \"wait until the numbers don't align\"\n        acceptors: [\n            {\n                state: \"retry\"\n                matcher: { success: true }\n            }\n            {\n                state: \"success\"\n                matcher: { errorType: \"HaltError\" }\n            }\n        ]\n    }\n    NumbersWhatDoTheyDoAnyway: {\n        documentation: \"wait until the numbers align or don't align\"\n        acceptors: [\n            {\n                state: \"success\"\n                matcher: { success: true }\n            }\n            {\n                state: \"success\"\n                matcher: { errorType: \"HaltError\" }\n            }\n        ]\n    }\n)\n@paginated(inputToken: \"startToken\", outputToken: \"nextToken\", pageSize: \"maxResults\", items: \"numbers\")\n@readonly\n@httpRequestTests([\n    {\n        id: \"GetNumbersRequestExample\"\n        protocol: \"smithy.protocols#rpcv2Cbor\"\n        method: \"POST\"\n        uri: \"/service/XYZService/operation/GetNumbers\"\n        tags: [\"serde-benchmark\"]\n    }\n    {\n        id: \"EndpointResolvedHeadersApplied\"\n        protocol: \"smithy.protocols#rpcv2Cbor\"\n        method: \"POST\"\n        uri: \"/service/XYZService/operation/GetNumbers\"\n        params: { customHeaderInput: \"test-custom-value\" }\n        headers: { \"x-custom-header\": \"test-custom-value\" }\n    }\n])\n@httpResponseTests([\n    {\n        id: \"GetNumbersResponseExample\"\n        protocol: \"smithy.protocols#rpcv2Cbor\"\n        code: 200\n        headers: { \"smithy-protocol\": \"rpc-v2-cbor\" }\n        tags: [\"serde-benchmark\"]\n    }\n])\n@http(method: \"POST\", uri: \"/get-numbers\", code: 200)\noperation GetNumbers {\n    input: GetNumbersRequest\n    output: GetNumbersResponse\n    errors: [\n        CodedThrottlingError\n        MysteryThrottlingError\n        RetryableError\n        HaltError\n        XYZServiceServiceException\n    ]\n}\n\n@input\nstructure GetNumbersRequest {\n    bigDecimal: BigDecimal\n\n    bigInteger: BigInteger\n\n    @documentation(\"This is deprecated documentation annotation\")\n    @deprecated\n    fieldWithoutMessage: String\n\n    @documentation(\"This is deprecated documentation annotation\")\n    @deprecated(message: \"This field has been deprecated\", since: \"3.0\")\n    fieldWithMessage: String\n\n    startToken: String\n\n    maxResults: Integer\n\n    @contextParam(name: \"CustomHeaderValue\")\n    customHeaderInput: String\n\n    numbers: IntegerMap\n\n    sparseNumbers: SparseIntegerMap\n}\n\n@output\nstructure GetNumbersResponse {\n    bigDecimal: BigDecimal\n\n    bigInteger: BigInteger\n\n    numbers: IntegerList\n\n    sparseNumbers: SparseIntegerList\n\n    nextToken: String\n\n    @documentation(\"This is deprecated documentation annotation\")\n    @deprecated(message: \"these numbers are not used anymore\", since: \"1685-12-31\")\n    deprecatedNumbers: IntegerList\n\n    @documentation(\"This is deprecated documentation annotation\")\n    @deprecated(since: \"1685-12-31\")\n    deprecatedNumbersWithoutExplanation: IntegerList\n\n    @deprecated(message: \"these numbers are not used anymore??\")\n    deprecatedNumbersWithoutChronology: IntegerList\n\n    @deprecated\n    inexplicablyDeprecatedNumbers: IntegerList\n}\n\nlist IntegerList {\n    member: Integer\n}\n\n@sparse\nlist SparseIntegerList {\n    member: Integer\n}\n\nmap IntegerMap {\n    key: String\n    value: Integer\n}\n\n@sparse\nmap SparseIntegerMap {\n    key: String\n    value: Integer\n}\n\n@error(\"client\")\n@retryable(throttling: true)\n@httpError(429)\nstructure CodedThrottlingError {}\n\n@error(\"client\")\n@retryable(throttling: true)\nstructure MysteryThrottlingError {}\n\n@error(\"client\")\n@retryable\nstructure RetryableError {\n    message: String\n}\n\n@error(\"client\")\nstructure HaltError {\n    message: String\n}\n\n@error(\"client\")\nstructure XYZServiceServiceException {}\n\n@http(method: \"POST\", uri: \"/trade-event-stream\", code: 200)\noperation TradeEventStream {\n    input: TradeEventStreamRequest\n    output: TradeEventStreamResponse\n}\n\nstructure TradeEventStreamRequest {\n    eventStream: TradeEvents\n}\n\nstructure TradeEventStreamResponse {\n    eventStream: TradeEvents\n}\n\n@streaming\nunion TradeEvents {\n    alpha: Alpha\n    beta: Unit\n    gamma: Unit\n    delta: DifferentShapeName\n}\n\nstructure Alpha {\n    id: String\n    timestamp: Timestamp\n}\n\n// this tests that the event stream member associated with it\n// generates using :event-type: delta rather than :event-type: DifferentShapeName.\nstructure DifferentShapeName {\n    name: String\n    number: Integer\n}\n\n@rpcv2Cbor\n@documentation(\"a second service in the same model, unused.\")\nservice UnusedService {\n    version: \"1.0\"\n    operations: [\n        UnusedOperation\n    ]\n    errors: [\n        UnusedServiceLinkedError\n    ]\n}\n\n@http(method: \"POST\", uri: \"/unused\", code: 200)\noperation UnusedOperation {\n    input: Unit\n    output: Unit\n    errors: [\n        UnusedServiceOperationLinkedError\n    ]\n}\n\n@error(\"client\")\n@httpError(400)\nstructure UnusedServiceOperationLinkedError {}\n\n@error(\"client\")\n@httpError(400)\nstructure UnusedServiceLinkedError {}\n\n@error(\"client\")\n@httpError(400)\nstructure CompletelyUnlinkedError {}\n\n@paginated(inputToken: \"token\", outputToken: \"token\", items: \"results\")\n@readonly\n@http(method: \"POST\", uri: \"/camel-case\", code: 200)\noperation camelCaseOperation {\n    input := {\n        token: String\n    }\n    output := {\n        token: String\n        results: Blobs\n    }\n}\n\nlist Blobs {\n    member: Blob\n}\n"
  },
  {
    "path": "smithy-typescript-protocol-test-codegen/model/my-local-model/secondary.smithy",
    "content": "$version: \"2.0\"\n\nnamespace org.xyz.secondary\n\nuse smithy.protocols#rpcv2Cbor\n\n@rpcv2Cbor\n@documentation(\"a second service in the same model, unused.\")\nservice TertiaryService {\n    version: \"1.0\"\n    operations: [\n        TertiaryUnusedOperation\n    ]\n    errors: [\n        TertiaryUnusedServiceLinkedError\n    ]\n}\n\noperation TertiaryUnusedOperation {\n    input: Unit\n    output: Unit\n    errors: [\n        TertiaryUnusedServiceOperationLinkedError\n    ]\n}\n\n@error(\"client\")\n@httpError(400)\nstructure TertiaryUnusedServiceOperationLinkedError {}\n\n@error(\"client\")\n@httpError(400)\nstructure TertiaryUnusedServiceLinkedError {}\n\n@error(\"client\")\n@httpError(400)\nstructure TertiaryCompletelyUnlinkedError {}\n"
  },
  {
    "path": "smithy-typescript-protocol-test-codegen/smithy-build.json",
    "content": "{\n  \"version\": \"1.0\",\n  \"projections\": {\n    \"smithy-rpcv2-cbor\": {\n      \"transforms\": [\n        {\n          \"name\": \"includeServices\",\n          \"args\": {\n            \"services\": [\"smithy.protocoltests.rpcv2Cbor#RpcV2Protocol\"]\n          }\n        }\n      ],\n      \"plugins\": {\n        \"typescript-codegen\": {\n          \"package\": \"@smithy/smithy-rpcv2-cbor\",\n          \"packageManager\": \"npm\",\n          \"packageVersion\": \"1.0.0-alpha.1\",\n          \"packageJson\": {\n            \"author\": {\n              \"name\": \"Smithy team\",\n              \"url\": \"https://smithy.io/\"\n            },\n            \"scripts\": {\n              \"merged\": \"echo \\\"this is merged from user configuration.\\\"\"\n            },\n            \"license\": \"Apache-2.0\"\n          },\n          \"private\": true,\n          \"generateSchemas\": false,\n          \"generateIndexTests\": true\n        }\n      }\n    },\n    \"smithy-rpcv2-cbor-schema\": {\n      \"transforms\": [\n        {\n          \"name\": \"includeServices\",\n          \"args\": {\n            \"services\": [\"smithy.protocoltests.rpcv2Cbor#RpcV2Protocol\"]\n          }\n        }\n      ],\n      \"plugins\": {\n        \"typescript-codegen\": {\n          \"package\": \"@smithy/smithy-rpcv2-cbor-schema\",\n          \"packageManager\": \"npm\",\n          \"packageVersion\": \"1.0.0-alpha.1\",\n          \"packageJson\": {\n            \"author\": {\n              \"name\": \"Smithy team\",\n              \"url\": \"https://smithy.io/\"\n            },\n            \"scripts\": {},\n            \"license\": \"Apache-2.0\"\n          },\n          \"private\": true,\n          \"generateSchemas\": true,\n          \"generateIndexTests\": true,\n          \"generateSnapshotTests\": true\n        }\n      }\n    },\n    \"my-local-model\": {\n      \"transforms\": [\n        {\n          \"name\": \"includeServices\",\n          \"args\": {\n            \"services\": [\"org.xyz.v1#XYZService\", \"org.xyz.v1#UnusedService\", \"org.xyz.secondary#TertiaryService\"]\n          }\n        }\n      ],\n      \"plugins\": {\n        \"typescript-client-codegen\": {\n          \"service\": \"org.xyz.v1#XYZService\",\n          \"package\": \"xyz\",\n          \"packageManager\": \"npm\",\n          \"packageVersion\": \"0.0.1\",\n          \"versioningScheme\": \"@smithy/core\",\n          \"packageJson\": {\n            \"private\": true\n          },\n          \"bigNumberMode\": \"native\",\n          \"generateSchemas\": false\n        }\n      }\n    },\n    \"my-local-model-schema\": {\n      \"transforms\": [\n        {\n          \"name\": \"includeServices\",\n          \"args\": {\n            \"services\": [\"org.xyz.v1#XYZService\", \"org.xyz.v1#UnusedService\", \"org.xyz.secondary#TertiaryService\"]\n          }\n        }\n      ],\n      \"plugins\": {\n        \"typescript-client-codegen\": {\n          \"service\": \"org.xyz.v1#XYZService\",\n          \"package\": \"xyz-schema\",\n          \"packageManager\": \"npm\",\n          \"packageVersion\": \"0.0.1\",\n          \"versioningScheme\": \"@aws-sdk/client\",\n          \"packageJson\": {\n            \"private\": true\n          },\n          \"bigNumberMode\": \"native\",\n          \"generateSchemas\": true,\n          \"generateIndexTests\": true,\n          \"generateSnapshotTests\": true,\n          \"generateEndpointBdd\": true\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-codegen-test-utils/build.gradle.kts",
    "content": "extra[\"displayName\"] = \"Smithy :: Typescript :: SSDK :: Codegen :: Test :: Utils\"\nextra[\"moduleName\"] = \"software.amazon.smithy.typescript.ssdk.codegen.test.utils\"\n\nplugins {\n    `java-library`\n}\n\nrepositories {\n    mavenLocal()\n    mavenCentral()\n}\n\ndependencies {\n    implementation(project(\":smithy-typescript-codegen\"))\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-codegen-test-utils/src/main/java/software/amazon/smithy/typescript/ssdk/codegen/test/utils/AddProtocols.java",
    "content": "package software.amazon.smithy.typescript.ssdk.codegen.test.utils;\n\nimport java.util.List;\nimport software.amazon.smithy.typescript.codegen.integration.ProtocolGenerator;\nimport software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;\nimport software.amazon.smithy.utils.ListUtils;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Adds fake protocols.\n */\n@SmithyInternalApi\npublic class AddProtocols implements TypeScriptIntegration {\n\n    @Override\n    public List<ProtocolGenerator> getProtocolGenerators() {\n        return ListUtils.of(new TestProtocolGenerator());\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-codegen-test-utils/src/main/java/software/amazon/smithy/typescript/ssdk/codegen/test/utils/TestProtocolGenerator.java",
    "content": "package software.amazon.smithy.typescript.ssdk.codegen.test.utils;\n\nimport java.util.List;\nimport java.util.Set;\nimport software.amazon.smithy.model.knowledge.HttpBinding;\nimport software.amazon.smithy.model.shapes.OperationShape;\nimport software.amazon.smithy.model.shapes.Shape;\nimport software.amazon.smithy.model.shapes.ShapeId;\nimport software.amazon.smithy.model.shapes.StructureShape;\nimport software.amazon.smithy.model.traits.TimestampFormatTrait.Format;\nimport software.amazon.smithy.typescript.codegen.TypeScriptDependency;\nimport software.amazon.smithy.typescript.codegen.TypeScriptWriter;\nimport software.amazon.smithy.typescript.codegen.integration.HttpBindingProtocolGenerator;\nimport software.amazon.smithy.utils.SmithyInternalApi;\n\n/**\n * Protocol for SSDK codegen testing.\n */\n@SmithyInternalApi\nclass TestProtocolGenerator extends HttpBindingProtocolGenerator {\n\n    TestProtocolGenerator() {\n        super(true);\n    }\n\n    @Override\n    public ShapeId getProtocol() {\n        return ShapeId.from(\"common#fakeProtocol\");\n    }\n\n    @Override\n    public String getName() {\n        return \"fakeProtocol\";\n    }\n\n    @Override\n    protected String getDocumentContentType() {\n        return \"application/json\";\n    }\n\n    @Override\n    public Format getDocumentTimestampFormat() {\n        return Format.EPOCH_SECONDS;\n    }\n\n    @Override\n    public boolean requiresNumericEpochSecondsInPayload() {\n        return true;\n    }\n\n    @Override\n    public boolean enableSerdeElision() {\n        return true;\n    }\n\n    @Override\n    public void deserializeErrorDocumentBody(\n        GenerationContext context,\n        StructureShape error,\n        List<HttpBinding> documentBindings\n    ) {}\n\n    @Override\n    public void serializeErrorDocumentBody(\n        GenerationContext context,\n        StructureShape error,\n        List<HttpBinding> documentBindings\n    ) {}\n\n    @Override\n    public void deserializeInputDocumentBody(\n        GenerationContext context,\n        OperationShape operation,\n        List<HttpBinding> documentBindings\n    ) {}\n\n    @Override\n    public void serializeInputDocumentBody(\n        GenerationContext context,\n        OperationShape operation,\n        List<HttpBinding> documentBindings\n    ) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.write(\"body = \\\"{}\\\"\");\n    }\n\n    @Override\n    public void deserializeOutputDocumentBody(\n        GenerationContext context,\n        OperationShape error,\n        List<HttpBinding> documentBindings\n    ) {}\n\n    @Override\n    public void serializeOutputDocumentBody(\n        GenerationContext context,\n        OperationShape error,\n        List<HttpBinding> documentBindings\n    ) {}\n\n    @Override\n    public void serializeInputEventDocumentPayload(GenerationContext context) {}\n\n    @Override\n    public void generateDocumentBodyShapeSerializers(GenerationContext context, Set<Shape> shapes) {}\n\n    @Override\n    public void generateDocumentBodyShapeDeserializers(GenerationContext context, Set<Shape> shapes) {}\n\n    @Override\n    public void writeErrorCodeParser(GenerationContext context) {\n        TypeScriptWriter writer = context.getWriter();\n        writer.write(\"const errorCode = parseErrorCode(output, parsedOutput.body);\");\n    }\n\n    @Override\n    public void generateProtocolTests(GenerationContext context) {}\n\n    @Override\n    public void generateSharedComponents(GenerationContext context) {\n        super.generateSharedComponents(context);\n\n        TypeScriptWriter writer = context.getWriter();\n\n        // Include a JSON body parser used to deserialize documents from HTTP responses.\n        writer.addImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\n            \"const parseBody = (streamBody: any, context: __SerdeContext): \" +\n                \"any => collectBodyString(streamBody, context).then(encoded => {\",\n            \"});\",\n            () -> {\n                writer.openBlock(\"if (encoded.length) {\", \"}\", () -> {\n                    writer.write(\"return JSON.parse(encoded);\");\n                });\n                writer.write(\"return {};\");\n            }\n        );\n        writer.write(\"\");\n\n        // Include a JSON body parser.\n        writer.addImport(\"SerdeContext\", \"__SerdeContext\", TypeScriptDependency.SMITHY_TYPES);\n        writer.openBlock(\"const parseErrorBody = async (errorBody: any, context: __SerdeContext) => {\", \"}\", () -> {\n            writer.write(\"const value = await parseBody(errorBody, context);\");\n            writer.write(\"value.message = value.message ?? value.Message;\");\n            writer.write(\"return value;\");\n        });\n        writer.write(\"\");\n\n        // Include an error code parser.\n        writer.openBlock(\n            \"const parseErrorCode = (output: __HttpResponse, data: any): string | undefined => {\",\n            \"}\",\n            () -> {\n                writer.openBlock(\"if (output.headers[\\\"x-error\\\"]) {\", \"}\", () -> {\n                    writer.write(\"return output.headers[\\\"x-error\\\"];\");\n                });\n                writer.openBlock(\"if (data.code !== undefined) {\", \"}\", () -> {\n                    writer.write(\"return data.code;\");\n                });\n            }\n        );\n    }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-codegen-test-utils/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration",
    "content": "software.amazon.smithy.typescript.ssdk.codegen.test.utils.AddProtocols\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/README.md",
    "content": "# Smithy Typescript Server SDK Libraries\n\nThese libraries support the use of the Smithy TypeScript Server SDKs.\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\nsrc/*.js\ndist/\ntypes/\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/.npmignore",
    "content": "/coverage/\ntsconfig.test.json\n*.tsbuildinfo\njest.config.js\n\n*.spec.js\n*.spec.ts\n*.spec.d.ts\n*.spec.js.map\n\n*.mock.js\n*.mock.d.ts\n*.mock.js.map\n\n*.fixture.js\n*.fixture.d.ts\n*.fixture.js.map\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/CHANGELOG.md",
    "content": "# server-apigateway Changelog\n\n## 1.0.0-alpha.10 (2023-04-18)\n\n## 1.0.0-alpha.9 (2023-03-16)\n\n### Other\n\n- Upgraded to Yarn 3. ([#705](https://github.com/awslabs/smithy-typescript/pull/705))\n\n## 1.0.0-alpha.8 (2023-02-09)\n\n### Features\n\n- Generated ES module distributions. ([#686](https://github.com/awslabs/smithy-typescript/pull/686))\n\n## 1.0.0-alpha.7 (2023-01-25)\n\n## 1.0.0-alpha.6 (2022-08-22)\n\n### Features\n\n- Used Record type in place of Object in SSDK libs. ([#558](https://github.com/awslabs/smithy-typescript/pull/558))\n- Updated shelljs, minimist dependencies. ([#497](https://github.com/awslabs/smithy-typescript/pull/497), [#529](https://github.com/awslabs/smithy-typescript/pull/529))\n- Updated SDK dependencies.\n\n## 1.0.0-alpha.5 (2022-02-23)\n\n### Features\n\n- Updated SDK dependencies.\n\n### Other\n\n- Converted from lerna to turborepo. ([#506](https://github.com/awslabs/smithy-typescript/pull/506))\n\n## 1.0.0-alpha.4 (2022-01-03)\n\n### Features\n\n- Updated SDK dependencies.\n\n## 1.0.0-alpha.3 (2021-11-03)\n\n### Features\n\n- Update SDK dependencies\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/LICENSE",
    "content": "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 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "smithy-typescript-ssdk-libs/server-apigateway/README.md",
    "content": "# smithy-typescript/server-apigateway\n\nThis package provides glue code to enable using a server sdk inside of\napigateway.\n\n## Usage\n\n### Example\n\n```typescript\nimport { convertEvent, convertResponse } from \"@aws-smithy/server-apigateway\";\nimport {\n  SayHelloInput,\n  SayHelloOutput,\n  GreetingService as __GreetingService,\n  getGreetingServiceHandler,\n} from \"@greeting-service/service-greeting\";\nimport { HttpRequest } from \"@smithy/protocol-http\";\nimport { APIGatewayProxyEventV2, APIGatewayProxyHandlerV2, APIGatewayProxyResultV2 } from \"aws-lambda\";\n\nclass GreetingService implements __GreetingService {\n  SayHello(input: SayHelloInput, request: HttpRequest): SayHelloOutput {\n    return {\n      greeting: `Hello ${input.name}! How is ${input.city}?`,\n    };\n  }\n}\nconst serviceHandler = getGreetingServiceHandler(new GreetingService());\nexport const lambdaHandler: APIGatewayProxyHandlerV2 = async (\n  event: APIGatewayProxyEventV2\n): Promise<APIGatewayProxyResultV2> => {\n  console.log(`Received event: ${JSON.stringify(event)}`);\n\n  // Convert apigateway's lambda event to an HttpRequest.\n  const convertedEvent = convertEvent(event);\n\n  // Call the service handler, which will route the request to the GreetingService\n  // implementation and then serialize the response to an HttpResponse.\n  let rawResponse = await serviceHandler.handle(convertedEvent);\n\n  // Convert the HttpResponse to apigateway's expected format.\n  const convertedResponse = convertResponse(rawResponse);\n  console.log(`Returning response: ${JSON.stringify(convertedResponse)}`);\n  return convertedResponse;\n};\n```\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/jest.config.js",
    "content": "const base = require(\"../../jest.config.base.js\");\n\nmodule.exports = {\n  preset: \"ts-jest\",\n  ...base,\n};\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/package.json",
    "content": "{\n  \"name\": \"@aws-smithy/server-apigateway\",\n  \"version\": \"1.0.0-alpha.10\",\n  \"description\": \"Base components for Smithy services behind APIGateway\",\n  \"main\": \"./dist/cjs/index.js\",\n  \"module\": \"./dist/es/index.js\",\n  \"types\": \"./dist/types/index.d.ts\",\n  \"scripts\": {\n    \"prepublishOnly\": \"yarn build\",\n    \"pretest\": \"yarn build\",\n    \"build\": \"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"postbuild\": \"premove dist/types/ts3.4 && downlevel-dts dist/types dist/types/ts3.4\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"jest --passWithNoTests\",\n    \"clean\": \"premove dist\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"smithy-typescript-ssdk-libs/server-apigateway\"\n  },\n  \"author\": \"AWS Smithy Team\",\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"@smithy/protocol-http\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"@types/aws-lambda\": \"^8.10.72\",\n    \"tslib\": \"^1.8.0\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"^0.7.0\",\n    \"jest\": \"29.7.0\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\"\n  },\n  \"files\": [\n    \"dist/cjs/**/*.js\",\n    \"dist/es/**/*.js\",\n    \"dist/types/**/*.d.ts\",\n    \"!**/*.spec.*\"\n  ],\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.0\": {\n      \"dist/types/*\": [\n        \"dist/types/ts3.4/*\"\n      ]\n    }\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript/issues\"\n  },\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript#readme\",\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/src/index.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nexport * from \"./lambda\";\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/src/lambda.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport { Readable } from \"node:stream\";\nimport { HttpRequest, type HeaderBag, type HttpResponse } from \"@smithy/protocol-http\";\nimport type { QueryParameterBag } from \"@smithy/types\";\nimport type {\n  APIGatewayProxyEvent,\n  APIGatewayProxyEventHeaders,\n  APIGatewayProxyEventMultiValueHeaders,\n  APIGatewayProxyEventMultiValueQueryStringParameters,\n  APIGatewayProxyEventQueryStringParameters,\n  APIGatewayProxyEventV2,\n  APIGatewayProxyResult,\n  APIGatewayProxyResultV2,\n} from \"aws-lambda\";\n\nexport function convertEvent(event: APIGatewayProxyEvent): HttpRequest;\nexport function convertEvent(event: APIGatewayProxyEventV2): HttpRequest;\n\nexport function convertEvent(event: APIGatewayProxyEvent | APIGatewayProxyEventV2): HttpRequest {\n  if (isV2Event(event)) {\n    return convertV2Event(event);\n  } else {\n    return convertV1Event(event);\n  }\n}\n\nfunction convertV1Event(event: APIGatewayProxyEvent): HttpRequest {\n  return new HttpRequest({\n    method: event.httpMethod,\n    headers: convertMultiValueHeaders(event.multiValueHeaders),\n    query: convertMultiValueQueryStringParameters(event.multiValueQueryStringParameters),\n    path: event.path,\n    ...(event.body ? { body: Readable.from(Buffer.from(event.body, event.isBase64Encoded ? \"base64\" : \"utf8\")) } : {}),\n  });\n}\n\nfunction convertV2Event(event: APIGatewayProxyEventV2): HttpRequest {\n  return new HttpRequest({\n    method: event.requestContext.http.method,\n    headers: convertHeaders(event.headers),\n    query: convertQuery(event.queryStringParameters),\n    path: event.rawPath,\n    ...(event.body ? { body: Readable.from(Buffer.from(event.body, event.isBase64Encoded ? \"base64\" : \"utf8\")) } : {}),\n  });\n}\n\nexport const convertVersion2Response = convertResponse;\nexport function convertResponse(response: HttpResponse): APIGatewayProxyResultV2 {\n  return {\n    statusCode: response.statusCode,\n    headers: response.headers,\n    body: response.body,\n    isBase64Encoded: false,\n  };\n}\n\nexport function convertVersion1Response(response: HttpResponse): APIGatewayProxyResult {\n  return {\n    statusCode: response.statusCode,\n    multiValueHeaders: convertResponseHeaders(response.headers),\n    body: response.body,\n    isBase64Encoded: false,\n  };\n}\nfunction convertResponseHeaders(headers: HeaderBag) {\n  const retVal: Record<string, string[]> = {};\n  for (const [key, val] of Object.entries(headers)) {\n    retVal[key] = val.split(\",\").map((v) => v.trim());\n  }\n  return retVal;\n}\n\nfunction isV2Event(event: APIGatewayProxyEvent | APIGatewayProxyEventV2): event is APIGatewayProxyEventV2 {\n  return hasVersion(event) && event.version === \"2.0\";\n}\n\nfunction hasVersion(event: any): event is Record<\"version\", string> {\n  return event.hasOwnProperty(\"version\");\n}\n\nfunction convertMultiValueHeaders(multiValueHeaders: APIGatewayProxyEventMultiValueHeaders | null) {\n  const retVal: Record<string, string> = {};\n\n  if (multiValueHeaders === null) {\n    return retVal;\n  }\n\n  for (const [key, val] of Object.entries(multiValueHeaders)) {\n    if (val !== undefined) {\n      retVal[key] = val.join(\", \");\n    }\n  }\n\n  return retVal;\n}\n\n// TODO: this can be rewritten with arrow functions / Object.fromEntries / filter\n// but first we need to split up generated client and servers so we can have different\n// language version targets.\nfunction convertHeaders(headers: APIGatewayProxyEventHeaders): HeaderBag {\n  const retVal: Record<string, string> = {};\n\n  for (const [key, val] of Object.entries(headers)) {\n    if (val !== undefined) {\n      retVal[key] = val;\n    }\n  }\n\n  return retVal;\n}\n\nfunction convertMultiValueQueryStringParameters(params: APIGatewayProxyEventMultiValueQueryStringParameters | null) {\n  if (params === undefined || params === null) {\n    return undefined;\n  }\n\n  const retVal: Record<string, string[]> = {};\n\n  for (const [key, val] of Object.entries(params)) {\n    if (val !== undefined) {\n      retVal[key] = val;\n    }\n  }\n\n  return retVal;\n}\n\n// TODO: this can be rewritten with arrow functions / Object.fromEntries / filter\nfunction convertQuery(params: APIGatewayProxyEventQueryStringParameters | undefined): QueryParameterBag | undefined {\n  if (params === undefined) {\n    return undefined;\n  }\n\n  const retVal: { [key: string]: string | string[] } = {};\n\n  for (const [key, val] of Object.entries(params)) {\n    if (val !== undefined) {\n      if (val.indexOf(\",\") !== -1) {\n        retVal[key] = val;\n      } else {\n        retVal[key] = val.split(\",\");\n      }\n    }\n  }\n\n  return retVal;\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist/cjs\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"module\": \"ESNext\",\n    \"outDir\": \"dist/es\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"stripInternal\": true,\n    \"removeComments\": true,\n    \"rootDir\": \"src\",\n    \"baseUrl\": \".\"\n  },\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-apigateway/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist/types\",\n    \"emitDeclarationOnly\": true\n  },\n  \"exclude\": [\"test/**/*\", \"dist/types/**/*\"]\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\nsrc/*.js\ndist/\ntypes/\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/.npmignore",
    "content": "/coverage/\ntsconfig.test.json\n*.tsbuildinfo\njest.config.js\n\n*.spec.js\n*.spec.ts\n*.spec.d.ts\n*.spec.js.map\n\n*.mock.js\n*.mock.d.ts\n*.mock.js.map\n\n*.fixture.js\n*.fixture.d.ts\n*.fixture.js.map\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/CHANGELOG.md",
    "content": "# server-common Changelog\n\n## 1.0.0-alpha.10 (2023-04-18)\n\n### Bug Fixes\n\n- Fix `uniqueItems` validation not to throw when undefined values are nested inside a list of objects.\n\n## 1.0.0-alpha.9 (2023-03-16)\n\n### Features\n\n- Updated validation messages to remove user input values and internal enum values. ([#695](https://github.com/awslabs/smithy-typescript/pull/695), [#704](https://github.com/awslabs/smithy-typescript/pull/704), [#713](https://github.com/awslabs/smithy-typescript/pull/713))\n\n### Other\n\n- Upgraded to Yarn 3. ([#705](https://github.com/awslabs/smithy-typescript/pull/705))\n\n## 1.0.0-alpha.8 (2023-02-09)\n\n### Features\n\n- Generated ES module distributions. ([#685](https://github.com/awslabs/smithy-typescript/pull/685))\n- Used re2 `test()` instead of `match()`. ([#680](https://github.com/awslabs/smithy-typescript/pull/680))\n\n## 1.0.0-alpha.7 (2023-01-25)\n\n### Features\n\n- Added intEnum validator. ([#654](https://github.com/awslabs/smithy-typescript/pull/654))\n\n## 1.0.0-alpha.6 (2022-08-22)\n\n### Features\n\n- Used Record type in place of Object in SSDK libs. ([#558](https://github.com/awslabs/smithy-typescript/pull/558))\n- Updated shelljs, minimist dependencies. ([#497](https://github.com/awslabs/smithy-typescript/pull/497), [#529](https://github.com/awslabs/smithy-typescript/pull/529))\n- Updated SDK dependencies.\n\n## 1.0.0-alpha.5 (2022-02-23)\n\n### Features\n\n- Defined ServiceException as base class for service side exception. ([#502](https://github.com/awslabs/smithy-typescript/pull/502))\n- Updated SDK dependencies.\n\n### Bug Fixes\n\n- Fix the uniqueItems implementation to accommodate non-primitive values. ([#511](https://github.com/awslabs/smithy-typescript/pull/511))\n- Fixed the implementation of length validation for strings. ([#510](https://github.com/awslabs/smithy-typescript/pull/510))\n\n### Other\n\n- Converted from lerna to turborepo. ([#506](https://github.com/awslabs/smithy-typescript/pull/506))\n\n## 1.0.0-alpha.4 (2022-01-03)\n\n### Features\n\n- Switched to re2-wasm for pattern validation. ([467](https://github.com/awslabs/smithy-typescript/pull/467))\n- Updated SDK dependencies.\n\n### Bug Fixes\n\n- Fixed greedy label matching. ([474](https://github.com/awslabs/smithy-typescript/pull/474))\n\n## 1.0.0-alpha.3 (2021-11-03)\n\n### Features\n\n- Switch to re2 for pattern validation ([451](https://github.com/awslabs/smithy-typescript/pull/451))\n- Add a helper function for parsing Accept headers ([431](https://github.com/awslabs/smithy-typescript/pull/431))\n- Update SDK dependencies ([439](https://github.com/awslabs/smithy-typescript/pull/439))\n\n### Bug Fixes\n\n- Fix query matching against list query values ([450](https://github.com/awslabs/smithy-typescript/pull/450))\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/LICENSE",
    "content": "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 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "smithy-typescript-ssdk-libs/server-common/README.md",
    "content": "# smithy-typescript/server-common\n\nThis library provides common interfaces and utilities needed for building a\nserver sdk.\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/jest.config.js",
    "content": "const base = require(\"../../jest.config.base.js\");\n\nmodule.exports = {\n  preset: \"ts-jest\",\n  ...base,\n};\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/package.json",
    "content": "{\n  \"name\": \"@aws-smithy/server-common\",\n  \"version\": \"1.0.0-alpha.10\",\n  \"description\": \"Base components for Smithy services\",\n  \"main\": \"./dist/cjs/index.js\",\n  \"module\": \"./dist/es/index.js\",\n  \"types\": \"./dist/types/index.d.ts\",\n  \"scripts\": {\n    \"prepublishOnly\": \"yarn build\",\n    \"pretest\": \"yarn build\",\n    \"build\": \"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"postbuild\": \"premove dist/types/ts3.4 && downlevel-dts dist/types dist/types/ts3.4\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"jest\",\n    \"clean\": \"premove dist\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"smithy-typescript-libs/smithy-server-common\"\n  },\n  \"author\": \"AWS Smithy Team\",\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"@smithy/protocol-http\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"re2-wasm\": \"^1.0.2\",\n    \"tslib\": \"^1.8.0\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"^0.7.0\",\n    \"jest\": \"29.7.0\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\"\n  },\n  \"files\": [\n    \"dist/cjs/**/*.js\",\n    \"dist/es/**/*.js\",\n    \"dist/types/**/*.d.ts\",\n    \"!**/*.spec.*\"\n  ],\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.0\": {\n      \"dist/types/*\": [\n        \"dist/types/ts3.4/*\"\n      ]\n    }\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript/issues\"\n  },\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript#readme\",\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/accept.spec.ts",
    "content": "import { acceptMatches } from \"./accept\";\n\ndescribe(\"acceptMatches\", () => {\n  it.each([null, undefined, \"*/*\"])(\"always returns true for %s\", (value) => {\n    expect(acceptMatches(value, \"text/plain\")).toEqual(true);\n  });\n\n  it(\"handles explicit matches\", () => {\n    expect(acceptMatches(\"text/plain\", \"text/plain\")).toEqual(true);\n    expect(acceptMatches(\"text/plain; q=5\", \"text/plain\")).toEqual(true);\n  });\n\n  it(\"handles wildcard subtypes\", () => {\n    expect(acceptMatches(\"text/*\", \"text/plain\")).toEqual(true);\n    expect(acceptMatches(\"text/*; q=5\", \"text/plain\")).toEqual(true);\n  });\n\n  it(\"handles multiple acceptable values\", () => {\n    expect(acceptMatches(\"application/json, text/plain; q=5\", \"text/plain\")).toEqual(true);\n    expect(acceptMatches(\"application/json, text/*; q=5\", \"text/plain\")).toEqual(true);\n    expect(acceptMatches(\"application/json, text/xml; q=5, */*\", \"text/plain\")).toEqual(true);\n  });\n\n  it.each([\"application/*\", \"application/json\", \"application/*; q=5; text/xml\"])(\n    \"does not match text/plain to %s\",\n    (value) => {\n      expect(acceptMatches(value, \"text/plain\")).toEqual(false);\n    }\n  );\n});\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/accept.ts",
    "content": "/**\n * A function for matching the 'Accept' header to an explicit MIME type.\n *\n * @param acceptHeader the header as specified by the caller\n * @param responseContentType the content type that we expect to return\n * @return true if the specified content-type is acceptable given the Accept value\n */\nexport const acceptMatches = (acceptHeader: string | null | undefined, responseContentType: string): boolean => {\n  if (acceptHeader === null || acceptHeader === undefined) {\n    return true;\n  }\n\n  // see: https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2\n  // we only care if anything in Accept matches a content-type we want to respond with,\n  // so we disregard all of the accept-params\n  const acceptableContentTypes = acceptHeader.split(\",\").map((s) => s.split(\";\")[0].trim());\n  const responsePrimaryType = responseContentType.split(\"/\")[0];\n\n  for (const type of acceptableContentTypes) {\n    if (type === \"*/*\" || type === `${responsePrimaryType}/*` || type === responseContentType) {\n      return true;\n    }\n  }\n\n  return false;\n};\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/errors.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nexport class ServiceException extends Error {\n  /**\n   * Whether the client or server are at fault.\n   */\n  readonly $fault: \"client\" | \"server\";\n\n  constructor(options: { name: string; $fault: \"client\" | \"server\"; message?: string }) {\n    super(options.message);\n    Object.setPrototypeOf(this, ServiceException.prototype);\n    this.name = options.name;\n    this.$fault = options.$fault;\n  }\n}\n\nexport type SmithyFrameworkException =\n  | InternalFailureException\n  | UnknownOperationException\n  | SerializationException\n  | UnsupportedMediaTypeException\n  | NotAcceptableException;\n\nexport const isFrameworkException = (error: any): error is SmithyFrameworkException => {\n  if (!error.hasOwnProperty(\"$frameworkError\")) {\n    return false;\n  }\n  return error.$frameworkError;\n};\n\nexport class InternalFailureException {\n  readonly name = \"InternalFailure\";\n  readonly $fault = \"server\";\n  readonly statusCode = 500;\n  readonly $frameworkError = true;\n}\n\nexport class UnknownOperationException {\n  readonly name = \"UnknownOperationException\";\n  readonly $fault = \"client\";\n  readonly statusCode = 404;\n  readonly $frameworkError = true;\n}\n\nexport class SerializationException {\n  readonly name = \"SerializationException\";\n  readonly $fault = \"client\";\n  readonly statusCode = 400;\n  readonly $frameworkError = true;\n}\n\nexport class UnsupportedMediaTypeException {\n  readonly name = \"UnsupportedMediaTypeException\";\n  readonly $fault = \"client\";\n  readonly statusCode = 415;\n  readonly $frameworkError = true;\n}\n\nexport class NotAcceptableException {\n  readonly name = \"NotAcceptableException\";\n  readonly $fault = \"client\";\n  readonly statusCode = 406;\n  readonly $frameworkError = true;\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/httpbinding/index.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nexport * from \"./mux\";\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/httpbinding/mux.spec.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport { HttpRequest } from \"@smithy/protocol-http\";\n\nimport { HttpBindingMux, UriSpec } from \".\";\n\ndescribe(\"simple matching\", () => {\n  const router = new HttpBindingMux<\n    \"Test\",\n    \"A\" | \"LessSpecificA\" | \"Greedy\" | \"MiddleGreedy\" | \"Delete\" | \"QueryKeyOnly\"\n  >([\n    new UriSpec(\"GET\", [{ type: \"path_literal\", value: \"a\" }, { type: \"path\" }, { type: \"path\" }], [], {\n      service: \"Test\",\n      operation: \"A\",\n    }),\n    new UriSpec(\"GET\", [{ type: \"path_literal\", value: \"a\" }, { type: \"path\" }, { type: \"greedy\" }], [], {\n      service: \"Test\",\n      operation: \"LessSpecificA\",\n    }),\n    new UriSpec(\"GET\", [{ type: \"path_literal\", value: \"greedy\" }, { type: \"greedy\" }], [], {\n      service: \"Test\",\n      operation: \"Greedy\",\n    }),\n    new UriSpec(\n      \"GET\",\n      [\n        { type: \"path_literal\", value: \"mg\" },\n        { type: \"greedy\" },\n        { type: \"path_literal\", value: \"y\" },\n        { type: \"path_literal\", value: \"z\" },\n      ],\n      [],\n      { service: \"Test\", operation: \"MiddleGreedy\" }\n    ),\n    new UriSpec(\n      \"DELETE\",\n      [],\n      [\n        { type: \"query_literal\", key: \"foo\", value: \"bar\" },\n        { type: \"query\", key: \"baz\" },\n      ],\n      { service: \"Test\", operation: \"Delete\" }\n    ),\n    new UriSpec(\"GET\", [{ type: \"path_literal\", value: \"query_key_only\" }], [{ type: \"query_literal\", key: \"foo\" }], {\n      service: \"Test\",\n      operation: \"QueryKeyOnly\",\n    }),\n  ]);\n\n  const matches: { [idx: string]: HttpRequest[] } = {\n    \"Test#LessSpecificA\": [\n      new HttpRequest({ method: \"GET\", path: \"/a/b/c/d\" }),\n      new HttpRequest({ method: \"GET\", path: \"/a/b/c/d/e\" }),\n    ],\n    \"Test#A\": [\n      new HttpRequest({ method: \"GET\", path: \"/a/b/c\" }),\n      new HttpRequest({ method: \"GET\", path: \"/a/b/c/\" }),\n      new HttpRequest({ method: \"GET\", path: \"/a/b/c\", query: { abc: \"def\" } }),\n      new HttpRequest({ method: \"GET\", path: \"/a/b/c\", query: { abc: null } }),\n    ],\n    \"Test#Greedy\": [\n      new HttpRequest({ method: \"GET\", path: \"/greedy/a/b/c/d\" }),\n      new HttpRequest({ method: \"GET\", path: \"/greedy/a/b/c/d\", query: { abc: \"def\" } }),\n    ],\n    \"Test#MiddleGreedy\": [\n      new HttpRequest({ method: \"GET\", path: \"/mg/a/y/z\" }),\n      new HttpRequest({ method: \"GET\", path: \"/mg/a/b/c/d/y/z\", query: { abc: \"def\" } }),\n      new HttpRequest({ method: \"GET\", path: \"/mg/a/b/y/c/d/y/z\", query: { abc: \"def\" } }),\n      new HttpRequest({ method: \"GET\", path: \"/mg/a/b/y/z/d/y/z\", query: { abc: \"def\" } }),\n    ],\n    \"Test#Delete\": [\n      new HttpRequest({ method: \"DELETE\", path: \"/\", query: { foo: \"bar\", baz: \"quux\" } }),\n      new HttpRequest({ method: \"DELETE\", path: \"/\", query: { foo: [\"bar\"], baz: \"quux\" } }),\n      new HttpRequest({ method: \"DELETE\", path: \"/\", query: { foo: [\"bar\", \"corge\"], baz: \"quux\" } }),\n      new HttpRequest({ method: \"DELETE\", path: \"/\", query: { foo: \"bar\", baz: \"quux\" } }),\n      new HttpRequest({ method: \"DELETE\", path: \"/\", query: { foo: \"bar\", baz: null } }),\n      new HttpRequest({ method: \"DELETE\", path: \"\", query: { foo: \"bar\", baz: [\"quux\", \"grault\"] } }),\n    ],\n    \"Test#QueryKeyOnly\": [\n      new HttpRequest({ method: \"GET\", path: \"/query_key_only\", query: { foo: \"bar\" } }),\n      new HttpRequest({ method: \"GET\", path: \"/query_key_only\", query: { foo: null } }),\n      new HttpRequest({ method: \"GET\", path: \"/query_key_only\", query: { foo: \"\" } }),\n      // this is actually what /query_key_only?foo will look like behind APIGateway\n      new HttpRequest({ method: \"GET\", path: \"/query_key_only\", query: { foo: [\"\"] } }),\n    ],\n  };\n\n  const misses = [\n    new HttpRequest({ method: \"POST\", path: \"/a/b/c\" }),\n    new HttpRequest({ method: \"PUT\", path: \"/a/b/c\" }),\n    new HttpRequest({ method: \"PATCH\", path: \"/a/b/c\" }),\n    new HttpRequest({ method: \"OPTIONS\", path: \"/a/b/c\" }),\n    new HttpRequest({ method: \"GET\", path: \"/a\" }),\n    new HttpRequest({ method: \"GET\", path: \"/a/b\" }),\n    new HttpRequest({ method: \"GET\", path: \"/greedy\" }),\n    new HttpRequest({ method: \"GET\", path: \"/greedy/\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/q\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/z\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/y/z\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/a/z\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/a/y/z/a\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/a/y/a\" }),\n    new HttpRequest({ method: \"GET\", path: \"/mg/a/b/z/c\" }),\n    new HttpRequest({ method: \"DELETE\", path: \"/\", query: { foo: \"bar\" } }),\n    new HttpRequest({ method: \"DELETE\", path: \"/\", query: { baz: \"quux\" } }),\n    new HttpRequest({ method: \"DELETE\", path: \"/\" }),\n  ];\n\n  for (const key in matches) {\n    const reqs = matches[key];\n    for (const req of reqs) {\n      it(`should match ${JSON.stringify(req)} to ${key}`, () => {\n        expect(router.match(req)).toEqual({ service: key.split(\"#\")[0], operation: key.split(\"#\")[1] });\n      });\n    }\n  }\n\n  for (const req of misses) {\n    it(`should not match ${JSON.stringify(req)} to anything`, () => {\n      expect(router.match(req)).toBeUndefined();\n    });\n  }\n});\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/httpbinding/mux.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport type { HttpRequest } from \"@smithy/protocol-http\";\n\nimport type { Mux, ServiceCoordinate } from \"..\";\n\nexport interface PathLiteralSegment {\n  type: \"path_literal\";\n  value: string;\n}\n\nexport interface PathLabelSegment {\n  type: \"path\";\n}\n\nexport interface GreedySegment {\n  type: \"greedy\";\n}\n\nexport interface QueryLiteralSegment {\n  type: \"query_literal\";\n  key: string;\n  value?: string;\n}\n\nexport interface QuerySegment {\n  type: \"query\";\n  key: string;\n}\nexport class UriSpec<S extends string, O extends string> {\n  private readonly method: string;\n  private readonly pathSegments: (PathLiteralSegment | PathLabelSegment | GreedySegment)[];\n  private readonly querySegments: (QueryLiteralSegment | QuerySegment)[];\n  readonly rank: number;\n  readonly target: ServiceCoordinate<S, O>;\n\n  constructor(\n    method: string,\n    pathSegments: (PathLiteralSegment | PathLabelSegment | GreedySegment)[],\n    querySegments: (QueryLiteralSegment | QuerySegment)[],\n    target: ServiceCoordinate<S, O>\n  ) {\n    this.method = method;\n    this.pathSegments = pathSegments;\n    this.querySegments = querySegments;\n    this.rank = this.pathSegments.length + this.querySegments.length;\n    this.target = target;\n  }\n\n  private matchesSegment(\n    requestSegment: string,\n    segment: PathLiteralSegment | PathLabelSegment | GreedySegment\n  ): boolean {\n    if (segment.type === \"path_literal\" && requestSegment !== segment.value) {\n      return false;\n    }\n    return true;\n  }\n\n  match(req: HttpRequest): boolean {\n    if (req.method !== this.method) {\n      return false;\n    }\n\n    const requestPathSegments = req.path.split(\"/\").filter((s) => s.length > 0);\n\n    let requestPathIdx = 0;\n    for (let i = 0; i < this.pathSegments.length; i++) {\n      if (requestPathIdx === requestPathSegments.length) {\n        // there are more pathSegments but we have reached the end of the requestPath\n        return false;\n      }\n      const pathSegment = this.pathSegments[i];\n      if (pathSegment.type === \"path_literal\" && pathSegment.value !== requestPathSegments[requestPathIdx]) {\n        return false;\n      }\n      if (pathSegment.type === \"greedy\") {\n        // greedy labels match greedily, and a greedy label cannot be followed by another greedy label\n        // so just consume as many segments as needed to leave an equal number of segments\n        // at the end of the request path as we have segments in the pattern\n        const remainingSegments = this.pathSegments.length - i - 1;\n        const newRequestPathIdx = requestPathSegments.length - remainingSegments;\n        if (requestPathIdx === newRequestPathIdx) {\n          // greedy labels must consume at least one segment\n          return false;\n        }\n        requestPathIdx = newRequestPathIdx;\n      } else {\n        requestPathIdx++;\n      }\n    }\n\n    if (requestPathIdx < requestPathSegments.length) {\n      // we reached the end of our defined path segments without reaching the end of the request path\n      return false;\n    }\n\n    if (this.querySegments.length === 0) {\n      return true;\n    }\n\n    if (!req.query) {\n      return false;\n    }\n\n    for (const querySegment of this.querySegments) {\n      if (!(querySegment.key in req.query)) {\n        return false;\n      }\n      if (querySegment.type === \"query_literal\") {\n        const input_query_value = req.query[querySegment.key];\n        if (Array.isArray(input_query_value)) {\n          if (querySegment.value && !input_query_value.includes(querySegment.value)) {\n            return false;\n          }\n        } else if (querySegment.value && querySegment.value !== input_query_value) {\n          return false;\n        }\n      }\n    }\n    return true;\n  }\n}\n\nexport class HttpBindingMux<S extends string, O extends string> implements Mux<S, O> {\n  private readonly specs: UriSpec<S, O>[];\n\n  constructor(inputSpecs: UriSpec<S, O>[]) {\n    this.specs = inputSpecs.sort((s1, s2) => s2.rank - s1.rank);\n  }\n\n  match(req: HttpRequest): ServiceCoordinate<S, O> | undefined {\n    return this.specs.find((s) => s.match(req))?.target;\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/index.ts",
    "content": "import type { HttpRequest, HttpResponse } from \"@smithy/protocol-http\";\nimport type { SerdeContext } from \"@smithy/types\";\n\nimport type { ServiceException } from \"./errors\";\n\n/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nexport * as httpbinding from \"./httpbinding\";\nexport * from \"./accept\";\nexport * from \"./errors\";\nexport * from \"./validation\";\nexport * from \"./unique\";\n\nexport type Operation<I, O, Context = {}> = (input: I, context: Context) => Promise<O>;\n\nexport type OperationInput<T> = T extends Operation<infer I, any, any> ? I : never;\nexport type OperationOutput<T> = T extends Operation<any, infer O, any> ? O : never;\n\nexport interface OperationSerializer<T, K extends keyof T, E extends ServiceException> {\n  serialize(input: OperationOutput<T[K]>, ctx: ServerSerdeContext): Promise<HttpResponse>;\n  deserialize(input: HttpRequest, ctx: SerdeContext): Promise<OperationInput<T[K]>>;\n  isOperationError(error: any): error is E;\n  serializeError(error: E, ctx: ServerSerdeContext): Promise<HttpResponse>;\n}\n\nexport interface ServiceHandler<Context = {}, RequestType = HttpRequest, ResponseType = HttpResponse> {\n  handle(request: RequestType, context: Context): Promise<ResponseType>;\n}\n\nexport interface ServiceCoordinate<S extends string, O extends string> {\n  readonly service: S;\n  readonly operation: O;\n}\nexport interface Mux<S extends string, O extends string> {\n  match(req: HttpRequest): ServiceCoordinate<S, O> | undefined;\n}\n\nexport interface ServerSerdeContext extends Omit<SerdeContext, \"endpoint\"> {}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/unique.spec.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport * as util from \"node:util\";\n\nimport { findDuplicates, type Input } from \"./unique\";\n\ndescribe(\"findDuplicates\", () => {\n  describe(\"finds duplicates in\", () => {\n    it(\"strings\", () => {\n      expect(findDuplicates([\"a\", \"b\", \"c\", \"a\", \"b\", \"a\"])).toEqual([\"a\", \"b\"]);\n      expect(findDuplicates([\"x\", \"y\", \"z\", \"a\", \"b\", \"c\", \"a\", \"b\"])).toEqual([\"a\", \"b\"]);\n    });\n    it(\"numbers\", () => {\n      expect(findDuplicates([1, 2, 3, 4, 1, 2])).toEqual([1, 2]);\n    });\n    it(\"booleans\", () => {\n      expect(findDuplicates([true, false, true])).toEqual([true]);\n    });\n    it(\"arrays\", () => {\n      expect(\n        findDuplicates([\n          [5, 6],\n          [2, 3],\n          [1, 2],\n          [3, 4],\n          [1, 2],\n        ])\n      ).toEqual([[1, 2]]);\n    });\n    it(\"Dates\", () => {\n      expect(findDuplicates([new Date(1000), new Date(2000), new Date(1000)])).toEqual([new Date(1000)]);\n    });\n    it(\"Blobs\", () => {\n      expect(findDuplicates([Uint8Array.of(1, 2, 3), Uint8Array.of(4, 5, 6), Uint8Array.of(4, 5, 6)])).toEqual([\n        Uint8Array.of(4, 5, 6),\n      ]);\n    });\n    it(\"nulls\", () => {\n      expect(findDuplicates([null, 1, null])).toEqual([null]);\n    });\n    it(\"undefineds\", () => {\n      const arr: Array<any> = [undefined, 1, undefined];\n      expect(findDuplicates(arr)).toEqual([undefined]);\n    });\n    it(\"objects\", () => {\n      expect(findDuplicates([{ a: \"b\" }, { b: [1, 2, 3] }, { a: \"b\" }, { a: \"b\" }])).toEqual([{ a: \"b\" }]);\n      expect(findDuplicates([{ a: \"b\" }, { b: 1, c: 2 }, { c: 2, b: 1 }])).toEqual([{ b: 1, c: 2 }]);\n    });\n    it(\"deeply nested objects\", () => {\n      expect(\n        findDuplicates([\n          { a: { b: { c: [1, { d: 2 }, [3]] } } },\n          2,\n          [3, 4],\n          { b: \"c\" },\n          { a: { b: { c: [1, { d: 2 }, [3]] } } },\n        ])\n      ).toEqual([{ a: { b: { c: [1, { d: 2 }, [3]] } } }]);\n    });\n  });\n  describe(\"correctly does not find duplicates in\", () => {\n    it(\"strings\", () => {\n      expect(findDuplicates([\"a\", \"b\", \"c\"])).toEqual([]);\n    });\n    it(\"numbers\", () => {\n      expect(findDuplicates([1, 2, 3, 4])).toEqual([]);\n      expect(findDuplicates([1, 2, \"1\", \"2\"])).toEqual([]);\n    });\n    it(\"booleans\", () => {\n      expect(findDuplicates([true, false])).toEqual([]);\n      expect(findDuplicates([true, false, \"true\", \"false\"])).toEqual([]);\n    });\n    it(\"arrays\", () => {\n      expect(\n        findDuplicates([\n          [1, 2],\n          [2, 3],\n          [3, 4],\n        ])\n      ).toEqual([]);\n      expect(\n        findDuplicates([\n          [1, 2],\n          [\"1\", \"2\"],\n        ])\n      ).toEqual([]);\n    });\n    it(\"objects\", () => {\n      expect(findDuplicates([{ a: \"b\" }, { b: [1, 2, 3] }])).toEqual([]);\n      expect(findDuplicates([{ a: 1 }, { a: \"1\" }])).toEqual([]);\n    });\n    it(\"Dates\", () => {\n      expect(findDuplicates([new Date(100), new Date(200), new Date(101)])).toEqual([]);\n    });\n    it(\"blobs\", () => {\n      expect(findDuplicates([Uint8Array.of(1, 2, 3), Uint8Array.of(1, 2)])).toEqual([]);\n    });\n    it(\"nulls\", () => {\n      expect(findDuplicates([null, 1])).toEqual([]);\n    });\n    it(\"undefineds\", () => {\n      const arr: Array<any> = [undefined, 1];\n      expect(findDuplicates(arr)).toEqual([]);\n    });\n  });\n  // This is relatively slow and may be flaky if the input size is tuned to let it run reasonably fast\n  it.skip(\"is faster than the naive implementation\", () => {\n    const input: Input[] = [true, false, 1, 2, 3, 4, 5, 6];\n    for (let i = 0; i < 10_000; i++) {\n      input.push({ a: [1, 2, 3, i], b: { nested: [true] } });\n    }\n\n    const uniqueStart = Date.now();\n    expect(findDuplicates(input)).toEqual([]);\n    const uniqueEnd = Date.now();\n    const uniqueDuration = (uniqueEnd - uniqueStart) / 1000;\n\n    console.log(`findDuplicates finished in ${uniqueDuration} seconds`);\n\n    const naiveStart = Date.now();\n    expect(naivefindDuplicates(input)).toEqual([]);\n    const naiveEnd = Date.now();\n    const naiveDuration = (naiveEnd - naiveStart) / 1000;\n\n    console.log(`naivefindDuplicates finished in ${naiveDuration} seconds`);\n\n    expect(naiveDuration).toBeGreaterThan(uniqueDuration);\n  });\n\n  // This isn't even correct! It should be even slower, it just returns the first duplicate!\n  function naivefindDuplicates(input: Array<Input>): Input | undefined {\n    for (let i = 0; i < input.length - 1; i++) {\n      for (let j = i + 1; j < input.length; j++) {\n        if (util.isDeepStrictEqual(input[i], input[j])) {\n          return [input[i]];\n        }\n      }\n    }\n    return [];\n  }\n});\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/unique.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport { createHash } from \"node:crypto\";\nimport * as util from \"node:util\";\n\n/**\n * A shortcut for JSON and Smithy primitives, as well as documents and Smithy-\n * modeled structures composed of those primitives\n */\nexport type Input = { [key: string]: Input } | Array<Input> | Date | Uint8Array | string | number | boolean | null;\n\n/**\n * Returns an array of duplicated values in the input. This is equivalent to using\n * {@link util#isDeepStrictEqual} to compare every member of the input to all the\n * other members, but with an optimization to make the runtime complexity O(n)\n * instead of O(n^2).\n *\n * @param input an array of {@link Input}\n * @return an array containing one instance of every duplicated member of the input,\n *         or an empty array if there are no duplicates\n */\nexport const findDuplicates = (input: Array<Input>): Array<Input> => {\n  const potentialCollisions: { [hash: string]: { value: Input; alreadyFound: boolean }[] } = {};\n  const collisions: Array<Input> = [];\n\n  for (const value of input) {\n    const valueHash = hash(value);\n    if (!potentialCollisions.hasOwnProperty(valueHash)) {\n      potentialCollisions[valueHash] = [{ value: value, alreadyFound: false }];\n    } else {\n      let duplicateFound = false;\n      for (const potentialCollision of potentialCollisions[valueHash]) {\n        if (util.isDeepStrictEqual(value, potentialCollision.value)) {\n          duplicateFound = true;\n          if (!potentialCollision.alreadyFound) {\n            collisions.push(value);\n            potentialCollision.alreadyFound = true;\n          }\n        }\n      }\n      if (!duplicateFound) {\n        potentialCollisions[valueHash].push({ value: value, alreadyFound: false });\n      }\n    }\n  }\n  return collisions;\n};\n\nconst hash = (input: Input): string => {\n  return createHash(\"sha256\").update(canonicalize(input)).digest(\"base64\");\n};\n\n/**\n * Since node's hash functions operate on strings or buffers, we need a canonical format for\n * our objects in order to hash them correctly. This function turns them into string representations\n * where the types are encoded in order to avoid ambiguity, for instance, between the string \"1\" and\n * the number 1. This method sorts object keys lexicographically in order to maintain consistency.\n *\n * This doesn't just call JSON.stringify because we want to have firm control over the ordering of map\n * keys and the handling of blobs and dates\n *\n * @param input a JSON-like object\n * @return a canonical string representation\n */\nconst canonicalize = (input: Input): string => {\n  if (input === undefined) {\n    return \"undefined()\";\n  }\n\n  if (input === null) {\n    return \"null()\";\n  }\n  if (typeof input === \"string\" || typeof input === \"number\" || typeof input === \"boolean\") {\n    return `${typeof input}(${input.toString()})`;\n  }\n  if (Array.isArray(input)) {\n    return \"array(\" + input.map((i) => canonicalize(i)).join(\",\") + \")\";\n  }\n  if (input instanceof Date) {\n    return \"date(\" + input.getTime() + \")\";\n  }\n  if (input instanceof Uint8Array) {\n    // hashing the blob just to avoid allocating another base64 copy of its data\n    return \"blob(\" + createHash(\"sha256\").update(input).digest(\"base64\") + \")\";\n  }\n\n  const contents: Array<string> = [];\n  for (const key of Object.keys(input).slice().sort()) {\n    contents.push(\"key(\" + key + \")->value(\" + canonicalize(input[key]) + \")\");\n  }\n  return \"map(\" + contents.join(\",\") + \")\";\n};\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/validation/index.spec.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport {\n  RequiredValidationFailure,\n  generateValidationMessage,\n  type EnumValidationFailure,\n  type IntegerEnumValidationFailure,\n  type LengthValidationFailure,\n  type PatternValidationFailure,\n  type RangeValidationFailure,\n  type UniqueItemsValidationFailure,\n} from \"./index\";\n\ndescribe(\"message formatting\", () => {\n  it(\"does not return very large inputs\", () => {\n    const failure: PatternValidationFailure = {\n      constraintType: \"pattern\",\n      constraintValues: \"^[a-c]$\",\n      failureValue: \"z\".repeat(1024),\n      path: \"/test\",\n    };\n    expect(generateValidationMessage(failure)).toEqual(\n      \"Value at '/test' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-c]$\"\n    );\n  });\n  it(\"omits null values\", () => {\n    const failure: PatternValidationFailure = {\n      constraintType: \"pattern\",\n      constraintValues: \"^[a-c]$\",\n      failureValue: null,\n      path: \"/test\",\n    };\n    expect(generateValidationMessage(failure)).toEqual(\n      \"Value at '/test' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-c]$\"\n    );\n  });\n  it(\"formats required failures\", () => {\n    const failure = new RequiredValidationFailure(\"/test\");\n    expect(generateValidationMessage(failure)).toEqual(\n      \"Value at '/test' failed to satisfy constraint: Member must not be null\"\n    );\n  });\n  it(\"formats enum failures\", () => {\n    const failure: EnumValidationFailure = {\n      constraintType: \"enum\",\n      constraintValues: [\"banana\", \"apple\"],\n      failureValue: \"pear\",\n      path: \"/test\",\n    };\n    expect(generateValidationMessage(failure)).toEqual(\n      \"Value at '/test' failed to satisfy constraint: Member must satisfy enum value set: [apple, banana]\"\n    );\n  });\n  it(\"formats integer enum failures\", () => {\n    const failure: IntegerEnumValidationFailure = {\n      constraintType: \"integerEnum\",\n      constraintValues: [1, 2],\n      failureValue: 3,\n      path: \"/test\",\n    };\n    expect(generateValidationMessage(failure)).toEqual(\n      \"Value at '/test' failed to satisfy constraint: Member must satisfy enum value set: [1, 2]\"\n    );\n  });\n  describe(\"formats length failures\", () => {\n    it(\"with only min values\", () => {\n      const failure: LengthValidationFailure = {\n        constraintType: \"length\",\n        constraintValues: [7, undefined],\n        failureValue: 3,\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value with length 3 at '/test' failed to satisfy constraint: Member must have length greater than or equal to 7\"\n      );\n    });\n    it(\"with only max values\", () => {\n      const failure: LengthValidationFailure = {\n        constraintType: \"length\",\n        constraintValues: [undefined, 2],\n        failureValue: 3,\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value with length 3 at '/test' failed to satisfy constraint: Member must have length less than or equal to 2\"\n      );\n    });\n    it(\"with min and max values\", () => {\n      const failure: LengthValidationFailure = {\n        constraintType: \"length\",\n        constraintValues: [3, 7],\n        failureValue: 2,\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value with length 2 at '/test' failed to satisfy constraint: Member must have length between 3 and 7, inclusive\"\n      );\n    });\n  });\n  it(\"formats pattern failures\", () => {\n    const failure: PatternValidationFailure = {\n      constraintType: \"pattern\",\n      constraintValues: \"^[a-c]$\",\n      failureValue: \"xyz\",\n      path: \"/test\",\n    };\n    expect(generateValidationMessage(failure)).toEqual(\n      \"Value at '/test' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-c]$\"\n    );\n  });\n  describe(\"formats range failures\", () => {\n    it(\"with only min values\", () => {\n      const failure: RangeValidationFailure = {\n        constraintType: \"range\",\n        constraintValues: [7, undefined],\n        failureValue: 3,\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value at '/test' failed to satisfy constraint: Member must be greater than or equal to 7\"\n      );\n    });\n    it(\"with only max values\", () => {\n      const failure: RangeValidationFailure = {\n        constraintType: \"range\",\n        constraintValues: [undefined, 2],\n        failureValue: 3,\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value at '/test' failed to satisfy constraint: Member must be less than or equal to 2\"\n      );\n    });\n    it(\"with min and max values\", () => {\n      const failure: RangeValidationFailure = {\n        constraintType: \"range\",\n        constraintValues: [3, 7],\n        failureValue: 2,\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value at '/test' failed to satisfy constraint: Member must be between 3 and 7, inclusive\"\n      );\n    });\n    it(\"with unique items\", () => {\n      const failure: UniqueItemsValidationFailure = {\n        constraintType: \"uniqueItems\",\n        failureValue: [5, 9],\n        path: \"/test\",\n      };\n      expect(generateValidationMessage(failure)).toEqual(\n        \"Value at '/test' failed to satisfy constraint: Member must have unique values\"\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/validation/index.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport type { ServiceException } from \"../errors\";\n\nexport * from \"./validators\";\n\ninterface StandardValidationFailure<ConstraintBoundsType, FailureType> {\n  path: string;\n  constraintType: string;\n  constraintValues: ArrayLike<ConstraintBoundsType>;\n  failureValue: FailureType | null;\n}\n\nexport interface EnumValidationFailure extends StandardValidationFailure<string, string> {\n  constraintType: \"enum\";\n  constraintValues: string[];\n}\n\nexport interface IntegerEnumValidationFailure extends StandardValidationFailure<number, number> {\n  constraintType: \"integerEnum\";\n  constraintValues: number[];\n}\n\nexport interface LengthValidationFailure extends StandardValidationFailure<number | undefined, number> {\n  constraintType: \"length\";\n  constraintValues: [number, number] | [undefined, number] | [number, undefined];\n}\n\nexport interface PatternValidationFailure {\n  path: string;\n  constraintType: \"pattern\";\n  constraintValues: string;\n  failureValue: string | null;\n}\n\nexport interface RangeValidationFailure extends StandardValidationFailure<number | undefined, number> {\n  constraintType: \"range\";\n  constraintValues: [number, number] | [undefined, number] | [number, undefined];\n}\n\nexport class RequiredValidationFailure {\n  path: string;\n  constraintType = \"required\" as const;\n\n  constructor(path: string) {\n    this.path = path;\n  }\n}\n\nexport interface UniqueItemsValidationFailure {\n  path: string;\n  constraintType: \"uniqueItems\";\n  failureValue: Array<any> | null;\n}\n\nexport type ValidationFailure =\n  | EnumValidationFailure\n  | IntegerEnumValidationFailure\n  | LengthValidationFailure\n  | PatternValidationFailure\n  | RangeValidationFailure\n  | RequiredValidationFailure\n  | UniqueItemsValidationFailure;\n\nexport interface ValidationContext<O extends string> {\n  operation: O;\n}\n\nexport type ValidationCustomizer<O extends string> = (\n  context: ValidationContext<O>,\n  failures: ValidationFailure[]\n) => ServiceException | undefined;\n\nexport const generateValidationSummary = (failures: readonly ValidationFailure[]): string => {\n  const failingPaths = new Set(failures.map((failure) => failure.path));\n\n  let message = `${failures.length} validation error${failures.length > 1 ? \"s\" : \"\"} `;\n\n  if (failures.length > 1) {\n    message += `at ${failingPaths.size} ` + `path${failingPaths.size > 1 ? \"s\" : \"\"} `;\n  }\n\n  message += \"detected. \";\n\n  if (failures.length > 1) {\n    message += \"First failure: \";\n  }\n\n  return message + generateValidationMessage(failures[0]);\n};\n\nexport const generateValidationMessage = (failure: ValidationFailure): string => {\n  let prefix = \"Value\";\n  let suffix: string;\n  switch (failure.constraintType) {\n    case \"required\": {\n      suffix = \"must not be null\";\n      break;\n    }\n    case \"enum\": {\n      suffix = `must satisfy enum value set: [${failure.constraintValues\n        .sort((a, b) => a.localeCompare(b))\n        .join(\", \")}]`;\n      break;\n    }\n    case \"integerEnum\": {\n      suffix = `must satisfy enum value set: [${failure.constraintValues.sort((a, b) => a - b).join(\", \")}]`;\n      break;\n    }\n    case \"length\": {\n      if (failure.failureValue !== null) {\n        prefix = prefix + \" with length \" + failure.failureValue;\n      }\n      const min = failure.constraintValues[0];\n      const max = failure.constraintValues[1];\n      if (min === undefined) {\n        suffix = `must have length less than or equal to ${max}`;\n      } else if (max === undefined) {\n        suffix = `must have length greater than or equal to ${min}`;\n      } else {\n        suffix = `must have length between ${min} and ${max}, inclusive`;\n      }\n      break;\n    }\n    case \"pattern\": {\n      suffix = `must satisfy regular expression pattern: ${failure.constraintValues}`;\n      break;\n    }\n    case \"range\": {\n      const min = failure.constraintValues[0];\n      const max = failure.constraintValues[1];\n      if (min === undefined) {\n        suffix = `must be less than or equal to ${max}`;\n      } else if (max === undefined) {\n        suffix = `must be greater than or equal to ${min}`;\n      } else {\n        suffix = `must be between ${min} and ${max}, inclusive`;\n      }\n      break;\n    }\n    case \"uniqueItems\": {\n      suffix = \"must have unique values\";\n    }\n  }\n  return `${prefix} at '${failure.path}' failed to satisfy constraint: Member ${suffix}`;\n};\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/validation/validators.spec.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport {\n  CompositeValidator,\n  EnumValidator,\n  IntegerEnumValidator,\n  LengthValidator,\n  PatternValidator,\n  RangeValidator,\n  SensitiveConstraintValidator,\n  UniqueItemsValidator,\n  type SingleConstraintValidator,\n} from \"./validators\";\n\ndescribe(\"sensitive validation\", () => {\n  function sensitize<T, V>(validator: SingleConstraintValidator<T, V>, input: T): V {\n    const failure = new SensitiveConstraintValidator(new CompositeValidator<T>([validator])).validate(input, \"\")[0];\n    return failure as unknown as V;\n  }\n\n  describe(\"strips the failure value from the resultant validation failure\", () => {\n    it(\"with enums\", () => {\n      expect(sensitize(new EnumValidator([\"apple\", \"banana\", \"orange\"], [\"apple\"]), \"pear\").failureValue).toBeNull();\n    });\n    it(\"with integer enums\", () => {\n      expect(sensitize(new IntegerEnumValidator([1, 2, 3]), 0).failureValue).toBeNull();\n    });\n    it(\"with length\", () => {\n      expect(sensitize(new LengthValidator(2, 4), \"pears\").failureValue).toBeNull();\n    });\n    it(\"with ranges\", () => {\n      expect(sensitize(new RangeValidator(2, 4), 7).failureValue).toBeNull();\n    });\n    it(\"with patterns\", () => {\n      expect(sensitize(new PatternValidator(\"^[a-c]+$\"), \"defg\").failureValue).toBeNull();\n    });\n  });\n});\n\ndescribe(\"enum validation\", () => {\n  const enumValidator = new EnumValidator([\"apple\", \"banana\", \"orange\"], [\"apple\", \"banana\"]);\n\n  it(\"does not fail when the enum value is found\", () => {\n    expect(enumValidator.validate(\"apple\", \"fruit\")).toBeNull();\n  });\n\n  it(\"fails when the enum value is not found\", () => {\n    expect(enumValidator.validate(\"kiwi\", \"fruit\")).toEqual({\n      constraintType: \"enum\",\n      constraintValues: [\"apple\", \"banana\"],\n      path: \"fruit\",\n      failureValue: \"kiwi\",\n    });\n  });\n});\n\ndescribe(\"integer enum validation\", () => {\n  const integerEnumValidator = new IntegerEnumValidator([1, 2, 3]);\n\n  it(\"does not fail when the enum value is found\", () => {\n    expect(integerEnumValidator.validate(1, \"test\")).toBeNull();\n  });\n\n  it(\"fails when the enum value is not found\", () => {\n    expect(integerEnumValidator.validate(0, \"test\")).toEqual({\n      constraintType: \"integerEnum\",\n      constraintValues: [1, 2, 3],\n      path: \"test\",\n      failureValue: 0,\n    });\n  });\n});\n\ndescribe(\"length validation\", () => {\n  const threeLengthThings = [\"foo\", { a: 1, b: 2, c: 3 }, [\"a\", \"b\", \"c\"], new Uint8Array([13, 37, 42])];\n\n  for (const value of threeLengthThings) {\n    describe(`for ${JSON.stringify(value)}`, () => {\n      it(\"should succeed with min = 1\", () => {\n        expect(new LengthValidator(1).validate(value, \"aThreeLengthThing\")).toBeNull();\n      });\n      it(\"should succeed with min = 3\", () => {\n        expect(new LengthValidator(3).validate(value, \"aThreeLengthThing\")).toBeNull();\n      });\n      it(\"should succeed with max = 100\", () => {\n        expect(new LengthValidator(undefined, 100).validate(value, \"aThreeLengthThing\")).toBeNull();\n      });\n      it(\"should succeed with max = 3\", () => {\n        expect(new LengthValidator(undefined, 3).validate(value, \"aThreeLengthThing\")).toBeNull();\n      });\n      it(\"should succeed with min = 3 and max = 3\", () => {\n        expect(new LengthValidator(3, 3).validate(value, \"aThreeLengthThing\")).toBeNull();\n      });\n      it(\"should succeed with min = 1 and max = 128\", () => {\n        expect(new LengthValidator(1, 128).validate(value, \"aThreeLengthThing\")).toBeNull();\n      });\n      it(\"should fail with min = 4\", () => {\n        expect(new LengthValidator(4).validate(value, \"aThreeLengthThing\")).toEqual({\n          constraintType: \"length\",\n          constraintValues: [4, undefined],\n          path: \"aThreeLengthThing\",\n          failureValue: 3,\n        });\n      });\n      it(\"should fail with max = 2\", () => {\n        expect(new LengthValidator(undefined, 2).validate(value, \"aThreeLengthThing\")).toEqual({\n          constraintType: \"length\",\n          constraintValues: [undefined, 2],\n          path: \"aThreeLengthThing\",\n          failureValue: 3,\n        });\n      });\n      it(\"should fail with min = 1 and max = 2\", () => {\n        expect(new LengthValidator(1, 2).validate(value, \"aThreeLengthThing\")).toEqual({\n          constraintType: \"length\",\n          constraintValues: [1, 2],\n          path: \"aThreeLengthThing\",\n          failureValue: 3,\n        });\n      });\n    });\n  }\n\n  it(\"properly assesses string length\", () => {\n    expect(new LengthValidator(3, 3).validate(\"👍👍👍\", \"threeEmojis\")).toBeNull();\n  });\n});\n\ndescribe(\"pattern validation\", () => {\n  it(\"does not match the entire string\", () => {\n    const validator = new PatternValidator(\"\\\\w+\");\n    expect(validator.validate(\"hello\", \"aField\")).toBeNull();\n    expect(validator.validate(\"!hello!\", \"aField\")).toBeNull();\n  });\n  it(\"can be anchored\", () => {\n    const validator = new PatternValidator(\"^\\\\w+$\");\n    expect(validator.validate(\"hello\", \"aField\")).toBeNull();\n    expect(validator.validate(\"!hello!\", \"aField\")).toEqual({\n      constraintType: \"pattern\",\n      constraintValues: \"^\\\\w+$\",\n      failureValue: \"!hello!\",\n      path: \"aField\",\n    });\n  });\n  it(\"supports character class expressions\", () => {\n    const validator = new PatternValidator(\"^\\\\p{L}+$\");\n    expect(validator.validate(\"hello\", \"aField\")).toBeNull();\n    expect(validator.validate(\"!hello!\", \"aField\")).toEqual({\n      constraintType: \"pattern\",\n      constraintValues: \"^\\\\p{L}+$\",\n      failureValue: \"!hello!\",\n      path: \"aField\",\n    });\n  });\n  it(\"is not vulnerable to ReDoS\", () => {\n    const validator = new PatternValidator(\"^([0-9]+)+$\");\n    expect(\n      validator.validate(\n        \"000000000000000000000000000000000000000000000000000000000000000000000000000000000000!\",\n        \"aField\"\n      )\n    ).toEqual({\n      constraintType: \"pattern\",\n      constraintValues: \"^([0-9]+)+$\",\n      failureValue: \"000000000000000000000000000000000000000000000000000000000000000000000000000000000000!\",\n      path: \"aField\",\n    });\n  });\n});\n\ndescribe(\"range validation\", () => {\n  it(\"supports min-only constraints\", () => {\n    const validator = new RangeValidator(3);\n    expect(validator.validate(3, \"aField\")).toBeNull();\n    expect(validator.validate(4, \"aField\")).toBeNull();\n    expect(validator.validate(1, \"aField\")).toEqual({\n      constraintType: \"range\",\n      constraintValues: [3, undefined],\n      failureValue: 1,\n      path: \"aField\",\n    });\n  });\n  it(\"supports max-only constraints\", () => {\n    const validator = new RangeValidator(undefined, 3);\n    expect(validator.validate(3, \"aField\")).toBeNull();\n    expect(validator.validate(1, \"aField\")).toBeNull();\n    expect(validator.validate(4, \"aField\")).toEqual({\n      constraintType: \"range\",\n      constraintValues: [undefined, 3],\n      failureValue: 4,\n      path: \"aField\",\n    });\n  });\n  it(\"supports min-max constraints\", () => {\n    const validator = new RangeValidator(3, 5);\n    expect(validator.validate(3, \"aField\")).toBeNull();\n    expect(validator.validate(4, \"aField\")).toBeNull();\n    expect(validator.validate(5, \"aField\")).toBeNull();\n    expect(validator.validate(1, \"aField\")).toEqual({\n      constraintType: \"range\",\n      constraintValues: [3, 5],\n      failureValue: 1,\n      path: \"aField\",\n    });\n    expect(validator.validate(6, \"aField\")).toEqual({\n      constraintType: \"range\",\n      constraintValues: [3, 5],\n      failureValue: 6,\n      path: \"aField\",\n    });\n  });\n});\n\ndescribe(\"uniqueItems\", () => {\n  const validator = new UniqueItemsValidator();\n  describe(\"supports strings\", () => {\n    expect(validator.validate([\"a\", \"b\", \"c\"], \"aField\")).toBeNull();\n    expect(validator.validate([\"a\", \"a\", \"c\", \"a\", \"b\", \"b\"], \"aField\")).toEqual({\n      constraintType: \"uniqueItems\",\n      failureValue: [\"a\", \"b\"],\n      path: \"aField\",\n    });\n  });\n  describe(\"supports numbers\", () => {\n    expect(validator.validate([1, 2, 3], \"aField\")).toBeNull();\n    expect(validator.validate([1, 1, 3, 1, 1, 2.5, 2.5], \"aField\")).toEqual({\n      constraintType: \"uniqueItems\",\n      failureValue: [1, 2.5],\n      path: \"aField\",\n    });\n  });\n  describe(\"supports booleans, I guess\", () => {\n    expect(validator.validate([true, false], \"aField\")).toBeNull();\n    expect(validator.validate([true, false, true], \"aField\")).toEqual({\n      constraintType: \"uniqueItems\",\n      failureValue: [true],\n      path: \"aField\",\n    });\n  });\n  describe(\"supports objects\", () => {\n    expect(validator.validate([{ a: 1 }, { b: 2 }], \"aField\")).toBeNull();\n    expect(validator.validate([{ a: 1 }, { b: 2 }, { a: 1 }], \"aField\")).toEqual({\n      constraintType: \"uniqueItems\",\n      failureValue: [{ a: 1 }],\n      path: \"aField\",\n    });\n  });\n  describe(\"supports undefined values inside objects in lists\", () => {\n    expect(() => validator.validate([{ a: [{ a: undefined }] }], \"aField\")).not.toThrowError();\n    expect(validator.validate([{ a: [{ a: null }] }, { a: [{ a: undefined }] }], \"aField\")).toBeNull();\n    expect(validator.validate([{ a: [{ a: undefined }] }, { a: [{ a: undefined }] }], \"aField\")).toEqual({\n      constraintType: \"uniqueItems\",\n      failureValue: [{ a: [{ a: undefined }] }],\n      path: \"aField\",\n    });\n  });\n});\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/src/validation/validators.ts",
    "content": "/*\n *  Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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 *  A copy of the License is located at\n *\n *   http://aws.amazon.com/apache2.0\n *\n *  or in the \"license\" file accompanying this file. This file is distributed\n *  on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n *  express or implied. See the License for the specific language governing\n *  permissions and limitations under the License.\n */\n\nimport { RE2 } from \"re2-wasm\";\n\nimport {\n  RequiredValidationFailure,\n  type EnumValidationFailure,\n  type IntegerEnumValidationFailure,\n  type LengthValidationFailure,\n  type PatternValidationFailure,\n  type RangeValidationFailure,\n  type UniqueItemsValidationFailure,\n  type ValidationFailure,\n} from \".\";\nimport { findDuplicates } from \"../unique\";\n\nexport class CompositeValidator<T> implements MultiConstraintValidator<T> {\n  private readonly validators: SingleConstraintValidator<T, any>[];\n\n  constructor(validators: SingleConstraintValidator<T, any>[]) {\n    this.validators = validators;\n  }\n\n  validate(input: T | undefined | null, path: string): ValidationFailure[] {\n    const retVal: ValidationFailure[] = [];\n    for (const v of this.validators) {\n      const failure = v.validate(input, path);\n      if (failure) {\n        retVal.push(failure);\n      }\n    }\n    return retVal;\n  }\n}\n\nexport class CompositeStructureValidator<T> implements MultiConstraintValidator<T> {\n  private readonly referenceValidator: MultiConstraintValidator<T>;\n  private readonly structureValidator: (input: T, path: string) => ValidationFailure[];\n\n  constructor(\n    referenceValidator: MultiConstraintValidator<T>,\n    structureValidator: (input: T, path: string) => ValidationFailure[]\n  ) {\n    this.referenceValidator = referenceValidator;\n    this.structureValidator = structureValidator;\n  }\n\n  validate(input: T | undefined | null, path: string): ValidationFailure[] {\n    const retVal: ValidationFailure[] = [];\n    retVal.push(...this.referenceValidator.validate(input, path));\n    if (input !== null && input !== undefined) {\n      retVal.push(...this.structureValidator(input, path));\n    }\n    return retVal;\n  }\n}\n\nexport class CompositeCollectionValidator<T> implements MultiConstraintValidator<Iterable<T>> {\n  private readonly referenceValidator: MultiConstraintValidator<Iterable<T>>;\n  private readonly memberValidator: MultiConstraintValidator<T>;\n\n  constructor(referenceValidator: MultiConstraintValidator<Iterable<T>>, memberValidator: MultiConstraintValidator<T>) {\n    this.referenceValidator = referenceValidator;\n    this.memberValidator = memberValidator;\n  }\n\n  validate(input: Iterable<T> | undefined | null, path: string): ValidationFailure[] {\n    const retVal: ValidationFailure[] = [];\n    retVal.push(...this.referenceValidator.validate(input, path));\n    if (input !== null && input !== undefined) {\n      let i = 0;\n      for (const member of input) {\n        retVal.push(...this.memberValidator.validate(member, `${path}/${i}`));\n        i += 1;\n      }\n    }\n    return retVal;\n  }\n}\n\nexport class CompositeMapValidator<T> implements MultiConstraintValidator<Record<string, T>> {\n  private readonly referenceValidator: MultiConstraintValidator<Record<string, T>>;\n  private readonly keyValidator: MultiConstraintValidator<string>;\n  private readonly valueValidator: MultiConstraintValidator<T>;\n\n  constructor(\n    referenceValidator: MultiConstraintValidator<Record<string, T>>,\n    keyValidator: MultiConstraintValidator<string>,\n    valueValidator: MultiConstraintValidator<T>\n  ) {\n    this.referenceValidator = referenceValidator;\n    this.keyValidator = keyValidator;\n    this.valueValidator = valueValidator;\n  }\n\n  validate(input: Record<string, T> | undefined | null, path: string): ValidationFailure[] {\n    const retVal: ValidationFailure[] = [];\n    retVal.push(...this.referenceValidator.validate(input, path));\n    if (input !== null && input !== undefined) {\n      Object.keys(input).forEach((key) => {\n        const value = input[key];\n        retVal.push(...this.keyValidator.validate(key, path));\n        retVal.push(...this.valueValidator.validate(value, `${path}/${key}`));\n      });\n    }\n    return retVal;\n  }\n}\n\nexport class NoOpValidator implements MultiConstraintValidator<any> {\n  validate(): ValidationFailure[] {\n    return [];\n  }\n}\n\nexport class SensitiveConstraintValidator<T> implements MultiConstraintValidator<T> {\n  private readonly delegate: MultiConstraintValidator<T>;\n\n  constructor(delegate: MultiConstraintValidator<T>) {\n    this.delegate = delegate;\n  }\n\n  validate(input: T, path: string): ValidationFailure[] {\n    return this.delegate.validate(input, path).map((f) => {\n      return {\n        ...f,\n        failureValue: null,\n      };\n    });\n  }\n}\n\nexport interface MultiConstraintValidator<T> {\n  validate(input: T | undefined | null, path: string): ValidationFailure[];\n}\n\nexport interface SingleConstraintValidator<T, F> {\n  validate(input: T | undefined | null, path: string): F | null;\n}\n\nexport class EnumValidator implements SingleConstraintValidator<string, EnumValidationFailure> {\n  private readonly allowedValues: string[];\n  private readonly nonInternalValues: string[];\n\n  constructor(allowedValues: readonly string[], nonInternalValues: readonly string[]) {\n    this.allowedValues = allowedValues.slice();\n    this.nonInternalValues = nonInternalValues.slice();\n  }\n\n  validate(input: string | undefined | null, path: string): EnumValidationFailure | null {\n    if (input === null || input === undefined) {\n      return null;\n    }\n\n    if (this.allowedValues.indexOf(input) < 0) {\n      return {\n        constraintType: \"enum\",\n        constraintValues: this.nonInternalValues.slice(),\n        path: path,\n        failureValue: input,\n      };\n    }\n\n    return null;\n  }\n}\n\nexport class IntegerEnumValidator implements SingleConstraintValidator<number, IntegerEnumValidationFailure> {\n  private readonly allowedValues: number[];\n\n  constructor(allowedValues: readonly number[]) {\n    this.allowedValues = allowedValues.slice();\n  }\n\n  validate(input: number | undefined | null, path: string): IntegerEnumValidationFailure | null {\n    if (input === null || input === undefined) {\n      return null;\n    }\n\n    if (this.allowedValues.indexOf(input) < 0) {\n      return {\n        constraintType: \"integerEnum\",\n        constraintValues: this.allowedValues.slice(),\n        path: path,\n        failureValue: input,\n      };\n    }\n\n    return null;\n  }\n}\n\ntype LengthCheckable = string | { length: number } | Record<string, any>;\n\nexport class LengthValidator implements SingleConstraintValidator<LengthCheckable, LengthValidationFailure> {\n  private readonly min?: number;\n  private readonly max?: number;\n\n  constructor(min?: number, max?: number) {\n    if (min === undefined && max === undefined) {\n      throw new Error(\"Length constraints must have at least a min or a max.\");\n    }\n    this.min = min;\n    this.max = max;\n  }\n\n  validate(input: LengthCheckable | undefined | null, path: string): LengthValidationFailure | null {\n    if (input === null || input === undefined) {\n      return null;\n    }\n\n    let length: number;\n    if (typeof input === \"string\") {\n      length = [...input].length; // string length is defined by the number of code points\n    } else if (LengthValidator.hasLength(input)) {\n      length = input.length;\n    } else {\n      length = Object.keys(input).length;\n    }\n\n    if ((this.min !== undefined && length < this.min) || (this.max !== undefined && length > this.max)) {\n      return {\n        constraintType: \"length\",\n        constraintValues:\n          this.min === undefined\n            ? [undefined, this.max!]\n            : this.max === undefined\n              ? [this.min!, undefined]\n              : [this.min!, this.max!],\n        path: path,\n        failureValue: length,\n      };\n    }\n\n    return null;\n  }\n\n  private static hasLength(obj: any): obj is { length: number } {\n    return obj.hasOwnProperty(\"length\");\n  }\n}\n\nexport class RangeValidator implements SingleConstraintValidator<number, RangeValidationFailure> {\n  private readonly min?: number;\n  private readonly max?: number;\n\n  constructor(min?: number, max?: number) {\n    if (min === undefined && max === undefined) {\n      throw new Error(\"Range constraints must have at least a min or a max.\");\n    }\n    this.min = min;\n    this.max = max;\n  }\n\n  validate(input: number | undefined | null, path: string): RangeValidationFailure | null {\n    if (input === null || input === undefined) {\n      return null;\n    }\n\n    if ((this.min !== undefined && input < this.min) || (this.max !== undefined && input > this.max)) {\n      return {\n        constraintType: \"range\",\n        constraintValues:\n          this.min === undefined\n            ? [undefined, this.max!]\n            : this.max === undefined\n              ? [this.min!, undefined]\n              : [this.min!, this.max!],\n        path: path,\n        failureValue: input,\n      };\n    }\n\n    return null;\n  }\n}\n\nexport class PatternValidator implements SingleConstraintValidator<string, PatternValidationFailure> {\n  private readonly inputPattern: string;\n  private readonly pattern: RE2;\n\n  constructor(pattern: string) {\n    this.inputPattern = pattern;\n    this.pattern = new RE2(pattern, \"u\");\n  }\n\n  validate(input: string | undefined | null, path: string): PatternValidationFailure | null {\n    if (input === null || input === undefined) {\n      return null;\n    }\n\n    if (!this.pattern.test(input)) {\n      return {\n        constraintType: \"pattern\",\n        constraintValues: this.inputPattern,\n        failureValue: input,\n        path: path,\n      };\n    }\n    return null;\n  }\n}\n\nexport class RequiredValidator implements SingleConstraintValidator<any, RequiredValidationFailure> {\n  validate(input: any, path: string): RequiredValidationFailure | null {\n    if (input === null || input === undefined) {\n      return new RequiredValidationFailure(path);\n    }\n    return null;\n  }\n}\n\nexport class UniqueItemsValidator implements SingleConstraintValidator<Array<any>, UniqueItemsValidationFailure> {\n  validate(input: Array<any> | undefined | null, path: string): UniqueItemsValidationFailure | null {\n    if (input === null || input === undefined) {\n      return null;\n    }\n\n    const repeats = findDuplicates(input);\n\n    if (repeats.length > 0) {\n      return {\n        constraintType: \"uniqueItems\",\n        path: path,\n        failureValue: [...repeats].sort(),\n      };\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist/cjs\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"module\": \"ESNext\",\n    \"outDir\": \"dist/es\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"stripInternal\": true,\n    \"removeComments\": true,\n    \"rootDir\": \"src\",\n    \"baseUrl\": \".\"\n  },\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-common/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist/types\",\n    \"emitDeclarationOnly\": true\n  },\n  \"exclude\": [\"test/**/*\", \"dist/types/**/*\"]\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/.gitignore",
    "content": "/node_modules/\n/build/\n/coverage/\n/docs/\n*.tsbuildinfo\n*.tgz\n*.log\npackage-lock.json\nsrc/*.js\ndist/\ntypes/\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/.npmignore",
    "content": "/coverage/\ntsconfig.test.json\n*.tsbuildinfo\njest.config.js\n\n*.spec.js\n*.spec.ts\n*.spec.d.ts\n*.spec.js.map\n\n*.mock.js\n*.mock.d.ts\n*.mock.js.map\n\n*.fixture.js\n*.fixture.d.ts\n*.fixture.js.map\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/CHANGELOG.md",
    "content": "# server-node Changelog\n\n## 1.0.0-alpha.10 (2023-04-18)\n\n## 1.0.0-alpha.9 (2023-03-16)\n\n### Features\n\nModule created.\n\n### Other\n\n- Upgraded to Yarn 3. ([#705](https://github.com/awslabs/smithy-typescript/pull/705))\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/LICENSE",
    "content": "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 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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": "smithy-typescript-ssdk-libs/server-node/README.md",
    "content": "# smithy-typescript/server-node\n\nThis package provides glue code to enable using a server sdk with NodeJS.\n\n## Usage\n\n### Example\n\n```typescript\nimport { IncomingMessage, ServerResponse, createServer } from \"http\";\nimport { convertEvent, convertResponse } from \"@aws-smithy/server-node\";\nimport {\n  SayHelloInput,\n  SayHelloOutput,\n  GreetingService as __GreetingService,\n  getGreetingServiceHandler,\n} from \"@greeting-service/service-greeting\";\nimport { HttpRequest } from \"@smithy/protocol-http\";\n\nclass GreetingService implements __GreetingService {\n  SayHello(input: SayHelloInput, request: HttpRequest): SayHelloOutput {\n    return {\n      greeting: `Hello ${input.name}! How is ${input.city}?`,\n    };\n  }\n}\nconst serviceHandler = getGreetingServiceHandler(new GreetingService());\n\nconst server = createServer(async function (\n  req: IncomingMessage,\n  res: ServerResponse<IncomingMessage> & { req: IncomingMessage }\n) {\n  // Convert NodeJS's http request to an HttpRequest.\n  const httpRequest = convertRequest(req);\n\n  // Call the service handler, which will route the request to the GreetingService\n  // implementation and then serialize the response to an HttpResponse.\n  const httpResponse = await serviceHandler.handle(httpRequest);\n\n  // Write the HttpResponse to NodeJS http's response expected format.\n  return writeResponse(httpResponse, res);\n});\n\nserver.listen(3000);\nconsole.error(\"Listening on port 3000\");\n```\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/jest.config.js",
    "content": "const base = require(\"../../jest.config.base.js\");\n\nmodule.exports = {\n  preset: \"ts-jest\",\n  ...base,\n};\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/package.json",
    "content": "{\n  \"name\": \"@aws-smithy/server-node\",\n  \"version\": \"1.0.0-alpha.10\",\n  \"description\": \"Base components for Smithy services running on NodeJS\",\n  \"main\": \"./dist/cjs/index.js\",\n  \"module\": \"./dist/es/index.js\",\n  \"types\": \"./dist/types/index.d.ts\",\n  \"scripts\": {\n    \"prepublishOnly\": \"yarn build\",\n    \"pretest\": \"yarn build\",\n    \"build\": \"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'\",\n    \"build:cjs\": \"tsc -p tsconfig.cjs.json\",\n    \"build:es\": \"tsc -p tsconfig.es.json\",\n    \"build:types\": \"tsc -p tsconfig.types.json\",\n    \"postbuild\": \"premove dist/types/ts3.4 && downlevel-dts dist/types dist/types/ts3.4\",\n    \"stage-release\": \"premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz\",\n    \"test\": \"jest --passWithNoTests\",\n    \"clean\": \"premove dist\",\n    \"lint\": \"eslint -c ../../.eslintrc.js \\\"src/**/*.ts\\\"\",\n    \"format\": \"prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \\\"**/*.{ts,md,json}\\\"\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/smithy-lang/smithy-typescript.git\",\n    \"directory\": \"smithy-typescript-ssdk-libs/server-node\"\n  },\n  \"author\": \"AWS Smithy Team\",\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"@smithy/protocol-http\": \"workspace:^\",\n    \"@smithy/types\": \"workspace:^\",\n    \"tslib\": \"^1.8.0\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"concurrently\": \"7.0.0\",\n    \"downlevel-dts\": \"^0.7.0\",\n    \"jest\": \"29.7.0\",\n    \"premove\": \"4.0.0\",\n    \"typescript\": \"~5.8.3\"\n  },\n  \"files\": [\n    \"dist/cjs/**/*.js\",\n    \"dist/es/**/*.js\",\n    \"dist/types/**/*.d.ts\",\n    \"!**/*.spec.*\"\n  ],\n  \"engines\": {\n    \"node\": \">=18.0.0\"\n  },\n  \"typesVersions\": {\n    \"<4.0\": {\n      \"dist/types/*\": [\n        \"dist/types/ts3.4/*\"\n      ]\n    }\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/smithy-lang/smithy-typescript/issues\"\n  },\n  \"homepage\": \"https://github.com/smithy-lang/smithy-typescript#readme\",\n  \"publishConfig\": {\n    \"directory\": \".release/package\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/src/index.spec.ts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { mkdtemp } from \"node:fs/promises\";\nimport {\n  createServer,\n  request,\n  type IncomingMessage,\n  type RequestOptions,\n  type Server,\n  type ServerResponse,\n} from \"node:http\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport type { Readable } from \"node:stream\";\n\nimport { convertRequest } from \"./node\";\n\nlet socketPath: string;\nlet promiseResolve: ([req, res]: [IncomingMessage, ServerResponse]) => void;\n\nlet server: Server;\nbeforeAll(async () => {\n  server = createServer(function (req, res) {\n    promiseResolve([req, res]);\n    resToEnd = res;\n  });\n  // Create a temporary named pipe where to run the server and obtain a request\n  socketPath = path.join(await mkdtemp(path.join(os.tmpdir(), \"named-pipe-for-test-\")), \"server\");\n  // TODO Add support to Windows by using '\\\\\\\\?\\\\pipe'\n  // See: https://nodejs.org/api/net.html#identifying-paths-for-ipc-connections\n  server.listen(socketPath);\n});\n\nlet resToEnd: ServerResponse;\n\nfunction getRequest(options: RequestOptions & { body?: string }): Promise<[IncomingMessage, ServerResponse]> {\n  return new Promise((resolve) => {\n    promiseResolve = resolve;\n    request({\n      socketPath,\n      ...options,\n    }).end(Buffer.from(options.body || []));\n  });\n}\n\nafterAll(() => {\n  server?.close();\n});\n\nasync function streamToString(stream: Readable) {\n  const chunks = [];\n\n  for await (const chunk of stream) {\n    chunks.push(Buffer.from(chunk));\n  }\n\n  return Buffer.concat(chunks).toString(\"utf-8\");\n}\n\ndescribe(\"convertRequest\", () => {\n  afterEach(async () => {\n    resToEnd?.end();\n  });\n  it(\"converts a simple GET / correctly\", async () => {\n    const [req] = await getRequest({\n      host: \"example.com\",\n      path: \"/\",\n    });\n\n    const convertedReq = convertRequest(req);\n    expect(convertedReq.hostname).toEqual(\"example.com\");\n    expect(convertedReq.method).toEqual(\"GET\");\n    expect(convertedReq.path).toEqual(\"/\");\n    expect(convertedReq.protocol).toEqual(\"http:\");\n    expect(convertedReq.query).toEqual({});\n    expect(convertedReq.headers).toMatchObject({\n      host: \"example.com\",\n      // From LTS 18 -> 20, the connection header defaults from \"close\" to \"keep-alive\", so don't test explicitly\n    });\n    expect(await streamToString(convertedReq.body)).toEqual(\"\");\n  });\n  it(\"converts a POST with query string correctly\", async () => {\n    const [req] = await getRequest({\n      method: \"POST\",\n      host: \"example.com\",\n      path: \"/some/endpoint?q=hello&a=world\",\n      body: \"hello\",\n    });\n\n    const convertedReq = convertRequest(req);\n    expect(convertedReq.hostname).toEqual(\"example.com\");\n    expect(convertedReq.method).toEqual(\"POST\");\n    expect(convertedReq.path).toEqual(\"/some/endpoint\");\n    expect(convertedReq.protocol).toEqual(\"http:\");\n    expect(convertedReq.query).toEqual({\n      q: \"hello\",\n      a: \"world\",\n    });\n    expect(convertedReq.headers).toMatchObject({\n      host: \"example.com\",\n      \"content-length\": \"5\",\n      // From LTS 18 -> 20, the connection header defaults from \"close\" to \"keep-alive\", so don't test explicitly\n    });\n    expect(await streamToString(convertedReq.body)).toEqual(\"hello\");\n  });\n  it(\"converts OPTIONS CORS requests\", async () => {\n    const [req] = await getRequest({\n      method: \"OPTIONS\",\n      host: \"example.com\",\n      path: \"/some/resource\",\n      headers: {\n        \"Access-Control-Request-Method\": \"DELETE\",\n        \"Access-Control-Request-Headers\": \"origin, x-requested-with\",\n        Origin: \"https://example.com\",\n      },\n    });\n    const convertedReq = convertRequest(req);\n    expect(convertedReq.hostname).toEqual(\"example.com\");\n    expect(convertedReq.method).toEqual(\"OPTIONS\");\n    expect(convertedReq.path).toEqual(\"/some/resource\");\n    expect(convertedReq.protocol).toEqual(\"http:\");\n    expect(convertedReq.query).toEqual({});\n    expect(convertedReq.headers).toMatchObject({\n      \"access-control-request-headers\": \"origin, x-requested-with\",\n      \"access-control-request-method\": \"DELETE\",\n      origin: \"https://example.com\",\n      host: \"example.com\",\n      // From LTS 18 -> 20, the connection header defaults from \"close\" to \"keep-alive\", so don't test explicitly\n    });\n    expect(await streamToString(convertedReq.body)).toEqual(\"\");\n  });\n});\n\n// TODO Implement writeResponse tests\n// describe(\"writeResponse\", () => {\n//   it(\"converts a simple GET / correctly\", async () => {});\n// });\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/src/index.ts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./node\";\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/src/node.ts",
    "content": "/*\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from \"node:http\";\nimport { URL, type URLSearchParams } from \"node:url\";\nimport { HttpRequest, type HeaderBag, type HttpResponse } from \"@smithy/protocol-http\";\nimport type { QueryParameterBag } from \"@smithy/types\";\n\nfunction convertHeaders(headers: IncomingHttpHeaders): HeaderBag {\n  // TODO make this proper\n  return Object.fromEntries(Object.entries(headers).filter((x) => x)) as HeaderBag;\n}\n\nfunction convertQueryString(qs: URLSearchParams): QueryParameterBag {\n  return Object.fromEntries(qs.entries());\n}\n\nexport function convertRequest(req: IncomingMessage): HttpRequest {\n  const url = new URL(req.url || \"\", `http://${req.headers.host}`);\n\n  return new HttpRequest({\n    hostname: url.hostname,\n    method: req.method,\n    path: url.pathname,\n    protocol: url.protocol,\n    query: convertQueryString(url.searchParams),\n    headers: convertHeaders(req.headers),\n    body: req,\n  });\n}\n\nexport function writeResponse(httpResponse: HttpResponse, res: ServerResponse) {\n  if (!httpResponse) {\n    res.statusCode = 500;\n    res.write(\"Error processing request\");\n    res.end();\n    return;\n  }\n  res.statusCode = httpResponse.statusCode;\n  Object.entries(httpResponse.headers).forEach(([key, value]) => res.setHeader(key, value));\n  res.write(httpResponse.body);\n  res.end();\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist/cjs\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"module\": \"ESNext\",\n    \"outDir\": \"dist/es\"\n  }\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"stripInternal\": true,\n    \"removeComments\": true,\n    \"rootDir\": \"src\",\n    \"baseUrl\": \".\",\n    \"lib\": [\"es2019.object\", \"dom\"]\n  },\n  \"include\": [\"src/\"]\n}\n"
  },
  {
    "path": "smithy-typescript-ssdk-libs/server-node/tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig\",\n  \"compilerOptions\": {\n    \"removeComments\": false,\n    \"declaration\": true,\n    \"declarationDir\": \"dist/types\",\n    \"emitDeclarationOnly\": true\n  },\n  \"exclude\": [\"test/**/*\", \"dist/types/**/*\"]\n}\n"
  },
  {
    "path": "testbed/bundlers/.gitignore",
    "content": "node_modules/\ndist-vite/\ndist-esbuild/\ndist-webpack/\ndist-rollup/\npackage-lock.json\n"
  },
  {
    "path": "testbed/bundlers/Makefile",
    "content": ".PHONY: run\n\nrun:\n\tnpm install\n\tnode ./runner/run.mjs\n"
  },
  {
    "path": "testbed/bundlers/applications/NormalizedSchema.ts",
    "content": "export { NormalizedSchema } from \"@smithy/core/schema\";\n"
  },
  {
    "path": "testbed/bundlers/applications/abstract-protocols.ts",
    "content": "export { HttpBindingProtocol, RpcProtocol } from \"@smithy/core/protocols\";\n"
  },
  {
    "path": "testbed/bundlers/applications/cbor-client-aggregate.ts",
    "content": "export { RpcV2Protocol } from \"@smithy/smithy-rpcv2-cbor-schema\";\n"
  },
  {
    "path": "testbed/bundlers/applications/cbor-client.ts",
    "content": "export { RpcV2ProtocolClient, FractionalSecondsCommand } from \"@smithy/smithy-rpcv2-cbor-schema\";\n"
  },
  {
    "path": "testbed/bundlers/applications/cbor-protocol.ts",
    "content": "export { SmithyRpcV2CborProtocol } from \"@smithy/core/cbor\";\n"
  },
  {
    "path": "testbed/bundlers/applications/inactive/.gitkeep",
    "content": ""
  },
  {
    "path": "testbed/bundlers/package.json",
    "content": "{\n  \"type\": \"module\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"acorn\": \"^8.14.0\",\n    \"acorn-walk\": \"^8.3.0\",\n    \"esbuild\": \"^0.25.0\",\n    \"ts-loader\": \"^9.5.0\",\n    \"typescript\": \"~5.8.0\",\n    \"vite\": \"^6.0.0\",\n    \"webpack\": \"^5.90.0\"\n  }\n}\n"
  },
  {
    "path": "testbed/bundlers/runner/bundler-output-analysis.cjs",
    "content": "const { parse } = require(\"acorn\");\nconst walk = require(\"acorn-walk\");\n\nconst MODULE = \"module\";\nconst BUFFER = \"Buffer\";\nconst TYPEOF = \"typeof\";\nconst LOGICAL_AND = \"&&\";\nconst NOT = \"!\";\nconst IDENTIFIER = \"Identifier\";\nconst UNARY_EXPRESSION = \"UnaryExpression\";\nconst BINARY_EXPRESSION = \"BinaryExpression\";\nconst LOGICAL_EXPRESSION = \"LogicalExpression\";\nconst MEMBER_EXPRESSION = \"MemberExpression\";\nconst OBJECT_PATTERN = \"ObjectPattern\";\nconst ARRAY_PATTERN = \"ArrayPattern\";\nconst REST_ELEMENT = \"RestElement\";\nconst ASSIGNMENT_PATTERN = \"AssignmentPattern\";\nconst FUNCTION_DECLARATION = \"FunctionDeclaration\";\nconst FUNCTION_EXPRESSION = \"FunctionExpression\";\nconst ARROW_FUNCTION_EXPRESSION = \"ArrowFunctionExpression\";\n\n/**\n * Detects unguarded references to the global `Buffer` identifier in bundled code.\n *\n * Guarded means the reference is inside a `typeof Buffer` check, a variable\n * derived from such a check (e.g. `USE_BUFFER`), or a polyfill assignment scope.\n *\n * @param {string} code - bundle source text.\n * @returns {{ line: number, column: number }[]} unguarded global Buffer references.\n * @internal\n */\nfunction findGlobalBufferRefs(code) {\n  const ast = parse(code, {\n    ecmaVersion: 2022,\n    sourceType: MODULE,\n    allowHashBang: true,\n    locations: true,\n  });\n\n  const polyfillRanges = collectPolyfillRanges(ast);\n  const guardedRanges = collectGuardedRanges(ast);\n  const typeofArgPositions = collectTypeofArgPositions(ast);\n\n  // Scope-aware walk: track local declarations to distinguish global Buffer.\n  const scopeStack = [new Set()];\n  const globalRefs = [];\n\n  function isDeclared(name) {\n    for (let i = scopeStack.length - 1; i >= 0; --i) {\n      if (scopeStack[i].has(name)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  function isGuarded(node) {\n    for (let i = 0; i < guardedRanges.length; ++i) {\n      const r = guardedRanges[i];\n      if (node.start >= r.start && node.end <= r.end) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  function isInPolyfill(node) {\n    for (let i = 0; i < polyfillRanges.length; ++i) {\n      const r = polyfillRanges[i];\n      if (node.start >= r.start && node.end <= r.end) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  walk.recursive(ast, null, {\n    FunctionDeclaration(node, state, c) {\n      if (node.id) {\n        scopeStack[scopeStack.length - 1].add(node.id.name);\n      }\n      const scope = new Set();\n      scopeStack.push(scope);\n      for (let i = 0; i < node.params.length; ++i) {\n        extractBindings(node.params[i], scope);\n      }\n      c(node.body, state);\n      scopeStack.pop();\n    },\n    FunctionExpression(node, state, c) {\n      const scope = new Set();\n      scopeStack.push(scope);\n      if (node.id) {\n        scope.add(node.id.name);\n      }\n      for (let i = 0; i < node.params.length; ++i) {\n        extractBindings(node.params[i], scope);\n      }\n      c(node.body, state);\n      scopeStack.pop();\n    },\n    ArrowFunctionExpression(node, state, c) {\n      const scope = new Set();\n      scopeStack.push(scope);\n      for (let i = 0; i < node.params.length; ++i) {\n        extractBindings(node.params[i], scope);\n      }\n      c(node.body, state);\n      scopeStack.pop();\n    },\n    BlockStatement(node, state, c) {\n      scopeStack.push(new Set());\n      for (let i = 0; i < node.body.length; ++i) {\n        c(node.body[i], state);\n      }\n      scopeStack.pop();\n    },\n    ForStatement(node, state, c) {\n      scopeStack.push(new Set());\n      if (node.init) {\n        c(node.init, state);\n      }\n      if (node.test) {\n        c(node.test, state);\n      }\n      if (node.update) {\n        c(node.update, state);\n      }\n      c(node.body, state);\n      scopeStack.pop();\n    },\n    VariableDeclaration(node, state, c) {\n      const scope = scopeStack[scopeStack.length - 1];\n      for (let i = 0; i < node.declarations.length; ++i) {\n        const decl = node.declarations[i];\n        extractBindings(decl.id, scope);\n        if (decl.init) {\n          c(decl.init, state);\n        }\n      }\n    },\n    CatchClause(node, state, c) {\n      const scope = new Set();\n      scopeStack.push(scope);\n      if (node.param) {\n        extractBindings(node.param, scope);\n      }\n      c(node.body, state);\n      scopeStack.pop();\n    },\n    Identifier(node) {\n      if (\n        node.name === BUFFER &&\n        !isDeclared(BUFFER) &&\n        !typeofArgPositions.has(node.start) &&\n        !isGuarded(node) &&\n        !isInPolyfill(node)\n      ) {\n        globalRefs.push({ line: node.loc.start.line, column: node.loc.start.column });\n      }\n    },\n    MemberExpression(node, state, c) {\n      c(node.object, state);\n      if (node.computed) {\n        c(node.property, state);\n      }\n    },\n  });\n\n  return globalRefs;\n}\n\n/**\n * Collects ranges of functions that assign to Buffer (polyfill code).\n */\nfunction collectPolyfillRanges(ast) {\n  const ranges = [];\n  walk.ancestor(ast, {\n    AssignmentExpression(node, ancestors) {\n      if (isBufferAssignTarget(node.left)) {\n        const fn = findEnclosingFunction(ancestors);\n        if (fn) {\n          ranges.push({ start: fn.start, end: fn.end });\n        }\n      }\n    },\n    VariableDeclarator(node, ancestors) {\n      if (node.id.type === IDENTIFIER && node.id.name === BUFFER) {\n        const fn = findEnclosingFunction(ancestors);\n        if (fn) {\n          ranges.push({ start: fn.start, end: fn.end });\n        }\n      }\n    },\n  });\n  return ranges;\n}\n\n/**\n * Collects AST ranges protected by typeof Buffer checks or derived variables.\n */\nfunction collectGuardedRanges(ast) {\n  // Variables assigned from typeof Buffer expressions (e.g. USE_BUFFER).\n  const typeofBufferVars = new Set();\n  walk.simple(ast, {\n    VariableDeclarator(node) {\n      if (node.id.type === IDENTIFIER && node.init && containsTypeofBuffer(node.init)) {\n        typeofBufferVars.add(node.id.name);\n      }\n    },\n  });\n\n  function isTypeofBufferVar(node) {\n    if (node.type === IDENTIFIER && typeofBufferVars.has(node.name)) {\n      return true;\n    }\n    if (node.type === UNARY_EXPRESSION && node.operator === NOT && isTypeofBufferVar(node.argument)) {\n      return true;\n    }\n    return false;\n  }\n\n  const ranges = [];\n  walk.simple(ast, {\n    ConditionalExpression(node) {\n      if (containsTypeofBuffer(node.test) || isTypeofBufferVar(node.test)) {\n        ranges.push(node);\n      }\n    },\n    IfStatement(node) {\n      if (containsTypeofBuffer(node.test) || isTypeofBufferVar(node.test)) {\n        ranges.push(node);\n      }\n    },\n    LogicalExpression(node) {\n      if (node.operator === LOGICAL_AND && (containsTypeofBuffer(node.left) || isTypeofBufferVar(node.left))) {\n        ranges.push(node);\n      }\n    },\n  });\n  return ranges;\n}\n\n/**\n * Collects start positions of Buffer identifiers used as typeof operands.\n * These are not actual references to the Buffer value.\n */\nfunction collectTypeofArgPositions(ast) {\n  const positions = new Set();\n  walk.simple(ast, {\n    UnaryExpression(node) {\n      if (node.operator === TYPEOF && node.argument.type === IDENTIFIER && node.argument.name === BUFFER) {\n        positions.add(node.argument.start);\n      }\n    },\n  });\n  return positions;\n}\n\nfunction extractBindings(pattern, scope) {\n  if (!pattern) {\n    return;\n  }\n  switch (pattern.type) {\n    case IDENTIFIER:\n      scope.add(pattern.name);\n      break;\n    case OBJECT_PATTERN:\n      for (let i = 0; i < pattern.properties.length; ++i) {\n        extractBindings(pattern.properties[i].value || pattern.properties[i].argument, scope);\n      }\n      break;\n    case ARRAY_PATTERN:\n      for (let i = 0; i < pattern.elements.length; ++i) {\n        if (pattern.elements[i]) {\n          extractBindings(pattern.elements[i], scope);\n        }\n      }\n      break;\n    case REST_ELEMENT:\n      extractBindings(pattern.argument, scope);\n      break;\n    case ASSIGNMENT_PATTERN:\n      extractBindings(pattern.left, scope);\n      break;\n  }\n}\n\nfunction isBufferAssignTarget(node) {\n  if (node.type === IDENTIFIER && node.name === BUFFER) {\n    return true;\n  }\n  if (node.type === MEMBER_EXPRESSION) {\n    if (node.object.type === IDENTIFIER && node.object.name === BUFFER) {\n      return true;\n    }\n    if (node.property.type === IDENTIFIER && node.property.name === BUFFER) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction containsTypeofBuffer(node) {\n  if (\n    node.type === UNARY_EXPRESSION &&\n    node.operator === TYPEOF &&\n    node.argument.type === IDENTIFIER &&\n    node.argument.name === BUFFER\n  ) {\n    return true;\n  }\n  if (node.type === BINARY_EXPRESSION || node.type === LOGICAL_EXPRESSION) {\n    return containsTypeofBuffer(node.left) || containsTypeofBuffer(node.right);\n  }\n  return false;\n}\n\nfunction findEnclosingFunction(ancestors) {\n  for (let i = ancestors.length - 1; i >= 0; --i) {\n    const t = ancestors[i].type;\n    if (t === FUNCTION_DECLARATION || t === FUNCTION_EXPRESSION || t === ARROW_FUNCTION_EXPRESSION) {\n      return ancestors[i];\n    }\n  }\n  return null;\n}\n\nmodule.exports = { findGlobalBufferRefs };\n"
  },
  {
    "path": "testbed/bundlers/runner/run.mjs",
    "content": "import { execSync } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n\n\n\n\nconst require = createRequire(import.meta.url);\nconst webpack = require(\"webpack\");\nconst { build: viteBuild } = await import(\"vite\");\nconst esbuild = require(\"esbuild\");\nconst { findGlobalBufferRefs } = require(\"./bundler-output-analysis.cjs\");\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst root = path.join(__dirname, \"..\");\nconst applicationFolder = path.join(root, \"applications\");\nconst distDir = path.join(root, \"dist\");\n\n// Clean dist\nfs.rmSync(path.join(root, \"dist-vite\"), { recursive: true, force: true });\nfs.rmSync(path.join(root, \"dist-esbuild\"), { recursive: true, force: true });\nfs.rmSync(path.join(root, \"dist-webpack\"), { recursive: true, force: true });\nfs.rmSync(path.join(root, \"dist-rollup\"), { recursive: true, force: true });\n\nfs.mkdirSync(path.join(root, \"dist-vite\"), { recursive: true });\nfs.mkdirSync(path.join(root, \"dist-esbuild\"), { recursive: true });\nfs.mkdirSync(path.join(root, \"dist-webpack\"), { recursive: true });\n\nconst apps = fs.readdirSync(applicationFolder).filter((f) => f.endsWith(\".ts\") || f.endsWith(\".mjs\"));\n\nlet failed = false;\n\nfor (const app of apps) {\n  const entry = path.join(applicationFolder, app);\n  const baseName = app.replace(/\\.[^.]+$/, \"\");\n  console.log(`\\n${\"=\".repeat(60)}`);\n  console.log(`Application: ${app}`);\n  console.log(`${\"=\".repeat(60)}`);\n\n  // --- Vite (UMD, no minify, readable) ---\n  const viteOutDir = path.join(root, \"dist-vite\");\n  const viteOutFile = path.join(viteOutDir, `${baseName}.umd.cjs`);\n  try {\n    await viteBuild({\n      logLevel: \"silent\",\n      resolve: { conditions: [\"browser\", \"module\", \"import\"] },\n      build: {\n        outDir: viteOutDir,\n        lib: { entry, name: \"dist\", fileName: baseName, formats: [\"umd\"] },\n        minify: false,\n        sourcemap: false,\n        emptyOutDir: false,\n        rollupOptions: {\n          output: { inlineDynamicImports: true },\n          treeshake: true,\n        },\n      },\n    });\n    console.log(`\\n  Vite: ${byteSize(fs.statSync(viteOutFile).size)}`);\n    validateBundle(\"vite\", viteOutFile);\n  } catch (e) {\n    console.error(`  Vite: ❌ FAIL: build error: ${e.message}`);\n    failed = true;\n  }\n\n  // --- esbuild (ESM, no minify, readable) ---\n  const esbuildOutFile = path.join(root, \"dist-esbuild\", `${baseName}.mjs`);\n  try {\n    await esbuild.build({\n      entryPoints: [entry],\n      platform: \"browser\",\n      bundle: true,\n      minify: false,\n      treeShaking: true,\n      mainFields: [\"browser\", \"module\", \"main\"],\n      conditions: [\"browser\", \"import\"],\n      outfile: esbuildOutFile,\n      format: \"esm\",\n      target: \"es2022\",\n    });\n    console.log(`  esbuild: ${byteSize(fs.statSync(esbuildOutFile).size)}`);\n    validateBundle(\"esbuild\", esbuildOutFile);\n  } catch (e) {\n    console.error(`  esbuild: ❌ FAIL: build error: ${e.message}`);\n    failed = true;\n  }\n\n  // --- Webpack (UMD, no minify, readable) ---\n  const webpackOutFile = path.join(root, \"dist-webpack\", `${baseName}.js`);\n  try {\n    await new Promise((resolve, reject) => {\n      webpack(\n        {\n          mode: \"development\",\n          devtool: false,\n          entry,\n          target: \"web\",\n          resolve: {\n            extensions: [\".ts\", \".js\", \".mjs\"],\n            conditionNames: [\"browser\", \"import\", \"module\", \"default\"],\n            aliasFields: [\"browser\"],\n          },\n          output: {\n            path: path.dirname(webpackOutFile),\n            filename: path.basename(webpackOutFile),\n            library: { type: \"umd\", name: \"dist\" },\n          },\n          optimization: { minimize: false, usedExports: true },\n          module: {\n            rules: [\n              {\n                test: /\\.ts$/,\n                use: { loader: \"ts-loader\", options: { transpileOnly: true } },\n                exclude: /node_modules/,\n              },\n            ],\n          },\n        },\n        (err, stats) => {\n          if (err) return reject(err);\n          if (stats.hasErrors()) return reject(new Error(stats.toString({ errors: true })));\n          resolve();\n        }\n      );\n    });\n    console.log(`  Webpack: ${byteSize(fs.statSync(webpackOutFile).size)}`);\n    validateBundle(\"webpack\", webpackOutFile);\n  } catch (e) {\n    console.error(`  Webpack: ❌ FAIL: build error: ${e.message.split(\"\\n\").slice(0, 3).join(\"\\n\")}`);\n    failed = true;\n  }\n}\n\nconsole.log(`\\n${\"=\".repeat(60)}`);\nif (failed) {\n  console.error(\"❌ Bundler check FAILED\");\n  process.exit(1);\n} else {\n  console.log(\"✅ Bundler check PASSED\");\n}\n\nfunction validateBundle(bundler, filePath) {\n  const content = fs.readFileSync(filePath, \"utf-8\");\n\n  // Check for node: protocol references\n  const nodeImports = content.match(/[\"']node:[^\"']+[\"']/g) || [];\n  const nodeRequires = content.match(/require\\([\"']node:[^\"']+[\"']\\)/g) || [];\n  const allNodeRefs = [...new Set([...nodeImports, ...nodeRequires])];\n\n  if (allNodeRefs.length > 0) {\n    console.error(`  ${bundler}: ❌ FAIL: node: protocol references: ${allNodeRefs.join(\", \")}`);\n    failed = true;\n  } else {\n    console.log(`  ${bundler}: ✅ PASS: No node: protocol references`);\n  }\n\n  // Check for node-only code marker\n  const nodeOnlyMatches = content.match(/\\w+\\s*=\\s*Symbol\\.for\\([\"']node-only[\"']\\)/g) || [];\n  if (nodeOnlyMatches.length > 3) {\n    console.error(`  ${bundler}: ❌ FAIL: ${nodeOnlyMatches.length}/3 Symbol.for(\"node-only\") occurrence(s) — node-only code not fully tree-shaken`);\n    failed = true;\n  } else if (nodeOnlyMatches.length > 0) {\n    console.log(`  ${bundler}: ⚠️  ${nodeOnlyMatches.length}/3 Symbol.for(\"node-only\") occurrence(s) — node-only code not fully tree-shaken`);\n  }\n\n  // AST-based global Buffer check\n  const globalBufferRefs = findGlobalBufferRefs(content);\n  if (globalBufferRefs.length > 0) {\n    console.error(`  ${bundler}: ❌ FAIL: ${globalBufferRefs.length} unguarded global Buffer reference(s)`);\n    for (const ref of globalBufferRefs.slice(0, 3)) {\n      const line = content.split(\"\\n\")[ref.line - 1]?.trim().slice(0, 120);\n      console.error(`    L${ref.line}: ${line}`);\n    }\n    if (globalBufferRefs.length > 3) console.error(`    ... and ${globalBufferRefs.length - 3} more`);\n    failed = true;\n  } else {\n    console.log(`  ${bundler}: ✅ PASS: No unguarded global Buffer references`);\n  }\n}\n\nfunction byteSize(num) {\n  if (num > 1024 ** 2) return ((((num / 1024 ** 2) * 1000) | 0) / 1000).toLocaleString() + \" MB\";\n  if (num > 1024) return ((num / 1024) | 0).toLocaleString() + \" KB\";\n  return num.toLocaleString() + \" B\";\n}\n"
  },
  {
    "path": "tsconfig.cjs.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"importHelpers\": true,\n    \"module\": \"commonjs\",\n    \"noEmitHelpers\": false,\n    \"target\": \"es2022\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "tsconfig.es.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"importHelpers\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"noEmitHelpers\": false,\n    \"target\": \"es2022\",\n    \"noCheck\": true\n  }\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"downlevelIteration\": true,\n    \"esModuleInterop\": true,\n    \"incremental\": true,\n    \"lib\": [\"es2015\", \"dom\"],\n    \"module\": \"commonjs\",\n    \"moduleResolution\": \"node\",\n    \"noFallthroughCasesInSwitch\": true,\n    \"paths\": {\n      \"@aws-smithy/*\": [\"smithy-typescript-ssdk-libs/*/src\"],\n      \"@smithy/*\": [\"packages/*/src\"]\n    },\n    \"preserveConstEnums\": true,\n    \"removeComments\": true,\n    \"resolveJsonModule\": true,\n    \"target\": \"es5\",\n    \"useUnknownInCatchVariables\": false,\n    \"experimentalDecorators\": true,\n    \"jsx\": \"react\",\n    \"jsxFactory\": \"JSX.createElement\",\n    \"jsxFragmentFactory\": \"JSX.Fragment\"\n  },\n  \"include\": [\"packages/\", \"smithy-typescript-ssdk-libs/\"],\n  \"exclude\": [\"node_modules/\", \"**/*.spec.ts\", \"vitest.*\"]\n}\n"
  },
  {
    "path": "tsconfig.test.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"noEmit\": true,\n    \"noCheck\": false,\n    \"skipLibCheck\": true\n  },\n  \"extends\": \"./tsconfig.types.json\",\n  \"include\": [\"packages/**/*.spec.ts\", \"private/**/*.spec.ts\"],\n  \"exclude\": [\n    \"node_modules/\",\n    \"node_modules\",\n    \"vitest.*.ts\"\n  ]\n}\n"
  },
  {
    "path": "tsconfig.types.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"removeComments\": false,\n    \"strict\": true\n  }\n}\n"
  },
  {
    "path": "turbo.json",
    "content": "{\n  \"$schema\": \"https://turborepo.org/schema.json\",\n  \"tasks\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"inputs\": [\"src/**/*\", \"package.json\"],\n      \"outputs\": [\"dist-types/**\", \"dist-cjs/**\", \"dist-es/**\", \"dist\"]\n    },\n    \"test\": {\n      \"dependsOn\": [\"build\", \"^build\"],\n      \"cache\": false\n    },\n    \"test:integration\": {\n      \"dependsOn\": [\"build\", \"^build\"],\n      \"cache\": false\n    },\n    \"lint\": {\n      \"outputs\": []\n    },\n    \"format\": {\n      \"outputs\": []\n    },\n    \"clean\": {\n      \"cache\": false\n    },\n    \"extract:docs\": {\n      \"dependsOn\": [\"build\"],\n      \"cache\": false\n    },\n    \"stage-release\": {\n      \"dependsOn\": [\"build\"]\n    }\n  }\n}\n"
  },
  {
    "path": "vitest.config.browser.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"node_modules\"],\n    include: [\"{packages,private}/**/*.browser.spec.ts\"],\n    environment: \"happy-dom\",\n  },\n});\n"
  },
  {
    "path": "vitest.config.integ.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\"node_modules\", \"**/*.{e2e,browser}.spec.ts\"],\n    include: [\"{packages,private}/**/*.integ.spec.ts\"],\n    environment: \"node\",\n  },\n});\n"
  },
  {
    "path": "vitest.config.mts",
    "content": "import { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n  test: {\n    exclude: [\n      \"node_modules\",\n      \"**/*.{integ,e2e,browser}.spec.ts\",\n      \"smithy-typescript-ssdk-libs\",\n      \"packages/types\",\n      \"packages/util-defaults-mode-browser\",\n    ],\n    include: [\"packages/**/*.spec.ts\", \"private/**/*.spec.ts\"],\n    environment: \"node\",\n    globals: true,\n  },\n});\n"
  }
]